t&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-n)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>a.WORLD_BOUNDARY?t=a.WORLD_BOUNDARY:t<-a.WORLD_BOUNDARY&&(t=-a.WORLD_BOUNDARY);var n=this.rect.y;n>a.WORLD_BOUNDARY?n=a.WORLD_BOUNDARY:n<-a.WORLD_BOUNDARY&&(n=-a.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.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 null==this.owner?null:this.owner.getParent()},e.exports=u},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(0),a=n(6),s=n(3),l=n(1),u=n(13),c=n(12),h=n(11);function d(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof a?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in d.prototype=Object.create(r.prototype),r)d[p]=r[p];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},d.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&c>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(u,1),o.target!=o.source&&o.target.edges.splice(c,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},d.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,o=i.MAX_VALUE,a=this.getNodes(),s=a.length,l=0;l(e=u.getTop())&&(r=e),o>(t=u.getLeft())&&(o=t)}return r==i.MAX_VALUE?null:(n=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-n,this.top=r-n,new c(this.left,this.top))},d.prototype.updateBounds=function(e){for(var t,n,r,o,a,s=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,h=-i.MAX_VALUE,d=this.nodes,p=d.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),c>(r=g.getTop())&&(c=r),h<(o=g.getBottom())&&(h=o)}var v=new u(s,c,l-s,h-c);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=v.x-a,this.right=v.x+v.width+a,this.top=v.y-a,this.bottom=v.y+v.height+a},d.calculateBounds=function(e){for(var t,n,r,o,a=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,h=e.length,d=0;d(t=p.getLeft())&&(a=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),c<(o=p.getBottom())&&(c=o)}return new u(a,l,s-a,c-l)},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach((function(t){t.owner==e&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=d},function(e,t,n){"use strict";var r,i=n(1);function o(e){r=n(5),this.layout=e,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var o=(r=t).getOwner(),a=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return n.isInterGraph=!1,o.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},o.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,o=[],a=(o=o.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var o=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(o=1);var a=o*n[0],s=n[1]/o;n[0]a)return n[0]=r,n[1]=l,n[2]=o,n[3]=b,!1;if(io)return n[0]=s,n[1]=i,n[2]=y,n[3]=a,!1;if(ro?(n[0]=c,n[1]=h,_=!0):(n[0]=u,n[1]=l,_=!0):C===D&&(r>o?(n[0]=s,n[1]=l,_=!0):(n[0]=d,n[1]=h,_=!0)),-N===D?o>r?(n[2]=m,n[3]=b,T=!0):(n[2]=y,n[3]=v,T=!0):N===D&&(o>r?(n[2]=g,n[3]=v,T=!0):(n[2]=x,n[3]=b,T=!0)),_&&T)return!1;if(r>o?i>a?(k=this.getCardinalDirection(C,D,4),A=this.getCardinalDirection(N,D,2)):(k=this.getCardinalDirection(-C,D,3),A=this.getCardinalDirection(-N,D,1)):i>a?(k=this.getCardinalDirection(-C,D,1),A=this.getCardinalDirection(-N,D,3)):(k=this.getCardinalDirection(C,D,2),A=this.getCardinalDirection(N,D,4)),!_)switch(k){case 1:M=l,S=r+-f/D,n[0]=S,n[1]=M;break;case 2:S=d,M=i+p*D,n[0]=S,n[1]=M;break;case 3:M=h,S=r+f/D,n[0]=S,n[1]=M;break;case 4:S=c,M=i+-p*D,n[0]=S,n[1]=M}if(!T)switch(A){case 1:L=v,O=o+-E/D,n[2]=O,n[3]=L;break;case 2:O=x,L=a+w*D,n[2]=O,n[3]=L;break;case 3:L=b,O=o+E/D,n[2]=O,n[3]=L;break;case 4:O=m,L=a+-w*D,n[2]=O,n[3]=L}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var o,a,s,l,u,c,h,d=e.x,p=e.y,f=t.x,g=t.y,v=n.x,y=n.y,m=i.x,b=i.y;return 0==(h=(o=g-p)*(l=v-m)-(a=b-y)*(s=d-f))?null:new r((s*(c=m*y-v*b)-l*(u=f*p-d*g))/h,(a*u-o*c)/h)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(u[0]);s.length>0&&t;){var c=s[0];s.splice(0,1),a.add(c);var h=c.getEdges();for(o=0;o-1&&u.splice(g,1)}a=new Set,l=new Map}else e=[]}return e},d.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),o=0;o=0&&t.splice(h,1),c.getNeighborsList().forEach((function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}}))}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,o=t[0])}return o},d.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=d},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(4);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(7),o=n(0),a=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.springConstant=i.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=i.DEFAULT_REPULSION_STRENGTH,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}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,a,s,l=this.getGraphManager().getAllEdges(),u=0;ui.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-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):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-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(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*o):(a>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||u>=s[0].length))for(var c=0;ce}}]),e}();e.exports=o},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var a=0;a=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{var r=n(6110)(n(9325),"DataView");e.exports=r},1549:(e,t,n)=>{var r=n(2032),i=n(3862),o=n(6721),a=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3702),i=n(80),o=n(4739),a=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Map");e.exports=r},3661:(e,t,n)=>{var r=n(3040),i=n(7670),o=n(289),a=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Promise");e.exports=r},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},8859:(e,t,n)=>{var r=n(3661),i=n(1380),o=n(1459);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(79),i=n(1420),o=n(938),a=n(3605),s=n(9817),l=n(945);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r{var r=n(8096),i=n(2428),o=n(6449),a=n(3656),s=n(361),l=n(7167),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),h=!n&&!c&&a(e),d=!n&&!c&&!h&&l(e),p=n||c||h||d,f=p?r(e.length,String):[],g=f.length;for(var v in e)!t&&!u.call(e,v)||p&&("length"==v||h&&("offset"==v||"parent"==v)||d&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||f.push(v);return f}},4932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{var r=n(7237)("length");e.exports=r},7805:(e,t,n)=>{var r=n(3360),i=n(5288);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547:(e,t,n)=>{var r=n(3360),i=n(5288),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733:(e,t,n)=>{var r=n(1791),i=n(5950);e.exports=function(e,t){return e&&r(t,i(t),e)}},3838:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e,t){return e&&r(t,i(t),e)}},3360:(e,t,n)=>{var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999:(e,t,n)=>{var r=n(7217),i=n(3729),o=n(6547),a=n(4733),s=n(3838),l=n(3290),u=n(3007),c=n(2271),h=n(8948),d=n(2),p=n(3349),f=n(5861),g=n(6189),v=n(7199),y=n(5529),m=n(6449),b=n(3656),x=n(7730),w=n(3805),E=n(8440),_=n(5950),T=n(7241),C="[object Arguments]",N="[object Function]",D="[object Object]",k={};k[C]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[D]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[N]=k["[object WeakMap]"]=!1,e.exports=function e(t,n,A,S,M,O){var L,I=1&n,P=2&n,R=4&n;if(A&&(L=M?A(t,S,M,O):A(t)),void 0!==L)return L;if(!w(t))return t;var B=m(t);if(B){if(L=g(t),!I)return u(t,L)}else{var F=f(t),z=F==N||"[object GeneratorFunction]"==F;if(b(t))return l(t,I);if(F==D||F==C||z&&!M){if(L=P||z?{}:y(t),!I)return P?h(t,s(L,t)):c(t,a(L,t))}else{if(!k[F])return M?t:{};L=v(t,F,I)}}O||(O=new r);var j=O.get(t);if(j)return j;O.set(t,L),E(t)?t.forEach((function(r){L.add(e(r,n,A,r,t,O))})):x(t)&&t.forEach((function(r,i){L.set(i,e(r,n,A,i,t,O))}));var G=B?void 0:(R?P?p:d:P?T:_)(t);return i(G||t,(function(r,i){G&&(r=t[i=r]),o(L,i,e(r,n,A,i,t,O))})),L}},9344:(e,t,n)=>{var r=n(3805),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},909:(e,t,n)=>{var r=n(641),i=n(8329)(r);e.exports=i},3599:(e,t,n)=>{var r=n(4394);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i{var r=n(909);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},2523:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o{var r=n(4528),i=n(5891);e.exports=function e(t,n,o,a,s){var l=-1,u=t.length;for(o||(o=i),s||(s=[]);++l0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},6649:(e,t,n)=>{var r=n(3221)();e.exports=r},641:(e,t,n)=>{var r=n(6649),i=n(5950);e.exports=function(e,t){return e&&r(e,t,i)}},7422:(e,t,n)=>{var r=n(1769),i=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(4528),i=n(6449);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},3335:e=>{e.exports=function(e,t){return e>t}},426:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},6131:(e,t,n)=>{var r=n(2523),i=n(5463),o=n(6959);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},7534:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},270:(e,t,n)=>{var r=n(7068),i=n(346);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},7068:(e,t,n)=>{var r=n(7217),i=n(5911),o=n(1986),a=n(689),s=n(5861),l=n(6449),u=n(3656),c=n(7167),h="[object Arguments]",d="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,v,y){var m=l(e),b=l(t),x=m?d:s(e),w=b?d:s(t),E=(x=x==h?p:x)==p,_=(w=w==h?p:w)==p,T=x==w;if(T&&u(e)){if(!u(t))return!1;m=!0,E=!1}if(T&&!E)return y||(y=new r),m||c(e)?i(e,t,n,g,v,y):o(e,t,x,n,g,v,y);if(!(1&n)){var C=E&&f.call(e,"__wrapped__"),N=_&&f.call(t,"__wrapped__");if(C||N){var D=C?e.value():e,k=N?t.value():t;return y||(y=new r),v(D,k,n,g,y)}}return!!T&&(y||(y=new r),a(e,t,n,g,v,y))}},9172:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},1799:(e,t,n)=>{var r=n(7217),i=n(270);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a{e.exports=function(e){return e!=e}},5083:(e,t,n)=>{var r=n(1882),i=n(7296),o=n(3805),a=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,h=u.hasOwnProperty,d=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:s).test(a(e))}},6038:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},4901:(e,t,n)=>{var r=n(2552),i=n(294),o=n(346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},5389:(e,t,n)=>{var r=n(3663),i=n(7978),o=n(3488),a=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},8984:(e,t,n)=>{var r=n(5527),i=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903:(e,t,n)=>{var r=n(3805),i=n(5527),o=n(181),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},6176:e=>{e.exports=function(e,t){return e{var r=n(909),i=n(4894);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},3663:(e,t,n)=>{var r=n(1799),i=n(776),o=n(7197);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978:(e,t,n)=>{var r=n(270),i=n(8156),o=n(631),a=n(8586),s=n(756),l=n(7197),u=n(7797);e.exports=function(e,t){return a(e)&&s(t)?l(u(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},5250:(e,t,n)=>{var r=n(7217),i=n(7805),o=n(6649),a=n(2824),s=n(3805),l=n(7241),u=n(4974);e.exports=function e(t,n,c,h,d){t!==n&&o(n,(function(o,l){if(d||(d=new r),s(o))a(t,n,l,c,e,h,d);else{var p=h?h(u(t,l),o,l+"",t,n,d):void 0;void 0===p&&(p=o),i(t,l,p)}}),l)}},2824:(e,t,n)=>{var r=n(7805),i=n(3290),o=n(1961),a=n(3007),s=n(5529),l=n(2428),u=n(6449),c=n(3693),h=n(3656),d=n(1882),p=n(3805),f=n(1331),g=n(7167),v=n(4974),y=n(9884);e.exports=function(e,t,n,m,b,x,w){var E=v(e,n),_=v(t,n),T=w.get(_);if(T)r(e,n,T);else{var C=x?x(E,_,n+"",e,t,w):void 0,N=void 0===C;if(N){var D=u(_),k=!D&&h(_),A=!D&&!k&&g(_);C=_,D||k||A?u(E)?C=E:c(E)?C=a(E):k?(N=!1,C=i(_,!0)):A?(N=!1,C=o(_,!0)):C=[]:f(_)||l(_)?(C=E,l(E)?C=y(E):p(E)&&!d(E)||(C=s(_))):N=!1}N&&(w.set(_,C),b(C,_,m,x,w),w.delete(_)),r(e,n,C)}}},6155:(e,t,n)=>{var r=n(4932),i=n(7422),o=n(5389),a=n(5128),s=n(3937),l=n(7301),u=n(3714),c=n(3488),h=n(6449);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return h(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var d=-1;t=r(t,l(o));var p=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++d,value:e}}));return s(p,(function(e,t){return u(e,t,n)}))}},6001:(e,t,n)=>{var r=n(7420),i=n(631);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},7420:(e,t,n)=>{var r=n(7422),i=n(3170),o=n(1769);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},5558:e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},9302:(e,t,n)=>{var r=n(3488),i=n(6757),o=n(2865);e.exports=function(e,t){return o(i(e,t,r),e+"")}},3170:(e,t,n)=>{var r=n(6547),i=n(1769),o=n(361),a=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!a(e))return e;for(var u=-1,c=(t=i(t,e)).length,h=c-1,d=e;null!=d&&++u{var r=n(7334),i=n(3243),o=n(3488),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},3937:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(1873),i=n(4932),o=n(6449),a=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},5765:(e,t,n)=>{var r=n(8859),i=n(5325),o=n(9905),a=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var u=-1,c=i,h=e.length,d=!0,p=[],f=p;if(n)d=!1,c=o;else if(h>=200){var g=t?null:s(e);if(g)return l(g);d=!1,c=a,f=new r}else f=t?[]:p;e:for(;++u{var r=n(4932);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},1234:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r{e.exports=function(e,t){return e.has(t)}},4066:(e,t,n)=>{var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769:(e,t,n)=>{var r=n(6449),i=n(8586),o=n(1802),a=n(3222);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},9653:(e,t,n)=>{var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736:(e,t,n)=>{var r=n(1873),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},1961:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730:(e,t,n)=>{var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,u=t==t,c=r(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!c&&e{var r=n(3730);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i=l?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}},3007:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n{var r=n(6547),i=n(3360);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s{var r=n(1791),i=n(4664);e.exports=function(e,t){return r(e,i(e),t)}},8948:(e,t,n)=>{var r=n(1791),i=n(6375);e.exports=function(e,t){return r(e,i(e),t)}},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},999:(e,t,n)=>{var r=n(9302),i=n(6800);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r{var r=n(4894);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},2006:(e,t,n)=>{var r=n(5389),i=n(4894),o=n(5950);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[l?t[u]:u]:void 0}}},5508:(e,t,n)=>{var r=n(6151),i=n(6800),o=n(7400);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t{var r=n(6545),i=n(3950),o=n(4247),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},3243:(e,t,n)=>{var r=n(6110),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},5911:(e,t,n)=>{var r=n(8859),i=n(4248),o=n(9219);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,h=t.length;if(c!=h&&!(u&&h>c))return!1;var d=l.get(e),p=l.get(t);if(d&&p)return d==t&&p==e;var f=-1,g=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++f{var r=n(1873),i=n(7828),o=n(5288),a=n(5911),s=n(317),l=n(4247),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,h,d){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!h(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)return!1;var g=d.get(e);if(g)return g==t;r|=2,d.set(e,t);var v=a(p(e),p(t),r,u,h,d);return d.delete(e),v;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},689:(e,t,n)=>{var r=n(2),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var h=c;h--;){var d=u[h];if(!(l?d in t:i.call(t,d)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var v=l;++h{var r=n(5970),i=n(6757),o=n(2865);e.exports=function(e){return o(i(e,void 0,r),e+"")}},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2:(e,t,n)=>{var r=n(2199),i=n(4664),o=n(5950);e.exports=function(e){return r(e,o,i)}},3349:(e,t,n)=>{var r=n(2199),i=n(6375),o=n(7241);e.exports=function(e){return r(e,o,i)}},2651:(e,t,n)=>{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776:(e,t,n)=>{var r=n(756),i=n(5950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},6110:(e,t,n)=>{var r=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},8879:(e,t,n)=>{var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},4664:(e,t,n)=>{var r=n(9770),i=n(3345),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},6375:(e,t,n)=>{var r=n(4528),i=n(8879),o=n(4664),a=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},5861:(e,t,n)=>{var r=n(5580),i=n(8223),o=n(2804),a=n(6545),s=n(8303),l=n(2552),u=n(7473),c="[object Map]",h="[object Promise]",d="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(r),v=u(i),y=u(o),m=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=f||i&&x(new i)!=c||o&&x(o.resolve())!=h||a&&x(new a)!=d||s&&x(new s)!=p)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return f;case v:return c;case y:return h;case m:return d;case b:return p}return t}),e.exports=x},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},9326:(e,t,n)=>{var r=n(1769),i=n(2428),o=n(6449),a=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,h=!1;++u{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199:(e,t,n)=>{var r=n(9653),i=n(6169),o=n(3201),a=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},5529:(e,t,n)=>{var r=n(9344),i=n(8879),o=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},5891:(e,t,n)=>{var r=n(1873),i=n(2428),o=n(6449),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(5288),i=n(4894),o=n(361),a=n(3805);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586:(e,t,n)=>{var r=n(6449),i=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:(e,t,n)=>{var r,i=n(5481),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},80:(e,t,n)=>{var r=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175:(e,t,n)=>{var r=n(6025);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:(e,t,n)=>{var r=n(1549),i=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},181:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},6757:(e,t,n)=>{var r=n(1033),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},4974:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},2865:(e,t,n)=>{var r=n(9570),i=n(1811)(r);e.exports=i},1811:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},9817:e=>{e.exports=function(e){return this.__data__.has(e)}},945:(e,t,n)=>{var r=n(79),i=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},6959:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r{var r=n(9811),i=n(9698),o=n(7927);e.exports=function(e){return i(e)?o(e):r(e)}},1802:(e,t,n)=>{var r=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",u="[\\ufe0e\\ufe0f]?",c=u+l+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+u+l+")*",h="(?:"+[o+r+"?",r,a,s,n].join("|")+")",d=RegExp(i+"(?="+i+")|"+h+c,"g");e.exports=function(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t}},2629:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,4)}},8055:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,5)}},7334:e=>{e.exports=function(e){return function(){return e}}},4684:(e,t,n)=>{var r=n(9302),i=n(5288),o=n(6800),a=n(7241),s=Object.prototype,l=s.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n{e.exports=n(9754)},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612:(e,t,n)=>{var r=n(9770),i=n(6574),o=n(5389),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},4713:(e,t,n)=>{var r=n(2523),i=n(5389),o=n(1489),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},5970:(e,t,n)=>{var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},9754:(e,t,n)=>{var r=n(3729),i=n(909),o=n(4066),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},2420:(e,t,n)=>{var r=n(6649),i=n(4066),o=n(7241);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},8156:(e,t,n)=>{var r=n(7422);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},1448:(e,t,n)=>{var r=n(426),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},631:(e,t,n)=>{var r=n(8077),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},3488:e=>{e.exports=function(e){return e}},2428:(e,t,n)=>{var r=n(7534),i=n(346),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,n)=>{var r=n(1882),i=n(294);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},3693:(e,t,n)=>{var r=n(4894),i=n(346);e.exports=function(e){return i(e)&&r(e)}},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(9935),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},2193:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(2428),a=n(6449),s=n(4894),l=n(3656),u=n(5527),c=n(7167),h=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(h.call(e,n))return!1;return!0}},1882:(e,t,n)=>{var r=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:(e,t,n)=>{var r=n(9172),i=n(7301),o=n(6009),a=o&&o.isMap,s=a?i(a):r;e.exports=s},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1331:(e,t,n)=>{var r=n(2552),i=n(8879),o=n(346),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},8440:(e,t,n)=>{var r=n(6038),i=n(7301),o=n(6009),a=o&&o.isSet,s=a?i(a):r;e.exports=s},5015:(e,t,n)=>{var r=n(2552),i=n(6449),o=n(346);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7167:(e,t,n)=>{var r=n(4901),i=n(7301),o=n(6009),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},2216:e=>{e.exports=function(e){return void 0===e}},5950:(e,t,n)=>{var r=n(695),i=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):i(e)}},7241:(e,t,n)=>{var r=n(695),i=n(2903),o=n(4894);e.exports=function(e){return o(e)?r(e,!0):i(e)}},8090:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:(e,t,n)=>{var r=n(4932),i=n(5389),o=n(5128),a=n(6449);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},3916:(e,t,n)=>{var r=n(3360),i=n(641),o=n(5389);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},4506:(e,t,n)=>{var r=n(3599),i=n(3335),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},104:(e,t,n)=>{var r=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},5364:(e,t,n)=>{var r=n(5250),i=n(999)((function(e,t,n){r(e,t,n)}));e.exports=i},1684:(e,t,n)=>{var r=n(3599),i=n(6176),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},6533:(e,t,n)=>{var r=n(3599),i=n(5389),o=n(6176);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},3950:e=>{e.exports=function(){}},124:(e,t,n)=>{var r=n(9325);e.exports=function(){return r.Date.now()}},4383:(e,t,n)=>{var r=n(6001),i=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},583:(e,t,n)=>{var r=n(7237),i=n(7255),o=n(8586),a=n(7797);e.exports=function(e){return o(e)?r(a(e)):i(e)}},3181:(e,t,n)=>{var r=n(5508)();e.exports=r},860:(e,t,n)=>{var r=n(882),i=n(909),o=n(5389),a=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:a,u=arguments.length<3;return l(e,o(t,4),n,u,i)}},7091:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(4894),a=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},3031:(e,t,n)=>{var r=n(3120),i=n(6155),o=n(9302),a=n(6800),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},3345:e=>{e.exports=function(){return[]}},9935:e=>{e.exports=function(){return!1}},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},9884:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e){return r(e,i(e))}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752:(e,t,n)=>{var r=n(3729),i=n(9344),o=n(641),a=n(5389),s=n(8879),l=n(6449),u=n(3656),c=n(1882),h=n(3805),d=n(7167);e.exports=function(e,t,n){var p=l(e),f=p||u(e)||d(e);if(t=a(t,4),null==n){var g=e&&e.constructor;n=f?p?new g:[]:h(e)&&c(g)?i(s(e)):{}}return(f?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},299:(e,t,n)=>{var r=n(3120),i=n(9302),o=n(5765),a=n(3693),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},7200:(e,t,n)=>{var r=n(3222),i=0;e.exports=function(e){var t=++i;return r(e)+t}},5880:(e,t,n)=>{var r=n(514),i=n(5950);e.exports=function(e){return null==e?[]:r(e,i(e))}},7248:(e,t,n)=>{var r=n(6547),i=n(1234);e.exports=function(e,t){return i(e||[],t||[],r)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nt?1:0},q=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=t||n<0||h&&e-u>=o}function g(){var e=te();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return h?xe(n,o-(e-u)):n}(e))}function v(e){return s=void 0,d&&r?p(e):(r=i=void 0,a)}function y(){var e=te(),n=f(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(g,t),c?p(e):a}(l);if(h)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=me(t)||0,Z(n)&&(c=!!n.leading,o=(h="maxWait"in n)?be(me(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:v(te())},y},Ee=g?g.performance:null,_e=Ee&&Ee.now?function(){return Ee.now()}:function(){return Date.now()},Te=function(){if(g){if(g.requestAnimationFrame)return function(e){g.requestAnimationFrame(e)};if(g.mozRequestAnimationFrame)return function(e){g.mozRequestAnimationFrame(e)};if(g.webkitRequestAnimationFrame)return function(e){g.webkitRequestAnimationFrame(e)};if(g.msRequestAnimationFrame)return function(e){g.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(_e())}),1e3/60)}}(),Ce=function(e){return Te(e)},Ne=_e,De=9261,ke=5381,Ae=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:De;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Se=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:De)+e|0},Me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ke;return(t<<5)+t+e|0},Oe=function(e){return 2097152*e[0]+e[1]},Le=function(e,t){return[Se(e[0],t[0]),Me(e[1],t[1])]},Ie=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Ae({next:function(){return r=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},et=function(e){e.splice(0,e.length)},tt=function(e,t,n){return n&&(t=F(n,t)),e[t]},nt=function(e,t,n,r){n&&(t=F(n,t)),e[t]=r},rt="undefined"!=typeof Map?Map:function(){function e(){l(this,e),this._obj={}}return c(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),it=function(){function e(t){if(l(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&M(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new ot,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.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(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];T(t.classes)?l=t.classes:E(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;ut?1:0},u=function(e,t,i,o,a){var s;if(null==i&&(i=0),null==a&&(a=n),i<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);in;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;og;0<=g?++d:--d)v.push(o(e,r));return v},f=function(e,t,r,i){var o,a,s;for(null==i&&(i=n),o=e[r];r>t&&i(o,a=e[s=r-1>>1])<0;)e[r]=a,r=s;return e[r]=o},g=function(e,t,r){var i,o,a,s,l;for(null==r&&(r=n),o=e.length,l=t,a=e[t],i=2*t+1;i0;){var w=y.pop(),_=g(w),T=w.id();if(h[T]=_,_!==1/0)for(var N=w.neighborhood().intersect(p),D=0;D0)for(n.unshift(t);c[i];){var o=c[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},ft={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t0;){if(u=(l=g.pop()).id(),v.delete(u),w++,u===h){for(var E=[],_=i,T=h,C=m[T];E.unshift(_),null!=C&&E.unshift(C),null!=(_=y[T]);)C=m[T=_.id()];return{found:!0,distance:d[u],path:this.spawn(E),steps:w}}f[u]=!0;for(var N=l._private.edges,D=0;DD&&(p[N]=D,y[N]=C,m[N]=x),!i){var k=C*u+T;!i&&p[k]>D&&(p[k]=D,y[k]=T,m[k]=x)}}}for(var A=0;A1&&void 0!==arguments[1]?arguments[1]:o,r=[],i=m(e);;){if(null==i)return t.spawn();var a=y(i),l=a.edge,u=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:f,negativeWeightCycles:g}}},wt=Math.sqrt(2),Et=function(e,t,n){0===n.length&&Ue("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],h=c[1],d=c[2];(t[h]===a&&t[d]===s||t[h]===s&&t[d]===a)&&l.splice(u,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*t.length);t=Et(i,e,t),n--}return t},Tt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/wt);if(!(i<2)){for(var l=[],u=0;u0?1:e<0?-1:0},Mt=function(e,t){return Math.sqrt(Ot(e,t))},Ot=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Lt=function(e){for(var t=e.length,n=0,r=0;r=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(null!=e.w&&null!=e.h&&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}}},Ft=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},zt=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),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},jt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Gt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=d(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Yt=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Vt=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},Xt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Ut=function(e,t){return Xt(e,t.x1,t.y1)&&Xt(e,t.x2,t.y2)},qt=function(e,t,n,r,i,o,a){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?hn(i,o):u,h=i/2,d=o/2,p=(c=Math.min(c,h,d))!==h,f=c!==d;if(p){var g=r-d-a;if((s=on(e,t,n,r,n-h+c-a,g,n+h-c+a,g,!1)).length>0)return s}if(f){var v=n+h+a;if((s=on(e,t,n,r,v,r-d+c-a,v,r+d-c+a,!1)).length>0)return s}if(p){var y=r+d+a;if((s=on(e,t,n,r,n-h+c-a,y,n+h-c+a,y,!1)).length>0)return s}if(f){var m=n-h-a;if((s=on(e,t,n,r,m,r-d+c-a,m,r+d-c+a,!1)).length>0)return s}var b=n-h+c,x=r-d+c;if((l=nn(e,t,n,r,b,x,c+a)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+h-c,E=r-d+c;if((l=nn(e,t,n,r,w,E,c+a)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var _=n+h-c,T=r+d-c;if((l=nn(e,t,n,r,_,T,c+a)).length>0&&l[0]>=_&&l[1]>=T)return[l[0],l[1]];var C=n-h+c,N=r+d-c;return(l=nn(e,t,n,r,C,N,c+a)).length>0&&l[0]<=C&&l[1]>=N?[l[0],l[1]]:[]},Wt=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,o),h=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=h+s},Ht=function(e,t,n,r,i,o,a,s,l){var u=Math.min(n,a,i)-l,c=Math.max(n,a,i)+l,h=Math.min(r,s,o)-l,d=Math.max(r,s,o)+l;return!(ec||td)},Kt=function(e,t,n,r,i,o,a,s){var l,u,c,h,d,p,f,g,v,y,m,b,x,w=[];u=9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,c=3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,h=1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,0===(l=1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s)&&(l=1e-5),g=-27*(h/=l)+(u/=l)*(9*(c/=l)-u*u*2),p=(f=(3*c-u*u)/9)*f*f+(g/=54)*g,(d=w)[1]=0,b=u/3,p>0?(y=(y=g+Math.sqrt(p))<0?-Math.pow(-y,1/3):Math.pow(y,1/3),m=(m=g-Math.sqrt(p))<0?-Math.pow(-m,1/3):Math.pow(m,1/3),d[0]=-b+y+m,b+=(y+m)/2,d[4]=d[2]=-b,b=Math.sqrt(3)*(-m+y)/2,d[3]=b,d[5]=-b):(d[5]=d[3]=0,0===p?(x=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),d[0]=2*x-b,d[4]=d[2]=-(x+b)):(v=(f=-f)*f*f,v=Math.acos(g/Math.sqrt(v)),x=2*Math.sqrt(f),d[0]=-b+x*Math.cos(v/3),d[2]=-b+x*Math.cos((v+2*Math.PI)/3),d[4]=-b+x*Math.cos((v+4*Math.PI)/3)));for(var E=[],_=0;_<6;_+=2)Math.abs(w[_+1])<1e-7&&w[_]>=0&&w[_]<=1&&E.push(w[_]);E.push(1),E.push(0);for(var T,C,N,D=-1,k=0;k=0?Nl?(e-i)*(e-i)+(t-o)*(t-o):u-h},$t=function(e,t,n){for(var r,i,o,a,s=0,l=0;l=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},Qt=function(e,t,n,r,i,o,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var h,d=Math.cos(-u),p=Math.sin(-u),f=0;f0){var g=en(c,-l);h=Jt(g)}else h=c;return $t(e,t,h)},Jt=function(e){for(var t,n,r,i,o,a,s,l,u=new Array(e.length/2),c=0;c=0&&f<=1&&v.push(f),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},rn=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},on=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,h=a-i,d=t-o,p=r-t,f=s-o,g=h*d-f*u,v=c*d-p*u,y=f*c-h*p;if(0!==y){var m=g/y,b=v/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*p]:[]}return 0===g||0===v?rn(e,n,a)===a?[a,s]:rn(e,n,i)===i?[i,o]:rn(i,a,n)===n?[n,r]:[]:[]},an=function(e,t,n,r,i,o,a,s){var l,u,c,h,d,p,f=[],g=new Array(n.length),v=!0;if(null==o&&(v=!1),v){for(var y=0;y0){var m=en(g,-s);u=Jt(m)}else u=g}else u=n;for(var b=0;bu&&(u=t)},h=function(e){return l[e]},d=0;d0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var w=r(m);b=b.id(),d[b]>d[v]+w&&(d[b]=d[v]+w,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),d[b]==d[v]+w&&(u[b]=u[b]+u[v],l[b].push(v))}else for(var E=0;E0;){for(var N=n.pop(),D=0;D0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,l,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:On,a=r,s=0;s=2?Fn(e,t,n,0,Pn,Rn):Fn(e,t,n,0,In)},squaredEuclidean:function(e,t,n){return Fn(e,t,n,0,Pn)},manhattan:function(e,t,n){return Fn(e,t,n,0,In)},max:function(e,t,n){return Fn(e,t,n,-1/0,Bn)}};function jn(e,t,n,r,i,o){var a;return a=_(e)?e:zn[e]||zn.euclidean,0===t&&_(e)?a(i,o):a(t,n,r,i,o)}zn["squared-euclidean"]=zn.squaredEuclidean,zn.squaredeuclidean=zn.squaredEuclidean;var Gn=Qe({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Yn=function(e){return Gn(e)},Vn=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return jn(e,r.length,o,(function(e){return r[e](t)}),a,s)},Xn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;ln)return!1;return!0},Kn=function(e,t,n){for(var r=0;ri&&(i=t[l][u],o=u);a[o].push(e[l])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[a],g=t[r[a]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var v=0;vn[g.key][y.key]&&(o=n[g.key][y.key])):"max"===i.linkage?(o=n[f.key][y.key],n[f.key][y.key]a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+o]:(e[u-1+o]+e[u+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i=D?(k=D,D=S,A=M):S>k&&(k=S);for(var O=0;O0?1:0;_[E%u.minIterations*t+F]=z,B+=z}if(B>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var j=0,G=0;G0&&r.push(i);return r}(t,o,a),X=function(e,t,n){for(var r=dr(e,t,n),i=0;il&&(s=u,l=c)}n[i]=o[s]}return dr(e,t,n)}(t,r,V),U={},q=0;q1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},yr=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),h=l.merge(c);r.push(h),o=o.difference(h)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},mr={};[lt,pt,ft,vt,mt,xt,Tt,gn,yn,bn,wn,Mn,tr,ur,fr,{hierholzer:function(e){if(!C(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=gr(e),a=o.root,s=o.directed,l=this,u=!1;a&&(i=E(a)?this.filter(a)[0].id():a[0].id());var c={},h={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||a>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else h[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):h[t]=[e.source().id(),e.target().id()]}));var d={found:!1,trail:void 0};if(u)return d;if(r&&n)if(s){if(i&&r!=i)return d;i=r}else{if(i&&r!=i&&n!=i)return d;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,o=[e];c[i].length;)t=c[i].shift(),n=h[t][0],i!=(r=h[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},f=[],g=[];for(g=p(i);1!=g.length;)0==c[g[0]].length?(f.unshift(l.getElementById(g.shift())),f.unshift(l.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var v in f.unshift(l.getElementById(g.shift())),c)if(c[v].length)return d;return d.found=!0,d.trail=this.spawn(f,!0),d}},{hopcroftTarjanBiconnected:vr,htbc:vr,htb:vr,hopcroftTarjanBiconnectedComponents:vr},{tarjanStronglyConnected:yr,tsc:yr,tscc:yr,tarjanStronglyConnectedComponents:yr}].forEach((function(e){q(mr,e)}));var br=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};br.prototype={fulfill:function(e){return xr(this,1,"fulfillValue",e)},reject:function(e){return xr(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new br;return n.onFulfilled.push(_r(e,r,"fulfill")),n.onRejected.push(_r(t,r,"reject")),wr(n),r.proxy}};var xr=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,wr(e)),e},wr=function(e){1===e.state?Er(e,"onFulfilled",e.fulfillValue):2===e.state&&Er(e,"onRejected",e.rejectReason)},Er=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1},Qr.prototype.set=function(e,t){var n=this.__data__,r=Zr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Jr=Qr,ei=Vr(ee,"Map"),ti=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function ni(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){T(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Ai.className=Ai.classNames=Ai.classes;var Si={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:j,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Si.variable="(?:[\\w-.]|(?:\\\\"+Si.metaChar+"))+",Si.className="(?:[\\w-]|(?:\\\\"+Si.metaChar+"))+",Si.value=Si.string+"|"+Si.number,Si.id=Si.variable,function(){var e,t,n;for(e=Si.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Si.comparatorOp+="|\\!"+t)}();var Mi=20,Oi=[{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(e,t){return function(e,t){return-1*U(e,t)}(e.selector,t.selector)})),Li=function(){for(var e,t={},n=0;n0&&u.edgeCount>0)return We("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return We("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&We("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},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return E(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(i,o){return i.checks.reduce((function(a,s,l){return a+(o===i&&0===l?"$":"")+function(i,o){var a=i.type,s=i.value;switch(a){case 0:var l=e(s);return l.substring(0,l.length-1);case 3:var u=i.field,c=i.operator;return"["+u+n(e(c))+t(s)+"]";case 5:var h=i.operator,d=i.field;return"["+e(h)+d+"]";case 4:return"["+i.field+"]";case 6:var p=i.operator;return"[["+i.field+n(e(p))+t(s)+"]]";case 7:return s;case 8:return"#"+s;case 9:return"."+s;case 17:case 15:return r(i.parent,o)+n(">")+r(i.child,o);case 18:case 16:return r(i.ancestor,o)+" "+r(i.descendant,o);case 19:var f=r(i.left,o),g=r(i.subject,o),v=r(i.right,o);return f+(f.length>0?" ":"")+g+v;case Mi:return""}}(s,o)}),"")},i="",o=0;o1&&o=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(a||l||u)&&(i=a||s?""+e:"",o=""+n),u&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":h=!0,r=e>n;break;case">=":h=!0,r=e>=n;break;case"<":h=!0,r=e0;){var u=i.shift();t(u),o.add(u.id()),a&&r(i,o,u)}return e}function Ji(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],Ji)},$i.forEachUp=function(e){return Qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],eo)},$i.forEachUpAndDown=function(e){return Qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],to)},$i.ancestors=$i.parents,(Hi=Ki={data:Di.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:Di.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Di.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Di.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Di.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Di.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Hi.data,Hi.removeAttr=Hi.removeData;var no,ro,io=Ki,oo={};function ao(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;at})),minIndegree:so("indegree",(function(e,t){return et})),minOutdegree:so("outdegree",(function(e,t){return et}))}),q(oo,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,c=u;u&&(l=l[0]);var h=c?l.position():{x:0,y:0};return i={x:s.x-h.x,y:s.y-h.y},void 0===e?i:i[e]}for(var d=0;d0,v=g;g&&(f=f[0]);var y=v?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!o)return;return this}},no.modelPosition=no.point=no.position,no.modelPositions=no.points=no.positions,no.renderedPoint=no.renderedPosition,no.relativePoint=no.relativePosition;var co,ho,po=ro;co=ho={},ho.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},ho.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},ho.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var h=y(i.width.val-o.w,s,l),d=h.biasDiff,p=h.biasComplementDiff,f=y(i.height.val-o.h,u,c),g=f.biasDiff,v=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-d+o.x1+o.x2+p)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-g+o.y1+o.y2+v)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},vo=function(e,t){return null==t?e:go(e,t.x1,t.y1,t.x2,t.y2)},yo=function(e,t,n){return tt(e,t,n)},mo=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,jt(u,1),go(e,u.x1,u.y1,u.x2,u.y2)}}},bo=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,u,c=t.pstyle("text-halign"),h=t.pstyle("text-valign"),d=yo(o,"labelWidth",n),p=yo(o,"labelHeight",n),f=yo(o,"labelX",n),g=yo(o,"labelY",n),v=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,_=p,T=d,C=T/2,N=_/2;if(m)a=f-C,s=f+C,l=g-N,u=g+N;else{switch(c.value){case"left":a=f-T,s=f;break;case"center":a=f-C,s=f+C;break;case"right":a=f,s=f+T}switch(h.value){case"top":l=g-_,u=g;break;case"center":l=g-N,u=g+N;break;case"bottom":l=g,u=g+_}}a+=v-Math.max(x,w)-E-2,s+=v+Math.max(x,w)+E+2,l+=y-Math.max(x,w)-E-2,u+=y+Math.max(x,w)+E+2;var D=n||"main",k=i.labelBounds,A=k[D]=k[D]||{};A.x1=a,A.y1=l,A.x2=s,A.y2=u,A.w=s-a,A.h=u-l;var S=m&&"autorotate"===b.strValue,M=null!=b.pfValue&&0!==b.pfValue;if(S||M){var O=S?yo(i.rstyle,"labelAngle",n):b.pfValue,L=Math.cos(O),I=Math.sin(O),P=(a+s)/2,R=(l+u)/2;if(!m){switch(c.value){case"left":P=s;break;case"right":P=a}switch(h.value){case"top":R=u;break;case"bottom":R=l}}var B=function(e,t){return{x:(e-=P)*L-(t-=R)*I+P,y:e*I+t*L+R}},F=B(a,l),z=B(a,u),j=B(s,l),G=B(s,u);a=Math.min(F.x,z.x,j.x,G.x),s=Math.max(F.x,z.x,j.x,G.x),l=Math.min(F.y,z.y,j.y,G.y),u=Math.max(F.y,z.y,j.y,G.y)}var Y=D+"Rot",V=k[Y]=k[Y]||{};V.x1=a,V.y1=l,V.x2=s,V.y2=u,V.w=s-a,V.h=u-l,go(e,a,l,s,u),go(i.labelBounds.all,a,l,s,u)}return e}},xo=function(e){var t=0,n=function(e){return(e?1:0)<0&&o>0){var a=t.pstyle("outline-offset").value,s=t.pstyle("shape").value,l=o+a,u=(e.w+2*l)/e.w,c=(e.h+2*l)/e.h,h=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+2.4*l)/e.w,h=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+2.4*l)/e.w:"star"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.6*l)/e.h,h=-l/3.8):"triangle"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.4*l)/e.h,h=-l/1.4):"vee"===s&&(u=(e.w+4.4*l)/e.w,c=(e.h+3.8*l)/e.h,h=.5*-l);var d=e.h*c-e.h,p=e.w*u-e.w;if(Gt(e,[Math.ceil(d/2),Math.ceil(p/2)]),0!==h){var f=(r=h,{x1:(n=e).x1+0,x2:n.x2+0,y1:n.y1+r,y2:n.y2+r,w:n.w,h:n.h});Ft(e,f)}}}}(d,e)}else if(g&&t.includeEdges)if(c&&!h){var D=e.pstyle("curve-style").strValue;if(n=Math.min(v.srcX,v.midX,v.tgtX),r=Math.max(v.srcX,v.midX,v.tgtX),i=Math.min(v.srcY,v.midY,v.tgtY),o=Math.max(v.srcY,v.midY,v.tgtY),go(d,n-=_,i-=_,r+=_,o+=_),"haystack"===D){var k=v.haystackPts;if(k&&2===k.length){if(n=k[0].x,i=k[0].y,n>(r=k[1].x)){var A=n;n=r,r=A}if(i>(o=k[1].y)){var S=i;i=o,o=S}go(d,n-_,i-_,r+_,o+_)}}else if("bezier"===D||"unbundled-bezier"===D||D.endsWith("segments")||D.endsWith("taxi")){var M;switch(D){case"bezier":case"unbundled-bezier":M=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":M=v.linePts}if(null!=M)for(var O=0;O(r=P.x)){var R=n;n=r,r=R}if((i=I.y)>(o=P.y)){var B=i;i=o,o=B}go(d,n-=_,i-=_,r+=_,o+=_)}if(c&&t.includeEdges&&g&&(mo(d,e,"mid-source"),mo(d,e,"mid-target"),mo(d,e,"source"),mo(d,e,"target")),c&&"yes"===e.pstyle("ghost").value){var F=e.pstyle("ghost-offset-x").pfValue,z=e.pstyle("ghost-offset-y").pfValue;go(d,d.x1+F,d.y1+z,d.x2+F,d.y2+z)}var j=p.bodyBounds=p.bodyBounds||{};Yt(j,d),Gt(j,y),jt(j,1),c&&(n=d.x1,r=d.x2,i=d.y1,o=d.y2,go(d,n-E,i-E,r+E,o+E));var G=p.overlayBounds=p.overlayBounds||{};Yt(G,d),Gt(G,y),jt(G,1);var Y=p.labelBounds=p.labelBounds||{};null!=Y.all?((l=Y.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):Y.all=Bt(),c&&t.includeLabels&&(t.includeMainLabels&&bo(d,e,null),g&&(t.includeSourceLabels&&bo(d,e,"source"),t.includeTargetLabels&&bo(d,e,"target")))}return d.x1=fo(d.x1),d.y1=fo(d.y1),d.x2=fo(d.x2),d.y2=fo(d.y2),d.w=fo(d.x2-d.x1),d.h=fo(d.y2-d.y1),d.w>0&&d.h>0&&b&&(Gt(d,y),jt(d,1)),d}(e,_o),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=Bt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?vo(n,r.overlayBounds):vo(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?vo(n,r.labelBounds.all):(t.includeMainLabels&&vo(n,r.labelBounds.mainRot),t.includeSourceLabels&&vo(n,r.labelBounds.sourceRot),t.includeTargetLabels&&vo(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},_o={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},To=xo(_o),Co=Qe(_o);ho.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=Bt();var n=Co(e=e||_o),r=this;if(r.cy().styleEnabled())for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:jo,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)a(s);return this},Yo.removeAllListeners=function(){return this.removeListener("*")},Yo.emit=Yo.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,T(t)||(t=[t]),function(e,t,n){if("event"!==w(n))if(C(n))t(e,Xo(e,n));else for(var r=T(n)?n:n.split(/\s+/),i=0;i1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&E(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=this,i=0;ir&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(C(e)){var o=e;i.applyBypass(this,o,r),this.emitAndNotify("style")}else if(E(e)){if(void 0===t){var a=this[0];return a?i.getStylePropertyValue(a,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var o=0;o0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),ga.neighbourhood=ga.neighborhood,ga.closedNeighbourhood=ga.closedNeighborhood,ga.openNeighbourhood=ga.openNeighborhood,q(ga,{source:Zi((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Zi((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:ba({attr:"source"}),targets:ba({attr:"target"})}),q(ga,{edgesWith:Zi(xa(),"edgesWith"),edgesTo:Zi(xa({thisIsSrc:!0}),"edgesTo")}),q(ga,{connectedEdges:Zi((function(e){for(var t=[],n=0;n0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),ga.componentsOf=ga.components;var Ea=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new rt,o=!1;if(t){if(t.length>0&&C(t[0])&&!A(t[0])){o=!0;for(var a=[],s=new ot,l=0,u=t.length;l0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],u=0,c=i.length;u0){for(var B=e.length===i.length?i:new Ea(o,e),F=0;F0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var T=0;T=.001?function(t,r){for(var i=0;i<4;++i){var o=d(r,e,n);if(0===o)return r;r-=(h(r,e,n)-t)/o}return r}(t,a):0===l?a:function(t,r,i){var o,a,s=0;do{(o=h(a=r+(i-r)/2,e,n)-t)>0?i=a:r=a}while(Math.abs(o)>1e-7&&++s<10);return a}(t,r,r+i)}(o),t,r)};f.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var g="generateBezier("+[e,t,n,r]+")";return f.toString=function(){return g},f}var Na=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,h=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||l,a),u.push(1+s.x),c+=16,Math.abs(s.x)>h&&Math.abs(s.v)>h;);return o?function(e){return u[e*(u.length-1)|0]}:c}}(),Da=function(e,t,n,r){var i=Ca(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},ka={linear:function(e,t,n){return e+(t-e)*n},ease:Da(.25,.1,.25,1),"ease-in":Da(.42,0,1,1),"ease-out":Da(0,0,.58,1),"ease-in-out":Da(.42,0,.58,1),"ease-in-sine":Da(.47,0,.745,.715),"ease-out-sine":Da(.39,.575,.565,1),"ease-in-out-sine":Da(.445,.05,.55,.95),"ease-in-quad":Da(.55,.085,.68,.53),"ease-out-quad":Da(.25,.46,.45,.94),"ease-in-out-quad":Da(.455,.03,.515,.955),"ease-in-cubic":Da(.55,.055,.675,.19),"ease-out-cubic":Da(.215,.61,.355,1),"ease-in-out-cubic":Da(.645,.045,.355,1),"ease-in-quart":Da(.895,.03,.685,.22),"ease-out-quart":Da(.165,.84,.44,1),"ease-in-out-quart":Da(.77,0,.175,1),"ease-in-quint":Da(.755,.05,.855,.06),"ease-out-quint":Da(.23,1,.32,1),"ease-in-out-quint":Da(.86,0,.07,1),"ease-in-expo":Da(.95,.05,.795,.035),"ease-out-expo":Da(.19,1,.22,1),"ease-in-out-expo":Da(1,0,0,1),"ease-in-circ":Da(.6,.04,.98,.335),"ease-out-circ":Da(.075,.82,.165,1),"ease-in-out-circ":Da(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return ka.linear;var r=Na(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":Da};function Aa(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Sa(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Ma(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Sa(e,i),s=Sa(t,i);if(N(a)&&N(s))return Aa(o,a,s,n,r);if(T(a)&&T(s)){for(var l=[],u=0;u0?("spring"===h&&d.push(a.duration),a.easingImpl=ka[h].apply(null,d)):a.easingImpl=ka[h]}var p,f=a.easingImpl;if(p=0===a.duration?1:(n-l)/a.duration,a.applying&&(p=a.progress),p<0?p=0:p>1&&(p=1),null==a.delay){var g=a.startPosition,v=a.position;if(v&&i&&!e.locked()){var y={};La(g.x,v.x)&&(y.x=Ma(g.x,v.x,p,f)),La(g.y,v.y)&&(y.y=Ma(g.y,v.y,p,f)),e.position(y)}var m=a.startPan,b=a.pan,x=o.pan,w=null!=b&&r;w&&(La(m.x,b.x)&&(x.x=Ma(m.x,b.x,p,f)),La(m.y,b.y)&&(x.y=Ma(m.y,b.y,p,f)),e.emit("pan"));var _=a.startZoom,T=a.zoom,C=null!=T&&r;C&&(La(_,T)&&(o.zoom=Rt(o.minZoom,Ma(_,T,p,f),o.maxZoom)),e.emit("zoom")),(w||C)&&e.emit("viewport");var N=a.style;if(N&&N.length>0&&i){for(var D=0;D=0;t--)(0,e[t])();e.splice(0,e.length)},c=o.length-1;c>=0;c--){var h=o[c],d=h._private;d.stopped?(o.splice(c,1),d.hooked=!1,d.playing=!1,d.started=!1,u(d.frames)):(d.playing||d.applying)&&(d.playing&&d.applying&&(d.applying=!1),d.started||Ia(0,h,e),Oa(t,h,e,n),d.applying&&(d.applying=!1),u(d.frames),null!=d.step&&d.step(e),h.completed()&&(o.splice(c,1),d.hooked=!1,d.playing=!1,d.started=!1,u(d.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Ra={animate:Di.animate(),animation:Di.animation(),animated:Di.animated(),clearQueue:Di.clearQueue(),delay:Di.delay(),delayAnimation:Di.delayAnimation(),stop:Di.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Pa(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Ce((function(n){Pa(n,e),t()}))}()}}},Ba={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&A(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Fa=function(e){return E(e)?new Ui(e):e},za={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Go(Ba,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Fa(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Fa(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Fa(t),n),this},once:function(e,t,n){return this.emitter().one(e,Fa(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Di.eventAliasesOn(za);var ja={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};ja.jpeg=ja.jpg;var Ga={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n,r=e.name,i=t.extension("layout",r);if(null!=i)return n=E(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new i(q({},e,{cy:t,eles:n}));Ue("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Ue("A `name` must be specified to make a layout");else Ue("Layout options must be specified to make a layout")}};Ga.createLayout=Ga.makeLayout=Ga.layout;var Ya={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.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 null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Xa.invalidateDimensions=Xa.resize;var Ua={collection:function(e,t){return E(e)?this.$(e):k(e)?e.collection():T(e)?(t||(t={}),new Ea(this,e,t.unique,t.removed)):new Ea(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Ua.elements=Ua.filter=Ua.$;var qa={},Wa="t";qa.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r0;if(d||h&&p){var f=void 0;d&&p||d?f=u.properties:p&&(f=u.mappedProperties);for(var g=0;g1&&(v=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],_=i.valueMin[1],T=i.valueMax[1],C=i.valueMin[2],D=i.valueMax[2],k=null==i.valueMin[3]?1:i.valueMin[3],A=null==i.valueMax[3]?1:i.valueMax[3],S=[Math.round(w+(E-w)*v),Math.round(_+(T-_)*v),Math.round(C+(D-C)*v),Math.round(k+(A-k)*v)];n={bypass:i.bypass,name:i.name,value:S,strValue:"rgb("+S[0]+", "+S[1]+", "+S[2]+")"}}else{if(!s.number)return!1;var M=i.valueMin+(i.valueMax-i.valueMin)*v;n=this.parse(i.name,M,i.bypass,d)}if(!n)return g(),!1;n.mapping=i,i=n;break;case a.data:for(var O=i.field.split("."),L=h.data,I=0;I0&&o>0){for(var s={},l=!1,u=0;u0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},qa.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},qa.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},qa.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==t||"bezier"!==n&&"bezier"!==r||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==t||"none"!==n&&"none"!==r||e.connectedEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}))},qa.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Ha={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;ot.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");!o.match(/^\s*$/);){var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){We("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var u=l[1];if("core"!==u&&new Ui(u).invalid)We("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();else{var c=l[2],h=!1;n=c;for(var d=[];!n.match(/^\s*$/);){var p=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){We("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),h=!0;break}r=p[0];var f=p[1],g=p[2];this.properties[f]?i.parse(f,g)?(d.push({name:f,val:g}),s()):(We("Skipping property: Invalid property definition in: "+r),s()):(We("Skipping property: Invalid property name in: "+r),s())}if(h){a();break}i.selector(u);for(var v=0;v=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var d=s.data;return{name:e,value:u,strValue:""+t,mapped:d,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(h.multiple)return!1;var p=s.mapData;if(!h.color&&!h.number)return!1;var f=this.parse(e,c[4]);if(!f||f.mapped)return!1;var g=this.parse(e,c[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return We("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(h.color){var v=f.value,y=g.value;if(!(v[0]!==y[0]||v[1]!==y[1]||v[2]!==y[2]||v[3]!==y[3]&&(null!=v[3]&&1!==v[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:p,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(h.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):T(t)?t:[t],h.evenMultiple&&m.length%2!=0)return null;for(var b=[],x=[],w=[],C="",D=!1,k=0;k0?" ":"")+A.strValue}return h.validate&&!h.validate(b,x)?null:h.singleEnum&&D?1===b.length&&E(b[0])?{name:e,value:b[0],strValue:b[0],bypass:n}:null:{name:e,value:b,pfValue:w,strValue:C,bypass:n,units:x}}var S,M,O,L=function(){for(var r=0;rh.max||h.strictMax&&t===h.max))return null;var z={name:e,value:t,strValue:""+t+(I||""),units:I,bypass:n};return h.unitless||"px"!==I&&"em"!==I?z.pfValue=t:z.pfValue="px"!==I&&I?this.getEmSizeInPixels()*t:t,"ms"!==I&&"s"!==I||(z.pfValue="ms"===I?t:1e3*t),"deg"!==I&&"rad"!==I||(z.pfValue="rad"===I?t:(S=t,Math.PI*S/180)),"%"===I&&(z.pfValue=t/100),z}if(h.propList){var Y=[],X=""+t;if("none"===X);else{for(var U=X.split(/\s*,\s*|\s+/),q=0;q255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(O)||function(e){var t,n,r,i,o,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+V+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var h=i<.5?i*(1+r):i+r-i*r,d=2*i-h;a=Math.round(255*u(d,h,n+1/3)),s=Math.round(255*u(d,h,n)),l=Math.round(255*u(d,h,n-1/3))}t=[a,s,l,o]}return t}(O);return K?{name:e,value:K,pfValue:K,strValue:"rgb("+K[0]+","+K[1]+","+K[2]+")",bypass:n}:null}if(h.regex||h.regexes){if(h.enums){var Z=L();if(Z)return Z}for(var $=h.regexes?h.regexes:[h.regex],Q=0;Q<$.length;Q++){var J=new RegExp($[Q]).exec(t);if(J)return{name:e,value:h.singleRegexMatchValue?J[1]:J,strValue:""+t,bypass:n}}return null}return h.string?{name:e,value:""+t,strValue:""+t,bypass:n}:h.enums?L():null};var ts=function e(t){if(!(this instanceof e))return new e(t);M(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Ue("A style must have a core reference")},ns=ts.prototype;ns.instanceString=function(){return"style"},ns.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),N(e)?n=e:C(e)&&(n=e.level,null!=e.position?t=Ct(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;N(l.x)&&(t.pan.x=l.x,a=!1),N(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(E(e)){var n=e;e=this.mutableElements().filter(n)}else k(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=this.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("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,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};is.centre=is.center,is.autolockNodes=is.autolock,is.autoungrabifyNodes=is.autoungrabify;var os={data:Di.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Di.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Di.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Di.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};os.attr=os.data,os.removeAttr=os.removeData;var as=function(e){var t=this,n=(e=q({},e)).container;n&&!D(n)&&D(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==g&&void 0!==n&&!e.headless,a=e;a.layout=q({name:o?"grid":"null"},a.layout),a.renderer=q({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new Ea(this),listeners:[],aniEles:new Ea(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:N(a.zoom)?a.zoom:1,pan:{x:C(a.pan)&&N(a.pan.x)?a.pan.x:0,y:C(a.pan)&&N(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=q({},a,a.renderer);t.initRenderer(u),function(e,t){if(e.some(I))return Cr.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(C(e)||T(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=q({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,_(a.ready)&&t.on("ready",a.ready);for(var e=0;e0,u=Bt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(k(n.roots))e=n.roots;else if(T(n.roots)){for(var c=[],h=0;h0;){var O=A.shift(),L=D(O,S);if(L)O.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(M);else if(null===L){We("Detected double maximal shift for node `"+O.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}N();var I=0;if(n.avoidOverlap)for(var P=0;P0&&y[0].length<=3?l/2:0),h=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:H+c*Math.cos(h),y:K+c*Math.sin(h)}}return{x:H+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var ps={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function fs(e){this.options=q({},ps,e)}fs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=Bt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),h=0,d=0;d1&&t.avoidOverlap){h*=1.75;var v=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(h*h/(v*v+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:u+s}})),this};var gs,vs={fit:!0,padding:30,startAngle:1.5*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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ys(e){this.options=q({},vs,e)}ys.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=Bt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,u=[],c=0,h=0;h0&&Math.abs(m[0].value-x.value)>=v&&(m=[],y.push(m)),m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,_=(Math.min(a.w,a.h)/2-w)/(y.length+E?1:0);w=Math.min(w,_)}for(var T=0,C=0;C1&&t.avoidOverlap){var A=Math.cos(k)-Math.cos(0),S=Math.sin(k)-Math.sin(0),M=Math.sqrt(w*w/(A*A+S*S));T=Math.max(M,T)}N.r=T,T+=w}if(t.equidistant){for(var O=0,L=0,I=0;I=e.numIter||(Ns(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature=e.animationThreshold&&o(),Ce(t)):(Fs(r,e),s())}();else{for(;u;)u=a(l),l++;Fs(r,e),s()}return this},bs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},bs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var xs=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o=Bt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},s=n.eles.components(),l={},u=0;u0)for(a.graphSet.push(w),u=0;ur.count?0:r.graph},Es=function e(t,n,r,i){var o=i.graphSet[r];if(-10)var s=(u=r.nodeOverlap*a)*i/(g=Math.sqrt(i*i+o*o)),l=u*o/g;else{var u,c=Ms(e,i,o),h=Ms(t,-1*i,-1*o),d=h.x-c.x,p=h.y-c.y,f=d*d+p*p,g=Math.sqrt(f);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/f)*d/g,l=u*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Ss=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ms=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,u={};return 0===t&&0n?(u.x=r,u.y=i+o/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-a/2,u.y=i-a*n/2/t,u):0=l)?(u.x=r+o*t/2/n,u.y=i+o/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-o*t/2/n,u.y=i-o/2,u):u},Os=function(e,t){for(var n=0;n1){var f=t.gravity*h/p,g=t.gravity*d/p;c.offsetX+=f,c.offsetY+=g}}}}},Is=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},Bs=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTopf&&(h+=p+t.componentSpacing,c=0,d=0,p=0)}}},zs={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function js(e){this.options=q({},zs,e)}js.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=Bt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},h=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},d=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=d&&null!=p)l=d,u=p;else if(null!=d&&null==p)l=d,u=Math.ceil(a/l);else if(null==d&&null!=p)u=p,l=Math.ceil(a/u);else if(u*l>a){var f=c(),g=h();(f-1)*g>=a?c(f-1):(g-1)*f>=a&&h(g-1)}else for(;u*l=a?h(y+1):c(v+1)}var m=o.w/u,b=o.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x=u&&(M=0,S++)},L={},I=0;I(r=Zt(e,t,x[w],x[w+1],x[w+2],x[w+3])))return v(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5(r=Kt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return v(n,r),!0;m=m||i.source,b=b||i.target;var E=a.getArrowWidth(l,c),_=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<_.length;w++){var T=_[w],C=s.arrowShapes[n.pstyle(T.name+"-arrow-shape").value],N=n.pstyle("width").pfValue;if(C.roughCollide(e,t,E,T.angle,{x:T.x,y:T.y},N,d)&&C.collide(e,t,E,T.angle,{x:T.x,y:T.y},N,d))return v(n),!0}h&&u.length>0&&(y(m),y(b))}function b(e,t,n){return tt(e,t,n)}function x(n,r){var i,o=n._private,a=f;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),h=b(o.rscratch,"labelAngle",r),d=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-a-d,y=s.x2+a-d,m=s.y1-a-p,x=s.y2+a-p;if(h){var w=Math.cos(h),E=Math.sin(h),_=function(e,t){return{x:(e-=u)*w-(t-=c)*E+u,y:e*E+t*w+c}},T=_(g,m),C=_(g,x),N=_(y,m),D=_(y,x),k=[T.x+d,T.y+p,N.x+d,N.y+p,D.x+d,D.y+p,C.x+d,C.y+p];if($t(e,t,k))return v(n),!0}else if(Xt(s,e,t))return v(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return u},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),h=Math.max(t,r),d=Bt({x1:e=l,y1:t=c,x2:n=u,y2:r=h}),p=0;p4&&void 0!==arguments[4])||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(function(e,t,n,r,i){var o,a;if(e!==vl?bl(t,e,yl):((a=yl).x=-1*(o=ml).x,a.y=-1*o.y,a.nx=-1*o.nx,a.ny=-1*o.ny,a.ang=o.ang>0?-(Math.PI-o.ang):Math.PI+o.ang),bl(t,n,ml),nl=yl.nx*ml.ny-yl.ny*ml.nx,rl=yl.nx*ml.nx-yl.ny*-ml.ny,al=Math.asin(Math.max(-1,Math.min(1,nl))),Math.abs(al)<1e-6)return el=t.x,tl=t.y,void(ll=cl=0);il=1,ol=!1,rl<0?al<0?al=Math.PI+al:(al=Math.PI-al,il=-1,ol=!0):al>0&&(il=-1,ol=!0),cl=void 0!==t.radius?t.radius:r,sl=al/2,hl=Math.min(yl.len/2,ml.len/2),i?(ul=Math.abs(Math.cos(sl)*cl/Math.sin(sl)))>hl?(ul=hl,ll=Math.abs(ul*Math.sin(sl)/Math.cos(sl))):ll=cl:(ul=Math.min(hl,cl),ll=Math.abs(ul*Math.sin(sl)/Math.cos(sl))),fl=t.x+ml.nx*ul,gl=t.y+ml.ny*ul,el=fl-ml.ny*ll*il,tl=gl+ml.nx*ll*il,dl=t.x+yl.nx*ul,pl=t.y+yl.ny*ul,vl=t}(e,t,n,r,i),{cx:el,cy:tl,radius:ll,startX:dl,startY:pl,stopX:fl,stopY:gl,startAngle:yl.ang+Math.PI/2*il,endAngle:ml.ang-Math.PI/2*il,counterClockwise:ol})}var El={};function _l(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},D=N(T,E),k=N(C,_),A=!1;"auto"===v?g=Math.abs(D)>Math.abs(k)?i:r:v===l||v===s?(g=r,A=!0):v!==o&&v!==a||(g=i,A=!0);var S,M=g===r,O=M?k:D,L=M?C:T,I=St(L),P=!1;A&&(m||x)||!(v===s&&L<0||v===l&&L>0||v===o&&L>0||v===a&&L<0)||(O=(I*=-1)*Math.abs(O),P=!0);var R=function(e){return Math.abs(e)=Math.abs(O)},B=R(S=m?(b<0?1+b:b)*O:(b<0?O:0)+b*I),F=R(Math.abs(O)-Math.abs(S));if(!B&&!F||P)if(M){var z=u.y1+S+(f?h/2*I:0),j=u.x1,G=u.x2;n.segpts=[j,z,G,z]}else{var Y=u.x1+S+(f?c/2*I:0),V=u.y1,X=u.y2;n.segpts=[Y,V,Y,X]}else if(M){var U=Math.abs(L)<=h/2,q=Math.abs(T)<=d/2;if(U){var W=(u.x1+u.x2)/2,H=u.y1,K=u.y2;n.segpts=[W,H,W,K]}else if(q){var Z=(u.y1+u.y2)/2,$=u.x1,Q=u.x2;n.segpts=[$,Z,Q,Z]}else n.segpts=[u.x1,u.y2]}else{var J=Math.abs(L)<=c/2,ee=Math.abs(C)<=p/2;if(J){var te=(u.y1+u.y2)/2,ne=u.x1,re=u.x2;n.segpts=[ne,te,re,te]}else if(ee){var ie=(u.x1+u.x2)/2,oe=u.y1,ae=u.y2;n.segpts=[ie,oe,ie,ae]}else n.segpts=[u.x2,u.y1]}if(n.isRound){var se=e.pstyle("taxi-radius").value,le="arc-radius"===e.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(se),n.isArcRadius=new Array(n.segpts.length/2).fill(le)}},El.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,h=t.srcCornerRadius,d=t.tgtCornerRadius,p=t.srcRs,f=t.tgtRs,g=!N(n.startX)||!N(n.startY),v=!N(n.arrowStartX)||!N(n.arrowStartY),y=!N(n.endX)||!N(n.endY),m=!N(n.arrowEndX)||!N(n.arrowEndY),b=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,x=Mt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=xd.poolIndex()){var p=h;h=d,d=p}var f=s.srcPos=h.position(),g=s.tgtPos=d.position(),v=s.srcW=h.outerWidth(),y=s.srcH=h.outerHeight(),m=s.tgtW=d.outerWidth(),b=s.tgtH=d.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(h)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(d)],E=s.srcCornerRadius="auto"===h.pstyle("corner-radius").value?"auto":h.pstyle("corner-radius").pfValue,_=s.tgtCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,T=s.tgtRs=d._private.rscratch,C=s.srcRs=h._private.rscratch;s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var D=0;D0){var q=u,W=Ot(q,Dt(t)),H=Ot(q,Dt(U)),K=W;H2&&Ot(q,{x:U[2],y:U[3]})0){var le=c,ue=Ot(le,Dt(t)),ce=Ot(le,Dt(se)),he=ue;ce2&&Ot(le,{x:se[2],y:se[3]})=u||m){c={cp:g,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-d)/x.length,E=x.t1-x.t0,_=s?x.t0+E*w:x.t1-E*w;_=Rt(0,_,1),t=Pt(b.p0,b.p1,b.p2,_),i=function(e,t,n,r){var i=Rt(0,r-.001,1),o=Rt(0,r+.001,1),a=Pt(e,t,n,i),s=Pt(e,t,n,o);return Al(a,s)}(b.p0,b.p1,b.p2,_);break;case"straight":case"segments":case"haystack":for(var T,C,N,D,k=0,A=r.allpts.length,S=0;S+3=u));S+=2);var M=(u-C)/T;M=Rt(0,M,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Mt(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(N,D,M),i=Al(N,D)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},Dl.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},Dl.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=tt(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),u=i.height/l,c=u*o,h=i.width,d=i.height+(l-1)*(o-1)*u;nt(n.rstyle,"labelWidth",t,h),nt(n.rscratch,"labelWidth",t,h),nt(n.rstyle,"labelHeight",t,d),nt(n.rscratch,"labelHeight",t,d),nt(n.rscratch,"labelLineHeight",t,c)},Dl.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(nt(n.rscratch,e,t,r),r):tt(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u=i.split("\n"),c=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,d=[],p=/[\s\u200b]+/,f=h?"":" ",g=0;gc){for(var b=v.split(p),x="",w=0;wT);D++)C+=i[D],D===i.length-1&&(N=!0);return N||(C+="…"),C}return i},Dl.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},Dl.calculateLabelDimensions=function(e,t){var n=Ie(t,e._private.labelDimsKey),r=this.labelDimCache||(this.labelDimCache=[]),i=r[n];if(null!=i)return i;var o=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue,s=e.pstyle("font-family").strValue,l=e.pstyle("font-weight").strValue,u=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!u){u=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=u.getContext("2d");var h=u.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}c.font="".concat(o," ").concat(l," ").concat(a,"px ").concat(s);for(var d=0,p=0,f=t.split("\n"),g=0;g1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var D=i(t);v&&(e.hoverData.tapholdCancelled=!0),n=!0,r(g,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var k=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(v){var A={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};m?m.emit(A):a.emit(A),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=g,g&&g.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(n=!0,a.panningEnabled()&&a.userPanningEnabled()){var S;if(e.hoverData.justStartedPan){var M=e.hoverData.mdownPos;S={x:(c[0]-M[0])*s,y:(c[1]-M[1])*s},e.hoverData.justStartedPan=!1}else S={x:b[0]*s,y:b[1]*s};a.panBy(S),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=m&&!m.pannable()){if(m&&m.pannable()&&m.active()&&m.unactivate(),m&&m.grabbed()||g==y||(y&&r(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),g&&r(g,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=g),m)if(v){if(a.boxSelectionEnabled()&&D)m&&m.grabbed()&&(h(x),m.emit("freeon"),x.emit("free"),e.dragData.didDrag&&(m.emit("dragfreeon"),x.emit("dragfree"))),k();else if(m&&m.grabbed()&&e.nodeIsDraggable(m)){var O=!e.dragData.didDrag;O&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||u(x,{inDragLayer:!0});var L={x:0,y:0};if(N(b[0])&&N(b[1])&&(L.x+=b[0],L.y+=b[1],O)){var I=e.hoverData.dragDelta;I&&N(I[0])&&N(I[1])&&(L.x+=I[0],L.y+=I[1])}e.hoverData.draggingEles=!0,x.silentShift(L).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(b[0]),t.push(b[1])):(t[0]+=b[0],t[1]+=b[1])}();n=!0}else v&&(e.hoverData.dragging||!a.boxSelectionEnabled()||!D&&a.panningEnabled()&&a.userPanningEnabled()?!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()&&o(m,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=Dt(d),e.redrawHint("select",!0),e.redraw()):k(),m&&m.pannable()&&m.active()&&m.unactivate());return f[2]=c[0],f[3]=c[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(t,"mouseup",(function(t){if(e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,d=i(t);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:t,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(p):o.emit(p),!e.hoverData.cxtDragged){var f={originalEvent:t,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(f):o.emit(f)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(c,["click","tap","vclick"],t,{x:a[0],y:a[1]}),b=!1,t.timeStamp-x<=o.multiClickDebounceTime()?(m&&clearTimeout(m),b=!0,x=null,r(c,["dblclick","dbltap","vdblclick"],t,{x:a[0],y:a[1]})):(m=setTimeout((function(){b||r(c,["oneclick","onetap","voneclick"],t,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),x=t.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(o.$(n).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=o.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||d?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):d||(o.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var g=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),g.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:t,position:{x:a[0],y:a[1]}});"additive"===o.selectionType()||d||o.$(n).unmerge(g).unselect(),g.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=c&&c.grabbed();h(u),v&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}}),!1);var E,_,T,C,D,k,A,S,M,O,L,I,P,R=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",R,!0),e.registerBinding(t,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||R(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var B,F,z,j,G,Y,V,X=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},U=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",B=function(t){if(e.hasTouchStarted=!0,w(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]&&(a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=a[0],i[3]=a[1]),t.touches[2]&&(a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=a[0],i[5]=a[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,h(e.dragData.touchDragEles);var l=e.findContainerClientCoords();M=l[0],O=l[1],L=l[2],I=l[3],E=t.touches[0].clientX-M,_=t.touches[0].clientY-O,T=t.touches[1].clientX-M,C=t.touches[1].clientY-O,P=0<=E&&E<=L&&0<=T&&T<=L&&0<=_&&_<=I&&0<=C&&C<=I;var d=n.pan(),f=n.zoom();if(D=X(E,_,T,C),k=U(E,_,T,C),S=[((A=[(E+T)/2,(_+C)/2])[0]-d.x)/f,(A[1]-d.y)/f],k<4e4&&!t.touches[2]){var g=e.findNearestElement(i[0],i[1],!0,!0),v=e.findNearestElement(i[2],i[3],!0,!0);return g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):n.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),m=y[0];if(null!=m&&(m.activate(),e.touchData.start=m,e.touchData.starts=y,e.nodeIsGrabbable(m))){var b=e.dragData.touchDragEles=n.collection(),x=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),m.selected()?(x=n.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),u(x,{addToList:b})):c(m,{addToList:b}),s(m);var N=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};m.emit(N("grabon")),x?x.forEach((function(e){e.emit(N("grab"))})):m.emit(N("grab"))}r(m,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==m&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var R=e.touchData.startPosition=[null,null,null,null,null,null],B=0;B=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var x=t.touches[0].clientX-M,A=t.touches[0].clientY-O,L=t.touches[1].clientX-M,I=t.touches[1].clientY-O,R=U(x,A,L,I);if(R/k>=2.25||R>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var B={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(B),e.touchData.start=null):a.emit(B)}}if(n&&e.touchData.cxt){B={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}},e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(B):a.emit(B),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var F=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&F===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=F,F&&F.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(n&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var z=0;z0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",z=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",j=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var d=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);u[0]=d[0],u[1]=d[1]}if(t.touches[1]&&(d=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),u[2]=d[0],u[3]=d[1]),t.touches[2]&&(d=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),u[4]=d[0],u[5]=d[1]),i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:t,type:"cxttapend",position:{x:u[0],y:u[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var p={originalEvent:t,type:"cxttap",position:{x:u[0],y:u[1]}};i?i.emit(p):s.emit(p)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var f=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:t,position:{x:u[0],y:u[1]}}),f.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),f.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var g=e.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;h(g),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&(i.emit("freeon"),g.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),g.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(u[0],u[1],!0,!0);r(y,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]})}var m=e.touchData.startPosition[0]-u[0],b=m*m,x=e.touchData.startPosition[1]-u[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:u[0],y:u[1]}),G=!1,t.timeStamp-V<=s.multiClickDebounceTime()?(Y&&clearTimeout(Y),G=!0,V=null,r(i,["dbltap","vdblclick"],t,{x:u[0],y:u[1]})):(Y=setTimeout((function(){G||r(i,["onetap","voneclick"],t,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),V=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w2){for(var p=[c[0],c[1]],f=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),g=1;g0)return g[0]}return null},p=Object.keys(h),f=0;f0?u:qt(i,o,e,t,n,r,a,s)},checkPoint:function(e,t,n,r,i,o,a,s){var l=2*(s="auto"===s?hn(r,i):s);if(Qt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(Qt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!$t(e,t,[o-u,a-c,o-u,a,o+u,a,o+u,a-c])||!!tn(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!tn(e,t,l,l,o-r/2+s,a+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",ln(3,0)),this.generateRoundPolygon("round-triangle",ln(3,0)),this.generatePolygon("rectangle",ln(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",ln(5,0)),this.generateRoundPolygon("round-pentagon",ln(5,0)),this.generatePolygon("hexagon",ln(6,0)),this.generateRoundPolygon("round-hexagon",ln(6,0)),this.generatePolygon("heptagon",ln(7,0)),this.generateRoundPolygon("round-heptagon",ln(7,0)),this.generatePolygon("octagon",ln(8,0)),this.generateRoundPolygon("round-octagon",ln(8,0));var r=new Array(20),i=cn(5,0),o=cn(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*Gl)break;var v=e.deq(t,h,c);if(!(v.length>0))break;for(var y=0;y0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,h,c)&&r())}),i(t))}}},Vl=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ye;l(this,e),this.idsByKey=new rt,this.keyForId=new rt,this.cachesByLvl=new rt,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return c(e,[{key:"getIdsFor",value:function(e){null==e&&Ue("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new ot,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new rt,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),Xl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Ul=Qe({getKey:null,doesEleInvalidateKey:Ye,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Ge,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ql=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Ul(t);q(n,r),n.lookup=new Vl(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Wl=ql.prototype;Wl.reasons=Xl,Wl.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Wl.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Wl.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new ht((function(e,t){return t.reqs-e.reqs}))},Wl.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Wl.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(At(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,h=t.w*u,d=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,d))return null;var p,f=l.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||h>1024)return null;var g=o.getTextureQueue(p),v=g[g.length-2],y=function(){return o.recycleTexture(p,h)||o.addTexture(p,h)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidthr;D--)C=o.getElement(e,t,n,D,Xl.downscale);N()}else{var k;if(!x&&!w&&!E)for(var A=r-1;A>=-4;A--){var S=l.get(e,A);if(S){k=S;break}}if(b(k))return o.queueElement(e,r),k;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,d,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return f={x:v.usedWidth,texture:v,level:r,scale:u,width:h,height:c,scaledLabelShown:d},v.usedWidth+=Math.ceil(h+8),v.eleCaches.push(f),l.set(e,r,f),o.checkTextureFullness(v),f},Wl.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},Wl.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Je(t,e):e.fullnessChecks++},Wl.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Je(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,et(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Je(r,o),n.push(o),o}},Wl.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},Wl.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(r[l]=null,!c){i.push(s);var h=t.getBoundingBox(u);t.getElement(u,h,e,s.level,Xl.dequeue)}}return i},Wl.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=je,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},Wl.onDequeue=function(e){this.onDequeues.push(e)},Wl.offDequeue=function(e){Je(this.onDequeues,e)},Wl.setupDequeueing=Yl({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&Je(c,a)}}();var h=function(t){var i=(t=t||{}).after;if(function(){if(!a){a=Bt();for(var t=0;t16e6)return null;var o=r.makeLayer(a,n);if(null!=i){var s=c.indexOf(i)+1;c.splice(s,0,o)}else(void 0===t.insert||t.insert)&&c.unshift(o);return o};if(r.skipping&&!o)return null;for(var d=null,p=e.length/1,f=!o,g=0;g=p||!Ut(d.bb,v.boundingBox()))&&!(d=h({insert:!0,after:d})))return null;s||f?r.queueLayer(d,v):r.drawEleInLayer(d,v,n,t),d.eles.push(v),m[n]=d}}return s||(f?null:c)},Kl.getEleLevelForLayerLevel=function(e,t){return e},Kl.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,!0),i.setImgSmoothing(o,!0))},Kl.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Kl.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},Kl.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=Ne(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Kl.invalidateLayer=function(e){if(this.lastInvalidationTime=Ne(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Je(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,h=t.pstyle("curve-style").value,d=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=u*c,v=u*c,y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;"straight-triangle"===h?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,d),e.lineCap="butt")},m=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;a.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var b=t.pstyle("ghost-offset-x").pfValue,x=t.pstyle("ghost-offset-y").pfValue,w=t.pstyle("ghost-opacity").value,E=g*w;e.translate(b,x),y(E),m(E),e.translate(-b,-x)}i&&a.drawEdgeUnderlay(e,t),y(),m(),i&&a.drawEdgeOverlay(e,t),a.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},pu=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};du.drawEdgeOverlay=pu("overlay"),du.drawEdgeUnderlay=pu("underlay"),du.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");o.pathCacheKey&&o.pathCacheKey===h?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=h,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+3=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(o.roundCorners);try{for(v.s();!(g=v.n()).done;)xl(t,g.value)}catch(e){v.e(e)}finally{v.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var y=2;y+15&&void 0!==arguments[5]?arguments[5]:5,a=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),a?e.stroke():e.fill()}gu.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(At(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),h=t.pstyle("source-label"),d=t.pstyle("target-label");if(u||(!c||!c.value)&&(!h||!h.value)&&(!d||!d.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(a.drawText(e,t,null,f,o),t.isEdge()&&(a.drawText(e,t,"source",f,o),a.drawText(e,t,"target",f,o))):a.drawText(e,t,i,f,o),n&&e.translate(p.x1,p.y1)},gu.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},gu.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=tt(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},gu.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private.rscratch,a=i?t.effectiveOpacity():1;if(!i||0!==a&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,u=tt(o,"labelX",n),c=tt(o,"labelY",n),h=this.getLabelText(t,n);if(null!=h&&""!==h&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,i);var d,p=n?n+"-":"",f=tt(o,"labelWidth",n),g=tt(o,"labelHeight",n),v=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(m&&(b="center",x="center"),u+=v,c+=y,0!==(d=r?this.getTextAngle(t,n):0)&&(s=u,l=c,e.translate(s,l),e.rotate(d),u=0,c=0),x){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,_=t.pstyle("text-border-width").pfValue,T=t.pstyle("text-background-padding").pfValue,C=0===t.pstyle("text-background-shape").strValue.indexOf("round");if(w>0||_>0&&E>0){var N=u-T;switch(b){case"left":N-=f;break;case"center":N-=f/2}var D=c-g-T,k=f+2*T,A=g+2*T;if(w>0){var S=e.fillStyle,M=t.pstyle("text-background-color").value;e.fillStyle="rgba("+M[0]+","+M[1]+","+M[2]+","+w*a+")",C?vu(e,N,D,k,A,2):e.fillRect(N,D,k,A),e.fillStyle=S}if(_>0&&E>0){var O=e.strokeStyle,L=e.lineWidth,I=t.pstyle("text-border-color").value,P=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+I[0]+","+I[1]+","+I[2]+","+E*a+")",e.lineWidth=_,e.setLineDash)switch(P){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=_/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(C?vu(e,N,D,k,A,2,"stroke"):e.strokeRect(N,D,k,A),"double"===P){var R=_/2;C?vu(e,N+R,D+R,k-2*R,A-2*R,2,"stroke"):e.strokeRect(N+R,D+R,k-2*R,A-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=L,e.strokeStyle=O}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=tt(o,"labelWrapCachedLines",n),z=tt(o,"labelLineHeight",n),j=f/2,G=this.getLabelJustification(t);switch("auto"===G||("left"===b?"left"===G?u+=-f:"center"===G&&(u+=-j):"center"===b?"left"===G?u+=-j:"right"===G&&(u+=j):"right"===b&&("center"===G?u+=j:"right"===G&&(u+=f))),x){case"top":case"center":case"bottom":c-=(F.length-1)*z}for(var Y=0;Y0&&e.strokeText(F[Y],u,c),e.fillText(F[Y],u,c),c+=z}else B>0&&e.strokeText(h,u,c),e.fillText(h,u,c);0!==d&&(e.rotate(-d),e.translate(-s,-l))}}};var yu={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,h=t.position();if(N(h.x)&&N(h.y)&&(!s||t.visible())){var d,p,f=s?t.effectiveOpacity():1,g=l.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image").value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:k;l.eleFillStyle(e,t,n)},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;l.colorStrokeStyle(e,A[0],A[1],A[2],t)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;l.colorStrokeStyle(e,F[0],F[1],F[2],t)},q=function(e,t,n,r){var i,o=l.nodePathCache=l.nodePathCache||[],a=Pe("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+Y),s=o[a],u=!1;return null!=s?(i=s,u=!0,c.pathCache=i):(i=new Path2D,o[a]=c.pathCache=i),{path:i,cacheHit:u}},W=t.pstyle("shape").strValue,H=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(h.x,h.y);var K=q(r,i,W,H);d=K.path,v=K.cacheHit}var Z=function(){if(!v){var n=h;g&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(d||e,n.x,n.y,r,i,Y,c)}g?e.fill(d):e.fill()},$=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=u.backgrounding,o=0,a=0;a0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,h.x,h.y,r,i,Y,c)))},J=function(){var t=(C>0?C:-C)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f),n=C>0?0:255;0!==C&&(l.colorFillStyle(e,n,n,n,t),g?e.fill(d):e.fill())},ee=function(){if(D>0){if(e.lineWidth=D,e.lineCap=O,e.lineJoin=M,e.setLineDash)switch(S){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(I),e.lineDashOffset=P;break;case"solid":case"double":e.setLineDash([])}if("center"!==L){if(e.save(),e.lineWidth*=2,"inside"===L)g?e.clip(d):e.clip();else{var t=new Path2D;t.rect(-r/2-D,-i/2-D,r+2*D,i+2*D),t.addPath(d),e.clip(t,"evenodd")}g?e.stroke(d):e.stroke(),e.restore()}else g?e.stroke(d):e.stroke();if("double"===S){e.lineWidth=D/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(d):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},te=function(){if(B>0){if(e.lineWidth=B,e.lineCap="butt",e.setLineDash)switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=h;g&&(n={x:0,y:0});var o=l.getNodeShape(t),a=D;"inside"===L&&(a=0),"outside"===L&&(a*=2);var s,u=(r+a+(B+G))/r,c=(i+a+(B+G))/i,d=r*u,p=i*c,f=l.nodeShapes[o].points;if(g&&(s=q(d,p,o,f).path),"ellipse"===o)l.drawEllipsePath(s||e,n.x,n.y,d,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(o)){var v=0,y=0,m=0;"round-diamond"===o?v=1.4*(a+G+B):"round-heptagon"===o?(v=1.075*(a+G+B),m=-(a/2+G+B)/35):"round-hexagon"===o?v=1.12*(a+G+B):"round-pentagon"===o?(v=1.13*(a+G+B),m=-(a/2+G+B)/15):"round-tag"===o?(v=1.12*(a+G+B),y=.07*(a/2+B+G)):"round-triangle"===o&&(v=(a+G+B)*(Math.PI/2),m=-(a+G/2+B)/Math.PI),0!==v&&(d=r*(u=(r+v)/r),["round-hexagon","round-tag"].includes(o)||(p=i*(c=(i+v)/i)));for(var b=d/2,x=p/2,w=(Y="auto"===Y?dn(d,p):Y)+(a+B+G)/2,E=new Array(f.length/2),_=new Array(f.length/2),T=0;T0){if(r=r||n.position(),null==i||null==o){var h=n.padding();i=n.width()+2*h,o=n.height()+2*h}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*a,o+2*a,c),t.fill()}}}};yu.drawNodeOverlay=mu("overlay"),yu.drawNodeUnderlay=mu("underlay"),yu.hasPie=function(e){return(e=e[0])._private.hasPie},yu.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,h=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var d=1;d<=i.pieBackgroundN;d++){var p=t.pstyle("pie-"+d+"-background-size").value,f=t.pstyle("pie-"+d+"-background-color").value,g=t.pstyle("pie-"+d+"-background-opacity").value*n,v=p/100;v+h>1&&(v=1-h);var y=1.5*Math.PI+2*Math.PI*h,m=y+2*Math.PI*v;0===p||h>=1||h+v>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,f[0],f[1],f[2],g),e.fill(),h+=v)}};for(var bu={getPixelRatio:function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},paintCache:function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;ia.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!h&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},T=a.prevViewport;void 0===T||_.zoom!==T.zoom||_.pan.x!==T.pan.x||_.pan.y!==T.pan.y||g&&!f||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var C=a.getCachedZSortedEles();function N(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function D(e,r){var s,l,c,h;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,c=a.canvasWidth,h=a.canvasHeight):(s={x:w.x*p,y:w.y*p},l=b*p,c=a.canvasWidth*p,h=a.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?N(e,0,0,c,h):t||void 0!==r&&!r||e.clearRect(0,0,c,h),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(h||(a.textureDrawLastFrame=!1),h){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var k=a.data.bufferContexts[a.TEXTURE_BUFFER];k.setTransform(1,0,0,1,0,0),k.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:k,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(_=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var A=u.contexts[a.NODE],S=a.textureCache.texture;_=a.textureCache.viewport,A.setTransform(1,0,0,1,0,0),d?N(A,0,0,_.width,_.height):A.clearRect(0,0,_.width,_.height);var M=m.core("outside-texture-bg-color").value,O=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(A,M[0],M[1],M[2],O),A.fillRect(0,0,_.width,_.height),b=l.zoom(),D(A,!1),A.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s),A.drawImage(S,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var L=l.extent(),I=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),P=a.hideEdgesOnViewport&&I,R=[];if(R[a.NODE]=!c[a.NODE]&&d&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,R[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),R[a.DRAG]=!c[a.DRAG]&&d&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,R[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||R[a.NODE]){var B=d&&!R[a.NODE]&&1!==p;D(A=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),d&&!B?"motionBlur":void 0),P?a.drawCachedNodes(A,C.nondrag,s,L):a.drawLayeredElements(A,C.nondrag,s,L),a.debug&&a.drawDebugPoints(A,C.nondrag),n||d||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||R[a.DRAG])&&(B=d&&!R[a.DRAG]&&1!==p,D(A=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),d&&!B?"motionBlur":void 0),P?a.drawCachedNodes(A,C.drag,s,L):a.drawCachedElements(A,C.drag,s,L),a.debug&&a.drawDebugPoints(A,C.drag),n||d||(c[a.DRAG]=!1)),a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(D(A=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var F=m.core("selection-box-border-width").value/b;A.lineWidth=F,A.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",A.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),F>0&&(A.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",A.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var z=u.bgActivePosistion;A.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",A.beginPath(),A.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),A.fill()}var j=a.lastRedrawTime;if(a.showFps&&j){j=Math.round(j);var G=Math.round(1e3/j);A.setTransform(1,0,0,1,0,0),A.fillStyle="rgba(255, 0, 0, 0.75)",A.strokeStyle="rgba(255, 0, 0, 0.75)",A.lineWidth=1,A.fillText("1 frame = "+j+" ms = "+G+" fps",0,20),A.strokeRect(0,30,250,20),A.fillRect(0,30,250*Math.min(G/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(d&&1!==p){var Y=u.contexts[a.NODE],V=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],X=u.contexts[a.DRAG],U=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],q=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):N(e,0,0,a.canvasWidth,a.canvasHeight);var r=p;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||R[a.NODE])&&(q(Y,V,R[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||R[a.DRAG])&&(q(X,U,R[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),d&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!h,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")}},xu={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l0&&o>0){d.clearRect(0,0,i,o),d.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)d.translate(-n.x1*l,-n.y1*l),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(n.x1*l,n.y1*l);else{var f=t.pan(),g={x:f.x*l,y:f.y*l};l*=t.zoom(),d.translate(g.x,g.y),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(-g.x,-g.y)}e.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=e.bg,d.rect(0,0,i,o),d.fill())}return h},Du.png=function(e){return Au(e,this.bufferCanvasImage(e),"image/png")},Du.jpg=function(e){return Au(e,this.bufferCanvasImage(e),"image/jpeg")};var Su=Ou,Mu=Ou.prototype;function Ou(e){var t=this;t.data={canvases:new Array(Mu.CANVAS_LAYERS),contexts:new Array(Mu.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Mu.CANVAS_LAYERS),bufferCanvases:new Array(Mu.BUFFER_COUNT),bufferContexts:new Array(Mu.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",r="rgba(0,0,0,0)";t.data.canvasContainer=document.createElement("div");var i=t.data.canvasContainer.style;t.data.canvasContainer.style[n]=r,i.position="relative",i.zIndex="0",i.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[n]=r;var a={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};v&&v.userAgent.match(/msie|trident|edge/i)&&(a["-ms-touch-action"]="none",a["touch-action"]="none");for(var s=0;s node",style:{"padding-top":"10px","padding-left":"10px","padding-bottom":"10px","padding-right":"10px","text-valign":"top"}},{selector:"node[parallel]",style:{"background-opacity":0,"background-image":function(e){if(!e)return e;var t=e._private.autoWidth;if(void 0===t)return e;var n=e._private.autoHeight+20,r=e._private.position,i=r.x-t/2,o=r.y-n/2;if(e._private.children.length>1){var a="";if(n>t)for(var s=e._private.children.map((function(e){return e._private.position.x})).sort((function(e,t){return e-t})),l=1;l\n')}else for(var c=e._private.children.map((function(e){return e._private.position.y})).sort((function(e,t){return e-t})),h=1;h\n')}var p='\n ");return"data:image/svg+xml,"+encodeURIComponent(p)}return e}}},{selector:"node[parallel] > node",style:{"background-opacity":0}},{selector:'node[id ^="init_"]',style:{width:"5px",height:"5px","background-color":"black",shape:"ellipse",label:""}},{selector:"edge",css:{"target-arrow-shape":"triangle",label:"data(label)","line-color":"black","curve-style":"bezier","target-arrow-color":"black","text-background-opacity":1,"text-background-color":"#fff","text-background-padding":5,"text-rotation":"autorotate","source-text-rotation":"autorotate","target-text-rotation":"autorotate"}},{selector:"edge:loop",style:{"loop-sweep":"60deg","loop-direction":"0deg","control-point-step-size":"50px"}},{selector:":active",style:{"line-color":"red","border-opacity":1,"target-arrow-color":"red","source-arrow-color":"red","border-color":"red"}},{selector:".currentState",style:{"background-color":"#faa","border-style":"double","border-color":"#f00"}},{selector:".currentTransition",style:{"background-color":"#faa","border-style":"double","border-color":"#f00","line-color":"#faa","target-arrow-color":"#faa","source-arrow-color":"#faa"}},{selector:"node.multiline",style:{"text-justification":"left","text-wrap":"wrap"}}];const $u={layouts:{concentric:{name:"concentric",minNodeSpacing:100},dagre:{name:"dagre",ranker:"tight-tree",avoidOverlap:!0,nodeDimensionsIncludeLabels:!0},bilkent:{name:"cose-bilkent",idealEdgeLength:100}},machineStorageLocation:"transitions.layouts.machines"};function Qu(e){return Qu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qu(e)}function Ju(e,t){for(var n=0;n\nState: ").concat(n.join(", "))},classes:[e.class,e.name]})})),t.length>1?(document.getElementById("legend").style.display=null,this.cyLegend=function(e,t){var n=Xu({container:document.getElementById("legend"),boxSelectionEnabled:!1,autounselectify:!0,layout:{name:"grid",cols:1},style:Ku.concat(t),elements:{nodes:e}});return n.autolock(!0),n}(t,this.style)):document.getElementById("legend").style.display="none"}},{key:"loadLayout",value:function(){if(this.machineName.length>0){var e=localStorage.getItem($u.machineStorageLocation);if(null!=e&&(e=JSON.parse(e)).hasOwnProperty(this.machineName))return{name:"preset",positions:e[this.machineName]}}}},{key:"saveLayout",value:function(){var e={};this.cy.nodes().forEach((function(t){e[t.data("id")]=t.position()}));var t,n,r,i=localStorage.getItem($u.machineStorageLocation);try{if("object"!==Qu(i=JSON.parse(i)))throw Error("Expected 'machineStorage' to be of type object but found ".concat(Qu(i)));i[this.machineName]=e}catch(o){t={},n=this.machineName,r=e,(n=ec(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,i=t}localStorage.setItem($u.machineStorageLocation,JSON.stringify(i))}},{key:"selectState",value:function(e,t){var n=this,r=e.replace(/\W/g,"");this.modelStates[e].forEach((function(t){t.removeClass("currentState"),t.removeClass(r),t.removeClass(n.modelClasses[e])}));var i=Array.isArray(t)?t:[t];this.modelStates[e]=i.map((function(e){return n.cy.getElementById(e)})),this.modelStates[e].forEach((function(t){t.addClass("currentState"),t.addClass(r),t.addClass(n.modelClasses[e])})),this.cyLegend&&this.cyLegend.nodes("#".concat(e)).css({content:"".concat(e," <").concat(this.modelClasses[e],">\nState: ").concat(i.join(", "))})}},{key:"selectTransition",value:function(e,t){this.modelTransitions[e].forEach((function(e){e.removeClass("currentTransition")}));var n=this.cy.nodes('[id="'.concat(t.source,'"]')).connectedEdges('[trigger="'.concat(t.trigger,'"]'));n.length>1&&(n=n.filter('[source="'.concat(t.source,'"]'))).length>1&&(n=n.filter('[target="'.concat(t.dest,'"]'))),n.length>0&&((n=n[0]).addClass("currentTransition"),this.modelTransitions[e]=[n])}}])&&Ju(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function nc(e){return nc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nc(e)}function rc(e,t){for(var n=0;n{var e={7799:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(0).FDLayoutConstants;function i(){}for(var o in r)i[o]=r[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i},function(e,t,n){"use strict";var r=n(0).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},function(e,t,n){"use strict";var r=n(0).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},function(e,t,n){"use strict";var r=n(0).LGraphManager;function i(e){r.call(this,e)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},function(e,t,n){"use strict";var r=n(0).FDLayoutNode,i=n(0).IMath;function o(e,t,n,i){r.call(this,e,t,n,i)}for(var a in o.prototype=Object.create(r.prototype),r)o[a]=r[a];o.prototype.move=function(){var e=this.graphManager.getLayout();this.displacementX=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},o.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},m.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},m.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n