not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
278 KiB

/*!
* This file is part of Cytoscape.js 2.4.5.
*
* 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 <http://www.gnu.org/licenses/>.
*/
var cytoscape;!function(e){"use strict";var t=cytoscape=function(){return cytoscape.init.apply(cytoscape,arguments)};t.version="2.4.5",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){"use strict";var t=0,r=1,i=2,n=function(e){return this instanceof n?(this.id="Thenable/1.0.7",this.state=t,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},void("function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this)))):new n(e)};n.prototype={fulfill:function(e){return a(this,r,"fulfillValue",e)},reject:function(e){return a(this,i,"rejectReason",e)},then:function(e,t){var r=this,i=new n;return r.onFulfilled.push(l(e,i,"fulfill")),r.onRejected.push(l(t,i,"reject")),o(r),i.proxy}};var a=function(e,r,i,n){return e.state===t&&(e.state=r,e[i]=n,o(e)),e},o=function(e){e.state===r?s(e,"onFulfilled",e.fulfillValue):e.state===i&&s(e,"onRejected",e.rejectReason)},s=function(e,t,r){if(0!==e[t].length){var i=e[t];e[t]=[];var n=function(){for(var e=0;e<i.length;e++)i[e](r)};"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick(n):"function"==typeof setImmediate?setImmediate(n):setTimeout(n,0)}},l=function(e,t,r){return function(i){if("function"!=typeof e)t[r].call(t,i);else{var n;try{n=e(i)}catch(a){return void t.reject(a)}u(t,n)}}},u=function(e,t){if(e===t||e.proxy===t)return void e.reject(new TypeError("cannot resolve promise with itself"));var r;if("object"==typeof t&&null!==t||"function"==typeof t)try{r=t.then}catch(i){return void e.reject(i)}if("function"!=typeof r)e.fulfill(t);else{var n=!1;try{r.call(t,function(r){n||(n=!0,r===t?e.reject(new TypeError("circular thenable chain")):u(e,r))},function(t){n||(n=!0,e.reject(t))})}catch(i){n||e.reject(i)}}};e.Promise="undefined"==typeof Promise?n:Promise,e.Promise.all=e.Promise.all||function(t){return new e.Promise(function(e,r){for(var i=new Array(t.length),n=0,a=function(r,a){i[r]=a,n++,n===t.length&&e(i)},o=0;o<t.length;o++)!function(e){var i=t[e],n=null!=i.then;if(n)i.then(function(t){a(e,t)},function(e){r(e)});else{var o=i;a(e,o)}}(o)})}}(cytoscape),function(e,t){"use strict";var r="string",i=typeof{},n="function";e.is={defined:function(e){return null!=e},string:function(e){return null!=e&&typeof e==r},fn:function(e){return null!=e&&typeof e===n},array:function(e){return Array.isArray?Array.isArray(e):null!=e&&e instanceof Array},plainObject:function(t){return null!=t&&typeof t===i&&!e.is.array(t)&&t.constructor===Object},object:function(e){return null!=e&&typeof e===i},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},thread:function(t){return t instanceof e.Thread},fabric:function(t){return t instanceof e.Fabric},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)},promise:function(t){return e.is.object(t)&&e.is.fn(t.then)},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.chromium()},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,r,i,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(r in t)i=s[r],n=t[r],s!==n&&(c&&n&&(e.is.plainObject(n)||(a=e.is.array(n)))?(a?(a=!1,o=i&&e.is.array(i)?i:[]):o=i&&e.is.plainObject(i)?i:{},s[r]=e.util.extend(c,o,n)):void 0!==n&&(s[r]=n));return s},require:function(r,i,n){var a;n=e.util.extend({msgIfNotFound:!0},n);var o=!1,s=function(e){o=!0,i(e)},l=function(e){t&&(a=t[r]),void 0!==a&&s(a),e&&e()},u=function(){o||c(d)},c=function(e){"undefined"!=typeof module&&module.exports&&require&&(a=require(r)),void 0!==a&&s(a),e&&e()},d=function(){o||h(p)},h=function(e){"undefined"!=typeof define&&define.amd&&require&&require([r],function(t){a=t,void 0!==a&&s(a),e&&e()})},p=function(){!o&&n.msgIfNotFound&&e.util.error("Cytoscape.js tried to pull in dependency `"+r+"` but no module (i.e. CommonJS, AMD, or window) was found")};l(u)},requires:function(t,r){for(var i=[],n=[],a=function(){for(var e=0;e<t.length;e++)if(!n[e])return;r.apply(r,i)},o=0;o<t.length;o++)!function(){var r=t[o],s=o;e.util.require(r,function(e){i[s]=e,n[s]=!0,a()})}()},throttle:function(t,r,i){var n=!0,a=!0;return i===!1?n=!1:e.is.plainObject(i)&&(n="leading"in i?i.leading:n,a="trailing"in i?i.trailing:a),i=i||{},i.leading=n,i.maxWait=r,i.trailing=a,e.util.debounce(t,r,i)},now:function(){return+new Date},debounce:function(t,r,i){var n,a,o,s,l,u,c,d=0,h=!1,p=!0;if(e.is.fn(t)){if(r=Math.max(0,r)||0,i===!0){var v=!0;p=!1}else e.is.plainObject(i)&&(v=i.leading,h="maxWait"in i&&(Math.max(r,i.maxWait)||0),p="trailing"in i?i.trailing:p);var f=function(){var i=r-(e.util.now()-s);if(0>=i){a&&clearTimeout(a);var h=c;a=u=c=void 0,h&&(d=e.util.now(),o=t.apply(l,n),u||a||(n=l=null))}else u=setTimeout(f,i)},g=function(){u&&clearTimeout(u),a=u=c=void 0,(p||h!==r)&&(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=p&&(u||!v),h===!1)var i=v&&!u;else{a||v||(d=s);var y=h-(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||r===h||(u=setTimeout(f,r)),i&&(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 r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);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 r in e){t=!1;break}return t},pushMap:function(t){var r=e.util.getMap(t);null==r?e.util.setMap($.extend({},t,{value:[t.value]})):r.push(t.value)},setMap:function(t){for(var r,i=t.map,n=t.keys,a=n.length,o=0;a>o;o++){var r=n[o];e.is.plainObject(r)&&e.util.error("Tried to set map with object key"),o<n.length-1?(null==i[r]&&(i[r]={}),i=i[r]):i[r]=t.value}},getMap:function(t){for(var r=t.map,i=t.keys,n=i.length,a=0;n>a;a++){var o=i[a];if(e.is.plainObject(o)&&e.util.error("Tried to get map with object key"),r=r[o],null==r)return r}return r},deleteMap:function(t){for(var r=t.map,i=t.keys,n=i.length,a=t.keepChildren,o=0;n>o;o++){var s=i[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 r)a[u]||(r[u]=void 0);else r[s]=void 0;else r=r[s]}},capitalize:function(t){return e.is.emptyString(t)?t:t.charAt(0).toUpperCase()+t.substring(1)},camel2dash:function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],n=i.toLowerCase(),a=i!==n;a?(t.push("-"),t.push(n)):t.push(i)}var o=t.length===e.length;return o?e:t.join("")},dash2camel:function(e){for(var t=[],r=!1,i=0;i<e.length;i++){var n=e[i],a="-"===n;a?r=!0:(t.push(r?n.toUpperCase():n),r=!1)}return t.join("")},trim:function(e){var t,r;for(t=0;t<e.length&&" "===e[t];t++);for(r=e.length-1;r>t&&" "===e[r];r--);return e.substring(t,r+1)},hex2tuple:function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,r,i,n=4===e.length,a=16;return n?(t=parseInt(e[1]+e[1],a),r=parseInt(e[2]+e[2],a),i=parseInt(e[3]+e[3],a)):(t=parseInt(e[1]+e[2],a),r=parseInt(e[3]+e[4],a),i=parseInt(e[5]+e[6],a)),[t,r,i]}},hsl2tuple:function(t){function r(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?e+6*(t-e)*r:.5>r?t:2/3>r?e+(t-e)*(2/3-r)*6:e}var i,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 h=.5>o?o*(1+a):o+a-o*a,p=2*o-h;l=Math.round(255*r(p,h,n+1/3)),u=Math.round(255*r(p,h,n)),c=Math.round(255*r(p,h,n-1/3))}i=[l,u,c,s]}return i},rgb2tuple:function(t){var r,i=new RegExp("^"+e.util.regex.rgba+"$").exec(t);if(i){r=[];for(var n=[],a=1;3>=a;a++){var o=i[a];if("%"===o[o.length-1]&&(n[a]=!0),o=parseFloat(o),n[a]&&(o=o/100*255),0>o||o>255)return;r.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=i[4];if(void 0!==u){if(u=parseFloat(u),0>u||u>1)return;r.push(u)}}return r},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 r=e[0],i=e[1],n=e[2];return"#"+t(r)+t(i)+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 r=t?t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame:null;r=r||function(e){e&&setTimeout(e,1e3/60)},e.util.requestAnimationFrame=function(e){r(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 r=t.x-e.x,i=t.y-e.y;return Math.sqrt(r*r+i*i)},e.math.qbezierAt=function(e,t,r,i){return(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*r},e.math.qbezierPtAt=function(t,r,i,n){return{x:e.math.qbezierAt(t.x,r.x,i.x,n),y:e.math.qbezierAt(t.y,r.y,i.y,n)}},e.math.boundingBoxesIntersect=function(e,t){return e.x1>t.x2?!1:t.x1>e.x2?!1:e.x2<t.x1?!1:t.x2<e.x1?!1:e.y2<t.y1?!1:t.y2<e.y1?!1:e.y1>t.y2?!1:t.y1>e.y2?!1:!0},e.math.inBoundingBox=function(e,t,r){return e.x1<=t&&t<=e.x2&&e.y1<=r&&r<=e.y2},e.math.pointInBoundingBox=function(e,t){return this.inBoundingBox(e,t.x,t.y)},e.math.roundRectangleIntersectLine=function(e,t,r,i,n,a,o){var s,l=this.getRoundRectangleRadius(n,a),u=n/2,c=a/2,d=r-u+l-o,h=i-c-o,p=r+u-l+o,v=h;if(s=this.finiteLinesIntersect(e,t,r,i,d,h,p,v,!1),s.length>0)return s;var f=r+u+o,g=i-c+l-o,y=f,m=i+c-l+o;if(s=this.finiteLinesIntersect(e,t,r,i,f,g,y,m,!1),s.length>0)return s;var x=r-u+l-o,b=i+c+o,w=r+u-l+o,_=b;if(s=this.finiteLinesIntersect(e,t,r,i,x,b,w,_,!1),s.length>0)return s;var E=r-u-o,S=i-c+l-o,D=E,k=i+c-l+o;if(s=this.finiteLinesIntersect(e,t,r,i,E,S,D,k,!1),s.length>0)return s;var T,P=r-u+l,C=i-c+l;if(T=this.intersectLineCircle(e,t,r,i,P,C,l+o),T.length>0&&T[0]<=P&&T[1]<=C)return[T[0],T[1]];var M=r+u-l,B=i-c+l;if(T=this.intersectLineCircle(e,t,r,i,M,B,l+o),T.length>0&&T[0]>=M&&T[1]<=B)return[T[0],T[1]];var N=r+u-l,I=i+c-l;if(T=this.intersectLineCircle(e,t,r,i,N,I,l+o),T.length>0&&T[0]>=N&&T[1]>=I)return[T[0],T[1]];var O=r-u+l,z=i+c-l;return T=this.intersectLineCircle(e,t,r,i,O,z,l+o),T.length>0&&T[0]<=O&&T[1]>=z?[T[0],T[1]]:[]},e.math.roundRectangleIntersectBox=function(e,t,r,i,n,a,o,s,l){var u=this.getRoundRectangleRadius(n,a),c=o-n/2-l,d=s-a/2+u-l,h=o+n/2+l,p=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,r),x=Math.max(e,r),b=Math.min(t,i),w=Math.max(t,i);return c>x?!1:m>h?!1:f>w?!1:b>y?!1:c>=m&&x>=c&&d>=b&&w>=d?!0:h>=m&&x>=h&&d>=b&&w>=d?!0:h>=m&&x>=h&&p>=b&&w>=p?!0:c>=m&&x>=c&&p>=b&&w>=p?!0:m>=c&&h>=m&&b>=d&&p>=b?!0:x>=c&&h>=x&&b>=d&&p>=b?!0:x>=c&&h>=x&&w>=d&&p>=w?!0:m>=c&&h>=m&&w>=d&&p>=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,p-l)?!0:this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,v+l,p-l)?!0:!1},e.math.checkInBoundingCircle=function(e,t,r,i,n,a,o,s){return e=(e-o)/(n+i),t=(t-s)/(a+i),r>=e*e+t*t},e.math.boxInBezierVicinity=function(e,t,r,i,n,a,o,s,l,u,c){var d=.25*n+.5*o+.25*l,h=.25*a+.5*s+.25*u,p=Math.min(e,r)-c,v=Math.min(t,i)-c,f=Math.max(e,r)+c,g=Math.max(t,i)+c;if(n>=p&&f>=n&&a>=v&&g>=a)return 1;if(l>=p&&f>=l&&u>=v&&g>=u)return 1;if(d>=p&&f>=d&&h>=v&&g>=h)return 1;if(o>=p&&f>=o&&s>=v&&g>=s)return 1;var y=Math.min(n,d,l),m=Math.min(a,h,u),x=Math.max(n,d,l),b=Math.max(a,h,u);return y>f||p>x||m>g||v>b?0:1},e.math.checkBezierInBox=function(t,r,i,n,a,o,s,l,u,c,d){function h(d){var h=e.math.qbezierAt(a,s,u,d),p=e.math.qbezierAt(o,l,c,d);return h>=t&&i>=h&&p>=r&&n>=p}for(var p=0;1>=p;p+=.25)if(!h(p))return!1;return!0},e.math.checkStraightEdgeInBox=function(e,t,r,i,n,a,o,s,l){return n>=e&&r>=n&&o>=e&&r>=o&&a>=t&&i>=a&&s>=t&&i>=s},e.math.checkStraightEdgeCrossesBox=function(e,t,r,i,n,a,o,s,l){var u,c,d=Math.min(e,r)-l,h=Math.min(t,i)-l,p=Math.max(e,r)+l,v=Math.max(t,i)+l,f=o-n,g=n,y=s-a,m=a;if(Math.abs(f)<1e-4)return n>=d&&p>=n&&Math.min(a,s)<=h&&Math.max(a,s)>=v;var x=(d-g)/f;if(x>0&&1>=x&&(u=y*x+m,u>=h&&v>=u))return!0;var b=(p-g)/f;if(b>0&&1>=b&&(u=y*b+m,u>=h&&v>=u))return!0;var w=(h-m)/y;if(w>0&&1>=w&&(c=f*w+g,c>=d&&p>=c))return!0;var _=(v-m)/y;return _>0&&1>=_&&(c=f*_+g,c>=d&&p>=c)?!0:!1},e.math.checkBezierCrossesBox=function(e,t,r,i,n,a,o,s,l,u,c){var d=Math.min(e,r)-c,h=Math.min(t,i)-c,p=Math.max(e,r)+c,v=Math.max(t,i)+c;if(n>=d&&p>=n&&a>=h&&v>=a)return!0;if(l>=d&&p>=l&&u>=h&&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=(p-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 D,k,T=g*g-4*f*(y-p);if(T>0){var S=Math.sqrt(T);D=(-g+S)/(2*f),k=(-g-S)/(2*f),m.push(D,k)}}m.sort(function(e,t){return e-t});var P=a-2*s+u,C=-2*a+2*s,M=a,B=[];if(Math.abs(P)<1e-4){var N=(h-a)/C,I=(v-a)/C;B.push(N,I)}else{var O,z,L=C*C-4*P*(M-h);if(L>0){var S=Math.sqrt(L);O=(-C+S)/(2*P),z=(-C-S)/(2*P),B.push(O,z)}var R,V,A=C*C-4*P*(M-v);if(A>0){var S=Math.sqrt(A);R=(-C+S)/(2*P),V=(-C-S)/(2*P),B.push(R,V)}}B.sort(function(e,t){return e-t});for(var X=0;X<m.length;X+=2)for(var F=1;F<B.length;F+=2)if(m[X]<B[F]&&B[F]>=0&&m[X]<=1&&m[X+1]>B[F-1]&&B[F-1]<=1&&m[X+1]>=0)return!0;return!1},e.math.inLineVicinity=function(e,t,r,i,n,a,o){var s=o,l=Math.min(r,n),u=Math.max(r,n),c=Math.min(i,a),d=Math.max(i,a);return e>=l-s&&u+s>=e&&t>=c-s&&d+s>=t},e.math.inBezierVicinity=function(e,t,r,i,n,a,o,s,l){var u={x1:Math.min(r,o,n),x2:Math.max(r,o,n),y1:Math.min(i,s,a),y2:Math.max(i,s,a)};return e<u.x1||e>u.x2||t<u.y1||t>u.y2?!1:!0},e.math.solveCubic=function(e,t,r,i,n){t/=e,r/=e,i/=e;var a,o,s,l,u,c,d,h;return o=(3*r-t*t)/9,s=-(27*i)+t*(9*r-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?(h=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3),n[0]=-d+2*h,void(n[4]=n[2]=-(h+d))):(o=-o,l=o*o*o,l=Math.acos(s/Math.sqrt(l)),h=2*Math.sqrt(o),n[0]=-d+h*Math.cos(l/3),n[2]=-d+h*Math.cos((l+2*Math.PI)/3),void(n[4]=-d+h*Math.cos((l+4*Math.PI)/3))))},e.math.sqDistanceToQuadraticBezier=function(e,t,r,i,n,a,o,s){var l=1*r*r-4*r*n+2*r*o+4*n*n-4*n*o+o*o+i*i-4*i*a+2*i*s+4*a*a-4*a*s+s*s,u=9*r*n-3*r*r-3*r*o-6*n*n+3*n*o+9*i*a-3*i*i-3*i*s-6*a*a+3*a*s,c=3*r*r-6*r*n+r*o-r*e+2*n*n+2*n*e-o*e+3*i*i-6*i*a+i*s-i*t+2*a*a+2*a*t-s*t,d=1*r*n-r*r+r*e-n*e+i*a-i*i+i*t-a*t,h=[];this.solveCubic(l,u,c,d,h);for(var p=1e-7,v=[],f=0;6>f;f+=2)Math.abs(h[f+1])<p&&h[f]>=0&&h[f]<=1&&v.push(h[f]);v.push(1),v.push(0);for(var g,y,m,x,b=-1,w=0;w<v.length;w++)y=Math.pow(1-v[w],2)*r+2*(1-v[w])*v[w]*n+v[w]*v[w]*o,m=Math.pow(1-v[w],2)*i+2*(1-v[w])*v[w]*a+v[w]*v[w]*s,x=Math.pow(y-e,2)+Math.pow(m-t,2),b>=0?b>x&&(b=x,g=v[w]):(b=x,g=v[w]);return b},e.math.sqDistanceToFiniteLine=function(e,t,r,i,n,a){var o=[e-r,t-i],s=[n-r,a-i],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,r,i,n,a,o,s,l){var u=new Array(r.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),h=Math.sin(-c),p=0;p<u.length/2;p++)u[2*p]=a/2*(r[2*p]*d-r[2*p+1]*h),u[2*p+1]=o/2*(r[2*p+1]*d+r[2*p]*h),u[2*p]+=i,u[2*p+1]+=n;var v;if(l>0){var f=this.expandPolygon(u,-l);v=this.joinLines(f)}else v=u;for(var g,y,m,x,b,w=0,_=0,p=0;p<v.length/2;p++)if(g=v[2*p],y=v[2*p+1],p+1<v.length/2?(m=v[2*(p+1)],x=v[2*(p+1)+1]):(m=v[2*(p+1-v.length/2)],x=v[2*(p+1-v.length/2)+1]),g==e&&m==e);else{if(!(g>=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,r,i,n,a,o,s,l,u=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],r=e[4*c+1],i=e[4*c+2],n=e[4*c+3],c<e.length/4-1?(a=e[4*(c+1)],o=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(a=e[0],o=e[1],s=e[2],l=e[3]);var d=this.finiteLinesIntersect(t,r,i,n,a,o,s,l,!0);u[2*c]=d[0],u[2*c+1]=d[1]}return u},e.math.expandPolygon=function(e,t){for(var r,i,n,a,o=new Array(2*e.length),s=0;s<e.length/2;s++){r=e[2*s],i=e[2*s+1],s<e.length/2-1?(n=e[2*(s+1)],a=e[2*(s+1)+1]):(n=e[0],a=e[1]);var l=a-i,u=-(n-r),c=Math.sqrt(l*l+u*u),d=l/c,h=u/c;o[4*s]=r+d*t,o[4*s+1]=i+h*t,o[4*s+2]=n+d*t,o[4*s+3]=a+h*t}return o},e.math.intersectLineEllipse=function(e,t,r,i,n,a){var o=r-e,s=i-t;o/=n,s/=a;var l=Math.sqrt(o*o+s*s),u=l-1;if(0>u)return[];var c=u/l;return[(r-e)*c+e,(i-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,r,i,n,a,o){var s=[r-e,i-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,h=d*d-4*c*l;if(0>h)return[];var p=(-d+Math.sqrt(h))/(2*c),v=(-d-Math.sqrt(h))/(2*c),f=Math.min(p,v),g=Math.max(p,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,r,i,n){var a=i-e,o=n-t,s=Math.sqrt(a*a+o*o),l=a/s,u=o/s;return[e+l*r,t+u*r]},e.math.findMaxSqDistanceToOrigin=function(e){for(var t,r=1e-6,i=0;i<e.length/2;i++)t=e[2*i]*e[2*i]+e[2*i+1]*e[2*i+1],t>r&&(r=t);return r},e.math.finiteLinesIntersect=function(e,t,r,i,n,a,o,s,l){var u=(o-n)*(t-a)-(s-a)*(e-n),c=(r-e)*(t-a)-(i-t)*(e-n),d=(s-a)*(r-e)-(o-n)*(i-t);if(0!==d){var h=u/d,p=c/d;return h>=0&&1>=h&&p>=0&&1>=p?[e+h*(r-e),t+h*(i-t)]:l?[e+h*(r-e),t+h*(i-t)]:[]}return 0===u||0===c?[e,r,o].sort()[1]===o?[o,s]:[e,r,n].sort()[1]===n?[n,a]:[n,o,r].sort()[1]===r?[r,i]:[]:[]},e.math.boxIntersectEllipse=function(e,t,r,i,n,a,o,s,l){if(e>r){var u=e;e=r,r=u}if(t>i){var c=t;t=i,i=c}var d=[s-a/2-n,l],h=[s+a/2+n,l],p=[s,l-o/2-n],v=[s,l+o/2+n];return r<d[0]?!1:e>h[0]?!1:t>v[1]?!1:i<p[1]?!1:e<=h[0]&&h[0]<=r&&t<=h[1]&&h[1]<=i?!0:e<=d[0]&&d[0]<=r&&t<=d[1]&&d[1]<=i?!0:e<=p[0]&&p[0]<=r&&t<=p[1]&&p[1]<=i?!0:e<=v[0]&&v[0]<=r&&t<=v[1]&&v[1]<=i?!0:(e=(e-s)/(a/2+n),r=(r-s)/(a/2+n),t=(t-l)/(o/2+n),i=(i-l)/(o/2+n),1>=e*e+t*t?!0:1>=r*r+t*t?!0:1>=r*r+i*i?!0:1>=e*e+i*i?!0:!1)},e.math.boxIntersectPolygon=function(t,r,i,n,a,o,s,l,u,c,d){if(t>i){var h=t;t=i,i=h}if(r>n){var p=r;r=n,n=p}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;m<v.length/2;m++)v[2*m]=o/2*(a[2*m]*g-a[2*m+1]*y),v[2*m+1]=s/2*(a[2*m+1]*g+a[2*m]*y),v[2*m]+=l,v[2*m+1]+=u;for(var x=v[0],b=v[0],w=v[1],_=v[1],m=1;m<v.length/2;m++)v[2*m]>b&&(b=v[2*m]),v[2*m]<x&&(x=v[2*m]),v[2*m+1]>_&&(_=v[2*m+1]),v[2*m+1]<w&&(w=v[2*m+1]);if(x-d>i)return!1;if(t>b+d)return!1;if(w-d>n)return!1;if(r>_+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;m<v.length/2;m++)if(t<=v[2*m]&&v[2*m]<=i&&r<=v[2*m+1]&&v[2*m+1]<=n)return!0;for(var m=0;m<E.length/2;m++){var D,k,T=E[2*m],P=E[2*m+1];if(m<E.length/2-1?(D=E[2*(m+1)],k=E[2*(m+1)+1]):(D=E[0],k=E[1]),e.math.finiteLinesIntersect(T,P,D,k,t,r,i,r,!1).length>0)return!0;if(e.math.finiteLinesIntersect(T,P,D,k,t,n,i,n,!1).length>0)return!0;if(e.math.finiteLinesIntersect(T,P,D,k,t,r,t,n,!1).length>0)return!0;if(e.math.finiteLinesIntersect(T,P,D,k,i,r,i,n,!1).length>0)return!0}return!1},e.math.polygonIntersectLine=function(t,r,i,n,a,o,s,l){for(var u,c=[],d=new Array(i.length),h=0;h<d.length/2;h++)d[2*h]=i[2*h]*o+n,d[2*h+1]=i[2*h+1]*s+a;var p;if(l>0){var v=e.math.expandPolygon(d,-l);p=e.math.joinLines(v)}else p=d;for(var f,g,y,m,h=0;h<p.length/2;h++)f=p[2*h],g=p[2*h+1],h<p.length/2-1?(y=p[2*(h+1)],m=p[2*(h+1)+1]):(y=p[0],m=p[1]),u=this.finiteLinesIntersect(t,r,n,a,f,g,y,m),0!==u.length&&c.push(u[0],u[1]);return c},e.math.shortenIntersection=function(e,t,r){var i=[e[0]-t[0],e[1]-t[1]],n=Math.sqrt(i[0]*i[0]+i[1]*i[1]),a=(n-r)/n;return 0>a&&(a=1e-5),[t[0]+a*i[0],t[1]+a*i[1]]},e.math.generateUnitNgonPointsFitToSquare=function(t,r){var i=e.math.generateUnitNgonPoints(t,r);return i=e.math.fitPolygonToSquare(i)},e.math.fitPolygonToSquare=function(e){for(var t,r,i=e.length/2,n=1/0,a=1/0,o=-(1/0),s=-(1/0),l=0;i>l;l++)t=e[2*l],r=e[2*l+1],n=Math.min(n,t),o=Math.max(o,t),a=Math.min(a,r),s=Math.max(s,r);for(var u=2/(o-n),c=2/(s-a),l=0;i>l;l++)t=e[2*l]=e[2*l]*u,r=e[2*l+1]=e[2*l+1]*c,n=Math.min(n,t),o=Math.max(o,t),a=Math.min(a,r),s=Math.max(s,r);if(-1>a)for(var l=0;i>l;l++)r=e[2*l+1]=e[2*l+1]+(-1-a);return e},e.math.generateUnitNgonPoints=function(e,t){var r=1/e*2*Math.PI,i=e%2===0?Math.PI/2+r/2:Math.PI/2;i+=t;for(var n,a,o,s=new Array(2*e),l=0;e>l;l++)n=l*r+i,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,r,i){var n={};switch(n[r]=i,t){case"core":case"collection":e.fn[t](n)}if("layout"===t){for(var o=i.prototype,s=[],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this}),o.stop||(o.stop=function(){var e=this.options;return e&&e.animate&&e.eles.stop(),this}),o.on=e.define.on({layout:!0}),o.one=e.define.on({layout:!0,unbindSelfOnTrigger:!0}),o.once=e.define.on({layout:!0,unbindAllBindersOnTrigger:!0}),o.off=e.define.off({layout:!0}),o.trigger=e.define.trigger({layout:!0}),e.define.eventAliasesOn(o)}return e.util.setMap({map:a,keys:[t,r],value:i})}function r(t,r){return e.util.getMap({map:a,keys:[t,r]})}function i(t,r,i,n,a){return e.util.setMap({map:o,keys:[t,r,i,n],value:a})}function n(t,r,i,n){return e.util.getMap({map:o,keys:[t,r,i,n]})}var a={};e.extensions=a;var o={};e.modules=o,e.extension=function(){return 2==arguments.length?r.apply(this,arguments):3==arguments.length?t.apply(this,arguments):4==arguments.length?n.apply(this,arguments):5==arguments.length?i.apply(this,arguments):void e.util.error("Invalid extension access syntax")}}(cytoscape),function(e,t){"use strict";if(e){var r=function(e){var t=e[0]._cyreg=e[0]._cyreg||{};return t};e.fn.cytoscape=function(i){var n=e(this);if("get"===i)return r(n).cy;if(t.is.fn(i)){var a=i,o=r(n).cy;if(o&&o.isReady())o.trigger("ready",[],a);else{var s=r(n),l=s.readies=s.readies||[];l.push(a)}}else if(t.is.plainObject(i))return n.each(function(){var t=e.extend({},i,{container:e(this)[0]});cytoscape(t)})},e.cytoscape=cytoscape,null==e.fn.cy&&null==e.cy&&(e.fn.cy=e.fn.cytoscape,e.cy=e.cytoscape)}}("undefined"!=typeof jQuery?jQuery:null,cytoscape),function(e){"use strict";function t(){return!1}function r(){return!0}e.Event=function(i,n){return this instanceof e.Event?(i&&i.type?(this.originalEvent=i,this.type=i.type,this.isDefaultPrevented=i.defaultPrevented?r:t):this.type=i,n&&(this.type=void 0!==n.type?n.type:this.type,this.cy=n.cy,this.cyTarget=n.cyTarget,this.cyPosition=n.cyPosition,this.cyRenderedPosition=n.cyRenderedPosition,this.namespace=n.namespace,this.layout=n.layout,this.data=n.data,this.message=n.message),void(this.timeStamp=i&&i.timeStamp||+new Date)):new e.Event(i,n)},e.Event.prototype={preventDefault:function(){this.isDefaultPrevented=r;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=r;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=r,this.stopPropagation()},isDefaultPrevented:t,isPropagationStopped:t,isImmediatePropagationStopped:t}}(cytoscape),function(e){"use strict";e.define={data:function(t){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,onSet:function(e){},canSet:function(e){return!0}};return t=e.util.extend({},r,t),function(r,i){var n=t,a=this,o=void 0!==a.length,s=o?a:[a],l=o?a[0]:a;if(e.is.string(r)){if(n.allowGetting&&void 0===i){var u;return l&&(u=l._private[n.field][r]),u}if(n.allowSetting&&void 0!==i){var c=!n.immutableKeys[r];if(c){for(var d=0,h=s.length;h>d;d++)n.canSet(s[d])&&(s[d]._private[n.field][r]=i);n.updateStyle&&a.updateStyle(),n.onSet(a),n.settingTriggersEvent&&a[n.triggerFnName](n.settingEvent)}}}else if(n.allowSetting&&e.is.plainObject(r)){var p,v,f=r;for(p in f){v=f[p];var c=!n.immutableKeys[p];if(c)for(var d=0,h=s.length;h>d;d++)n.canSet(s[d])&&(s[d]._private[n.field][p]=v)}n.updateStyle&&a.updateStyle(),n.onSet(a),n.settingTriggersEvent&&a[n.triggerFnName](n.settingEvent)}else if(n.allowBinding&&e.is.fn(r)){var g=r;a.bind(n.bindingEvent,g)}else if(n.allowGetting&&void 0===r){var u;return l&&(u=l._private[n.field]),u}return a}},removeData:function(t){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return t=e.util.extend({},r,t),function(r){var i=t,n=this,a=void 0!==n.length,o=a?n:[n];if(e.is.string(r)){for(var s=r.split(/\s+/),l=s.length,u=0;l>u;u++){var c=s[u];if(!e.is.emptyString(c)){var d=!i.immutableKeys[c];if(d)for(var h=0,p=o.length;p>h;h++)o[h]._private[i.field][c]=void 0}}i.triggerEvent&&n[i.triggerFnName](i.event)}else if(void 0===r){for(var h=0,p=o.length;p>h;h++){var v=o[h]._private[i.field];for(var c in v){var f=!i.immutableKeys[c];f&&(v[c]=void 0)}}i.triggerEvent&&n[i.triggerFnName](i.event)}return n}},event:{regex:/(\w+)(\.\w+)?/,optionalTypeRegex:/(\w+)?(\.\w+)?/,falseCallback:function(){return!1}},on:function(t){var r={unbindSelfOnTrigger:!1,unbindAllBindersOnTrigger:!1};return t=e.util.extend({},r,t),function(r,i,n,a){var o=this,s=void 0!==o.length,l=s?o:[o],u=e.is.string(r),c=t;if(e.is.plainObject(i)?(a=n,n=i,i=void 0):(e.is.fn(i)||i===!1)&&(a=i,n=void 0,i=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[r]=a,r=d}for(var h in r)if(a=r[h],a===!1&&(a=e.define.event.falseCallback),e.is.fn(a)){h=h.split(/\s+/);for(var p=0;p<h.length;p++){var v=h[p];if(!e.is.emptyString(v)){var f=v.match(e.define.event.regex);if(f)for(var g=f[1],y=f[2]?f[2]:void 0,m={callback:a,data:n,delegated:i?!0:!1,selector:i,selObj:new e.Selector(i),type:g,namespace:y,unbindSelfOnTrigger:c.unbindSelfOnTrigger,unbindAllBindersOnTrigger:c.unbindAllBindersOnTrigger,binders:l},x=0;x<l.length;x++){var b=l[x]._private;b.listeners=b.listeners||[],b.listeners.push(m)}}}}return o}},eventAliasesOn:function(t){var r=t;r.addListener=r.listen=r.bind=r.on,r.removeListener=r.unlisten=r.unbind=r.off,r.emit=r.trigger,r.pon=r.promiseOn=function(t,r){var i=this,n=Array.prototype.slice.call(arguments,0);return new e.Promise(function(e,t){var r=function(t){i.off.apply(i,o),e(t)},a=n.concat([r]),o=a.concat([]);i.on.apply(i,a)})}},off:function(t){var r={};return t=e.util.extend({},r,t),function(t,r,i){var n=this,a=void 0!==n.length,o=a?n:[n],s=e.is.string(t);if(0===arguments.length){for(var l=0;l<o.length;l++)o[l]._private.listeners=[];return n}if((e.is.fn(r)||r===!1)&&(i=r,r=void 0),s){var u={};u[t]=i,t=u}for(var c in t){i=t[c],i===!1&&(i=e.define.event.falseCallback),c=c.split(/\s+/);for(var d=0;d<c.length;d++){var h=c[d];if(!e.is.emptyString(h)){var p=h.match(e.define.event.optionalTypeRegex);if(p)for(var v=p[1]?p[1]:void 0,f=p[2]?p[2]:void 0,l=0;l<o.length;l++)for(var g=o[l]._private.listeners=o[l]._private.listeners||[],y=0;y<g.length;y++){var m=g[y],x=!f||f===m.namespace,b=!v||m.type===v,w=!i||i===m.callback,_=x&&b&&w;_&&(g.splice(y,1),y--)}}}}return n}},trigger:function(t){var r={};return t=e.util.extend({},r,t),function(r,i,n){var a=this,o=void 0!==a.length,s=o?a:[a],l=e.is.string(r),u=e.is.plainObject(r),c=e.is.event(r),d=this._private.cy||(e.is.core(this)?this:null),h=d?d.hasCompoundNodes():!1;if(l){var p=r.split(/\s+/);r=[];for(var v=0;v<p.length;v++){var f=p[v];if(!e.is.emptyString(f)){var g=f.match(e.define.event.regex),y=g[1],m=g[2]?g[2]:void 0;r.push({type:y,namespace:m})}}}else if(u){var x=r;r=[x]}i?e.is.array(i)||(i=[i]):i=[];for(var v=0;v<r.length;v++)for(var b=r[v],w=0;w<s.length;w++){var f,_=s[w],E=_._private.listeners=_._private.listeners||[],S=e.is.element(_),D=S||t.layout;if(c?(f=b,f.cyTarget=f.cyTarget||_,f.cy=f.cy||d):f=new e.Event(b,{cyTarget:_,cy:d,namespace:b.namespace}),b.layout&&(f.layout=b.layout),t.layout&&(f.layout=_),f.cyPosition){var k=f.cyPosition,T=d.zoom(),P=d.pan();f.cyRenderedPosition={x:k.x*T+P.x,y:k.y*T+P.y}}n&&(E=[{namespace:f.namespace,type:f.type,callback:n}]);for(var C=0;C<E.length;C++){var M=E[C],B=!M.namespace||M.namespace===f.namespace,N=M.type===f.type,I=M.delegated?_!==f.cyTarget&&e.is.element(f.cyTarget)&&M.selObj.matches(f.cyTarget):!0,O=B&&N&&I;if(O){var z=[f];if(z=z.concat(i),f.data=M.data?M.data:void 0,(M.unbindSelfOnTrigger||M.unbindAllBindersOnTrigger)&&(E.splice(C,1),C--),M.unbindAllBindersOnTrigger)for(var L=M.binders,R=0;R<L.length;R++){var V=L[R];if(V&&V!==_)for(var A=V._private.listeners,X=0;X<A.length;X++){var F=A[X];F===M&&(A.splice(X,1),X--)}}var Y=M.delegated?f.cyTarget:_,q=M.callback.apply(Y,z);(q===!1||f.isPropagationStopped())&&(D=!1,q===!1&&(f.stopPropagation(),f.preventDefault()))}}if(D){var j=h?_._private.parent:null,$=null!=j&&0!==j.length;$?(j=j[0],j.trigger(f)):d.trigger(f)}}return a}},animated:function(t){var r={};return t=e.util.extend({},r,t),function(){var e=this,t=void 0!==e.length,r=t?e:[e],i=this._private.cy||this;if(!i.styleEnabled())return!1;var n=r[0];
return n?n._private.animation.current.length>0:void 0}},clearQueue:function(t){var r={};return t=e.util.extend({},r,t),function(){var e=this,t=void 0!==e.length,r=t?e:[e],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var n=0;n<r.length;n++){var a=r[n];a._private.animation.queue=[]}return this}},delay:function(t){var r={};return t=e.util.extend({},r,t),function(e,t){var r=this._private.cy||this;return r.styleEnabled()?(this.animate({delay:e},{duration:e,complete:t}),this):this}},animate:function(t){var r={};return t=e.util.extend({},r,t),function(e,t){var r=this,i=void 0!==r.length,n=i?r:[r],a=this._private.cy||this,o=!i,s=!o;if(!a.styleEnabled())return this;var l,u=+new Date,c=a.style();switch(void 0===t&&(t={}),void 0===t.duration&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200}var d=!0;if(e)for(var h in e){d=!1;break}if(d)return this;if(e.css&&s&&(e.css=c.getValueStyle(e.css,{array:!0})),e.renderedPosition&&s){var p=e.renderedPosition,v=a.pan(),f=a.zoom();e.position={x:(p.x-v.x)/f,y:(p.y-v.y)/f}}if(e.panBy&&o){var g=e.panBy,y=a.pan();e.pan={x:y.x+g.x,y:y.y+g.y}}var m=e.center||e.centre;if(m&&o){var x=a.getCenterPan(m.eles,e.zoom);x&&(e.pan=x)}if(e.fit&&o){var b=e.fit,w=a.getFitViewport(b.eles||b.boundingBox,b.padding);w&&(e.pan=w.pan,e.zoom=w.zoom)}for(var h=0;h<n.length;h++){var _=n[h];l=_.animated()&&(void 0===t.queue||t.queue)?_._private.animation.queue:_._private.animation.current,l.push({properties:e,duration:t.duration,params:t,callTime:u})}return s&&a.addToAnimationPool(this),this}},stop:function(t){var r={};return t=e.util.extend({},r,t),function(e,t){var r=this,i=void 0!==r.length,n=i?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var o=0;o<n.length;o++){for(var s=n[o],l=s._private.animation.current,u=0;u<l.length;u++){var c=l[u];t&&(c.duration=0)}e&&(s._private.animation.queue=[]),t||(s._private.animation.current=[])}return a.notify({collection:this,type:"draw"}),this}}}}(cytoscape),function(e){"use strict";e.fn.selector=function(t,r){for(var i in t){var n=t[i];e.Selector.prototype[i]=n}},e.Selector=function(t,r){if(!(this instanceof e.Selector))return new e.Selector(t,r);void 0===r&&void 0!==t&&(r=t,t=void 0);var i=this;if(i._private={selectorText:null,invalid:!0},!r||e.is.string(r)&&r.match(/^\s*$/))null==t?i.length=0:(i[0]=o(),i[0].group=t,i.length=1);else if(e.is.element(r)){var n=new e.Collection(i.cy(),[r]);i[0]=o(),i[0].collection=n,i.length=1}else if(e.is.collection(r))i[0]=o(),i[0].collection=r,i.length=1;else if(e.is.fn(r))i[0]=o(),i[0].filter=r,i.length=1;else{if(!e.is.string(r))return void e.util.error("A selector must be created from a string; found "+r);var a=null,o=function(){return{classes:[],colonSelectors:[],data:[],group:null,ids:[],meta:[],collection:null,filter:null,parent:null,ancestor:null,subject:null,child:null,descendant:null}},s={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",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,r,i){return t})},u=s.comparatorOp.split("|"),c=0;c<u.length;c++){var d=u[c];s.comparatorOp+="|@"+d}for(var u=s.comparatorOp.split("|"),c=0;c<u.length;c++){var d=u[c];d.indexOf("!")>=0||"="!==d&&(s.comparatorOp+="|\\!"+d)}var h={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|:backgrounding|:nonbackgrounding)",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,r){var i=null!=new RegExp("^"+s.string+"$").exec(r);r=i?r.substring(1,r.length-1):parseFloat(r),this.data.push({field:l(e),operator:t,value:r})}},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,r){this.meta.push({field:l(e),operator:t,value:parseFloat(r)})}},nextQuery:{separator:!0,regex:s.separator,populate:function(){i[++c]=o(),a=null}},child:{separator:!0,regex:s.child,populate:function(){var e=o();e.parent=this,e.subject=a,i[c]=e}},descendant:{separator:!0,regex:s.descendant,populate:function(){var e=o();e.ancestor=this,e.subject=a,i[c]=e}},subject:{modifier:!0,regex:s.subject,populate:function(){return null!=a&&this.subject!=this?(e.util.error("Redefinition of subject in selector `"+r+"`"),!1):(a=this,void(this.subject=this))}}},p=0;for(var v in h)h[p]=h[v],h[p].name=v,p++;h.length=p,i._private.selectorText=r;var f=r,c=0,g=function(t){for(var r,i,n,a=0;a<h.length;a++){var o=h[a],s=o.name;if(!e.is.fn(t)||t(s,o)){var l=f.match(new RegExp("^"+o.regex));if(null!=l){i=l,r=o,n=s;var u=l[0];f=f.substring(u.length);break}}}return{expr:r,match:i,name:n}},y=function(){var e=f.match(/^\s+/);if(e){var t=e[0];f=f.substring(t.length)}};for(i[0]=o(),y();;){var m=g();if(null==m.expr)return void e.util.error("The selector `"+r+"`is invalid");for(var x=[],p=1;p<m.match.length;p++)x.push(m.match[p]);var b=m.expr.populate.apply(i[c],x);if(b===!1)return;if(f.match(/^\s*$/))break}for(i.length=c+1,p=0;p<i.length;p++){var w=i[p];if(null!=w.subject){for(;w.subject!=w;)if(null!=w.parent){var _=w.parent,E=w;E.parent=null,_.child=E,w=_}else{if(null==w.ancestor){e.util.error("When adjusting references for the selector `"+w+"`, neither parent nor ancestor was found");break}var S=w.ancestor,D=w;D.ancestor=null,S.descendant=D,w=S}i[p]=w.subject}}if(null!=t)for(var p=0;p<i.length;p++){if(null!=i[p].group&&i[p].group!=t)return void e.util.error("Group `"+i[p].group+"` conflicts with implicit group `"+t+"` in selector `"+r+"`");i[p].group=t}}i._private.invalid=!1},e.selfn=e.Selector.prototype,e.selfn.size=function(){return this.length},e.selfn.eq=function(e){return this[e]},e.selfn.find=function(){};var t=function(r,i){if(null!=r.group&&"*"!=r.group&&r.group!=i._private.group)return!1;for(var n=i.cy(),a=!0,o=0;o<r.colonSelectors.length;o++){var s=r.colonSelectors[o];switch(s){case":selected":a=i.selected();break;case":unselected":a=!i.selected();break;case":selectable":a=i.selectable();break;case":unselectable":a=!i.selectable();break;case":locked":a=i.locked();break;case":unlocked":a=!i.locked();break;case":visible":a=i.visible();break;case":hidden":a=!i.visible();break;case":transparent":a=i.transparent();break;case":grabbed":a=i.grabbed();break;case":free":a=!i.grabbed();break;case":removed":a=i.removed();break;case":inside":a=!i.removed();break;case":grabbable":a=i.grabbable();break;case":ungrabbable":a=!i.grabbable();break;case":animated":a=i.animated();break;case":unanimated":a=!i.animated();break;case":parent":a=i.isNode()&&i.children().nonempty();break;case":child":case":nonorphan":a=i.isNode()&&i.parent().nonempty();break;case":orphan":a=i.isNode()&&i.parent().empty();break;case":loop":a=i.isEdge()&&i.data("source")===i.data("target");break;case":simple":a=i.isEdge()&&i.data("source")!==i.data("target");break;case":active":a=i.active();break;case":inactive":a=!i.active();break;case":touch":a=e.is.touch();break;case":backgrounding":a=i.backgrounding();break;case":nonbackgrounding":a=!i.backgrounding()}if(!a)break}if(!a)return!1;for(var l=!0,o=0;o<r.ids.length;o++){var u=r.ids[o],c=i._private.data.id;if(l=l&&u==c,!l)break}if(!l)return!1;for(var d=!0,o=0;o<r.classes.length;o++){var h=r.classes[o];if(d=d&&i.hasClass(h),!d)break}if(!d)return!1;var p=function(t){for(var i=!0,n=0;n<r[t.name].length;n++){var a,o=r[t.name][n],s=o.operator,l=o.value,u=o.field;if(null!=s&&null!=l){var c=t.fieldValue(u),d=e.is.string(c)||e.is.number(c)?""+c:"",h=""+l,p=!1;s.indexOf("@")>=0&&(d=d.toLowerCase(),h=h.toLowerCase(),s=s.replace("@",""),p=!0);var v=!1,f=!1;switch(s.indexOf("!")>=0&&(s=s.replace("!",""),v=!0),p&&(l=h.toLowerCase(),c=d.toLowerCase()),s){case"*=":a=d.search(h)>=0;break;case"$=":a=null!=new RegExp(h+"$").exec(d);break;case"^=":a=null!=new RegExp("^"+h).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){i=!1;break}}return i},v=p({name:"data",fieldValue:function(e){return i._private.data[e]},fieldRef:function(e){return"element._private.data."+e},fieldUndefined:function(e){return void 0===i._private.data[e]},fieldTruthy:function(e){return i._private.data[e]?!0:!1}});if(!v)return!1;var f=p({name:"meta",fieldValue:function(e){return i[e]()},fieldRef:function(e){return"element."+e+"()"},fieldUndefined:function(e){return null==i[e]()},fieldTruthy:function(e){return i[e]()?!0:!1}});if(!f)return!1;if(null!=r.collection){var g=null!=r.collection._private.ids[i.id()];if(!g)return!1}if(null!=r.filter&&0===i.collection().filter(r.filter).size())return!1;var y=function(e,r){if(null!=e){var i=!1;if(!n.hasCompoundNodes())return!1;r=r();for(var a=0;a<r.length;a++)if(t(e,r[a])){i=!0;break}return i}return!0};return y(r.parent,function(){return i.parent()})&&y(r.ancestor,function(){return i.parents()})&&y(r.child,function(){return i.children()})&&y(r.descendant,function(){return i.descendants()})?!0:!1};e.selfn.filter=function(r){var i=this,n=r.cy();if(i._private.invalid)return new e.Collection(n);var a=function(e,r){for(var n=0;n<i.length;n++){var a=i[n];if(t(a,r))return!0}return!1};null==i._private.selectorText&&(a=function(){return!0});var o=r.filter(a);return o},e.selfn.matches=function(e){var r=this;if(r._private.invalid)return!1;for(var i=0;i<r.length;i++){var n=r[i];if(t(n,e))return!0}return!1},e.selfn.toString=e.selfn.selector=function(){for(var t="",r=function(t,r){return e.is.string(t)?r?'"'+t+'"':t:""},i=function(e){var t="";e.subject===e&&(t+="$");var a=r(e.group);t+=a.substring(0,a.length-1);for(var o=0;o<e.data.length;o++){var s=e.data[o];t+=s.value?"["+s.field+r(s.operator)+r(s.value,!0)+"]":"["+r(s.operator)+s.field+"]"}for(var o=0;o<e.meta.length;o++){var l=e.meta[o];t+="[["+l.field+r(l.operator)+r(l.value,!0)+"]]"}for(var o=0;o<e.colonSelectors.length;o++){var u=e.colonSelectors[n];t+=u}for(var o=0;o<e.ids.length;o++){var u="#"+e.ids[n];t+=u}for(var o=0;o<e.classes.length;o++){var u="."+e.classes[n];t+=u}return null!=e.parent&&(t=i(e.parent)+" > "+t),null!=e.ancestor&&(t=i(e.ancestor)+" "+t),null!=e.child&&(t+=" > "+i(e.child)),null!=e.descendant&&(t+=" "+i(e.descendant)),t},n=0;n<this.length;n++){var a=this[n];t+=i(a),this.length>1&&n<this.length-1&&(t+=", ")}return t}}(cytoscape),function(e){"use strict";e.Style=function(t){return this instanceof e.Style?e.is.core(t)?(this._private={cy:t,coreStyle:{},newStyle:!0},this.length=0,void this.addDefaultStylesheet()):void e.util.error("A style must have a core reference"):new e.Style(t)},e.style=e.Style,e.styfn=e.Style.prototype,e.fn.style=function(t,r){for(var i in t){var n=t[i];e.Style.prototype=n}},function(){var t=e.util.regex.number,r=e.util.regex.rgbaNoBackRefs,i=e.util.regex.hslaNoBackRefs,n=e.util.regex.hex3,a=e.util.regex.hex6,o=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(e){return"^"+e+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+t+"|\\w+|"+r+"|"+i+"|"+n+"|"+a+")\\s*\\,\\s*("+t+"|\\w+|"+r+"|"+i+"|"+n+"|"+a+")\\)$"};e.style.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%"},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},autoSize:{number:!0,min:0,enums:["auto"]},number:{number:!0},size:{number:!0,min:0},bgSize:{number:!0,min:0,allowPercent:!0},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"]},bgPos:{number:!0,allowPercent:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"]},bgFit:{enums:["none","contain","cover"]},bgClip:{enums:["none","node"]},color:{color:!0},lineStyle:{enums:["solid","dotted","dashed"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontVariant:{enums:["small-caps","normal"]},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap"]},textBackgroundShape:{enums:["rectangle","roundrectangle"]},nodeShape:{enums:["rectangle","roundrectangle","ellipse","triangle","square","pentagon","hexagon","heptagon","octagon","star","diamond","vee","rhomboid"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","triangle-backcurve","half-triangle-overshot","square","circle","diamond","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},text:{string:!0},data:{mapping:!0,regex:o("data")},layoutData:{mapping:!0,regex:o("layoutData")},scratch:{mapping:!0,regex:o("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regex:"^url\\s*\\(\\s*([^\\s]+)\\s*\\s*\\)|none|(.+)$"},propList:{propList:!0},angle:{number:!0,units:"deg|rad"},textRotation:{enums:["none","autorotate"]}};var l=e.style.types,u=e.style.properties=[{name:"text-valign",type:l.valign},{name:"text-halign",type:l.halign},{name:"color",type:l.color},{name:"content",type:l.text},{name:"text-outline-color",type:l.color},{name:"text-outline-width",type:l.size},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size},{name:"text-border-style",type:l.borderStyle},{name:"text-background-shape",type:l.textBackgroundShape},{name:"text-transform",type:l.textTransform},{name:"text-wrap",type:l.textWrap},{name:"text-max-width",type:l.size},{name:"font-family",type:l.fontFamily},{name:"font-style",type:l.fontStyle},{name:"font-weight",type:l.fontWeight},{name:"font-size",type:l.size},{name:"min-zoomed-font-size",type:l.size},{name:"edge-text-rotation",type:l.textRotation},{name:"display",type:l.display},{name:"visibility",type:l.visibility},{name:"opacity",type:l.zeroOneNumber},{name:"z-index",type:l.nonNegativeInt},{name:"overlay-padding",type:l.size},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber},{name:"shadow-blur",type:l.size},{name:"shadow-color",type:l.color},{name:"shadow-opacity",type:l.zeroOneNumber},{name:"shadow-offset-x",type:l.number},{name:"shadow-offset-y",type:l.number},{name:"text-shadow-blur",type:l.size},{name:"text-shadow-color",type:l.color},{name:"text-shadow-opacity",type:l.zeroOneNumber},{name:"text-shadow-offset-x",type:l.number},{name:"text-shadow-offset-y",type:l.number},{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"height",type:l.autoSize},{name:"width",type:l.autoSize},{name:"shape",type:l.nodeShape},{name:"background-color",type:l.color},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size},{name:"border-style",type:l.borderStyle},{name:"background-image",type:l.url},{name:"background-image-opacity",type:l.zeroOneNumber},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"padding-left",type:l.size},{name:"padding-right",type:l.size},{name:"padding-top",type:l.size},{name:"padding-bottom",type:l.size},{name:"position",type:l.position},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels},{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"control-point-step-size",type:l.size},{name:"control-point-distance",type:l.number},{name:"control-point-weight",type:l.zeroOneNumber},{name:"curve-style",type:l.curveStyle},{name:"haystack-radius",type:l.zeroOneNumber},{name:"source-arrow-shape",type:l.arrowShape},{name:"target-arrow-shape",type:l.arrowShape},{name:"mid-source-arrow-shape",type:l.arrowShape},{name:"mid-target-arrow-shape",type:l.arrowShape},{name:"source-arrow-color",type:l.color},{name:"target-arrow-color",type:l.color},{name:"mid-source-arrow-color",type:l.color},{name:"mid-target-arrow-color",type:l.color},{name:"source-arrow-fill",type:l.arrowFill},{name:"target-arrow-fill",type:l.arrowFill},{name:"mid-source-arrow-fill",type:l.arrowFill},{name:"mid-target-arrow-fill",type:l.arrowFill},{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}];e.style.pieBackgroundN=16,u.push({name:"pie-size",type:l.bgSize});for(var c=1;c<=e.style.pieBackgroundN;c++)u.push({name:"pie-"+c+"-background-color",type:l.color}),u.push({name:"pie-"+c+"-background-size",type:l.percent}),u.push({name:"pie-"+c+"-background-opacity",type:l.zeroOneNumber});for(var c=0;c<u.length;c++){var d=u[c];u[d.name]=d}}(),e.styfn.addDefaultStylesheet=function(){var e="Helvetica",t="normal",r="normal",i="#000",n="none",a=16,o=9999;this.selector("node, edge").css({"text-valign":"top","text-halign":"center",color:i,"text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":n,"text-wrap":"none","text-max-width":o,"text-background-color":"#000","text-background-opacity":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","text-background-shape":"rectangle","font-family":e,"font-style":t,"font-weight":r,"font-size":a,"min-zoomed-font-size":0,"edge-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-index":0,content:"","overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"shadow-opacity":0,"shadow-color":"#000","shadow-blur":10,"shadow-offset-x":0,"shadow-offset-y":0,"text-shadow-opacity":0,"text-shadow-color":"#000","text-shadow-blur":5,"text-shadow-offset-x":0,"text-shadow-offset-y":0,"transition-property":"none","transition-duration":0,"transition-delay":0,"background-blacken":0,"background-color":"#888","background-opacity":1,"background-image":"none","background-image-opacity":1,"background-position-x":"50%","background-position-y":"50%","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","padding-top":0,"padding-bottom":0,"padding-left":0,"padding-right":0,position:"origin","compound-sizing-wrt-labels":"include","pie-size":"100%","pie-1-background-color":"black","pie-2-background-color":"black","pie-3-background-color":"black","pie-4-background-color":"black","pie-5-background-color":"black","pie-6-background-color":"black","pie-7-background-color":"black","pie-8-background-color":"black","pie-9-background-color":"black","pie-10-background-color":"black","pie-11-background-color":"black","pie-12-background-color":"black","pie-13-background-color":"black","pie-14-background-color":"black","pie-15-background-color":"black","pie-16-background-color":"black","pie-1-background-size":"0%","pie-2-background-size":"0%","pie-3-background-size":"0%","pie-4-background-size":"0%","pie-5-background-size":"0%","pie-6-background-size":"0%","pie-7-background-size":"0%","pie-8-background-size":"0%","pie-9-background-size":"0%","pie-10-background-size":"0%","pie-11-background-size":"0%","pie-12-background-size":"0%","pie-13-background-size":"0%","pie-14-background-size":"0%","pie-15-background-size":"0%","pie-16-background-size":"0%","pie-1-background-opacity":1,"pie-2-background-opacity":1,"pie-3-background-opacity":1,"pie-4-background-opacity":1,"pie-5-background-opacity":1,"pie-6-background-opacity":1,"pie-7-background-opacity":1,"pie-8-background-opacity":1,"pie-9-background-opacity":1,"pie-10-background-opacity":1,"pie-11-background-opacity":1,"pie-12-background-opacity":1,"pie-13-background-opacity":1,"pie-14-background-opacity":1,"pie-15-background-opacity":1,"pie-16-background-opacity":1,"source-arrow-shape":"none","mid-source-arrow-shape":"none","target-arrow-shape":"none","mid-target-arrow-shape":"none","source-arrow-color":"#ddd","mid-source-arrow-color":"#ddd","target-arrow-color":"#ddd","mid-target-arrow-color":"#ddd","source-arrow-fill":"filled","mid-source-arrow-fill":"filled","target-arrow-fill":"filled","mid-target-arrow-fill":"filled","line-style":"solid","line-color":"#ddd","control-point-step-size":40,"control-point-weight":.5,"curve-style":"bezier","haystack-radius":.8}).selector("$node > 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":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125}),this.defaultLength=this.length},e.styfn.clear=function(){for(var e=0;e<this.length;e++)this[e]=void 0;return this.length=0,this._private.newStyle=!0,this},e.styfn.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},e.styfn.core=function(){return this._private.coreStyle},e.styfn.parse=function(t,r,i,n){t=e.util.camel2dash(t);var a=e.style.properties[t],o=r,s=e.style.types;if(!a)return null;if(void 0===r||null===r)return null;var l=e.is.string(r);l&&(r=e.util.trim(r));var u=a.type;if(!u)return null;if(i&&(""===r||null===r))return{name:t,value:r,bypass:!0,deleteBypass:!0};var c=t.match(/pie-(\d+)-background-size/);if(e.is.fn(r))return{name:t,value:r,strValue:"fn",mapped:s.fn,bypass:i,hasPie:c};var d,h,p,v,f,g;if(!l||n);else{if((d=new RegExp(s.data.regex).exec(r))||(p=new RegExp(s.layoutData.regex).exec(r))||(f=new RegExp(s.scratch.regex).exec(r))){if(i)return!1;var y;return y=d?s.data:p?s.layoutData:s.scratch,d=d||p||f,{name:t,value:d,strValue:""+r,mapped:y,field:d[1],bypass:i,hasPie:c}}if((h=new RegExp(s.mapData.regex).exec(r))||(v=new RegExp(s.mapLayoutData.regex).exec(r))||(g=new RegExp(s.mapScratch.regex).exec(r))){if(i)return!1;var y;if(y=h?s.mapData:v?s.mapLayoutData:s.mapScratch,h=h||v||g,!u.color&&!u.number)return!1;var m=this.parse(t,h[4]);if(!m||m.mapped)return!1;var x=this.parse(t,h[5]);if(!x||x.mapped)return!1;if(m.value===x.value)return!1;if(u.color){var b=m.value,w=x.value,_=!(b[0]!==w[0]||b[1]!==w[1]||b[2]!==w[2]||b[3]!==w[3]&&(null!=b[3]&&1!==b[3]||null!=w[3]&&1!==w[3]));if(_)return!1}return{name:t,value:h,strValue:""+r,mapped:y,field:h[1],fieldMin:parseFloat(h[2]),fieldMax:parseFloat(h[3]),valueMin:m.value,valueMax:x.value,bypass:i,hasPie:c}}}if(u.number){var E,S="px";if(u.units&&(E=u.units),u.implicitUnits&&(S=u.implicitUnits),!u.unitless)if(l){var D="px|em"+(u.allowPercent?"|\\%":"");E&&(D=E);var k=r.match("^("+e.util.regex.number+")("+D+")?$");k&&(r=k[1],E=k[2]||S)}else(!E||u.implicitUnits)&&(E=S);if(r=parseFloat(r),isNaN(r)&&void 0===u.enums)return null;if(isNaN(r)&&void 0!==u.enums){r=o;for(var T=0;T<u.enums.length;T++){var P=u.enums[T];if(P===r)return{name:t,value:r,strValue:""+r,bypass:i}}return null}if(u.integer&&!e.is.integer(r))return null;if(void 0!==u.min&&r<u.min||void 0!==u.max&&r>u.max)return null;var C={name:t,value:r,strValue:""+r+(E?E:""),units:E,bypass:i,hasPie:c&&null!=r&&0!==r&&""!==r};return u.unitless||"px"!==E&&"em"!==E||(C.pxValue="px"!==E&&E?this.getEmSizeInPixels()*r:r),("ms"===E||"s"===E)&&(C.msValue="ms"===E?r:1e3*r),C}if(u.propList){var M=[],B=""+r;if("none"===B);else{for(var N=B.split(","),T=0;T<N.length;T++){var I=e.util.trim(N[T]);e.style.properties[I]&&M.push(I)}if(0===M.length)return null}return{name:t,value:M,strValue:0===M.length?"none":M.join(", "),bypass:i}}if(u.color){var O=e.util.color2tuple(r);return O?{name:t,value:O,strValue:""+r,bypass:i}:null}if(u.enums){for(var T=0;T<u.enums.length;T++){var P=u.enums[T];if(P===r)return{name:t,value:r,strValue:""+r,bypass:i}}return null}if(u.regex){var z=new RegExp(u.regex),L=z.exec(r);return L?{name:t,value:L,strValue:""+r,bypass:i}:null}return u.string?{name:t,value:r,strValue:""+r,bypass:i}:null},e.styfn.selector=function(t){var r="core"===t?null:new e.Selector(t),i=this.length++;return this[i]={selector:r,properties:[],mappedProperties:[],index:i},this},e.styfn.css=function(){var t=arguments;switch(t.length){case 1:for(var r=t[0],i=0;i<e.style.properties.length;i++){var n=e.style.properties[i],a=r[n.name];void 0===a&&(a=r[e.util.dash2camel(n.name)]),void 0!==a&&this.cssRule(n.name,a)}break;case 2:this.cssRule(t[0],t[1])}return this},e.styfn.style=e.styfn.css,e.styfn.cssRule=function(e,t){var r=this.parse(e,t);if(r){var i=this.length-1;this[i].properties.push(r),this[i].properties[r.name]=r,r.hasPie&&(this._private.hasPie=!0),r.mapped&&this[i].mappedProperties.push(r);var n=!this[i].selector;n&&(this._private.coreStyle[r.name]=r)}return this}}(cytoscape),function(e){"use strict";e.styfn.apply=function(e){var t=this;t._private.newStyle&&(this._private.contextStyles={},this._private.propDiffs={});for(var r=0;r<e.length;r++){var i=e[r],n=t.getContextMeta(i),a=t.getContextStyle(n),o=t.applyContextStyle(n,a,i);t.updateTransitions(i,o.diffProps),t.updateStyleHints(i)}t._private.newStyle=!1},e.styfn.getPropertiesDiff=function(e,t){var r=this,i=r._private.propDiffs=r._private.propDiffs||{},n=e+"-"+t,a=i[n];if(a)return a;for(var o=[],s={},l=0;l<r.length;l++){var u=r[l],c="t"===e[l],d="t"===t[l],h=c!==d,p=u.mappedProperties.length>0;if(h||p){var v;h&&p?v=u.properties:h?v=u.properties:p&&(v=u.mappedProperties);for(var f=0;f<v.length;f++){for(var g=v[f],y=g.name,m=!1,x=l+1;x<r.length;x++){var b=r[x],w="t"===t[x];if(w&&(m=null!=b.properties[g.name]))break}s[y]||m||(s[y]=!0,o.push(y))}}}return i[n]=o,o},e.styfn.getContextMeta=function(e){var t,r=this,i="",n=e._private.styleCxtKey||"";r._private.newStyle&&(n="");for(var a=0;a<r.length;a++){var o=r[a],s=o.selector&&o.selector.matches(e);i+=s?"t":"f"}return t=r.getPropertiesDiff(n,i),e._private.styleCxtKey=i,{key:i,diffPropNames:t}},e.styfn.getContextStyle=function(e){var t=e.key,r=this,i=this._private.contextStyles=this._private.contextStyles||{};if(i[t])return i[t];for(var n={_private:{key:t}},a=0;a<r.length;a++){var o=r[a],s="t"===t[a];if(s)for(var l=0;l<o.properties.length;l++){var u=o.properties[l],c=n[u.name]=u;c.context=o}}return i[t]=n,n},e.styfn.applyContextStyle=function(e,t,r){for(var i=this,n=e.diffPropNames,a={},o=0;o<n.length;o++){var s=n[o],l=t[s],u=r._private.style[s];if(l&&u!==l){var c=a[s]={prev:u};i.applyParsedProperty(r,l),c.next=r._private.style[s],c.next&&c.next.bypass&&(c.next=c.next.bypassed)}}return{diffProps:a}},e.styfn.updateStyleHints=function(t){var r=t._private,i=this,n=r.style,a=!1;if("nodes"===r.group&&i._private.hasPie)for(var o=1;o<=e.style.pieBackgroundN;o++){var s=r.style["pie-"+o+"-background-size"].value;if(s>0){a=!0;break}}r.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,h=n["font-weight"].strValue,p=n["text-valign"].strValue,v=n["text-valign"].strValue,f=n["text-outline-width"].pxValue,g=n["text-wrap"].strValue,y=n["text-max-width"].pxValue;r.labelKey=c+"$"+s+"$"+d+"$"+h+"$"+u+"$"+l+"$"+p+"$"+v+"$"+f+"$"+g+"$"+y,r.fontKey=c+"$"+h+"$"+s+"$"+d;var m=n.width.pxValue,x=n.height.pxValue,b=n["border-width"].pxValue;if(r.boundingBoxKey=m+"$"+x+"$"+b,"edges"===t._private.group){var w=n["control-point-step-size"].pxValue,_=n["control-point-distance"]?n["control-point-distance"].pxValue:void 0,E=n["control-point-weight"].value,S=n["curve-style"].strValue;r.boundingBoxKey+="$"+w+"$"+_+"$"+E+"$"+S}r.styleKey=Date.now()},e.styfn.applyParsedProperty=function(t,r){var i,n,a=r,o=t._private.style,s=e.style.types,l=e.style.properties[a.name].type,u=a.bypass,c=o[a.name],d=c&&c.bypass,h=t._private;if(("height"===r.name||"width"===r.name)&&t.isNode()){if("auto"===r.value&&!t.isParent())return!1;"auto"!==r.value&&t.isParent()&&(a=r=this.parse(r.name,"auto",u))}if(u&&a.deleteBypass){var p=o[a.name];return p?p.bypass&&p.bypassed?(o[a.name]=p.bypassed,!0):!1:!0}var v=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 s.mapData:case s.mapLayoutData:case s.mapScratch:var i,f=a.mapped===s.mapLayoutData,g=a.mapped===s.mapScratch,y=a.field.split(".");i=g||f?h.scratch:h.data;for(var m=0;m<y.length&&i;m++){var x=y[m];i=i[x]}var b;if(b=e.is.number(i)?(i-a.fieldMin)/(a.fieldMax-a.fieldMin):0,0>b?b=0:b>1&&(b=1),l.color){var w=a.valueMin[0],_=a.valueMax[0],E=a.valueMin[1],S=a.valueMax[1],D=a.valueMin[2],k=a.valueMax[2],T=null==a.valueMin[3]?1:a.valueMin[3],P=null==a.valueMax[3]?1:a.valueMax[3],C=[Math.round(w+(_-w)*b),Math.round(E+(S-E)*b),Math.round(D+(k-D)*b),Math.round(T+(P-T)*b)];n={bypass:a.bypass,name:a.name,value:C,strValue:"rgb("+C[0]+", "+C[1]+", "+C[2]+")"}}else{if(!l.number)return!1;var M=a.valueMin+(a.valueMax-a.valueMin)*b;n=this.parse(a.name,M,a.bypass,!0)}n||(n=this.parse(a.name,c.strValue,a.bypass,!0)),n||v(),n.mapping=a,a=n;break;case s.data:case s.layoutData:case s.scratch:var i,f=a.mapped===s.layoutData,g=a.mapped===s.scratch,y=a.field.split(".");if(i=g||f?h.scratch:h.data)for(var m=0;m<y.length;m++){var x=y[m];i=i[x]}if(n=this.parse(a.name,i,a.bypass,!0),!n){var B=c?c.strValue:"";n=this.parse(a.name,B,a.bypass,!0);
}n||v(),n.mapping=a,a=n;break;case s.fn:var N=a.value,I=N(t);n=this.parse(a.name,I,a.bypass,!0),n.mapping=a,a=n;break;case void 0:break;default:return!1}return u?(a.bypassed=d?c.bypassed:c,o[a.name]=a):d?c.bypassed=a:o[a.name]=a,!0},e.styfn.update=function(){var e=this._private.cy,t=e.elements();t.updateStyle()},e.styfn.updateMappers=function(t){for(var r=0;r<t.length;r++){for(var i=t[r],n=i._private.style,a=0;a<e.style.properties.length;a++){var o=e.style.properties[a],s=n[o.name];if(s&&s.mapping){var l=s.mapping;this.applyParsedProperty(i,l)}}this.updateStyleHints(i)}},e.styfn.updateTransitions=function(t,r,i){var n=this,a=t._private.style,o=a["transition-property"].value,s=a["transition-duration"].msValue,l=a["transition-delay"].msValue,u={};if(o.length>0&&s>0){for(var c=!1,d=0;d<o.length;d++){var h=o[d],p=a[h],v=r[h];if(v){var f=v.prev,g=f,y=null!=v.next?v.next:p,m=!1;g&&(e.is.number(g.pxValue)&&e.is.number(y.pxValue)?m=g.pxValue!==y.pxValue:e.is.number(g.value)&&e.is.number(y.value)?m=g.value!==y.value:e.is.array(g.value)&&e.is.array(y.value)&&(m=g.value[0]!==y.value[0]||g.value[1]!==y.value[1]||g.value[2]!==y.value[2]),m&&(u[h]=y.strValue,this.applyBypass(t,h,g.strValue),c=!0))}}if(!c)return;t._private.transitioning=!0,t.stop(),l>0&&t.delay(l),t.animate({css:u},{duration:s,queue:!1,complete:function(){i||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,r,i,n){var a=[],o=!0;if("*"===r||"**"===r){if(void 0!==i)for(var s=0;s<e.style.properties.length;s++){var l=e.style.properties[s],r=l.name,u=this.parse(r,i,!0);u&&a.push(u)}}else if(e.is.string(r)){var u=this.parse(r,i,!0);u&&a.push(u)}else{if(!e.is.plainObject(r))return!1;var c=r;n=i;for(var s=0;s<e.style.properties.length;s++){var l=e.style.properties[s],r=l.name,i=c[r];if(void 0===i&&(i=c[e.util.dash2camel(r)]),void 0!==i){var u=this.parse(r,i,!0);u&&a.push(u)}}}if(0===a.length)return!1;for(var d=!1,s=0;s<t.length;s++){for(var h,p=t[s],v=p._private.style,f={},g=0;g<a.length;g++){var l=a[g];if(n){var y=v[l.name];h=f[l.name]={prev:y}}d=this.applyParsedProperty(p,l)||d,n&&(h.next=v[l.name])}n&&this.updateTransitions(p,f,o)}return d},e.styfn.overrideBypass=function(t,r,i){for(var n=0;n<t.length;n++){var a=t[n],o=a._private.style[e.util.camel2dash(r)];o.bypass?(o.value=i,o.pxValue=i):this.applyBypass(a,r,i)}},e.styfn.removeAllBypasses=function(t,r){for(var i=!0,n=0;n<t.length;n++){for(var a=t[n],o={},s=a._private.style,l=0;l<e.style.properties.length;l++){var u=e.style.properties[l],c=u.name,d="",h=this.parse(c,d,!0),p=s[u.name],v=o[u.name]={prev:p};this.applyParsedProperty(a,h),v.next=s[u.name]}r&&this.updateTransitions(a,o,i)}},e.styfn.removeBypasses=function(t,r,i){for(var n=!0,a=0;a<t.length;a++){for(var o=t[a],s={},l=o._private.style,u=0;u<r.length;u++){var c=r[u],d=e.style.properties[c],h="",p=this.parse(c,h,!0),v=l[d.name],f=s[d.name]={prev:v};this.applyParsedProperty(o,p),f.next=l[d.name]}i&&this.updateTransitions(o,s,n)}}}(cytoscape),function(e,t){"use strict";e.styfn.getEmSizeInPixels=function(){var e=this._private.cy,r=e.container();if(t&&r&&t.getComputedStyle){var i=t.getComputedStyle(r).getPropertyValue("font-size"),n=parseFloat(i);return n}return 1},e.styfn.containerCss=function(e){var r=this._private.cy,i=r.container();return t&&i&&t.getComputedStyle?t.getComputedStyle(i).getPropertyValue(e):void 0},e.styfn.containerProperty=function(e){var t=this.containerCss(e),r=this.parse(e,t);return r},e.styfn.containerPropertyAsString=function(e){var t=this.containerProperty(e);return t?t.strValue:void 0}}(cytoscape,"undefined"==typeof window?null:window),function(e){"use strict";e.styfn.getRenderedStyle=function(t){var t=t[0];if(t){for(var r={},i=t._private.style,n=this._private.cy,a=n.zoom(),o=0;o<e.style.properties.length;o++){var s=e.style.properties[o],l=i[s.name];if(l){var u=l.unitless?l.strValue:l.pxValue*a+"px";r[s.name]=u,r[e.util.dash2camel(s.name)]=u}}return r}},e.styfn.getRawStyle=function(t){var t=t[0];if(t){for(var r={},i=t._private.style,n=0;n<e.style.properties.length;n++){var a=e.style.properties[n],o=i[a.name];o&&(r[a.name]=o.strValue,r[e.util.dash2camel(a.name)]=o.strValue)}return r}},e.styfn.getValueStyle=function(t,r){r=r||{};var i,n=r.array?[]:{};if(i=e.is.element(t)?t._private.style:t)for(var a=0;a<e.style.properties.length;a++){var o=e.style.properties[a],s=i[o.name]||i[e.util.dash2camel(o.name)];void 0===s||e.is.plainObject(s)||(s=this.parse(o.name,s)),s&&(r.array?n.push(s):(n[o.name]=s,n[e.util.dash2camel(o.name)]=s))}return n}}(cytoscape),function(e){"use strict";e.style.applyFromJson=function(e,t){for(var r=0;r<t.length;r++){var i=t[r],n=i.selector,a=i.style||i.css;e.selector(n);for(var o in a){var s=a[o];e.css(o,s)}}return e},e.style.fromJson=function(t,r){var i=new e.Style(t);return e.style.applyFromJson(i,r),i},e.styfn.fromJson=function(t){var r=this;return r.resetToDefault(),e.style.applyFromJson(r,t),r},e.styfn.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var r=this[t],i=r.selector,n=r.properties,a={},o=0;o<n.length;o++){var s=n[o];a[s.name]=s.strValue}e.push({selector:i?i.toString():"core",style:a})}return e}}(cytoscape),function(e){"use strict";e.style.applyFromString=function(t,r){function i(){l=l.length>a.length?l.substr(a.length):""}function n(){o=o.length>s.length?o.substr(s.length):""}var a,o,s,l=""+r;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 h=new e.Selector(d);if(h._private.invalid){e.util.error("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),i();continue}}var p=c[2],v=!1;o=p;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:"+p),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){i();break}t.selector(d);for(var w=0;w<f.length;w++){var x=f[w];t.css(x.name,x.val)}i()}return t},e.style.fromString=function(t,r){var i=new e.Style(t);return e.style.applyFromString(i,r),i},e.styfn.fromString=function(t){var r=this;return r.resetToDefault(),e.style.applyFromString(r,t),r}}(cytoscape),function(e){"use strict";e.stylesheet=e.Stylesheet=function(){return this instanceof e.Stylesheet?void(this.length=0):new e.Stylesheet},e.sheetfn=e.Stylesheet.prototype,e.sheetfn.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this},e.sheetfn.css=function(t,r){var i=this.length-1;if(e.is.string(t))this[i].properties.push({name:t,value:r});else if(e.is.plainObject(t))for(var n=t,a=0;a<e.style.properties.length;a++){var o=e.style.properties[a],s=n[o.name];if(void 0===s&&(s=n[e.util.dash2camel(o.name)]),void 0!==s){var t=o.name,r=s;this[i].properties.push({name:t,value:r})}}return this},e.sheetfn.style=e.sheetfn.css,e.sheetfn.generateStyle=function(t){for(var r=new e.Style(t),i=0;i<this.length;i++){var n=this[i],a=n.selector,o=n.properties;r.selector(a);for(var s=0;s<o.length;s++){var l=o[s];r.css(l.name,l.value)}}return r}}(cytoscape),function(e,t){"use strict";e.Thread=function(t){return this instanceof e.Thread?(this._private={requires:[],files:[],queue:null,pass:[]},void(t&&this.run(t))):new e.Thread(t)},e.thread=e.Thread,e.thdfn=e.Thread.prototype,e.fn.thread=function(t,r){for(var i in t){var n=t[i];e.Thread.prototype[i]=n}};var r=function(t){var r=e.is.fn(t)?t.toString():'JSON.parse("'+JSON.stringify(t)+'")';return r},i=function(t){var n,o;e.is.object(t)&&t.fn?(n=a(t.fn,t.name),o=t.name,t=t.fn):e.is.fn(t)?(n=t.toString(),o=t.name):e.is.string(t)?n=t:e.is.object(t)&&(n=t.proto?"":t.name+" = {};",o=t.name,t=t.obj),n+="\n";var s=function(e,t){if(e.prototype){var r=!1;for(var a in e.prototype){r=!0;break}r&&(n+=i({name:t,obj:e,proto:!0},e))}};if(t.prototype&&null!=o)for(var l in t.prototype){var u="",c=t.prototype[l],d=r(c),h=o+".prototype."+l;u+=h+" = "+d+";\n",u&&(n+=u),s(c,h)}if(!e.is.string(t))for(var l in t){var p="";if(t.hasOwnProperty(l)){var c=t[l],d=r(c),h=o+'["'+l+'"]';p+=h+" = "+d+";\n"}p&&(n+=p),s(c,h)}return n},n=function(t){return e.is.string(t)&&t.match(/\.js$/)};e.fn.thread({require:function(t,r){return n(t)?(this._private.files.push(t),this):(r&&(e.is.fn(t)?(r=r||t.name,t={name:r,fn:t}):t={name:r,obj:t}),this._private.requires.push(t),this)},pass:function(e){return this._private.pass.push(e),this},run:function(r,n){var a=this,o=this._private;if(n=n||o.pass.shift(),o.stopped)return void e.util.error("Attempted to run a stopped thread! Start a new thread or do not stop the existing thread and reuse it.");if(o.running)return o.queue=o.queue.then(function(){return a.run(r,n)});var s=null!=t,l="undefined"!=typeof module;a.trigger("run");var u=new e.Promise(function(u,c){o.running=!0;var d=o.ran,h=e.is.string(r)?r:r.toString(),p="\n"+o.requires.map(function(e){return i(e)}).concat(o.files.map(function(e){if(s){var r=function(e){return e.match(/^\.\//)||e.match(/^\.\./)?t.location.origin+t.location.pathname+e:e.match(/^\//)?t.location.origin+"/"+e:e};return'importScripts("'+r(e)+'");'}return l?'eval( require("fs").readFileSync("'+e+'", { encoding: "utf8" }) );':void 0})).concat(["( function(){","var ret = ("+h+")("+JSON.stringify(n)+");","if( ret !== undefined ){ resolve(ret); }","} )()\n"]).join("\n");if(o.requires=[],o.files=[],s){var v,f;if(!d){var g=p+"";p=["function broadcast(m){ return message(m); };","function message(m){ postMessage(m); };","function listen(fn){",' self.addEventListener("message", function(m){ ',' if( typeof m === "object" && (m.data.$$eval || m.data === "$$start") ){'," } else { "," fn( m.data );"," }"," });","};",'self.addEventListener("message", function(m){ if( m.data.$$eval ){ eval( m.data.$$eval ); } });',"function resolve(v){ postMessage({ $$resolve: v }); };","function reject(v){ postMessage({ $$reject: v }); };"].join("\n"),p+=g,v=new Blob([p],{type:"application/javascript"}),f=t.URL.createObjectURL(v)}var y=o.webworker=o.webworker||new Worker(f);d&&y.postMessage({$$eval:p});var m;y.addEventListener("message",m=function(t){var r=e.is.object(t)&&e.is.object(t.data);r&&"$$resolve"in t.data?(y.removeEventListener("message",m),u(t.data.$$resolve)):r&&"$$reject"in t.data?(y.removeEventListener("message",m),c(t.data.$$reject)):a.trigger(new e.Event(t,{type:"message",message:t.data}))},!1),d||y.postMessage("$$start")}else if(l){var m,x=require("path"),b=require("child_process"),w=o.child=o.child||b.fork(x.join(__dirname,"thread-node-fork"));w.on("message",m=function(t){e.is.object(t)&&"$$resolve"in t?(w.removeListener("message",m),u(t.$$resolve)):e.is.object(t)&&"$$reject"in t?(w.removeListener("message",m),c(t.$$reject)):a.trigger(new e.Event({},{type:"message",message:t}))}),w.send({$$eval:p})}else e.error("Tried to create thread but no underlying tech found!")}).then(function(e){return o.running=!1,o.ran=!0,a.trigger("ran"),e});return null==o.queue&&(o.queue=u),u},message:function(e){var t=this._private;return t.webworker&&t.webworker.postMessage(e),t.child&&t.child.send(e),this},stop:function(){var e=this._private;return e.webworker&&e.webworker.terminate(),e.child&&e.child.kill(),e.stopped=!0,this.trigger("stop")},stopped:function(){return this._private.stopped}});var a=function(e,t){var r=e.toString();return r=r.replace(/function.*\(/,"function "+t+"(")},o=function(e){return e=e||{},function(t,r){var i=a(t,"_$_$_"+e.name);return this.require(i),this.run(["function( data ){"," var origResolve = resolve;"," var res = [];"," "," resolve = function( val ){"," res.push( val );"," };"," "," var ret = data."+e.name+"( _$_$_"+e.name+(arguments.length>1?", "+JSON.stringify(r):"")+" );"," "," resolve = origResolve;"," resolve( res.length > 0 ? res : ret );","}"].join("\n"))}};e.fn.thread({reduce:o({name:"reduce"}),reduceRight:o({name:"reduceRight"}),map:o({name:"map"})});var s=e.thdfn;s.promise=s.run,s.terminate=s.halt=s.stop,s.include=s.require,e.worker=e.Worker=e.Thread,e.fn.thread({on:e.define.on(),one:e.define.on({unbindSelfOnTrigger:!0}),off:e.define.off(),trigger:e.define.trigger()}),e.define.eventAliasesOn(e.thdfn)}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";e.Fabric=function(t){if(!(this instanceof e.Fabric))return new e.Fabric(t);this._private={pass:[]};var r=4;e.is.number(t),t="undefined"!=typeof navigator&&null!=navigator.hardwareConcurrency?navigator.hardwareConcurrency:"undefined"!=typeof module?require("os").cpus().length:r;for(var i=0;t>i;i++)this[i]=e.Thread();this.length=t},e.fabric=e.Fabric,e.fabfn=e.Fabric.prototype,e.fn.fabric=function(t,r){for(var i in t){var n=t[i];e.Fabric.prototype[i]=n}},e.fn.fabric({require:function(e,t){for(var r=0;r<this.length;r++){var i=this[r];i.require(e,t)}return this},random:function(){var e=Math.round((this.length-1)*Math.random()),t=this[e];return t},run:function(e){var t=this._private.pass.shift();return this.random().pass(t).run(e)},message:function(e){return this.random().message(e)},broadcast:function(e){for(var t=0;t<this.length;t++){var r=this[t];r.message(e)}return this},stop:function(){for(var e=0;e<this.length;e++){var t=this[e];t.stop()}return this},pass:function(t){var r=this._private.pass;return e.is.array(t)?r.push(t):e.util.error("Only arrays or collections may be used with fabric.pass()"),this},spreadSize:function(){var e=Math.ceil(this._private.pass[0].length/this.length);return e=Math.max(1,e)},spread:function(t){for(var r=this,i=r._private,n=r.spreadSize(),a=i.pass.shift().concat([]),o=[],s=0;s<this.length;s++){var l=this[s],u=a.splice(0,n),c=l.pass(u).run(t);o.push(c);var d=0===a.length;if(d)break}return e.Promise.all(o).then(function(e){for(var t=[],r=0,i=0;i<e.length;i++)for(var n=e[i],a=0;a<n.length;a++){var o=n[a];t[r++]=o}return t})},map:function(e){var t=this;return t.require(e,"_$_$_fabmap"),t.spread(function(e){var t=[],r=resolve;resolve=function(e){t.push(e)};for(var i=0;i<e.length;i++){var n=t.length,a=_$_$_fabmap(e[i]),o=n===t.length;o&&t.push(a)}return resolve=r,t})},filter:function(e){var t=this._private,r=t.pass[0];return this.map(e).then(function(e){for(var t=[],i=0;i<r.length;i++){var n=r[i],a=e[i];a&&t.push(n)}return t})},sort:function(e){var t=this,r=this._private.pass[0].length,i=this.spreadSize();return e=e||function(e,t){return t>e?-1:e>t?1:0},t.require(e,"_$_$_cmp"),t.spread(function(e){var t=e.sort(_$_$_cmp);resolve(t)}).then(function(t){for(var n=function(i,n,a){n=Math.min(n,r),a=Math.min(a,r);for(var o=i,s=n,l=[],u=o;a>u;u++){var c=t[i],d=t[n];s>i&&(n>=a||e(c,d)<=0)?(l.push(c),i++):(l.push(d),n++)}for(var u=0;u<l.length;u++){var h=o+u;t[h]=l[u]}},a=i;r>a;a*=2)for(var o=0;r>o;o+=2*a)n(o,o+a,o+2*a);return t})}});var r=function(e){return e=e||{},function(t,r){var i=this._private.pass.shift();return this.random().pass(i)[e.threadFn](t,r)}};e.fn.fabric({randomMap:r({threadFn:"map"}),reduce:r({threadFn:"reduce"}),reduceRight:r({threadFn:"reduceRight"})});var i=e.fabfn;i.promise=i.run,i.terminate=i.halt=i.stop,i.include=i.require,e.fn.fabric({on:e.define.on(),one:e.define.on({unbindSelfOnTrigger:!0}),off:e.define.off(),trigger:e.define.trigger()}),e.define.eventAliasesOn(e.fabfn)}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";var r={},i=e.util.copy(r);e.defaults=function(t){r=e.util.extend({},i,t)},e.fn.core=function(t,r){for(var i in t){var n=t[i];e.Core.prototype[i]=n}},e.Core=function(i){if(!(this instanceof e.Core))return new e.Core(i);var n=this;i=e.util.extend({},r,i);var a=i.container,o=a?a._cyreg:null;if(o=o||{},o&&o.cy){if(a)for(;a.firstChild;)a.removeChild(a.firstChild);o.cy.notify({type:"destroy"}),o={}}var s=o.readies=o.readies||[];a&&(a._cyreg=o),o.cy=n;var l=void 0!==t&&void 0!==a&&!i.headless,u=i;u.layout=e.util.extend({name:l?"grid":"null"},u.layout),u.renderer=e.util.extend({name:l?"canvas":"null"},u.renderer);var c=function(e,t,r){return void 0!==t?t:void 0!==r?r:e},d=this._private={container:u.container,ready:!1,initrender:!1,options:u,elements:[],id2index:{},listeners:[],onRenders:[],aniEles:e.Collection(this),scratch:{},layout:null,renderer:null,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:c(!0,u.zoomingEnabled),userZoomingEnabled:c(!0,u.userZoomingEnabled),panningEnabled:c(!0,u.panningEnabled),userPanningEnabled:c(!0,u.userPanningEnabled),boxSelectionEnabled:c(!1,u.boxSelectionEnabled),autolock:c(!1,u.autolock,u.autolockNodes),autoungrabify:c(!1,u.autoungrabify,u.autoungrabifyNodes),autounselectify:c(!1,u.autounselectify),styleEnabled:void 0===u.styleEnabled?l:u.styleEnabled,zoom:e.is.number(u.zoom)?u.zoom:1,pan:{x:e.is.plainObject(u.pan)&&e.is.number(u.pan.x)?u.pan.x:0,y:e.is.plainObject(u.pan)&&e.is.number(u.pan.y)?u.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,deferredExecQueue:[]},h=u.selectionType;d.selectionType=void 0===h||"additive"!==h&&"single"!==h?"single":h,e.is.number(u.minZoom)&&e.is.number(u.maxZoom)&&u.minZoom<u.maxZoom?(d.minZoom=u.minZoom,d.maxZoom=u.maxZoom):e.is.number(u.minZoom)&&void 0===u.maxZoom?d.minZoom=u.minZoom:e.is.number(u.maxZoom)&&void 0===u.minZoom&&(d.maxZoom=u.maxZoom);var p=function(t){for(var r=!1,i=0;i<v.length;i++){var n=v[i];if(e.is.promise(n)){r=!0;break}}return r?e.Promise.all(v).then(t):void t(v)},v=[u.style,u.elements];p(function(t){var r=t[0],i=t[1];d.styleEnabled&&n.setStyle(r),n.initRenderer(e.util.extend({hideEdgesOnViewport:u.hideEdgesOnViewport,hideLabelsOnViewport:u.hideLabelsOnViewport,textureOnViewport:u.textureOnViewport,wheelSensitivity:e.is.number(u.wheelSensitivity)&&u.wheelSensitivity>0?u.wheelSensitivity:1,motionBlur:void 0===u.motionBlur?!0:u.motionBlur,motionBlurOpacity:void 0===u.motionBlurOpacity?.05:u.motionBlurOpacity,pixelRatio:e.is.number(u.pixelRatio)&&u.pixelRatio>0?u.pixelRatio:"auto"===u.pixelRatio?void 0:1,desktopTapThreshold:void 0===u.desktopTapThreshold?4:u.desktopTapThreshold,touchTapThreshold:void 0===u.touchTapThreshold?8:u.touchTapThreshold},u.renderer)),u.initrender&&(n.on("initrender",u.initrender),n.on("initrender",function(){n._private.initrender=!0})),n.load(i,function(){n.startAnimationLoop(),n._private.ready=!0,e.is.fn(u.ready)&&n.on("ready",u.ready);for(var t=0;t<s.length;t++){var r=s[t];n.on("ready",r)}o&&(o.readies=[]),n.trigger("ready")},u.done)})},e.corefn=e.Core.prototype,e.fn.core({isReady:function(){return this._private.ready},ready:function(e){this.isReady()?this.trigger("ready",[],e):this.on("ready",e)},initrender:function(){return this._private.initrender},destroy:function(){this.notify({type:"destroy"});var e=this.container(),t=e.parentNode;if(t)try{t.removeChild(e)}catch(r){}return this},getElementById:function(t){var r=this._private.id2index[t];return void 0!==r?this._private.elements[r]:new e.Collection(this)},selectionType:function(){return this._private.selectionType},hasCompoundNodes:function(){return this._private.hasCompoundNodes},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){for(var t=this._private.elements,r=this._private.id2index,i=0;i<e.length;i++){var n=e[i],a=n._private.data.id,o=r[a],s=void 0!==o;s||(o=t.length,t.push(n),r[a]=o,n._private.index=o)}return this},removeFromPool:function(e){for(var t=this._private.elements,r=this._private.id2index,i=0;i<e.length;i++){var n=e[i],a=n._private.data.id,o=r[a],s=void 0!==o;if(s){this._private.id2index[a]=void 0,t.splice(o,1);for(var l=o;l<t.length;l++){var u=t[l]._private.data.id;r[u]--,t[l]._private.index--}}}},container:function(){return this._private.container},options:function(){return e.util.copy(this._private.options)},json:function(e){var t={},r=this;return t.elements={},r.elements().each(function(e,r){var i=r.group();t.elements[i]||(t.elements[i]=[]),t.elements[i].push(r.json())}),this._private.styleEnabled&&(t.style=r.style().json()),t.zoomingEnabled=r._private.zoomingEnabled,t.userZoomingEnabled=r._private.userZoomingEnabled,t.zoom=r._private.zoom,t.minZoom=r._private.minZoom,t.maxZoom=r._private.maxZoom,t.panningEnabled=r._private.panningEnabled,t.userPanningEnabled=r._private.userPanningEnabled,t.pan=r._private.pan,t.boxSelectionEnabled=r._private.boxSelectionEnabled,t.layout=r._private.options.layout,t.renderer=r._private.options.renderer,t.hideEdgesOnViewport=r._private.options.hideEdgesOnViewport,t.hideLabelsOnViewport=r._private.options.hideLabelsOnViewport,t.textureOnViewport=r._private.options.textureOnViewport,t.wheelSensitivity=r._private.options.wheelSensitivity,t.motionBlur=r._private.options.motionBlur,t},defer:function(e){var t=this,r=t._private,i=r.deferredExecQueue;i.push(e),r.deferredTimeout||(r.deferredTimeout=setTimeout(function(){for(;i.length>0;)i.shift()();r.deferredTimeout=null},0))}})}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";function r(e){var t=!document||"interactive"!==document.readyState&&"complete"!==document.readyState?r:e;setTimeout(t,9,e)}e.fn.core({add:function(t){var r,i=this;if(e.is.elementOrCollection(t)){var n=t;if(n._private.cy===i)r=n.restore();else{for(var a=[],o=0;o<n.length;o++){var s=n[o];a.push(s.json())}r=new e.Collection(i,a)}}else if(e.is.array(t)){var a=t;r=new e.Collection(i,a)}else if(e.is.plainObject(t)&&(e.is.array(t.nodes)||e.is.array(t.edges))){for(var l=t,a=[],u=["nodes","edges"],o=0,c=u.length;c>o;o++){var d=u[o],h=l[d];if(e.is.array(h))for(var p=0,v=h.length;v>p;p++){var f=h[p];f.group=d,a.push(f)}}r=new e.Collection(i,a)}else{var f=t;r=new e.Element(i,f).collection()}return r},remove:function(t){if(e.is.elementOrCollection(t))t=t;else if(e.is.string(t)){var r=t;t=this.$(r)}return t.remove()},load:function(i,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!=i&&(e.is.plainObject(i)||e.is.array(i))&&s.add(i),t?r(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 r(){e.util.requestAnimationFrame(function(e){i(e),r()})}function i(t){function r(r,i){var s=r._private.animation.current,l=r._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=[],h=s.length-1;h>=0;h--){var p=s[h];p.started||n(r,p),a(r,p,t,i),p.done&&(d.push(p),s.splice(h,1)),u=!0}for(var h=0;h<d.length;h++){var p=d[h],v=p.params.complete;e.is.fn(v)&&v.apply(r,[t])}return i||0!==s.length||0!==l.length||o.push(r),u}t=+new Date;for(var i=l._private.aniEles,o=[],s=0;s<i.length;s++){var u=i[s];r(u)}var c=r(l,!0);if(i.length>0||c){var d;if(i.length>0){var h=i.updateCompoundBounds();d=h.length>0?i.add(h):i}l.notify({type:"draw",collection:d})}i.unmerge(o)}function n(t,r){var i=e.is.core(t),n=!i,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(i)var d=l._private.pan,h={x:d.x,y:d.y},p=l._private.zoom;r.started=!0,r.startTime=Date.now(),r.startPosition=u,r.startStyle=c,r.startPan=h,r.startZoom=p}function a(t,r,i,n){var a,u=l._private.style,c=r.properties,d=r.params,h=r.startTime,p=!n;if(a=0===r.duration?1:Math.min(1,(i-h)/r.duration),0>a?a=0:a>1&&(a=1),null==c.delay){var v=r.startPosition,f=c.position,g=t._private.position;f&&p&&(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=r.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=r.startZoom,_=c.zoom,E=null!=_&&n;E&&(o(w,_)&&(t._private.zoom=s(w,_,a)),t.trigger("zoom")),(b||E)&&t.trigger("viewport");var S=c.style||c.css;if(S&&p)for(var D=0;D<S.length;D++){var k=S[D].name,T=S[D],P=T,C=r.startStyle[k],M=s(C,P,a);u.overrideBypass(t,k,M)}}return e.is.fn(d.step)&&d.step.apply(t,[i]),a>=1&&(r.done=!0),a}function o(t,r){return null==t||null==r?!1:e.is.number(t)&&e.is.number(r)?!0:t&&r?!0:!1}function s(t,r,i){0>i?i=0:i>1&&(i=1);var n,a;if(n=null!=t.pxValue||null!=t.value?null!=t.pxValue?t.pxValue:t.value:t,a=null!=r.pxValue||null!=r.value?null!=r.pxValue?r.pxValue:r.value:r,e.is.number(n)&&e.is.number(a))return n+(a-n)*i;if(e.is.number(n[0])&&e.is.number(a[0])){var o=n,s=a,l=function(e,t){var r=t-e,n=e;return Math.round(i*r+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&&r()}})}(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.define.eventAliasesOn(e.corefn)}(cytoscape),function(e){"use strict";e.fn.core({png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}}),e.corefn.jpeg=e.corefn.jpg}(cytoscape),function(e){"use strict";e.fn.core({layout:function(t){var r;return null==t&&(t=e.util.extend({},this._private.options.layout),t.eles=this.$()),r=this.initLayout(t),r.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 r=t.name,i=e.extension("layout",r);if(null==i)return void e.util.error("Can not apply layout: No such layout `"+r+"` 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 i(e.util.extend({},t,{cy:this}));return e.is.plainObject(n._private)||(n._private={}),n._private.cy=this,n._private.listeners=[],n}}),e.corefn.createLayout=e.corefn.makeLayout}(cytoscape),function(e){"use strict";e.fn.core({notify:function(e){if(this._private.batchingNotify){var t=this._private.batchNotifyEles,r=this._private.batchNotifyTypes;if(e.collection)for(var i=0;i<e.collection.length;i++){var n=e.collection[i];t.ids[n._private.id]||t.push(n)}return void(r.ids[e.type]||r.push(e.type))}if(this._private.notificationsEnabled){var a=this.renderer();a.notify(e)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:void(t.notificationsEnabled=e?!0:!1)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},startBatch:function(){var e=this._private;return e.batchingStyle=e.batchingNotify=!0,e.batchStyleEles=[],e.batchNotifyEles=[],e.batchNotifyTypes=[],e.batchStyleEles.ids={},e.batchNotifyEles.ids={},e.batchNotifyTypes.ids={},this},endBatch:function(){var t=this._private;return t.batchingStyle=!1,new e.Collection(this,t.batchStyleEles).updateStyle(),t.batchingNotify=!1,this.notify({type:t.batchNotifyTypes,collection:t.batchNotifyEles}),this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var r in e){var i=e[r],n=t.getElementById(r);n.data(i)}})}})}(cytoscape),function(e){"use strict";e.fn.core({renderTo:function(e,t,r,i){var n=this._private.renderer;return n.renderTo(e,t,r,i),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify({type:"draw"}),this},resize:function(){return this.notify({type:"resize"}),this.trigger("resize"),this},initRenderer:function(t){var r=this,i=e.extension("renderer",t.name);return null==i?void e.util.error("Can not initialise: No such renderer `%s` found; did you include its JS file?",t.name):void(this._private.renderer=new i(e.util.extend({},t,{cy:r,style:r._private.style})))},triggerOnRender:function(){for(var e=this._private.onRenders,t=0;t<e.length;t++){var r=e[t];r()}return this},onRender:function(e){return this._private.onRenders.push(e),this},offRender:function(e){var t=this._private.onRenders;if(null==e)return this._private.onRenders=[],this;for(var r=0;r<t.length;r++){var i=t[r];if(e===i){t.splice(r,1);break}}return this}})}(cytoscape),function(e){"use strict";e.fn.core({collection:function(t){return e.is.string(t)?this.$(t):e.is.elementOrCollection(t)?t.collection():e.is.array(t)?new e.Collection(this,t):new e.Collection(this)},nodes:function(e){var t=this.$(function(){return this.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(){return this.isEdge()});return e?t.filter(e):t},$:function(t){var r=new e.Collection(this,this._private.elements);return t?r.filter(t):r}}),e.corefn.elements=e.corefn.filter=e.corefn.$}(cytoscape),function(e){"use strict";e.fn.core({style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(t){var r=this._private;return r.style=e.is.stylesheet(t)?t.generateStyle(this):e.is.array(t)?e.style.fromJson(this,t):e.is.string(t)?e.style.fromString(this,t):new e.Style(this),r.style}})}(cytoscape),function(e){"use strict";e.fn.core({autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=e?!0:!1,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=e?!0:!1,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=e?!0:!1,this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=e?!0:!1,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=e?!0:!1,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=e?!0:!1,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=e?!0:!1,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=e?!0:!1,this)},pan:function(){var t,r,i,n,a,o=arguments,s=this._private.pan;switch(o.length){case 0:return s;case 1:if(e.is.string(o[0]))return t=o[0],s[t];if(e.is.plainObject(o[0])){if(!this._private.panningEnabled)return this;i=o[0],n=i.x,a=i.y,e.is.number(n)&&(s.x=n),e.is.number(a)&&(s.y=a),this.trigger("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;t=o[0],r=o[1],"x"!==t&&"y"!==t||!e.is.number(r)||(s[t]=r),this.trigger("pan viewport")}return this.notify({type:"viewport"}),this},panBy:function(t){var r,i,n,a,o,s=arguments,l=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:e.is.plainObject(s[0])&&(n=s[0],a=n.x,o=n.y,e.is.number(a)&&(l.x+=a),e.is.number(o)&&(l.y+=o),this.trigger("pan viewport"));
break;case 2:r=s[0],i=s[1],"x"!==r&&"y"!==r||!e.is.number(i)||(l[r]+=i),this.trigger("pan viewport")}return this.notify({type:"viewport"}),this},fit:function(e,t){var r=this.getFitViewport(e,t);if(r){var i=this._private;i.zoom=r.zoom,i.pan=r.pan,this.trigger("pan zoom viewport"),this.notify({type:"viewport"})}return this},getFitViewport:function(t,r){if(e.is.number(t)&&void 0===r&&(r=t,t=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var i;if(e.is.string(t)){var n=t;t=this.$(n)}else if(e.is.boundingBox(t)){var a=t;i={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},i.w=i.x2-i.x1,i.h=i.y2-i.y1}else e.is.elementOrCollection(t)||(t=this.elements());i=i||t.boundingBox();var o,s=this.width(),l=this.height();if(r=e.is.number(r)?r:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(i.w)&&!isNaN(i.h)&&i.w>0&&i.h>0){o=Math.min((s-2*r)/i.w,(l-2*r)/i.h),o=o>this._private.maxZoom?this._private.maxZoom:o,o=o<this._private.minZoom?this._private.minZoom:o;var u={x:(s-o*(i.x1+i.x2))/2,y:(l-o*(i.y1+i.y2))/2};return{zoom:o,pan:u}}}},minZoom:function(t){return void 0===t?this._private.minZoom:(e.is.number(t)&&(this._private.minZoom=t),this)},maxZoom:function(t){return void 0===t?this._private.maxZoom:(e.is.number(t)&&(this._private.maxZoom=t),this)},zoom:function(t){var r,i;if(void 0===t)return this._private.zoom;if(e.is.number(t))i=t;else if(e.is.plainObject(t)){if(i=t.level,t.position){var n=t.position,a=this._private.pan,o=this._private.zoom;r={x:n.x*o+a.x,y:n.y*o+a.y}}else t.renderedPosition&&(r=t.renderedPosition);if(r&&!this._private.panningEnabled)return this}if(!this._private.zoomingEnabled)return this;if(!e.is.number(i)||r&&(!e.is.number(r.x)||!e.is.number(r.y)))return this;if(i=i>this._private.maxZoom?this._private.maxZoom:i,i=i<this._private.minZoom?this._private.minZoom:i,r){var s=this._private.pan,l=this._private.zoom,u=i,c={x:-u/l*(r.x-s.x)+r.x,y:-u/l*(r.y-s.y)+r.y};this._private.zoom=i,this._private.pan=c;var d=s.x!==c.x||s.y!==c.y;this.trigger(" zoom "+(d?" pan ":"")+" viewport ")}else this._private.zoom=i,this.trigger("zoom viewport");return this.notify({type:"viewport"}),this},viewport:function(t){var r=this._private,i=!0,n=!0,a=[],o=!1,s=!1;if(!t)return this;if(e.is.number(t.zoom)||(i=!1),e.is.plainObject(t.pan)||(n=!1),!i&&!n)return this;if(i){var l=t.zoom;l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=l,a.push("zoom"))}if(n&&(!o||!t.cancelOnFailedZoom)&&r.panningEnabled){var u=t.pan;e.is.number(u.x)&&(r.pan.x=u.x,s=!1),e.is.number(u.y)&&(r.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,r){if(this._private.panningEnabled){if(e.is.string(t)){var i=t;t=this.elements(i)}else e.is.elementOrCollection(t)||(t=this.elements());var n=t.boundingBox(),a=this.width(),o=this.height();r=void 0===r?this._private.zoom:r;var s={x:(a-r*(n.x1+n.x2))/2,y:(o-r*(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,r=this.renderedExtent(),i={x1:(r.x1-e.x)/t,x2:(r.x2-e.x)/t,y1:(r.y1-e.y)/t,y2:(r.y2-e.y)/t};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},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,r){for(var i in t){var n=t[i];e.Collection.prototype[i]=n}};var t={prefix:{nodes:"n",edges:"e"},id:{nodes:0,edges:0},generate:function(t,r,i){var n=e.is.element(r)?r._private:r,a=n.group,o=null!=i?i: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,r,i){if(!(this instanceof e.Element))return new e.Element(t,r,i);var n=this;if(i=void 0===i||i?!0:!1,void 0===t||void 0===r||!e.is.core(t))return void e.util.error("An element must have a core reference and parameters set");if("nodes"!==r.group&&"edges"!==r.group)return void e.util.error("An element must be of type `nodes` or `edges`; you specified `"+r.group+"`");if(this.length=1,this[0]=this,this._private={cy:t,single:!0,data:r.data||{},position:r.position||{},autoWidth:void 0,autoHeight:void 0,listeners:[],group:r.group,style:{},rstyle:{},styleCxts:[],removed:!0,selected:r.selected?!0:!1,selectable:void 0===r.selectable?!0:r.selectable?!0:!1,locked:r.locked?!0:!1,grabbed:!1,grabbable:void 0===r.grabbable?!0:r.grabbable?!0:!1,active:!1,classes:{},animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[]},r.renderedPosition){var a=r.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(r.classes))for(var l=r.classes.split(/\s+/),u=0,c=l.length;c>u;u++){var d=l[u];d&&""!==d&&(n._private.classes[d]=!0)}r.css&&t.style().applyBypass(this,r.css),(void 0===i||i)&&this.restore()},e.Collection=function(r,i,n){if(!(this instanceof e.Collection))return new e.Collection(r,i);if(void 0===r||!e.is.core(r))return void e.util.error("A collection must have a reference to the core");var a={},o={},s=!1;if(i){if(i.length>0&&e.is.plainObject(i[0])&&!e.is.element(i[0])){s=!0;for(var l=[],u={},c=0,d=i.length;d>c;c++){var h=i[c];null==h.data&&(h.data={});var p=h.data;if(null==p.id)p.id=t.generate(r,h);else if(0!==r.getElementById(p.id).length||u[p.id])continue;var v=new e.Element(r,h,!1);l.push(v),u[p.id]=!0}i=l}}else i=[];this.length=0;for(var c=0,d=i.length;d>c;c++){var f=i[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:r,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 r=this._private.cy,i=this._private.ids[t];return i?i:e.Collection(r)},e.elesfn.json=function(){var t=this.element();if(null==t)return void 0;var r=t._private,i=e.util.copy({data:r.data,position:r.position,group:r.group,bypass:r.bypass,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbed:r.grabbed,grabbable:r.grabbable,classes:""}),n=[];for(var a in r.classes)r.classes[a]&&n.push(a);for(var o=0;o<n.length;o++){var a=n[o];i.classes+=a+(o<n.length-1?" ":"")}return i},e.elesfn.jsons=function(){for(var e=[],t=0;t<this.length;t++){var r=this[t],i=r.json();e.push(i)}return e},e.elesfn.clone=function(){for(var t=this.cy(),r=[],i=0;i<this.length;i++){var n=this[i],a=n.json(),o=new e.Element(t,a,!1);r.push(o)}return new e.Collection(t,r)},e.elesfn.copy=e.elesfn.clone,e.elesfn.restore=function(r){var i=this,n=[],a=i.cy();void 0===r&&(r=!0);for(var o=[],s=[],l=[],u=0,c=0,d=0,h=i.length;h>d;d++){var p=i[d];p.isNode()?(s.push(p),u++):(l.push(p),c++)}o=s.concat(l);for(var d=0,h=o.length;h>d;d++){var p=o[d];if(p.removed()){var v=p._private,f=v.data;if(void 0===f.id)f.id=t.generate(a,p);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(p.isEdge()){for(var y=p,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),D=a.getElementById(f.target);S._private.edges.push(y),D._private.edges.push(y),y._private.source=S,y._private.target=D}v.ids={},v.ids[g]=p,v.removed=!1,a.addToPool(p),n.push(p)}}for(var d=0;u>d;d++){var k=o[d],f=k._private.data,T=k._private.data.parent,P=null!=T;if(P){var C=a.getElementById(T);if(C.empty())f.parent=void 0;else{for(var M=!1,B=C;!B.empty();){if(k.same(B)){M=!0,f.parent=void 0;break}B=B.parent()}M||(C[0]._private.children.push(k),k._private.parent=C[0],a._private.hasCompoundNodes=!0)}}}if(n=new e.Collection(a,n),n.length>0){var N=n.add(n.connectedNodes()).add(n.parent());N.updateStyle(r),r?n.rtrigger("add"):n.trigger("add")}return i},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 r(e){for(var t=e._private.edges,r=0;r<t.length;r++)n(t[r])}function i(e){for(var t=e._private.children,r=0;r<t.length;r++)n(t[r])}function n(e){var t=c[e.id()];t||(c[e.id()]=!0,e.isNode()?(u.push(e),r(e),i(e)):u.unshift(e))}function a(e,t){for(var r=e._private.edges,i=0;i<r.length;i++){var n=r[i];if(t===n){r.splice(i,1);break}}}function o(e,t){t=t[0],e=e[0];for(var r=e._private.children,i=0;i<r.length;i++)if(r[i][0]===t[0]){r.splice(i,1);break}}var s=this,l=[],u=[],c={},d=s._private.cy;void 0===t&&(t=!0);for(var h=0,p=s.length;p>h;h++){var v=s[h];n(v)}for(var h=0;h<u.length;h++){var v=u[h];if(v._private.removed=!0,d.removeFromPool(v),l.push(v),v.isEdge()){var f=v.source()[0],g=v.target()[0];a(f,v),a(g,v)}else{var y=v.parent();0!==y.length&&o(y,v)}}var m=d._private.elements;d._private.hasCompoundNodes=!1;for(var h=0;h<m.length;h++){var v=m[h];if(v.isParent()){d._private.hasCompoundNodes=!0;break}}var x=new e.Collection(this.cy(),l);x.size()>0&&(t&&this.cy().notify({type:"remove",collection:x}),x.trigger("remove"));for(var b={},h=0;h<u.length;h++){var v=u[h],w="nodes"===v._private.group,_=v._private.data.parent;if(w&&void 0!==_&&!b[_]){b[_]=!0;var y=d.getElementById(_);y&&0!==y.length&&!y._private.removed&&0===y.children().length&&y.updateStyle()}}return this},e.elesfn.move=function(e){var t=this._private.cy;if(void 0!==e.source||void 0!==e.target){var r=e.source,i=e.target,n=t.getElementById(r).length>0,a=t.getElementById(i).length>0;if(n||a){var o=this.jsons();this.remove();for(var s=0;s<o.length;s++){var l=o[s];"edges"===l.group&&(n&&(l.data.source=r),a&&(l.data.target=i))}return t.add(o)}}else if(void 0!==e.parent){var u=e.parent,c=null===u||t.getElementById(u).length>0;if(c){var o=this.jsons(),d=this.descendants(),h=d.merge(d.add(this).connectedEdges());this.remove();for(var s=0;s<this.length;s++){var l=o[s];"nodes"===l.group&&(l.data.parent=null===u?void 0:u)}}return t.add(o).merge(h.restore())}return this}}(cytoscape),function(e){"use strict";e.fn.eles({stdBreadthFirstSearch:function(t){return t=e.util.extend({},t,{std:!0}),this.breadthFirstSearch(t)},breadthFirstSearch:function(t,r,i){var n,a,o;e.is.plainObject(t)&&!e.is.elementOrCollection(t)&&(n=t,t=n.roots,r=n.visit,i=n.directed,a=n.std,o=n.thisArg),i=2!==arguments.length||e.is.fn(r)?i:r,r=e.is.fn(r)?r:function(){};for(var s,l=this._private.cy,u=e.is.string(t)?this.filter(t):t,c=[],d=[],h={},p={},v={},f=0,g=this.nodes(),y=this.edges(),m=0;m<u.length;m++)u[m].isNode()&&(c.unshift(u[m]),v[u[m].id()]=!0,d.push(u[m]),p[u[m].id()]=0);for(;0!==c.length;){var x,u=c.shift(),b=p[u.id()],w=h[u.id()],_=null==w?void 0:w.connectedNodes().not(u)[0];if(x=a?r.call(o,u,w,_,f++,b):r.call(u,f++,b,u,w,_),x===!0){s=u;break}if(x===!1)break;for(var E=u.connectedEdges(i?function(){return this.data("source")===u.id()}:void 0).intersect(y),m=0;m<E.length;m++){var S=E[m],D=S.connectedNodes(function(){return this.id()!==u.id()}).intersect(g);0===D.length||v[D.id()]||(D=D[0],c.push(D),v[D.id()]=!0,p[D.id()]=p[u.id()]+1,d.push(D),h[D.id()]=S)}}for(var k=[],m=0;m<d.length;m++){var T=d[m],P=h[T.id()];P&&k.push(P),k.push(T)}return{path:new e.Collection(l,k,{unique:!0}),found:new e.Collection(l,s,{unique:!0})}},stdDepthFirstSearch:function(t){return t=e.util.extend({},t,{std:!0}),this.depthFirstSearch(t)},depthFirstSearch:function(t,r,i){var n,a,o;e.is.plainObject(t)&&!e.is.elementOrCollection(t)&&(n=t,t=n.roots,r=n.visit,i=n.directed,a=n.std,o=n.thisArg),i=2!==arguments.length||e.is.fn(r)?i:r,r=e.is.fn(r)?r:function(){};for(var s,l=this._private.cy,u=e.is.string(t)?this.filter(t):t,c=[],d=[],h={},p={},v={},f=0,g=this.edges(),y=this.nodes(),m=0;m<u.length;m++)u[m].isNode()&&(c.push(u[m]),d.push(u[m]),p[u[m].id()]=0);for(;0!==c.length;){var u=c.pop();if(!v[u.id()]){v[u.id()]=!0;var x,b=p[u.id()],w=h[u.id()],_=null==w?void 0:w.connectedNodes().not(u)[0];if(x=a?r.call(o,u,w,_,f++,b):r.call(u,f++,b,u,w,_),x===!0){s=u;break}if(x===!1)break;for(var E=u.connectedEdges(i?function(){return this.data("source")===u.id()}:void 0).intersect(g),m=0;m<E.length;m++){var S=E[m],D=S.connectedNodes(function(){return this.id()!==u.id()}).intersect(y);0===D.length||v[D.id()]||(D=D[0],c.push(D),p[D.id()]=p[u.id()]+1,d.push(D),h[D.id()]=S)}}}for(var k=[],m=0;m<d.length;m++){var T=d[m],P=h[T.id()];P&&k.push(P),k.push(T)}return{path:new e.Collection(l,k,{unique:!0}),found:new e.Collection(l,s,{unique:!0})}},kruskal:function(t){function r(e){for(var t=0;t<n.length;t++){var r=n[t];if(r.anySame(e))return{eles:r,index:t}}}t=e.is.fn(t)?t:function(){return 1};for(var i=new e.Collection(this._private.cy,[]),n=[],a=this.nodes(),o=0;o<a.length;o++)n.push(a[o].collection());for(var s=this.edges(),l=s.toArray().sort(function(e,r){var i=t.call(e,e),n=t.call(r,r);return i-n}),o=0;o<l.length;o++){var u=l[o],c=u.source()[0],d=u.target()[0],h=r(c),p=r(d);h.index!==p.index&&(i=i.add(u),n[h.index]=h.eles.add(p.eles),n.splice(p.index,1))}return a.add(i)},dijkstra:function(t,r,i){var n;e.is.plainObject(t)&&!e.is.elementOrCollection(t)&&(n=t,t=n.root,r=n.weight,i=n.directed);var a=this._private.cy;r=e.is.fn(r)?r:function(){return 1};for(var o=e.is.string(t)?this.filter(t)[0]:t[0],s={},l={},u={},c=this.edges().filter(function(){return!this.isLoop()}),d=this.nodes(),h=[],p=0;p<d.length;p++)s[d[p].id()]=d[p].same(o)?0:1/0,h.push(d[p]);var v=function(e){return s[e.id()]};h=new e.Collection(a,h);for(var f=e.Minheap(a,h,v),g=function(e,t){for(var n,a=(i?e.edgesTo(t):e.edgesWith(t)).intersect(c),o=1/0,s=0;s<a.length;s++){var l=a[s],u=r.apply(l,[l]);(o>u||!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),p=0;p<w.length;p++){var _=w[p],E=_.id(),S=g(b,_),D=m+S.dist;D<f.getValueById(E)&&(f.edit(E,D),l[E]={node:b,edge:S.edge})}}return{distanceTo:function(t){var r=e.is.string(t)?d.filter(t)[0]:t[0];return u[r.id()]},pathTo:function(t){var r=e.is.string(t)?d.filter(t)[0]:t[0],i=[],n=r;if(r.length>0)for(i.unshift(r);l[n.id()];){var o=l[n.id()];i.unshift(o.edge),i.unshift(o.node),n=o.node}return new e.Collection(a,i)}}}}),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 r=function(e,t,i,a){if(e==t)return a.push(n.getElementById(t)),a;if(t in i){var o=i[t],s=p[t];return a.push(n.getElementById(t)),a.push(n.getElementById(s)),r(e,o,i,a)}return void 0},i=function(e,t){if(0===e.length)return void 0;for(var r=0,i=t[e[0]],n=1;n<e.length;n++){var a=t[e[n]];i>a&&(i=a,r=n)}return r},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(e){return 1};if(null!=t.directed)var u=t.directed;else var u=!1;var c=[],d=[a.id()],h={},p={},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=i(d,f),b=n.getElementById(d[x]);if(m++,b.id()==o.id()){var w=r(a.id(),o.id(),h,[]);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],D=S.connectedNodes().stdFilter(function(e){return e.id()!==b.id()}).intersect(y);if(-1==c.indexOf(D.id())){var k=v[b.id()]+l.apply(S,[S]);-1!=d.indexOf(D.id())?k<v[D.id()]&&(v[D.id()]=k,f[D.id()]=k+s(D),h[D.id()]=b.id()):(v[D.id()]=k,f[D.id()]=k+s(D),d.push(D.id()),h[D.id()]=b.id(),p[D.id()]=S.id())}}}return{found:!1,distance:void 0,path:void 0,steps:m}},floydWarshall:function(t){t=t||{};var r=this._private.cy;if(null!=t.weight&&e.is.fn(t.weight))var i=t.weight;else var i=function(e){return 1};if(null!=t.directed)var n=t.directed;else var n=!1;for(var a=this.edges().stdFilter(function(e){return!e.isLoop()}),o=this.nodes(),s=o.length,l={},u=0;s>u;u++)l[o[u].id()]=u;for(var c=[],u=0;s>u;u++){for(var d=new Array(s),h=0;s>h;h++)d[h]=u==h?0:1/0;c.push(d)}var p=[],v=[],f=function(e){for(var t=0;s>t;t++){for(var r=new Array(s),i=0;s>i;i++)r[i]=void 0;e.push(r)}};f(p),f(v);for(var u=0;u<a.length;u++){var g=l[a[u].source().id()],y=l[a[u].target().id()],m=i.apply(a[u],[a[u]]);c[g][y]>m&&(c[g][y]=m,p[g][y]=y,v[g][y]=a[u])}if(!n)for(var u=0;u<a.length;u++){var g=l[a[u].target().id()],y=l[a[u].source().id()],m=i.apply(a[u],[a[u]]);c[g][y]>m&&(c[g][y]=m,p[g][y]=y,v[g][y]=a[u])}for(var x=0;s>x;x++)for(var u=0;s>u;u++)for(var h=0;s>h;h++)c[u][x]+c[x][h]<c[u][h]&&(c[u][h]=c[u][x]+c[x][h],p[u][h]=p[u][x]);for(var b=[],u=0;s>u;u++)b.push(o[u].id());var w={distance:function(t,i){if(e.is.string(t))var n=r.filter(t)[0].id();else var n=t.id();if(e.is.string(i))var a=r.filter(i)[0].id();else var a=i.id();return c[l[n]][l[a]]},path:function(t,i){var n=function(e,t,i,n,a){if(e===t)return r.getElementById(n[e]);if(void 0===i[e][t])return void 0;for(var o=[r.getElementById(n[e])],s=e;e!==t;){s=e,e=i[e][t];var l=a[s][e];o.push(l),o.push(r.getElementById(n[e]))}return o};if(e.is.string(t))var a=r.filter(t)[0].id();else var a=t.id();if(e.is.string(i))var o=r.filter(i)[0].id();else var o=i.id();var s=n(l[a],l[o],p,b,v);return new e.Collection(r,s)}};return w},bellmanFord:function(t){if(t=t||{},null!=t.weight&&e.is.fn(t.weight))var r=t.weight;else var r=function(e){return 1};if(null!=t.directed)var i=t.directed;else var i=!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=[],h=[],p=[],c=0;l>c;c++)d[c]=s[c].id()===n.id()?0:1/0,h[c]=void 0;for(var v=!1,c=1;l>c;c++){v=!1;for(var f=0;f<o.length;f++){var g=u[o[f].source().id()],y=u[o[f].target().id()],m=r.apply(o[f],[o[f]]),x=d[g]+m;if(x<d[y]&&(d[y]=x,h[y]=g,p[y]=o[f],v=!0),!i){var x=d[y]+m;x<d[g]&&(d[g]=x,h[g]=y,p[g]=o[f],v=!0)}}if(!v)break}if(v)for(var f=0;f<o.length;f++){var g=u[o[f].source().id()],y=u[o[f].target().id()],m=r.apply(o[f],[o[f]]);if(d[g]+m<d[y])return e.util.error("Error: graph contains a negative weigth cycle!"),{pathTo:void 0,distanceTo:void 0,hasNegativeWeightCycle:!0}}for(var b=[],c=0;l>c;c++)b.push(s[c].id());var w={distanceTo:function(t){if(e.is.string(t))var r=a.filter(t)[0].id();else var r=t.id();return d[u[r]]},pathTo:function(t){var r=function(e,t,r,i,n,o){for(;;){if(n.push(a.getElementById(i[r])),n.push(o[r]),t===r)return n;var s=e[r];if("undefined"==typeof s)return void 0;r=s}};if(e.is.string(t))var i=a.filter(t)[0].id();else var i=t.id();var o=[],s=r(h,u[n.id()],u[i],b,o,p);return null!=s&&s.reverse(),new e.Collection(a,s)},hasNegativeWeightCycle:!1};return w},kargerStein:function(t){t=t||{};var r=function(e,t,r){for(var i=r[e],n=i[1],a=i[2],o=t[n],s=t[a],l=r.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<l.length;u++){var c=l[u];c[1]===s?(l[u]=c.slice(0),l[u][1]=o):c[2]===s&&(l[u]=c.slice(0),l[u][2]=o)}for(var u=0;u<t.length;u++)t[u]===s&&(t[u]=o);return l},i=function(e,t,n,a){if(a>=n)return t;var o=Math.floor(Math.random()*t.length),s=r(o,e,t);return i(e,s,n-1,a)},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={},h=0;s>h;h++)d[o[h].id()]=h;for(var p=[],h=0;l>h;h++){var v=a[h];p.push([h,d[v.source().id()],d[v.target().id()]])}for(var f,g=1/0,y=[],h=0;s>h;h++)y.push(h);for(var m=0;u>=m;m++){var x=y.slice(0),b=i(x,p,s,c),w=x.slice(0),_=i(x,b,c,2),E=i(w,b,c,2);_.length<=E.length&&_.length<g?(g=_.length,f=[_,x]):E.length<=_.length&&E.length<g&&(g=E.length,f=[E,w])}for(var S=f[0].map(function(e){return a[e[0]]}),D=[],k=[],T=f[1][0],h=0;h<f[1].length;h++){var P=f[1][h];P===T?D.push(o[h]):k.push(o[h])}var C={cut:new e.Collection(n,S),partition1:new e.Collection(n,D),partition2:new e.Collection(n,k)};return C},pageRank:function(t){t=t||{};var r=function(e){for(var t=e.length,r=0,i=0;t>i;i++)r+=e[i];for(var i=0;t>i;i++)e[i]=e[i]/r};if(null!=t&&null!=t.dampingfactor)var i=t.dampingFactor;else var i=.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(e){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,h={},p=0;c>p;p++)h[u[p].id()]=p;for(var v=[],f=[],g=(1-i)/c,p=0;c>p;p++){for(var y=[],m=0;c>m;m++)y.push(0);v.push(y),f.push(0)}for(var p=0;d>p;p++){var x=l[p],b=h[x.source().id()],w=h[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 p=0;c>p;p++)v[p][m]=E;else for(var p=0;c>p;p++)v[p][m]=v[p][m]/f[m]+g;for(var S,D=[],k=[],p=0;c>p;p++)D.push(1),k.push(0);for(var T=0;a>T;T++){for(var P=k.slice(0),p=0;c>p;p++)for(var m=0;c>m;m++)P[p]+=v[p][m]*D[m];r(P),S=D,D=P;for(var C=0,p=0;c>p;p++)C+=Math.pow(S[p]-D[p],2);if(n>C)break}var M={rank:function(t){if(e.is.string(t))var r=s.filter(t)[0].id();else var r=t.id();return D[h[r]]}};return M},degreeCentralityNormalized:function(t){if(t=t||{},null!=t.directed)var r=t.directed;else var r=!1;var i=this.nodes(),n=i.length;if(r){for(var a={},o={},s=0,l=0,u=0;n>u;u++){var c=i[u],d=this.degreeCentrality(e.util.extend({},t,{root:c}));s<d.indegree&&(s=d.indegree),l<d.outdegree&&(l=d.outdegree),a[c.id()]=d.indegree,o[c.id()]=d.outdegree}return{indegree:function(t){if(e.is.string(t))var t=cy.filter(t)[0].id();else var t=t.id();return a[t]/s},outdegree:function(t){if(e.is.string(t))var t=cy.filter(t)[0].id();else var t=t.id();return o[t]/l}}}for(var h={},p=0,u=0;n>u;u++){var c=i[u],d=this.degreeCentrality(e.util.extend({},t,{root:c}));p<d.degree&&(p=d.degree),h[c.id()]=d.degree}return{degree:function(t){if(e.is.string(t))var t=cy.filter(t)[0].id();else var t=t.id();return h[t]/p}}},degreeCentrality:function(t){t=t||{};var r=this;if(null==t||null==t.root)return void 0;var i=e.is.string(t.root)?this.filter(t.root)[0]:t.root[0];if(null!=t.weight&&e.is.fn(t.weight))var n=t.weight;else var n=function(e){return 1};if(null!=t.directed)var a=t.directed;else var a=!1;if(null!=t.alpha&&e.is.number(t.alpha))var o=t.alpha;else o=0;if(a){for(var s=i.connectedEdges('edge[target = "'+i.id()+'"]').intersection(r),l=i.connectedEdges('edge[source = "'+i.id()+'"]').intersection(r),u=s.length,c=l.length,d=0,h=0,p=0;p<s.length;p++){var v=s[p];d+=n.apply(v,[v])}for(var p=0;p<l.length;p++){var v=l[p];h+=n.apply(v,[v])}return{indegree:Math.pow(u,1-o)*Math.pow(d,o),outdegree:Math.pow(c,1-o)*Math.pow(h,o)}}for(var f=i.connectedEdges().intersection(r),g=f.length,y=0,p=0;p<f.length;p++){var v=f[p];y+=n.apply(v,[v])}return{degree:Math.pow(g,1-o)*Math.pow(y,o)}},closenessCentralityNormalized:function(t){t=t||{};var r=t.harmonic;void 0===r&&(r=!0);for(var i={},n=0,a=this.nodes(),o=this.floydWarshall({weight:t.weight,directed:t.directed}),s=0;s<a.length;s++){for(var l=0,u=0;u<a.length;u++)if(s!=u){var c=o.distance(a[s],a[u]);l+=r?1/c:c}r||(l=1/l),l>n&&(n=l),i[a[s].id()]=l}return{closeness:function(t){if(e.is.string(t))var t=cy.filter(t)[0].id();else var t=t.id();return i[t]/n}}},closenessCentrality:function(t){if(t=t||{},null==t.root)return void e.util.error("options.root required");if(e.is.string(t.root))var r=this.filter(t.root)[0];else var r=t.root[0];if(null!=t.weight&&e.is.fn(t.weight))var i=t.weight;else var i=function(){return 1};if(null!=t.directed&&e.is.bool(t.directed))var n=t.directed;else var n=!1;var a=t.harmonic;void 0===a&&(a=!0);for(var o=this.dijkstra({root:r,weight:i,directed:n}),s=0,l=this.nodes(),u=0;u<l.length;u++)if(l[u].id()!=r.id()){var c=o.distanceTo(l[u]);s+=a?1/c:c}return a?s:1/s},betweennessCentrality:function(t){if(t=t||{},null!=t.weight&&e.is.fn(t.weight))var r=t.weight,i=!0;else var i=!1;if(null!=t.directed&&e.is.bool(t.directed))var n=t.directed;else var n=!1;for(var a=function(e,t){e.unshift(t);for(var r=0;f[e[r]]<f[e[r+1]]&&r<e.length-1;r++){var i=e[r];e[r]=e[r+1],e[r+1]=i}},o=this._private.cy,s=this.nodes(),l={},u={},c=0;c<s.length;c++)l[s[c].id()]=n?s[c].outgoers("node"):s[c].openNeighborhood("node");for(var c=0;c<s.length;c++)u[s[c].id()]=0;for(var d=0;d<s.length;d++){for(var h=[],p={},v={},f={},g=[],c=0;c<s.length;c++)p[s[c].id()]=[],v[s[c].id()]=0,f[s[c].id()]=Number.POSITIVE_INFINITY;for(v[s[d].id()]=1,f[s[d].id()]=0,g.unshift(s[d].id());g.length>0;){var y=g.pop();h.push(y),l[y].forEach(i?function(e){if(o.$("#"+y).edgesTo(e).length>0)var t=o.$("#"+y).edgesTo(e)[0];else var t=e.edgesTo("#"+y)[0];var i=r.apply(t,[t]);f[e.id()]>f[y]+i&&(f[e.id()]=f[y]+i,g.indexOf(e.id())<0?a(g,e.id()):(g.splice(g.indexOf(e.id()),1),a(g,e.id())),v[e.id()]=0,p[e.id()]=[]),f[e.id()]==f[y]+i&&(v[e.id()]=v[e.id()]+v[y],p[e.id()].push(y))}:function(e){f[e.id()]==Number.POSITIVE_INFINITY&&(g.unshift(e.id()),f[e.id()]=f[y]+1),f[e.id()]==f[y]+1&&(v[e.id()]=v[e.id()]+v[y],p[e.id()].push(y))})}for(var m={},c=0;c<s.length;c++)m[s[c].id()]=0;for(;h.length>0;){var x=h.pop();p[x].forEach(function(e){m[e]=m[e]+v[e]/v[x]*(1+m[x]),x!=s[d].id()&&(u[x]=u[x]+m[x])})}}var b=0;for(var w in u)b<u[w]&&(b=u[w]);var _={betweenness:function(t){if(e.is.string(t))var t=o.filter(t)[0].id();else var t=t.id();return u[t]},betweennessNormalized:function(t){if(e.is.string(t))var t=o.filter(t)[0].id();else var t=t.id();return u[t]/b}};return _.betweennessNormalised=_.betweennessNormalized,_}}),e.elesfn.dc=e.elesfn.degreeCentrality,e.elesfn.dcn=e.elesfn.degreeCentralityNormalised=e.elesfn.degreeCentralityNormalized,e.elesfn.cc=e.elesfn.closenessCentrality,e.elesfn.ccn=e.elesfn.closenessCentralityNormalised=e.elesfn.closenessCentralityNormalized,e.elesfn.bc=e.elesfn.betweennessCentrality}(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({addClass:function(t){t=t.split(/\s+/);for(var r=this,i=[],n=0;n<t.length;n++){var a=t[n];if(!e.is.emptyString(a))for(var o=0;o<r.length;o++){var s=r[o],l=s._private.classes[a];s._private.classes[a]=!0,l||i.push(s)}}return i.length>0&&new e.Collection(this._private.cy,i).updateStyle().trigger("class"),r},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes[e]?!0:!1},toggleClass:function(t,r){for(var i=t.split(/\s+/),n=this,a=[],o=0,s=n.length;s>o;o++)for(var l=n[o],u=0;u<i.length;u++){var c=i[u];if(!e.is.emptyString(c)){var d=l._private.classes[c],h=r||void 0===r&&!d;h?(l._private.classes[c]=!0,d||a.push(l)):(l._private.classes[c]=!1,d&&a.push(l))}}return a.length>0&&new e.Collection(this._private.cy,a).updateStyle().trigger("class"),n},removeClass:function(t){t=t.split(/\s+/);for(var r=this,i=[],n=0;n<r.length;n++)for(var a=r[n],o=0;o<t.length;o++){var s=t[o];if(s&&""!==s){var l=a._private.classes[s];a._private.classes[s]=void 0,l&&i.push(a)}}return i.length>0&&new e.Collection(r._private.cy,i).updateStyle(),r.trigger("class"),r},flashClass:function(e,t){var r=this;if(null==t)t=250;else if(0===t)return r;return r.addClass(e),setTimeout(function(){r.removeClass(e)},t),r}})}(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 r=0;r<this.length;r++){var i=t?e.apply(t,[this[r],r,this]):e(this[r],r,this);if(i)return!0}return!1},every:function(e,t){for(var r=0;r<this.length;r++){var i=t?e.apply(t,[this[r],r,this]):e(this[r],r,this);if(!i)return!1}return!0},same:function(e){return e=this.cy().collection(e),this.length!==e.length?!1:this.intersect(e).length===this.length},anySame:function(e){return e=this.cy().collection(e),this.intersect(e).length>0},allAreNeighbors:function(e){return e=this.cy().collection(e),this.neighborhood().intersect(e).length===e.length}}),e.elesfn.allAreNeighbours=e.elesfn.allAreNeighbors}(cytoscape),function(e){"use strict";e.fn.eles({parent:function(t){for(var r=[],i=this._private.cy,n=0;n<this.length;n++){var a=this[n],o=i.getElementById(a._private.data.parent);o.size()>0&&r.push(o)}return new e.Collection(i,r,{unique:!0}).filter(t)},parents:function(t){for(var r=[],i=this.parent();i.nonempty();){for(var n=0;n<i.length;n++){var a=i[n];r.push(a)}i=i.parent()}return new e.Collection(this.cy(),r,{unique:!0}).filter(t)},commonAncestors:function(e){for(var t,r=0;r<this.length;r++){var i=this[r],n=i.parents();t=t||n,t=t.intersect(n)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(e){return e.isNode()&&e.parent().empty()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(e){return e.isNode()&&e.parent().nonempty()}).filter(e)},children:function(t){for(var r=[],i=0;i<this.length;i++){var n=this[i];r=r.concat(n._private.children)}return new e.Collection(this.cy(),r,{unique:!0}).filter(t)},siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];return e?0!==e._private.children.length:void 0},isChild:function(){var e=this[0];return e?void 0!==e._private.data.parent&&0!==e.parent().length:void 0},descendants:function(t){function r(e){for(var t=0;t<e.length;t++){var n=e[t];i.push(n),n.children().nonempty()&&r(n.children())}}var i=[];return r(this.children()),new e.Collection(this.cy(),i,{unique:!0}).filter(t)}}),e.elesfn.ancestors=e.elesfn.parents}(cytoscape),function(e){"use strict";var t=1,r=0;e.fn.eles({data:e.define.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:e.define.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:e.define.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:e.define.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:e.define.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,
allowGetting:!0}),removeRscratch:e.define.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];return e?e._private.data.id:void 0},position:e.define.data({field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"rtrigger",allowGetting:!0,validKeys:["x","y"],onSet:function(e){var t=e.updateCompoundBounds();t.rtrigger("position")},canSet:function(e){return!e.locked()}}),silentPosition:e.define.data({field:"position",bindingEvent:"position",allowBinding:!1,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!1,triggerFnName:"trigger",allowGetting:!0,validKeys:["x","y"],onSet:function(e){e.updateCompoundBounds()},canSet:function(e){return!e.locked()}}),positions:function(t,r){if(e.is.plainObject(t))this.position(t);else if(e.is.fn(t)){for(var i=t,n=0;n<this.length;n++){var a=this[n],t=i.apply(a,[n,a]);if(t&&!a.locked()){var o=a._private.position;o.x=t.x,o.y=t.y}}var s=this.updateCompoundBounds(),l=s.length>0?this.add(s):this;r?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(),r=e._private.style,n="include"===r["compound-sizing-wrt-labels"].value,a=t.boundingBox({includeLabels:n,includeEdges:!0}),o={top:r["padding-top"].pxValue,bottom:r["padding-bottom"].pxValue,left:r["padding-left"].pxValue,right:r["padding-right"].pxValue},s=e._private.position,l=!1;"auto"===r.width.value&&(e._private.autoWidth=a.w+o.left+o.right,s.x=(a.x1+a.x2-o.left+o.right)/2,l=!0),"auto"===r.height.value&&(e._private.autoHeight=a.h+o.top+o.bottom,s.y=(a.y1+a.y2-o.top+o.bottom)/2,l=!0),l&&i.push(e)}var r=this.cy();if(!r.styleEnabled()||!r.hasCompoundNodes())return r.collection();for(var i=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var o=n[a];t(o)}n=n.parent()}return new e.Collection(r,i)},renderedPosition:function(t,r){var i=this[0],n=this.cy(),a=n.zoom(),o=n.pan(),s=e.is.plainObject(t)?t:void 0,l=void 0!==s||void 0!==r&&e.is.string(t);if(i&&i.isNode()){if(!l){var u=i._private.position;return s={x:u.x*a+o.x,y:u.y*a+o.y},void 0===t?s:s[t]}for(var c=0;c<this.length;c++){var i=this[c];void 0!==r?i._private.position[t]=(r-o[t])/a:void 0!==s&&(i._private.position={x:(s.x-o.x)/a,y:(s.y-o.y)/a})}this.rtrigger("position")}else if(!l)return void 0;return this},relativePosition:function(t,r){var i=this[0],n=this.cy(),a=e.is.plainObject(t)?t:void 0,o=void 0!==a||void 0!==r&&e.is.string(t),s=n.hasCompoundNodes();if(i&&i.isNode()){if(!o){var l=i._private.position,u=s?i.parent():null,c=u&&u.length>0,d=c;c&&(u=u[0]);var h=d?u._private.position:{x:0,y:0};return a={x:l.x-h.x,y:l.y-h.y},void 0===t?a:a[t]}for(var p=0;p<this.length;p++){var i=this[p],u=s?i.parent():null,c=u&&u.length>0,d=c;c&&(u=u[0]);var h=d?u._private.position:{x:0,y:0};void 0!==r?i._private.position[t]=r+h[t]:void 0!==a&&(i._private.position={x:a.x+h.x,y:a.y+h.y})}this.rtrigger("position")}else if(!o)return void 0;return this},width:function(){var e=this[0],t=e._private.cy,r=t._private.styleEnabled;if(e){if(r){var i=e._private.style.width;return"auto"===i.strValue?e._private.autoWidth:i.pxValue}return 1}},outerWidth:function(){var e=this[0],i=e._private.cy,n=i._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+r: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,r=t._private.styleEnabled;if(e&&"nodes"===e._private.group){if(r){var i=e._private.style.height;return"auto"===i.strValue?e._private.autoHeight:i.pxValue}return 1}},outerHeight:function(){var e=this[0],i=e._private.cy,n=i._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+r: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),r=this.cy(),i=r.zoom(),n=r.pan(),a=t.x1*i+n.x,o=t.x2*i+n.x,s=t.y1*i+n.y,l=t.y2*i+n.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},boundingBox:function(e){var t=this,r=t._private.cy,i=r._private,n=i.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&&i.renderer.recalculateRenderedStyle(this);for(var l=1/0,u=-(1/0),c=1/0,d=-(1/0),h=0;h<t.length;h++){var p,v,f,g,y,m,x=t[h],b=x._private,w=b.style,_=n?b.style.display.value:"element",E="nodes"===b.group,S=!1;if("none"!==_){if(E&&a){S=!0;var D=b.position;y=D.x,m=D.y;var k=x.outerWidth(),T=k/2,P=x.outerHeight(),C=P/2;p=y-T,v=y+T,f=m-C,g=m+C,l=l>p?p:l,u=v>u?v:u,c=c>f?f:c,d=g>d?g:d}else if(x.isEdge()&&o){S=!0;var M=b.source,B=M._private,N=B.position,I=b.target,O=I._private,z=O.position,L=b.rstyle||{};if(p=N.x,v=z.x,f=N.y,g=z.y,p>v){var R=p;p=v,v=R}if(f>g){var R=f;f=g,g=R}if(l=l>p?p:l,u=v>u?v:u,c=c>f?f:c,d=g>d?g:d,n)for(var V=L.bezierPts||[],k=w.width.pxValue,A=k/2,X=0;X<V.length;X++){var F=V[X];p=F.x-A,v=F.x+A,f=F.y-A,g=F.y+A,l=l>p?p:l,u=v>u?v:u,c=c>f?f:c,d=g>d?g:d}if(n&&"haystack"===w["curve-style"].strValue){var Y=b.rscratch.haystackPts;if(p=Y[0],f=Y[1],v=Y[2],g=Y[3],p>v){var R=p;p=v,v=R}if(f>g){var R=f;f=g,g=R}l=l>p?p:l,u=v>u?v:u,c=c>f?f:c,d=g>d?g:d}}if(n){var w=x._private.style,L=x._private.rstyle,q=w.content.strValue,j=w["font-size"],$=w["text-halign"],W=w["text-valign"],H=L.labelWidth,Z=L.labelHeight,U=L.labelX,G=L.labelY;if(S&&s&&q&&j&&null!=Z&&null!=H&&null!=U&&null!=G&&$&&W){var K,J,Q,ee,te=Z,re=H;if(x.isEdge())K=U-re/2,J=U+re/2,Q=G-te/2,ee=G+te/2;else{switch($.value){case"left":K=U-re,J=U;break;case"center":K=U-re/2,J=U+re/2;break;case"right":K=U,J=U+re}switch(W.value){case"top":Q=G-te,ee=G;break;case"center":Q=G-te/2,ee=G+te/2;break;case"bottom":Q=G,ee=G+te}}l=l>K?K:l,u=J>u?J:u,c=c>Q?Q:c,d=ee>d?ee:d}}}}var ie=function(e){return e===1/0||e===-(1/0)?0:e};return l=ie(l),u=ie(u),c=ie(c),d=ie(d),{x1:l,x2:u,y1:c,y2:d,w:u-l,h:d-c}}});var i=e.elesfn;i.attr=i.data,i.removeAttr=i.removeData,i.modelPosition=i.point=i.position,i.modelPositions=i.points=i.positions,i.renderedPoint=i.renderedPosition,i.relativePoint=i.relativePosition,i.boundingbox=i.boundingBox,i.renderedBoundingbox=i.renderedBoundingBox}(cytoscape),function(e){"use strict";function t(e){return function(t){var r=this;if(void 0===t&&(t=!0),0!==r.length&&r.isNode()&&!r.removed()){for(var i=0,n=r[0],a=n._private.edges,o=0;o<a.length;o++){var s=a[o];(t||!s.isLoop())&&(i+=e(n,s))}return i}}}function r(e,t){return function(r){for(var i,n=this.nodes(),a=0;a<n.length;a++){var o=n[a],s=o[e](r);void 0===s||void 0!==i&&!t(s,i)||(i=s)}return i}}e.fn.eles({degree:t(function(e,t){return t.source().same(t.target())?2:1}),indegree:t(function(e,t){return t.target().same(e)?1:0}),outdegree:t(function(e,t){return t.source().same(e)?1:0})}),e.fn.eles({minDegree:r("degree",function(e,t){return t>e}),maxDegree:r("degree",function(e,t){return e>t}),minIndegree:r("indegree",function(e,t){return t>e}),maxIndegree:r("indegree",function(e,t){return e>t}),minOutdegree:r("outdegree",function(e,t){return t>e}),maxOutdegree:r("outdegree",function(e,t){return e>t})}),e.fn.eles({totalDegree:function(e){for(var t=0,r=this.nodes(),i=0;i<r.length;i++)t+=r[i].degree(e);return t}})}(cytoscape),function(e){"use strict";e.fn.eles({on:e.define.on(),one:e.define.on({unbindSelfOnTrigger:!0}),once:e.define.on({unbindAllBindersOnTrigger:!0}),off:e.define.off(),trigger:e.define.trigger(),rtrigger:function(e,t){return 0!==this.length?(this.cy().notify({type:e,collection:this}),this.trigger(e,t),this):void 0}}),e.define.eventAliasesOn(e.elesfn)}(cytoscape),function(e){"use strict";e.fn.eles({nodes:function(e){return this.filter(function(e,t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(e,t){return t.isEdge()}).filter(e)},filter:function(t){var r=this._private.cy;if(e.is.fn(t)){for(var i=[],n=0;n<this.length;n++){var a=this[n];t.apply(a,[n,a])&&i.push(a)}return new e.Collection(r,i)}return e.is.string(t)||e.is.elementOrCollection(t)?new e.Selector(t).filter(this):void 0===t?this:new e.Collection(r)},not:function(t){var r=this._private.cy;if(t){e.is.string(t)&&(t=this.filter(t));for(var i=[],n=0;n<this.length;n++){var a=this[n],o=t._private.ids[a.id()];o||i.push(a)}return new e.Collection(r,i)}return this},absoluteComplement:function(){var e=this._private.cy;return e.elements().not(this)},intersect:function(t){var r=this._private.cy;if(e.is.string(t)){var i=t;return this.filter(i)}for(var n=[],a=this,o=t,s=this.length<t.length,l=s?o._private.ids:a._private.ids,u=s?a:o,c=0;c<u.length;c++){var d=u[c]._private.data.id,h=l[d];h&&n.push(h)}return new e.Collection(r,n)},xor:function(t){var r=this._private.cy;e.is.string(t)&&(t=r.$(t));var i=[],n=this,a=t,o=function(e,t){for(var r=0;r<e.length;r++){var n=e[r],a=n._private.data.id,o=t._private.ids[a];o||i.push(n)}};return o(n,a),o(a,n),new e.Collection(r,i)},diff:function(t){var r=this._private.cy;e.is.string(t)&&(t=r.$(t));var i=[],n=[],a=[],o=this,s=t,l=function(e,t,r){for(var i=0;i<e.length;i++){var n=e[i],o=n._private.data.id,s=t._private.ids[o];s?a.push(n):r.push(n)}};return l(o,s,i),l(s,o,n),{left:new e.Collection(r,i,{unique:!0}),right:new e.Collection(r,n,{unique:!0}),both:new e.Collection(r,a,{unique:!0})}},add:function(t){var r=this._private.cy;if(!t)return this;if(e.is.string(t)){var i=t;t=r.elements(i)}for(var n=[],a=0;a<this.length;a++)n.push(this[a]);for(var a=0;a<t.length;a++){var o=!this._private.ids[t[a].id()];o&&n.push(t[a])}return new e.Collection(r,n)},merge:function(t){var r=this._private,i=r.cy;if(!t)return this;if(e.is.string(t)){var n=t;t=i.elements(n)}for(var a=0;a<t.length;a++){var o=t[a],s=o.id(),l=!r.ids[s];if(l){var u=this.length++;this[u]=o,r.ids[s]=o,r.indexes[s]=u}}return this},unmergeOne:function(e){e=e[0];var t=this._private,r=e.id(),i=t.indexes[r];if(null==i)return this;this[i]=void 0,t.ids[r]=void 0,t.indexes[r]=void 0;var n=i===this.length-1;if(this.length>1&&!n){var a=this.length-1,o=this[a];this[a]=void 0,this[i]=o,t.indexes[o.id()]=i}return this.length--,this},unmerge:function(t){var r=this._private.cy;if(!t)return this;if(e.is.string(t)){var i=t;t=r.elements(i)}for(var n=0;n<t.length;n++)this.unmergeOne(t[n]);return this},map:function(e,t){for(var r=[],i=this,n=0;n<i.length;n++){var a=i[n],o=t?e.apply(t,[a,n,i]):e(a,n,i);r.push(o)}return r},stdFilter:function(t,r){for(var i=[],n=this,a=this._private.cy,o=0;o<n.length;o++){var s=n[o],l=r?t.apply(r,[s,o,n]):t(s,o,n);l&&i.push(s)}return new e.Collection(a,i)},max:function(e,t){for(var r,i=-(1/0),n=this,a=0;a<n.length;a++){var o=n[a],s=t?e.apply(t,[o,a,n]):e(o,a,n);s>i&&(i=s,r=o)}return{value:i,ele:r}},min:function(e,t){for(var r,i=1/0,n=this,a=0;a<n.length;a++){var o=n[a],s=t?e.apply(t,[o,a,n]):e(o,a,n);i>s&&(i=s,r=o)}return{value:i,ele:r}}});var t=e.elesfn;t.u=t["|"]=t["+"]=t.union=t.or=t.add,t["\\"]=t["!"]=t["-"]=t.difference=t.relativeComplement=t.not,t.n=t["&"]=t["."]=t.and=t.intersection=t.intersect,t["^"]=t["(+)"]=t["(-)"]=t.symmetricDifference=t.symdiff=t.xor,t.fnFilter=t.filterFn=t.stdFilter,t.complement=t.abscomp=t.absoluteComplement}(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 r=0;r<this.length;r++){var i=this[r],n=t.apply(i,[r,i]);if(n===!1)break}return this},forEach:function(t,r){if(e.is.fn(t))for(var i=0;i<this.length;i++){var n=this[i],a=r?t.apply(r,[n,i,this]):t(n,i,this);if(a===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(t,r){var i=[],n=this.length;null==r&&(r=n),null==t&&(t=0),0>t&&(t=n+t),0>r&&(r=n+r);for(var a=t;a>=0&&r>a&&n>a;a++)i.push(this[a]);return new e.Collection(this.cy(),i)},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 r=this.cy(),i=this.toArray().sort(t);return new e.Collection(r,i)},sortByZIndex:function(){return this.sort(e.Collection.zIndexSort)},zDepth:function(){var e=this[0];if(!e)return void 0;var t=e._private,r=t.group;if("nodes"===r){var i=t.data.parent?e.parents().size():0;return e.isParent()?i:Number.MAX_VALUE}var n=t.source,a=t.target,o=n.zDepth(),s=a.zDepth();return Math.max(o,s,0)}}),e.Collection.zIndexSort=function(e,t){var r=e.cy(),i=e._private,n=t._private,a=i.style["z-index"].value-n.style["z-index"].value,o=0,s=0,l=r.hasCompoundNodes(),u="nodes"===i.group,c="edges"===i.group,d="nodes"===n.group,h="edges"===n.group;l&&(o=e.zDepth(),s=t.zDepth());var p=o-s,v=0===p;return v?u&&h?1:c&&d?-1:0===a?i.index-n.index:a:p}}(cytoscape),function(e){"use strict";e.fn.eles({layoutPositions:function(t,r,i){var n=this.nodes(),a=this.cy();if(t.trigger({type:"layoutstart",layout:t}),r.animate){for(var o=0;o<n.length;o++){var s=n[o],l=o===n.length-1,u=i.call(s,o,s),c=s.position();e.is.number(c.x)&&e.is.number(c.y)||s.silentPosition({x:0,y:0}),s.animate({position:u},{duration:r.animationDuration,step:l?function(){r.fit&&a.fit(r.eles,r.padding)}:void 0,complete:l?function(){null!=r.zoom&&a.zoom(r.zoom),r.pan&&a.pan(r.pan),r.fit&&a.fit(r.eles,r.padding),t.one("layoutstop",r.stop),t.trigger({type:"layoutstop",layout:t})}:void 0})}t.one("layoutready",r.ready),t.trigger({type:"layoutready",layout:t})}else n.positions(i),r.fit&&a.fit(r.eles,r.padding),null!=r.zoom&&a.zoom(r.zoom),r.pan&&a.pan(r.pan),t.one("layoutready",r.ready),t.trigger({type:"layoutready",layout:t}),t.one("layoutstop",r.stop),t.trigger({type:"layoutstop",layout:t});return this},layout:function(t){var r=this.cy();return r.layout(e.util.extend({},t,{eles:this})),this},makeLayout:function(t){var r=this.cy();return r.makeLayout(e.util.extend({},t,{eles:this}))}}),e.elesfn.createLayout=e.elesfn.makeLayout}(cytoscape),function(e){"use strict";e.fn.eles({updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t._private.batchingStyle){for(var r=t._private.batchStyleEles,i=0;i<this.length;i++){var n=this[i];r.ids[n._private.id]||r.push(n)}return this}var a=t.style();e=e||void 0===e?!0:!1,a.apply(this);var o=this.updateCompoundBounds(),s=o.length>0?this.add(o):this;return e?s.rtrigger("style"):s.trigger("style"),this},updateMappers:function(e){var t=this._private.cy,r=t.style();if(e=e||void 0===e?!0:!1,!t.styleEnabled())return this;r.updateMappers(this);var i=this.updateCompoundBounds(),n=i.length>0?this.add(i):this;return e?n.rtrigger("style"):n.trigger("style"),this},renderedCss:function(e){var t=this.cy();if(!t.styleEnabled())return this;var r=this[0];if(r){var i=r.cy().style().getRenderedStyle(r);return void 0===e?i:i[e]}},css:function(t,r){var i=this.cy();if(!i.styleEnabled())return this;var n=!1,a=i.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===r){var u=this[0];return u?u._private.style[t].strValue:void 0}a.applyBypass(this,t,r,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 r=!1,i=t.style(),n=this;if(void 0===e)for(var a=0;a<n.length;a++){var o=n[a];i.removeAllBypasses(o,r)}else{e=e.split(/\s+/);for(var a=0;a<n.length;a++){var o=n[a];i.removeBypasses(o,e,r)}}var s=this.updateCompoundBounds(),l=s.length>0?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],r=e.hasCompoundNodes();if(t){var i=t._private.style;if("visible"!==i.visibility.value||"element"!==i.display.value)return!1;if("nodes"===t._private.group){if(!r)return!0;var n=t._private.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var o=n[a],s=o._private.style,l=s.visibility.value,u=s.display.value;if("visible"!==l||"element"!==u)return!1}return!0}var c=t._private.source,d=t._private.target;return c.visible()&&d.visible()}},hidden:function(){var e=this[0];return e?!e.visible():void 0},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),r=this[0];if(r){var i=r._private,n=i.style.opacity.value;if(!t)return n;var a=i.data.parent?r.parents():null;if(a)for(var o=0;o<a.length;o++){var s=a[o],l=s._private.style.opacity.value;n=l*n}return n}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],r=t.cy().hasCompoundNodes();return t?r?0===t.effectiveOpacity():0===t._private.style.opacity.value:void 0},isFullAutoParent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];if(t){var r="auto"===t._private.style.width.value,i="auto"===t._private.style.height.value;return t.isParent()&&r&&i}},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return t._private.backgrounding?!0:!1}}),e.elesfn.bypass=e.elesfn.style=e.elesfn.css,e.elesfn.renderedStyle=e.elesfn.renderedCss,e.elesfn.removeBypass=e.elesfn.removeStyle=e.elesfn.removeCss}(cytoscape),function(e){"use strict";function t(t){return function(){var r=arguments,i=[];if(2===r.length){var n=r[0],a=r[1];this.bind(t.event,n,a)}else if(1===r.length){var a=r[0];this.bind(t.event,a)}else if(0===r.length){for(var o=0;o<this.length;o++){var s=this[o],l=!t.ableField||s._private[t.ableField],u=s._private[t.field]!=t.value;if(t.overrideAble){var c=t.overrideAble(s);if(void 0!==c&&(l=c,!c))return this}l&&(s._private[t.field]=t.value,u&&i.push(s))}var d=e.Collection(this.cy(),i);d.updateStyle(),d.trigger(t.event)}return this}}function r(r){e.elesfn[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(void 0!==t)return t}return e._private[r.field]}},e.elesfn[r.on]=t({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),e.elesfn[r.off]=t({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}r({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),r({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()?!1:void 0},on:"grabify",off:"ungrabify"}),r({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),r({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),e.elesfn.deselect=e.elesfn.unselect,e.elesfn.grabbed=function(){var e=this[0];return e?e._private.grabbed:void 0},r({field:"active",on:"activate",off:"unactivate"}),e.elesfn.inactive=function(){var e=this[0];return e?!e._private.active:void 0}}(cytoscape),function(e){"use strict";function t(t){return function(r){for(var i=[],n=this._private.cy,a=0;a<this.length;a++){var o=this[a],s=o._private[t.attr];s&&i.push(s)}return new e.Collection(n,i,{unique:!0}).filter(r)}}function r(t){return function(r){var i=[],n=this._private.cy,a=t||{};e.is.string(r)&&(r=n.$(r));for(var o=this._private.ids,s=r._private.ids,l=0;l<r.length;l++)for(var u=r[l]._private.edges,c=0;c<u.length;c++){var d=u[c],h=d._private.data,p=o[h.source]&&s[h.target],v=s[h.source]&&o[h.target],f=p||v;if(f){if(a.thisIs){if("source"===a.thisIs&&!p)continue;if("target"===a.thisIs&&!v)continue}i.push(d)}}return new e.Collection(n,i,{unique:!0})}}function i(t){var r={codirected:!1};return t=e.util.extend({},r,t),function(r){for(var i=this._private.cy,n=[],a=this.edges(),o=t,s=0;s<a.length;s++)for(var l=a[s],u=l.source()[0],c=u.id(),d=l.target()[0],h=d.id(),p=u._private.edges,v=0;v<p.length;v++){var f=p[v],g=f._private.data,y=g.target,m=g.source,x=y===h&&m===c,b=c===y&&h===m;(o.codirected&&x||!o.codirected&&(x||b))&&n.push(f)}return new e.Collection(i,n,{unique:!0}).filter(r)}}e.fn.eles({roots:function(t){for(var r=this,i=[],n=0;n<r.length;n++){var a=r[n];if(a.isNode()){var o=a.connectedEdges(function(){return this.data("target")===a.id()&&this.data("source")!==a.id()}).length>0;o||i.push(a)}}return new e.Collection(this._private.cy,i,{unique:!0}).filter(t)},leaves:function(t){for(var r=this,i=[],n=0;n<r.length;n++){var a=r[n];if(a.isNode()){var o=a.connectedEdges(function(){return this.data("source")===a.id()&&this.data("target")!==a.id()}).length>0;o||i.push(a)}}return new e.Collection(this._private.cy,i,{unique:!0}).filter(t)},outgoers:function(t){for(var r=this,i=[],n=0;n<r.length;n++){var a=r[n],o=a.id();if(a.isNode())for(var s=a._private.edges,l=0;l<s.length;l++){var u=s[l],c=u._private.data.source,d=u._private.data.target;c===o&&d!==o&&(i.push(u),i.push(u.target()[0]))}}return new e.Collection(this._private.cy,i,{unique:!0}).filter(t)},successors:function(t){for(var r=this,i=[],n={};;){var a=r.outgoers();if(0===a.length)break;for(var o=!1,s=0;s<a.length;s++){var l=a[s],u=l.id();n[u]||(n[u]=!0,i.push(l),o=!0)}if(!o)break;r=a}return new e.Collection(this._private.cy,i,{unique:!0}).filter(t)},incomers:function(t){for(var r=this,i=[],n=0;n<r.length;n++){var a=r[n],o=a.id();if(a.isNode())for(var s=a._private.edges,l=0;l<s.length;l++){var u=s[l],c=u._private.data.source,d=u._private.data.target;d===o&&c!==o&&(i.push(u),i.push(u.source()[0]))}}return new e.Collection(this._private.cy,i,{unique:!0}).filter(t)},predecessors:function(t){for(var r=this,i=[],n={};;){var a=r.incomers();if(0===a.length)break;for(var o=!1,s=0;s<a.length;s++){var l=a[s],u=l.id();n[u]||(n[u]=!0,i.push(l),o=!0)}if(!o)break;r=a}return new e.Collection(this._private.cy,i,{unique:!0}).filter(t)}}),e.fn.eles({neighborhood:function(t){for(var r=[],i=this._private.cy,n=this.nodes(),a=0;a<n.length;a++)for(var o=n[a],s=o.connectedEdges(),l=0;l<s.length;l++){var u=s[l],c=u.connectedNodes().not(o);c.length>0&&r.push(c[0]),r.push(u[0])}return new e.Collection(i,r,{unique:!0}).filter(t)},closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),e.elesfn.neighbourhood=e.elesfn.neighborhood,e.elesfn.closedNeighbourhood=e.elesfn.closedNeighborhood,e.elesfn.openNeighbourhood=e.elesfn.openNeighborhood,e.fn.eles({source:function(e){var t,r=this[0];return r&&(t=r._private.source),t&&e?t.filter(e):t},target:function(e){var t,r=this[0];return r&&(t=r._private.target),t&&e?t.filter(e):t},sources:t({attr:"source"}),targets:t({attr:"target"})}),e.fn.eles({edgesWith:r(),edgesTo:r({thisIs:"source"})}),e.fn.eles({connectedEdges:function(t){for(var r=[],i=this._private.cy,n=this,a=0;a<n.length;a++){var o=n[a];if(o.isNode())for(var s=o._private.edges,l=0;l<s.length;l++){var u=s[l];r.push(u)}}return new e.Collection(i,r,{unique:!0}).filter(t)},connectedNodes:function(t){for(var r=[],i=this._private.cy,n=this,a=0;a<n.length;a++){var o=n[a];o.isEdge()&&(r.push(o.source()[0]),r.push(o.target()[0]))}return new e.Collection(i,r,{unique:!0}).filter(t)},parallelEdges:i(),codirectedEdges:i({codirected:!0})})}(cytoscape),function(e){"use strict";e.fn.eles({fit:function(){},center:function(){}})}(cytoscape),function(e){"use strict";e.Minheap=function(t,r,i){return new e.Heap(t,r,e.Heap.minHeapComparator,i)},e.Maxheap=function(t,r,i){return new e.Heap(t,r,e.Heap.maxHeapComparator,i)},e.Heap=function(t,r,i,n){if("undefined"!=typeof i&&"undefined"!=typeof r){"undefined"==typeof n&&(n=e.Heap.idFn);var a,o,s,l=[],u={},c=[],d=0;for(r=this.getArgumentAsCollection(r,t),s=r.length,d=0;s>d;d+=1){if(l.push(n.call(t,r[d],d,r)),a=r[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:i,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,r){for(var i in t){var n=t[i];e.Heap.prototype[i]=n}},e.heapfn=e.Heap.prototype,e.heapfn.size=function(){return this._private.length},e.heapfn.getArgumentAsCollection=function(t,r){var i;if("undefined"==typeof r&&(r=this._private.cy),e.is.elementOrCollection(t))i=t;else{for(var n=[],a=[].concat.apply([],[t]),o=0;o<a.length;o++){var s=a[o],l=r.getElementById(s);l.length>0&&n.push(l)}i=new e.Collection(r,n)}return i},e.heapfn.isHeap=function(){var e,t,r,i,n,a=this._private.heap,o=a.length,s=this._private.comparator;for(e=0;o>e;e+=1)if(t=2*e+1,r=t+1,i=o>t?s(a[t],a[e]):!0,n=o>r?s(a[r],a[e]):!0,!i||!n)return!1;return!0},e.heapfn.heapSwap=function(e,t){var r=this._private.heap,i=this._private.pointers,n=this._private.elements,a=r[e],o=n[e],s=n[e],l=n[t];r[e]=r[t],n[e]=n[t],i[s]=t,i[l]=e,r[t]=a,n[t]=o},e.heapfn.heapify=function(e,t){var r,i,n,a,o,s,l,u=0,c=!1;for("undefined"==typeof t&&(t=!0),r=this._private.heap,u=r.length,s=this._private.comparator,i=e;!c;)t?(n=2*i+1,a=n+1,o=i,u>n&&!s(r[n],r[o])&&(o=n),u>a&&!s(r[a],r[o])&&(o=a),c=o===i,c||(this.heapSwap(o,i),i=o)):(l=Math.floor((i-1)/2),o=i,c=0>l||s(r[o],r[l]),c||(this.heapSwap(o,l),i=l))},e.heapfn.insert=function(e){var t,r,i,n,a,o=this.getArgumentAsCollection(e),s=o.length;for(a=0;s>a;a+=1){if(t=o[a],r=this._private.heap.length,i=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(i),this._private.elements.push(n),this._private.pointers[n]=r,this.heapify(r,!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),r=0;r<t.length;r+=1){var i=t[r].id();if(!this._private.pointers.hasOwnProperty(i))return!1}return!0},e.heapfn.top=function(){return this._private.length>0?{value:this._private.heap[0],id:this._private.elements[0]}:void 0},e.heapfn.pop=function(){if(this._private.length>0){var e,t,r,i=this.top(),n=this._private.length-1;return this.heapSwap(0,n),e=this._private.elements[n],t=this._private.heap[n],r=e,this._private.heap.pop(),this._private.elements.pop(),this._private.length=this._private.heap.length,this._private.pointers[r]=void 0,this.heapify(0),i}},e.heapfn.findDirectionHeapify=function(e){var t=Math.floor((e-1)/2),r=this._private.heap,i=0>t||this._private.comparator(r[e],r[t]);this.heapify(e,i)},e.heapfn.edit=function(t,r){for(var i=this.getArgumentAsCollection(t),n=0;n<i.length;n+=1){var a=i[n].id(),o=this._private.pointers[a],s=this._private.heap[o];e.is.number(r)?this._private.heap[o]=r:e.is.fn(r)&&(this._private.heap[o]=r.call(this._private.cy,s,o)),this.findDirectionHeapify(o)}},e.heapfn.remove=function(e){for(var t=this.getArgumentAsCollection(e),r=0;r<t.length;r+=1){var i,n,a,o=t[r].id(),s=this._private.pointers[o],l=this._private.length-1;s!==l&&this.heapSwap(s,l),i=this._private.elements[l],n=this._private.heap[l],a=i,this._private.heap.pop(),this._private.elements.pop(),this._private.length=this._private.heap.length,this._private.pointers[a]=void 0,this.findDirectionHeapify(s)}return n}}(cytoscape),function(e){"use strict";function t(e){this.options=e,this.data={select:[void 0,void 0,void 0,void 0,0],renderer:this,cy:e.cy,container:e.cy.container(),canvases:new Array(t.CANVAS_LAYERS),contexts:new Array(t.CANVAS_LAYERS),canvasNeedsRedraw:new Array(t.CANVAS_LAYERS),bufferCanvases:new Array(t.BUFFER_COUNT),bufferContexts:new Array(t.CANVAS_LAYERS)},this.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},this.timeoutData={panTimeout:null},this.dragData={possibleDragElements:[]},this.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},this.zoomData={freeToZoom:!1,lastPointerX:null},this.redraws=0,this.showFps=e.showFps,this.bindings=[],this.data.canvasContainer=document.createElement("div");var r=this.data.canvasContainer.style;r.position="absolute",r.zIndex="0",r.overflow="hidden",this.data.container.appendChild(this.data.canvasContainer);for(var i=0;i<t.CANVAS_LAYERS;i++)this.data.canvases[i]=document.createElement("canvas"),this.data.contexts[i]=this.data.canvases[i].getContext("2d"),this.data.canvases[i].style.position="absolute",this.data.canvases[i].setAttribute("data-id","layer"+i),this.data.canvases[i].style.zIndex=String(t.CANVAS_LAYERS-i),this.data.canvasContainer.appendChild(this.data.canvases[i]),this.data.canvasNeedsRedraw[i]=!1;this.data.topCanvas=this.data.canvases[0],this.data.canvases[t.NODE].setAttribute("data-id","layer"+t.NODE+"-node"),this.data.canvases[t.SELECT_BOX].setAttribute("data-id","layer"+t.SELECT_BOX+"-selectbox"),this.data.canvases[t.DRAG].setAttribute("data-id","layer"+t.DRAG+"-drag");for(var i=0;i<t.BUFFER_COUNT;i++)this.data.bufferCanvases[i]=document.createElement("canvas"),this.data.bufferContexts[i]=this.data.bufferCanvases[i].getContext("2d"),this.data.bufferCanvases[i].style.position="absolute",this.data.bufferCanvases[i].setAttribute("data-id","buffer"+i),this.data.bufferCanvases[i].style.zIndex=String(-i-1),this.data.bufferCanvases[i].style.visibility="hidden";this.hideEdgesOnViewport=e.hideEdgesOnViewport,this.hideLabelsOnViewport=e.hideLabelsOnViewport,this.textureOnViewport=e.textureOnViewport,this.wheelSensitivity=e.wheelSensitivity,this.motionBlurEnabled=e.motionBlur,this.forcedPixelRatio=e.pixelRatio,this.motionBlur=!0,this.motionBlurOpacity=e.motionBlurOpacity,this.motionBlurTransparency=1-this.motionBlurOpacity,this.motionBlurPxRatio=1,this.mbPxRBlurry=1,this.minMbLowQualFrames=4,this.fullQualityMb=!1,this.clearedForMotionBlur=[],this.desktopTapThreshold=e.desktopTapThreshold,this.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,this.touchTapThreshold=e.touchTapThreshold,this.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,this.tapholdDuration=500,this.load()}t.CANVAS_LAYERS=3,t.SELECT_BOX=0,t.DRAG=1,t.NODE=2,t.BUFFER_COUNT=3,t.TEXTURE_BUFFER=0,t.MOTIONBLUR_BUFFER_NODE=1,t.MOTIONBLUR_BUFFER_DRAG=2,t.panOrBoxSelectDelay=400;var r="undefined"!=typeof Path2D;t.usePaths=function(){return r},t.prototype.notify=function(r){var i;i=e.is.array(r.type)?r.type:[r.type];for(var n=0;n<i.length;n++){var a=i[n];switch(a){case"destroy":return void this.destroy();case"add":case"remove":case"load":this.updateNodesCache(),this.updateEdgesCache();break;case"viewport":this.data.canvasNeedsRedraw[t.SELECT_BOX]=!0;break;case"style":this.updateCachedZSortedEles()}("load"===a||"resize"===a)&&(this.invalidateContainerClientCoordsCache(),this.matchCanvasSize(this.data.container))}this.data.canvasNeedsRedraw[t.NODE]=!0,this.data.canvasNeedsRedraw[t.DRAG]=!0,this.redraw();
},t.prototype.destroy=function(){this.destroyed=!0;for(var e=0;e<this.bindings.length;e++){var t=this.bindings[e],r=t;r.target.removeEventListener(r.event,r.handler,r.useCapture)}if(this.removeObserver&&this.removeObserver.disconnect(),this.labelCalcDiv)try{document.body.removeChild(this.labelCalcDiv)}catch(i){}};for(var i in e.math)t.prototype[i]=e.math[i];e("renderer","canvas",t)}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t.prototype,i=t.arrowShapes={};t.arrowShapeHeight=.3;var n=function(e,t,r,i,n,a,o,s){var l=r-n/2,u=r+n/2,c=i-a/2,d=i+a/2;return e>=l&&u>=e&&t>=c&&d>=t},a=function(e,t,r,i,n){i=-i;var a=e*Math.cos(i)-t*Math.sin(i),o=e*Math.sin(i)+t*Math.cos(i),s=a*r,l=o*r,u=s+n.x,c=l+n.y;return{x:u,y:c}};i.arrow={_points:[-.15,-.3,0,0,.15,-.3],collide:function(t,r,n,a,o,s,l,u){var c=i.arrow._points;return e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,r,n){for(var o=i.arrow._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,r,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},i.triangle=i.arrow,i["triangle-backcurve"]={_ctrlPt:[0,-.15],collide:function(t,r,n,a,o,s,l,u){var c=i.triangle._points;return e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,r,n){for(var o,s=i.triangle._points,l=0;l<s.length/2;l++){var u=a(s[2*l],s[2*l+1],t,r,n);0===l&&(o=u),e.lineTo(u.x,u.y)}var c=this._ctrlPt,d=a(c[0],c[1],t,r,n);e.quadraticCurveTo(d.x,d.y,o.x,o.y)},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},i["triangle-tee"]={_points:[-.15,-.3,0,0,.15,-.3,-.15,-.3],_pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(t,r,n,a,o,s,l,u){var c=i["triangle-tee"]._points,d=i["triangle-tee"]._pointsTee,h=e.math.pointInsidePolygon(t,r,d,n,a,o,s,l,u)||e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u);return h},roughCollide:n,draw:function(e,t,r,n){for(var o=i["triangle-tee"]._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,r,n);e.lineTo(l.x,l.y)}var u=i["triangle-tee"]._pointsTee,c=a(u[0],u[1],t,r,n);e.moveTo(c.x,c.y);for(var s=0;s<u.length/2;s++){var l=a(u[2*s],u[2*s+1],t,r,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},i["half-triangle-overshot"]={_points:[0,-.25,-.5,-.25,.5,.25],leavePathOpen:!0,matchEdgeWidth:!0,collide:function(t,r,i,n,a,o,s,l){var u=this._points;return e.math.pointInsidePolygon(t,r,u,i,n,a,o,s,l)},roughCollide:n,draw:function(e,t,r,i){for(var n=this._points,o=0;o<n.length/2;o++){var s=a(n[2*o],n[2*o+1],t,r,i);e.lineTo(s.x,s.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},i.none={collide:function(e,t,r,i,n,a,o,s){return!1},roughCollide:function(e,t,r,i,n,a,o,s){return!1},draw:function(e){},spacing:function(e){return 0},gap:function(e){return 0}},i.circle={_baseRadius:.15,collide:function(e,t,r,n,a,o,s,l){if(a!=o){var u=(o+l)/(a+l);return t/=u,n/=u,Math.pow(r-e,2)+Math.pow(n-t,2)<=Math.pow((a+l)*i.circle._baseRadius,2)}return Math.pow(r-e,2)+Math.pow(n-t,2)<=Math.pow((a+l)*i.circle._baseRadius,2)},roughCollide:n,draw:function(e,t,r,n){e.arc(n.x,n.y,i.circle._baseRadius*t,0,2*Math.PI,!1)},spacing:function(e){return r.getArrowWidth(e._private.style.width.pxValue)*i.circle._baseRadius},gap:function(e){return 2*e._private.style.width.pxValue}},i.inhibitor={_points:[-.25,0,-.25,-.1,.25,-.1,.25,0],collide:function(t,r,n,a,o,s,l,u){var c=i.inhibitor._points;return e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,r,n){for(var o=i.inhibitor._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,r,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 1},gap:function(e){return 1}},i.tee=i.inhibitor,i.square={_points:[-.15,0,.15,0,.15,-.3,-.15,-.3],collide:function(t,r,n,a,o,s,l,u){var c=i.square._points;return e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,r,n){for(var o=i.square._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,r,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},i.diamond={_points:[-.15,-.15,0,-.3,.15,-.15,0,0],collide:function(t,r,n,a,o,s,l,u){var c=i.diamond._points;return e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,r,n){for(var o=i.diamond._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,r,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 0},gap:function(e){return e._private.style.width.pxValue}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t.prototype;r.getCachedNodes=function(){var e=this.data,t=this.data.cy;return null==e.cache&&(e.cache={}),null==e.cache.cachedNodes&&(e.cache.cachedNodes=t.nodes()),e.cache.cachedNodes},r.updateNodesCache=function(){var e=this.data,t=this.data.cy;null==e.cache&&(e.cache={}),e.cache.cachedNodes=t.nodes()},r.getCachedEdges=function(){var e=this.data,t=this.data.cy;return null==e.cache&&(e.cache={}),null==e.cache.cachedEdges&&(e.cache.cachedEdges=t.edges()),e.cache.cachedEdges},r.updateEdgesCache=function(){var e=this.data,t=this.data.cy;null==e.cache&&(e.cache={}),e.cache.cachedEdges=t.edges()}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t.prototype;r.projectIntoViewport=function(e,t){var r=this.findContainerClientCoords(),i=r[0],n=r[1],a=e-i,o=t-n;return a-=this.data.cy.pan().x,o-=this.data.cy.pan().y,a/=this.data.cy.zoom(),o/=this.data.cy.zoom(),[a,o]},r.findContainerClientCoords=function(){var e=this.data.container,t=this.containerBB=this.containerBB||e.getBoundingClientRect();return[t.left,t.top,t.right-t.left,t.bottom-t.top]},r.invalidateContainerClientCoordsCache=function(){this.containerBB=null},r.findNearestElement=function(r,i,n,a){function o(e){var a=e.outerWidth()+2*v,o=e.outerHeight()+2*v,s=a/2,u=o/2,d=e._private.position;if(d.x-s<=r&&r<=d.x+s&&d.y-u<=i&&i<=d.y+u){var h=!n||e.visible()&&!e.transparent();if(n&&!h)return;{var p=t.nodeShapes[l.getNodeShape(e)];e._private.style["border-width"].pxValue/2}p.checkPoint(r,i,0,a,o,d.x,d.y)&&c.push(e)}}function s(a){var s,u,d=a._private.rscratch,v=a._private.style,f=v.width.pxValue/2+p,g=f*f,y=2*f,m=a._private.source,x=a._private.target,b=!1,w=function(){if(void 0!==u)return u;if(!n)return u=!0,!0;var e=a.visible()&&!a.transparent();return e?(u=!0,!0):(u=!1,!1)};if("self"===d.edgeType||"compound"===d.edgeType)((b=e.math.inBezierVicinity(r,i,d.startX,d.startY,d.cp2ax,d.cp2ay,d.selfEdgeMidX,d.selfEdgeMidY,g))&&w()&&g>(s=e.math.sqDistanceToQuadraticBezier(r,i,d.startX,d.startY,d.cp2ax,d.cp2ay,d.selfEdgeMidX,d.selfEdgeMidY))||(b=e.math.inBezierVicinity(r,i,d.selfEdgeMidX,d.selfEdgeMidY,d.cp2cx,d.cp2cy,d.endX,d.endY,g))&&w()&&g>(s=e.math.sqDistanceToQuadraticBezier(r,i,d.selfEdgeMidX,d.selfEdgeMidY,d.cp2cx,d.cp2cy,d.endX,d.endY)))&&c.push(a);else if("haystack"===d.edgeType){var _=v["haystack-radius"].value,E=_/2,S=x._private.position,D=x.width(),k=x.height(),T=m._private.position,P=m.width(),C=m.height(),M=T.x+d.source.x*P*E,B=T.y+d.source.y*C*E,N=S.x+d.target.x*D*E,I=S.y+d.target.y*k*E;(b=e.math.inLineVicinity(r,i,M,B,N,I,y))&&w()&&g>(s=e.math.sqDistanceToFiniteLine(r,i,M,B,N,I))&&c.push(a)}else"straight"===d.edgeType?(b=e.math.inLineVicinity(r,i,d.startX,d.startY,d.endX,d.endY,y))&&w()&&g>(s=e.math.sqDistanceToFiniteLine(r,i,d.startX,d.startY,d.endX,d.endY))&&c.push(a):"bezier"===d.edgeType&&(b=e.math.inBezierVicinity(r,i,d.startX,d.startY,d.cp2x,d.cp2y,d.endX,d.endY,g))&&w()&&g>(s=e.math.sqDistanceToQuadraticBezier(r,i,d.startX,d.startY,d.cp2x,d.cp2y,d.endX,d.endY))&&c.push(a);if(b&&w()&&0===c.length||c[c.length-1]!==a){var O=t.arrowShapes[v["source-arrow-shape"].value],z=t.arrowShapes[v["target-arrow-shape"].value],m=m||a._private.source,x=x||a._private.target,S=x._private.position,T=m._private.position,L=l.getArrowWidth(v.width.pxValue),R=l.getArrowHeight(v.width.pxValue),V=L,A=R;(O.roughCollide(r,i,d.arrowStartX,d.arrowStartY,L,R,[d.arrowStartX-T.x,d.arrowStartY-T.y],p)&&O.collide(r,i,d.arrowStartX,d.arrowStartY,L,R,[d.arrowStartX-T.x,d.arrowStartY-T.y],p)||z.roughCollide(r,i,d.arrowEndX,d.arrowEndY,V,A,[d.arrowEndX-S.x,d.arrowEndY-S.y],p)&&z.collide(r,i,d.arrowEndX,d.arrowEndY,V,A,[d.arrowEndX-S.x,d.arrowEndY-S.y],p))&&c.push(a)}h&&c.length>0&&c[c.length-1]===a&&(o(m),o(x))}for(var l=this,u=this.getCachedZSortedEles(),c=[],d=this.data.cy.zoom(),h=this.data.cy.hasCompoundNodes(),p=(a?24:8)/d,v=(a?8:2)/d,f=u.length-1;f>=0;f--){var g=u[f];if(c.length>0)break;"nodes"===g._private.group?o(u[f]):s(u[f])}return c.length>0?c[c.length-1]:null},r.getAllInBox=function(r,i,n,a){var o=this.getCachedNodes(),s=this.getCachedEdges(),l=[],u=Math.min(r,n),c=Math.max(r,n),d=Math.min(i,a),h=Math.max(i,a);r=u,n=c,i=d,a=h;for(var p,v=0;v<o.length;v++){var f=o[v]._private.position,g=this.getNodeShape(o[v]),y=this.getNodeWidth(o[v]),m=this.getNodeHeight(o[v]),x=o[v]._private.style["border-width"].pxValue/2,b=t.nodeShapes[g];b.intersectBox(r,i,n,a,y,m,f.x,f.y,x)&&l.push(o[v])}for(var v=0;v<s.length;v++){var w=s[v]._private.rscratch;if("self"==s[v]._private.rscratch.edgeType&&((p=e.math.boxInBezierVicinity(r,i,n,a,w.startX,w.startY,w.cp2ax,w.cp2ay,w.endX,w.endY,s[v]._private.style.width.pxValue))&&(2==p||1==p&&e.math.checkBezierInBox(r,i,n,a,w.startX,w.startY,w.cp2ax,w.cp2ay,w.endX,w.endY,s[v]._private.style.width.pxValue))||(p=e.math.boxInBezierVicinity(r,i,n,a,w.startX,w.startY,w.cp2cx,w.cp2cy,w.endX,w.endY,s[v]._private.style.width.pxValue))&&(2==p||1==p&&e.math.checkBezierInBox(r,i,n,a,w.startX,w.startY,w.cp2cx,w.cp2cy,w.endX,w.endY,s[v]._private.style.width.pxValue)))&&l.push(s[v]),"bezier"==w.edgeType&&(p=e.math.boxInBezierVicinity(r,i,n,a,w.startX,w.startY,w.cp2x,w.cp2y,w.endX,w.endY,s[v]._private.style.width.pxValue))&&(2==p||1==p&&e.math.checkBezierInBox(r,i,n,a,w.startX,w.startY,w.cp2x,w.cp2y,w.endX,w.endY,s[v]._private.style.width.pxValue))&&l.push(s[v]),"straight"==w.edgeType&&(p=e.math.boxInBezierVicinity(r,i,n,a,w.startX,w.startY,.5*w.startX+.5*w.endX,.5*w.startY+.5*w.endY,w.endX,w.endY,s[v]._private.style.width.pxValue))&&(2==p||1==p&&e.math.checkStraightEdgeInBox(r,i,n,a,w.startX,w.startY,w.endX,w.endY,s[v]._private.style.width.pxValue))&&l.push(s[v]),"haystack"==w.edgeType){var _=s[v].target()[0],E=_.position(),S=s[v].source()[0],D=S.position(),k=D.x+w.source.x,T=D.y+w.source.y,P=E.x+w.target.x,C=E.y+w.target.y,M=k>=r&&n>=k&&T>=i&&a>=T,B=P>=r&&n>=P&&C>=i&&a>=C;M&&B&&l.push(s[v])}}return l},r.getNodeWidth=function(e){return e.width()},r.getNodeHeight=function(e){return e.height()},r.getNodeShape=function(e){var t=e._private.style.shape.value;return e.isParent()?"rectangle"===t||"roundrectangle"===t?t:"rectangle":t},r.getNodePadding=function(e){var t=e._private.style["padding-left"].pxValue,r=e._private.style["padding-right"].pxValue,i=e._private.style["padding-top"].pxValue,n=e._private.style["padding-bottom"].pxValue;return isNaN(t)&&(t=0),isNaN(r)&&(r=0),isNaN(i)&&(i=0),isNaN(n)&&(n=0),{left:t,right:r,top:i,bottom:n}},r.zOrderSort=e.Collection.zIndexSort,r.updateCachedZSortedEles=function(){this.getCachedZSortedEles(!0)},r.getCachedZSortedEles=function(e){var t=this.lastZOrderCachedNodes,r=this.lastZOrderCachedEdges,i=this.getCachedNodes(),n=this.getCachedEdges(),a=[];if(!e&&t&&r&&t===i&&r===n)a=this.cachedZSortedEles;else{for(var o=0;o<i.length;o++)i[o].visible()&&!i[o].transparent()&&a.push(i[o]);for(var o=0;o<n.length;o++)n[o].visible()&&!n[o].transparent()&&a.push(n[o]);a.sort(this.zOrderSort),this.cachedZSortedEles=a}return this.lastZOrderCachedNodes=i,this.lastZOrderCachedEdges=n,a},r.projectBezier=function(t){function r(e){a.push({x:i(e[0],e[2],e[4],.05),y:i(e[1],e[3],e[5],.05)}),a.push({x:i(e[0],e[2],e[4],.25),y:i(e[1],e[3],e[5],.25)}),a.push({x:i(e[0],e[2],e[4],.4),y:i(e[1],e[3],e[5],.4)});var t={x:i(e[0],e[2],e[4],.5),y:i(e[1],e[3],e[5],.5)};a.push(t),"self"===n.edgeType||"compound"===n.edgeType?(n.midX=n.selfEdgeMidX,n.midY=n.selfEdgeMidY):(n.midX=t.x,n.midY=t.y),a.push({x:i(e[0],e[2],e[4],.6),y:i(e[1],e[3],e[5],.6)}),a.push({x:i(e[0],e[2],e[4],.75),y:i(e[1],e[3],e[5],.75)}),a.push({x:i(e[0],e[2],e[4],.95),y:i(e[1],e[3],e[5],.95)})}var i=e.math.qbezierAt,n=t._private.rscratch,a=t._private.rstyle.bezierPts=[];"self"===n.edgeType?(r([n.startX,n.startY,n.cp2ax,n.cp2ay,n.selfEdgeMidX,n.selfEdgeMidY]),r([n.selfEdgeMidX,n.selfEdgeMidY,n.cp2cx,n.cp2cy,n.endX,n.endY])):"bezier"===n.edgeType&&r([n.startX,n.startY,n.cp2x,n.cp2y,n.endX,n.endY])},r.recalculateNodeLabelProjection=function(e){var t=e._private.style.content.strValue;if(t&&!t.match(/^\s+$/)){var r,i,n=e.outerWidth(),a=e.outerHeight(),o=e._private.position,s=e._private.style["text-halign"].strValue,l=e._private.style["text-valign"].strValue,u=e._private.rscratch,c=e._private.rstyle;switch(s){case"left":r=o.x-n/2;break;case"right":r=o.x+n/2;break;default:r=o.x}switch(l){case"top":i=o.y-a/2;break;case"bottom":i=o.y+a/2;break;default:i=o.y}u.labelX=r,u.labelY=i,c.labelX=r,c.labelY=i,this.applyLabelDimensions(e)}},r.recalculateEdgeLabelProjection=function(t){var r=t._private.style.content.strValue;if(r&&!r.match(/^\s+$/)){var i,n,a,o,s=t._private,l=s.rscratch,u=s.rstyle;if("self"==l.edgeType)a=l.selfEdgeMidX,o=l.selfEdgeMidY;else if("straight"==l.edgeType)a=(l.startX+l.endX)/2,o=(l.startY+l.endY)/2;else if("bezier"==l.edgeType)a=e.math.qbezierAt(l.startX,l.cp2x,l.endX,.5),o=e.math.qbezierAt(l.startY,l.cp2y,l.endY,.5);else if("haystack"==l.edgeType){var c=l.haystackPts;a=(c[0]+c[2])/2,o=(c[1]+c[3])/2}i=a,n=o,l.labelX=i,l.labelY=n,u.labelX=i,u.labelY=n,this.applyLabelDimensions(t)}},r.applyLabelDimensions=function(e){var t=e._private.rscratch,r=e._private.rstyle,i=this.getLabelText(e),n=this.calculateLabelDimensions(e,i);r.labelWidth=n.width,t.labelWidth=n.width,r.labelHeight=n.height,t.labelHeight=n.height},r.getLabelText=function(e){var t=e._private.style,r=e._private.style.content.strValue,i=t["text-transform"].value,n=e._private.rscratch;if("none"==i||("uppercase"==i?r=r.toUpperCase():"lowercase"==i&&(r=r.toLowerCase())),"wrap"===t["text-wrap"].value){if(n.labelWrapKey===n.labelKey)return n.labelWrapCachedText;for(var a=r.split("\n"),o=t["text-max-width"].pxValue,s=[],l=0;l<a.length;l++){var u=a[l],c=this.calculateLabelDimensions(e,u,"line="+u),d=c.width;if(d>o){for(var h=u.split(/\s+/),p="",v=0;v<h.length;v++){var f=h[v],g=0===p.length?f:p+" "+f,y=this.calculateLabelDimensions(e,g,"testLine="+g),m=y.width;o>=m?p+=f+" ":(s.push(p),p=f+" ")}p.match(/^\s+$/)||s.push(p)}else s.push(u)}n.labelWrapCachedLines=s,n.labelWrapCachedText=r=s.join("\n"),n.labelWrapKey=n.labelKey}return r},r.calculateLabelDimensions=function(e,t,r){var i=this,n=e._private.style,a=n["font-style"].strValue,o=n["font-size"].pxValue+"px",s=n["font-family"].strValue,l=n["font-weight"].strValue,u=e._private.labelKey;r&&(u+="$@$"+r);var c=i.labelDimCache||(i.labelDimCache={});if(c[u])return c[u];var d=this.labelCalcDiv;d||(d=this.labelCalcDiv=document.createElement("div"),document.body.appendChild(d));var h=d.style;return h.fontFamily=s,h.fontStyle=a,h.fontSize=o,h.fontWeight=l,h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none",h.padding="0",h.lineHeight="1",h.whiteSpace="wrap"===n["text-wrap"].value?"pre":"normal",d.textContent=t,c[u]={width:d.clientWidth,height:d.clientHeight},c[u]},r.recalculateRenderedStyle=function(e){for(var t=[],r=[],i={},n=0;n<e.length;n++){var a=e[n],o=a._private,s=o.style,l=o.rscratch,u=o.rstyle,c=o.data.id,d=null!=l.boundingBoxKey&&o.boundingBoxKey===l.boundingBoxKey,h=null!=l.labelKey&&o.labelKey===l.labelKey,p=d&&h;if("nodes"===a._private.group){var v=o.position,f=null!=u.nodeX&&null!=u.nodeY&&v.x===u.nodeX&&v.y===u.nodeY,g=null!=u.nodeW&&u.nodeW===s.width.pxValue,y=null!=u.nodeH&&u.nodeH===s.height.pxValue;f&&p&&g&&y||r.push(a),u.nodeX=v.x,u.nodeY=v.y,u.nodeW=s.width.pxValue,u.nodeH=s.height.pxValue}else{var m=a._private.source._private.position,x=a._private.target._private.position,b=null!=u.srcX&&null!=u.srcY&&m.x===u.srcX&&m.y===u.srcY,w=null!=u.tgtX&&null!=u.tgtY&&x.x===u.tgtX&&x.y===u.tgtY,_=b&&w;if(!_||!p){var E=o.style["curve-style"].value;if("bezier"===E){if(!i[c]){t.push(a),i[c]=!0;for(var S=a.parallelEdges(),n=0;n<S.length;n++){var D=S[n],k=D._private.data.id;i[k]||(t.push(D),i[k]=!0)}}}else t.push(a)}u.srcX=m.x,u.srcY=m.y,u.tgtX=x.x,u.tgtY=x.y}l.boundingBoxKey=o.boundingBoxKey,l.labelKey=o.labelKey}this.recalculateEdgeProjections(t),this.recalculateLabelProjections(r,t)},r.recalculateLabelProjections=function(e,t){for(var r=0;r<e.length;r++)this.recalculateNodeLabelProjection(e[r]);for(var r=0;r<t.length;r++)this.recalculateEdgeLabelProjection(t[r])},r.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)},r.findEdgeControlPoints=function(r){if(r&&0!==r.length){for(var i,n=this.data.cy,a=n.hasCompoundNodes(),o={},s=[],l=[],u=0;u<r.length;u++){var c=r[u],d=c._private.style,h="unbundled-bezier"===d["curve-style"].value;if("none"!==d.display.value)if("haystack"!==d["curve-style"].value){var p=c._private.data.source,v=c._private.data.target;i=p>v?v+"-"+p:p+"-"+v,h&&(i="unbundled"+c._private.data.id),null==o[i]&&(o[i]=[],s.push(i)),o[i].push(c),h&&(o[i].hasUnbundled=!0)}else l.push(c)}for(var f,g,y,m,x,b,w,_,E,S,D,k,T,P,C=0;C<s.length;C++){i=s[C];var M=o[i];if(M.sort(function(e,t){return e._private.index-t._private.index}),f=M[0]._private.source,g=M[0]._private.target,f._private.data.id>g._private.data.id){var B=f;f=g,g=B}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)],D=f._private.style["border-width"].pxValue,k=g._private.style["border-width"].pxValue,P=!1,M.length>1&&f!==g||M.hasUnbundled){var N=E.intersectLine(y.x,y.y,x,b,m.x,m.y,D/2),I=S.intersectLine(m.x,m.y,w,_,y.x,y.y,k/2),O={x1:N[0],x2:I[0],y1:N[1],y2:I[1]},z=I[1]-N[1],L=I[0]-N[0],R=Math.sqrt(L*L+z*z),V={x:L,y:z},A={x:V.x/R,y:V.y/R};T={x:-A.y,y:A.x},(S.checkPoint(N[0],N[1],k/2,w,_,m.x,m.y)||E.checkPoint(I[0],I[1],D/2,x,b,y.x,y.y))&&(T={},P=!0)}for(var c,X,u=0;u<M.length;u++){c=M[u],X=c._private.rscratch;var F=X.lastEdgeIndex,Y=u,q=X.lastNumEdges,j=M.length,$=c._private.style,W=$["control-point-step-size"].pxValue,H=void 0!==$["control-point-distance"]?$["control-point-distance"].pxValue:void 0,Z=$["control-point-weight"].value,h="unbundled-bezier"===$["curve-style"].value,U=c._private.source!==f;U&&h&&(H*=-1);var G=X.lastSrcCtlPtX,K=y.x,J=X.lastSrcCtlPtY,Q=y.y,ee=X.lastSrcCtlPtW,te=f.outerWidth(),re=X.lastSrcCtlPtH,ie=f.outerHeight(),ne=X.lastTgtCtlPtX,ae=m.x,oe=X.lastTgtCtlPtY,se=m.y,le=X.lastTgtCtlPtW,ue=g.outerWidth(),ce=X.lastTgtCtlPtH,de=g.outerHeight(),he=X.lastW,pe=$["control-point-step-size"].pxValue;if(X.badBezier=P?!0:!1,G!==K||J!==Q||ee!==te||re!==ie||ne!==ae||oe!==se||le!==ue||ce!==de||he!==pe||!(F===Y&&q===j||h)){if(X.lastSrcCtlPtX=K,X.lastSrcCtlPtY=Q,X.lastSrcCtlPtW=te,X.lastSrcCtlPtH=ie,X.lastTgtCtlPtX=ae,X.lastTgtCtlPtY=se,X.lastTgtCtlPtW=ue,X.lastTgtCtlPtH=de,X.lastEdgeIndex=Y,X.lastNumEdges=j,X.lastWidth=pe,f===g){X.edgeType="self";var ve=u,fe=W;h&&(ve=0,fe=H),X.cp2ax=y.x,X.cp2ay=y.y-(1+Math.pow(b,1.12)/100)*fe*(ve/3+1),X.cp2cx=y.x-(1+Math.pow(x,1.12)/100)*fe*(ve/3+1),X.cp2cy=y.y,X.selfEdgeMidX=(X.cp2ax+X.cp2cx)/2,X.selfEdgeMidY=(X.cp2ay+X.cp2cy)/2}else if(a&&(f.isParent()||f.isChild()||g.isParent()||g.isChild())&&(f.parents().anySame(g)||g.parents().anySame(f))){X.edgeType="compound",X.badBezier=!1;var ve=u,fe=W;h&&(ve=0,fe=H);var ge=50,ye={x:y.x-x/2,y:y.y-b/2},me={x:m.x-w/2,y:m.y-_/2},xe=1;X.cp2ax=ye.x,X.compoundStretchA=Math.max(xe,Math.log(.01*x)),X.cp2ay=ye.y-(1+Math.pow(ge,1.12)/100)*fe*(ve/3+1)*X.compoundStretchA,X.compoundStretchB=Math.max(xe,Math.log(.01*w)),X.cp2cx=me.x-(1+Math.pow(ge,1.12)/100)*fe*(ve/3+1)*X.compoundStretchB,X.cp2cy=me.y,X.selfEdgeMidX=(X.cp2ax+X.cp2cx)/2,X.selfEdgeMidY=(X.cp2ay+X.cp2cy)/2}else if(M.length%2!==1||u!==Math.floor(M.length/2)||h){var be,we=(.5-M.length/2+u)*W,_e=e.math.signum(we);be=h?H:void 0!==H?_e*H:void 0;var Ee=void 0!==be?be:we,Se=1-Z,De=Z;U&&(Se=Z,De=1-Z);var ke={x:O.x1*Se+O.x2*De,y:O.y1*Se+O.y2*De};X.edgeType="bezier",X.cp2x=ke.x+T.x*Ee,X.cp2y=ke.y+T.y*Ee}else X.edgeType="straight";this.findEndpoints(c);var Te=!e.is.number(X.startX)||!e.is.number(X.startY),Pe=!e.is.number(X.arrowStartX)||!e.is.number(X.arrowStartY),Ce=!e.is.number(X.endX)||!e.is.number(X.endY),Me=!e.is.number(X.arrowEndX)||!e.is.number(X.arrowEndY),Be=3,Ne=this.getArrowWidth(c._private.style.width.pxValue)*t.arrowShapeHeight,Ie=Be*Ne,Oe=e.math.distance({x:X.cp2x,y:X.cp2y},{x:X.startX,y:X.startY}),ze=Ie>Oe,Le=e.math.distance({x:X.cp2x,y:X.cp2y},{x:X.endX,y:X.endY}),Re=Ie>Le;if("bezier"===X.edgeType){var Ve=!1;if(Te||Pe||ze){Ve=!0;var Ae={x:X.cp2x-y.x,y:X.cp2y-y.y},Xe=Math.sqrt(Ae.x*Ae.x+Ae.y*Ae.y),Fe={x:Ae.x/Xe,y:Ae.y/Xe},Ye=Math.max(x,b),qe={x:X.cp2x+2*Fe.x*Ye,y:X.cp2y+2*Fe.y*Ye},je=E.intersectLine(y.x,y.y,x,b,qe.x,qe.y,D/2);ze?(X.cp2x=X.cp2x+Fe.x*(Ie-Oe),X.cp2y=X.cp2y+Fe.y*(Ie-Oe)):(X.cp2x=je[0]+Fe.x*Ie,X.cp2y=je[1]+Fe.y*Ie)}if(Ce||Me||Re){Ve=!0;var Ae={x:X.cp2x-m.x,y:X.cp2y-m.y},Xe=Math.sqrt(Ae.x*Ae.x+Ae.y*Ae.y),Fe={x:Ae.x/Xe,y:Ae.y/Xe},Ye=Math.max(x,b),qe={x:X.cp2x+2*Fe.x*Ye,y:X.cp2y+2*Fe.y*Ye},$e=S.intersectLine(m.x,m.y,w,_,qe.x,qe.y,k/2);Re?(X.cp2x=X.cp2x+Fe.x*(Ie-Le),X.cp2y=X.cp2y+Fe.y*(Ie-Le)):(X.cp2x=$e[0]+Fe.x*Ie,X.cp2y=$e[1]+Fe.y*Ie)}Ve&&this.findEndpoints(c)}else"straight"===X.edgeType&&(X.midX=(K+ae)/2,X.midY=(Q+se)/2);this.projectBezier(c),this.recalculateEdgeLabelProjection(c)}}}for(var u=0;u<l.length;u++){var c=l[u],We=c._private,He=We.rscratch,X=He;if(!He.haystack){var Ze=2*Math.random()*Math.PI;He.source={x:Math.cos(Ze),y:Math.sin(Ze)};var Ze=2*Math.random()*Math.PI;He.target={x:Math.cos(Ze),y:Math.sin(Ze)}}var f=We.source,g=We.target,y=f._private.position,m=g._private.position,x=f.width(),w=g.width(),b=f.height(),_=g.height(),Ye=d["haystack-radius"].value,Ue=Ye/2;X.haystackPts=[X.source.x*x*Ue+y.x,X.source.y*b*Ue+y.y,X.target.x*w*Ue+m.x,X.target.y*_*Ue+m.y],He.edgeType="haystack",He.haystack=!0,this.recalculateEdgeLabelProjection(c)}return o}},r.findEndpoints=function(r){var i,n=r.source()[0],a=r.target()[0],o=r._private.style["target-arrow-shape"].value,s=r._private.style["source-arrow-shape"].value,l=a._private.style["border-width"].pxValue,u=n._private.style["border-width"].pxValue,c=r._private.rscratch;if("self"==c.edgeType||"compound"==c.edgeType){var d=[c.cp2cx,c.cp2cy];i=t.nodeShapes[this.getNodeShape(a)].intersectLine(a._private.position.x,a._private.position.y,this.getNodeWidth(a),this.getNodeHeight(a),d[0],d[1],l/2);var h=e.math.shortenIntersection(i,d,t.arrowShapes[o].spacing(r)),p=e.math.shortenIntersection(i,d,t.arrowShapes[o].gap(r));c.endX=p[0],c.endY=p[1],c.arrowEndX=h[0],c.arrowEndY=h[1];var d=[c.cp2ax,c.cp2ay];i=t.nodeShapes[this.getNodeShape(n)].intersectLine(n._private.position.x,n._private.position.y,this.getNodeWidth(n),this.getNodeHeight(n),d[0],d[1],u/2);var v=e.math.shortenIntersection(i,d,t.arrowShapes[s].spacing(r)),f=e.math.shortenIntersection(i,d,t.arrowShapes[s].gap(r));c.startX=f[0],c.startY=f[1],c.arrowStartX=v[0],c.arrowStartY=v[1]}else if("straight"==c.edgeType){i=t.nodeShapes[this.getNodeShape(a)].intersectLine(a._private.position.x,a._private.position.y,this.getNodeWidth(a),this.getNodeHeight(a),n.position().x,n.position().y,l/2),c.noArrowPlacement=0===i.length?!0:!1;var h=e.math.shortenIntersection(i,[n.position().x,n.position().y],t.arrowShapes[o].spacing(r)),p=e.math.shortenIntersection(i,[n.position().x,n.position().y],t.arrowShapes[o].gap(r));c.endX=p[0],c.endY=p[1],c.arrowEndX=h[0],c.arrowEndY=h[1],i=t.nodeShapes[this.getNodeShape(n)].intersectLine(n._private.position.x,n._private.position.y,this.getNodeWidth(n),this.getNodeHeight(n),a.position().x,a.position().y,u/2),c.noArrowPlacement=0===i.length?!0:!1;var v=e.math.shortenIntersection(i,[a.position().x,a.position().y],t.arrowShapes[s].spacing(r)),f=e.math.shortenIntersection(i,[a.position().x,a.position().y],t.arrowShapes[s].gap(r));c.startX=f[0],c.startY=f[1],c.arrowStartX=v[0],c.arrowStartY=v[1],c.badLine=e.is.number(c.startX)&&e.is.number(c.startY)&&e.is.number(c.endX)&&e.is.number(c.endY)?!1:!0}else if("bezier"==c.edgeType){var d=[c.cp2x,c.cp2y];i=t.nodeShapes[this.getNodeShape(a)].intersectLine(a._private.position.x,a._private.position.y,this.getNodeWidth(a),this.getNodeHeight(a),d[0],d[1],l/2);var h=e.math.shortenIntersection(i,d,t.arrowShapes[o].spacing(r)),p=e.math.shortenIntersection(i,d,t.arrowShapes[o].gap(r));c.endX=p[0],c.endY=p[1],c.arrowEndX=h[0],c.arrowEndY=h[1],i=t.nodeShapes[this.getNodeShape(n)].intersectLine(n._private.position.x,n._private.position.y,this.getNodeWidth(n),this.getNodeHeight(n),d[0],d[1],u/2);var v=e.math.shortenIntersection(i,d,t.arrowShapes[s].spacing(r)),f=e.math.shortenIntersection(i,d,t.arrowShapes[s].gap(r));c.startX=f[0],c.startY=f[1],c.arrowStartX=v[0],c.arrowStartY=v[1]}else if(c.isArcEdge)return},r.findEdges=function(e){for(var t=this.getCachedEdges(),r={},i=[],n=0;n<e.length;n++)r[e[n]._private.data.id]=e[n];for(var n=0;n<t.length;n++)(r[t[n]._private.data.source]||r[t[n]._private.data.target])&&i.push(t[n]);return i},r.getArrowWidth=r.getArrowHeight=function(e){var t=this.arrowWidthCache=this.arrowWidthCache||{},r=t[e];return r?r:(r=Math.max(Math.pow(13.37*e,.9),29),t[e]=r,r)}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t.prototype;r.drawEdge=function(e,r,i){var n=r._private.rscratch,a=t.usePaths();if(!n.badBezier&&("bezier"!==n.edgeType&&"straight"!==n.edgeType||!isNaN(n.startX))){var o=r._private.style;if(!(o.width.pxValue<=0)){var s=o["overlay-padding"].pxValue,l=o["overlay-opacity"].value,u=o["overlay-color"].value;if(i){if(0===l)return;this.strokeStyle(e,u[0],u[1],u[2],l),e.lineCap="round","self"!=r._private.rscratch.edgeType||a||(e.lineCap="butt")}else{var c=o["line-color"].value;this.strokeStyle(e,c[0],c[1],c[2],o.opacity.value),e.lineCap="butt"}var d,h,p,v;p=d=r._private.source,v=h=r._private.target;var f=o.width.pxValue+(i?2*s:0),g=i?"solid":o["line-style"].value;e.lineWidth=f;var y=o["shadow-blur"].pxValue,m=o["shadow-opacity"].value,x=o["shadow-color"].value,b=o["shadow-offset-x"].pxValue,w=o["shadow-offset-y"].pxValue;if(this.shadowStyle(e,x,i?0:m,y,b,w),"haystack"===n.edgeType)this.drawStyledEdge(r,e,n.haystackPts,g,f);else if("self"===n.edgeType||"compound"===n.edgeType){var _=r._private.rscratch,E=[_.startX,_.startY,_.cp2ax,_.cp2ay,_.selfEdgeMidX,_.selfEdgeMidY,_.selfEdgeMidX,_.selfEdgeMidY,_.cp2cx,_.cp2cy,_.endX,_.endY];this.drawStyledEdge(r,e,E,g,f)}else if("straight"===n.edgeType){var S=h._private.position.x-d._private.position.x,D=h._private.position.y-d._private.position.y,k=n.endX-n.startX,T=n.endY-n.startY;if(0>S*k+D*T)n.straightEdgeTooShort=!0;else{var _=n;this.drawStyledEdge(r,e,[_.startX,_.startY,_.endX,_.endY],g,f),n.straightEdgeTooShort=!1}}else{var _=n;this.drawStyledEdge(r,e,[_.startX,_.startY,_.cp2x,_.cp2y,_.endX,_.endY],g,f)}"haystack"===n.edgeType?this.drawArrowheads(e,r,i):n.noArrowPlacement!==!0&&void 0!==n.startX&&this.drawArrowheads(e,r,i),this.shadowStyle(e,"transparent",0)}}},r.drawStyledEdge=function(e,r,i,n,a){var o,s=e._private.rscratch,l=r,u=!1,c=t.usePaths();if(c){for(var d=i,h=s.pathCacheKey&&d.length===s.pathCacheKey.length,p=h,v=0;p&&v<d.length;v++)s.pathCacheKey[v]!==d[v]&&(p=!1);p?(o=r=s.pathCache,u=!0):(o=r=new Path2D,s.pathCacheKey=d,s.pathCache=o)}if(l.setLineDash)switch(n){case"dotted":l.setLineDash([1,1]);break;case"dashed":l.setLineDash([6,3]);break;case"solid":l.setLineDash([])}u||(r.beginPath&&r.beginPath(),r.moveTo(i[0],i[1]),6!==i.length||s.badBezier?12!==i.length||s.badBezier?4!==i.length||s.badLine||r.lineTo(i[2],i[3]):(r.quadraticCurveTo(i[2],i[3],i[4],i[5]),r.quadraticCurveTo(i[8],i[9],i[10],i[11])):r.quadraticCurveTo(i[2],i[3],i[4],i[5])),r=l,c?r.stroke(o):r.stroke(),r.setLineDash&&r.setLineDash([])},r.drawArrowheads=function(e,t,r){function i(r,i,n,a,o){var s=f[r+"-arrow-shape"].value;if("none"!==s){var l=e.globalCompositeOperation,u="hollow"===f[r+"-arrow-fill"].value?"both":"filled",c=f[r+"-arrow-fill"].value;"half-triangle-overshot"===s&&(c="hollow",u="hollow"),(1!==f.opacity.value||"hollow"===c)&&(e.globalCompositeOperation="destination-out",d.fillStyle(e,255,255,255,1),d.strokeStyle(e,255,255,255,1),d.drawArrowShape(t,r,e,u,f.width.pxValue,f[r+"-arrow-shape"].value,i,n,a,o),e.globalCompositeOperation=l);var h=f[r+"-arrow-color"].value;d.fillStyle(e,h[0],h[1],h[2],f.opacity.value),d.strokeStyle(e,h[0],h[1],h[2],f.opacity.value),d.drawArrowShape(t,r,e,c,f.width.pxValue,f[r+"-arrow-shape"].value,i,n,a,o)}}if(!r){var n,a,o,s,l,u,c=t._private.rscratch,d=this,h="haystack"===c.edgeType,p=t.source().position(),v=t.target().position();h?(o=c.haystackPts[0],s=c.haystackPts[1],l=c.haystackPts[2],u=c.haystackPts[3]):(o=c.arrowStartX,s=c.arrowStartY,l=c.arrowEndX,u=c.arrowEndY);var f=t._private.style;n=o-p.x,a=s-p.y,h||isNaN(o)||isNaN(s)||isNaN(n)||isNaN(a)||i("source",o,s,n,a);var g=c.midX,y=c.midY;h&&(g=(o+l)/2,y=(s+u)/2),n=o-l,a=s-u,"self"===c.edgeType&&(n=1,a=-1),isNaN(g)||isNaN(y)||i("mid-target",g,y,n,a),n*=-1,a*=-1,isNaN(g)||isNaN(y)||i("mid-source",g,y,n,a),n=l-v.x,a=u-v.y,h||isNaN(l)||isNaN(u)||isNaN(n)||isNaN(a)||i("target",l,u,n,a)}},r.drawArrowShape=function(e,r,i,n,a,o,s,l,u,c){var d,h=t.usePaths(),p=e._private.rscratch,v=!1,f=i,g={x:s,y:l},y=Math.asin(c/Math.sqrt(u*u+c*c));0>u?y+=Math.PI/2:y=-(Math.PI/2+y);var m=this.getArrowWidth(a),x=t.arrowShapes[o];if(h){var b=m+"$"+o+"$"+y+"$"+s+"$"+l;p.arrowPathCacheKey=p.arrowPathCacheKey||{},p.arrowPathCache=p.arrowPathCache||{};var w=p.arrowPathCacheKey[r]===b;w?(d=i=p.arrowPathCache[r],v=!0):(d=i=new Path2D,p.arrowPathCacheKey[r]=b,p.arrowPathCache[r]=d)}i.beginPath&&i.beginPath(),v||x.draw(i,m,y,g),!x.leavePathOpen&&i.closePath&&i.closePath(),i=f,("filled"===n||"both"===n)&&(h?i.fill(d):i.fill()),("hollow"===n||"both"===n)&&(i.lineWidth=x.matchEdgeWidth?a:1,i.lineJoin="miter",h?i.stroke(d):i.stroke())}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t.prototype;r.getCachedImage=function(e,t){var r=this,i=r.imageCache=r.imageCache||{};if(i[e]&&i[e].image)return i[e].image;var n=i[e]=i[e]||{},a=n.image=new Image;return a.addEventListener("load",t),a.src=e,a},r.safeDrawImage=function(e,r,i,n,a,o,s,l,u,c){var d=this;try{e.drawImage(r,i,n,a,o,s,l,u,c)}catch(h){d.data.canvasNeedsRedraw[t.NODE]=!0,d.data.canvasNeedsRedraw[t.DRAG]=!0,d.drawingImage=!0,d.redraw()}},r.drawInscribedImage=function(e,r,i){var n=this,a=i._private.position.x,o=i._private.position.y,s=i._private.style,l=s["background-fit"].value,u=s["background-position-x"],c=s["background-position-y"],d=s["background-repeat"].value,h=i.width(),p=i.height(),v=i._private.rscratch,f=s["background-clip"].value,g="node"===f,y=s["background-image-opacity"].value,m=r.width,x=r.height;if(0!==m&&0!==x){var b=s["background-width"];"auto"!==b.value&&(m="%"===b.units?b.value/100*h:b.pxValue);var w=s["background-height"];if("auto"!==w.value&&(x="%"===w.units?w.value/100*p:w.pxValue),0!==m&&0!==x){if("contain"===l){var _=Math.min(h/m,p/x);m*=_,x*=_}else if("cover"===l){var _=Math.max(h/m,p/x);m*=_,x*=_}var E=a-h/2;E+="%"===u.units?(h-m)*u.value/100:u.pxValue;var S=o-p/2;S+="%"===c.units?(p-x)*c.value/100:c.pxValue,v.pathCache&&(E-=a,S-=o,a=0,o=0);var D=e.globalAlpha;if(e.globalAlpha=y,"no-repeat"===d)g&&(e.save(),v.pathCache?e.clip(v.pathCache):(t.nodeShapes[n.getNodeShape(i)].drawPath(e,a,o,h,p),e.clip())),n.safeDrawImage(e,r,0,0,r.width,r.height,E,S,m,x),g&&e.restore();else{var k=e.createPattern(r,d);e.fillStyle=k,t.nodeShapes[n.getNodeShape(i)].drawPath(e,a,o,h,p),e.translate(E,S),e.fill(),e.translate(-E,-S)}e.globalAlpha=D}}}}(cytoscape),function(e){"use strict";function t(e,t,r,i,n,a){var a=a||5;e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+i-a,r),e.quadraticCurveTo(t+i,r,t+i,r+a),e.lineTo(t+i,r+n-a),e.quadraticCurveTo(t+i,r+n,t+i-a,r+n),
e.lineTo(t+a,r+n),e.quadraticCurveTo(t,r+n,t,r+n-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath(),e.fill()}var r=e("renderer","canvas"),i=r.prototype;i.drawEdgeText=function(t,r){var i=r._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 n=r._private.style["font-size"].pxValue*r.cy().zoom(),a=r._private.style["min-zoomed-font-size"].pxValue;if(!(a>n)){t.textAlign="center",t.textBaseline="middle";var o=r._private.rscratch;if(e.is.number(o.labelX)&&e.is.number(o.labelY)){var s,l,u,c=r._private.style,d="autorotate"===c["edge-text-rotation"].strValue;if(d){switch(o.edgeType){case"haystack":l=o.haystackPts[2]-o.haystackPts[0],u=o.haystackPts[3]-o.haystackPts[1];break;default:l=o.endX-o.startX,u=o.endY-o.startY}s=Math.atan(u/l),t.translate(o.labelX,o.labelY),t.rotate(s),this.drawText(t,r,0,0),t.rotate(-s),t.translate(-o.labelX,-o.labelY)}else this.drawText(t,r,o.labelX,o.labelY)}}}},i.drawNodeText=function(t,r){var i=r._private.style.content.strValue;if(i&&!i.match(/^\s+$/)){var n=r._private.style["font-size"].pxValue*r.cy().zoom(),a=r._private.style["min-zoomed-font-size"].pxValue;if(!(a>n)){var o=r._private.style["text-halign"].strValue,s=r._private.style["text-valign"].strValue,l=r._private.rscratch;if(e.is.number(l.labelX)&&e.is.number(l.labelY)){switch(o){case"left":t.textAlign="right";break;case"right":t.textAlign="left";break;default:t.textAlign="center"}switch(s){case"top":t.textBaseline="bottom";break;case"bottom":t.textBaseline="top";break;default:t.textBaseline="middle"}this.drawText(t,r,l.labelX,l.labelY)}}}},i.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(t=this.fontCaches[r],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t},i.setupTextStyle=function(e,t){var r=t.effectiveOpacity(),i=t._private.style,n=i["font-style"].strValue,a=i["font-size"].pxValue+"px",o=i["font-family"].strValue,s=i["font-weight"].strValue,l=i["text-opacity"].value*i.opacity.value*r,u=i["text-outline-opacity"].value*l,c=i.color.value,d=i["text-outline-color"].value,h=i["text-shadow-blur"].pxValue,p=i["text-shadow-opacity"].value,v=i["text-shadow-color"].value,f=i["text-shadow-offset-x"].pxValue,g=i["text-shadow-offset-y"].pxValue,y=t._private.fontKey,m=this.getFontCache(e);m.key!==y&&(e.font=n+" "+s+" "+a+" "+o,m.key=y);var x=this.getLabelText(t);return e.lineJoin="round",this.fillStyle(e,c[0],c[1],c[2],l),this.strokeStyle(e,d[0],d[1],d[2],u),this.shadowStyle(e,v,p,h,f,g),x},i.drawText=function(e,r,i,n){var a=r._private,o=a.style,s=a.rstyle,l=a.rscratch,u=r.effectiveOpacity();if(0!==u&&0!==o["text-opacity"].value){var c=this.setupTextStyle(e,r),d=o["text-halign"].value,h=o["text-valign"].value;if(r.isEdge()&&(d="center",h="center"),null!=c&&!isNaN(i)&&!isNaN(n)){var p=o["text-background-opacity"].value,v=o["text-border-opacity"].value,f=o["text-border-width"].pxValue;if(p>0||f>0&&v>0){var g=4+f/2;r.isNode()&&("top"===h?n-=g:"bottom"===h&&(n+=g),"left"===d?i-=g:"right"===d&&(i+=g));var y=s.labelWidth,m=s.labelHeight,x=i;d&&("center"==d?x-=y/2:"left"==d&&(x-=y));var b=n;if(r.isNode()?"top"==h?b-=m:"center"==h&&(b-=m/2):b-=m/2,"autorotate"===o["edge-text-rotation"].strValue?(n=0,y+=4,x=i-y/2,b=n-m/2):(x-=g,b-=g,m+=2*g,y+=2*g),p>0){var w=e.fillStyle,_=o["text-background-color"].value;e.fillStyle="rgba("+_[0]+","+_[1]+","+_[2]+","+p*u+")";var E=o["text-background-shape"].strValue;"roundrectangle"==E?t(e,x,b,y,m,2):e.fillRect(x,b,y,m),e.fillStyle=w}if(f>0&&v>0){var S=e.strokeStyle,D=e.lineWidth,k=o["text-border-color"].value,T=o["text-border-style"].value;if(e.strokeStyle="rgba("+k[0]+","+k[1]+","+k[2]+","+v*u+")",e.lineWidth=f,e.setLineDash)switch(T){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=f/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(x,b,y,m),"double"===T){var P=f/2;e.strokeRect(x+P,b+P,y-2*P,m-2*P)}e.setLineDash&&e.setLineDash([]),e.lineWidth=D,e.strokeStyle=S}}var C=2*o["text-outline-width"].pxValue;if(C>0&&(e.lineWidth=C),"wrap"===o["text-wrap"].value){var M=l.labelWrapCachedLines,B=s.labelHeight/M.length;switch(h){case"top":n-=(M.length-1)*B;break;case"bottom":break;default:case"center":n-=(M.length-1)*B/2}for(var N=0;N<M.length;N++)C>0&&e.strokeText(M[N],i,n),e.fillText(M[N],i,n),n+=B}else C>0&&e.strokeText(c,i,n),e.fillText(c,i,n);this.shadowStyle(e,"transparent",0)}}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t.prototype;r.drawNode=function(e,r,i){var n,a,o,s=this,l=r._private.style,u=r._private.rscratch,c=r._private,d=t.usePaths(),h=e,p=!1,v=l["overlay-padding"].pxValue,f=l["overlay-opacity"].value,g=l["overlay-color"].value;if(!i||0!==f){var y=r.effectiveOpacity();if(0!==y)if(n=this.getNodeWidth(r),a=this.getNodeHeight(r),e.lineWidth=l["border-width"].pxValue,void 0!==i&&i)f>0&&(this.fillStyle(e,g[0],g[1],g[2],f),t.nodeShapes.roundrectangle.drawPath(e,r._private.position.x,r._private.position.y,n+2*v,a+2*v),e.fill());else{var m,x=l["background-image"].value[2]||l["background-image"].value[1];if(void 0!==x){m=this.getCachedImage(x,function(){s.data.canvasNeedsRedraw[t.NODE]=!0,s.data.canvasNeedsRedraw[t.DRAG]=!0,s.drawingImage=!0,s.redraw()});var b=c.backgrounding;c.backgrounding=!m.complete,b!==c.backgrounding&&r.updateStyle(!1)}var w=l["background-color"].value,_=l["border-color"].value,E=l["border-style"].value;this.fillStyle(e,w[0],w[1],w[2],l["background-opacity"].value*y),this.strokeStyle(e,_[0],_[1],_[2],l["border-opacity"].value*y);var S=l["shadow-blur"].pxValue,D=l["shadow-opacity"].value,k=l["shadow-color"].value,T=l["shadow-offset-x"].pxValue,P=l["shadow-offset-y"].pxValue;if(this.shadowStyle(e,k,D,S,T,P),e.lineJoin="miter",e.setLineDash)switch(E){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var C=l.shape.strValue,M=r._private.position;if(d){var B=C+"$"+n+"$"+a;e.translate(M.x,M.y),u.pathCacheKey===B?(o=e=u.pathCache,p=!0):(o=e=new Path2D,u.pathCacheKey=B,u.pathCache=o)}if(!p){var N=M;d&&(N={x:0,y:0}),t.nodeShapes[this.getNodeShape(r)].drawPath(e,N.x,N.y,n,a)}e=h,d?e.fill(o):e.fill(),this.shadowStyle(e,"transparent",0),void 0!==x&&m.complete&&this.drawInscribedImage(e,m,r);var I=l["background-blacken"].value,O=l["border-width"].pxValue;if(this.hasPie(r)&&(this.drawPie(e,r,y),(0!==I||0!==O)&&(d||t.nodeShapes[this.getNodeShape(r)].drawPath(e,M.x,M.y,n,a))),I>0?(this.fillStyle(e,0,0,0,I),d?e.fill(o):e.fill()):0>I&&(this.fillStyle(e,255,255,255,-I),d?e.fill(o):e.fill()),O>0&&(d?e.stroke(o):e.stroke(),"double"===E)){e.lineWidth=l["border-width"].pxValue/3;var z=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",d?e.stroke(o):e.stroke(),e.globalCompositeOperation=z}d&&e.translate(-M.x,-M.y),e.setLineDash&&e.setLineDash([])}}},r.hasPie=function(e){return e=e[0],e._private.hasPie},r.drawPie=function(r,i,n){i=i[0];var a=i._private,o=a.style,s=o["pie-size"],l=this.getNodeWidth(i),u=this.getNodeHeight(i),c=a.position.x,d=a.position.y,h=Math.min(l,u)/2,p=0,v=t.usePaths();v&&(c=0,d=0),"%"===s.units?h=h*s.value/100:void 0!==s.pxValue&&(h=s.pxValue/2);for(var f=1;f<=e.style.pieBackgroundN;f++){var g=o["pie-"+f+"-background-size"].value,y=o["pie-"+f+"-background-color"].value,m=o["pie-"+f+"-background-opacity"].value*n,x=g/100,b=1.5*Math.PI+2*Math.PI*p,w=2*Math.PI*x,_=b+w;0===g||p>=1||p+x>1||(r.beginPath(),r.moveTo(c,d),r.arc(c,d,h,b,_),r.closePath(),this.fillStyle(r,y[0],y[1],y[2],m),r.fill(),p+=x)}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t,i=t.prototype;i.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},i.paintCache=function(e){for(var t,r=this.paintCaches=this.paintCaches||[],i=!0,n=0;n<r.length;n++)if(t=r[n],t.context===e){i=!1;break}return i&&(t={context:e},r.push(t)),t},i.fillStyle=function(e,t,r,i,n){e.fillStyle="rgba("+t+","+r+","+i+","+n+")"},i.strokeStyle=function(e,t,r,i,n){e.strokeStyle="rgba("+t+","+r+","+i+","+n+")"},i.shadowStyle=function(e,t,r,i,n,a){var o=this.data.cy.zoom(),s=this.paintCache(e);(0!==s.shadowOpacity||0!==r)&&(s.shadowOpacity=r,r>0?(e.shadowBlur=i*o,e.shadowColor="rgba("+t[0]+","+t[1]+","+t[2]+","+r+")",e.shadowOffsetX=n*o,e.shadowOffsetY=a*o):(e.shadowBlur=0,e.shadowColor="transparent"))},i.matchCanvasSize=function(e){var i=this.data,n=e.clientWidth,a=e.clientHeight,o=this.getPixelRatio(),s=this.motionBlurPxRatio;(e===this.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE]||e===this.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var l,u=n*o,c=a*o;if(u!==this.canvasWidth||c!==this.canvasHeight){this.fontCaches=null;var d=i.canvasContainer;d.style.width=n+"px",d.style.height=a+"px";for(var h=0;h<t.CANVAS_LAYERS;h++)l=i.canvases[h],(l.width!==u||l.height!==c)&&(l.width=u,l.height=c,l.style.width=n+"px",l.style.height=a+"px");for(var h=0;h<t.BUFFER_COUNT;h++)l=i.bufferCanvases[h],(l.width!==u||l.height!==c)&&(l.width=u,l.height=c,l.style.width=n+"px",l.style.height=a+"px");this.textureMult=1,1>=o&&(l=i.bufferCanvases[t.TEXTURE_BUFFER],this.textureMult=2,l.width=u*this.textureMult,l.height=c*this.textureMult),this.canvasWidth=u,this.canvasHeight=c}},i.renderTo=function(e,t,r,i){this.redraw({forcedContext:e,forcedZoom:t,forcedPan:r,drawAllLayers:!0,forcedPxRatio:i})},i.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},t.minRedrawLimit=1e3/60,t.maxRedrawLimit=1e3,t.motionBlurDelay=100,i.redraw=function(i){function n(){function i(e,t,r,i,n){var a=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",c.fillStyle(e,255,255,255,c.motionBlurTransparency),e.fillRect(t,r,i,n),e.globalCompositeOperation=a}function n(e,t){var n,s,d,h;/*!r.fullQualityMb &&*/c.clearingMotionBlur||e!==p.bufferContexts[r.MOTIONBLUR_BUFFER_NODE]&&e!==p.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG]?(n=T,s=D,d=c.canvasWidth,h=c.canvasHeight):(n={x:k.x*y,y:k.y*y},s=S*y,d=c.canvasWidth*y,h=c.canvasHeight*y),e.setTransform(1,0,0,1,0,0),"motionBlur"===t?i(e,0,0,d,h):a||void 0!==t&&!t||e.clearRect(0,0,d,h),o||(e.translate(n.x,n.y),e.scale(s,s)),u&&e.translate(u.x,u.y),l&&e.scale(l,l)}function b(e,t){for(var r=e.eles,i=0;i<r.length;i++){var n=r[i];n.isNode()?(c.drawNode(t,n),F||c.drawNodeText(t,n),c.drawNode(t,n,!0)):X||(c.drawEdge(t,n),F||c.drawEdgeText(t,n),c.drawEdge(t,n,!0))}}c.textureDrawLastFrame&&!f&&(v[r.NODE]=!0,v[r.SELECT_BOX]=!0);var _=c.getCachedEdges(),E=h.style()._private.coreStyle,S=h.zoom(),D=void 0!==l?l:S,k=h.pan(),T={x:k.x,y:k.y},C={zoom:S,pan:{x:k.x,y:k.y}},M=c.prevViewport,B=void 0===M||C.zoom!==M.zoom||C.pan.x!==M.pan.x||C.pan.y!==M.pan.y;B||x&&!m||(c.motionBlurPxRatio=1),u&&(T=u),D*=d,T.x*=d,T.y*=d;var N={drag:{nodes:[],edges:[],eles:[]},nondrag:{nodes:[],edges:[],eles:[]}};if(f||(c.textureDrawLastFrame=!1),f){c.textureDrawLastFrame=!0;var I;if(!c.textureCache){c.textureCache={},I=c.textureCache.bb=h.elements().boundingBox(),c.textureCache.texture=c.data.bufferCanvases[t.TEXTURE_BUFFER];var O=c.data.bufferContexts[t.TEXTURE_BUFFER];O.setTransform(1,0,0,1,0,0),O.clearRect(0,0,c.canvasWidth*c.textureMult,c.canvasHeight*c.textureMult),c.redraw({forcedContext:O,drawOnlyNodeLayer:!0,forcedPxRatio:d*c.textureMult});var C=c.textureCache.viewport={zoom:h.zoom(),pan:h.pan(),width:c.canvasWidth,height:c.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}v[r.DRAG]=!1,v[r.NODE]=!1;var z=p.contexts[r.NODE],L=c.textureCache.texture,C=c.textureCache.viewport;I=c.textureCache.bb,z.setTransform(1,0,0,1,0,0),g?i(z,0,0,C.width,C.height):z.clearRect(0,0,C.width,C.height);var R=E["outside-texture-bg-color"].value,V=E["outside-texture-bg-opacity"].value;c.fillStyle(z,R[0],R[1],R[2],V),z.fillRect(0,0,C.width,C.height);var S=h.zoom();n(z,!1),z.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/d,C.height/C.zoom/d),z.drawImage(L,C.mpan.x,C.mpan.y,C.width/C.zoom/d,C.height/C.zoom/d)}else c.textureOnViewport&&!a&&(c.textureCache=null);var A=c.pinching||c.hoverData.dragging||c.swipePanning||c.data.wheelZooming||c.hoverData.draggingEles,X=c.hideEdgesOnViewport&&A,F=c.hideLabelsOnViewport&&A;if(v[r.DRAG]||v[r.NODE]||o||s){X||c.findEdgeControlPoints(_);for(var Y=c.getCachedZSortedEles(),q=h.extent(),j=0;j<Y.length;j++){var $,W=Y[j],I=a?null:W.boundingBox(),H=a?!0:e.math.boundingBoxesIntersect(q,I);H&&($=W._private.rscratch.inDragLayer?N.drag:N.nondrag,$.eles.push(W))}}var Z=[];if(Z[r.NODE]=!v[r.NODE]&&g&&!c.clearedForMotionBlur[r.NODE]||c.clearingMotionBlur,Z[r.NODE]&&(c.clearedForMotionBlur[r.NODE]=!0),Z[r.DRAG]=!v[r.DRAG]&&g&&!c.clearedForMotionBlur[r.DRAG]||c.clearingMotionBlur,Z[r.DRAG]&&(c.clearedForMotionBlur[r.DRAG]=!0),v[r.NODE]||o||s||Z[r.NODE]){var U=g&&!Z[r.NODE]&&1!==y,z=a||(U?c.data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE]:p.contexts[r.NODE]),G=g&&!U?"motionBlur":void 0;n(z,G),b(N.nondrag,z),o||g||(v[r.NODE]=!1)}if(!s&&(v[r.DRAG]||o||Z[r.DRAG])){var U=g&&!Z[r.DRAG]&&1!==y,z=a||(U?c.data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG]:p.contexts[r.DRAG]);n(z,g&&!U?"motionBlur":void 0),b(N.drag,z),o||g||(v[r.DRAG]=!1)}if(c.showFps||!s&&v[r.SELECT_BOX]&&!o){var z=a||p.contexts[r.SELECT_BOX];if(n(z),1==p.select[4]&&(c.hoverData.selecting||c.touchData.selecting)){var S=p.cy.zoom(),K=E["selection-box-border-width"].value/S;z.lineWidth=K,z.fillStyle="rgba("+E["selection-box-color"].value[0]+","+E["selection-box-color"].value[1]+","+E["selection-box-color"].value[2]+","+E["selection-box-opacity"].value+")",z.fillRect(p.select[0],p.select[1],p.select[2]-p.select[0],p.select[3]-p.select[1]),K>0&&(z.strokeStyle="rgba("+E["selection-box-border-color"].value[0]+","+E["selection-box-border-color"].value[1]+","+E["selection-box-border-color"].value[2]+","+E["selection-box-opacity"].value+")",z.strokeRect(p.select[0],p.select[1],p.select[2]-p.select[0],p.select[3]-p.select[1]))}if(p.bgActivePosistion&&!c.hoverData.selecting){var S=p.cy.zoom(),J=p.bgActivePosistion;z.fillStyle="rgba("+E["active-bg-color"].value[0]+","+E["active-bg-color"].value[1]+","+E["active-bg-color"].value[2]+","+E["active-bg-opacity"].value+")",z.beginPath(),z.arc(J.x,J.y,E["active-bg-size"].pxValue/S,0,2*Math.PI),z.fill()}var Q=c.averageRedrawTime;if(c.showFps&&Q){Q=Math.round(Q);var ee=Math.round(1e3/Q);z.setTransform(1,0,0,1,0,0),z.fillStyle="rgba(255, 0, 0, 0.75)",z.strokeStyle="rgba(255, 0, 0, 0.75)",z.lineWidth=1,z.fillText("1 frame = "+Q+" ms = "+ee+" fps",0,20);var te=60;z.strokeRect(0,30,250,20),z.fillRect(0,30,250*Math.min(ee/te,1),20)}o||(v[r.SELECT_BOX]=!1)}if(g&&1!==y){var re=p.contexts[r.NODE],ie=c.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE],ne=p.contexts[r.DRAG],ae=c.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG],oe=function(e,t,r){e.setTransform(1,0,0,1,0,0),r||!w?e.clearRect(0,0,c.canvasWidth,c.canvasHeight):i(e,0,0,c.canvasWidth,c.canvasHeight);var n=y;e.drawImage(t,0,0,c.canvasWidth*n,c.canvasHeight*n,0,0,c.canvasWidth,c.canvasHeight)};(v[r.NODE]||Z[r.NODE])&&(oe(re,ie,Z[r.NODE]),v[r.NODE]=!1),(v[r.DRAG]||Z[r.DRAG])&&(oe(ne,ae,Z[r.DRAG]),v[r.DRAG]=!1)}var se=Date.now();void 0===c.averageRedrawTime&&(c.averageRedrawTime=se-P),void 0===c.redrawCount&&(c.redrawCount=0),c.redrawCount++,void 0===c.redrawTotalTime&&(c.redrawTotalTime=0),c.redrawTotalTime+=se-P,c.lastRedrawTime=se-P,c.averageRedrawTime=c.averageRedrawTime/2+(se-P)/2,c.currentlyDrawing=!1,c.prevViewport=C,c.clearingMotionBlur&&(c.clearingMotionBlur=!1,c.motionBlurCleared=!0,c.motionBlur=!0),g&&(c.motionBlurTimeout=setTimeout(function(){c.motionBlurTimeout=null,c.clearedForMotionBlur[r.NODE]=!1,c.clearedForMotionBlur[r.DRAG]=!1,c.motionBlur=!1,c.clearingMotionBlur=!f,c.mbFrames=0,v[r.NODE]=!0,v[r.DRAG]=!0,c.redraw()},t.motionBlurDelay)),c.drawingImage=!1}i=i||{};var a=i.forcedContext,o=i.drawAllLayers,s=i.drawOnlyNodeLayer,l=i.forcedZoom,u=i.forcedPan,c=this,d=void 0===i.forcedPxRatio?this.getPixelRatio():i.forcedPxRatio,h=c.data.cy,p=c.data,v=p.canvasNeedsRedraw,f=c.textureOnViewport&&!a&&(c.pinching||c.hoverData.dragging||c.swipePanning||c.data.wheelZooming),g=void 0!==i.motionBlur?i.motionBlur:c.motionBlur,y=c.motionBlurPxRatio,m=h.hasCompoundNodes(),x=c.hoverData.draggingEles,b=c.hoverData.selecting||c.touchData.selecting?!0:!1;g=g&&!a&&c.motionBlurEnabled&&!b;var w=g;!a&&c.motionBlurTimeout&&clearTimeout(c.motionBlurTimeout),!a&&this.redrawTimeout&&clearTimeout(this.redrawTimeout),this.redrawTimeout=null,void 0===this.averageRedrawTime&&(this.averageRedrawTime=0);var _=t.minRedrawLimit,E=t.maxRedrawLimit,S=this.averageRedrawTime;S=_>S?_:S,S=E>S?S:E,void 0===this.lastDrawTime&&(this.lastDrawTime=0);var D=Date.now(),k=D-this.lastDrawTime,T=k>=S;if(!a&&!c.clearingMotionBlur){if(!T||this.currentlyDrawing)return void(this.redrawTimeout=setTimeout(function(){c.redraw()},S));this.lastDrawTime=D,this.currentlyDrawing=!0}g&&(null==c.mbFrames&&(c.mbFrames=0),c.drawingImage||c.mbFrames++,c.mbFrames<3&&(w=!1),c.mbFrames>c.minMbLowQualFrames&&(c.motionBlurPxRatio=c.mbPxRBlurry)),c.clearingMotionBlur&&(c.motionBlurPxRatio=1);var P=Date.now();a?n():e.util.requestAnimationFrame(n),a||c.initrender||(c.initrender=!0,h.trigger("initrender")),a||h.triggerOnRender()}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t.prototype;r.drawPolygonPath=function(e,t,r,i,n,a){var o=i/2,s=n/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],r+s*a[1]);for(var l=1;l<a.length/2;l++)e.lineTo(t+o*a[2*l],r+s*a[2*l+1]);e.closePath()},r.drawPolygon=function(e,t,r,i,n,a){this.drawPolygonPath(e,t,r,i,n,a),e.fill()},r.drawRoundRectanglePath=function(t,r,i,n,a,o){var s=n/2,l=a/2,u=e.math.getRoundRectangleRadius(n,a);t.beginPath&&t.beginPath(),t.moveTo(r,i-l),t.arcTo(r+s,i-l,r+s,i,u),t.arcTo(r+s,i+l,r,i+l,u),t.arcTo(r-s,i+l,r-s,i,u),t.arcTo(r-s,i-l,r,i-l,u),t.lineTo(r,i-l),t.closePath()},r.drawRoundRectangle=function(e,t,r,i,n,a){this.drawRoundRectanglePath(e,t,r,i,n,a),e.fill()}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t.prototype;r.createBuffer=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,[r,r.getContext("2d")]},r.bufferCanvasImage=function(t){var r=this.data,i=r.cy,n=i.elements().boundingBox(),a=t.full?Math.ceil(n.w):this.data.container.clientWidth,o=t.full?Math.ceil(n.h):this.data.container.clientHeight,s=1;if(void 0!==t.scale)a*=t.scale,o*=t.scale,s=t.scale;else if(e.is.number(t.maxWidth)||e.is.number(t.maxHeight)){var l=1/0,u=1/0;e.is.number(t.maxWidth)&&(l=s*t.maxWidth/a),e.is.number(t.maxHeight)&&(u=s*t.maxHeight/o),s=Math.min(l,u),a*=s,o*=s}var c=document.createElement("canvas");c.width=a,c.height=o,c.style.width=a+"px",c.style.height=o+"px";var d=c.getContext("2d");if(a>0&&o>0)if(d.clearRect(0,0,a,o),t.bg&&(d.fillStyle=t.bg,d.rect(0,0,a,o),d.fill()),d.globalCompositeOperation="source-over",t.full)this.redraw({forcedContext:d,drawAllLayers:!0,forcedZoom:s,forcedPan:{x:-n.x1*s,y:-n.y1*s},forcedPxRatio:1});else{var h=i.pan(),p={x:h.x*s,y:h.y*s},v=i.zoom()*s;this.redraw({forcedContext:d,drawAllLayers:!0,forcedZoom:v,forcedPan:p,forcedPxRatio:1})}return c},r.png=function(e){return this.bufferCanvasImage(e).toDataURL("image/png")},r.jpg=function(e){return this.bufferCanvasImage(e).toDataURL("image/jpeg")}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t,i=r.prototype;i.registerBinding=function(e,t,r,i){this.bindings.push({target:e,event:t,handler:r,useCapture:i}),e.addEventListener(t,r,i)},i.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},i.load=function(){var t=this,i=function(e){var r;if(e.addToList&&t.data.cy.hasCompoundNodes()){if(!e.addToList.hasId){e.addToList.hasId={};for(var i=0;i<e.addToList.length;i++){var n=e.addToList[i];e.addToList.hasId[n.id()]=!0}}r=e.addToList.hasId}return r||{}},n=function(e,t){if(e._private.cy.hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList))for(var r=i(t),n=e.descendants(),a=0;a<n.size();a++){var o=n[a],s=o._private;t.inDragLayer&&(s.rscratch.inDragLayer=!0),t.addToList&&!r[o.id()]&&(t.addToList.push(o),r[o.id()]=!0,s.grabbed=!0);for(var l=s.edges,u=0;t.inDragLayer&&u<l.length;u++)l[u]._private.rscratch.inDragLayer=!0}},a=function(e,t){var r=e._private,a=i(t);t.inDragLayer&&(r.rscratch.inDragLayer=!0),t.addToList&&!a[e.id()]&&(t.addToList.push(e),a[e.id()]=!0,r.grabbed=!0);for(var o=r.edges,l=0;t.inDragLayer&&l<o.length;l++)o[l]._private.rscratch.inDragLayer=!0;n(e,t),s(e,{inDragLayer:t.inDragLayer})},o=function(e){if(e)for(var t=0;t<e.length;t++){var r=e[t]._private;if("nodes"===r.group){r.rscratch.inDragLayer=!1,r.grabbed=!1;for(var i=r.edges,n=0;n<i.length;n++)i[n]._private.rscratch.inDragLayer=!1;s(e[t],{inDragLayer:!1})}else"edges"===r.group&&(r.rscratch.inDragLayer=!1)}},s=function(e,t){if(null!=t.inDragLayer||null!=t.addToList){var r=e;if(e._private.cy.hasCompoundNodes()){for(;r.parent().nonempty();)r=r.parent()[0];if(r!=e){for(var n=r.descendants().merge(r).unmerge(e).unmerge(e.descendants()),a=n.connectedEdges(),o=i(t),s=0;s<n.size();s++)void 0!==t.inDragLayer&&(n[s]._private.rscratch.inDragLayer=t.inDragLayer),t.addToList&&!o[n[s].id()]&&(t.addToList.push(n[s]),o[n[s].id()]=!0,n[s]._private.grabbed=!0);for(var l=0;void 0!==t.inDragLayer&&l<a.length;l++)a[l]._private.rscratch.inDragLayer=t.inDragLayer}}}};"undefined"!=typeof MutationObserver?(t.removeObserver=new MutationObserver(function(e){for(var r=0;r<e.length;r++){var i=e[r],n=i.removedNodes;if(n)for(var a=0;a<n.length;a++){var o=n[a];if(o===t.data.container){t.destroy();break}}}}),t.removeObserver.observe(t.data.container.parentNode,{childList:!0})):t.registerBinding(t.data.container,"DOMNodeRemoved",function(e){t.destroy()}),t.registerBinding(window,"resize",e.util.debounce(function(e){t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.data.container),t.data.canvasNeedsRedraw[r.NODE]=!0,t.redraw()},100));for(var l=function(e){t.registerBinding(e,"scroll",function(e){t.invalidateContainerClientCoordsCache()})},u=t.data.cy.container();l(u),u.parentNode;)u=u.parentNode;t.registerBinding(t.data.container,"contextmenu",function(e){e.preventDefault()});var c=function(){return 0!==t.data.select[4]};t.registerBinding(t.data.container,"mousedown",function(i){i.preventDefault(),t.hoverData.capture=!0,t.hoverData.which=i.which;var n=t.data.cy,o=t.projectIntoViewport(i.clientX,i.clientY),s=t.data.select,l=t.findNearestElement(o[0],o[1],!0,!1),u=t.dragData.possibleDragElements;t.hoverData.mdownPos=o;var c=t.data.canvasNeedsRedraw,d=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var r=t.hoverData.down;r?r.trigger(new e.Event(i,{type:"taphold",cyPosition:{x:o[0],y:o[1]}})):n.trigger(new e.Event(i,{type:"taphold",cyPosition:{x:o[0],y:o[1]}}))}},t.tapholdDuration)};if(3==i.which){t.hoverData.cxtStarted=!0;var h=new e.Event(i,{type:"cxttapstart",cyPosition:{x:o[0],y:o[1]}});l?(l.activate(),l.trigger(h),t.hoverData.down=l):n.trigger(h),t.hoverData.downTime=(new Date).getTime(),t.hoverData.cxtDragged=!1}else if(1==i.which){if(l&&l.activate(),null!=l){if(t.nodeIsDraggable(l)){var p=new e.Event(i,{type:"grab",cyPosition:{x:o[0],y:o[1]}});if(l.isNode()&&!l.selected())u=t.dragData.possibleDragElements=[],a(l,{addToList:u}),l.trigger(p);else if(l.isNode()&&l.selected()){u=t.dragData.possibleDragElements=[];for(var v=n.$(function(){return this.isNode()&&this.selected()}),f=0;f<v.length;f++)t.nodeIsDraggable(v[f])&&a(v[f],{addToList:u});l.trigger(p)}c[r.NODE]=!0,c[r.DRAG]=!0}l.trigger(new e.Event(i,{type:"mousedown",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(i,{type:"tapstart",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(i,{type:"vmousedown",cyPosition:{x:o[0],y:o[1]}}))}else null==l&&n.trigger(new e.Event(i,{type:"mousedown",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(i,{type:"tapstart",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(i,{type:"vmousedown",cyPosition:{x:o[0],y:o[1]}}));if(t.hoverData.down=l,t.hoverData.downTime=(new Date).getTime(),null==l||l.isEdge()){s[4]=1;var g=Math.max(0,r.panOrBoxSelectDelay-(+new Date-t.hoverData.downTime));clearTimeout(t.bgActiveTimeout),n.boxSelectionEnabled()||l&&l.isEdge()?t.bgActiveTimeout=setTimeout(function(){l&&l.unactivate(),t.data.bgActivePosistion={x:o[0],y:o[1]},t.hoverData.dragging=!0,c[r.SELECT_BOX]=!0,t.redraw()},g):(t.data.bgActivePosistion={x:o[0],y:o[1]},c[r.SELECT_BOX]=!0,t.redraw())}d()}s[0]=s[2]=o[0],s[1]=s[3]=o[1]},!1),t.registerBinding(window,"mousemove",e.util.throttle(function(i){var n=!1,o=t.hoverData.capture;if(!o){var s=t.findContainerClientCoords();if(!(i.clientX>s[0]&&i.clientX<s[0]+t.canvasWidth&&i.clientY>s[1]&&i.clientY<s[1]+t.canvasHeight))return;for(var l=t.data.container,u=i.target,c=u.parentNode,d=!1;c;){if(c===l){d=!0;break}c=c.parentNode}if(!d)return}var h=t.data.cy,p=h.zoom(),v=t.projectIntoViewport(i.clientX,i.clientY),f=t.data.select,g=t.data.canvasNeedsRedraw,y=null;t.hoverData.draggingEles||(y=t.findNearestElement(v[0],v[1],!0,!1));var m=t.hoverData.last,x=t.hoverData.down,b=[v[0]-f[2],v[1]-f[3]],w=t.dragData.possibleDragElements,_=f[2]-f[0],E=_*_,S=f[3]-f[1],D=S*S,k=E+D,T=k*p*p;t.hoverData.tapholdCancelled=!0;var P=function(){var e=t.hoverData.dragDelta=t.hoverData.dragDelta||[];0===e.length?(e.push(b[0]),e.push(b[1])):(e[0]+=b[0],e[1]+=b[1])};if(n=!0,null!=y?y.trigger(new e.Event(i,{type:"mousemove",cyPosition:{x:v[0],y:v[1]}})).trigger(new e.Event(i,{type:"vmousemove",cyPosition:{x:v[0],y:v[1]}})).trigger(new e.Event(i,{type:"tapdrag",cyPosition:{x:v[0],y:v[1]}})):null==y&&h.trigger(new e.Event(i,{type:"mousemove",cyPosition:{x:v[0],y:v[1]}})).trigger(new e.Event(i,{type:"vmousemove",cyPosition:{x:v[0],y:v[1]}})).trigger(new e.Event(i,{type:"tapdrag",cyPosition:{x:v[0],y:v[1]}})),3===t.hoverData.which){var C=new e.Event(i,{type:"cxtdrag",cyPosition:{x:v[0],y:v[1]}});x?x.trigger(C):h.trigger(C),t.hoverData.cxtDragged=!0,t.hoverData.cxtOver&&y===t.hoverData.cxtOver||(t.hoverData.cxtOver&&t.hoverData.cxtOver.trigger(new e.Event(i,{type:"cxtdragout",cyPosition:{x:v[0],y:v[1]}})),t.hoverData.cxtOver=y,y&&y.trigger(new e.Event(i,{type:"cxtdragover",cyPosition:{x:v[0],y:v[1]}})))}else if(t.hoverData.dragging){if(n=!0,h.panningEnabled()&&h.userPanningEnabled()){var M;if(t.hoverData.justStartedPan){var B=t.hoverData.mdownPos;M={x:(v[0]-B[0])*p,y:(v[1]-B[1])*p},t.hoverData.justStartedPan=!1}else M={x:b[0]*p,y:b[1]*p};h.panBy(M),t.hoverData.dragged=!0}v=t.projectIntoViewport(i.clientX,i.clientY)}else if(1==f[4]&&(null==x||x.isEdge())&&(!h.boxSelectionEnabled()||+new Date-t.hoverData.downTime>=r.panOrBoxSelectDelay)&&!t.hoverData.selecting&&T>=t.desktopTapThreshold2&&h.panningEnabled()&&h.userPanningEnabled())t.hoverData.dragging=!0,t.hoverData.selecting=!1,t.hoverData.justStartedPan=!0,f[4]=0;else{if(h.boxSelectionEnabled()&&!t.hoverData.dragging&&Math.pow(f[2]-f[0],2)+Math.pow(f[3]-f[1],2)>7&&f[4]&&(clearTimeout(t.bgActiveTimeout),t.data.bgActivePosistion=void 0,t.hoverData.selecting=!0,g[r.SELECT_BOX]=!0,t.redraw()),x&&x.isEdge()&&x.active()&&x.unactivate(),y!=m&&(m&&(m.trigger(new e.Event(i,{type:"mouseout",cyPosition:{x:v[0],y:v[1]}})),m.trigger(new e.Event(i,{type:"tapdragout",cyPosition:{x:v[0],y:v[1]}}))),y&&(y.trigger(new e.Event(i,{type:"mouseover",cyPosition:{x:v[0],y:v[1]}})),y.trigger(new e.Event(i,{type:"tapdragover",cyPosition:{x:v[0],y:v[1]}}))),t.hoverData.last=y),x&&x.isNode()&&t.nodeIsDraggable(x))if(T>=t.desktopTapThreshold2){var N=!t.dragData.didDrag;N&&(g[r.NODE]=!0),t.dragData.didDrag=!0;for(var I=[],O=0;O<w.length;O++){var z=w[O];if(t.hoverData.draggingEles||a(z,{inDragLayer:!0}),z.isNode()&&t.nodeIsDraggable(z)&&z.grabbed()){var L=z._private.position;if(I.push(z),e.is.number(b[0])&&e.is.number(b[1])&&(L.x+=b[0],L.y+=b[1],N)){var R=t.hoverData.dragDelta;e.is.number(R[0])&&e.is.number(R[1])&&(L.x+=R[0],L.y+=R[1])}}}t.hoverData.draggingEles=!0;var V=new e.Collection(h,I);V.updateCompoundBounds(),V.trigger("position drag"),g[r.DRAG]=!0,t.redraw()}else P();n=!0}return f[2]=v[0],f[3]=v[1],n?(i.stopPropagation&&i.stopPropagation(),i.preventDefault&&i.preventDefault(),!1):void 0},1e3/30,{trailing:!0}),!1),t.registerBinding(window,"mouseup",function(i){var n=t.hoverData.capture;if(n){t.hoverData.capture=!1;var a=t.data.cy,s=t.projectIntoViewport(i.clientX,i.clientY),l=t.data.select,u=t.findNearestElement(s[0],s[1],!0,!1),c=t.dragData.possibleDragElements,d=t.hoverData.down,h=i.shiftKey,p=t.data.canvasNeedsRedraw;if(t.data.bgActivePosistion&&(p[r.SELECT_BOX]=!0,t.redraw()),t.data.bgActivePosistion=void 0,clearTimeout(t.bgActiveTimeout),d&&d.unactivate(),3===t.hoverData.which){var v=new e.Event(i,{type:"cxttapend",cyPosition:{x:s[0],y:s[1]}});if(d?d.trigger(v):a.trigger(v),!t.hoverData.cxtDragged){var f=new e.Event(i,{type:"cxttap",cyPosition:{x:s[0],y:s[1]}});d?d.trigger(f):a.trigger(f)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else{if(null!=d||t.dragData.didDrag||t.hoverData.dragged||(a.$(function(){return this.selected()}).unselect(),c.length>0&&(p[r.NODE]=!0),t.dragData.possibleDragElements=c=[]),null!=u?u.trigger(new e.Event(i,{type:"mouseup",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(i,{type:"tapend",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(i,{type:"vmouseup",cyPosition:{x:s[0],y:s[1]}})):null==u&&a.trigger(new e.Event(i,{type:"mouseup",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(i,{type:"tapend",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(i,{type:"vmouseup",cyPosition:{x:s[0],y:s[1]}})),t.dragData.didDrag||t.hoverData.dragged||(null!=u?u.trigger(new e.Event(i,{type:"click",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(i,{type:"tap",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(i,{type:"vclick",cyPosition:{x:s[0],y:s[1]}})):null==u&&a.trigger(new e.Event(i,{type:"click",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(i,{type:"tap",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(i,{type:"vclick",cyPosition:{x:s[0],y:s[1]}}))),u!=d||t.dragData.didDrag||null!=u&&u._private.selectable&&(t.hoverData.dragging||("additive"===a.selectionType()||h?u.selected()?u.unselect():u.select():h||(a.$(":selected").unmerge(u).unselect(),u.select())),p[r.NODE]=!0),t.hoverData.selecting&&a.boxSelectionEnabled()&&Math.pow(l[2]-l[0],2)+Math.pow(l[3]-l[1],2)>7&&l[4]){var g=[],y=t.getAllInBox(l[0],l[1],l[2],l[3]);p[r.SELECT_BOX]=!0,y.length>0&&(p[r.NODE]=!0);for(var m=0;m<y.length;m++)y[m]._private.selectable&&g.push(y[m]);var x=new e.Collection(a,g);"additive"===a.selectionType()?x.select():(h||a.$(":selected").unmerge(x).unselect(),x.select()),t.redraw()}t.hoverData.dragging&&(t.hoverData.dragging=!1,p[r.SELECT_BOX]=!0,p[r.NODE]=!0,t.redraw()),l[4]||(p[r.DRAG]=!0,p[r.NODE]=!0,o(c),d&&d.trigger("free"))}l[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[]}},!1);var d=function(e){if(!t.scrollingPage){var i=t.data.cy,n=t.projectIntoViewport(e.clientX,e.clientY),a=[n[0]*i.zoom()+i.pan().x,n[1]*i.zoom()+i.pan().y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||c())return void e.preventDefault();if(i.panningEnabled()&&i.userPanningEnabled()&&i.zoomingEnabled()&&i.userZoomingEnabled()){e.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.data.canvasNeedsRedraw[r.NODE]=!0,t.redraw()},150);var o=e.deltaY/-250||e.wheelDeltaY/1e3||e.wheelDelta/1e3;o*=t.wheelSensitivity;var s=1===e.deltaMode;s&&(o*=33),i.zoom({
level:i.zoom()*Math.pow(10,o),renderedPosition:{x:a[0],y:a[1]}})}}};t.registerBinding(t.data.container,"wheel",d,!0),t.registerBinding(window,"scroll",function(e){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.data.container,"mouseout",function(r){var i=t.projectIntoViewport(r.clientX,r.clientY);t.data.cy.trigger(new e.Event(r,{type:"mouseout",cyPosition:{x:i[0],y:i[1]}}))},!1),t.registerBinding(t.data.container,"mouseover",function(r){var i=t.projectIntoViewport(r.clientX,r.clientY);t.data.cy.trigger(new e.Event(r,{type:"mouseover",cyPosition:{x:i[0],y:i[1]}}))},!1);var h,p,v,f,g,y,m,x,b,w,_,E,S,D=function(e,t,r,i){return Math.sqrt((r-e)*(r-e)+(i-t)*(i-t))},k=function(e,t,r,i){return(r-e)*(r-e)+(i-t)*(i-t)};t.registerBinding(t.data.container,"touchstart",function(i){clearTimeout(this.threeFingerSelectTimeout),i.target!==t.data.link&&i.preventDefault(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var n=t.data.cy,o=t.getCachedNodes(),s=t.getCachedEdges(),l=t.touchData.now,u=t.touchData.earlier,c=t.data.canvasNeedsRedraw;if(i.touches[0]){var d=t.projectIntoViewport(i.touches[0].clientX,i.touches[0].clientY);l[0]=d[0],l[1]=d[1]}if(i.touches[1]){var d=t.projectIntoViewport(i.touches[1].clientX,i.touches[1].clientY);l[2]=d[0],l[3]=d[1]}if(i.touches[2]){var d=t.projectIntoViewport(i.touches[2].clientX,i.touches[2].clientY);l[4]=d[0],l[5]=d[1]}if(i.touches[1]){var T=function(e){for(var t=0;t<e.length;t++)e[t]._private.grabbed=!1,e[t]._private.rscratch.inDragLayer=!1,e[t].active()&&e[t].unactivate()};T(o),T(s);var P=t.findContainerClientCoords();b=P[0],w=P[1],_=P[2],E=P[3],h=i.touches[0].clientX-b,p=i.touches[0].clientY-w,v=i.touches[1].clientX-b,f=i.touches[1].clientY-w,S=h>=0&&_>=h&&v>=0&&_>=v&&p>=0&&E>=p&&f>=0&&E>=f;var C=n.pan(),M=n.zoom();g=D(h,p,v,f),y=k(h,p,v,f),m=[(h+v)/2,(p+f)/2],x=[(m[0]-C.x)/M,(m[1]-C.y)/M];var B=200,N=B*B;if(N>y&&!i.touches[2]){var I=t.findNearestElement(l[0],l[1],!0,!0),O=t.findNearestElement(l[2],l[3],!0,!0);return I&&I.isNode()?(I.activate().trigger(new e.Event(i,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),t.touchData.start=I):O&&O.isNode()?(O.activate().trigger(new e.Event(i,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),t.touchData.start=O):(n.trigger(new e.Event(i,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),t.touchData.start=null),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,void t.redraw()}}if(i.touches[2]);else if(i.touches[1]);else if(i.touches[0]){var z=t.findNearestElement(l[0],l[1],!0,!0);if(null!=z){if(z.activate(),t.touchData.start=z,z.isNode()&&t.nodeIsDraggable(z)){var L=t.dragData.touchDragEles=[];if(c[r.NODE]=!0,c[r.DRAG]=!0,z.selected())for(var R=n.$(function(){return this.isNode()&&this.selected()}),V=0;V<R.length;V++){var A=R[V];t.nodeIsDraggable(A)&&a(A,{addToList:L})}else a(z,{addToList:L});z.trigger(new e.Event(i,{type:"grab",cyPosition:{x:l[0],y:l[1]}}))}z.trigger(new e.Event(i,{type:"touchstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(i,{type:"tapstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(i,{type:"vmousdown",cyPosition:{x:l[0],y:l[1]}}))}null==z&&(n.trigger(new e.Event(i,{type:"touchstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(i,{type:"tapstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(i,{type:"vmousedown",cyPosition:{x:l[0],y:l[1]}})),t.data.bgActivePosistion={x:d[0],y:d[1]},c[r.SELECT_BOX]=!0,t.redraw());for(var X=0;X<l.length;X++)u[X]=l[X],t.touchData.startPosition[X]=l[X];t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved!==!1||t.pinching||(t.touchData.start?t.touchData.start.trigger(new e.Event(i,{type:"taphold",cyPosition:{x:l[0],y:l[1]}})):(t.data.cy.trigger(new e.Event(i,{type:"taphold",cyPosition:{x:l[0],y:l[1]}})),n.$(":selected").unselect()))},t.tapholdDuration)}},!1),t.registerBinding(window,"touchmove",e.util.throttle(function(i){var n=t.data.select,o=t.touchData.capture;o&&i.preventDefault();var s=t.data.cy,l=t.touchData.now,u=t.touchData.earlier,c=s.zoom(),d=t.data.canvasNeedsRedraw;if(i.touches[0]){var m=t.projectIntoViewport(i.touches[0].clientX,i.touches[0].clientY);l[0]=m[0],l[1]=m[1]}if(i.touches[1]){var m=t.projectIntoViewport(i.touches[1].clientX,i.touches[1].clientY);l[2]=m[0],l[3]=m[1]}if(i.touches[2]){var m=t.projectIntoViewport(i.touches[2].clientX,i.touches[2].clientY);l[4]=m[0],l[5]=m[1]}for(var _=[],E=0;E<l.length;E++)_[E]=l[E]-u[E];var T=t.touchData.startPosition,P=l[0]-T[0],C=P*P,M=l[1]-T[1],B=M*M,N=C+B,I=N*c*c;if(o&&t.touchData.cxt){var O=i.touches[0].clientX-b,z=i.touches[0].clientY-w,L=i.touches[1].clientX-b,R=i.touches[1].clientY-w,V=k(O,z,L,R),A=V/y,X=150,F=X*X,Y=1.5,q=Y*Y;if(A>=q||V>=F){t.touchData.cxt=!1,t.touchData.start&&(t.touchData.start.unactivate(),t.touchData.start=null),t.data.bgActivePosistion=void 0,d[r.SELECT_BOX]=!0;var j=new e.Event(i,{type:"cxttapend",cyPosition:{x:l[0],y:l[1]}});t.touchData.start?t.touchData.start.trigger(j):s.trigger(j)}}if(o&&t.touchData.cxt){var j=new e.Event(i,{type:"cxtdrag",cyPosition:{x:l[0],y:l[1]}});t.data.bgActivePosistion=void 0,d[r.SELECT_BOX]=!0,t.touchData.start?t.touchData.start.trigger(j):s.trigger(j),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var $=t.findNearestElement(l[0],l[1],!0,!0);t.touchData.cxtOver&&$===t.touchData.cxtOver||(t.touchData.cxtOver&&t.touchData.cxtOver.trigger(new e.Event(i,{type:"cxtdragout",cyPosition:{x:l[0],y:l[1]}})),t.touchData.cxtOver=$,$&&$.trigger(new e.Event(i,{type:"cxtdragover",cyPosition:{x:l[0],y:l[1]}})))}else if(o&&i.touches[2]&&s.boxSelectionEnabled())t.data.bgActivePosistion=void 0,clearTimeout(this.threeFingerSelectTimeout),this.lastThreeTouch=+new Date,t.touchData.selecting=!0,d[r.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,t.touchData.selecting=!0,t.redraw();else if(o&&i.touches[1]&&s.zoomingEnabled()&&s.panningEnabled()&&s.userZoomingEnabled()&&s.userPanningEnabled()){t.data.bgActivePosistion=void 0,d[r.SELECT_BOX]=!0;var W=t.dragData.touchDragEles;if(W){d[r.DRAG]=!0;for(var H=0;H<W.length;H++)W[H]._private.grabbed=!1,W[H]._private.rscratch.inDragLayer=!1}var O=i.touches[0].clientX-b,z=i.touches[0].clientY-w,L=i.touches[1].clientX-b,R=i.touches[1].clientY-w,Z=D(O,z,L,R),U=Z/g;if(1!=U&&S){var G=O-h,K=z-p,J=L-v,Q=R-f,ee=(G+J)/2,te=(K+Q)/2,re=s.zoom(),ie=re*U,ne=s.pan(),ae=x[0]*re+ne.x,oe=x[1]*re+ne.y,se={x:-ie/re*(ae-ne.x-ee)+ae,y:-ie/re*(oe-ne.y-te)+oe};if(t.touchData.start){var W=t.dragData.touchDragEles;if(W)for(var H=0;H<W.length;H++){var le=W[H]._private;le.grabbed=!1,le.rscratch.inDragLayer=!1}var ue=t.touchData.start._private;ue.active=!1,ue.grabbed=!1,ue.rscratch.inDragLayer=!1,d[r.DRAG]=!0,t.touchData.start.trigger("free").trigger("unactivate")}s.viewport({zoom:ie,pan:se,cancelOnFailedZoom:!0}),g=Z,h=O,p=z,v=L,f=R,t.pinching=!0}if(i.touches[0]){var m=t.projectIntoViewport(i.touches[0].clientX,i.touches[0].clientY);l[0]=m[0],l[1]=m[1]}if(i.touches[1]){var m=t.projectIntoViewport(i.touches[1].clientX,i.touches[1].clientY);l[2]=m[0],l[3]=m[1]}if(i.touches[2]){var m=t.projectIntoViewport(i.touches[2].clientX,i.touches[2].clientY);l[4]=m[0],l[5]=m[1]}}else if(i.touches[0]){var ce=t.touchData.start,de=t.touchData.last,$=$||t.findNearestElement(l[0],l[1],!0,!0);if(null!=ce&&"nodes"==ce._private.group&&t.nodeIsDraggable(ce))if(I>=t.touchTapThreshold2){for(var W=t.dragData.touchDragEles,he=0;he<W.length;he++){var pe=W[he];if(t.nodeIsDraggable(pe)&&pe.isNode()&&pe.grabbed()){t.dragData.didDrag=!0;var ve=pe._private.position,fe=!t.hoverData.draggingEles;if(e.is.number(_[0])&&e.is.number(_[1])&&(ve.x+=_[0],ve.y+=_[1]),fe){a(pe,{inDragLayer:!0}),d[r.NODE]=!0;var ge=t.touchData.dragDelta;e.is.number(ge[0])&&e.is.number(ge[1])&&(ve.x+=ge[0],ve.y+=ge[1])}}}var ye=new e.Collection(s,pe);ye.updateCompoundBounds(),ye.trigger("position drag"),t.hoverData.draggingEles=!0,d[r.DRAG]=!0,t.touchData.startPosition[0]==u[0]&&t.touchData.startPosition[1]==u[1]&&(d[r.NODE]=!0),t.redraw()}else{var ge=t.touchData.dragDelta=t.touchData.dragDelta||[];0===ge.length?(ge.push(_[0]),ge.push(_[1])):(ge[0]+=_[0],ge[1]+=_[1])}null!=ce&&(ce.trigger(new e.Event(i,{type:"touchmove",cyPosition:{x:l[0],y:l[1]}})),ce.trigger(new e.Event(i,{type:"tapdrag",cyPosition:{x:l[0],y:l[1]}})),ce.trigger(new e.Event(i,{type:"vmousemove",cyPosition:{x:l[0],y:l[1]}}))),null==ce&&(null!=$&&($.trigger(new e.Event(i,{type:"touchmove",cyPosition:{x:l[0],y:l[1]}})),$.trigger(new e.Event(i,{type:"tapdrag",cyPosition:{x:l[0],y:l[1]}})),$.trigger(new e.Event(i,{type:"vmousemove",cyPosition:{x:l[0],y:l[1]}}))),null==$&&(s.trigger(new e.Event(i,{type:"touchmove",cyPosition:{x:l[0],y:l[1]}})),s.trigger(new e.Event(i,{type:"tapdrag",cyPosition:{x:l[0],y:l[1]}})),s.trigger(new e.Event(i,{type:"vmousemove",cyPosition:{x:l[0],y:l[1]}})))),$!=de&&(de&&de.trigger(new e.Event(i,{type:"tapdragout",cyPosition:{x:l[0],y:l[1]}})),$&&$.trigger(new e.Event(i,{type:"tapdragover",cyPosition:{x:l[0],y:l[1]}}))),t.touchData.last=$;for(var H=0;H<l.length;H++)l[H]&&t.touchData.startPosition[H]&&Math.abs(l[H]-t.touchData.startPosition[H])>4&&(t.touchData.singleTouchMoved=!0);if(o&&(null==ce||ce.isEdge())&&s.panningEnabled()&&s.userPanningEnabled()){t.swipePanning?s.panBy({x:_[0]*c,y:_[1]*c}):I>=t.touchTapThreshold2&&(t.swipePanning=!0,s.panBy({x:P*c,y:M*c})),ce&&(ce.unactivate(),t.data.bgActivePosistion||(t.data.bgActivePosistion={x:l[0],y:l[1]}),d[r.SELECT_BOX]=!0,t.touchData.start=null);var m=t.projectIntoViewport(i.touches[0].clientX,i.touches[0].clientY);l[0]=m[0],l[1]=m[1]}}for(var E=0;E<l.length;E++)u[E]=l[E]},1e3/30,{trailing:!0}),!1),t.registerBinding(window,"touchcancel",function(e){var r=t.touchData.start;t.touchData.capture=!1,r&&r.unactivate()}),t.registerBinding(window,"touchend",function(i){var n=t.touchData.start,a=t.touchData.capture;if(a){t.touchData.capture=!1,i.preventDefault();var s=t.data.select;t.swipePanning=!1,t.hoverData.draggingEles=!1;var l=t.data.cy,u=l.zoom(),c=t.touchData.now,d=t.touchData.earlier,h=t.data.canvasNeedsRedraw;if(i.touches[0]){var p=t.projectIntoViewport(i.touches[0].clientX,i.touches[0].clientY);c[0]=p[0],c[1]=p[1]}if(i.touches[1]){var p=t.projectIntoViewport(i.touches[1].clientX,i.touches[1].clientY);c[2]=p[0],c[3]=p[1]}if(i.touches[2]){var p=t.projectIntoViewport(i.touches[2].clientX,i.touches[2].clientY);c[4]=p[0],c[5]=p[1]}n&&n.unactivate();var v;if(t.touchData.cxt){if(v=new e.Event(i,{type:"cxttapend",cyPosition:{x:c[0],y:c[1]}}),n?n.trigger(v):l.trigger(v),!t.touchData.cxtDragged){var f=new e.Event(i,{type:"cxttap",cyPosition:{x:c[0],y:c[1]}});n?n.trigger(f):l.trigger(f)}return t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,void t.redraw()}if(!i.touches[2]&&l.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1,clearTimeout(this.threeFingerSelectTimeout);var g=[],y=t.getAllInBox(s[0],s[1],s[2],s[3]);s[0]=void 0,s[1]=void 0,s[2]=void 0,s[3]=void 0,s[4]=0,h[r.SELECT_BOX]=!0;for(var m=0;m<y.length;m++)y[m]._private.selectable&&g.push(y[m]);var x=new e.Collection(l,g);"single"===l.selectionType()&&l.$(":selected").unmerge(x).unselect(),x.select(),x.length>0?h[r.NODE]=!0:t.redraw()}var b=!1;if(null!=n&&(n._private.active=!1,b=!0,n.unactivate()),i.touches[2])t.data.bgActivePosistion=void 0,h[r.SELECT_BOX]=!0;else if(i.touches[1]);else if(i.touches[0]);else if(!i.touches[0]){t.data.bgActivePosistion=void 0,h[r.SELECT_BOX]=!0;var w=t.dragData.touchDragEles;if(null!=n){var _=n._private.grabbed;o(w),h[r.DRAG]=!0,h[r.NODE]=!0,_&&n.trigger("free"),n.trigger(new e.Event(i,{type:"touchend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(i,{type:"tapend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(i,{type:"vmouseup",cyPosition:{x:c[0],y:c[1]}})),n.unactivate(),t.touchData.start=null}else{var E=t.findNearestElement(c[0],c[1],!0,!0);null!=E&&E.trigger(new e.Event(i,{type:"touchend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(i,{type:"tapend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(i,{type:"vmouseup",cyPosition:{x:c[0],y:c[1]}})),null==E&&l.trigger(new e.Event(i,{type:"touchend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(i,{type:"tapend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(i,{type:"vmouseup",cyPosition:{x:c[0],y:c[1]}}))}var S=t.touchData.startPosition[0]-c[0],D=S*S,k=t.touchData.startPosition[1]-c[1],T=k*k,P=D+T,C=P*u*u;null!=n&&!t.dragData.didDrag&&n._private.selectable&&C<t.touchTapThreshold2&&!t.pinching&&("single"===l.selectionType()?(l.$(":selected").unmerge(n).unselect(),n.select()):n.selected()?n.unselect():n.select(),b=!0,h[r.NODE]=!0),t.touchData.singleTouchMoved===!1&&(n?n.trigger(new e.Event(i,{type:"tap",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(i,{type:"vclick",cyPosition:{x:c[0],y:c[1]}})):l.trigger(new e.Event(i,{type:"tap",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(i,{type:"vclick",cyPosition:{x:c[0],y:c[1]}}))),t.touchData.singleTouchMoved=!0}for(var M=0;M<c.length;M++)d[M]=c[M];t.dragData.didDrag=!1,0===i.touches.length&&(t.touchData.dragDelta=[]),b&&n&&n.updateStyle(!1),i.touches.length<2&&(t.pinching=!1,h[r.NODE]=!0,t.redraw())}},!1)}}(cytoscape),function(e){"use strict";function t(t,r){a[t]={points:r,draw:function(e,r,n,o,s){i.drawPolygon(e,r,n,o,s,a[t].points)},drawPath:function(e,r,n,o,s){i.drawPolygonPath(e,r,n,o,s,a[t].points)},intersectLine:function(r,i,n,o,s,l,u){return e.math.polygonIntersectLine(s,l,a[t].points,r,i,n/2,o/2,u)},intersectBox:function(r,i,n,o,s,l,u,c,d){var h=a[t].points;return e.math.boxIntersectPolygon(r,i,n,o,h,s,l,u,c,[0,-1],d)},checkPoint:function(r,i,n,o,s,l,u){return e.math.pointInsidePolygon(r,i,a[t].points,l,u,o,s,[0,-1],n)}}}for(var r=e("renderer","canvas"),i=r.prototype,n=r.usePaths(),a=r.nodeShapes={},o=Math.sin(0),s=Math.cos(0),l={},u={},c=.1,d=0*Math.PI;d<2*Math.PI;d+=c)l[d]=Math.sin(d),u[d]=Math.cos(d);a.ellipse={draw:function(e,t,r,i,n){a.ellipse.drawPath(e,t,r,i,n),e.fill()},drawPath:function(e,t,r,i,a){if(n){e.beginPath&&e.beginPath();for(var d,h,p=i/2,v=a/2,f=0*Math.PI;f<2*Math.PI;f+=c)d=t-p*l[f]*o+p*u[f]*s,h=r+v*u[f]*o+v*l[f]*s,0===f?e.moveTo(d,h):e.lineTo(d,h);e.closePath()}else e.beginPath&&e.beginPath(),e.translate(t,r),e.scale(i/2,a/2),e.arc(0,0,1,0,2*Math.PI*.999,!1),e.closePath(),e.scale(2/i,2/a),e.translate(-t,-r)},intersectLine:function(t,r,i,n,a,o,s){var l=e.math.intersectLineEllipse(a,o,t,r,i/2+s,n/2+s);return l},intersectBox:function(t,r,i,n,a,o,s,l,u){return e.math.boxIntersectEllipse(t,r,i,n,u,a,o,s,l)},checkPoint:function(e,t,r,i,n,a,o){return e-=a,t-=o,e/=i/2+r,t/=n/2+r,Math.pow(e,2)+Math.pow(t,2)<=1}},t("triangle",e.math.generateUnitNgonPointsFitToSquare(3,0)),t("square",e.math.generateUnitNgonPointsFitToSquare(4,0)),a.rectangle=a.square,a.roundrectangle={points:e.math.generateUnitNgonPointsFitToSquare(4,0),draw:function(e,t,r,n,a){i.drawRoundRectangle(e,t,r,n,a,10)},drawPath:function(e,t,r,n,a){i.drawRoundRectanglePath(e,t,r,n,a,10)},intersectLine:function(t,r,i,n,a,o,s){return e.math.roundRectangleIntersectLine(a,o,t,r,i,n,s)},intersectBox:function(t,r,i,n,a,o,s,l,u){return e.math.roundRectangleIntersectBox(t,r,i,n,a,o,s,l,u)},checkPoint:function(t,r,i,n,o,s,l){var u=e.math.getRoundRectangleRadius(n,o);if(e.math.pointInsidePolygon(t,r,a.roundrectangle.points,s,l,n,o-2*u,[0,-1],i))return!0;if(e.math.pointInsidePolygon(t,r,a.roundrectangle.points,s,l,n-2*u,o,[0,-1],i))return!0;var c=function(e,t,r,i,n,a,o){return e-=r,t-=i,e/=n/2+o,t/=a/2+o,Math.pow(e,2)+Math.pow(t,2)<=1};return c(t,r,s-n/2+u,l-o/2+u,2*u,2*u,i)?!0:c(t,r,s+n/2-u,l-o/2+u,2*u,2*u,i)?!0:c(t,r,s+n/2-u,l+o/2-u,2*u,2*u,i)?!0:c(t,r,s-n/2+u,l+o/2-u,2*u,2*u,i)?!0:!1}},t("diamond",[0,1,1,0,0,-1,-1,0]),t("pentagon",e.math.generateUnitNgonPointsFitToSquare(5,0)),t("hexagon",e.math.generateUnitNgonPointsFitToSquare(6,0)),t("heptagon",e.math.generateUnitNgonPointsFitToSquare(7,0)),t("octagon",e.math.generateUnitNgonPointsFitToSquare(8,0));var h=new Array(20),p=e.math.generateUnitNgonPoints(5,0),v=e.math.generateUnitNgonPoints(5,Math.PI/5),f=.5*(3-Math.sqrt(5));f*=1.57;for(var d=0;d<v.length/2;d++)v[2*d]*=f,v[2*d+1]*=f;for(var d=0;5>d;d++)h[4*d]=p[2*d],h[4*d+1]=p[2*d+1],h[4*d+2]=v[2*d],h[4*d+3]=v[2*d+1];h=e.math.fitPolygonToSquare(h),t("star",h),t("vee",[-1,-1,0,-.333,1,-1,0,1]),t("rhomboid",[-1,-1,.333,-1,1,1,-.333,1])}(cytoscape),function(e){"use strict";function t(t){this._private={},this._private.options=e.util.extend({},r,t)}var r={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,r=this._private.options;return e.util.require("arbor",function(i){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,i=n(e,r.nodeMass),a=e._private.locked,o=e.position(),s=p.fromScreen({x:o.x,y:o.y});e.scratch().arbor=p.addNode(t,{element:e,mass:i,fixed:a,x:a?s.x:void 0,y:a?s.y:void 0})}}function o(e){var t=e.source().id(),i=e.target().id(),a=n(e,r.edgeLength);e.scratch().arbor=p.addEdge(t,i,{length:a})}var s=r.cy,l=r.eles,u=l.nodes().not(":parent"),c=l.edges(),d=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:s.width(),h:s.height()}),h=!1;if(t.trigger({type:"layoutstart",layout:t}),void 0!==r.liveUpdate&&(r.animate=r.liveUpdate),l.nodes().size()<=1)return r.fit&&s.reset(),l.nodes().position({x:Math.round((d.x1+d.x2)/2),y:Math.round((d.y1+d.y2)/2)}),t.one("layoutready",r.ready),t.trigger({type:"layoutready",layout:t}),t.one("layoutstop",r.stop),void t.trigger({type:"layoutstop",layout:t});var p=t._private.system=i.ParticleSystem();p.parameters({repulsion:r.repulsion,stiffness:r.stiffness,friction:r.friction,gravity:r.gravity,fps:r.fps,dt:r.dt,precision:r.precision}),r.animate&&r.fit&&s.fit(d,r.padding);var v,f=250,g=!1,y=+new Date,m={init:function(e){},redraw:function(){var e=p.energy();if(!r.infinite&&null!=r.stableEnergy&&null!=e&&e.n>0&&r.stableEnergy(e))return void t.stop();r.infinite||f==1/0||(clearTimeout(v),v=setTimeout(D,f));var i=s.collection();p.eachNode(function(e,t){var r=e.data,n=r.element;null!=n&&(n.locked()||n.grabbed()||(n.silentPosition({x:d.x1+t.x,y:d.y1+t.y}),i.merge(n)))}),r.animate&&i.length>0&&(h=!0,i.rtrigger("position"),r.fit&&s.fit(r.padding),y=+new Date,h=!1),g||(g=!0,t.one("layoutready",r.ready),t.trigger({type:"layoutready",layout:t}))}};p.renderer=m,p.screenSize(d.w,d.h),p.screenPadding(r.padding,r.padding,r.padding,r.padding),p.screenStep(r.stepSize);var x;u.on("grab free position",x=function(e){if(!h){var t=this.position(),n=p.fromScreen(t);if(n){var a=i.Point(n.x,n.y),o=r.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(e){node.scratch().arbor.fixed=node.locked()});var w;l.on("remove",w=function(e){});var _;s.on("add","*",_=function(){});var E;s.on("resize",E=function(){if(null==r.boundingBox&&null!=t._private.system){var e=s.width(),i=s.height();p.screenSize(e,i)}}),u.each(function(e,t){a(t)}),c.each(function(e,t){o(t)});var S=u.filter(":grabbable");r.ungrabifyWhileSimulating&&S.ungrabify();var D=t._private.doneHandler=function(){t._private.doneHandler=null,r.animate||(r.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),r.ungrabifyWhileSimulating&&S.grabify(),t.one("layoutstop",r.stop),t.trigger({type:"layoutstop",layout:t})};p.start(),!r.infinite&&null!=r.maxSimulationTime&&r.maxSimulationTime>0&&r.maxSimulationTime!==1/0&&setTimeout(function(){t.stop()},r.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({},r,t)}var r={fit:!0,directed:!1,padding:30,circle:!1,spacingFactor:1.75,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,r=this.options,i=r,n=r.cy,a=i.eles,o=a.nodes().not(":parent"),s=a,l=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(e.is.elementOrCollection(i.roots))t=i.roots;else if(e.is.array(i.roots)){for(var u=[],c=0;c<i.roots.length;c++){var d=i.roots[c],h=n.getElementById(d);u.push(h)}t=new e.Collection(n,u)}else if(e.is.string(i.roots))t=n.$(i.roots);else if(i.directed)t=o.roots();else{for(var p=[],v=o;v.length>0;){var f=n.collection();a.bfs({roots:v[0],visit:function(e,t,r,i,n){f=f.add(r)},directed:!1}),v=v.not(f),p.push(f)}t=n.collection();for(var c=0;c<p.length;c++){var g=p[c],y=g.maxDegree(!1),m=g.filter(function(){return this.degree(!1)===y});t=t.add(m)}}var x=[],b={},w={},_={},E={},S={};s.bfs({roots:t,directed:i.directed,visit:function(e,t,r,i,n){var a=this[0],o=a.id();if(x[t]||(x[t]=[]),x[t].push(a),b[o]=!0,w[o]=t,_[o]=n,E[o]=i,n){var s=n.id(),l=S[s]=S[s]||[];l.push(r)}}});for(var D=[],c=0;c<o.length;c++){var h=o[c];b[h.id()]||D.push(h)}for(var k=3*D.length,T=0;0!==D.length&&k>T;){for(var P=D.shift(),C=P.neighborhood().nodes(),M=!1,c=0;c<C.length;c++){var B=w[C[c].id()];if(void 0!==B){x[B].push(P),M=!0;break}}M||D.push(P),T++}for(;0!==D.length;){var P=D.shift(),M=!1;M||(0===x.length&&x.push([]),x[0].push(P))}var N=function(){for(var e=0;e<x.length;e++)for(var t=x[e],r=0;r<t.length;r++){var i=t[r];i._private.scratch.breadthfirst={depth:e,index:r}}};N();for(var I=function(e){for(var t,r=e.connectedEdges(function(){return this.data("target")===e.id()}),i=e._private.scratch.breadthfirst,n=0,a=0;a<r.length;a++){var o=r[a],s=o.source()[0],l=s._private.scratch.breadthfirst;i.depth<=l.depth&&n<l.depth&&(n=l.depth,t=s)}return t},O=0;O<i.maximalAdjustments;O++){for(var z=x.length,L=[],c=0;z>c;c++)for(var B=x[c],R=B.length,V=0;R>V;V++){var h=B[V],A=h._private.scratch.breadthfirst,X=I(h);X&&(A.intEle=X,L.push(h))}for(var c=0;c<L.length;c++){var h=L[c],A=h._private.scratch.breadthfirst,X=A.intEle,F=X._private.scratch.breadthfirst;x[A.depth].splice(A.index,1);for(var Y=F.depth+1;Y>x.length-1;)x.push([]);x[Y].push(h),A.depth=Y,A.index=x[Y].length-1}N()}var q=0;if(i.avoidOverlap){for(var c=0;c<o.length;c++){var j=o[c].outerWidth(),$=o[c].outerHeight();q=Math.max(q,j,$)}q*=i.spacingFactor}for(var W={},H=function(e){if(W[e.id()])return W[e.id()];for(var t=e._private.scratch.breadthfirst.depth,r=e.neighborhood().nodes().not(":parent"),i=0,n=0,a=0;a<r.length;a++){var o=r[a],s=o._private.scratch.breadthfirst,l=s.index,u=s.depth,c=x[u].length;(t>u||0===t)&&(i+=l/c,n++)}return n=Math.max(1,n),i/=n,0===n&&(i=void 0),W[e.id()]=i,i},Z=function(e,t){var r=H(e),i=H(t);return r-i},U=0;3>U;U++){for(var c=0;c<x.length;c++)x[c]=x[c].sort(Z);N()}for(var G=0,c=0;c<x.length;c++)G=Math.max(x[c].length,G);for(var K={x:l.x1+l.w/2,y:l.x1+l.h/2},J=function(e,t){var r=e._private.scratch.breadthfirst,n=r.depth,a=r.index,o=x[n].length,s=Math.max(l.w/(o+1),q),u=Math.max(l.h/(x.length+1),q),c=Math.min(l.w/2/x.length,l.h/2/x.length);if(c=Math.max(c,q),i.circle){if(i.circle){var d=c*n+c-(x.length>0&&x[0].length<=3?c/2:0),h=2*Math.PI/x[n].length*a;return 0===n&&1===x[0].length&&(d=1),{x:K.x+d*Math.cos(h),y:K.y+d*Math.sin(h)}}return{x:K.x+(a+1-(o+1)/2)*s,y:(n+1)*u}}var p={x:K.x+(a+1-(o+1)/2)*s,y:(n+1)*u};return t?p:p},Q={},c=x.length-1;c>=0;c--)for(var B=x[c],V=0;V<B.length;V++){var P=B[V];Q[P.id()]=J(P,c===x.length-1)}return o.layoutPositions(this,i,function(){return Q[this.id()]}),this},e("layout","breadthfirst",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},r,t)}var r={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,radius:void 0,startAngle:1.5*Math.PI,counterclockwise:!1,sort:void 0,animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){var t=this.options,r=t,i=t.cy,n=r.eles,a=n.nodes().not(":parent");r.sort&&(a=a.sort(r.sort));for(var o,s=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:i.width(),h:i.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=r.startAngle,c=2*Math.PI/a.length,d=0,h=0;h<a.length;h++){var p=a[h].outerWidth(),v=a[h].outerHeight();d=Math.max(d,p,v)}if(o=e.is.number(r.radius)?r.radius:a.length<=1?0:Math.min(s.h,s.w)/2-d,a.length>1&&r.avoidOverlap){d*=1.75;var c=2*Math.PI/a.length,f=Math.cos(c)-Math.cos(0),g=Math.sin(c)-Math.sin(0),y=Math.sqrt(d*d/(f*f+g*g));o=Math.max(y,o)}var m=function(e,t){var i=o*Math.cos(u),n=o*Math.sin(u),a={x:l.x+i,y:l.y+n};return u=r.counterclockwise?u-c:u+c,a};return a.layoutPositions(this,r,m),this},e("layout","circle",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},r,t)}var r={animate:!0,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(e){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,r=this.options;return t.manuallyStopped=!1,e.util.require("cola",function(i){var n=r.cy,a=r.eles,o=a.nodes(),s=a.edges(),l=!1,u=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),c=function(t,r){if(e.is.fn(t)){var i=t;return i.apply(r,[r])}return t},d=function(){for(var t={min:1/0,max:-(1/0)},i={min:1/0,max:-(1/0)},a=0;a<o.length;a++){var s=o[a],d=s._private.scratch.cola;if(t.min=Math.min(t.min,d.x||0),t.max=Math.max(t.max,d.x||0),i.min=Math.min(i.min,d.y||0),i.max=Math.max(i.max,d.y||0),!d.updatedDims){var h=s.boundingBox(),v=c(r.nodeSpacing,s);d.width=h.w+2*v,d.height=h.h+2*v}}o.positions(function(r,n){var a,o=n._private.scratch.cola;return n.grabbed()||n.isParent()||(a={x:u.x1+o.x-t.min,y:u.y1+o.y-i.min},e.is.number(a.x)&&e.is.number(a.y)||(a=void 0)),a}),o.updateCompoundBounds(),l||(p(),l=!0),r.fit&&n.fit(r.padding)},h=function(){r.ungrabifyWhileSimulating&&y.grabify(),o.off("grab free position",m),o.off("lock unlock",x),t.one("layoutstop",r.stop),t.trigger({type:"layoutstop",layout:t})},p=function(){t.one("layoutready",r.ready),t.trigger({type:"layoutready",layout:t})},v=r.refresh,f=1;r.refresh<0?(f=Math.abs(r.refresh),v=1):v=Math.max(1,v);var g=t.adaptor=i.adaptor({trigger:function(e){var t=i.EventType?i.EventType.tick:null,n=i.EventType?i.EventType.end:null;switch(e.type){case"tick":case t:r.animate&&d();break;case"end":case n:d(),r.infinite||h()}},kick:function(){var i=function(){if(t.manuallyStopped)return h(),!0;var e=g.tick();return e&&r.infinite&&g.resume(),e},n=function(){for(var e,t=0;v>t&&!e;t++)e=e||i();return e};if(r.animate){var a=function(){n()||e.util.requestAnimationFrame(a)};e.util.requestAnimationFrame(a)}else for(;!i(););},on:function(e,t){},drag:function(){}});t.adaptor=g;var y=o.filter(":grabbable");r.ungrabifyWhileSimulating&&y.ungrabify();var m;o.on("grab free position",m=function(t){var r=this,i=r._private.scratch.cola,n=r._private.position;switch(r.grabbed()?(i.x=n.x-u.x1,i.y=n.y-u.y1,g.dragstart(i)):e.is.number(i.x)&&e.is.number(i.y)&&(n.x=i.x+u.x1,n.y=i.y+u.y1),t.type){case"grab":g.dragstart(i),g.resume();break;case"free":g.dragend(i)}});var x;o.on("lock unlock",x=function(e){var t=this,r=t._private.scratch.cola;t.locked()?g.dragstart(r):g.dragend(r)});var b=o.stdFilter(function(e){return!e.isParent()});if(g.nodes(b.map(function(e,t){var i=c(r.nodeSpacing,e),n=e.position(),a=e.boundingBox(),o=e._private.scratch.cola={x:r.randomize||void 0===n.x?Math.round(Math.random()*u.w):n.x,y:r.randomize||void 0===n.y?Math.round(Math.random()*u.h):n.y,width:a.w+2*i,height:a.h+2*i,index:t};return o})),r.alignment){var w=[],_=[];b.forEach(function(e){var t=c(r.alignment,e),i=e._private.scratch.cola,n=i.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){var i=e._private.style,n=c(r.nodeSpacing,e),a=i["padding-left"].pxValue+n,o=i["padding-right"].pxValue+n,s=i["padding-top"].pxValue+n,l=i["padding-bottom"].pxValue+n;return e._private.scratch.cola={index:t,padding:Math.max(a,o,s,l),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,D;null!=r.edgeLength?(S=r.edgeLength,D="linkDistance"):null!=r.edgeSymDiffLength?(S=r.edgeSymDiffLength,D="symmetricDiffLinkLengths"):null!=r.edgeJaccardLength?(S=r.edgeJaccardLength,D="jaccardLinkLengths"):(S=100,D="linkDistance");var k=function(e){return e.calcLength};if(g.links(s.stdFilter(function(e){return!e.source().isParent()&&!e.target().isParent()}).map(function(e,t){var r=e._private.scratch.cola={source:e.source()[0]._private.scratch.cola.index,target:e.target()[0]._private.scratch.cola.index};return null!=S&&(r.calcLength=c(S,e)),r})),g.size([u.w,u.h]),null!=S&&g[D](k),r.flow){var T,P="y",C=50;e.is.string(r.flow)?T={axis:r.flow,minSeparation:C}:e.is.number(r.flow)?T={axis:P,minSeparation:r.flow}:e.is.plainObject(r.flow)?(T=r.flow,T.axis=T.axis||P,T.minSeparation=null!=T.minSeparation?T.minSeparation:C):T={axis:P,minSeparation:C},g.flowLayout(T.axis,T.minSeparation)}t.trigger({type:"layoutstart",layout:t}),g.avoidOverlaps(r.avoidOverlap).handleDisconnected(r.handleDisconnected).start(r.unconstrIter,r.userConstIter,r.allConstIter),r.infinite||setTimeout(function(){t.manuallyStopped||g.stop()},r.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({},r,t)}var r={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(e){return e.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,r=t,i=t.cy,n=r.eles,a=n.nodes().not(":parent"),o=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:i.width(),h:i.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=[],u=r.startAngle,c=0,d=0;d<a.length;d++){var h,p=a[d];h=r.concentric.apply(p,[p]),l.push({value:h,node:p}),p._private.scratch.concentric=h}a.updateStyle();for(var d=0;d<a.length;d++){var p=a[d];c=Math.max(c,p.outerWidth(),p.outerHeight())}l.sort(function(e,t){return t.value-e.value});for(var v=r.levelWidth(a),f=[[]],g=f[0],d=0;d<l.length;d++){var y=l[d];if(g.length>0){var m=Math.abs(g[0].value-y.value);m>=v&&(g=[],f.push(g))}g.push(y)}var x={},b=0,w=c+r.minNodeSpacing;if(!r.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;d<f.length;d++){var D=f[d],k=2*Math.PI/D.length;if(D.length>1&&r.avoidOverlap){var T=Math.cos(k)-Math.cos(0),P=Math.sin(k)-Math.sin(0),C=Math.sqrt(w*w/(T*T+P*P));b=Math.max(C,b)}for(var M=0;M<D.length;M++){var y=D[M],u=r.startAngle+(r.counterclockwise?-1:1)*k*M,B={x:s.x+b*Math.cos(u),y:s.y+b*Math.sin(u)};x[y.node.id()]=B}b+=w}return a.layoutPositions(this,r,function(){var e=this.id();return x[e]}),this},e("layout","concentric",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},i,t)}var r,i={ready:function(){},stop:function(){},animate:!0,refresh:4,fit:!0,padding:30,boundingBox:void 0,randomize:!0,debug:!1,nodeRepulsion:4e5,nodeOverlap:10,idealEdgeLength:10,edgeElasticity:100,nestingFactor:5,gravity:250,numIter:100,initialTemp:200,coolingFactor:.95,minTemp:1};t.prototype.run=function(){var t=this.options,i=t.cy,a=this;a.stopped=!1,a.trigger({type:"layoutstart",layout:a}),r=!0===t.debug?!0:!1;var o=new Date,d=n(i,a,t);r&&s(d),!0===t.randomize&&l(d,i),m(d,i,t);var h=function(e){return a.stopped?!1:(c(d,i,t,e),d.temperature=d.temperature*t.coolingFactor,d.temperature<t.minTemp?!1:!0)},p=function(){u(d,i,t),!0===t.fit&&i.fit(t.padding);var e=new Date;console.info("Layout took "+(e-o)+" ms"),a.one("layoutstop",t.stop),a.trigger({type:"layoutstop",layout:a})};if(t.animate){var v=0,f=function(){for(var r,n=0;n<t.refresh&&v<t.numIter;){var r=h(v);if(r===!1)break;n++,v++}u(d,i,t),t.fit&&i.fit(t.padding),r!==!1&&v+1<t.numIter?e.util.requestAnimationFrame(f):p()};e.util.requestAnimationFrame(f)}else{for(var v=0;v<t.numIter&&h(v)!==!1;v++);p()}return this},t.prototype.stop=function(){return this.stopped=!0,this};var n=function(t,r,i){for(var n=i.eles.edges(),o=i.eles.nodes(),s={layout:r,layoutNodes:[],idToIndex:{},nodeSize:o.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:i.initialTemp,clientWidth:t.width(),clientHeight:t.width(),boundingBox:e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()})},l=0;l<s.nodeSize;l++){var u={};u.id=o[l].data("id"),u.parentId=o[l].data("parent"),u.children=[],u.positionX=o[l].position("x"),u.positionY=o[l].position("y"),u.offsetX=0,u.offsetY=0,u.height=o[l].height(),u.width=o[l].width(),u.maxX=u.positionX+u.width/2,u.minX=u.positionX-u.width/2,u.maxY=u.positionY+u.height/2,u.minY=u.positionY-u.height/2,u.padLeft=o[l]._private.style["padding-left"].pxValue,u.padRight=o[l]._private.style["padding-right"].pxValue,u.padTop=o[l]._private.style["padding-top"].pxValue,u.padBottom=o[l]._private.style["padding-bottom"].pxValue,s.layoutNodes.push(u),s.idToIndex[u.id]=l}for(var c=[],d=0,h=-1,p=[],l=0;l<s.nodeSize;l++){var v=s.layoutNodes[l],f=v.parentId;null!=f?s.layoutNodes[s.idToIndex[f]].children.push(v.id):(c[++h]=v.id,p.push(v.id))}for(s.graphSet.push(p);h>=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;l<x.length;l++)c[++h]=x[l]}}for(var l=0;l<s.graphSet.length;l++)for(var b=s.graphSet[l],w=0;w<b.length;w++){var _=s.idToIndex[b[w]];s.indexToGraph[_]=l}for(var l=0;l<s.edgeSize;l++){var E=n[l],S={};S.id=E.data("id"),S.sourceId=E.data("source"),S.targetId=E.data("target");var D=i.idealEdgeLength,k=s.idToIndex[S.sourceId],T=s.idToIndex[S.targetId],P=s.indexToGraph[k],C=s.indexToGraph[T];if(P!=C){for(var M=a(S.sourceId,S.targetId,s),B=s.graphSet[M],N=0,u=s.layoutNodes[k];-1===$.inArray(u.id,B);)u=s.layoutNodes[s.idToIndex[u.parentId]],N++;for(u=s.layoutNodes[T];-1===$.inArray(u.id,B);)u=s.layoutNodes[s.idToIndex[u.parentId]],N++;D*=N*i.nestingFactor}S.idealLength=D,s.layoutEdges.push(S)}return s},a=function(e,t,r){var i=o(e,t,0,r);return 2>i.count?0:i.graph},o=function(e,t,r,i){var n=i.graphSet[r];if(-1<$.inArray(e,n)&&-1<$.inArray(t,n))return{count:2,graph:r};for(var a=0,s=0;s<n.length;s++){var l=n[s],u=i.idToIndex[l],c=i.layoutNodes[u].children;if(0!==c.length){var d=i.indexToGraph[i.idToIndex[c[0]]],h=o(e,t,d,i);if(0!==h.count){if(1!==h.count)return h;if(a++,2===a)break}}}return{count:a,graph:r}},s=function(e){if(r){console.debug("layoutNodes:");for(var t=0;t<e.nodeSize;t++){var i=e.layoutNodes[t],n="\nindex: "+t+"\nId: "+i.id+"\nChildren: "+i.children.toString()+"\nparentId: "+i.parentId+"\npositionX: "+i.positionX+"\npositionY: "+i.positionY+"\nOffsetX: "+i.offsetX+"\nOffsetY: "+i.offsetY+"\npadLeft: "+i.padLeft+"\npadRight: "+i.padRight+"\npadTop: "+i.padTop+"\npadBottom: "+i.padBottom;console.debug(n)}console.debug("idToIndex");for(var t in e.idToIndex)console.debug("Id: "+t+"\nIndex: "+e.idToIndex[t]);console.debug("Graph Set");for(var a=e.graphSet,t=0;t<a.length;t++)console.debug("Set : "+t+": "+a[t].toString());for(var n="IndexToGraph",t=0;t<e.indexToGraph.length;t++)n+="\nIndex : "+t+" Graph: "+e.indexToGraph[t];console.debug(n),n="Layout Edges";for(var t=0;t<e.layoutEdges.length;t++){var o=e.layoutEdges[t];n+="\nEdge Index: "+t+" ID: "+o.id+" SouceID: "+o.sourceId+" TargetId: "+o.targetId+" Ideal Length: "+o.idealLength}console.debug(n),n="nodeSize: "+e.nodeSize,n+="\nedgeSize: "+e.edgeSize,n+="\ntemperature: "+e.temperature,console.debug(n)}},l=function(e,t){for(var r=e.clientWidth,i=e.clientHeight,n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];a.positionX=Math.random()*r,a.positionY=Math.random()*i}},u=function(e,t,r){var i=e.layout,n=r.eles.nodes(),a=e.boundingBox,o={x1:1/0,x2:-(1/0),y1:1/0,y2:-(1/0)};r.boundingBox&&(n.forEach(function(t){var r=e.layoutNodes[e.idToIndex[t.data("id")]];o.x1=Math.min(o.x1,r.positionX),o.x2=Math.max(o.x2,r.positionX),o.y1=Math.min(o.y1,r.positionY),o.y2=Math.max(o.y2,r.positionY)}),o.w=o.x2-o.x1,o.h=o.y2-o.y1),n.positions(function(t,i){var n=e.layoutNodes[e.idToIndex[i.data("id")]];if(r.boundingBox){var s=(n.positionX-o.x1)/o.w,l=(n.positionY-o.y1)/o.h;return{x:a.x1+s*a.w,y:a.y1+l*a.h}}return{x:n.positionX,y:n.positionY}}),!0!==e.ready&&(e.ready=!0,i.one("layoutready",r.ready),i.trigger({type:"layoutready",layout:this}))},c=function(e,t,r,i){d(e,t,r),f(e,t,r),g(e,t,r),y(e,t,r),m(e,t,r)},d=function(e,t,r){for(var i=0;i<e.graphSet.length;i++)for(var n=e.graphSet[i],a=n.length,o=0;a>o;o++)for(var s=e.layoutNodes[e.idToIndex[n[o]]],l=o+1;a>l;l++){var u=e.layoutNodes[e.idToIndex[n[l]]];h(s,u,e,t,r)}},h=function(e,t,r,i,n){var a=t.positionX-e.positionX,o=t.positionY-e.positionY;if(0!==a||0!==o){var s=v(e,t,a,o);if(s>0)var l=n.nodeOverlap*s,u=Math.sqrt(a*a+o*o),c=l*a/u,d=l*o/u;else var h=p(e,a,o),f=p(t,-1*a,-1*o),g=f.x-h.x,y=f.y-h.y,m=g*g+y*y,u=Math.sqrt(m),l=n.nodeRepulsion/m,c=l*g/u,d=l*y/u;e.offsetX-=c,e.offsetY-=d,t.offsetX+=c,t.offsetY+=d}},p=function(e,t,r){var i=e.positionX,n=e.positionY,a=e.height,o=e.width,s=r/t,l=a/o,u={};do{if(0===t&&r>0){u.x=i,u.y=n+a/2;break}if(0===t&&0>r){u.x=i,u.y=n+a/2;break}if(t>0&&s>=-1*l&&l>=s){u.x=i+o/2,u.y=n+o*r/2/t;break}if(0>t&&s>=-1*l&&l>=s){u.x=i-o/2,u.y=n-o*r/2/t;break}if(r>0&&(-1*l>=s||s>=l)){u.x=i+a*t/2/r,u.y=n+a/2;break}if(0>r&&(-1*l>=s||s>=l)){u.x=i-a*t/2/r,u.y=n-a/2;break}}while(!1);return u},v=function(e,t,r,i){if(r>0)var n=e.maxX-t.minX;else var n=t.maxX-e.minX;if(i>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,r){for(var i=0;i<e.edgeSize;i++){var n=e.layoutEdges[i],a=e.idToIndex[n.sourceId],o=e.layoutNodes[a],s=e.idToIndex[n.targetId],l=e.layoutNodes[s],u=l.positionX-o.positionX,c=l.positionY-o.positionY;if(0===u&&0===c)return;var d=p(o,u,c),h=p(l,-1*u,-1*c),v=h.x-d.x,f=h.y-d.y,g=Math.sqrt(v*v+f*f),y=Math.pow(n.idealLength-g,2)/r.edgeElasticity;if(0!==g)var m=y*v/g,x=y*f/g;else var m=0,x=0;o.offsetX+=m,o.offsetY+=x,l.offsetX-=m,l.offsetY-=x}},g=function(e,t,r){for(var i=0;i<e.graphSet.length;i++){var n=e.graphSet[i],a=n.length;if(0===i)var o=e.clientHeight/2,s=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[n[0]]],u=e.layoutNodes[e.idToIndex[l.parentId]],o=u.positionX,s=u.positionY;for(var c=0;a>c;c++){var d=e.layoutNodes[e.idToIndex[n[c]]],h=o-d.positionX,p=s-d.positionY,v=Math.sqrt(h*h+p*p);if(v>1){var f=r.gravity*h/v,g=r.gravity*p/v;d.offsetX+=f,d.offsetY+=g}}}},y=function(e,t,r){var i=[],n=0,a=-1;for(i.push.apply(i,e.graphSet[0]),a+=e.graphSet[0].length;a>=n;){var o=i[n++],s=e.idToIndex[o],l=e.layoutNodes[s],u=l.children;if(0<u.length){for(var c=l.offsetX,d=l.offsetY,h=0;h<u.length;h++){var p=e.layoutNodes[e.idToIndex[u[h]]];p.offsetX+=c,p.offsetY+=d,i[++a]=u[h]}l.offsetX=0,l.offsetY=0}}},m=function(e,t,r){for(var i=0;i<e.nodeSize;i++){var n=e.layoutNodes[i];0<n.children.length&&(n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0)}for(var i=0;i<e.nodeSize;i++){var n=e.layoutNodes[i];if(!(0<n.children.length)){var a=x(n.offsetX,n.offsetY,e.temperature);n.positionX+=a.x,n.positionY+=a.y,n.offsetX=0,n.offsetY=0,n.minX=n.positionX-n.width,n.maxX=n.positionX+n.width,n.minY=n.positionY-n.height,n.maxY=n.positionY+n.height,b(n,e)}}for(var i=0;i<e.nodeSize;i++){var n=e.layoutNodes[i];0<n.children.length&&(n.positionX=(n.maxX+n.minX)/2,n.positionY=(n.maxY+n.minY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY)}},x=function(e,t,r){var i=Math.sqrt(e*e+t*t);if(i>r)var n={x:r*e/i,y:r*t/i};else var n={x:e,y:t};return n},b=function(e,t){var r=e.parentId;if(null!=r){var i=t.layoutNodes[t.idToIndex[r]],n=!1;return(null==i.maxX||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,n=!0),(null==i.minX||e.minX-i.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,n=!0),(null==i.maxY||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,n=!0),(null==i.minY||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,n=!0),n?b(i,t):void 0}};e("layout","cose",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},r,t)}var r={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,animate:!1,animationDuration:500,boundingBox:void 0,ready:function(){},stop:function(){}};t.prototype.run=function(){var t=this.options,r=this;return e.util.require("dagre",function(i){var n=t.cy,a=t.eles,o=function(t,r){return e.is.fn(r)?r.apply(t,[t]):r},s=e.util.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=new i.graphlib.Graph({multigraph:!0,compound:!0}),u={},c=function(e,t){null!=t&&(u[e]=t)};c("nodesep",t.nodeSep),c("edgesep",t.edgeSep),c("ranksep",t.rankSep),c("rankdir",t.rankDir),l.setGraph(u),l.setDefaultEdgeLabel(function(){return{}}),l.setDefaultNodeLabel(function(){return{}});for(var d=a.nodes(),h=0;h<d.length;h++){var p=d[h];l.setNode(p.id(),{width:p.width(),height:p.height(),name:p.id()})}for(var h=0;h<d.length;h++){var p=d[h];p.isChild()&&l.setParent(p.id(),p.parent().id())}for(var v=a.edges().stdFilter(function(e){return!e.source().isParent()&&!e.target().isParent()}),h=0;h<v.length;h++){var f=v[h];l.setEdge(f.source().id(),f.target().id(),{minlen:o(f,t.minLen),weight:o(f,t.edgeWeight),name:f.id()},f.id())}i.layout(l);for(var g=l.nodes(),h=0;h<g.length;h++){var y=g[h],m=l.node(y);n.getElementById(y).scratch().dagre=m}var x;t.boundingBox?(x={x1:1/0,x2:-(1/0),y1:1/0,y2:-(1/0)},d.forEach(function(e){var t=e.scratch().dagre;x.x1=Math.min(x.x1,t.x),x.x2=Math.max(x.x2,t.x),x.y1=Math.min(x.y1,t.y),x.y2=Math.max(x.y2,t.y)}),x.w=x.x2-x.x1,x.h=x.y2-x.y1):x=s;var b=function(e){if(t.boundingBox){var r=(e.x-x.x1)/x.w,i=(e.y-x.y1)/x.h;return{x:s.x1+r*s.w,y:s.y1+i*s.h}}return e};d.layoutPositions(r,t,function(){var e=this.scratch().dagre;return b({x:e.x,y:e.y})})}),this},e("layout","dagre",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},r,t)}var r={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,rows:void 0,columns:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){var t=this.options,r=t,i=t.cy,n=r.eles,a=n.nodes().not(":parent");r.sort&&(a=a.sort(r.sort));var o=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:i.width(),h:i.height()});if(0===o.h||0===o.w)a.layoutPositions(this,r,function(){return{x:o.x1,y:o.y1}});else{var s=a.size(),l=Math.sqrt(s*o.h/o.w),u=Math.round(l),c=Math.round(o.w/o.h*l),d=function(e){if(null==e)return Math.min(u,c);var t=Math.min(u,c);t==u?u=e:c=e},h=function(e){if(null==e)return Math.max(u,c);var t=Math.max(u,c);t==u?u=e:c=e};if(null!=r.rows&&null!=r.columns)u=r.rows,c=r.columns;else if(null!=r.rows&&null==r.columns)u=r.rows,c=Math.ceil(s/u);else if(null==r.rows&&null!=r.columns)c=r.columns,u=Math.ceil(s/c);else if(c*u>s){var p=d(),v=h();(p-1)*v>=s?d(p-1):(v-1)*p>=s&&h(v-1)}else for(;s>c*u;){var p=d(),v=h();(v+1)*p>=s?h(v+1):d(p+1)}var f=o.w/c,g=o.h/u;if(r.avoidOverlap)for(var y=0;y<a.length;y++){var m=a[y],x=m.outerWidth(),b=m.outerHeight();f=Math.max(f,x),g=Math.max(g,b)}for(var w={},_=function(e,t){return w["c-"+e+"-"+t]?!0:!1},E=function(e,t){w["c-"+e+"-"+t]=!0},S=0,D=0,k=function(){D++,D>=c&&(D=0,S++)},T={},y=0;y<a.length;y++){var m=a[y],P=r.position(m);if(P&&(void 0!==P.row||void 0!==P.col)){var C={row:P.row,col:P.col};if(void 0===C.col)for(C.col=0;_(C.row,C.col);)C.col++;else if(void 0===C.row)for(C.row=0;_(C.row,C.col);)C.row++;T[m.id()]=C,E(C.row,C.col)}}var M=function(e,t){var r,i;if(t.locked()||t.isFullAutoParent())return!1;var n=T[t.id()];if(n)r=n.col*f+f/2+o.x1,i=n.row*g+g/2+o.y1;else{for(;_(S,D);)k();r=D*f+f/2+o.x1,i=S*g+g/2+o.y1,E(S,D),k()}return{x:r,y:i}};a.layoutPositions(this,r,M)}return this},e("layout","grid",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},r,t)}var r={ready:function(){},stop:function(){}};t.prototype.run=function(){{var e=this.options,t=e.eles,r=this;e.cy}return r.trigger("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",e.ready),r.trigger("layoutready"),r.one("layoutstop",e.stop),r.trigger("layoutstop"),this},t.prototype.stop=function(){return this},e("layout","null",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},r,t)}var r={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){function t(e){if(null==r.positions)return null;if(a)return r.positions.apply(e,[e]);var t=r.positions[e._private.data.id];return null==t?null:t}var r=this.options,i=r.eles,n=i.nodes(),a=e.is.fn(r.positions);return n.layoutPositions(this,r,function(e,r){var i=t(r);return r.locked()||null==i?!1:i}),this},e("layout","preset",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},r,t)}var r={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){var t=this.options,r=t.cy,i=t.eles,n=i.nodes().not(":parent"),a=e.util.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o=function(e,t){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return n.layoutPositions(this,t,o),this},e("layout","random",t)}(cytoscape),function($$){"use strict";function SpreadLayout(e){this.options=$$.util.extend({},defaults,e)}function cellCentroid(e){for(var t,r,i,n=e.halfedges,a=0,o=0,s=0,l=0;l<n.length;++l)t=n[l].getEndpoint(),r=n[l].getStartpoint(),a+=t.x*r.y,a-=t.y*r.x,i=t.x*r.y-r.x*t.y,o+=(t.x+r.x)*i,s+=(t.y+r.y)*i;return a/=2,i=6*a,{x:o/i,y:s/i}}function sitesDistance(e,t){var r=e.x-t.x,i=e.y-t.y;return Math.sqrt(r*r+i*i)}var defaults={animate:!0,ready:void 0,stop:void 0,fit:!0,minDist:20,padding:20,expandingFactor:-1,maxFruchtermanReingoldIterations:50,maxExpandIterations:4,boundingBox:void 0};SpreadLayout.prototype.run=function(){var layout=this,options=this.options;return $$.util.requires(["foograph","Voronoi"],function(foograph,Voronoi){function setPositions(e){for(var t=e.vertices,r=[],i=0;i<t.length;++i){var n=t[i];r[n.id]={x:n.x,y:n.y}}nodes.positions(function(e,t){var i=t._private.data.id,n=r[i];return{x:Math.round(simBB.x1+n.x),y:Math.round(simBB.y1+n.y)}}),options.fit&&cy.fit(options.padding),cy.nodes().rtrigger("position")}var cy=options.cy,nodes=cy.nodes(),edges=cy.edges(),cWidth=cy.width(),cHeight=cy.height(),simulationBounds=options.boundingBox?$$.util.makeBoundingBox(options.boundingBox):null,padding=options.padding,simBBFactor=Math.max(1,.8*Math.log(nodes.length));nodes.length<100&&(simBBFactor/=2),layout.trigger({type:"layoutstart",layout:layout});var simBB={x1:0,y1:0,x2:cWidth*simBBFactor,y2:cHeight*simBBFactor};simulationBounds&&(simBB.x1=simulationBounds.x1,simBB.y1=simulationBounds.y1,simBB.x2=simulationBounds.x2,simBB.y2=simulationBounds.y2),simBB.x1+=padding,simBB.y1+=padding,simBB.x2-=padding,simBB.y2-=padding;var width=simBB.x2-simBB.x1,height=simBB.y2-simBB.y1,startTime=Date.now();if(nodes.size()<=1){nodes.positions({x:Math.round((simBB.x1+simBB.x2)/2),y:Math.round((simBB.y1+simBB.y2)/2)}),options.fit&&cy.fit(options.padding);var endTime=Date.now();return console.info("Layout on "+nodes.size()+" nodes took "+(endTime-startTime)+" ms"),layout.one("layoutready",options.ready),layout.trigger("layoutready"),layout.one("layoutstop",options.stop),void layout.trigger("layoutstop")}var pData={width:width,height:height,minDist:options.minDist,expFact:options.expandingFactor,expIt:0,maxExpIt:options.maxExpandIterations,vertices:[],edges:[],startTime:startTime,maxFruchtermanReingoldIterations:options.maxFruchtermanReingoldIterations};nodes.each(function(e,t){var r=this._private.data.id;pData.vertices.push({id:r,x:0,y:0})}),edges.each(function(){var e=this.source().id(),t=this.target().id();pData.edges.push({src:e,tgt:t})});var t1=$$.Thread();t1.require(foograph,"foograph"),t1.require(Voronoi),t1.require(sitesDistance),t1.require(cellCentroid);var didLayoutReady=!1;t1.on("message",function(e){var t=e.message;options.animate&&(setPositions(t),didLayoutReady||(layout.trigger("layoutready"),didLayoutReady=!0))}),layout.one("layoutready",options.ready),t1.pass(pData).run(function(pData){function checkMinDist(e){for(var t=0,r=0;r<e.length;++r){var i=e[r];null!=i.lSite&&null!=i.rSite&&sitesDistance(i.lSite,i.rSite)<lMinDist&&++t}return t}foograph=eval("foograph"),Voronoi=eval("Voronoi");for(var lWidth=pData.width,lHeight=pData.height,lMinDist=pData.minDist,lExpFact=pData.expFact,lMaxExpIt=pData.maxExpIt,lMaxFruchtermanReingoldIterations=pData.maxFruchtermanReingoldIterations,savePositions=function(){pData.width=lWidth,pData.height=lHeight,pData.expIt=expandIteration,pData.expFact=lExpFact,pData.vertices=[];for(var e=0;e<fv.length;++e)pData.vertices.push({id:fv[e].label,x:fv[e].x,y:fv[e].y})},messagePositions=function(){broadcast(pData)},frg=new foograph.Graph("FRgraph",!1),frgNodes={},dataVertices=pData.vertices,ni=0;ni<dataVertices.length;++ni){var id=dataVertices[ni].id,v=new foograph.Vertex(id,Math.round(Math.random()*lHeight),Math.round(Math.random()*lHeight));frgNodes[id]=v,frg.insertVertex(v)}for(var dataEdges=pData.edges,ei=0;ei<dataEdges.length;++ei){var srcNodeId=dataEdges[ei].src,tgtNodeId=dataEdges[ei].tgt;frg.insertEdge("",1,frgNodes[srcNodeId],frgNodes[tgtNodeId])}var fv=frg.vertices,iterations=lMaxFruchtermanReingoldIterations,frLayoutManager=new foograph.ForceDirectedVertexLayout(lWidth,lHeight,iterations,!1,lMinDist);frLayoutManager.callback=function(){savePositions(),messagePositions()},frLayoutManager.layout(frg),savePositions(),messagePositions();for(var voronoi=new Voronoi,bbox={xl:0,xr:lWidth,yt:0,yb:lHeight},vSites=[],i=0;i<fv.length;++i)vSites[fv[i].label]=fv[i];for(var diagram=voronoi.compute(fv,bbox),cells=diagram.cells,i=0;i<cells.length;++i){var cell=cells[i],site=cell.site,centroid=cellCentroid(cell),currv=vSites[site.label];currv.x=centroid.x,currv.y=centroid.y}0>lExpFact&&(lExpFact=Math.max(.05,Math.min(.1,lMinDist/Math.sqrt(lWidth*lHeight/fv.length)*.5)));for(var prevInfractions=checkMinDist(diagram.edges),bStop=0>=prevInfractions,voronoiIteration=0,expandIteration=0;!bStop;){++voronoiIteration;for(var it=0;4>=it;++it){voronoi.recycle(diagram),diagram=voronoi.compute(fv,bbox),cells=diagram.cells;for(var i=0;i<cells.length;++i){var cell=cells[i],site=cell.site,centroid=cellCentroid(cell),currv=vSites[site.label];currv.x=centroid.x,currv.y=centroid.y}}var currInfractions=checkMinDist(diagram.edges);0>=currInfractions?bStop=!0:(currInfractions>=prevInfractions||voronoiIteration>=4)&&(expandIteration>=lMaxExpIt?bStop=!0:(lWidth+=lWidth*lExpFact,lHeight+=lHeight*lExpFact,bbox={xl:0,xr:lWidth,yt:0,yb:lHeight},++expandIteration,voronoiIteration=0)),prevInfractions=currInfractions,savePositions(),messagePositions()}return savePositions(),pData}).then(function(e){var t=e.vertices;setPositions(e);var r=e.startTime,i=new Date;console.info("Layout on "+t.length+" nodes took "+(i-r)+" ms"),layout.one("layoutstop",options.stop),options.animate||layout.trigger("layoutready"),layout.trigger("layoutstop"),t1.stop()})}),this},SpreadLayout.prototype.stop=function(){},$$("layout","spread",SpreadLayout)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},r,t)}var r={animate:!0,maxSimulationTime:4e3,ungrabifyWhileSimulating:!1,fit:!0,padding:30,boundingBox:void 0,random:!1,infinite:!1,ready:void 0,stop:void 0,stiffness:400,repulsion:400,damping:.5};t.prototype.run=function(){var t=this,r=this,i=this.options;return e.util.require("Springy",function(n){function a(e){var t=e.scratch("springy").model.id,r=w.layout.nodePoints[t].p,i=e.position(),n=null!=i.x&&null!=i.y?y(e.position()):{x:4*Math.random()-2,y:4*Math.random()-2};r.x=n.x,r.y=n.y}function o(){r.stopped=!1,i.ungrabifyWhileSimulating&&E.ungrabify(),w.start()}var s=!1,l=i.cy;t.trigger({type:"layoutstart",layout:t});var u=i.eles,c=u.nodes().not(":parent"),d=u.edges(),h=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:l.width(),h:l.height()}),p=new n.Graph;c.each(function(e,t){t.scratch("springy",{model:p.newNode({element:t})})}),d.each(function(e,t){var r=t.source().scratch("springy").model,i=t.target().scratch("springy").model;t.scratch("springy",{model:p.newEdge(r,i,{element:t})})});var v=window.sim=new n.Layout.ForceDirected(p,i.stiffness,i.repulsion,i.damping);i.infinite&&(v.minEnergyThreshold=-(1/0));var f=v.getBoundingBox(),g=function(e){f=v.getBoundingBox();var t=f.topright.subtract(f.bottomleft),r=e.subtract(f.bottomleft).divide(t.x).x*h.w+h.x1,i=e.subtract(f.bottomleft).divide(t.y).y*h.h+h.x1;return new n.Vector(r,i)},y=function(e){f=v.getBoundingBox();var t=f.topright.subtract(f.bottomleft),r=(e.x-h.x1)/h.w*t.x+f.bottomleft.x,i=(e.y-h.y1)/h.h*t.y+f.bottomleft.y;return new n.Vector(r,i)},m=l.collection(),x=l.nodes().size(),b=1,w=new n.Renderer(v,function(){r.stopped||m.length>0&&i.animate&&(s=!0,m.rtrigger("position"),i.fit&&l.fit(i.padding),m=l.collection(),s=!1)},function(e,t,r){},function(e,n){if(!r.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",i.ready),t.trigger({type:"layoutready",layout:t})),b++}});c.each(function(e,t){i.random||a(t)});var _;c.on("position",_=function(){s||a(this)});var E=c.filter(":grabbable");r.stopSystem=function(){r.stopped=!0,p.filterNodes(function(){return!1}),i.ungrabifyWhileSimulating&&E.grabify(),i.fit&&l.fit(i.padding),c.off("drag position",_),t.one("layoutstop",i.stop),t.trigger({type:"layoutstop",layout:t}),r.stopSystem=null},o(),i.infinite||setTimeout(function(){r.stop()},i.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);