/*!
* This file is part of Cytoscape.js 2.3.15.
*
* Cytoscape.js is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Cytoscape.js is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* Cytoscape.js. If not, see .
*/
var cytoscape;!function(e){"use strict";var t=cytoscape=function(){return cytoscape.init.apply(cytoscape,arguments)};t.version="2.3.15",t.init=function(e){return void 0===e&&(e={}),t.is.plainObject(e)?new t.Core(e):t.is.string(e)?t.extension.apply(t.extension,arguments):void 0},t.fn={},"undefined"!=typeof module&&module.exports&&(module.exports=cytoscape),"undefined"!=typeof define&&define.amd&&define("cytoscape",function(){return cytoscape}),e&&(e.cytoscape=cytoscape)}("undefined"==typeof window?null:window),this.cytoscape=cytoscape,function(e,t){"use strict";e.is={defined:function(e){return null!=e},string:function(e){return null!=e&&"string"==typeof e},fn:function(e){return null!=e&&"function"==typeof e},array:function(e){return Array.isArray?Array.isArray(e):null!=e&&e instanceof Array},plainObject:function(t){return null!=t&&typeof t==typeof{}&&!e.is.array(t)&&t.constructor===Object},number:function(e){return null!=e&&"number"==typeof e&&!isNaN(e)},integer:function(t){return e.is.number(t)&&Math.floor(t)===t},color:function(e){return null!=e&&"string"==typeof e&&""!==$.Color(e).toString()},bool:function(e){return null!=e&&typeof e==typeof!0},elementOrCollection:function(t){return e.is.element(t)||e.is.collection(t)},element:function(t){return t instanceof e.Element&&t._private.single},collection:function(t){return t instanceof e.Collection&&!t._private.single},core:function(t){return t instanceof e.Core},style:function(t){return t instanceof e.Style},stylesheet:function(t){return t instanceof e.Stylesheet},event:function(t){return t instanceof e.Event},emptyString:function(t){return t?e.is.string(t)&&(""===t||t.match(/^\s+$/))?!0:!1:!0},nonemptyString:function(t){return t&&e.is.string(t)&&""!==t&&!t.match(/^\s+$/)?!0:!1},domElement:function(e){return"undefined"==typeof HTMLElement?!1:e instanceof HTMLElement},boundingBox:function(t){return e.is.plainObject(t)&&e.is.number(t.x1)&&e.is.number(t.x2)&&e.is.number(t.y1)&&e.is.number(t.y2)},touch:function(){return t&&("ontouchstart"in t||t.DocumentTouch&&document instanceof DocumentTouch)},gecko:function(){return"undefined"!=typeof InstallTrigger||"MozAppearance"in document.documentElement.style},webkit:function(){return"undefined"!=typeof webkitURL||"WebkitAppearance"in document.documentElement.style},chromium:function(){return"undefined"!=typeof chrome},khtml:function(){return navigator.vendor.match(/kde/i)},khtmlEtc:function(){return e.is.khtml()||e.is.webkit()||e.is.blink()},trident:function(){/*@cc_on!@*/
return"undefined"!=typeof ActiveXObject||!1},windows:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/Win/i)},mac:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/Mac/i)},linux:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/Linux/i)},unix:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/X11/i)}}}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";e.util={extend:function(){var t,i,r,n,a,o,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||e.is.fn(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(t=arguments[l]))for(i in t)r=s[i],n=t[i],s!==n&&(c&&n&&(e.is.plainObject(n)||(a=e.is.array(n)))?(a?(a=!1,o=r&&e.is.array(r)?r:[]):o=r&&e.is.plainObject(r)?r:{},s[i]=e.util.extend(c,o,n)):void 0!==n&&(s[i]=n));return s},require:function(i,r,n){var a;n=e.util.extend({msgIfNotFound:!0},n);var o=!1,s=function(e){o=!0,r(e)},l=function(e){t&&(a=t[i]),void 0!==a&&s(a),e&&e()},u=function(){o||c(d)},c=function(e){"undefined"!=typeof module&&module.exports&&require&&(a=require(i)),void 0!==a&&s(a),e&&e()},d=function(){o||p(h)},p=function(e){"undefined"!=typeof define&&define.amd&&require&&require([i],function(t){a=t,void 0!==a&&s(a),e&&e()})},h=function(){!o&&n.msgIfNotFound&&e.util.error("Cytoscape.js tried to pull in dependency `"+i+"` but no module (i.e. CommonJS, AMD, or window) was found")};l(u)},requires:function(t,i){for(var r=[],n=[],a=function(){for(var e=0;e=r){a&&clearTimeout(a);var p=c;a=u=c=void 0,p&&(d=e.util.now(),o=t.apply(l,n),u||a||(n=l=null))}else u=setTimeout(f,r)},g=function(){u&&clearTimeout(u),a=u=c=void 0,(h||p!==i)&&(d=e.util.now(),o=t.apply(l,n),u||a||(n=l=null))};return function(){if(n=arguments,s=e.util.now(),l=this,c=h&&(u||!v),p===!1)var r=v&&!u;else{a||v||(d=s);var y=p-(s-d),m=0>=y;m?(a&&(a=clearTimeout(a)),d=s,o=t.apply(l,n)):a||(a=setTimeout(g,y))}return m&&u?u=clearTimeout(u):u||i===p||(u=setTimeout(f,i)),r&&(m=!0,o=t.apply(l,n)),!m||u||a||(n=l=null),o}}},error:function(e){if(!console)throw e;if(console.error)console.error.apply(console,arguments);else{if(!console.log)throw e;console.log.apply(console,arguments)}},clone:function(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},copy:function(t){return null==t?t:e.is.array(t)?t.slice():e.is.plainObject(t)?e.util.clone(t):t},makeBoundingBox:function(e){if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(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}}},mapEmpty:function(e){var t=!0;if(null!=e)for(var i in e){t=!1;break}return t},pushMap:function(t){var i=e.util.getMap(t);null==i?e.util.setMap($.extend({},t,{value:[t.value]})):i.push(t.value)},setMap:function(t){for(var i,r=t.map,n=t.keys,a=n.length,o=0;a>o;o++){var i=n[o];e.is.plainObject(i)&&e.util.error("Tried to set map with object key"),oa;a++){var o=r[a];if(e.is.plainObject(o)&&e.util.error("Tried to get map with object key"),i=i[o],null==i)return i}return i},deleteMap:function(t){for(var i=t.map,r=t.keys,n=r.length,a=t.keepChildren,o=0;n>o;o++){var s=r[o];e.is.plainObject(s)&&e.util.error("Tried to delete map with object key");var l=o===t.keys.length-1;if(l)if(a)for(var u in i)a[u]||(i[u]=void 0);else i[s]=void 0;else i=i[s]}},capitalize:function(t){return e.is.emptyString(t)?t:t.charAt(0).toUpperCase()+t.substring(1)},camel2dash:function(e){for(var t=[],i=0;it&&" "===e[i];i--);return e.substring(t,i+1)},hex2tuple:function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,i,r,n=4===e.length,a=16;return n?(t=parseInt(e[1]+e[1],a),i=parseInt(e[2]+e[2],a),r=parseInt(e[3]+e[3],a)):(t=parseInt(e[1]+e[2],a),i=parseInt(e[3]+e[4],a),r=parseInt(e[5]+e[6],a)),[t,i,r]}},hsl2tuple:function(t){function i(e,t,i){return 0>i&&(i+=1),i>1&&(i-=1),1/6>i?e+6*(t-e)*i:.5>i?t:2/3>i?e+(t-e)*(2/3-i)*6:e}var r,n,a,o,s,l,u,c,d=new RegExp("^"+e.util.regex.hsla+"$").exec(t);if(d){if(n=parseInt(d[1]),0>n?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,a=parseFloat(d[2]),0>a||a>100)return;if(a/=100,o=parseFloat(d[3]),0>o||o>100)return;if(o/=100,s=d[4],void 0!==s&&(s=parseFloat(s),0>s||s>1))return;if(0===a)l=u=c=Math.round(255*o);else{var p=.5>o?o*(1+a):o+a-o*a,h=2*o-p;l=Math.round(255*i(h,p,n+1/3)),u=Math.round(255*i(h,p,n)),c=Math.round(255*i(h,p,n-1/3))}r=[l,u,c,s]}return r},rgb2tuple:function(t){var i,r=new RegExp("^"+e.util.regex.rgba+"$").exec(t);if(r){i=[];for(var n=[],a=1;3>=a;a++){var o=r[a];if("%"===o[o.length-1]&&(n[a]=!0),o=parseFloat(o),n[a]&&(o=o/100*255),0>o||o>255)return;i.push(Math.floor(o))}var s=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(s&&!l)return;var u=r[4];if(void 0!==u){if(u=parseFloat(u),0>u||u>1)return;i.push(u)}}return i},colorname2tuple:function(t){return e.util.colors[t.toLowerCase()]},color2tuple:function(t){return(e.is.array(t)?t:null)||e.util.colorname2tuple(t)||e.util.hex2tuple(t)||e.util.rgb2tuple(t)||e.util.hsl2tuple(t)},tuple2hex:function(e){function t(e){var t=e.toString(16);return 1===t.length&&(t="0"+t),t}var i=e[0],r=e[1],n=e[2];return"#"+t(i)+t(r)+t(n)},colors:{transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},e.util.regex={},e.util.regex.number="(?:[-]?\\d*\\.\\d+|[-]?\\d+|[-]?\\d*\\.\\d+[eE]\\d+)",e.util.regex.rgba="rgb[a]?\\(("+e.util.regex.number+"[%]?)\\s*,\\s*("+e.util.regex.number+"[%]?)\\s*,\\s*("+e.util.regex.number+"[%]?)(?:\\s*,\\s*("+e.util.regex.number+"))?\\)",e.util.regex.rgbaNoBackRefs="rgb[a]?\\((?:"+e.util.regex.number+"[%]?)\\s*,\\s*(?:"+e.util.regex.number+"[%]?)\\s*,\\s*(?:"+e.util.regex.number+"[%]?)(?:\\s*,\\s*(?:"+e.util.regex.number+"))?\\)",e.util.regex.hsla="hsl[a]?\\(("+e.util.regex.number+")\\s*,\\s*("+e.util.regex.number+"[%])\\s*,\\s*("+e.util.regex.number+"[%])(?:\\s*,\\s*("+e.util.regex.number+"))?\\)",e.util.regex.hslaNoBackRefs="hsl[a]?\\((?:"+e.util.regex.number+")\\s*,\\s*(?:"+e.util.regex.number+"[%])\\s*,\\s*(?:"+e.util.regex.number+"[%])(?:\\s*,\\s*(?:"+e.util.regex.number+"))?\\)",e.util.regex.hex3="\\#[0-9a-fA-F]{3}",e.util.regex.hex6="\\#[0-9a-fA-F]{6}";var i=t?t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame:null;i=i||function(e){e&&setTimeout(e,1e3/60)},e.util.requestAnimationFrame=function(e){i(e)}}(cytoscape,"undefined"==typeof window?null:window),function(e){"use strict";e.math={},e.math.signum=function(e){return e>0?1:0>e?-1:0},e.math.distance=function(e,t){var i=t.x-e.x,r=t.y-e.y;return Math.sqrt(i*i+r*r)},e.math.qbezierAt=function(e,t,i,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*i},e.math.qbezierPtAt=function(t,i,r,n){return{x:e.math.qbezierAt(t.x,i.x,r.x,n),y:e.math.qbezierAt(t.y,i.y,r.y,n)}},e.math.boundingBoxesIntersect=function(e,t){return e.x1>t.x2?!1:t.x1>e.x2?!1:e.x2t.y2?!1:t.y1>e.y2?!1:!0},e.math.inBoundingBox=function(e,t,i){return e.x1<=t&&t<=e.x2&&e.y1<=i&&i<=e.y2},e.math.pointInBoundingBox=function(e,t){return this.inBoundingBox(e,t.x,t.y)},e.math.roundRectangleIntersectLine=function(e,t,i,r,n,a,o){var s,l=this.getRoundRectangleRadius(n,a),u=n/2,c=a/2,d=i-u+l-o,p=r-c-o,h=i+u-l+o,v=p;if(s=this.finiteLinesIntersect(e,t,i,r,d,p,h,v,!1),s.length>0)return s;var f=i+u+o,g=r-c+l-o,y=f,m=r+c-l+o;if(s=this.finiteLinesIntersect(e,t,i,r,f,g,y,m,!1),s.length>0)return s;var x=i-u+l-o,b=r+c+o,w=i+u-l+o,_=b;if(s=this.finiteLinesIntersect(e,t,i,r,x,b,w,_,!1),s.length>0)return s;var E=i-u-o,S=r-c+l-o,P=E,D=r+c-l+o;if(s=this.finiteLinesIntersect(e,t,i,r,E,S,P,D,!1),s.length>0)return s;var k,C=i-u+l,T=r-c+l;if(k=this.intersectLineCircle(e,t,i,r,C,T,l+o),k.length>0&&k[0]<=C&&k[1]<=T)return[k[0],k[1]];var N=i+u-l,M=r-c+l;if(k=this.intersectLineCircle(e,t,i,r,N,M,l+o),k.length>0&&k[0]>=N&&k[1]<=M)return[k[0],k[1]];var B=i+u-l,z=r+c-l;if(k=this.intersectLineCircle(e,t,i,r,B,z,l+o),k.length>0&&k[0]>=B&&k[1]>=z)return[k[0],k[1]];var I=i-u+l,L=r+c-l;return k=this.intersectLineCircle(e,t,i,r,I,L,l+o),k.length>0&&k[0]<=I&&k[1]>=L?[k[0],k[1]]:[]},e.math.roundRectangleIntersectBox=function(e,t,i,r,n,a,o,s,l){var u=this.getRoundRectangleRadius(n,a),c=o-n/2-l,d=s-a/2+u-l,p=o+n/2+l,h=s+a/2-u+l,v=o-n/2+u-l,f=s-a/2-l,g=o+n/2-u+l,y=s+a/2+l,m=Math.min(e,i),x=Math.max(e,i),b=Math.min(t,r),w=Math.max(t,r);return c>x?!1:m>p?!1:f>w?!1:b>y?!1:c>=m&&x>=c&&d>=b&&w>=d?!0:p>=m&&x>=p&&d>=b&&w>=d?!0:p>=m&&x>=p&&h>=b&&w>=h?!0:c>=m&&x>=c&&h>=b&&w>=h?!0:m>=c&&p>=m&&b>=d&&h>=b?!0:x>=c&&p>=x&&b>=d&&h>=b?!0:x>=c&&p>=x&&w>=d&&h>=w?!0:m>=c&&p>=m&&w>=d&&h>=w?!0:v>=m&&x>=v&&f>=b&&w>=f?!0:g>=m&&x>=g&&f>=b&&w>=f?!0:g>=m&&x>=g&&y>=b&&w>=y?!0:v>=m&&x>=v&&y>=b&&w>=y?!0:m>=v&&g>=m&&b>=f&&y>=b?!0:x>=v&&g>=x&&b>=f&&y>=b?!0:x>=v&&g>=x&&w>=f&&y>=w?!0:m>=v&&g>=m&&w>=f&&y>=w?!0:this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,v+l,d+l)?!0:this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,g-l,d+l)?!0:this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,g-l,h-l)?!0:this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,v+l,h-l)?!0:!1},e.math.checkInBoundingCircle=function(e,t,i,r,n,a,o,s){return e=(e-o)/(n+r),t=(t-s)/(a+r),i>=e*e+t*t},e.math.boxInBezierVicinity=function(e,t,i,r,n,a,o,s,l,u,c){var d=.25*n+.5*o+.25*l,p=.25*a+.5*s+.25*u,h=Math.min(e,i)-c,v=Math.min(t,r)-c,f=Math.max(e,i)+c,g=Math.max(t,r)+c;if(n>=h&&f>=n&&a>=v&&g>=a)return 1;if(l>=h&&f>=l&&u>=v&&g>=u)return 1;if(d>=h&&f>=d&&p>=v&&g>=p)return 1;if(o>=h&&f>=o&&s>=v&&g>=s)return 1;var y=Math.min(n,d,l),m=Math.min(a,p,u),x=Math.max(n,d,l),b=Math.max(a,p,u);return y>f||h>x||m>g||v>b?0:1},e.math.checkBezierInBox=function(t,i,r,n,a,o,s,l,u,c){function d(d){var p=e.math.qbezierAt(a,s,u,d),h=e.math.qbezierAt(o,l,c,d);return p>=t&&r>=p&&h>=i&&n>=h}for(var p=0;1>=p;p+=.25)if(!d(p))return!1;return!0},e.math.checkStraightEdgeInBox=function(e,t,i,r,n,a,o,s){return n>=e&&i>=n&&o>=e&&i>=o&&a>=t&&r>=a&&s>=t&&r>=s},e.math.checkStraightEdgeCrossesBox=function(e,t,i,r,n,a,o,s,l){var u,c,d=Math.min(e,i)-l,p=Math.min(t,r)-l,h=Math.max(e,i)+l,v=Math.max(t,r)+l,f=o-n,g=n,y=s-a,m=a;if(Math.abs(f)<1e-4)return n>=d&&h>=n&&Math.min(a,s)<=p&&Math.max(a,s)>=v;var x=(d-g)/f;if(x>0&&1>=x&&(u=y*x+m,u>=p&&v>=u))return!0;var b=(h-g)/f;if(b>0&&1>=b&&(u=y*b+m,u>=p&&v>=u))return!0;var w=(p-m)/y;if(w>0&&1>=w&&(c=f*w+g,c>=d&&h>=c))return!0;var _=(v-m)/y;return _>0&&1>=_&&(c=f*_+g,c>=d&&h>=c)?!0:!1},e.math.checkBezierCrossesBox=function(e,t,i,r,n,a,o,s,l,u,c){var d=Math.min(e,i)-c,p=Math.min(t,r)-c,h=Math.max(e,i)+c,v=Math.max(t,r)+c;if(n>=d&&h>=n&&a>=p&&v>=a)return!0;if(l>=d&&h>=l&&u>=p&&v>=u)return!0;var f=n-2*o+l,g=-2*n+2*o,y=n,m=[];if(Math.abs(f)<1e-4){var x=(d-n)/g,b=(h-n)/g;m.push(x,b)}else{var w,_,E=g*g-4*f*(y-d);if(E>0){var S=Math.sqrt(E);w=(-g+S)/(2*f),_=(-g-S)/(2*f),m.push(w,_)}var P,D,k=g*g-4*f*(y-h);if(k>0){var S=Math.sqrt(k);P=(-g+S)/(2*f),D=(-g-S)/(2*f),m.push(P,D)}}m.sort(function(e,t){return e-t});var C=a-2*s+u,T=-2*a+2*s,N=a,M=[];if(Math.abs(C)<1e-4){var B=(p-a)/T,z=(v-a)/T;M.push(B,z)}else{var I,L,O=T*T-4*C*(N-p);if(O>0){var S=Math.sqrt(O);I=(-T+S)/(2*C),L=(-T-S)/(2*C),M.push(I,L)}var R,X,V=T*T-4*C*(N-v);if(V>0){var S=Math.sqrt(V);R=(-T+S)/(2*C),X=(-T-S)/(2*C),M.push(R,X)}}M.sort(function(e,t){return e-t});for(var Y=0;Y=0&&m[Y]<=1&&m[Y+1]>M[A-1]&&M[A-1]<=1&&m[Y+1]>=0)return!0;return!1},e.math.inLineVicinity=function(e,t,i,r,n,a,o){var s=o,l=Math.min(i,n),u=Math.max(i,n),c=Math.min(r,a),d=Math.max(r,a);return e>=l-s&&u+s>=e&&t>=c-s&&d+s>=t},e.math.inBezierVicinity=function(e,t,i,r,n,a,o,s){var l={x1:Math.min(i,o,n),x2:Math.max(i,o,n),y1:Math.min(r,s,a),y2:Math.max(r,s,a)};return el.x2||tl.y2?!1:!0},e.math.solveCubic=function(e,t,i,r,n){t/=e,i/=e,r/=e;var a,o,s,l,u,c,d,p;return o=(3*i-t*t)/9,s=-(27*r)+t*(9*i-2*t*t),s/=54,a=o*o*o+s*s,n[1]=0,d=t/3,a>0?(u=s+Math.sqrt(a),u=0>u?-Math.pow(-u,1/3):Math.pow(u,1/3),c=s-Math.sqrt(a),c=0>c?-Math.pow(-c,1/3):Math.pow(c,1/3),n[0]=-d+u+c,d+=(u+c)/2,n[4]=n[2]=-d,d=Math.sqrt(3)*(-c+u)/2,n[3]=d,void(n[5]=-d)):(n[5]=n[3]=0,0===a?(p=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3),n[0]=-d+2*p,void(n[4]=n[2]=-(p+d))):(o=-o,l=o*o*o,l=Math.acos(s/Math.sqrt(l)),p=2*Math.sqrt(o),n[0]=-d+p*Math.cos(l/3),n[2]=-d+p*Math.cos((l+2*Math.PI)/3),void(n[4]=-d+p*Math.cos((l+4*Math.PI)/3))))},e.math.sqDistanceToQuadraticBezier=function(e,t,i,r,n,a,o,s){var l=1*i*i-4*i*n+2*i*o+4*n*n-4*n*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,u=9*i*n-3*i*i-3*i*o-6*n*n+3*n*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,c=3*i*i-6*i*n+i*o-i*e+2*n*n+2*n*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,d=1*i*n-i*i+i*e-n*e+r*a-r*r+r*t-a*t,p=[];this.solveCubic(l,u,c,d,p);for(var h=1e-7,v=[],f=0;6>f;f+=2)Math.abs(p[f+1])=0&&p[f]<=1&&v.push(p[f]);v.push(1),v.push(0);for(var g,y,m,x,b=-1,w=0;w=0?b>x&&(b=x,g=v[w]):(b=x,g=v[w]);return b},e.math.sqDistanceToFiniteLine=function(e,t,i,r,n,a){var o=[e-i,t-r],s=[n-i,a-r],l=s[0]*s[0]+s[1]*s[1],u=o[0]*o[0]+o[1]*o[1],c=o[0]*s[0]+o[1]*s[1],d=c*c/l;return 0>c?u:d>l?(e-n)*(e-n)+(t-a)*(t-a):u-d},e.math.pointInsidePolygon=function(e,t,i,r,n,a,o,s,l){var u=new Array(i.length),c=Math.asin(s[1]/Math.sqrt(s[0]*s[0]+s[1]*s[1]));s[0]<0?c+=Math.PI/2:c=-c-Math.PI/2;for(var d=Math.cos(-c),p=Math.sin(-c),h=0;h0){var f=this.expandPolygon(u,-l);v=this.joinLines(f)}else v=u;for(var g,y,m,x,b,w=0,_=0,h=0;h=e&&e>=m||e>=g&&m>=e))continue;b=(e-g)/(m-g)*(x-y)+y,b>t&&w++,t>b&&_++}return w%2===0?!1:!0},e.math.joinLines=function(e){for(var t,i,r,n,a,o,s,l,u=new Array(e.length/2),c=0;cu)return[];var c=u/l;return[(i-e)*c+e,(r-t)*c+t]},e.math.dotProduct=function(e,t){if(2!=e.length||2!=t.length)throw"dot product: arguments are not vectors";return e[0]*t[0]+e[1]*t[1]},e.math.intersectLineCircle=function(e,t,i,r,n,a,o){var s=[i-e,r-t],l=[n,a],u=[e-n,t-a],c=s[0]*s[0]+s[1]*s[1],d=2*(u[0]*s[0]+u[1]*s[1]),l=u[0]*u[0]+u[1]*u[1]-o*o,p=d*d-4*c*l;if(0>p)return[];var h=(-d+Math.sqrt(p))/(2*c),v=(-d-Math.sqrt(p))/(2*c),f=Math.min(h,v),g=Math.max(h,v),y=[];if(f>=0&&1>=f&&y.push(f),g>=0&&1>=g&&y.push(g),0===y.length)return[];var m=y[0]*s[0]+e,x=y[0]*s[1]+t;if(y.length>1){if(y[0]==y[1])return[m,x];var b=y[1]*s[0]+e,w=y[1]*s[1]+t;return[m,x,b,w]}return[m,x]},e.math.findCircleNearPoint=function(e,t,i,r,n){var a=r-e,o=n-t,s=Math.sqrt(a*a+o*o),l=a/s,u=o/s;return[e+l*i,t+u*i]},e.math.findMaxSqDistanceToOrigin=function(e){for(var t,i=1e-6,r=0;ri&&(i=t);return i},e.math.finiteLinesIntersect=function(e,t,i,r,n,a,o,s,l){var u=(o-n)*(t-a)-(s-a)*(e-n),c=(i-e)*(t-a)-(r-t)*(e-n),d=(s-a)*(i-e)-(o-n)*(r-t);if(0!==d){var p=u/d,h=c/d;return p>=0&&1>=p&&h>=0&&1>=h?[e+p*(i-e),t+p*(r-t)]:l?[e+p*(i-e),t+p*(r-t)]:[]}return 0===u||0===c?[e,i,o].sort()[1]===o?[o,s]:[e,i,n].sort()[1]===n?[n,a]:[n,o,i].sort()[1]===i?[i,r]:[]:[]},e.math.boxIntersectEllipse=function(e,t,i,r,n,a,o,s,l){if(e>i){var u=e;e=i,i=u}if(t>r){var c=t;t=r,r=c}var d=[s-a/2-n,l],p=[s+a/2+n,l],h=[s,l-o/2-n],v=[s,l+o/2+n];return ip[0]?!1:t>v[1]?!1:r=e*e+t*t?!0:1>=i*i+t*t?!0:1>=i*i+r*r?!0:1>=e*e+r*r?!0:!1)},e.math.boxIntersectPolygon=function(t,i,r,n,a,o,s,l,u,c,d){if(t>r){var p=t;t=r,r=p}if(i>n){var h=i;i=n,n=h}var v=new Array(a.length),f=Math.asin(c[1]/Math.sqrt(c[0]*c[0]+c[1]*c[1]));c[0]<0?f+=Math.PI/2:f=-f-Math.PI/2;for(var g=Math.cos(-f),y=Math.sin(-f),m=0;mb&&(b=v[2*m]),v[2*m]_&&(_=v[2*m+1]),v[2*m+1]r)return!1;if(t>b+d)return!1;if(w-d>n)return!1;if(i>_+d)return!1;var E;if(d>0){var S=e.math.expandPolygon(v,-d);E=e.math.joinLines(S)}else E=v;for(var m=0;m0)return!0;if(e.math.finiteLinesIntersect(k,C,P,D,t,n,r,n,!1).length>0)return!0;if(e.math.finiteLinesIntersect(k,C,P,D,t,i,t,n,!1).length>0)return!0;if(e.math.finiteLinesIntersect(k,C,P,D,r,i,r,n,!1).length>0)return!0}return!1},e.math.polygonIntersectLine=function(t,i,r,n,a,o,s,l){for(var u,c=[],d=new Array(r.length),p=0;p0){var v=e.math.expandPolygon(d,-l);h=e.math.joinLines(v)}else h=d;for(var f,g,y,m,p=0;pa&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},e.math.generateUnitNgonPointsFitToSquare=function(t,i){var r=e.math.generateUnitNgonPoints(t,i);return r=e.math.fitPolygonToSquare(r)},e.math.fitPolygonToSquare=function(e){for(var t,i,r=e.length/2,n=1/0,a=1/0,o=-1/0,s=-1/0,l=0;r>l;l++)t=e[2*l],i=e[2*l+1],n=Math.min(n,t),o=Math.max(o,t),a=Math.min(a,i),s=Math.max(s,i);for(var u=2/(o-n),c=2/(s-a),l=0;r>l;l++)t=e[2*l]=e[2*l]*u,i=e[2*l+1]=e[2*l+1]*c,n=Math.min(n,t),o=Math.max(o,t),a=Math.min(a,i),s=Math.max(s,i);if(-1>a)for(var l=0;r>l;l++)i=e[2*l+1]=e[2*l+1]+(-1-a);return e},e.math.generateUnitNgonPoints=function(e,t){var i=1/e*2*Math.PI,r=e%2===0?Math.PI/2+i/2:Math.PI/2;r+=t;for(var n,a,o,s=new Array(2*e),l=0;e>l;l++)n=l*i+r,a=s[2*l]=Math.cos(n),o=s[2*l+1]=Math.sin(-n);return s},e.math.getRoundRectangleRadius=function(e,t){return Math.min(e/4,t/4,8)}}(cytoscape),function(e){"use strict";function t(t,i,r){var n={};switch(n[i]=r,t){case"core":case"collection":e.fn[t](n)}if("layout"===t){for(var o=r.prototype,s=["stop"],l=0;ld;d++)n.canSet(s[d])&&(s[d]._private[n.field][i]=r);n.updateStyle&&a.updateStyle(),n.onSet(a),n.settingTriggersEvent&&a[n.triggerFnName](n.settingEvent)}}}else if(n.allowSetting&&e.is.plainObject(i)){var h,v,f=i;for(h in f){v=f[h];var c=!n.immutableKeys[h];if(c)for(var d=0,p=s.length;p>d;d++)n.canSet(s[d])&&(s[d]._private[n.field][h]=v)}n.updateStyle&&a.updateStyle(),n.onSet(a),n.settingTriggersEvent&&a[n.triggerFnName](n.settingEvent)}else if(n.allowBinding&&e.is.fn(i)){var g=i;a.bind(n.bindingEvent,g)}else if(n.allowGetting&&void 0===i){var u;return l&&(u=l._private[n.field]),u}return a}},removeData:function(t){var i={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return t=e.util.extend({},i,t),function(i){var r=t,n=this,a=void 0!==n.length,o=a?n:[n];if(e.is.string(i)){for(var s=i.split(/\s+/),l=s.length,u=0;l>u;u++){var c=s[u];if(!e.is.emptyString(c)){var d=!r.immutableKeys[c];if(d)for(var p=0,h=o.length;h>p;p++)o[p]._private[r.field][c]=void 0}}r.triggerEvent&&n[r.triggerFnName](r.event)}else if(void 0===i){for(var p=0,h=o.length;h>p;p++){var v=o[p]._private[r.field];for(var c in v){var f=!r.immutableKeys[c];f&&(v[c]=void 0)}}r.triggerEvent&&n[r.triggerFnName](r.event)}return n}},event:{regex:/(\w+)(\.\w+)?/,optionalTypeRegex:/(\w+)?(\.\w+)?/,falseCallback:function(){return!1}},on:function(t){var i={unbindSelfOnTrigger:!1,unbindAllBindersOnTrigger:!1};return t=e.util.extend({},i,t),function(i,r,n,a){var o=this,s=void 0!==o.length,l=s?o:[o],u=e.is.string(i),c=t;if(e.is.plainObject(r)?(a=n,n=r,r=void 0):(e.is.fn(r)||r===!1)&&(a=r,n=void 0,r=void 0),(e.is.fn(n)||n===!1)&&(a=n,n=void 0),!e.is.fn(a)&&a!==!1&&u)return o;if(u){var d={};d[i]=a,i=d}for(var p in i)if(a=i[p],a===!1&&(a=e.define.event.falseCallback),e.is.fn(a)){p=p.split(/\s+/);for(var h=0;h0:void 0}},clearQueue:function(t){var i={};return t=e.util.extend({},i,t),function(){var e=this,t=void 0!==e.length,i=t?e:[e],r=this._private.cy||this;if(!r.styleEnabled())return this;for(var n=0;n\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])+"|'+"'(?:\\\\'|[^'])+'",number:e.util.regex.number,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$"};s.variable="(?:[\\w-]|(?:\\\\"+s.metaChar+"))+",s.value=s.string+"|"+s.number,s.className=s.variable,s.id=s.variable;for(var l=function(e){return e.replace(new RegExp("\\\\("+s.metaChar+")","g"),function(e,t){return t})},u=s.comparatorOp.split("|"),c=0;c=0||"="!==d&&(s.comparatorOp+="|\\!"+d)}var p={group:{query:!0,regex:"(node|edge|\\*)",populate:function(e){this.group="*"==e?e:e+"s"}},state:{query:!0,regex:"(:selected|:unselected|:locked|:unlocked|:visible|:hidden|:transparent|:grabbed|:free|:removed|:inside|:grabbable|:ungrabbable|:animated|:unanimated|:selectable|:unselectable|:orphan|:nonorphan|:parent|:child|:loop|:simple|:active|:inactive|:touch)",populate:function(e){this.colonSelectors.push(e)}},id:{query:!0,regex:"\\#("+s.id+")",populate:function(e){this.ids.push(l(e))}},className:{query:!0,regex:"\\.("+s.className+")",populate:function(e){this.classes.push(l(e))}},dataExists:{query:!0,regex:"\\[\\s*("+s.variable+")\\s*\\]",populate:function(e){this.data.push({field:l(e)})}},dataCompare:{query:!0,regex:"\\[\\s*("+s.variable+")\\s*("+s.comparatorOp+")\\s*("+s.value+")\\s*\\]",populate:function(e,t,i){var r=null!=new RegExp("^"+s.string+"$").exec(i);i=r?i.substring(1,i.length-1):parseFloat(i),this.data.push({field:l(e),operator:t,value:i})}},dataBool:{query:!0,regex:"\\[\\s*("+s.boolOp+")\\s*("+s.variable+")\\s*\\]",populate:function(e,t){this.data.push({field:l(t),operator:e})}},metaCompare:{query:!0,regex:"\\[\\[\\s*("+s.meta+")\\s*("+s.comparatorOp+")\\s*("+s.number+")\\s*\\]\\]",populate:function(e,t,i){this.meta.push({field:l(e),operator:t,value:parseFloat(i)})}},nextQuery:{separator:!0,regex:s.separator,populate:function(){r[++c]=o(),a=null}},child:{separator:!0,regex:s.child,populate:function(){var e=o();e.parent=this,e.subject=a,r[c]=e}},descendant:{separator:!0,regex:s.descendant,populate:function(){var e=o();e.ancestor=this,e.subject=a,r[c]=e}},subject:{modifier:!0,regex:s.subject,populate:function(){return null!=a&&this.subject!=this?(e.util.error("Redefinition of subject in selector `"+i+"`"),!1):(a=this,void(this.subject=this))}}},h=0;for(var v in p)p[h]=p[v],p[h].name=v,h++;p.length=h,r._private.selectorText=i;var f=i,c=0,g=function(t){for(var i,r,n,a=0;a=0&&(d=d.toLowerCase(),p=p.toLowerCase(),s=s.replace("@",""),h=!0);var v=!1,f=!1;switch(s.indexOf("!")>=0&&(s=s.replace("!",""),v=!0),h&&(l=p.toLowerCase(),c=d.toLowerCase()),s){case"*=":a=d.search(p)>=0;break;case"$=":a=null!=new RegExp(p+"$").exec(d);break;case"^=":a=null!=new RegExp("^"+p).exec(d);break;case"=":a=c===l;break;case"!=":a=c!==l;break;case">":a=v?l>=c:c>l,f=!0;break;case">=":a=v?l>c:c>=l,f=!0;break;case"<":a=v?c>=l:l>c,f=!0;break;case"<=":a=v?c>l:l>=c,f=!0;break;default:a=!1}}else if(null!=s)switch(s){case"?":a=t.fieldTruthy(u);break;case"!":a=!t.fieldTruthy(u);break;case"^":a=t.fieldUndefined(u)}else a=!t.fieldUndefined(u);if(v&&!f&&(a=!a,f=!0),!a){r=!1;break}}return r},v=h({name:"data",fieldValue:function(e){return r._private.data[e]},fieldRef:function(e){return"element._private.data."+e},fieldUndefined:function(e){return void 0===r._private.data[e]},fieldTruthy:function(e){return r._private.data[e]?!0:!1}});if(!v)return!1;var f=h({name:"meta",fieldValue:function(e){return r[e]()},fieldRef:function(e){return"element."+e+"()"},fieldUndefined:function(e){return null==r[e]()},fieldTruthy:function(e){return r[e]()?!0:!1}});if(!f)return!1;if(null!=i.collection){var g=null!=i.collection._private.ids[r.id()];if(!g)return!1}if(null!=i.filter&&0===r.collection().filter(i.filter).size())return!1;var y=function(e,i){if(null!=e){var r=!1;if(!n.hasCompoundNodes())return!1;i=i();for(var a=0;a "+t),null!=e.ancestor&&(t=r(e.ancestor)+" "+t),null!=e.child&&(t+=" > "+r(e.child)),null!=e.descendant&&(t+=" "+r(e.descendant)),t},n=0;n1&&n node").css({width:"auto",height:"auto",shape:"rectangle","background-opacity":.5,"padding-top":10,"padding-right":10,"padding-left":10,"padding-bottom":10}).selector("edge").css({width:1}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}).selector("core").css({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":e.is.touch()?40:15,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125}),this.defaultLength=this.length},e.styfn.clear=function(){for(var e=0;el.max)return null;var P={name:t,value:i,strValue:""+i+(x?x:""),units:x,bypass:r,hasPie:t.match(/pie-(\d+)-background-size/)&&null!=i&&0!==i&&""!==i};return l.unitless||"px"!==x&&"em"!==x||(P.pxValue="px"!==x&&x?this.getEmSizeInPixels()*i:i),("ms"===x||"s"===x)&&(P.msValue="ms"===x?i:1e3*i),P}if(l.propList){var D=[],k=""+i;if("none"===k);else{for(var C=k.split(","),E=0;E0;if(p||h){var v;p&&h?v=u.properties:p?v=u.properties:h&&(v=u.mappedProperties);for(var f=0;f0){a=!0;break}}i.hasPie=a;var l=n["text-transform"].strValue,u=n.content.strValue,c=n["font-style"].strValue,s=n["font-size"].pxValue+"px",d=n["font-family"].strValue,p=n["font-weight"].strValue,h=n["text-valign"].strValue,v=n["text-valign"].strValue,f=n["text-outline-width"].pxValue;i.labelKey=c+"$"+s+"$"+d+"$"+p+"$"+u+"$"+l+"$"+h+"$"+v+"$"+f,i.fontKey=c+"$"+p+"$"+s+"$"+d;var g=n.width.pxValue,y=n.height.pxValue,m=n["border-width"].pxValue;if(i.boundingBoxKey=g+"$"+y+"$"+m,"edges"===t._private.group){var x=n["control-point-step-size"].pxValue,b=n["control-point-distance"]?n["control-point-distance"].pxValue:void 0,w=n["control-point-weight"].value,_=n["curve-style"].strValue;i.boundingBoxKey+="$"+x+"$"+b+"$"+w+"$"+_}i.styleKey=Date.now()},e.styfn.applyParsedProperty=function(t,i){var r,n,a=i,o=t._private.style,s=e.style.properties[a.name].type,l=a.bypass,u=o[a.name],c=u&&u.bypass;if(("height"===i.name||"width"===i.name)&&"auto"===i.value&&t.isNode()&&!t.isParent())return!1;if(l&&a.deleteBypass){var d=o[a.name];return d?d.bypass&&d.bypassed?(o[a.name]=d.bypassed,!0):!1:!0}var p=function(){e.util.error("Do not assign mappings to elements without corresponding data (e.g. ele `"+t.id()+"` for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case e.style.types.mapData:case e.style.types.mapLayoutData:for(var h=a.mapped===e.style.types.mapLayoutData,v=a.field.split("."),r=h?t._private.layoutData:t._private.data,f=0;fy?y=0:y>1&&(y=1),s.color){var m=a.valueMin[0],x=a.valueMax[0],b=a.valueMin[1],w=a.valueMax[1],_=a.valueMin[2],E=a.valueMax[2],S=null==a.valueMin[3]?1:a.valueMin[3],P=null==a.valueMax[3]?1:a.valueMax[3],D=[Math.round(m+(x-m)*y),Math.round(b+(w-b)*y),Math.round(_+(E-_)*y),Math.round(S+(P-S)*y)];n={bypass:a.bypass,name:a.name,value:D,strValue:"rgb("+D[0]+", "+D[1]+", "+D[2]+")"}}else{if(!s.number)return!1;var k=a.valueMin+(a.valueMax-a.valueMin)*y;n=this.parse(a.name,k,a.bypass,!0)}n||(n=this.parse(a.name,u.strValue,a.bypass,!0)),n||p(),n.mapping=a,a=n;break;case e.style.types.data:case e.style.types.layoutData:for(var h=a.mapped===e.style.types.layoutData,v=a.field.split("."),r=h?t._private.layoutData:t._private.data,f=0;f0&&s>0){for(var c=!1,d=0;d0&&t.delay(l),t.animate({css:u},{duration:s,queue:!1,complete:function(){r||n.removeBypasses(t,o),t._private.transitioning=!1}})}else t._private.transitioning&&(t.stop(),this.removeBypasses(t,o),t._private.transitioning=!1)}}(cytoscape),function(e){"use strict";e.styfn.applyBypass=function(t,i,r,n){var a=[],o=!0;if("*"===i||"**"===i){if(void 0!==r)for(var s=0;sa.length?l.substr(a.length):""}function n(){o=o.length>s.length?o.substr(s.length):""}var a,o,s,l=""+i;for(l=l.replace(/[/][*](\s|.)+?[*][/]/g,"");;){var u=l.match(/^\s*$/);if(u)break;var c=l.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){e.util.error("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+l);break}a=c[0];var d=c[1];if("core"!==d){var p=new e.Selector(d);if(p._private.invalid){e.util.error("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),r();continue}}var h=c[2],v=!1;o=h;for(var f=[];;){var u=o.match(/^\s*$/);if(u)break;var g=o.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!g){e.util.error("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),v=!0;break}s=g[0];var y=g[1],m=g[2],x=e.style.properties[y];if(x){var b=t.parse(y,m);b?(f.push({name:y,val:m}),n()):(e.util.error("Skipping property: Invalid property definition in: "+s),n())}else e.util.error("Skipping property: Invalid property name in: "+s),n()}if(v){r();break}t.selector(d);for(var w=0;w0?c.wheelSensitivity:1,motionBlur:c.motionBlur,pixelRatio:e.is.number(c.pixelRatio)&&c.pixelRatio>0?c.pixelRatio:"auto"===c.pixelRatio?void 0:1,tapThreshold:d(e.is.touch()?8:4,e.is.touch()?c.touchTapThreshold:c.desktopTapThreshold)},c.renderer)),c.initrender&&(a.on("initrender",c.initrender),a.on("initrender",function(){a._private.initrender=!0})),a.load(c.elements,function(){a.startAnimationLoop(),a._private.ready=!0,e.is.fn(c.ready)&&a.on("ready",c.ready);for(var t=0;t0;)r.shift()();i.deferredTimeout=null},0))}})}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";function i(e){var t=!document||"interactive"!==document.readyState&&"complete"!==document.readyState?i:e;setTimeout(t,9,e)}e.fn.core({add:function(t){var i,r=this;if(e.is.elementOrCollection(t)){var n=t;if(n._private.cy===r)i=n.restore();else{for(var a=[],o=0;oo;o++){var d=u[o],p=l[d];if(e.is.array(p))for(var h=0,v=p.length;v>h;h++){var f=p[h];f.group=d,a.push(f)}}i=new e.Collection(r,a)}else{var f=t;i=new e.Element(r,f).collection()}return i},remove:function(t){if(e.is.elementOrCollection(t))t=t;else if(e.is.string(t)){var i=t;t=this.$(i)}return t.remove()},load:function(r,n,a){function o(){s.one("layoutready",function(e){s.notifications(!0),s.trigger(e),s.notify({type:"load",collection:s.elements()}),s.one("load",n),s.trigger("load")}).one("layoutstop",function(){s.one("done",a),s.trigger("done")});var t=e.util.extend({},s._private.options.layout);t.eles=s.$(),s.layout(t)}var s=this;s.notifications(!1);var l=s.elements();return l.length>0&&l.remove(),null!=r&&(e.is.plainObject(r)||e.is.array(r))&&s.add(r),t?i(o):o(),this}})}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";e.fn.core({animated:e.define.animated(),clearQueue:e.define.clearQueue(),delay:e.define.delay(),animate:e.define.animate(),stop:e.define.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},startAnimationLoop:function(){function i(){e.util.requestAnimationFrame(function(e){r(e),i()})}function r(t){function i(i,r){var s=i._private.animation.current,l=i._private.animation.queue,u=!1;if(0===s.length){var c=l.length>0?l.shift():null;c&&(c.callTime=t,s.push(c))}for(var d=[],p=s.length-1;p>=0;p--){var h=s[p];h.started||n(i,h),a(i,h,t,r),h.done&&(d.push(h),s.splice(p,1)),u=!0}for(var p=0;p0||c){var d;if(r.length>0){var p=r.updateCompoundBounds();d=p.length>0?r.add(p):r}l.notify({type:"draw",collection:d})}r.unmerge(o)}function n(t,i){var r=e.is.core(t),n=!r,a=t,o=l._private.style;if(n)var s=a._private.position,u={x:s.x,y:s.y},c=o.getValueStyle(a);if(r)var d=l._private.pan,p={x:d.x,y:d.y},h=l._private.zoom;i.started=!0,i.startTime=Date.now(),i.startPosition=u,i.startStyle=c,i.startPan=p,i.startZoom=h}function a(t,i,r,n){var a,u=l._private.style,c=i.properties,d=i.params,p=i.startTime,h=!n;if(a=0===i.duration?1:Math.min(1,(r-p)/i.duration),0>a?a=0:a>1&&(a=1),null==c.delay){var v=i.startPosition,f=c.position,g=t._private.position;f&&h&&(o(v.x,f.x)&&(g.x=s(v.x,f.x,a)),o(v.y,f.y)&&(g.y=s(v.y,f.y,a)));var y=i.startPan,m=c.pan,x=t._private.pan,b=null!=m&&n;b&&(o(y.x,m.x)&&(x.x=s(y.x,m.x,a)),o(y.y,m.y)&&(x.y=s(y.y,m.y,a)),t.trigger("pan"));var w=i.startZoom,_=c.zoom,E=null!=_&&n;if(E&&(o(w,_)&&(t._private.zoom=s(w,_,a)),t.trigger("zoom")),(b||E)&&t.trigger("viewport"),c.css&&h)for(var S=c.css,P=0;P=1&&(i.done=!0),a}function o(t,i){return null==t||null==i?!1:e.is.number(t)&&e.is.number(i)?!0:t&&i?!0:!1}function s(t,i,r){0>r?r=0:r>1&&(r=1);var n,a;if(n=null!=t.pxValue||null!=t.value?null!=t.pxValue?t.pxValue:t.value:t,a=null!=i.pxValue||null!=i.value?null!=i.pxValue?i.pxValue:i.value:i,e.is.number(n)&&e.is.number(a))return n+(a-n)*r;if(e.is.number(n[0])&&e.is.number(a[0])){var o=n,s=a,l=function(e,t){var i=t-e,n=e;return Math.round(r*i+n)},u=l(o[0],s[0]),c=l(o[1],s[1]),d=l(o[2],s[2]);return[u,c,d]}return void 0}var l=this;l.styleEnabled()&&t&&i()}})}(cytoscape,"undefined"==typeof window?null:window),function(e){"use strict";e.fn.core({data:e.define.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0}),removeData:e.define.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0}),scratch:e.define.data({field:"scratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeScratch:e.define.removeData({field:"scratch",triggerEvent:!1})})}(cytoscape),function(e){"use strict";e.fn.core({on:e.define.on(),one:e.define.on({unbindSelfOnTrigger:!0}),once:e.define.on({unbindAllBindersOnTrigger:!0}),off:e.define.off(),trigger:e.define.trigger()}),e.corefn.bind=e.corefn.on,e.corefn.unbind=e.corefn.off}(cytoscape),function(e){"use strict";e.fn.core({png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)}})}(cytoscape),function(e){"use strict";e.fn.core({layout:function(t){var i;return null==t&&(t=e.util.extend({},this._private.options.layout),t.eles=this.$()),i=this.initLayout(t),i.run(),this},makeLayout:function(e){return this.initLayout(e)},initLayout:function(t){if(null==t)return void e.util.error("Layout options must be specified to make a layout");if(null==t.name)return void e.util.error("A `name` must be specified to make a layout");var i=t.name,r=e.extension("layout",i);if(null==r)return void e.util.error("Can not apply layout: No such layout `"+i+"` found; did you include its JS file?");t.eles=null!=t.eles?t.eles:this.$(),e.is.string(t.eles)&&(t.eles=this.$(t.eles));var n=new r(e.util.extend({},t,{cy:this}));return e.is.plainObject(n._private)||(n._private={}),n._private.cy=this,n._private.listeners=[],n}})}(cytoscape),function(e){"use strict";e.fn.core({notify:function(e){if(this._private.batchingNotify){var t=this._private.batchNotifyEles,i=this._private.batchNotifyTypes;if(e.collection)for(var r=0;r0&&l>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){o=Math.min((s-2*i)/r.w,(l-2*i)/r.h),o=o>this._private.maxZoom?this._private.maxZoom:o,o=othis._private.maxZoom?this._private.maxZoom:r,r=ri.maxZoom||!i.zoomingEnabled?o=!0:(i.zoom=l,a.push("zoom"))}if(n&&(!o||!t.cancelOnFailedZoom)&&i.panningEnabled){var u=t.pan;e.is.number(u.x)&&(i.pan.x=u.x,s=!1),e.is.number(u.y)&&(i.pan.y=u.y,s=!1),s||a.push("pan")}return a.length>0&&(a.push("viewport"),this.trigger(a.join(" ")),this.notify({type:"viewport"})),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.trigger("pan viewport"),this.notify({type:"viewport"})),this},getCenterPan:function(t,i){if(this._private.panningEnabled){if(e.is.string(t)){var r=t;t=this.elements(r)}else e.is.elementOrCollection(t)||(t=this.elements());var n=t.boundingBox(),a=this.width(),o=this.height();i=void 0===i?this._private.zoom:i;var s={x:(a-i*(n.x1+n.x2))/2,y:(o-i*(n.y1+n.y2))/2};return s}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},width:function(){var e=this._private.container;return e?e.clientWidth:1},height:function(){var e=this._private.container;return e?e.clientHeight:1},extent:function(){var e=this._private.pan,t=this._private.zoom,i=this.renderedExtent(),r={x1:(i.x1-e.x)/t,x2:(i.x2-e.x)/t,y1:(i.y1-e.y)/t,y2:(i.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}}}),e.corefn.centre=e.corefn.center,e.corefn.autolockNodes=e.corefn.autolock,e.corefn.autoungrabifyNodes=e.corefn.autoungrabify}(cytoscape),function(e){"use strict";e.fn.collection=e.fn.eles=function(t){for(var i in t){var r=t[i];e.Collection.prototype[i]=r}};var t={prefix:{nodes:"n",edges:"e"},id:{nodes:0,edges:0},generate:function(t,i,r){var n=e.is.element(i)?i._private:i,a=n.group,o=null!=r?r:this.prefix[a]+this.id[a];if(t.getElementById(o).empty())this.id[a]++;else for(;!t.getElementById(o).empty();)o=this.prefix[a]+ ++this.id[a];return o}};e.Element=function(t,i,r){if(!(this instanceof e.Element))return new e.Element(t,i,r);var n=this;if(r=void 0===r||r?!0:!1,void 0===t||void 0===i||!e.is.core(t))return void e.util.error("An element must have a core reference and parameters set");if("nodes"!==i.group&&"edges"!==i.group)return void e.util.error("An element must be of type `nodes` or `edges`; you specified `"+i.group+"`");if(this.length=1,this[0]=this,this._private={cy:t,single:!0,data:i.data||{},layoutData:{},position:i.position||{},autoWidth:void 0,autoHeight:void 0,listeners:[],group:i.group,style:{},rstyle:{},styleCxts:[],removed:!0,selected:i.selected?!0:!1,selectable:void 0===i.selectable?!0:i.selectable?!0:!1,locked:i.locked?!0:!1,grabbed:!1,grabbable:void 0===i.grabbable?!0:i.grabbable?!0:!1,active:!1,classes:{},animation:{current:[],queue:[]},rscratch:{},scratch:{},edges:[],children:[]},i.renderedPosition){var a=i.renderedPosition,o=t.pan(),s=t.zoom();this._private.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}if(e.is.string(i.classes))for(var l=i.classes.split(/\s+/),u=0,c=l.length;c>u;u++){var d=l[u];d&&""!==d&&(n._private.classes[d]=!0)}i.css&&t.style().applyBypass(this,i.css),(void 0===r||r)&&this.restore()},e.Collection=function(i,r,n){if(!(this instanceof e.Collection))return new e.Collection(i,r);if(void 0===i||!e.is.core(i))return void e.util.error("A collection must have a reference to the core");var a={},o={},s=!1;if(r){if(r.length>0&&e.is.plainObject(r[0])&&!e.is.element(r[0])){s=!0;for(var l=[],u={},c=0,d=r.length;d>c;c++){var p=r[c];null==p.data&&(p.data={});var h=p.data;if(null==h.id)h.id=t.generate(i,p);else if(0!==i.getElementById(h.id).length||u[h.id])continue;var v=new e.Element(i,p,!1);l.push(v),u[h.id]=!0}r=l}}else r=[];this.length=0;for(var c=0,d=r.length;d>c;c++){var f=r[c];if(f){var g=f._private.data.id;(!n||n.unique&&!a[g])&&(a[g]=f,o[g]=this.length,this[this.length]=f,this.length++)}}this._private={cy:i,ids:a,indexes:o},s&&this.restore()},e.elefn=e.elesfn=e.Element.prototype=e.Collection.prototype,e.elesfn.cy=function(){return this._private.cy},e.elesfn.element=function(){return this[0]},e.elesfn.collection=function(){return e.is.collection(this)?this:new e.Collection(this._private.cy,[this])},e.elesfn.unique=function(){return new e.Collection(this._private.cy,this,{unique:!0})},e.elesfn.getElementById=function(t){var i=this._private.cy,r=this._private.ids[t];return r?r:e.Collection(i)},e.elesfn.json=function(){var t=this.element();if(null==t)return void 0;var i=t._private,r=e.util.copy({data:i.data,position:i.position,group:i.group,bypass:i.bypass,removed:i.removed,selected:i.selected,selectable:i.selectable,locked:i.locked,grabbed:i.grabbed,grabbable:i.grabbable,classes:""}),n=[];for(var a in i.classes)i.classes[a]&&n.push(a);for(var o=0;od;d++){var h=r[d];h.isNode()?(s.push(h),u++):(l.push(h),c++)}o=s.concat(l);for(var d=0,p=o.length;p>d;d++){var h=o[d];if(h.removed()){var v=h._private,f=v.data;if(void 0===f.id)f.id=t.generate(a,h);else{if(e.is.emptyString(f.id)||!e.is.string(f.id)){e.util.error("Can not create element with invalid string ID `"+f.id+"`");continue}if(0!==a.getElementById(f.id).length){e.util.error("Can not create second element with ID `"+f.id+"`");continue}}var g=f.id;if(h.isEdge()){for(var y=h,m=["source","target"],x=m.length,b=!1,w=0;x>w;w++){var _=m[w],E=f[_];null==E||""===E?(e.util.error("Can not create edge `"+g+"` with unspecified "+_),b=!0):a.getElementById(E).empty()&&(e.util.error("Can not create edge `"+g+"` with nonexistant "+_+" `"+E+"`"),b=!0)}if(b)continue;var S=a.getElementById(f.source),P=a.getElementById(f.target);S._private.edges.push(y),P._private.edges.push(y),y._private.source=S,y._private.target=P}v.ids={},v.ids[g]=h,v.removed=!1,a.addToPool(h),n.push(h)}}for(var d=0;u>d;d++){var D=o[d],f=D._private.data,k=D._private.data.parent,C=null!=k;if(C){var T=a.getElementById(k);if(T.empty())f.parent=void 0;else{for(var N=!1,M=T;!M.empty();){if(D.same(M)){N=!0,f.parent=void 0;break}M=M.parent()}N||(T[0]._private.children.push(D),D._private.parent=T[0],a._private.hasCompoundNodes=!0)}}}if(n=new e.Collection(a,n),n.length>0){var B=n.add(n.connectedNodes()).add(n.parent());B.updateStyle(i),i?n.rtrigger("add"):n.trigger("add")}return r},e.elesfn.removed=function(){var e=this[0];return e&&e._private.removed},e.elesfn.inside=function(){var e=this[0];return e&&!e._private.removed},e.elesfn.remove=function(t){function i(e){for(var t=e._private.edges,i=0;ip;p++){var v=s[p];n(v)}for(var p=0;p0&&(t&&this.cy().notify({type:"remove",collection:x}),x.trigger("remove"));for(var b={},p=0;p0,a=t.getElementById(r).length>0;if(n||a){var o=this.jsons();this.remove();for(var s=0;s0;if(c){var o=this.jsons(),d=this.descendants(),p=d.merge(d.add(this).connectedEdges());this.remove();for(var s=0;su||!n)&&(o=u,n=l)}return{edge:n,dist:o}};f.size()>0;){var y=f.pop(),m=y.value,x=y.id,b=a.getElementById(x);if(u[x]=m,m===Math.Infinite)break;for(var w=b.neighborhood().intersect(d),h=0;h0)for(r.unshift(i);l[n.id()];){var o=l[n.id()];r.unshift(o.edge),r.unshift(o.node),n=o.node}return new e.Collection(a,r)}}}}),e.elesfn.bfs=e.elesfn.breadthFirstSearch,e.elesfn.dfs=e.elesfn.depthFirstSearch,e.elesfn.stdBfs=e.elesfn.stdBreadthFirstSearch,e.elesfn.stdDfs=e.elesfn.stdDepthFirstSearch}(cytoscape),function(e){"use strict";e.fn.eles({aStar:function(t){t=t||{};var i=function(e,t,r,a){if(e==t)return a.push(n.getElementById(t)),a;if(t in r){var o=r[t],s=h[t];return a.push(n.getElementById(t)),a.push(n.getElementById(s)),i(e,o,r,a)}return void 0},r=function(e,t){if(0===e.length)return void 0;for(var i=0,r=t[e[0]],n=1;na&&(r=a,i=n)}return i};if(null!=t.debug){t.debug}else;var n=this._private.cy;if(null==t||null==t.root)return void 0;var a=e.is.string(t.root)?this.filter(t.root)[0]:t.root[0];if(null==t.goal)return void 0;var o=e.is.string(t.goal)?this.filter(t.goal)[0]:t.goal[0];if(null!=t.heuristic&&e.is.fn(t.heuristic))var s=t.heuristic;else var s=function(){return 0};if(null!=t.weight&&e.is.fn(t.weight))var l=t.weight;else var l=function(){return 1};if(null!=t.directed)var u=t.directed;else var u=!1;var c=[],d=[a.id()],p={},h={},v={},f={};v[a.id()]=0,f[a.id()]=s(a);for(var g=this.edges().stdFilter(function(e){return!e.isLoop()}),y=this.nodes(),m=0;d.length>0;){var x=r(d,f),b=n.getElementById(d[x]);if(m++,b.id()==o.id()){var w=i(a.id(),o.id(),p,[]);return w.reverse(),{found:!0,distance:v[b.id()],path:new e.Collection(n,w),steps:m}}c.push(b.id()),d.splice(x,1);var _=b.connectedEdges();u&&(_=_.stdFilter(function(e){return e.data("source")===b.id()})),_=_.intersect(g);for(var E=0;E<_.length;E++){var S=_[E],P=S.connectedNodes().stdFilter(function(e){return e.id()!==b.id()}).intersect(y);if(-1==c.indexOf(P.id())){var D=v[b.id()]+l.apply(S,[S]);-1!=d.indexOf(P.id())?Du;u++)l[o[u].id()]=u;for(var c=[],u=0;s>u;u++){for(var d=new Array(s),p=0;s>p;p++)d[p]=u==p?0:1/0;c.push(d)}var h=[],v=[],f=function(e){for(var t=0;s>t;t++){for(var i=new Array(s),r=0;s>r;r++)i[r]=void 0;e.push(i)}};f(h),f(v);for(var u=0;um&&(c[g][y]=m,h[g][y]=y,v[g][y]=a[u])}if(!n)for(var u=0;um&&(c[g][y]=m,h[g][y]=y,v[g][y]=a[u])}for(var x=0;s>x;x++)for(var u=0;s>u;u++)for(var p=0;s>p;p++)c[u][x]+c[x][p]u;u++)b.push(o[u].id());var w={distance:function(t,r){if(e.is.string(t))var n=i.filter(t)[0].id();else var n=t.id();if(e.is.string(r))var a=i.filter(r)[0].id();else var a=r.id();return c[l[n]][l[a]]},path:function(t,r){var n=function(e,t,r,n,a){if(e===t)return i.getElementById(n[e]);if(void 0===r[e][t])return void 0;for(var o=[i.getElementById(n[e])],s=e;e!==t;){s=e,e=r[e][t];var l=a[s][e];o.push(l),o.push(i.getElementById(n[e]))}return o};if(e.is.string(t))var a=i.filter(t)[0].id();else var a=t.id();if(e.is.string(r))var o=i.filter(r)[0].id();else var o=r.id();var s=n(l[a],l[o],h,b,v);return new e.Collection(i,s)}};return w},bellmanFord:function(t){t=t||{};if(null!=t.debug){t.debug}else;if(null!=t.weight&&e.is.fn(t.weight))var i=t.weight;else var i=function(){return 1};if(null!=t.directed)var r=t.directed;else var r=!1;if(null==t.root)return void e.util.error("options.root required");if(e.is.string(t.root))var n=this.filter(t.root)[0];else var n=t.root[0];for(var a=this._private.cy,o=this.edges().stdFilter(function(e){return!e.isLoop()}),s=this.nodes(),l=s.length,u={},c=0;l>c;c++)u[s[c].id()]=c;for(var d=[],p=[],h=[],c=0;l>c;c++)d[c]=s[c].id()===n.id()?0:1/0,p[c]=void 0;for(var v=!1,c=1;l>c;c++){v=!1;for(var f=0;fc;c++)b.push(s[c].id());var w={distanceTo:function(t){if(e.is.string(t))var i=a.filter(t)[0].id();else var i=t.id();return d[u[i]]},pathTo:function(t){var i=function(e,t,i,r,n,o){for(;;){if(n.push(a.getElementById(r[i])),n.push(o[i]),t===i)return n;var s=e[i];if("undefined"==typeof s)return void 0;i=s}};if(e.is.string(t))var r=a.filter(t)[0].id();else var r=t.id();var o=[],s=i(p,u[n.id()],u[r],b,o,h);return null!=s&&s.reverse(),new e.Collection(a,s)},hasNegativeWeightCycle:!1};return w},kargerStein:function(t){t=t||{};var i=function(e,t,i){for(var r=i[e],n=r[1],a=r[2],o=t[n],s=t[a],l=i.filter(function(e){return t[e[1]]===o&&t[e[2]]===s?!1:t[e[1]]===s&&t[e[2]]===o?!1:!0}),u=0;u=n)return t;var o=Math.floor(Math.random()*t.length),s=i(o,e,t);return r(e,s,n-1,a)};if(null!=t&&null!=t.debug){t.debug}else;var n=this._private.cy,a=this.edges().stdFilter(function(e){return!e.isLoop()}),o=this.nodes(),s=o.length,l=a.length,u=Math.ceil(Math.pow(Math.log(s)/Math.LN2,2)),c=Math.floor(s/Math.sqrt(2));if(2>s)return void e.util.error("At least 2 nodes are required for KargerSteing algorithm!");for(var d={},p=0;s>p;p++)d[o[p].id()]=p;for(var h=[],p=0;l>p;p++){var v=a[p];h.push([p,d[v.source().id()],d[v.target().id()]])}for(var f,g=1/0,y=[],p=0;s>p;p++)y.push(p);for(var m=0;u>=m;m++){var x=y.slice(0),b=r(x,h,s,c),w=x.slice(0),_=r(x,b,c,2),E=r(w,b,c,2);_.length<=E.length&&_.lengthr;r++)i+=e[r];for(var r=0;t>r;r++)e[r]=e[r]/i};if(null!=t&&null!=t.debug){t.debug}else;if(null!=t&&null!=t.dampingfactor)var r=t.dampingFactor;else var r=.8;if(null!=t&&null!=t.precision)var n=t.precision;else var n=1e-6;if(null!=t&&null!=t.iterations)var a=t.iterations;else var a=200;if(null!=t&&null!=t.weight&&e.is.fn(t.weight))var o=t.weight;else var o=function(){return 1};for(var s=this._private.cy,l=this.edges().stdFilter(function(e){return!e.isLoop()}),u=this.nodes(),c=u.length,d=l.length,p={},h=0;c>h;h++)p[u[h].id()]=h;for(var v=[],f=[],g=(1-r)/c,h=0;c>h;h++){for(var y=[],m=0;c>m;m++)y.push(0);v.push(y),f.push(0)}for(var h=0;d>h;h++){var x=l[h],b=p[x.source().id()],w=p[x.target().id()],_=o.apply(x,[x]);v[w][b]+=_,f[b]+=_}for(var E=1/c+g,m=0;c>m;m++)if(0===f[m])for(var h=0;c>h;h++)v[h][m]=E;else for(var h=0;c>h;h++)v[h][m]=v[h][m]/f[m]+g;for(var S,P=[],D=[],h=0;c>h;h++)P.push(1),D.push(0);for(var k=0;a>k;k++){for(var C=D.slice(0),h=0;c>h;h++)for(var m=0;c>m;m++)C[h]+=v[h][m]*P[m];i(C),S=P,P=C;for(var T=0,h=0;c>h;h++)T+=Math.pow(S[h]-P[h],2);if(n>T)break}var N={rank:function(t){if(e.is.string(t))var i=s.filter(t)[0].id();else var i=t.id();return P[p[i]]}};return N}})}(cytoscape),function(e){"use strict";e.fn.eles({animated:e.define.animated(),clearQueue:e.define.clearQueue(),delay:e.define.delay(),animate:e.define.animate(),stop:e.define.stop()})}(cytoscape),function(e){"use strict";e.fn.eles({classes:function(t){var i,r=this,n=[];if(e.is.fn(t))i=t;else if(!e.is.plainObject(t))return this;for(var a=0;a0&&new e.Collection(this.cy(),n).updateStyle().trigger("class"),this},addClass:function(t){t=t.split(/\s+/);for(var i=this,r=[],n=0;n0&&new e.Collection(this._private.cy,r).updateStyle().trigger("class"),i},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes[e]?!0:!1},toggleClass:function(t,i){for(var r=t.split(/\s+/),n=this,a=[],o=0,s=n.length;s>o;o++)for(var l=n[o],u=0;u0&&new e.Collection(this._private.cy,a).updateStyle().trigger("class"),n},removeClass:function(t){t=t.split(/\s+/);for(var i=this,r=[],n=0;n0&&new e.Collection(i._private.cy,r).updateStyle(),i.trigger("class"),i},flashClass:function(e,t){var i=this;if(null==t)t=250;else if(0===t)return i;return i.addClass(e),setTimeout(function(){i.removeClass(e)},t),i}})}(cytoscape),function(e){"use strict";e.fn.eles({allAre:function(e){return this.filter(e).length===this.length},is:function(e){return this.filter(e).length>0},some:function(e,t){for(var i=0;i0},allAreNeighbors:function(e){return e=this.cy().collection(e),this.neighborhood().intersect(e).length===e.length}})}(cytoscape),function(e){"use strict";e.fn.eles({parent:function(t){for(var i=[],r=this._private.cy,n=0;n0&&i.push(o)}return new e.Collection(r,i,{unique:!0}).filter(t)},parents:function(t){for(var i=[],r=this.parent();r.nonempty();){for(var n=0;n0?this.add(s):this;i?l.trigger("position"):l.rtrigger("position")}return this},silentPositions:function(e){return this.positions(e,!0)},updateCompoundBounds:function(){function t(e){var t=e.children(),i=e._private.style,n=t.boundingBox({includeLabels:!1,includeEdges:!1}),a={top:i["padding-top"].pxValue,bottom:i["padding-bottom"].pxValue,left:i["padding-left"].pxValue,right:i["padding-right"].pxValue},o=e._private.position,s=!1;"auto"===i.width.value&&(e._private.autoWidth=n.w+a.left+a.right,o.x=(n.x1+n.x2-a.left+a.right)/2,s=!0),"auto"===i.height.value&&(e._private.autoHeight=n.h+a.top+a.bottom,o.y=(n.y1+n.y2-a.top+a.bottom)/2,s=!0),s&&r.push(e)}var i=this.cy();if(!i.styleEnabled()||!i.hasCompoundNodes())return i.collection();for(var r=[],n=this.parent();n.nonempty();){for(var a=0;a0,d=c;c&&(u=u[0]);var p=d?u._private.position:{x:0,y:0};return a={x:l.x-p.x,y:l.y-p.y},void 0===t?a:a[t]}for(var h=0;h0,d=c;c&&(u=u[0]);var p=d?u._private.position:{x:0,y:0};void 0!==i?r._private.position[t]=i+p[t]:void 0!==a&&(r._private.position={x:a.x+p.x,y:a.y+p.y})}this.rtrigger("position")}else if(!o)return void 0;return this},width:function(){var e=this[0],t=e._private.cy,i=t._private.styleEnabled;if(e){if(i){var r=e._private.style.width;return"auto"===r.strValue?e._private.autoWidth:r.pxValue}return 1}},outerWidth:function(){var e=this[0],r=e._private.cy,n=r._private.styleEnabled;if(e){if(n){var a=e._private.style,o="auto"===a.width.strValue?e._private.autoWidth:a.width.pxValue,s=a["border-width"]?a["border-width"].pxValue*t+i:0;return o+s}return 1}},renderedWidth:function(){var e=this[0];if(e){var t=e.width();return t*this.cy().zoom()}},renderedOuterWidth:function(){var e=this[0];if(e){var t=e.outerWidth();return t*this.cy().zoom()}},height:function(){var e=this[0],t=e._private.cy,i=t._private.styleEnabled;if(e&&"nodes"===e._private.group){if(i){var r=e._private.style.height;return"auto"===r.strValue?e._private.autoHeight:r.pxValue}return 1}},outerHeight:function(){var e=this[0],r=e._private.cy,n=r._private.styleEnabled;if(e&&"nodes"===e._private.group){if(!n)return 1;var a=e._private.style,o="auto"===a.height.strValue?e._private.autoHeight:a.height.pxValue,s=a["border-width"]?a["border-width"].pxValue*t+i:0;return o+s}},renderedHeight:function(){var e=this[0];if(e&&"nodes"===e._private.group){var t=e.height();return t*this.cy().zoom()}},renderedOuterHeight:function(){var e=this[0];if(e&&"nodes"===e._private.group){var t=e.outerHeight();return t*this.cy().zoom()}},renderedBoundingBox:function(e){var t=this.boundingBox(e),i=this.cy(),r=i.zoom(),n=i.pan(),a=t.x1*r+n.x,o=t.x2*r+n.x,s=t.y1*r+n.y,l=t.y2*r+n.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},boundingBox:function(e){var t=this,i=t._private.cy,r=i._private,n=r.styleEnabled;e=e||{};var a=void 0===e.includeNodes?!0:e.includeNodes,o=void 0===e.includeEdges?!0:e.includeEdges,s=void 0===e.includeLabels?!0:e.includeLabels;n&&r.renderer.recalculateRenderedStyle(this);for(var l=1/0,u=-1/0,c=1/0,d=-1/0,p=0;ph?h:l,u=v>u?v:u,c=c>f?f:c,d=g>d?g:d}else if(x.isEdge()&&o){E=!0;var T=x._private.source._private.position,N=x._private.target._private.position,M=x._private.rstyle||{};if(h=T.x,v=N.x,f=T.y,g=N.y,h>v){var B=h;h=v,v=B}if(f>g){var B=f;f=g,g=B}if(l=l>h?h:l,u=v>u?v:u,c=c>f?f:c,d=g>d?g:d,n)for(var z=M.bezierPts||[],P=x._private.style.width.pxValue,I=P/2,L=0;Lh?h:l,u=v>u?v:u,c=c>f?f:c,d=g>d?g:d}}if(n){var R=x._private.style,M=x._private.rstyle,X=R.content.strValue,V=R["font-size"],Y=R["text-halign"],A=R["text-valign"],q=M.labelWidth,F=M.labelHeight,j=M.labelX,W=M.labelY;if(E&&s&&X&&V&&null!=F&&null!=q&&null!=j&&null!=W&&Y&&A){var H,$,Z,U,G=F,K=q;if(x.isEdge())H=j-K/2,$=j+K/2,Z=W-G/2,U=W+G/2;else{switch(Y.value){case"left":H=j-K,$=j;break;case"center":H=j-K/2,$=j+K/2;break;case"right":H=j,$=j+K}switch(A.value){case"top":Z=W-G,U=W;break;case"center":Z=W-G/2,U=W+G/2;break;case"bottom":Z=W,U=W+G}}l=l>H?H:l,u=$>u?$:u,c=c>Z?Z:c,d=U>d?U:d}}}}return{x1:l,x2:u,y1:c,y2:d,w:u-l,h:d-c}}}),e.elesfn.modelPosition=e.elesfn.position,e.elesfn.modelPositions=e.elesfn.positions}(cytoscape),function(e){"use strict";function t(e){return function(t){var i=this;if(void 0===t&&(t=!0),0!==i.length&&i.isNode()&&!i.removed()){for(var r=0,n=i[0],a=n._private.edges,o=0;oe}),maxDegree:i("degree",function(e,t){return e>t}),minIndegree:i("indegree",function(e,t){return t>e}),maxIndegree:i("indegree",function(e,t){return e>t}),minOutdegree:i("outdegree",function(e,t){return t>e}),maxOutdegree:i("outdegree",function(e,t){return e>t})}),e.fn.eles({totalDegree:function(e){for(var t=0,i=this.nodes(),r=0;r1&&!n){var a=this.length-1,o=this[a];this[a]=void 0,this[r]=o,t.indexes[o.id()]=r}return this.length--,this},unmerge:function(t){var i=this._private.cy;if(!t)return this;if(e.is.string(t)){var r=t;t=i.elements(r)}for(var n=0;nr&&(r=s,i=o)}return{value:r,ele:i}},min:function(e,t){for(var i,r=1/0,n=this,a=0;as&&(r=s,i=o)}return{value:r,ele:i}}})}(cytoscape),function(e){"use strict";e.fn.eles({isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source().id()===this.target().id()},isSimple:function(){return this.isEdge()&&this.source().id()!==this.target().id()},group:function(){var e=this[0];return e?e._private.group:void 0}})}(cytoscape),function(e){"use strict";e.fn.eles({each:function(t){if(e.is.fn(t))for(var i=0;it&&(t=n+t),0>i&&(i=n+i);for(var a=t;a>=0&&i>a&&n>a;a++)r.push(this[a]);return new e.Collection(this.cy(),r)},size:function(){return this.length},eq:function(t){return this[t]||new e.Collection(this.cy())},first:function(){return this[0]||new e.Collection(this.cy())},last:function(){return this[this.length-1]||new e.Collection(this.cy())},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(t){if(!e.is.fn(t))return this;var i=this.cy(),r=this.toArray().sort(t);return new e.Collection(i,r)},sortByZIndex:function(){return this.sort(e.Collection.zIndexSort)},zDepth:function(){var e=this[0];if(!e)return void 0;var t=e._private,i=t.group;if("nodes"===i)return t.data.parent?e.parents().size():0;var r=t.source,n=t.target,a=r._private.data.parent?r.parents().size():0,o=n._private.data.parent?n.parents().size():0;return Math.max(a-1,o-1,0)+.5}}),e.Collection.zIndexSort=function(e,t){var i=e.cy(),r=e._private,n=t._private,a=r.style["z-index"].value-n.style["z-index"].value,o=0,s=0,l=i.hasCompoundNodes(),u="nodes"===r.group,c="edges"===r.group,d="nodes"===n.group,p="edges"===n.group;l&&(o=e.zDepth(),s=t.zDepth());var h=o-s,v=0===h;return v?u&&p?1:c&&d?-1:0===a?r.index-n.index:a:h}}(cytoscape),function(e){"use strict";e.fn.eles({layoutPositions:function(t,i,r){var n=this.nodes(),a=this.cy();if(t.trigger({type:"layoutstart",layout:t}),i.animate){for(var o=0;o0?this.add(o):this;return e?s.rtrigger("style"):s.trigger("style"),this},updateMappers:function(e){var t=this._private.cy,i=t.style();if(e=e||void 0===e?!0:!1,!t.styleEnabled())return this;i.updateMappers(this);var r=this.updateCompoundBounds(),n=r.length>0?this.add(r):this;return e?n.rtrigger("style"):n.trigger("style"),this},renderedCss:function(e){var t=this.cy();if(!t.styleEnabled())return this;var i=this[0];if(i){var r=i.cy().style().getRenderedStyle(i);return void 0===e?r:r[e]}},css:function(t,i){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style();if(e.is.plainObject(t)){var o=t;a.applyBypass(this,o,n);var s=this.updateCompoundBounds(),l=s.length>0?this.add(s):this;l.rtrigger("style")}else if(e.is.string(t)){if(void 0===i){var u=this[0];return u?u._private.style[t].strValue:void 0}a.applyBypass(this,t,i,n);var s=this.updateCompoundBounds(),l=s.length>0?this.add(s):this;l.rtrigger("style")}else if(void 0===t){var u=this[0];return u?a.getRawStyle(u):void 0}return this},removeCss:function(e){var t=this.cy();if(!t.styleEnabled())return this;var i=!1,r=t.style(),n=this;if(void 0===e)for(var a=0;a0?this.add(s):this;return l.rtrigger("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},visible:function(){var e=this.cy();if(!e.styleEnabled())return!0;var t=this[0],i=e.hasCompoundNodes();if(t){var r=t._private.style;if("visible"!==r.visibility.value||"element"!==r.display.value)return!1;if("nodes"===t._private.group){if(!i)return!0;var n=t._private.data.parent?t.parents():null;if(n)for(var a=0;a0;o||r.push(a)}}return new e.Collection(this._private.cy,r,{unique:!0}).filter(t)},leaves:function(t){for(var i=this,r=[],n=0;n0;o||r.push(a)}}return new e.Collection(this._private.cy,r,{unique:!0}).filter(t)},outgoers:function(t){for(var i=this,r=[],n=0;n0&&i.push(c[0]),i.push(u[0])}return new e.Collection(r,i,{unique:!0}).filter(t)},closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),e.fn.eles({source:function(e){var t,i=this[0];return i&&(t=i._private.source),t&&e?t.filter(e):t},target:function(e){var t,i=this[0];return i&&(t=i._private.target),t&&e?t.filter(e):t},sources:t({attr:"source"}),targets:t({attr:"target"})}),e.fn.eles({edgesWith:i(),edgesTo:i({thisIs:"source"})}),e.fn.eles({connectedEdges:function(t){for(var i=[],r=this._private.cy,n=this,a=0;ad;d+=1){if(l.push(n.call(t,i[d],d,i)),a=i[d].id(),u.hasOwnProperty(a))throw"ERROR: Multiple items with the same id found: "+a;u[a]=d,c.push(a)}for(this._private={cy:t,heap:l,pointers:u,elements:c,comparator:r,extractor:n,length:s},d=Math.floor(s/2);d>=0;d-=1)o=this.heapify(d);return o}},e.Heap.idFn=function(e){return e.id()},e.Heap.minHeapComparator=function(e,t){return e>=t},e.Heap.maxHeapComparator=function(e,t){return t>=e},e.fn.heap=function(t){for(var i in t){var r=t[i];e.Heap.prototype[i]=r}},e.heapfn=e.Heap.prototype,e.heapfn.size=function(){return this._private.length},e.heapfn.getArgumentAsCollection=function(t,i){var r;if("undefined"==typeof i&&(i=this._private.cy),e.is.elementOrCollection(t))r=t;else{for(var n=[],a=[].concat.apply([],[t]),o=0;o0&&n.push(l)}r=new e.Collection(i,n)}return r},e.heapfn.isHeap=function(){var e,t,i,r,n,a=this._private.heap,o=a.length,s=this._private.comparator;for(e=0;o>e;e+=1)if(t=2*e+1,i=t+1,r=o>t?s(a[t],a[e]):!0,n=o>i?s(a[i],a[e]):!0,!r||!n)return!1;return!0},e.heapfn.heapSwap=function(e,t){var i=this._private.heap,r=this._private.pointers,n=this._private.elements,a=i[e],o=n[e],s=n[e],l=n[t];i[e]=i[t],n[e]=n[t],r[s]=t,r[l]=e,i[t]=a,n[t]=o},e.heapfn.heapify=function(e,t){var i,r,n,a,o,s,l,u=0,c=!1;for("undefined"==typeof t&&(t=!0),i=this._private.heap,u=i.length,s=this._private.comparator,r=e;!c;)t?(n=2*r+1,a=n+1,o=r,u>n&&!s(i[n],i[o])&&(o=n),u>a&&!s(i[a],i[o])&&(o=a),c=o===r,c||(this.heapSwap(o,r),r=o)):(l=Math.floor((r-1)/2),o=r,c=0>l||s(i[o],i[l]),c||(this.heapSwap(o,l),r=l))},e.heapfn.insert=function(e){var t,i,r,n,a,o=this.getArgumentAsCollection(e),s=o.length;for(a=0;s>a;a+=1){if(t=o[a],i=this._private.heap.length,r=this._private.extractor(t),n=t.id(),this._private.pointers.hasOwnProperty(n))throw"ERROR: Multiple items with the same id found: "+n;this._private.heap.push(r),this._private.elements.push(n),this._private.pointers[n]=i,this.heapify(i,!1)}this._private.length=this._private.heap.length},e.heapfn.getValueById=function(e){if(this._private.pointers.hasOwnProperty(e)){var t=this._private.pointers[e];return this._private.heap[t]}},e.heapfn.contains=function(e){for(var t=this.getArgumentAsCollection(e),i=0;i0?{value:this._private.heap[0],id:this._private.elements[0]}:void 0},e.heapfn.pop=function(){if(this._private.length>0){var e,t,i,r=this.top(),n=this._private.length-1;return this.heapSwap(0,n),e=this._private.elements[n],t=this._private.heap[n],i=e,this._private.heap.pop(),this._private.elements.pop(),this._private.length=this._private.heap.length,this._private.pointers[i]=void 0,this.heapify(0),r}},e.heapfn.findDirectionHeapify=function(e){var t=Math.floor((e-1)/2),i=this._private.heap,r=0>t||this._private.comparator(i[e],i[t]);this.heapify(e,r)},e.heapfn.edit=function(t,i){for(var r=this.getArgumentAsCollection(t),n=0;n=o&&s>=e&&t>=l&&u>=t},a=function(e,t,i,r,n){r=-r;var a=e*Math.cos(r)-t*Math.sin(r),o=e*Math.sin(r)+t*Math.cos(r),s=a*i,l=o*i,u=s+n.x,c=l+n.y;return{x:u,y:c}};r.arrow={_points:[-.15,-.3,0,0,.15,-.3],collide:function(t,i,n,a,o,s,l,u){var c=r.arrow._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o=r.arrow._points,s=0;se.math.sqDistanceToQuadraticBezier(i,r,c.startX,c.startY,c.cp2ax,c.cp2ay,c.selfEdgeMidX,c.selfEdgeMidY)||(x=e.math.inBezierVicinity(i,r,c.selfEdgeMidX,c.selfEdgeMidY,c.cp2cx,c.cp2cy,c.endX,c.endY,f))&&b()&&f+h>e.math.sqDistanceToQuadraticBezier(i,r,c.selfEdgeMidX,c.selfEdgeMidY,c.cp2cx,c.cp2cy,c.endX,c.endY))&&u.push(o);else if("haystack"===c.edgeType){var w=d["haystack-radius"].value,_=w/2,E=m._private.position,S=m.width(),P=m.height(),D=y._private.position,k=y.width(),C=y.height(),T=D.x+c.source.x*k*_,N=D.y+c.source.y*C*_,M=E.x+c.target.x*S*_,B=E.y+c.target.y*P*_;(x=e.math.inLineVicinity(i,r,T,N,M,B,g))&&b()&&f+h>e.math.sqDistanceToFiniteLine(i,r,T,N,M,B)&&u.push(o)}else"straight"===c.edgeType?(x=e.math.inLineVicinity(i,r,c.startX,c.startY,c.endX,c.endY,g))&&b()&&f+h>e.math.sqDistanceToFiniteLine(i,r,c.startX,c.startY,c.endX,c.endY)&&u.push(o):"bezier"===c.edgeType&&(x=e.math.inBezierVicinity(i,r,c.startX,c.startY,c.cp2x,c.cp2y,c.endX,c.endY,f))&&b()&&f+h>e.math.sqDistanceToQuadraticBezier(i,r,c.startX,c.startY,c.cp2x,c.cp2y,c.endX,c.endY)&&u.push(o);if(x&&b()&&0===u.length||u[u.length-1]!==o){var z=t.arrowShapes[d["source-arrow-shape"].value],I=t.arrowShapes[d["target-arrow-shape"].value],y=y||o._private.source,m=m||o._private.target,E=m._private.position,D=y._private.position,L=s.getArrowWidth(d.width.pxValue),O=s.getArrowHeight(d.width.pxValue),R=L,X=O;(z.roughCollide(i,r,c.arrowStartX,c.arrowStartY,L,O,[c.arrowStartX-D.x,c.arrowStartY-D.y],0)&&z.collide(i,r,c.arrowStartX,c.arrowStartY,L,O,[c.arrowStartX-D.x,c.arrowStartY-D.y],0)||I.roughCollide(i,r,c.arrowEndX,c.arrowEndY,R,X,[c.arrowEndX-E.x,c.arrowEndY-E.y],0)&&I.collide(i,r,c.arrowEndX,c.arrowEndY,R,X,[c.arrowEndX-E.x,c.arrowEndY-E.y],0))&&u.push(o)}p&&u.length>0&&u[u.length-1]===o&&(a(y),a(m))}for(var s=this,l=this.getCachedZSortedEles(),u=[],c=t.isTouch,d=this.data.cy.zoom(),p=this.data.cy.hasCompoundNodes(),h=(c?256:32)/d,v=(c?16:0)/d,f=l.length-1;f>=0;f--){var g=l[f];if(u.length>0)break;"nodes"===g._private.group?a(l[f]):o(l[f])}return u.length>0?u[u.length-1]:null},t.prototype.getAllInBox=function(i,r,n,a){var o=this.getCachedNodes(),s=this.getCachedEdges(),l=[],u=Math.min(i,n),c=Math.max(i,n),d=Math.min(r,a),p=Math.max(r,a);i=u,n=c,r=d,a=p;for(var h,v=0;v=i&&n>=D&&k>=r&&a>=k,M=C>=i&&n>=C&&T>=r&&a>=T;N&&M&&l.push(s[v])}}return l},t.prototype.getNodeWidth=function(e){return e.width()},t.prototype.getNodeHeight=function(e){return e.height()},t.prototype.getNodeShape=function(e){var t=e._private.style.shape.value;return e.isParent()?"rectangle"===t||"roundrectangle"===t?t:"rectangle":t},t.prototype.getNodePadding=function(e){var t=e._private.style["padding-left"].pxValue,i=e._private.style["padding-right"].pxValue,r=e._private.style["padding-top"].pxValue,n=e._private.style["padding-bottom"].pxValue;return isNaN(t)&&(t=0),isNaN(i)&&(i=0),isNaN(r)&&(r=0),isNaN(n)&&(n=0),{left:t,right:i,top:r,bottom:n}},t.prototype.zOrderSort=e.Collection.zIndexSort,t.prototype.updateCachedZSortedEles=function(){this.getCachedZSortedEles(!0)},t.prototype.getCachedZSortedEles=function(e){var t=this.lastZOrderCachedNodes,i=this.lastZOrderCachedEdges,r=this.getCachedNodes(),n=this.getCachedEdges(),a=[];if(!e&&t&&i&&t===r&&i===n)a=this.cachedZSortedEles;else{for(var o=0;ov?v+"-"+h:h+"-"+v,p&&(r="unbundled"+c._private.data.id),null==o[r]&&(o[r]=[],s.push(r)),o[r].push(c),p&&(o[r].hasUnbundled=!0)}else l.push(c)}for(var f,g,y,m,x,b,w,_,E,S,P,D,k,C,T=0;Tg._private.data.id){var M=f;f=g,g=M}if(y=f._private.position,m=g._private.position,x=this.getNodeWidth(f),b=this.getNodeHeight(f),w=this.getNodeWidth(g),_=this.getNodeHeight(g),E=t.nodeShapes[this.getNodeShape(f)],S=t.nodeShapes[this.getNodeShape(g)],P=f._private.style["border-width"].pxValue,D=g._private.style["border-width"].pxValue,C=!1,N.length>1&&f!==g||N.hasUnbundled){var B=E.intersectLine(y.x,y.y,x,b,m.x,m.y,P/2),z=S.intersectLine(m.x,m.y,w,_,y.x,y.y,D/2),I={x1:B[0],x2:z[0],y1:B[1],y2:z[1]},L=z[1]-B[1],O=z[0]-B[0],R=Math.sqrt(O*O+L*L),X={x:O,y:L},V={x:X.x/R,y:X.y/R};k={x:-V.y,y:V.x},(S.checkPoint(B[0],B[1],D/2,w,_,m.x,m.y)||E.checkPoint(z[0],z[1],P/2,x,b,y.x,y.y))&&(k={},C=!0)}for(var c,Y,u=0;uIt,Ot=e.math.distance({x:Y.cp2x,y:Y.cp2y},{x:Y.endX,y:Y.endY}),Rt=zt>Ot;if("bezier"===Y.edgeType){var Xt=!1;if(kt||Ct||Lt){Xt=!0;var Vt={x:Y.cp2x-y.x,y:Y.cp2y-y.y},Yt=Math.sqrt(Vt.x*Vt.x+Vt.y*Vt.y),At={x:Vt.x/Yt,y:Vt.y/Yt},qt=Math.max(x,b),Ft={x:Y.cp2x+2*At.x*qt,y:Y.cp2y+2*At.y*qt},jt=E.intersectLine(y.x,y.y,x,b,Ft.x,Ft.y,P/2);Lt?(Y.cp2x=Y.cp2x+At.x*(zt-It),Y.cp2y=Y.cp2y+At.y*(zt-It)):(Y.cp2x=jt[0]+At.x*zt,Y.cp2y=jt[1]+At.y*zt)}if(Tt||Nt||Rt){Xt=!0;var Vt={x:Y.cp2x-m.x,y:Y.cp2y-m.y},Yt=Math.sqrt(Vt.x*Vt.x+Vt.y*Vt.y),At={x:Vt.x/Yt,y:Vt.y/Yt},qt=Math.max(x,b),Ft={x:Y.cp2x+2*At.x*qt,y:Y.cp2y+2*At.y*qt},Wt=S.intersectLine(m.x,m.y,w,_,Ft.x,Ft.y,D/2);Rt?(Y.cp2x=Y.cp2x+At.x*(zt-Ot),Y.cp2y=Y.cp2y+At.y*(zt-Ot)):(Y.cp2x=Wt[0]+At.x*zt,Y.cp2y=Wt[1]+At.y*zt)}Xt&&this.findEndpoints(c)}else"straight"===Y.edgeType&&(Y.midX=(G+nt)/2,Y.midY=(J+ot)/2);this.projectBezier(c)}}}for(var u=0;uk*T+C*N)n.straightEdgeTooShort=!0;else{var P=n;this.drawStyledEdge(i,e,[P.startX,P.startY,P.endX,P.endY],_,w),n.straightEdgeTooShort=!1}}else{var P=n;this.drawStyledEdge(i,e,[P.startX,P.startY,P.cp2x,P.cp2y,P.endX,P.endY],_,w)}"haystack"===n.edgeType?this.drawArrowheads(e,i,r):n.noArrowPlacement!==!0&&void 0!==n.startX&&this.drawArrowheads(e,i,r)}}},t.prototype.drawStyledEdge=function(e,i,r,n){var a,o=e._private.rscratch,s=i,l=!1,u=t.usePaths();if(u){for(var c=r,d=o.pathCacheKey&&c.length===o.pathCacheKey.length,p=d,h=0;p&&hu?y+=Math.PI/2:y=-(Math.PI/2+y);var m=this.getArrowWidth(a),x=t.arrowShapes[o];if(p){var b=m+"$"+o+"$"+y+"$"+s+"$"+l;h.arrowPathCacheKey=h.arrowPathCacheKey||{},h.arrowPathCache=h.arrowPathCache||{};var w=h.arrowPathCacheKey[i]===b;w?(d=r=h.arrowPathCache[i],v=!0):(d=r=new Path2D,h.arrowPathCacheKey[i]=b,h.arrowPathCache[i]=d)}r.beginPath&&r.beginPath(),v||x.draw(r,m,y,g),!x.leavePathOpen&&r.closePath&&r.closePath(),r=f,("filled"===n||"both"===n)&&(p?r.fill(d):r.fill()),("hollow"===n||"both"===n)&&(r.lineWidth=x.matchEdgeWidth?a:1,r.lineJoin="miter",p?r.stroke(d):r.stroke())}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.getCachedImage=function(e,t){var i=this,r=i.imageCache=i.imageCache||{};if(r[e]&&r[e].image)return r[e].image;var n=r[e]=r[e]||{},a=n.image=new Image;return a.addEventListener("load",t),a.src=e,a},t.prototype.drawInscribedImage=function(e,i,r){var n=this,a=r._private.position.x,o=r._private.position.y,s=r._private.style,l=s["background-fit"].value,u=s["background-position-x"],c=s["background-position-y"],d=s["background-repeat"].value,p=r.width(),h=r.height(),v=r._private.rscratch,f=s["background-clip"].value,g="node"===f,y=s["background-image-opacity"].value,m=i.width,x=i.height;if(0!==m&&0!==x){if("contain"===l){var b=Math.min(p/m,h/x);m*=b,x*=b}else if("cover"===l){var b=Math.max(p/m,h/x);m*=b,x*=b}var w=a-p/2;w+="%"===u.units?(p-m)*u.value/100:u.pxValue;var _=o-h/2;_+="%"===c.units?(h-x)*c.value/100:c.pxValue,v.pathCache&&(w-=a,_-=o,a=0,o=0);var E=e.globalAlpha;if(e.globalAlpha=y,"no-repeat"===d)g&&(e.save(),v.pathCache?e.clip(v.pathCache):(t.nodeShapes[n.getNodeShape(r)].drawPath(e,a,o,p,h),e.clip())),e.drawImage(i,0,0,i.width,i.height,w,_,m,x),g&&e.restore();else{var S=e.createPattern(i,d);e.fillStyle=S,t.nodeShapes[n.getNodeShape(r)].drawPath(e,a,o,p,h),e.translate(w,_),e.fill(),e.translate(-w,-_)}e.globalAlpha=E}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.drawEdgeText=function(e,t){var i=t._private.style.content.strValue;if(!(!i||i.match(/^\s+$/)||this.hideEdgesOnViewport&&(this.dragData.didDrag||this.pinching||this.hoverData.dragging||this.data.wheel||this.swipePanning))){var r=t._private.style["font-size"].pxValue*t.cy().zoom(),n=t._private.style["min-zoomed-font-size"].pxValue;if(!(n>r)){e.textAlign="center",e.textBaseline="middle";var a=t._private.rscratch;this.drawText(e,t,a.labelX,a.labelY)}}},t.prototype.drawNodeText=function(e,t){var i=t._private.style.content.strValue;if(i&&!i.match(/^\s+$/)){var r=t._private.style["font-size"].pxValue*t.cy().zoom(),n=t._private.style["min-zoomed-font-size"].pxValue;if(!(n>r)){var a=t._private.style["text-halign"].strValue,o=t._private.style["text-valign"].strValue,s=t._private.rscratch;switch(a){case"left":e.textAlign="right";break;case"right":e.textAlign="left";break;default:e.textAlign="center"}switch(o){case"top":e.textBaseline="bottom";break;case"bottom":e.textBaseline="top";break;default:e.textBaseline="middle"}this.drawText(e,t,s.labelX,s.labelY)}}},t.prototype.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var i=0;i0&&(e.lineWidth=s,e.strokeText(o,i,r)),e.fillText(o,i,r)}}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.drawNode=function(e,i,r){var n,a,o,s=this,l=i._private.style,u=i._private.rscratch,c=t.usePaths(),d=e,p=!1,h=l["overlay-padding"].pxValue,v=l["overlay-opacity"].value,f=l["overlay-color"].value;if(!r||0!==v){var g=i.effectiveOpacity();if(0!==g)if(n=this.getNodeWidth(i),a=this.getNodeHeight(i),e.lineWidth=l["border-width"].pxValue,void 0!==r&&r)v>0&&(this.fillStyle(e,f[0],f[1],f[2],v),t.nodeShapes.roundrectangle.drawPath(e,i._private.position.x,i._private.position.y,n+2*h,a+2*h),e.fill());else{var y=l["background-color"].value,m=l["border-color"].value,x=l["border-style"].value;if(this.fillStyle(e,y[0],y[1],y[2],l["background-opacity"].value*l.opacity.value*g),this.strokeStyle(e,m[0],m[1],m[2],l["border-opacity"].value*l.opacity.value*g),e.lineJoin="miter",e.setLineDash)switch(x){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var b=l["background-image"].value[2]||l["background-image"].value[1],w=l.shape.strValue,_=i._private.position;if(c){var E=w+"$"+n+"$"+a;e.translate(_.x,_.y),u.pathCacheKey===E?(o=e=u.pathCache,p=!0):(o=e=new Path2D,u.pathCacheKey=E,u.pathCache=o)}if(!p){var S=_;c&&(S={x:0,y:0}),t.nodeShapes[this.getNodeShape(i)].drawPath(e,S.x,S.y,n,a)}if(e=d,c?e.fill(o):e.fill(),void 0!==b){var P=this.getCachedImage(b,function(){s.data.canvasNeedsRedraw[t.NODE]=!0,s.data.canvasNeedsRedraw[t.DRAG]=!0,s.redraw()});P.complete&&this.drawInscribedImage(e,P,i)}var D=l["background-blacken"].value,k=l["border-width"].pxValue;if(this.hasPie(i)&&(this.drawPie(e,i),(0!==D||0!==k)&&(c||t.nodeShapes[this.getNodeShape(i)].drawPath(e,_.x,_.y,n,a))),D>0?(this.fillStyle(e,0,0,0,D),c?e.fill(o):e.fill()):0>D&&(this.fillStyle(e,255,255,255,-D),c?e.fill(o):e.fill()),k>0&&(c?e.stroke(o):e.stroke(),"double"===x)){e.lineWidth=l["border-width"].pxValue/3;var C=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",c?e.stroke(o):e.stroke(),e.globalCompositeOperation=C}c&&e.translate(-_.x,-_.y),e.setLineDash&&e.setLineDash([])}}},t.prototype.hasPie=function(e){return e=e[0],e._private.hasPie},t.prototype.drawPie=function(i,r){r=r[0];var n=r._private.style["pie-size"],a=this.getNodeWidth(r),o=this.getNodeHeight(r),s=r._private.position.x,l=r._private.position.y,u=Math.min(a,o)/2,c=0,d=t.usePaths();d&&(s=0,l=0),"%"===n.units?u=u*n.value/100:void 0!==n.pxValue&&(u=n.pxValue/2);for(var p=1;p<=e.style.pieBackgroundN;p++){var h=r._private.style["pie-"+p+"-background-size"].value,v=r._private.style["pie-"+p+"-background-color"].value,f=r._private.style["pie-"+p+"-background-opacity"].value,g=h/100,y=1.5*Math.PI+2*Math.PI*c,m=2*Math.PI*g,x=y+m;0===h||c>=1||c+g>1||(i.beginPath(),i.moveTo(s,l),i.arc(s,l,u,y,x),i.closePath(),this.fillStyle(i,v[0],v[1],v[2],f),i.fill(),c+=g)}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.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},t.prototype.paintCache=function(e){for(var t,i=this.paintCaches=this.paintCaches||[],r=!0,n=0;n=o&&(i=r.bufferCanvases[t.TEXTURE_BUFFER],this.textureMult=2,i.width=s*this.textureMult,i.height=l*this.textureMult),this.canvasWidth=s,this.canvasHeight=l}},t.prototype.renderTo=function(e,t,i,r){this.redraw({forcedContext:e,forcedZoom:t,forcedPan:i,drawAllLayers:!0,forcedPxRatio:r})},t.prototype.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},t.minRedrawLimit=1e3/60,t.maxRedrawLimit=1e3,t.motionBlurDelay=100,t.prototype.redraw=function(i){function r(){function i(e,t){if(e.setTransform(1,0,0,1,0,0),"motionBlur"===t){var i=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",u.fillStyle(e,255,255,255,.666),e.fillRect(0,0,u.canvasWidth,u.canvasHeight),e.globalCompositeOperation=i}else n||void 0!==t&&!t||e.clearRect(0,0,u.canvasWidth,u.canvasHeight);a||(e.translate(b.x,b.y),e.scale(m,m)),l&&e.translate(l.x,l.y),s&&e.scale(s,s)}function r(e,t){for(var i=e.eles,r=0;r0&&(k.strokeStyle="rgba("+g["selection-box-border-color"].value[0]+","+g["selection-box-border-color"].value[1]+","+g["selection-box-border-color"].value[2]+","+g["selection-box-opacity"].value+")",k.strokeRect(p.select[0],p.select[1],p.select[2]-p.select[0],p.select[3]-p.select[1]))}if(p.bgActivePosistion&&!u.hoverData.selecting){var y=p.cy.zoom(),q=p.bgActivePosistion;k.fillStyle="rgba("+g["active-bg-color"].value[0]+","+g["active-bg-color"].value[1]+","+g["active-bg-color"].value[2]+","+g["active-bg-opacity"].value+")",k.beginPath(),k.arc(q.x,q.y,g["active-bg-size"].pxValue/y,0,2*Math.PI),k.fill()}var F=u.averageRedrawTime;if(u.showFps&&F){F=Math.round(F);var j=Math.round(1e3/F);k.setTransform(1,0,0,1,0,0),k.fillStyle="rgba(255, 0, 0, 0.75)",k.strokeStyle="rgba(255, 0, 0, 0.75)",k.lineWidth=1,k.fillText("1 frame = "+F+" ms = "+j+" fps",0,20);var W=60;k.strokeRect(0,30,250,20),k.fillRect(0,30,250*Math.min(j/W,1),20)}a||(h[t.SELECT_BOX]=!1)}var H=+new Date;void 0===u.averageRedrawTime&&(u.averageRedrawTime=H-w),void 0===u.redrawCount&&(u.redrawCount=0),u.redrawCount++,void 0===u.redrawTotalTime&&(u.redrawTotalTime=0),u.redrawTotalTime+=H-w,u.lastRedrawTime=H-w,u.averageRedrawTime=u.averageRedrawTime/2+(H-w)/2,u.currentlyDrawing=!1,u.clearingMotionBlur&&(u.clearingMotionBlur=!1,u.motionBlurCleared=!0,u.motionBlur=!0),v&&(u.motionBlurTimeout=setTimeout(function(){u.motionBlurTimeout=null,u.clearedNodeLayerForMotionBlur=!1,u.motionBlur=!1,u.clearingMotionBlur=!0,h[t.NODE]=!0,h[t.DRAG]=!0,u.redraw()},t.motionBlurDelay))}i=i||{};var n=i.forcedContext,a=i.drawAllLayers,o=i.drawOnlyNodeLayer,s=i.forcedZoom,l=i.forcedPan,u=this,c=void 0===i.forcedPxRatio?this.getPixelRatio():i.forcedPxRatio,d=u.data.cy,p=u.data,h=p.canvasNeedsRedraw,v=void 0!==i.motionBlur?i.motionBlur:u.motionBlur;v=v&&!n&&u.motionBlurEnabled,v&&u.motionBlurTimeout&&clearTimeout(u.motionBlurTimeout),!n&&this.redrawTimeout&&clearTimeout(this.redrawTimeout),this.redrawTimeout=null,void 0===this.averageRedrawTime&&(this.averageRedrawTime=0);var f=t.minRedrawLimit,g=t.maxRedrawLimit,y=this.averageRedrawTime;y=f>y?f:y,y=g>y?y:g,void 0===this.lastDrawTime&&(this.lastDrawTime=0);var m=+new Date,x=m-this.lastDrawTime,b=x>=y;if(!n){if(!b||this.currentlyDrawing)return void(this.redrawTimeout=setTimeout(function(){u.redraw()},y));this.lastDrawTime=m,this.currentlyDrawing=!0}var w=+new Date;n?r():e.util.requestAnimationFrame(r),n||u.initrender||(u.initrender=!0,d.trigger("initrender"))}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.drawPolygonPath=function(e,t,i,r,n,a){var o=r/2,s=n/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],i+s*a[1]);for(var l=1;l0&&a>0)if(l.clearRect(0,0,n,a),e.bg&&(l.fillStyle=e.bg,l.rect(0,0,n,a),l.fill()),l.globalCompositeOperation="source-over",e.full)this.redraw({forcedContext:l,drawAllLayers:!0,forcedZoom:o,forcedPan:{x:-r.x1*o,y:-r.y1*o},forcedPxRatio:1});else{var u=i.pan(),c={x:u.x*o,y:u.y*o},d=i.zoom()*o;this.redraw({forcedContext:l,drawAllLayers:!0,forcedZoom:d,forcedPan:c,forcedPxRatio:1})}return s},t.prototype.png=function(e){return this.bufferCanvasImage(e).toDataURL("image/png")}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.registerBinding=function(e,t,i,r){this.bindings.push({target:e,event:t,handler:i,useCapture:r}),e.addEventListener(t,i,r)},t.prototype.nodeIsDraggable=function(e){return 0!==e._private.style.opacity.value&&"visible"==e._private.style.visibility.value&&"element"==e._private.style.display.value&&!e.locked()&&e.grabbable()?!0:!1},t.prototype.load=function(){var i=this,r=function(e){var t;if(e.addToList&&i.data.cy.hasCompoundNodes()){if(!e.addToList.hasId){e.addToList.hasId={};for(var r=0;rs[0]&&r.clientXs[1]&&r.clientY=t.panOrBoxSelectDelay)&&!i.hoverData.selecting&&D>=i.tapThreshold2&&p.panningEnabled()&&p.userPanningEnabled())i.hoverData.dragging=!0,i.hoverData.selecting=!1,i.hoverData.justStartedPan=!0,f[4]=0;else{if(p.boxSelectionEnabled()&&!i.hoverData.dragging&&Math.pow(f[2]-f[0],2)+Math.pow(f[3]-f[1],2)>7&&f[4]&&(clearTimeout(i.bgActiveTimeout),i.data.bgActivePosistion=void 0,i.hoverData.selecting=!0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,i.redraw()),m&&m.isEdge()&&m.active()&&m.unactivate(),g!=y&&(y&&(y.trigger(new e.Event(r,{type:"mouseout",cyPosition:{x:v[0],y:v[1]}})),y.trigger(new e.Event(r,{type:"tapdragout",cyPosition:{x:v[0],y:v[1]}}))),g&&(g.trigger(new e.Event(r,{type:"mouseover",cyPosition:{x:v[0],y:v[1]}})),g.trigger(new e.Event(r,{type:"tapdragover",cyPosition:{x:v[0],y:v[1]}}))),i.hoverData.last=g),m&&m.isNode()&&i.nodeIsDraggable(m))if(D>=i.tapThreshold2){var M=!i.dragData.didDrag;M&&(i.data.canvasNeedsRedraw[t.NODE]=!0),i.dragData.didDrag=!0;for(var B=[],z=0;z7&&l[4]||i.hoverData.dragged||(a.$(function(){return this.selected()}).unselect(),c.length>0&&(i.data.canvasNeedsRedraw[t.NODE]=!0),i.dragData.possibleDragElements=c=[]),null!=u?u.trigger(new e.Event(r,{type:"mouseup",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:s[0],y:s[1]}})):null==u&&a.trigger(new e.Event(r,{type:"mouseup",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:s[0],y:s[1]}})),Math.pow(l[2]-l[0],2)+Math.pow(l[3]-l[1],2)===0&&(null!=u?u.trigger(new e.Event(r,{type:"click",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"tap",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"vclick",cyPosition:{x:s[0],y:s[1]}})):null==u&&a.trigger(new e.Event(r,{type:"click",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"tap",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"vclick",cyPosition:{x:s[0],y:s[1]}}))),u!=d||i.dragData.didDrag||null!=u&&u._private.selectable&&(i.hoverData.dragging||("additive"===a.selectionType()||p?u.selected()?u.unselect():u.select():p||(a.$(":selected").not(u).unselect(),u.select())),i.data.canvasNeedsRedraw[t.NODE]=!0),a.boxSelectionEnabled()&&Math.pow(l[2]-l[0],2)+Math.pow(l[3]-l[1],2)>7&&l[4]){var f=[],g=i.getAllInBox(l[0],l[1],l[2],l[3]);i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,g.length>0&&(i.data.canvasNeedsRedraw[t.NODE]=!0);for(var y=0;y=0&&w>=d&&h>=0&&w>=h&&p>=0&&_>=p&&v>=0&&_>=v;var C=n.pan(),T=n.zoom();f=S(d,p,h,v),g=P(d,p,h,v),y=[(d+h)/2,(p+v)/2],m=[(y[0]-C.x)/T,(y[1]-C.y)/T];var N=200,M=N*N;if(M>g&&!r.touches[2]){var B=i.findNearestElement(l[0],l[1],!0),z=i.findNearestElement(l[2],l[3],!0);return B&&B.isNode()?(B.activate().trigger(new e.Event(r,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),i.touchData.start=B):z&&z.isNode()?(z.activate().trigger(new e.Event(r,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),i.touchData.start=z):(n.trigger(new e.Event(r,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),i.touchData.start=null),i.touchData.start&&(i.touchData.start._private.grabbed=!1),i.touchData.cxt=!0,i.touchData.cxtDragged=!1,i.data.bgActivePosistion=void 0,void i.redraw()}}if(r.touches[2]);else if(r.touches[1]);else if(r.touches[0]){var I=i.findNearestElement(l[0],l[1],!0);if(null!=I){if(I.activate(),i.touchData.start=I,I.isNode()&&i.nodeIsDraggable(I)){var L=i.dragData.touchDragEles=[];if(i.data.canvasNeedsRedraw[t.NODE]=!0,i.data.canvasNeedsRedraw[t.DRAG]=!0,I.selected())for(var O=n.$(function(){return this.isNode()&&this.selected()}),R=0;R=q||R>=Y){i.touchData.cxt=!1,i.touchData.start&&(i.touchData.start.unactivate(),i.touchData.start=null),i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0;var F=new e.Event(r,{type:"cxttapend",cyPosition:{x:l[0],y:l[1]}});i.touchData.start?i.touchData.start.trigger(F):s.trigger(F)}}if(o&&i.touchData.cxt){var F=new e.Event(r,{type:"cxtdrag",cyPosition:{x:l[0],y:l[1]}});i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,i.touchData.start?i.touchData.start.trigger(F):s.trigger(F),i.touchData.start&&(i.touchData.start._private.grabbed=!1),i.touchData.cxtDragged=!0;var j=i.findNearestElement(l[0],l[1],!0);i.touchData.cxtOver&&j===i.touchData.cxtOver||(i.touchData.cxtOver&&i.touchData.cxtOver.trigger(new e.Event(r,{type:"cxtdragout",cyPosition:{x:l[0],y:l[1]}})),i.touchData.cxtOver=j,j&&j.trigger(new e.Event(r,{type:"cxtdragover",cyPosition:{x:l[0],y:l[1]}})))}else if(o&&r.touches[2]&&s.boxSelectionEnabled())i.data.bgActivePosistion=void 0,clearTimeout(this.threeFingerSelectTimeout),this.lastThreeTouch=+new Date,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,n&&0!==n.length&&void 0!==n[0]?(n[2]=(l[0]+l[2]+l[4])/3,n[3]=(l[1]+l[3]+l[5])/3):(n[0]=(l[0]+l[2]+l[4])/3,n[1]=(l[1]+l[3]+l[5])/3,n[2]=(l[0]+l[2]+l[4])/3+1,n[3]=(l[1]+l[3]+l[5])/3+1),n[4]=1,i.redraw();else if(o&&r.touches[1]&&s.zoomingEnabled()&&s.panningEnabled()&&s.userZoomingEnabled()&&s.userPanningEnabled()){i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0;var W=i.dragData.touchDragEles;if(W){i.data.canvasNeedsRedraw[t.DRAG]=!0;for(var H=0;H=i.tapThreshold2){for(var W=i.dragData.touchDragEles,ut=0;ut4&&(i.touchData.singleTouchMoved=!0);if(o&&(null==st||st.isEdge())&&s.panningEnabled()&&s.userPanningEnabled()){i.swipePanning?s.panBy({x:w[0]*c,y:w[1]*c}):B>=i.tapThreshold2&&(i.swipePanning=!0,s.panBy({x:k*c,y:T*c})),st&&(st.unactivate(),i.data.bgActivePosistion||(i.data.bgActivePosistion={x:l[0],y:l[1]}),i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,i.touchData.start=null);var y=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=y[0],l[1]=y[1]}}for(var _=0;_0?i.data.canvasNeedsRedraw[t.NODE]=!0:i.redraw()}var x=!1;if(null!=n&&(n._private.active=!1,x=!0,n.unactivate()),r.touches[2])i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0;else if(r.touches[1]);else if(r.touches[0]);else if(!r.touches[0]){if(i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,null!=n){n._private.grabbed&&(n._private.grabbed=!1,n.trigger("free"),n._private.rscratch.inDragLayer=!1);for(var b=n._private.edges,w=0;wc;c++)d[4*c]=p[2*c],d[4*c+1]=p[2*c+1],d[4*c+2]=h[2*c],d[4*c+3]=h[2*c+1];d=e.math.fitPolygonToSquare(d),n.star5=n.star={points:d,draw:function(e,t,r,a,o){i.drawPolygon(e,t,r,a,o,n.star5.points)},drawPath:function(e,t,r,a,o){i.drawPolygonPath(e,t,r,a,o,n.star5.points)},intersectLine:function(e,t,r,a,o,s,l){return i.polygonIntersectLine(o,s,n.star5.points,e,t,r/2,a/2,l)},intersectBox:function(e,t,r,a,o,s,l,u,c){var d=n.star5.points;return i.boxIntersectPolygon(e,t,r,a,d,o,s,l,u,[0,-1],c)},checkPoint:function(t,i,r,a,o,s,l){return e.math.pointInsidePolygon(t,i,n.star5.points,s,l,a,o,[0,-1],r)}}}(cytoscape),function(e){"use strict";function t(t){this._private={},this._private.options=e.util.extend({},i,t)}var i={animate:!0,maxSimulationTime:4e3,fit:!0,padding:30,boundingBox:void 0,ungrabifyWhileSimulating:!1,ready:void 0,stop:void 0,repulsion:void 0,stiffness:void 0,friction:void 0,gravity:!0,fps:void 0,precision:void 0,nodeMass:void 0,edgeLength:void 0,stepSize:.1,stableEnergy:function(e){var t=e;return t.max<=.5||t.mean<=.3},infinite:!1};t.prototype.run=function(){var t=this,i=this._private.options;return e.util.require("arbor",function(r){function n(e,t){return null==t?void 0:"function"==typeof t?t.apply(e,[e._private.data,{nodes:u.length,edges:c.length,element:e}]):t}function a(e){if(!e.isFullAutoParent()){var t=e._private.data.id,r=n(e,i.nodeMass),a=e._private.locked,o=e.position(),s=h.fromScreen({x:o.x,y:o.y});e.scratch().arbor=h.addNode(t,{element:e,mass:r,fixed:a,x:a?s.x:void 0,y:a?s.y:void 0})}}function o(e){var t=e.source().id(),r=e.target().id(),a=n(e,i.edgeLength);e.scratch().arbor=h.addEdge(t,r,{length:a})}var s=i.cy,l=i.eles,u=l.nodes().not(":parent"),c=l.edges(),d=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:s.width(),h:s.height()}),p=!1;if(t.trigger({type:"layoutstart",layout:t}),void 0!==i.liveUpdate&&(i.animate=i.liveUpdate),s.nodes().size()<=1)return i.fit&&s.reset(),s.nodes().position({x:Math.round((d.x1+d.x2)/2),y:Math.round((d.y1+d.y2)/2)}),t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t}),t.one("layoutstop",i.stop),void t.trigger({type:"layoutstop",layout:t});var h=t._private.system=r.ParticleSystem();h.parameters({repulsion:i.repulsion,stiffness:i.stiffness,friction:i.friction,gravity:i.gravity,fps:i.fps,dt:i.dt,precision:i.precision}),i.animate&&i.fit&&s.fit(d,i.padding);var v,f=250,g=!1,y=+new Date,m={init:function(){},redraw:function(){var e=h.energy();if(!i.infinite&&null!=i.stableEnergy&&null!=e&&e.n>0&&i.stableEnergy(e))return void t.stop();i.infinite||1/0==f||(clearTimeout(v),v=setTimeout(P,f));var r=s.collection();h.eachNode(function(e,t){var i=e.data,n=i.element;null!=n&&(n.locked()||n.grabbed()||(n.silentPosition({x:d.x1+t.x,y:d.y1+t.y}),r.merge(n)))}),i.animate&&r.length>0&&(p=!0,r.rtrigger("position"),i.fit&&s.fit(i.padding),y=+new Date,p=!1),g||(g=!0,t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t}))}};h.renderer=m,h.screenSize(d.w,d.h),h.screenPadding(i.padding,i.padding,i.padding,i.padding),h.screenStep(i.stepSize);var x;u.on("grab free position",x=function(e){if(!p){var t=this.position(),n=h.fromScreen(t);if(n){var a=r.Point(n.x,n.y),o=i.padding;switch(d.x1+o<=t.x&&t.x<=d.x2-o&&d.y1+o<=t.y&&t.y<=d.y2-o&&(this.scratch().arbor.p=a),e.type){case"grab":this.scratch().arbor.fixed=!0;break;case"free":this.scratch().arbor.fixed=!1}}}});var b;u.on("lock unlock",b=function(){node.scratch().arbor.fixed=node.locked()});var w;l.on("remove",w=function(){});var _;s.on("add","*",_=function(){});var E;s.on("resize",E=function(){if(null==i.boundingBox&&null!=t._private.system){var e=s.width(),r=s.height();h.screenSize(e,r)}}),u.each(function(e,t){a(t)}),c.each(function(e,t){o(t)});var S=u.filter(":grabbable");i.ungrabifyWhileSimulating&&S.ungrabify();var P=t._private.doneHandler=function(){t._private.doneHandler=null,i.animate||(i.fit&&s.reset(),u.rtrigger("position")),u.off("grab free position",x),u.off("lock unlock",b),l.off("remove",w),s.off("add","*",_),s.off("resize",E),i.ungrabifyWhileSimulating&&S.grabify(),t.one("layoutstop",i.stop),t.trigger({type:"layoutstop",layout:t})};h.start(),!i.infinite&&null!=i.maxSimulationTime&&i.maxSimulationTime>0&&1/0!==i.maxSimulationTime&&setTimeout(function(){t.stop()},i.maxSimulationTime)}),this},t.prototype.stop=function(){return null!=this._private.system&&this._private.system.stop(),this._private.doneHandler&&this._private.doneHandler(),this},e("layout","arbor",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},i,t)}var i={fit:!0,directed:!1,padding:30,circle:!1,boundingBox:void 0,avoidOverlap:!0,roots:void 0,maximalAdjustments:0,animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){var t,i=this.options,r=i,n=i.cy,a=r.eles,o=a.nodes().not(":parent"),s=a,l=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(e.is.elementOrCollection(r.roots))t=r.roots;else if(e.is.array(r.roots)){for(var u=[],c=0;c0;){var f=n.collection();a.bfs({roots:v[0],visit:function(e,t,i){f=f.add(i)},directed:!1}),v=v.not(f),h.push(f)}t=n.collection();for(var c=0;ck;){for(var C=P.shift(),T=C.neighborhood().nodes(),N=!1,c=0;cc;c++)for(var M=x[c],R=M.length,X=0;R>X;X++){var p=M[X],V=p._private.scratch.breadthfirst,Y=z(p);Y&&(V.intEle=Y,O.push(p))}for(var c=0;cx.length-1;)x.push([]);x[q].push(p),V.depth=q,V.index=x[q].length-1}B()}var F=0;if(r.avoidOverlap){for(var c=0;cl||0===t)&&(r+=s/u,n++)}return n=Math.max(1,n),r/=n,0===n&&(r=void 0),H[e.id()]=r,r},Z=function(e,t){var i=$(e),r=$(t);return i-r},U=0;3>U;U++){for(var c=0;c0&&x[0].length<=3?c/2:0),p=2*Math.PI/x[n].length*a;return 0===n&&1===x[0].length&&(d=1),{x:K.x+d*Math.cos(p),y:K.y+d*Math.sin(p)}}return{x:K.x+(a+1-(o+1)/2)*s,y:(n+1)*u}}var h={x:K.x+(a+1-(o+1)/2)*s,y:(n+1)*u};if(t)return h;var v=S[e.id()];if(v){h.x=0;for(var f=0;f=0;c--)for(var M=x[c],X=0;X1&&r.avoidOverlap){d*=1.75;var c=2*Math.PI/o.length,f=Math.cos(c)-Math.cos(0),g=Math.sin(c)-Math.sin(0),y=Math.sqrt(d*d/(f*f+g*g));t=Math.max(y,t)}var m=function(){var e=t*Math.cos(u),i=t*Math.sin(u),n={x:l.x+e,y:l.y+i};return u=r.counterclockwise?u-c:u+c,n};return o.layoutPositions(this,r,m),this},e("layout","circle",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},i,t)}var i={animate:!1,refresh:1,maxSimulationTime:4e3,ungrabifyWhileSimulating:!1,fit:!0,padding:30,boundingBox:void 0,ready:function(){},stop:function(){},randomize:!1,avoidOverlap:!0,handleDisconnected:!0,nodeSpacing:function(){return 10},flow:void 0,alignment:void 0,edgeLength:void 0,edgeSymDiffLength:void 0,edgeJaccardLength:void 0,unconstrIter:void 0,userConstIter:void 0,allConstIter:void 0,infinite:!1};t.prototype.run=function(){var t=this,i=this.options;return e.util.require("cola",function(r){var n=i.cy,a=i.eles,o=a.nodes(),s=a.edges(),l=!1,u=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),c=function(t,i){if(e.is.fn(t)){var r=t;return r.apply(i,[i])}return t},d=function(){for(var t={min:1/0,max:-1/0},r={min:1/0,max:-1/0},a=0;ai&&!e;i++)e=e||n();return e};if(i.animate){var o=function(){a()||e.util.requestAnimationFrame(o)};e.util.requestAnimationFrame(o)}else for(;!n(););},on:function(){},drag:function(){}});t.adaptor=g;var y=o.filter(":grabbable");i.ungrabifyWhileSimulating&&y.ungrabify();var m;o.on("grab free position",m=function(t){var i=this,r=i._private.scratch.cola,n=i._private.position;switch(i.grabbed()?(r.x=n.x-u.x1,r.y=n.y-u.y1,g.dragstart(r)):e.is.number(r.x)&&e.is.number(r.y)&&(n.x=r.x+u.x1,n.y=r.y+u.y1),t.type){case"grab":g.dragstart(r),g.resume();break;case"free":g.dragend(r)}});var x;o.on("lock unlock",x=function(){var e=this,t=e._private.scratch.cola;e.locked()?g.dragstart(t):g.dragend(t)});var b=o.stdFilter(function(e){return!e.isParent()});if(g.nodes(b.map(function(e,t){var r=c(i.nodeSpacing,e),n=e.position(),a=e._private.scratch.cola={x:i.randomize?Math.round(Math.random()*u.w):n.x,y:i.randomize?Math.round(Math.random()*u.h):n.y,width:e.outerWidth()+2*r,height:e.outerHeight()+2*r,index:t};return a})),i.alignment){var w=[],_=[];b.forEach(function(e){var t=c(i.alignment,e),r=e._private.scratch.cola,n=r.index;t&&(null!=t.x&&w.push({node:n,offset:t.x}),null!=t.y&&_.push({node:n,offset:t.y}))});var E=[];w.length>0&&E.push({type:"alignment",axis:"x",offsets:w}),_.length>0&&E.push({type:"alignment",axis:"y",offsets:_}),g.constraints(E)}g.groups(o.stdFilter(function(e){return e.isParent()}).map(function(e,t){return e._private.scratch.cola={index:t,leaves:e.descendants().stdFilter(function(e){return!e.isParent()}).map(function(e){return e[0]._private.scratch.cola.index})},e}).map(function(e){return e._private.scratch.cola.groups=e.descendants().stdFilter(function(e){return e.isParent()}).map(function(e){return e._private.scratch.cola.index}),e._private.scratch.cola}));var S,P;null!=i.edgeLength?(S=i.edgeLength,P="linkDistance"):null!=i.edgeSymDiffLength?(S=i.edgeSymDiffLength,P="symmetricDiffLinkLengths"):null!=i.edgeJaccardLength?(S=i.edgeJaccardLength,P="jaccardLinkLengths"):(S=100,P="linkDistance");var D=function(e){return e.calcLength};if(g.links(s.stdFilter(function(e){return!e.source().isParent()&&!e.target().isParent()}).map(function(e){var t=e._private.scratch.cola={source:e.source()[0]._private.scratch.cola.index,target:e.target()[0]._private.scratch.cola.index};return null!=S&&(t.calcLength=c(S,e)),t})),g.size([u.w,u.h]),null!=S&&g[P](D),i.flow){var k,C="y",T=50;e.is.string(i.flow)?k={axis:i.flow,minSeparation:T}:e.is.number(i.flow)?k={axis:C,minSeparation:i.flow}:e.is.plainObject(i.flow)?(k=i.flow,k.axis=k.axis||C,k.minSeparation=null!=k.minSeparation?k.minSeparation:T):k={axis:C,minSeparation:T},g.flowLayout(k.axis,k.minSeparation)}g.avoidOverlaps(i.avoidOverlap).handleDisconnected(i.handleDisconnected).start(i.unconstrIter,i.userConstIter,i.allConstIter),t.trigger({type:"layoutstart",layout:t}),i.infinite||setTimeout(function(){g.stop()},i.maxSimulationTime)}),this},t.prototype.stop=function(){return this.adaptor&&(this.manuallyStopped=!0,this.adaptor.stop()),this},e("layout","cola",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},i,t)}var i={fit:!0,padding:30,startAngle:1.5*Math.PI,counterclockwise:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,height:void 0,width:void 0,concentric:function(){return this.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){for(var t=this.options,i=t,r=t.cy,n=i.eles,a=n.nodes().not(":parent"),o=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=[],u=i.startAngle,c=0,d=0;d0){var m=Math.abs(g[0].value-y.value);m>=v&&(g=[],f.push(g))}g.push(y)}var x={},b=0,w=c+i.minNodeSpacing;if(!i.avoidOverlap){var _=f.length>0&&f[0].length>1,E=Math.min(o.w,o.h)/2-w,S=E/(f.length+_?1:0);w=Math.min(w,S)}for(var d=0;d1&&i.avoidOverlap){var k=Math.cos(D)-Math.cos(0),C=Math.sin(D)-Math.sin(0),T=Math.sqrt(w*w/(k*k+C*C));b=Math.max(T,b)}for(var N=0;N=d;){var g=c[d++],y=s.idToIndex[g],m=s.layoutNodes[y],x=m.children;if(x.length>0){s.graphSet.push(x);for(var l=0;lr.count?0:r.graph},o=function(e,t,i,r){var n=r.graphSet[i];if(-1<$.inArray(e,n)&&-1<$.inArray(t,n))return{count:2,graph:i};for(var a=0,s=0;ss;s++)for(var l=e.layoutNodes[e.idToIndex[a[s]]],u=s+1;o>u;u++){var c=e.layoutNodes[e.idToIndex[a[u]]];p(l,c,e,t,i)}}},p=function(e,t,i,r,n){var a="Node repulsion. Node1: "+e.id+" Node2: "+t.id,o=t.positionX-e.positionX,s=t.positionY-e.positionY;if(a+="\ndirectionX: "+o+", directionY: "+s,0===o&&0===s)return void(a+="\nNodes have the same position.");var l=v(e,t,o,s);if(l>0){a+="\nNodes DO overlap.",a+="\nOverlap: "+l;var u=n.nodeOverlap*l,c=Math.sqrt(o*o+s*s);a+="\nDistance: "+c;var d=u*o/c,p=u*s/c}else{a+="\nNodes do NOT overlap.";var f=h(e,o,s),g=h(t,-1*o,-1*s),y=g.x-f.x,m=g.y-f.y,x=y*y+m*m,c=Math.sqrt(x);a+="\nDistance: "+c;var u=n.nodeRepulsion/x,d=u*y/c,p=u*m/c}e.offsetX-=d,e.offsetY-=p,t.offsetX+=d,t.offsetY+=p,a+="\nForceX: "+d+" ForceY: "+p,w(a)},h=function(e,t,i){var r=e.positionX,n=e.positionY,a=e.height,o=e.width,s=i/t,l=a/o,u="Computing clipping point of node "+e.id+" . Height: "+a+", Width: "+o+"\nDirection "+t+", "+i,c={};do{if(0===t&&i>0){c.x=r,u+="\nUp direction",c.y=n+a/2;break}if(0===t&&0>i){c.x=r,c.y=n+a/2,u+="\nDown direction";break}if(t>0&&s>=-1*l&&l>=s){c.x=r+o/2,c.y=n+o*i/2/t,u+="\nRightborder";break}if(0>t&&s>=-1*l&&l>=s){c.x=r-o/2,c.y=n-o*i/2/t,u+="\nLeftborder";break}if(i>0&&(-1*l>=s||s>=l)){c.x=r+a*t/2/i,c.y=n+a/2,u+="\nTop border";break}if(0>i&&(-1*l>=s||s>=l)){c.x=r-a*t/2/i,c.y=n-a/2,u+="\nBottom border";break}}while(!1);return u+="\nClipping point found at "+c.x+", "+c.y,w(u),c},v=function(e,t,i,r){if(i>0)var n=e.maxX-t.minX;else var n=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else var a=t.maxY-e.minY;return n>=0&&a>=0?Math.sqrt(n*n+a*a):0},f=function(e,t,i){for(var r=0;rd;d++){var p=e.layoutNodes[e.idToIndex[a[d]]];r="Node: "+p.id;var h=s-p.positionX,v=l-p.positionY,f=Math.sqrt(h*h+v*v);if(f>1){var g=i.gravity*h/f,y=i.gravity*v/f;p.offsetX+=g,p.offsetY+=y,r+=": Applied force: "+g+", "+y}else r+=": skypped since it's too close to center";w(r)}}},y=function(e){var t=[],i=0,r=-1;for(w("propagateForces"),t.push.apply(t,e.graphSet[0]),r+=e.graphSet[0].length;r>=i;){var n=t[i++],a=e.idToIndex[n],o=e.layoutNodes[a],s=o.children;if(0i)var a={x:i*e/n,y:i*t/n};else var a={x:e,y:t};return r+=".\nResult: ("+a.x+", "+a.y+")",w(r),a},b=function(e,t){var i="Propagating new position/size of node "+e.id,r=e.parentId;if(null==r)return i+=". No parent node.",void w(i);var n=t.layoutNodes[t.idToIndex[r]],a=!1;return(null==n.maxX||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,a=!0,i+="\nNew maxX for parent node "+n.id+": "+n.maxX),(null==n.minX||e.minX-n.padLeftn.maxY)&&(n.maxY=e.maxY+n.padBottom,a=!0,i+="\nNew maxY for parent node "+n.id+": "+n.maxY),(null==n.minY||e.minY-n.padTops){var h=d(),v=p();(h-1)*v>=s?d(h-1):(v-1)*h>=s&&p(v-1)}else for(;s>c*u;){var h=d(),v=p();(v+1)*h>=s?p(v+1):d(h+1)}var f=o.w/c,g=o.h/u;if(i.avoidOverlap)for(var y=0;y=c&&(P=0,S++)},k={},y=0;y0&&r.animate&&(s=!0,m.rtrigger("position"),r.fit&&l.fit(r.padding),m=l.collection(),s=!1)},function(){},function(e,n){if(!i.stopped){var a=g(n),o=e.data.element;o.locked()||o.grabbed()||(o._private.position={x:a.x,y:a.y},m.merge(o)),b==x&&(t.one("layoutready",r.ready),t.trigger({type:"layoutready",layout:t})),b++}});c.each(function(e,t){r.random||a(t)});var _;c.on("position",_=function(){s||a(this)});var E=c.filter(":grabbable");i.stopSystem=function(){i.stopped=!0,h.filterNodes(function(){return!1}),r.ungrabifyWhileSimulating&&E.grabify(),r.fit&&l.fit(r.padding),c.off("drag position",_),t.one("layoutstop",r.stop),t.trigger({type:"layoutstop",layout:t}),i.stopSystem=null},o(),r.infinite||setTimeout(function(){i.stop()},r.maxSimulationTime)}),this},t.prototype.stop=function(){return null!=this.stopSystem&&this.stopSystem(),this},e("layout","springy",t)}(cytoscape),function(e){"use strict";function t(e){this.options=e}t.prototype.recalculateRenderedStyle=function(){},t.prototype.notify=function(){},e("renderer","null",t)}(cytoscape);