ontologyviewer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja.md +166 -0
  3. package/README.md +169 -0
  4. package/THIRD_PARTY_NOTICES.md +49 -0
  5. package/dist/index.d.ts +14 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/locale.d.ts +34 -0
  8. package/dist/locale.d.ts.map +1 -0
  9. package/dist/meta.json +7246 -0
  10. package/dist/ontologyviewer.css +211 -0
  11. package/dist/ontologyviewer.esm.min.mjs +221 -0
  12. package/dist/ontologyviewer.esm.min.mjs.LEGAL.txt +31 -0
  13. package/dist/ontologyviewer.esm.min.mjs.map +7 -0
  14. package/dist/ontologyviewer.esm.mjs +47748 -0
  15. package/dist/ontologyviewer.esm.mjs.LEGAL.txt +31 -0
  16. package/dist/ontologyviewer.esm.mjs.map +7 -0
  17. package/dist/persistence.d.ts +18 -0
  18. package/dist/persistence.d.ts.map +1 -0
  19. package/dist/rdf/appearance.d.ts +23 -0
  20. package/dist/rdf/appearance.d.ts.map +1 -0
  21. package/dist/rdf/graphModel.d.ts +25 -0
  22. package/dist/rdf/graphModel.d.ts.map +1 -0
  23. package/dist/rdf/opExtensions.d.ts +9 -0
  24. package/dist/rdf/opExtensions.d.ts.map +1 -0
  25. package/dist/rdf/parser.d.ts +22 -0
  26. package/dist/rdf/parser.d.ts.map +1 -0
  27. package/dist/rdf/rdfList.d.ts +6 -0
  28. package/dist/rdf/rdfList.d.ts.map +1 -0
  29. package/dist/rdf/schemaModel.d.ts +63 -0
  30. package/dist/rdf/schemaModel.d.ts.map +1 -0
  31. package/dist/rdf/vocabulary.d.ts +82 -0
  32. package/dist/rdf/vocabulary.d.ts.map +1 -0
  33. package/dist/search.d.ts +11 -0
  34. package/dist/search.d.ts.map +1 -0
  35. package/dist/theme.d.ts +6 -0
  36. package/dist/theme.d.ts.map +1 -0
  37. package/dist/types.d.ts +64 -0
  38. package/dist/types.d.ts.map +1 -0
  39. package/dist/viewer.d.ts +3 -0
  40. package/dist/viewer.d.ts.map +1 -0
  41. package/dist/viewport.d.ts +8 -0
  42. package/dist/viewport.d.ts.map +1 -0
  43. package/package.json +91 -0
@@ -0,0 +1,221 @@
1
+ var jC=Object.create;var Tc=Object.defineProperty;var ZC=Object.getOwnPropertyDescriptor;var QC=Object.getOwnPropertyNames;var JC=Object.getPrototypeOf,eS=Object.prototype.hasOwnProperty;var Jn=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var F=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var tS=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of QC(e))!eS.call(t,a)&&a!==r&&Tc(t,a,{get:()=>e[a],enumerable:!(n=ZC(e,a))||n.enumerable});return t};var bo=(t,e,r)=>(r=t!=null?jC(JC(t)):{},tS(e||!t||!t.__esModule?Tc(r,"default",{value:t,enumerable:!0}):r,t));var hl=F((Si,cl)=>{(function(e,r){typeof Si=="object"&&typeof cl=="object"?cl.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Si=="object"?Si.layoutBase=r():e.layoutBase=r()})(Si,function(){return(function(t){var e={};function r(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=t,r.c=e,r.i=function(n){return n},r.d=function(n,a,i){r.o(n,a)||Object.defineProperty(n,a,{configurable:!1,enumerable:!0,get:i})},r.n=function(n){var a=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(a,"a",a),a},r.o=function(n,a){return Object.prototype.hasOwnProperty.call(n,a)},r.p="",r(r.s=28)})([(function(t,e,r){"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,t.exports=n}),(function(t,e,r){"use strict";var n=r(2),a=r(8),i=r(9);function o(l,u,f){n.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=l,this.target=u}o.prototype=Object.create(n.prototype);for(var s in n)o[s]=n[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(l){if(this.source===l)return this.target;if(this.target===l)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(l,u){for(var f=this.getOtherEnd(l),c=u.getGraphManager().getRoot();;){if(f.getOwner()==u)return f;if(f.getOwner()==c)break;f=f.getOwner().getParent()}return null},o.prototype.updateLength=function(){var l=new Array(4);this.isOverlapingSourceAndTarget=a.getIntersection(this.target.getRect(),this.source.getRect(),l),this.isOverlapingSourceAndTarget||(this.lengthX=l[0]-l[2],this.lengthY=l[1]-l[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.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=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=o}),(function(t,e,r){"use strict";function n(a){this.vGraphObject=a}t.exports=n}),(function(t,e,r){"use strict";var n=r(2),a=r(10),i=r(13),o=r(0),s=r(16),l=r(5);function u(c,h,d,v){d==null&&v==null&&(v=h),n.call(this,v),c.graphManager!=null&&(c=c.graphManager),this.estimatedSize=a.MIN_VALUE,this.inclusionTreeDepth=a.MAX_VALUE,this.vGraphObject=v,this.edges=[],this.graphManager=c,d!=null&&h!=null?this.rect=new i(h.x,h.y,d.width,d.height):this.rect=new i}u.prototype=Object.create(n.prototype);for(var f in n)u[f]=n[f];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(c){this.rect.width=c},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(c){this.rect.height=c},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(c,h){this.rect.x=c.x,this.rect.y=c.y,this.rect.width=h.width,this.rect.height=h.height},u.prototype.setCenter=function(c,h){this.rect.x=c-this.rect.width/2,this.rect.y=h-this.rect.height/2},u.prototype.setLocation=function(c,h){this.rect.x=c,this.rect.y=h},u.prototype.moveBy=function(c,h){this.rect.x+=c,this.rect.y+=h},u.prototype.getEdgeListToNode=function(c){var h=[],d,v=this;return v.edges.forEach(function(p){if(p.target==c){if(p.source!=v)throw"Incorrect edge source!";h.push(p)}}),h},u.prototype.getEdgesBetween=function(c){var h=[],d,v=this;return v.edges.forEach(function(p){if(!(p.source==v||p.target==v))throw"Incorrect edge source and/or target";(p.target==c||p.source==c)&&h.push(p)}),h},u.prototype.getNeighborsList=function(){var c=new Set,h=this;return h.edges.forEach(function(d){if(d.source==h)c.add(d.target);else{if(d.target!=h)throw"Incorrect incidency!";c.add(d.source)}}),c},u.prototype.withChildren=function(){var c=new Set,h,d;if(c.add(this),this.child!=null)for(var v=this.child.getNodes(),p=0;p<v.length;p++)h=v[p],d=h.withChildren(),d.forEach(function(m){c.add(m)});return c},u.prototype.getNoOfChildren=function(){var c=0,h;if(this.child==null)c=1;else for(var d=this.child.getNodes(),v=0;v<d.length;v++)h=d[v],c+=h.getNoOfChildren();return c==0&&(c=1),c},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==a.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.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)},u.prototype.scatter=function(){var c,h,d=-o.INITIAL_WORLD_BOUNDARY,v=o.INITIAL_WORLD_BOUNDARY;c=o.WORLD_CENTER_X+s.nextDouble()*(v-d)+d;var p=-o.INITIAL_WORLD_BOUNDARY,m=o.INITIAL_WORLD_BOUNDARY;h=o.WORLD_CENTER_Y+s.nextDouble()*(m-p)+p,this.rect.x=c,this.rect.y=h},u.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var c=this.getChild();if(c.updateBounds(!0),this.rect.x=c.getLeft(),this.rect.y=c.getTop(),this.setWidth(c.getRight()-c.getLeft()),this.setHeight(c.getBottom()-c.getTop()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var h=c.getRight()-c.getLeft(),d=c.getBottom()-c.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(h+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>h?(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(h+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(d+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>d?(this.rect.y-=(this.labelHeight-d)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(d+this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==a.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(c){var h=this.rect.x;h>o.WORLD_BOUNDARY?h=o.WORLD_BOUNDARY:h<-o.WORLD_BOUNDARY&&(h=-o.WORLD_BOUNDARY);var d=this.rect.y;d>o.WORLD_BOUNDARY?d=o.WORLD_BOUNDARY:d<-o.WORLD_BOUNDARY&&(d=-o.WORLD_BOUNDARY);var v=new l(h,d),p=c.inverseTransformPoint(v);this.setLocation(p.x,p.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},t.exports=u}),(function(t,e,r){"use strict";var n=r(0);function a(){}for(var i in n)a[i]=n[i];a.MAX_ITERATIONS=2500,a.DEFAULT_EDGE_LENGTH=50,a.DEFAULT_SPRING_STRENGTH=.45,a.DEFAULT_REPULSION_STRENGTH=4500,a.DEFAULT_GRAVITY_STRENGTH=.4,a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,a.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,a.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,a.COOLING_ADAPTATION_FACTOR=.33,a.ADAPTATION_LOWER_NODE_LIMIT=1e3,a.ADAPTATION_UPPER_NODE_LIMIT=5e3,a.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,a.MAX_NODE_DISPLACEMENT=a.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,a.MIN_REPULSION_DIST=a.DEFAULT_EDGE_LENGTH/10,a.CONVERGENCE_CHECK_PERIOD=100,a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,a.MIN_EDGE_LENGTH=1,a.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=a}),(function(t,e,r){"use strict";function n(a,i){a==null&&i==null?(this.x=0,this.y=0):(this.x=a,this.y=i)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(a){this.x=a},n.prototype.setY=function(a){this.y=a},n.prototype.getDifference=function(a){return new DimensionD(this.x-a.x,this.y-a.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(a){return this.x+=a.width,this.y+=a.height,this},t.exports=n}),(function(t,e,r){"use strict";var n=r(2),a=r(10),i=r(0),o=r(7),s=r(3),l=r(1),u=r(13),f=r(12),c=r(11);function h(v,p,m){n.call(this,m),this.estimatedSize=a.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=v,p!=null&&p instanceof o?this.graphManager=p:p!=null&&p instanceof Layout&&(this.graphManager=p.graphManager)}h.prototype=Object.create(n.prototype);for(var d in n)h[d]=n[d];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(v,p,m){if(p==null&&m==null){var g=v;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var y=v;if(!(this.getNodes().indexOf(p)>-1&&this.getNodes().indexOf(m)>-1))throw"Source or target not in graph!";if(!(p.owner==m.owner&&p.owner==this))throw"Both owners must be this graph!";return p.owner!=m.owner?null:(y.source=p,y.target=m,y.isInterGraph=!1,this.getEdges().push(y),p.edges.push(y),m!=p&&m.edges.push(y),y)}},h.prototype.remove=function(v){var p=v;if(v instanceof s){if(p==null)throw"Node is null!";if(!(p.owner!=null&&p.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var m=p.edges.slice(),g,y=m.length,b=0;b<y;b++)g=m[b],g.isInterGraph?this.graphManager.remove(g):g.source.owner.remove(g);var x=this.nodes.indexOf(p);if(x==-1)throw"Node not in owner node list!";this.nodes.splice(x,1)}else if(v instanceof l){var g=v;if(g==null)throw"Edge is null!";if(!(g.source!=null&&g.target!=null))throw"Source and/or target is null!";if(!(g.source.owner!=null&&g.target.owner!=null&&g.source.owner==this&&g.target.owner==this))throw"Source and/or target owner is invalid!";var C=g.source.edges.indexOf(g),O=g.target.edges.indexOf(g);if(!(C>-1&&O>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(C,1),g.target!=g.source&&g.target.edges.splice(O,1);var x=g.source.owner.getEdges().indexOf(g);if(x==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(x,1)}},h.prototype.updateLeftTop=function(){for(var v=a.MAX_VALUE,p=a.MAX_VALUE,m,g,y,b=this.getNodes(),x=b.length,C=0;C<x;C++){var O=b[C];m=O.getTop(),g=O.getLeft(),v>m&&(v=m),p>g&&(p=g)}return v==a.MAX_VALUE?null:(b[0].getParent().paddingLeft!=null?y=b[0].getParent().paddingLeft:y=this.margin,this.left=p-y,this.top=v-y,new f(this.left,this.top))},h.prototype.updateBounds=function(v){for(var p=a.MAX_VALUE,m=-a.MAX_VALUE,g=a.MAX_VALUE,y=-a.MAX_VALUE,b,x,C,O,L,A=this.nodes,I=A.length,D=0;D<I;D++){var M=A[D];v&&M.child!=null&&M.updateBounds(),b=M.getLeft(),x=M.getRight(),C=M.getTop(),O=M.getBottom(),p>b&&(p=b),m<x&&(m=x),g>C&&(g=C),y<O&&(y=O)}var E=new u(p,g,m-p,y-g);p==a.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),A[0].getParent().paddingLeft!=null?L=A[0].getParent().paddingLeft:L=this.margin,this.left=E.x-L,this.right=E.x+E.width+L,this.top=E.y-L,this.bottom=E.y+E.height+L},h.calculateBounds=function(v){for(var p=a.MAX_VALUE,m=-a.MAX_VALUE,g=a.MAX_VALUE,y=-a.MAX_VALUE,b,x,C,O,L=v.length,A=0;A<L;A++){var I=v[A];b=I.getLeft(),x=I.getRight(),C=I.getTop(),O=I.getBottom(),p>b&&(p=b),m<x&&(m=x),g>C&&(g=C),y<O&&(y=O)}var D=new u(p,g,m-p,y-g);return D},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==a.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var v=0,p=this.nodes,m=p.length,g=0;g<m;g++){var y=p[g];v+=y.calcEstimatedSize()}return v==0?this.estimatedSize=i.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=v/Math.sqrt(this.nodes.length),this.estimatedSize},h.prototype.updateConnected=function(){var v=this;if(this.nodes.length==0){this.isConnected=!0;return}var p=new c,m=new Set,g=this.nodes[0],y,b,x=g.withChildren();for(x.forEach(function(D){p.push(D),m.add(D)});p.length!==0;){g=p.shift(),y=g.getEdges();for(var C=y.length,O=0;O<C;O++){var L=y[O];if(b=L.getOtherEndInGraph(g,this),b!=null&&!m.has(b)){var A=b.withChildren();A.forEach(function(D){p.push(D),m.add(D)})}}}if(this.isConnected=!1,m.size>=this.nodes.length){var I=0;m.forEach(function(D){D.owner==v&&I++}),I==this.nodes.length&&(this.isConnected=!0)}},t.exports=h}),(function(t,e,r){"use strict";var n,a=r(1);function i(o){n=r(6),this.layout=o,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var o=this.layout.newGraph(),s=this.layout.newNode(null),l=this.add(o,s);return this.setRootGraph(l),this.rootGraph},i.prototype.add=function(o,s,l,u,f){if(l==null&&u==null&&f==null){if(o==null)throw"Graph is null!";if(s==null)throw"Parent node is null!";if(this.graphs.indexOf(o)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(o),o.parent!=null)throw"Already has a parent!";if(s.child!=null)throw"Already has a child!";return o.parent=s,s.child=o,o}else{f=l,u=s,l=o;var c=u.getOwner(),h=f.getOwner();if(!(c!=null&&c.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(c==h)return l.isInterGraph=!1,c.add(l,u,f);if(l.isInterGraph=!0,l.source=u,l.target=f,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}},i.prototype.remove=function(o){if(o instanceof n){var s=o;if(s.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(s==this.rootGraph||s.parent!=null&&s.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(s.getEdges());for(var u,f=l.length,c=0;c<f;c++)u=l[c],s.remove(u);var h=[];h=h.concat(s.getNodes());var d;f=h.length;for(var c=0;c<f;c++)d=h[c],s.remove(d);s==this.rootGraph&&this.setRootGraph(null);var v=this.graphs.indexOf(s);this.graphs.splice(v,1),s.parent=null}else if(o instanceof a){if(u=o,u==null)throw"Edge is null!";if(!u.isInterGraph)throw"Not an inter-graph edge!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.edges.indexOf(u)!=-1&&u.target.edges.indexOf(u)!=-1))throw"Source and/or target doesn't know this edge!";var v=u.source.edges.indexOf(u);if(u.source.edges.splice(v,1),v=u.target.edges.indexOf(u),u.target.edges.splice(v,1),!(u.source.owner!=null&&u.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(u.source.owner.getGraphManager().edges.indexOf(u)==-1)throw"Not in owner graph manager's edge list!";var v=u.source.owner.getGraphManager().edges.indexOf(u);u.source.owner.getGraphManager().edges.splice(v,1)}},i.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},i.prototype.getGraphs=function(){return this.graphs},i.prototype.getAllNodes=function(){if(this.allNodes==null){for(var o=[],s=this.getGraphs(),l=s.length,u=0;u<l;u++)o=o.concat(s[u].getNodes());this.allNodes=o}return this.allNodes},i.prototype.resetAllNodes=function(){this.allNodes=null},i.prototype.resetAllEdges=function(){this.allEdges=null},i.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},i.prototype.getAllEdges=function(){if(this.allEdges==null){for(var o=[],s=this.getGraphs(),l=s.length,u=0;u<s.length;u++)o=o.concat(s[u].getEdges());o=o.concat(this.edges),this.allEdges=o}return this.allEdges},i.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},i.prototype.setAllNodesToApplyGravitation=function(o){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=o},i.prototype.getRoot=function(){return this.rootGraph},i.prototype.setRootGraph=function(o){if(o.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=o,o.parent==null&&(o.parent=this.layout.newNode("Root node"))},i.prototype.getLayout=function(){return this.layout},i.prototype.isOneAncestorOfOther=function(o,s){if(!(o!=null&&s!=null))throw"assert failed";if(o==s)return!0;var l=o.getOwner(),u;do{if(u=l.getParent(),u==null)break;if(u==s)return!0;if(l=u.getOwner(),l==null)break}while(!0);l=s.getOwner();do{if(u=l.getParent(),u==null)break;if(u==o)return!0;if(l=u.getOwner(),l==null)break}while(!0);return!1},i.prototype.calcLowestCommonAncestors=function(){for(var o,s,l,u,f,c=this.getAllEdges(),h=c.length,d=0;d<h;d++){if(o=c[d],s=o.source,l=o.target,o.lca=null,o.sourceInLca=s,o.targetInLca=l,s==l){o.lca=s.getOwner();continue}for(u=s.getOwner();o.lca==null;){for(o.targetInLca=l,f=l.getOwner();o.lca==null;){if(f==u){o.lca=f;break}if(f==this.rootGraph)break;if(o.lca!=null)throw"assert failed";o.targetInLca=f.getParent(),f=o.targetInLca.getOwner()}if(u==this.rootGraph)break;o.lca==null&&(o.sourceInLca=u.getParent(),u=o.sourceInLca.getOwner())}if(o.lca==null)throw"assert failed"}},i.prototype.calcLowestCommonAncestor=function(o,s){if(o==s)return o.getOwner();var l=o.getOwner();do{if(l==null)break;var u=s.getOwner();do{if(u==null)break;if(u==l)return u;u=u.getParent().getOwner()}while(!0);l=l.getParent().getOwner()}while(!0);return l},i.prototype.calcInclusionTreeDepths=function(o,s){o==null&&s==null&&(o=this.rootGraph,s=1);for(var l,u=o.getNodes(),f=u.length,c=0;c<f;c++)l=u[c],l.inclusionTreeDepth=s,l.child!=null&&this.calcInclusionTreeDepths(l.child,s+1)},i.prototype.includesInvalidEdge=function(){for(var o,s=[],l=this.edges.length,u=0;u<l;u++)o=this.edges[u],this.isOneAncestorOfOther(o.source,o.target)&&s.push(o);for(var u=0;u<s.length;u++)this.remove(s[u]);return!1},t.exports=i}),(function(t,e,r){"use strict";var n=r(12);function a(){}a.calcSeparationAmount=function(i,o,s,l){if(!i.intersects(o))throw"assert failed";var u=new Array(2);this.decideDirectionsForOverlappingNodes(i,o,u),s[0]=Math.min(i.getRight(),o.getRight())-Math.max(i.x,o.x),s[1]=Math.min(i.getBottom(),o.getBottom())-Math.max(i.y,o.y),i.getX()<=o.getX()&&i.getRight()>=o.getRight()?s[0]+=Math.min(o.getX()-i.getX(),i.getRight()-o.getRight()):o.getX()<=i.getX()&&o.getRight()>=i.getRight()&&(s[0]+=Math.min(i.getX()-o.getX(),o.getRight()-i.getRight())),i.getY()<=o.getY()&&i.getBottom()>=o.getBottom()?s[1]+=Math.min(o.getY()-i.getY(),i.getBottom()-o.getBottom()):o.getY()<=i.getY()&&o.getBottom()>=i.getBottom()&&(s[1]+=Math.min(i.getY()-o.getY(),o.getBottom()-i.getBottom()));var f=Math.abs((o.getCenterY()-i.getCenterY())/(o.getCenterX()-i.getCenterX()));o.getCenterY()===i.getCenterY()&&o.getCenterX()===i.getCenterX()&&(f=1);var c=f*s[0],h=s[1]/f;s[0]<h?h=s[0]:c=s[1],s[0]=-1*u[0]*(h/2+l),s[1]=-1*u[1]*(c/2+l)},a.decideDirectionsForOverlappingNodes=function(i,o,s){i.getCenterX()<o.getCenterX()?s[0]=-1:s[0]=1,i.getCenterY()<o.getCenterY()?s[1]=-1:s[1]=1},a.getIntersection2=function(i,o,s){var l=i.getCenterX(),u=i.getCenterY(),f=o.getCenterX(),c=o.getCenterY();if(i.intersects(o))return s[0]=l,s[1]=u,s[2]=f,s[3]=c,!0;var h=i.getX(),d=i.getY(),v=i.getRight(),p=i.getX(),m=i.getBottom(),g=i.getRight(),y=i.getWidthHalf(),b=i.getHeightHalf(),x=o.getX(),C=o.getY(),O=o.getRight(),L=o.getX(),A=o.getBottom(),I=o.getRight(),D=o.getWidthHalf(),M=o.getHeightHalf(),E=!1,S=!1;if(l===f){if(u>c)return s[0]=l,s[1]=d,s[2]=f,s[3]=A,!1;if(u<c)return s[0]=l,s[1]=m,s[2]=f,s[3]=C,!1}else if(u===c){if(l>f)return s[0]=h,s[1]=u,s[2]=O,s[3]=c,!1;if(l<f)return s[0]=v,s[1]=u,s[2]=x,s[3]=c,!1}else{var w=i.height/i.width,N=o.height/o.width,T=(c-u)/(f-l),R=void 0,P=void 0,k=void 0,U=void 0,B=void 0,V=void 0;if(-w===T?l>f?(s[0]=p,s[1]=m,E=!0):(s[0]=v,s[1]=d,E=!0):w===T&&(l>f?(s[0]=h,s[1]=d,E=!0):(s[0]=g,s[1]=m,E=!0)),-N===T?f>l?(s[2]=L,s[3]=A,S=!0):(s[2]=O,s[3]=C,S=!0):N===T&&(f>l?(s[2]=x,s[3]=C,S=!0):(s[2]=I,s[3]=A,S=!0)),E&&S)return!1;if(l>f?u>c?(R=this.getCardinalDirection(w,T,4),P=this.getCardinalDirection(N,T,2)):(R=this.getCardinalDirection(-w,T,3),P=this.getCardinalDirection(-N,T,1)):u>c?(R=this.getCardinalDirection(-w,T,1),P=this.getCardinalDirection(-N,T,3)):(R=this.getCardinalDirection(w,T,2),P=this.getCardinalDirection(N,T,4)),!E)switch(R){case 1:U=d,k=l+-b/T,s[0]=k,s[1]=U;break;case 2:k=g,U=u+y*T,s[0]=k,s[1]=U;break;case 3:U=m,k=l+b/T,s[0]=k,s[1]=U;break;case 4:k=p,U=u+-y*T,s[0]=k,s[1]=U;break}if(!S)switch(P){case 1:V=C,B=f+-M/T,s[2]=B,s[3]=V;break;case 2:B=I,V=c+D*T,s[2]=B,s[3]=V;break;case 3:V=A,B=f+M/T,s[2]=B,s[3]=V;break;case 4:B=L,V=c+-D*T,s[2]=B,s[3]=V;break}}return!1},a.getCardinalDirection=function(i,o,s){return i>o?s:1+s%4},a.getIntersection=function(i,o,s,l){if(l==null)return this.getIntersection2(i,o,s);var u=i.x,f=i.y,c=o.x,h=o.y,d=s.x,v=s.y,p=l.x,m=l.y,g=void 0,y=void 0,b=void 0,x=void 0,C=void 0,O=void 0,L=void 0,A=void 0,I=void 0;return b=h-f,C=u-c,L=c*f-u*h,x=m-v,O=d-p,A=p*v-d*m,I=b*O-x*C,I===0?null:(g=(C*A-O*L)/I,y=(x*L-b*A)/I,new n(g,y))},a.angleOfVector=function(i,o,s,l){var u=void 0;return i!==s?(u=Math.atan((l-o)/(s-i)),s<i?u+=Math.PI:l<o&&(u+=this.TWO_PI)):l<o?u=this.ONE_AND_HALF_PI:u=this.HALF_PI,u},a.doIntersect=function(i,o,s,l){var u=i.x,f=i.y,c=o.x,h=o.y,d=s.x,v=s.y,p=l.x,m=l.y,g=(c-u)*(m-v)-(p-d)*(h-f);if(g===0)return!1;var y=((m-v)*(p-u)+(d-p)*(m-f))/g,b=((f-h)*(p-u)+(c-u)*(m-f))/g;return 0<y&&y<1&&0<b&&b<1},a.findCircleLineIntersections=function(i,o,s,l,u,f,c){var h=(s-i)*(s-i)+(l-o)*(l-o),d=2*((i-u)*(s-i)+(o-f)*(l-o)),v=(i-u)*(i-u)+(o-f)*(o-f)-c*c,p=d*d-4*h*v;if(p>=0){var m=(-d+Math.sqrt(d*d-4*h*v))/(2*h),g=(-d-Math.sqrt(d*d-4*h*v))/(2*h),y=null;return m>=0&&m<=1?[m]:g>=0&&g<=1?[g]:y}else return null},a.HALF_PI=.5*Math.PI,a.ONE_AND_HALF_PI=1.5*Math.PI,a.TWO_PI=2*Math.PI,a.THREE_PI=3*Math.PI,t.exports=a}),(function(t,e,r){"use strict";function n(){}n.sign=function(a){return a>0?1:a<0?-1:0},n.floor=function(a){return a<0?Math.ceil(a):Math.floor(a)},n.ceil=function(a){return a<0?Math.floor(a):Math.ceil(a)},t.exports=n}),(function(t,e,r){"use strict";function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n}),(function(t,e,r){"use strict";var n=(function(){function u(f,c){for(var h=0;h<c.length;h++){var d=c[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(f,d.key,d)}}return function(f,c,h){return c&&u(f.prototype,c),h&&u(f,h),f}})();function a(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var i=function(f){return{value:f,next:null,prev:null}},o=function(f,c,h,d){return f!==null?f.next=c:d.head=c,h!==null?h.prev=c:d.tail=c,c.prev=f,c.next=h,d.length++,c},s=function(f,c){var h=f.prev,d=f.next;return h!==null?h.next=d:c.head=d,d!==null?d.prev=h:c.tail=h,f.prev=f.next=null,c.length--,f},l=(function(){function u(f){var c=this;a(this,u),this.length=0,this.head=null,this.tail=null,f?.forEach(function(h){return c.push(h)})}return n(u,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(c,h){return o(h.prev,i(c),h,this)}},{key:"insertAfter",value:function(c,h){return o(h,i(c),h.next,this)}},{key:"insertNodeBefore",value:function(c,h){return o(h.prev,c,h,this)}},{key:"insertNodeAfter",value:function(c,h){return o(h,c,h.next,this)}},{key:"push",value:function(c){return o(this.tail,i(c),null,this)}},{key:"unshift",value:function(c){return o(null,i(c),this.head,this)}},{key:"remove",value:function(c){return s(c,this)}},{key:"pop",value:function(){return s(this.tail,this).value}},{key:"popNode",value:function(){return s(this.tail,this)}},{key:"shift",value:function(){return s(this.head,this).value}},{key:"shiftNode",value:function(){return s(this.head,this)}},{key:"get_object_at",value:function(c){if(c<=this.length()){for(var h=1,d=this.head;h<c;)d=d.next,h++;return d.value}}},{key:"set_object_at",value:function(c,h){if(c<=this.length()){for(var d=1,v=this.head;d<c;)v=v.next,d++;v.value=h}}}]),u})();t.exports=l}),(function(t,e,r){"use strict";function n(a,i,o){this.x=null,this.y=null,a==null&&i==null&&o==null?(this.x=0,this.y=0):typeof a=="number"&&typeof i=="number"&&o==null?(this.x=a,this.y=i):a.constructor.name=="Point"&&i==null&&o==null&&(o=a,this.x=o.x,this.y=o.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(a,i,o){a.constructor.name=="Point"&&i==null&&o==null?(o=a,this.setLocation(o.x,o.y)):typeof a=="number"&&typeof i=="number"&&o==null&&(parseInt(a)==a&&parseInt(i)==i?this.move(a,i):(this.x=Math.floor(a+.5),this.y=Math.floor(i+.5)))},n.prototype.move=function(a,i){this.x=a,this.y=i},n.prototype.translate=function(a,i){this.x+=a,this.y+=i},n.prototype.equals=function(a){if(a.constructor.name=="Point"){var i=a;return this.x==i.x&&this.y==i.y}return this==a},n.prototype.toString=function(){return new n().constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=n}),(function(t,e,r){"use strict";function n(a,i,o,s){this.x=0,this.y=0,this.width=0,this.height=0,a!=null&&i!=null&&o!=null&&s!=null&&(this.x=a,this.y=i,this.width=o,this.height=s)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(a){this.x=a},n.prototype.getY=function(){return this.y},n.prototype.setY=function(a){this.y=a},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(a){this.width=a},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(a){this.height=a},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(a){return!(this.getRight()<a.x||this.getBottom()<a.y||a.getRight()<this.x||a.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},t.exports=n}),(function(t,e,r){"use strict";var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i};function a(){}a.lastID=0,a.createID=function(i){return a.isPrimitive(i)?i:(i.uniqueID!=null||(i.uniqueID=a.getString(),a.lastID++),i.uniqueID)},a.getString=function(i){return i==null&&(i=a.lastID),"Object#"+i},a.isPrimitive=function(i){var o=typeof i>"u"?"undefined":n(i);return i==null||o!="object"&&o!="function"},t.exports=a}),(function(t,e,r){"use strict";function n(d){if(Array.isArray(d)){for(var v=0,p=Array(d.length);v<d.length;v++)p[v]=d[v];return p}else return Array.from(d)}var a=r(0),i=r(7),o=r(3),s=r(1),l=r(6),u=r(5),f=r(17),c=r(29);function h(d){c.call(this),this.layoutQuality=a.QUALITY,this.createBendsAsNeeded=a.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=a.DEFAULT_INCREMENTAL,this.animationOnLayout=a.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=a.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=a.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=a.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new i(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,d!=null&&(this.isRemoteUse=d)}h.RANDOM_SEED=1,h.prototype=Object.create(c.prototype),h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},h.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},h.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},h.prototype.newGraphManager=function(){var d=new i(this);return this.graphManager=d,d},h.prototype.newGraph=function(d){return new l(null,this.graphManager,d)},h.prototype.newNode=function(d){return new o(this.graphManager,d)},h.prototype.newEdge=function(d){return new s(null,null,d)},h.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},h.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var d;return this.checkLayoutSuccess()?d=!1:d=this.layout(),a.ANIMATE==="during"?!1:(d&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,d)},h.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},h.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var d,v=this.graphManager.getAllEdges(),p=0;p<v.length;p++)d=v[p];for(var m,g=this.graphManager.getRoot().getNodes(),p=0;p<g.length;p++)m=g[p];this.update(this.graphManager.getRoot())}},h.prototype.update=function(d){if(d==null)this.update2();else if(d instanceof o){var v=d;if(v.getChild()!=null)for(var p=v.getChild().getNodes(),m=0;m<p.length;m++)update(p[m]);if(v.vGraphObject!=null){var g=v.vGraphObject;g.update(v)}}else if(d instanceof s){var y=d;if(y.vGraphObject!=null){var b=y.vGraphObject;b.update(y)}}else if(d instanceof l){var x=d;if(x.vGraphObject!=null){var C=x.vGraphObject;C.update(x)}}},h.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=a.QUALITY,this.animationDuringLayout=a.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=a.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=a.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=a.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=a.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=a.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},h.prototype.transform=function(d){if(d==null)this.transform(new u(0,0));else{var v=new f,p=this.graphManager.getRoot().updateLeftTop();if(p!=null){v.setWorldOrgX(d.x),v.setWorldOrgY(d.y),v.setDeviceOrgX(p.x),v.setDeviceOrgY(p.y);for(var m=this.getAllNodes(),g,y=0;y<m.length;y++)g=m[y],g.transform(v)}}},h.prototype.positionNodesRandomly=function(d){if(d==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var v,p,m=d.getNodes(),g=0;g<m.length;g++)v=m[g],p=v.getChild(),p==null||p.getNodes().length==0?v.scatter():(this.positionNodesRandomly(p),v.updateBounds())},h.prototype.getFlatForest=function(){for(var d=[],v=!0,p=this.graphManager.getRoot().getNodes(),m=!0,g=0;g<p.length;g++)p[g].getChild()!=null&&(m=!1);if(!m)return d;var y=new Set,b=[],x=new Map,C=[];for(C=C.concat(p);C.length>0&&v;){for(b.push(C[0]);b.length>0&&v;){var O=b[0];b.splice(0,1),y.add(O);for(var L=O.getEdges(),g=0;g<L.length;g++){var A=L[g].getOtherEnd(O);if(x.get(O)!=A)if(!y.has(A))b.push(A),x.set(A,O);else{v=!1;break}}}if(!v)d=[];else{var I=[].concat(n(y));d.push(I);for(var g=0;g<I.length;g++){var D=I[g],M=C.indexOf(D);M>-1&&C.splice(M,1)}y=new Set,x=new Map}}return d},h.prototype.createDummyNodesForBendpoints=function(d){for(var v=[],p=d.source,m=this.graphManager.calcLowestCommonAncestor(d.source,d.target),g=0;g<d.bendpoints.length;g++){var y=this.newNode(null);y.setRect(new Point(0,0),new Dimension(1,1)),m.add(y);var b=this.newEdge(null);this.graphManager.add(b,p,y),v.add(y),p=y}var b=this.newEdge(null);return this.graphManager.add(b,p,d.target),this.edgeToDummyNodes.set(d,v),d.isInterGraph()?this.graphManager.remove(d):m.remove(d),v},h.prototype.createBendpointsFromDummyNodes=function(){var d=[];d=d.concat(this.graphManager.getAllEdges()),d=[].concat(n(this.edgeToDummyNodes.keys())).concat(d);for(var v=0;v<d.length;v++){var p=d[v];if(p.bendpoints.length>0){for(var m=this.edgeToDummyNodes.get(p),g=0;g<m.length;g++){var y=m[g],b=new u(y.getCenterX(),y.getCenterY()),x=p.bendpoints.get(g);x.x=b.x,x.y=b.y,y.getOwner().remove(y)}this.graphManager.add(p,p.source,p.target)}}},h.transform=function(d,v,p,m){if(p!=null&&m!=null){var g=v;if(d<=50){var y=v/p;g-=(v-y)/50*(50-d)}else{var b=v*m;g+=(b-v)/50*(d-50)}return g}else{var x,C;return d<=50?(x=9*v/500,C=v/10):(x=9*v/50,C=-8*v),x*d+C}},h.findCenterOfTree=function(d){var v=[];v=v.concat(d);var p=[],m=new Map,g=!1,y=null;(v.length==1||v.length==2)&&(g=!0,y=v[0]);for(var b=0;b<v.length;b++){var x=v[b],C=x.getNeighborsList().size;m.set(x,x.getNeighborsList().size),C==1&&p.push(x)}var O=[];for(O=O.concat(p);!g;){var L=[];L=L.concat(O),O=[];for(var b=0;b<v.length;b++){var x=v[b],A=v.indexOf(x);A>=0&&v.splice(A,1);var I=x.getNeighborsList();I.forEach(function(E){if(p.indexOf(E)<0){var S=m.get(E),w=S-1;w==1&&O.push(E),m.set(E,w)}})}p=p.concat(O),(v.length==1||v.length==2)&&(g=!0,y=v[0])}return y},h.prototype.setGraphManager=function(d){this.graphManager=d},t.exports=h}),(function(t,e,r){"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)},t.exports=n}),(function(t,e,r){"use strict";var n=r(5);function a(i,o){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}a.prototype.getWorldOrgX=function(){return this.lworldOrgX},a.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},a.prototype.getWorldOrgY=function(){return this.lworldOrgY},a.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},a.prototype.getWorldExtX=function(){return this.lworldExtX},a.prototype.setWorldExtX=function(i){this.lworldExtX=i},a.prototype.getWorldExtY=function(){return this.lworldExtY},a.prototype.setWorldExtY=function(i){this.lworldExtY=i},a.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},a.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},a.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},a.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},a.prototype.getDeviceExtX=function(){return this.ldeviceExtX},a.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},a.prototype.getDeviceExtY=function(){return this.ldeviceExtY},a.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},a.prototype.transformX=function(i){var o=0,s=this.lworldExtX;return s!=0&&(o=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/s),o},a.prototype.transformY=function(i){var o=0,s=this.lworldExtY;return s!=0&&(o=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/s),o},a.prototype.inverseTransformX=function(i){var o=0,s=this.ldeviceExtX;return s!=0&&(o=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/s),o},a.prototype.inverseTransformY=function(i){var o=0,s=this.ldeviceExtY;return s!=0&&(o=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/s),o},a.prototype.inverseTransformPoint=function(i){var o=new n(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return o},t.exports=a}),(function(t,e,r){"use strict";function n(c){if(Array.isArray(c)){for(var h=0,d=Array(c.length);h<c.length;h++)d[h]=c[h];return d}else return Array.from(c)}var a=r(15),i=r(4),o=r(0),s=r(8),l=r(9);function u(){a.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}u.prototype=Object.create(a.prototype);for(var f in a)u[f]=a[f];u.prototype.initParameters=function(){a.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){for(var c,h,d,v,p,m,g,y=this.getGraphManager().getAllEdges(),b=0;b<y.length;b++)c=y[b],h=c.idealLength,c.isInterGraph&&(v=c.getSource(),p=c.getTarget(),m=c.getSourceInLca().getEstimatedSize(),g=c.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(c.idealLength+=m+g-2*o.SIMPLE_NODE_SIZE),d=c.getLca().getInclusionTreeDepth(),c.idealLength+=h*i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(v.getInclusionTreeDepth()+p.getInclusionTreeDepth()-2*d))},u.prototype.initSpringEmbedder=function(){var c=this.getAllNodes().length;this.incremental?(c>i.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(c-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(c>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(c-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var c=this.getAllEdges(),h,d=0;d<c.length;d++)h=c[d],this.calcSpringForce(h,h.idealLength)},u.prototype.calcRepulsionForces=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d,v,p,m,g=this.getAllNodes(),y;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&c&&this.updateGrid(),y=new Set,d=0;d<g.length;d++)p=g[d],this.calculateRepulsionForceOfANode(p,y,c,h),y.add(p);else for(d=0;d<g.length;d++)for(p=g[d],v=d+1;v<g.length;v++)m=g[v],p.getOwner()==m.getOwner()&&this.calcRepulsionForce(p,m)},u.prototype.calcGravitationalForces=function(){for(var c,h=this.getAllNodesToApplyGravitation(),d=0;d<h.length;d++)c=h[d],this.calcGravitationalForce(c)},u.prototype.moveNodes=function(){for(var c=this.getAllNodes(),h,d=0;d<c.length;d++)h=c[d],h.move()},u.prototype.calcSpringForce=function(c,h){var d=c.getSource(),v=c.getTarget(),p,m,g,y;if(this.uniformLeafNodeSizes&&d.getChild()==null&&v.getChild()==null)c.updateLengthSimple();else if(c.updateLength(),c.isOverlapingSourceAndTarget)return;p=c.getLength(),p!=0&&(m=c.edgeElasticity*(p-h),g=m*(c.lengthX/p),y=m*(c.lengthY/p),d.springForceX+=g,d.springForceY+=y,v.springForceX-=g,v.springForceY-=y)},u.prototype.calcRepulsionForce=function(c,h){var d=c.getRect(),v=h.getRect(),p=new Array(2),m=new Array(4),g,y,b,x,C,O,L;if(d.intersects(v)){s.calcSeparationAmount(d,v,p,i.DEFAULT_EDGE_LENGTH/2),O=2*p[0],L=2*p[1];var A=c.noOfChildren*h.noOfChildren/(c.noOfChildren+h.noOfChildren);c.repulsionForceX-=A*O,c.repulsionForceY-=A*L,h.repulsionForceX+=A*O,h.repulsionForceY+=A*L}else this.uniformLeafNodeSizes&&c.getChild()==null&&h.getChild()==null?(g=v.getCenterX()-d.getCenterX(),y=v.getCenterY()-d.getCenterY()):(s.getIntersection(d,v,m),g=m[2]-m[0],y=m[3]-m[1]),Math.abs(g)<i.MIN_REPULSION_DIST&&(g=l.sign(g)*i.MIN_REPULSION_DIST),Math.abs(y)<i.MIN_REPULSION_DIST&&(y=l.sign(y)*i.MIN_REPULSION_DIST),b=g*g+y*y,x=Math.sqrt(b),C=(c.nodeRepulsion/2+h.nodeRepulsion/2)*c.noOfChildren*h.noOfChildren/b,O=C*g/x,L=C*y/x,c.repulsionForceX-=O,c.repulsionForceY-=L,h.repulsionForceX+=O,h.repulsionForceY+=L},u.prototype.calcGravitationalForce=function(c){var h,d,v,p,m,g,y,b;h=c.getOwner(),d=(h.getRight()+h.getLeft())/2,v=(h.getTop()+h.getBottom())/2,p=c.getCenterX()-d,m=c.getCenterY()-v,g=Math.abs(p)+c.getWidth()/2,y=Math.abs(m)+c.getHeight()/2,c.getOwner()==this.graphManager.getRoot()?(b=h.getEstimatedSize()*this.gravityRangeFactor,(g>b||y>b)&&(c.gravitationForceX=-this.gravityConstant*p,c.gravitationForceY=-this.gravityConstant*m)):(b=h.getEstimatedSize()*this.compoundGravityRangeFactor,(g>b||y>b)&&(c.gravitationForceX=-this.gravityConstant*p*this.compoundGravityConstant,c.gravitationForceY=-this.gravityConstant*m*this.compoundGravityConstant))},u.prototype.isConverged=function(){var c,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),c=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,c||h},u.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},u.prototype.calcNoOfChildrenForAllNodes=function(){for(var c,h=this.graphManager.getAllNodes(),d=0;d<h.length;d++)c=h[d],c.noOfChildren=c.getNoOfChildren()},u.prototype.calcGrid=function(c){var h=0,d=0;h=parseInt(Math.ceil((c.getRight()-c.getLeft())/this.repulsionRange)),d=parseInt(Math.ceil((c.getBottom()-c.getTop())/this.repulsionRange));for(var v=new Array(h),p=0;p<h;p++)v[p]=new Array(d);for(var p=0;p<h;p++)for(var m=0;m<d;m++)v[p][m]=new Array;return v},u.prototype.addNodeToGrid=function(c,h,d){var v=0,p=0,m=0,g=0;v=parseInt(Math.floor((c.getRect().x-h)/this.repulsionRange)),p=parseInt(Math.floor((c.getRect().width+c.getRect().x-h)/this.repulsionRange)),m=parseInt(Math.floor((c.getRect().y-d)/this.repulsionRange)),g=parseInt(Math.floor((c.getRect().height+c.getRect().y-d)/this.repulsionRange));for(var y=v;y<=p;y++)for(var b=m;b<=g;b++)this.grid[y][b].push(c),c.setGridCoordinates(v,p,m,g)},u.prototype.updateGrid=function(){var c,h,d=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),c=0;c<d.length;c++)h=d[c],this.addNodeToGrid(h,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},u.prototype.calculateRepulsionForceOfANode=function(c,h,d,v){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&d||v){var p=new Set;c.surrounding=new Array;for(var m,g=this.grid,y=c.startX-1;y<c.finishX+2;y++)for(var b=c.startY-1;b<c.finishY+2;b++)if(!(y<0||b<0||y>=g.length||b>=g[0].length)){for(var x=0;x<g[y][b].length;x++)if(m=g[y][b][x],!(c.getOwner()!=m.getOwner()||c==m)&&!h.has(m)&&!p.has(m)){var C=Math.abs(c.getCenterX()-m.getCenterX())-(c.getWidth()/2+m.getWidth()/2),O=Math.abs(c.getCenterY()-m.getCenterY())-(c.getHeight()/2+m.getHeight()/2);C<=this.repulsionRange&&O<=this.repulsionRange&&p.add(m)}}c.surrounding=[].concat(n(p))}for(y=0;y<c.surrounding.length;y++)this.calcRepulsionForce(c,c.surrounding[y])},u.prototype.calcRepulsionRange=function(){return 0},t.exports=u}),(function(t,e,r){"use strict";var n=r(1),a=r(4);function i(s,l,u){n.call(this,s,l,u),this.idealLength=a.DEFAULT_EDGE_LENGTH,this.edgeElasticity=a.DEFAULT_SPRING_STRENGTH}i.prototype=Object.create(n.prototype);for(var o in n)i[o]=n[o];t.exports=i}),(function(t,e,r){"use strict";var n=r(3),a=r(4);function i(s,l,u,f){n.call(this,s,l,u,f),this.nodeRepulsion=a.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=[]}i.prototype=Object.create(n.prototype);for(var o in n)i[o]=n[o];i.prototype.setGridCoordinates=function(s,l,u,f){this.startX=s,this.finishX=l,this.startY=u,this.finishY=f},t.exports=i}),(function(t,e,r){"use strict";function n(a,i){this.width=0,this.height=0,a!==null&&i!==null&&(this.height=i,this.width=a)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(a){this.width=a},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(a){this.height=a},t.exports=n}),(function(t,e,r){"use strict";var n=r(14);function a(){this.map={},this.keys=[]}a.prototype.put=function(i,o){var s=n.createID(i);this.contains(s)||(this.map[s]=o,this.keys.push(i))},a.prototype.contains=function(i){var o=n.createID(i);return this.map[i]!=null},a.prototype.get=function(i){var o=n.createID(i);return this.map[o]},a.prototype.keySet=function(){return this.keys},t.exports=a}),(function(t,e,r){"use strict";var n=r(14);function a(){this.set={}}a.prototype.add=function(i){var o=n.createID(i);this.contains(o)||(this.set[o]=i)},a.prototype.remove=function(i){delete this.set[n.createID(i)]},a.prototype.clear=function(){this.set={}},a.prototype.contains=function(i){return this.set[n.createID(i)]==i},a.prototype.isEmpty=function(){return this.size()===0},a.prototype.size=function(){return Object.keys(this.set).length},a.prototype.addAllTo=function(i){for(var o=Object.keys(this.set),s=o.length,l=0;l<s;l++)i.push(this.set[o[l]])},a.prototype.size=function(){return Object.keys(this.set).length},a.prototype.addAll=function(i){for(var o=i.length,s=0;s<o;s++){var l=i[s];this.add(l)}},t.exports=a}),(function(t,e,r){"use strict";function n(){}n.multMat=function(a,i){for(var o=[],s=0;s<a.length;s++){o[s]=[];for(var l=0;l<i[0].length;l++){o[s][l]=0;for(var u=0;u<a[0].length;u++)o[s][l]+=a[s][u]*i[u][l]}}return o},n.transpose=function(a){for(var i=[],o=0;o<a[0].length;o++){i[o]=[];for(var s=0;s<a.length;s++)i[o][s]=a[s][o]}return i},n.multCons=function(a,i){for(var o=[],s=0;s<a.length;s++)o[s]=a[s]*i;return o},n.minusOp=function(a,i){for(var o=[],s=0;s<a.length;s++)o[s]=a[s]-i[s];return o},n.dotProduct=function(a,i){for(var o=0,s=0;s<a.length;s++)o+=a[s]*i[s];return o},n.mag=function(a){return Math.sqrt(this.dotProduct(a,a))},n.normalize=function(a){for(var i=[],o=this.mag(a),s=0;s<a.length;s++)i[s]=a[s]/o;return i},n.multGamma=function(a){for(var i=[],o=0,s=0;s<a.length;s++)o+=a[s];o*=-1/a.length;for(var l=0;l<a.length;l++)i[l]=o+a[l];return i},n.multL=function(a,i,o){for(var s=[],l=[],u=[],f=0;f<i[0].length;f++){for(var c=0,h=0;h<i.length;h++)c+=-.5*i[h][f]*a[h];l[f]=c}for(var d=0;d<o.length;d++){for(var v=0,p=0;p<o.length;p++)v+=o[d][p]*l[p];u[d]=v}for(var m=0;m<i.length;m++){for(var g=0,y=0;y<i[0].length;y++)g+=i[m][y]*u[y];s[m]=g}return s},t.exports=n}),(function(t,e,r){"use strict";var n=(function(){function s(l,u){for(var f=0;f<u.length;f++){var c=u[f];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,u,f){return u&&s(l.prototype,u),f&&s(l,f),l}})();function a(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}var i=r(11),o=(function(){function s(l,u){a(this,s),(u!==null||u!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;l instanceof i?f=l.size():f=l.length,this._quicksort(l,0,f-1)}return n(s,[{key:"_quicksort",value:function(u,f,c){if(f<c){var h=this._partition(u,f,c);this._quicksort(u,f,h),this._quicksort(u,h+1,c)}}},{key:"_partition",value:function(u,f,c){for(var h=this._get(u,f),d=f,v=c;;){for(;this.compareFunction(h,this._get(u,v));)v--;for(;this.compareFunction(this._get(u,d),h);)d++;if(d<v)this._swap(u,d,v),d++,v--;else return v}}},{key:"_get",value:function(u,f){return u instanceof i?u.get_object_at(f):u[f]}},{key:"_set",value:function(u,f,c){u instanceof i?u.set_object_at(f,c):u[f]=c}},{key:"_swap",value:function(u,f,c){var h=this._get(u,f);this._set(u,f,this._get(u,c)),this._set(u,c,h)}},{key:"_defaultCompareFunction",value:function(u,f){return f>u}}]),s})();t.exports=o}),(function(t,e,r){"use strict";function n(){}n.svd=function(a){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=a.length,this.n=a[0].length;var i=Math.min(this.m,this.n);this.s=(function(He){for(var Ue=[];He-- >0;)Ue.push(0);return Ue})(Math.min(this.m+1,this.n)),this.U=(function(He){var Ue=function yt(Ve){if(Ve.length==0)return 0;for(var je=[],it=0;it<Ve[0];it++)je.push(yt(Ve.slice(1)));return je};return Ue(He)})([this.m,i]),this.V=(function(He){var Ue=function yt(Ve){if(Ve.length==0)return 0;for(var je=[],it=0;it<Ve[0];it++)je.push(yt(Ve.slice(1)));return je};return Ue(He)})([this.n,this.n]);for(var o=(function(He){for(var Ue=[];He-- >0;)Ue.push(0);return Ue})(this.n),s=(function(He){for(var Ue=[];He-- >0;)Ue.push(0);return Ue})(this.m),l=!0,u=!0,f=Math.min(this.m-1,this.n),c=Math.max(0,Math.min(this.n-2,this.m)),h=0;h<Math.max(f,c);h++){if(h<f){this.s[h]=0;for(var d=h;d<this.m;d++)this.s[h]=n.hypot(this.s[h],a[d][h]);if(this.s[h]!==0){a[h][h]<0&&(this.s[h]=-this.s[h]);for(var v=h;v<this.m;v++)a[v][h]/=this.s[h];a[h][h]+=1}this.s[h]=-this.s[h]}for(var p=h+1;p<this.n;p++){if((function(He,Ue){return He&&Ue})(h<f,this.s[h]!==0)){for(var m=0,g=h;g<this.m;g++)m+=a[g][h]*a[g][p];m=-m/a[h][h];for(var y=h;y<this.m;y++)a[y][p]+=m*a[y][h]}o[p]=a[h][p]}if((function(He,Ue){return He&&Ue})(l,h<f))for(var b=h;b<this.m;b++)this.U[b][h]=a[b][h];if(h<c){o[h]=0;for(var x=h+1;x<this.n;x++)o[h]=n.hypot(o[h],o[x]);if(o[h]!==0){o[h+1]<0&&(o[h]=-o[h]);for(var C=h+1;C<this.n;C++)o[C]/=o[h];o[h+1]+=1}if(o[h]=-o[h],(function(He,Ue){return He&&Ue})(h+1<this.m,o[h]!==0)){for(var O=h+1;O<this.m;O++)s[O]=0;for(var L=h+1;L<this.n;L++)for(var A=h+1;A<this.m;A++)s[A]+=o[L]*a[A][L];for(var I=h+1;I<this.n;I++)for(var D=-o[I]/o[h+1],M=h+1;M<this.m;M++)a[M][I]+=D*s[M]}if(u)for(var E=h+1;E<this.n;E++)this.V[E][h]=o[E]}}var S=Math.min(this.n,this.m+1);if(f<this.n&&(this.s[f]=a[f][f]),this.m<S&&(this.s[S-1]=0),c+1<S&&(o[c]=a[c][S-1]),o[S-1]=0,l){for(var w=f;w<i;w++){for(var N=0;N<this.m;N++)this.U[N][w]=0;this.U[w][w]=1}for(var T=f-1;T>=0;T--)if(this.s[T]!==0){for(var R=T+1;R<i;R++){for(var P=0,k=T;k<this.m;k++)P+=this.U[k][T]*this.U[k][R];P=-P/this.U[T][T];for(var U=T;U<this.m;U++)this.U[U][R]+=P*this.U[U][T]}for(var B=T;B<this.m;B++)this.U[B][T]=-this.U[B][T];this.U[T][T]=1+this.U[T][T];for(var V=0;V<T-1;V++)this.U[V][T]=0}else{for(var j=0;j<this.m;j++)this.U[j][T]=0;this.U[T][T]=1}}if(u)for(var Y=this.n-1;Y>=0;Y--){if((function(He,Ue){return He&&Ue})(Y<c,o[Y]!==0))for(var Z=Y+1;Z<i;Z++){for(var K=0,G=Y+1;G<this.n;G++)K+=this.V[G][Y]*this.V[G][Z];K=-K/this.V[Y+1][Y];for(var $=Y+1;$<this.n;$++)this.V[$][Z]+=K*this.V[$][Y]}for(var q=0;q<this.n;q++)this.V[q][Y]=0;this.V[Y][Y]=1}for(var X=S-1,ee=0,ce=Math.pow(2,-52),Ee=Math.pow(2,-966);S>0;){var ne=void 0,Q=void 0;for(ne=S-2;ne>=-1&&ne!==-1;ne--)if(Math.abs(o[ne])<=Ee+ce*(Math.abs(this.s[ne])+Math.abs(this.s[ne+1]))){o[ne]=0;break}if(ne===S-2)Q=4;else{var se=void 0;for(se=S-1;se>=ne&&se!==ne;se--){var J=(se!==S?Math.abs(o[se]):0)+(se!==ne+1?Math.abs(o[se-1]):0);if(Math.abs(this.s[se])<=Ee+ce*J){this.s[se]=0;break}}se===ne?Q=3:se===S-1?Q=1:(Q=2,ne=se)}switch(ne++,Q){case 1:{var ie=o[S-2];o[S-2]=0;for(var ve=S-2;ve>=ne;ve--){var Se=n.hypot(this.s[ve],ie),Ce=this.s[ve]/Se,xe=ie/Se;if(this.s[ve]=Se,ve!==ne&&(ie=-xe*o[ve-1],o[ve-1]=Ce*o[ve-1]),u)for(var De=0;De<this.n;De++)Se=Ce*this.V[De][ve]+xe*this.V[De][S-1],this.V[De][S-1]=-xe*this.V[De][ve]+Ce*this.V[De][S-1],this.V[De][ve]=Se}}break;case 2:{var Le=o[ne-1];o[ne-1]=0;for(var Pe=ne;Pe<S;Pe++){var de=n.hypot(this.s[Pe],Le),_=this.s[Pe]/de,te=Le/de;if(this.s[Pe]=de,Le=-te*o[Pe],o[Pe]=_*o[Pe],l)for(var oe=0;oe<this.m;oe++)de=_*this.U[oe][Pe]+te*this.U[oe][ne-1],this.U[oe][ne-1]=-te*this.U[oe][Pe]+_*this.U[oe][ne-1],this.U[oe][Pe]=de}}break;case 3:{var z=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[S-1]),Math.abs(this.s[S-2])),Math.abs(o[S-2])),Math.abs(this.s[ne])),Math.abs(o[ne])),H=this.s[S-1]/z,re=this.s[S-2]/z,W=o[S-2]/z,ae=this.s[ne]/z,le=o[ne]/z,ye=((re+H)*(re-H)+W*W)/2,he=H*W*(H*W),fe=0;(function(He,Ue){return He||Ue})(ye!==0,he!==0)&&(fe=Math.sqrt(ye*ye+he),ye<0&&(fe=-fe),fe=he/(ye+fe));for(var pe=(ae+H)*(ae-H)+fe,ge=ae*le,me=ne;me<S-1;me++){var Ne=n.hypot(pe,ge),ze=pe/Ne,Oe=ge/Ne;if(me!==ne&&(o[me-1]=Ne),pe=ze*this.s[me]+Oe*o[me],o[me]=ze*o[me]-Oe*this.s[me],ge=Oe*this.s[me+1],this.s[me+1]=ze*this.s[me+1],u)for(var be=0;be<this.n;be++)Ne=ze*this.V[be][me]+Oe*this.V[be][me+1],this.V[be][me+1]=-Oe*this.V[be][me]+ze*this.V[be][me+1],this.V[be][me]=Ne;if(Ne=n.hypot(pe,ge),ze=pe/Ne,Oe=ge/Ne,this.s[me]=Ne,pe=ze*o[me]+Oe*this.s[me+1],this.s[me+1]=-Oe*o[me]+ze*this.s[me+1],ge=Oe*o[me+1],o[me+1]=ze*o[me+1],l&&me<this.m-1)for(var Me=0;Me<this.m;Me++)Ne=ze*this.U[Me][me]+Oe*this.U[Me][me+1],this.U[Me][me+1]=-Oe*this.U[Me][me]+ze*this.U[Me][me+1],this.U[Me][me]=Ne}o[S-2]=pe,ee=ee+1}break;case 4:{if(this.s[ne]<=0&&(this.s[ne]=this.s[ne]<0?-this.s[ne]:0,u))for(var Te=0;Te<=X;Te++)this.V[Te][ne]=-this.V[Te][ne];for(;ne<X&&!(this.s[ne]>=this.s[ne+1]);){var Ae=this.s[ne];if(this.s[ne]=this.s[ne+1],this.s[ne+1]=Ae,u&&ne<this.n-1)for(var We=0;We<this.n;We++)Ae=this.V[We][ne+1],this.V[We][ne+1]=this.V[We][ne],this.V[We][ne]=Ae;if(l&&ne<this.m-1)for(var Ke=0;Ke<this.m;Ke++)Ae=this.U[Ke][ne+1],this.U[Ke][ne+1]=this.U[Ke][ne],this.U[Ke][ne]=Ae;ne++}ee=0,S--}break}}var st={U:this.U,V:this.V,S:this.s};return st},n.hypot=function(a,i){var o=void 0;return Math.abs(a)>Math.abs(i)?(o=i/a,o=Math.abs(a)*Math.sqrt(1+o*o)):i!=0?(o=a/i,o=Math.abs(i)*Math.sqrt(1+o*o)):o=0,o},t.exports=n}),(function(t,e,r){"use strict";var n=(function(){function o(s,l){for(var u=0;u<l.length;u++){var f=l[u];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(s,f.key,f)}}return function(s,l,u){return l&&o(s.prototype,l),u&&o(s,u),s}})();function a(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")}var i=(function(){function o(s,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;a(this,o),this.sequence1=s,this.sequence2=l,this.match_score=u,this.mismatch_penalty=f,this.gap_penalty=c,this.iMax=s.length+1,this.jMax=l.length+1,this.grid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.grid[h]=new Array(this.jMax);for(var d=0;d<this.jMax;d++)this.grid[h][d]=0}this.tracebackGrid=new Array(this.iMax);for(var v=0;v<this.iMax;v++){this.tracebackGrid[v]=new Array(this.jMax);for(var p=0;p<this.jMax;p++)this.tracebackGrid[v][p]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return n(o,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var l=1;l<this.jMax;l++)this.grid[0][l]=this.grid[0][l-1]+this.gap_penalty,this.tracebackGrid[0][l]=[!1,!1,!0];for(var u=1;u<this.iMax;u++)this.grid[u][0]=this.grid[u-1][0]+this.gap_penalty,this.tracebackGrid[u][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var c=1;c<this.jMax;c++){var h=void 0;this.sequence1[f-1]===this.sequence2[c-1]?h=this.grid[f-1][c-1]+this.match_score:h=this.grid[f-1][c-1]+this.mismatch_penalty;var d=this.grid[f-1][c]+this.gap_penalty,v=this.grid[f][c-1]+this.gap_penalty,p=[h,d,v],m=this.arrayAllMaxIndexes(p);this.grid[f][c]=p[m[0]],this.tracebackGrid[f][c]=[m.includes(0),m.includes(1),m.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var l=[];for(l.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});l[0];){var u=l[0],f=this.tracebackGrid[u.pos[0]][u.pos[1]];f[0]&&l.push({pos:[u.pos[0]-1,u.pos[1]-1],seq1:this.sequence1[u.pos[0]-1]+u.seq1,seq2:this.sequence2[u.pos[1]-1]+u.seq2}),f[1]&&l.push({pos:[u.pos[0]-1,u.pos[1]],seq1:this.sequence1[u.pos[0]-1]+u.seq1,seq2:"-"+u.seq2}),f[2]&&l.push({pos:[u.pos[0],u.pos[1]-1],seq1:"-"+u.seq1,seq2:this.sequence2[u.pos[1]-1]+u.seq2}),u.pos[0]===0&&u.pos[1]===0&&this.alignments.push({sequence1:u.seq1,sequence2:u.seq2}),l.shift()}return this.alignments}},{key:"getAllIndexes",value:function(l,u){for(var f=[],c=-1;(c=l.indexOf(u,c+1))!==-1;)f.push(c);return f}},{key:"arrayAllMaxIndexes",value:function(l){return this.getAllIndexes(l,Math.max.apply(null,l))}}]),o})();t.exports=i}),(function(t,e,r){"use strict";var n=function(){};n.FDLayout=r(18),n.FDLayoutConstants=r(4),n.FDLayoutEdge=r(19),n.FDLayoutNode=r(20),n.DimensionD=r(21),n.HashMap=r(22),n.HashSet=r(23),n.IGeometry=r(8),n.IMath=r(9),n.Integer=r(10),n.Point=r(12),n.PointD=r(5),n.RandomSeed=r(16),n.RectangleD=r(13),n.Transform=r(17),n.UniqueIDGeneretor=r(14),n.Quicksort=r(25),n.LinkedList=r(11),n.LGraphObject=r(2),n.LGraph=r(6),n.LEdge=r(1),n.LGraphManager=r(7),n.LNode=r(3),n.Layout=r(15),n.LayoutConstants=r(0),n.NeedlemanWunsch=r(27),n.Matrix=r(24),n.SVD=r(26),t.exports=n}),(function(t,e,r){"use strict";function n(){this.listeners=[]}var a=n.prototype;a.addListener=function(i,o){this.listeners.push({event:i,callback:o})},a.removeListener=function(i,o){for(var s=this.listeners.length;s>=0;s--){var l=this.listeners[s];l.event===i&&l.callback===o&&this.listeners.splice(s,1)}},a.emit=function(i,o){for(var s=0;s<this.listeners.length;s++){var l=this.listeners[s];i===l.event&&l.callback(o)}},t.exports=n})])})});var vl=F((Li,dl)=>{(function(e,r){typeof Li=="object"&&typeof dl=="object"?dl.exports=r(hl()):typeof define=="function"&&define.amd?define(["layout-base"],r):typeof Li=="object"?Li.coseBase=r(hl()):e.coseBase=r(e.layoutBase)})(Li,function(t){return(()=>{"use strict";var e={45:((i,o,s)=>{var l={};l.layoutBase=s(551),l.CoSEConstants=s(806),l.CoSEEdge=s(767),l.CoSEGraph=s(880),l.CoSEGraphManager=s(578),l.CoSELayout=s(765),l.CoSENode=s(991),l.ConstraintHandler=s(902),i.exports=l}),806:((i,o,s)=>{var l=s(551).FDLayoutConstants;function u(){}for(var f in l)u[f]=l[f];u.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH,u.DEFAULT_COMPONENT_SEPERATION=60,u.TILE=!0,u.TILING_PADDING_VERTICAL=10,u.TILING_PADDING_HORIZONTAL=10,u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0,u.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,u.TREE_REDUCTION_ON_INCREMENTAL=!0,u.PURE_INCREMENTAL=u.DEFAULT_INCREMENTAL,i.exports=u}),767:((i,o,s)=>{var l=s(551).FDLayoutEdge;function u(c,h,d){l.call(this,c,h,d)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u}),880:((i,o,s)=>{var l=s(551).LGraph;function u(c,h,d){l.call(this,c,h,d)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u}),578:((i,o,s)=>{var l=s(551).LGraphManager;function u(c){l.call(this,c)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u}),765:((i,o,s)=>{var l=s(551).FDLayout,u=s(578),f=s(880),c=s(991),h=s(767),d=s(806),v=s(902),p=s(551).FDLayoutConstants,m=s(551).LayoutConstants,g=s(551).Point,y=s(551).PointD,b=s(551).DimensionD,x=s(551).Layout,C=s(551).Integer,O=s(551).IGeometry,L=s(551).LGraph,A=s(551).Transform,I=s(551).LinkedList;function D(){l.call(this),this.toBeTiled={},this.constraints={}}D.prototype=Object.create(l.prototype);for(var M in l)D[M]=l[M];D.prototype.newGraphManager=function(){var E=new u(this);return this.graphManager=E,E},D.prototype.newGraph=function(E){return new f(null,this.graphManager,E)},D.prototype.newNode=function(E){return new c(this.graphManager,E)},D.prototype.newEdge=function(E){return new h(null,null,E)},D.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.isSubLayout||(d.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=d.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=d.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=p.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=p.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=p.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},D.prototype.initSpringEmbedder=function(){l.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/p.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},D.prototype.layout=function(){var E=m.DEFAULT_CREATE_BENDS_AS_NEEDED;return E&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(d.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var S=new Set(this.getAllNodes()),w=this.nodesWithGravity.filter(function(R){return S.has(R)});this.graphManager.setAllNodesToApplyGravitation(w)}}else{var E=this.getFlatForest();if(E.length>0)this.positionNodesRadially(E);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var S=new Set(this.getAllNodes()),w=this.nodesWithGravity.filter(function(N){return S.has(N)});this.graphManager.setAllNodesToApplyGravitation(w),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(v.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),d.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},D.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%p.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),S=this.nodesWithGravity.filter(function(T){return E.has(T)});this.graphManager.setAllNodesToApplyGravitation(S),this.graphManager.updateBounds(),this.updateGrid(),d.PURE_INCREMENTAL?this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),d.PURE_INCREMENTAL?this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var w=!this.isTreeGrowing&&!this.isGrowthFinished,N=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(w,N),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var E=this.graphManager.getAllNodes(),S={},w=0;w<E.length;w++){var N=E[w].rect,T=E[w].id;S[T]={id:T,x:N.getCenterX(),y:N.getCenterY(),w:N.width,h:N.height}}return S},D.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var E=!1;if(p.ANIMATE==="during")this.emit("layoutstarted");else{for(;!E;)E=this.tick();this.graphManager.updateBounds()}},D.prototype.moveNodes=function(){for(var E=this.getAllNodes(),S,w=0;w<E.length;w++)S=E[w],S.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var w=0;w<E.length;w++)S=E[w],S.move()},D.prototype.initConstraintVariables=function(){var E=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var S=this.graphManager.getAllNodes(),w=0;w<S.length;w++){var N=S[w];this.idToNodeMap.set(N.id,N)}var T=function G($){for(var q=$.getChild().getNodes(),X,ee=0,ce=0;ce<q.length;ce++)X=q[ce],X.getChild()==null?E.fixedNodeSet.has(X.id)&&(ee+=100):ee+=G(X);return ee};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(q){E.fixedNodeSet.add(q.nodeId)});for(var S=this.graphManager.getAllNodes(),N,w=0;w<S.length;w++)if(N=S[w],N.getChild()!=null){var R=T(N);R>0&&(N.fixedNodeWeight=R)}}if(this.constraints.relativePlacementConstraint){var P=new Map,k=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(G){E.fixedNodesOnHorizontal.add(G),E.fixedNodesOnVertical.add(G)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var U=this.constraints.alignmentConstraint.vertical,w=0;w<U.length;w++)this.dummyToNodeForVerticalAlignment.set("dummy"+w,[]),U[w].forEach(function($){P.set($,"dummy"+w),E.dummyToNodeForVerticalAlignment.get("dummy"+w).push($),E.fixedNodeSet.has($)&&E.fixedNodesOnHorizontal.add("dummy"+w)});if(this.constraints.alignmentConstraint.horizontal)for(var B=this.constraints.alignmentConstraint.horizontal,w=0;w<B.length;w++)this.dummyToNodeForHorizontalAlignment.set("dummy"+w,[]),B[w].forEach(function($){k.set($,"dummy"+w),E.dummyToNodeForHorizontalAlignment.get("dummy"+w).push($),E.fixedNodeSet.has($)&&E.fixedNodesOnVertical.add("dummy"+w)})}if(d.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(G){var $,q,X;for(X=G.length-1;X>=2*G.length/3;X--)$=Math.floor(Math.random()*(X+1)),q=G[X],G[X]=G[$],G[$]=q;return G},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(G){if(G.left){var $=P.has(G.left)?P.get(G.left):G.left,q=P.has(G.right)?P.get(G.right):G.right;E.nodesInRelativeHorizontal.includes($)||(E.nodesInRelativeHorizontal.push($),E.nodeToRelativeConstraintMapHorizontal.set($,[]),E.dummyToNodeForVerticalAlignment.has($)?E.nodeToTempPositionMapHorizontal.set($,E.idToNodeMap.get(E.dummyToNodeForVerticalAlignment.get($)[0]).getCenterX()):E.nodeToTempPositionMapHorizontal.set($,E.idToNodeMap.get($).getCenterX())),E.nodesInRelativeHorizontal.includes(q)||(E.nodesInRelativeHorizontal.push(q),E.nodeToRelativeConstraintMapHorizontal.set(q,[]),E.dummyToNodeForVerticalAlignment.has(q)?E.nodeToTempPositionMapHorizontal.set(q,E.idToNodeMap.get(E.dummyToNodeForVerticalAlignment.get(q)[0]).getCenterX()):E.nodeToTempPositionMapHorizontal.set(q,E.idToNodeMap.get(q).getCenterX())),E.nodeToRelativeConstraintMapHorizontal.get($).push({right:q,gap:G.gap}),E.nodeToRelativeConstraintMapHorizontal.get(q).push({left:$,gap:G.gap})}else{var X=k.has(G.top)?k.get(G.top):G.top,ee=k.has(G.bottom)?k.get(G.bottom):G.bottom;E.nodesInRelativeVertical.includes(X)||(E.nodesInRelativeVertical.push(X),E.nodeToRelativeConstraintMapVertical.set(X,[]),E.dummyToNodeForHorizontalAlignment.has(X)?E.nodeToTempPositionMapVertical.set(X,E.idToNodeMap.get(E.dummyToNodeForHorizontalAlignment.get(X)[0]).getCenterY()):E.nodeToTempPositionMapVertical.set(X,E.idToNodeMap.get(X).getCenterY())),E.nodesInRelativeVertical.includes(ee)||(E.nodesInRelativeVertical.push(ee),E.nodeToRelativeConstraintMapVertical.set(ee,[]),E.dummyToNodeForHorizontalAlignment.has(ee)?E.nodeToTempPositionMapVertical.set(ee,E.idToNodeMap.get(E.dummyToNodeForHorizontalAlignment.get(ee)[0]).getCenterY()):E.nodeToTempPositionMapVertical.set(ee,E.idToNodeMap.get(ee).getCenterY())),E.nodeToRelativeConstraintMapVertical.get(X).push({bottom:ee,gap:G.gap}),E.nodeToRelativeConstraintMapVertical.get(ee).push({top:X,gap:G.gap})}});else{var V=new Map,j=new Map;this.constraints.relativePlacementConstraint.forEach(function(G){if(G.left){var $=P.has(G.left)?P.get(G.left):G.left,q=P.has(G.right)?P.get(G.right):G.right;V.has($)?V.get($).push(q):V.set($,[q]),V.has(q)?V.get(q).push($):V.set(q,[$])}else{var X=k.has(G.top)?k.get(G.top):G.top,ee=k.has(G.bottom)?k.get(G.bottom):G.bottom;j.has(X)?j.get(X).push(ee):j.set(X,[ee]),j.has(ee)?j.get(ee).push(X):j.set(ee,[X])}});var Y=function($,q){var X=[],ee=[],ce=new I,Ee=new Set,ne=0;return $.forEach(function(Q,se){if(!Ee.has(se)){X[ne]=[],ee[ne]=!1;var J=se;for(ce.push(J),Ee.add(J),X[ne].push(J);ce.length!=0;){J=ce.shift(),q.has(J)&&(ee[ne]=!0);var ie=$.get(J);ie.forEach(function(ve){Ee.has(ve)||(ce.push(ve),Ee.add(ve),X[ne].push(ve))})}ne++}}),{components:X,isFixed:ee}},Z=Y(V,E.fixedNodesOnHorizontal);this.componentsOnHorizontal=Z.components,this.fixedComponentsOnHorizontal=Z.isFixed;var K=Y(j,E.fixedNodesOnVertical);this.componentsOnVertical=K.components,this.fixedComponentsOnVertical=K.isFixed}}},D.prototype.updateDisplacements=function(){var E=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(K){var G=E.idToNodeMap.get(K.nodeId);G.displacementX=0,G.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var S=this.constraints.alignmentConstraint.vertical,w=0;w<S.length;w++){for(var N=0,T=0;T<S[w].length;T++){if(this.fixedNodeSet.has(S[w][T])){N=0;break}N+=this.idToNodeMap.get(S[w][T]).displacementX}for(var R=N/S[w].length,T=0;T<S[w].length;T++)this.idToNodeMap.get(S[w][T]).displacementX=R}if(this.constraints.alignmentConstraint.horizontal)for(var P=this.constraints.alignmentConstraint.horizontal,w=0;w<P.length;w++){for(var k=0,T=0;T<P[w].length;T++){if(this.fixedNodeSet.has(P[w][T])){k=0;break}k+=this.idToNodeMap.get(P[w][T]).displacementY}for(var U=k/P[w].length,T=0;T<P[w].length;T++)this.idToNodeMap.get(P[w][T]).displacementY=U}}if(this.constraints.relativePlacementConstraint)if(d.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(K){if(!E.fixedNodesOnHorizontal.has(K)){var G=0;E.dummyToNodeForVerticalAlignment.has(K)?G=E.idToNodeMap.get(E.dummyToNodeForVerticalAlignment.get(K)[0]).displacementX:G=E.idToNodeMap.get(K).displacementX,E.nodeToRelativeConstraintMapHorizontal.get(K).forEach(function($){if($.right){var q=E.nodeToTempPositionMapHorizontal.get($.right)-E.nodeToTempPositionMapHorizontal.get(K)-G;q<$.gap&&(G-=$.gap-q)}else{var q=E.nodeToTempPositionMapHorizontal.get(K)-E.nodeToTempPositionMapHorizontal.get($.left)+G;q<$.gap&&(G+=$.gap-q)}}),E.nodeToTempPositionMapHorizontal.set(K,E.nodeToTempPositionMapHorizontal.get(K)+G),E.dummyToNodeForVerticalAlignment.has(K)?E.dummyToNodeForVerticalAlignment.get(K).forEach(function($){E.idToNodeMap.get($).displacementX=G}):E.idToNodeMap.get(K).displacementX=G}}),this.nodesInRelativeVertical.forEach(function(K){if(!E.fixedNodesOnHorizontal.has(K)){var G=0;E.dummyToNodeForHorizontalAlignment.has(K)?G=E.idToNodeMap.get(E.dummyToNodeForHorizontalAlignment.get(K)[0]).displacementY:G=E.idToNodeMap.get(K).displacementY,E.nodeToRelativeConstraintMapVertical.get(K).forEach(function($){if($.bottom){var q=E.nodeToTempPositionMapVertical.get($.bottom)-E.nodeToTempPositionMapVertical.get(K)-G;q<$.gap&&(G-=$.gap-q)}else{var q=E.nodeToTempPositionMapVertical.get(K)-E.nodeToTempPositionMapVertical.get($.top)+G;q<$.gap&&(G+=$.gap-q)}}),E.nodeToTempPositionMapVertical.set(K,E.nodeToTempPositionMapVertical.get(K)+G),E.dummyToNodeForHorizontalAlignment.has(K)?E.dummyToNodeForHorizontalAlignment.get(K).forEach(function($){E.idToNodeMap.get($).displacementY=G}):E.idToNodeMap.get(K).displacementY=G}});else{for(var w=0;w<this.componentsOnHorizontal.length;w++){var B=this.componentsOnHorizontal[w];if(this.fixedComponentsOnHorizontal[w])for(var T=0;T<B.length;T++)this.dummyToNodeForVerticalAlignment.has(B[T])?this.dummyToNodeForVerticalAlignment.get(B[T]).forEach(function($){E.idToNodeMap.get($).displacementX=0}):this.idToNodeMap.get(B[T]).displacementX=0;else{for(var V=0,j=0,T=0;T<B.length;T++)if(this.dummyToNodeForVerticalAlignment.has(B[T])){var Y=this.dummyToNodeForVerticalAlignment.get(B[T]);V+=Y.length*this.idToNodeMap.get(Y[0]).displacementX,j+=Y.length}else V+=this.idToNodeMap.get(B[T]).displacementX,j++;for(var Z=V/j,T=0;T<B.length;T++)this.dummyToNodeForVerticalAlignment.has(B[T])?this.dummyToNodeForVerticalAlignment.get(B[T]).forEach(function($){E.idToNodeMap.get($).displacementX=Z}):this.idToNodeMap.get(B[T]).displacementX=Z}}for(var w=0;w<this.componentsOnVertical.length;w++){var B=this.componentsOnVertical[w];if(this.fixedComponentsOnVertical[w])for(var T=0;T<B.length;T++)this.dummyToNodeForHorizontalAlignment.has(B[T])?this.dummyToNodeForHorizontalAlignment.get(B[T]).forEach(function(q){E.idToNodeMap.get(q).displacementY=0}):this.idToNodeMap.get(B[T]).displacementY=0;else{for(var V=0,j=0,T=0;T<B.length;T++)if(this.dummyToNodeForHorizontalAlignment.has(B[T])){var Y=this.dummyToNodeForHorizontalAlignment.get(B[T]);V+=Y.length*this.idToNodeMap.get(Y[0]).displacementY,j+=Y.length}else V+=this.idToNodeMap.get(B[T]).displacementY,j++;for(var Z=V/j,T=0;T<B.length;T++)this.dummyToNodeForHorizontalAlignment.has(B[T])?this.dummyToNodeForHorizontalAlignment.get(B[T]).forEach(function(ce){E.idToNodeMap.get(ce).displacementY=Z}):this.idToNodeMap.get(B[T]).displacementY=Z}}}},D.prototype.calculateNodesToApplyGravitationTo=function(){var E=[],S,w=this.graphManager.getGraphs(),N=w.length,T;for(T=0;T<N;T++)S=w[T],S.updateConnected(),S.isConnected||(E=E.concat(S.getNodes()));return E},D.prototype.createBendpoints=function(){var E=[];E=E.concat(this.graphManager.getAllEdges());var S=new Set,w;for(w=0;w<E.length;w++){var N=E[w];if(!S.has(N)){var T=N.getSource(),R=N.getTarget();if(T==R)N.getBendpoints().push(new y),N.getBendpoints().push(new y),this.createDummyNodesForBendpoints(N),S.add(N);else{var P=[];if(P=P.concat(T.getEdgeListToNode(R)),P=P.concat(R.getEdgeListToNode(T)),!S.has(P[0])){if(P.length>1){var k;for(k=0;k<P.length;k++){var U=P[k];U.getBendpoints().push(new y),this.createDummyNodesForBendpoints(U)}}P.forEach(function(B){S.add(B)})}}}if(S.size==E.length)break}},D.prototype.positionNodesRadially=function(E){for(var S=new g(0,0),w=Math.ceil(Math.sqrt(E.length)),N=0,T=0,R=0,P=new y(0,0),k=0;k<E.length;k++){k%w==0&&(R=0,T=N,k!=0&&(T+=d.DEFAULT_COMPONENT_SEPERATION),N=0);var U=E[k],B=x.findCenterOfTree(U);S.x=R,S.y=T,P=D.radialLayout(U,B,S),P.y>N&&(N=Math.floor(P.y)),R=Math.floor(P.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new y(m.WORLD_CENTER_X-P.x/2,m.WORLD_CENTER_Y-P.y/2))},D.radialLayout=function(E,S,w){var N=Math.max(this.maxDiagonalInTree(E),d.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(S,null,0,359,0,N);var T=L.calculateBounds(E),R=new A;R.setDeviceOrgX(T.getMinX()),R.setDeviceOrgY(T.getMinY()),R.setWorldOrgX(w.x),R.setWorldOrgY(w.y);for(var P=0;P<E.length;P++){var k=E[P];k.transform(R)}var U=new y(T.getMaxX(),T.getMaxY());return R.inverseTransformPoint(U)},D.branchRadialLayout=function(E,S,w,N,T,R){var P=(N-w+1)/2;P<0&&(P+=180);var k=(P+w)%360,U=k*O.TWO_PI/360,B=Math.cos(U),V=T*Math.cos(U),j=T*Math.sin(U);E.setCenter(V,j);var Y=[];Y=Y.concat(E.getEdges());var Z=Y.length;S!=null&&Z--;for(var K=0,G=Y.length,$,q=E.getEdgesBetween(S);q.length>1;){var X=q[0];q.splice(0,1);var ee=Y.indexOf(X);ee>=0&&Y.splice(ee,1),G--,Z--}S!=null?$=(Y.indexOf(q[0])+1)%G:$=0;for(var ce=Math.abs(N-w)/Z,Ee=$;K!=Z;Ee=++Ee%G){var ne=Y[Ee].getOtherEnd(E);if(ne!=S){var Q=(w+K*ce)%360,se=(Q+ce)%360;D.branchRadialLayout(ne,E,Q,se,T+R,R),K++}}},D.maxDiagonalInTree=function(E){for(var S=C.MIN_VALUE,w=0;w<E.length;w++){var N=E[w],T=N.getDiagonal();T>S&&(S=T)}return S},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var E=this,S={};this.memberGroups={},this.idToDummyNode={};for(var w=[],N=this.graphManager.getAllNodes(),T=0;T<N.length;T++){var R=N[T],P=R.getParent();this.getNodeDegreeWithChildren(R)===0&&(P.id==null||!this.getToBeTiled(P))&&w.push(R)}for(var T=0;T<w.length;T++){var R=w[T],k=R.getParent().id;typeof S[k]>"u"&&(S[k]=[]),S[k]=S[k].concat(R)}Object.keys(S).forEach(function(U){if(S[U].length>1){var B="DummyCompound_"+U;E.memberGroups[B]=S[U];var V=S[U][0].getParent(),j=new c(E.graphManager);j.id=B,j.paddingLeft=V.paddingLeft||0,j.paddingRight=V.paddingRight||0,j.paddingBottom=V.paddingBottom||0,j.paddingTop=V.paddingTop||0,E.idToDummyNode[B]=j;var Y=E.getGraphManager().add(E.newGraph(),j),Z=V.getChild();Z.add(j);for(var K=0;K<S[U].length;K++){var G=S[U][K];Z.remove(G),Y.add(G)}}})},D.prototype.clearCompounds=function(){var E={},S={};this.performDFSOnCompounds();for(var w=0;w<this.compoundOrder.length;w++)S[this.compoundOrder[w].id]=this.compoundOrder[w],E[this.compoundOrder[w].id]=[].concat(this.compoundOrder[w].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[w].getChild()),this.compoundOrder[w].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(E,S)},D.prototype.clearZeroDegreeMembers=function(){var E=this,S=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(w){var N=E.idToDummyNode[w];if(S[w]=E.tileNodes(E.memberGroups[w],N.paddingLeft+N.paddingRight),N.rect.width=S[w].width,N.rect.height=S[w].height,N.setCenter(S[w].centerX,S[w].centerY),N.labelMarginLeft=0,N.labelMarginTop=0,d.NODE_DIMENSIONS_INCLUDE_LABELS){var T=N.rect.width,R=N.rect.height;N.labelWidth&&(N.labelPosHorizontal=="left"?(N.rect.x-=N.labelWidth,N.setWidth(T+N.labelWidth),N.labelMarginLeft=N.labelWidth):N.labelPosHorizontal=="center"&&N.labelWidth>T?(N.rect.x-=(N.labelWidth-T)/2,N.setWidth(N.labelWidth),N.labelMarginLeft=(N.labelWidth-T)/2):N.labelPosHorizontal=="right"&&N.setWidth(T+N.labelWidth)),N.labelHeight&&(N.labelPosVertical=="top"?(N.rect.y-=N.labelHeight,N.setHeight(R+N.labelHeight),N.labelMarginTop=N.labelHeight):N.labelPosVertical=="center"&&N.labelHeight>R?(N.rect.y-=(N.labelHeight-R)/2,N.setHeight(N.labelHeight),N.labelMarginTop=(N.labelHeight-R)/2):N.labelPosVertical=="bottom"&&N.setHeight(R+N.labelHeight))}})},D.prototype.repopulateCompounds=function(){for(var E=this.compoundOrder.length-1;E>=0;E--){var S=this.compoundOrder[E],w=S.id,N=S.paddingLeft,T=S.paddingTop,R=S.labelMarginLeft,P=S.labelMarginTop;this.adjustLocations(this.tiledMemberPack[w],S.rect.x,S.rect.y,N,T,R,P)}},D.prototype.repopulateZeroDegreeMembers=function(){var E=this,S=this.tiledZeroDegreePack;Object.keys(S).forEach(function(w){var N=E.idToDummyNode[w],T=N.paddingLeft,R=N.paddingTop,P=N.labelMarginLeft,k=N.labelMarginTop;E.adjustLocations(S[w],N.rect.x,N.rect.y,T,R,P,k)})},D.prototype.getToBeTiled=function(E){var S=E.id;if(this.toBeTiled[S]!=null)return this.toBeTiled[S];var w=E.getChild();if(w==null)return this.toBeTiled[S]=!1,!1;for(var N=w.getNodes(),T=0;T<N.length;T++){var R=N[T];if(this.getNodeDegree(R)>0)return this.toBeTiled[S]=!1,!1;if(R.getChild()==null){this.toBeTiled[R.id]=!1;continue}if(!this.getToBeTiled(R))return this.toBeTiled[S]=!1,!1}return this.toBeTiled[S]=!0,!0},D.prototype.getNodeDegree=function(E){for(var S=E.id,w=E.getEdges(),N=0,T=0;T<w.length;T++){var R=w[T];R.getSource().id!==R.getTarget().id&&(N=N+1)}return N},D.prototype.getNodeDegreeWithChildren=function(E){var S=this.getNodeDegree(E);if(E.getChild()==null)return S;for(var w=E.getChild().getNodes(),N=0;N<w.length;N++){var T=w[N];S+=this.getNodeDegreeWithChildren(T)}return S},D.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},D.prototype.fillCompexOrderByDFS=function(E){for(var S=0;S<E.length;S++){var w=E[S];w.getChild()!=null&&this.fillCompexOrderByDFS(w.getChild().getNodes()),this.getToBeTiled(w)&&this.compoundOrder.push(w)}},D.prototype.adjustLocations=function(E,S,w,N,T,R,P){S+=N+R,w+=T+P;for(var k=S,U=0;U<E.rows.length;U++){var B=E.rows[U];S=k;for(var V=0,j=0;j<B.length;j++){var Y=B[j];Y.rect.x=S,Y.rect.y=w,S+=Y.rect.width+E.horizontalPadding,Y.rect.height>V&&(V=Y.rect.height)}w+=V+E.verticalPadding}},D.prototype.tileCompoundMembers=function(E,S){var w=this;this.tiledMemberPack=[],Object.keys(E).forEach(function(N){var T=S[N];if(w.tiledMemberPack[N]=w.tileNodes(E[N],T.paddingLeft+T.paddingRight),T.rect.width=w.tiledMemberPack[N].width,T.rect.height=w.tiledMemberPack[N].height,T.setCenter(w.tiledMemberPack[N].centerX,w.tiledMemberPack[N].centerY),T.labelMarginLeft=0,T.labelMarginTop=0,d.NODE_DIMENSIONS_INCLUDE_LABELS){var R=T.rect.width,P=T.rect.height;T.labelWidth&&(T.labelPosHorizontal=="left"?(T.rect.x-=T.labelWidth,T.setWidth(R+T.labelWidth),T.labelMarginLeft=T.labelWidth):T.labelPosHorizontal=="center"&&T.labelWidth>R?(T.rect.x-=(T.labelWidth-R)/2,T.setWidth(T.labelWidth),T.labelMarginLeft=(T.labelWidth-R)/2):T.labelPosHorizontal=="right"&&T.setWidth(R+T.labelWidth)),T.labelHeight&&(T.labelPosVertical=="top"?(T.rect.y-=T.labelHeight,T.setHeight(P+T.labelHeight),T.labelMarginTop=T.labelHeight):T.labelPosVertical=="center"&&T.labelHeight>P?(T.rect.y-=(T.labelHeight-P)/2,T.setHeight(T.labelHeight),T.labelMarginTop=(T.labelHeight-P)/2):T.labelPosVertical=="bottom"&&T.setHeight(P+T.labelHeight))}})},D.prototype.tileNodes=function(E,S){var w=this.tileNodesByFavoringDim(E,S,!0),N=this.tileNodesByFavoringDim(E,S,!1),T=this.getOrgRatio(w),R=this.getOrgRatio(N),P;return R<T?P=N:P=w,P},D.prototype.getOrgRatio=function(E){var S=E.width,w=E.height,N=S/w;return N<1&&(N=1/N),N},D.prototype.calcIdealRowWidth=function(E,S){var w=d.TILING_PADDING_VERTICAL,N=d.TILING_PADDING_HORIZONTAL,T=E.length,R=0,P=0,k=0;E.forEach(function(K){R+=K.getWidth(),P+=K.getHeight(),K.getWidth()>k&&(k=K.getWidth())});var U=R/T,B=P/T,V=Math.pow(w-N,2)+4*(U+N)*(B+w)*T,j=(N-w+Math.sqrt(V))/(2*(U+N)),Y;S?(Y=Math.ceil(j),Y==j&&Y++):Y=Math.floor(j);var Z=Y*(U+N)-N;return k>Z&&(Z=k),Z+=N*2,Z},D.prototype.tileNodesByFavoringDim=function(E,S,w){var N=d.TILING_PADDING_VERTICAL,T=d.TILING_PADDING_HORIZONTAL,R=d.TILING_COMPARE_BY,P={rows:[],rowWidth:[],rowHeight:[],width:0,height:S,verticalPadding:N,horizontalPadding:T,centerX:0,centerY:0};R&&(P.idealRowWidth=this.calcIdealRowWidth(E,w));var k=function(G){return G.rect.width*G.rect.height},U=function(G,$){return k($)-k(G)};E.sort(function(K,G){var $=U;return P.idealRowWidth?($=R,$(K.id,G.id)):$(K,G)});for(var B=0,V=0,j=0;j<E.length;j++){var Y=E[j];B+=Y.getCenterX(),V+=Y.getCenterY()}P.centerX=B/E.length,P.centerY=V/E.length;for(var j=0;j<E.length;j++){var Y=E[j];if(P.rows.length==0)this.insertNodeToRow(P,Y,0,S);else if(this.canAddHorizontal(P,Y.rect.width,Y.rect.height)){var Z=P.rows.length-1;P.idealRowWidth||(Z=this.getShortestRowIndex(P)),this.insertNodeToRow(P,Y,Z,S)}else this.insertNodeToRow(P,Y,P.rows.length,S);this.shiftToLastRow(P)}return P},D.prototype.insertNodeToRow=function(E,S,w,N){var T=N;if(w==E.rows.length){var R=[];E.rows.push(R),E.rowWidth.push(T),E.rowHeight.push(0)}var P=E.rowWidth[w]+S.rect.width;E.rows[w].length>0&&(P+=E.horizontalPadding),E.rowWidth[w]=P,E.width<P&&(E.width=P);var k=S.rect.height;w>0&&(k+=E.verticalPadding);var U=0;k>E.rowHeight[w]&&(U=E.rowHeight[w],E.rowHeight[w]=k,U=E.rowHeight[w]-U),E.height+=U,E.rows[w].push(S)},D.prototype.getShortestRowIndex=function(E){for(var S=-1,w=Number.MAX_VALUE,N=0;N<E.rows.length;N++)E.rowWidth[N]<w&&(S=N,w=E.rowWidth[N]);return S},D.prototype.getLongestRowIndex=function(E){for(var S=-1,w=Number.MIN_VALUE,N=0;N<E.rows.length;N++)E.rowWidth[N]>w&&(S=N,w=E.rowWidth[N]);return S},D.prototype.canAddHorizontal=function(E,S,w){if(E.idealRowWidth){var N=E.rows.length-1,T=E.rowWidth[N];return T+S+E.horizontalPadding<=E.idealRowWidth}var R=this.getShortestRowIndex(E);if(R<0)return!0;var P=E.rowWidth[R];if(P+E.horizontalPadding+S<=E.width)return!0;var k=0;E.rowHeight[R]<w&&R>0&&(k=w+E.verticalPadding-E.rowHeight[R]);var U;E.width-P>=S+E.horizontalPadding?U=(E.height+k)/(P+S+E.horizontalPadding):U=(E.height+k)/E.width,k=w+E.verticalPadding;var B;return E.width<S?B=(E.height+k)/S:B=(E.height+k)/E.width,B<1&&(B=1/B),U<1&&(U=1/U),U<B},D.prototype.shiftToLastRow=function(E){var S=this.getLongestRowIndex(E),w=E.rowWidth.length-1,N=E.rows[S],T=N[N.length-1],R=T.width+E.horizontalPadding;if(E.width-E.rowWidth[w]>R&&S!=w){N.splice(-1,1),E.rows[w].push(T),E.rowWidth[S]=E.rowWidth[S]-R,E.rowWidth[w]=E.rowWidth[w]+R,E.width=E.rowWidth[instance.getLongestRowIndex(E)];for(var P=Number.MIN_VALUE,k=0;k<N.length;k++)N[k].height>P&&(P=N[k].height);S>0&&(P+=E.verticalPadding);var U=E.rowHeight[S]+E.rowHeight[w];E.rowHeight[S]=P,E.rowHeight[w]<T.height+E.verticalPadding&&(E.rowHeight[w]=T.height+E.verticalPadding);var B=E.rowHeight[S]+E.rowHeight[w];E.height+=B-U,this.shiftToLastRow(E)}},D.prototype.tilingPreLayout=function(){d.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},D.prototype.tilingPostLayout=function(){d.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},D.prototype.reduceTrees=function(){for(var E=[],S=!0,w;S;){var N=this.graphManager.getAllNodes(),T=[];S=!1;for(var R=0;R<N.length;R++)if(w=N[R],w.getEdges().length==1&&!w.getEdges()[0].isInterGraph&&w.getChild()==null){if(d.PURE_INCREMENTAL){var P=w.getEdges()[0].getOtherEnd(w),k=new b(w.getCenterX()-P.getCenterX(),w.getCenterY()-P.getCenterY());T.push([w,w.getEdges()[0],w.getOwner(),k])}else T.push([w,w.getEdges()[0],w.getOwner()]);S=!0}if(S==!0){for(var U=[],B=0;B<T.length;B++)T[B][0].getEdges().length==1&&(U.push(T[B]),T[B][0].getOwner().remove(T[B][0]));E.push(U),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=E},D.prototype.growTree=function(E){for(var S=E.length,w=E[S-1],N,T=0;T<w.length;T++)N=w[T],this.findPlaceforPrunedNode(N),N[2].add(N[0]),N[2].add(N[1],N[1].source,N[1].target);E.splice(E.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},D.prototype.findPlaceforPrunedNode=function(E){var S,w,N=E[0];if(N==E[1].source?w=E[1].target:w=E[1].source,d.PURE_INCREMENTAL)N.setCenter(w.getCenterX()+E[3].getWidth(),w.getCenterY()+E[3].getHeight());else{var T=w.startX,R=w.finishX,P=w.startY,k=w.finishY,U=0,B=0,V=0,j=0,Y=[U,V,B,j];if(P>0)for(var Z=T;Z<=R;Z++)Y[0]+=this.grid[Z][P-1].length+this.grid[Z][P].length-1;if(R<this.grid.length-1)for(var Z=P;Z<=k;Z++)Y[1]+=this.grid[R+1][Z].length+this.grid[R][Z].length-1;if(k<this.grid[0].length-1)for(var Z=T;Z<=R;Z++)Y[2]+=this.grid[Z][k+1].length+this.grid[Z][k].length-1;if(T>0)for(var Z=P;Z<=k;Z++)Y[3]+=this.grid[T-1][Z].length+this.grid[T][Z].length-1;for(var K=C.MAX_VALUE,G,$,q=0;q<Y.length;q++)Y[q]<K?(K=Y[q],G=1,$=q):Y[q]==K&&G++;if(G==3&&K==0)Y[0]==0&&Y[1]==0&&Y[2]==0?S=1:Y[0]==0&&Y[1]==0&&Y[3]==0?S=0:Y[0]==0&&Y[2]==0&&Y[3]==0?S=3:Y[1]==0&&Y[2]==0&&Y[3]==0&&(S=2);else if(G==2&&K==0){var X=Math.floor(Math.random()*2);Y[0]==0&&Y[1]==0?X==0?S=0:S=1:Y[0]==0&&Y[2]==0?X==0?S=0:S=2:Y[0]==0&&Y[3]==0?X==0?S=0:S=3:Y[1]==0&&Y[2]==0?X==0?S=1:S=2:Y[1]==0&&Y[3]==0?X==0?S=1:S=3:X==0?S=2:S=3}else if(G==4&&K==0){var X=Math.floor(Math.random()*4);S=X}else S=$;S==0?N.setCenter(w.getCenterX(),w.getCenterY()-w.getHeight()/2-p.DEFAULT_EDGE_LENGTH-N.getHeight()/2):S==1?N.setCenter(w.getCenterX()+w.getWidth()/2+p.DEFAULT_EDGE_LENGTH+N.getWidth()/2,w.getCenterY()):S==2?N.setCenter(w.getCenterX(),w.getCenterY()+w.getHeight()/2+p.DEFAULT_EDGE_LENGTH+N.getHeight()/2):N.setCenter(w.getCenterX()-w.getWidth()/2-p.DEFAULT_EDGE_LENGTH-N.getWidth()/2,w.getCenterY())}},i.exports=D}),991:((i,o,s)=>{var l=s(551).FDLayoutNode,u=s(551).IMath;function f(h,d,v,p){l.call(this,h,d,v,p)}f.prototype=Object.create(l.prototype);for(var c in l)f[c]=l[c];f.prototype.calculateDisplacement=function(){var h=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(h,d){for(var v=this.getChild().getNodes(),p,m=0;m<v.length;m++)p=v[m],p.getChild()==null?(p.displacementX+=h,p.displacementY+=d):p.propogateDisplacementToChildren(h,d)},f.prototype.move=function(){var h=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.setPred1=function(h){this.pred1=h},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(h){this.next=h},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(h){this.processed=h},f.prototype.isProcessed=function(){return processed},i.exports=f}),902:((i,o,s)=>{function l(v){if(Array.isArray(v)){for(var p=0,m=Array(v.length);p<v.length;p++)m[p]=v[p];return m}else return Array.from(v)}var u=s(806),f=s(551).LinkedList,c=s(551).Matrix,h=s(551).SVD;function d(){}d.handleConstraints=function(v){var p={};p.fixedNodeConstraint=v.constraints.fixedNodeConstraint,p.alignmentConstraint=v.constraints.alignmentConstraint,p.relativePlacementConstraint=v.constraints.relativePlacementConstraint;for(var m=new Map,g=new Map,y=[],b=[],x=v.getAllNodes(),C=0,O=0;O<x.length;O++){var L=x[O];L.getChild()==null&&(g.set(L.id,C++),y.push(L.getCenterX()),b.push(L.getCenterY()),m.set(L.id,L))}p.relativePlacementConstraint&&p.relativePlacementConstraint.forEach(function(z){!z.gap&&z.gap!=0&&(z.left?z.gap=u.DEFAULT_EDGE_LENGTH+m.get(z.left).getWidth()/2+m.get(z.right).getWidth()/2:z.gap=u.DEFAULT_EDGE_LENGTH+m.get(z.top).getHeight()/2+m.get(z.bottom).getHeight()/2)});var A=function(H,re){return{x:H.x-re.x,y:H.y-re.y}},I=function(H){var re=0,W=0;return H.forEach(function(ae){re+=y[g.get(ae)],W+=b[g.get(ae)]}),{x:re/H.size,y:W/H.size}},D=function(H,re,W,ae,le){function ye(Oe,be){var Me=new Set(Oe),Te=!0,Ae=!1,We=void 0;try{for(var Ke=be[Symbol.iterator](),st;!(Te=(st=Ke.next()).done);Te=!0){var He=st.value;Me.add(He)}}catch(Ue){Ae=!0,We=Ue}finally{try{!Te&&Ke.return&&Ke.return()}finally{if(Ae)throw We}}return Me}var he=new Map;H.forEach(function(Oe,be){he.set(be,0)}),H.forEach(function(Oe,be){Oe.forEach(function(Me){he.set(Me.id,he.get(Me.id)+1)})});var fe=new Map,pe=new Map,ge=new f;he.forEach(function(Oe,be){Oe==0?(ge.push(be),W||(re=="horizontal"?fe.set(be,g.has(be)?y[g.get(be)]:ae.get(be)):fe.set(be,g.has(be)?b[g.get(be)]:ae.get(be)))):fe.set(be,Number.NEGATIVE_INFINITY),W&&pe.set(be,new Set([be]))}),W&&le.forEach(function(Oe){var be=[];if(Oe.forEach(function(Ae){W.has(Ae)&&be.push(Ae)}),be.length>0){var Me=0;be.forEach(function(Ae){re=="horizontal"?(fe.set(Ae,g.has(Ae)?y[g.get(Ae)]:ae.get(Ae)),Me+=fe.get(Ae)):(fe.set(Ae,g.has(Ae)?b[g.get(Ae)]:ae.get(Ae)),Me+=fe.get(Ae))}),Me=Me/be.length,Oe.forEach(function(Ae){W.has(Ae)||fe.set(Ae,Me)})}else{var Te=0;Oe.forEach(function(Ae){re=="horizontal"?Te+=g.has(Ae)?y[g.get(Ae)]:ae.get(Ae):Te+=g.has(Ae)?b[g.get(Ae)]:ae.get(Ae)}),Te=Te/Oe.length,Oe.forEach(function(Ae){fe.set(Ae,Te)})}});for(var me=function(){var be=ge.shift(),Me=H.get(be);Me.forEach(function(Te){if(fe.get(Te.id)<fe.get(be)+Te.gap)if(W&&W.has(Te.id)){var Ae=void 0;if(re=="horizontal"?Ae=g.has(Te.id)?y[g.get(Te.id)]:ae.get(Te.id):Ae=g.has(Te.id)?b[g.get(Te.id)]:ae.get(Te.id),fe.set(Te.id,Ae),Ae<fe.get(be)+Te.gap){var We=fe.get(be)+Te.gap-Ae;pe.get(be).forEach(function(Ke){fe.set(Ke,fe.get(Ke)-We)})}}else fe.set(Te.id,fe.get(be)+Te.gap);he.set(Te.id,he.get(Te.id)-1),he.get(Te.id)==0&&ge.push(Te.id),W&&pe.set(Te.id,ye(pe.get(be),pe.get(Te.id)))})};ge.length!=0;)me();if(W){var Ne=new Set;H.forEach(function(Oe,be){Oe.length==0&&Ne.add(be)});var ze=[];pe.forEach(function(Oe,be){if(Ne.has(be)){var Me=!1,Te=!0,Ae=!1,We=void 0;try{for(var Ke=Oe[Symbol.iterator](),st;!(Te=(st=Ke.next()).done);Te=!0){var He=st.value;W.has(He)&&(Me=!0)}}catch(Ve){Ae=!0,We=Ve}finally{try{!Te&&Ke.return&&Ke.return()}finally{if(Ae)throw We}}if(!Me){var Ue=!1,yt=void 0;ze.forEach(function(Ve,je){Ve.has([].concat(l(Oe))[0])&&(Ue=!0,yt=je)}),Ue?Oe.forEach(function(Ve){ze[yt].add(Ve)}):ze.push(new Set(Oe))}}}),ze.forEach(function(Oe,be){var Me=Number.POSITIVE_INFINITY,Te=Number.POSITIVE_INFINITY,Ae=Number.NEGATIVE_INFINITY,We=Number.NEGATIVE_INFINITY,Ke=!0,st=!1,He=void 0;try{for(var Ue=Oe[Symbol.iterator](),yt;!(Ke=(yt=Ue.next()).done);Ke=!0){var Ve=yt.value,je=void 0;re=="horizontal"?je=g.has(Ve)?y[g.get(Ve)]:ae.get(Ve):je=g.has(Ve)?b[g.get(Ve)]:ae.get(Ve);var it=fe.get(Ve);je<Me&&(Me=je),je>Ae&&(Ae=je),it<Te&&(Te=it),it>We&&(We=it)}}catch($r){st=!0,He=$r}finally{try{!Ke&&Ue.return&&Ue.return()}finally{if(st)throw He}}var Gr=(Me+Ae)/2-(Te+We)/2,St=!0,Nr=!1,Vr=void 0;try{for(var Or=Oe[Symbol.iterator](),Kn;!(St=(Kn=Or.next()).done);St=!0){var Hr=Kn.value;fe.set(Hr,fe.get(Hr)+Gr)}}catch($r){Nr=!0,Vr=$r}finally{try{!St&&Or.return&&Or.return()}finally{if(Nr)throw Vr}}})}return fe},M=function(H){var re=0,W=0,ae=0,le=0;if(H.forEach(function(pe){pe.left?y[g.get(pe.left)]-y[g.get(pe.right)]>=0?re++:W++:b[g.get(pe.top)]-b[g.get(pe.bottom)]>=0?ae++:le++}),re>W&&ae>le)for(var ye=0;ye<g.size;ye++)y[ye]=-1*y[ye],b[ye]=-1*b[ye];else if(re>W)for(var he=0;he<g.size;he++)y[he]=-1*y[he];else if(ae>le)for(var fe=0;fe<g.size;fe++)b[fe]=-1*b[fe]},E=function(H){var re=[],W=new f,ae=new Set,le=0;return H.forEach(function(ye,he){if(!ae.has(he)){re[le]=[];var fe=he;for(W.push(fe),ae.add(fe),re[le].push(fe);W.length!=0;){fe=W.shift();var pe=H.get(fe);pe.forEach(function(ge){ae.has(ge.id)||(W.push(ge.id),ae.add(ge.id),re[le].push(ge.id))})}le++}}),re},S=function(H){var re=new Map;return H.forEach(function(W,ae){re.set(ae,[])}),H.forEach(function(W,ae){W.forEach(function(le){re.get(ae).push(le),re.get(le.id).push({id:ae,gap:le.gap,direction:le.direction})})}),re},w=function(H){var re=new Map;return H.forEach(function(W,ae){re.set(ae,[])}),H.forEach(function(W,ae){W.forEach(function(le){re.get(le.id).push({id:ae,gap:le.gap,direction:le.direction})})}),re},N=[],T=[],R=!1,P=!1,k=new Set,U=new Map,B=new Map,V=[];if(p.fixedNodeConstraint&&p.fixedNodeConstraint.forEach(function(z){k.add(z.nodeId)}),p.relativePlacementConstraint&&(p.relativePlacementConstraint.forEach(function(z){z.left?(U.has(z.left)?U.get(z.left).push({id:z.right,gap:z.gap,direction:"horizontal"}):U.set(z.left,[{id:z.right,gap:z.gap,direction:"horizontal"}]),U.has(z.right)||U.set(z.right,[])):(U.has(z.top)?U.get(z.top).push({id:z.bottom,gap:z.gap,direction:"vertical"}):U.set(z.top,[{id:z.bottom,gap:z.gap,direction:"vertical"}]),U.has(z.bottom)||U.set(z.bottom,[]))}),B=S(U),V=E(B)),u.TRANSFORM_ON_CONSTRAINT_HANDLING){if(p.fixedNodeConstraint&&p.fixedNodeConstraint.length>1)p.fixedNodeConstraint.forEach(function(z,H){N[H]=[z.position.x,z.position.y],T[H]=[y[g.get(z.nodeId)],b[g.get(z.nodeId)]]}),R=!0;else if(p.alignmentConstraint)(function(){var z=0;if(p.alignmentConstraint.vertical){for(var H=p.alignmentConstraint.vertical,re=function(fe){var pe=new Set;H[fe].forEach(function(Ne){pe.add(Ne)});var ge=new Set([].concat(l(pe)).filter(function(Ne){return k.has(Ne)})),me=void 0;ge.size>0?me=y[g.get(ge.values().next().value)]:me=I(pe).x,H[fe].forEach(function(Ne){N[z]=[me,b[g.get(Ne)]],T[z]=[y[g.get(Ne)],b[g.get(Ne)]],z++})},W=0;W<H.length;W++)re(W);R=!0}if(p.alignmentConstraint.horizontal){for(var ae=p.alignmentConstraint.horizontal,le=function(fe){var pe=new Set;ae[fe].forEach(function(Ne){pe.add(Ne)});var ge=new Set([].concat(l(pe)).filter(function(Ne){return k.has(Ne)})),me=void 0;ge.size>0?me=y[g.get(ge.values().next().value)]:me=I(pe).y,ae[fe].forEach(function(Ne){N[z]=[y[g.get(Ne)],me],T[z]=[y[g.get(Ne)],b[g.get(Ne)]],z++})},ye=0;ye<ae.length;ye++)le(ye);R=!0}p.relativePlacementConstraint&&(P=!0)})();else if(p.relativePlacementConstraint){for(var j=0,Y=0,Z=0;Z<V.length;Z++)V[Z].length>j&&(j=V[Z].length,Y=Z);if(j<B.size/2)M(p.relativePlacementConstraint),R=!1,P=!1;else{var K=new Map,G=new Map,$=[];V[Y].forEach(function(z){U.get(z).forEach(function(H){H.direction=="horizontal"?(K.has(z)?K.get(z).push(H):K.set(z,[H]),K.has(H.id)||K.set(H.id,[]),$.push({left:z,right:H.id})):(G.has(z)?G.get(z).push(H):G.set(z,[H]),G.has(H.id)||G.set(H.id,[]),$.push({top:z,bottom:H.id}))})}),M($),P=!1;var q=D(K,"horizontal"),X=D(G,"vertical");V[Y].forEach(function(z,H){T[H]=[y[g.get(z)],b[g.get(z)]],N[H]=[],q.has(z)?N[H][0]=q.get(z):N[H][0]=y[g.get(z)],X.has(z)?N[H][1]=X.get(z):N[H][1]=b[g.get(z)]}),R=!0}}if(R){for(var ee=void 0,ce=c.transpose(N),Ee=c.transpose(T),ne=0;ne<ce.length;ne++)ce[ne]=c.multGamma(ce[ne]),Ee[ne]=c.multGamma(Ee[ne]);var Q=c.multMat(ce,c.transpose(Ee)),se=h.svd(Q);ee=c.multMat(se.V,c.transpose(se.U));for(var J=0;J<g.size;J++){var ie=[y[J],b[J]],ve=[ee[0][0],ee[1][0]],Se=[ee[0][1],ee[1][1]];y[J]=c.dotProduct(ie,ve),b[J]=c.dotProduct(ie,Se)}P&&M(p.relativePlacementConstraint)}}if(u.ENFORCE_CONSTRAINTS){if(p.fixedNodeConstraint&&p.fixedNodeConstraint.length>0){var Ce={x:0,y:0};p.fixedNodeConstraint.forEach(function(z,H){var re={x:y[g.get(z.nodeId)],y:b[g.get(z.nodeId)]},W=z.position,ae=A(W,re);Ce.x+=ae.x,Ce.y+=ae.y}),Ce.x/=p.fixedNodeConstraint.length,Ce.y/=p.fixedNodeConstraint.length,y.forEach(function(z,H){y[H]+=Ce.x}),b.forEach(function(z,H){b[H]+=Ce.y}),p.fixedNodeConstraint.forEach(function(z){y[g.get(z.nodeId)]=z.position.x,b[g.get(z.nodeId)]=z.position.y})}if(p.alignmentConstraint){if(p.alignmentConstraint.vertical)for(var xe=p.alignmentConstraint.vertical,De=function(H){var re=new Set;xe[H].forEach(function(le){re.add(le)});var W=new Set([].concat(l(re)).filter(function(le){return k.has(le)})),ae=void 0;W.size>0?ae=y[g.get(W.values().next().value)]:ae=I(re).x,re.forEach(function(le){k.has(le)||(y[g.get(le)]=ae)})},Le=0;Le<xe.length;Le++)De(Le);if(p.alignmentConstraint.horizontal)for(var Pe=p.alignmentConstraint.horizontal,de=function(H){var re=new Set;Pe[H].forEach(function(le){re.add(le)});var W=new Set([].concat(l(re)).filter(function(le){return k.has(le)})),ae=void 0;W.size>0?ae=b[g.get(W.values().next().value)]:ae=I(re).y,re.forEach(function(le){k.has(le)||(b[g.get(le)]=ae)})},_=0;_<Pe.length;_++)de(_)}p.relativePlacementConstraint&&(function(){var z=new Map,H=new Map,re=new Map,W=new Map,ae=new Map,le=new Map,ye=new Set,he=new Set;if(k.forEach(function(bt){ye.add(bt),he.add(bt)}),p.alignmentConstraint){if(p.alignmentConstraint.vertical)for(var fe=p.alignmentConstraint.vertical,pe=function(Be){re.set("dummy"+Be,[]),fe[Be].forEach(function(Ge){z.set(Ge,"dummy"+Be),re.get("dummy"+Be).push(Ge),k.has(Ge)&&ye.add("dummy"+Be)}),ae.set("dummy"+Be,y[g.get(fe[Be][0])])},ge=0;ge<fe.length;ge++)pe(ge);if(p.alignmentConstraint.horizontal)for(var me=p.alignmentConstraint.horizontal,Ne=function(Be){W.set("dummy"+Be,[]),me[Be].forEach(function(Ge){H.set(Ge,"dummy"+Be),W.get("dummy"+Be).push(Ge),k.has(Ge)&&he.add("dummy"+Be)}),le.set("dummy"+Be,b[g.get(me[Be][0])])},ze=0;ze<me.length;ze++)Ne(ze)}var Oe=new Map,be=new Map,Me=function(Be){U.get(Be).forEach(function(Ge){var hr=void 0,Qt=void 0;Ge.direction=="horizontal"?(hr=z.get(Be)?z.get(Be):Be,z.get(Ge.id)?Qt={id:z.get(Ge.id),gap:Ge.gap,direction:Ge.direction}:Qt=Ge,Oe.has(hr)?Oe.get(hr).push(Qt):Oe.set(hr,[Qt]),Oe.has(Qt.id)||Oe.set(Qt.id,[])):(hr=H.get(Be)?H.get(Be):Be,H.get(Ge.id)?Qt={id:H.get(Ge.id),gap:Ge.gap,direction:Ge.direction}:Qt=Ge,be.has(hr)?be.get(hr).push(Qt):be.set(hr,[Qt]),be.has(Qt.id)||be.set(Qt.id,[]))})},Te=!0,Ae=!1,We=void 0;try{for(var Ke=U.keys()[Symbol.iterator](),st;!(Te=(st=Ke.next()).done);Te=!0){var He=st.value;Me(He)}}catch(bt){Ae=!0,We=bt}finally{try{!Te&&Ke.return&&Ke.return()}finally{if(Ae)throw We}}var Ue=S(Oe),yt=S(be),Ve=E(Ue),je=E(yt),it=w(Oe),Gr=w(be),St=[],Nr=[];Ve.forEach(function(bt,Be){St[Be]=[],bt.forEach(function(Ge){it.get(Ge).length==0&&St[Be].push(Ge)})}),je.forEach(function(bt,Be){Nr[Be]=[],bt.forEach(function(Ge){Gr.get(Ge).length==0&&Nr[Be].push(Ge)})});var Vr=D(Oe,"horizontal",ye,ae,St),Or=D(be,"vertical",he,le,Nr),Kn=function(Be){re.get(Be)?re.get(Be).forEach(function(Ge){y[g.get(Ge)]=Vr.get(Be)}):y[g.get(Be)]=Vr.get(Be)},Hr=!0,$r=!1,yo=void 0;try{for(var $a=Vr.keys()[Symbol.iterator](),Yr;!(Hr=(Yr=$a.next()).done);Hr=!0){var mn=Yr.value;Kn(mn)}}catch(bt){$r=!0,yo=bt}finally{try{!Hr&&$a.return&&$a.return()}finally{if($r)throw yo}}var jn=function(Be){W.get(Be)?W.get(Be).forEach(function(Ge){b[g.get(Ge)]=Or.get(Be)}):b[g.get(Be)]=Or.get(Be)},Zn=!0,Ya=!1,mo=void 0;try{for(var zt=Or.keys()[Symbol.iterator](),Qn;!(Zn=(Qn=zt.next()).done);Zn=!0){var mn=Qn.value;jn(mn)}}catch(bt){Ya=!0,mo=bt}finally{try{!Zn&&zt.return&&zt.return()}finally{if(Ya)throw mo}}})()}for(var te=0;te<x.length;te++){var oe=x[te];oe.getChild()==null&&oe.setCenter(y[g.get(oe.id)],b[g.get(oe.id)])}},i.exports=d}),551:(i=>{i.exports=t})},r={};function n(i){var o=r[i];if(o!==void 0)return o.exports;var s=r[i]={exports:{}};return e[i](s,s.exports,n),s.exports}var a=n(45);return a})()})});var Cv=F((Ni,pl)=>{(function(e,r){typeof Ni=="object"&&typeof pl=="object"?pl.exports=r(vl()):typeof define=="function"&&define.amd?define(["cose-base"],r):typeof Ni=="object"?Ni.cytoscapeFcose=r(vl()):e.cytoscapeFcose=r(e.coseBase)})(Ni,function(t){return(()=>{"use strict";var e={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(o){for(var s=arguments.length,l=Array(s>1?s-1:0),u=1;u<s;u++)l[u-1]=arguments[u];return l.forEach(function(f){Object.keys(f).forEach(function(c){return o[c]=f[c]})}),o}}),548:((i,o,s)=>{var l=(function(){function c(h,d){var v=[],p=!0,m=!1,g=void 0;try{for(var y=h[Symbol.iterator](),b;!(p=(b=y.next()).done)&&(v.push(b.value),!(d&&v.length===d));p=!0);}catch(x){m=!0,g=x}finally{try{!p&&y.return&&y.return()}finally{if(m)throw g}}return v}return function(h,d){if(Array.isArray(h))return h;if(Symbol.iterator in Object(h))return c(h,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),u=s(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(c){for(var h={},d=0;d<c.length;d++)h[c[d].id()]=!0;var v=c.filter(function(p,m){typeof p=="number"&&(p=m);for(var g=p.parent()[0];g!=null;){if(h[g.id()])return!1;g=g.parent()[0]}return!0});return v},f.connectComponents=function(c,h,d,v){var p=new u,m=new Set,g=[],y=void 0,b=void 0,x=void 0,C=!1,O=1,L=[],A=[],I=function(){var M=c.collection();A.push(M);var E=d[0],S=c.collection();S.merge(E).merge(E.descendants().intersection(h)),g.push(E),S.forEach(function(T){p.push(T),m.add(T),M.merge(T)});for(var w=function(){E=p.shift();var R=c.collection();E.neighborhood().nodes().forEach(function(B){h.intersection(E.edgesWith(B)).length>0&&R.merge(B)});for(var P=0;P<R.length;P++){var k=R[P];if(y=d.intersection(k.union(k.ancestors())),y!=null&&!m.has(y[0])){var U=y.union(y.descendants());U.forEach(function(B){p.push(B),m.add(B),M.merge(B),d.has(B)&&g.push(B)})}}};p.length!=0;)w();if(M.forEach(function(T){h.intersection(T.connectedEdges()).forEach(function(R){M.has(R.source())&&M.has(R.target())&&M.merge(R)})}),g.length==d.length&&(C=!0),!C||C&&O>1){b=g[0],x=b.connectedEdges().length,g.forEach(function(T){T.connectedEdges().length<x&&(x=T.connectedEdges().length,b=T)}),L.push(b.id());var N=c.collection();N.merge(g[0]),g.forEach(function(T){N.merge(T)}),g=[],d=d.difference(N),O++}};do I();while(!C);return v&&L.length>0&&v.set("dummy"+(v.size+1),L),A},f.relocateComponent=function(c,h,d){if(!d.fixedNodeConstraint){var v=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY,m=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(d.quality=="draft"){var y=!0,b=!1,x=void 0;try{for(var C=h.nodeIndexes[Symbol.iterator](),O;!(y=(O=C.next()).done);y=!0){var L=O.value,A=l(L,2),I=A[0],D=A[1],M=d.cy.getElementById(I);if(M){var E=M.boundingBox(),S=h.xCoords[D]-E.w/2,w=h.xCoords[D]+E.w/2,N=h.yCoords[D]-E.h/2,T=h.yCoords[D]+E.h/2;S<v&&(v=S),w>p&&(p=w),N<m&&(m=N),T>g&&(g=T)}}}catch(B){b=!0,x=B}finally{try{!y&&C.return&&C.return()}finally{if(b)throw x}}var R=c.x-(p+v)/2,P=c.y-(g+m)/2;h.xCoords=h.xCoords.map(function(B){return B+R}),h.yCoords=h.yCoords.map(function(B){return B+P})}else{Object.keys(h).forEach(function(B){var V=h[B],j=V.getRect().x,Y=V.getRect().x+V.getRect().width,Z=V.getRect().y,K=V.getRect().y+V.getRect().height;j<v&&(v=j),Y>p&&(p=Y),Z<m&&(m=Z),K>g&&(g=K)});var k=c.x-(p+v)/2,U=c.y-(g+m)/2;Object.keys(h).forEach(function(B){var V=h[B];V.setCenter(V.getCenterX()+k,V.getCenterY()+U)})}}},f.calcBoundingBox=function(c,h,d,v){for(var p=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,b=void 0,x=void 0,C=void 0,O=void 0,L=c.descendants().not(":parent"),A=L.length,I=0;I<A;I++){var D=L[I];b=h[v.get(D.id())]-D.width()/2,x=h[v.get(D.id())]+D.width()/2,C=d[v.get(D.id())]-D.height()/2,O=d[v.get(D.id())]+D.height()/2,p>b&&(p=b),m<x&&(m=x),g>C&&(g=C),y<O&&(y=O)}var M={};return M.topLeftX=p,M.topLeftY=g,M.width=m-p,M.height=y-g,M},f.calcParentsWithoutChildren=function(c,h){var d=c.collection();return h.nodes(":parent").forEach(function(v){var p=!1;v.children().forEach(function(m){m.css("display")!="none"&&(p=!0)}),p||d.merge(v)}),d},i.exports=f}),816:((i,o,s)=>{var l=s(548),u=s(140).CoSELayout,f=s(140).CoSENode,c=s(140).layoutBase.PointD,h=s(140).layoutBase.DimensionD,d=s(140).layoutBase.LayoutConstants,v=s(140).layoutBase.FDLayoutConstants,p=s(140).CoSEConstants,m=function(y,b){var x=y.cy,C=y.eles,O=C.nodes(),L=C.edges(),A=void 0,I=void 0,D=void 0,M={};y.randomize&&(A=b.nodeIndexes,I=b.xCoords,D=b.yCoords);var E=function(B){return typeof B=="function"},S=function(B,V){return E(B)?B(V):B},w=l.calcParentsWithoutChildren(x,C),N=function U(B,V,j,Y){for(var Z=V.length,K=0;K<Z;K++){var G=V[K],$=null;G.intersection(w).length==0&&($=G.children());var q=void 0,X=G.layoutDimensions({nodeDimensionsIncludeLabels:Y.nodeDimensionsIncludeLabels});if(G.outerWidth()!=null&&G.outerHeight()!=null)if(Y.randomize)if(!G.isParent())q=B.add(new f(j.graphManager,new c(I[A.get(G.id())]-X.w/2,D[A.get(G.id())]-X.h/2),new h(parseFloat(X.w),parseFloat(X.h))));else{var ee=l.calcBoundingBox(G,I,D,A);G.intersection(w).length==0?q=B.add(new f(j.graphManager,new c(ee.topLeftX,ee.topLeftY),new h(ee.width,ee.height))):q=B.add(new f(j.graphManager,new c(ee.topLeftX,ee.topLeftY),new h(parseFloat(X.w),parseFloat(X.h))))}else q=B.add(new f(j.graphManager,new c(G.position("x")-X.w/2,G.position("y")-X.h/2),new h(parseFloat(X.w),parseFloat(X.h))));else q=B.add(new f(this.graphManager));if(q.id=G.data("id"),q.nodeRepulsion=S(Y.nodeRepulsion,G),q.paddingLeft=parseInt(G.css("padding")),q.paddingTop=parseInt(G.css("padding")),q.paddingRight=parseInt(G.css("padding")),q.paddingBottom=parseInt(G.css("padding")),Y.nodeDimensionsIncludeLabels&&(q.labelWidth=G.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,q.labelHeight=G.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,q.labelPosVertical=G.css("text-valign"),q.labelPosHorizontal=G.css("text-halign")),M[G.data("id")]=q,isNaN(q.rect.x)&&(q.rect.x=0),isNaN(q.rect.y)&&(q.rect.y=0),$!=null&&$.length>0){var ce=void 0;ce=j.getGraphManager().add(j.newGraph(),q),U(ce,$,j,Y)}}},T=function(B,V,j){for(var Y=0,Z=0,K=0;K<j.length;K++){var G=j[K],$=M[G.data("source")],q=M[G.data("target")];if($&&q&&$!==q&&$.getEdgesBetween(q).length==0){var X=V.add(B.newEdge(),$,q);X.id=G.id(),X.idealLength=S(y.idealEdgeLength,G),X.edgeElasticity=S(y.edgeElasticity,G),Y+=X.idealLength,Z++}}y.idealEdgeLength!=null&&(Z>0?p.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=Y/Z:E(y.idealEdgeLength)?p.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=50:p.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=y.idealEdgeLength,p.MIN_REPULSION_DIST=v.MIN_REPULSION_DIST=v.DEFAULT_EDGE_LENGTH/10,p.DEFAULT_RADIAL_SEPARATION=v.DEFAULT_EDGE_LENGTH)},R=function(B,V){V.fixedNodeConstraint&&(B.constraints.fixedNodeConstraint=V.fixedNodeConstraint),V.alignmentConstraint&&(B.constraints.alignmentConstraint=V.alignmentConstraint),V.relativePlacementConstraint&&(B.constraints.relativePlacementConstraint=V.relativePlacementConstraint)};y.nestingFactor!=null&&(p.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(p.DEFAULT_GRAVITY_STRENGTH=v.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(p.MAX_ITERATIONS=v.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(p.DEFAULT_GRAVITY_RANGE_FACTOR=v.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(p.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(p.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.tilingCompareBy!=null&&(p.TILING_COMPARE_BY=y.tilingCompareBy),y.quality=="proof"?d.QUALITY=2:d.QUALITY=0,p.NODE_DIMENSIONS_INCLUDE_LABELS=v.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,p.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=!y.randomize,p.ANIMATE=v.ANIMATE=d.ANIMATE=y.animate,p.TILE=y.tile,p.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,p.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal,p.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=!0,p.PURE_INCREMENTAL=!y.randomize,d.DEFAULT_UNIFORM_LEAF_NODE_SIZES=y.uniformNodeDimensions,y.step=="transformed"&&(p.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,p.ENFORCE_CONSTRAINTS=!1,p.APPLY_LAYOUT=!1),y.step=="enforced"&&(p.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,p.ENFORCE_CONSTRAINTS=!0,p.APPLY_LAYOUT=!1),y.step=="cose"&&(p.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,p.ENFORCE_CONSTRAINTS=!1,p.APPLY_LAYOUT=!0),y.step=="all"&&(y.randomize?p.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:p.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,p.ENFORCE_CONSTRAINTS=!0,p.APPLY_LAYOUT=!0),y.fixedNodeConstraint||y.alignmentConstraint||y.relativePlacementConstraint?p.TREE_REDUCTION_ON_INCREMENTAL=!1:p.TREE_REDUCTION_ON_INCREMENTAL=!0;var P=new u,k=P.newGraphManager();return N(k.addRoot(),l.getTopMostNodes(O),P,y),T(P,k,L),R(P,y),P.runLayout(),M};i.exports={coseLayout:m}}),212:((i,o,s)=>{var l=(function(){function y(b,x){for(var C=0;C<x.length;C++){var O=x[C];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(b,O.key,O)}}return function(b,x,C){return x&&y(b.prototype,x),C&&y(b,C),b}})();function u(y,b){if(!(y instanceof b))throw new TypeError("Cannot call a class as a function")}var f=s(658),c=s(548),h=s(657),d=h.spectralLayout,v=s(816),p=v.coseLayout,m=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(b){return 4500},idealEdgeLength:function(b){return 50},edgeElasticity:function(b){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),g=(function(){function y(b){u(this,y),this.options=f({},m,b)}return l(y,[{key:"run",value:function(){var x=this,C=this.options,O=C.cy,L=C.eles,A=[],I=void 0,D=void 0,M=[],E=void 0,S=[];C.fixedNodeConstraint&&(!Array.isArray(C.fixedNodeConstraint)||C.fixedNodeConstraint.length==0)&&(C.fixedNodeConstraint=void 0),C.alignmentConstraint&&(C.alignmentConstraint.vertical&&(!Array.isArray(C.alignmentConstraint.vertical)||C.alignmentConstraint.vertical.length==0)&&(C.alignmentConstraint.vertical=void 0),C.alignmentConstraint.horizontal&&(!Array.isArray(C.alignmentConstraint.horizontal)||C.alignmentConstraint.horizontal.length==0)&&(C.alignmentConstraint.horizontal=void 0)),C.relativePlacementConstraint&&(!Array.isArray(C.relativePlacementConstraint)||C.relativePlacementConstraint.length==0)&&(C.relativePlacementConstraint=void 0);var w=C.fixedNodeConstraint||C.alignmentConstraint||C.relativePlacementConstraint;w&&(C.tile=!1,C.packComponents=!1);var N=void 0,T=!1;if(O.layoutUtilities&&C.packComponents&&(N=O.layoutUtilities("get"),N||(N=O.layoutUtilities()),T=!0),L.nodes().length>0)if(T){var k=c.getTopMostNodes(C.eles.nodes());if(E=c.connectComponents(O,C.eles,k),E.forEach(function(J){var ie=J.boundingBox();S.push({x:ie.x1+ie.w/2,y:ie.y1+ie.h/2})}),C.randomize&&E.forEach(function(J){C.eles=J,A.push(d(C))}),C.quality=="default"||C.quality=="proof"){var U=O.collection();if(C.tile){var B=new Map,V=[],j=[],Y=0,Z={nodeIndexes:B,xCoords:V,yCoords:j},K=[];if(E.forEach(function(J,ie){J.edges().length==0&&(J.nodes().forEach(function(ve,Se){U.merge(J.nodes()[Se]),ve.isParent()||(Z.nodeIndexes.set(J.nodes()[Se].id(),Y++),Z.xCoords.push(J.nodes()[0].position().x),Z.yCoords.push(J.nodes()[0].position().y))}),K.push(ie))}),U.length>1){var G=U.boundingBox();S.push({x:G.x1+G.w/2,y:G.y1+G.h/2}),E.push(U),A.push(Z);for(var $=K.length-1;$>=0;$--)E.splice(K[$],1),A.splice(K[$],1),S.splice(K[$],1)}}E.forEach(function(J,ie){C.eles=J,M.push(p(C,A[ie])),c.relocateComponent(S[ie],M[ie],C)})}else E.forEach(function(J,ie){c.relocateComponent(S[ie],A[ie],C)});var q=new Set;if(E.length>1){var X=[],ee=L.filter(function(J){return J.css("display")=="none"});E.forEach(function(J,ie){var ve=void 0;if(C.quality=="draft"&&(ve=A[ie].nodeIndexes),J.nodes().not(ee).length>0){var Se={};Se.edges=[],Se.nodes=[];var Ce=void 0;J.nodes().not(ee).forEach(function(xe){if(C.quality=="draft")if(!xe.isParent())Ce=ve.get(xe.id()),Se.nodes.push({x:A[ie].xCoords[Ce]-xe.boundingbox().w/2,y:A[ie].yCoords[Ce]-xe.boundingbox().h/2,width:xe.boundingbox().w,height:xe.boundingbox().h});else{var De=c.calcBoundingBox(xe,A[ie].xCoords,A[ie].yCoords,ve);Se.nodes.push({x:De.topLeftX,y:De.topLeftY,width:De.width,height:De.height})}else M[ie][xe.id()]&&Se.nodes.push({x:M[ie][xe.id()].getLeft(),y:M[ie][xe.id()].getTop(),width:M[ie][xe.id()].getWidth(),height:M[ie][xe.id()].getHeight()})}),J.edges().forEach(function(xe){var De=xe.source(),Le=xe.target();if(De.css("display")!="none"&&Le.css("display")!="none")if(C.quality=="draft"){var Pe=ve.get(De.id()),de=ve.get(Le.id()),_=[],te=[];if(De.isParent()){var oe=c.calcBoundingBox(De,A[ie].xCoords,A[ie].yCoords,ve);_.push(oe.topLeftX+oe.width/2),_.push(oe.topLeftY+oe.height/2)}else _.push(A[ie].xCoords[Pe]),_.push(A[ie].yCoords[Pe]);if(Le.isParent()){var z=c.calcBoundingBox(Le,A[ie].xCoords,A[ie].yCoords,ve);te.push(z.topLeftX+z.width/2),te.push(z.topLeftY+z.height/2)}else te.push(A[ie].xCoords[de]),te.push(A[ie].yCoords[de]);Se.edges.push({startX:_[0],startY:_[1],endX:te[0],endY:te[1]})}else M[ie][De.id()]&&M[ie][Le.id()]&&Se.edges.push({startX:M[ie][De.id()].getCenterX(),startY:M[ie][De.id()].getCenterY(),endX:M[ie][Le.id()].getCenterX(),endY:M[ie][Le.id()].getCenterY()})}),Se.nodes.length>0&&(X.push(Se),q.add(ie))}});var ce=N.packComponents(X,C.randomize).shifts;if(C.quality=="draft")A.forEach(function(J,ie){var ve=J.xCoords.map(function(Ce){return Ce+ce[ie].dx}),Se=J.yCoords.map(function(Ce){return Ce+ce[ie].dy});J.xCoords=ve,J.yCoords=Se});else{var Ee=0;q.forEach(function(J){Object.keys(M[J]).forEach(function(ie){var ve=M[J][ie];ve.setCenter(ve.getCenterX()+ce[Ee].dx,ve.getCenterY()+ce[Ee].dy)}),Ee++})}}}else{var R=C.eles.boundingBox();if(S.push({x:R.x1+R.w/2,y:R.y1+R.h/2}),C.randomize){var P=d(C);A.push(P)}C.quality=="default"||C.quality=="proof"?(M.push(p(C,A[0])),c.relocateComponent(S[0],M[0],C)):c.relocateComponent(S[0],A[0],C)}var ne=function(ie,ve){if(C.quality=="default"||C.quality=="proof"){typeof ie=="number"&&(ie=ve);var Se=void 0,Ce=void 0,xe=ie.data("id");return M.forEach(function(Le){xe in Le&&(Se={x:Le[xe].getRect().getCenterX(),y:Le[xe].getRect().getCenterY()},Ce=Le[xe])}),C.nodeDimensionsIncludeLabels&&(Ce.labelWidth&&(Ce.labelPosHorizontal=="left"?Se.x+=Ce.labelWidth/2:Ce.labelPosHorizontal=="right"&&(Se.x-=Ce.labelWidth/2)),Ce.labelHeight&&(Ce.labelPosVertical=="top"?Se.y+=Ce.labelHeight/2:Ce.labelPosVertical=="bottom"&&(Se.y-=Ce.labelHeight/2))),Se==null&&(Se={x:ie.position("x"),y:ie.position("y")}),{x:Se.x,y:Se.y}}else{var De=void 0;return A.forEach(function(Le){var Pe=Le.nodeIndexes.get(ie.id());Pe!=null&&(De={x:Le.xCoords[Pe],y:Le.yCoords[Pe]})}),De==null&&(De={x:ie.position("x"),y:ie.position("y")}),{x:De.x,y:De.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var Q=c.calcParentsWithoutChildren(O,L),se=L.filter(function(J){return J.css("display")=="none"});C.eles=L.not(se),L.nodes().not(":parent").not(se).layoutPositions(x,C,ne),Q.length>0&&Q.forEach(function(J){J.position(ne(J))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),y})();i.exports=g}),657:((i,o,s)=>{var l=s(548),u=s(140).layoutBase.Matrix,f=s(140).layoutBase.SVD,c=function(d){var v=d.cy,p=d.eles,m=p.nodes(),g=p.nodes(":parent"),y=new Map,b=new Map,x=new Map,C=[],O=[],L=[],A=[],I=[],D=[],M=[],E=[],S=void 0,w=void 0,N=1e8,T=1e-9,R=d.piTol,P=d.samplingType,k=d.nodeSeparation,U=void 0,B=function(){for(var re=0,W=0,ae=!1;W<U;){re=Math.floor(Math.random()*w),ae=!1;for(var le=0;le<W;le++)if(A[le]==re){ae=!0;break}if(!ae)A[W]=re,W++;else continue}},V=function(re,W,ae){for(var le=[],ye=0,he=0,fe=0,pe=void 0,ge=[],me=0,Ne=1,ze=0;ze<w;ze++)ge[ze]=N;for(le[he]=re,ge[re]=0;he>=ye;){fe=le[ye++];for(var Oe=C[fe],be=0;be<Oe.length;be++)pe=b.get(Oe[be]),ge[pe]==N&&(ge[pe]=ge[fe]+1,le[++he]=pe);D[fe][W]=ge[fe]*k}if(ae){for(var Me=0;Me<w;Me++)D[Me][W]<I[Me]&&(I[Me]=D[Me][W]);for(var Te=0;Te<w;Te++)I[Te]>me&&(me=I[Te],Ne=Te)}return Ne},j=function(re){var W=void 0;if(re){W=Math.floor(Math.random()*w),S=W;for(var le=0;le<w;le++)I[le]=N;for(var ye=0;ye<U;ye++)A[ye]=W,W=V(W,ye,re)}else{B();for(var ae=0;ae<U;ae++)V(A[ae],ae,re,!1)}for(var he=0;he<w;he++)for(var fe=0;fe<U;fe++)D[he][fe]*=D[he][fe];for(var pe=0;pe<U;pe++)M[pe]=[];for(var ge=0;ge<U;ge++)for(var me=0;me<U;me++)M[ge][me]=D[A[me]][ge]},Y=function(){for(var re=f.svd(M),W=re.S,ae=re.U,le=re.V,ye=W[0]*W[0]*W[0],he=[],fe=0;fe<U;fe++){he[fe]=[];for(var pe=0;pe<U;pe++)he[fe][pe]=0,fe==pe&&(he[fe][pe]=W[fe]/(W[fe]*W[fe]+ye/(W[fe]*W[fe])))}E=u.multMat(u.multMat(le,he),u.transpose(ae))},Z=function(){for(var re=void 0,W=void 0,ae=[],le=[],ye=[],he=[],fe=0;fe<w;fe++)ae[fe]=Math.random(),le[fe]=Math.random();ae=u.normalize(ae),le=u.normalize(le);for(var pe=0,ge=T,me=T,Ne=void 0;;){pe++;for(var ze=0;ze<w;ze++)ye[ze]=ae[ze];if(ae=u.multGamma(u.multL(u.multGamma(ye),D,E)),re=u.dotProduct(ye,ae),ae=u.normalize(ae),ge=u.dotProduct(ye,ae),Ne=Math.abs(ge/me),Ne<=1+R&&Ne>=1)break;me=ge}for(var Oe=0;Oe<w;Oe++)ye[Oe]=ae[Oe];for(pe=0,me=T;;){pe++;for(var be=0;be<w;be++)he[be]=le[be];if(he=u.minusOp(he,u.multCons(ye,u.dotProduct(ye,he))),le=u.multGamma(u.multL(u.multGamma(he),D,E)),W=u.dotProduct(he,le),le=u.normalize(le),ge=u.dotProduct(he,le),Ne=Math.abs(ge/me),Ne<=1+R&&Ne>=1)break;me=ge}for(var Me=0;Me<w;Me++)he[Me]=le[Me];O=u.multCons(ye,Math.sqrt(Math.abs(re))),L=u.multCons(he,Math.sqrt(Math.abs(W)))};l.connectComponents(v,p,l.getTopMostNodes(m),y),g.forEach(function(H){l.connectComponents(v,p,l.getTopMostNodes(H.descendants().intersection(p)),y)});for(var K=0,G=0;G<m.length;G++)m[G].isParent()||b.set(m[G].id(),K++);var $=!0,q=!1,X=void 0;try{for(var ee=y.keys()[Symbol.iterator](),ce;!($=(ce=ee.next()).done);$=!0){var Ee=ce.value;b.set(Ee,K++)}}catch(H){q=!0,X=H}finally{try{!$&&ee.return&&ee.return()}finally{if(q)throw X}}for(var ne=0;ne<b.size;ne++)C[ne]=[];g.forEach(function(H){for(var re=H.children().intersection(p);re.nodes(":childless").length==0;)re=re.nodes()[0].children().intersection(p);var W=0,ae=re.nodes(":childless")[0].connectedEdges().length;re.nodes(":childless").forEach(function(le,ye){le.connectedEdges().length<ae&&(ae=le.connectedEdges().length,W=ye)}),x.set(H.id(),re.nodes(":childless")[W].id())}),m.forEach(function(H){var re=void 0;H.isParent()?re=b.get(x.get(H.id())):re=b.get(H.id()),H.neighborhood().nodes().forEach(function(W){p.intersection(H.edgesWith(W)).length>0&&(W.isParent()?C[re].push(x.get(W.id())):C[re].push(W.id()))})});var Q=function(re){var W=b.get(re),ae=void 0;y.get(re).forEach(function(le){v.getElementById(le).isParent()?ae=x.get(le):ae=le,C[W].push(ae),C[b.get(ae)].push(re)})},se=!0,J=!1,ie=void 0;try{for(var ve=y.keys()[Symbol.iterator](),Se;!(se=(Se=ve.next()).done);se=!0){var Ce=Se.value;Q(Ce)}}catch(H){J=!0,ie=H}finally{try{!se&&ve.return&&ve.return()}finally{if(J)throw ie}}w=b.size;var xe=void 0;if(w>2){U=w<d.sampleSize?w:d.sampleSize;for(var De=0;De<w;De++)D[De]=[];for(var Le=0;Le<U;Le++)E[Le]=[];return d.quality=="draft"||d.step=="all"?(j(P),Y(),Z(),xe={nodeIndexes:b,xCoords:O,yCoords:L}):(b.forEach(function(H,re){O.push(v.getElementById(re).position("x")),L.push(v.getElementById(re).position("y"))}),xe={nodeIndexes:b,xCoords:O,yCoords:L}),xe}else{var Pe=b.keys(),de=v.getElementById(Pe.next().value),_=de.position(),te=de.outerWidth();if(O.push(_.x),L.push(_.y),w==2){var oe=v.getElementById(Pe.next().value),z=oe.outerWidth();O.push(_.x+te/2+z/2+d.idealEdgeLength),L.push(_.y)}return xe={nodeIndexes:b,xCoords:O,yCoords:L},xe}};i.exports={spectralLayout:c}}),579:((i,o,s)=>{var l=s(212),u=function(c){c&&c("layout","fcose",l)};typeof cytoscape<"u"&&u(cytoscape),i.exports=u}),140:(i=>{i.exports=t})},r={};function n(i){var o=r[i];if(o!==void 0)return o.exports;var s=r[i]={exports:{}};return e[i](s,s.exports,n),s.exports}var a=n(579);return a})()})});var Lv=F((PX,Sv)=>{function PM(){this.__data__=[],this.size=0}Sv.exports=PM});var _n=F((_X,Nv)=>{function _M(t,e){return t===e||t!==t&&e!==e}Nv.exports=_M});var Oi=F((FX,Ov)=>{var FM=_n();function BM(t,e){for(var r=t.length;r--;)if(FM(t[r][0],e))return r;return-1}Ov.exports=BM});var Iv=F((BX,Av)=>{var kM=Oi(),qM=Array.prototype,zM=qM.splice;function UM(t){var e=this.__data__,r=kM(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():zM.call(e,r,1),--this.size,!0}Av.exports=UM});var Mv=F((kX,Dv)=>{var GM=Oi();function VM(t){var e=this.__data__,r=GM(e,t);return r<0?void 0:e[r][1]}Dv.exports=VM});var Pv=F((qX,Rv)=>{var HM=Oi();function $M(t){return HM(this.__data__,t)>-1}Rv.exports=$M});var Fv=F((zX,_v)=>{var YM=Oi();function WM(t,e){var r=this.__data__,n=YM(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}_v.exports=WM});var Ai=F((UX,Bv)=>{var XM=Lv(),KM=Iv(),jM=Mv(),ZM=Pv(),QM=Fv();function La(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}La.prototype.clear=XM;La.prototype.delete=KM;La.prototype.get=jM;La.prototype.has=ZM;La.prototype.set=QM;Bv.exports=La});var qv=F((GX,kv)=>{var JM=Ai();function eR(){this.__data__=new JM,this.size=0}kv.exports=eR});var Uv=F((VX,zv)=>{function tR(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}zv.exports=tR});var Vv=F((HX,Gv)=>{function rR(t){return this.__data__.get(t)}Gv.exports=rR});var $v=F(($X,Hv)=>{function nR(t){return this.__data__.has(t)}Hv.exports=nR});var gl=F((YX,Yv)=>{var aR=typeof global=="object"&&global&&global.Object===Object&&global;Yv.exports=aR});var rr=F((WX,Wv)=>{var iR=gl(),oR=typeof self=="object"&&self&&self.Object===Object&&self,sR=iR||oR||Function("return this")();Wv.exports=sR});var Fn=F((XX,Xv)=>{var uR=rr(),lR=uR.Symbol;Xv.exports=lR});var Qv=F((KX,Zv)=>{var Kv=Fn(),jv=Object.prototype,fR=jv.hasOwnProperty,cR=jv.toString,Ii=Kv?Kv.toStringTag:void 0;function hR(t){var e=fR.call(t,Ii),r=t[Ii];try{t[Ii]=void 0;var n=!0}catch{}var a=cR.call(t);return n&&(e?t[Ii]=r:delete t[Ii]),a}Zv.exports=hR});var ep=F((jX,Jv)=>{var dR=Object.prototype,vR=dR.toString;function pR(t){return vR.call(t)}Jv.exports=pR});var sn=F((ZX,np)=>{var tp=Fn(),gR=Qv(),yR=ep(),mR="[object Null]",bR="[object Undefined]",rp=tp?tp.toStringTag:void 0;function ER(t){return t==null?t===void 0?bR:mR:rp&&rp in Object(t)?gR(t):yR(t)}np.exports=ER});var Xt=F((QX,ap)=>{function wR(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}ap.exports=wR});var Na=F((JX,ip)=>{var xR=sn(),TR=Xt(),CR="[object AsyncFunction]",SR="[object Function]",LR="[object GeneratorFunction]",NR="[object Proxy]";function OR(t){if(!TR(t))return!1;var e=xR(t);return e==SR||e==LR||e==CR||e==NR}ip.exports=OR});var sp=F((e6,op)=>{var AR=rr(),IR=AR["__core-js_shared__"];op.exports=IR});var fp=F((t6,lp)=>{var yl=sp(),up=(function(){var t=/[^.]+$/.exec(yl&&yl.keys&&yl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function DR(t){return!!up&&up in t}lp.exports=DR});var ml=F((r6,cp)=>{var MR=Function.prototype,RR=MR.toString;function PR(t){if(t!=null){try{return RR.call(t)}catch{}try{return t+""}catch{}}return""}cp.exports=PR});var dp=F((n6,hp)=>{var _R=Na(),FR=fp(),BR=Xt(),kR=ml(),qR=/[\\^$.*+?()[\]{}|]/g,zR=/^\[object .+?Constructor\]$/,UR=Function.prototype,GR=Object.prototype,VR=UR.toString,HR=GR.hasOwnProperty,$R=RegExp("^"+VR.call(HR).replace(qR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function YR(t){if(!BR(t)||FR(t))return!1;var e=_R(t)?$R:zR;return e.test(kR(t))}hp.exports=YR});var pp=F((a6,vp)=>{function WR(t,e){return t?.[e]}vp.exports=WR});var un=F((i6,gp)=>{var XR=dp(),KR=pp();function jR(t,e){var r=KR(t,e);return XR(r)?r:void 0}gp.exports=jR});var gs=F((o6,yp)=>{var ZR=un(),QR=rr(),JR=ZR(QR,"Map");yp.exports=JR});var Di=F((s6,mp)=>{var e2=un(),t2=e2(Object,"create");mp.exports=t2});var wp=F((u6,Ep)=>{var bp=Di();function r2(){this.__data__=bp?bp(null):{},this.size=0}Ep.exports=r2});var Tp=F((l6,xp)=>{function n2(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}xp.exports=n2});var Sp=F((f6,Cp)=>{var a2=Di(),i2="__lodash_hash_undefined__",o2=Object.prototype,s2=o2.hasOwnProperty;function u2(t){var e=this.__data__;if(a2){var r=e[t];return r===i2?void 0:r}return s2.call(e,t)?e[t]:void 0}Cp.exports=u2});var Np=F((c6,Lp)=>{var l2=Di(),f2=Object.prototype,c2=f2.hasOwnProperty;function h2(t){var e=this.__data__;return l2?e[t]!==void 0:c2.call(e,t)}Lp.exports=h2});var Ap=F((h6,Op)=>{var d2=Di(),v2="__lodash_hash_undefined__";function p2(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=d2&&e===void 0?v2:e,this}Op.exports=p2});var Dp=F((d6,Ip)=>{var g2=wp(),y2=Tp(),m2=Sp(),b2=Np(),E2=Ap();function Oa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Oa.prototype.clear=g2;Oa.prototype.delete=y2;Oa.prototype.get=m2;Oa.prototype.has=b2;Oa.prototype.set=E2;Ip.exports=Oa});var Pp=F((v6,Rp)=>{var Mp=Dp(),w2=Ai(),x2=gs();function T2(){this.size=0,this.__data__={hash:new Mp,map:new(x2||w2),string:new Mp}}Rp.exports=T2});var Fp=F((p6,_p)=>{function C2(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}_p.exports=C2});var Mi=F((g6,Bp)=>{var S2=Fp();function L2(t,e){var r=t.__data__;return S2(e)?r[typeof e=="string"?"string":"hash"]:r.map}Bp.exports=L2});var qp=F((y6,kp)=>{var N2=Mi();function O2(t){var e=N2(this,t).delete(t);return this.size-=e?1:0,e}kp.exports=O2});var Up=F((m6,zp)=>{var A2=Mi();function I2(t){return A2(this,t).get(t)}zp.exports=I2});var Vp=F((b6,Gp)=>{var D2=Mi();function M2(t){return D2(this,t).has(t)}Gp.exports=M2});var $p=F((E6,Hp)=>{var R2=Mi();function P2(t,e){var r=R2(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}Hp.exports=P2});var ys=F((w6,Yp)=>{var _2=Pp(),F2=qp(),B2=Up(),k2=Vp(),q2=$p();function Aa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Aa.prototype.clear=_2;Aa.prototype.delete=F2;Aa.prototype.get=B2;Aa.prototype.has=k2;Aa.prototype.set=q2;Yp.exports=Aa});var Xp=F((x6,Wp)=>{var z2=Ai(),U2=gs(),G2=ys(),V2=200;function H2(t,e){var r=this.__data__;if(r instanceof z2){var n=r.__data__;if(!U2||n.length<V2-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new G2(n)}return r.set(t,e),this.size=r.size,this}Wp.exports=H2});var Ri=F((T6,Kp)=>{var $2=Ai(),Y2=qv(),W2=Uv(),X2=Vv(),K2=$v(),j2=Xp();function Ia(t){var e=this.__data__=new $2(t);this.size=e.size}Ia.prototype.clear=Y2;Ia.prototype.delete=W2;Ia.prototype.get=X2;Ia.prototype.has=K2;Ia.prototype.set=j2;Kp.exports=Ia});var ms=F((C6,jp)=>{function Z2(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}jp.exports=Z2});var bl=F((S6,Zp)=>{var Q2=un(),J2=(function(){try{var t=Q2(Object,"defineProperty");return t({},"",{}),t}catch{}})();Zp.exports=J2});var Pi=F((L6,Jp)=>{var Qp=bl();function eP(t,e,r){e=="__proto__"&&Qp?Qp(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}Jp.exports=eP});var _i=F((N6,eg)=>{var tP=Pi(),rP=_n(),nP=Object.prototype,aP=nP.hasOwnProperty;function iP(t,e,r){var n=t[e];(!(aP.call(t,e)&&rP(n,r))||r===void 0&&!(e in t))&&tP(t,e,r)}eg.exports=iP});var Da=F((O6,tg)=>{var oP=_i(),sP=Pi();function uP(t,e,r,n){var a=!r;r||(r={});for(var i=-1,o=e.length;++i<o;){var s=e[i],l=n?n(r[s],t[s],s,r,t):void 0;l===void 0&&(l=t[s]),a?sP(r,s,l):oP(r,s,l)}return r}tg.exports=uP});var ng=F((A6,rg)=>{function lP(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}rg.exports=lP});var fr=F((I6,ag)=>{function fP(t){return t!=null&&typeof t=="object"}ag.exports=fP});var og=F((D6,ig)=>{var cP=sn(),hP=fr(),dP="[object Arguments]";function vP(t){return hP(t)&&cP(t)==dP}ig.exports=vP});var Ma=F((M6,lg)=>{var sg=og(),pP=fr(),ug=Object.prototype,gP=ug.hasOwnProperty,yP=ug.propertyIsEnumerable,mP=sg((function(){return arguments})())?sg:function(t){return pP(t)&&gP.call(t,"callee")&&!yP.call(t,"callee")};lg.exports=mP});var mt=F((R6,fg)=>{var bP=Array.isArray;fg.exports=bP});var hg=F((P6,cg)=>{function EP(){return!1}cg.exports=EP});var Bn=F((Fi,Ra)=>{var wP=rr(),xP=hg(),pg=typeof Fi=="object"&&Fi&&!Fi.nodeType&&Fi,dg=pg&&typeof Ra=="object"&&Ra&&!Ra.nodeType&&Ra,TP=dg&&dg.exports===pg,vg=TP?wP.Buffer:void 0,CP=vg?vg.isBuffer:void 0,SP=CP||xP;Ra.exports=SP});var Bi=F((_6,gg)=>{var LP=9007199254740991,NP=/^(?:0|[1-9]\d*)$/;function OP(t,e){var r=typeof t;return e=e??LP,!!e&&(r=="number"||r!="symbol"&&NP.test(t))&&t>-1&&t%1==0&&t<e}gg.exports=OP});var bs=F((F6,yg)=>{var AP=9007199254740991;function IP(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=AP}yg.exports=IP});var bg=F((B6,mg)=>{var DP=sn(),MP=bs(),RP=fr(),PP="[object Arguments]",_P="[object Array]",FP="[object Boolean]",BP="[object Date]",kP="[object Error]",qP="[object Function]",zP="[object Map]",UP="[object Number]",GP="[object Object]",VP="[object RegExp]",HP="[object Set]",$P="[object String]",YP="[object WeakMap]",WP="[object ArrayBuffer]",XP="[object DataView]",KP="[object Float32Array]",jP="[object Float64Array]",ZP="[object Int8Array]",QP="[object Int16Array]",JP="[object Int32Array]",e_="[object Uint8Array]",t_="[object Uint8ClampedArray]",r_="[object Uint16Array]",n_="[object Uint32Array]",ht={};ht[KP]=ht[jP]=ht[ZP]=ht[QP]=ht[JP]=ht[e_]=ht[t_]=ht[r_]=ht[n_]=!0;ht[PP]=ht[_P]=ht[WP]=ht[FP]=ht[XP]=ht[BP]=ht[kP]=ht[qP]=ht[zP]=ht[UP]=ht[GP]=ht[VP]=ht[HP]=ht[$P]=ht[YP]=!1;function a_(t){return RP(t)&&MP(t.length)&&!!ht[DP(t)]}mg.exports=a_});var ki=F((k6,Eg)=>{function i_(t){return function(e){return t(e)}}Eg.exports=i_});var Es=F((qi,Pa)=>{var o_=gl(),wg=typeof qi=="object"&&qi&&!qi.nodeType&&qi,zi=wg&&typeof Pa=="object"&&Pa&&!Pa.nodeType&&Pa,s_=zi&&zi.exports===wg,El=s_&&o_.process,u_=(function(){try{var t=zi&&zi.require&&zi.require("util").types;return t||El&&El.binding&&El.binding("util")}catch{}})();Pa.exports=u_});var _a=F((q6,Cg)=>{var l_=bg(),f_=ki(),xg=Es(),Tg=xg&&xg.isTypedArray,c_=Tg?f_(Tg):l_;Cg.exports=c_});var wl=F((z6,Sg)=>{var h_=ng(),d_=Ma(),v_=mt(),p_=Bn(),g_=Bi(),y_=_a(),m_=Object.prototype,b_=m_.hasOwnProperty;function E_(t,e){var r=v_(t),n=!r&&d_(t),a=!r&&!n&&p_(t),i=!r&&!n&&!a&&y_(t),o=r||n||a||i,s=o?h_(t.length,String):[],l=s.length;for(var u in t)(e||b_.call(t,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||g_(u,l)))&&s.push(u);return s}Sg.exports=E_});var Ui=F((U6,Lg)=>{var w_=Object.prototype;function x_(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||w_;return t===r}Lg.exports=x_});var xl=F((G6,Ng)=>{function T_(t,e){return function(r){return t(e(r))}}Ng.exports=T_});var Ag=F((V6,Og)=>{var C_=xl(),S_=C_(Object.keys,Object);Og.exports=S_});var ws=F((H6,Ig)=>{var L_=Ui(),N_=Ag(),O_=Object.prototype,A_=O_.hasOwnProperty;function I_(t){if(!L_(t))return N_(t);var e=[];for(var r in Object(t))A_.call(t,r)&&r!="constructor"&&e.push(r);return e}Ig.exports=I_});var wr=F(($6,Dg)=>{var D_=Na(),M_=bs();function R_(t){return t!=null&&M_(t.length)&&!D_(t)}Dg.exports=R_});var _r=F((Y6,Mg)=>{var P_=wl(),__=ws(),F_=wr();function B_(t){return F_(t)?P_(t):__(t)}Mg.exports=B_});var Pg=F((W6,Rg)=>{var k_=Da(),q_=_r();function z_(t,e){return t&&k_(e,q_(e),t)}Rg.exports=z_});var Fg=F((X6,_g)=>{function U_(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}_g.exports=U_});var kg=F((K6,Bg)=>{var G_=Xt(),V_=Ui(),H_=Fg(),$_=Object.prototype,Y_=$_.hasOwnProperty;function W_(t){if(!G_(t))return H_(t);var e=V_(t),r=[];for(var n in t)n=="constructor"&&(e||!Y_.call(t,n))||r.push(n);return r}Bg.exports=W_});var ln=F((j6,qg)=>{var X_=wl(),K_=kg(),j_=wr();function Z_(t){return j_(t)?X_(t,!0):K_(t)}qg.exports=Z_});var Ug=F((Z6,zg)=>{var Q_=Da(),J_=ln();function eF(t,e){return t&&Q_(e,J_(e),t)}zg.exports=eF});var Tl=F((Gi,Fa)=>{var tF=rr(),$g=typeof Gi=="object"&&Gi&&!Gi.nodeType&&Gi,Gg=$g&&typeof Fa=="object"&&Fa&&!Fa.nodeType&&Fa,rF=Gg&&Gg.exports===$g,Vg=rF?tF.Buffer:void 0,Hg=Vg?Vg.allocUnsafe:void 0;function nF(t,e){if(e)return t.slice();var r=t.length,n=Hg?Hg(r):new t.constructor(r);return t.copy(n),n}Fa.exports=nF});var Cl=F((Q6,Yg)=>{function aF(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}Yg.exports=aF});var Sl=F((J6,Wg)=>{function iF(t,e){for(var r=-1,n=t==null?0:t.length,a=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[a++]=o)}return i}Wg.exports=iF});var Ll=F((eK,Xg)=>{function oF(){return[]}Xg.exports=oF});var xs=F((tK,jg)=>{var sF=Sl(),uF=Ll(),lF=Object.prototype,fF=lF.propertyIsEnumerable,Kg=Object.getOwnPropertySymbols,cF=Kg?function(t){return t==null?[]:(t=Object(t),sF(Kg(t),function(e){return fF.call(t,e)}))}:uF;jg.exports=cF});var Qg=F((rK,Zg)=>{var hF=Da(),dF=xs();function vF(t,e){return hF(t,dF(t),e)}Zg.exports=vF});var Ts=F((nK,Jg)=>{function pF(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}Jg.exports=pF});var Vi=F((aK,ey)=>{var gF=xl(),yF=gF(Object.getPrototypeOf,Object);ey.exports=yF});var Nl=F((iK,ty)=>{var mF=Ts(),bF=Vi(),EF=xs(),wF=Ll(),xF=Object.getOwnPropertySymbols,TF=xF?function(t){for(var e=[];t;)mF(e,EF(t)),t=bF(t);return e}:wF;ty.exports=TF});var ny=F((oK,ry)=>{var CF=Da(),SF=Nl();function LF(t,e){return CF(t,SF(t),e)}ry.exports=LF});var Ol=F((sK,ay)=>{var NF=Ts(),OF=mt();function AF(t,e,r){var n=e(t);return OF(t)?n:NF(n,r(t))}ay.exports=AF});var Al=F((uK,iy)=>{var IF=Ol(),DF=xs(),MF=_r();function RF(t){return IF(t,MF,DF)}iy.exports=RF});var sy=F((lK,oy)=>{var PF=Ol(),_F=Nl(),FF=ln();function BF(t){return PF(t,FF,_F)}oy.exports=BF});var ly=F((fK,uy)=>{var kF=un(),qF=rr(),zF=kF(qF,"DataView");uy.exports=zF});var cy=F((cK,fy)=>{var UF=un(),GF=rr(),VF=UF(GF,"Promise");fy.exports=VF});var Il=F((hK,hy)=>{var HF=un(),$F=rr(),YF=HF($F,"Set");hy.exports=YF});var vy=F((dK,dy)=>{var WF=un(),XF=rr(),KF=WF(XF,"WeakMap");dy.exports=KF});var qn=F((vK,wy)=>{var Dl=ly(),Ml=gs(),Rl=cy(),Pl=Il(),_l=vy(),Ey=sn(),Ba=ml(),py="[object Map]",jF="[object Object]",gy="[object Promise]",yy="[object Set]",my="[object WeakMap]",by="[object DataView]",ZF=Ba(Dl),QF=Ba(Ml),JF=Ba(Rl),eB=Ba(Pl),tB=Ba(_l),kn=Ey;(Dl&&kn(new Dl(new ArrayBuffer(1)))!=by||Ml&&kn(new Ml)!=py||Rl&&kn(Rl.resolve())!=gy||Pl&&kn(new Pl)!=yy||_l&&kn(new _l)!=my)&&(kn=function(t){var e=Ey(t),r=e==jF?t.constructor:void 0,n=r?Ba(r):"";if(n)switch(n){case ZF:return by;case QF:return py;case JF:return gy;case eB:return yy;case tB:return my}return e});wy.exports=kn});var Ty=F((pK,xy)=>{var rB=Object.prototype,nB=rB.hasOwnProperty;function aB(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&nB.call(t,"index")&&(r.index=t.index,r.input=t.input),r}xy.exports=aB});var Fl=F((gK,Cy)=>{var iB=rr(),oB=iB.Uint8Array;Cy.exports=oB});var Cs=F((yK,Ly)=>{var Sy=Fl();function sB(t){var e=new t.constructor(t.byteLength);return new Sy(e).set(new Sy(t)),e}Ly.exports=sB});var Oy=F((mK,Ny)=>{var uB=Cs();function lB(t,e){var r=e?uB(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}Ny.exports=lB});var Iy=F((bK,Ay)=>{var fB=/\w*$/;function cB(t){var e=new t.constructor(t.source,fB.exec(t));return e.lastIndex=t.lastIndex,e}Ay.exports=cB});var _y=F((EK,Py)=>{var Dy=Fn(),My=Dy?Dy.prototype:void 0,Ry=My?My.valueOf:void 0;function hB(t){return Ry?Object(Ry.call(t)):{}}Py.exports=hB});var Bl=F((wK,Fy)=>{var dB=Cs();function vB(t,e){var r=e?dB(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}Fy.exports=vB});var ky=F((xK,By)=>{var pB=Cs(),gB=Oy(),yB=Iy(),mB=_y(),bB=Bl(),EB="[object Boolean]",wB="[object Date]",xB="[object Map]",TB="[object Number]",CB="[object RegExp]",SB="[object Set]",LB="[object String]",NB="[object Symbol]",OB="[object ArrayBuffer]",AB="[object DataView]",IB="[object Float32Array]",DB="[object Float64Array]",MB="[object Int8Array]",RB="[object Int16Array]",PB="[object Int32Array]",_B="[object Uint8Array]",FB="[object Uint8ClampedArray]",BB="[object Uint16Array]",kB="[object Uint32Array]";function qB(t,e,r){var n=t.constructor;switch(e){case OB:return pB(t);case EB:case wB:return new n(+t);case AB:return gB(t,r);case IB:case DB:case MB:case RB:case PB:case _B:case FB:case BB:case kB:return bB(t,r);case xB:return new n;case TB:case LB:return new n(t);case CB:return yB(t);case SB:return new n;case NB:return mB(t)}}By.exports=qB});var kl=F((TK,zy)=>{var zB=Xt(),qy=Object.create,UB=(function(){function t(){}return function(e){if(!zB(e))return{};if(qy)return qy(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();zy.exports=UB});var ql=F((CK,Uy)=>{var GB=kl(),VB=Vi(),HB=Ui();function $B(t){return typeof t.constructor=="function"&&!HB(t)?GB(VB(t)):{}}Uy.exports=$B});var Vy=F((SK,Gy)=>{var YB=qn(),WB=fr(),XB="[object Map]";function KB(t){return WB(t)&&YB(t)==XB}Gy.exports=KB});var Wy=F((LK,Yy)=>{var jB=Vy(),ZB=ki(),Hy=Es(),$y=Hy&&Hy.isMap,QB=$y?ZB($y):jB;Yy.exports=QB});var Ky=F((NK,Xy)=>{var JB=qn(),ek=fr(),tk="[object Set]";function rk(t){return ek(t)&&JB(t)==tk}Xy.exports=rk});var Jy=F((OK,Qy)=>{var nk=Ky(),ak=ki(),jy=Es(),Zy=jy&&jy.isSet,ik=Zy?ak(Zy):nk;Qy.exports=ik});var zl=F((AK,nm)=>{var ok=Ri(),sk=ms(),uk=_i(),lk=Pg(),fk=Ug(),ck=Tl(),hk=Cl(),dk=Qg(),vk=ny(),pk=Al(),gk=sy(),yk=qn(),mk=Ty(),bk=ky(),Ek=ql(),wk=mt(),xk=Bn(),Tk=Wy(),Ck=Xt(),Sk=Jy(),Lk=_r(),Nk=ln(),Ok=1,Ak=2,Ik=4,em="[object Arguments]",Dk="[object Array]",Mk="[object Boolean]",Rk="[object Date]",Pk="[object Error]",tm="[object Function]",_k="[object GeneratorFunction]",Fk="[object Map]",Bk="[object Number]",rm="[object Object]",kk="[object RegExp]",qk="[object Set]",zk="[object String]",Uk="[object Symbol]",Gk="[object WeakMap]",Vk="[object ArrayBuffer]",Hk="[object DataView]",$k="[object Float32Array]",Yk="[object Float64Array]",Wk="[object Int8Array]",Xk="[object Int16Array]",Kk="[object Int32Array]",jk="[object Uint8Array]",Zk="[object Uint8ClampedArray]",Qk="[object Uint16Array]",Jk="[object Uint32Array]",ft={};ft[em]=ft[Dk]=ft[Vk]=ft[Hk]=ft[Mk]=ft[Rk]=ft[$k]=ft[Yk]=ft[Wk]=ft[Xk]=ft[Kk]=ft[Fk]=ft[Bk]=ft[rm]=ft[kk]=ft[qk]=ft[zk]=ft[Uk]=ft[jk]=ft[Zk]=ft[Qk]=ft[Jk]=!0;ft[Pk]=ft[tm]=ft[Gk]=!1;function Ss(t,e,r,n,a,i){var o,s=e&Ok,l=e&Ak,u=e&Ik;if(r&&(o=a?r(t,n,a,i):r(t)),o!==void 0)return o;if(!Ck(t))return t;var f=wk(t);if(f){if(o=mk(t),!s)return hk(t,o)}else{var c=yk(t),h=c==tm||c==_k;if(xk(t))return ck(t,s);if(c==rm||c==em||h&&!a){if(o=l||h?{}:Ek(t),!s)return l?vk(t,fk(o,t)):dk(t,lk(o,t))}else{if(!ft[c])return a?t:{};o=bk(t,c,s)}}i||(i=new ok);var d=i.get(t);if(d)return d;i.set(t,o),Sk(t)?t.forEach(function(m){o.add(Ss(m,e,r,m,t,i))}):Tk(t)&&t.forEach(function(m,g){o.set(g,Ss(m,e,r,g,t,i))});var v=u?l?gk:pk:l?Nk:Lk,p=f?void 0:v(t);return sk(p||t,function(m,g){p&&(g=m,m=t[g]),uk(o,g,Ss(m,e,r,g,t,i))}),o}nm.exports=Ss});var im=F((IK,am)=>{var eq=zl(),tq=4;function rq(t){return eq(t,tq)}am.exports=rq});var Ls=F((DK,om)=>{function nq(t){return function(){return t}}om.exports=nq});var um=F((MK,sm)=>{function aq(t){return function(e,r,n){for(var a=-1,i=Object(e),o=n(e),s=o.length;s--;){var l=o[t?s:++a];if(r(i[l],l,i)===!1)break}return e}}sm.exports=aq});var Ns=F((RK,lm)=>{var iq=um(),oq=iq();lm.exports=oq});var Os=F((PK,fm)=>{var sq=Ns(),uq=_r();function lq(t,e){return t&&sq(t,e,uq)}fm.exports=lq});var hm=F((_K,cm)=>{var fq=wr();function cq(t,e){return function(r,n){if(r==null)return r;if(!fq(r))return t(r,n);for(var a=r.length,i=e?a:-1,o=Object(r);(e?i--:++i<a)&&n(o[i],i,o)!==!1;);return r}}cm.exports=cq});var Hi=F((FK,dm)=>{var hq=Os(),dq=hm(),vq=dq(hq);dm.exports=vq});var fn=F((BK,vm)=>{function pq(t){return t}vm.exports=pq});var Ul=F((kK,pm)=>{var gq=fn();function yq(t){return typeof t=="function"?t:gq}pm.exports=yq});var Gl=F((qK,gm)=>{var mq=ms(),bq=Hi(),Eq=Ul(),wq=mt();function xq(t,e){var r=wq(t)?mq:bq;return r(t,Eq(e))}gm.exports=xq});var Vl=F((zK,ym)=>{ym.exports=Gl()});var bm=F((UK,mm)=>{var Tq=Hi();function Cq(t,e){var r=[];return Tq(t,function(n,a,i){e(n,a,i)&&r.push(n)}),r}mm.exports=Cq});var wm=F((GK,Em)=>{var Sq="__lodash_hash_undefined__";function Lq(t){return this.__data__.set(t,Sq),this}Em.exports=Lq});var Tm=F((VK,xm)=>{function Nq(t){return this.__data__.has(t)}xm.exports=Nq});var Hl=F((HK,Cm)=>{var Oq=ys(),Aq=wm(),Iq=Tm();function As(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Oq;++e<r;)this.add(t[e])}As.prototype.add=As.prototype.push=Aq;As.prototype.has=Iq;Cm.exports=As});var Lm=F(($K,Sm)=>{function Dq(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}Sm.exports=Dq});var $l=F((YK,Nm)=>{function Mq(t,e){return t.has(e)}Nm.exports=Mq});var Yl=F((WK,Om)=>{var Rq=Hl(),Pq=Lm(),_q=$l(),Fq=1,Bq=2;function kq(t,e,r,n,a,i){var o=r&Fq,s=t.length,l=e.length;if(s!=l&&!(o&&l>s))return!1;var u=i.get(t),f=i.get(e);if(u&&f)return u==e&&f==t;var c=-1,h=!0,d=r&Bq?new Rq:void 0;for(i.set(t,e),i.set(e,t);++c<s;){var v=t[c],p=e[c];if(n)var m=o?n(p,v,c,e,t,i):n(v,p,c,t,e,i);if(m!==void 0){if(m)continue;h=!1;break}if(d){if(!Pq(e,function(g,y){if(!_q(d,y)&&(v===g||a(v,g,r,n,i)))return d.push(y)})){h=!1;break}}else if(!(v===p||a(v,p,r,n,i))){h=!1;break}}return i.delete(t),i.delete(e),h}Om.exports=kq});var Im=F((XK,Am)=>{function qq(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}Am.exports=qq});var Is=F((KK,Dm)=>{function zq(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}Dm.exports=zq});var Fm=F((jK,_m)=>{var Mm=Fn(),Rm=Fl(),Uq=_n(),Gq=Yl(),Vq=Im(),Hq=Is(),$q=1,Yq=2,Wq="[object Boolean]",Xq="[object Date]",Kq="[object Error]",jq="[object Map]",Zq="[object Number]",Qq="[object RegExp]",Jq="[object Set]",ez="[object String]",tz="[object Symbol]",rz="[object ArrayBuffer]",nz="[object DataView]",Pm=Mm?Mm.prototype:void 0,Wl=Pm?Pm.valueOf:void 0;function az(t,e,r,n,a,i,o){switch(r){case nz:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case rz:return!(t.byteLength!=e.byteLength||!i(new Rm(t),new Rm(e)));case Wq:case Xq:case Zq:return Uq(+t,+e);case Kq:return t.name==e.name&&t.message==e.message;case Qq:case ez:return t==e+"";case jq:var s=Vq;case Jq:var l=n&$q;if(s||(s=Hq),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;n|=Yq,o.set(t,e);var f=Gq(s(t),s(e),n,a,i,o);return o.delete(t),f;case tz:if(Wl)return Wl.call(t)==Wl.call(e)}return!1}_m.exports=az});var qm=F((ZK,km)=>{var Bm=Al(),iz=1,oz=Object.prototype,sz=oz.hasOwnProperty;function uz(t,e,r,n,a,i){var o=r&iz,s=Bm(t),l=s.length,u=Bm(e),f=u.length;if(l!=f&&!o)return!1;for(var c=l;c--;){var h=s[c];if(!(o?h in e:sz.call(e,h)))return!1}var d=i.get(t),v=i.get(e);if(d&&v)return d==e&&v==t;var p=!0;i.set(t,e),i.set(e,t);for(var m=o;++c<l;){h=s[c];var g=t[h],y=e[h];if(n)var b=o?n(y,g,h,e,t,i):n(g,y,h,t,e,i);if(!(b===void 0?g===y||a(g,y,r,n,i):b)){p=!1;break}m||(m=h=="constructor")}if(p&&!m){var x=t.constructor,C=e.constructor;x!=C&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof C=="function"&&C instanceof C)&&(p=!1)}return i.delete(t),i.delete(e),p}km.exports=uz});var Wm=F((QK,Ym)=>{var Xl=Ri(),lz=Yl(),fz=Fm(),cz=qm(),zm=qn(),Um=mt(),Gm=Bn(),hz=_a(),dz=1,Vm="[object Arguments]",Hm="[object Array]",Ds="[object Object]",vz=Object.prototype,$m=vz.hasOwnProperty;function pz(t,e,r,n,a,i){var o=Um(t),s=Um(e),l=o?Hm:zm(t),u=s?Hm:zm(e);l=l==Vm?Ds:l,u=u==Vm?Ds:u;var f=l==Ds,c=u==Ds,h=l==u;if(h&&Gm(t)){if(!Gm(e))return!1;o=!0,f=!1}if(h&&!f)return i||(i=new Xl),o||hz(t)?lz(t,e,r,n,a,i):fz(t,e,l,r,n,a,i);if(!(r&dz)){var d=f&&$m.call(t,"__wrapped__"),v=c&&$m.call(e,"__wrapped__");if(d||v){var p=d?t.value():t,m=v?e.value():e;return i||(i=new Xl),a(p,m,r,n,i)}}return h?(i||(i=new Xl),cz(t,e,r,n,a,i)):!1}Ym.exports=pz});var Kl=F((JK,jm)=>{var gz=Wm(),Xm=fr();function Km(t,e,r,n,a){return t===e?!0:t==null||e==null||!Xm(t)&&!Xm(e)?t!==t&&e!==e:gz(t,e,r,n,Km,a)}jm.exports=Km});var Qm=F((e9,Zm)=>{var yz=Ri(),mz=Kl(),bz=1,Ez=2;function wz(t,e,r,n){var a=r.length,i=a,o=!n;if(t==null)return!i;for(t=Object(t);a--;){var s=r[a];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){s=r[a];var l=s[0],u=t[l],f=s[1];if(o&&s[2]){if(u===void 0&&!(l in t))return!1}else{var c=new yz;if(n)var h=n(u,f,l,t,e,c);if(!(h===void 0?mz(f,u,bz|Ez,n,c):h))return!1}}return!0}Zm.exports=wz});var jl=F((t9,Jm)=>{var xz=Xt();function Tz(t){return t===t&&!xz(t)}Jm.exports=Tz});var t0=F((r9,e0)=>{var Cz=jl(),Sz=_r();function Lz(t){for(var e=Sz(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,Cz(a)]}return e}e0.exports=Lz});var Zl=F((n9,r0)=>{function Nz(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}r0.exports=Nz});var a0=F((a9,n0)=>{var Oz=Qm(),Az=t0(),Iz=Zl();function Dz(t){var e=Az(t);return e.length==1&&e[0][2]?Iz(e[0][0],e[0][1]):function(r){return r===t||Oz(r,t,e)}}n0.exports=Dz});var zn=F((i9,i0)=>{var Mz=sn(),Rz=fr(),Pz="[object Symbol]";function _z(t){return typeof t=="symbol"||Rz(t)&&Mz(t)==Pz}i0.exports=_z});var Ms=F((o9,o0)=>{var Fz=mt(),Bz=zn(),kz=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qz=/^\w*$/;function zz(t,e){if(Fz(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Bz(t)?!0:qz.test(t)||!kz.test(t)||e!=null&&t in Object(e)}o0.exports=zz});var l0=F((s9,u0)=>{var s0=ys(),Uz="Expected a function";function Ql(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Uz);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(Ql.Cache||s0),r}Ql.Cache=s0;u0.exports=Ql});var c0=F((u9,f0)=>{var Gz=l0(),Vz=500;function Hz(t){var e=Gz(t,function(n){return r.size===Vz&&r.clear(),n}),r=e.cache;return e}f0.exports=Hz});var d0=F((l9,h0)=>{var $z=c0(),Yz=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wz=/\\(\\)?/g,Xz=$z(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Yz,function(r,n,a,i){e.push(a?i.replace(Wz,"$1"):n||r)}),e});h0.exports=Xz});var $i=F((f9,v0)=>{function Kz(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}v0.exports=Kz});var E0=F((c9,b0)=>{var p0=Fn(),jz=$i(),Zz=mt(),Qz=zn(),Jz=1/0,g0=p0?p0.prototype:void 0,y0=g0?g0.toString:void 0;function m0(t){if(typeof t=="string")return t;if(Zz(t))return jz(t,m0)+"";if(Qz(t))return y0?y0.call(t):"";var e=t+"";return e=="0"&&1/t==-Jz?"-0":e}b0.exports=m0});var Jl=F((h9,w0)=>{var eU=E0();function tU(t){return t==null?"":eU(t)}w0.exports=tU});var Yi=F((d9,x0)=>{var rU=mt(),nU=Ms(),aU=d0(),iU=Jl();function oU(t,e){return rU(t)?t:nU(t,e)?[t]:aU(iU(t))}x0.exports=oU});var ka=F((v9,T0)=>{var sU=zn(),uU=1/0;function lU(t){if(typeof t=="string"||sU(t))return t;var e=t+"";return e=="0"&&1/t==-uU?"-0":e}T0.exports=lU});var Wi=F((p9,C0)=>{var fU=Yi(),cU=ka();function hU(t,e){e=fU(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[cU(e[r++])];return r&&r==n?t:void 0}C0.exports=hU});var L0=F((g9,S0)=>{var dU=Wi();function vU(t,e,r){var n=t==null?void 0:dU(t,e);return n===void 0?r:n}S0.exports=vU});var O0=F((y9,N0)=>{function pU(t,e){return t!=null&&e in Object(t)}N0.exports=pU});var ef=F((m9,A0)=>{var gU=Yi(),yU=Ma(),mU=mt(),bU=Bi(),EU=bs(),wU=ka();function xU(t,e,r){e=gU(e,t);for(var n=-1,a=e.length,i=!1;++n<a;){var o=wU(e[n]);if(!(i=t!=null&&r(t,o)))break;t=t[o]}return i||++n!=a?i:(a=t==null?0:t.length,!!a&&EU(a)&&bU(o,a)&&(mU(t)||yU(t)))}A0.exports=xU});var tf=F((b9,I0)=>{var TU=O0(),CU=ef();function SU(t,e){return t!=null&&CU(t,e,TU)}I0.exports=SU});var M0=F((E9,D0)=>{var LU=Kl(),NU=L0(),OU=tf(),AU=Ms(),IU=jl(),DU=Zl(),MU=ka(),RU=1,PU=2;function _U(t,e){return AU(t)&&IU(e)?DU(MU(t),e):function(r){var n=NU(r,t);return n===void 0&&n===e?OU(r,t):LU(e,n,RU|PU)}}D0.exports=_U});var rf=F((w9,R0)=>{function FU(t){return function(e){return e?.[t]}}R0.exports=FU});var _0=F((x9,P0)=>{var BU=Wi();function kU(t){return function(e){return BU(e,t)}}P0.exports=kU});var B0=F((T9,F0)=>{var qU=rf(),zU=_0(),UU=Ms(),GU=ka();function VU(t){return UU(t)?qU(GU(t)):zU(t)}F0.exports=VU});var xr=F((C9,k0)=>{var HU=a0(),$U=M0(),YU=fn(),WU=mt(),XU=B0();function KU(t){return typeof t=="function"?t:t==null?YU:typeof t=="object"?WU(t)?$U(t[0],t[1]):HU(t):XU(t)}k0.exports=KU});var nf=F((S9,q0)=>{var jU=Sl(),ZU=bm(),QU=xr(),JU=mt();function eG(t,e){var r=JU(t)?jU:ZU;return r(t,QU(e,3))}q0.exports=eG});var U0=F((L9,z0)=>{var tG=Object.prototype,rG=tG.hasOwnProperty;function nG(t,e){return t!=null&&rG.call(t,e)}z0.exports=nG});var af=F((N9,G0)=>{var aG=U0(),iG=ef();function oG(t,e){return t!=null&&iG(t,e,aG)}G0.exports=oG});var H0=F((O9,V0)=>{var sG=ws(),uG=qn(),lG=Ma(),fG=mt(),cG=wr(),hG=Bn(),dG=Ui(),vG=_a(),pG="[object Map]",gG="[object Set]",yG=Object.prototype,mG=yG.hasOwnProperty;function bG(t){if(t==null)return!0;if(cG(t)&&(fG(t)||typeof t=="string"||typeof t.splice=="function"||hG(t)||vG(t)||lG(t)))return!t.length;var e=uG(t);if(e==pG||e==gG)return!t.size;if(dG(t))return!sG(t).length;for(var r in t)if(mG.call(t,r))return!1;return!0}V0.exports=bG});var of=F((A9,$0)=>{function EG(t){return t===void 0}$0.exports=EG});var sf=F((I9,Y0)=>{var wG=Hi(),xG=wr();function TG(t,e){var r=-1,n=xG(t)?Array(t.length):[];return wG(t,function(a,i,o){n[++r]=e(a,i,o)}),n}Y0.exports=TG});var uf=F((D9,W0)=>{var CG=$i(),SG=xr(),LG=sf(),NG=mt();function OG(t,e){var r=NG(t)?CG:LG;return r(t,SG(e,3))}W0.exports=OG});var K0=F((M9,X0)=>{function AG(t,e,r,n){var a=-1,i=t==null?0:t.length;for(n&&i&&(r=t[++a]);++a<i;)r=e(r,t[a],a,t);return r}X0.exports=AG});var Z0=F((R9,j0)=>{function IG(t,e,r,n,a){return a(t,function(i,o,s){r=n?(n=!1,i):e(r,i,o,s)}),r}j0.exports=IG});var lf=F((P9,Q0)=>{var DG=K0(),MG=Hi(),RG=xr(),PG=Z0(),_G=mt();function FG(t,e,r){var n=_G(t)?DG:PG,a=arguments.length<3;return n(t,RG(e,4),r,a,MG)}Q0.exports=FG});var eb=F((_9,J0)=>{var BG=sn(),kG=mt(),qG=fr(),zG="[object String]";function UG(t){return typeof t=="string"||!kG(t)&&qG(t)&&BG(t)==zG}J0.exports=UG});var rb=F((F9,tb)=>{var GG=rf(),VG=GG("length");tb.exports=VG});var ab=F((B9,nb)=>{var HG="\\ud800-\\udfff",$G="\\u0300-\\u036f",YG="\\ufe20-\\ufe2f",WG="\\u20d0-\\u20ff",XG=$G+YG+WG,KG="\\ufe0e\\ufe0f",jG="\\u200d",ZG=RegExp("["+jG+HG+XG+KG+"]");function QG(t){return ZG.test(t)}nb.exports=QG});var db=F((k9,hb)=>{var ob="\\ud800-\\udfff",JG="\\u0300-\\u036f",e5="\\ufe20-\\ufe2f",t5="\\u20d0-\\u20ff",r5=JG+e5+t5,n5="\\ufe0e\\ufe0f",a5="["+ob+"]",ff="["+r5+"]",cf="\\ud83c[\\udffb-\\udfff]",i5="(?:"+ff+"|"+cf+")",sb="[^"+ob+"]",ub="(?:\\ud83c[\\udde6-\\uddff]){2}",lb="[\\ud800-\\udbff][\\udc00-\\udfff]",o5="\\u200d",fb=i5+"?",cb="["+n5+"]?",s5="(?:"+o5+"(?:"+[sb,ub,lb].join("|")+")"+cb+fb+")*",u5=cb+fb+s5,l5="(?:"+[sb+ff+"?",ff,ub,lb,a5].join("|")+")",ib=RegExp(cf+"(?="+cf+")|"+l5+u5,"g");function f5(t){for(var e=ib.lastIndex=0;ib.test(t);)++e;return e}hb.exports=f5});var pb=F((q9,vb)=>{var c5=rb(),h5=ab(),d5=db();function v5(t){return h5(t)?d5(t):c5(t)}vb.exports=v5});var yb=F((z9,gb)=>{var p5=ws(),g5=qn(),y5=wr(),m5=eb(),b5=pb(),E5="[object Map]",w5="[object Set]";function x5(t){if(t==null)return 0;if(y5(t))return m5(t)?b5(t):t.length;var e=g5(t);return e==E5||e==w5?t.size:p5(t).length}gb.exports=x5});var bb=F((U9,mb)=>{var T5=ms(),C5=kl(),S5=Os(),L5=xr(),N5=Vi(),O5=mt(),A5=Bn(),I5=Na(),D5=Xt(),M5=_a();function R5(t,e,r){var n=O5(t),a=n||A5(t)||M5(t);if(e=L5(e,4),r==null){var i=t&&t.constructor;a?r=n?new i:[]:D5(t)?r=I5(i)?C5(N5(t)):{}:r={}}return(a?T5:S5)(t,function(o,s,l){return e(r,o,s,l)}),r}mb.exports=R5});var Tb=F((G9,xb)=>{var Eb=Fn(),P5=Ma(),_5=mt(),wb=Eb?Eb.isConcatSpreadable:void 0;function F5(t){return _5(t)||P5(t)||!!(wb&&t&&t[wb])}xb.exports=F5});var Rs=F((V9,Sb)=>{var B5=Ts(),k5=Tb();function Cb(t,e,r,n,a){var i=-1,o=t.length;for(r||(r=k5),a||(a=[]);++i<o;){var s=t[i];e>0&&r(s)?e>1?Cb(s,e-1,r,n,a):B5(a,s):n||(a[a.length]=s)}return a}Sb.exports=Cb});var Nb=F((H9,Lb)=>{function q5(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}Lb.exports=q5});var hf=F(($9,Ab)=>{var z5=Nb(),Ob=Math.max;function U5(t,e,r){return e=Ob(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,i=Ob(n.length-e,0),o=Array(i);++a<i;)o[a]=n[e+a];a=-1;for(var s=Array(e+1);++a<e;)s[a]=n[a];return s[e]=r(o),z5(t,this,s)}}Ab.exports=U5});var Mb=F((Y9,Db)=>{var G5=Ls(),Ib=bl(),V5=fn(),H5=Ib?function(t,e){return Ib(t,"toString",{configurable:!0,enumerable:!1,value:G5(e),writable:!0})}:V5;Db.exports=H5});var Pb=F((W9,Rb)=>{var $5=800,Y5=16,W5=Date.now;function X5(t){var e=0,r=0;return function(){var n=W5(),a=Y5-(n-r);if(r=n,a>0){if(++e>=$5)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}Rb.exports=X5});var df=F((X9,_b)=>{var K5=Mb(),j5=Pb(),Z5=j5(K5);_b.exports=Z5});var Xi=F((K9,Fb)=>{var Q5=fn(),J5=hf(),eV=df();function tV(t,e){return eV(J5(t,e,Q5),t+"")}Fb.exports=tV});var vf=F((j9,Bb)=>{function rV(t,e,r,n){for(var a=t.length,i=r+(n?1:-1);n?i--:++i<a;)if(e(t[i],i,t))return i;return-1}Bb.exports=rV});var qb=F((Z9,kb)=>{function nV(t){return t!==t}kb.exports=nV});var Ub=F((Q9,zb)=>{function aV(t,e,r){for(var n=r-1,a=t.length;++n<a;)if(t[n]===e)return n;return-1}zb.exports=aV});var Vb=F((J9,Gb)=>{var iV=vf(),oV=qb(),sV=Ub();function uV(t,e,r){return e===e?sV(t,e,r):iV(t,oV,r)}Gb.exports=uV});var $b=F((e7,Hb)=>{var lV=Vb();function fV(t,e){var r=t==null?0:t.length;return!!r&&lV(t,e,0)>-1}Hb.exports=fV});var Wb=F((t7,Yb)=>{function cV(t,e,r){for(var n=-1,a=t==null?0:t.length;++n<a;)if(r(e,t[n]))return!0;return!1}Yb.exports=cV});var Kb=F((r7,Xb)=>{function hV(){}Xb.exports=hV});var Zb=F((n7,jb)=>{var pf=Il(),dV=Kb(),vV=Is(),pV=1/0,gV=pf&&1/vV(new pf([,-0]))[1]==pV?function(t){return new pf(t)}:dV;jb.exports=gV});var Jb=F((a7,Qb)=>{var yV=Hl(),mV=$b(),bV=Wb(),EV=$l(),wV=Zb(),xV=Is(),TV=200;function CV(t,e,r){var n=-1,a=mV,i=t.length,o=!0,s=[],l=s;if(r)o=!1,a=bV;else if(i>=TV){var u=e?null:wV(t);if(u)return xV(u);o=!1,a=EV,l=new yV}else l=e?[]:s;e:for(;++n<i;){var f=t[n],c=e?e(f):f;if(f=r||f!==0?f:0,o&&c===c){for(var h=l.length;h--;)if(l[h]===c)continue e;e&&l.push(c),s.push(f)}else a(l,c,r)||(l!==s&&l.push(c),s.push(f))}return s}Qb.exports=CV});var gf=F((i7,eE)=>{var SV=wr(),LV=fr();function NV(t){return LV(t)&&SV(t)}eE.exports=NV});var rE=F((o7,tE)=>{var OV=Rs(),AV=Xi(),IV=Jb(),DV=gf(),MV=AV(function(t){return IV(OV(t,1,DV,!0))});tE.exports=MV});var aE=F((s7,nE)=>{var RV=$i();function PV(t,e){return RV(e,function(r){return t[r]})}nE.exports=PV});var yf=F((u7,iE)=>{var _V=aE(),FV=_r();function BV(t){return t==null?[]:_V(t,FV(t))}iE.exports=BV});var Kt=F((l7,oE)=>{var Ps;if(typeof Jn=="function")try{Ps={clone:im(),constant:Ls(),each:Vl(),filter:nf(),has:af(),isArray:mt(),isEmpty:H0(),isFunction:Na(),isUndefined:of(),keys:_r(),map:uf(),reduce:lf(),size:yb(),transform:bb(),union:rE(),values:yf()}}catch{}Ps||(Ps=window._);oE.exports=Ps});var _s=F((c7,fE)=>{"use strict";var ke=Kt();fE.exports=Ye;var kV="\0",Un="\0",sE="";function Ye(t){this._isDirected=ke.has(t,"directed")?t.directed:!0,this._isMultigraph=ke.has(t,"multigraph")?t.multigraph:!1,this._isCompound=ke.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=ke.constant(void 0),this._defaultEdgeLabelFn=ke.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Un]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}Ye.prototype._nodeCount=0;Ye.prototype._edgeCount=0;Ye.prototype.isDirected=function(){return this._isDirected};Ye.prototype.isMultigraph=function(){return this._isMultigraph};Ye.prototype.isCompound=function(){return this._isCompound};Ye.prototype.setGraph=function(t){return this._label=t,this};Ye.prototype.graph=function(){return this._label};Ye.prototype.setDefaultNodeLabel=function(t){return ke.isFunction(t)||(t=ke.constant(t)),this._defaultNodeLabelFn=t,this};Ye.prototype.nodeCount=function(){return this._nodeCount};Ye.prototype.nodes=function(){return ke.keys(this._nodes)};Ye.prototype.sources=function(){var t=this;return ke.filter(this.nodes(),function(e){return ke.isEmpty(t._in[e])})};Ye.prototype.sinks=function(){var t=this;return ke.filter(this.nodes(),function(e){return ke.isEmpty(t._out[e])})};Ye.prototype.setNodes=function(t,e){var r=arguments,n=this;return ke.each(t,function(a){r.length>1?n.setNode(a,e):n.setNode(a)}),this};Ye.prototype.setNode=function(t,e){return ke.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Un,this._children[t]={},this._children[Un][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};Ye.prototype.node=function(t){return this._nodes[t]};Ye.prototype.hasNode=function(t){return ke.has(this._nodes,t)};Ye.prototype.removeNode=function(t){var e=this;if(ke.has(this._nodes,t)){var r=function(n){e.removeEdge(e._edgeObjs[n])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],ke.each(this.children(t),function(n){e.setParent(n)}),delete this._children[t]),ke.each(ke.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],ke.each(ke.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};Ye.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ke.isUndefined(e))e=Un;else{e+="";for(var r=e;!ke.isUndefined(r);r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this};Ye.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};Ye.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==Un)return e}};Ye.prototype.children=function(t){if(ke.isUndefined(t)&&(t=Un),this._isCompound){var e=this._children[t];if(e)return ke.keys(e)}else{if(t===Un)return this.nodes();if(this.hasNode(t))return[]}};Ye.prototype.predecessors=function(t){var e=this._preds[t];if(e)return ke.keys(e)};Ye.prototype.successors=function(t){var e=this._sucs[t];if(e)return ke.keys(e)};Ye.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return ke.union(e,this.successors(t))};Ye.prototype.isLeaf=function(t){var e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0};Ye.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;ke.each(this._nodes,function(i,o){t(o)&&e.setNode(o,i)}),ke.each(this._edgeObjs,function(i){e.hasNode(i.v)&&e.hasNode(i.w)&&e.setEdge(i,r.edge(i))});var n={};function a(i){var o=r.parent(i);return o===void 0||e.hasNode(o)?(n[i]=o,o):o in n?n[o]:a(o)}return this._isCompound&&ke.each(e.nodes(),function(i){e.setParent(i,a(i))}),e};Ye.prototype.setDefaultEdgeLabel=function(t){return ke.isFunction(t)||(t=ke.constant(t)),this._defaultEdgeLabelFn=t,this};Ye.prototype.edgeCount=function(){return this._edgeCount};Ye.prototype.edges=function(){return ke.values(this._edgeObjs)};Ye.prototype.setPath=function(t,e){var r=this,n=arguments;return ke.reduce(t,function(a,i){return n.length>1?r.setEdge(a,i,e):r.setEdge(a,i),i}),this};Ye.prototype.setEdge=function(){var t,e,r,n,a=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(t=i.v,e=i.w,r=i.name,arguments.length===2&&(n=arguments[1],a=!0)):(t=i,e=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],a=!0)),t=""+t,e=""+e,ke.isUndefined(r)||(r=""+r);var o=Ki(this._isDirected,t,e,r);if(ke.has(this._edgeLabels,o))return a&&(this._edgeLabels[o]=n),this;if(!ke.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=a?n:this._defaultEdgeLabelFn(t,e,r);var s=qV(this._isDirected,t,e,r);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[o]=s,uE(this._preds[e],t),uE(this._sucs[t],e),this._in[e][o]=s,this._out[t][o]=s,this._edgeCount++,this};Ye.prototype.edge=function(t,e,r){var n=arguments.length===1?mf(this._isDirected,arguments[0]):Ki(this._isDirected,t,e,r);return this._edgeLabels[n]};Ye.prototype.hasEdge=function(t,e,r){var n=arguments.length===1?mf(this._isDirected,arguments[0]):Ki(this._isDirected,t,e,r);return ke.has(this._edgeLabels,n)};Ye.prototype.removeEdge=function(t,e,r){var n=arguments.length===1?mf(this._isDirected,arguments[0]):Ki(this._isDirected,t,e,r),a=this._edgeObjs[n];return a&&(t=a.v,e=a.w,delete this._edgeLabels[n],delete this._edgeObjs[n],lE(this._preds[e],t),lE(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this};Ye.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var n=ke.values(r);return e?ke.filter(n,function(a){return a.v===e}):n}};Ye.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var n=ke.values(r);return e?ke.filter(n,function(a){return a.w===e}):n}};Ye.prototype.nodeEdges=function(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))};function uE(t,e){t[e]?t[e]++:t[e]=1}function lE(t,e){--t[e]||delete t[e]}function Ki(t,e,r,n){var a=""+e,i=""+r;if(!t&&a>i){var o=a;a=i,i=o}return a+sE+i+sE+(ke.isUndefined(n)?kV:n)}function qV(t,e,r,n){var a=""+e,i=""+r;if(!t&&a>i){var o=a;a=i,i=o}var s={v:a,w:i};return n&&(s.name=n),s}function mf(t,e){return Ki(t,e.v,e.w,e.name)}});var hE=F((h7,cE)=>{cE.exports="2.1.8"});var vE=F((d7,dE)=>{dE.exports={Graph:_s(),version:hE()}});var gE=F((v7,pE)=>{var Tr=Kt(),zV=_s();pE.exports={write:UV,read:HV};function UV(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:GV(t),edges:VV(t)};return Tr.isUndefined(t.graph())||(e.value=Tr.clone(t.graph())),e}function GV(t){return Tr.map(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),a={v:e};return Tr.isUndefined(r)||(a.value=r),Tr.isUndefined(n)||(a.parent=n),a})}function VV(t){return Tr.map(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Tr.isUndefined(e.name)||(n.name=e.name),Tr.isUndefined(r)||(n.value=r),n})}function HV(t){var e=new zV(t.options).setGraph(t.value);return Tr.each(t.nodes,function(r){e.setNode(r.v,r.value),r.parent&&e.setParent(r.v,r.parent)}),Tr.each(t.edges,function(r){e.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),e}});var mE=F((p7,yE)=>{var Fs=Kt();yE.exports=$V;function $V(t){var e={},r=[],n;function a(i){Fs.has(e,i)||(e[i]=!0,n.push(i),Fs.each(t.successors(i),a),Fs.each(t.predecessors(i),a))}return Fs.each(t.nodes(),function(i){n=[],a(i),n.length&&r.push(n)}),r}});var bf=F((g7,EE)=>{var bE=Kt();EE.exports=nr;function nr(){this._arr=[],this._keyIndices={}}nr.prototype.size=function(){return this._arr.length};nr.prototype.keys=function(){return this._arr.map(function(t){return t.key})};nr.prototype.has=function(t){return bE.has(this._keyIndices,t)};nr.prototype.priority=function(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority};nr.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};nr.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!bE.has(r,t)){var n=this._arr,a=n.length;return r[t]=a,n.push({key:t,priority:e}),this._decrease(a),!0}return!1};nr.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};nr.prototype.decrease=function(t,e){var r=this._keyIndices[t];if(e>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+e);this._arr[r].priority=e,this._decrease(r)};nr.prototype._heapify=function(t){var e=this._arr,r=2*t,n=r+1,a=t;r<e.length&&(a=e[r].priority<e[a].priority?r:a,n<e.length&&(a=e[n].priority<e[a].priority?n:a),a!==t&&(this._swap(t,a),this._heapify(a)))};nr.prototype._decrease=function(t){for(var e=this._arr,r=e[t].priority,n;t!==0&&(n=t>>1,!(e[n].priority<r));)this._swap(t,n),t=n};nr.prototype._swap=function(t,e){var r=this._arr,n=this._keyIndices,a=r[t],i=r[e];r[t]=i,r[e]=a,n[i.key]=t,n[a.key]=e}});var Ef=F((y7,wE)=>{var YV=Kt(),WV=bf();wE.exports=KV;var XV=YV.constant(1);function KV(t,e,r,n){return jV(t,String(e),r||XV,n||function(a){return t.outEdges(a)})}function jV(t,e,r,n){var a={},i=new WV,o,s,l=function(u){var f=u.v!==o?u.v:u.w,c=a[f],h=r(u),d=s.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);d<c.distance&&(c.distance=d,c.predecessor=o,i.decrease(f,d))};for(t.nodes().forEach(function(u){var f=u===e?0:Number.POSITIVE_INFINITY;a[u]={distance:f},i.add(u,f)});i.size()>0&&(o=i.removeMin(),s=a[o],s.distance!==Number.POSITIVE_INFINITY);)n(o).forEach(l);return a}});var TE=F((m7,xE)=>{var ZV=Ef(),QV=Kt();xE.exports=JV;function JV(t,e,r){return QV.transform(t.nodes(),function(n,a){n[a]=ZV(t,a,e,r)},{})}});var wf=F((b7,SE)=>{var CE=Kt();SE.exports=eH;function eH(t){var e=0,r=[],n={},a=[];function i(o){var s=n[o]={onStack:!0,lowlink:e,index:e++};if(r.push(o),t.successors(o).forEach(function(f){CE.has(n,f)?n[f].onStack&&(s.lowlink=Math.min(s.lowlink,n[f].index)):(i(f),s.lowlink=Math.min(s.lowlink,n[f].lowlink))}),s.lowlink===s.index){var l=[],u;do u=r.pop(),n[u].onStack=!1,l.push(u);while(o!==u);a.push(l)}}return t.nodes().forEach(function(o){CE.has(n,o)||i(o)}),a}});var NE=F((E7,LE)=>{var tH=Kt(),rH=wf();LE.exports=nH;function nH(t){return tH.filter(rH(t),function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}});var AE=F((w7,OE)=>{var aH=Kt();OE.exports=oH;var iH=aH.constant(1);function oH(t,e,r){return sH(t,e||iH,r||function(n){return t.outEdges(n)})}function sH(t,e,r){var n={},a=t.nodes();return a.forEach(function(i){n[i]={},n[i][i]={distance:0},a.forEach(function(o){i!==o&&(n[i][o]={distance:Number.POSITIVE_INFINITY})}),r(i).forEach(function(o){var s=o.v===i?o.w:o.v,l=e(o);n[i][s]={distance:l,predecessor:i}})}),a.forEach(function(i){var o=n[i];a.forEach(function(s){var l=n[s];a.forEach(function(u){var f=l[i],c=o[u],h=l[u],d=f.distance+c.distance;d<h.distance&&(h.distance=d,h.predecessor=c.predecessor)})})}),n}});var xf=F((x7,DE)=>{var ji=Kt();DE.exports=IE;IE.CycleException=Bs;function IE(t){var e={},r={},n=[];function a(i){if(ji.has(r,i))throw new Bs;ji.has(e,i)||(r[i]=!0,e[i]=!0,ji.each(t.predecessors(i),a),delete r[i],n.push(i))}if(ji.each(t.sinks(),a),ji.size(e)!==t.nodeCount())throw new Bs;return n}function Bs(){}Bs.prototype=new Error});var PE=F((T7,RE)=>{var ME=xf();RE.exports=uH;function uH(t){try{ME(t)}catch(e){if(e instanceof ME.CycleException)return!1;throw e}return!0}});var Tf=F((C7,FE)=>{var ks=Kt();FE.exports=lH;function lH(t,e,r){ks.isArray(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],i={};return ks.each(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);_E(t,o,r==="post",i,n,a)}),a}function _E(t,e,r,n,a,i){ks.has(n,e)||(n[e]=!0,r||i.push(e),ks.each(a(e),function(o){_E(t,o,r,n,a,i)}),r&&i.push(e))}});var kE=F((S7,BE)=>{var fH=Tf();BE.exports=cH;function cH(t,e){return fH(t,e,"post")}});var zE=F((L7,qE)=>{var hH=Tf();qE.exports=dH;function dH(t,e){return hH(t,e,"pre")}});var VE=F((N7,GE)=>{var UE=Kt(),vH=_s(),pH=bf();GE.exports=gH;function gH(t,e){var r=new vH,n={},a=new pH,i;function o(l){var u=l.v===i?l.w:l.v,f=a.priority(u);if(f!==void 0){var c=e(l);c<f&&(n[u]=i,a.decrease(u,c))}}if(t.nodeCount()===0)return r;UE.each(t.nodes(),function(l){a.add(l,Number.POSITIVE_INFINITY),r.setNode(l)}),a.decrease(t.nodes()[0],0);for(var s=!1;a.size()>0;){if(i=a.removeMin(),UE.has(n,i))r.setEdge(i,n[i]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(i).forEach(o)}return r}});var $E=F((O7,HE)=>{HE.exports={components:mE(),dijkstra:Ef(),dijkstraAll:TE(),findCycles:NE(),floydWarshall:AE(),isAcyclic:PE(),postorder:kE(),preorder:zE(),prim:VE(),tarjan:wf(),topsort:xf()}});var XE=F((A7,WE)=>{var YE=vE();WE.exports={Graph:YE.Graph,json:gE(),alg:$E(),version:YE.version}});var ar=F((I7,KE)=>{var qs;if(typeof Jn=="function")try{qs=XE()}catch{}qs||(qs=window.graphlib);KE.exports=qs});var ZE=F((M7,jE)=>{var yH=zl(),mH=1,bH=4;function EH(t){return yH(t,mH|bH)}jE.exports=EH});var Zi=F((R7,QE)=>{var wH=_n(),xH=wr(),TH=Bi(),CH=Xt();function SH(t,e,r){if(!CH(r))return!1;var n=typeof e;return(n=="number"?xH(r)&&TH(e,r.length):n=="string"&&e in r)?wH(r[e],t):!1}QE.exports=SH});var tw=F((P7,ew)=>{var LH=Xi(),NH=_n(),OH=Zi(),AH=ln(),JE=Object.prototype,IH=JE.hasOwnProperty,DH=LH(function(t,e){t=Object(t);var r=-1,n=e.length,a=n>2?e[2]:void 0;for(a&&OH(e[0],e[1],a)&&(n=1);++r<n;)for(var i=e[r],o=AH(i),s=-1,l=o.length;++s<l;){var u=o[s],f=t[u];(f===void 0||NH(f,JE[u])&&!IH.call(t,u))&&(t[u]=i[u])}return t});ew.exports=DH});var nw=F((_7,rw)=>{var MH=xr(),RH=wr(),PH=_r();function _H(t){return function(e,r,n){var a=Object(e);if(!RH(e)){var i=MH(r,3);e=PH(e),r=function(s){return i(a[s],s,a)}}var o=t(e,r,n);return o>-1?a[i?e[o]:o]:void 0}}rw.exports=_H});var iw=F((F7,aw)=>{var FH=/\s/;function BH(t){for(var e=t.length;e--&&FH.test(t.charAt(e)););return e}aw.exports=BH});var sw=F((B7,ow)=>{var kH=iw(),qH=/^\s+/;function zH(t){return t&&t.slice(0,kH(t)+1).replace(qH,"")}ow.exports=zH});var cw=F((k7,fw)=>{var UH=sw(),uw=Xt(),GH=zn(),lw=NaN,VH=/^[-+]0x[0-9a-f]+$/i,HH=/^0b[01]+$/i,$H=/^0o[0-7]+$/i,YH=parseInt;function WH(t){if(typeof t=="number")return t;if(GH(t))return lw;if(uw(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=uw(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=UH(t);var r=HH.test(t);return r||$H.test(t)?YH(t.slice(2),r?2:8):VH.test(t)?lw:+t}fw.exports=WH});var Cf=F((q7,dw)=>{var XH=cw(),hw=1/0,KH=17976931348623157e292;function jH(t){if(!t)return t===0?t:0;if(t=XH(t),t===hw||t===-hw){var e=t<0?-1:1;return e*KH}return t===t?t:0}dw.exports=jH});var pw=F((z7,vw)=>{var ZH=Cf();function QH(t){var e=ZH(t),r=e%1;return e===e?r?e-r:e:0}vw.exports=QH});var yw=F((U7,gw)=>{var JH=vf(),e3=xr(),t3=pw(),r3=Math.max;function n3(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=r==null?0:t3(r);return a<0&&(a=r3(n+a,0)),JH(t,e3(e,3),a)}gw.exports=n3});var bw=F((G7,mw)=>{var a3=nw(),i3=yw(),o3=a3(i3);mw.exports=o3});var Sf=F((V7,Ew)=>{var s3=Rs();function u3(t){var e=t==null?0:t.length;return e?s3(t,1):[]}Ew.exports=u3});var xw=F((H7,ww)=>{var l3=Ns(),f3=Ul(),c3=ln();function h3(t,e){return t==null?t:l3(t,f3(e),c3)}ww.exports=h3});var Cw=F(($7,Tw)=>{function d3(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}Tw.exports=d3});var Lw=F((Y7,Sw)=>{var v3=Pi(),p3=Os(),g3=xr();function y3(t,e){var r={};return e=g3(e,3),p3(t,function(n,a,i){v3(r,a,e(n,a,i))}),r}Sw.exports=y3});var zs=F((W7,Nw)=>{var m3=zn();function b3(t,e,r){for(var n=-1,a=t.length;++n<a;){var i=t[n],o=e(i);if(o!=null&&(s===void 0?o===o&&!m3(o):r(o,s)))var s=o,l=i}return l}Nw.exports=b3});var Aw=F((X7,Ow)=>{function E3(t,e){return t>e}Ow.exports=E3});var Dw=F((K7,Iw)=>{var w3=zs(),x3=Aw(),T3=fn();function C3(t){return t&&t.length?w3(t,T3,x3):void 0}Iw.exports=C3});var Lf=F((j7,Mw)=>{var S3=Pi(),L3=_n();function N3(t,e,r){(r!==void 0&&!L3(t[e],r)||r===void 0&&!(e in t))&&S3(t,e,r)}Mw.exports=N3});var _w=F((Z7,Pw)=>{var O3=sn(),A3=Vi(),I3=fr(),D3="[object Object]",M3=Function.prototype,R3=Object.prototype,Rw=M3.toString,P3=R3.hasOwnProperty,_3=Rw.call(Object);function F3(t){if(!I3(t)||O3(t)!=D3)return!1;var e=A3(t);if(e===null)return!0;var r=P3.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Rw.call(r)==_3}Pw.exports=F3});var Nf=F((Q7,Fw)=>{function B3(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}Fw.exports=B3});var kw=F((J7,Bw)=>{var k3=Da(),q3=ln();function z3(t){return k3(t,q3(t))}Bw.exports=z3});var Hw=F((ej,Vw)=>{var qw=Lf(),U3=Tl(),G3=Bl(),V3=Cl(),H3=ql(),zw=Ma(),Uw=mt(),$3=gf(),Y3=Bn(),W3=Na(),X3=Xt(),K3=_w(),j3=_a(),Gw=Nf(),Z3=kw();function Q3(t,e,r,n,a,i,o){var s=Gw(t,r),l=Gw(e,r),u=o.get(l);if(u){qw(t,r,u);return}var f=i?i(s,l,r+"",t,e,o):void 0,c=f===void 0;if(c){var h=Uw(l),d=!h&&Y3(l),v=!h&&!d&&j3(l);f=l,h||d||v?Uw(s)?f=s:$3(s)?f=V3(s):d?(c=!1,f=U3(l,!0)):v?(c=!1,f=G3(l,!0)):f=[]:K3(l)||zw(l)?(f=s,zw(s)?f=Z3(s):(!X3(s)||W3(s))&&(f=H3(l))):c=!1}c&&(o.set(l,f),a(f,l,n,i,o),o.delete(l)),qw(t,r,f)}Vw.exports=Q3});var Ww=F((tj,Yw)=>{var J3=Ri(),e$=Lf(),t$=Ns(),r$=Hw(),n$=Xt(),a$=ln(),i$=Nf();function $w(t,e,r,n,a){t!==e&&t$(e,function(i,o){if(a||(a=new J3),n$(i))r$(t,e,o,r,$w,n,a);else{var s=n?n(i$(t,o),i,o+"",t,e,a):void 0;s===void 0&&(s=i),e$(t,o,s)}},a$)}Yw.exports=$w});var Kw=F((rj,Xw)=>{var o$=Xi(),s$=Zi();function u$(t){return o$(function(e,r){var n=-1,a=r.length,i=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(i=t.length>3&&typeof i=="function"?(a--,i):void 0,o&&s$(r[0],r[1],o)&&(i=a<3?void 0:i,a=1),e=Object(e);++n<a;){var s=r[n];s&&t(e,s,n,i)}return e})}Xw.exports=u$});var Zw=F((nj,jw)=>{var l$=Ww(),f$=Kw(),c$=f$(function(t,e,r){l$(t,e,r)});jw.exports=c$});var Of=F((aj,Qw)=>{function h$(t,e){return t<e}Qw.exports=h$});var ex=F((ij,Jw)=>{var d$=zs(),v$=Of(),p$=fn();function g$(t){return t&&t.length?d$(t,p$,v$):void 0}Jw.exports=g$});var rx=F((oj,tx)=>{var y$=zs(),m$=xr(),b$=Of();function E$(t,e){return t&&t.length?y$(t,m$(e,2),b$):void 0}tx.exports=E$});var ax=F((sj,nx)=>{var w$=rr(),x$=function(){return w$.Date.now()};nx.exports=x$});var sx=F((uj,ox)=>{var T$=_i(),C$=Yi(),S$=Bi(),ix=Xt(),L$=ka();function N$(t,e,r,n){if(!ix(t))return t;e=C$(e,t);for(var a=-1,i=e.length,o=i-1,s=t;s!=null&&++a<i;){var l=L$(e[a]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(a!=o){var f=s[l];u=n?n(f,l,s):void 0,u===void 0&&(u=ix(f)?f:S$(e[a+1])?[]:{})}T$(s,l,u),s=s[l]}return t}ox.exports=N$});var lx=F((lj,ux)=>{var O$=Wi(),A$=sx(),I$=Yi();function D$(t,e,r){for(var n=-1,a=e.length,i={};++n<a;){var o=e[n],s=O$(t,o);r(s,o)&&A$(i,I$(o,t),s)}return i}ux.exports=D$});var cx=F((fj,fx)=>{var M$=lx(),R$=tf();function P$(t,e){return M$(t,e,function(r,n){return R$(t,n)})}fx.exports=P$});var dx=F((cj,hx)=>{var _$=Sf(),F$=hf(),B$=df();function k$(t){return B$(F$(t,void 0,_$),t+"")}hx.exports=k$});var px=F((hj,vx)=>{var q$=cx(),z$=dx(),U$=z$(function(t,e){return t==null?{}:q$(t,e)});vx.exports=U$});var yx=F((dj,gx)=>{var G$=Math.ceil,V$=Math.max;function H$(t,e,r,n){for(var a=-1,i=V$(G$((e-t)/(r||1)),0),o=Array(i);i--;)o[n?i:++a]=t,t+=r;return o}gx.exports=H$});var bx=F((vj,mx)=>{var $$=yx(),Y$=Zi(),Af=Cf();function W$(t){return function(e,r,n){return n&&typeof n!="number"&&Y$(e,r,n)&&(r=n=void 0),e=Af(e),r===void 0?(r=e,e=0):r=Af(r),n=n===void 0?e<r?1:-1:Af(n),$$(e,r,n,t)}}mx.exports=W$});var wx=F((pj,Ex)=>{var X$=bx(),K$=X$();Ex.exports=K$});var Tx=F((gj,xx)=>{function j$(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}xx.exports=j$});var Lx=F((yj,Sx)=>{var Cx=zn();function Z$(t,e){if(t!==e){var r=t!==void 0,n=t===null,a=t===t,i=Cx(t),o=e!==void 0,s=e===null,l=e===e,u=Cx(e);if(!s&&!u&&!i&&t>e||i&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!a)return 1;if(!n&&!i&&!u&&t<e||u&&r&&a&&!n&&!i||s&&r&&a||!o&&a||!l)return-1}return 0}Sx.exports=Z$});var Ox=F((mj,Nx)=>{var Q$=Lx();function J$(t,e,r){for(var n=-1,a=t.criteria,i=e.criteria,o=a.length,s=r.length;++n<o;){var l=Q$(a[n],i[n]);if(l){if(n>=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}Nx.exports=J$});var Ix=F((bj,Ax)=>{var If=$i(),eY=Wi(),tY=xr(),rY=sf(),nY=Tx(),aY=ki(),iY=Ox(),oY=fn(),sY=mt();function uY(t,e,r){e.length?e=If(e,function(i){return sY(i)?function(o){return eY(o,i.length===1?i[0]:i)}:i}):e=[oY];var n=-1;e=If(e,aY(tY));var a=rY(t,function(i,o,s){var l=If(e,function(u){return u(i)});return{criteria:l,index:++n,value:i}});return nY(a,function(i,o){return iY(i,o,r)})}Ax.exports=uY});var Rx=F((Ej,Mx)=>{var lY=Rs(),fY=Ix(),cY=Xi(),Dx=Zi(),hY=cY(function(t,e){if(t==null)return[];var r=e.length;return r>1&&Dx(t,e[0],e[1])?e=[]:r>2&&Dx(e[0],e[1],e[2])&&(e=[e[0]]),fY(t,lY(e,1),[])});Mx.exports=hY});var _x=F((wj,Px)=>{var dY=Jl(),vY=0;function pY(t){var e=++vY;return dY(t)+e}Px.exports=pY});var Bx=F((xj,Fx)=>{function gY(t,e,r){for(var n=-1,a=t.length,i=e.length,o={};++n<a;){var s=n<i?e[n]:void 0;r(o,t[n],s)}return o}Fx.exports=gY});var qx=F((Tj,kx)=>{var yY=_i(),mY=Bx();function bY(t,e){return mY(t||[],e||[],yY)}kx.exports=bY});var dt=F((Cj,zx)=>{var Us;if(typeof Jn=="function")try{Us={cloneDeep:ZE(),constant:Ls(),defaults:tw(),each:Vl(),filter:nf(),find:bw(),flatten:Sf(),forEach:Gl(),forIn:xw(),has:af(),isUndefined:of(),last:Cw(),map:uf(),mapValues:Lw(),max:Dw(),merge:Zw(),min:ex(),minBy:rx(),now:ax(),pick:px(),range:wx(),reduce:lf(),sortBy:Rx(),uniqueId:_x(),values:yf(),zipObject:qx()}}catch{}Us||(Us=window._);zx.exports=Us});var Vx=F((Lj,Gx)=>{Gx.exports=Gs;function Gs(){var t={};t._next=t._prev=t,this._sentinel=t}Gs.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return Ux(e),e};Gs.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&Ux(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e};Gs.prototype.toString=function(){for(var t=[],e=this._sentinel,r=e._prev;r!==e;)t.push(JSON.stringify(r,EY)),r=r._prev;return"["+t.join(", ")+"]"};function Ux(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function EY(t,e){if(t!=="_next"&&t!=="_prev")return e}});var $x=F((Nj,Hx)=>{var Fr=dt(),wY=ar().Graph,xY=Vx();Hx.exports=CY;var TY=Fr.constant(1);function CY(t,e){if(t.nodeCount()<=1)return[];var r=LY(t,e||TY),n=SY(r.graph,r.buckets,r.zeroIdx);return Fr.flatten(Fr.map(n,function(a){return t.outEdges(a.v,a.w)}),!0)}function SY(t,e,r){for(var n=[],a=e[e.length-1],i=e[0],o;t.nodeCount();){for(;o=i.dequeue();)Df(t,e,r,o);for(;o=a.dequeue();)Df(t,e,r,o);if(t.nodeCount()){for(var s=e.length-2;s>0;--s)if(o=e[s].dequeue(),o){n=n.concat(Df(t,e,r,o,!0));break}}}return n}function Df(t,e,r,n,a){var i=a?[]:void 0;return Fr.forEach(t.inEdges(n.v),function(o){var s=t.edge(o),l=t.node(o.v);a&&i.push({v:o.v,w:o.w}),l.out-=s,Mf(e,r,l)}),Fr.forEach(t.outEdges(n.v),function(o){var s=t.edge(o),l=o.w,u=t.node(l);u.in-=s,Mf(e,r,u)}),t.removeNode(n.v),i}function LY(t,e){var r=new wY,n=0,a=0;Fr.forEach(t.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),Fr.forEach(t.edges(),function(s){var l=r.edge(s.v,s.w)||0,u=e(s),f=l+u;r.setEdge(s.v,s.w,f),a=Math.max(a,r.node(s.v).out+=u),n=Math.max(n,r.node(s.w).in+=u)});var i=Fr.range(a+n+3).map(function(){return new xY}),o=n+1;return Fr.forEach(r.nodes(),function(s){Mf(i,o,r.node(s))}),{graph:r,buckets:i,zeroIdx:o}}function Mf(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}});var Wx=F((Oj,Yx)=>{"use strict";var Gn=dt(),NY=$x();Yx.exports={run:OY,undo:IY};function OY(t){var e=t.graph().acyclicer==="greedy"?NY(t,r(t)):AY(t);Gn.forEach(e,function(n){var a=t.edge(n);t.removeEdge(n),a.forwardName=n.name,a.reversed=!0,t.setEdge(n.w,n.v,a,Gn.uniqueId("rev"))});function r(n){return function(a){return n.edge(a).weight}}}function AY(t){var e=[],r={},n={};function a(i){Gn.has(n,i)||(n[i]=!0,r[i]=!0,Gn.forEach(t.outEdges(i),function(o){Gn.has(r,o.w)?e.push(o):a(o.w)}),delete r[i])}return Gn.forEach(t.nodes(),a),e}function IY(t){Gn.forEach(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}});var Gt=F((Aj,Zx)=>{"use strict";var tt=dt(),Xx=ar().Graph;Zx.exports={addDummyNode:Kx,simplify:DY,asNonCompoundGraph:MY,successorWeights:RY,predecessorWeights:PY,intersectRect:_Y,buildLayerMatrix:FY,normalizeRanks:BY,removeEmptyRanks:kY,addBorderNode:qY,maxRank:jx,partition:zY,time:UY,notime:GY};function Kx(t,e,r,n){var a;do a=tt.uniqueId(n);while(t.hasNode(a));return r.dummy=e,t.setNode(a,r),a}function DY(t){var e=new Xx().setGraph(t.graph());return tt.forEach(t.nodes(),function(r){e.setNode(r,t.node(r))}),tt.forEach(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},a=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+a.weight,minlen:Math.max(n.minlen,a.minlen)})}),e}function MY(t){var e=new Xx({multigraph:t.isMultigraph()}).setGraph(t.graph());return tt.forEach(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),tt.forEach(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function RY(t){var e=tt.map(t.nodes(),function(r){var n={};return tt.forEach(t.outEdges(r),function(a){n[a.w]=(n[a.w]||0)+t.edge(a).weight}),n});return tt.zipObject(t.nodes(),e)}function PY(t){var e=tt.map(t.nodes(),function(r){var n={};return tt.forEach(t.inEdges(r),function(a){n[a.v]=(n[a.v]||0)+t.edge(a).weight}),n});return tt.zipObject(t.nodes(),e)}function _Y(t,e){var r=t.x,n=t.y,a=e.x-r,i=e.y-n,o=t.width/2,s=t.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(i)*o>Math.abs(a)*s?(i<0&&(s=-s),l=s*a/i,u=s):(a<0&&(o=-o),l=o,u=o*i/a),{x:r+l,y:n+u}}function FY(t){var e=tt.map(tt.range(jx(t)+1),function(){return[]});return tt.forEach(t.nodes(),function(r){var n=t.node(r),a=n.rank;tt.isUndefined(a)||(e[a][n.order]=r)}),e}function BY(t){var e=tt.min(tt.map(t.nodes(),function(r){return t.node(r).rank}));tt.forEach(t.nodes(),function(r){var n=t.node(r);tt.has(n,"rank")&&(n.rank-=e)})}function kY(t){var e=tt.min(tt.map(t.nodes(),function(i){return t.node(i).rank})),r=[];tt.forEach(t.nodes(),function(i){var o=t.node(i).rank-e;r[o]||(r[o]=[]),r[o].push(i)});var n=0,a=t.graph().nodeRankFactor;tt.forEach(r,function(i,o){tt.isUndefined(i)&&o%a!==0?--n:n&&tt.forEach(i,function(s){t.node(s).rank+=n})})}function qY(t,e,r,n){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=n),Kx(t,"border",a,e)}function jx(t){return tt.max(tt.map(t.nodes(),function(e){var r=t.node(e).rank;if(!tt.isUndefined(r))return r}))}function zY(t,e){var r={lhs:[],rhs:[]};return tt.forEach(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function UY(t,e){var r=tt.now();try{return e()}finally{console.log(t+" time: "+(tt.now()-r)+"ms")}}function GY(t,e){return e()}});var e1=F((Ij,Jx)=>{"use strict";var Qx=dt(),VY=Gt();Jx.exports={run:HY,undo:YY};function HY(t){t.graph().dummyChains=[],Qx.forEach(t.edges(),function(e){$Y(t,e)})}function $Y(t,e){var r=e.v,n=t.node(r).rank,a=e.w,i=t.node(a).rank,o=e.name,s=t.edge(e),l=s.labelRank;if(i!==n+1){t.removeEdge(e);var u,f,c;for(c=0,++n;n<i;++c,++n)s.points=[],f={width:0,height:0,edgeLabel:s,edgeObj:e,rank:n},u=VY.addDummyNode(t,"edge",f,"_d"),n===l&&(f.width=s.width,f.height=s.height,f.dummy="edge-label",f.labelpos=s.labelpos),t.setEdge(r,u,{weight:s.weight},o),c===0&&t.graph().dummyChains.push(u),r=u;t.setEdge(r,a,{weight:s.weight},o)}}function YY(t){Qx.forEach(t.graph().dummyChains,function(e){var r=t.node(e),n=r.edgeLabel,a;for(t.setEdge(r.edgeObj,n);r.dummy;)a=t.successors(e)[0],t.removeNode(e),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),e=a,r=t.node(e)})}});var Qi=F((Dj,t1)=>{"use strict";var Vs=dt();t1.exports={longestPath:WY,slack:XY};function WY(t){var e={};function r(n){var a=t.node(n);if(Vs.has(e,n))return a.rank;e[n]=!0;var i=Vs.min(Vs.map(t.outEdges(n),function(o){return r(o.w)-t.edge(o).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}Vs.forEach(t.sources(),r)}function XY(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}});var Rf=F((Mj,r1)=>{"use strict";var Hs=dt(),KY=ar().Graph,$s=Qi().slack;r1.exports=jY;function jY(t){var e=new KY({directed:!1}),r=t.nodes()[0],n=t.nodeCount();e.setNode(r,{});for(var a,i;ZY(e,t)<n;)a=QY(e,t),i=e.hasNode(a.v)?$s(t,a):-$s(t,a),JY(e,t,i);return e}function ZY(t,e){function r(n){Hs.forEach(e.nodeEdges(n),function(a){var i=a.v,o=n===i?a.w:i;!t.hasNode(o)&&!$s(e,a)&&(t.setNode(o,{}),t.setEdge(n,o,{}),r(o))})}return Hs.forEach(t.nodes(),r),t.nodeCount()}function QY(t,e){return Hs.minBy(e.edges(),function(r){if(t.hasNode(r.v)!==t.hasNode(r.w))return $s(e,r)})}function JY(t,e,r){Hs.forEach(t.nodes(),function(n){e.node(n).rank+=r})}});var f1=F((Rj,l1)=>{"use strict";var Br=dt(),e4=Rf(),t4=Qi().slack,r4=Qi().longestPath,n4=ar().alg.preorder,a4=ar().alg.postorder,i4=Gt().simplify;l1.exports=Vn;Vn.initLowLimValues=_f;Vn.initCutValues=Pf;Vn.calcCutValue=a1;Vn.leaveEdge=o1;Vn.enterEdge=s1;Vn.exchangeEdges=u1;function Vn(t){t=i4(t),r4(t);var e=e4(t);_f(e),Pf(e,t);for(var r,n;r=o1(e);)n=s1(e,t,r),u1(e,t,r,n)}function Pf(t,e){var r=a4(t,t.nodes());r=r.slice(0,r.length-1),Br.forEach(r,function(n){o4(t,e,n)})}function o4(t,e,r){var n=t.node(r),a=n.parent;t.edge(r,a).cutvalue=a1(t,e,r)}function a1(t,e,r){var n=t.node(r),a=n.parent,i=!0,o=e.edge(r,a),s=0;return o||(i=!1,o=e.edge(a,r)),s=o.weight,Br.forEach(e.nodeEdges(r),function(l){var u=l.v===r,f=u?l.w:l.v;if(f!==a){var c=u===i,h=e.edge(l).weight;if(s+=c?h:-h,u4(t,r,f)){var d=t.edge(r,f).cutvalue;s+=c?-d:d}}}),s}function _f(t,e){arguments.length<2&&(e=t.nodes()[0]),i1(t,{},1,e)}function i1(t,e,r,n,a){var i=r,o=t.node(n);return e[n]=!0,Br.forEach(t.neighbors(n),function(s){Br.has(e,s)||(r=i1(t,e,r,s,n))}),o.low=i,o.lim=r++,a?o.parent=a:delete o.parent,r}function o1(t){return Br.find(t.edges(),function(e){return t.edge(e).cutvalue<0})}function s1(t,e,r){var n=r.v,a=r.w;e.hasEdge(n,a)||(n=r.w,a=r.v);var i=t.node(n),o=t.node(a),s=i,l=!1;i.lim>o.lim&&(s=o,l=!0);var u=Br.filter(e.edges(),function(f){return l===n1(t,t.node(f.v),s)&&l!==n1(t,t.node(f.w),s)});return Br.minBy(u,function(f){return t4(e,f)})}function u1(t,e,r,n){var a=r.v,i=r.w;t.removeEdge(a,i),t.setEdge(n.v,n.w,{}),_f(t),Pf(t,e),s4(t,e)}function s4(t,e){var r=Br.find(t.nodes(),function(a){return!e.node(a).parent}),n=n4(t,r);n=n.slice(1),Br.forEach(n,function(a){var i=t.node(a).parent,o=e.edge(a,i),s=!1;o||(o=e.edge(i,a),s=!0),e.node(a).rank=e.node(i).rank+(s?o.minlen:-o.minlen)})}function u4(t,e,r){return t.hasEdge(e,r)}function n1(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}});var v1=F((Pj,d1)=>{"use strict";var l4=Qi(),h1=l4.longestPath,f4=Rf(),c4=f1();d1.exports=h4;function h4(t){switch(t.graph().ranker){case"network-simplex":c1(t);break;case"tight-tree":v4(t);break;case"longest-path":d4(t);break;default:c1(t)}}var d4=h1;function v4(t){h1(t),f4(t)}function c1(t){c4(t)}});var g1=F((_j,p1)=>{var Ff=dt();p1.exports=p4;function p4(t){var e=y4(t);Ff.forEach(t.graph().dummyChains,function(r){for(var n=t.node(r),a=n.edgeObj,i=g4(t,e,a.v,a.w),o=i.path,s=i.lca,l=0,u=o[l],f=!0;r!==a.w;){if(n=t.node(r),f){for(;(u=o[l])!==s&&t.node(u).maxRank<n.rank;)l++;u===s&&(f=!1)}if(!f){for(;l<o.length-1&&t.node(u=o[l+1]).minRank<=n.rank;)l++;u=o[l]}t.setParent(r,u),r=t.successors(r)[0]}})}function g4(t,e,r,n){var a=[],i=[],o=Math.min(e[r].low,e[n].low),s=Math.max(e[r].lim,e[n].lim),l,u;l=r;do l=t.parent(l),a.push(l);while(l&&(e[l].low>o||s>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)i.push(l);return{path:a.concat(i.reverse()),lca:u}}function y4(t){var e={},r=0;function n(a){var i=r;Ff.forEach(t.children(a),n),e[a]={low:i,lim:r++}}return Ff.forEach(t.children(),n),e}});var b1=F((Fj,m1)=>{var kr=dt(),Bf=Gt();m1.exports={run:m4,cleanup:w4};function m4(t){var e=Bf.addDummyNode(t,"root",{},"_root"),r=b4(t),n=kr.max(kr.values(r))-1,a=2*n+1;t.graph().nestingRoot=e,kr.forEach(t.edges(),function(o){t.edge(o).minlen*=a});var i=E4(t)+1;kr.forEach(t.children(),function(o){y1(t,e,a,i,n,r,o)}),t.graph().nodeRankFactor=a}function y1(t,e,r,n,a,i,o){var s=t.children(o);if(!s.length){o!==e&&t.setEdge(e,o,{weight:0,minlen:r});return}var l=Bf.addBorderNode(t,"_bt"),u=Bf.addBorderNode(t,"_bb"),f=t.node(o);t.setParent(l,o),f.borderTop=l,t.setParent(u,o),f.borderBottom=u,kr.forEach(s,function(c){y1(t,e,r,n,a,i,c);var h=t.node(c),d=h.borderTop?h.borderTop:c,v=h.borderBottom?h.borderBottom:c,p=h.borderTop?n:2*n,m=d!==v?1:a-i[o]+1;t.setEdge(l,d,{weight:p,minlen:m,nestingEdge:!0}),t.setEdge(v,u,{weight:p,minlen:m,nestingEdge:!0})}),t.parent(o)||t.setEdge(e,l,{weight:0,minlen:a+i[o]})}function b4(t){var e={};function r(n,a){var i=t.children(n);i&&i.length&&kr.forEach(i,function(o){r(o,a+1)}),e[n]=a}return kr.forEach(t.children(),function(n){r(n,1)}),e}function E4(t){return kr.reduce(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function w4(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,kr.forEach(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}});var x1=F((Bj,w1)=>{var kf=dt(),x4=Gt();w1.exports=T4;function T4(t){function e(r){var n=t.children(r),a=t.node(r);if(n.length&&kf.forEach(n,e),kf.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,o=a.maxRank+1;i<o;++i)E1(t,"borderLeft","_bl",r,a,i),E1(t,"borderRight","_br",r,a,i)}}kf.forEach(t.children(),e)}function E1(t,e,r,n,a,i){var o={width:0,height:0,rank:i,borderType:e},s=a[e][i-1],l=x4.addDummyNode(t,"border",o,r);a[e][i]=l,t.setParent(l,n),s&&t.setEdge(s,l,{weight:1})}});var L1=F((kj,S1)=>{"use strict";var Cr=dt();S1.exports={adjust:C4,undo:S4};function C4(t){var e=t.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&C1(t)}function S4(t){var e=t.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&L4(t),(e==="lr"||e==="rl")&&(N4(t),C1(t))}function C1(t){Cr.forEach(t.nodes(),function(e){T1(t.node(e))}),Cr.forEach(t.edges(),function(e){T1(t.edge(e))})}function T1(t){var e=t.width;t.width=t.height,t.height=e}function L4(t){Cr.forEach(t.nodes(),function(e){qf(t.node(e))}),Cr.forEach(t.edges(),function(e){var r=t.edge(e);Cr.forEach(r.points,qf),Cr.has(r,"y")&&qf(r)})}function qf(t){t.y=-t.y}function N4(t){Cr.forEach(t.nodes(),function(e){zf(t.node(e))}),Cr.forEach(t.edges(),function(e){var r=t.edge(e);Cr.forEach(r.points,zf),Cr.has(r,"x")&&zf(r)})}function zf(t){var e=t.x;t.x=t.y,t.y=e}});var O1=F((qj,N1)=>{"use strict";var qr=dt();N1.exports=O4;function O4(t){var e={},r=qr.filter(t.nodes(),function(s){return!t.children(s).length}),n=qr.max(qr.map(r,function(s){return t.node(s).rank})),a=qr.map(qr.range(n+1),function(){return[]});function i(s){if(!qr.has(e,s)){e[s]=!0;var l=t.node(s);a[l.rank].push(s),qr.forEach(t.successors(s),i)}}var o=qr.sortBy(r,function(s){return t.node(s).rank});return qr.forEach(o,i),a}});var I1=F((zj,A1)=>{"use strict";var cn=dt();A1.exports=A4;function A4(t,e){for(var r=0,n=1;n<e.length;++n)r+=I4(t,e[n-1],e[n]);return r}function I4(t,e,r){for(var n=cn.zipObject(r,cn.map(r,function(u,f){return f})),a=cn.flatten(cn.map(e,function(u){return cn.sortBy(cn.map(t.outEdges(u),function(f){return{pos:n[f.w],weight:t.edge(f).weight}}),"pos")}),!0),i=1;i<r.length;)i<<=1;var o=2*i-1;i-=1;var s=cn.map(new Array(o),function(){return 0}),l=0;return cn.forEach(a.forEach(function(u){var f=u.pos+i;s[f]+=u.weight;for(var c=0;f>0;)f%2&&(c+=s[f+1]),f=f-1>>1,s[f]+=u.weight;l+=u.weight*c})),l}});var R1=F((Uj,M1)=>{var D1=dt();M1.exports=D4;function D4(t,e){return D1.map(e,function(r){var n=t.inEdges(r);if(n.length){var a=D1.reduce(n,function(i,o){var s=t.edge(o),l=t.node(o.v);return{sum:i.sum+s.weight*l.order,weight:i.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}});var _1=F((Gj,P1)=>{"use strict";var jt=dt();P1.exports=M4;function M4(t,e){var r={};jt.forEach(t,function(a,i){var o=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};jt.isUndefined(a.barycenter)||(o.barycenter=a.barycenter,o.weight=a.weight)}),jt.forEach(e.edges(),function(a){var i=r[a.v],o=r[a.w];!jt.isUndefined(i)&&!jt.isUndefined(o)&&(o.indegree++,i.out.push(r[a.w]))});var n=jt.filter(r,function(a){return!a.indegree});return R4(n)}function R4(t){var e=[];function r(i){return function(o){o.merged||(jt.isUndefined(o.barycenter)||jt.isUndefined(i.barycenter)||o.barycenter>=i.barycenter)&&P4(i,o)}}function n(i){return function(o){o.in.push(i),--o.indegree===0&&t.push(o)}}for(;t.length;){var a=t.pop();e.push(a),jt.forEach(a.in.reverse(),r(a)),jt.forEach(a.out,n(a))}return jt.map(jt.filter(e,function(i){return!i.merged}),function(i){return jt.pick(i,["vs","i","barycenter","weight"])})}function P4(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}});var k1=F((Vj,B1)=>{var Ji=dt(),_4=Gt();B1.exports=F4;function F4(t,e){var r=_4.partition(t,function(f){return Ji.has(f,"barycenter")}),n=r.lhs,a=Ji.sortBy(r.rhs,function(f){return-f.i}),i=[],o=0,s=0,l=0;n.sort(B4(!!e)),l=F1(i,a,l),Ji.forEach(n,function(f){l+=f.vs.length,i.push(f.vs),o+=f.barycenter*f.weight,s+=f.weight,l=F1(i,a,l)});var u={vs:Ji.flatten(i,!0)};return s&&(u.barycenter=o/s,u.weight=s),u}function F1(t,e,r){for(var n;e.length&&(n=Ji.last(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function B4(t){return function(e,r){return e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}}});var U1=F((Hj,z1)=>{var hn=dt(),k4=R1(),q4=_1(),z4=k1();z1.exports=q1;function q1(t,e,r,n){var a=t.children(e),i=t.node(e),o=i?i.borderLeft:void 0,s=i?i.borderRight:void 0,l={};o&&(a=hn.filter(a,function(v){return v!==o&&v!==s}));var u=k4(t,a);hn.forEach(u,function(v){if(t.children(v.v).length){var p=q1(t,v.v,r,n);l[v.v]=p,hn.has(p,"barycenter")&&G4(v,p)}});var f=q4(u,r);U4(f,l);var c=z4(f,n);if(o&&(c.vs=hn.flatten([o,c.vs,s],!0),t.predecessors(o).length)){var h=t.node(t.predecessors(o)[0]),d=t.node(t.predecessors(s)[0]);hn.has(c,"barycenter")||(c.barycenter=0,c.weight=0),c.barycenter=(c.barycenter*c.weight+h.order+d.order)/(c.weight+2),c.weight+=2}return c}function U4(t,e){hn.forEach(t,function(r){r.vs=hn.flatten(r.vs.map(function(n){return e[n]?e[n].vs:n}),!0)})}function G4(t,e){hn.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}});var V1=F(($j,G1)=>{var eo=dt(),V4=ar().Graph;G1.exports=H4;function H4(t,e,r){var n=$4(t),a=new V4({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(i){return t.node(i)});return eo.forEach(t.nodes(),function(i){var o=t.node(i),s=t.parent(i);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(a.setNode(i),a.setParent(i,s||n),eo.forEach(t[r](i),function(l){var u=l.v===i?l.w:l.v,f=a.edge(u,i),c=eo.isUndefined(f)?0:f.weight;a.setEdge(u,i,{weight:t.edge(l).weight+c})}),eo.has(o,"minRank")&&a.setNode(i,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),a}function $4(t){for(var e;t.hasNode(e=eo.uniqueId("_root")););return e}});var $1=F((Yj,H1)=>{var Y4=dt();H1.exports=W4;function W4(t,e,r){var n={},a;Y4.forEach(r,function(i){for(var o=t.parent(i),s,l;o;){if(s=t.parent(o),s?(l=n[s],n[s]=o):(l=a,a=o),l&&l!==o){e.setEdge(l,o);return}o=s}})}});var j1=F((Wj,K1)=>{"use strict";var dn=dt(),X4=O1(),K4=I1(),j4=U1(),Z4=V1(),Q4=$1(),J4=ar().Graph,Y1=Gt();K1.exports=eW;function eW(t){var e=Y1.maxRank(t),r=W1(t,dn.range(1,e+1),"inEdges"),n=W1(t,dn.range(e-1,-1,-1),"outEdges"),a=X4(t);X1(t,a);for(var i=Number.POSITIVE_INFINITY,o,s=0,l=0;l<4;++s,++l){tW(s%2?r:n,s%4>=2),a=Y1.buildLayerMatrix(t);var u=K4(t,a);u<i&&(l=0,o=dn.cloneDeep(a),i=u)}X1(t,o)}function W1(t,e,r){return dn.map(e,function(n){return Z4(t,n,r)})}function tW(t,e){var r=new J4;dn.forEach(t,function(n){var a=n.graph().root,i=j4(n,a,r,e);dn.forEach(i.vs,function(o,s){n.node(o).order=s}),Q4(n,r,i.vs)})}function X1(t,e){dn.forEach(e,function(r){dn.forEach(r,function(n,a){t.node(n).order=a})})}});var oT=F((Xj,iT)=>{"use strict";var qe=dt(),rW=ar().Graph,nW=Gt();iT.exports={positionX:oW,findType1Conflicts:Z1,findType2Conflicts:Q1,addConflict:Uf,hasConflict:J1,verticalAlignment:eT,horizontalCompaction:tT,alignCoordinates:nT,findSmallestWidthAlignment:rT,balance:aT};function Z1(t,e){var r={};function n(a,i){var o=0,s=0,l=a.length,u=qe.last(i);return qe.forEach(i,function(f,c){var h=aW(t,f),d=h?t.node(h).order:l;(h||f===u)&&(qe.forEach(i.slice(s,c+1),function(v){qe.forEach(t.predecessors(v),function(p){var m=t.node(p),g=m.order;(g<o||d<g)&&!(m.dummy&&t.node(v).dummy)&&Uf(r,p,v)})}),s=c+1,o=d)}),i}return qe.reduce(e,n),r}function Q1(t,e){var r={};function n(i,o,s,l,u){var f;qe.forEach(qe.range(o,s),function(c){f=i[c],t.node(f).dummy&&qe.forEach(t.predecessors(f),function(h){var d=t.node(h);d.dummy&&(d.order<l||d.order>u)&&Uf(r,h,f)})})}function a(i,o){var s=-1,l,u=0;return qe.forEach(o,function(f,c){if(t.node(f).dummy==="border"){var h=t.predecessors(f);h.length&&(l=t.node(h[0]).order,n(o,u,c,s,l),u=c,s=l)}n(o,u,o.length,l,i.length)}),o}return qe.reduce(e,a),r}function aW(t,e){if(t.node(e).dummy)return qe.find(t.predecessors(e),function(r){return t.node(r).dummy})}function Uf(t,e,r){if(e>r){var n=e;e=r,r=n}var a=t[e];a||(t[e]=a={}),a[r]=!0}function J1(t,e,r){if(e>r){var n=e;e=r,r=n}return qe.has(t[e],r)}function eT(t,e,r,n){var a={},i={},o={};return qe.forEach(e,function(s){qe.forEach(s,function(l,u){a[l]=l,i[l]=l,o[l]=u})}),qe.forEach(e,function(s){var l=-1;qe.forEach(s,function(u){var f=n(u);if(f.length){f=qe.sortBy(f,function(p){return o[p]});for(var c=(f.length-1)/2,h=Math.floor(c),d=Math.ceil(c);h<=d;++h){var v=f[h];i[u]===u&&l<o[v]&&!J1(r,u,v)&&(i[v]=u,i[u]=a[u]=a[v],l=o[v])}}})}),{root:a,align:i}}function tT(t,e,r,n,a){var i={},o=iW(t,e,r,a),s=a?"borderLeft":"borderRight";function l(c,h){for(var d=o.nodes(),v=d.pop(),p={};v;)p[v]?c(v):(p[v]=!0,d.push(v),d=d.concat(h(v))),v=d.pop()}function u(c){i[c]=o.inEdges(c).reduce(function(h,d){return Math.max(h,i[d.v]+o.edge(d))},0)}function f(c){var h=o.outEdges(c).reduce(function(v,p){return Math.min(v,i[p.w]-o.edge(p))},Number.POSITIVE_INFINITY),d=t.node(c);h!==Number.POSITIVE_INFINITY&&d.borderType!==s&&(i[c]=Math.max(i[c],h))}return l(u,o.predecessors.bind(o)),l(f,o.successors.bind(o)),qe.forEach(n,function(c){i[c]=i[r[c]]}),i}function iW(t,e,r,n){var a=new rW,i=t.graph(),o=sW(i.nodesep,i.edgesep,n);return qe.forEach(e,function(s){var l;qe.forEach(s,function(u){var f=r[u];if(a.setNode(f),l){var c=r[l],h=a.edge(c,f);a.setEdge(c,f,Math.max(o(t,u,l),h||0))}l=u})}),a}function rT(t,e){return qe.minBy(qe.values(e),function(r){var n=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return qe.forIn(r,function(i,o){var s=uW(t,o)/2;n=Math.max(i+s,n),a=Math.min(i-s,a)}),n-a})}function nT(t,e){var r=qe.values(e),n=qe.min(r),a=qe.max(r);qe.forEach(["u","d"],function(i){qe.forEach(["l","r"],function(o){var s=i+o,l=t[s],u;if(l!==e){var f=qe.values(l);u=o==="l"?n-qe.min(f):a-qe.max(f),u&&(t[s]=qe.mapValues(l,function(c){return c+u}))}})})}function aT(t,e){return qe.mapValues(t.ul,function(r,n){if(e)return t[e.toLowerCase()][n];var a=qe.sortBy(qe.map(t,n));return(a[1]+a[2])/2})}function oW(t){var e=nW.buildLayerMatrix(t),r=qe.merge(Z1(t,e),Q1(t,e)),n={},a;qe.forEach(["u","d"],function(o){a=o==="u"?e:qe.values(e).reverse(),qe.forEach(["l","r"],function(s){s==="r"&&(a=qe.map(a,function(c){return qe.values(c).reverse()}));var l=(o==="u"?t.predecessors:t.successors).bind(t),u=eT(t,a,r,l),f=tT(t,a,u.root,u.align,s==="r");s==="r"&&(f=qe.mapValues(f,function(c){return-c})),n[o+s]=f})});var i=rT(t,n);return nT(n,i),aT(n,t.graph().align)}function sW(t,e,r){return function(n,a,i){var o=n.node(a),s=n.node(i),l=0,u;if(l+=o.width/2,qe.has(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(l+=r?u:-u),u=0,l+=(o.dummy?e:t)/2,l+=(s.dummy?e:t)/2,l+=s.width/2,qe.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(l+=r?u:-u),u=0,l}}function uW(t,e){return t.node(e).width}});var lT=F((Kj,uT)=>{"use strict";var to=dt(),sT=Gt(),lW=oT().positionX;uT.exports=fW;function fW(t){t=sT.asNonCompoundGraph(t),cW(t),to.forEach(lW(t),function(e,r){t.node(r).x=e})}function cW(t){var e=sT.buildLayerMatrix(t),r=t.graph().ranksep,n=0;to.forEach(e,function(a){var i=to.max(to.map(a,function(o){return t.node(o).height}));to.forEach(a,function(o){t.node(o).y=n+i/2}),n+=i+r})}});var pT=F((jj,vT)=>{"use strict";var $e=dt(),fT=Wx(),cT=e1(),hW=v1(),dW=Gt().normalizeRanks,vW=g1(),pW=Gt().removeEmptyRanks,hT=b1(),gW=x1(),dT=L1(),yW=j1(),mW=lT(),vn=Gt(),bW=ar().Graph;vT.exports=EW;function EW(t,e){var r=e&&e.debugTiming?vn.time:vn.notime;r("layout",function(){var n=r(" buildLayoutGraph",function(){return DW(t)});r(" runLayout",function(){wW(n,r)}),r(" updateInputGraph",function(){xW(t,n)})})}function wW(t,e){e(" makeSpaceForEdgeLabels",function(){MW(t)}),e(" removeSelfEdges",function(){UW(t)}),e(" acyclic",function(){fT.run(t)}),e(" nestingGraph.run",function(){hT.run(t)}),e(" rank",function(){hW(vn.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){RW(t)}),e(" removeEmptyRanks",function(){pW(t)}),e(" nestingGraph.cleanup",function(){hT.cleanup(t)}),e(" normalizeRanks",function(){dW(t)}),e(" assignRankMinMax",function(){PW(t)}),e(" removeEdgeLabelProxies",function(){_W(t)}),e(" normalize.run",function(){cT.run(t)}),e(" parentDummyChains",function(){vW(t)}),e(" addBorderSegments",function(){gW(t)}),e(" order",function(){yW(t)}),e(" insertSelfEdges",function(){GW(t)}),e(" adjustCoordinateSystem",function(){dT.adjust(t)}),e(" position",function(){mW(t)}),e(" positionSelfEdges",function(){VW(t)}),e(" removeBorderNodes",function(){zW(t)}),e(" normalize.undo",function(){cT.undo(t)}),e(" fixupEdgeLabelCoords",function(){kW(t)}),e(" undoCoordinateSystem",function(){dT.undo(t)}),e(" translateGraph",function(){FW(t)}),e(" assignNodeIntersects",function(){BW(t)}),e(" reversePoints",function(){qW(t)}),e(" acyclic.undo",function(){fT.undo(t)})}function xW(t,e){$e.forEach(t.nodes(),function(r){var n=t.node(r),a=e.node(r);n&&(n.x=a.x,n.y=a.y,e.children(r).length&&(n.width=a.width,n.height=a.height))}),$e.forEach(t.edges(),function(r){var n=t.edge(r),a=e.edge(r);n.points=a.points,$e.has(a,"x")&&(n.x=a.x,n.y=a.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var TW=["nodesep","edgesep","ranksep","marginx","marginy"],CW={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},SW=["acyclicer","ranker","rankdir","align"],LW=["width","height"],NW={width:0,height:0},OW=["minlen","weight","width","height","labeloffset"],AW={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},IW=["labelpos"];function DW(t){var e=new bW({multigraph:!0,compound:!0}),r=Vf(t.graph());return e.setGraph($e.merge({},CW,Gf(r,TW),$e.pick(r,SW))),$e.forEach(t.nodes(),function(n){var a=Vf(t.node(n));e.setNode(n,$e.defaults(Gf(a,LW),NW)),e.setParent(n,t.parent(n))}),$e.forEach(t.edges(),function(n){var a=Vf(t.edge(n));e.setEdge(n,$e.merge({},AW,Gf(a,OW),$e.pick(a,IW)))}),e}function MW(t){var e=t.graph();e.ranksep/=2,$e.forEach(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function RW(t){$e.forEach(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),a=t.node(e.w),i={rank:(a.rank-n.rank)/2+n.rank,e};vn.addDummyNode(t,"edge-proxy",i,"_ep")}})}function PW(t){var e=0;$e.forEach(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=$e.max(e,n.maxRank))}),t.graph().maxRank=e}function _W(t){$e.forEach(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function FW(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,a=0,i=t.graph(),o=i.marginx||0,s=i.marginy||0;function l(u){var f=u.x,c=u.y,h=u.width,d=u.height;e=Math.min(e,f-h/2),r=Math.max(r,f+h/2),n=Math.min(n,c-d/2),a=Math.max(a,c+d/2)}$e.forEach(t.nodes(),function(u){l(t.node(u))}),$e.forEach(t.edges(),function(u){var f=t.edge(u);$e.has(f,"x")&&l(f)}),e-=o,n-=s,$e.forEach(t.nodes(),function(u){var f=t.node(u);f.x-=e,f.y-=n}),$e.forEach(t.edges(),function(u){var f=t.edge(u);$e.forEach(f.points,function(c){c.x-=e,c.y-=n}),$e.has(f,"x")&&(f.x-=e),$e.has(f,"y")&&(f.y-=n)}),i.width=r-e+o,i.height=a-n+s}function BW(t){$e.forEach(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),a=t.node(e.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=a,o=n),r.points.unshift(vn.intersectRect(n,i)),r.points.push(vn.intersectRect(a,o))})}function kW(t){$e.forEach(t.edges(),function(e){var r=t.edge(e);if($e.has(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function qW(t){$e.forEach(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function zW(t){$e.forEach(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),a=t.node(r.borderBottom),i=t.node($e.last(r.borderLeft)),o=t.node($e.last(r.borderRight));r.width=Math.abs(o.x-i.x),r.height=Math.abs(a.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),$e.forEach(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function UW(t){$e.forEach(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function GW(t){var e=vn.buildLayerMatrix(t);$e.forEach(e,function(r){var n=0;$e.forEach(r,function(a,i){var o=t.node(a);o.order=i+n,$e.forEach(o.selfEdges,function(s){vn.addDummyNode(t,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:i+ ++n,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function VW(t){$e.forEach(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),a=n.x+n.width/2,i=n.y,o=r.x-a,s=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:a+2*o/3,y:i-s},{x:a+5*o/6,y:i-s},{x:a+o,y:i},{x:a+5*o/6,y:i+s},{x:a+2*o/3,y:i+s}],r.label.x=r.x,r.label.y=r.y}})}function Gf(t,e){return $e.mapValues($e.pick(t,e),Number)}function Vf(t){var e={};return $e.forEach(t,function(r,n){e[n.toLowerCase()]=r}),e}});var yT=F((Zj,gT)=>{var Ys=dt(),HW=Gt(),$W=ar().Graph;gT.exports={debugOrdering:YW};function YW(t){var e=HW.buildLayerMatrix(t),r=new $W({compound:!0,multigraph:!0}).setGraph({});return Ys.forEach(t.nodes(),function(n){r.setNode(n,{label:n}),r.setParent(n,"layer"+t.node(n).rank)}),Ys.forEach(t.edges(),function(n){r.setEdge(n.v,n.w,{},n.name)}),Ys.forEach(e,function(n,a){var i="layer"+a;r.setNode(i,{rank:"same"}),Ys.reduce(n,function(o,s){return r.setEdge(o,s,{style:"invis"}),s})}),r}});var bT=F((Qj,mT)=>{mT.exports="0.8.5"});var Hf=F((Jj,ET)=>{ET.exports={graphlib:ar(),layout:pT(),debug:yT(),util:{time:Gt().time,notime:Gt().notime},version:bT()}});var wT=F((ro,$f)=>{(function(e,r){typeof ro=="object"&&typeof $f=="object"?$f.exports=r(Hf()):typeof define=="function"&&define.amd?define(["dagre"],r):typeof ro=="object"?ro.cytoscapeDagre=r(Hf()):e.cytoscapeDagre=r(e.dagre)})(ro,function(t){return(function(e){var r={};function n(a){if(r[a])return r[a].exports;var i=r[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=r,n.d=function(a,i,o){n.o(a,i)||Object.defineProperty(a,i,{enumerable:!0,get:o})},n.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},n.t=function(a,i){if(i&1&&(a=n(a)),i&8||i&4&&typeof a=="object"&&a&&a.__esModule)return a;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:a}),i&2&&typeof a!="string")for(var s in a)n.d(o,s,function(l){return a[l]}.bind(null,s));return o},n.n=function(a){var i=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(i,"a",i),i},n.o=function(a,i){return Object.prototype.hasOwnProperty.call(a,i)},n.p="",n(n.s=0)})([(function(e,r,n){var a=n(1),i=function(s){s&&s("layout","dagre",a)};typeof cytoscape<"u"&&i(cytoscape),e.exports=i}),(function(e,r,n){function a(f){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?a=function(h){return typeof h}:a=function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},a(f)}var i=function(c){return typeof c=="function"},o=n(2),s=n(3),l=n(4);function u(f){this.options=s({},o,f)}u.prototype.run=function(){var f=this.options,c=this,h=f.cy,d=f.eles,v=function(k,U){return i(U)?U.apply(k,[k]):U},p=f.boundingBox||{x1:0,y1:0,w:h.width(),h:h.height()};p.x2===void 0&&(p.x2=p.x1+p.w),p.w===void 0&&(p.w=p.x2-p.x1),p.y2===void 0&&(p.y2=p.y1+p.h),p.h===void 0&&(p.h=p.y2-p.y1);var m=new l.graphlib.Graph({multigraph:!0,compound:!0}),g={},y=function(k,U){U!=null&&(g[k]=U)};y("nodesep",f.nodeSep),y("edgesep",f.edgeSep),y("ranksep",f.rankSep),y("rankdir",f.rankDir),y("align",f.align),y("ranker",f.ranker),y("acyclicer",f.acyclicer),m.setGraph(g),m.setDefaultEdgeLabel(function(){return{}}),m.setDefaultNodeLabel(function(){return{}});var b=d.nodes();i(f.sort)&&(b=b.sort(f.sort));for(var x=0;x<b.length;x++){var C=b[x],O=C.layoutDimensions(f);m.setNode(C.id(),{width:O.w,height:O.h,name:C.id()})}for(var L=0;L<b.length;L++){var A=b[L];A.isChild()&&m.setParent(A.id(),A.parent().id())}var I=d.edges().stdFilter(function(P){return!P.source().isParent()&&!P.target().isParent()});i(f.sort)&&(I=I.sort(f.sort));for(var D=0;D<I.length;D++){var M=I[D];m.setEdge(M.source().id(),M.target().id(),{minlen:v(M,f.minLen),weight:v(M,f.edgeWeight),name:M.id()},M.id())}l.layout(m);for(var E=m.nodes(),S=0;S<E.length;S++){var w=E[S],N=m.node(w);h.getElementById(w).scratch().dagre=N}var T;f.boundingBox?(T={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},b.forEach(function(P){var k=P.scratch().dagre;T.x1=Math.min(T.x1,k.x),T.x2=Math.max(T.x2,k.x),T.y1=Math.min(T.y1,k.y),T.y2=Math.max(T.y2,k.y)}),T.w=T.x2-T.x1,T.h=T.y2-T.y1):T=p;var R=function(k){if(f.boundingBox){var U=T.w===0?0:(k.x-T.x1)/T.w,B=T.h===0?0:(k.y-T.y1)/T.h;return{x:p.x1+U*p.w,y:p.y1+B*p.h}}else return k};return b.layoutPositions(c,f,function(P){P=a(P)==="object"?P:this;var k=P.scratch().dagre;return R({x:k.x,y:k.y})}),this},e.exports=u}),(function(e,r){var n={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(i){return 1},edgeWeight:function(i){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(i,o){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(i,o){return o},ready:function(){},sort:void 0,stop:function(){}};e.exports=n}),(function(e,r){e.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,i=new Array(a>1?a-1:0),o=1;o<a;o++)i[o-1]=arguments[o];return i.forEach(function(s){Object.keys(s).forEach(function(l){return n[l]=s[l]})}),n}}),(function(e,r){e.exports=t})])})});var CT=F(Ws=>{"use strict";Ws.byteLength=XW;Ws.toByteArray=jW;Ws.fromByteArray=JW;var Sr=[],ir=[],WW=typeof Uint8Array<"u"?Uint8Array:Array,Yf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Hn=0,xT=Yf.length;Hn<xT;++Hn)Sr[Hn]=Yf[Hn],ir[Yf.charCodeAt(Hn)]=Hn;var Hn,xT;ir[45]=62;ir[95]=63;function TT(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function XW(t){var e=TT(t),r=e[0],n=e[1];return(r+n)*3/4-n}function KW(t,e,r){return(e+r)*3/4-r}function jW(t){var e,r=TT(t),n=r[0],a=r[1],i=new WW(KW(t,n,a)),o=0,s=a>0?n-4:n,l;for(l=0;l<s;l+=4)e=ir[t.charCodeAt(l)]<<18|ir[t.charCodeAt(l+1)]<<12|ir[t.charCodeAt(l+2)]<<6|ir[t.charCodeAt(l+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=e&255;return a===2&&(e=ir[t.charCodeAt(l)]<<2|ir[t.charCodeAt(l+1)]>>4,i[o++]=e&255),a===1&&(e=ir[t.charCodeAt(l)]<<10|ir[t.charCodeAt(l+1)]<<4|ir[t.charCodeAt(l+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function ZW(t){return Sr[t>>18&63]+Sr[t>>12&63]+Sr[t>>6&63]+Sr[t&63]}function QW(t,e,r){for(var n,a=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),a.push(ZW(n));return a.join("")}function JW(t){for(var e,r=t.length,n=r%3,a=[],i=16383,o=0,s=r-n;o<s;o+=i)a.push(QW(t,o,o+i>s?s:o+i));return n===1?(e=t[r-1],a.push(Sr[e>>2]+Sr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],a.push(Sr[e>>10]+Sr[e>>4&63]+Sr[e<<2&63]+"=")),a.join("")}});var ST=F(Wf=>{Wf.read=function(t,e,r,n,a){var i,o,s=a*8-n-1,l=(1<<s)-1,u=l>>1,f=-7,c=r?a-1:0,h=r?-1:1,d=t[e+c];for(c+=h,i=d&(1<<-f)-1,d>>=-f,f+=s;f>0;i=i*256+t[e+c],c+=h,f-=8);for(o=i&(1<<-f)-1,i>>=-f,f+=n;f>0;o=o*256+t[e+c],c+=h,f-=8);if(i===0)i=1-u;else{if(i===l)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),i=i-u}return(d?-1:1)*o*Math.pow(2,i-n)};Wf.write=function(t,e,r,n,a,i){var o,s,l,u=i*8-a-1,f=(1<<u)-1,c=f>>1,h=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,v=n?1:-1,p=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+c>=1?e+=h/l:e+=h*Math.pow(2,1-c),e*l>=2&&(o++,l/=2),o+c>=f?(s=0,o=f):o+c>=1?(s=(e*l-1)*Math.pow(2,a),o=o+c):(s=e*Math.pow(2,c-1)*Math.pow(2,a),o=0));a>=8;t[r+d]=s&255,d+=v,s/=256,a-=8);for(o=o<<a|s,u+=a;u>0;t[r+d]=o&255,d+=v,o/=256,u-=8);t[r+d-v]|=p*128}});var GT=F(Ga=>{"use strict";var Xf=CT(),za=ST(),LT=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ga.Buffer=ue;Ga.SlowBuffer=i8;Ga.INSPECT_MAX_BYTES=50;var Xs=2147483647;Ga.kMaxLength=Xs;ue.TYPED_ARRAY_SUPPORT=e8();!ue.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function e8(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(ue.prototype,"parent",{enumerable:!0,get:function(){if(ue.isBuffer(this))return this.buffer}});Object.defineProperty(ue.prototype,"offset",{enumerable:!0,get:function(){if(ue.isBuffer(this))return this.byteOffset}});function zr(t){if(t>Xs)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,ue.prototype),e}function ue(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Qf(t)}return IT(t,e,r)}ue.poolSize=8192;function IT(t,e,r){if(typeof t=="string")return r8(t,e);if(ArrayBuffer.isView(t))return n8(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Lr(t,ArrayBuffer)||t&&Lr(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Lr(t,SharedArrayBuffer)||t&&Lr(t.buffer,SharedArrayBuffer)))return jf(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return ue.from(n,e,r);let a=a8(t);if(a)return a;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return ue.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}ue.from=function(t,e,r){return IT(t,e,r)};Object.setPrototypeOf(ue.prototype,Uint8Array.prototype);Object.setPrototypeOf(ue,Uint8Array);function DT(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function t8(t,e,r){return DT(t),t<=0?zr(t):e!==void 0?typeof r=="string"?zr(t).fill(e,r):zr(t).fill(e):zr(t)}ue.alloc=function(t,e,r){return t8(t,e,r)};function Qf(t){return DT(t),zr(t<0?0:Jf(t)|0)}ue.allocUnsafe=function(t){return Qf(t)};ue.allocUnsafeSlow=function(t){return Qf(t)};function r8(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!ue.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=MT(t,e)|0,n=zr(r),a=n.write(t,e);return a!==r&&(n=n.slice(0,a)),n}function Kf(t){let e=t.length<0?0:Jf(t.length)|0,r=zr(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function n8(t){if(Lr(t,Uint8Array)){let e=new Uint8Array(t);return jf(e.buffer,e.byteOffset,e.byteLength)}return Kf(t)}function jf(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,ue.prototype),n}function a8(t){if(ue.isBuffer(t)){let e=Jf(t.length)|0,r=zr(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||tc(t.length)?zr(0):Kf(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Kf(t.data)}function Jf(t){if(t>=Xs)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Xs.toString(16)+" bytes");return t|0}function i8(t){return+t!=t&&(t=0),ue.alloc(+t)}ue.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==ue.prototype};ue.compare=function(e,r){if(Lr(e,Uint8Array)&&(e=ue.from(e,e.offset,e.byteLength)),Lr(r,Uint8Array)&&(r=ue.from(r,r.offset,r.byteLength)),!ue.isBuffer(e)||!ue.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,a=r.length;for(let i=0,o=Math.min(n,a);i<o;++i)if(e[i]!==r[i]){n=e[i],a=r[i];break}return n<a?-1:a<n?1:0};ue.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};ue.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return ue.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let a=ue.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){let o=e[n];if(Lr(o,Uint8Array))i+o.length>a.length?(ue.isBuffer(o)||(o=ue.from(o)),o.copy(a,i)):Uint8Array.prototype.set.call(a,o,i);else if(ue.isBuffer(o))o.copy(a,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return a};function MT(t,e){if(ue.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Lr(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let a=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Zf(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return UT(t).length;default:if(a)return n?-1:Zf(t).length;e=(""+e).toLowerCase(),a=!0}}ue.byteLength=MT;function o8(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return g8(this,e,r);case"utf8":case"utf-8":return PT(this,e,r);case"ascii":return v8(this,e,r);case"latin1":case"binary":return p8(this,e,r);case"base64":return h8(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y8(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}ue.prototype._isBuffer=!0;function $n(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}ue.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)$n(this,r,r+1);return this};ue.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)$n(this,r,r+3),$n(this,r+1,r+2);return this};ue.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)$n(this,r,r+7),$n(this,r+1,r+6),$n(this,r+2,r+5),$n(this,r+3,r+4);return this};ue.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?PT(this,0,e):o8.apply(this,arguments)};ue.prototype.toLocaleString=ue.prototype.toString;ue.prototype.equals=function(e){if(!ue.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:ue.compare(this,e)===0};ue.prototype.inspect=function(){let e="",r=Ga.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};LT&&(ue.prototype[LT]=ue.prototype.inspect);ue.prototype.compare=function(e,r,n,a,i){if(Lr(e,Uint8Array)&&(e=ue.from(e,e.offset,e.byteLength)),!ue.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),r<0||n>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&r>=n)return 0;if(a>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,a>>>=0,i>>>=0,this===e)return 0;let o=i-a,s=n-r,l=Math.min(o,s),u=this.slice(a,i),f=e.slice(r,n);for(let c=0;c<l;++c)if(u[c]!==f[c]){o=u[c],s=f[c];break}return o<s?-1:s<o?1:0};function RT(t,e,r,n,a){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,tc(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0)if(a)r=0;else return-1;if(typeof e=="string"&&(e=ue.from(e,n)),ue.isBuffer(e))return e.length===0?-1:NT(t,e,r,n,a);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):NT(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function NT(t,e,r,n,a){let i=1,o=t.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,o/=2,s/=2,r/=2}function l(f,c){return i===1?f[c]:f.readUInt16BE(c*i)}let u;if(a){let f=-1;for(u=r;u<o;u++)if(l(t,u)===l(e,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===s)return f*i}else f!==-1&&(u-=u-f),f=-1}else for(r+s>o&&(r=o-s),u=r;u>=0;u--){let f=!0;for(let c=0;c<s;c++)if(l(t,u+c)!==l(e,c)){f=!1;break}if(f)return u}return-1}ue.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};ue.prototype.indexOf=function(e,r,n){return RT(this,e,r,n,!0)};ue.prototype.lastIndexOf=function(e,r,n){return RT(this,e,r,n,!1)};function s8(t,e,r,n){r=Number(r)||0;let a=t.length-r;n?(n=Number(n),n>a&&(n=a)):n=a;let i=e.length;n>i/2&&(n=i/2);let o;for(o=0;o<n;++o){let s=parseInt(e.substr(o*2,2),16);if(tc(s))return o;t[r+o]=s}return o}function u8(t,e,r,n){return Ks(Zf(e,t.length-r),t,r,n)}function l8(t,e,r,n){return Ks(w8(e),t,r,n)}function f8(t,e,r,n){return Ks(UT(e),t,r,n)}function c8(t,e,r,n){return Ks(x8(e,t.length-r),t,r,n)}ue.prototype.write=function(e,r,n,a){if(r===void 0)a="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")a=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");let o=!1;for(;;)switch(a){case"hex":return s8(this,e,r,n);case"utf8":case"utf-8":return u8(this,e,r,n);case"ascii":case"latin1":case"binary":return l8(this,e,r,n);case"base64":return f8(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c8(this,e,r,n);default:if(o)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),o=!0}};ue.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function h8(t,e,r){return e===0&&r===t.length?Xf.fromByteArray(t):Xf.fromByteArray(t.slice(e,r))}function PT(t,e,r){r=Math.min(t.length,r);let n=[],a=e;for(;a<r;){let i=t[a],o=null,s=i>239?4:i>223?3:i>191?2:1;if(a+s<=r){let l,u,f,c;switch(s){case 1:i<128&&(o=i);break;case 2:l=t[a+1],(l&192)===128&&(c=(i&31)<<6|l&63,c>127&&(o=c));break;case 3:l=t[a+1],u=t[a+2],(l&192)===128&&(u&192)===128&&(c=(i&15)<<12|(l&63)<<6|u&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:l=t[a+1],u=t[a+2],f=t[a+3],(l&192)===128&&(u&192)===128&&(f&192)===128&&(c=(i&15)<<18|(l&63)<<12|(u&63)<<6|f&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),a+=s}return d8(n)}var OT=4096;function d8(t){let e=t.length;if(e<=OT)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=OT));return r}function v8(t,e,r){let n="";r=Math.min(t.length,r);for(let a=e;a<r;++a)n+=String.fromCharCode(t[a]&127);return n}function p8(t,e,r){let n="";r=Math.min(t.length,r);for(let a=e;a<r;++a)n+=String.fromCharCode(t[a]);return n}function g8(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let a="";for(let i=e;i<r;++i)a+=T8[t[i]];return a}function y8(t,e,r){let n=t.slice(e,r),a="";for(let i=0;i<n.length-1;i+=2)a+=String.fromCharCode(n[i]+n[i+1]*256);return a}ue.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let a=this.subarray(e,r);return Object.setPrototypeOf(a,ue.prototype),a};function Nt(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}ue.prototype.readUintLE=ue.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Nt(e,r,this.length);let a=this[e],i=1,o=0;for(;++o<r&&(i*=256);)a+=this[e+o]*i;return a};ue.prototype.readUintBE=ue.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Nt(e,r,this.length);let a=this[e+--r],i=1;for(;r>0&&(i*=256);)a+=this[e+--r]*i;return a};ue.prototype.readUint8=ue.prototype.readUInt8=function(e,r){return e=e>>>0,r||Nt(e,1,this.length),this[e]};ue.prototype.readUint16LE=ue.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Nt(e,2,this.length),this[e]|this[e+1]<<8};ue.prototype.readUint16BE=ue.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Nt(e,2,this.length),this[e]<<8|this[e+1]};ue.prototype.readUint32LE=ue.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Nt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};ue.prototype.readUint32BE=ue.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Nt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};ue.prototype.readBigUInt64LE=pn(function(e){e=e>>>0,Ua(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&no(e,this.length-8);let a=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(a)+(BigInt(i)<<BigInt(32))});ue.prototype.readBigUInt64BE=pn(function(e){e=e>>>0,Ua(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&no(e,this.length-8);let a=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(a)<<BigInt(32))+BigInt(i)});ue.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Nt(e,r,this.length);let a=this[e],i=1,o=0;for(;++o<r&&(i*=256);)a+=this[e+o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};ue.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Nt(e,r,this.length);let a=r,i=1,o=this[e+--a];for(;a>0&&(i*=256);)o+=this[e+--a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};ue.prototype.readInt8=function(e,r){return e=e>>>0,r||Nt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};ue.prototype.readInt16LE=function(e,r){e=e>>>0,r||Nt(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};ue.prototype.readInt16BE=function(e,r){e=e>>>0,r||Nt(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};ue.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Nt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};ue.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Nt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};ue.prototype.readBigInt64LE=pn(function(e){e=e>>>0,Ua(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&no(e,this.length-8);let a=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(a)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});ue.prototype.readBigInt64BE=pn(function(e){e=e>>>0,Ua(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&no(e,this.length-8);let a=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(a)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});ue.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Nt(e,4,this.length),za.read(this,e,!0,23,4)};ue.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Nt(e,4,this.length),za.read(this,e,!1,23,4)};ue.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Nt(e,8,this.length),za.read(this,e,!0,52,8)};ue.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Nt(e,8,this.length),za.read(this,e,!1,52,8)};function $t(t,e,r,n,a,i){if(!ue.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}ue.prototype.writeUintLE=ue.prototype.writeUIntLE=function(e,r,n,a){if(e=+e,r=r>>>0,n=n>>>0,!a){let s=Math.pow(2,8*n)-1;$t(this,e,r,n,s,0)}let i=1,o=0;for(this[r]=e&255;++o<n&&(i*=256);)this[r+o]=e/i&255;return r+n};ue.prototype.writeUintBE=ue.prototype.writeUIntBE=function(e,r,n,a){if(e=+e,r=r>>>0,n=n>>>0,!a){let s=Math.pow(2,8*n)-1;$t(this,e,r,n,s,0)}let i=n-1,o=1;for(this[r+i]=e&255;--i>=0&&(o*=256);)this[r+i]=e/o&255;return r+n};ue.prototype.writeUint8=ue.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||$t(this,e,r,1,255,0),this[r]=e&255,r+1};ue.prototype.writeUint16LE=ue.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||$t(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};ue.prototype.writeUint16BE=ue.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||$t(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};ue.prototype.writeUint32LE=ue.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||$t(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};ue.prototype.writeUint32BE=ue.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||$t(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function _T(t,e,r,n,a){zT(e,n,a,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function FT(t,e,r,n,a){zT(e,n,a,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i=i>>8,t[r+6]=i,i=i>>8,t[r+5]=i,i=i>>8,t[r+4]=i;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}ue.prototype.writeBigUInt64LE=pn(function(e,r=0){return _T(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});ue.prototype.writeBigUInt64BE=pn(function(e,r=0){return FT(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});ue.prototype.writeIntLE=function(e,r,n,a){if(e=+e,r=r>>>0,!a){let l=Math.pow(2,8*n-1);$t(this,e,r,n,l-1,-l)}let i=0,o=1,s=0;for(this[r]=e&255;++i<n&&(o*=256);)e<0&&s===0&&this[r+i-1]!==0&&(s=1),this[r+i]=(e/o>>0)-s&255;return r+n};ue.prototype.writeIntBE=function(e,r,n,a){if(e=+e,r=r>>>0,!a){let l=Math.pow(2,8*n-1);$t(this,e,r,n,l-1,-l)}let i=n-1,o=1,s=0;for(this[r+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[r+i+1]!==0&&(s=1),this[r+i]=(e/o>>0)-s&255;return r+n};ue.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||$t(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};ue.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||$t(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};ue.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||$t(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};ue.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||$t(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};ue.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||$t(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};ue.prototype.writeBigInt64LE=pn(function(e,r=0){return _T(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});ue.prototype.writeBigInt64BE=pn(function(e,r=0){return FT(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function BT(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function kT(t,e,r,n,a){return e=+e,r=r>>>0,a||BT(t,e,r,4,34028234663852886e22,-34028234663852886e22),za.write(t,e,r,n,23,4),r+4}ue.prototype.writeFloatLE=function(e,r,n){return kT(this,e,r,!0,n)};ue.prototype.writeFloatBE=function(e,r,n){return kT(this,e,r,!1,n)};function qT(t,e,r,n,a){return e=+e,r=r>>>0,a||BT(t,e,r,8,17976931348623157e292,-17976931348623157e292),za.write(t,e,r,n,52,8),r+8}ue.prototype.writeDoubleLE=function(e,r,n){return qT(this,e,r,!0,n)};ue.prototype.writeDoubleBE=function(e,r,n){return qT(this,e,r,!1,n)};ue.prototype.copy=function(e,r,n,a){if(!ue.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!a&&a!==0&&(a=this.length),r>=e.length&&(r=e.length),r||(r=0),a>0&&a<n&&(a=n),a===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-r<a-n&&(a=e.length-r+n);let i=a-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,a):Uint8Array.prototype.set.call(e,this.subarray(n,a),r),i};ue.prototype.fill=function(e,r,n,a){if(typeof e=="string"){if(typeof r=="string"?(a=r,r=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!ue.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(e.length===1){let o=e.charCodeAt(0);(a==="utf8"&&o<128||a==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let i;if(typeof e=="number")for(i=r;i<n;++i)this[i]=e;else{let o=ue.isBuffer(e)?e:ue.from(e,a),s=o.length;if(s===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-r;++i)this[i+r]=o[i%s]}return this};var qa={};function ec(t,e,r){qa[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(a){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:a,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}ec("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);ec("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);ec("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,a=r;return Number.isInteger(r)&&Math.abs(r)>2**32?a=AT(String(r)):typeof r=="bigint"&&(a=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(a=AT(a)),a+="n"),n+=` It must be ${e}. Received ${a}`,n},RangeError);function AT(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function m8(t,e,r){Ua(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&no(e,t.length-(r+1))}function zT(t,e,r,n,a,i){if(t>r||t<e){let o=typeof e=="bigint"?"n":"",s;throw i>3?e===0||e===BigInt(0)?s=`>= 0${o} and < 2${o} ** ${(i+1)*8}${o}`:s=`>= -(2${o} ** ${(i+1)*8-1}${o}) and < 2 ** ${(i+1)*8-1}${o}`:s=`>= ${e}${o} and <= ${r}${o}`,new qa.ERR_OUT_OF_RANGE("value",s,t)}m8(n,a,i)}function Ua(t,e){if(typeof t!="number")throw new qa.ERR_INVALID_ARG_TYPE(e,"number",t)}function no(t,e,r){throw Math.floor(t)!==t?(Ua(t,r),new qa.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new qa.ERR_BUFFER_OUT_OF_BOUNDS:new qa.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var b8=/[^+/0-9A-Za-z-_]/g;function E8(t){if(t=t.split("=")[0],t=t.trim().replace(b8,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Zf(t,e){e=e||1/0;let r,n=t.length,a=null,i=[];for(let o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function w8(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function x8(t,e){let r,n,a,i=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,a=r%256,i.push(a),i.push(n);return i}function UT(t){return Xf.toByteArray(E8(t))}function Ks(t,e,r,n){let a;for(a=0;a<n&&!(a+r>=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function Lr(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function tc(t){return t!==t}var T8=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let a=0;a<16;++a)e[n+a]=t[r]+t[a]}return e})();function pn(t){return typeof BigInt>"u"?C8:t}function C8(){throw new Error("BigInt not supported")}});var $T=F((aZ,HT)=>{var VT;HT.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(VT||(VT=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});function Tt(t){"@babel/helpers - typeof";return Tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tt(t)}function Uu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Gu(t,e,r){return e&&Cc(t.prototype,e),r&&Cc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function qh(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function or(t,e){return rS(t)||nS(t,e)||zh(t,e)||aS()}function rS(t){if(Array.isArray(t))return t}function nS(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],a=!0,i=!1,o,s;try{for(r=r.call(t);!(a=(o=r.next()).done)&&(n.push(o.value),!(e&&n.length===e));a=!0);}catch(l){i=!0,s=l}finally{try{!a&&r.return!=null&&r.return()}finally{if(i)throw s}}return n}}function zh(t,e){if(t){if(typeof t=="string")return Sc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Sc(t,e)}}function Sc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function aS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uh(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=zh(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return i=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}}}var wt=typeof window>"u"?null:window,Lc=wt?wt.navigator:null;wt&&wt.document;var iS=Tt(""),Gh=Tt({}),oS=Tt(function(){}),sS=typeof HTMLElement>"u"?"undefined":Tt(HTMLElement),gi=function(e){return e&&e.instanceString&&vt(e.instanceString)?e.instanceString():null},Re=function(e){return e!=null&&Tt(e)==iS},vt=function(e){return e!=null&&Tt(e)===oS},ot=function(e){return!Yt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Qe=function(e){return e!=null&&Tt(e)===Gh&&!ot(e)&&e.constructor===Object},uS=function(e){return e!=null&&Tt(e)===Gh},we=function(e){return e!=null&&Tt(e)===Tt(1)&&!isNaN(e)},lS=function(e){return we(e)&&Math.floor(e)===e},Uo=function(e){if(sS!=="undefined")return e!=null&&e instanceof HTMLElement},Yt=function(e){return yi(e)||Vh(e)},yi=function(e){return gi(e)==="collection"&&e._private.single},Vh=function(e){return gi(e)==="collection"&&!e._private.single},Vu=function(e){return gi(e)==="core"},Hh=function(e){return gi(e)==="stylesheet"},fS=function(e){return gi(e)==="event"},Jr=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},cS=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},hS=function(e){return Qe(e)&&we(e.x1)&&we(e.x2)&&we(e.y1)&&we(e.y2)},dS=function(e){return uS(e)&&vt(e.then)},vS=function(){return Lc&&Lc.userAgent.match(/msie|trident|edge/i)},ii=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var n=function a(){var i=this,o=arguments,s,l=r.apply(i,o),u=a.cache;return(s=u[l])||(s=u[l]=e.apply(i,o)),s};return n.cache={},n},Hu=ii(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Qo=ii(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),$h=ii(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Nc=function(e){return Jr(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},xt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",pS="rgb[a]?\\(("+xt+"[%]?)\\s*,\\s*("+xt+"[%]?)\\s*,\\s*("+xt+"[%]?)(?:\\s*,\\s*("+xt+"))?\\)",gS="rgb[a]?\\((?:"+xt+"[%]?)\\s*,\\s*(?:"+xt+"[%]?)\\s*,\\s*(?:"+xt+"[%]?)(?:\\s*,\\s*(?:"+xt+"))?\\)",yS="hsl[a]?\\(("+xt+")\\s*,\\s*("+xt+"[%])\\s*,\\s*("+xt+"[%])(?:\\s*,\\s*("+xt+"))?\\)",mS="hsl[a]?\\((?:"+xt+")\\s*,\\s*(?:"+xt+"[%])\\s*,\\s*(?:"+xt+"[%])(?:\\s*,\\s*(?:"+xt+"))?\\)",bS="\\#[0-9a-fA-F]{3}",ES="\\#[0-9a-fA-F]{6}",Yh=function(e,r){return e<r?-1:e>r?1:0},wS=function(e,r){return-1*Yh(e,r)},_e=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var o=a[i];t[o]=n[o]}}return t},xS=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,a,i,o=16;return r?(n=parseInt(e[1]+e[1],o),a=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),a=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[n,a,i]}},TS=function(e){var r,n,a,i,o,s,l,u;function f(v,p,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?v+(p-v)*6*m:m<1/2?p:m<2/3?v+(p-v)*(2/3-m)*6:v}var c=new RegExp("^"+yS+"$").exec(e);if(c){if(n=parseInt(c[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(c[2]),a<0||a>100||(a=a/100,i=parseFloat(c[3]),i<0||i>100)||(i=i/100,o=c[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)s=l=u=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,d=2*i-h;s=Math.round(255*f(d,h,n+1/3)),l=Math.round(255*f(d,h,n)),u=Math.round(255*f(d,h,n-1/3))}r=[s,l,u,o]}return r},CS=function(e){var r,n=new RegExp("^"+pS+"$").exec(e);if(n){r=[];for(var a=[],i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"&&(a[i]=!0),o=parseFloat(o),a[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=a[1]||a[2]||a[3],l=a[1]&&a[2]&&a[3];if(s&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},SS=function(e){return NS[e.toLowerCase()]},LS=function(e){return(ot(e)?e:null)||SS(e)||xS(e)||CS(e)||TS(e)},NS={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Wh=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(Qe(o))throw Error("Tried to set map with object key");i<n.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},Xh=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(Qe(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r};function OS(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ln=OS,Qa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function AS(t,e){return e={exports:{}},t(e,e.exports),e.exports}var IS=typeof Qa=="object"&&Qa&&Qa.Object===Object&&Qa,DS=IS,MS=typeof self=="object"&&self&&self.Object===Object&&self,RS=DS||MS||Function("return this")(),Jo=RS,PS=function(){return Jo.Date.now()},hu=PS,_S=/\s/;function FS(t){for(var e=t.length;e--&&_S.test(t.charAt(e)););return e}var BS=FS,kS=/^\s+/;function qS(t){return t&&t.slice(0,BS(t)+1).replace(kS,"")}var zS=qS,US=Jo.Symbol,ha=US,Kh=Object.prototype,GS=Kh.hasOwnProperty,VS=Kh.toString,Wa=ha?ha.toStringTag:void 0;function HS(t){var e=GS.call(t,Wa),r=t[Wa];try{t[Wa]=void 0;var n=!0}catch{}var a=VS.call(t);return n&&(e?t[Wa]=r:delete t[Wa]),a}var $S=HS,YS=Object.prototype,WS=YS.toString;function XS(t){return WS.call(t)}var KS=XS,jS="[object Null]",ZS="[object Undefined]",Oc=ha?ha.toStringTag:void 0;function QS(t){return t==null?t===void 0?ZS:jS:Oc&&Oc in Object(t)?$S(t):KS(t)}var jh=QS;function JS(t){return t!=null&&typeof t=="object"}var eL=JS,tL="[object Symbol]";function rL(t){return typeof t=="symbol"||eL(t)&&jh(t)==tL}var mi=rL,Ac=NaN,nL=/^[-+]0x[0-9a-f]+$/i,aL=/^0b[01]+$/i,iL=/^0o[0-7]+$/i,oL=parseInt;function sL(t){if(typeof t=="number")return t;if(mi(t))return Ac;if(Ln(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ln(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=zS(t);var r=aL.test(t);return r||iL.test(t)?oL(t.slice(2),r?2:8):nL.test(t)?Ac:+t}var Ic=sL,uL="Expected a function",lL=Math.max,fL=Math.min;function cL(t,e,r){var n,a,i,o,s,l,u=0,f=!1,c=!1,h=!0;if(typeof t!="function")throw new TypeError(uL);e=Ic(e)||0,Ln(r)&&(f=!!r.leading,c="maxWait"in r,i=c?lL(Ic(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function d(O){var L=n,A=a;return n=a=void 0,u=O,o=t.apply(A,L),o}function v(O){return u=O,s=setTimeout(g,e),f?d(O):o}function p(O){var L=O-l,A=O-u,I=e-L;return c?fL(I,i-A):I}function m(O){var L=O-l,A=O-u;return l===void 0||L>=e||L<0||c&&A>=i}function g(){var O=hu();if(m(O))return y(O);s=setTimeout(g,p(O))}function y(O){return s=void 0,h&&n?d(O):(n=a=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,n=l=a=s=void 0}function x(){return s===void 0?o:y(hu())}function C(){var O=hu(),L=m(O);if(n=arguments,a=this,l=O,L){if(s===void 0)return v(l);if(c)return clearTimeout(s),s=setTimeout(g,e),d(l)}return s===void 0&&(s=setTimeout(g,e)),o}return C.cancel=b,C.flush=x,C}var es=cL,du=wt?wt.performance:null,Zh=du&&du.now?function(){return du.now()}:function(){return Date.now()},hL=(function(){if(wt){if(wt.requestAnimationFrame)return function(t){wt.requestAnimationFrame(t)};if(wt.mozRequestAnimationFrame)return function(t){wt.mozRequestAnimationFrame(t)};if(wt.webkitRequestAnimationFrame)return function(t){wt.webkitRequestAnimationFrame(t)};if(wt.msRequestAnimationFrame)return function(t){wt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Zh())},1e3/60)}})(),Go=function(e){return hL(e)},Ir=Zh,ia=9261,Qh=65599,Ja=5381,Jh=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ia,n=r,a;a=e.next(),!a.done;)n=n*Qh+a.value|0;return n},oi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ia;return r*Qh+e|0},si=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ja;return(r<<5)+r+e|0},dL=function(e,r){return e*2097152+r},Wr=function(e){return e[0]*2097152+e[1]},Eo=function(e,r){return[oi(e[0],r[0]),si(e[1],r[1])]},vL=function(e,r){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return Jh(o,r)},Nn=function(e,r){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return Jh(o,r)},ed=function(){return pL(arguments)},pL=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=Nn(a):r=Nn(a,r)}return r},Dc=!0,gL=console.warn!=null,yL=console.trace!=null,$u=Number.MAX_SAFE_INTEGER||9007199254740991,td=function(){return!0},Vo=function(){return!1},Mc=function(){return 0},Yu=function(){},pt=function(e){throw new Error(e)},rd=function(e){if(e!==void 0)Dc=!!e;else return Dc},nt=function(e){rd()&&(gL?console.warn(e):(console.log(e),yL&&console.trace()))},mL=function(e){return _e({},e)},pr=function(e){return e==null?e:ot(e)?e.slice():Qe(e)?mL(e):e},bL=function(e){return e.slice()},nd=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},EL={},ad=function(){return EL},Dt=function(e){var r=Object.keys(e);return function(n){for(var a={},i=0;i<r.length;i++){var o=r[i],s=n?.[o];a[o]=s===void 0?e[o]:s}return a}},en=function(e,r,n){for(var a=e.length-1;a>=0&&!(e[a]===r&&(e.splice(a,1),n));a--);},Wu=function(e){e.splice(0,e.length)},wL=function(e,r){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}},ur=function(e,r,n){return n&&(r=$h(n,r)),e[r]},Kr=function(e,r,n,a){n&&(r=$h(n,r)),e[r]=a},xL=(function(){function t(){Uu(this,t),this._obj={}}return Gu(t,[{key:"set",value:function(r,n){return this._obj[r]=n,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}]),t})(),gr=typeof Map<"u"?Map:xL,TL="undefined",CL=(function(){function t(e){if(Uu(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return Gu(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)}},{key:"delete",value:function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})}},{key:"forEach",value:function(r,n){return this.toArray().forEach(r,n)}}]),t})(),ga=(typeof Set>"u"?"undefined":Tt(Set))!==TL?Set:CL,ts=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Vu(e)){pt("An element must have a core reference and parameters set");return}var a=r.group;if(a==null&&(r.data&&r.data.source!=null&&r.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){pt("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?a==="edges":!!r.pannable,active:!1,classes:new ga,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var o=r.renderedPosition,s=e.pan(),l=e.zoom();i.position={x:(o.x-s.x)/l,y:(o.y-s.y)/l}}var u=[];ot(r.classes)?u=r.classes:Re(r.classes)&&(u=r.classes.split(/\s+/));for(var f=0,c=u.length;f<c;f++){var h=u[f];!h||h===""||i.classes.add(h)}this.createEmitter();var d=r.style||r.css;d&&(nt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d)),(n===void 0||n)&&this.restore()},Rc=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;Qe(n)&&!Yt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!vt(a)?a:i,a=vt(a)?a:function(){};for(var s=this._private.cy,l=n=Re(n)?this.filter(n):n,u=[],f=[],c={},h={},d={},v=0,p,m=this.byGroup(),g=m.nodes,y=m.edges,b=0;b<l.length;b++){var x=l[b],C=x.id();x.isNode()&&(u.unshift(x),e.bfs&&(d[C]=!0,f.push(x)),h[C]=0)}for(var O=function(){var S=e.bfs?u.shift():u.pop(),w=S.id();if(e.dfs){if(d[w])return"continue";d[w]=!0,f.push(S)}var N=h[w],T=c[w],R=T!=null?T.source():null,P=T!=null?T.target():null,k=T==null?void 0:S.same(R)?P[0]:R[0],U=void 0;if(U=a(S,T,k,v++,N),U===!0)return p=S,"break";if(U===!1)return"break";for(var B=S.connectedEdges().filter(function(K){return(!i||K.source().same(S))&&y.has(K)}),V=0;V<B.length;V++){var j=B[V],Y=j.connectedNodes().filter(function(K){return!K.same(S)&&g.has(K)}),Z=Y.id();Y.length!==0&&!d[Z]&&(Y=Y[0],u.push(Y),e.bfs&&(d[Z]=!0,f.push(Y)),c[Z]=j,h[Z]=h[w]+1)}};u.length!==0;){var L=O();if(L!=="continue"&&L==="break")break}for(var A=s.collection(),I=0;I<f.length;I++){var D=f[I],M=c[D.id()];M!=null&&A.push(M),A.push(D)}return{path:s.collection(A),found:s.collection(p)}}},ui={breadthFirstSearch:Rc({bfs:!0}),depthFirstSearch:Rc({dfs:!0})};ui.bfs=ui.breadthFirstSearch;ui.dfs=ui.depthFirstSearch;var SL=AS(function(t,e){(function(){var r,n,a,i,o,s,l,u,f,c,h,d,v,p,m;a=Math.floor,c=Math.min,n=function(g,y){return g<y?-1:g>y?1:0},f=function(g,y,b,x,C){var O;if(b==null&&(b=0),C==null&&(C=n),b<0)throw new Error("lo must be non-negative");for(x==null&&(x=g.length);b<x;)O=a((b+x)/2),C(y,g[O])<0?x=O:b=O+1;return[].splice.apply(g,[b,b-b].concat(y)),y},s=function(g,y,b){return b==null&&(b=n),g.push(y),p(g,0,g.length-1,b)},o=function(g,y){var b,x;return y==null&&(y=n),b=g.pop(),g.length?(x=g[0],g[0]=b,m(g,0,y)):x=b,x},u=function(g,y,b){var x;return b==null&&(b=n),x=g[0],g[0]=y,m(g,0,b),x},l=function(g,y,b){var x;return b==null&&(b=n),g.length&&b(g[0],y)<0&&(x=[g[0],y],y=x[0],g[0]=x[1],m(g,0,b)),y},i=function(g,y){var b,x,C,O,L,A;for(y==null&&(y=n),O=(function(){A=[];for(var I=0,D=a(g.length/2);0<=D?I<D:I>D;0<=D?I++:I--)A.push(I);return A}).apply(this).reverse(),L=[],x=0,C=O.length;x<C;x++)b=O[x],L.push(m(g,b,y));return L},v=function(g,y,b){var x;if(b==null&&(b=n),x=g.indexOf(y),x!==-1)return p(g,0,x,b),m(g,x,b)},h=function(g,y,b){var x,C,O,L,A;if(b==null&&(b=n),C=g.slice(0,y),!C.length)return C;for(i(C,b),A=g.slice(y),O=0,L=A.length;O<L;O++)x=A[O],l(C,x,b);return C.sort(b).reverse()},d=function(g,y,b){var x,C,O,L,A,I,D,M,E;if(b==null&&(b=n),y*10<=g.length){if(O=g.slice(0,y).sort(b),!O.length)return O;for(C=O[O.length-1],D=g.slice(y),L=0,I=D.length;L<I;L++)x=D[L],b(x,C)<0&&(f(O,x,0,null,b),O.pop(),C=O[O.length-1]);return O}for(i(g,b),E=[],A=0,M=c(y,g.length);0<=M?A<M:A>M;0<=M?++A:--A)E.push(o(g,b));return E},p=function(g,y,b,x){var C,O,L;for(x==null&&(x=n),C=g[b];b>y;){if(L=b-1>>1,O=g[L],x(C,O)<0){g[b]=O,b=L;continue}break}return g[b]=C},m=function(g,y,b){var x,C,O,L,A;for(b==null&&(b=n),C=g.length,A=y,O=g[y],x=2*y+1;x<C;)L=x+1,L<C&&!(b(g[x],g[L])<0)&&(x=L),g[y]=g[x],y=x,x=2*y+1;return g[y]=O,p(g,A,y,b)},r=(function(){g.push=s,g.pop=o,g.replace=u,g.pushpop=l,g.heapify=i,g.updateItem=v,g.nlargest=h,g.nsmallest=d;function g(y){this.cmp=y??n,this.nodes=[]}return g.prototype.push=function(y){return s(this.nodes,y,this.cmp)},g.prototype.pop=function(){return o(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(y){return this.nodes.indexOf(y)!==-1},g.prototype.replace=function(y){return u(this.nodes,y,this.cmp)},g.prototype.pushpop=function(y){return l(this.nodes,y,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(y){return v(this.nodes,y,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var y;return y=new g,y.nodes=this.nodes.slice(0),y},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g})(),(function(g,y){return t.exports=y()})(this,function(){return r})}).call(Qa)}),bi=SL,LL=Dt({root:null,weight:function(e){return 1},directed:!1}),NL={dijkstra:function(e){if(!Qe(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=LL(e),a=n.root,i=n.weight,o=n.directed,s=this,l=i,u=Re(a)?this.filter(a)[0]:a[0],f={},c={},h={},d=this.byGroup(),v=d.nodes,p=d.edges;p.unmergeBy(function(N){return N.isLoop()});for(var m=function(T){return f[T.id()]},g=function(T,R){f[T.id()]=R,y.updateItem(T)},y=new bi(function(N,T){return m(N)-m(T)}),b=0;b<v.length;b++){var x=v[b];f[x.id()]=x.same(u)?0:1/0,y.push(x)}for(var C=function(T,R){for(var P=(o?T.edgesTo(R):T.edgesWith(R)).intersect(p),k=1/0,U,B=0;B<P.length;B++){var V=P[B],j=l(V);(j<k||!U)&&(k=j,U=V)}return{edge:U,dist:k}};y.size()>0;){var O=y.pop(),L=m(O),A=O.id();if(h[A]=L,L!==1/0)for(var I=O.neighborhood().intersect(v),D=0;D<I.length;D++){var M=I[D],E=M.id(),S=C(O,M),w=L+S.dist;w<m(M)&&(g(M,w),c[E]={node:O,edge:S.edge})}}return{distanceTo:function(T){var R=Re(T)?v.filter(T)[0]:T[0];return h[R.id()]},pathTo:function(T){var R=Re(T)?v.filter(T)[0]:T[0],P=[],k=R,U=k.id();if(R.length>0)for(P.unshift(R);c[U];){var B=c[U];P.unshift(B.edge),P.unshift(B.node),k=B.node,U=k.id()}return s.spawn(P)}}}},OL={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,i=n.length,o=new Array(i),s=n,l=function(x){for(var C=0;C<o.length;C++){var O=o[C];if(O.has(x))return C}},u=0;u<i;u++)o[u]=this.spawn(n[u]);for(var f=a.sort(function(b,x){return e(b)-e(x)}),c=0;c<f.length;c++){var h=f[c],d=h.source()[0],v=h.target()[0],p=l(d),m=l(v),g=o[p],y=o[m];p!==m&&(s.merge(h),g.merge(y),o.splice(m,1))}return s}},AL=Dt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),IL={aStar:function(e){var r=this.cy(),n=AL(e),a=n.root,i=n.goal,o=n.heuristic,s=n.directed,l=n.weight;a=r.collection(a)[0],i=r.collection(i)[0];var u=a.id(),f=i.id(),c={},h={},d={},v=new bi(function(U,B){return h[U.id()]-h[B.id()]}),p=new ga,m={},g={},y=function(B,V){v.push(B),p.add(V)},b,x,C=function(){b=v.pop(),x=b.id(),p.delete(x)},O=function(B){return p.has(B)};y(a,u),c[u]=0,h[u]=o(a);for(var L=0;v.size()>0;){if(C(),L++,x===f){for(var A=[],I=i,D=f,M=g[D];A.unshift(I),M!=null&&A.unshift(M),I=m[D],I!=null;)D=I.id(),M=g[D];return{found:!0,distance:c[x],path:this.spawn(A),steps:L}}d[x]=!0;for(var E=b._private.edges,S=0;S<E.length;S++){var w=E[S];if(this.hasElementWithId(w.id())&&!(s&&w.data("source")!==x)){var N=w.source(),T=w.target(),R=N.id()!==x?N:T,P=R.id();if(this.hasElementWithId(P)&&!d[P]){var k=c[x]+l(w);if(!O(P)){c[P]=k,h[P]=k+o(R),y(R,P),m[P]=b,g[P]=w;continue}k<c[P]&&(c[P]=k,h[P]=k+o(R),m[P]=b,g[P]=w)}}}}return{found:!1,distance:void 0,path:void 0,steps:L}}},DL=Dt({weight:function(e){return 1},directed:!1}),ML={floydWarshall:function(e){for(var r=this.cy(),n=DL(e),a=n.weight,i=n.directed,o=a,s=this.byGroup(),l=s.nodes,u=s.edges,f=l.length,c=f*f,h=function(j){return l.indexOf(j)},d=function(j){return l[j]},v=new Array(c),p=0;p<c;p++){var m=p%f,g=(p-m)/f;g===m?v[p]=0:v[p]=1/0}for(var y=new Array(c),b=new Array(c),x=0;x<u.length;x++){var C=u[x],O=C.source()[0],L=C.target()[0];if(O!==L){var A=h(O),I=h(L),D=A*f+I,M=o(C);if(v[D]>M&&(v[D]=M,y[D]=I,b[D]=C),!i){var E=I*f+A;!i&&v[E]>M&&(v[E]=M,y[E]=A,b[E]=C)}}}for(var S=0;S<f;S++)for(var w=0;w<f;w++)for(var N=w*f+S,T=0;T<f;T++){var R=w*f+T,P=S*f+T;v[N]+v[P]<v[R]&&(v[R]=v[N]+v[P],y[R]=y[N])}var k=function(j){return(Re(j)?r.filter(j):j)[0]},U=function(j){return h(k(j))},B={distance:function(j,Y){var Z=U(j),K=U(Y);return v[Z*f+K]},path:function(j,Y){var Z=U(j),K=U(Y),G=d(Z);if(Z===K)return G.collection();if(y[Z*f+K]==null)return r.collection();var $=r.collection(),q=Z,X;for($.merge(G);Z!==K;)q=Z,Z=y[Z*f+K],X=b[q*f+Z],$.merge(X),$.merge(d(Z));return $}};return B}},RL=Dt({weight:function(e){return 1},directed:!1,root:null}),PL={bellmanFord:function(e){var r=this,n=RL(e),a=n.weight,i=n.directed,o=n.root,s=a,l=this,u=this.cy(),f=this.byGroup(),c=f.edges,h=f.nodes,d=h.length,v=new gr,p=!1,m=[];o=u.collection(o)[0],c.unmergeBy(function(J){return J.isLoop()});for(var g=c.length,y=function(ie){var ve=v.get(ie.id());return ve||(ve={},v.set(ie.id(),ve)),ve},b=function(ie){return(Re(ie)?u.$(ie):ie)[0]},x=function(ie){return y(b(ie)).dist},C=function(ie){for(var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,Se=b(ie),Ce=[],xe=Se;;){if(xe==null)return r.spawn();var De=y(xe),Le=De.edge,Pe=De.pred;if(Ce.unshift(xe[0]),xe.same(ve)&&Ce.length>0)break;Le!=null&&Ce.unshift(Le),xe=Pe}return l.spawn(Ce)},O=0;O<d;O++){var L=h[O],A=y(L);L.same(o)?A.dist=0:A.dist=1/0,A.pred=null,A.edge=null}for(var I=!1,D=function(ie,ve,Se,Ce,xe,De){var Le=Ce.dist+De;Le<xe.dist&&!Se.same(Ce.edge)&&(xe.dist=Le,xe.pred=ie,xe.edge=Se,I=!0)},M=1;M<d;M++){I=!1;for(var E=0;E<g;E++){var S=c[E],w=S.source(),N=S.target(),T=s(S),R=y(w),P=y(N);D(w,N,S,R,P,T),i||D(N,w,S,P,R,T)}if(!I)break}if(I)for(var k=[],U=0;U<g;U++){var B=c[U],V=B.source(),j=B.target(),Y=s(B),Z=y(V).dist,K=y(j).dist;if(Z+Y<K||!i&&K+Y<Z)if(p||(nt("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles!==!1){var G=[];Z+Y<K&&G.push(V),!i&&K+Y<Z&&G.push(j);for(var $=G.length,q=0;q<$;q++){var X=G[q],ee=[X];ee.push(y(X).edge);for(var ce=y(X).pred;ee.indexOf(ce)===-1;)ee.push(ce),ee.push(y(ce).edge),ce=y(ce).pred;ee=ee.slice(ee.indexOf(ce));for(var Ee=ee[0].id(),ne=0,Q=2;Q<ee.length;Q+=2)ee[Q].id()<Ee&&(Ee=ee[Q].id(),ne=Q);ee=ee.slice(ne).concat(ee.slice(0,ne)),ee.push(ee[0]);var se=ee.map(function(J){return J.id()}).join(",");k.indexOf(se)===-1&&(m.push(l.spawn(ee)),k.push(se))}}else break}return{distanceTo:x,pathTo:C,hasNegativeWeightCycle:p,negativeWeightCycles:m}}},_L=Math.sqrt(2),FL=function(e,r,n){n.length===0&&pt("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],o=a[2],s=r[i],l=r[o],u=n,f=u.length-1;f>=0;f--){var c=u[f],h=c[1],d=c[2];(r[h]===s&&r[d]===l||r[h]===l&&r[d]===s)&&u.splice(f,1)}for(var v=0;v<u.length;v++){var p=u[v];p[1]===l?(u[v]=p.slice(),u[v][1]=s):p[2]===l&&(u[v]=p.slice(),u[v][2]=s)}for(var m=0;m<r.length;m++)r[m]===l&&(r[m]=s);return u},vu=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=FL(i,e,r),n--}return r},BL={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(P){return P.isLoop()});var i=n.length,o=a.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/_L);if(i<2){pt("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],f=0;f<o;f++){var c=a[f];u.push([f,n.indexOf(c.source()),n.indexOf(c.target())])}for(var h=1/0,d=[],v=new Array(i),p=new Array(i),m=new Array(i),g=function(k,U){for(var B=0;B<i;B++)U[B]=k[B]},y=0;y<=s;y++){for(var b=0;b<i;b++)p[b]=b;var x=vu(p,u.slice(),i,l),C=x.slice();g(p,m);var O=vu(p,x,l,2),L=vu(m,C,l,2);O.length<=L.length&&O.length<h?(h=O.length,d=O,g(p,v)):L.length<=O.length&&L.length<h&&(h=L.length,d=L,g(m,v))}for(var A=this.spawn(d.map(function(P){return a[P[0]]})),I=this.spawn(),D=this.spawn(),M=v[0],E=0;E<v.length;E++){var S=v[E],w=n[E];S===M?I.merge(w):D.merge(w)}var N=function(k){var U=e.spawn();return k.forEach(function(B){U.merge(B),B.connectedEdges().forEach(function(V){e.contains(V)&&!A.contains(V)&&U.merge(V)})}),U},T=[N(I),N(D)],R={cut:A,components:T,partition1:I,partition2:D};return R}},kL=function(e){return{x:e.x,y:e.y}},rs=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},id=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},oa=function(e){return{x:e[0],y:e[1]}},qL=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=r;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.min(o,a))}return a},zL=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=r;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.max(o,a))}return a},UL=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,o=r;o<n;o++){var s=e[o];isFinite(s)&&(a+=s,i++)}return a/i},GL=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var s=0,l=e.length-1;l>=0;l--){var u=e[l];o?isFinite(u)||(e[l]=-1/0,s++):e.splice(l,1)}i&&e.sort(function(h,d){return h-d});var f=e.length,c=Math.floor(f/2);return f%2!==0?e[c+1+s]:(e[c-1+s]+e[c+s])/2},VL=function(e){return Math.PI*e/180},wo=function(e,r){return Math.atan2(r,e)-Math.PI/2},Xu=Math.log2||function(t){return Math.log(t)/Math.log(2)},od=function(e){return e>0?1:e<0?-1:0},On=function(e,r){return Math.sqrt(wn(e,r))},wn=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},HL=function(e){for(var r=e.length,n=0,a=0;a<r;a++)n+=e[a];for(var i=0;i<r;i++)e[i]=e[i]/n;return e},Lt=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},ua=function(e,r,n,a){return{x:Lt(e.x,r.x,n.x,a),y:Lt(e.y,r.y,n.y,a)}},$L=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},o=On(e,r),s={x:i.x/o,y:i.y/o};return n=n??0,a=a??n*o,{x:e.x+s.x*a,y:e.y+s.y*a}},li=function(e,r,n){return Math.max(e,Math.min(n,r))},Ht=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},YL=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},WL=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},XL=function(e,r,n){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+n,y2:e.y2+n,w:e.w,h:e.h}},sd=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},KL=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Mo=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ro=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,o;if(r.length===1)n=a=i=o=r[0];else if(r.length===2)n=i=r[0],o=a=r[1];else if(r.length===4){var s=or(r,4);n=s[0],a=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Pc=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Ku=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},da=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},jL=function(e,r){return da(e,r.x,r.y)},ud=function(e,r){return da(e,r.x1,r.y1)&&da(e,r.x2,r.y2)},ld=function(e,r,n,a,i,o,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?An(i,o):l,f=i/2,c=o/2;u=Math.min(u,f,c);var h=u!==f,d=u!==c,v;if(h){var p=n-f+u-s,m=a-c-s,g=n+f-u+s,y=m;if(v=jr(e,r,n,a,p,m,g,y,!1),v.length>0)return v}if(d){var b=n+f+s,x=a-c+u-s,C=b,O=a+c-u+s;if(v=jr(e,r,n,a,b,x,C,O,!1),v.length>0)return v}if(h){var L=n-f+u-s,A=a+c+s,I=n+f-u+s,D=A;if(v=jr(e,r,n,a,L,A,I,D,!1),v.length>0)return v}if(d){var M=n-f-s,E=a-c+u-s,S=M,w=a+c-u+s;if(v=jr(e,r,n,a,M,E,S,w,!1),v.length>0)return v}var N;{var T=n-f+u,R=a-c+u;if(N=ei(e,r,n,a,T,R,u+s),N.length>0&&N[0]<=T&&N[1]<=R)return[N[0],N[1]]}{var P=n+f-u,k=a-c+u;if(N=ei(e,r,n,a,P,k,u+s),N.length>0&&N[0]>=P&&N[1]<=k)return[N[0],N[1]]}{var U=n+f-u,B=a+c-u;if(N=ei(e,r,n,a,U,B,u+s),N.length>0&&N[0]>=U&&N[1]>=B)return[N[0],N[1]]}{var V=n-f+u,j=a+c-u;if(N=ei(e,r,n,a,V,j,u+s),N.length>0&&N[0]<=V&&N[1]>=j)return[N[0],N[1]]}return[]},ZL=function(e,r,n,a,i,o,s){var l=s,u=Math.min(n,i),f=Math.max(n,i),c=Math.min(a,o),h=Math.max(a,o);return u-l<=e&&e<=f+l&&c-l<=r&&r<=h+l},QL=function(e,r,n,a,i,o,s,l,u){var f={x1:Math.min(n,s,i)-u,x2:Math.max(n,s,i)+u,y1:Math.min(a,l,o)-u,y2:Math.max(a,l,o)+u};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},JL=function(e,r,n,a){n-=a;var i=r*r-4*e*n;if(i<0)return[];var o=Math.sqrt(i),s=2*e,l=(-r+o)/s,u=(-r-o)/s;return[l,u]},eN=function(e,r,n,a,i){var o=1e-5;e===0&&(e=o),r/=e,n/=e,a/=e;var s,l,u,f,c,h,d,v;if(l=(3*n-r*r)/9,u=-(27*a)+r*(9*n-2*(r*r)),u/=54,s=l*l*l+u*u,i[1]=0,d=r/3,s>0){c=u+Math.sqrt(s),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),h=u-Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-d+c+h,d+=(c+h)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-h+c)/2,i[3]=d,i[5]=-d;return}if(i[5]=i[3]=0,s===0){v=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-d+2*v,i[4]=i[2]=-(v+d);return}l=-l,f=l*l*l,f=Math.acos(u/Math.sqrt(f)),v=2*Math.sqrt(l),i[0]=-d+v*Math.cos(f/3),i[2]=-d+v*Math.cos((f+2*Math.PI)/3),i[4]=-d+v*Math.cos((f+4*Math.PI)/3)},tN=function(e,r,n,a,i,o,s,l){var u=1*n*n-4*n*i+2*n*s+4*i*i-4*i*s+s*s+a*a-4*a*o+2*a*l+4*o*o-4*o*l+l*l,f=9*n*i-3*n*n-3*n*s-6*i*i+3*i*s+9*a*o-3*a*a-3*a*l-6*o*o+3*o*l,c=3*n*n-6*n*i+n*s-n*e+2*i*i+2*i*e-s*e+3*a*a-6*a*o+a*l-a*r+2*o*o+2*o*r-l*r,h=1*n*i-n*n+n*e-i*e+a*o-a*a+a*r-o*r,d=[];eN(u,f,c,h,d);for(var v=1e-7,p=[],m=0;m<6;m+=2)Math.abs(d[m+1])<v&&d[m]>=0&&d[m]<=1&&p.push(d[m]);p.push(1),p.push(0);for(var g=-1,y,b,x,C=0;C<p.length;C++)y=Math.pow(1-p[C],2)*n+2*(1-p[C])*p[C]*i+p[C]*p[C]*s,b=Math.pow(1-p[C],2)*a+2*(1-p[C])*p[C]*o+p[C]*p[C]*l,x=Math.pow(y-e,2)+Math.pow(b-r,2),g>=0?x<g&&(g=x):g=x;return g},rN=function(e,r,n,a,i,o){var s=[e-n,r-a],l=[i-n,o-a],u=l[0]*l[0]+l[1]*l[1],f=s[0]*s[0]+s[1]*s[1],c=s[0]*l[0]+s[1]*l[1],h=c*c/u;return c<0?f:h>u?(e-i)*(e-i)+(r-o)*(r-o):f-h},Vt=function(e,r,n){for(var a,i,o,s,l,u=0,f=0;f<n.length/2;f++)if(a=n[f*2],i=n[f*2+1],f+1<n.length/2?(o=n[(f+1)*2],s=n[(f+1)*2+1]):(o=n[(f+1-n.length/2)*2],s=n[(f+1-n.length/2)*2+1]),!(a==e&&o==e))if(a>=e&&e>=o||a<=e&&e<=o)l=(e-a)/(o-a)*(s-i)+i,l>r&&u++;else continue;return u%2!==0},Dr=function(e,r,n,a,i,o,s,l,u){var f=new Array(n.length),c;l[0]!=null?(c=Math.atan(l[1]/l[0]),l[0]<0?c=c+Math.PI/2:c=-c-Math.PI/2):c=l;for(var h=Math.cos(-c),d=Math.sin(-c),v=0;v<f.length/2;v++)f[v*2]=o/2*(n[v*2]*h-n[v*2+1]*d),f[v*2+1]=s/2*(n[v*2+1]*h+n[v*2]*d),f[v*2]+=a,f[v*2+1]+=i;var p;if(u>0){var m=$o(f,-u);p=Ho(m)}else p=f;return Vt(e,r,p)},nN=function(e,r,n,a,i,o,s,l){for(var u=new Array(n.length*2),f=0;f<l.length;f++){var c=l[f];u[f*4+0]=c.startX,u[f*4+1]=c.startY,u[f*4+2]=c.stopX,u[f*4+3]=c.stopY;var h=Math.pow(c.cx-e,2)+Math.pow(c.cy-r,2);if(h<=Math.pow(c.radius,2))return!0}return Vt(e,r,u)},Ho=function(e){for(var r=new Array(e.length/2),n,a,i,o,s,l,u,f,c=0;c<e.length/4;c++){n=e[c*4],a=e[c*4+1],i=e[c*4+2],o=e[c*4+3],c<e.length/4-1?(s=e[(c+1)*4],l=e[(c+1)*4+1],u=e[(c+1)*4+2],f=e[(c+1)*4+3]):(s=e[0],l=e[1],u=e[2],f=e[3]);var h=jr(n,a,i,o,s,l,u,f,!0);r[c*2]=h[0],r[c*2+1]=h[1]}return r},$o=function(e,r){for(var n=new Array(e.length*2),a,i,o,s,l=0;l<e.length/2;l++){a=e[l*2],i=e[l*2+1],l<e.length/2-1?(o=e[(l+1)*2],s=e[(l+1)*2+1]):(o=e[0],s=e[1]);var u=s-i,f=-(o-a),c=Math.sqrt(u*u+f*f),h=u/c,d=f/c;n[l*4]=a+h*r,n[l*4+1]=i+d*r,n[l*4+2]=o+h*r,n[l*4+3]=s+d*r}return n},aN=function(e,r,n,a,i,o){var s=n-e,l=a-r;s/=i,l/=o;var u=Math.sqrt(s*s+l*l),f=u-1;if(f<0)return[];var c=f/u;return[(n-e)*c+e,(a-r)*c+r]},Sn=function(e,r,n,a,i,o,s){return e-=i,r-=o,e/=n/2+s,r/=a/2+s,e*e+r*r<=1},ei=function(e,r,n,a,i,o,s){var l=[n-e,a-r],u=[e-i,r-o],f=l[0]*l[0]+l[1]*l[1],c=2*(u[0]*l[0]+u[1]*l[1]),h=u[0]*u[0]+u[1]*u[1]-s*s,d=c*c-4*f*h;if(d<0)return[];var v=(-c+Math.sqrt(d))/(2*f),p=(-c-Math.sqrt(d))/(2*f),m=Math.min(v,p),g=Math.max(v,p),y=[];if(m>=0&&m<=1&&y.push(m),g>=0&&g<=1&&y.push(g),y.length===0)return[];var b=y[0]*l[0]+e,x=y[0]*l[1]+r;if(y.length>1){if(y[0]==y[1])return[b,x];var C=y[1]*l[0]+e,O=y[1]*l[1]+r;return[b,x,C,O]}else return[b,x]},pu=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},jr=function(e,r,n,a,i,o,s,l,u){var f=e-i,c=n-e,h=s-i,d=r-o,v=a-r,p=l-o,m=h*d-p*f,g=c*d-v*f,y=p*c-h*v;if(y!==0){var b=m/y,x=g/y,C=.001,O=0-C,L=1+C;return O<=b&&b<=L&&O<=x&&x<=L?[e+b*c,r+b*v]:u?[e+b*c,r+b*v]:[]}else return m===0||g===0?pu(e,n,s)===s?[s,l]:pu(e,n,i)===i?[i,o]:pu(i,s,n)===n?[n,a]:[]:[]},fi=function(e,r,n,a,i,o,s,l){var u=[],f,c=new Array(n.length),h=!0;o==null&&(h=!1);var d;if(h){for(var v=0;v<c.length/2;v++)c[v*2]=n[v*2]*o+a,c[v*2+1]=n[v*2+1]*s+i;if(l>0){var p=$o(c,-l);d=Ho(p)}else d=c}else d=n;for(var m,g,y,b,x=0;x<d.length/2;x++)m=d[x*2],g=d[x*2+1],x<d.length/2-1?(y=d[(x+1)*2],b=d[(x+1)*2+1]):(y=d[0],b=d[1]),f=jr(e,r,a,i,m,g,y,b),f.length!==0&&u.push(f[0],f[1]);return u},iN=function(e,r,n,a,i,o,s,l,u){var f=[],c,h=new Array(n.length*2);u.forEach(function(y,b){b===0?(h[h.length-2]=y.startX,h[h.length-1]=y.startY):(h[b*4-2]=y.startX,h[b*4-1]=y.startY),h[b*4]=y.stopX,h[b*4+1]=y.stopY,c=ei(e,r,a,i,y.cx,y.cy,y.radius),c.length!==0&&f.push(c[0],c[1])});for(var d=0;d<h.length/4;d++)c=jr(e,r,a,i,h[d*4],h[d*4+1],h[d*4+2],h[d*4+3],!1),c.length!==0&&f.push(c[0],c[1]);if(f.length>2){for(var v=[f[0],f[1]],p=Math.pow(v[0]-e,2)+Math.pow(v[1]-r,2),m=1;m<f.length/2;m++){var g=Math.pow(f[m*2]-e,2)+Math.pow(f[m*2+1]-r,2);g<=p&&(v[0]=f[m*2],v[1]=f[m*2+1],p=g)}return v}return f},xo=function(e,r,n){var a=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=(i-n)/i;return o<0&&(o=1e-5),[r[0]+o*a[0],r[1]+o*a[1]]},Ut=function(e,r){var n=Su(e,r);return n=fd(n),n},fd=function(e){for(var r,n,a=e.length/2,i=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u<a;u++)r=e[2*u],n=e[2*u+1],i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,n),l=Math.max(l,n);for(var f=2/(s-i),c=2/(l-o),h=0;h<a;h++)r=e[2*h]=e[2*h]*f,n=e[2*h+1]=e[2*h+1]*c,i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,n),l=Math.max(l,n);if(o<-1)for(var d=0;d<a;d++)n=e[2*d+1]=e[2*d+1]+(-1-o);return e},Su=function(e,r){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=r;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*n+a,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},An=function(e,r){return Math.min(e/4,r/4,8)},cd=function(e,r){return Math.min(e/10,r/10,8)},ju=function(){return 8},oN=function(e,r,n){return[e-2*r+n,2*(r-e),e]},Lu=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},sN=Dt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),uN={pageRank:function(e){for(var r=sN(e),n=r.dampingFactor,a=r.precision,i=r.iterations,o=r.weight,s=this._private.cy,l=this.byGroup(),u=l.nodes,f=l.edges,c=u.length,h=c*c,d=f.length,v=new Array(h),p=new Array(c),m=(1-n)/c,g=0;g<c;g++){for(var y=0;y<c;y++){var b=g*c+y;v[b]=0}p[g]=0}for(var x=0;x<d;x++){var C=f[x],O=C.data("source"),L=C.data("target");if(O!==L){var A=u.indexOfId(O),I=u.indexOfId(L),D=o(C),M=I*c+A;v[M]+=D,p[A]+=D}}for(var E=1/c+m,S=0;S<c;S++)if(p[S]===0)for(var w=0;w<c;w++){var N=w*c+S;v[N]=E}else for(var T=0;T<c;T++){var R=T*c+S;v[R]=v[R]/p[S]+m}for(var P=new Array(c),k=new Array(c),U,B=0;B<c;B++)P[B]=1;for(var V=0;V<i;V++){for(var j=0;j<c;j++)k[j]=0;for(var Y=0;Y<c;Y++)for(var Z=0;Z<c;Z++){var K=Y*c+Z;k[Y]+=v[K]*P[Z]}HL(k),U=P,P=k,k=U;for(var G=0,$=0;$<c;$++){var q=U[$]-P[$];G+=q*q}if(G<a)break}var X={rank:function(ce){return ce=s.collection(ce)[0],P[u.indexOf(ce)]}};return X}},_c=Dt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),la={degreeCentralityNormalized:function(e){e=_c(e);var r=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var f={},c={},h=0,d=0,v=0;v<a;v++){var p=n[v],m=p.id();e.root=p;var g=this.degreeCentrality(e);h<g.indegree&&(h=g.indegree),d<g.outdegree&&(d=g.outdegree),f[m]=g.indegree,c[m]=g.outdegree}return{indegree:function(b){return h==0?0:(Re(b)&&(b=r.filter(b)),f[b.id()]/h)},outdegree:function(b){return d===0?0:(Re(b)&&(b=r.filter(b)),c[b.id()]/d)}}}else{for(var i={},o=0,s=0;s<a;s++){var l=n[s];e.root=l;var u=this.degreeCentrality(e);o<u.degree&&(o=u.degree),i[l.id()]=u.degree}return{degree:function(b){return o===0?0:(Re(b)&&(b=r.filter(b)),i[b.id()]/o)}}}},degreeCentrality:function(e){e=_c(e);var r=this.cy(),n=this,a=e,i=a.root,o=a.weight,s=a.directed,l=a.alpha;if(i=r.collection(i)[0],s){for(var d=i.connectedEdges(),v=d.filter(function(O){return O.target().same(i)&&n.has(O)}),p=d.filter(function(O){return O.source().same(i)&&n.has(O)}),m=v.length,g=p.length,y=0,b=0,x=0;x<v.length;x++)y+=o(v[x]);for(var C=0;C<p.length;C++)b+=o(p[C]);return{indegree:Math.pow(m,1-l)*Math.pow(y,l),outdegree:Math.pow(g,1-l)*Math.pow(b,l)}}else{for(var u=i.connectedEdges().intersection(n),f=u.length,c=0,h=0;h<u.length;h++)c+=o(u[h]);return{degree:Math.pow(f,1-l)*Math.pow(c,l)}}}};la.dc=la.degreeCentrality;la.dcn=la.degreeCentralityNormalised=la.degreeCentralityNormalized;var Fc=Dt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),fa={closenessCentralityNormalized:function(e){for(var r=Fc(e),n=r.harmonic,a=r.weight,i=r.directed,o=this.cy(),s={},l=0,u=this.nodes(),f=this.floydWarshall({weight:a,directed:i}),c=0;c<u.length;c++){for(var h=0,d=u[c],v=0;v<u.length;v++)if(c!==v){var p=f.distance(d,u[v]);n?h+=1/p:h+=p}n||(h=1/h),l<h&&(l=h),s[d.id()]=h}return{closeness:function(g){return l==0?0:(Re(g)?g=o.filter(g)[0].id():g=g.id(),s[g]/l)}}},closenessCentrality:function(e){var r=Fc(e),n=r.root,a=r.weight,i=r.directed,o=r.harmonic;n=this.filter(n)[0];for(var s=this.dijkstra({root:n,weight:a,directed:i}),l=0,u=this.nodes(),f=0;f<u.length;f++){var c=u[f];if(!c.same(n)){var h=s.distanceTo(c);o?l+=1/h:l+=h}}return o?l:1/l}};fa.cc=fa.closenessCentrality;fa.ccn=fa.closenessCentralityNormalised=fa.closenessCentralityNormalized;var lN=Dt({weight:null,directed:!1}),Nu={betweennessCentrality:function(e){for(var r=lN(e),n=r.directed,a=r.weight,i=a!=null,o=this.cy(),s=this.nodes(),l={},u={},f=0,c={set:function(b,x){u[b]=x,x>f&&(f=x)},get:function(b){return u[b]}},h=0;h<s.length;h++){var d=s[h],v=d.id();n?l[v]=d.outgoers().nodes():l[v]=d.openNeighborhood().nodes(),c.set(v,0)}for(var p=function(b){for(var x=s[b].id(),C=[],O={},L={},A={},I=new bi(function(Z,K){return A[Z]-A[K]}),D=0;D<s.length;D++){var M=s[D].id();O[M]=[],L[M]=0,A[M]=1/0}for(L[x]=1,A[x]=0,I.push(x);!I.empty();){var E=I.pop();if(C.push(E),i)for(var S=0;S<l[E].length;S++){var w=l[E][S],N=o.getElementById(E),T=void 0;N.edgesTo(w).length>0?T=N.edgesTo(w)[0]:T=w.edgesTo(N)[0];var R=a(T);w=w.id(),A[w]>A[E]+R&&(A[w]=A[E]+R,I.nodes.indexOf(w)<0?I.push(w):I.updateItem(w),L[w]=0,O[w]=[]),A[w]==A[E]+R&&(L[w]=L[w]+L[E],O[w].push(E))}else for(var P=0;P<l[E].length;P++){var k=l[E][P].id();A[k]==1/0&&(I.push(k),A[k]=A[E]+1),A[k]==A[E]+1&&(L[k]=L[k]+L[E],O[k].push(E))}}for(var U={},B=0;B<s.length;B++)U[s[B].id()]=0;for(;C.length>0;){for(var V=C.pop(),j=0;j<O[V].length;j++){var Y=O[V][j];U[Y]=U[Y]+L[Y]/L[V]*(1+U[V])}V!=s[b].id()&&c.set(V,c.get(V)+U[V])}},m=0;m<s.length;m++)p(m);var g={betweenness:function(b){var x=o.collection(b).id();return c.get(x)},betweennessNormalized:function(b){if(f==0)return 0;var x=o.collection(b).id();return c.get(x)/f}};return g.betweennessNormalised=g.betweennessNormalized,g}};Nu.bc=Nu.betweennessCentrality;var fN=Dt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),cN=function(e){return fN(e)},hN=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},dN=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},hd=function(e,r){for(var n,a=0;a<r;a++){n=0;for(var i=0;i<r;i++)n+=e[i*r+a];for(var o=0;o<r;o++)e[o*r+a]=e[o*r+a]/n}},vN=function(e,r,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)a[i*n+o]=0;for(var s=0;s<n;s++)for(var l=0;l<n;l++)a[i*n+l]+=e[i*n+s]*r[s*n+l]}return a},pN=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=vN(e,a,r);return e},gN=function(e,r,n){for(var a=new Array(r*r),i=0;i<r*r;i++)a[i]=Math.pow(e[i],n);return hd(a,r),a},yN=function(e,r,n,a){for(var i=0;i<n;i++){var o=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),s=Math.round(r[i]*Math.pow(10,a))/Math.pow(10,a);if(o!==s)return!1}return!0},mN=function(e,r,n,a){for(var i=[],o=0;o<r;o++){for(var s=[],l=0;l<r;l++)Math.round(e[o*r+l]*1e3)/1e3>0&&s.push(n[l]);s.length!==0&&i.push(a.collection(s))}return i},bN=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},EN=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&bN(e[r],e[n])&&e.splice(n,1);return e},Bc=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=cN(e),o={},s=0;s<r.length;s++)o[r[s].id()]=s;for(var l=r.length,u=l*l,f=new Array(u),c,h=0;h<u;h++)f[h]=0;for(var d=0;d<n.length;d++){var v=n[d],p=o[v.source().id()],m=o[v.target().id()],g=hN(v,i.attributes);f[p*l+m]+=g,f[m*l+p]+=g}dN(f,l,i.multFactor),hd(f,l);for(var y=!0,b=0;y&&b<i.maxIterations;)y=!1,c=pN(f,l,i.expandFactor),f=gN(c,l,i.inflateFactor),yN(f,c,u,4)||(y=!0),b++;var x=mN(f,l,r,a);return x=EN(x),x},wN={markovClustering:Bc,mcl:Bc},xN=function(e){return e},dd=function(e,r){return Math.abs(r-e)},kc=function(e,r,n){return e+dd(r,n)},qc=function(e,r,n){return e+Math.pow(n-r,2)},TN=function(e){return Math.sqrt(e)},CN=function(e,r,n){return Math.max(e,dd(r,n))},Xa=function(e,r,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:xN,s=a,l,u,f=0;f<e;f++)l=r(f),u=n(f),s=i(s,l,u);return o(s)},va={euclidean:function(e,r,n){return e>=2?Xa(e,r,n,0,qc,TN):Xa(e,r,n,0,kc)},squaredEuclidean:function(e,r,n){return Xa(e,r,n,0,qc)},manhattan:function(e,r,n){return Xa(e,r,n,0,kc)},max:function(e,r,n){return Xa(e,r,n,-1/0,CN)}};va["squared-euclidean"]=va.squaredEuclidean;va.squaredeuclidean=va.squaredEuclidean;function ns(t,e,r,n,a,i){var o;return vt(t)?o=t:o=va[t]||va.euclidean,e===0&&vt(t)?o(a,i):o(e,r,n,a,i)}var SN=Dt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Zu=function(e){return SN(e)},Yo=function(e,r,n,a,i){var o=i!=="kMedoids",s=o?function(c){return n[c]}:function(c){return a[c](n)},l=function(h){return a[h](r)},u=n,f=r;return ns(e,a.length,s,l,u,f)},gu=function(e,r,n){for(var a=n.length,i=new Array(a),o=new Array(a),s=new Array(r),l=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,o[u]=e.max(n[u]).value;for(var f=0;f<r;f++){l=[];for(var c=0;c<a;c++)l[c]=Math.random()*(o[c]-i[c])+i[c];s[f]=l}return s},vd=function(e,r,n,a,i){for(var o=1/0,s=0,l=0;l<r.length;l++){var u=Yo(n,e,r[l],a,i);u<o&&(o=u,s=l)}return s},pd=function(e,r,n){for(var a=[],i=null,o=0;o<r.length;o++)i=r[o],n[i.id()]===e&&a.push(i);return a},LN=function(e,r,n){return Math.abs(r-e)<=n},NN=function(e,r,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var o=Math.abs(e[a][i]-r[a][i]);if(o>n)return!1}return!0},ON=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},zc=function(e,r){var n=new Array(r);if(e.length<50)for(var a=0;a<r;a++){for(var i=e[Math.floor(Math.random()*e.length)];ON(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var o=0;o<r;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},Uc=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=Yo("manhattan",r[i],e,n,"kMedoids");return a},AN=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Zu(e),o=new Array(i.k),s={},l;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,l=gu(n,i.k,i.attributes)):Tt(i.testCentroids)==="object"?l=i.testCentroids:l=gu(n,i.k,i.attributes):l=gu(n,i.k,i.attributes);for(var u=!0,f=0;u&&f<i.maxIterations;){for(var c=0;c<n.length;c++)a=n[c],s[a.id()]=vd(a,l,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var d=pd(h,n,s);if(d.length!==0){for(var v=i.attributes.length,p=l[h],m=new Array(v),g=new Array(v),y=0;y<v;y++){g[y]=0;for(var b=0;b<d.length;b++)a=d[b],g[y]+=i.attributes[y](a);m[y]=g[y]/d.length,LN(m[y],p[y],i.sensitivityThreshold)||(u=!0)}l[h]=m,o[h]=r.collection(d)}}f++}return o},IN=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Zu(e),o=new Array(i.k),s,l={},u,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(Tt(i.testCentroids)==="object"?s=i.testCentroids:s=zc(n,i.k)):s=zc(n,i.k);for(var c=!0,h=0;c&&h<i.maxIterations;){for(var d=0;d<n.length;d++)a=n[d],l[a.id()]=vd(a,s,i.distance,i.attributes,"kMedoids");c=!1;for(var v=0;v<s.length;v++){var p=pd(v,n,l);if(p.length!==0){f[v]=Uc(s[v],p,i.attributes);for(var m=0;m<p.length;m++)u=Uc(p[m],p,i.attributes),u<f[v]&&(f[v]=u,s[v]=p[m],c=!0);o[v]=r.collection(p)}}h++}return o},DN=function(e,r,n,a,i){for(var o,s,l=0;l<r.length;l++)for(var u=0;u<e.length;u++)a[l][u]=Math.pow(n[l][u],i.m);for(var f=0;f<e.length;f++)for(var c=0;c<i.attributes.length;c++){o=0,s=0;for(var h=0;h<r.length;h++)o+=a[h][f]*i.attributes[c](r[h]),s+=a[h][f];e[f][c]=o/s}},MN=function(e,r,n,a,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var s,l,u,f=2/(i.m-1),c=0;c<n.length;c++)for(var h=0;h<a.length;h++){s=0;for(var d=0;d<n.length;d++)l=Yo(i.distance,a[h],n[c],i.attributes,"cmeans"),u=Yo(i.distance,a[h],n[d],i.attributes,"cmeans"),s+=Math.pow(l/u,f);e[h][c]=1/s}},RN=function(e,r,n,a){for(var i=new Array(n.k),o=0;o<i.length;o++)i[o]=[];for(var s,l,u=0;u<r.length;u++){s=-1/0,l=-1;for(var f=0;f<r[0].length;f++)r[u][f]>s&&(s=r[u][f],l=f);i[l].push(e[u])}for(var c=0;c<i.length;c++)i[c]=a.collection(i[c]);return i},Gc=function(e){var r=this.cy(),n=this.nodes(),a=Zu(e),i,o,s,l,u;l=new Array(n.length);for(var f=0;f<n.length;f++)l[f]=new Array(a.k);s=new Array(n.length);for(var c=0;c<n.length;c++)s[c]=new Array(a.k);for(var h=0;h<n.length;h++){for(var d=0,v=0;v<a.k;v++)s[h][v]=Math.random(),d+=s[h][v];for(var p=0;p<a.k;p++)s[h][p]=s[h][p]/d}o=new Array(a.k);for(var m=0;m<a.k;m++)o[m]=new Array(a.attributes.length);u=new Array(n.length);for(var g=0;g<n.length;g++)u[g]=new Array(a.k);for(var y=!0,b=0;y&&b<a.maxIterations;)y=!1,DN(o,n,s,u,a),MN(s,l,o,n,a),NN(s,l,a.sensitivityThreshold)||(y=!0),b++;return i=RN(n,s,a,r),{clusters:i,degreeOfMembership:s}},PN={kMeans:AN,kMedoids:IN,fuzzyCMeans:Gc,fcm:Gc},_N=Dt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),FN={single:"min",complete:"max"},BN=function(e){var r=_N(e),n=FN[r.linkage];return n!=null&&(r.linkage=n),r},Vc=function(e,r,n,a,i){for(var o=0,s=1/0,l,u=i.attributes,f=function(I,D){return ns(i.distance,u.length,function(M){return u[M](I)},function(M){return u[M](D)},I,D)},c=0;c<e.length;c++){var h=e[c].key,d=n[h][a[h]];d<s&&(o=h,s=d)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var v=r[o],p=r[a[o]],m;i.mode==="dendrogram"?m={left:v,right:p,key:v.key}:m={value:v.value.concat(p.value),key:v.key},e[v.index]=m,e.splice(p.index,1),r[v.key]=m;for(var g=0;g<e.length;g++){var y=e[g];v.key===y.key?l=1/0:i.linkage==="min"?(l=n[v.key][y.key],n[v.key][y.key]>n[p.key][y.key]&&(l=n[p.key][y.key])):i.linkage==="max"?(l=n[v.key][y.key],n[v.key][y.key]<n[p.key][y.key]&&(l=n[p.key][y.key])):i.linkage==="mean"?l=(n[v.key][y.key]*v.size+n[p.key][y.key]*p.size)/(v.size+p.size):i.mode==="dendrogram"?l=f(y.value,v.value):l=f(y.value[0],v.value[0]),n[v.key][y.key]=n[y.key][v.key]=l}for(var b=0;b<e.length;b++){var x=e[b].key;if(a[x]===v.key||a[x]===p.key){for(var C=x,O=0;O<e.length;O++){var L=e[O].key;n[x][L]<n[x][C]&&(C=L)}a[x]=C}e[b].index=b}return v.key=p.key=v.index=p.index=null,!0},To=function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},kN=function t(e,r){if(!e)return"";if(e.left&&e.right){var n=t(e.left,r),a=t(e.right,r),i=r.add({group:"nodes",data:{id:n+","+a}});return r.add({group:"edges",data:{source:n,target:i.id()}}),r.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},qN=function t(e,r,n){if(!e)return[];var a=[],i=[],o=[];return r===0?(e.left&&To(e.left,a),e.right&&To(e.right,i),o=a.concat(i),[n.collection(o)]):r===1?e.value?[n.collection(e.value)]:(e.left&&To(e.left,a),e.right&&To(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=t(e.left,r-1,n)),e.right&&(i=t(e.right,r-1,n)),a.concat(i))},Hc=function(e){for(var r=this.cy(),n=this.nodes(),a=BN(e),i=a.attributes,o=function(b,x){return ns(a.distance,i.length,function(C){return i[C](b)},function(C){return i[C](x)},b,x)},s=[],l=[],u=[],f=[],c=0;c<n.length;c++){var h={value:a.mode==="dendrogram"?n[c]:[n[c]],key:c,index:c};s[c]=h,f[c]=h,l[c]=[],u[c]=0}for(var d=0;d<s.length;d++)for(var v=0;v<=d;v++){var p=void 0;a.mode==="dendrogram"?p=d===v?1/0:o(s[d].value,s[v].value):p=d===v?1/0:o(s[d].value[0],s[v].value[0]),l[d][v]=p,l[v][d]=p,p<l[d][u[d]]&&(u[d]=v)}for(var m=Vc(s,f,l,u,a);m;)m=Vc(s,f,l,u,a);var g;return a.mode==="dendrogram"?(g=qN(s[0],a.dendrogramDepth,r),a.addDendrogram&&kN(s[0],r)):(g=new Array(s.length),s.forEach(function(y,b){y.key=y.index=null,g[b]=r.collection(y.value)})),g},zN={hierarchicalClustering:Hc,hca:Hc},UN=Dt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),GN=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||pt("Damping must range on [0.5, 1). Got: ".concat(r));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||we(n)||pt("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),UN(e)},VN=function(e,r,n,a){var i=function(s,l){return a[l](s)};return-ns(e,a.length,function(o){return i(r,o)},function(o){return i(n,o)},r,n)},HN=function(e,r){var n=null;return r==="median"?n=GL(e):r==="mean"?n=UL(e):r==="min"?n=qL(e):r==="max"?n=zL(e):n=r,n},$N=function(e,r,n){for(var a=[],i=0;i<e;i++)r[i*e+i]+n[i*e+i]>0&&a.push(i);return a},$c=function(e,r,n){for(var a=[],i=0;i<e;i++){for(var o=-1,s=-1/0,l=0;l<n.length;l++){var u=n[l];r[i*e+u]>s&&(o=u,s=r[i*e+u])}o>0&&a.push(o)}for(var f=0;f<n.length;f++)a[n[f]]=n[f];return a},YN=function(e,r,n){for(var a=$c(e,r,n),i=0;i<n.length;i++){for(var o=[],s=0;s<a.length;s++)a[s]===n[i]&&o.push(s);for(var l=-1,u=-1/0,f=0;f<o.length;f++){for(var c=0,h=0;h<o.length;h++)c+=r[o[h]*e+o[f]];c>u&&(l=f,u=c)}n[i]=o[l]}return a=$c(e,r,n),a},Yc=function(e){for(var r=this.cy(),n=this.nodes(),a=GN(e),i={},o=0;o<n.length;o++)i[n[o].id()]=o;var s,l,u,f,c,h;s=n.length,l=s*s,u=new Array(l);for(var d=0;d<l;d++)u[d]=-1/0;for(var v=0;v<s;v++)for(var p=0;p<s;p++)v!==p&&(u[v*s+p]=VN(a.distance,n[v],n[p],a.attributes));f=HN(u,a.preference);for(var m=0;m<s;m++)u[m*s+m]=f;c=new Array(l);for(var g=0;g<l;g++)c[g]=0;h=new Array(l);for(var y=0;y<l;y++)h[y]=0;for(var b=new Array(s),x=new Array(s),C=new Array(s),O=0;O<s;O++)b[O]=0,x[O]=0,C[O]=0;for(var L=new Array(s*a.minIterations),A=0;A<L.length;A++)L[A]=0;var I;for(I=0;I<a.maxIterations;I++){for(var D=0;D<s;D++){for(var M=-1/0,E=-1/0,S=-1,w=0,N=0;N<s;N++)b[N]=c[D*s+N],w=h[D*s+N]+u[D*s+N],w>=M?(E=M,M=w,S=N):w>E&&(E=w);for(var T=0;T<s;T++)c[D*s+T]=(1-a.damping)*(u[D*s+T]-M)+a.damping*b[T];c[D*s+S]=(1-a.damping)*(u[D*s+S]-E)+a.damping*b[S]}for(var R=0;R<s;R++){for(var P=0,k=0;k<s;k++)b[k]=h[k*s+R],x[k]=Math.max(0,c[k*s+R]),P+=x[k];P-=x[R],x[R]=c[R*s+R],P+=x[R];for(var U=0;U<s;U++)h[U*s+R]=(1-a.damping)*Math.min(0,P-x[U])+a.damping*b[U];h[R*s+R]=(1-a.damping)*(P-x[R])+a.damping*b[R]}for(var B=0,V=0;V<s;V++){var j=h[V*s+V]+c[V*s+V]>0?1:0;L[I%a.minIterations*s+V]=j,B+=j}if(B>0&&(I>=a.minIterations-1||I==a.maxIterations-1)){for(var Y=0,Z=0;Z<s;Z++){C[Z]=0;for(var K=0;K<a.minIterations;K++)C[Z]+=L[K*s+Z];(C[Z]===0||C[Z]===a.minIterations)&&Y++}if(Y===s)break}}for(var G=$N(s,c,h),$=YN(s,u,G),q={},X=0;X<G.length;X++)q[G[X]]=[];for(var ee=0;ee<n.length;ee++){var ce=i[n[ee].id()],Ee=$[ce];Ee!=null&&q[Ee].push(n[ee])}for(var ne=new Array(G.length),Q=0;Q<G.length;Q++)ne[Q]=r.collection(q[G[Q]]);return ne},WN={affinityPropagation:Yc,ap:Yc},XN=Dt({root:void 0,directed:!1}),KN={hierholzer:function(e){if(!Qe(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=XN(e),a=n.root,i=n.directed,o=this,s=!1,l,u,f;a&&(f=Re(a)?this.filter(a)[0].id():a[0].id());var c={},h={};i?o.forEach(function(y){var b=y.id();if(y.isNode()){var x=y.indegree(!0),C=y.outdegree(!0),O=x-C,L=C-x;O==1?l?s=!0:l=b:L==1?u?s=!0:u=b:(L>1||O>1)&&(s=!0),c[b]=[],y.outgoers().forEach(function(A){A.isEdge()&&c[b].push(A.id())})}else h[b]=[void 0,y.target().id()]}):o.forEach(function(y){var b=y.id();if(y.isNode()){var x=y.degree(!0);x%2&&(l?u?s=!0:u=b:l=b),c[b]=[],y.connectedEdges().forEach(function(C){return c[b].push(C.id())})}else h[b]=[y.source().id(),y.target().id()]});var d={found:!1,trail:void 0};if(s)return d;if(u&&l)if(i){if(f&&u!=f)return d;f=u}else{if(f&&u!=f&&l!=f)return d;f||(f=u)}else f||(f=o[0].id());var v=function(b){for(var x=b,C=[b],O,L,A;c[x].length;)O=c[x].shift(),L=h[O][0],A=h[O][1],x!=A?(c[A]=c[A].filter(function(I){return I!=O}),x=A):!i&&x!=L&&(c[L]=c[L].filter(function(I){return I!=O}),x=L),C.unshift(O),C.unshift(x);return C},p=[],m=[];for(m=v(f);m.length!=1;)c[m[0]].length==0?(p.unshift(o.getElementById(m.shift())),p.unshift(o.getElementById(m.shift()))):m=v(m.shift()).concat(m);p.unshift(o.getElementById(m.shift()));for(var g in c)if(c[g].length)return d;return d.found=!0,d.trail=this.spawn(p,!0),d}},Co=function(){var e=this,r={},n=0,a=0,i=[],o=[],s={},l=function(h,d){for(var v=o.length-1,p=[],m=e.spawn();o[v].x!=h||o[v].y!=d;)p.push(o.pop().edge),v--;p.push(o.pop().edge),p.forEach(function(g){var y=g.connectedNodes().intersection(e);m.merge(g),y.forEach(function(b){var x=b.id(),C=b.connectedEdges().intersection(e);m.merge(b),r[x].cutVertex?m.merge(C.filter(function(O){return O.isLoop()})):m.merge(C)})}),i.push(m)},u=function c(h,d,v){h===v&&(a+=1),r[d]={id:n,low:n++,cutVertex:!1};var p=e.getElementById(d).connectedEdges().intersection(e);if(p.size()===0)i.push(e.spawn(e.getElementById(d)));else{var m,g,y,b;p.forEach(function(x){m=x.source().id(),g=x.target().id(),y=m===d?g:m,y!==v&&(b=x.id(),s[b]||(s[b]=!0,o.push({x:d,y,edge:x})),y in r?r[d].low=Math.min(r[d].low,r[y].id):(c(h,y,d),r[d].low=Math.min(r[d].low,r[y].low),r[d].id<=r[y].low&&(r[d].cutVertex=!0,l(d,y))))})}};e.forEach(function(c){if(c.isNode()){var h=c.id();h in r||(a=0,u(h,h),r[h].cutVertex=a>1)}});var f=Object.keys(r).filter(function(c){return r[c].cutVertex}).map(function(c){return e.getElementById(c)});return{cut:e.spawn(f),components:i}},jN={hopcroftTarjanBiconnected:Co,htbc:Co,htb:Co,hopcroftTarjanBiconnectedComponents:Co},So=function(){var e=this,r={},n=0,a=[],i=[],o=e.spawn(e),s=function l(u){i.push(u),r[u]={index:n,low:n++,explored:!1};var f=e.getElementById(u).connectedEdges().intersection(e);if(f.forEach(function(p){var m=p.target().id();m!==u&&(m in r||l(m),r[m].explored||(r[u].low=Math.min(r[u].low,r[m].low)))}),r[u].index===r[u].low){for(var c=e.spawn();;){var h=i.pop();if(c.merge(e.getElementById(h)),r[h].low=r[u].index,r[h].explored=!0,h===u)break}var d=c.edgesWith(c),v=c.merge(d);a.push(v),o=o.difference(v)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||s(u)}}),{cut:o,components:a}},ZN={tarjanStronglyConnected:So,tsc:So,tscc:So,tarjanStronglyConnectedComponents:So},gd={};[ui,NL,OL,IL,ML,PL,BL,uN,la,fa,Nu,wN,PN,zN,WN,KN,jN,ZN].forEach(function(t){_e(gd,t)});var yd=0,md=1,bd=2,Mr=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=yd,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Mr.prototype={fulfill:function(e){return Wc(this,md,"fulfillValue",e)},reject:function(e){return Wc(this,bd,"rejectReason",e)},then:function(e,r){var n=this,a=new Mr;return n.onFulfilled.push(Kc(e,a,"fulfill")),n.onRejected.push(Kc(r,a,"reject")),Ed(n),a.proxy}};var Wc=function(e,r,n,a){return e.state===yd&&(e.state=r,e[n]=a,Ed(e)),e},Ed=function(e){e.state===md?Xc(e,"onFulfilled",e.fulfillValue):e.state===bd&&Xc(e,"onRejected",e.rejectReason)},Xc=function(e,r,n){if(e[r].length!==0){var a=e[r];e[r]=[];var i=function(){for(var s=0;s<a.length;s++)a[s](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Kc=function(e,r,n){return function(a){if(typeof e!="function")r[n].call(r,a);else{var i;try{i=e(a)}catch(o){r.reject(o);return}QN(r,i)}}},QN=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(Tt(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(r,function(i){a||(a=!0,i===r?e.reject(new TypeError("circular thenable chain")):t(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(r)};Mr.all=function(t){return new Mr(function(e,r){for(var n=new Array(t.length),a=0,i=function(l,u){n[l]=u,a++,a===t.length&&e(n)},o=0;o<t.length;o++)(function(s){var l=t[s],u=l!=null&&l.then!=null;if(u)l.then(function(c){i(s,c)},function(c){r(c)});else{var f=l;i(s,f)}})(o)})};Mr.resolve=function(t){return new Mr(function(e,r){e(t)})};Mr.reject=function(t){return new Mr(function(e,r){r(t)})};var ya=typeof Promise<"u"?Promise:Mr,Ou=function(e,r,n){var a=Vu(e),i=!a,o=this._private=_e({duration:1e3},r,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&vt(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(a){var l=e.pan();o.startPan={x:l.x,y:l.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},In=Ou.prototype;_e(In,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.push(this),Yt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,f){var c=e[u];c!=null&&(e[u]=e[f],e[f]=c)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[a]=s}return r&&this.play(),this},promise:function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new ya(function(a,i){n.push(function(){a()})})}});In.complete=In.completed;In.run=In.play;In.running=In.playing;var JN={animated:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=a[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<a.length;o++){var s=a[o];s._private.animation.queue=[]}return this}},delay:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this}},delayAnimation:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this}},animation:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this,l=!i,u=!l;if(!s.styleEnabled())return this;var f=s.style();r=_e({},r,n);var c=Object.keys(r).length===0;if(c)return new Ou(o[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u&&(r.style=f.getPropsList(r.style||r.css),r.css=void 0),u&&r.renderedPosition!=null){var h=r.renderedPosition,d=s.pan(),v=s.zoom();r.position=id(h,v,d)}if(l&&r.panBy!=null){var p=r.panBy,m=s.pan();r.pan={x:m.x+p.x,y:m.y+p.y}}var g=r.center||r.centre;if(l&&g!=null){var y=s.getCenterPan(g.eles,r.zoom);y!=null&&(r.pan=y)}if(l&&r.fit!=null){var b=r.fit,x=s.getFitViewport(b.eles||b.boundingBox,b.padding);x!=null&&(r.pan=x.pan,r.zoom=x.zoom)}if(l&&Qe(r.zoom)){var C=s.getZoomedViewport(r.zoom);C!=null?(C.zoomed&&(r.zoom=C.zoom),C.panned&&(r.pan=C.pan)):r.zoom=null}return new Ou(o[0],r)}},animate:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this;if(!s.styleEnabled())return this;n&&(r=_e({},r,n));for(var l=0;l<o.length;l++){var u=o[l],f=u.animated()&&(r.queue===void 0||r.queue),c=u.animation(r,f?{queue:!0}:void 0);c.play()}return this}},stop:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var l=0;l<o.length;l++){for(var u=o[l],f=u._private,c=f.animation.current,h=0;h<c.length;h++){var d=c[h],v=d._private;n&&(v.duration=0)}r&&(f.animation.queue=[]),n||(f.animation.current=[])}return s.notify("draw"),this}}},eO=Array.isArray,as=eO,tO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rO=/^\w*$/;function nO(t,e){if(as(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||mi(t)?!0:rO.test(t)||!tO.test(t)||e!=null&&t in Object(e)}var aO=nO,iO="[object AsyncFunction]",oO="[object Function]",sO="[object GeneratorFunction]",uO="[object Proxy]";function lO(t){if(!Ln(t))return!1;var e=jh(t);return e==oO||e==sO||e==iO||e==uO}var fO=lO,cO=Jo["__core-js_shared__"],yu=cO,jc=(function(){var t=/[^.]+$/.exec(yu&&yu.keys&&yu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function hO(t){return!!jc&&jc in t}var dO=hO,vO=Function.prototype,pO=vO.toString;function gO(t){if(t!=null){try{return pO.call(t)}catch{}try{return t+""}catch{}}return""}var yO=gO,mO=/[\\^$.*+?()[\]{}|]/g,bO=/^\[object .+?Constructor\]$/,EO=Function.prototype,wO=Object.prototype,xO=EO.toString,TO=wO.hasOwnProperty,CO=RegExp("^"+xO.call(TO).replace(mO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function SO(t){if(!Ln(t)||dO(t))return!1;var e=fO(t)?CO:bO;return e.test(yO(t))}var LO=SO;function NO(t,e){return t?.[e]}var OO=NO;function AO(t,e){var r=OO(t,e);return LO(r)?r:void 0}var Qu=AO,IO=Qu(Object,"create"),ci=IO;function DO(){this.__data__=ci?ci(null):{},this.size=0}var MO=DO;function RO(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var PO=RO,_O="__lodash_hash_undefined__",FO=Object.prototype,BO=FO.hasOwnProperty;function kO(t){var e=this.__data__;if(ci){var r=e[t];return r===_O?void 0:r}return BO.call(e,t)?e[t]:void 0}var qO=kO,zO=Object.prototype,UO=zO.hasOwnProperty;function GO(t){var e=this.__data__;return ci?e[t]!==void 0:UO.call(e,t)}var VO=GO,HO="__lodash_hash_undefined__";function $O(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ci&&e===void 0?HO:e,this}var YO=$O;function ma(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ma.prototype.clear=MO;ma.prototype.delete=PO;ma.prototype.get=qO;ma.prototype.has=VO;ma.prototype.set=YO;var Zc=ma;function WO(){this.__data__=[],this.size=0}var XO=WO;function KO(t,e){return t===e||t!==t&&e!==e}var wd=KO;function jO(t,e){for(var r=t.length;r--;)if(wd(t[r][0],e))return r;return-1}var is=jO,ZO=Array.prototype,QO=ZO.splice;function JO(t){var e=this.__data__,r=is(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():QO.call(e,r,1),--this.size,!0}var eA=JO;function tA(t){var e=this.__data__,r=is(e,t);return r<0?void 0:e[r][1]}var rA=tA;function nA(t){return is(this.__data__,t)>-1}var aA=nA;function iA(t,e){var r=this.__data__,n=is(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var oA=iA;function ba(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ba.prototype.clear=XO;ba.prototype.delete=eA;ba.prototype.get=rA;ba.prototype.has=aA;ba.prototype.set=oA;var sA=ba,uA=Qu(Jo,"Map"),lA=uA;function fA(){this.size=0,this.__data__={hash:new Zc,map:new(lA||sA),string:new Zc}}var cA=fA;function hA(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var dA=hA;function vA(t,e){var r=t.__data__;return dA(e)?r[typeof e=="string"?"string":"hash"]:r.map}var os=vA;function pA(t){var e=os(this,t).delete(t);return this.size-=e?1:0,e}var gA=pA;function yA(t){return os(this,t).get(t)}var mA=yA;function bA(t){return os(this,t).has(t)}var EA=bA;function wA(t,e){var r=os(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var xA=wA;function Ea(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ea.prototype.clear=cA;Ea.prototype.delete=gA;Ea.prototype.get=mA;Ea.prototype.has=EA;Ea.prototype.set=xA;var xd=Ea,TA="Expected a function";function Ju(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(TA);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(Ju.Cache||xd),r}Ju.Cache=xd;var CA=Ju,SA=500;function LA(t){var e=CA(t,function(n){return r.size===SA&&r.clear(),n}),r=e.cache;return e}var NA=LA,OA=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AA=/\\(\\)?/g,IA=NA(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(OA,function(r,n,a,i){e.push(a?i.replace(AA,"$1"):n||r)}),e}),Td=IA;function DA(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var Cd=DA,MA=1/0,Qc=ha?ha.prototype:void 0,Jc=Qc?Qc.toString:void 0;function Sd(t){if(typeof t=="string")return t;if(as(t))return Cd(t,Sd)+"";if(mi(t))return Jc?Jc.call(t):"";var e=t+"";return e=="0"&&1/t==-MA?"-0":e}var RA=Sd;function PA(t){return t==null?"":RA(t)}var Ld=PA;function _A(t,e){return as(t)?t:aO(t,e)?[t]:Td(Ld(t))}var Nd=_A,FA=1/0;function BA(t){if(typeof t=="string"||mi(t))return t;var e=t+"";return e=="0"&&1/t==-FA?"-0":e}var el=BA;function kA(t,e){e=Nd(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[el(e[r++])];return r&&r==n?t:void 0}var qA=kA;function zA(t,e,r){var n=t==null?void 0:qA(t,e);return n===void 0?r:n}var UA=zA,GA=(function(){try{var t=Qu(Object,"defineProperty");return t({},"",{}),t}catch{}})(),eh=GA;function VA(t,e,r){e=="__proto__"&&eh?eh(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var HA=VA,$A=Object.prototype,YA=$A.hasOwnProperty;function WA(t,e,r){var n=t[e];(!(YA.call(t,e)&&wd(n,r))||r===void 0&&!(e in t))&&HA(t,e,r)}var XA=WA,KA=9007199254740991,jA=/^(?:0|[1-9]\d*)$/;function ZA(t,e){var r=typeof t;return e=e??KA,!!e&&(r=="number"||r!="symbol"&&jA.test(t))&&t>-1&&t%1==0&&t<e}var QA=ZA;function JA(t,e,r,n){if(!Ln(t))return t;e=Nd(e,t);for(var a=-1,i=e.length,o=i-1,s=t;s!=null&&++a<i;){var l=el(e[a]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(a!=o){var f=s[l];u=n?n(f,l,s):void 0,u===void 0&&(u=Ln(f)?f:QA(e[a+1])?[]:{})}XA(s,l,u),s=s[l]}return t}var eI=JA;function tI(t,e,r){return t==null?t:eI(t,e,r)}var rI=tI;function nI(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var aI=nI;function iI(t){return as(t)?Cd(t,el):mi(t)?[t]:aI(Td(Ld(t)))}var oI=iI,sI={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=_e({},r,e),function(a,i){var o=e,s=this,l=s.length!==void 0,u=l?s:[s],f=l?s[0]:s;if(Re(a)){var c=a.indexOf(".")!==-1,h=c&&oI(a);if(o.allowGetting&&i===void 0){var d;return f&&(o.beforeGet(f),h&&f._private[o.field][a]===void 0?d=UA(f._private[o.field],h):d=f._private[o.field][a]),d}else if(o.allowSetting&&i!==void 0){var v=!o.immutableKeys[a];if(v){var p=qh({},a,i);o.beforeSet(s,p);for(var m=0,g=u.length;m<g;m++){var y=u[m];o.canSet(y)&&(h&&f._private[o.field][a]===void 0?rI(y._private[o.field],h,i):y._private[o.field][a]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&Qe(a)){var b=a,x,C,O=Object.keys(b);o.beforeSet(s,b);for(var L=0;L<O.length;L++){x=O[L],C=b[x];var A=!o.immutableKeys[x];if(A)for(var I=0;I<u.length;I++){var D=u[I];o.canSet(D)&&(D._private[o.field][x]=C)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&vt(a)){var M=a;s.on(o.bindingEvent,M)}else if(o.allowGetting&&a===void 0){var E;return f&&(o.beforeGet(f),E=f._private[o.field]),E}return s}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=_e({},r,e),function(a){var i=e,o=this,s=o.length!==void 0,l=s?o:[o];if(Re(a)){for(var u=a.split(/\s+/),f=u.length,c=0;c<f;c++){var h=u[c];if(!Jr(h)){var d=!i.immutableKeys[h];if(d)for(var v=0,p=l.length;v<p;v++)l[v]._private[i.field][h]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(a===void 0){for(var m=0,g=l.length;m<g;m++)for(var y=l[m]._private[i.field],b=Object.keys(y),x=0;x<b.length;x++){var C=b[x],O=!i.immutableKeys[C];O&&(y[C]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},uI={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,a){var i=this,o=Array.prototype.slice.call(arguments,0);return new ya(function(s,l){var u=function(d){i.off.apply(i,c),s(d)},f=o.concat([u]),c=f.concat([]);i.on.apply(i,f)})}}},rt={};[JN,sI,uI].forEach(function(t){_e(rt,t)});var lI={animate:rt.animate(),animation:rt.animation(),animated:rt.animated(),clearQueue:rt.clearQueue(),delay:rt.delay(),delayAnimation:rt.delayAnimation(),stop:rt.stop()},Po={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(v){return n.push(v)}),n}else ot(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new ga(e),o=0;o<r.length;o++){for(var s=r[o],l=s._private,u=l.classes,f=!1,c=0;c<e.length;c++){var h=e[c],d=u.has(h);if(!d){f=!0;break}}f||(f=u.size!==e.length),f&&(l.classes=i,a.push(s))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){ot(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=r===void 0,i=[],o=0,s=n.length;o<s;o++)for(var l=n[o],u=l._private.classes,f=!1,c=0;c<e.length;c++){var h=e[c],d=u.has(h),v=!1;r||a&&!d?(u.add(h),v=!0):(!r||a&&d)&&(u.delete(h),v=!0),!f&&v&&(i.push(l),f=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};Po.className=Po.classNames=Po.classes;var Ze={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:xt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ze.variable="(?:[\\w-.]|(?:\\\\"+Ze.metaChar+"))+";Ze.className="(?:[\\w-]|(?:\\\\"+Ze.metaChar+"))+";Ze.value=Ze.string+"|"+Ze.number;Ze.id=Ze.variable;(function(){var t,e,r;for(t=Ze.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Ze.comparatorOp+="|@"+e;for(t=Ze.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Ze.comparatorOp+="|\\!"+e)})();var at=function(){return{checks:[]}},Ie={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Au=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return wS(t.selector,e.selector)}),fI=(function(){for(var t={},e,r=0;r<Au.length;r++)e=Au[r],t[e.selector]=e.matches;return t})(),cI=function(e,r){return fI[e](r)},hI="("+Au.map(function(t){return t.selector}).join("|")+")",ea=function(e){return e.replace(new RegExp("\\\\("+Ze.metaChar+")","g"),function(r,n){return n})},Xr=function(e,r,n){e[e.length-1]=n},Iu=[{name:"group",query:!0,regex:"("+Ze.group+")",populate:function(e,r,n){var a=or(n,1),i=a[0];r.checks.push({type:Ie.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:hI,populate:function(e,r,n){var a=or(n,1),i=a[0];r.checks.push({type:Ie.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Ze.id+")",populate:function(e,r,n){var a=or(n,1),i=a[0];r.checks.push({type:Ie.ID,value:ea(i)})}},{name:"className",query:!0,regex:"\\.("+Ze.className+")",populate:function(e,r,n){var a=or(n,1),i=a[0];r.checks.push({type:Ie.CLASS,value:ea(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ze.variable+")\\s*\\]",populate:function(e,r,n){var a=or(n,1),i=a[0];r.checks.push({type:Ie.DATA_EXIST,field:ea(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ze.variable+")\\s*("+Ze.comparatorOp+")\\s*("+Ze.value+")\\s*\\]",populate:function(e,r,n){var a=or(n,3),i=a[0],o=a[1],s=a[2],l=new RegExp("^"+Ze.string+"$").exec(s)!=null;l?s=s.substring(1,s.length-1):s=parseFloat(s),r.checks.push({type:Ie.DATA_COMPARE,field:ea(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ze.boolOp+")\\s*("+Ze.variable+")\\s*\\]",populate:function(e,r,n){var a=or(n,2),i=a[0],o=a[1];r.checks.push({type:Ie.DATA_BOOL,field:ea(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ze.meta+")\\s*("+Ze.comparatorOp+")\\s*("+Ze.number+")\\s*\\]\\]",populate:function(e,r,n){var a=or(n,3),i=a[0],o=a[1],s=a[2];r.checks.push({type:Ie.META_COMPARE,field:ea(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:Ze.separator,populate:function(e,r){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,o=e[e.length-1];n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=a,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=at();return s}},{name:"directedEdge",separator:!0,regex:Ze.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=at(),a=r,i=at();return n.checks.push({type:Ie.DIRECTED_EDGE,source:a,target:i}),Xr(e,r,n),e.edgeCount++,i}else{var o=at(),s=r,l=at();return o.checks.push({type:Ie.NODE_SOURCE,source:s,target:l}),Xr(e,r,o),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:Ze.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=at(),a=r,i=at();return n.checks.push({type:Ie.UNDIRECTED_EDGE,nodes:[a,i]}),Xr(e,r,n),e.edgeCount++,i}else{var o=at(),s=r,l=at();return o.checks.push({type:Ie.NODE_NEIGHBOR,node:s,neighbor:l}),Xr(e,r,o),l}}},{name:"child",separator:!0,regex:Ze.child,populate:function(e,r){if(e.currentSubject==null){var n=at(),a=at(),i=e[e.length-1];return n.checks.push({type:Ie.CHILD,parent:i,child:a}),Xr(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var o=at(),s=e[e.length-1],l=at(),u=at(),f=at(),c=at();return o.checks.push({type:Ie.COMPOUND_SPLIT,left:s,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:Ie.TRUE}],c.checks.push({type:Ie.TRUE}),l.checks.push({type:Ie.PARENT,parent:c,child:f}),Xr(e,s,o),e.currentSubject=u,e.compoundCount++,f}else{var h=at(),d=at(),v=[{type:Ie.PARENT,parent:h,child:d}];return h.checks=r.checks,r.checks=v,e.compoundCount++,d}}},{name:"descendant",separator:!0,regex:Ze.descendant,populate:function(e,r){if(e.currentSubject==null){var n=at(),a=at(),i=e[e.length-1];return n.checks.push({type:Ie.DESCENDANT,ancestor:i,descendant:a}),Xr(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var o=at(),s=e[e.length-1],l=at(),u=at(),f=at(),c=at();return o.checks.push({type:Ie.COMPOUND_SPLIT,left:s,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:Ie.TRUE}],c.checks.push({type:Ie.TRUE}),l.checks.push({type:Ie.ANCESTOR,ancestor:c,descendant:f}),Xr(e,s,o),e.currentSubject=u,e.compoundCount++,f}else{var h=at(),d=at(),v=[{type:Ie.ANCESTOR,ancestor:h,descendant:d}];return h.checks=r.checks,r.checks=v,e.compoundCount++,d}}},{name:"subject",modifier:!0,regex:Ze.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return nt("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],a=n.checks[0],i=a==null?null:a.type;i===Ie.DIRECTED_EDGE?a.type=Ie.NODE_TARGET:i===Ie.UNDIRECTED_EDGE&&(a.type=Ie.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];Iu.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var dI=function(e){for(var r,n,a,i=0;i<Iu.length;i++){var o=Iu[i],s=o.name,l=e.match(o.regexObj);if(l!=null){n=l,r=o,a=s;var u=l[0];e=e.substring(u.length);break}}return{expr:r,match:n,name:a,remaining:e}},vI=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},pI=function(e){var r=this,n=r.inputText=e,a=r[0]=at();for(r.length=1,n=vI(n);;){var i=dI(n);if(i.expr==null)return nt("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(r,a,o);if(s===!1)return!1;if(s!=null&&(a=s),n=i.remaining,n.match(/^\s*$/))break}var l=r[r.length-1];r.currentSubject!=null&&(l.subject=r.currentSubject),l.edgeCount=r.edgeCount,l.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var f=r[u];if(f.compoundCount>0&&f.edgeCount>0)return nt("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return nt("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&nt("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},gI=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},r=function(f){return Re(f)?'"'+f+'"':e(f)},n=function(f){return" "+f+" "},a=function(f,c){var h=f.type,d=f.value;switch(h){case Ie.GROUP:{var v=e(d);return v.substring(0,v.length-1)}case Ie.DATA_COMPARE:{var p=f.field,m=f.operator;return"["+p+n(e(m))+r(d)+"]"}case Ie.DATA_BOOL:{var g=f.operator,y=f.field;return"["+e(g)+y+"]"}case Ie.DATA_EXIST:{var b=f.field;return"["+b+"]"}case Ie.META_COMPARE:{var x=f.operator,C=f.field;return"[["+C+n(e(x))+r(d)+"]]"}case Ie.STATE:return d;case Ie.ID:return"#"+d;case Ie.CLASS:return"."+d;case Ie.PARENT:case Ie.CHILD:return i(f.parent,c)+n(">")+i(f.child,c);case Ie.ANCESTOR:case Ie.DESCENDANT:return i(f.ancestor,c)+" "+i(f.descendant,c);case Ie.COMPOUND_SPLIT:{var O=i(f.left,c),L=i(f.subject,c),A=i(f.right,c);return O+(O.length>0?" ":"")+L+A}case Ie.TRUE:return""}},i=function(f,c){return f.checks.reduce(function(h,d,v){return h+(c===f&&v===0?"$":"")+a(d,c)},"")},o="",s=0;s<this.length;s++){var l=this[s];o+=i(l,l.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},yI={parse:pI,toString:gI},Od=function(e,r,n){var a,i=Re(e),o=we(e),s=Re(n),l,u,f=!1,c=!1,h=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),c=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(i||s||f)&&(l=!i&&!o?"":""+e,u=""+n),f&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":a=l.indexOf(u)>=0;break;case"$=":a=l.indexOf(u,l.length-u.length)>=0;break;case"^=":a=l.indexOf(u)===0;break;case"=":a=e===n;break;case">":h=!0,a=e>n;break;case">=":h=!0,a=e>=n;break;case"<":h=!0,a=e<n;break;case"<=":h=!0,a=e<=n;break;default:a=!1;break}return c&&(e!=null||!h)&&(a=!a),a},mI=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},bI=function(e){return e!==void 0},tl=function(e,r){return e.data(r)},EI=function(e,r){return e[r]()},gt=[],ct=function(e,r){return e.checks.every(function(n){return gt[n.type](n,r)})};gt[Ie.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};gt[Ie.STATE]=function(t,e){var r=t.value;return cI(r,e)};gt[Ie.ID]=function(t,e){var r=t.value;return e.id()===r};gt[Ie.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};gt[Ie.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Od(EI(e,r),n,a)};gt[Ie.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Od(tl(e,r),n,a)};gt[Ie.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return mI(tl(e,r),n)};gt[Ie.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,bI(tl(e,r))};gt[Ie.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],a=e.source(),i=e.target();return ct(r,a)&&ct(n,i)||ct(n,a)&&ct(r,i)};gt[Ie.NODE_NEIGHBOR]=function(t,e){return ct(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&ct(t.neighbor,r)})};gt[Ie.DIRECTED_EDGE]=function(t,e){return ct(t.source,e.source())&&ct(t.target,e.target())};gt[Ie.NODE_SOURCE]=function(t,e){return ct(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&ct(t.target,r)})};gt[Ie.NODE_TARGET]=function(t,e){return ct(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&ct(t.source,r)})};gt[Ie.CHILD]=function(t,e){return ct(t.child,e)&&ct(t.parent,e.parent())};gt[Ie.PARENT]=function(t,e){return ct(t.parent,e)&&e.children().some(function(r){return ct(t.child,r)})};gt[Ie.DESCENDANT]=function(t,e){return ct(t.descendant,e)&&e.ancestors().some(function(r){return ct(t.ancestor,r)})};gt[Ie.ANCESTOR]=function(t,e){return ct(t.ancestor,e)&&e.descendants().some(function(r){return ct(t.descendant,r)})};gt[Ie.COMPOUND_SPLIT]=function(t,e){return ct(t.subject,e)&&ct(t.left,e)&&ct(t.right,e)};gt[Ie.TRUE]=function(){return!0};gt[Ie.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};gt[Ie.FILTER]=function(t,e){var r=t.value;return r(e)};var wI=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===Ie.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(i){for(var o=0;o<r.length;o++){var s=r[o];if(ct(s,i))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},xI=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(ct(a,e))return!0}return!1},TI={matches:xI,filter:wI},tn=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Re(e)&&e.match(/^\s*$/)||(Yt(e)?this.addQuery({checks:[{type:Ie.COLLECTION,value:e.collection()}]}):vt(e)?this.addQuery({checks:[{type:Ie.FILTER,value:e}]}):Re(e)?this.parse(e)||(this.invalid=!0):pt("A selector must be created from a string; found "))},rn=tn.prototype;[yI,TI].forEach(function(t){return _e(rn,t)});rn.text=function(){return this.inputText};rn.size=function(){return this.length};rn.eq=function(t){return this[t]};rn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};rn.addQuery=function(t){this[this.length++]=t};rn.selector=rn.toString;var Zr={allAre:function(e){var r=new tn(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new tn(e);return this.some(function(n){return r.matches(n)})},some:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})}};Zr.allAreNeighbours=Zr.allAreNeighbors;Zr.has=Zr.contains;Zr.equal=Zr.equals=Zr.same;var tr=function(e,r){return function(a,i,o,s){var l=a,u=this,f;if(l==null?f="":Yt(l)&&l.length===1&&(f=l.id()),u.length===1&&f){var c=u[0]._private,h=c.traversalCache=c.traversalCache||{},d=h[r]=h[r]||[],v=Nn(f),p=d[v];return p||(d[v]=e.call(u,a,i,o,s))}else return e.call(u,a,i,o,s)}},pa={parent:function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],o=i._private.parent;o&&r.push(o)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var i=n[a];r.push(i)}n=n.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,n=0;n<this.length;n++){var a=this[n],i=a.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:tr(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],a=n._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function n(a){for(var i=0;i<a.length;i++){var o=a[i];r.push(o),o.children().nonempty()&&n(o.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function rl(t,e,r,n){for(var a=[],i=new ga,o=t.cy(),s=o.hasCompoundNodes(),l=0;l<t.length;l++){var u=t[l];r?a.push(u):s&&n(a,i,u)}for(;a.length>0;){var f=a.shift();e(f),i.add(f.id()),s&&n(a,i,f)}return t}function Ad(t,e,r){if(r.isParent())for(var n=r._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||t.push(i)}}pa.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return rl(this,t,e,Ad)};function Id(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}pa.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return rl(this,t,e,Id)};function CI(t,e,r){Id(t,e,r),Ad(t,e,r)}pa.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return rl(this,t,e,CI)};pa.ancestors=pa.parents;var hi,Dd;hi=Dd={data:rt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:rt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:rt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:rt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:rt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:rt.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};hi.attr=hi.data;hi.removeAttr=hi.removeData;var SI=Dd,ss={};function mu(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,a=r[0],i=a._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(n+=t(a,s))}return n}else return}}_e(ss,{degree:mu(function(t,e){return e.source().same(e.target())?2:1}),indegree:mu(function(t,e){return e.target().same(t)?1:0}),outdegree:mu(function(t,e){return e.source().same(t)?1:0})});function ta(t,e){return function(r){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i],s=o[t](r);s!==void 0&&(n===void 0||e(s,n))&&(n=s)}return n}}_e(ss,{minDegree:ta("degree",function(t,e){return t<e}),maxDegree:ta("degree",function(t,e){return t>e}),minIndegree:ta("indegree",function(t,e){return t<e}),maxIndegree:ta("indegree",function(t,e){return t>e}),minOutdegree:ta("outdegree",function(t,e){return t<e}),maxOutdegree:ta("outdegree",function(t,e){return t>e})});_e(ss,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a<n.length;a++)r+=n[a].degree(e);return r}});var lr,Md,Rd=function(e,r,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var o=i._private.position,s={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,n),i.dirtyBoundingBoxCache()}}},th={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){Rd(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};lr=Md={position:rt.data(th),silentPosition:rt.data(_e({},th,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){Rd(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(Qe(e))r?this.silentPosition(e):this.position(e);else if(vt(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=n(o,i))&&(r?o.silentPosition(s):o.position(s))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var a;if(Qe(e)?(a={x:we(e.x)?e.x:0,y:we(e.y)?e.y:0},n=r):Re(e)&&we(r)&&(a={x:0,y:0},a[e]=r),a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var l=s.position(),u={x:l.x+a.x,y:l.y+a.y};n?s.silentPosition(u):s.position(u)}}i.endBatch()}return this},silentShift:function(e,r){return Qe(e)?this.shift(e,!0):Re(e)&&we(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],a=this.cy(),i=a.zoom(),o=a.pan(),s=Qe(e)?e:void 0,l=s!==void 0||r!==void 0&&Re(e);if(n&&n.isNode())if(l)for(var u=0;u<this.length;u++){var f=this[u];r!==void 0?f.position(e,(r-o[e])/i):s!==void 0&&f.position(id(s,i,o))}else{var c=n.position();return s=rs(c,i,o),e===void 0?s:s[e]}else if(!l)return;return this},relativePosition:function(e,r){var n=this[0],a=this.cy(),i=Qe(e)?e:void 0,o=i!==void 0||r!==void 0&&Re(e),s=a.hasCompoundNodes();if(n&&n.isNode())if(o)for(var l=0;l<this.length;l++){var u=this[l],f=s?u.parent():null,c=f&&f.length>0,h=c;c&&(f=f[0]);var d=h?f.position():{x:0,y:0};r!==void 0?u.position(e,r+d[e]):i!==void 0&&u.position({x:i.x+d.x,y:i.y+d.y})}else{var v=n.position(),p=s?n.parent():null,m=p&&p.length>0,g=m;m&&(p=p[0]);var y=g?p.position():{x:0,y:0};return i={x:v.x-y.x,y:v.y-y.y},e===void 0?i:i[e]}else if(!o)return;return this}};lr.modelPosition=lr.point=lr.position;lr.modelPositions=lr.points=lr.positions;lr.renderedPoint=lr.renderedPosition;lr.relativePoint=lr.relativePosition;var LI=Md,ca,an;ca=an={};an.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),i=e.x1*n+a.x,o=e.x2*n+a.x,s=e.y1*n+a.y,l=e.y2*n+a.y;return{x1:i,x2:o,y1:s,y2:l,w:o-i,h:l-s}};an.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};an.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(o){if(!o.isParent())return;var s=o._private,l=o.children(),u=o.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},c=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),h=s.position;(c.w===0||c.h===0)&&(c={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},c.x1=h.x-c.w/2,c.x2=h.x+c.w/2,c.y1=h.y-c.h/2,c.y2=h.y+c.h/2);function d(I,D,M){var E=0,S=0,w=D+M;return I>0&&w>0&&(E=D/w*I,S=M/w*I),{biasDiff:E,biasComplementDiff:S}}function v(I,D,M,E){if(M.units==="%")switch(E){case"width":return I>0?M.pfValue*I:0;case"height":return D>0?M.pfValue*D:0;case"average":return I>0&&D>0?M.pfValue*(I+D)/2:0;case"min":return I>0&&D>0?I>D?M.pfValue*D:M.pfValue*I:0;case"max":return I>0&&D>0?I>D?M.pfValue*I:M.pfValue*D:0;default:return 0}else return M.units==="px"?M.pfValue:0}var p=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(p=p*100/f.width.val);var m=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(m=m*100/f.width.val);var g=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(g=g*100/f.height.val);var y=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(y=y*100/f.height.val);var b=d(f.width.val-c.w,p,m),x=b.biasDiff,C=b.biasComplementDiff,O=d(f.height.val-c.h,g,y),L=O.biasDiff,A=O.biasComplementDiff;s.autoPadding=v(c.w,c.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(c.w,f.width.val),h.x=(-x+c.x1+c.x2+C)/2,s.autoHeight=Math.max(c.h,f.height.val),h.y=(-L+c.y1+c.y2+A)/2}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||t)&&(r(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var er=function(e){return e===1/0||e===-1/0?0:e},sr=function(e,r,n,a,i){a-r===0||i-n===0||r==null||n==null||a==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},xn=function(e,r){return r==null?e:sr(e,r.x1,r.y1,r.x2,r.y2)},Ka=function(e,r,n){return ur(e,r,n)},Lo=function(e,r,n){if(!r.cy().headless()){var a=r._private,i=a.rstyle,o=i.arrowWidth/2,s=r.pstyle(n+"-arrow-shape").value,l,u;if(s!=="none"){n==="source"?(l=i.srcX,u=i.srcY):n==="target"?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var f=a.arrowBounds=a.arrowBounds||{},c=f[n]=f[n]||{};c.x1=l-o,c.y1=u-o,c.x2=l+o,c.y2=u+o,c.w=c.x2-c.x1,c.h=c.y2-c.y1,Mo(c,1),sr(e,c.x1,c.y1,c.x2,c.y2)}}},bu=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var i=r._private,o=i.rstyle,s=r.pstyle(a+"label").strValue;if(s){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),f=Ka(o,"labelWidth",n),c=Ka(o,"labelHeight",n),h=Ka(o,"labelX",n),d=Ka(o,"labelY",n),v=r.pstyle(a+"text-margin-x").pfValue,p=r.pstyle(a+"text-margin-y").pfValue,m=r.isEdge(),g=r.pstyle(a+"text-rotation"),y=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,x=b/2,C=r.pstyle("text-background-padding").pfValue,O=2,L=c,A=f,I=A/2,D=L/2,M,E,S,w;if(m)M=h-I,E=h+I,S=d-D,w=d+D;else{switch(l.value){case"left":M=h-A,E=h;break;case"center":M=h-I,E=h+I;break;case"right":M=h,E=h+A;break}switch(u.value){case"top":S=d-L,w=d;break;case"center":S=d-D,w=d+D;break;case"bottom":S=d,w=d+L;break}}var N=v-Math.max(y,x)-C-O,T=v+Math.max(y,x)+C+O,R=p-Math.max(y,x)-C-O,P=p+Math.max(y,x)+C+O;M+=N,E+=T,S+=R,w+=P;var k=n||"main",U=i.labelBounds,B=U[k]=U[k]||{};B.x1=M,B.y1=S,B.x2=E,B.y2=w,B.w=E-M,B.h=w-S,B.leftPad=N,B.rightPad=T,B.topPad=R,B.botPad=P;var V=m&&g.strValue==="autorotate",j=g.pfValue!=null&&g.pfValue!==0;if(V||j){var Y=V?Ka(i.rstyle,"labelAngle",n):g.pfValue,Z=Math.cos(Y),K=Math.sin(Y),G=(M+E)/2,$=(S+w)/2;if(!m){switch(l.value){case"left":G=E;break;case"right":G=M;break}switch(u.value){case"top":$=w;break;case"bottom":$=S;break}}var q=function(J,ie){return J=J-G,ie=ie-$,{x:J*Z-ie*K+G,y:J*K+ie*Z+$}},X=q(M,S),ee=q(M,w),ce=q(E,S),Ee=q(E,w);M=Math.min(X.x,ee.x,ce.x,Ee.x),E=Math.max(X.x,ee.x,ce.x,Ee.x),S=Math.min(X.y,ee.y,ce.y,Ee.y),w=Math.max(X.y,ee.y,ce.y,Ee.y)}var ne=k+"Rot",Q=U[ne]=U[ne]||{};Q.x1=M,Q.y1=S,Q.x2=E,Q.y2=w,Q.w=E-M,Q.h=w-S,sr(e,M,S,E,w),sr(i.labelBounds.all,M,S,E,w)}return e}},NI=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,a=r.pstyle("outline-width").value;if(n>0&&a>0){var i=r.pstyle("outline-offset").value,o=r.pstyle("shape").value,s=a+i,l=(e.w+s*2)/e.w,u=(e.h+s*2)/e.h,f=0,c=0;["diamond","pentagon","round-triangle"].includes(o)?(l=(e.w+s*2.4)/e.w,c=-s/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(o)?l=(e.w+s*2.4)/e.w:o==="star"?(l=(e.w+s*2.8)/e.w,u=(e.h+s*2.6)/e.h,c=-s/3.8):o==="triangle"?(l=(e.w+s*2.8)/e.w,u=(e.h+s*2.4)/e.h,c=-s/1.4):o==="vee"&&(l=(e.w+s*4.4)/e.w,u=(e.h+s*3.8)/e.h,c=-s*.5);var h=e.h*u-e.h,d=e.w*l-e.w;if(Ro(e,[Math.ceil(h/2),Math.ceil(d/2)]),f!=0||c!==0){var v=XL(e,f,c);sd(e,v)}}}},OI=function(e,r){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),o=Ht(),s=e._private,l=e.isNode(),u=e.isEdge(),f,c,h,d,v,p,m=s.rstyle,g=l&&a?e.pstyle("bounds-expansion").pfValue:[0],y=function(se){return se.pstyle("display").value!=="none"},b=!a||y(e)&&(!u||y(e.source())&&y(e.target()));if(b){var x=0,C=0;a&&r.includeOverlays&&(x=e.pstyle("overlay-opacity").value,x!==0&&(C=e.pstyle("overlay-padding").value));var O=0,L=0;a&&r.includeUnderlays&&(O=e.pstyle("underlay-opacity").value,O!==0&&(L=e.pstyle("underlay-padding").value));var A=Math.max(C,L),I=0,D=0;if(a&&(I=e.pstyle("width").pfValue,D=I/2),l&&r.includeNodes){var M=e.position();v=M.x,p=M.y;var E=e.outerWidth(),S=E/2,w=e.outerHeight(),N=w/2;f=v-S,c=v+S,h=p-N,d=p+N,sr(o,f,h,c,d),a&&r.includeOutlines&&NI(o,e)}else if(u&&r.includeEdges)if(a&&!i){var T=e.pstyle("curve-style").strValue;if(f=Math.min(m.srcX,m.midX,m.tgtX),c=Math.max(m.srcX,m.midX,m.tgtX),h=Math.min(m.srcY,m.midY,m.tgtY),d=Math.max(m.srcY,m.midY,m.tgtY),f-=D,c+=D,h-=D,d+=D,sr(o,f,h,c,d),T==="haystack"){var R=m.haystackPts;if(R&&R.length===2){if(f=R[0].x,h=R[0].y,c=R[1].x,d=R[1].y,f>c){var P=f;f=c,c=P}if(h>d){var k=h;h=d,d=k}sr(o,f-D,h-D,c+D,d+D)}}else if(T==="bezier"||T==="unbundled-bezier"||T.endsWith("segments")||T.endsWith("taxi")){var U;switch(T){case"bezier":case"unbundled-bezier":U=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":U=m.linePts;break}if(U!=null)for(var B=0;B<U.length;B++){var V=U[B];f=V.x-D,c=V.x+D,h=V.y-D,d=V.y+D,sr(o,f,h,c,d)}}}else{var j=e.source(),Y=j.position(),Z=e.target(),K=Z.position();if(f=Y.x,c=K.x,h=Y.y,d=K.y,f>c){var G=f;f=c,c=G}if(h>d){var $=h;h=d,d=$}f-=D,c+=D,h-=D,d+=D,sr(o,f,h,c,d)}if(a&&r.includeEdges&&u&&(Lo(o,e,"mid-source"),Lo(o,e,"mid-target"),Lo(o,e,"source"),Lo(o,e,"target")),a){var q=e.pstyle("ghost").value==="yes";if(q){var X=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;sr(o,o.x1+X,o.y1+ee,o.x2+X,o.y2+ee)}}var ce=s.bodyBounds=s.bodyBounds||{};Pc(ce,o),Ro(ce,g),Mo(ce,1),a&&(f=o.x1,c=o.x2,h=o.y1,d=o.y2,sr(o,f-A,h-A,c+A,d+A));var Ee=s.overlayBounds=s.overlayBounds||{};Pc(Ee,o),Ro(Ee,g),Mo(Ee,1);var ne=s.labelBounds=s.labelBounds||{};ne.all!=null?WL(ne.all):ne.all=Ht(),a&&r.includeLabels&&(r.includeMainLabels&&bu(o,e,null),u&&(r.includeSourceLabels&&bu(o,e,"source"),r.includeTargetLabels&&bu(o,e,"target")))}return o.x1=er(o.x1),o.y1=er(o.y1),o.x2=er(o.x2),o.y2=er(o.y2),o.w=er(o.x2-o.x1),o.h=er(o.y2-o.y1),o.w>0&&o.h>0&&b&&(Ro(o,g),Mo(o,1)),o},Pd=function(e){var r=0,n=function(o){return(o?1:0)<<r++},a=0;return a+=n(e.incudeNodes),a+=n(e.includeEdges),a+=n(e.includeLabels),a+=n(e.includeMainLabels),a+=n(e.includeSourceLabels),a+=n(e.includeTargetLabels),a+=n(e.includeOverlays),a+=n(e.includeOutlines),a},_d=function(e){if(e.isEdge()){var r=e.source().position(),n=e.target().position(),a=function(o){return Math.round(o)};return vL([a(r.x),a(r.y),a(n.x),a(n.y)])}else return 0},rh=function(e,r){var n=e._private,a,i=e.isEdge(),o=r==null?nh:Pd(r),s=o===nh,l=_d(e),u=n.bbCachePosKey===l,f=r.useCache&&u,c=function(p){return p._private.bbCache==null||p._private.styleDirty},h=!f||c(e)||i&&(c(e.source())||c(e.target()));if(h?(u||e.recalculateRenderedStyle(f),a=OI(e,di),n.bbCache=a,n.bbCachePosKey=l):a=n.bbCache,!s){var d=e.isNode();a=Ht(),(r.includeNodes&&d||r.includeEdges&&!d)&&(r.includeOverlays?xn(a,n.overlayBounds):xn(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?xn(a,n.labelBounds.all):(r.includeMainLabels&&xn(a,n.labelBounds.mainRot),r.includeSourceLabels&&xn(a,n.labelBounds.sourceRot),r.includeTargetLabels&&xn(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},di={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},nh=Pd(di),ah=Dt(di);an.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=di:t=ah(t),e=rh(this[0],t);else{e=Ht(),t=t||di;var r=ah(t),n=this,a=n.cy(),i=a.styleEnabled();if(i)for(var o=0;o<n.length;o++){var s=n[o],l=s._private,u=_d(s),f=l.bbCachePosKey===u,c=r.useCache&&f&&!l.styleDirty;s.recalculateRenderedStyle(c)}this.updateCompoundBounds(!t.useCache);for(var h=0;h<n.length;h++){var d=n[h];xn(e,rh(d,r))}}return e.x1=er(e.x1),e.y1=er(e.y1),e.x2=er(e.x2),e.y2=er(e.y2),e.w=er(e.x2-e.x1),e.h=er(e.y2-e.y1),e};an.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};an.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),a=r.collection();if(n&&(a=e.filter(function(u){return u.isParent()}),e=e.not(a)),Qe(t)){var i=t;t=function(){return i}}var o=function(f,c){return f._private.bbAtOldPos=t(f,c)},s=function(f){return f._private.bbAtOldPos};r.startBatch(),e.forEach(o).silentPositions(t),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var l=YL(this.boundingBox({useCache:!1}));return e.silentPositions(s),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),l};ca.boundingbox=ca.bb=ca.boundingBox;ca.renderedBoundingbox=ca.renderedBoundingBox;var AI=an,ti,Ei;ti=Ei={};var Fd=function(e){e.uppercaseName=Nc(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Nc(e.outerName),ti[e.name]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var s=n.pstyle(e.name);return s.strValue==="label"?(n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0):s.pfValue}else return 1},ti["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){var s=n[e.name](),l=n.pstyle("border-width").pfValue,u=2*n.padding();return s+l+u}else return 1},ti["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},ti["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};Fd({name:"width"});Fd({name:"height"});Ei.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};Ei.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};Ei.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var II=Ei,DI=function(e,r){if(e.isEdge())return r(e)},MI=function(e,r){if(e.isEdge()){var n=e.cy();return rs(r(e),n.zoom(),n.pan())}},RI=function(e,r){if(e.isEdge()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(o){return rs(o,i,a)})}},PI=function(e){return e.renderer().getControlPoints(e)},_I=function(e){return e.renderer().getSegmentPoints(e)},FI=function(e){return e.renderer().getSourceEndpoint(e)},BI=function(e){return e.renderer().getTargetEndpoint(e)},kI=function(e){return e.renderer().getEdgeMidpoint(e)},ih={controlPoints:{get:PI,mult:!0},segmentPoints:{get:_I,mult:!0},sourceEndpoint:{get:FI},targetEndpoint:{get:BI},midpoint:{get:kI}},qI=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},zI=Object.keys(ih).reduce(function(t,e){var r=ih[e],n=qI(e);return t[e]=function(){return DI(this,r.get)},r.mult?t[n]=function(){return RI(this,r.get)}:t[n]=function(){return MI(this,r.get)},t},{}),UI=_e({},LI,AI,II,zI);var Bd=function(e,r){this.recycle(e,r)};function ja(){return!1}function No(){return!0}Bd.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=ja,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?No:ja):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=No;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=No;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=No,this.stopPropagation()},isDefaultPrevented:ja,isPropagationStopped:ja,isImmediatePropagationStopped:ja};var kd=/^([^.]+)(\.(?:[^.]+))?$/,GI=".*",qd={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},oh=Object.keys(qd),VI={};function us(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VI,e=arguments.length>1?arguments[1]:void 0,r=0;r<oh.length;r++){var n=oh[r];this[n]=t[n]||qd[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var nn=us.prototype,zd=function(e,r,n,a,i,o,s){vt(a)&&(i=a,a=null),s&&(o==null?o=s:o=_e({},o,s));for(var l=ot(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var f=l[u];if(!Jr(f)){var c=f.match(kd);if(c){var h=c[1],d=c[2]?c[2]:null,v=r(e,f,h,d,a,i,o);if(v===!1)break}}}},sh=function(e,r){return e.addEventFields(e.context,r),new Bd(r.type,r)},HI=function(e,r,n){if(fS(n)){r(e,n);return}else if(Qe(n)){r(e,sh(e,n));return}for(var a=ot(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!Jr(o)){var s=o.match(kd);if(s){var l=s[1],u=s[2]?s[2]:null,f=sh(e,{type:l,namespace:u,target:e.context});r(e,f)}}}};nn.on=nn.addListener=function(t,e,r,n,a){return zd(this,function(i,o,s,l,u,f,c){vt(f)&&i.listeners.push({event:o,callback:f,type:s,namespace:l,qualifier:u,conf:c})},t,e,r,n,a),this};nn.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})};nn.removeListener=nn.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=bL(this.listeners));for(var i=this.listeners,o=function(u){var f=i[u];zd(a,function(c,h,d,v,p,m){if((f.type===d||t==="*")&&(!v&&f.namespace!==".*"||f.namespace===v)&&(!p||c.qualifierCompare(f.qualifier,p))&&(!m||f.callback===m))return i.splice(u,1),!1},t,e,r,n)},s=i.length-1;s>=0;s--)o(s);return this};nn.removeAllListeners=function(){return this.removeListener("*")};nn.emit=nn.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,ot(e)||(e=[e]),HI(this,function(i,o){r!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],a=n.length);for(var s=function(f){var c=n[f];if(c.type===o.type&&(!c.namespace||c.namespace===o.namespace||c.namespace===GI)&&i.eventMatches(i.context,c,o)){var h=[o];e!=null&&wL(h,e),i.beforeEmit(i.context,c,o),c.conf&&c.conf.one&&(i.listeners=i.listeners.filter(function(p){return p!==c}));var d=i.callbackContext(i.context,c,o),v=c.callback.apply(d,h);i.afterEmit(i.context,c,o),v===!1&&(o.stopPropagation(),o.preventDefault())}},l=0;l<a;l++)s(l);i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},t),this.emitting--,this};var $I={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&yi(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Oo=function(e){return Re(e)?new tn(e):e},Ud={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new us($I,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=Oo(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n)}return this},removeListener:function(e,r,n){for(var a=Oo(r),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var a=Oo(r),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,a,n)}return this},once:function(e,r,n){for(var a=Oo(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};rt.eventAliasesOn(Ud);var Gd={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):r.push(a)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(Re(e)||Yt(e))return new tn(e).filter(this);if(vt(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var o=a[i],s=r?e.apply(r,[o,i,a]):e(o,i,a);s&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){Re(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||r.push(a)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Re(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),a=this,i=e,o=this.length<e.length,s=o?a:i,l=o?i:a,u=0;u<s.length;u++){var f=s[u];l.has(f)&&n.push(f)}return n},xor:function(e){var r=this._private.cy;Re(e)&&(e=r.$(e));var n=this.spawn(),a=this,i=e,o=function(l,u){for(var f=0;f<l.length;f++){var c=l[f],h=c._private.data.id,d=u.hasElementWithId(h);d||n.push(c)}};return o(a,i),o(i,a),n},diff:function(e){var r=this._private.cy;Re(e)&&(e=r.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=this,s=e,l=function(f,c,h){for(var d=0;d<f.length;d++){var v=f[d],p=v._private.data.id,m=c.hasElementWithId(p);m?i.merge(v):h.push(v)}};return l(o,s,n),l(s,o,a),{left:n,right:a,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Re(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&a.push(o)}return a},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&Re(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=r.map,o=0;o<e.length;o++){var s=e[o],l=s._private.data.id,u=!i.has(l);if(u){var f=this.length++;this[f]=s,i.set(l,{ele:s,index:f})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,a=r.map,i=a.get(n);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Re(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],a=this,i=0;i<a.length;i++){var o=a[i],s=r?e.apply(r,[o,i,a]):e(o,i,a);n.push(s)}return n},reduce:function(e,r){for(var n=r,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,r){for(var n=-1/0,a,i=this,o=0;o<i.length;o++){var s=i[o],l=r?e.apply(r,[s,o,i]):e(s,o,i);l>n&&(n=l,a=s)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,i=this,o=0;o<i.length;o++){var s=i[o],l=r?e.apply(r,[s,o,i]):e(s,o,i);l<n&&(n=l,a=s)}return{value:n,ele:a}}},et=Gd;et.u=et["|"]=et["+"]=et.union=et.or=et.add;et["\\"]=et["!"]=et["-"]=et.difference=et.relativeComplement=et.subtract=et.not;et.n=et["&"]=et["."]=et.and=et.intersection=et.intersect;et["^"]=et["(+)"]=et["(-)"]=et.symmetricDifference=et.symdiff=et.xor;et.fnFilter=et.filterFn=et.stdFilter=et.filter;et.complement=et.abscomp=et.absoluteComplement;var YI={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Vd=function(e,r){var n=e.cy(),a=n.hasCompoundNodes();function i(f){var c=f.pstyle("z-compound-depth");return c.value==="auto"?a?f.zDepth():0:c.value==="bottom"?-1:c.value==="top"?$u:0}var o=i(e)-i(r);if(o!==0)return o;function s(f){var c=f.pstyle("z-index-compare");return c.value==="auto"&&f.isNode()?1:0}var l=s(e)-s(r);if(l!==0)return l;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},Wo={forEach:function(e,r){if(vt(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],o=r?e.apply(r,[i,a,this]):e(i,a,this);if(o===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],a=this.length;r==null&&(r=a),e==null&&(e=0),e<0&&(e=a+e),r<0&&(r=a+r);for(var i=e;i>=0&&i<r&&i<a;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!vt(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(Vd)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var a=r.data.parent?e.parents().size():0;return e.isParent()?a:$u-1}else{var i=r.source,o=r.target,s=i.zDepth(),l=o.zDepth();return Math.max(s,l,0)}}}};Wo.each=Wo.forEach;var WI=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":Tt(Symbol))!=e&&Tt(Symbol.iterator)!=e;r&&(Wo[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return qh({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};WI();var XI=Dt({nodeDimensionsIncludeLabels:!1}),_o={layoutDimensions:function(e){e=XI(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var a=this.nodes().filter(function(C){return!C.isParent()}),i=this.cy(),o=r.eles,s=function(O){return O.id()},l=ii(n,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(O,L,A){var I={x:L.x1+L.w/2,y:L.y1+L.h/2},D={x:(A.x-I.x)*O,y:(A.y-I.y)*O};return{x:I.x+D.x,y:I.y+D.y}},f=r.spacingFactor&&r.spacingFactor!==1,c=function(){if(!f)return null;for(var O=Ht(),L=0;L<a.length;L++){var A=a[L],I=l(A,L);KL(O,I.x,I.y)}return O},h=c(),d=ii(function(C,O){var L=l(C,O);if(f){var A=Math.abs(r.spacingFactor);L=u(A,h,L)}return r.transform!=null&&(L=r.transform(C,L)),L},s);if(r.animate){for(var v=0;v<a.length;v++){var p=a[v],m=d(p,v),g=r.animateFilter==null||r.animateFilter(p,v);if(g){var y=p.animation({position:m,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(y)}else p.position(m)}if(r.fit){var b=i.animation({fit:{boundingBox:o.boundingBoxAt(d),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else if(r.zoom!==void 0&&r.pan!==void 0){var x=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(x)}e.animations.forEach(function(C){return C.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),ya.all(e.animations.map(function(C){return C.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(d),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(_e({},e,{eles:this}))}};_o.createLayout=_o.makeLayout=_o.layout;function Hd(t,e,r){var n=r._private,a=n.styleCache=n.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(r)),i}function ls(t,e){return t=Nn(t),function(n){return Hd(t,e,n)}}function fs(t,e){t=Nn(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return Hd(t,r,a)}}var At={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),a=r.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(a){r(a),a.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var a=r.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return i??(r?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(Qe(e)){var o=e;i.applyBypass(this,o,a),this.emitAndNotify("style")}else if(Re(e))if(r===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,r,a),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?i.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];a.removeAllBypasses(s,n)}else{e=e.split(/\s+/);for(var l=0;l<i.length;l++){var u=i[l];a.removeBypasses(u,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!r)return i;var o=a.data.parent?n.parents():null;if(o)for(var s=0;s<o.length;s++){var l=o[s],u=l.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function Eu(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function nl(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],o=a.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||Eu(i,n);var l=s.source,u=s.target;return r(l)&&(!o||Eu(l,r))&&(l===u||r(u)&&(!o||Eu(u,r)))}}}var wa=ls("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});At.takesUpSpace=fs("takesUpSpace",nl({ok:wa}));var KI=ls("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&wa(t)}),jI=ls("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&wa(t)});At.interactive=fs("interactive",nl({ok:KI,parentOk:jI,edgeOkViaNode:wa}));At.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var ZI=ls("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&wa(t)}),QI=wa;At.visible=fs("visible",nl({ok:ZI,edgeOkViaNode:QI}));At.hidden=function(){var t=this[0];if(t)return!t.visible()};At.isBundledBezier=fs("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});At.bypass=At.css=At.style;At.renderedCss=At.renderedStyle;At.removeBypass=At.removeCss=At.removeStyle;At.pstyle=At.parsedStyle;var Qr={};function uh(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],a=e[1];this.on(t.event,n,a)}else if(e.length===1&&vt(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&ot(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var l=this[s],u=!t.ableField||l._private[t.ableField],f=l._private[t.field]!=t.value;if(t.overrideAble){var c=t.overrideAble(l);if(c!==void 0&&(u=c,!c))return this}u&&(l._private[t.field]=t.value,f&&r.push(l))}var h=this.spawn(r);h.updateStyle(),h.emit(t.event),o&&h.emit(o)}return this}}function xa(t){Qr[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},Qr[t.on]=uh({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Qr[t.off]=uh({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}xa({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});xa({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});xa({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});xa({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Qr.deselect=Qr.unselect;Qr.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};xa({field:"active",on:"activate",off:"unactivate"});xa({field:"pannable",on:"panify",off:"unpanify"});Qr.inactive=function(){var t=this[0];if(t)return!t._private.active};var _t={},lh=function(e){return function(n){for(var a=this,i=[],o=0;o<a.length;o++){var s=a[o];if(s.isNode()){for(var l=!1,u=s.connectedEdges(),f=0;f<u.length;f++){var c=u[f],h=c.source(),d=c.target();if(e.noIncomingEdges&&d===s&&h!==s||e.noOutgoingEdges&&h===s&&d!==s){l=!0;break}}l||i.push(s)}}return this.spawn(i,!0).filter(n)}},fh=function(e){return function(r){for(var n=this,a=[],i=0;i<n.length;i++){var o=n[i];if(o.isNode())for(var s=o.connectedEdges(),l=0;l<s.length;l++){var u=s[l],f=u.source(),c=u.target();e.outgoing&&f===o?(a.push(u),a.push(c)):e.incoming&&c===o&&(a.push(u),a.push(f))}}return this.spawn(a,!0).filter(r)}},ch=function(e){return function(r){for(var n=this,a=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var s=!1,l=0;l<o.length;l++){var u=o[l],f=u.id();i[f]||(i[f]=!0,a.push(u),s=!0)}if(!s)break;n=o}return this.spawn(a,!0).filter(r)}};_t.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};_e(_t,{roots:lh({noIncomingEdges:!0}),leaves:lh({noOutgoingEdges:!0}),outgoers:tr(fh({outgoing:!0}),"outgoers"),successors:ch({outgoing:!0}),incomers:tr(fh({incoming:!0}),"incomers"),predecessors:ch({incoming:!0})});_e(_t,{neighborhood:tr(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var a=r[n],i=a.connectedEdges(),o=0;o<i.length;o++){var s=i[o],l=s.source(),u=s.target(),f=a===l?u:l;f.length>0&&e.push(f[0]),e.push(s[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});_t.neighbourhood=_t.neighborhood;_t.closedNeighbourhood=_t.closedNeighborhood;_t.openNeighbourhood=_t.openNeighborhood;_e(_t,{source:tr(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:tr(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:hh({attr:"source"}),targets:hh({attr:"target"})});function hh(t){return function(r){for(var n=[],a=0;a<this.length;a++){var i=this[a],o=i._private[t.attr];o&&n.push(o)}return this.spawn(n,!0).filter(r)}}_e(_t,{edgesWith:tr(dh(),"edgesWith"),edgesTo:tr(dh({thisIsSrc:!0}),"edgesTo")});function dh(t){return function(r){var n=[],a=this._private.cy,i=t||{};Re(r)&&(r=a.$(r));for(var o=0;o<r.length;o++)for(var s=r[o]._private.edges,l=0;l<s.length;l++){var u=s[l],f=u._private.data,c=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),h=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),d=c||h;d&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!c||i.thisIsTgt&&!h)||n.push(u))}return this.spawn(n,!0)}}_e(_t,{connectedEdges:tr(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];if(a.isNode())for(var i=a._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:tr(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:tr(vh(),"parallelEdges"),codirectedEdges:tr(vh({codirected:!0}),"codirectedEdges")});function vh(t){var e={codirected:!1};return t=_e({},e,t),function(n){for(var a=[],i=this.edges(),o=t,s=0;s<i.length;s++)for(var l=i[s],u=l._private,f=u.source,c=f._private.data.id,h=u.data.target,d=f._private.edges,v=0;v<d.length;v++){var p=d[v],m=p._private.data,g=m.target,y=m.source,b=g===h&&y===c,x=c===g&&h===y;(o.codirected&&b||!o.codirected&&(b||x))&&a.push(p)}return this.spawn(a,!0).filter(n)}}_e(_t,{components:function(e){var r=this,n=r.cy(),a=n.collection(),i=e==null?r.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=function(f,c){a.merge(f),i.unmerge(f),c.merge(f)};if(i.empty())return r.spawn();var l=function(){var f=n.collection();o.push(f);var c=i[0];s(c,f),r.bfs({directed:!1,roots:c,visit:function(d){return s(d,f)}}),f.forEach(function(h){h.connectedEdges().forEach(function(d){r.has(d)&&f.has(d.source())&&f.has(d.target())&&f.merge(d)})})};do l();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});_t.componentsOf=_t.components;var It=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){pt("A collection must have a reference to the core");return}var i=new gr,o=!1;if(!r)r=[];else if(r.length>0&&Qe(r[0])&&!yi(r[0])){o=!0;for(var s=[],l=new ga,u=0,f=r.length;u<f;u++){var c=r[u];c.data==null&&(c.data={});var h=c.data;if(h.id==null)h.id=nd();else if(e.hasElementWithId(h.id)||l.has(h.id))continue;var d=new ts(e,c,!1);s.push(d),l.add(h.id)}r=s}this.length=0;for(var v=0,p=r.length;v<p;v++){var m=r[v][0];if(m!=null){var g=m._private.data.id;(!n||!i.has(g))&&(n&&i.set(g,{index:this.length,ele:m}),this[this.length]=m,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(y){this.lazyMap=y},rebuildMap:function(){for(var b=this.lazyMap=new gr,x=this.eles,C=0;C<x.length;C++){var O=x[C];b.set(O.id(),{index:C,ele:O})}}},n&&(this._private.map=i),o&&!a&&this.restore()},lt=ts.prototype=It.prototype=Object.create(Array.prototype);lt.instanceString=function(){return"collection"};lt.spawn=function(t,e){return new It(this.cy(),t,e)};lt.spawnSelf=function(){return this.spawn(this)};lt.cy=function(){return this._private.cy};lt.renderer=function(){return this._private.cy.renderer()};lt.element=function(){return this[0]};lt.collection=function(){return Vh(this)?this:new It(this._private.cy,[this])};lt.unique=function(){return new It(this._private.cy,this,!0)};lt.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};lt.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new It(e)};lt.$id=lt.getElementById;lt.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};lt.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};lt.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};lt.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(Qe(t)){if(r.startBatch(),t.data){e.data(t.data);var a=n.data;if(e.isEdge()){var i=!1,o={},s=t.data.source,l=t.data.target;s!=null&&s!=a.source&&(o.source=""+s,i=!0),l!=null&&l!=a.target&&(o.target=""+l,i=!0),i&&(e=e.move(o))}else{var u="parent"in t.data,f=t.data.parent;u&&(f!=null||a.parent!=null)&&f!=a.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}t.position&&e.position(t.position);var c=function(p,m,g){var y=t[p];y!=null&&y!==n[p]&&(y?e[m]():e[g]())};return c("removed","remove","restore"),c("selected","select","unselect"),c("selectable","selectify","unselectify"),c("locked","lock","unlock"),c("grabbable","grabify","ungrabify"),c("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var h={data:pr(n.data),position:pr(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};h.classes="";var d=0;return n.classes.forEach(function(v){return h.classes+=d++===0?v:" "+v}),h}}};lt.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t};lt.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),i=new ts(t,a,!1);e.push(i)}return new It(t,e)};lt.copy=lt.clone;lt.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),a=n._private,i=[],o=[],s,l=0,u=r.length;l<u;l++){var f=r[l];e&&!f.removed()||(f.isNode()?i.push(f):o.push(f))}s=i.concat(o);var c,h=function(){s.splice(c,1),c--};for(c=0;c<s.length;c++){var d=s[c],v=d._private,p=v.data;if(d.clearTraversalCache(),!(!e&&!v.removed)){if(p.id===void 0)p.id=nd();else if(we(p.id))p.id=""+p.id;else if(Jr(p.id)||!Re(p.id)){pt("Can not create element with invalid string ID `"+p.id+"`"),h();continue}else if(n.hasElementWithId(p.id)){pt("Can not create second element with ID `"+p.id+"`"),h();continue}}var m=p.id;if(d.isNode()){var g=v.position;g.x==null&&(g.x=0),g.y==null&&(g.y=0)}if(d.isEdge()){for(var y=d,b=["source","target"],x=b.length,C=!1,O=0;O<x;O++){var L=b[O],A=p[L];we(A)&&(A=p[L]=""+p[L]),A==null||A===""?(pt("Can not create edge `"+m+"` with unspecified "+L),C=!0):n.hasElementWithId(A)||(pt("Can not create edge `"+m+"` with nonexistant "+L+" `"+A+"`"),C=!0)}if(C){h();continue}var I=n.getElementById(p.source),D=n.getElementById(p.target);I.same(D)?I._private.edges.push(y):(I._private.edges.push(y),D._private.edges.push(y)),y._private.source=I,y._private.target=D}v.map=new gr,v.map.set(m,{ele:d,index:0}),v.removed=!1,e&&n.addToPool(d)}for(var M=0;M<i.length;M++){var E=i[M],S=E._private.data;we(S.parent)&&(S.parent=""+S.parent);var w=S.parent,N=w!=null;if(N||E._private.parent){var T=E._private.parent?n.collection().merge(E._private.parent):n.getElementById(w);if(T.empty())S.parent=void 0;else if(T[0].removed())nt("Node added with missing parent, reference to parent removed"),S.parent=void 0,E._private.parent=null;else{for(var R=!1,P=T;!P.empty();){if(E.same(P)){R=!0,S.parent=void 0;break}P=P.parent()}R||(T[0]._private.children.push(E),E._private.parent=T[0],a.hasCompoundNodes=!0)}}}if(s.length>0){for(var k=s.length===r.length?r:new It(n,s),U=0;U<k.length;U++){var B=k[U];B.isNode()||(B.parallelEdges().clearTraversalCache(),B.source().clearTraversalCache(),B.target().clearTraversalCache())}var V;a.hasCompoundNodes?V=n.collection().merge(k).merge(k.connectedNodes()).merge(k.parent()):V=k,V.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?k.emitAndNotify("add"):e&&k.emit("add")}return r};lt.removed=function(){var t=this[0];return t&&t._private.removed};lt.inside=function(){var t=this[0];return t&&!t._private.removed};lt.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],a={},i=r._private.cy;function o(w){for(var N=w._private.edges,T=0;T<N.length;T++)l(N[T])}function s(w){for(var N=w._private.children,T=0;T<N.length;T++)l(N[T])}function l(w){var N=a[w.id()];e&&w.removed()||N||(a[w.id()]=!0,w.isNode()?(n.push(w),o(w),s(w)):n.unshift(w))}for(var u=0,f=r.length;u<f;u++){var c=r[u];l(c)}function h(w,N){var T=w._private.edges;en(T,N),w.clearTraversalCache()}function d(w){w.clearTraversalCache()}var v=[];v.ids={};function p(w,N){N=N[0],w=w[0];var T=w._private.children,R=w.id();en(T,N),N._private.parent=null,v.ids[R]||(v.ids[R]=!0,v.push(w))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var m=0;m<n.length;m++){var g=n[m];if(g.isEdge()){var y=g.source()[0],b=g.target()[0];h(y,g),h(b,g);for(var x=g.parallelEdges(),C=0;C<x.length;C++){var O=x[C];d(O),O.isBundledBezier()&&O.dirtyBoundingBoxCache()}}else{var L=g.parent();L.length!==0&&p(L,g)}e&&(g._private.removed=!0)}var A=i._private.elements;i._private.hasCompoundNodes=!1;for(var I=0;I<A.length;I++){var D=A[I];if(D.isParent()){i._private.hasCompoundNodes=!0;break}}var M=new It(this.cy(),n);M.size()>0&&(t?M.emitAndNotify("remove"):e&&M.emit("remove"));for(var E=0;E<v.length;E++){var S=v[E];(!e||!S.removed())&&S.updateStyle()}return M};lt.move=function(t){var e=this._private.cy,r=this,n=!1,a=!1,i=function(v){return v==null?v:""+v};if(t.source!==void 0||t.target!==void 0){var o=i(t.source),s=i(t.target),l=o!=null&&e.hasElementWithId(o),u=s!=null&&e.hasElementWithId(s);(l||u)&&(e.batch(function(){r.remove(n,a),r.emitAndNotify("moveout");for(var d=0;d<r.length;d++){var v=r[d],p=v._private.data;v.isEdge()&&(l&&(p.source=o),u&&(p.target=s))}r.restore(n,a)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var f=i(t.parent),c=f===null||e.hasElementWithId(f);if(c){var h=f===null?void 0:f;e.batch(function(){var d=r.remove(n,a);d.emitAndNotify("moveout");for(var v=0;v<r.length;v++){var p=r[v],m=p._private.data;p.isNode()&&(m.parent=h)}d.restore(n,a)}),r.emitAndNotify("move")}}return this};[gd,lI,Po,Zr,pa,SI,ss,UI,Ud,Gd,YI,Wo,_o,At,Qr,_t].forEach(function(t){_e(lt,t)});var JI={add:function(e){var r,n=this;if(Yt(e)){var a=e;if(a._private.cy===n)r=a.restore();else{for(var i=[],o=0;o<a.length;o++){var s=a[o];i.push(s.json())}r=new It(n,i)}}else if(ot(e)){var l=e;r=new It(n,l)}else if(Qe(e)&&(ot(e.nodes)||ot(e.edges))){for(var u=e,f=[],c=["nodes","edges"],h=0,d=c.length;h<d;h++){var v=c[h],p=u[v];if(ot(p))for(var m=0,g=p.length;m<g;m++){var y=_e({group:v},p[m]);f.push(y)}}r=new It(n,f)}else{var b=e;r=new ts(n,b).collection()}return r},remove:function(e){if(!Yt(e)){if(Re(e)){var r=e;e=this.$(r)}}return e.remove()}};function eD(t,e,r,n){var a=4,i=.001,o=1e-7,s=10,l=11,u=1/(l-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var c=0;c<4;++c)if(typeof arguments[c]!="number"||isNaN(arguments[c])||!isFinite(arguments[c]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var h=f?new Float32Array(l):new Array(l);function d(D,M){return 1-3*M+3*D}function v(D,M){return 3*M-6*D}function p(D){return 3*D}function m(D,M,E){return((d(M,E)*D+v(M,E))*D+p(M))*D}function g(D,M,E){return 3*d(M,E)*D*D+2*v(M,E)*D+p(M)}function y(D,M){for(var E=0;E<a;++E){var S=g(M,t,r);if(S===0)return M;var w=m(M,t,r)-D;M-=w/S}return M}function b(){for(var D=0;D<l;++D)h[D]=m(D*u,t,r)}function x(D,M,E){var S,w,N=0;do w=M+(E-M)/2,S=m(w,t,r)-D,S>0?E=w:M=w;while(Math.abs(S)>o&&++N<s);return w}function C(D){for(var M=0,E=1,S=l-1;E!==S&&h[E]<=D;++E)M+=u;--E;var w=(D-h[E])/(h[E+1]-h[E]),N=M+w*u,T=g(N,t,r);return T>=i?y(D,N):T===0?N:x(D,M,M+u)}var O=!1;function L(){O=!0,(t!==e||r!==n)&&b()}var A=function(M){return O||L(),t===e&&r===n?M:M===0?0:M===1?1:m(C(M),e,n)};A.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var I="generateBezier("+[t,e,r,n]+")";return A.toString=function(){return I},A}var tD=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var o={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:o.v,dv:t(o)}}function r(n,a){var i={dx:n.v,dv:t(n)},o=e(n,a*.5,i),s=e(n,a*.5,o),l=e(n,a,s),u=1/6*(i.dx+2*(o.dx+s.dx)+l.dx),f=1/6*(i.dv+2*(o.dv+s.dv)+l.dv);return n.x=n.x+u*a,n.v=n.v+f*a,n}return function n(a,i,o){var s={x:-1,v:0,tension:null,friction:null},l=[0],u=0,f=1/1e4,c=16/1e3,h,d,v;for(a=parseFloat(a)||500,i=parseFloat(i)||20,o=o||null,s.tension=a,s.friction=i,h=o!==null,h?(u=n(a,i),d=u/o*c):d=c;v=r(v||s,d),l.push(1+v.x),u+=16,Math.abs(v.x)>f&&Math.abs(v.v)>f;);return h?function(p){return l[p*(l.length-1)|0]}:u}})(),ut=function(e,r,n,a){var i=eD(e,r,n,a);return function(o,s,l){return o+(s-o)*i(l)}},Fo={linear:function(e,r,n){return e+(r-e)*n},ease:ut(.25,.1,.25,1),"ease-in":ut(.42,0,1,1),"ease-out":ut(0,0,.58,1),"ease-in-out":ut(.42,0,.58,1),"ease-in-sine":ut(.47,0,.745,.715),"ease-out-sine":ut(.39,.575,.565,1),"ease-in-out-sine":ut(.445,.05,.55,.95),"ease-in-quad":ut(.55,.085,.68,.53),"ease-out-quad":ut(.25,.46,.45,.94),"ease-in-out-quad":ut(.455,.03,.515,.955),"ease-in-cubic":ut(.55,.055,.675,.19),"ease-out-cubic":ut(.215,.61,.355,1),"ease-in-out-cubic":ut(.645,.045,.355,1),"ease-in-quart":ut(.895,.03,.685,.22),"ease-out-quart":ut(.165,.84,.44,1),"ease-in-out-quart":ut(.77,0,.175,1),"ease-in-quint":ut(.755,.05,.855,.06),"ease-out-quint":ut(.23,1,.32,1),"ease-in-out-quint":ut(.86,0,.07,1),"ease-in-expo":ut(.95,.05,.795,.035),"ease-out-expo":ut(.19,1,.22,1),"ease-in-out-expo":ut(1,0,0,1),"ease-in-circ":ut(.6,.04,.98,.335),"ease-out-circ":ut(.075,.82,.165,1),"ease-in-out-circ":ut(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return Fo.linear;var a=tD(e,r,n);return function(i,o,s){return i+(o-i)*a(s)}},"cubic-bezier":ut};function ph(t,e,r,n,a){if(n===1||e===r)return r;var i=a(e,r,n);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function gh(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function ra(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var o=gh(t,a),s=gh(e,a);if(we(o)&&we(s))return ph(i,o,s,r,n);if(ot(o)&&ot(s)){for(var l=[],u=0;u<s.length;u++){var f=o[u],c=s[u];if(f!=null&&c!=null){var h=ph(i,f,c,r,n);l.push(h)}else l.push(c)}return l}}function rD(t,e,r,n){var a=!n,i=t._private,o=e._private,s=o.easing,l=o.startTime,u=n?t:t.cy(),f=u.style();if(!o.easingImpl)if(s==null)o.easingImpl=Fo.linear;else{var c;if(Re(s)){var h=f.parse("transition-timing-function",s);c=h.value}else c=s;var d,v;Re(c)?(d=c,v=[]):(d=c[1],v=c.slice(2).map(function(k){return+k})),v.length>0?(d==="spring"&&v.push(o.duration),o.easingImpl=Fo[d].apply(null,v)):o.easingImpl=Fo[d]}var p=o.easingImpl,m;if(o.duration===0?m=1:m=(r-l)/o.duration,o.applying&&(m=o.progress),m<0?m=0:m>1&&(m=1),o.delay==null){var g=o.startPosition,y=o.position;if(y&&a&&!t.locked()){var b={};Za(g.x,y.x)&&(b.x=ra(g.x,y.x,m,p)),Za(g.y,y.y)&&(b.y=ra(g.y,y.y,m,p)),t.position(b)}var x=o.startPan,C=o.pan,O=i.pan,L=C!=null&&n;L&&(Za(x.x,C.x)&&(O.x=ra(x.x,C.x,m,p)),Za(x.y,C.y)&&(O.y=ra(x.y,C.y,m,p)),t.emit("pan"));var A=o.startZoom,I=o.zoom,D=I!=null&&n;D&&(Za(A,I)&&(i.zoom=li(i.minZoom,ra(A,I,m,p),i.maxZoom)),t.emit("zoom")),(L||D)&&t.emit("viewport");var M=o.style;if(M&&M.length>0&&a){for(var E=0;E<M.length;E++){var S=M[E],w=S.name,N=S,T=o.startStyle[w],R=f.properties[T.name],P=ra(T,N,m,p,R);f.overrideBypass(t,w,P)}t.emit("style")}}return o.progress=m,m}function Za(t,e){return t==null||e==null?!1:we(t)&&we(e)?!0:!!(t&&e)}function nD(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function yh(t,e){var r=e._private.aniEles,n=[];function a(f,c){var h=f._private,d=h.animation.current,v=h.animation.queue,p=!1;if(d.length===0){var m=v.shift();m&&d.push(m)}for(var g=function(O){for(var L=O.length-1;L>=0;L--){var A=O[L];A()}O.splice(0,O.length)},y=d.length-1;y>=0;y--){var b=d[y],x=b._private;if(x.stopped){d.splice(y,1),x.hooked=!1,x.playing=!1,x.started=!1,g(x.frames);continue}!x.playing&&!x.applying||(x.playing&&x.applying&&(x.applying=!1),x.started||nD(f,b,t),rD(f,b,t,c),x.applying&&(x.applying=!1),g(x.frames),x.step!=null&&x.step(t),b.completed()&&(d.splice(y,1),x.hooked=!1,x.playing=!1,x.started=!1,g(x.completes)),p=!0)}return!c&&d.length===0&&v.length===0&&n.push(f),p}for(var i=!1,o=0;o<r.length;o++){var s=r[o],l=a(s);i=i||l}var u=a(e,!0);(i||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var aD={animate:rt.animate(),animation:rt.animation(),animated:rt.animated(),clearQueue:rt.clearQueue(),delay:rt.delay(),delayAnimation:rt.delayAnimation(),stop:rt.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Go(function(i){yh(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){yh(o,e)},n.beforeRenderPriorities.animations):r()}},iD={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&yi(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},Ao=function(e){return Re(e)?new tn(e):e},$d={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new us(iD,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Ao(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Ao(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Ao(r),n),this},once:function(e,r,n){return this.emitter().one(e,Ao(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};rt.eventAliasesOn($d);var Du={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};Du.jpeg=Du.jpg;var Bo={layout:function(e){var r=this;if(e==null){pt("Layout options must be specified to make a layout");return}if(e.name==null){pt("A `name` must be specified to make a layout");return}var n=e.name,a=r.extension("layout",n);if(a==null){pt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Re(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var o=new a(_e({},e,{cy:r,eles:i}));return o}};Bo.createLayout=Bo.makeLayout=Bo.layout;var oD={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&a.merge(r);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?r.notify(n):r.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],o=e[i],s=r.getElementById(i);s.data(o)}})}},sD=Dt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Mu={renderTo:function(e,r,n,a){var i=this._private.renderer;return i.renderTo(e,r,n,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,n=r.extension("renderer",e.name);if(n==null){pt("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&nt("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var a=sD(e);a.cy=r,r._private.renderer=new n(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Mu.invalidateDimensions=Mu.resize;var ko={collection:function(e,r){return Re(e)?this.$(e):Yt(e)?e.collection():ot(e)?(r||(r={}),new It(this,e,r.unique,r.removed)):new It(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};ko.elements=ko.filter=ko.$;var Bt={},ni="t",uD="f";Bt.apply=function(t){for(var e=this,r=e._private,n=r.cy,a=n.collection(),i=0;i<t.length;i++){var o=t[i],s=e.getContextMeta(o);if(!s.empty){var l=e.getContextStyle(s),u=e.applyContextStyle(s,l,o);o._private.appliedInitStyle?e.updateTransitions(o,u.diffProps):o._private.appliedInitStyle=!0;var f=e.updateStyleHints(o);f&&a.push(o)}}return a};Bt.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},a=t+"-"+e,i=n[a];if(i)return i;for(var o=[],s={},l=0;l<r.length;l++){var u=r[l],f=t[l]===ni,c=e[l]===ni,h=f!==c,d=u.mappedProperties.length>0;if(h||c&&d){var v=void 0;h&&d||h?v=u.properties:d&&(v=u.mappedProperties);for(var p=0;p<v.length;p++){for(var m=v[p],g=m.name,y=!1,b=l+1;b<r.length;b++){var x=r[b],C=e[b]===ni;if(C&&(y=x.properties[m.name]!=null,y))break}!s[g]&&!y&&(s[g]=!0,o.push(g))}}}return n[a]=o,o};Bt.getContextMeta=function(t){for(var e=this,r="",n,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(t);s?r+=ni:r+=uD}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}};Bt.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<r.length;i++){var o=r[i],s=e[i]===ni;if(s)for(var l=0;l<o.properties.length;l++){var u=o.properties[l];a[u.name]=u}}return n[e]=a,a};Bt.applyContextStyle=function(t,e,r){for(var n=this,a=t.diffPropNames,i={},o=n.types,s=0;s<a.length;s++){var l=a[s],u=e[l],f=r.pstyle(l);if(!u)if(f)f.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(f!==u){if(u.mapped===o.fn&&f!=null&&f.mapping!=null&&f.mapping.value===u.value){var c=f.mapping,h=c.fnValue=u.value(r);if(h===c.prevFnValue)continue}var d=i[l]={prev:f};n.applyParsedProperty(r,u),d.next=r.pstyle(l),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:i}};Bt.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,a=r.propertyGroupKeys,i=function(ee,ce,Ee){return r.getPropertiesHash(ee,ce,Ee)},o=e.styleKey;if(t.removed())return!1;var s=e.group==="nodes",l=t._private.style;n=Object.keys(l);for(var u=0;u<a.length;u++){var f=a[u];e.styleKeys[f]=[ia,Ja]}for(var c=function(ee,ce){return e.styleKeys[ce][0]=oi(ee,e.styleKeys[ce][0])},h=function(ee,ce){return e.styleKeys[ce][1]=si(ee,e.styleKeys[ce][1])},d=function(ee,ce){c(ee,ce),h(ee,ce)},v=function(ee,ce){for(var Ee=0;Ee<ee.length;Ee++){var ne=ee.charCodeAt(Ee);c(ne,ce),h(ne,ce)}},p=2e9,m=function(ee){return-128<ee&&ee<128&&Math.floor(ee)!==ee?p-(ee*1024|0):ee},g=0;g<n.length;g++){var y=n[g],b=l[y];if(b!=null){var x=this.properties[y],C=x.type,O=x.groupKey,L=void 0;x.hashOverride!=null?L=x.hashOverride(t,b):b.pfValue!=null&&(L=b.pfValue);var A=x.enums==null?b.value:null,I=L!=null,D=A!=null,M=I||D,E=b.units;if(C.number&&M&&!C.multiple){var S=I?L:A;d(m(S),O),!I&&E!=null&&v(E,O)}else v(b.strValue,O)}}for(var w=[ia,Ja],N=0;N<a.length;N++){var T=a[N],R=e.styleKeys[T];w[0]=oi(R[0],w[0]),w[1]=si(R[1],w[1])}e.styleKey=dL(w[0],w[1]);var P=e.styleKeys;e.labelDimsKey=Wr(P.labelDimensions);var k=i(t,["label"],P.labelDimensions);if(e.labelKey=Wr(k),e.labelStyleKey=Wr(Eo(P.commonLabel,k)),!s){var U=i(t,["source-label"],P.labelDimensions);e.sourceLabelKey=Wr(U),e.sourceLabelStyleKey=Wr(Eo(P.commonLabel,U));var B=i(t,["target-label"],P.labelDimensions);e.targetLabelKey=Wr(B),e.targetLabelStyleKey=Wr(Eo(P.commonLabel,B))}if(s){var V=e.styleKeys,j=V.nodeBody,Y=V.nodeBorder,Z=V.nodeOutline,K=V.backgroundImage,G=V.compound,$=V.pie,q=[j,Y,Z,K,G,$].filter(function(X){return X!=null}).reduce(Eo,[ia,Ja]);e.nodeKey=Wr(q),e.hasPie=$!=null&&$[0]!==ia&&$[1]!==Ja}return o!==e.styleKey};Bt.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null};Bt.applyParsedProperty=function(t,e){var r=this,n=e,a=t._private.style,i,o=r.types,s=r.properties[n.name].type,l=n.bypass,u=a[n.name],f=u&&u.bypass,c=t._private,h="mapping",d=function(j){return j==null?null:j.pfValue!=null?j.pfValue:j.value},v=function(){var j=d(u),Y=d(n);r.checkTriggers(t,n.name,j,Y)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return a[n.name]=void 0,v(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,v(),!0):!1:(v(),!0);if(n.deleteBypass)return u?u.bypass?(a[n.name]=u.bypassed,v(),!0):!1:(v(),!0);var p=function(){nt("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case o.mapData:{for(var m=n.field.split("."),g=c.data,y=0;y<m.length&&g;y++){var b=m[y];g=g[b]}if(g==null)return p(),!1;var x;if(we(g)){var C=n.fieldMax-n.fieldMin;C===0?x=0:x=(g-n.fieldMin)/C}else return nt("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+g+"` for `"+t.id()+"` is non-numeric)"),!1;if(x<0?x=0:x>1&&(x=1),s.color){var O=n.valueMin[0],L=n.valueMax[0],A=n.valueMin[1],I=n.valueMax[1],D=n.valueMin[2],M=n.valueMax[2],E=n.valueMin[3]==null?1:n.valueMin[3],S=n.valueMax[3]==null?1:n.valueMax[3],w=[Math.round(O+(L-O)*x),Math.round(A+(I-A)*x),Math.round(D+(M-D)*x),Math.round(E+(S-E)*x)];i={bypass:n.bypass,name:n.name,value:w,strValue:"rgb("+w[0]+", "+w[1]+", "+w[2]+")"}}else if(s.number){var N=n.valueMin+(n.valueMax-n.valueMin)*x;i=this.parse(n.name,N,n.bypass,h)}else return!1;if(!i)return p(),!1;i.mapping=n,n=i;break}case o.data:{for(var T=n.field.split("."),R=c.data,P=0;P<T.length&&R;P++){var k=T[P];R=R[k]}if(R!=null&&(i=this.parse(n.name,R,n.bypass,h)),!i)return p(),!1;i.mapping=n,n=i;break}case o.fn:{var U=n.value,B=n.fnValue!=null?n.fnValue:U(t);if(n.prevFnValue=B,B==null)return nt("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(n.name,B,n.bypass,h),!i)return nt("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=pr(n),n=i;break}case void 0:break;default:return!1}return l?(f?n.bypassed=u.bypassed:n.bypassed=u,a[n.name]=n):f?u.bypassed=n:a[n.name]=n,v(),!0};Bt.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],l=a[s];l!=null&&(l.bypass?l.bypassed=null:a[s]=null)}}};Bt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};Bt.updateTransitions=function(t,e){var r=this,n=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,o=t.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var s={},l=!1,u=0;u<a.length;u++){var f=a[u],c=t.pstyle(f),h=e[f];if(h){var d=h.prev,v=d,p=h.next!=null?h.next:c,m=!1,g=void 0,y=1e-6;v&&(we(v.pfValue)&&we(p.pfValue)?(m=p.pfValue-v.pfValue,g=v.pfValue+y*m):we(v.value)&&we(p.value)?(m=p.value-v.value,g=v.value+y*m):ot(v.value)&&ot(p.value)&&(m=v.value[0]!==p.value[0]||v.value[1]!==p.value[1]||v.value[2]!==p.value[2],g=v.strValue),m&&(s[f]=p.strValue,this.applyBypass(t,f,g),l=!0))}}if(!l)return;n.transitioning=!0,new ya(function(b){o>0?t.delayAnimation(o).play().promise().then(b):b()}).then(function(){return t.animation({style:s,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1)};Bt.checkTrigger=function(t,e,r,n,a,i){var o=this.properties[e],s=a(o);s!=null&&s(r,n)&&i(o)};Bt.checkZOrderTrigger=function(t,e,r,n){var a=this;this.checkTrigger(t,e,r,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})};Bt.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(r==="bezier"||n==="bezier")&&t.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||n==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};Bt.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var wi={};wi.applyBypass=function(t,e,r,n){var a=this,i=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var s=0;s<a.properties.length;s++){var l=a.properties[s],u=l.name,f=this.parse(u,r,!0);f&&i.push(f)}}else if(Re(e)){var c=this.parse(e,r,!0);c&&i.push(c)}else if(Qe(e)){var h=e;n=r;for(var d=Object.keys(h),v=0;v<d.length;v++){var p=d[v],m=h[p];if(m===void 0&&(m=h[Qo(p)]),m!==void 0){var g=this.parse(p,m,!0);g&&i.push(g)}}}else return!1;if(i.length===0)return!1;for(var y=!1,b=0;b<t.length;b++){for(var x=t[b],C={},O=void 0,L=0;L<i.length;L++){var A=i[L];if(n){var I=x.pstyle(A.name);O=C[A.name]={prev:I}}y=this.applyParsedProperty(x,pr(A))||y,n&&(O.next=x.pstyle(A.name))}y&&this.updateStyleHints(x),n&&this.updateTransitions(x,C,o)}return y};wi.overrideBypass=function(t,e,r){e=Hu(e);for(var n=0;n<t.length;n++){var a=t[n],i=a._private.style[e],o=this.properties[e].type,s=o.color,l=o.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),s?i.strValue="rgb("+r.join(",")+")":l?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(a)),this.checkTriggers(a,e,u,r)}};wi.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};wi.removeBypasses=function(t,e,r){for(var n=!0,a=0;a<t.length;a++){for(var i=t[a],o={},s=0;s<e.length;s++){var l=e[s],u=this.properties[l],f=i.pstyle(u.name);if(!(!f||!f.bypass)){var c="",h=this.parse(l,c,!0),d=o[u.name]={prev:f};this.applyParsedProperty(i,h),d.next=i.pstyle(u.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,o,n)}};var al={};al.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};al.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};var yr={};yr.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};yr.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},a=0;a<r.properties.length;a++){var i=r.properties[a],o=r.getStylePropertyValue(t,i.name,e);o!=null&&(n[i.name]=o,n[Qo(i.name)]=o)}return n}};yr.getIndexedStyle=function(t,e,r,n){var a=t.pstyle(e)[r][n];return a??t.cy().style().getDefaultProperty(e)[r][0]};yr.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,o=t.pstyle(a.name);if(o){var s=o.value,l=o.units,u=o.strValue;if(r&&i.number&&s!=null&&we(s)){var f=t.cy().zoom(),c=function(m){return m*f},h=function(m,g){return c(m)+g},d=ot(s),v=d?l.every(function(p){return p!=null}):l!=null;return v?d?s.map(function(p,m){return h(p,l[m])}).join(" "):h(s,l):d?s.map(function(p){return Re(p)?p:""+c(p)}).join(" "):""+c(s)}else if(u!=null)return u}return null}};yr.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=a.name,o=t.pstyle(i);o!==void 0&&(Qe(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(r[i]=o)}return r};yr.getPropsList=function(t){var e=this,r=[],n=t,a=e.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],l=n[s],u=a[s]||a[Hu(s)],f=this.parse(u.name,l);f&&r.push(f)}return r};yr.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),a,i,o,s,l,u;for(l=0;l<e.length;l++)if(a=e[l],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=oi(s,n[0]),n[1]=si(s,n[1]);else for(o=i.strValue,u=0;u<o.length;u++)s=o.charCodeAt(u),n[0]=oi(s,n[0]),n[1]=si(s,n[1]);return n};yr.getPropertiesHash=yr.getNonDefaultPropertiesHash;var cs={};cs.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],a=n.selector,i=n.style||n.css,o=Object.keys(i);e.selector(a);for(var s=0;s<o.length;s++){var l=o[s],u=i[l];e.css(l,u)}}return e};cs.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};cs.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,a=r.properties,i={},o=0;o<a.length;o++){var s=a[o];i[s.name]=s.strValue}t.push({selector:n?n.toString():"core",style:i})}return t};var il={};il.appendFromString=function(t){var e=this,r=this,n=""+t,a,i,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){n.length>a.length?n=n.substr(a.length):n=""}function l(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var f=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){nt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=f[0];var c=f[1];if(c!=="core"){var h=new tn(c);if(h.invalid){nt("Skipping parsing of block: Invalid selector found in string stylesheet: "+c),s();continue}}var d=f[2],v=!1;i=d;for(var p=[];;){var m=i.match(/^\s*$/);if(m)break;var g=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){nt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+d),v=!0;break}o=g[0];var y=g[1],b=g[2],x=e.properties[y];if(!x){nt("Skipping property: Invalid property name in: "+o),l();continue}var C=r.parse(y,b);if(!C){nt("Skipping property: Invalid property definition in: "+o),l();continue}p.push({name:y,val:b}),l()}if(v){s();break}r.selector(c);for(var O=0;O<p.length;O++){var L=p[O];r.css(L.name,L.val)}s()}return r};il.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Ot={};(function(){var t=xt,e=gS,r=mS,n=bS,a=ES,i=function(q){return"^"+q+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(q){var X=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+a;return"^"+q+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+X+")\\s*\\,\\s*("+X+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Ot.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(q,X){switch(q.length){case 2:return X[0]!=="deg"&&X[0]!=="rad"&&X[1]!=="deg"&&X[1]!=="rad";case 1:return Re(q[0])||X[0]==="deg"||X[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(q){var X=q.length;return X===1||X===2||X===4}}};var l={zeroNonZero:function(q,X){return(q==null||X==null)&&q!==X||q==0&&X!=0?!0:q!=0&&X==0},any:function(q,X){return q!=X},emptyNonEmpty:function(q,X){var ee=Jr(q),ce=Jr(X);return ee&&!ce||!ee&&ce}},u=Ot.types,f=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],c=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],h=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],d=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],v=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification}],p=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any}],m=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],g=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],y=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],b=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],x=function(q,X){return X.value==="label"?-q.poolIndex():X.pfValue},C=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:x},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:x},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],O=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],L=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],A=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],I=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],D=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],M=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],E=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],S=[];Ot.pieBackgroundN=16,S.push({name:"pie-size",type:u.sizeMaybePercent});for(var w=1;w<=Ot.pieBackgroundN;w++)S.push({name:"pie-"+w+"-background-color",type:u.color}),S.push({name:"pie-"+w+"-background-size",type:u.percent}),S.push({name:"pie-"+w+"-background-opacity",type:u.zeroOneNumber});var N=[],T=Ot.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function($){T.forEach(function(q){var X=q+"-"+$.name,ee=$.type,ce=$.triggersBounds;N.push({name:X,type:ee,triggersBounds:ce})})},{});var R=Ot.properties=[].concat(p,b,m,g,y,M,v,d,f,c,h,C,O,L,A,S,I,D,N,E),P=Ot.propertyGroups={behavior:p,transition:b,visibility:m,overlay:g,underlay:y,ghost:M,commonLabel:v,labelDimensions:d,mainLabel:f,sourceLabel:c,targetLabel:h,nodeBody:C,nodeBorder:O,nodeOutline:L,backgroundImage:A,pie:S,compound:I,edgeLine:D,edgeArrow:N,core:E},k=Ot.propertyGroupNames={},U=Ot.propertyGroupKeys=Object.keys(P);U.forEach(function($){k[$]=P[$].map(function(q){return q.name}),P[$].forEach(function(q){return q.groupKey=$})});var B=Ot.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Ot.propertyNames=R.map(function($){return $.name});for(var V=0;V<R.length;V++){var j=R[V];R[j.name]=j}for(var Y=0;Y<B.length;Y++){var Z=B[Y],K=R[Z.pointsTo],G={name:Z.name,alias:!0,pointsTo:K};R.push(G),R[Z.name]=G}})();Ot.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};Ot.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=_e({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var f=1;f<=Ot.pieBackgroundN;f++){var c=u.name.replace("{{i}}",f),h=u.value;l[c]=h}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return Ot.arrowPrefixes.forEach(function(f){var c=f+"-"+u.name,h=u.value;l[c]=h}),l},{})),r={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=e[i],s=this.parse(i,o);r[i]=s}}return t.defaultProperties=r,t.defaultProperties};Ot.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var hs={};hs.parse=function(t,e,r,n){var a=this;if(vt(e))return a.parseImplWarn(t,e,r,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=r?"t":"f",s=""+e,l=ed(t,s,o,i),u=a.propCache=a.propCache||[],f;return(f=u[l])||(f=u[l]=a.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(f=pr(f),f&&(f.value=pr(f.value))),f};hs.parseImplWarn=function(t,e,r,n){var a=this.parseImpl(t,e,r,n);return!a&&e!=null&&nt("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&nt("The style value of `label` is deprecated for `"+a.name+"`"),a};hs.parseImpl=function(t,e,r,n){var a=this;t=Hu(t);var i=a.properties[t],o=e,s=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var l=Re(e);l&&(e=e.trim());var u=i.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(vt(e))return{name:t,value:e,strValue:"fn",mapped:s.fn,bypass:r};var f,c;if(!(!l||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(s.data.regex).exec(e))){if(r)return!1;var h=s.data;return{name:t,value:f,strValue:""+e,mapped:h,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(c=new RegExp(s.mapData.regex).exec(e))){if(r||u.multiple)return!1;var d=s.mapData;if(!(u.color||u.number))return!1;var v=this.parse(t,c[4]);if(!v||v.mapped)return!1;var p=this.parse(t,c[5]);if(!p||p.mapped)return!1;if(v.pfValue===p.pfValue||v.strValue===p.strValue)return nt("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+v.strValue+"`"),this.parse(t,v.strValue);if(u.color){var m=v.value,g=p.value,y=m[0]===g[0]&&m[1]===g[1]&&m[2]===g[2]&&(m[3]===g[3]||(m[3]==null||m[3]===1)&&(g[3]==null||g[3]===1));if(y)return!1}return{name:t,value:c,strValue:""+e,mapped:d,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:v.value,valueMax:p.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):ot(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var x=[],C=[],O=[],L="",A=!1,I=0;I<b.length;I++){var D=a.parse(t,b[I],r,"multiple");A=A||Re(D.value),x.push(D.value),O.push(D.pfValue!=null?D.pfValue:D.value),C.push(D.units),L+=(I>0?" ":"")+D.strValue}return u.validate&&!u.validate(x,C)?null:u.singleEnum&&A?x.length===1&&Re(x[0])?{name:t,value:x[0],strValue:x[0],bypass:r}:null:{name:t,value:x,pfValue:O,strValue:L,bypass:r,units:C}}var M=function(){for(var q=0;q<u.enums.length;q++){var X=u.enums[q];if(X===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var E,S="px";if(u.units&&(E=u.units),u.implicitUnits&&(S=u.implicitUnits),!u.unitless)if(l){var w="px|em"+(u.allowPercent?"|\\%":"");E&&(w=E);var N=e.match("^("+xt+")("+w+")?$");N&&(e=N[1],E=N[2]||S)}else(!E||u.implicitUnits)&&(E=S);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=o,M();if(u.integer&&!lS(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var T={name:t,value:e,strValue:""+e+(E||""),units:E,bypass:r};return u.unitless||E!=="px"&&E!=="em"?T.pfValue=e:T.pfValue=E==="px"||!E?e:this.getEmSizeInPixels()*e,(E==="ms"||E==="s")&&(T.pfValue=E==="ms"?e:1e3*e),(E==="deg"||E==="rad")&&(T.pfValue=E==="rad"?e:VL(e)),E==="%"&&(T.pfValue=e/100),T}else if(u.propList){var R=[],P=""+e;if(P!=="none"){for(var k=P.split(/\s*,\s*|\s+/),U=0;U<k.length;U++){var B=k[U].trim();a.properties[B]?R.push(B):nt("`"+B+"` is not a valid property name")}if(R.length===0)return null}return{name:t,value:R,strValue:R.length===0?"none":R.join(" "),bypass:r}}else if(u.color){var V=LS(e);return V?{name:t,value:V,pfValue:V,strValue:"rgb("+V[0]+","+V[1]+","+V[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var j=M();if(j)return j}for(var Y=u.regexes?u.regexes:[u.regex],Z=0;Z<Y.length;Z++){var K=new RegExp(Y[Z]),G=K.exec(e);if(G)return{name:t,value:u.singleRegexMatchValue?G[1]:G,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?M():null};var Pt=function t(e){if(!(this instanceof t))return new t(e);if(!Vu(e)){pt("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Ft=Pt.prototype;Ft.instanceString=function(){return"style"};Ft.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};Ft.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Ft.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};Ft.selector=function(t){var e=t==="core"?null:new tn(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};Ft.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var a=t.properties[n],i=r[a.name];i===void 0&&(i=r[Qo(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};Ft.style=Ft.css;Ft.cssRule=function(t,e){var r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[n].mappedProperties.push(r);var a=!this[n].selector;a&&(this._private.coreStyle[r.name]=r)}return this};Ft.append=function(t){return Hh(t)?t.appendToStyle(this):ot(t)?this.appendFromJson(t):Re(t)&&this.appendFromString(t),this};Pt.fromJson=function(t,e){var r=new Pt(t);return r.fromJson(e),r};Pt.fromString=function(t,e){return new Pt(t).fromString(e)};[Bt,wi,al,yr,cs,il,Ot,hs].forEach(function(t){_e(Ft,t)});Pt.types=Ft.types;Pt.properties=Ft.properties;Pt.propertyGroups=Ft.propertyGroups;Pt.propertyGroupNames=Ft.propertyGroupNames;Pt.propertyGroupKeys=Ft.propertyGroupKeys;var lD={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return Hh(e)?r.style=e.generateStyle(this):ot(e)?r.style=Pt.fromJson(this,e):Re(e)?r.style=Pt.fromString(this,e):r.style=Pt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},fD="single",Dn={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=fD),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,n,a,i,o,s;switch(e.length){case 0:return r;case 1:if(Re(e[0]))return n=e[0],r[n];if(Qe(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,we(o)&&(r.x=o),we(s)&&(r.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&we(a)&&(r[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,a=this._private.pan,i,o,s,l,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Qe(e)&&(s=n[0],l=s.x,u=s.y,we(l)&&(a.x+=l),we(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&we(o)&&(a[i]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var a=this._private;a.zoom=n.zoom,a.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(we(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Re(e)){var a=e;e=this.$(a)}else if(hS(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Yt(e)||(e=this.mutableElements());if(!(Yt(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),s=this.height(),l;if(r=we(r)?r:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((o-2*r)/n.w,(s-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(o-l*(n.x1+n.x2))/2,y:(s-l*(n.y1+n.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var a=e;e=a.min,r=a.max}return we(e)&&we(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):we(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:we(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,a=r.zoom,i,o,s=!1;if(r.zoomingEnabled||(s=!0),we(e)?o=e:Qe(e)&&(o=e.level,e.position!=null?i=rs(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(s=!0)),o=o>r.maxZoom?r.maxZoom:o,o=o<r.minZoom?r.minZoom:o,s||!we(o)||o===a||i!=null&&(!we(i.x)||!we(i.y)))return null;if(i!=null){var l=n,u=a,f=o,c={x:-f/u*(i.x-l.x)+i.x,y:-f/u*(i.y-l.y)+i.y};return{zoomed:!0,panned:!0,zoom:f,pan:c}}else return{zoomed:!0,panned:!1,zoom:o,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,a=!0,i=[],o=!1,s=!1;if(!e)return this;if(we(e.zoom)||(n=!1),Qe(e.pan)||(a=!1),!n&&!a)return this;if(n){var l=e.zoom;l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=l,i.push("zoom"))}if(a&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;we(u.x)&&(r.pan.x=u.x,s=!1),we(u.y)&&(r.pan.y=u.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Re(e)){var n=e;e=this.mutableElements().filter(n)}else Yt(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var s={x:(i-r*(a.x1+a.x2))/2,y:(o-r*(a.y1+a.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var a=n.window().getComputedStyle(r),i=function(s){return parseFloat(a.getPropertyValue(s))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Dn.centre=Dn.center;Dn.autolockNodes=Dn.autolock;Dn.autoungrabifyNodes=Dn.autoungrabify;var vi={data:rt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:rt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:rt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:rt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};vi.attr=vi.data;vi.removeAttr=vi.removeData;var pi=function(e){var r=this;e=_e({},e);var n=e.container;n&&!Uo(n)&&Uo(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=r;var o=wt!==void 0&&n!==void 0&&!e.headless,s=e;s.layout=_e({name:o?"grid":"null"},s.layout),s.renderer=_e({name:o?"canvas":"null"},s.renderer);var l=function(v,p,m){return p!==void 0?p:m!==void 0?m:v},u=this._private={container:n,ready:!1,options:s,elements:new It(this),listeners:[],aniEles:new It(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:we(s.zoom)?s.zoom:1,pan:{x:Qe(s.pan)&&we(s.pan.x)?s.pan.x:0,y:Qe(s.pan)&&we(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var f=function(v,p){var m=v.some(dS);if(m)return ya.all(v).then(p);p(v)};u.styleEnabled&&r.setStyle([]);var c=_e({},s,s.renderer);r.initRenderer(c);var h=function(v,p,m){r.notifications(!1);var g=r.mutableElements();g.length>0&&g.remove(),v!=null&&(Qe(v)||ot(v))&&r.add(v),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",p),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",m),r.emit("done")});var y=_e({},r._private.options.layout);y.eles=r.elements(),r.layout(y).run()};f([s.style,s.elements],function(d){var v=d[0],p=d[1];u.styleEnabled&&r.style().append(v),h(p,function(){r.startAnimationLoop(),u.ready=!0,vt(s.ready)&&r.on("ready",s.ready);for(var m=0;m<i.length;m++){var g=i[m];r.on("ready",g)}a&&(a.readies=[]),r.emit("ready")},s.done)})},Xo=pi.prototype;_e(Xo,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return wt;var r=this._private.container.ownerDocument;return r===void 0||r==null?wt:r.defaultView||wt},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!Uo(e)&&Uo(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(_e({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),r.startAnimationLoop(),r.style(a.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return pr(this._private.options)},json:function(e){var r=this,n=r._private,a=r.mutableElements(),i=function(x){return r.getElementById(x.id())};if(Qe(e)){if(r.startBatch(),e.elements){var o={},s=function(x,C){for(var O=[],L=[],A=0;A<x.length;A++){var I=x[A];if(!I.data.id){nt("cy.json() cannot handle elements without an ID attribute");continue}var D=""+I.data.id,M=r.getElementById(D);o[D]=!0,M.length!==0?L.push({ele:M,json:I}):(C&&(I.group=C),O.push(I))}r.add(O);for(var E=0;E<L.length;E++){var S=L[E],w=S.ele,N=S.json;w.json(N)}};if(ot(e.elements))s(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var f=l[u],c=e.elements[f];ot(c)&&s(c,f)}var h=r.collection();a.filter(function(b){return!o[b.id()]}).forEach(function(b){b.isParent()?h.merge(b):b.remove()}),h.forEach(function(b){return b.children().move({parent:null})}),h.forEach(function(b){return i(b).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],v=0;v<d.length;v++){var p=d[v];e[p]!=null&&r[p](e[p])}return r.endBatch(),this}else{var m=!!e,g={};m?g.elements=this.elements().map(function(b){return b.json()}):(g.elements={},a.forEach(function(b){var x=b.group();g.elements[x]||(g.elements[x]=[]),g.elements[x].push(b.json())})),this._private.styleEnabled&&(g.style=r.style().json()),g.data=pr(r.data());var y=n.options;return g.zoomingEnabled=n.zoomingEnabled,g.userZoomingEnabled=n.userZoomingEnabled,g.zoom=n.zoom,g.minZoom=n.minZoom,g.maxZoom=n.maxZoom,g.panningEnabled=n.panningEnabled,g.userPanningEnabled=n.userPanningEnabled,g.pan=pr(n.pan),g.boxSelectionEnabled=n.boxSelectionEnabled,g.renderer=pr(y.renderer),g.hideEdgesOnViewport=y.hideEdgesOnViewport,g.textureOnViewport=y.textureOnViewport,g.wheelSensitivity=y.wheelSensitivity,g.motionBlur=y.motionBlur,g.multiClickDebounceTime=y.multiClickDebounceTime,g}}});Xo.$id=Xo.getElementById;[JI,aD,$d,Du,Bo,oD,Mu,ko,lD,Dn,vi].forEach(function(t){_e(Xo,t)});var cD={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},hD={maximal:!1,acyclic:!1},na=function(e){return e.scratch("breadthfirst")},mh=function(e,r){return e.scratch("breadthfirst",r)};function Yd(t){this.options=_e({},cD,hD,t)}Yd.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().filter(function(ne){return!ne.isParent()}),i=n,o=e.directed,s=e.acyclic||e.maximal||e.maximalAdjustments>0,l=Ht(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u;if(Yt(e.roots))u=e.roots;else if(ot(e.roots)){for(var f=[],c=0;c<e.roots.length;c++){var h=e.roots[c],d=r.getElementById(h);f.push(d)}u=r.collection(f)}else if(Re(e.roots))u=r.$(e.roots);else if(o)u=a.roots();else{var v=n.components();u=r.collection();for(var p=function(Q){var se=v[Q],J=se.maxDegree(!1),ie=se.filter(function(ve){return ve.degree(!1)===J});u=u.add(ie)},m=0;m<v.length;m++)p(m)}var g=[],y={},b=function(Q,se){g[se]==null&&(g[se]=[]);var J=g[se].length;g[se].push(Q),mh(Q,{index:J,depth:se})},x=function(Q,se){var J=na(Q),ie=J.depth,ve=J.index;g[ie][ve]=null,b(Q,se)};i.bfs({roots:u,directed:e.directed,visit:function(Q,se,J,ie,ve){var Se=Q[0],Ce=Se.id();b(Se,ve),y[Ce]=!0}});for(var C=[],O=0;O<a.length;O++){var L=a[O];y[L.id()]||C.push(L)}var A=function(Q){for(var se=g[Q],J=0;J<se.length;J++){var ie=se[J];if(ie==null){se.splice(J,1),J--;continue}mh(ie,{depth:Q,index:J})}},I=function(){for(var Q=0;Q<g.length;Q++)A(Q)},D=function(Q,se){for(var J=na(Q),ie=Q.incomers().filter(function(Pe){return Pe.isNode()&&n.has(Pe)}),ve=-1,Se=Q.id(),Ce=0;Ce<ie.length;Ce++){var xe=ie[Ce],De=na(xe);ve=Math.max(ve,De.depth)}if(J.depth<=ve){if(!e.acyclic&&se[Se])return null;var Le=ve+1;return x(Q,Le),se[Se]=Le,!0}return!1};if(o&&s){var M=[],E={},S=function(Q){return M.push(Q)},w=function(){return M.shift()};for(a.forEach(function(ne){return M.push(ne)});M.length>0;){var N=w(),T=D(N,E);if(T)N.outgoers().filter(function(ne){return ne.isNode()&&n.has(ne)}).forEach(S);else if(T===null){nt("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}I();var R=0;if(e.avoidOverlap)for(var P=0;P<a.length;P++){var k=a[P],U=k.layoutDimensions(e),B=U.w,V=U.h;R=Math.max(R,B,V)}var j={},Y=function(Q){if(j[Q.id()])return j[Q.id()];for(var se=na(Q).depth,J=Q.neighborhood(),ie=0,ve=0,Se=0;Se<J.length;Se++){var Ce=J[Se];if(!(Ce.isEdge()||Ce.isParent()||!a.has(Ce))){var xe=na(Ce);if(xe!=null){var De=xe.index,Le=xe.depth;if(!(De==null||Le==null)){var Pe=g[Le].length;Le<se&&(ie+=De/Pe,ve++)}}}}return ve=Math.max(1,ve),ie=ie/ve,ve===0&&(ie=0),j[Q.id()]=ie,ie},Z=function(Q,se){var J=Y(Q),ie=Y(se),ve=J-ie;return ve===0?Yh(Q.id(),se.id()):ve};e.depthSort!==void 0&&(Z=e.depthSort);for(var K=0;K<g.length;K++)g[K].sort(Z),A(K);for(var G=[],$=0;$<C.length;$++)G.push(C[$]);g.unshift(G),I();for(var q=0,X=0;X<g.length;X++)q=Math.max(g[X].length,q);var ee={x:l.x1+l.w/2,y:l.x1+l.h/2},ce=g.reduce(function(ne,Q){return Math.max(ne,Q.length)},0),Ee=function(Q){var se=na(Q),J=se.depth,ie=se.index,ve=g[J].length,Se=Math.max(l.w/((e.grid?ce:ve)+1),R),Ce=Math.max(l.h/(g.length+1),R),xe=Math.min(l.w/2/g.length,l.h/2/g.length);if(xe=Math.max(xe,R),e.circle){var Le=xe*J+xe-(g.length>0&&g[0].length<=3?xe/2:0),Pe=2*Math.PI/g[J].length*ie;return J===0&&g[0].length===1&&(Le=1),{x:ee.x+Le*Math.cos(Pe),y:ee.y+Le*Math.sin(Pe)}}else{var De={x:ee.x+(ie+1-(ve+1)/2)*Se,y:(J+1)*Ce};return De}};return n.nodes().layoutPositions(this,e,Ee),this};var dD={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Wd(t){this.options=_e({},dD,t)}Wd.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=Ht(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),f,c=0,h=0;h<i.length;h++){var d=i[h],v=d.layoutDimensions(e),p=v.w,m=v.h;c=Math.max(c,p,m)}if(we(e.radius)?f=e.radius:i.length<=1?f=0:f=Math.min(o.h,o.w)/2-c,i.length>1&&e.avoidOverlap){c*=1.75;var g=Math.cos(u)-Math.cos(0),y=Math.sin(u)-Math.sin(0),b=Math.sqrt(c*c/(g*g+y*y));f=Math.max(b,f)}var x=function(O,L){var A=e.startAngle+L*u*(a?1:-1),I=f*Math.cos(A),D=f*Math.sin(A),M={x:s.x+I,y:s.y+D};return M};return n.nodes().layoutPositions(this,e,x),this};var vD={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Xd(t){this.options=_e({},vD,t)}Xd.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,a=e.eles,i=a.nodes().not(":parent"),o=Ht(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=[],u=0,f=0;f<i.length;f++){var c=i[f],h=void 0;h=e.concentric(c),l.push({value:h,node:c}),c._private.scratch.concentric=h}i.updateStyle();for(var d=0;d<i.length;d++){var v=i[d],p=v.layoutDimensions(e);u=Math.max(u,p.w,p.h)}l.sort(function(ne,Q){return Q.value-ne.value});for(var m=e.levelWidth(i),g=[[]],y=g[0],b=0;b<l.length;b++){var x=l[b];if(y.length>0){var C=Math.abs(y[0].value-x.value);C>=m&&(y=[],g.push(y))}y.push(x)}var O=u+e.minNodeSpacing;if(!e.avoidOverlap){var L=g.length>0&&g[0].length>1,A=Math.min(o.w,o.h)/2-O,I=A/(g.length+L?1:0);O=Math.min(O,I)}for(var D=0,M=0;M<g.length;M++){var E=g[M],S=e.sweep===void 0?2*Math.PI-2*Math.PI/E.length:e.sweep,w=E.dTheta=S/Math.max(1,E.length-1);if(E.length>1&&e.avoidOverlap){var N=Math.cos(w)-Math.cos(0),T=Math.sin(w)-Math.sin(0),R=Math.sqrt(O*O/(N*N+T*T));D=Math.max(R,D)}E.r=D,D+=O}if(e.equidistant){for(var P=0,k=0,U=0;U<g.length;U++){var B=g[U],V=B.r-k;P=Math.max(P,V)}k=0;for(var j=0;j<g.length;j++){var Y=g[j];j===0&&(k=Y.r),Y.r=k,k+=P}}for(var Z={},K=0;K<g.length;K++)for(var G=g[K],$=G.dTheta,q=G.r,X=0;X<G.length;X++){var ee=G[X],ce=e.startAngle+(r?1:-1)*$*X,Ee={x:s.x+q*Math.cos(ce),y:s.y+q*Math.sin(ce)};Z[ee.node.id()]=Ee}return a.nodes().layoutPositions(this,e,function(ne){var Q=ne.id();return Z[Q]}),this};var wu,pD={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function ds(t){this.options=_e({},pD,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(a){var i=a.source().data("id"),o=a.target().data("id"),s=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===o});return!s||!l});this.options.eles=this.options.eles.not(n)}ds.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?wu=!0:wu=!1;var n=gD(e,r,t);wu&&bD(n),t.randomize&&ED(n);var a=Ir(),i=function(){wD(n,e,t),t.fit===!0&&e.fit(t.padding)},o=function(h){return!(r.stopped||h>=t.numIter||(xD(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},s=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var h=t.eles.nodes(),d=Kd(n,t,h);h.layoutPositions(r,t,d)}},l=0,u=!0;if(t.animate===!0){var f=function c(){for(var h=0;u&&h<t.refresh;)u=o(l),l++,h++;if(!u)Eh(n,t),s();else{var d=Ir();d-a>=t.animationThreshold&&i(),Go(c)}};f()}else{for(;u;)u=o(l),l++;Eh(n,t),s()}return this};ds.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};ds.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var gD=function(e,r,n){for(var a=n.eles.edges(),i=n.eles.nodes(),o=Ht(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},l=n.eles.components(),u={},f=0;f<l.length;f++)for(var c=l[f],h=0;h<c.length;h++){var d=c[h];u[d.id()]=f}for(var f=0;f<s.nodeSize;f++){var v=i[f],p=v.layoutDimensions(n),m={};m.isLocked=v.locked(),m.id=v.data("id"),m.parentId=v.data("parent"),m.cmptId=u[v.id()],m.children=[],m.positionX=v.position("x"),m.positionY=v.position("y"),m.offsetX=0,m.offsetY=0,m.height=p.w,m.width=p.h,m.maxX=m.positionX+m.width/2,m.minX=m.positionX-m.width/2,m.maxY=m.positionY+m.height/2,m.minY=m.positionY-m.height/2,m.padLeft=parseFloat(v.style("padding")),m.padRight=parseFloat(v.style("padding")),m.padTop=parseFloat(v.style("padding")),m.padBottom=parseFloat(v.style("padding")),m.nodeRepulsion=vt(n.nodeRepulsion)?n.nodeRepulsion(v):n.nodeRepulsion,s.layoutNodes.push(m),s.idToIndex[m.id]=f}for(var g=[],y=0,b=-1,x=[],f=0;f<s.nodeSize;f++){var v=s.layoutNodes[f],C=v.parentId;C!=null?s.layoutNodes[s.idToIndex[C]].children.push(v.id):(g[++b]=v.id,x.push(v.id))}for(s.graphSet.push(x);y<=b;){var O=g[y++],L=s.idToIndex[O],d=s.layoutNodes[L],A=d.children;if(A.length>0){s.graphSet.push(A);for(var f=0;f<A.length;f++)g[++b]=A[f]}}for(var f=0;f<s.graphSet.length;f++)for(var I=s.graphSet[f],h=0;h<I.length;h++){var D=s.idToIndex[I[h]];s.indexToGraph[D]=f}for(var f=0;f<s.edgeSize;f++){var M=a[f],E={};E.id=M.data("id"),E.sourceId=M.data("source"),E.targetId=M.data("target");var S=vt(n.idealEdgeLength)?n.idealEdgeLength(M):n.idealEdgeLength,w=vt(n.edgeElasticity)?n.edgeElasticity(M):n.edgeElasticity,N=s.idToIndex[E.sourceId],T=s.idToIndex[E.targetId],R=s.indexToGraph[N],P=s.indexToGraph[T];if(R!=P){for(var k=yD(E.sourceId,E.targetId,s),U=s.graphSet[k],B=0,m=s.layoutNodes[N];U.indexOf(m.id)===-1;)m=s.layoutNodes[s.idToIndex[m.parentId]],B++;for(m=s.layoutNodes[T];U.indexOf(m.id)===-1;)m=s.layoutNodes[s.idToIndex[m.parentId]],B++;S*=B*n.nestingFactor}E.idealLength=S,E.elasticity=w,s.layoutEdges.push(E)}return s},yD=function(e,r,n){var a=mD(e,r,0,n);return 2>a.count?0:a.graph},mD=function t(e,r,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:n};for(var o=0,s=0;s<i.length;s++){var l=i[s],u=a.idToIndex[l],f=a.layoutNodes[u].children;if(f.length!==0){var c=a.indexToGraph[a.idToIndex[f[0]]],h=t(e,r,c,a);if(h.count!==0)if(h.count===1){if(o++,o===2)break}else return h}}return{count:o,graph:n}},bD,ED=function(e,r){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*n,o.positionY=Math.random()*a)}},Kd=function(e,r,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.forEach(function(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var l=e.layoutNodes[e.idToIndex[o.data("id")]];if(r.boundingBox){var u=(l.positionX-i.x1)/i.w,f=(l.positionY-i.y1)/i.h;return{x:a.x1+u*a.w,y:a.y1+f*a.h}}else return{x:l.positionX,y:l.positionY}}},wD=function(e,r,n){var a=n.layout,i=n.eles.nodes(),o=Kd(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},xD=function(e,r,n){TD(e,r),LD(e),ND(e,r),OD(e),AD(e)},TD=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[a[o]]],l=o+1;l<i;l++){var u=e.layoutNodes[e.idToIndex[a[l]]];CD(s,u,e,r)}},bh=function(e){return-e+2*e*Math.random()},CD=function(e,r,n,a){var i=e.cmptId,o=r.cmptId;if(!(i!==o&&!n.isCompound)){var s=r.positionX-e.positionX,l=r.positionY-e.positionY,u=1;s===0&&l===0&&(s=bh(u),l=bh(u));var f=SD(e,r,s,l);if(f>0)var c=a.nodeOverlap*f,h=Math.sqrt(s*s+l*l),d=c*s/h,v=c*l/h;else var p=Ko(e,s,l),m=Ko(r,-1*s,-1*l),g=m.x-p.x,y=m.y-p.y,b=g*g+y*y,h=Math.sqrt(b),c=(e.nodeRepulsion+r.nodeRepulsion)/b,d=c*g/h,v=c*y/h;e.isLocked||(e.offsetX-=d,e.offsetY-=v),r.isLocked||(r.offsetX+=d,r.offsetY+=v)}},SD=function(e,r,n,a){if(n>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(a>0)var o=e.maxY-r.minY;else var o=r.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ko=function(e,r,n){var a=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,l=n/r,u=o/s,f={};return r===0&&0<n||r===0&&0>n?(f.x=a,f.y=i+o/2,f):0<r&&-1*u<=l&&l<=u?(f.x=a+s/2,f.y=i+s*n/2/r,f):0>r&&-1*u<=l&&l<=u?(f.x=a-s/2,f.y=i-s*n/2/r,f):0<n&&(l<=-1*u||l>=u)?(f.x=a+o*r/2/n,f.y=i+o/2,f):(0>n&&(l<=-1*u||l>=u)&&(f.x=a-o*r/2/n,f.y=i-o/2),f)},LD=function(e,r){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],o=e.layoutNodes[i],s=e.idToIndex[a.targetId],l=e.layoutNodes[s],u=l.positionX-o.positionX,f=l.positionY-o.positionY;if(!(u===0&&f===0)){var c=Ko(o,u,f),h=Ko(l,-1*u,-1*f),d=h.x-c.x,v=h.y-c.y,p=Math.sqrt(d*d+v*v),m=Math.pow(a.idealLength-p,2)/a.elasticity;if(p!==0)var g=m*d/p,y=m*v/p;else var g=0,y=0;o.isLocked||(o.offsetX+=g,o.offsetY+=y),l.isLocked||(l.offsetX-=g,l.offsetY-=y)}}},ND=function(e,r){if(r.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],o=i.length;if(a===0)var s=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[u.parentId]],s=f.positionX,l=f.positionY;for(var c=0;c<o;c++){var h=e.layoutNodes[e.idToIndex[i[c]]];if(!h.isLocked){var d=s-h.positionX,v=l-h.positionY,p=Math.sqrt(d*d+v*v);if(p>n){var m=r.gravity*d/p,g=r.gravity*v/p;h.offsetX+=m,h.offsetY+=g}}}}},OD=function(e,r){var n=[],a=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var o=n[a++],s=e.idToIndex[o],l=e.layoutNodes[s],u=l.children;if(0<u.length&&!l.isLocked){for(var f=l.offsetX,c=l.offsetY,h=0;h<u.length;h++){var d=e.layoutNodes[e.idToIndex[u[h]]];d.offsetX+=f,d.offsetY+=c,n[++i]=u[h]}l.offsetX=0,l.offsetY=0}}},AD=function(e,r){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=ID(a.offsetX,a.offsetY,e.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,DD(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},ID=function(e,r,n){var a=Math.sqrt(e*e+r*r);if(a>n)var i={x:n*e/a,y:n*r/a};else var i={x:e,y:r};return i},DD=function t(e,r){var n=e.parentId;if(n!=null){var a=r.layoutNodes[r.idToIndex[n]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return t(a,r)}},Eh=function(e,r){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var o=n[i],s=o.cmptId,l=a[s]=a[s]||[];l.push(o)}for(var u=0,i=0;i<a.length;i++){var f=a[i];if(f){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var c=0;c<f.length;c++){var h=f[c];f.x1=Math.min(f.x1,h.positionX-h.width/2),f.x2=Math.max(f.x2,h.positionX+h.width/2),f.y1=Math.min(f.y1,h.positionY-h.height/2),f.y2=Math.max(f.y2,h.positionY+h.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,u+=f.w*f.h}}a.sort(function(y,b){return b.w*b.h-y.w*y.h});for(var d=0,v=0,p=0,m=0,g=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var f=a[i];if(f){for(var c=0;c<f.length;c++){var h=f[c];h.isLocked||(h.positionX+=d-f.x1,h.positionY+=v-f.y1)}d+=f.w+r.componentSpacing,p+=f.w+r.componentSpacing,m=Math.max(m,f.h),p>g&&(v+=m+r.componentSpacing,d=0,p=0,m=0)}}},MD={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function jd(t){this.options=_e({},MD,t)}jd.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=Ht(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)n.nodes().layoutPositions(this,e,function(j){return{x:i.x1,y:i.y1}});else{var o=a.size(),s=Math.sqrt(o*i.h/i.w),l=Math.round(s),u=Math.round(i.w/i.h*s),f=function(Y){if(Y==null)return Math.min(l,u);var Z=Math.min(l,u);Z==l?l=Y:u=Y},c=function(Y){if(Y==null)return Math.max(l,u);var Z=Math.max(l,u);Z==l?l=Y:u=Y},h=e.rows,d=e.cols!=null?e.cols:e.columns;if(h!=null&&d!=null)l=h,u=d;else if(h!=null&&d==null)l=h,u=Math.ceil(o/l);else if(h==null&&d!=null)u=d,l=Math.ceil(o/u);else if(u*l>o){var v=f(),p=c();(v-1)*p>=o?f(v-1):(p-1)*v>=o&&c(p-1)}else for(;u*l<o;){var m=f(),g=c();(g+1)*m>=o?c(g+1):f(m+1)}var y=i.w/u,b=i.h/l;if(e.condense&&(y=0,b=0),e.avoidOverlap)for(var x=0;x<a.length;x++){var C=a[x],O=C._private.position;(O.x==null||O.y==null)&&(O.x=0,O.y=0);var L=C.layoutDimensions(e),A=e.avoidOverlapPadding,I=L.w+A,D=L.h+A;y=Math.max(y,I),b=Math.max(b,D)}for(var M={},E=function(Y,Z){return!!M["c-"+Y+"-"+Z]},S=function(Y,Z){M["c-"+Y+"-"+Z]=!0},w=0,N=0,T=function(){N++,N>=u&&(N=0,w++)},R={},P=0;P<a.length;P++){var k=a[P],U=e.position(k);if(U&&(U.row!==void 0||U.col!==void 0)){var B={row:U.row,col:U.col};if(B.col===void 0)for(B.col=0;E(B.row,B.col);)B.col++;else if(B.row===void 0)for(B.row=0;E(B.row,B.col);)B.row++;R[k.id()]=B,S(B.row,B.col)}}var V=function(Y,Z){var K,G;if(Y.locked()||Y.isParent())return!1;var $=R[Y.id()];if($)K=$.col*y+y/2+i.x1,G=$.row*b+b/2+i.y1;else{for(;E(w,N);)T();K=N*y+y/2+i.x1,G=w*b+b/2+i.y1,S(w,N),T()}return{x:K,y:G}};a.layoutPositions(this,e,V)}return this};var RD={ready:function(){},stop:function(){}};function ol(t){this.options=_e({},RD,t)}ol.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};ol.prototype.stop=function(){return this};var PD={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Zd(t){this.options=_e({},PD,t)}Zd.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=vt(t.positions);function a(i){if(t.positions==null)return kL(i.position());if(n)return t.positions(i);var o=t.positions[i._private.data.id];return o??null}return r.layoutPositions(this,t,function(i,o){var s=a(i);return i.locked()||s==null?!1:s}),this};var _D={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Qd(t){this.options=_e({},_D,t)}Qd.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=Ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(o,s){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,a),this};var FD=[{name:"breadthfirst",impl:Yd},{name:"circle",impl:Wd},{name:"concentric",impl:Xd},{name:"cose",impl:ds},{name:"grid",impl:jd},{name:"null",impl:ol},{name:"preset",impl:Zd},{name:"random",impl:Qd}];function Jd(t){this.options=t,this.notifications=0}var wh=function(){},xh=function(){throw new Error("A headless instance can not render images")};Jd.prototype={recalculateRenderedStyle:wh,notify:function(){this.notifications++},init:wh,isHeadless:function(){return!0},png:xh,jpg:xh};var sl={};sl.arrowShapeWidth=.3;sl.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,f,c,h,d,v,p){var m=d.x-c/2-p,g=d.x+c/2+p,y=d.y-c/2-p,b=d.y+c/2+p,x=m<=u&&u<=g&&y<=f&&f<=b;return x},n=function(u,f,c,h,d){var v=u*Math.cos(h)-f*Math.sin(h),p=u*Math.sin(h)+f*Math.cos(h),m=v*c,g=p*c,y=m+d.x,b=g+d.y;return{x:y,y:b}},a=function(u,f,c,h){for(var d=[],v=0;v<u.length;v+=2){var p=u[v],m=u[v+1];d.push(n(p,m,f,c,h))}return d},i=function(u){for(var f=[],c=0;c<u.length;c++){var h=u[c];f.push(h.x,h.y)}return f},o=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},s=function(u,f){Re(f)&&(f=t[f]),t[u]=_e({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,d,v,p,m,g){var y=i(a(this.points,v+2*g,p,m)),b=Vt(h,d,y);return b},roughCollide:r,draw:function(h,d,v,p){var m=a(this.points,d,v,p);e.arrowShapeImpl("polygon")(h,m)},spacing:function(h){return 0},gap:o},f)};s("none",{collide:Vo,roughCollide:Vo,draw:Yu,spacing:Mc,gap:Mc}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,f,c,h,d){var v=a(this.points,f,c,h),p=this.controlPoint,m=n(p[0],p[1],f,c,h);e.arrowShapeImpl(this.name)(u,v,m)},gap:function(u){return o(u)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,f,c,h,d,v,p){var m=i(a(this.points,c+2*p,h,d)),g=i(a(this.pointsTee,c+2*p,h,d)),y=Vt(u,f,m)||Vt(u,f,g);return y},draw:function(u,f,c,h,d){var v=a(this.points,f,c,h),p=a(this.pointsTee,f,c,h);e.arrowShapeImpl(this.name)(u,v,p)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,f,c,h,d,v,p){var m=d,g=Math.pow(m.x-u,2)+Math.pow(m.y-f,2)<=Math.pow((c+2*p)*this.radius,2),y=i(a(this.points,c+2*p,h,d));return Vt(u,f,y)||g},draw:function(u,f,c,h,d){var v=a(this.pointsTr,f,c,h);e.arrowShapeImpl(this.name)(u,v,h.x,h.y,this.radius*f)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,f){var c=this.baseCrossLinePts.slice(),h=f/u,d=3,v=5;return c[d]=c[d]-h,c[v]=c[v]-h,c},collide:function(u,f,c,h,d,v,p){var m=i(a(this.points,c+2*p,h,d)),g=i(a(this.crossLinePts(c,v),c+2*p,h,d)),y=Vt(u,f,m)||Vt(u,f,g);return y},draw:function(u,f,c,h,d){var v=a(this.points,f,c,h),p=a(this.crossLinePts(f,d),f,c,h);e.arrowShapeImpl(this.name)(u,v,p)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return o(u)*.525}}),s("circle",{radius:.15,collide:function(u,f,c,h,d,v,p){var m=d,g=Math.pow(m.x-u,2)+Math.pow(m.y-f,2)<=Math.pow((c+2*p)*this.radius,2);return g},draw:function(u,f,c,h,d){e.arrowShapeImpl(this.name)(u,h.x,h.y,this.radius*f)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var Rn={};Rn.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],o=n[4],s=r.pan(),l=r.zoom(),u=((t-a)/o-s.x)/l,f=((e-i)/o-s.y)/l;return[u,f]};Rn.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(g){return parseFloat(r.getPropertyValue(g))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},o=t.clientWidth,s=t.clientHeight,l=a.left+a.right,u=a.top+a.bottom,f=i.left+i.right,c=e.width/(o+f),h=o-l,d=s-u,v=e.left+a.left+i.left,p=e.top+a.top+i.top;return this.containerBB=[v,p,h,d,c]};Rn.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Rn.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]};Rn.findNearestElements=function(t,e,r,n){var a=this,i=this,o=i.getCachedZSortedEles(),s=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),f=(n?24:8)/l,c=(n?8:2)/l,h=(n?8:2)/l,d=1/0,v,p;r&&(o=o.interactive);function m(L,A){if(L.isNode()){if(p)return;p=L,s.push(L)}if(L.isEdge()&&(A==null||A<d))if(v){if(v.pstyle("z-compound-depth").value===L.pstyle("z-compound-depth").value&&v.pstyle("z-compound-depth").value===L.pstyle("z-compound-depth").value){for(var I=0;I<s.length;I++)if(s[I].isEdge()){s[I]=L,v=L,d=A??d;break}}}else s.push(L),v=L,d=A??d}function g(L){var A=L.outerWidth()+2*c,I=L.outerHeight()+2*c,D=A/2,M=I/2,E=L.position(),S=L.pstyle("corner-radius").value==="auto"?"auto":L.pstyle("corner-radius").pfValue,w=L._private.rscratch;if(E.x-D<=t&&t<=E.x+D&&E.y-M<=e&&e<=E.y+M){var N=i.nodeShapes[a.getNodeShape(L)];if(N.checkPoint(t,e,0,A,I,E.x,E.y,S,w))return m(L,0),!0}}function y(L){var A=L._private,I=A.rscratch,D=L.pstyle("width").pfValue,M=L.pstyle("arrow-scale").value,E=D/2+f,S=E*E,w=E*2,P=A.source,k=A.target,N;if(I.edgeType==="segments"||I.edgeType==="straight"||I.edgeType==="haystack"){for(var T=I.allpts,R=0;R+3<T.length;R+=2)if(ZL(t,e,T[R],T[R+1],T[R+2],T[R+3],w)&&S>(N=rN(t,e,T[R],T[R+1],T[R+2],T[R+3])))return m(L,N),!0}else if(I.edgeType==="bezier"||I.edgeType==="multibezier"||I.edgeType==="self"||I.edgeType==="compound"){for(var T=I.allpts,R=0;R+5<I.allpts.length;R+=4)if(QL(t,e,T[R],T[R+1],T[R+2],T[R+3],T[R+4],T[R+5],w)&&S>(N=tN(t,e,T[R],T[R+1],T[R+2],T[R+3],T[R+4],T[R+5])))return m(L,N),!0}for(var P=P||A.source,k=k||A.target,U=a.getArrowWidth(D,M),B=[{name:"source",x:I.arrowStartX,y:I.arrowStartY,angle:I.srcArrowAngle},{name:"target",x:I.arrowEndX,y:I.arrowEndY,angle:I.tgtArrowAngle},{name:"mid-source",x:I.midX,y:I.midY,angle:I.midsrcArrowAngle},{name:"mid-target",x:I.midX,y:I.midY,angle:I.midtgtArrowAngle}],R=0;R<B.length;R++){var V=B[R],j=i.arrowShapes[L.pstyle(V.name+"-arrow-shape").value],Y=L.pstyle("width").pfValue;if(j.roughCollide(t,e,U,V.angle,{x:V.x,y:V.y},Y,f)&&j.collide(t,e,U,V.angle,{x:V.x,y:V.y},Y,f))return m(L),!0}u&&s.length>0&&(g(P),g(k))}function b(L,A,I){return ur(L,A,I)}function x(L,A){var I=L._private,D=h,M;A?M=A+"-":M="",L.boundingBox();var E=I.labelBounds[A||"main"],S=L.pstyle(M+"label").value,w=L.pstyle("text-events").strValue==="yes";if(!(!w||!S)){var N=b(I.rscratch,"labelX",A),T=b(I.rscratch,"labelY",A),R=b(I.rscratch,"labelAngle",A),P=L.pstyle(M+"text-margin-x").pfValue,k=L.pstyle(M+"text-margin-y").pfValue,U=E.x1-D-P,B=E.x2+D-P,V=E.y1-D-k,j=E.y2+D-k;if(R){var Y=Math.cos(R),Z=Math.sin(R),K=function(Ee,ne){return Ee=Ee-N,ne=ne-T,{x:Ee*Y-ne*Z+N,y:Ee*Z+ne*Y+T}},G=K(U,V),$=K(U,j),q=K(B,V),X=K(B,j),ee=[G.x+P,G.y+k,q.x+P,q.y+k,X.x+P,X.y+k,$.x+P,$.y+k];if(Vt(t,e,ee))return m(L),!0}else if(da(E,t,e))return m(L),!0}}for(var C=o.length-1;C>=0;C--){var O=o[C];O.isNode()?g(O)||x(O):y(O)||x(O)||x(O,"source")||x(O,"target")}return s};Rn.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,i=[],o=Math.min(t,r),s=Math.max(t,r),l=Math.min(e,n),u=Math.max(e,n);t=o,r=s,e=l,n=u;for(var f=Ht({x1:t,y1:e,x2:r,y2:n}),c=0;c<a.length;c++){var h=a[c];if(h.isNode()){var d=h,v=d.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Ku(f,v)&&!ud(v,f)&&i.push(d)}else{var p=h,m=p._private,g=m.rscratch;if(g.startX!=null&&g.startY!=null&&!da(f,g.startX,g.startY)||g.endX!=null&&g.endY!=null&&!da(f,g.endX,g.endY))continue;if(g.edgeType==="bezier"||g.edgeType==="multibezier"||g.edgeType==="self"||g.edgeType==="compound"||g.edgeType==="segments"||g.edgeType==="haystack"){for(var y=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,b=!0,x=0;x<y.length;x++)if(!jL(f,y[x])){b=!1;break}b&&i.push(p)}else(g.edgeType==="haystack"||g.edgeType==="straight")&&i.push(p)}}return i};var jo={};jo.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",l,u,f,c,h,d,g,y;if(r?(f=e.haystackPts[0],c=e.haystackPts[1],h=e.haystackPts[2],d=e.haystackPts[3]):(f=e.arrowStartX,c=e.arrowStartY,h=e.arrowEndX,d=e.arrowEndY),g=e.midX,y=e.midY,i)l=f-e.segpts[0],u=c-e.segpts[1];else if(a||o||s||n){var v=e.allpts,p=Lt(v[0],v[2],v[4],.1),m=Lt(v[1],v[3],v[5],.1);l=f-p,u=c-m}else l=f-g,u=c-y;e.srcArrowAngle=wo(l,u);var g=e.midX,y=e.midY;if(r&&(g=(f+h)/2,y=(c+d)/2),l=h-f,u=d-c,i){var v=e.allpts;if(v.length/2%2===0){var b=v.length/2,x=b-2;l=v[b]-v[x],u=v[b+1]-v[x+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var b=v.length/2-1,x=b-2;l=v[b]-v[x],u=v[b+1]-v[x+1]}}else if(a||o||s){var v=e.allpts,C=e.ctrlpts,O,L,A,I;if(C.length/2%2===0){var D=v.length/2-1,M=D+2,E=M+2;O=Lt(v[D],v[M],v[E],0),L=Lt(v[D+1],v[M+1],v[E+1],0),A=Lt(v[D],v[M],v[E],1e-4),I=Lt(v[D+1],v[M+1],v[E+1],1e-4)}else{var M=v.length/2-1,D=M-2,E=M+2;O=Lt(v[D],v[M],v[E],.4999),L=Lt(v[D+1],v[M+1],v[E+1],.4999),A=Lt(v[D],v[M],v[E],.5),I=Lt(v[D+1],v[M+1],v[E+1],.5)}l=A-O,u=I-L}if(e.midtgtArrowAngle=wo(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i){var v=e.allpts;if(v.length/2%2!==0){if(!e.isRound){var b=v.length/2-1,S=b+2;l=-(v[S]-v[b]),u=-(v[S+1]-v[b+1])}}}if(e.midsrcArrowAngle=wo(l,u),i)l=h-e.segpts[e.segpts.length-2],u=d-e.segpts[e.segpts.length-1];else if(a||o||s||n){var v=e.allpts,w=v.length,p=Lt(v[w-6],v[w-4],v[w-2],.9),m=Lt(v[w-5],v[w-3],v[w-1],.9);l=h-p,u=d-m}else l=h-g,u=d-y;e.tgtArrowAngle=wo(l,u)};jo.getArrowWidth=jo.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var Ru,Pu,vr={},Jt={},Th,Ch,Cn,qo,Ar,bn,Tn,dr,aa,Io,ev,tv,_u,Fu,Sh,Lh=function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},BD=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},kD=function(e,r,n,a,i){if(e!==Sh?Lh(r,e,vr):BD(Jt,vr),Lh(r,n,Jt),Th=vr.nx*Jt.ny-vr.ny*Jt.nx,Ch=vr.nx*Jt.nx-vr.ny*-Jt.ny,Ar=Math.asin(Math.max(-1,Math.min(1,Th))),Math.abs(Ar)<1e-6){Ru=r.x,Pu=r.y,Tn=aa=0;return}Cn=1,qo=!1,Ch<0?Ar<0?Ar=Math.PI+Ar:(Ar=Math.PI-Ar,Cn=-1,qo=!0):Ar>0&&(Cn=-1,qo=!0),r.radius!==void 0?aa=r.radius:aa=a,bn=Ar/2,Io=Math.min(vr.len/2,Jt.len/2),i?(dr=Math.abs(Math.cos(bn)*aa/Math.sin(bn)),dr>Io?(dr=Io,Tn=Math.abs(dr*Math.sin(bn)/Math.cos(bn))):Tn=aa):(dr=Math.min(Io,aa),Tn=Math.abs(dr*Math.sin(bn)/Math.cos(bn))),_u=r.x+Jt.nx*dr,Fu=r.y+Jt.ny*dr,Ru=_u-Jt.ny*Tn*Cn,Pu=Fu+Jt.nx*Tn*Cn,ev=r.x+vr.nx*dr,tv=r.y+vr.ny*dr,Sh=r};function rv(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function ul(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(kD(t,e,r,n,a),{cx:Ru,cy:Pu,radius:Tn,startX:ev,startY:tv,stopX:_u,stopY:Fu,startAngle:vr.ang+Math.PI/2*Cn,endAngle:Jt.ang-Math.PI/2*Cn,counterClockwise:qo})}var kt={};kt.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,o=t.pstyle("source-endpoint"),s=t.pstyle("target-endpoint"),l=o.units!=null&&s.units!=null,u=function(C,O,L,A){var I=A-O,D=L-C,M=Math.sqrt(D*D+I*I);return{x:-I/M,y:D/M}},f=t.pstyle("edge-distances").value;switch(f){case"node-position":i=r;break;case"intersection":i=n;break;case"endpoints":{if(l){var c=this.manualEndptToPx(t.source()[0],o),h=or(c,2),d=h[0],v=h[1],p=this.manualEndptToPx(t.target()[0],s),m=or(p,2),g=m[0],y=m[1],b={x1:d,y1:v,x2:g,y2:y};a=u(d,v,g,y),i=b}else nt("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=n;break}}return{midptPts:i,vectorNormInverse:a}};kt.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,a=n.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var o=n.source,s=n.target,l=o.position(),u=s.position(),f=o.width(),c=s.width(),h=o.height(),d=s.height(),v=r.pstyle("haystack-radius").value,p=v/2;a.haystackPts=a.allpts=[a.source.x*f*p+l.x,a.source.y*h*p+l.y,a.target.x*c*p+u.x,a.target.y*d*p+u.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};kt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),o=t.pstyle("radius-type"),s=Math.min(n.pfValue.length,a.pfValue.length),l=i.pfValue[i.pfValue.length-1],u=o.pfValue[o.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var f=0;f<s;f++){var c=n.pfValue[f],h=a.pfValue[f],d=1-c,v=c,p=this.findMidptPtsEtc(t,e),m=p.midptPts,g=p.vectorNormInverse,y={x:m.x1*d+m.x2*v,y:m.y1*d+m.y2*v};r.segpts.push(y.x+g.x*h,y.y+g.y*h),r.radii.push(i.pfValue[f]!==void 0?i.pfValue[f]:l),r.isArcRadius.push((o.pfValue[f]!==void 0?o.pfValue[f]:u)==="arc-radius")}};kt.findLoopPoints=function(t,e,r,n){var a=t._private.rscratch,i=e.dirCounts,o=e.srcPos,s=t.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,c=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=r,d=c;n&&(h=0,d=l);var v=u-Math.PI/2,p=v-f/2,m=v+f/2,g=u+"_"+f;h=i[g]===void 0?i[g]=0:++i[g],a.ctrlpts=[o.x+Math.cos(p)*1.4*d*(h/3+1),o.y+Math.sin(p)*1.4*d*(h/3+1),o.x+Math.cos(m)*1.4*d*(h/3+1),o.y+Math.sin(m)*1.4*d*(h/3+1)]};kt.findCompoundLoopPoints=function(t,e,r,n){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,l=e.srcH,u=e.tgtW,f=e.tgtH,c=t.pstyle("control-point-step-size").pfValue,h=t.pstyle("control-point-distances"),d=h?h.pfValue[0]:void 0,v=r,p=c;n&&(v=0,p=d);var m=50,g={x:i.x-s/2,y:i.y-l/2},y={x:o.x-u/2,y:o.y-f/2},b={x:Math.min(g.x,y.x),y:Math.min(g.y,y.y)},x=.5,C=Math.max(x,Math.log(s*.01)),O=Math.max(x,Math.log(u*.01));a.ctrlpts=[b.x,b.y-(1+Math.pow(m,1.12)/100)*p*(v/3+1)*C,b.x-(1+Math.pow(m,1.12)/100)*p*(v/3+1)*O,b.y]};kt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};kt.findBezierPoints=function(t,e,r,n,a){var i=t._private.rscratch,o=t.pstyle("control-point-step-size").pfValue,s=t.pstyle("control-point-distances"),l=t.pstyle("control-point-weights"),u=s&&l?Math.min(s.value.length,l.value.length):1,f=s?s.pfValue[0]:void 0,c=l.value[0],h=n;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var d=0;d<u;d++){var v=(.5-e.eles.length/2+r)*o*(a?-1:1),p=void 0,m=od(v);h&&(f=s?s.pfValue[d]:o,c=l.value[d]),n?p=f:p=f!==void 0?m*f:void 0;var g=p!==void 0?p:v,y=1-c,b=c,x=this.findMidptPtsEtc(t,e),C=x.midptPts,O=x.vectorNormInverse,L={x:C.x1*y+C.x2*b,y:C.y1*y+C.y2*b};i.ctrlpts.push(L.x+O.x*g,L.y+O.y*g)}};kt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",a="horizontal",i="leftward",o="rightward",s="downward",l="upward",u="auto",f=e.posPts,c=e.srcW,h=e.srcH,d=e.tgtW,v=e.tgtH,p=t.pstyle("edge-distances").value,m=p!=="node-position",g=t.pstyle("taxi-direction").value,y=g,b=t.pstyle("taxi-turn"),x=b.units==="%",C=b.pfValue,O=C<0,L=t.pstyle("taxi-turn-min-distance").pfValue,A=m?(c+d)/2:0,I=m?(h+v)/2:0,D=f.x2-f.x1,M=f.y2-f.y1,E=function(W,ae){return W>0?Math.max(W-ae,0):Math.min(W+ae,0)},S=E(D,A),w=E(M,I),N=!1;y===u?g=Math.abs(S)>Math.abs(w)?a:n:y===l||y===s?(g=n,N=!0):(y===i||y===o)&&(g=a,N=!0);var T=g===n,R=T?w:S,P=T?M:D,k=od(P),U=!1;!(N&&(x||O))&&(y===s&&P<0||y===l&&P>0||y===i&&P>0||y===o&&P<0)&&(k*=-1,R=k*Math.abs(R),U=!0);var B;if(x){var V=C<0?1+C:C;B=V*R}else{var j=C<0?R:0;B=j+C*k}var Y=function(W){return Math.abs(W)<L||Math.abs(W)>=Math.abs(R)},Z=Y(B),K=Y(Math.abs(R)-Math.abs(B)),G=Z||K;if(G&&!U)if(T){var $=Math.abs(P)<=h/2,q=Math.abs(D)<=d/2;if($){var X=(f.x1+f.x2)/2,ee=f.y1,ce=f.y2;r.segpts=[X,ee,X,ce]}else if(q){var Ee=(f.y1+f.y2)/2,ne=f.x1,Q=f.x2;r.segpts=[ne,Ee,Q,Ee]}else r.segpts=[f.x1,f.y2]}else{var se=Math.abs(P)<=c/2,J=Math.abs(M)<=v/2;if(se){var ie=(f.y1+f.y2)/2,ve=f.x1,Se=f.x2;r.segpts=[ve,ie,Se,ie]}else if(J){var Ce=(f.x1+f.x2)/2,xe=f.y1,De=f.y2;r.segpts=[Ce,xe,Ce,De]}else r.segpts=[f.x2,f.y1]}else if(T){var Le=f.y1+B+(m?h/2*k:0),Pe=f.x1,de=f.x2;r.segpts=[Pe,Le,de,Le]}else{var _=f.x1+B+(m?c/2*k:0),te=f.y1,oe=f.y2;r.segpts=[_,te,_,oe]}if(r.isRound){var z=t.pstyle("taxi-radius").value,H=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(z),r.isArcRadius=new Array(r.segpts.length/2).fill(H)}};kt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,l=e.tgtH,u=e.srcShape,f=e.tgtShape,c=e.srcCornerRadius,h=e.tgtCornerRadius,d=e.srcRs,v=e.tgtRs,p=!we(r.startX)||!we(r.startY),m=!we(r.arrowStartX)||!we(r.arrowStartY),g=!we(r.endX)||!we(r.endY),y=!we(r.arrowEndX)||!we(r.arrowEndY),b=3,x=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=b*x,O=On({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),L=O<C,A=On({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),I=A<C,D=!1;if(p||m||L){D=!0;var M={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},E=Math.sqrt(M.x*M.x+M.y*M.y),S={x:M.x/E,y:M.y/E},w=Math.max(i,o),N={x:r.ctrlpts[0]+S.x*2*w,y:r.ctrlpts[1]+S.y*2*w},T=u.intersectLine(n.x,n.y,i,o,N.x,N.y,0,c,d);L?(r.ctrlpts[0]=r.ctrlpts[0]+S.x*(C-O),r.ctrlpts[1]=r.ctrlpts[1]+S.y*(C-O)):(r.ctrlpts[0]=T[0]+S.x*C,r.ctrlpts[1]=T[1]+S.y*C)}if(g||y||I){D=!0;var R={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},P=Math.sqrt(R.x*R.x+R.y*R.y),k={x:R.x/P,y:R.y/P},U=Math.max(i,o),B={x:r.ctrlpts[0]+k.x*2*U,y:r.ctrlpts[1]+k.y*2*U},V=f.intersectLine(a.x,a.y,s,l,B.x,B.y,0,h,v);I?(r.ctrlpts[0]=r.ctrlpts[0]+k.x*(C-A),r.ctrlpts[1]=r.ctrlpts[1]+k.y*(C-A)):(r.ctrlpts[0]=V[0]+k.x*C,r.ctrlpts[1]=V[1]+k.y*C)}D&&this.findEndpoints(t)}};kt.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=Lt(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=Lt(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(ul({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,s))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var f=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[f],e.midY=e.segpts[f+1];else{var c={x:e.segpts[f],y:e.segpts[f+1]},h=e.roundCorners[f/2],d=[c.x-h.cx,c.y-h.cy],v=h.radius/Math.sqrt(Math.pow(d[0],2)+Math.pow(d[1],2));d=d.map(function(p){return p*v}),e.midX=h.cx+d[0],e.midY=h.cy+d[1],e.midVector=d}}}};kt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||we(e.startX)&&we(e.startY)&&we(e.endX)&&we(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,nt("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};kt.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,a=n.hasCompoundNodes(),i={map:new gr,get:function(L){var A=this.map.get(L[0]);return A!=null?A.get(L[1]):null},set:function(L,A){var I=this.map.get(L[0]);I==null&&(I=new gr,this.map.set(L[0],I)),I.set(L[1],A)}},o=[],s=[],l=0;l<t.length;l++){var u=t[l],f=u._private,c=u.pstyle("curve-style").value;if(!(u.removed()||!u.takesUpSpace())){if(c==="haystack"){s.push(u);continue}var h=c==="unbundled-bezier"||c.endsWith("segments")||c==="straight"||c==="straight-triangle"||c.endsWith("taxi"),d=c==="unbundled-bezier"||c==="bezier",v=f.source,p=f.target,m=v.poolIndex(),g=p.poolIndex(),y=[m,g].sort(),b=i.get(y);b==null&&(b={eles:[]},i.set(y,b),o.push(y)),b.eles.push(u),h&&(b.hasUnbundled=!0),d&&(b.hasBezier=!0)}}for(var x=function(L){var A=o[L],I=i.get(A),D=void 0;if(!I.hasUnbundled){var M=I.eles[0].parallelEdges().filter(function(_){return _.isBundledBezier()});Wu(I.eles),M.forEach(function(_){return I.eles.push(_)}),I.eles.sort(function(_,te){return _.poolIndex()-te.poolIndex()})}var E=I.eles[0],S=E.source(),w=E.target();if(S.poolIndex()>w.poolIndex()){var N=S;S=w,w=N}var T=I.srcPos=S.position(),R=I.tgtPos=w.position(),P=I.srcW=S.outerWidth(),k=I.srcH=S.outerHeight(),U=I.tgtW=w.outerWidth(),B=I.tgtH=w.outerHeight(),V=I.srcShape=r.nodeShapes[e.getNodeShape(S)],j=I.tgtShape=r.nodeShapes[e.getNodeShape(w)],Y=I.srcCornerRadius=S.pstyle("corner-radius").value==="auto"?"auto":S.pstyle("corner-radius").pfValue,Z=I.tgtCornerRadius=w.pstyle("corner-radius").value==="auto"?"auto":w.pstyle("corner-radius").pfValue,K=I.tgtRs=w._private.rscratch,G=I.srcRs=S._private.rscratch;I.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var $=0;$<I.eles.length;$++){var q=I.eles[$],X=q[0]._private.rscratch,ee=q.pstyle("curve-style").value,ce=ee==="unbundled-bezier"||ee.endsWith("segments")||ee.endsWith("taxi"),Ee=!S.same(q.source());if(!I.calculatedIntersection&&S!==w&&(I.hasBezier||I.hasUnbundled)){I.calculatedIntersection=!0;var ne=V.intersectLine(T.x,T.y,P,k,R.x,R.y,0,Y,G),Q=I.srcIntn=ne,se=j.intersectLine(R.x,R.y,U,B,T.x,T.y,0,Z,K),J=I.tgtIntn=se,ie=I.intersectionPts={x1:ne[0],x2:se[0],y1:ne[1],y2:se[1]},ve=I.posPts={x1:T.x,x2:R.x,y1:T.y,y2:R.y},Se=se[1]-ne[1],Ce=se[0]-ne[0],xe=Math.sqrt(Ce*Ce+Se*Se),De=I.vector={x:Ce,y:Se},Le=I.vectorNorm={x:De.x/xe,y:De.y/xe},Pe={x:-Le.y,y:Le.x};I.nodesOverlap=!we(xe)||j.checkPoint(ne[0],ne[1],0,U,B,R.x,R.y,Z,K)||V.checkPoint(se[0],se[1],0,P,k,T.x,T.y,Y,G),I.vectorNormInverse=Pe,D={nodesOverlap:I.nodesOverlap,dirCounts:I.dirCounts,calculatedIntersection:!0,hasBezier:I.hasBezier,hasUnbundled:I.hasUnbundled,eles:I.eles,srcPos:R,srcRs:K,tgtPos:T,tgtRs:G,srcW:U,srcH:B,tgtW:P,tgtH:k,srcIntn:J,tgtIntn:Q,srcShape:j,tgtShape:V,posPts:{x1:ve.x2,y1:ve.y2,x2:ve.x1,y2:ve.y1},intersectionPts:{x1:ie.x2,y1:ie.y2,x2:ie.x1,y2:ie.y1},vector:{x:-De.x,y:-De.y},vectorNorm:{x:-Le.x,y:-Le.y},vectorNormInverse:{x:-Pe.x,y:-Pe.y}}}var de=Ee?D:I;X.nodesOverlap=de.nodesOverlap,X.srcIntn=de.srcIntn,X.tgtIntn=de.tgtIntn,X.isRound=ee.startsWith("round"),a&&(S.isParent()||S.isChild()||w.isParent()||w.isChild())&&(S.parents().anySame(w)||w.parents().anySame(S)||S.same(w)&&S.isParent())?e.findCompoundLoopPoints(q,de,$,ce):S===w?e.findLoopPoints(q,de,$,ce):ee.endsWith("segments")?e.findSegmentsPoints(q,de):ee.endsWith("taxi")?e.findTaxiPoints(q,de):ee==="straight"||!ce&&I.eles.length%2===1&&$===Math.floor(I.eles.length/2)?e.findStraightEdgePoints(q):e.findBezierPoints(q,de,$,ce,Ee),e.findEndpoints(q),e.tryToCorrectInvalidPoints(q,de),e.checkForInvalidEdgeWarning(q),e.storeAllpts(q),e.storeEdgeProjections(q),e.calculateArrowAngles(q),e.recalculateEdgeLabelProjections(q),e.calculateLabelAngles(q)}},C=0;C<o.length;C++)x(C);this.findHaystackPoints(s)}};function nv(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],a=t[r+1];e.push({x:n,y:a})}return e}}kt.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return nv(e.segpts)};kt.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return nv(e.ctrlpts)};kt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var xi={};xi.manualEndptToPx=function(t,e){var r=this,n=t.position(),a=t.outerWidth(),i=t.outerHeight(),o=t._private.rscratch;if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*a),e.units[1]==="%"&&(s[1]=s[1]*i),s[0]+=n.x,s[1]+=n.y,s}else{var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(a,i),f=[n.x+Math.cos(l)*u,n.y+Math.sin(l)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,a,i,f[0],f[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,o)}};xi.findEndpoints=function(t){var e=this,r,n=t.source()[0],a=t.target()[0],i=n.position(),o=a.position(),s=t.pstyle("target-arrow-shape").value,l=t.pstyle("source-arrow-shape").value,u=t.pstyle("target-distance-from-node").pfValue,f=t.pstyle("source-distance-from-node").pfValue,c=n._private.rscratch,h=a._private.rscratch,d=t.pstyle("curve-style").value,v=t._private.rscratch,p=v.edgeType,m=d==="taxi",g=p==="self"||p==="compound",y=p==="bezier"||p==="multibezier"||g,b=p!=="bezier",x=p==="straight"||p==="segments",C=p==="segments",O=y||b||x,L=g||m,A=t.pstyle("source-endpoint"),I=L?"outside-to-node":A.value,D=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,M=t.pstyle("target-endpoint"),E=L?"outside-to-node":M.value,S=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;v.srcManEndpt=A,v.tgtManEndpt=M;var w,N,T,R;if(y){var P=[v.ctrlpts[0],v.ctrlpts[1]],k=b?[v.ctrlpts[v.ctrlpts.length-2],v.ctrlpts[v.ctrlpts.length-1]]:P;w=k,N=P}else if(x){var U=C?v.segpts.slice(0,2):[o.x,o.y],B=C?v.segpts.slice(v.segpts.length-2):[i.x,i.y];w=B,N=U}if(E==="inside-to-node")r=[o.x,o.y];else if(M.units)r=this.manualEndptToPx(a,M);else if(E==="outside-to-line")r=v.tgtIntn;else if(E==="outside-to-node"||E==="outside-to-node-or-label"?T=w:(E==="outside-to-line"||E==="outside-to-line-or-label")&&(T=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x,o.y,a.outerWidth(),a.outerHeight(),T[0],T[1],0,S,h),E==="outside-to-node-or-label"||E==="outside-to-line-or-label"){var V=a._private.rscratch,j=V.labelWidth,Y=V.labelHeight,Z=V.labelX,K=V.labelY,G=j/2,$=Y/2,q=a.pstyle("text-valign").value;q==="top"?K-=$:q==="bottom"&&(K+=$);var X=a.pstyle("text-halign").value;X==="left"?Z-=G:X==="right"&&(Z+=G);var ee=fi(T[0],T[1],[Z-G,K-$,Z+G,K-$,Z+G,K+$,Z-G,K+$],o.x,o.y);if(ee.length>0){var ce=i,Ee=wn(ce,oa(r)),ne=wn(ce,oa(ee)),Q=Ee;if(ne<Ee&&(r=ee,Q=ne),ee.length>2){var se=wn(ce,{x:ee[2],y:ee[3]});se<Q&&(r=[ee[2],ee[3]])}}}var J=xo(r,w,e.arrowShapes[s].spacing(t)+u),ie=xo(r,w,e.arrowShapes[s].gap(t)+u);if(v.endX=ie[0],v.endY=ie[1],v.arrowEndX=J[0],v.arrowEndY=J[1],I==="inside-to-node")r=[i.x,i.y];else if(A.units)r=this.manualEndptToPx(n,A);else if(I==="outside-to-line")r=v.srcIntn;else if(I==="outside-to-node"||I==="outside-to-node-or-label"?R=N:(I==="outside-to-line"||I==="outside-to-line-or-label")&&(R=[o.x,o.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),R[0],R[1],0,D,c),I==="outside-to-node-or-label"||I==="outside-to-line-or-label"){var ve=n._private.rscratch,Se=ve.labelWidth,Ce=ve.labelHeight,xe=ve.labelX,De=ve.labelY,Le=Se/2,Pe=Ce/2,de=n.pstyle("text-valign").value;de==="top"?De-=Pe:de==="bottom"&&(De+=Pe);var _=n.pstyle("text-halign").value;_==="left"?xe-=Le:_==="right"&&(xe+=Le);var te=fi(R[0],R[1],[xe-Le,De-Pe,xe+Le,De-Pe,xe+Le,De+Pe,xe-Le,De+Pe],i.x,i.y);if(te.length>0){var oe=o,z=wn(oe,oa(r)),H=wn(oe,oa(te)),re=z;if(H<z&&(r=[te[0],te[1]],re=H),te.length>2){var W=wn(oe,{x:te[2],y:te[3]});W<re&&(r=[te[2],te[3]])}}}var ae=xo(r,N,e.arrowShapes[l].spacing(t)+f),le=xo(r,N,e.arrowShapes[l].gap(t)+f);v.startX=le[0],v.startY=le[1],v.arrowStartX=ae[0],v.arrowStartY=ae[1],O&&(!we(v.startX)||!we(v.startY)||!we(v.endX)||!we(v.endY)?v.badLine=!0:v.badLine=!1)};xi.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),e.edgeType==="haystack"?{x:e.haystackPts[0],y:e.haystackPts[1]}:{x:e.arrowStartX,y:e.arrowStartY}};xi.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),e.edgeType==="haystack"?{x:e.haystackPts[2],y:e.haystackPts[3]}:{x:e.arrowEndX,y:e.arrowEndY}};var ll={};function qD(t,e,r){for(var n=function(u,f,c,h){return Lt(u,f,c,h)},a=e._private,i=a.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var s=t.bezierProjPcts[o];i.push({x:n(r[0],r[2],r[4],s),y:n(r[1],r[3],r[5],s)})}}ll.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<r.allpts.length;a+=4)qD(this,t,r.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<r.allpts.length;a+=2)i.push({x:r.allpts[a],y:r.allpts[a+1]});else if(n==="haystack"){var o=r.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};ll.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var br={};br.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!Jr(e)){var r,n,a=t._private,i=t.width(),o=t.height(),s=t.padding(),l=t.position(),u=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,c=a.rscratch,h=a.rstyle;switch(u){case"left":r=l.x-i/2-s;break;case"right":r=l.x+i/2+s;break;default:r=l.x}switch(f){case"top":n=l.y-o/2-s;break;case"bottom":n=l.y+o/2+s;break;default:n=l.y}c.labelX=r,c.labelY=n,h.labelX=r,h.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var av=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},iv=function(e,r){var n=r.x-e.x,a=r.y-e.y;return av(n,a)},zD=function(e,r,n,a){var i=li(0,a-.001,1),o=li(0,a+.001,1),s=ua(e,r,n,i),l=ua(e,r,n,o);return iv(s,l)};br.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.rscratch,a=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:n.midX,y:n.midY};var o=function(c,h,d){Kr(r.rscratch,c,h,d),Kr(r.rstyle,c,h,d)};o("labelX",null,e.x),o("labelY",null,e.y);var s=av(n.midDispX,n.midDispY);o("labelAutoAngle",null,s);var l=function f(){if(f.cache)return f.cache;for(var c=[],h=0;h+5<n.allpts.length;h+=4){var d={x:n.allpts[h],y:n.allpts[h+1]},v={x:n.allpts[h+2],y:n.allpts[h+3]},p={x:n.allpts[h+4],y:n.allpts[h+5]};c.push({p0:d,p1:v,p2:p,startDist:0,length:0,segments:[]})}var m=r.rstyle.bezierPts,g=a.bezierProjPcts.length;function y(L,A,I,D,M){var E=On(A,I),S=L.segments[L.segments.length-1],w={p0:A,p1:I,t0:D,t1:M,startDist:S?S.startDist+S.length:0,length:E};L.segments.push(w),L.length+=E}for(var b=0;b<c.length;b++){var x=c[b],C=c[b-1];C&&(x.startDist=C.startDist+C.length),y(x,x.p0,m[b*g],0,a.bezierProjPcts[0]);for(var O=0;O<g-1;O++)y(x,m[b*g+O],m[b*g+O+1],a.bezierProjPcts[O],a.bezierProjPcts[O+1]);y(x,m[b*g+g-1],x.p2,a.bezierProjPcts[g-1],1)}return f.cache=c},u=function(c){var h,d=c==="source";if(i[c]){var v=t.pstyle(c+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var p=l(),m,g=0,y=0,b=0;b<p.length;b++){for(var x=p[d?b:p.length-1-b],C=0;C<x.segments.length;C++){var O=x.segments[d?C:x.segments.length-1-C],L=b===p.length-1&&C===x.segments.length-1;if(g=y,y+=O.length,y>=v||L){m={cp:x,segment:O};break}}if(m)break}var A=m.cp,I=m.segment,D=(v-g)/I.length,M=I.t1-I.t0,E=d?I.t0+M*D:I.t1-M*D;E=li(0,E,1),e=ua(A.p0,A.p1,A.p2,E),h=zD(A.p0,A.p1,A.p2,E);break}case"straight":case"segments":case"haystack":{for(var S=0,w,N,T,R,P=n.allpts.length,k=0;k+3<P&&(d?(T={x:n.allpts[k],y:n.allpts[k+1]},R={x:n.allpts[k+2],y:n.allpts[k+3]}):(T={x:n.allpts[P-2-k],y:n.allpts[P-1-k]},R={x:n.allpts[P-4-k],y:n.allpts[P-3-k]}),w=On(T,R),N=S,S+=w,!(S>=v));k+=2);var U=v-N,B=U/w;B=li(0,B,1),e=$L(T,R,B),h=iv(T,R);break}}o("labelX",c,e.x),o("labelY",c,e.y),o("labelAutoAngle",c,h)}};u("source"),u("target"),this.applyLabelDimensions(t)}};br.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};br.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,n),i=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,s=ur(r.rscratch,"labelWrapCachedLines",e)||[],l=o!=="wrap"?1:Math.max(s.length,1),u=a.height/l,f=u*i,c=a.width,h=a.height+(l-1)*(i-1)*u;Kr(r.rstyle,"labelWidth",e,c),Kr(r.rscratch,"labelWidth",e,c),Kr(r.rstyle,"labelHeight",e,h),Kr(r.rscratch,"labelHeight",e,h),Kr(r.rscratch,"labelLineHeight",e,f)};br.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,i=t.pstyle("text-transform").value,o=function(j,Y){return Y?(Kr(r.rscratch,j,e,Y),Y):ur(r.rscratch,j,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var s=t.pstyle("text-wrap").value;if(s==="wrap"){var l=o("labelKey");if(l!=null&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var u="\u200B",f=a.split(`
4
+ `),c=t.pstyle("text-max-width").pfValue,h=t.pstyle("text-overflow-wrap").value,d=h==="anywhere",v=[],p=/[\s\u200b]+|$/g,m=0;m<f.length;m++){var g=f[m],y=this.calculateLabelDimensions(t,g),b=y.width;if(d){var x=g.split("").join(u);g=x}if(b>c){var C=g.matchAll(p),O="",L=0,A=Uh(C),I;try{for(A.s();!(I=A.n()).done;){var D=I.value,M=D[0],E=g.substring(L,D.index);L=D.index+M.length;var S=O.length===0?E:O+E+M,w=this.calculateLabelDimensions(t,S),N=w.width;N<=c?O+=E+M:(O&&v.push(O),O=E+M)}}catch(V){A.e(V)}finally{A.f()}O.match(/^[\s\u200b]+$/)||v.push(O)}else v.push(g)}o("labelWrapCachedLines",v),a=o("labelWrapCachedText",v.join(`
5
+ `)),o("labelWrapKey",l)}else if(s==="ellipsis"){var T=t.pstyle("text-max-width").pfValue,R="",P="\u2026",k=!1;if(this.calculateLabelDimensions(t,a).width<T)return a;for(var U=0;U<a.length;U++){var B=this.calculateLabelDimensions(t,R+a[U]+P).width;if(B>T)break;R+=a[U],U===a.length-1&&(k=!0)}return k||(R+=P),R}return a};br.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};br.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),a=n.document,i=Nn(e,t._private.labelDimsKey),o=r.labelDimCache||(r.labelDimCache=[]),s=o[i];if(s!=null)return s;var l=0,u=t.pstyle("font-style").strValue,f=t.pstyle("font-size").pfValue,c=t.pstyle("font-family").strValue,h=t.pstyle("font-weight").strValue,d=this.labelCalcCanvas,v=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=a.createElement("canvas"),v=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}v.font="".concat(u," ").concat(h," ").concat(f,"px ").concat(c);for(var m=0,g=0,y=e.split(`
6
+ `),b=0;b<y.length;b++){var x=y[b],C=v.measureText(x),O=Math.ceil(C.width),L=f;m=Math.max(O,m),g+=L}return m+=l,g+=l,o[i]={width:m,height:g}};br.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,a=t.isEdge(),i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:a&&s==="autorotate"?n.labelAutoAngle:s==="autorotate"?0:o.pfValue};br.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(t),r&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var ov={},Nh=28,Oh=!1;ov.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<Nh||t.height()<Nh))return Oh||(nt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Oh=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var vs={};vs.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var l=0;l<o.length;l++){var u=o[l],f=u._private,c=f.rstyle;c.clean=!1,c.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(o){var s=o.target;n(s)}).on("style.* background.*",function(o){var s=o.target;n(s,!1)});var a=function(o){if(o){var s=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],f=u._private.rstyle;u.isNode()&&!f.cleanConnected&&(n(u.connectedEdges()),f.cleanConnected=!0)}if(s)for(var c=0;c<s.length;c++){var h=s[c];h(o,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){a(!0)},r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)};vs.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};vs.recalculateRenderedStyle=function(t,e){var r=function(x){return x._private.rstyle.cleanConnected},n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var o=t[i],s=o._private,l=s.rstyle;o.isEdge()&&(!r(o.source())||!r(o.target()))&&(l.clean=!1),!(e&&l.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?a.push(o):n.push(o),l.clean=!0)}for(var u=0;u<a.length;u++){var f=a[u],c=f._private,h=c.rstyle,d=f.position();this.recalculateNodeLabelProjection(f),h.nodeX=d.x,h.nodeY=d.y,h.nodeW=f.pstyle("width").pfValue,h.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var v=0;v<n.length;v++){var p=n[v],m=p._private,g=m.rstyle,y=m.rscratch;g.srcX=y.arrowStartX,g.srcY=y.arrowStartY,g.tgtX=y.arrowEndX,g.tgtY=y.arrowEndY,g.midX=y.midX,g.midY=y.midY,g.labelAngle=y.labelAngle,g.sourceLabelAngle=y.sourceLabelAngle,g.targetLabelAngle=y.targetLabelAngle}}};var ps={};ps.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}};ps.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};ps.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Vd),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var sv={};[Rn,jo,kt,xi,ll,br,ov,vs,ps].forEach(function(t){_e(sv,t)});var uv={};uv.getCachedImage=function(t,e,r){var n=this,a=n.imageCache=n.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=a[t]=a[t]||{};var o=i.image=new Image;o.addEventListener("load",r),o.addEventListener("error",function(){o.error=!0});var s="data:",l=t.substring(0,s.length).toLowerCase()===s;return l||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var Ta={};Ta.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++){var s=t[o];if(s!==void 0){var l=this.binder(s);i.push(l.on.apply(l,a))}}return i}var l=this.binder(t);return l.on.apply(l,a)};Ta.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||cS(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var o=function(l,u,f){var c=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(c[2]={capture:f??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:c}),(t.addEventListener||t.on).apply(t,c),this};return{on:o,addEventListener:o,addListener:o,bind:o}};Ta.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Ta.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Ta.load=function(){var t=this,e=t.cy.window(),r=function(_){return _.selected()},n=function(_){var te=_.getRootNode();if(te&&te.nodeType===11&&te.host!==void 0)return te},a=function(_,te,oe,z){_==null&&(_=t.cy);for(var H=0;H<te.length;H++){var re=te[H];_.emit({originalEvent:oe,type:re,position:z})}},i=function(_){return _.shiftKey||_.metaKey||_.ctrlKey},o=function(_,te){var oe=!0;if(t.cy.hasCompoundNodes()&&_&&_.pannable())for(var z=0;te&&z<te.length;z++){var _=te[z];if(_.isNode()&&_.isParent()&&!_.pannable()){oe=!1;break}}else oe=!0;return oe},s=function(_){_[0]._private.grabbed=!0},l=function(_){_[0]._private.grabbed=!1},u=function(_){_[0]._private.rscratch.inDragLayer=!0},f=function(_){_[0]._private.rscratch.inDragLayer=!1},c=function(_){_[0]._private.rscratch.isGrabTarget=!0},h=function(_){_[0]._private.rscratch.isGrabTarget=!1},d=function(_,te){var oe=te.addToList,z=oe.has(_);!z&&_.grabbable()&&!_.locked()&&(oe.merge(_),s(_))},v=function(_,te){if(_.cy().hasCompoundNodes()&&!(te.inDragLayer==null&&te.addToList==null)){var oe=_.descendants();te.inDragLayer&&(oe.forEach(u),oe.connectedEdges().forEach(u)),te.addToList&&d(oe,te)}},p=function(_,te){te=te||{};var oe=_.cy().hasCompoundNodes();te.inDragLayer&&(_.forEach(u),_.neighborhood().stdFilter(function(z){return!oe||z.isEdge()}).forEach(u)),te.addToList&&_.forEach(function(z){d(z,te)}),v(_,te),y(_,{inDragLayer:te.inDragLayer}),t.updateCachedGrabbedEles()},m=p,g=function(_){_&&(t.getCachedZSortedEles().forEach(function(te){l(te),f(te),h(te)}),t.updateCachedGrabbedEles())},y=function(_,te){if(!(te.inDragLayer==null&&te.addToList==null)&&_.cy().hasCompoundNodes()){var oe=_.ancestors().orphans();if(!oe.same(_)){var z=oe.descendants().spawnSelf().merge(oe).unmerge(_).unmerge(_.descendants()),H=z.connectedEdges();te.inDragLayer&&(H.forEach(u),z.forEach(u)),te.addToList&&z.forEach(function(re){d(re,te)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},x=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";x?(t.removeObserver=new MutationObserver(function(de){for(var _=0;_<de.length;_++){var te=de[_],oe=te.removedNodes;if(oe)for(var z=0;z<oe.length;z++){var H=oe[z];if(H===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(de){t.destroy()});var O=es(function(){t.cy.resize()},100);x&&(t.styleObserver=new MutationObserver(O),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",O),C&&(t.resizeObserver=new ResizeObserver(O),t.resizeObserver.observe(t.container));var L=function(_,te){for(;_!=null;)te(_),_=_.parentNode},A=function(){t.invalidateContainerClientCoordsCache()};L(t.container,function(de){t.registerBinding(de,"transitionend",A),t.registerBinding(de,"animationend",A),t.registerBinding(de,"scroll",A)}),t.registerBinding(t.container,"contextmenu",function(de){de.preventDefault()});var I=function(){return t.selection[4]!==0},D=function(_){for(var te=t.findContainerClientCoords(),oe=te[0],z=te[1],H=te[2],re=te[3],W=_.touches?_.touches:[_],ae=!1,le=0;le<W.length;le++){var ye=W[le];if(oe<=ye.clientX&&ye.clientX<=oe+H&&z<=ye.clientY&&ye.clientY<=z+re){ae=!0;break}}if(!ae)return!1;for(var he=t.container,fe=_.target,pe=fe.parentNode,ge=!1;pe;){if(pe===he){ge=!0;break}pe=pe.parentNode}return!!ge};t.registerBinding(t.container,"mousedown",function(_){if(D(_)&&!(t.hoverData.which===1&&_.which!==1)){_.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=_.which;var te=t.cy,oe=[_.clientX,_.clientY],z=t.projectIntoViewport(oe[0],oe[1]),H=t.selection,re=t.findNearestElements(z[0],z[1],!0,!1),W=re[0],ae=t.dragData.possibleDragElements;t.hoverData.mdownPos=z,t.hoverData.mdownGPos=oe;var le=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var me=t.hoverData.down;me?me.emit({originalEvent:_,type:"taphold",position:{x:z[0],y:z[1]}}):te.emit({originalEvent:_,type:"taphold",position:{x:z[0],y:z[1]}})}},t.tapholdDuration)};if(_.which==3){t.hoverData.cxtStarted=!0;var ye={originalEvent:_,type:"cxttapstart",position:{x:z[0],y:z[1]}};W?(W.activate(),W.emit(ye),t.hoverData.down=W):te.emit(ye),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(_.which==1){W&&W.activate();{if(W!=null&&t.nodeIsGrabbable(W)){var he=function(me){return{originalEvent:_,type:me,position:{x:z[0],y:z[1]}}},fe=function(me){me.emit(he("grab"))};if(c(W),!W.selected())ae=t.dragData.possibleDragElements=te.collection(),m(W,{addToList:ae}),W.emit(he("grabon")).emit(he("grab"));else{ae=t.dragData.possibleDragElements=te.collection();var pe=te.$(function(ge){return ge.isNode()&&ge.selected()&&t.nodeIsGrabbable(ge)});p(pe,{addToList:ae}),W.emit(he("grabon")),pe.forEach(fe)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=W,t.hoverData.downs=re,t.hoverData.downTime=new Date().getTime()}a(W,["mousedown","tapstart","vmousedown"],_,{x:z[0],y:z[1]}),W==null?(H[4]=1,t.data.bgActivePosistion={x:z[0],y:z[1]},t.redrawHint("select",!0),t.redraw()):W.pannable()&&(H[4]=1),le()}H[0]=H[2]=z[0],H[1]=H[3]=z[1]}},!1);var M=n(t.container);t.registerBinding([e,M],"mousemove",function(_){var te=t.hoverData.capture;if(!(!te&&!D(_))){var oe=!1,z=t.cy,H=z.zoom(),re=[_.clientX,_.clientY],W=t.projectIntoViewport(re[0],re[1]),ae=t.hoverData.mdownPos,le=t.hoverData.mdownGPos,ye=t.selection,he=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(he=t.findNearestElement(W[0],W[1],!0,!1));var fe=t.hoverData.last,pe=t.hoverData.down,ge=[W[0]-ye[2],W[1]-ye[3]],me=t.dragData.possibleDragElements,Ne;if(le){var ze=re[0]-le[0],Oe=ze*ze,be=re[1]-le[1],Me=be*be,Te=Oe+Me;t.hoverData.isOverThresholdDrag=Ne=Te>=t.desktopTapThreshold2}var Ae=i(_);Ne&&(t.hoverData.tapholdCancelled=!0);var We=function(){var St=t.hoverData.dragDelta=t.hoverData.dragDelta||[];St.length===0?(St.push(ge[0]),St.push(ge[1])):(St[0]+=ge[0],St[1]+=ge[1])};oe=!0,a(he,["mousemove","vmousemove","tapdrag"],_,{x:W[0],y:W[1]});var Ke=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||z.emit({originalEvent:_,type:"boxstart",position:{x:W[0],y:W[1]}}),ye[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Ne){var st={originalEvent:_,type:"cxtdrag",position:{x:W[0],y:W[1]}};pe?pe.emit(st):z.emit(st),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||he!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:_,type:"cxtdragout",position:{x:W[0],y:W[1]}}),t.hoverData.cxtOver=he,he&&he.emit({originalEvent:_,type:"cxtdragover",position:{x:W[0],y:W[1]}}))}}else if(t.hoverData.dragging){if(oe=!0,z.panningEnabled()&&z.userPanningEnabled()){var He;if(t.hoverData.justStartedPan){var Ue=t.hoverData.mdownPos;He={x:(W[0]-Ue[0])*H,y:(W[1]-Ue[1])*H},t.hoverData.justStartedPan=!1}else He={x:ge[0]*H,y:ge[1]*H};z.panBy(He),z.emit("dragpan"),t.hoverData.dragged=!0}W=t.projectIntoViewport(_.clientX,_.clientY)}else if(ye[4]==1&&(pe==null||pe.pannable())){if(Ne){if(!t.hoverData.dragging&&z.boxSelectionEnabled()&&(Ae||!z.panningEnabled()||!z.userPanningEnabled()))Ke();else if(!t.hoverData.selecting&&z.panningEnabled()&&z.userPanningEnabled()){var yt=o(pe,t.hoverData.downs);yt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,ye[4]=0,t.data.bgActivePosistion=oa(ae),t.redrawHint("select",!0),t.redraw())}pe&&pe.pannable()&&pe.active()&&pe.unactivate()}}else{if(pe&&pe.pannable()&&pe.active()&&pe.unactivate(),(!pe||!pe.grabbed())&&he!=fe&&(fe&&a(fe,["mouseout","tapdragout"],_,{x:W[0],y:W[1]}),he&&a(he,["mouseover","tapdragover"],_,{x:W[0],y:W[1]}),t.hoverData.last=he),pe)if(Ne){if(z.boxSelectionEnabled()&&Ae)pe&&pe.grabbed()&&(g(me),pe.emit("freeon"),me.emit("free"),t.dragData.didDrag&&(pe.emit("dragfreeon"),me.emit("dragfree"))),Ke();else if(pe&&pe.grabbed()&&t.nodeIsDraggable(pe)){var Ve=!t.dragData.didDrag;Ve&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(me,{inDragLayer:!0});var je={x:0,y:0};if(we(ge[0])&&we(ge[1])&&(je.x+=ge[0],je.y+=ge[1],Ve)){var it=t.hoverData.dragDelta;it&&we(it[0])&&we(it[1])&&(je.x+=it[0],je.y+=it[1])}t.hoverData.draggingEles=!0,me.silentShift(je).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else We();oe=!0}if(ye[2]=W[0],ye[3]=W[1],oe)return _.stopPropagation&&_.stopPropagation(),_.preventDefault&&_.preventDefault(),!1}},!1);var E,S,w;t.registerBinding(e,"mouseup",function(_){if(!(t.hoverData.which===1&&_.which!==1&&t.hoverData.capture)){var te=t.hoverData.capture;if(te){t.hoverData.capture=!1;var oe=t.cy,z=t.projectIntoViewport(_.clientX,_.clientY),H=t.selection,re=t.findNearestElement(z[0],z[1],!0,!1),W=t.dragData.possibleDragElements,ae=t.hoverData.down,le=i(_);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ae&&ae.unactivate(),t.hoverData.which===3){var ye={originalEvent:_,type:"cxttapend",position:{x:z[0],y:z[1]}};if(ae?ae.emit(ye):oe.emit(ye),!t.hoverData.cxtDragged){var he={originalEvent:_,type:"cxttap",position:{x:z[0],y:z[1]}};ae?ae.emit(he):oe.emit(he)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(a(re,["mouseup","tapend","vmouseup"],_,{x:z[0],y:z[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(a(ae,["click","tap","vclick"],_,{x:z[0],y:z[1]}),S=!1,_.timeStamp-w<=oe.multiClickDebounceTime()?(E&&clearTimeout(E),S=!0,w=null,a(ae,["dblclick","dbltap","vdblclick"],_,{x:z[0],y:z[1]})):(E=setTimeout(function(){S||a(ae,["oneclick","onetap","voneclick"],_,{x:z[0],y:z[1]})},oe.multiClickDebounceTime()),w=_.timeStamp)),ae==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(_)&&(oe.$(r).unselect(["tapunselect"]),W.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=W=oe.collection()),re==ae&&!t.dragData.didDrag&&!t.hoverData.selecting&&re!=null&&re._private.selectable&&(t.hoverData.dragging||(oe.selectionType()==="additive"||le?re.selected()?re.unselect(["tapunselect"]):re.select(["tapselect"]):le||(oe.$(r).unmerge(re).unselect(["tapunselect"]),re.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var fe=oe.collection(t.getAllInBox(H[0],H[1],H[2],H[3]));t.redrawHint("select",!0),fe.length>0&&t.redrawHint("eles",!0),oe.emit({type:"boxend",originalEvent:_,position:{x:z[0],y:z[1]}});var pe=function(Ne){return Ne.selectable()&&!Ne.selected()};oe.selectionType()==="additive"||le||oe.$(r).unmerge(fe).unselect(),fe.emit("box").stdFilter(pe).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!H[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var ge=ae&&ae.grabbed();g(W),ge&&(ae.emit("freeon"),W.emit("free"),t.dragData.didDrag&&(ae.emit("dragfreeon"),W.emit("dragfree")))}}H[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var N=function(_){if(!t.scrollingPage){var te=t.cy,oe=te.zoom(),z=te.pan(),H=t.projectIntoViewport(_.clientX,_.clientY),re=[H[0]*oe+z.x,H[1]*oe+z.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||I()){_.preventDefault();return}if(te.panningEnabled()&&te.userPanningEnabled()&&te.zoomingEnabled()&&te.userZoomingEnabled()){_.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var W;_.deltaY!=null?W=_.deltaY/-250:_.wheelDeltaY!=null?W=_.wheelDeltaY/1e3:W=_.wheelDelta/1e3,W=W*t.wheelSensitivity;var ae=_.deltaMode===1;ae&&(W*=33);var le=te.zoom()*Math.pow(10,W);_.type==="gesturechange"&&(le=t.gestureStartZoom*_.scale),te.zoom({level:le,renderedPosition:{x:re[0],y:re[1]}}),te.emit(_.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",N,!0),t.registerBinding(e,"scroll",function(_){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(_){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||_.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(de){t.hasTouchStarted||N(de)},!0),t.registerBinding(t.container,"mouseout",function(_){var te=t.projectIntoViewport(_.clientX,_.clientY);t.cy.emit({originalEvent:_,type:"mouseout",position:{x:te[0],y:te[1]}})},!1),t.registerBinding(t.container,"mouseover",function(_){var te=t.projectIntoViewport(_.clientX,_.clientY);t.cy.emit({originalEvent:_,type:"mouseover",position:{x:te[0],y:te[1]}})},!1);var T,R,P,k,U,B,V,j,Y,Z,K,G,$,q=function(_,te,oe,z){return Math.sqrt((oe-_)*(oe-_)+(z-te)*(z-te))},X=function(_,te,oe,z){return(oe-_)*(oe-_)+(z-te)*(z-te)},ee;t.registerBinding(t.container,"touchstart",ee=function(_){if(t.hasTouchStarted=!0,!!D(_)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var te=t.cy,oe=t.touchData.now,z=t.touchData.earlier;if(_.touches[0]){var H=t.projectIntoViewport(_.touches[0].clientX,_.touches[0].clientY);oe[0]=H[0],oe[1]=H[1]}if(_.touches[1]){var H=t.projectIntoViewport(_.touches[1].clientX,_.touches[1].clientY);oe[2]=H[0],oe[3]=H[1]}if(_.touches[2]){var H=t.projectIntoViewport(_.touches[2].clientX,_.touches[2].clientY);oe[4]=H[0],oe[5]=H[1]}if(_.touches[1]){t.touchData.singleTouchMoved=!0,g(t.dragData.touchDragEles);var re=t.findContainerClientCoords();Y=re[0],Z=re[1],K=re[2],G=re[3],T=_.touches[0].clientX-Y,R=_.touches[0].clientY-Z,P=_.touches[1].clientX-Y,k=_.touches[1].clientY-Z,$=0<=T&&T<=K&&0<=P&&P<=K&&0<=R&&R<=G&&0<=k&&k<=G;var W=te.pan(),ae=te.zoom();U=q(T,R,P,k),B=X(T,R,P,k),V=[(T+P)/2,(R+k)/2],j=[(V[0]-W.x)/ae,(V[1]-W.y)/ae];var le=200,ye=le*le;if(B<ye&&!_.touches[2]){var he=t.findNearestElement(oe[0],oe[1],!0,!0),fe=t.findNearestElement(oe[2],oe[3],!0,!0);he&&he.isNode()?(he.activate().emit({originalEvent:_,type:"cxttapstart",position:{x:oe[0],y:oe[1]}}),t.touchData.start=he):fe&&fe.isNode()?(fe.activate().emit({originalEvent:_,type:"cxttapstart",position:{x:oe[0],y:oe[1]}}),t.touchData.start=fe):te.emit({originalEvent:_,type:"cxttapstart",position:{x:oe[0],y:oe[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(_.touches[2])te.boxSelectionEnabled()&&_.preventDefault();else if(!_.touches[1]){if(_.touches[0]){var pe=t.findNearestElements(oe[0],oe[1],!0,!0),ge=pe[0];if(ge!=null&&(ge.activate(),t.touchData.start=ge,t.touchData.starts=pe,t.nodeIsGrabbable(ge))){var me=t.dragData.touchDragEles=te.collection(),Ne=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),ge.selected()?(Ne=te.$(function(Te){return Te.selected()&&t.nodeIsGrabbable(Te)}),p(Ne,{addToList:me})):m(ge,{addToList:me}),c(ge);var ze=function(Ae){return{originalEvent:_,type:Ae,position:{x:oe[0],y:oe[1]}}};ge.emit(ze("grabon")),Ne?Ne.forEach(function(Te){Te.emit(ze("grab"))}):ge.emit(ze("grab"))}a(ge,["touchstart","tapstart","vmousedown"],_,{x:oe[0],y:oe[1]}),ge==null&&(t.data.bgActivePosistion={x:H[0],y:H[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&a(t.touchData.start,["taphold"],_,{x:oe[0],y:oe[1]})},t.tapholdDuration)}}if(_.touches.length>=1){for(var Oe=t.touchData.startPosition=[null,null,null,null,null,null],be=0;be<oe.length;be++)Oe[be]=z[be]=oe[be];var Me=_.touches[0];t.touchData.startGPosition=[Me.clientX,Me.clientY]}}},!1);var ce;t.registerBinding(e,"touchmove",ce=function(_){var te=t.touchData.capture;if(!(!te&&!D(_))){var oe=t.selection,z=t.cy,H=t.touchData.now,re=t.touchData.earlier,W=z.zoom();if(_.touches[0]){var ae=t.projectIntoViewport(_.touches[0].clientX,_.touches[0].clientY);H[0]=ae[0],H[1]=ae[1]}if(_.touches[1]){var ae=t.projectIntoViewport(_.touches[1].clientX,_.touches[1].clientY);H[2]=ae[0],H[3]=ae[1]}if(_.touches[2]){var ae=t.projectIntoViewport(_.touches[2].clientX,_.touches[2].clientY);H[4]=ae[0],H[5]=ae[1]}var le=t.touchData.startGPosition,ye;if(te&&_.touches[0]&&le){for(var he=[],fe=0;fe<H.length;fe++)he[fe]=H[fe]-re[fe];var pe=_.touches[0].clientX-le[0],ge=pe*pe,me=_.touches[0].clientY-le[1],Ne=me*me,ze=ge+Ne;ye=ze>=t.touchTapThreshold2}if(te&&t.touchData.cxt){_.preventDefault();var Oe=_.touches[0].clientX-Y,be=_.touches[0].clientY-Z,Me=_.touches[1].clientX-Y,Te=_.touches[1].clientY-Z,Ae=X(Oe,be,Me,Te),We=Ae/B,Ke=150,st=Ke*Ke,He=1.5,Ue=He*He;if(We>=Ue||Ae>=st){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var yt={originalEvent:_,type:"cxttapend",position:{x:H[0],y:H[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(yt),t.touchData.start=null):z.emit(yt)}}if(te&&t.touchData.cxt){var yt={originalEvent:_,type:"cxtdrag",position:{x:H[0],y:H[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(yt):z.emit(yt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Ve=t.findNearestElement(H[0],H[1],!0,!0);(!t.touchData.cxtOver||Ve!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:_,type:"cxtdragout",position:{x:H[0],y:H[1]}}),t.touchData.cxtOver=Ve,Ve&&Ve.emit({originalEvent:_,type:"cxtdragover",position:{x:H[0],y:H[1]}}))}else if(te&&_.touches[2]&&z.boxSelectionEnabled())_.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||z.emit({originalEvent:_,type:"boxstart",position:{x:H[0],y:H[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,oe[4]=1,!oe||oe.length===0||oe[0]===void 0?(oe[0]=(H[0]+H[2]+H[4])/3,oe[1]=(H[1]+H[3]+H[5])/3,oe[2]=(H[0]+H[2]+H[4])/3+1,oe[3]=(H[1]+H[3]+H[5])/3+1):(oe[2]=(H[0]+H[2]+H[4])/3,oe[3]=(H[1]+H[3]+H[5])/3),t.redrawHint("select",!0),t.redraw();else if(te&&_.touches[1]&&!t.touchData.didSelect&&z.zoomingEnabled()&&z.panningEnabled()&&z.userZoomingEnabled()&&z.userPanningEnabled()){_.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var je=t.dragData.touchDragEles;if(je){t.redrawHint("drag",!0);for(var it=0;it<je.length;it++){var Gr=je[it]._private;Gr.grabbed=!1,Gr.rscratch.inDragLayer=!1}}var St=t.touchData.start,Oe=_.touches[0].clientX-Y,be=_.touches[0].clientY-Z,Me=_.touches[1].clientX-Y,Te=_.touches[1].clientY-Z,Nr=q(Oe,be,Me,Te),Vr=Nr/U;if($){var Or=Oe-T,Kn=be-R,Hr=Me-P,$r=Te-k,yo=(Or+Hr)/2,$a=(Kn+$r)/2,Yr=z.zoom(),mn=Yr*Vr,jn=z.pan(),Zn=j[0]*Yr+jn.x,Ya=j[1]*Yr+jn.y,mo={x:-mn/Yr*(Zn-jn.x-yo)+Zn,y:-mn/Yr*(Ya-jn.y-$a)+Ya};if(St&&St.active()){var je=t.dragData.touchDragEles;g(je),t.redrawHint("drag",!0),t.redrawHint("eles",!0),St.unactivate().emit("freeon"),je.emit("free"),t.dragData.didDrag&&(St.emit("dragfreeon"),je.emit("dragfree"))}z.viewport({zoom:mn,pan:mo,cancelOnFailedZoom:!0}),z.emit("pinchzoom"),U=Nr,T=Oe,R=be,P=Me,k=Te,t.pinching=!0}if(_.touches[0]){var ae=t.projectIntoViewport(_.touches[0].clientX,_.touches[0].clientY);H[0]=ae[0],H[1]=ae[1]}if(_.touches[1]){var ae=t.projectIntoViewport(_.touches[1].clientX,_.touches[1].clientY);H[2]=ae[0],H[3]=ae[1]}if(_.touches[2]){var ae=t.projectIntoViewport(_.touches[2].clientX,_.touches[2].clientY);H[4]=ae[0],H[5]=ae[1]}}else if(_.touches[0]&&!t.touchData.didSelect){var zt=t.touchData.start,Qn=t.touchData.last,Ve;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Ve=t.findNearestElement(H[0],H[1],!0,!0)),te&&zt!=null&&_.preventDefault(),te&&zt!=null&&t.nodeIsDraggable(zt))if(ye){var je=t.dragData.touchDragEles,bt=!t.dragData.didDrag;bt&&p(je,{inDragLayer:!0}),t.dragData.didDrag=!0;var Be={x:0,y:0};if(we(he[0])&&we(he[1])&&(Be.x+=he[0],Be.y+=he[1],bt)){t.redrawHint("eles",!0);var Ge=t.touchData.dragDelta;Ge&&we(Ge[0])&&we(Ge[1])&&(Be.x+=Ge[0],Be.y+=Ge[1])}t.hoverData.draggingEles=!0,je.silentShift(Be).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==re[0]&&t.touchData.startPosition[1]==re[1]&&t.redrawHint("eles",!0),t.redraw()}else{var Ge=t.touchData.dragDelta=t.touchData.dragDelta||[];Ge.length===0?(Ge.push(he[0]),Ge.push(he[1])):(Ge[0]+=he[0],Ge[1]+=he[1])}if(a(zt||Ve,["touchmove","tapdrag","vmousemove"],_,{x:H[0],y:H[1]}),(!zt||!zt.grabbed())&&Ve!=Qn&&(Qn&&Qn.emit({originalEvent:_,type:"tapdragout",position:{x:H[0],y:H[1]}}),Ve&&Ve.emit({originalEvent:_,type:"tapdragover",position:{x:H[0],y:H[1]}})),t.touchData.last=Ve,te)for(var it=0;it<H.length;it++)H[it]&&t.touchData.startPosition[it]&&ye&&(t.touchData.singleTouchMoved=!0);if(te&&(zt==null||zt.pannable())&&z.panningEnabled()&&z.userPanningEnabled()){var hr=o(zt,t.touchData.starts);hr&&(_.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=oa(t.touchData.startPosition)),t.swipePanning?(z.panBy({x:he[0]*W,y:he[1]*W}),z.emit("dragpan")):ye&&(t.swipePanning=!0,z.panBy({x:pe*W,y:me*W}),z.emit("dragpan"),zt&&(zt.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ae=t.projectIntoViewport(_.touches[0].clientX,_.touches[0].clientY);H[0]=ae[0],H[1]=ae[1]}}for(var fe=0;fe<H.length;fe++)re[fe]=H[fe];te&&_.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Ee;t.registerBinding(e,"touchcancel",Ee=function(_){var te=t.touchData.start;t.touchData.capture=!1,te&&te.unactivate()});var ne,Q,se,J;if(t.registerBinding(e,"touchend",ne=function(_){var te=t.touchData.start,oe=t.touchData.capture;if(oe)_.touches.length===0&&(t.touchData.capture=!1),_.preventDefault();else return;var z=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var H=t.cy,re=H.zoom(),W=t.touchData.now,ae=t.touchData.earlier;if(_.touches[0]){var le=t.projectIntoViewport(_.touches[0].clientX,_.touches[0].clientY);W[0]=le[0],W[1]=le[1]}if(_.touches[1]){var le=t.projectIntoViewport(_.touches[1].clientX,_.touches[1].clientY);W[2]=le[0],W[3]=le[1]}if(_.touches[2]){var le=t.projectIntoViewport(_.touches[2].clientX,_.touches[2].clientY);W[4]=le[0],W[5]=le[1]}te&&te.unactivate();var ye;if(t.touchData.cxt){if(ye={originalEvent:_,type:"cxttapend",position:{x:W[0],y:W[1]}},te?te.emit(ye):H.emit(ye),!t.touchData.cxtDragged){var he={originalEvent:_,type:"cxttap",position:{x:W[0],y:W[1]}};te?te.emit(he):H.emit(he)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!_.touches[2]&&H.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var fe=H.collection(t.getAllInBox(z[0],z[1],z[2],z[3]));z[0]=void 0,z[1]=void 0,z[2]=void 0,z[3]=void 0,z[4]=0,t.redrawHint("select",!0),H.emit({type:"boxend",originalEvent:_,position:{x:W[0],y:W[1]}});var pe=function(st){return st.selectable()&&!st.selected()};fe.emit("box").stdFilter(pe).select().emit("boxselect"),fe.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(te?.unactivate(),_.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!_.touches[1]){if(!_.touches[0]){if(!_.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ge=t.dragData.touchDragEles;if(te!=null){var me=te._private.grabbed;g(ge),t.redrawHint("drag",!0),t.redrawHint("eles",!0),me&&(te.emit("freeon"),ge.emit("free"),t.dragData.didDrag&&(te.emit("dragfreeon"),ge.emit("dragfree"))),a(te,["touchend","tapend","vmouseup","tapdragout"],_,{x:W[0],y:W[1]}),te.unactivate(),t.touchData.start=null}else{var Ne=t.findNearestElement(W[0],W[1],!0,!0);a(Ne,["touchend","tapend","vmouseup","tapdragout"],_,{x:W[0],y:W[1]})}var ze=t.touchData.startPosition[0]-W[0],Oe=ze*ze,be=t.touchData.startPosition[1]-W[1],Me=be*be,Te=Oe+Me,Ae=Te*re*re;t.touchData.singleTouchMoved||(te||H.$(":selected").unselect(["tapunselect"]),a(te,["tap","vclick"],_,{x:W[0],y:W[1]}),Q=!1,_.timeStamp-J<=H.multiClickDebounceTime()?(se&&clearTimeout(se),Q=!0,J=null,a(te,["dbltap","vdblclick"],_,{x:W[0],y:W[1]})):(se=setTimeout(function(){Q||a(te,["onetap","voneclick"],_,{x:W[0],y:W[1]})},H.multiClickDebounceTime()),J=_.timeStamp)),te!=null&&!t.dragData.didDrag&&te._private.selectable&&Ae<t.touchTapThreshold2&&!t.pinching&&(H.selectionType()==="single"?(H.$(r).unmerge(te).unselect(["tapunselect"]),te.select(["tapselect"])):te.selected()?te.unselect(["tapunselect"]):te.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var We=0;We<W.length;We++)ae[We]=W[We];t.dragData.didDrag=!1,_.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),_.touches.length<2&&(_.touches.length===1&&(t.touchData.startGPosition=[_.touches[0].clientX,_.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ie=[],ve=function(_){return{clientX:_.clientX,clientY:_.clientY,force:1,identifier:_.pointerId,pageX:_.pageX,pageY:_.pageY,radiusX:_.width/2,radiusY:_.height/2,screenX:_.screenX,screenY:_.screenY,target:_.target}},Se=function(_){return{event:_,touch:ve(_)}},Ce=function(_){ie.push(Se(_))},xe=function(_){for(var te=0;te<ie.length;te++){var oe=ie[te];if(oe.event.pointerId===_.pointerId){ie.splice(te,1);return}}},De=function(_){var te=ie.filter(function(oe){return oe.event.pointerId===_.pointerId})[0];te.event=_,te.touch=ve(_)},Le=function(_){_.touches=ie.map(function(te){return te.touch})},Pe=function(_){return _.pointerType==="mouse"||_.pointerType===4};t.registerBinding(t.container,"pointerdown",function(de){Pe(de)||(de.preventDefault(),Ce(de),Le(de),ee(de))}),t.registerBinding(t.container,"pointerup",function(de){Pe(de)||(xe(de),Le(de),ne(de))}),t.registerBinding(t.container,"pointercancel",function(de){Pe(de)||(xe(de),Le(de),Ee(de))}),t.registerBinding(t.container,"pointermove",function(de){Pe(de)||(de.preventDefault(),De(de),Le(de),ce(de))})}};var Rr={};Rr.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,a,i,o,s,l){this.renderer.nodeShapeImpl("polygon",n,a,i,o,s,this.points)},intersectLine:function(n,a,i,o,s,l,u,f){return fi(s,l,this.points,n,a,i/2,o/2,u)},checkPoint:function(n,a,i,o,s,l,u,f){return Dr(n,a,this.points,l,u,o,s,[0,-1],i)}}};Rr.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,o,s,l){return aN(i,o,e,r,n/2+s,a/2+s)},checkPoint:function(e,r,n,a,i,o,s,l){return Sn(e,r,a,i,o,s,n)}}};Rr.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,a,i,o,s,l,u){if(l[u]!==void 0&&l[u+"-cx"]===n&&l[u+"-cy"]===a)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=a;var f=i/2,c=o/2;s=s==="auto"?cd(i,o):s;for(var h=new Array(e.length/2),d=0;d<e.length/2;d++)h[d]={x:n+f*e[d*2],y:a+c*e[d*2+1]};var v,p,m,g,y=h.length;for(p=h[y-1],v=0;v<y;v++)m=h[v%y],g=h[(v+1)%y],l[u][v]=ul(p,m,g,s),p=m,m=g;return l[u]},draw:function(n,a,i,o,s,l,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,o,s,this.points,this.getOrCreateCorners(a,i,o,s,l,u,"drawCorners"))},intersectLine:function(n,a,i,o,s,l,u,f,c){return iN(s,l,this.points,n,a,i,o,u,this.getOrCreateCorners(n,a,i,o,f,c,"corners"))},checkPoint:function(n,a,i,o,s,l,u,f,c){return nN(n,a,this.points,l,u,o,s,this.getOrCreateCorners(l,u,o,s,f,c,"corners"))}}};Rr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Ut(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,o)},intersectLine:function(e,r,n,a,i,o,s,l){return ld(i,o,e,r,n,a,s,l)},checkPoint:function(e,r,n,a,i,o,s,l){var u=a/2,f=i/2;l=l==="auto"?An(a,i):l,l=Math.min(u,f,l);var c=l*2;return!!(Dr(e,r,this.points,o,s,a,i-c,[0,-1],n)||Dr(e,r,this.points,o,s,a-c,i,[0,-1],n)||Sn(e,r,c,c,o-u+l,s-f+l,n)||Sn(e,r,c,c,o+u-l,s-f+l,n)||Sn(e,r,c,c,o+u-l,s+f-l,n)||Sn(e,r,c,c,o-u+l,s+f-l,n))}}};Rr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:ju(),points:Ut(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,null,o)},generateCutTrianglePts:function(e,r,n,a,i){var o=i==="auto"?this.cornerLength:i,s=r/2,l=e/2,u=n-l,f=n+l,c=a-s,h=a+s;return{topLeft:[u,c+o,u+o,c,u+o,c+o],topRight:[f-o,c,f,c+o,f-o,c+o],bottomRight:[f,h-o,f-o,h,f-o,h-o],bottomLeft:[u+o,h,u,h-o,u+o,h-o]}},intersectLine:function(e,r,n,a,i,o,s,l){var u=this.generateCutTrianglePts(n+2*s,a+2*s,e,r,l),f=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return fi(i,o,f,e,r)},checkPoint:function(e,r,n,a,i,o,s,l){var u=l==="auto"?this.cornerLength:l;if(Dr(e,r,this.points,o,s,a,i-2*u,[0,-1],n)||Dr(e,r,this.points,o,s,a-2*u,i,[0,-1],n))return!0;var f=this.generateCutTrianglePts(a,i,o,s);return Vt(e,r,f.topLeft)||Vt(e,r,f.topRight)||Vt(e,r,f.bottomRight)||Vt(e,r,f.bottomLeft)}}};Rr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Ut(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,o,s,l){var u=.15,f=.5,c=.85,h=this.generateBarrelBezierPts(n+2*s,a+2*s,e,r),d=function(m){var g=ua({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},u),y=ua({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},f),b=ua({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},c);return[m[0],m[1],g.x,g.y,y.x,y.y,b.x,b.y,m[4],m[5]]},v=[].concat(d(h.topLeft),d(h.topRight),d(h.bottomRight),d(h.bottomLeft));return fi(i,o,v,e,r)},generateBarrelBezierPts:function(e,r,n,a){var i=r/2,o=e/2,s=n-o,l=n+o,u=a-i,f=a+i,c=Lu(e,r),h=c.heightOffset,d=c.widthOffset,v=c.ctrlPtOffsetPct*e,p={topLeft:[s,u+h,s+v,u,s+d,u],topRight:[l-d,u,l-v,u,l,u+h],bottomRight:[l,f-h,l-v,f,l-d,f],bottomLeft:[s+d,f,s+v,f,s,f-h]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,r,n,a,i,o,s,l){var u=Lu(a,i),f=u.heightOffset,c=u.widthOffset;if(Dr(e,r,this.points,o,s,a,i-2*f,[0,-1],n)||Dr(e,r,this.points,o,s,a-2*c,i,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(a,i,o,s),d=function(A,I,D){var M=D[4],E=D[2],S=D[0],w=D[5],N=D[1],T=Math.min(M,S),R=Math.max(M,S),P=Math.min(w,N),k=Math.max(w,N);if(T<=A&&A<=R&&P<=I&&I<=k){var U=oN(M,E,S),B=JL(U[0],U[1],U[2],A),V=B.filter(function(j){return 0<=j&&j<=1});if(V.length>0)return V[0]}return null},v=Object.keys(h),p=0;p<v.length;p++){var m=v[p],g=h[m],y=d(e,r,g);if(y!=null){var b=g[5],x=g[3],C=g[1],O=Lt(b,x,C,y);if(g.isTop&&O<=r||g.isBottom&&r<=O)return!0}}return!1}}};Rr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Ut(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,o)},intersectLine:function(e,r,n,a,i,o,s,l){var u=e-(n/2+s),f=r-(a/2+s),c=f,h=e+(n/2+s),d=jr(i,o,e,r,u,f,h,c,!1);return d.length>0?d:ld(i,o,e,r,n,a,s,l)},checkPoint:function(e,r,n,a,i,o,s,l){l=l==="auto"?An(a,i):l;var u=2*l;if(Dr(e,r,this.points,o,s,a,i-u,[0,-1],n)||Dr(e,r,this.points,o,s,a-u,i,[0,-1],n))return!0;var f=a/2+2*n,c=i/2+2*n,h=[o-f,s-c,o-f,s,o+f,s,o+f,s-c];return!!(Vt(e,r,h)||Sn(e,r,u,u,o+a/2-l,s+i/2-l,n)||Sn(e,r,u,u,o-a/2+l,s+i/2-l,n))}}};Rr.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Ut(3,0)),this.generateRoundPolygon("round-triangle",Ut(3,0)),this.generatePolygon("rectangle",Ut(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Ut(5,0)),this.generateRoundPolygon("round-pentagon",Ut(5,0)),this.generatePolygon("hexagon",Ut(6,0)),this.generateRoundPolygon("round-hexagon",Ut(6,0)),this.generatePolygon("heptagon",Ut(7,0)),this.generateRoundPolygon("round-heptagon",Ut(7,0)),this.generatePolygon("octagon",Ut(8,0)),this.generateRoundPolygon("round-octagon",Ut(8,0));var n=new Array(20);{var a=Su(5,0),i=Su(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)n[s*4]=a[s*2],n[s*4+1]=a[s*2+1],n[s*4+2]=i[s*2],n[s*4+3]=i[s*2+1]}n=fd(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l)}t.makePolygon=function(u){var f=u.join("$"),c="polygon-"+f,h;return(h=this[c])?h:e.generatePolygon(c,u)}};var Ti={};Ti.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Ti.redraw=function(t){t=t||ad();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};Ti.beforeRender=function(t,e){if(!this.destroyed){e==null&&pt("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,a){return a.priority-n.priority})}};var Ah=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};Ti.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function n(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){Ah(t,!0,a);var i=Ir();t.render(t.renderOptions);var o=t.lastDrawTime=Ir();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var s=o-i;t.redrawTotalTime+=s,t.lastRedrawTime=s,t.averageRedrawTime=t.averageRedrawTime/2+s/2,t.requestedFrame=!1}else Ah(t,!1,a);t.skipFrame=!1,Go(n)}};Go(r)}};var UD=function(e){this.init(e)},lv=UD,Ca=lv.prototype;Ca.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Ca.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,o="__________cytoscape_stylesheet",s="__________cytoscape_container",l=a.getElementById(o)!=null;if(r.className.indexOf(s)<0&&(r.className=(r.className||"")+" "+s),!l){var u=a.createElement("style");u.id=o,u.textContent="."+s+" { position: relative; }",i.insertBefore(u,i.children[0])}var f=n.getComputedStyle(r),c=f.getPropertyValue("position");c==="static"&&nt("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=we(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};Ca.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Ca.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r,a=n.target;(a.off||a.removeEventListener).apply(a,n.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};Ca.isHeadless=function(){return!1};[sl,sv,uv,Ta,Rr,Ti].forEach(function(t){_e(Ca,t)});var xu=1e3/60,fv={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=es(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(u,f){var c=Ir(),h=a.averageRedrawTime,d=a.lastRedrawTime,v=[],p=a.cy.extent(),m=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var g=Ir(),y=g-c,b=g-f;if(d<xu){var x=xu-(u?h:0);if(b>=e.deqFastCost*x)break}else if(u){if(y>=e.deqCost*d||y>=e.deqAvgCost*h)break}else if(b>=e.deqNoDrawCost*xu)break;var C=e.deq(n,m,p);if(C.length>0)for(var O=0;O<C.length;O++)v.push(C[O]);else break}v.length>0&&(e.onDeqd(n,v),!u&&e.shouldRedraw(n,v,m,p)&&i())},s=e.priority||Yu;a.beforeRender(o,s(n))}}}},GD=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vo;Uu(this,t),this.idsByKey=new gr,this.keyForId=new gr,this.cachesByLvl=new gr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Gu(t,[{key:"getIdsFor",value:function(r){r==null&&pt("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new ga,n.set(r,a)),a}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);return a!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,a=this.lvls,i=n.get(r);return i||(i=new gr,n.set(r,i),a.push(r)),i}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var a=this.getKey(r),i=this.getCache(a,n);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,n){var a=this.keyForId.get(r.id()),i=this.getCache(a,n);return i}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var a=this.getKey(r);return this.hasCache(a,n)}},{key:"setCache",value:function(r,n,a){a.key=r,this.getCachesAt(n).set(r,a)}},{key:"set",value:function(r,n,a){var i=this.getKey(r);this.setCache(i,n,a),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var a=this.getKey(r);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(a){return n.deleteCache(r,a)})}},{key:"invalidate",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}]),t})(),Ih=25,Do=50,zo=-4,Bu=3,VD=7.99,HD=8,$D=1024,YD=1024,WD=1024,XD=.2,KD=.8,jD=10,ZD=.15,QD=.1,JD=.9,eM=.9,tM=100,rM=1,sa={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},nM=Dt({getKey:null,doesEleInvalidateKey:Vo,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:td,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ri=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=nM(r);_e(n,a),n.lookup=new GD(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},Ct=ri.prototype;Ct.reasons=sa;Ct.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Ct.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};Ct.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new bi(function(r,n){return n.reqs-r.reqs});return e};Ct.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Ct.getElement=function(t,e,r,n,a){var i=this,o=this.renderer,s=o.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(Xu(s*r))),n<zo)n=zo;else if(s>=VD||n>Bu)return null;var u=Math.pow(2,n),f=e.h*u,c=e.w*u,h=o.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,h))return null;var d=l.get(t,n);if(d&&d.invalidated&&(d.invalidated=!1,d.texture.invalidatedWidth-=d.width),d)return d;var v;if(f<=Ih?v=Ih:f<=Do?v=Do:v=Math.ceil(f/Do)*Do,f>WD||c>YD)return null;var p=i.getTextureQueue(v),m=p[p.length-2],g=function(){return i.recycleTexture(v,c)||i.addTexture(v,c)};m||(m=p[p.length-1]),m||(m=g()),m.width-m.usedWidth<c&&(m=g());for(var y=function(T){return T&&T.scaledLabelShown===h},b=a&&a===sa.dequeue,x=a&&a===sa.highQuality,C=a&&a===sa.downscale,O,L=n+1;L<=Bu;L++){var A=l.get(t,L);if(A){O=A;break}}var I=O&&O.level===n+1?O:null,D=function(){m.context.drawImage(I.texture.canvas,I.x,0,I.width,I.height,m.usedWidth,0,c,f)};if(m.context.setTransform(1,0,0,1,0,0),m.context.clearRect(m.usedWidth,0,c,v),y(I))D();else if(y(O))if(x){for(var M=O.level;M>n;M--)I=i.getElement(t,e,r,M,sa.downscale);D()}else return i.queueElement(t,O.level-1),O;else{var E;if(!b&&!x&&!C)for(var S=n-1;S>=zo;S--){var w=l.get(t,S);if(w){E=w;break}}if(y(E))return i.queueElement(t,n),E;m.context.translate(m.usedWidth,0),m.context.scale(u,u),this.drawElement(m.context,t,e,h,!1),m.context.scale(1/u,1/u),m.context.translate(-m.usedWidth,0)}return d={x:m.usedWidth,texture:m,level:n,scale:u,width:c,height:f,scaledLabelShown:h},m.usedWidth+=Math.ceil(c+HD),m.eleCaches.push(d),l.set(t,n,d),i.checkTextureFullness(m),d};Ct.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};Ct.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=zo;i<=Bu;i++){var o=r.getForCachedKey(t,i);o&&n.push(o)}var s=r.invalidate(t);if(s)for(var l=0;l<n.length;l++){var u=n[l],f=u.texture;f.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(f)}e.removeFromQueue(t)}};Ct.checkTextureUtility=function(t){t.invalidatedWidth>=XD*t.width&&this.retireTexture(t)};Ct.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>KD&&t.fullnessChecks>=jD?en(r,t):t.fullnessChecks++};Ct.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;en(n,t),t.retired=!0;for(var i=t.eleCaches,o=0;o<i.length;o++){var s=i[o];a.deleteCache(s.key,s.level)}Wu(i);var l=e.getRetiredTextureQueue(r);l.push(t)};Ct.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),a={};return n.push(a),a.eleCaches=[],a.height=t,a.width=Math.max($D,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=r.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a};Ct.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),a=r.getRetiredTextureQueue(t),i=0;i<a.length;i++){var o=a[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Wu(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),en(a,o),n.push(o),o}};Ct.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),i=this.getKey(t),o=a[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,n.updateItem(o);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(s),a[i]=s}};Ct.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<rM&&r.size()>0;o++){var s=r.pop(),l=s.key,u=s.eles[0],f=i.hasCache(u,s.level);if(n[l]=null,f)continue;a.push(s);var c=e.getBoundingBox(u);e.getElement(u,c,t,s.level,sa.dequeue)}return a};Ct.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(t),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=$u,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))};Ct.onDequeue=function(t){this.onDequeues.push(t)};Ct.offDequeue=function(t){en(this.onDequeues,t)};Ct.setupDequeueing=fv.setupDequeueing({deqRedrawThreshold:tM,deqCost:ZD,deqAvgCost:QD,deqNoDrawCost:JD,deqFastCost:eM,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(r)}},shouldRedraw:function(e,r,n,a){for(var i=0;i<r.length;i++)for(var o=r[i].eles,s=0;s<o.length;s++){var l=o[s].boundingBox();if(Ku(l,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var aM=1,ai=-4,Zo=2,iM=3.99,oM=50,sM=50,uM=.15,lM=.1,fM=.9,cM=.9,hM=1,Dh=250,dM=4e3*4e3,Mh=32767,vM=!0,cv=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Ir()-2*Dh,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=es(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},sM),n.beforeRender(function(o,s){s-r.lastInvalidationTime<=Dh?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(s,l){return l.reqs-s.reqs};r.layersQueue=new bi(i),r.setupDequeueing()},Mt=cv.prototype,Rh=0,pM=Math.pow(2,53)-1;Mt.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),a=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(n,a),o={id:Rh=++Rh%pM,bb:t,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,l=-o.bb.x1,u=-o.bb.y1;return s.scale(r,r),s.translate(l,u),o};Mt.getLayers=function(t,e,r){var n=this,a=n.renderer,i=a.cy,o=i.zoom(),s=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(Xu(o*e)),r<ai)r=ai;else if(o>=iM||r>Zo)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),f=l[r]=l[r]||[],c,h=n.levelIsComplete(r,t),d,v=function(){var D=function(N){if(n.validateLayersElesOrdering(N,t),n.levelIsComplete(N,t))return d=l[N],!0},M=function(N){if(!d)for(var T=r+N;ai<=T&&T<=Zo&&!D(T);T+=N);};M(1),M(-1);for(var E=f.length-1;E>=0;E--){var S=f[E];S.invalid&&en(f,S)}};if(!h)v();else return f;var p=function(){if(!c){c=Ht();for(var D=0;D<t.length;D++)sd(c,t[D].boundingBox())}return c},m=function(D){D=D||{};var M=D.after;p();var E=Math.ceil(c.w*u),S=Math.ceil(c.h*u);if(E>Mh||S>Mh)return null;var w=E*S;if(w>dM)return null;var N=n.makeLayer(c,r);if(M!=null){var T=f.indexOf(M)+1;f.splice(T,0,N)}else(D.insert===void 0||D.insert)&&f.unshift(N);return N};if(n.skipping&&!s)return null;for(var g=null,y=t.length/aM,b=!s,x=0;x<t.length;x++){var C=t[x],O=C._private.rscratch,L=O.imgLayerCaches=O.imgLayerCaches||{},A=L[r];if(A){g=A;continue}if((!g||g.eles.length>=y||!ud(g.bb,C.boundingBox()))&&(g=m({insert:!0,after:g}),!g))return null;d||b?n.queueLayer(g,C):n.drawEleInLayer(g,C,r,e),g.eles.push(C),L[r]=g}return d||(b?null:f)};Mt.getEleLevelForLayerLevel=function(t,e){return t};Mt.drawEleInLayer=function(t,e,r,n){var a=this,i=this.renderer,o=t.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,r,vM),i.setImgSmoothing(o,!0))};Mt.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0||o.invalid)return!1;a+=o.eles.length}return a===e.length};Mt.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var a=r[n],i=-1,o=0;o<e.length;o++)if(a.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(a);continue}for(var s=i,o=0;o<a.eles.length;o++)if(a.eles[o]!==e[s+o]){this.invalidateLayer(a);break}}};Mt.updateElementsInLayers=function(t,e){for(var r=this,n=yi(t[0]),a=0;a<t.length;a++)for(var i=n?null:t[a],o=n?t[a]:t[a].ele,s=o._private.rscratch,l=s.imgLayerCaches=s.imgLayerCaches||{},u=ai;u<=Zo;u++){var f=l[u];f&&(i&&r.getEleLevelForLayerLevel(f.level)!==i.level||e(f,o,i))}};Mt.haveLayers=function(){for(var t=this,e=!1,r=ai;r<=Zo;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e};Mt.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Ir(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))};Mt.invalidateLayer=function(t){if(this.lastInvalidationTime=Ir(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];en(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<r.length;a++){var i=r[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};Mt.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,a,i){var o=n.replacement;if(o||(o=n.replacement=e.makeLayer(n.bb,n.level),o.replaces=n,o.eles=n.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})};Mt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};Mt.queueLayer=function(t,e){var r=this,n=r.layersQueue,a=t.elesQueue,i=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}};Mt.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<hM&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,t),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n};Mt.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,a=r.indexOf(n);if(!(a<0||n.invalid)){r[a]=t;for(var i=0;i<t.eles.length;i++){var o=t.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[t.level]=t)}e.requestRedraw()}};Mt.requestRedraw=es(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);Mt.setupDequeueing=fv.setupDequeueing({deqRedrawThreshold:oM,deqCost:uM,deqAvgCost:lM,deqNoDrawCost:fM,deqFastCost:cM,deq:function(e,r){return e.dequeue(r)},onDeqd:Yu,shouldRedraw:td,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var hv={},Ph;function gM(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function yM(t,e,r){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function _h(t,e,r){t.beginPath&&t.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];t.lineTo(i.x,i.y)}var o=r,s=r[0];t.moveTo(s.x,s.y);for(var a=1;a<o.length;a++){var i=o[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function mM(t,e,r,n,a){t.beginPath&&t.beginPath(),t.arc(r,n,a,0,Math.PI*2,!1);var i=e,o=i[0];t.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var l=i[s];t.lineTo(l.x,l.y)}t.closePath&&t.closePath()}function bM(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}hv.arrowShapeImpl=function(t){return(Ph||(Ph={polygon:gM,"triangle-backcurve":yM,"triangle-tee":_h,"circle-triangle":mM,"triangle-cross":_h,circle:bM}))[t]};var Er={};Er.drawElement=function(t,e,r,n,a,i){var o=this;e.isNode()?o.drawNode(t,e,r,n,a,i):o.drawEdge(t,e,r,n,a,i)};Er.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};Er.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};Er.drawCachedElementPortion=function(t,e,r,n,a,i,o,s){var l=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var f=r.getElement(e,u,n,a,i);if(f!=null){var c=s(l,e);if(c===0)return;var h=o(l,e),d=u.x1,v=u.y1,p=u.w,m=u.h,g,y,b,x,C;if(h!==0){var O=r.getRotationPoint(e);b=O.x,x=O.y,t.translate(b,x),t.rotate(h),C=l.getImgSmoothing(t),C||l.setImgSmoothing(t,!0);var L=r.getRotationOffset(e);g=L.x,y=L.y}else g=d,y=v;var A;c!==1&&(A=t.globalAlpha,t.globalAlpha=A*c),t.drawImage(f.texture.canvas,f.x,0,f.width,f.height,g,y,p,m),c!==1&&(t.globalAlpha=A),h!==0&&(t.rotate(-h),t.translate(-b,-x),C||l.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var EM=function(){return 0},wM=function(e,r){return e.getTextAngle(r,null)},xM=function(e,r){return e.getTextAngle(r,"source")},TM=function(e,r){return e.getTextAngle(r,"target")},CM=function(e,r){return r.effectiveOpacity()},Tu=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Er.drawCachedElement=function(t,e,r,n,a,i){var o=this,s=o.data,l=s.eleTxrCache,u=s.lblTxrCache,f=s.slbTxrCache,c=s.tlbTxrCache,h=e.boundingBox(),d=i===!0?l.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!n||Ku(h,n))){var v=e.isEdge(),p=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,l,r,a,d,EM,CM),(!v||!p)&&o.drawCachedElementPortion(t,e,u,r,a,d,wM,Tu),v&&!p&&(o.drawCachedElementPortion(t,e,f,r,a,d,xM,Tu),o.drawCachedElementPortion(t,e,c,r,a,d,TM,Tu)),o.drawElementOverlay(t,e)}};Er.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var a=e[n];r.drawElement(t,a)}};Er.drawCachedElements=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];a.drawCachedElement(t,o,r,n)}};Er.drawCachedNodes=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&a.drawCachedElement(t,o,r,n)}};Er.drawLayeredElements=function(t,e,r,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,r);if(i)for(var o=0;o<i.length;o++){var s=i[o],l=s.bb;l.w===0||l.h===0||t.drawImage(s.canvas,l.x1,l.y1,l.w,l.h)}else a.drawCachedElements(t,e,r,n)};var Pr={};Pr.drawEdge=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,c=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,d=e.pstyle("width").pfValue,v=e.pstyle("line-cap").value,p=e.pstyle("line-outline-width").value,m=e.pstyle("line-outline-color").value,g=u*f,y=u*f,b=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;c==="straight-triangle"?(o.eleStrokeStyle(t,e,N),o.drawEdgeTrianglePath(e,t,s.allpts)):(t.lineWidth=d,t.lineCap=v,o.eleStrokeStyle(t,e,N),o.drawEdgePath(e,t,s.allpts,h),t.lineCap="butt")},x=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;if(t.lineWidth=d+p,t.lineCap=v,p>0)o.colorStrokeStyle(t,m[0],m[1],m[2],N);else{t.lineCap="butt";return}c==="straight-triangle"?o.drawEdgeTrianglePath(e,t,s.allpts):(o.drawEdgePath(e,t,s.allpts,h),t.lineCap="butt")},C=function(){a&&o.drawEdgeOverlay(t,e)},O=function(){a&&o.drawEdgeUnderlay(t,e)},L=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;o.drawArrowheads(t,e,N)},A=function(){o.drawElementText(t,e,null,n)};t.lineJoin="round";var I=e.pstyle("ghost").value==="yes";if(I){var D=e.pstyle("ghost-offset-x").pfValue,M=e.pstyle("ghost-offset-y").pfValue,E=e.pstyle("ghost-opacity").value,S=g*E;t.translate(D,M),b(S),L(S),t.translate(-D,-M)}else x();O(),b(),L(),C(),A(),r&&t.translate(l.x1,l.y1)}};var dv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,o=i.usePaths(),s=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,f=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,s.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,f[0],f[1],f[2],a),i.drawEdgePath(n,r,s.allpts,"solid")}}}};Pr.drawEdgeOverlay=dv("overlay");Pr.drawEdgeUnderlay=dv("underlay");Pr.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,i=e,o,s=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(l){var c=r.join("$"),h=a.pathCacheKey&&a.pathCacheKey===c;h?(o=e=a.pathCache,s=!0):(o=e=new Path2D,a.pathCacheKey=c,a.pathCache=o)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!s&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+3<r.length;d+=4)e.quadraticCurveTo(r[d],r[d+1],r[d+2],r[d+3]);break;case"straight":case"haystack":for(var v=2;v+1<r.length;v+=2)e.lineTo(r[v],r[v+1]);break;case"segments":if(a.isRound){var p=Uh(a.roundCorners),m;try{for(p.s();!(m=p.n()).done;){var g=m.value;rv(e,g)}}catch(b){p.e(b)}finally{p.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var y=2;y+1<r.length;y+=2)e.lineTo(r[y],r[y+1]);break}e=i,l?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};Pr.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,a=0;a+1<r.length;a+=2){var i=[r[a+2]-r[a],r[a+3]-r[a+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],l=[s[0]*n/2,s[1]*n/2];e.beginPath(),e.moveTo(r[a]-l[0],r[a+1]-l[1]),e.lineTo(r[a]+l[0],r[a+1]+l[1]),e.lineTo(r[a+2],r[a+3]),e.closePath(),e.fill()}};Pr.drawArrowheads=function(t,e,r){var n=e._private.rscratch,a=n.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),a||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)};Pr.drawArrowhead=function(t,e,r,n,a,i,o){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var s=this,l=e.pstyle(r+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(r+"-arrow-fill").value,c=e.pstyle("width").pfValue,h=e.pstyle(r+"-arrow-width"),d=h.value==="match-line"?c:h.pfValue;h.units==="%"&&(d*=c);var v=e.pstyle("opacity").value;o===void 0&&(o=v);var p=t.globalCompositeOperation;(o!==1||f==="hollow")&&(t.globalCompositeOperation="destination-out",s.colorFillStyle(t,255,255,255,1),s.colorStrokeStyle(t,255,255,255,1),s.drawArrowShape(e,t,u,c,l,d,n,a,i),t.globalCompositeOperation=p);var m=e.pstyle(r+"-arrow-color").value;s.colorFillStyle(t,m[0],m[1],m[2],o),s.colorStrokeStyle(t,m[0],m[1],m[2],o),s.drawArrowShape(e,t,f,c,l,d,n,a,i)}}};Pr.drawArrowShape=function(t,e,r,n,a,i,o,s,l){var u=this,f=this.usePaths()&&a!=="triangle-cross",c=!1,h,d=e,v={x:o,y:s},p=t.pstyle("arrow-scale").value,m=this.getArrowWidth(n,p),g=u.arrowShapes[a];if(f){var y=u.arrowPathCache=u.arrowPathCache||[],b=Nn(a),x=y[b];x!=null?(h=e=x,c=!0):(h=e=new Path2D,y[b]=h)}c||(e.beginPath&&e.beginPath(),f?g.draw(e,1,0,{x:0,y:0},1):g.draw(e,m,l,v,n),e.closePath&&e.closePath()),e=d,f&&(e.translate(o,s),e.rotate(l),e.scale(m,m)),(r==="filled"||r==="both")&&(f?e.fill(h):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(f?m:1),e.lineJoin="miter",f?e.stroke(h):e.stroke()),f&&(e.scale(1/m,1/m),e.rotate(-l),e.translate(-o,-s))};var fl={};fl.safeDrawImage=function(t,e,r,n,a,i,o,s,l,u){if(!(a<=0||i<=0||l<=0||u<=0))try{t.drawImage(e,r,n,a,i,o,s,l,u)}catch(f){nt(f)}};fl.drawInscribedImage=function(t,e,r,n,a){var i=this,o=r.position(),s=o.x,l=o.y,u=r.cy().style(),f=u.getIndexedStyle.bind(u),c=f(r,"background-fit","value",n),h=f(r,"background-repeat","value",n),d=r.width(),v=r.height(),p=r.padding()*2,m=d+(f(r,"background-width-relative-to","value",n)==="inner"?0:p),g=v+(f(r,"background-height-relative-to","value",n)==="inner"?0:p),y=r._private.rscratch,b=f(r,"background-clip","value",n),x=b==="node",C=f(r,"background-image-opacity","value",n)*a,O=f(r,"background-image-smoothing","value",n),L=r.pstyle("corner-radius").value;L!=="auto"&&(L=r.pstyle("corner-radius").pfValue);var A=e.width||e.cachedW,I=e.height||e.cachedH;(A==null||I==null)&&(document.body.appendChild(e),A=e.cachedW=e.width||e.offsetWidth,I=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var D=A,M=I;if(f(r,"background-width","value",n)!=="auto"&&(f(r,"background-width","units",n)==="%"?D=f(r,"background-width","pfValue",n)*m:D=f(r,"background-width","pfValue",n)),f(r,"background-height","value",n)!=="auto"&&(f(r,"background-height","units",n)==="%"?M=f(r,"background-height","pfValue",n)*g:M=f(r,"background-height","pfValue",n)),!(D===0||M===0)){if(c==="contain"){var E=Math.min(m/D,g/M);D*=E,M*=E}else if(c==="cover"){var E=Math.max(m/D,g/M);D*=E,M*=E}var S=s-m/2,w=f(r,"background-position-x","units",n),N=f(r,"background-position-x","pfValue",n);w==="%"?S+=(m-D)*N:S+=N;var T=f(r,"background-offset-x","units",n),R=f(r,"background-offset-x","pfValue",n);T==="%"?S+=(m-D)*R:S+=R;var P=l-g/2,k=f(r,"background-position-y","units",n),U=f(r,"background-position-y","pfValue",n);k==="%"?P+=(g-M)*U:P+=U;var B=f(r,"background-offset-y","units",n),V=f(r,"background-offset-y","pfValue",n);B==="%"?P+=(g-M)*V:P+=V,y.pathCache&&(S-=s,P-=l,s=0,l=0);var j=t.globalAlpha;t.globalAlpha=C;var Y=i.getImgSmoothing(t),Z=!1;if(O==="no"&&Y?(i.setImgSmoothing(t,!1),Z=!0):O==="yes"&&!Y&&(i.setImgSmoothing(t,!0),Z=!0),h==="no-repeat")x&&(t.save(),y.pathCache?t.clip(y.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,s,l,m,g,L,y),t.clip())),i.safeDrawImage(t,e,0,0,A,I,S,P,D,M),x&&t.restore();else{var K=t.createPattern(e,h);t.fillStyle=K,i.nodeShapes[i.getNodeShape(r)].draw(t,s,l,m,g,L,y),t.translate(S,P),t.fill(),t.translate(-S,-P)}t.globalAlpha=j,Z&&i.setImgSmoothing(t,Y)}};var Pn={};Pn.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(Xu(r*n));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,o=t.pstyle("min-zoomed-font-size").pfValue;return!(i<o)};Pn.drawElementText=function(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var l=o.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,f=e.pstyle("label"),c=e.pstyle("source-label"),h=e.pstyle("target-label");if(u||(!f||!f.value)&&(!c||!c.value)&&(!h||!h.value))return;t.textAlign="center",t.textBaseline="bottom"}var d=!r,v;r&&(v=r,t.translate(-v.x1,-v.y1)),a==null?(o.drawText(t,e,null,d,i),e.isEdge()&&(o.drawText(t,e,"source",d,i),o.drawText(t,e,"target",d,i))):o.drawText(t,e,a,d,i),r&&t.translate(v.x1,v.y1)};Pn.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Pn.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*s,u=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=n+" "+o+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],s),this.colorStrokeStyle(t,f[0],f[1],f[2],l)};function Cu(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+i,r),t.lineTo(e+n-i,r),t.quadraticCurveTo(e+n,r,e+n,r+i),t.lineTo(e+n,r+a-i),t.quadraticCurveTo(e+n,r+a,e+n-i,r+a),t.lineTo(e+i,r+a),t.quadraticCurveTo(e,r+a,e,r+a-i),t.lineTo(e,r+i),t.quadraticCurveTo(e,r,e+i,r),t.closePath(),o?t.stroke():t.fill()}Pn.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),s=ur(a,"labelAngle",e);return o.strValue==="autorotate"?r=t.isEdge()?s:0:o.strValue==="none"?r=0:r=o.pfValue,r};Pn.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,s=a?e.effectiveOpacity():1;if(!(a&&(s===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=ur(o,"labelX",r),u=ur(o,"labelY",r),f,c,h=this.getLabelText(e,r);if(h!=null&&h!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,a);var d=r?r+"-":"",v=ur(o,"labelWidth",r),p=ur(o,"labelHeight",r),m=e.pstyle(d+"text-margin-x").pfValue,g=e.pstyle(d+"text-margin-y").pfValue,y=e.isEdge(),b=e.pstyle("text-halign").value,x=e.pstyle("text-valign").value;y&&(b="center",x="center"),l+=m,u+=g;var C;switch(n?C=this.getTextAngle(e,r):C=0,C!==0&&(f=l,c=u,t.translate(f,c),t.rotate(C),l=0,u=0),x){case"top":break;case"center":u+=p/2;break;case"bottom":u+=p;break}var O=e.pstyle("text-background-opacity").value,L=e.pstyle("text-border-opacity").value,A=e.pstyle("text-border-width").pfValue,I=e.pstyle("text-background-padding").pfValue,D=e.pstyle("text-background-shape").strValue,M=D.indexOf("round")===0,E=2;if(O>0||A>0&&L>0){var S=l-I;switch(b){case"left":S-=v;break;case"center":S-=v/2;break}var w=u-p-I,N=v+2*I,T=p+2*I;if(O>0){var R=t.fillStyle,P=e.pstyle("text-background-color").value;t.fillStyle="rgba("+P[0]+","+P[1]+","+P[2]+","+O*s+")",M?Cu(t,S,w,N,T,E):t.fillRect(S,w,N,T),t.fillStyle=R}if(A>0&&L>0){var k=t.strokeStyle,U=t.lineWidth,B=e.pstyle("text-border-color").value,V=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+L*s+")",t.lineWidth=A,t.setLineDash)switch(V){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=A/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(M?Cu(t,S,w,N,T,E,"stroke"):t.strokeRect(S,w,N,T),V==="double"){var j=A/2;M?Cu(t,S+j,w+j,N-j*2,T-j*2,E,"stroke"):t.strokeRect(S+j,w+j,N-j*2,T-j*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=U,t.strokeStyle=k}}var Y=2*e.pstyle("text-outline-width").pfValue;if(Y>0&&(t.lineWidth=Y),e.pstyle("text-wrap").value==="wrap"){var Z=ur(o,"labelWrapCachedLines",r),K=ur(o,"labelLineHeight",r),G=v/2,$=this.getLabelJustification(e);switch($==="auto"||(b==="left"?$==="left"?l+=-v:$==="center"&&(l+=-G):b==="center"?$==="left"?l+=-G:$==="right"&&(l+=G):b==="right"&&($==="center"?l+=G:$==="right"&&(l+=v))),x){case"top":u-=(Z.length-1)*K;break;case"center":case"bottom":u-=(Z.length-1)*K;break}for(var q=0;q<Z.length;q++)Y>0&&t.strokeText(Z[q],l,u),t.fillText(Z[q],l,u),u+=K}else Y>0&&t.strokeText(h,l,u),t.fillText(h,l,u);C!==0&&(t.rotate(-C),t.translate(-f,-c))}}};var Sa={};Sa.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,l,u=e._private,f=u.rscratch,c=e.position();if(!(!we(c.x)||!we(c.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,d=o.usePaths(),v,p=!1,m=e.padding();s=e.width()+2*m,l=e.height()+2*m;var g;r&&(g=r,t.translate(-g.x1,-g.y1));for(var y=e.pstyle("background-image"),b=y.value,x=new Array(b.length),C=new Array(b.length),O=0,L=0;L<b.length;L++){var A=b[L],I=x[L]=A!=null&&A!=="none";if(I){var D=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",L);O++,C[L]=o.getCachedImage(A,D,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var M=e.pstyle("background-blacken").value,E=e.pstyle("border-width").pfValue,S=e.pstyle("background-opacity").value*h,w=e.pstyle("border-color").value,N=e.pstyle("border-style").value,T=e.pstyle("border-join").value,R=e.pstyle("border-cap").value,P=e.pstyle("border-position").value,k=e.pstyle("border-dash-pattern").pfValue,U=e.pstyle("border-dash-offset").pfValue,B=e.pstyle("border-opacity").value*h,V=e.pstyle("outline-width").pfValue,j=e.pstyle("outline-color").value,Y=e.pstyle("outline-style").value,Z=e.pstyle("outline-opacity").value*h,K=e.pstyle("outline-offset").value,G=e.pstyle("corner-radius").value;G!=="auto"&&(G=e.pstyle("corner-radius").pfValue);var $=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S;o.eleFillStyle(t,e,z)},q=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B;o.colorStrokeStyle(t,w[0],w[1],w[2],z)},X=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z;o.colorStrokeStyle(t,j[0],j[1],j[2],z)},ee=function(z,H,re,W){var ae=o.nodePathCache=o.nodePathCache||[],le=ed(re==="polygon"?re+","+W.join(","):re,""+H,""+z,""+G),ye=ae[le],he,fe=!1;return ye!=null?(he=ye,fe=!0,f.pathCache=he):(he=new Path2D,ae[le]=f.pathCache=he),{path:he,cacheHit:fe}},ce=e.pstyle("shape").strValue,Ee=e.pstyle("shape-polygon-points").pfValue;if(d){t.translate(c.x,c.y);var ne=ee(s,l,ce,Ee);v=ne.path,p=ne.cacheHit}var Q=function(){if(!p){var z=c;d&&(z={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(v||t,z.x,z.y,s,l,G,f)}d?t.fill(v):t.fill()},se=function(){for(var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,re=u.backgrounding,W=0,ae=0;ae<C.length;ae++){var le=e.cy().style().getIndexedStyle(e,"background-image-containment","value",ae);if(H&&le==="over"||!H&&le==="inside"){W++;continue}x[ae]&&C[ae].complete&&!C[ae].error&&(W++,o.drawInscribedImage(t,C[ae],e,ae,z))}u.backgrounding=W!==O,re!==u.backgrounding&&e.updateStyle(!1)},J=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasPie(e)&&(o.drawPie(t,e,H),z&&(d||o.nodeShapes[o.getNodeShape(e)].draw(t,c.x,c.y,s,l,G,f)))},ie=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,H=(M>0?M:-M)*z,re=M>0?0:255;M!==0&&(o.colorFillStyle(t,re,re,re,H),d?t.fill(v):t.fill())},ve=function(){if(E>0){if(t.lineWidth=E,t.lineCap=R,t.lineJoin=T,t.setLineDash)switch(N){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(k),t.lineDashOffset=U;break;case"solid":case"double":t.setLineDash([]);break}if(P!=="center"){if(t.save(),t.lineWidth*=2,P==="inside")d?t.clip(v):t.clip();else{var z=new Path2D;z.rect(-s/2-E,-l/2-E,s+2*E,l+2*E),z.addPath(v),t.clip(z,"evenodd")}d?t.stroke(v):t.stroke(),t.restore()}else d?t.stroke(v):t.stroke();if(N==="double"){t.lineWidth=E/3;var H=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",d?t.stroke(v):t.stroke(),t.globalCompositeOperation=H}t.setLineDash&&t.setLineDash([])}},Se=function(){if(V>0){if(t.lineWidth=V,t.lineCap="butt",t.setLineDash)switch(Y){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var z=c;d&&(z={x:0,y:0});var H=o.getNodeShape(e),re=E;P==="inside"&&(re=0),P==="outside"&&(re*=2);var W=(s+re+(V+K))/s,ae=(l+re+(V+K))/l,le=s*W,ye=l*ae,he=o.nodeShapes[H].points,fe;if(d){var pe=ee(le,ye,H,he);fe=pe.path}if(H==="ellipse")o.drawEllipsePath(fe||t,z.x,z.y,le,ye);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(H)){var ge=0,me=0,Ne=0;H==="round-diamond"?ge=(re+K+V)*1.4:H==="round-heptagon"?(ge=(re+K+V)*1.075,Ne=-(re/2+K+V)/35):H==="round-hexagon"?ge=(re+K+V)*1.12:H==="round-pentagon"?(ge=(re+K+V)*1.13,Ne=-(re/2+K+V)/15):H==="round-tag"?(ge=(re+K+V)*1.12,me=(re/2+V+K)*.07):H==="round-triangle"&&(ge=(re+K+V)*(Math.PI/2),Ne=-(re+K/2+V)/Math.PI),ge!==0&&(W=(s+ge)/s,le=s*W,["round-hexagon","round-tag"].includes(H)||(ae=(l+ge)/l,ye=l*ae)),G=G==="auto"?cd(le,ye):G;for(var ze=le/2,Oe=ye/2,be=G+(re+V+K)/2,Me=new Array(he.length/2),Te=new Array(he.length/2),Ae=0;Ae<he.length/2;Ae++)Me[Ae]={x:z.x+me+ze*he[Ae*2],y:z.y+Ne+Oe*he[Ae*2+1]};var We,Ke,st,He,Ue=Me.length;for(Ke=Me[Ue-1],We=0;We<Ue;We++)st=Me[We%Ue],He=Me[(We+1)%Ue],Te[We]=ul(Ke,st,He,be),Ke=st,st=He;o.drawRoundPolygonPath(fe||t,z.x+me,z.y+Ne,s*W,l*ae,he,Te)}else if(["roundrectangle","round-rectangle"].includes(H))G=G==="auto"?An(le,ye):G,o.drawRoundRectanglePath(fe||t,z.x,z.y,le,ye,G+(re+V+K)/2);else if(["cutrectangle","cut-rectangle"].includes(H))G=G==="auto"?ju():G,o.drawCutRectanglePath(fe||t,z.x,z.y,le,ye,null,G+(re+V+K)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(H))G=G==="auto"?An(le,ye):G,o.drawBottomRoundRectanglePath(fe||t,z.x,z.y,le,ye,G+(re+V+K)/2);else if(H==="barrel")o.drawBarrelPath(fe||t,z.x,z.y,le,ye);else if(H.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(H)){var yt=(re+V+K)/s;he=Ho($o(he,yt)),o.drawPolygonPath(fe||t,z.x,z.y,s,l,he)}else{var Ve=(re+V+K)/s;he=Ho($o(he,-Ve)),o.drawPolygonPath(fe||t,z.x,z.y,s,l,he)}if(d?t.stroke(fe):t.stroke(),Y==="double"){t.lineWidth=re/3;var je=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",d?t.stroke(fe):t.stroke(),t.globalCompositeOperation=je}t.setLineDash&&t.setLineDash([])}},Ce=function(){a&&o.drawNodeOverlay(t,e,c,s,l)},xe=function(){a&&o.drawNodeUnderlay(t,e,c,s,l)},De=function(){o.drawElementText(t,e,null,n)},Le=e.pstyle("ghost").value==="yes";if(Le){var Pe=e.pstyle("ghost-offset-x").pfValue,de=e.pstyle("ghost-offset-y").pfValue,_=e.pstyle("ghost-opacity").value,te=_*h;t.translate(Pe,de),X(),Se(),$(_*S),Q(),se(te,!0),q(_*B),ve(),J(M!==0||E!==0),se(te,!1),ie(te),t.translate(-Pe,-de)}d&&t.translate(-c.x,-c.y),xe(),d&&t.translate(c.x,c.y),X(),Se(),$(),Q(),se(h,!0),q(),ve(),J(M!==0||E!==0),se(h,!1),ie(),d&&t.translate(-c.x,-c.y),De(),Ce(),r&&t.translate(g.x1,g.y1)}};var vv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,a,i,o){var s=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,f=n.pstyle("".concat(e,"-color")).value,c=n.pstyle("".concat(e,"-shape")).value,h=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),i==null||o==null){var d=n.padding();i=n.width()+2*d,o=n.height()+2*d}s.colorFillStyle(r,f[0],f[1],f[2],u),s.nodeShapes[c].draw(r,a.x,a.y,i+l*2,o+l*2,h),r.fill()}}}};Sa.drawNodeOverlay=vv("overlay");Sa.drawNodeUnderlay=vv("underlay");Sa.hasPie=function(t){return t=t[0],t._private.hasPie};Sa.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),o=n.x,s=n.y,l=e.width(),u=e.height(),f=Math.min(l,u)/2,c=0,h=this.usePaths();h&&(o=0,s=0),i.units==="%"?f=f*i.pfValue:i.pfValue!==void 0&&(f=i.pfValue/2);for(var d=1;d<=a.pieBackgroundN;d++){var v=e.pstyle("pie-"+d+"-background-size").value,p=e.pstyle("pie-"+d+"-background-color").value,m=e.pstyle("pie-"+d+"-background-opacity").value*r,g=v/100;g+c>1&&(g=1-c);var y=1.5*Math.PI+2*Math.PI*c,b=2*Math.PI*g,x=y+b;v===0||c>=1||c+g>1||(t.beginPath(),t.moveTo(o,s),t.arc(o,s,f,y,x),t.closePath(),this.colorFillStyle(t,p[0],p[1],p[2],m),t.fill(),c+=g)}};var Wt={},SM=100;Wt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Wt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n};Wt.createGradientStyleFor=function(t,e,r,n,a){var i,o=this.usePaths(),s=r.pstyle(e+"-gradient-stop-colors").value,l=r.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),f=r.targetEndpoint(),c=r.midpoint(),h=On(u,c),d=On(f,c);i=t.createRadialGradient(c.x,c.y,0,c.x,c.y,Math.max(h,d))}else{var v=o?{x:0,y:0}:r.position(),p=r.paddedWidth(),m=r.paddedHeight();i=t.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(p,m))}else if(r.isEdge()){var g=r.sourceEndpoint(),y=r.targetEndpoint();i=t.createLinearGradient(g.x,g.y,y.x,y.y)}else{var b=o?{x:0,y:0}:r.position(),x=r.paddedWidth(),C=r.paddedHeight(),O=x/2,L=C/2,A=r.pstyle("background-gradient-direction").value;switch(A){case"to-bottom":i=t.createLinearGradient(b.x,b.y-L,b.x,b.y+L);break;case"to-top":i=t.createLinearGradient(b.x,b.y+L,b.x,b.y-L);break;case"to-left":i=t.createLinearGradient(b.x+O,b.y,b.x-O,b.y);break;case"to-right":i=t.createLinearGradient(b.x-O,b.y,b.x+O,b.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(b.x-O,b.y-L,b.x+O,b.y+L);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(b.x-O,b.y+L,b.x+O,b.y-L);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(b.x+O,b.y-L,b.x-O,b.y+L);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(b.x+O,b.y+L,b.x-O,b.y-L);break}}if(!i)return null;for(var I=l.length===s.length,D=s.length,M=0;M<D;M++)i.addColorStop(I?l[M]:M/(D-1),"rgba("+s[M][0]+","+s[M][1]+","+s[M][2]+","+a+")");return i};Wt.gradientFillStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"background",e,r,n);if(!a)return null;t.fillStyle=a};Wt.colorFillStyle=function(t,e,r,n,a){t.fillStyle="rgba("+e+","+r+","+n+","+a+")"};Wt.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],r)}};Wt.gradientStrokeStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"line",e,r,n);if(!a)return null;t.strokeStyle=a};Wt.colorStrokeStyle=function(t,e,r,n,a){t.strokeStyle="rgba("+e+","+r+","+n+","+a+")"};Wt.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],r)}};Wt.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var l=a*o,u=i*o,f;if(!(l===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var c=r.canvasContainer;c.style.width=a+"px",c.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)f=r.canvases[h],f.width=l,f.height=u,f.style.width=a+"px",f.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)f=r.bufferCanvases[h],f.width=l,f.height=u,f.style.width=a+"px",f.style.height=i+"px";e.textureMult=1,o<=1&&(f=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=l*e.textureMult,f.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u}};Wt.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})};Wt.render=function(t){t=t||ad();var e=t.forcedContext,r=t.drawAllLayers,n=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,o=this,s=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,l=o.cy,u=o.data,f=u.canvasNeedsRedraw,c=o.textureOnViewport&&!e&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),h=t.motionBlur!==void 0?t.motionBlur:o.motionBlur,d=o.motionBlurPxRatio,v=l.hasCompoundNodes(),p=o.hoverData.draggingEles,m=!!(o.hoverData.selecting||o.touchData.selecting);h=h&&!e&&o.motionBlurEnabled&&!m;var g=h;e||(o.prevPxRatio!==s&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=s),!e&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),h&&(o.mbFrames==null&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(g=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!c&&(f[o.NODE]=!0,f[o.SELECT_BOX]=!0);var y=l.style(),b=l.zoom(),x=a!==void 0?a:b,C=l.pan(),O={x:C.x,y:C.y},L={zoom:b,pan:{x:C.x,y:C.y}},A=o.prevViewport,I=A===void 0||L.zoom!==A.zoom||L.pan.x!==A.pan.x||L.pan.y!==A.pan.y;!I&&!(p&&!v)&&(o.motionBlurPxRatio=1),i&&(O=i),x*=s,O.x*=s,O.y*=s;var D=o.getCachedZSortedEles();function M(ne,Q,se,J,ie){var ve=ne.globalCompositeOperation;ne.globalCompositeOperation="destination-out",o.colorFillStyle(ne,255,255,255,o.motionBlurTransparency),ne.fillRect(Q,se,J,ie),ne.globalCompositeOperation=ve}function E(ne,Q){var se,J,ie,ve;!o.clearingMotionBlur&&(ne===u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||ne===u.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG])?(se={x:C.x*d,y:C.y*d},J=b*d,ie=o.canvasWidth*d,ve=o.canvasHeight*d):(se=O,J=x,ie=o.canvasWidth,ve=o.canvasHeight),ne.setTransform(1,0,0,1,0,0),Q==="motionBlur"?M(ne,0,0,ie,ve):!e&&(Q===void 0||Q)&&ne.clearRect(0,0,ie,ve),r||(ne.translate(se.x,se.y),ne.scale(J,J)),i&&ne.translate(i.x,i.y),a&&ne.scale(a,a)}if(c||(o.textureDrawLastFrame=!1),c){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=l.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var S=o.data.bufferContexts[o.TEXTURE_BUFFER];S.setTransform(1,0,0,1,0,0),S.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:S,drawOnlyNodeLayer:!0,forcedPxRatio:s*o.textureMult});var L=o.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:o.canvasWidth,height:o.canvasHeight};L.mpan={x:(0-L.pan.x)/L.zoom,y:(0-L.pan.y)/L.zoom}}f[o.DRAG]=!1,f[o.NODE]=!1;var w=u.contexts[o.NODE],N=o.textureCache.texture,L=o.textureCache.viewport;w.setTransform(1,0,0,1,0,0),h?M(w,0,0,L.width,L.height):w.clearRect(0,0,L.width,L.height);var T=y.core("outside-texture-bg-color").value,R=y.core("outside-texture-bg-opacity").value;o.colorFillStyle(w,T[0],T[1],T[2],R),w.fillRect(0,0,L.width,L.height);var b=l.zoom();E(w,!1),w.clearRect(L.mpan.x,L.mpan.y,L.width/L.zoom/s,L.height/L.zoom/s),w.drawImage(N,L.mpan.x,L.mpan.y,L.width/L.zoom/s,L.height/L.zoom/s)}else o.textureOnViewport&&!e&&(o.textureCache=null);var P=l.extent(),k=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),U=o.hideEdgesOnViewport&&k,B=[];if(B[o.NODE]=!f[o.NODE]&&h&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,B[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),B[o.DRAG]=!f[o.DRAG]&&h&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,B[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),f[o.NODE]||r||n||B[o.NODE]){var V=h&&!B[o.NODE]&&d!==1,w=e||(V?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:u.contexts[o.NODE]),j=h&&!V?"motionBlur":void 0;E(w,j),U?o.drawCachedNodes(w,D.nondrag,s,P):o.drawLayeredElements(w,D.nondrag,s,P),o.debug&&o.drawDebugPoints(w,D.nondrag),!r&&!h&&(f[o.NODE]=!1)}if(!n&&(f[o.DRAG]||r||B[o.DRAG])){var V=h&&!B[o.DRAG]&&d!==1,w=e||(V?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:u.contexts[o.DRAG]);E(w,h&&!V?"motionBlur":void 0),U?o.drawCachedNodes(w,D.drag,s,P):o.drawCachedElements(w,D.drag,s,P),o.debug&&o.drawDebugPoints(w,D.drag),!r&&!h&&(f[o.DRAG]=!1)}if(o.showFps||!n&&f[o.SELECT_BOX]&&!r){var w=e||u.contexts[o.SELECT_BOX];if(E(w),o.selection[4]==1&&(o.hoverData.selecting||o.touchData.selecting)){var b=o.cy.zoom(),Y=y.core("selection-box-border-width").value/b;w.lineWidth=Y,w.fillStyle="rgba("+y.core("selection-box-color").value[0]+","+y.core("selection-box-color").value[1]+","+y.core("selection-box-color").value[2]+","+y.core("selection-box-opacity").value+")",w.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),Y>0&&(w.strokeStyle="rgba("+y.core("selection-box-border-color").value[0]+","+y.core("selection-box-border-color").value[1]+","+y.core("selection-box-border-color").value[2]+","+y.core("selection-box-opacity").value+")",w.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(u.bgActivePosistion&&!o.hoverData.selecting){var b=o.cy.zoom(),Z=u.bgActivePosistion;w.fillStyle="rgba("+y.core("active-bg-color").value[0]+","+y.core("active-bg-color").value[1]+","+y.core("active-bg-color").value[2]+","+y.core("active-bg-opacity").value+")",w.beginPath(),w.arc(Z.x,Z.y,y.core("active-bg-size").pfValue/b,0,2*Math.PI),w.fill()}var K=o.lastRedrawTime;if(o.showFps&&K){K=Math.round(K);var G=Math.round(1e3/K);w.setTransform(1,0,0,1,0,0),w.fillStyle="rgba(255, 0, 0, 0.75)",w.strokeStyle="rgba(255, 0, 0, 0.75)",w.lineWidth=1,w.fillText("1 frame = "+K+" ms = "+G+" fps",0,20);var $=60;w.strokeRect(0,30,250,20),w.fillRect(0,30,250*Math.min(G/$,1),20)}r||(f[o.SELECT_BOX]=!1)}if(h&&d!==1){var q=u.contexts[o.NODE],X=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],ee=u.contexts[o.DRAG],ce=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],Ee=function(Q,se,J){Q.setTransform(1,0,0,1,0,0),J||!g?Q.clearRect(0,0,o.canvasWidth,o.canvasHeight):M(Q,0,0,o.canvasWidth,o.canvasHeight);var ie=d;Q.drawImage(se,0,0,o.canvasWidth*ie,o.canvasHeight*ie,0,0,o.canvasWidth,o.canvasHeight)};(f[o.NODE]||B[o.NODE])&&(Ee(q,X,B[o.NODE]),f[o.NODE]=!1),(f[o.DRAG]||B[o.DRAG])&&(Ee(ee,ce,B[o.DRAG]),f[o.DRAG]=!1)}o.prevViewport=L,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),h&&(o.motionBlurTimeout=setTimeout(function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!c,o.mbFrames=0,f[o.NODE]=!0,f[o.DRAG]=!0,o.redraw()},SM)),e||l.emit("render")};var on={};on.drawPolygonPath=function(t,e,r,n,a,i){var o=n/2,s=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*i[0],r+s*i[1]);for(var l=1;l<i.length/2;l++)t.lineTo(e+o*i[l*2],r+s*i[l*2+1]);t.closePath()};on.drawRoundPolygonPath=function(t,e,r,n,a,i,o){o.forEach(function(s){return rv(t,s)}),t.closePath()};on.drawRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,s=a/2,l=i==="auto"?An(n,a):Math.min(i,s,o);t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.arcTo(e+o,r-s,e+o,r,l),t.arcTo(e+o,r+s,e,r+s,l),t.arcTo(e-o,r+s,e-o,r,l),t.arcTo(e-o,r-s,e,r-s,l),t.lineTo(e,r-s),t.closePath()};on.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,s=a/2,l=i==="auto"?An(n,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.lineTo(e+o,r-s),t.lineTo(e+o,r),t.arcTo(e+o,r+s,e,r+s,l),t.arcTo(e-o,r+s,e-o,r,l),t.lineTo(e-o,r-s),t.lineTo(e,r-s),t.closePath()};on.drawCutRectanglePath=function(t,e,r,n,a,i,o){var s=n/2,l=a/2,u=o==="auto"?ju():o;t.beginPath&&t.beginPath(),t.moveTo(e-s+u,r-l),t.lineTo(e+s-u,r-l),t.lineTo(e+s,r-l+u),t.lineTo(e+s,r+l-u),t.lineTo(e+s-u,r+l),t.lineTo(e-s+u,r+l),t.lineTo(e-s,r+l-u),t.lineTo(e-s,r-l+u),t.closePath()};on.drawBarrelPath=function(t,e,r,n,a){var i=n/2,o=a/2,s=e-i,l=e+i,u=r-o,f=r+o,c=Lu(n,a),h=c.widthOffset,d=c.heightOffset,v=c.ctrlPtOffsetPct*h;t.beginPath&&t.beginPath(),t.moveTo(s,u+d),t.lineTo(s,f-d),t.quadraticCurveTo(s+v,f,s+h,f),t.lineTo(l-h,f),t.quadraticCurveTo(l-v,f,l,f-d),t.lineTo(l,u+d),t.quadraticCurveTo(l-v,u,l-h,u),t.lineTo(s+h,u),t.quadraticCurveTo(s+v,u,s,u+d),t.closePath()};var Fh=Math.sin(0),Bh=Math.cos(0),ku={},qu={},pv=Math.PI/40;for(En=0*Math.PI;En<2*Math.PI;En+=pv)ku[En]=Math.sin(En),qu[En]=Math.cos(En);var En;on.drawEllipsePath=function(t,e,r,n,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,a/2,0,0,2*Math.PI);else for(var i,o,s=n/2,l=a/2,u=0*Math.PI;u<2*Math.PI;u+=pv)i=e-s*ku[u]*Fh+s*qu[u]*Bh,o=r+l*qu[u]*Fh+l*ku[u]*Bh,u===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var Ci={};Ci.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};Ci.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),n=r.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(n.w):a[2],o=t.full?Math.ceil(n.h):a[3],s=we(t.maxWidth)||we(t.maxHeight),l=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,o*=t.scale,u=t.scale;else if(s){var f=1/0,c=1/0;we(t.maxWidth)&&(f=u*t.maxWidth/i),we(t.maxHeight)&&(c=u*t.maxHeight/o),u=Math.min(f,c),i*=u,o*=u}s||(i*=l,o*=l,u*=l);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var d=h.getContext("2d");if(i>0&&o>0){d.clearRect(0,0,i,o),d.globalCompositeOperation="source-over";var v=this.getCachedZSortedEles();if(t.full)d.translate(-n.x1*u,-n.y1*u),d.scale(u,u),this.drawElements(d,v),d.scale(1/u,1/u),d.translate(n.x1*u,n.y1*u);else{var p=e.pan(),m={x:p.x*u,y:p.y*u};u*=e.zoom(),d.translate(m.x,m.y),d.scale(u,u),this.drawElements(d,v),d.scale(1/u,1/u),d.translate(-m.x,-m.y)}t.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=t.bg,d.rect(0,0,i,o),d.fill())}return h};function LM(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function kh(t){var e=t.indexOf(",");return t.substr(e+1)}function gv(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new ya(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(o){i(o)}});case"blob":return LM(kh(n()),r);case"base64":return kh(n());default:return n()}}Ci.png=function(t){return gv(t,this.bufferCanvasImage(t),"image/png")};Ci.jpg=function(t){return gv(t,this.bufferCanvasImage(t),"image/jpeg")};var yv={};yv.nodeShapeImpl=function(t,e,r,n,a,i,o,s){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,a,i);case"polygon":return this.drawPolygonPath(e,r,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,a,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,a,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,a,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,a,i,s);case"barrel":return this.drawBarrelPath(e,r,n,a,i)}};var NM=mv,Je=mv.prototype;Je.CANVAS_LAYERS=3;Je.SELECT_BOX=0;Je.DRAG=1;Je.NODE=2;Je.BUFFER_COUNT=3;Je.TEXTURE_BUFFER=0;Je.MOTIONBLUR_BUFFER_NODE=1;Je.MOTIONBLUR_BUFFER_DRAG=2;function mv(t){var e=this,r=e.cy.window(),n=r.document;e.data={canvases:new Array(Je.CANVAS_LAYERS),contexts:new Array(Je.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Je.CANVAS_LAYERS),bufferCanvases:new Array(Je.BUFFER_COUNT),bufferContexts:new Array(Je.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=t.cy.container();s.appendChild(e.data.canvasContainer),s.style[a]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};vS()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<Je.CANVAS_LAYERS;u++){var f=e.data.canvases[u]=n.createElement("canvas");e.data.contexts[u]=f.getContext("2d"),Object.keys(l).forEach(function($){f.style[$]=l[$]}),f.style.position="absolute",f.setAttribute("data-id","layer"+u),f.style.zIndex=String(Je.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(f),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Je.NODE].setAttribute("data-id","layer"+Je.NODE+"-node"),e.data.canvases[Je.SELECT_BOX].setAttribute("data-id","layer"+Je.SELECT_BOX+"-selectbox"),e.data.canvases[Je.DRAG].setAttribute("data-id","layer"+Je.DRAG+"-drag");for(var u=0;u<Je.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var c=Ht(),h=function(q){return{x:(q.x1+q.x2)/2,y:(q.y1+q.y2)/2}},d=function(q){return{x:-q.w/2,y:-q.h/2}},v=function(q){var X=q[0]._private,ee=X.oldBackgroundTimestamp===X.backgroundTimestamp;return!ee},p=function(q){return q[0]._private.nodeKey},m=function(q){return q[0]._private.labelStyleKey},g=function(q){return q[0]._private.sourceLabelStyleKey},y=function(q){return q[0]._private.targetLabelStyleKey},b=function(q,X,ee,ce,Ee){return e.drawElement(q,X,ee,!1,!1,Ee)},x=function(q,X,ee,ce,Ee){return e.drawElementText(q,X,ee,ce,"main",Ee)},C=function(q,X,ee,ce,Ee){return e.drawElementText(q,X,ee,ce,"source",Ee)},O=function(q,X,ee,ce,Ee){return e.drawElementText(q,X,ee,ce,"target",Ee)},L=function(q){return q.boundingBox(),q[0]._private.bodyBounds},A=function(q){return q.boundingBox(),q[0]._private.labelBounds.main||c},I=function(q){return q.boundingBox(),q[0]._private.labelBounds.source||c},D=function(q){return q.boundingBox(),q[0]._private.labelBounds.target||c},M=function(q,X){return X},E=function(q){return h(L(q))},S=function(q,X,ee){var ce=q?q+"-":"";return{x:X.x+ee.pstyle(ce+"text-margin-x").pfValue,y:X.y+ee.pstyle(ce+"text-margin-y").pfValue}},w=function(q,X,ee){var ce=q[0]._private.rscratch;return{x:ce[X],y:ce[ee]}},N=function(q){return S("",w(q,"labelX","labelY"),q)},T=function(q){return S("source",w(q,"sourceLabelX","sourceLabelY"),q)},R=function(q){return S("target",w(q,"targetLabelX","targetLabelY"),q)},P=function(q){return d(L(q))},k=function(q){return d(I(q))},U=function(q){return d(D(q))},B=function(q){var X=A(q),ee=d(A(q));if(q.isNode()){switch(q.pstyle("text-halign").value){case"left":ee.x=-X.w-(X.leftPad||0);break;case"right":ee.x=-(X.rightPad||0);break}switch(q.pstyle("text-valign").value){case"top":ee.y=-X.h-(X.topPad||0);break;case"bottom":ee.y=-(X.botPad||0);break}}return ee},V=e.data.eleTxrCache=new ri(e,{getKey:p,doesEleInvalidateKey:v,drawElement:b,getBoundingBox:L,getRotationPoint:E,getRotationOffset:P,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),j=e.data.lblTxrCache=new ri(e,{getKey:m,drawElement:x,getBoundingBox:A,getRotationPoint:N,getRotationOffset:B,isVisible:M}),Y=e.data.slbTxrCache=new ri(e,{getKey:g,drawElement:C,getBoundingBox:I,getRotationPoint:T,getRotationOffset:k,isVisible:M}),Z=e.data.tlbTxrCache=new ri(e,{getKey:y,drawElement:O,getBoundingBox:D,getRotationPoint:R,getRotationOffset:U,isVisible:M}),K=e.data.lyrTxrCache=new cv(e);e.onUpdateEleCalcs(function(q,X){V.invalidateElements(X),j.invalidateElements(X),Y.invalidateElements(X),Z.invalidateElements(X),K.invalidateElements(X);for(var ee=0;ee<X.length;ee++){var ce=X[ee]._private;ce.oldBackgroundTimestamp=ce.backgroundTimestamp}});var G=function(q){for(var X=0;X<q.length;X++)K.enqueueElementRefinement(q[X].ele)};V.onDequeue(G),j.onDequeue(G),Y.onDequeue(G),Z.onDequeue(G)}Je.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Je.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Je.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Je.SELECT_BOX]=e;break}};var OM=typeof Path2D<"u";Je.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Je.usePaths=function(){return OM&&this.pathsEnabled};Je.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Je.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Je.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":Tt(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),a=n.document;r=a.createElement("canvas"),r.width=t,r.height=e}return r};[hv,Er,Pr,fl,Pn,Sa,Wt,on,Ci,yv].forEach(function(t){_e(Je,t)});var AM=[{name:"null",impl:Jd},{name:"base",impl:lv},{name:"canvas",impl:NM}],IM=[{type:"layout",extensions:FD},{type:"renderer",extensions:AM}],bv={},Ev={};function wv(t,e,r){var n=r,a=function(A){nt("Can not register `"+e+"` for `"+t+"` since `"+A+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(pi.prototype[e])return a(e);pi.prototype[e]=r}else if(t==="collection"){if(It.prototype[e])return a(e);It.prototype[e]=r}else if(t==="layout"){for(var i=function(A){this.options=A,r.call(this,A),Qe(this._private)||(this._private={}),this._private.cy=A.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(r.prototype),s=[],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var f=r.prototype.stop;o.stop=function(){var L=this.options;if(L&&L.animate){var A=this.animations;if(A)for(var I=0;I<A.length;I++)A[I].stop()}return f?f.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var c=function(A){return A._private.cy},h={addEventFields:function(A,I){I.layout=A,I.cy=c(A),I.target=A},bubble:function(){return!0},parent:function(A){return c(A)}};_e(o,{createEmitter:function(){return this._private.emitter=new us(h,this),this},emitter:function(){return this._private.emitter},on:function(A,I){return this.emitter().on(A,I),this},one:function(A,I){return this.emitter().one(A,I),this},once:function(A,I){return this.emitter().one(A,I),this},removeListener:function(A,I){return this.emitter().removeListener(A,I),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(A,I){return this.emitter().emit(A,I),this}}),rt.eventAliasesOn(o),n=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var d=xv("renderer","base"),v=d.prototype,p=r,m=r.prototype,g=function(){d.apply(this,arguments),p.apply(this,arguments)},y=g.prototype;for(var b in v){var x=v[b],C=m[b]!=null;if(C)return a(b);y[b]=x}for(var O in m)y[O]=m[O];v.clientFunctions.forEach(function(L){y[L]=y[L]||function(){pt("Renderer does not implement `renderer."+L+"()` on its prototype")}}),n=g}else if(t==="__proto__"||t==="constructor"||t==="prototype")return pt(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return Wh({map:bv,keys:[t,e],value:n})}function xv(t,e){return Xh({map:bv,keys:[t,e]})}function DM(t,e,r,n,a){return Wh({map:Ev,keys:[t,e,r,n],value:a})}function MM(t,e,r,n){return Xh({map:Ev,keys:[t,e,r,n]})}var zu=function(){if(arguments.length===2)return xv.apply(null,arguments);if(arguments.length===3)return wv.apply(null,arguments);if(arguments.length===4)return MM.apply(null,arguments);if(arguments.length===5)return DM.apply(null,arguments);pt("Invalid extension access syntax")};pi.prototype.extension=zu;IM.forEach(function(t){t.extensions.forEach(function(e){wv(t.type,e.name,e.impl)})});var Tv=function t(){if(!(this instanceof t))return new t;this.length=0},Mn=Tv.prototype;Mn.instanceString=function(){return"stylesheet"};Mn.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};Mn.css=function(t,e){var r=this.length-1;if(Re(t))this[r].properties.push({name:t,value:e});else if(Qe(t))for(var n=t,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],s=n[o];if(s!=null){var l=Pt.properties[o]||Pt.properties[Qo(o)];if(l!=null){var u=l.name,f=s;this[r].properties.push({name:u,value:f})}}}return this};Mn.style=Mn.css;Mn.generateStyle=function(t){var e=new Pt(t);return this.appendToStyle(e)};Mn.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,a=r.properties;t.selector(n);for(var i=0;i<a.length;i++){var o=a[i];t.css(o.name,o.value)}}return t};var RM="3.30.4",mr=function(e){if(e===void 0&&(e={}),Qe(e))return new pi(e);if(Re(e))return zu.apply(zu,arguments)};mr.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(mr),t.apply(null,e),this};mr.warnings=function(t){return rd(t)};mr.version=RM;mr.stylesheet=mr.Stylesheet=Tv;var kC=bo(Cv(),1),qC=bo(wT(),1);var WT=bo(GT()),XT=bo($T());var ao="http://www.w3.org/1999/02/22-rdf-syntax-ns#",io="http://www.w3.org/2001/XMLSchema#",rc="http://www.w3.org/2000/10/swap/",Zt={xsd:{decimal:`${io}decimal`,boolean:`${io}boolean`,double:`${io}double`,integer:`${io}integer`,string:`${io}string`},rdf:{type:`${ao}type`,nil:`${ao}nil`,first:`${ao}first`,rest:`${ao}rest`,langString:`${ao}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${rc}reify#forSome`,forAll:`${rc}reify#forAll`},log:{implies:`${rc}log#implies`}};var{xsd:js}=Zt,S8=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,YT={"\\":"\\","'":"'",'"':'"',n:`
7
+ `,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},L8=/[\x00-\x20<>\\"\{\}\|\^\`]/,N8={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},O8=/$0^/,oo=class{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let r in this)!(r in N8)&&this[r]instanceof RegExp&&(this[r]=O8)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,r){let n=this._input,a=n.length;for(;;){let s,l;for(;s=this._newline.exec(n);)this.comments&&(l=this._comment.exec(s[0]))&&i("comment",l[1],"",this._line,s[0].length),n=n.substr(s[0].length,n.length),a=n.length,this._line++;if(!s&&(s=this._whitespace.exec(n))&&(n=n.substr(s[0].length,n.length)),this._endOfFile.test(n))return r&&(this.comments&&(l=this._comment.exec(n))&&i("comment",l[1],"",this._line,n.length),n=null,i("eof","","",this._line,0)),this._input=n;let u=this._line,f=n[0],c="",h="",d="",v=null,p=0,m=!1;switch(f){case"^":if(n.length<3)break;if(n[1]==="^"){if(this._previousMarker="^^",n=n.substr(2),n[0]!=="<"){m=!0;break}}else{this._n3Mode&&(p=1,c="^");break}case"<":if(v=this._unescapedIri.exec(n))c="IRI",h=v[1];else if(v=this._iri.exec(n)){if(h=this._unescape(v[1]),h===null||L8.test(h))return o(this);c="IRI"}else n.length>1&&n[1]==="<"?(c="<<",p=2):this._n3Mode&&n.length>1&&n[1]==="="&&(c="inverse",p=2,h=">");break;case">":n.length>1&&n[1]===">"&&(c=">>",p=2);break;case"_":((v=this._blank.exec(n))||r&&(v=this._blank.exec(`${n} `)))&&(c="blank",d="_",h=v[1]);break;case'"':if(v=this._simpleQuotedString.exec(n))h=v[1];else if({value:h,matchLength:p}=this._parseLiteral(n),h===null)return o(this);(v!==null||p!==0)&&(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(v=this._simpleApostropheString.exec(n))h=v[1];else if({value:h,matchLength:p}=this._parseLiteral(n),h===null)return o(this);(v!==null||p!==0)&&(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(v=this._variable.exec(n))&&(c="var",h=v[0]);break;case"@":this._previousMarker==="literal"&&(v=this._langcode.exec(n))?(c="langcode",h=v[1]):(v=this._keyword.exec(n))&&(c=v[0]);break;case".":if(n.length===1?r:n[1]<"0"||n[1]>"9"){c=".",p=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(v=this._number.exec(n)||r&&(v=this._number.exec(`${n} `)))&&(c="literal",h=v[0],d=typeof v[1]=="string"?js.double:typeof v[2]=="string"?js.decimal:js.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(v=this._sparqlKeyword.exec(n))?c=v[0].toUpperCase():m=!0;break;case"f":case"t":(v=this._boolean.exec(n))?(c="literal",h=v[0],d=js.boolean):m=!0;break;case"a":(v=this._shortPredicates.exec(n))?(c="abbreviation",h="a"):m=!0;break;case"=":this._n3Mode&&n.length>1&&(c="abbreviation",n[1]!==">"?(p=1,h="="):(p=2,h=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(p=1,c=f);break;case"{":!this._lineMode&&n.length>=2&&(n[1]==="|"?(c="{|",p=2):(c=f,p=1));break;case"|":n.length>=2&&n[1]==="}"&&(c="|}",p=2);break;default:m=!0}if(m&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(v=this._prefix.exec(n))?(c="prefix",h=v[1]||""):((v=this._prefixed.exec(n))||r&&(v=this._prefixed.exec(`${n} `)))&&(c="prefixed",d=v[1]||"",h=this._unescape(v[2]))),this._previousMarker==="^^")switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return r||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?o(this):this._input=n;let g=p||v[0].length,y=i(c,h,d,u,g);this.previousToken=y,this._previousMarker=c,n=n.substr(g,n.length)}function i(s,l,u,f,c){let h=n?a-n.length:a,d=h+c,v={type:s,value:l,prefix:u,line:f,start:h,end:d};return e(null,v),v}function o(s){e(s._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let r=!1,n=e.replace(S8,(a,i,o,s)=>{if(typeof i=="string")return String.fromCharCode(Number.parseInt(i,16));if(typeof o=="string"){let l=Number.parseInt(o,16);return l<=65535?String.fromCharCode(Number.parseInt(o,16)):String.fromCharCode(55296+((l-=65536)>>10),56320+(l&1023))}return s in YT?YT[s]:(r=!0,"")});return r?null:n}_parseLiteral(e){if(e.length>=3){let r=e.match(/^(?:"""|"|'''|'|)/)[0],n=r.length,a=Math.max(this._literalClosingPos,n);for(;(a=e.indexOf(r,a))>0;){let i=0;for(;e[a-i-1]==="\\";)i++;if(i%2===0){let o=e.substring(n,a),s=o.split(/\r\n|\r|\n/).length-1,l=a+n;if(n===1&&s!==0||n===3&&this._lineMode)break;return this._line+=s,{value:this._unescape(o),matchLength:l}}a++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;let r=new Error(`Unexpected "${e}" on line ${this._line}.`);return r.context={token:void 0,line:this._line,previousToken:this.previousToken},r}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,r){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof r=="function")(0,XT.default)(()=>this._tokenizeToEnd(r,!0));else{let n=[],a;if(this._tokenizeToEnd((i,o)=>i?a=i:n.push(o),!0),a)throw a;return n}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",n=>{this._input!==null&&n.length!==0&&(this._pendingBuffer&&(n=WT.Buffer.concat([this._pendingBuffer,n]),this._pendingBuffer=null),n[n.length-1]&128?this._pendingBuffer=n:(typeof this._input>"u"?this._input=this._readStartingBom(typeof n=="string"?n:n.toString()):this._input+=n,this._tokenizeToEnd(r,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(r,!0)}),e.on("error",r)}};var{rdf:A8,xsd:Va}=Zt,lo,I8=0;var D8={namedNode:jT,blankNode:ZT,variable:JT,literal:QT,defaultGraph:M8,quad:oc,triple:oc,fromTerm:so,fromQuad:eC},KT=D8,Ur=class t{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof t?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},Zs=class extends Ur{get termType(){return"NamedNode"}},uo=class t extends Ur{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let e=this.id,r=e.lastIndexOf('"')+1;return r<e.length&&e[r++]==="@"?e.substr(r).toLowerCase():""}get datatype(){return new Zs(this.datatypeString)}get datatypeString(){let e=this.id,r=e.lastIndexOf('"')+1,n=r<e.length?e[r]:"";return n==="^"?e.substr(r+2):n!=="@"?Va.string:A8.langString}equals(e){return e instanceof t?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},nc=class extends Ur{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},ac=class extends Ur{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},ic=class extends Ur{constructor(){return super(""),lo||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};lo=new ic;var Qs=class extends Ur{constructor(e,r,n,a){super(""),this._subject=e,this._predicate=r,this._object=n,this._graph=a||lo}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}};function jT(t){return new Zs(t)}function ZT(t){return new nc(t||`n3-${I8++}`)}function QT(t,e){if(typeof e=="string")return new uo(`"${t}"@${e.toLowerCase()}`);let r=e?e.value:"";return r===""&&(typeof t=="boolean"?r=Va.boolean:typeof t=="number"&&(Number.isFinite(t)?r=Number.isInteger(t)?Va.integer:Va.double:(r=Va.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),r===""||r===Va.string?new uo(`"${t}"`):new uo(`"${t}"^^${r}`)}function JT(t){return new ac(t)}function M8(){return lo}function oc(t,e,r,n){return new Qs(t,e,r,n)}function so(t){if(t instanceof Ur)return t;switch(t.termType){case"NamedNode":return jT(t.value);case"BlankNode":return ZT(t.value);case"Variable":return JT(t.value);case"DefaultGraph":return lo;case"Literal":return QT(t.value,t.language||t.datatype);case"Quad":return eC(t);default:throw new Error(`Unexpected termType: ${t.termType}`)}}function eC(t){if(t instanceof Qs)return t;if(t.termType!=="Quad")throw new Error(`Unexpected termType: ${t.termType}`);return oc(so(t.subject),so(t.predicate),so(t.object),so(t.graph))}var tC=0,Yn=class{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&rC(this,e.factory);let r=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(r),a=/trig/.test(r),i=/triple/.test(r),o=/quad/.test(r),s=this._n3Mode=/n3/.test(r),l=i||o;(this._supportsNamedGraphs=!(n||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||a||i||s),this._supportsRDFStar=r===""||/star|\*$/.test(r),l&&(this._resolveRelativeIRI=u=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new oo({lineMode:l,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){tC=0}_setBase(e){if(!e)this._base="",this._basePath="";else{let r=e.indexOf("#");r>=0&&(e=e.substr(0,r)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,r,n,a,i){let o=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:a,object:i,graph:r,inverse:o?this._inversePredicate:!1,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,r){let n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${r.type}`,r);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,r){let n;switch(e.type){case"IRI":case"typeIRI":let a=this._resolveIRI(e.value);if(a===null)return this._error("Invalid IRI",e);n=this._namedNode(a);break;case"type":case"prefixed":let i=this._prefixes[e.prefix];if(i===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._namedNode(i+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!r&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){let r=e.type;switch(r){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${r}`,e):(this._subject=null,r==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);let r=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:r?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let r=null,n=null,a=this._readListItem,i=this._subject,o=this._contextStack,s=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=r=this._blankNode()),a=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(a=this._readPredicate,this._subject===this.RDF_NIL)return a}else if(a=this._getContextEndReader(),this._object===this.RDF_NIL)return a;n=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,a=this._readListItemDataTypeOrLang):(r=this._literal(e.value,this._namedNode(e.prefix)),a=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((r=this._readEntity(e))===void 0)return}if(n===null&&(this._subject=n=this._blankNode()),i===null?s.predicate===null?s.subject=n:s.object=n:this._emit(i,this.RDF_REST,n,this._graph),r!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,n,this.RDF_FIRST,r),this._subject=r,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,r,this._graph)}return a}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let r=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":let n=this._readEntity(e);if(n===void 0)return;r=this._literal(this._literalValue,n),e=null;break;case"langcode":r=this._literal(this._literalValue,e.value),e=null;break}return{token:e,literal:r}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,r){let n=this._completeLiteral(e);if(n)return this._object=n.literal,r&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),n.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let r,n=this._graph,a=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,r=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":r=this._readPredicate;break;case",":r=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);let o=this._predicate,s=this._object;this._subject=this._quad(a,o,s,this.DEFAULTGRAPH),r=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,r=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(n=this._readEntity(e))!==void 0){r=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(a!==null){let o=this._predicate,s=this._object;i?this._emit(s,o,a,n):this._emit(a,o,s,n)}return r}_readBlankNodePunctuation(e){let r;switch(e.type){case";":r=this._readPredicate;break;case",":r=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),r}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);let r=this._readEntity(e);return this._prefixes[this._prefix]=r.value,this._prefixCallback(this._prefix,r),this._readDeclarationPunctuation}_readBaseIRI(e){let r=e.type==="IRI"&&this._resolveIRI(e.value);return r?(this._setBase(r),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let r;switch(e.type){case"IRI":case"prefixed":if((r=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,r,this.QUANTIFIERS_GRAPH)):this._quantified[r.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let r=this._contextStack,n=r.length&&r[r.length-1];if(n&&n.type==="item"){let a=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,a,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let r,n,a=this._blankNode();if((n=this._readEntity(e))!==void 0)return this._predicate===null?(r=this._subject,this._subject=a):(r=this._object,this._object=a),this._emit(r,n,a,this._graph),this._readPath}_readBackwardPath(e){let r=this._blankNode(),n,a;if((n=this._readEntity(e))!==void 0)return this._predicate===null?(a=this._subject,this._subject=r):(a=this._object,this._object=r),this._emit(r,n,a,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);let r=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=r,this._readPredicate):(this._object=r,this._getContextEndReader())}_getContextEndReader(){let e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,r,n,a){this._callback(null,this._quad(e,r,n,a||this.DEFAULTGRAPH))}_error(e,r){let n=new Error(`${e} on line ${r.line}.`);n.context={token:r,line:r.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=Js}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;let r=e.length,n="",a=-1,i=-1,o=0,s="/";for(;a<r;){switch(s){case":":if(i<0&&e[++a]==="/"&&e[++a]==="/")for(;(i=a+1)<r&&e[i]!=="/";)a=i;break;case"?":case"#":a=r;break;case"/":if(e[a+1]===".")switch(s=e[++a+1],s){case"/":n+=e.substring(o,a-1),o=a+1;break;case void 0:case"?":case"#":return n+e.substring(o,a)+e.substr(a+1);case".":if(s=e[++a+1],s===void 0||s==="/"||s==="?"||s==="#"){if(n+=e.substring(o,a-2),(o=n.lastIndexOf("/"))>=i&&(n=n.substr(0,o)),s!=="/")return`${n}/${e.substr(a+1)}`;o=a+1}}}s=e[++a]}return n+e.substring(o)}parse(e,r,n){let a,i,o;if(r&&(r.onQuad||r.onPrefix||r.onComment)?(a=r.onQuad,i=r.onPrefix,o=r.onComment):(a=r,i=n),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${tC++}_`,this._prefixCallback=i||Js,this._inversePredicate=!1,this._quantified=Object.create(null),!a){let l=[],u;if(this._callback=(f,c)=>{f?u=f:c&&l.push(c)},this._lexer.tokenize(e).every(f=>this._readCallback=this._readCallback(f)),u)throw u;return l}let s=(l,u)=>{l!==null?(this._callback(l),this._callback=Js):this._readCallback&&(this._readCallback=this._readCallback(u))};o&&(this._lexer.comments=!0,s=(l,u)=>{l!==null?(this._callback(l),this._callback=Js):this._readCallback&&(u.type==="comment"?o(u.value):this._readCallback=this._readCallback(u))}),this._callback=a,this._lexer.tokenize(e,s)}};function Js(){}function rC(t,e){let r=e.namedNode;t._namedNode=r,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=r(Zt.rdf.first),t.RDF_REST=r(Zt.rdf.rest),t.RDF_NIL=r(Zt.rdf.nil),t.N3_FORALL=r(Zt.r.forAll),t.N3_FORSOME=r(Zt.r.forSome),t.ABBREVIATIONS={a:r(Zt.rdf.type),"=":r(Zt.owl.sameAs),">":r(Zt.log.implies)},t.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}rC(Yn.prototype,KT);function nC(t,e){let r=[],n=[],a={};try{n=new Yn({format:"Turtle",baseIRI:e}).parse(t),a=_8(t)}catch(i){r.push(P8(i))}return{quads:n,prefixes:a,baseIRI:e,errors:r}}function P8(t){let e=t instanceof Error?t.message:String(t),r=/line (\d+)(?:\s*(?:,|:)?\s*column (\d+))?/i.exec(e);return{message:e,line:r?Number(r[1]):void 0,column:r?.[2]?Number(r[2]):void 0}}function _8(t){let e=Object.create(null),r=new Set(["__proto__","constructor","prototype"]),n=/(?:@prefix\s+|\bPREFIX\s+)([A-Za-z][\w-]*|)\s*:\s*<([^>]*)>/gi;for(let a of t.matchAll(n))r.has(a[1])||(e[a[1]]=a[2]);return e}var gn="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Et="http://www.w3.org/2000/01/rdf-schema#",Fe="http://www.w3.org/2002/07/owl#",Wn="http://www.w3.org/2001/XMLSchema#",Rt="http://www.w3.org/2004/02/skos/core#",eu="http://purl.org/dc/terms/",F8="http://xmlns.com/foaf/0.1/";var fo=`${gn}type`,tu=`${Et}label`,ru=`${Et}comment`,co=`${Et}subClassOf`,gZ=`${Et}subPropertyOf`,aC=`${Et}domain`,iC=`${Et}range`,oC=`${Et}Resource`,ho=`${Fe}Class`,nu=`${Fe}ObjectProperty`,au=`${Fe}DatatypeProperty`,sc=`${Fe}AnnotationProperty`,iu=`${Fe}NamedIndividual`,uc=`${Fe}Ontology`,sC=`${Fe}Thing`,uC=`${Fe}Restriction`,yZ=`${Fe}unionOf`,mZ=`${Fe}intersectionOf`,bZ=`${Fe}inverseOf`,EZ=`${Fe}FunctionalProperty`,wZ=`${Fe}InverseFunctionalProperty`,xZ=`${Fe}onProperty`,TZ=`${Fe}someValuesFrom`,CZ=`${Fe}allValuesFrom`,SZ=`${Fe}hasValue`,LZ=`${Fe}equivalentClass`,NZ=`${Fe}equivalentProperty`,OZ=`${Fe}sameAs`,AZ=`${Fe}differentFrom`,IZ=`${Fe}disjointWith`,DZ=`${Fe}cardinality`,MZ=`${Fe}minCardinality`,RZ=`${Fe}maxCardinality`,PZ=`${Fe}qualifiedCardinality`,_Z=`${Fe}minQualifiedCardinality`,FZ=`${Fe}maxQualifiedCardinality`,BZ=`${Fe}onClass`,kZ=`${Fe}hasKey`,qZ=`${Fe}imports`,zZ=`${Fe}versionIRI`,UZ=`${Fe}priorVersion`,GZ=`${Et}seeAlso`,VZ=`${Et}isDefinedBy`,ou=`${Et}Class`,lc=`${gn}Property`,HZ=`${gn}first`,$Z=`${gn}rest`,YZ=`${gn}nil`,fc=`${Rt}Concept`,lC=`${Rt}ConceptScheme`,fC=`${Rt}broader`,WZ=`${Rt}narrower`,XZ=`${Rt}related`,cC=`${Rt}prefLabel`,KZ=`${Rt}altLabel`,jZ=`${Rt}inScheme`;function Xe(t,e,r,n){return{iri:`${e}${r}`,prefix:t,local:r,label:`${t}:${r}`,comment:n}}var B8=[Xe("rdf",gn,"type","States that a resource is an instance of a class."),Xe("rdf",gn,"Property","The class of RDF properties."),Xe("rdfs",Et,"Class","The class of classes."),Xe("rdfs",Et,"subClassOf","Relates a class to one of its superclasses."),Xe("rdfs",Et,"subPropertyOf","Relates a property to one of its superproperties."),Xe("rdfs",Et,"domain","Declares the class of subjects a property applies to."),Xe("rdfs",Et,"range","Declares the class or datatype of a property's values."),Xe("rdfs",Et,"label","A human-readable name for a resource."),Xe("rdfs",Et,"comment","A human-readable description of a resource."),Xe("rdfs",Et,"seeAlso","Points to a related resource."),Xe("rdfs",Et,"isDefinedBy","Points to the resource defining a term."),Xe("owl",Fe,"Class","The class of OWL classes."),Xe("owl",Fe,"ObjectProperty","A property relating individuals to individuals."),Xe("owl",Fe,"DatatypeProperty","A property relating individuals to literal values."),Xe("owl",Fe,"AnnotationProperty","A property used for non-logical annotations."),Xe("owl",Fe,"NamedIndividual","An explicitly named individual."),Xe("owl",Fe,"Ontology","Marks the document/ontology itself."),Xe("owl",Fe,"equivalentClass","States that two classes have the same instances."),Xe("owl",Fe,"equivalentProperty","States that two properties have the same meaning."),Xe("owl",Fe,"inverseOf","Declares that a property is the inverse of another."),Xe("owl",Fe,"TransitiveProperty","Marks a property as transitive."),Xe("owl",Fe,"SymmetricProperty","Marks a property as symmetric."),Xe("owl",Fe,"FunctionalProperty","Marks a property as functional (at most one value)."),Xe("owl",Fe,"sameAs","States that two individuals are identical."),Xe("owl",Fe,"differentFrom","States that two individuals are distinct."),Xe("owl",Fe,"disjointWith","States that two classes share no instances."),Xe("skos",Rt,"Concept","The class of SKOS concepts."),Xe("skos",Rt,"ConceptScheme","A set of SKOS concepts."),Xe("skos",Rt,"prefLabel","The preferred lexical label for a concept."),Xe("skos",Rt,"altLabel","An alternative lexical label for a concept."),Xe("skos",Rt,"broader","Relates a concept to a more general concept."),Xe("skos",Rt,"narrower","Relates a concept to a more specific concept."),Xe("skos",Rt,"related","Relates a concept to an associated concept."),Xe("skos",Rt,"inScheme","Relates a concept to the scheme it belongs to."),Xe("dcterms",eu,"title","The title of a resource."),Xe("dcterms",eu,"description","A description of a resource."),Xe("dcterms",eu,"creator","The creator of a resource.")],k8=new Map(B8.map(t=>[t.iri,t]));function su(t){return k8.get(t)}var q8=new Set([ho,ou]),z8=new Set([nu,au,sc,lc]);function hC(t){return q8.has(t)}function dC(t){return z8.has(t)}var U8=[gn,Et,Fe,Wn,Rt,eu,F8];function vC(t){return U8.some(e=>t.startsWith(e))}function gC(t){let e=new Map,r=[],n=(a,i)=>{let o=e.get(a);return o||(o={id:a,kind:"resource",label:yC(a,i),isBlankNode:i},e.set(a,o)),o};for(let[a,i]of t.entries()){if(i.subject.termType!=="NamedNode"&&i.subject.termType!=="BlankNode")continue;let o=V8(i),s=n(o,i.subject.termType==="BlankNode");if(i.object.termType==="Literal"){i.predicate.value===tu&&(s.label=i.object.value),i.predicate.value===ru&&(s.comment=i.object.value);let u=`_:literal:${a}`;e.set(u,{id:u,kind:"literal",label:H8(i.object),isBlankNode:!1,literalValue:i.object.value,datatypeIri:i.object.datatype.value,language:i.object.language||void 0}),pC(r,s.id,i.predicate.value,u);continue}if(i.object.termType!=="NamedNode"&&i.object.termType!=="BlankNode")continue;let l=$8(i);n(l,i.object.termType==="BlankNode"),i.predicate.value===fo&&i.object.termType==="NamedNode"&&G8(s,i.object.value),i.predicate.value===co&&(s.kind=s.kind==="resource"?"class":s.kind),pC(r,s.id,i.predicate.value,l)}return{nodes:[...e.values()],edges:r}}function G8(t,e){hC(e)?t.kind="class":dC(e)?t.kind="property":e===iu?t.kind=t.kind==="resource"?"individual":t.kind:t.kind==="resource"&&(t.kind="individual")}function pC(t,e,r,n){t.push({id:`${e}|${r}|${n}|${t.length}`,source:e,predicate:r,predicateLabel:su(r)?.label??yC(r,!1),target:n})}function V8(t){return t.subject.termType==="BlankNode"?`_:${t.subject.value}`:t.subject.value}function H8(t){let r=`"${t.value.replaceAll("\\","\\\\").replaceAll('"','\\"').replaceAll(`
8
+ `,"\\n").replaceAll("\r","\\r")}"`;if(t.language)return`${r}@${t.language}`;if(t.datatype.value===`${Wn}string`)return r;let n=su(t.datatype.value)?.label??(t.datatype.value.startsWith(Wn)?`xsd:${t.datatype.value.slice(Wn.length)}`:`<${t.datatype.value}>`);return`${r}^^${n}`}function $8(t){return t.object.termType==="BlankNode"?`_:${t.object.value}`:t.object.value}function yC(t,e){if(e)return t.startsWith("_:literal:")?t:`[blank node ${t.slice(2)}]`;let r=su(t);if(r)return r.label;let n=t.lastIndexOf("#"),a=t.lastIndexOf("/"),i=Math.max(n,a);return i>=0&&i<t.length-1?t.slice(i+1):t}function Ha(t){let e=t.lastIndexOf("#"),r=t.lastIndexOf("/"),n=Math.max(e,r);return n>=0&&n<t.length-1?t.slice(n+1):t}function Xn(t,e,r){for(let n of t)if(!(n.subject.value!==e||n.object.termType!=="Literal")&&!vC(n.predicate.value)&&r.includes(Ha(n.predicate.value)))return n.object.value}var yn=48;function mC(t,e,r=yn){let n=new Map;for(let c of t)n.set(c,[]);for(let{source:c,target:h}of e)c===h||!n.has(c)||!n.has(h)||(n.get(c).push(h),n.get(h).push(c));let a=new Set,i=[];function o(c){let h=[c],d=[];for(;h.length>0;){let v=h.pop();if(a.has(v))continue;a.add(v),d.push(v);let p=[...new Set(n.get(v))].sort().reverse();for(let m of p)a.has(m)||h.push(m)}return d}for(let c of[...t].sort())a.has(c)||i.push(o(c));let s=new Map;if(i.length===0)return s;let l=r/i.length,u=r/3,f=Math.min(l*.6,u);return i.forEach((c,h)=>{let d=h*l;c.forEach((v,p)=>{let m=c.length>1?p/(c.length-1)*f:0;s.set(v,{colorIndex:Math.round(d+m)%r,groupIndex:h+1,groupCount:i.length,groupSize:c.length})})}),s}var Y8=[{tokens:["pizza"],icon:"\u{1F355}"},{tokens:["cheese"],icon:"\u{1F9C0}"},{tokens:["vegetable","veggie","plant"],icon:"\u{1F96C}"},{tokens:["meat"],icon:"\u{1F969}"},{tokens:["food","meal","dish","topping","ingredient","recipe"],icon:"\u{1F37D}\uFE0F"},{tokens:["person","people","human","agent","user","member","customer"],icon:"\u{1F464}"},{tokens:["organization","org","company","institution","department","team"],icon:"\u{1F3E2}"},{tokens:["place","location","city","country","region","address","site"],icon:"\u{1F4CD}"},{tokens:["author","writer","creator"],icon:"\u270D\uFE0F"},{tokens:["book","publication","library","catalog"],icon:"\u{1F4DA}"},{tokens:["document","doc","file","report","paper","article"],icon:"\u{1F4C4}"},{tokens:["event","meeting","conference","session"],icon:"\u{1F4C5}"},{tokens:["time","date","period","interval","duration"],icon:"\u{1F550}"},{tokens:["money","price","cost","payment","invoice","order"],icon:"\u{1F4B0}"},{tokens:["vehicle","car","truck","ship","aircraft","train"],icon:"\u{1F697}"},{tokens:["device","sensor","machine","equipment","asset","component"],icon:"\u2699\uFE0F"},{tokens:["project","task","activity","process","workflow","step"],icon:"\u{1F4CB}"},{tokens:["system","service","application","software","platform"],icon:"\u{1F4BB}"},{tokens:["network","graph","link","connection"],icon:"\u{1F517}"},{tokens:["message","email","mail","note","comment"],icon:"\u2709\uFE0F"},{tokens:["role","position","job","title"],icon:"\u{1F396}\uFE0F"},{tokens:["concept","category","type","taxonomy","scheme","term"],icon:"\u{1F3F7}\uFE0F"},{tokens:["measurement","metric","unit","quantity","value"],icon:"\u{1F4CF}"},{tokens:["health","patient","medical","disease","treatment"],icon:"\u{1F3E5}"},{tokens:["law","policy","rule","regulation","contract","license"],icon:"\u2696\uFE0F"},{tokens:["education","course","student","teacher","school","lesson"],icon:"\u{1F393}"},{tokens:["animal","species","organism"],icon:"\u{1F43E}"},{tokens:["energy","power","electricity"],icon:"\u26A1"},{tokens:["store","shop"],icon:"\u{1F3EA}"},{tokens:["supplier","shipment","delivery"],icon:"\u{1F4E6}"}],bC="\u{1F4E6}",EC="\u{1F3F7}\uFE0F";function W8(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[\s_\-0-9]+/).map(e=>e.toLowerCase()).filter(e=>e.length>0)}function cc(t,e){let r=new Set(t.flatMap(W8));for(let n of Y8)if(n.tokens.some(a=>r.has(a)))return n.icon;return e}var X8=["icon","emoji"],K8=["color","colour","fillColor"];function j8(t){let e=[...t];return e.length<1||e.length>4?!1:!/[ -]/.test(t)}var Z8=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function Q8(t){return Z8.test(t.trim())}function hc(t,e){let r=Xn(t,e,X8);return r!==void 0&&j8(r)?r:void 0}function dc(t,e){let r=Xn(t,e,K8);return r!==void 0&&Q8(r)?r.trim():void 0}var vc=new Set([ho,ou,nu,au,sc,uc,iu,lc,sC,oC,uC,fc,lC]),J8={string:"string",integer:"integer",int:"integer",long:"integer",short:"integer",nonNegativeInteger:"integer",positiveInteger:"integer",decimal:"decimal",float:"decimal",double:"double",date:"date",dateTime:"datetime",boolean:"boolean",anyURI:"other",time:"other",duration:"other"},eX=new Set(["one-to-one","one-to-many","many-to-one","many-to-many"]);function tX(t){let e=new Map,r=new Map,n=new Map,a=new Map;for(let i of t){if(i.subject.termType!=="NamedNode")continue;let o=i.subject.value;i.predicate.value===fo&&i.object.termType==="NamedNode"?(e.has(o)||e.set(o,new Set),e.get(o).add(i.object.value)):i.predicate.value===tu&&i.object.termType==="Literal"?r.set(o,i.object.value):i.predicate.value===cC&&i.object.termType==="Literal"?n.set(o,i.object.value):i.predicate.value===ru&&i.object.termType==="Literal"&&a.set(o,i.object.value)}return{typesOf:e,labelOf:r,prefLabelOf:n,commentOf:a}}function uu(t,e){return e.labelOf.get(t)??e.prefLabelOf.get(t)??Ha(t)}function rX(t){return t?t.startsWith(Wn)?J8[Ha(t)]??"other":"other":"string"}function wC(t){let e=tX(t),r,n;for(let[g,y]of e.typesOf)if(y.has(uc)){r=e.labelOf.get(g),n=e.commentOf.get(g);break}let a=new Set,i=new Set;for(let[g,y]of e.typesOf)vc.has(g)||(y.has(ho)||y.has(ou)?a.add(g):y.has(fc)&&i.add(g));for(let g of t)g.predicate.value===co&&g.subject.termType==="NamedNode"&&g.object.termType==="NamedNode"&&!vc.has(g.subject.value)&&!vc.has(g.object.value)&&(a.add(g.subject.value),a.add(g.object.value));let o=new Map,s=new Map,l=new Set,u=new Set;for(let[g,y]of e.typesOf)y.has(nu)&&l.add(g),y.has(au)&&u.add(g);for(let g of t){if(g.subject.termType!=="NamedNode")continue;let y=g.subject.value;g.predicate.value===aC&&g.object.termType==="NamedNode"?(o.has(y)||o.set(y,new Set),o.get(y).add(g.object.value)):g.predicate.value===iC&&g.object.termType==="NamedNode"&&s.set(y,g.object.value)}let f=[],c=new Map;for(let g of t)if(g.predicate.value===co&&g.subject.termType==="NamedNode"&&g.object.termType==="NamedNode"&&a.has(g.subject.value)&&a.has(g.object.value)){let y=`${g.subject.value}|subClassOf|${g.object.value}`;f.some(b=>b.id===y)||f.push({id:y,name:"subClassOf",source:g.subject.value,target:g.object.value,kind:"subClassOf",cardinality:"unspecified",provenance:"declared"})}for(let g of t)g.predicate.value===fC&&g.subject.termType==="NamedNode"&&g.object.termType==="NamedNode"&&i.has(g.subject.value)&&i.has(g.object.value)&&f.push({id:`${g.subject.value}|skosBroader|${g.object.value}`,name:"broader",source:g.subject.value,target:g.object.value,kind:"skosBroader",cardinality:"unspecified",provenance:"declared"});for(let g of l){let y=o.get(g),b=s.get(g);if(y&&b&&a.has(b)){for(let x of y)if(a.has(x)){let C=Xn(t,g,["cardinality"]),O=C&&eX.has(C)?C:"unspecified";f.push({id:`${x}|${g}|${b}`,iri:g,name:uu(g,e),source:x,target:b,kind:"objectProperty",cardinality:O,description:e.commentOf.get(g),provenance:"declared"})}}}for(let g of u){let y=o.get(g),b=s.get(g);if(y){let x=rX(b),C=Xn(t,g,["isIdentifier"]),O=Xn(t,g,["unit"]);for(let L of y)a.has(L)&&(c.has(L)||c.set(L,[]),c.get(L).push({iri:g,name:uu(g,e),type:x,datatypeIri:b,isIdentifier:C==="true",unit:O??void 0,description:e.commentOf.get(g),provenance:"declared"}))}}let h=new Map;for(let g of t)if(g.predicate.value===fo&&g.subject.termType==="NamedNode"&&g.object.termType==="NamedNode"){let y=g.object.value;(a.has(y)||i.has(y))&&!a.has(g.subject.value)&&!i.has(g.subject.value)&&h.set(y,(h.get(y)??0)+1)}let d=[...a,...i],v=f.map(g=>({source:g.source,target:g.target})),p=mC(d,v),m=[];for(let g of a){let y=uu(g,e),b=p.get(g)??{colorIndex:0,groupIndex:1,groupCount:1,groupSize:1},x=hc(t,g)??cc([y,Ha(g)],bC);m.push({id:g,name:y,description:e.commentOf.get(g),origin:e.typesOf.get(g)?.has(ho)?"owlClass":"rdfsClass",properties:c.get(g)??[],instanceCount:h.get(g)??0,icon:x,colorIndex:b.colorIndex,connectionGroup:{index:b.groupIndex,count:b.groupCount,size:b.groupSize},colorOverride:dc(t,g)})}for(let g of i){let y=uu(g,e),b=p.get(g)??{colorIndex:0,groupIndex:1,groupCount:1,groupSize:1},x=hc(t,g)??cc([y,Ha(g)],EC);m.push({id:g,name:y,description:e.commentOf.get(g),origin:"skosConcept",properties:c.get(g)??[],instanceCount:h.get(g)??0,icon:x,colorIndex:b.colorIndex,connectionGroup:{index:b.groupIndex,count:b.groupCount,size:b.groupSize},colorOverride:dc(t,g)})}return{title:r,description:n,entities:m,relations:f,isEmpty:m.length===0&&f.length===0}}function pc(t){return t==="dark"?!0:t==="light"||typeof window>"u"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function CC(t,e=yn,r=!1){return`hsl(${(t%e+e)%e*(360/e)}, ${r?70:75}%, ${r?62:42}%)`}function gc(t,e=yn,r=!1){let n=(t%e+e)%e*(360/e);return r?`hsl(${n}, 38%, 23%)`:`hsl(${n}, 62%, 92%)`}function SC(t,e="#ffffff"){let r=xC(t),n=xC(e);if(!r||!n)return"#000000";let a=aX(r,n),i=(TC(a)+.05)/.05,o=1.05/(TC(a)+.05);return i>=o?"#000000":"#ffffff"}function xC(t){let e=t.trim().toLowerCase(),r=e.match(/^#([0-9a-f]{3,8})$/i)?.[1];if(r&&[3,4,6,8].includes(r.length)){let i=r.length<=4?[...r].map(o=>o+o).join(""):r;return{r:Number.parseInt(i.slice(0,2),16),g:Number.parseInt(i.slice(2,4),16),b:Number.parseInt(i.slice(4,6),16),a:i.length===8?Number.parseInt(i.slice(6,8),16)/255:1}}let n=e.match(/^hsla?\(\s*([\d.-]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/);if(n)return{...nX(Number(n[1]),Number(n[2]),Number(n[3])),a:n[4]===void 0?1:Math.min(1,Number(n[4]))};let a=e.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)$/);if(a)return{r:Math.min(255,Number(a[1])),g:Math.min(255,Number(a[2])),b:Math.min(255,Number(a[3])),a:a[4]===void 0?1:Math.min(1,Number(a[4]))}}function nX(t,e,r){let n=e/100,a=r/100,i=(1-Math.abs(2*a-1))*n,o=(t%360+360)%360/60,s=i*(1-Math.abs(o%2-1)),[l,u,f]=o<1?[i,s,0]:o<2?[s,i,0]:o<3?[0,i,s]:o<4?[0,s,i]:o<5?[s,0,i]:[i,0,s],c=a-i/2;return{r:(l+c)*255,g:(u+c)*255,b:(f+c)*255}}function aX(t,e){let r=t.a+e.a*(1-t.a);return r===0?{r:0,g:0,b:0,a:0}:{r:(t.r*t.a+e.r*e.a*(1-t.a))/r,g:(t.g*t.a+e.g*e.a*(1-t.a))/r,b:(t.b*t.a+e.b*e.a*(1-t.a))/r,a:r}}function TC(t){let e=[t.r,t.g,t.b].map(r=>{let n=r/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4});return .2126*e[0]+.7152*e[1]+.0722*e[2]}var iX={schemaView:"Schema",triplesView:"Triples",searchPlaceholder:"Search classes, relations, properties\u2026",noResults:"No results",properties:"properties",instances:"instances",relations:"Relations",entities:"Entities",triples:"Triples",legend:"Legend",inspector:"Inspector",statistics:"Statistics",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",fitToScreen:"Fit to screen",exportPng:"Export PNG",layout:"Layout",close:"Close",parseError:"Parse error at line {line}, column {col}: {msg}",emptyOntology:"No classes or concepts found in this document.",description:"Description",type:"Type",domain:"Domain",range:"Range",colorGroup:"Color group {index} of {count} ({size} members)",declared:"Declared",inferred:"Inferred"},oX={schemaView:"\u30B9\u30AD\u30FC\u30DE",triplesView:"\u30C8\u30EA\u30D7\u30EB",searchPlaceholder:"\u30AF\u30E9\u30B9\u30FB\u95A2\u4FC2\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u691C\u7D22\u2026",noResults:"\u7D50\u679C\u306A\u3057",properties:"\u30D7\u30ED\u30D1\u30C6\u30A3",instances:"\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9",relations:"\u95A2\u4FC2",entities:"\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3",triples:"\u30C8\u30EA\u30D7\u30EB",legend:"\u51E1\u4F8B",inspector:"\u30A4\u30F3\u30B9\u30DA\u30AF\u30BF\u30FC",statistics:"\u7D71\u8A08",zoomIn:"\u62E1\u5927",zoomOut:"\u7E2E\u5C0F",resetZoom:"\u30BA\u30FC\u30E0\u30EA\u30BB\u30C3\u30C8",fitToScreen:"\u753B\u9762\u306B\u30D5\u30A3\u30C3\u30C8",exportPng:"PNG\u66F8\u304D\u51FA\u3057",layout:"\u30EC\u30A4\u30A2\u30A6\u30C8",close:"\u9589\u3058\u308B",parseError:"{line}\u884C\u76EE\u3001{col}\u5217\u76EE\u306B\u30A8\u30E9\u30FC: {msg}",emptyOntology:"\u3053\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u30AF\u30E9\u30B9\u3084\u30B3\u30F3\u30BB\u30D7\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002",description:"\u8AAC\u660E",type:"\u578B",domain:"\u30C9\u30E1\u30A4\u30F3",range:"\u30EC\u30F3\u30B8",colorGroup:"\u30AB\u30E9\u30FC\u30B0\u30EB\u30FC\u30D7 {index}/{count}\uFF08{size}\u30E1\u30F3\u30D0\u30FC\uFF09",declared:"\u5BA3\u8A00\u6E08\u307F",inferred:"\u63A8\u8AD6\u6E08\u307F"};function sX(t){return t==="en"||t==="ja"?t:typeof navigator<"u"&&navigator.language.toLowerCase().startsWith("ja")?"ja":"en"}function LC(t){return sX(t)==="ja"?oX:iX}var NC={entity:0,relation:1,property:2};function OC(t){return t.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase()}function yc(t,e){let r=OC(t);if(r===e)return 0;if(r.startsWith(e))return 1;if(r.split(/[\s._:/-]+/).some(n=>n.startsWith(e)))return 2;if(r.includes(e))return 3}function AC(t,e,r=8){let n=OC(e.trim());if(!n||r<=0)return[];let a=new Map(t.entities.map(o=>[o.id,o.name])),i=[];for(let o of t.entities){let s=yc(o.name,n);s!==void 0&&i.push({id:o.id,kind:"entity",label:o.name,meta:`${o.properties.length} properties \xB7 ${o.instanceCount} instances`,score:s});for(let l of o.properties){let u=yc(l.name,n);u!==void 0&&i.push({id:l.iri,ownerId:o.id,kind:"property",label:l.name,meta:`${o.name} \xB7 ${l.type}`,score:u})}}for(let o of t.relations){let s=a.get(o.source)??o.source,l=a.get(o.target)??o.target,u=yc(o.name,n);u!==void 0&&i.push({id:o.id,kind:"relation",label:o.name,meta:`${s} \u2192 ${l}`,score:u})}return i.sort((o,s)=>o.score-s.score||NC[o.kind]-NC[s.kind]||o.label.localeCompare(s.label)).slice(0,r).map(({score:o,...s})=>s)}function IC(t){return Math.min(2.5,Math.max(.35,t))}function DC(t,e){let r=e>=40?.6:.8;return IC(Math.max(t,r))}function mc(t,e){return IC(t*(e==="in"?1.2:1/1.2))}function bc(t){return`${Math.round(t*100)}%`}var uX=new Set(["__proto__","constructor","prototype"]);function Ec(t,e){return`ontologyviewer:${t}:${e}`}function MC(t,e){let r=PC(e);if(r)try{localStorage.setItem(t,JSON.stringify({version:1,...r}))}catch{}}function RC(t){try{let e=localStorage.getItem(t);if(!e)return;let r=JSON.parse(e);return!po(r)||r.version!==1?void 0:PC(r)}catch{return}}function PC(t){if(!po(t)||!po(t.positions)||!po(t.pan)||!vo(t.zoom)||t.zoom<.1||t.zoom>10||!vo(t.pan.x)||!vo(t.pan.y))return;let e=Object.entries(t.positions);if(e.length>1e5)return;let r=Object.create(null);for(let[n,a]of e){if(uX.has(n)||!po(a)||!vo(a.x)||!vo(a.y))return;r[n]={x:a.x,y:a.y}}return{positions:r,zoom:t.zoom,pan:{x:t.pan.x,y:t.pan.y}}}function po(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function vo(t){return typeof t=="number"&&Number.isFinite(t)}var _C=!1;function fX(){_C||(mr.use(kC.default),mr.use(qC.default),_C=!0)}function zC(t,e,r,n){fX();let a=t.ownerDocument;xX(a);let i=LC(r.locale??"auto"),o=a.createElement("section");o.className="ontologyviewer-root",r.injectStyles!==!1&&(o.style.height=r.height??"600px"),o.setAttribute("role","region"),o.setAttribute("aria-label",i.schemaView),t.insertAdjacentElement("afterend",o);let s=cX(a,o,i,r),l="loading",u,f={entities:[],relations:[],isEmpty:!0},c={nodes:[],edges:[]},h=r.defaultView??"schema",d=r.layout??"fcose",v=pc(r.theme??"auto"),p,m=!1,g,y,b=new AbortController,{signal:x}=b;BC(o,v);let C={container:o,sourceElement:t,get status(){return l},get error(){return u},async update(Q){O(),t.textContent=Q,L(Q)},destroy(){m||(m=!0,l="destroyed",y&&clearTimeout(y),b.abort(),ne?.disconnect(),ce&&ce.removeEventListener("change",ee),p?.destroy(),p=void 0,o.remove(),n())},fit(){O(),S()},runLayout(Q){O(),Q&&(d=Q,s.layout.value=Q),E()},async exportPng(){if(O(),!p||p.elements().empty())throw new Error("The ontology graph is not ready.");let Q=p.png({full:!0,scale:2,bg:v?"#1e1e1e":"#ffffff"});return wX(Q)}};function O(){if(m)throw new Error("This Ontology Viewer instance has been destroyed.")}function L(Q){l="loading",u=void 0;let se=nC(Q,r.baseIri??r.baseIRI??a.baseURI);if(se.errors.length>0){let J=se.errors[0],ie={...J,cause:J.message};A(ie);return}if(f=wC(se.quads),c=gC(se.quads),f.isEmpty&&c.nodes.length===0){l="empty",u=void 0,P(),k(!1),U(i.emptyOntology,"status"),j();return}h==="schema"&&f.isEmpty&&(h="triples"),l="ready",k(!0),B(),Z(),I(),j(),V(),queueMicrotask(()=>{!m&&l==="ready"&&r.onReady?.(C)})}function A(Q){l="error",u=Q,P(),k(!1);let se=i.parseError.replace("{line}",String(Q.line??"?")).replace("{col}",String(Q.column??"?")).replace("{msg}",Q.message);U(se,"alert"),queueMicrotask(()=>{!m&&u===Q&&r.onError?.(Q,C)})}function I(){P(),g=void 0;let Q=M(),se=Q==="schema"?hX(f):dX(c);p=mr({container:s.graph,elements:se,style:Q==="schema"?vX(v):pX(v),layout:{name:"preset"},minZoom:.35,maxZoom:2.5,wheelSensitivity:.25});let J=w(p,Q);D(p,Q),J?(p.layout({name:"preset",fit:!1}).run(),S(!1)):E(),s.zoomLabel.textContent=bc(p.zoom())}function D(Q,se){Q.on("select","node",J=>{K(J.target.id(),se),r.onSelectionChange?.(J.target.id())}),Q.on("select","edge",J=>{G(J.target.id(),se),r.onSelectionChange?.(J.target.id())}),Q.on("tap",J=>{J.target===Q&&(Q.elements().unselect(),R(),Z(),r.onSelectionChange?.(void 0))}),Q.on("dbltap","node",J=>T(J.target.id())),Q.on("dragfree","node",N),Q.on("zoom",()=>{s.zoomLabel.textContent=bc(Q.zoom()),N()}),Q.on("pan",N)}function M(){return h==="schema"&&f.isEmpty?"triples":h}function E(){!p||p.elements().empty()||(p.one("layoutstop",()=>{S(),N()}),p.layout(gX(d)).run())}function S(Q=!0){if(!p||p.elements().empty())return;Q&&p.fit(p.elements(),42);let se=DC(p.zoom(),p.nodes().length);se>p.zoom()&&(p.zoom(se),p.center(p.elements()))}function w(Q,se){if(!r.storageKey)return!1;let J=RC(Ec(r.storageKey,se));if(!J)return!1;let ie=0;for(let[ve,Se]of Object.entries(J.positions)){let Ce=Q.getElementById(ve);Ce.nonempty()&&(Ce.position(Se),ie+=1)}return ie===0?!1:(Q.zoom(J.zoom),Q.pan(J.pan),!0)}function N(){!r.storageKey||!p||m||(y&&clearTimeout(y),y=setTimeout(()=>{if(!p||!r.storageKey||m)return;let Q=Object.create(null);p.nodes().forEach(se=>{Q[se.id()]={...se.position()}}),MC(Ec(r.storageKey,M()),{positions:Q,zoom:p.zoom(),pan:{...p.pan()}})},100))}function T(Q){if(!p)return;if(g===Q){R();return}g=Q;let se=p.getElementById(Q);p.elements().removeClass("dimmed"),p.elements().not(se.closedNeighborhood()).addClass("dimmed"),p.fit(se.closedNeighborhood(),70)}function R(){g=void 0,p?.elements().removeClass("dimmed")}function P(){p?.destroy(),p=void 0,s.graph.replaceChildren()}function k(Q){s.toolbar.hidden=!Q,s.graph.hidden=!Q,s.inspector.hidden=!Q,s.stats.hidden=!Q,s.legend.hidden=!Q}function U(Q,se){s.message.replaceChildren();let J=a.createElement("p");J.textContent=Q,s.message.appendChild(J),s.message.className=se==="alert"?"ov-message ov-error":"ov-message ov-empty",s.message.setAttribute("role",se),s.message.hidden=!1}function B(){s.message.hidden=!0,s.message.removeAttribute("role"),s.message.className="ov-message",s.message.replaceChildren()}function V(){s.schemaButton.classList.toggle("active",h==="schema"),s.triplesButton.classList.toggle("active",h==="triples"),s.schemaButton.setAttribute("aria-pressed",String(h==="schema")),s.triplesButton.setAttribute("aria-pressed",String(h==="triples"))}function j(){s.stats.textContent=`${i.entities}: ${f.entities.length} \xB7 ${i.relations}: ${f.relations.length} \xB7 ${i.triples}: ${c.edges.length}`}function Y(){s.inspector.hidden=!1,s.inspector.replaceChildren(),s.inspector.appendChild(cr(a,i.close,"ov-inspector-close","\xD7"))}function Z(){Y();let Q=a.createElement("p");Q.className="ov-inspector-empty",Q.textContent=i.inspector,s.inspector.appendChild(Q)}function K(Q,se){if(Y(),se==="schema"){let ie=f.entities.find(ve=>ve.id===Q);if(!ie)return Z();yX(a,s.inspector,ie,f,i);return}let J=c.nodes.find(ie=>ie.id===Q);if(!J)return Z();if(lu(a,s.inspector,J.label),J.kind==="literal"){let ie=[["Value",J.literalValue??""],["Datatype",J.datatypeIri??""]];J.language&&ie.push(["Language",J.language]),go(a,s.inspector,ie);return}J.comment&&wc(a,s.inspector,J.comment,"ov-inspector-desc"),go(a,s.inspector,[[i.type,J.kind],["IRI",J.id]])}function G(Q,se){if(Y(),se==="schema"){let ie=f.relations.find(ve=>ve.id===Q);if(!ie)return Z();mX(a,s.inspector,ie,f,i);return}let J=c.edges.find(ie=>ie.id===Q);if(!J)return Z();lu(a,s.inspector,J.predicateLabel),go(a,s.inspector,[["Source",J.source],["Predicate",J.predicate],["Target",J.target]])}function $(){s.searchResults.replaceChildren();let Q=s.search.value.trim();if(!Q){s.searchResults.hidden=!0,R();return}let se=AC(f,Q);if(s.searchResults.hidden=!1,se.length===0){let J=a.createElement("p");J.className="ov-search-empty",J.textContent=i.noResults,s.searchResults.appendChild(J);return}for(let J of se)s.searchResults.appendChild(bX(a,J,q))}function q(Q){if(!p)return;let se=Q.ownerId??Q.id,J=p.getElementById(se);if(J.empty())return;p.elements().unselect(),J.select(),p.elements().removeClass("dimmed");let ie=Q.kind==="relation"?J.connectedNodes().union(J):J.closedNeighborhood();p.elements().not(ie).addClass("dimmed"),p.fit(ie,70),s.search.value="",s.searchResults.hidden=!0}function X(){C.exportPng().then(Q=>{let se=URL.createObjectURL(Q),J=a.createElement("a");J.href=se,J.download="ontology-diagram.png",J.click(),setTimeout(()=>URL.revokeObjectURL(se),6e4)}).catch(Q=>{A({message:Q instanceof Error?Q.message:String(Q),cause:Q})})}function ee(){let Q=pc("auto");Q!==v&&(v=Q,BC(o,v),l==="ready"&&I())}s.schemaButton.addEventListener("click",()=>{f.isEmpty||h==="schema"||(h="schema",V(),Z(),I())},{signal:x}),s.triplesButton.addEventListener("click",()=>{h!=="triples"&&(h="triples",V(),Z(),I())},{signal:x}),s.search.addEventListener("input",$,{signal:x}),s.search.addEventListener("keydown",Q=>{Q.key==="Escape"&&(s.search.value="",s.searchResults.hidden=!0,R())},{signal:x}),o.querySelector(".ov-btn-zoom-in")?.addEventListener("click",()=>p?.zoom(mc(p.zoom(),"in")),{signal:x}),o.querySelector(".ov-btn-zoom-out")?.addEventListener("click",()=>p?.zoom(mc(p.zoom(),"out")),{signal:x}),o.querySelector(".ov-btn-reset-zoom")?.addEventListener("click",()=>{p?.zoom(1),p?.center()},{signal:x}),o.querySelector(".ov-btn-fit")?.addEventListener("click",()=>S(),{signal:x}),o.querySelector(".ov-btn-layout")?.addEventListener("click",()=>E(),{signal:x}),o.querySelector(".ov-btn-export")?.addEventListener("click",X,{signal:x}),o.addEventListener("click",Q=>{let se=Q.target;se instanceof Element&&se.closest(".ov-inspector-close")&&(s.inspector.hidden=!0)},{signal:x}),s.layout.addEventListener("change",()=>{d=s.layout.value==="dagre"?"dagre":"fcose",E()},{signal:x});let ce=r.theme==="auto"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):void 0;ce?.addEventListener("change",ee);let Ee=!0,ne=typeof ResizeObserver>"u"?void 0:new ResizeObserver(Q=>{let se=Q[0]?.contentRect;if(!se)return;o.dataset.compact=String(se.width<760),p?.resize();let J=se.width===0||se.height===0;Ee&&!J&&S(),Ee=J});return ne?.observe(o),Z(),L(e),C}function cX(t,e,r,n){let a=qt(t,"div","ov-toolbar");a.setAttribute("role","toolbar"),a.setAttribute("aria-label",r.layout);let i=qt(t,"div","ov-view-toggle");i.setAttribute("role","group");let o=cr(t,r.schemaView,"ov-btn-schema"),s=cr(t,r.triplesView,"ov-btn-triples");i.append(o,s);let l=t.createElement("input");l.type="search",l.className="ov-search",l.placeholder=r.searchPlaceholder,l.setAttribute("aria-label",r.searchPlaceholder),l.setAttribute("aria-controls","");let u=t.createElement("select");u.className="ov-layout-select",u.setAttribute("aria-label",r.layout);for(let A of["fcose","dagre"]){let I=t.createElement("option");I.value=A,I.textContent=A==="fcose"?"fCoSE":"Dagre",u.appendChild(I)}u.value=n.layout??"fcose";let f=qt(t,"div","ov-controls");f.append(cr(t,r.zoomOut,"ov-btn-zoom-out","\u2212"),cr(t,r.resetZoom,"ov-btn-reset-zoom","100%"),cr(t,r.zoomIn,"ov-btn-zoom-in","+"),cr(t,r.fitToScreen,"ov-btn-fit","\u26F6"),cr(t,r.layout,"ov-btn-layout","\u21BB"),cr(t,r.exportPng,"ov-btn-export","\u21E9")),a.append(i,l,u,f);let c=qt(t,"div","ov-search-dropdown");c.setAttribute("role","listbox"),c.hidden=!0;let h=qt(t,"div","ov-body"),d=qt(t,"div","ov-stage"),v=qt(t,"div","ov-graph"),p=qt(t,"div","ov-message");p.hidden=!0,d.append(v,p);let m=qt(t,"aside","ov-inspector");m.setAttribute("aria-label",r.inspector);let g=cr(t,r.close,"ov-inspector-close","\xD7");m.appendChild(g),h.append(d,m);let y=qt(t,"footer","ov-footer"),b=qt(t,"div","ov-stats");b.setAttribute("role","status");let x=t.createElement("details");x.className="ov-legend";let C=t.createElement("summary");C.textContent=r.legend;let O=qt(t,"div","ov-legend-content");for(let[A,I]of[["subClassOf","ov-subclass"],["skos:broader","ov-broader"],[r.inferred,"ov-inferred"]]){let D=qt(t,"span",`ov-legend-item ${I}`);D.textContent=A,O.appendChild(D)}x.append(C,O),y.append(b,x),e.append(a,c,h,y);let L=f.querySelector(".ov-btn-reset-zoom")??f;return{toolbar:a,schemaButton:o,triplesButton:s,search:l,searchResults:c,layout:u,zoomLabel:L,stage:d,graph:v,message:p,inspector:m,stats:b,legend:x}}function hX(t){let e=t.entities.map(i=>{let o=i.properties.slice(0,7).map(l=>`${l.isIdentifier?"\u{1F511} ":""}${l.name}: ${l.type}`),s=i.properties.length>o.length?[`\u2026 +${i.properties.length-o.length}`]:[];return{data:{id:i.id,label:[`${i.icon} ${i.name}`,...o,...s].join(`
9
+ `),colorIndex:i.colorIndex,colorOverride:i.colorOverride??null,origin:i.origin,height:Math.min(210,70+(o.length+s.length)*18)}}}),r=new Set,n=new Map,a=[];for(let i of t.relations){if(r.has(i.id))continue;r.add(i.id);let o=i.source===i.target?n.get(i.source)??0:0;i.source===i.target&&n.set(i.source,o+1);let s=i.cardinality==="unspecified"?"":` (${EX(i.cardinality)})`;a.push({data:{id:i.id,source:i.source,target:i.target,edgeLabel:i.kind==="subClassOf"?"":`${i.name}${s}`,kind:i.kind,provenance:i.provenance,loopIndex:o}})}return[...e,...a]}function dX(t){return[...t.nodes.map(e=>({data:{id:e.id,label:e.label,kind:e.kind}})),...t.edges.map(e=>({data:{id:e.id,source:e.source,target:e.target,edgeLabel:e.predicateLabel}}))]}function vX(t){let e=t?"#1e1e1e":"#ffffff";return[{selector:"node",style:{label:"data(label)","text-valign":"center","text-halign":"center","text-wrap":"wrap","text-max-width":"190px","font-size":12,width:220,height:"data(height)",shape:"round-rectangle","border-width":2.5,"background-color":r=>r.data("colorOverride")||gc(r.data("colorIndex"),yn,t),"border-color":r=>r.data("colorOverride")||CC(r.data("colorIndex"),yn,t),color:r=>SC(r.data("colorOverride")||gc(r.data("colorIndex"),yn,t),e)}},{selector:"node[origin = 'skosConcept']",style:{shape:"ellipse"}},{selector:"node[origin = 'inferred']",style:{"border-style":"dashed",opacity:.85}},{selector:"node:selected",style:{"border-color":"#007fd4","border-width":4}},{selector:"edge",style:UC(t)},{selector:"edge[kind = 'subClassOf']",style:{"line-color":"#b180d7","target-arrow-color":"#b180d7","target-arrow-shape":"triangle-tee"}},{selector:"edge[kind = 'skosBroader']",style:{"line-color":"#16875c","target-arrow-color":"#16875c"}},{selector:"edge[provenance != 'declared']",style:{"line-style":"dashed",opacity:.65}},{selector:".dimmed",style:{opacity:.1}}]}function pX(t){return[{selector:"node",style:{label:"data(label)","text-valign":"center","text-halign":"center","text-wrap":"ellipsis","text-max-width":"130px",width:154,height:54,shape:"round-rectangle","font-size":11,"border-width":1.5,"background-color":t?"#2d2d2d":"#f1f5f9","border-color":t?"#666":"#94a3b8",color:t?"#eee":"#1e293b"}},{selector:"node[kind = 'class']",style:{"background-color":t?"#18324b":"#dbeafe","border-color":"#3b82f6"}},{selector:"node[kind = 'property']",style:{"background-color":t?"#3b1f3b":"#fce7f3","border-color":"#a855f7"}},{selector:"node[kind = 'literal']",style:{width:138,height:44,"font-size":10,"border-style":"dashed","background-color":t?"#38331f":"#fef9c3","border-color":t?"#d6b94c":"#ca8a04"}},{selector:"node:selected",style:{"border-color":"#007fd4","border-width":3}},{selector:"edge",style:UC(t)},{selector:".dimmed",style:{opacity:.1}}]}function UC(t){return{label:"data(edgeLabel)","font-size":10,color:t?"#aaa":"#475569","text-background-color":t?"#1e1e1e":"#ffffff","text-background-opacity":.9,"text-background-padding":"4px",width:1.8,"line-color":t?"#777":"#64748b","target-arrow-color":t?"#777":"#64748b","target-arrow-shape":"triangle","curve-style":"bezier"}}function gX(t){return t==="dagre"?{name:t,animate:!1,fit:!1,padding:42,nodeSep:86,edgeSep:34,rankSep:118}:{name:t,animate:!1,fit:!1,padding:42,quality:"default",idealEdgeLength:150,nodeRepulsion:8800,nodeSeparation:80}}function yX(t,e,r,n,a){if(lu(t,e,`${r.icon} ${r.name}`),r.description&&wc(t,e,r.description,"ov-inspector-desc"),go(t,e,[[a.type,r.origin],[a.properties,String(r.properties.length)],[a.instances,String(r.instanceCount)],["IRI",r.id]]),r.properties.length){GC(t,e,a.properties);let s=qt(t,"ul","ov-prop-list");for(let l of r.properties)VC(t,s,`${l.isIdentifier?"\u{1F511} ":""}${l.name}: ${l.type}`);e.appendChild(s)}let i=n.relations.filter(s=>s.target===r.id),o=n.relations.filter(s=>s.source===r.id);FC(t,e,"\u2190 Incoming",i,n,!1),FC(t,e,"\u2192 Outgoing",o,n,!0)}function mX(t,e,r,n,a){lu(t,e,r.name),r.description&&wc(t,e,r.description,"ov-inspector-desc");let i=n.entities.find(s=>s.id===r.source)?.name??r.source,o=n.entities.find(s=>s.id===r.target)?.name??r.target;go(t,e,[[a.type,r.kind],["Source",i],["Target",o],["Cardinality",r.cardinality],["Provenance",r.provenance]])}function FC(t,e,r,n,a,i){if(!n.length)return;GC(t,e,r);let o=t.createElement("ul");for(let s of n){let l=i?s.target:s.source,u=a.entities.find(f=>f.id===l)?.name??l;VC(t,o,`${s.name} ${i?"\u2192":"\u2190"} ${u}`)}e.appendChild(o)}function bX(t,e,r){let n=cr(t,`${e.label}, ${e.meta}`,"ov-search-item");n.setAttribute("role","option");let a=qt(t,"span","ov-search-label");a.textContent=e.label;let i=qt(t,"span","ov-search-meta");return i.textContent=e.meta,n.replaceChildren(a,i),n.addEventListener("click",()=>r(e),{once:!0}),n}function lu(t,e,r){let n=t.createElement("h3");n.textContent=r,e.appendChild(n)}function GC(t,e,r){let n=t.createElement("h4");n.textContent=r,e.appendChild(n)}function wc(t,e,r,n){let a=t.createElement("p");n&&(a.className=n),a.textContent=r,e.appendChild(a)}function go(t,e,r){let n=t.createElement("dl");for(let[a,i]of r){let o=t.createElement("dt");o.textContent=a;let s=t.createElement("dd");s.textContent=i,n.append(o,s)}e.appendChild(n)}function VC(t,e,r){let n=t.createElement("li");n.textContent=r,e.appendChild(n)}function cr(t,e,r,n=e){let a=t.createElement("button");return a.type="button",a.className=r,a.textContent=n,a.setAttribute("aria-label",e),a}function qt(t,e,r){let n=t.createElement(e);return n.className=r,n}function BC(t,e){t.classList.toggle("ov-dark",e),t.classList.toggle("ov-light",!e),t.dataset.theme=e?"dark":"light"}function EX(t){return{"one-to-one":"1:1","one-to-many":"1:N","many-to-one":"N:1","many-to-many":"N:N"}[t]??""}function wX(t){let e=/^data:([^;,]+)?(;base64)?,(.*)$/s.exec(t);if(!e)throw new Error("Cytoscape returned an invalid PNG data URL.");let r=e[1]||"image/png",n=e[2]?atob(e[3]):decodeURIComponent(e[3]),a=Uint8Array.from(n,i=>i.charCodeAt(0));return new Blob([a],{type:r})}function xX(t){if(t.getElementById("__________cytoscape_stylesheet"))return;let e=t.createElement("meta");e.id="__________cytoscape_stylesheet",e.setAttribute("data-ontologyviewer-cytoscape-style","external"),(t.head??t.documentElement).prepend(e)}var fu=new WeakMap,cu=new Set,xc=new WeakSet,TX='pre.ontologyviewer, script[type="text/turtle"].ontologyviewer';function XC(t,e={}){let r=fu.get(t);if(r&&r.status!=="destroyed")return r;let n=LX(t,e);n.injectStyles!==!1&&NX(t.ownerDocument);let a=t.hidden,i=t.getAttribute("aria-hidden");t.hidden=!0,t.setAttribute("aria-hidden","true");let o,s=()=>{fu.delete(t),cu.delete(o),t.hidden=a,i===null?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",i)};try{o=zC(t,t.textContent??"",n,s)}catch(l){throw t.hidden=a,i===null?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",i),l}return fu.set(t,o),cu.add(o),o}function CX(t={}){let{startOnLoad:e=!1,selector:r=TX,...n}=t,a=(o=document)=>SX(o,r).map(l=>XC(l,n)),i=Promise.resolve([]);return e&&typeof document<"u"&&(i=document.readyState==="loading"?new Promise((o,s)=>{document.addEventListener("DOMContentLoaded",()=>{try{o(a(document))}catch(l){s(l)}},{once:!0})}):Promise.resolve(a(document))),{ready:i,instances:()=>[...cu],getInstance:KC,scan:a,destroyAll:()=>{for(let o of[...cu])o.destroy()}}}function KC(t){let e=fu.get(t);return e?.status==="destroyed"?void 0:e}function SX(t,e){let r=[];return t instanceof HTMLElement&&t.matches(e)&&r.push(t),r.push(...t.querySelectorAll(e)),r}function LX(t,e){let r=t.dataset,n=e.baseIri??e.baseIRI;return{height:OX(e.height??r.height),theme:HC(e.theme)??HC(r.theme)??"auto",locale:$C(e.locale)??$C(r.locale)??"auto",layout:YC(e.layout)??YC(r.layout)??"fcose",defaultView:WC(e.defaultView)??WC(r.defaultView)??"schema",baseIri:IX(n??r.baseIri,t.ownerDocument.baseURI),storageKey:AX(e.storageKey??r.storageKey),injectStyles:e.injectStyles,onReady:e.onReady,onError:e.onError,onSelectionChange:e.onSelectionChange}}function NX(t){if(xc.has(t)||t.querySelector("[data-ontologyviewer-styles]")){xc.add(t);return}let e=`/* ontologyviewer.css \u2014 all selectors are scoped to the generated root. */
10
+ .ontologyviewer-root {
11
+ --ov-bg: #fff;
12
+ --ov-fg: #1f2937;
13
+ --ov-muted: #64748b;
14
+ --ov-border: #d7dde5;
15
+ --ov-toolbar-bg: #f8fafc;
16
+ --ov-input-bg: #fff;
17
+ --ov-hover: #eef2f7;
18
+ position: relative;
19
+ display: flex;
20
+ flex-direction: column;
21
+ width: 100%;
22
+ height: 600px;
23
+ min-height: 320px;
24
+ overflow: hidden;
25
+ border: 1px solid var(--ov-border);
26
+ border-radius: 10px;
27
+ color: var(--ov-fg);
28
+ background: var(--ov-bg);
29
+ font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
30
+ container-type: inline-size;
31
+ box-sizing: border-box;
32
+ }
33
+ .ontologyviewer-root *, .ontologyviewer-root *::before, .ontologyviewer-root *::after { box-sizing: border-box; }
34
+ .ontologyviewer-root [hidden] { display: none !important; }
35
+ .ontologyviewer-root.ov-dark {
36
+ --ov-bg: #1e1e1e;
37
+ --ov-fg: #d4d4d4;
38
+ --ov-muted: #a8a8a8;
39
+ --ov-border: #454545;
40
+ --ov-toolbar-bg: #252526;
41
+ --ov-input-bg: #313131;
42
+ --ov-hover: #2a2d2e;
43
+ }
44
+ .ontologyviewer-root button,
45
+ .ontologyviewer-root input,
46
+ .ontologyviewer-root select { font: inherit; }
47
+ .ontologyviewer-root button:focus-visible,
48
+ .ontologyviewer-root input:focus-visible,
49
+ .ontologyviewer-root select:focus-visible,
50
+ .ontologyviewer-root summary:focus-visible { outline: 2px solid #1685d1; outline-offset: 2px; }
51
+ .ontologyviewer-root .ov-toolbar {
52
+ z-index: 5;
53
+ display: flex;
54
+ flex: 0 0 auto;
55
+ align-items: center;
56
+ gap: 8px;
57
+ padding: 8px 10px;
58
+ border-bottom: 1px solid var(--ov-border);
59
+ background: var(--ov-toolbar-bg);
60
+ }
61
+ .ontologyviewer-root .ov-view-toggle,
62
+ .ontologyviewer-root .ov-controls { display: flex; align-items: center; gap: 4px; }
63
+ .ontologyviewer-root .ov-view-toggle button,
64
+ .ontologyviewer-root .ov-controls button,
65
+ .ontologyviewer-root .ov-layout-select,
66
+ .ontologyviewer-root .ov-inspector-close {
67
+ min-height: 32px;
68
+ padding: 4px 9px;
69
+ border: 1px solid var(--ov-border);
70
+ border-radius: 6px;
71
+ color: var(--ov-fg);
72
+ background: var(--ov-bg);
73
+ cursor: pointer;
74
+ }
75
+ .ontologyviewer-root button:hover,
76
+ .ontologyviewer-root .ov-layout-select:hover { background: var(--ov-hover); }
77
+ .ontologyviewer-root .ov-view-toggle button.active {
78
+ border-color: #0878bd;
79
+ color: #fff;
80
+ background: #0878bd;
81
+ }
82
+ .ontologyviewer-root .ov-search {
83
+ flex: 1 1 250px;
84
+ min-width: 130px;
85
+ height: 34px;
86
+ padding: 5px 9px;
87
+ border: 1px solid var(--ov-border);
88
+ border-radius: 7px;
89
+ color: var(--ov-fg);
90
+ background: var(--ov-input-bg);
91
+ }
92
+ .ontologyviewer-root .ov-layout-select { height: 34px; }
93
+ .ontologyviewer-root .ov-body { display: flex; flex: 1 1 auto; min-height: 0; }
94
+ .ontologyviewer-root .ov-stage { position: relative; flex: 1 1 auto; min-width: 0; min-height: 260px; }
95
+ /* Cytoscape forces its container to position: relative; explicit dimensions prevent a zero-height graph. */
96
+ .ontologyviewer-root .ov-graph { position: absolute; inset: 0; width: 100%; height: 100%; }
97
+ .ontologyviewer-root .ov-message {
98
+ position: absolute;
99
+ inset: 0;
100
+ display: grid;
101
+ place-items: center;
102
+ padding: 24px;
103
+ text-align: center;
104
+ }
105
+ .ontologyviewer-root .ov-error { color: #b42318; background: #fff5f4; }
106
+ .ontologyviewer-root.ov-dark .ov-error { color: #ff8a80; background: #2e1b1a; }
107
+ .ontologyviewer-root .ov-inspector {
108
+ position: relative;
109
+ flex: 0 0 300px;
110
+ width: 300px;
111
+ overflow: auto;
112
+ padding: 14px;
113
+ border-left: 1px solid var(--ov-border);
114
+ background: var(--ov-bg);
115
+ }
116
+ .ontologyviewer-root .ov-inspector-close {
117
+ position: absolute;
118
+ top: 6px;
119
+ right: 6px;
120
+ display: none;
121
+ min-width: 30px;
122
+ padding: 2px 7px;
123
+ font-size: 20px;
124
+ }
125
+ .ontologyviewer-root .ov-inspector h3 { margin: 0 30px 8px 0; font-size: 16px; }
126
+ .ontologyviewer-root .ov-inspector h4 { margin: 14px 0 5px; font-size: 13px; }
127
+ .ontologyviewer-root .ov-inspector p { overflow-wrap: anywhere; }
128
+ .ontologyviewer-root .ov-inspector dl {
129
+ display: grid;
130
+ grid-template-columns: max-content minmax(0, 1fr);
131
+ gap: 4px 10px;
132
+ margin: 10px 0;
133
+ }
134
+ .ontologyviewer-root .ov-inspector dt { font-weight: 600; }
135
+ .ontologyviewer-root .ov-inspector dd { margin: 0; overflow-wrap: anywhere; }
136
+ .ontologyviewer-root .ov-inspector ul { margin: 5px 0; padding-left: 20px; }
137
+ .ontologyviewer-root .ov-inspector-empty { color: var(--ov-muted); text-align: center; }
138
+ .ontologyviewer-root .ov-inspector-desc { color: var(--ov-muted); }
139
+ .ontologyviewer-root .ov-prop-list { list-style: none; padding: 0 !important; }
140
+ .ontologyviewer-root .ov-prop-list li { padding: 3px 0; border-bottom: 1px solid var(--ov-border); }
141
+ .ontologyviewer-root .ov-footer {
142
+ display: flex;
143
+ flex: 0 0 auto;
144
+ align-items: center;
145
+ justify-content: space-between;
146
+ gap: 12px;
147
+ padding: 5px 10px;
148
+ border-top: 1px solid var(--ov-border);
149
+ color: var(--ov-muted);
150
+ font-size: 12px;
151
+ }
152
+ .ontologyviewer-root .ov-legend summary { cursor: pointer; }
153
+ .ontologyviewer-root .ov-legend-content { display: flex; gap: 12px; padding-top: 5px; }
154
+ .ontologyviewer-root .ov-legend-item::before {
155
+ display: inline-block;
156
+ width: 18px;
157
+ margin-right: 5px;
158
+ border-top: 3px solid #64748b;
159
+ content: "";
160
+ vertical-align: middle;
161
+ }
162
+ .ontologyviewer-root .ov-subclass::before { border-color: #b180d7; }
163
+ .ontologyviewer-root .ov-broader::before { border-color: #16875c; }
164
+ .ontologyviewer-root .ov-inferred::before { border-top-style: dashed; }
165
+ .ontologyviewer-root .ov-search-dropdown {
166
+ position: absolute;
167
+ z-index: 20;
168
+ top: 51px;
169
+ left: 120px;
170
+ width: min(520px, calc(100% - 240px));
171
+ max-height: 260px;
172
+ overflow: auto;
173
+ padding: 5px;
174
+ border: 1px solid var(--ov-border);
175
+ border-radius: 8px;
176
+ background: var(--ov-bg);
177
+ box-shadow: 0 10px 30px rgb(0 0 0 / 20%);
178
+ }
179
+ .ontologyviewer-root .ov-search-item {
180
+ display: flex;
181
+ justify-content: space-between;
182
+ gap: 12px;
183
+ width: 100%;
184
+ padding: 8px;
185
+ border: 0;
186
+ border-radius: 5px;
187
+ color: var(--ov-fg);
188
+ background: transparent;
189
+ text-align: left;
190
+ cursor: pointer;
191
+ }
192
+ .ontologyviewer-root .ov-search-meta { color: var(--ov-muted); font-size: 11px; }
193
+ .ontologyviewer-root .ov-search-empty { margin: 0; padding: 10px; color: var(--ov-muted); }
194
+
195
+ @container (max-width: 759px) {
196
+ .ontologyviewer-root .ov-toolbar { flex-wrap: wrap; }
197
+ .ontologyviewer-root .ov-search { order: 3; flex-basis: 100%; }
198
+ .ontologyviewer-root .ov-body { display: block; position: relative; }
199
+ .ontologyviewer-root .ov-stage { height: 100%; }
200
+ .ontologyviewer-root .ov-inspector {
201
+ position: absolute;
202
+ z-index: 10;
203
+ right: 0;
204
+ bottom: 0;
205
+ left: 0;
206
+ width: auto;
207
+ max-height: 52%;
208
+ border-top: 1px solid var(--ov-border);
209
+ border-left: 0;
210
+ box-shadow: 0 -8px 24px rgb(0 0 0 / 22%);
211
+ }
212
+ .ontologyviewer-root .ov-inspector-close { display: block; }
213
+ .ontologyviewer-root .ov-search-dropdown { top: 92px; left: 10px; width: calc(100% - 20px); }
214
+ .ontologyviewer-root .ov-footer { align-items: flex-start; }
215
+ }
216
+
217
+ /* Cytoscape normally injects this fixed rule as an inline style. Keeping it in
218
+ the external bundle lets strict-CSP users avoid that injection. */
219
+ .ontologyviewer-root .__________cytoscape_container { position: relative; }
220
+ `;if(!e)return;let r=t.createElement("style");r.setAttribute("data-ontologyviewer-styles",""),r.textContent=e,(t.head??t.documentElement).appendChild(r),xc.add(t)}function OX(t){if(!t)return"600px";let e=t.trim().toLowerCase();return/^(?:0|(?:\d+(?:\.\d+)?)(?:px|rem|em|vh|vw|%))$/.test(e)?e:"600px"}function AX(t){if(!t)return;let e=t.trim();return e.length>0&&e.length<=200?e:void 0}function IX(t,e){if(!t)return e;try{return new URL(t,e).href}catch{return e}}function HC(t){return t==="auto"||t==="light"||t==="dark"?t:void 0}function $C(t){return t==="auto"||t==="en"||t==="ja"?t:void 0}function YC(t){return t==="fcose"||t==="dagre"?t:void 0}function WC(t){return t==="schema"||t==="triples"?t:void 0}var DX={initialize:CX,render:XC,getInstance:KC},LQ=DX;export{LQ as default,KC as getInstance,CX as initialize,XC as render};
221
+ //# sourceMappingURL=ontologyviewer.esm.min.mjs.map