!function(e){var t={};function i(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:s})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=3)}([function(e,t){e.exports=neo4j},function(module,exports){(function(){(function(undefined){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";var _root=this,webWorkers="Worker"in _root;function Supervisor(sigInst,options){var _this=this,workerFn=sigInst.getForceAtlas2Worker&&sigInst.getForceAtlas2Worker();if(options=options||{},_root.URL=_root.URL||_root.webkitURL,this.sigInst=sigInst,this.graph=this.sigInst.graph,this.ppn=10,this.ppe=3,this.config={},this.shouldUseWorker=!1!==options.worker&&webWorkers,this.workerUrl=options.workerUrl,this.started=!1,this.running=!1,this.shouldUseWorker){if(this.workerUrl)this.worker=new Worker(this.workerUrl);else{var blob=this.makeBlob(workerFn);this.worker=new Worker(URL.createObjectURL(blob))}this.worker.postMessage=this.worker.webkitPostMessage||this.worker.postMessage}else eval(workerFn);this.msgName=this.worker?"message":"newCoords",this.listener=function(e){_this.nodesByteArray=new Float32Array(e.data.nodes),_this.running&&(_this.applyLayoutChanges(),_this.sendByteArrayToWorker(),_this.sigInst.refresh())},(this.worker||document).addEventListener(this.msgName,this.listener),this.graphToByteArrays(),sigInst.bind("kill",function(){sigInst.killForceAtlas2()})}Supervisor.prototype.makeBlob=function(e){var t;try{t=new Blob([e],{type:"application/javascript"})}catch(i){_root.BlobBuilder=_root.BlobBuilder||_root.WebKitBlobBuilder||_root.MozBlobBuilder,(t=new BlobBuilder).append(e),t=t.getBlob()}return t},Supervisor.prototype.graphToByteArrays=function(){var e,t,i,s=this.graph.nodes(),n=this.graph.edges(),r=s.length*this.ppn,a=n.length*this.ppe,o={};for(this.nodesByteArray=new Float32Array(r),this.edgesByteArray=new Float32Array(a),e=t=0,i=s.length;e=0;e--)for(t in arguments[e])i[t]=arguments[e][t];return i}(e,n.settings)}function u(){var e,r,a,o,d,c,u,m,f,p,y,x,v,b,w,E,C,k,M;for(a=0;a=0)A=t[h(a,"x")]=0){if(b=Math.sqrt(Math.pow(t[h(a,"x")]-s[g(r,"massCenterX")],2)+Math.pow(t[h(a,"y")]-s[g(r,"massCenterY")],2)),2*s[g(r,"size")]/b0?(w=p*t[h(a,"mass")]*s[g(r,"mass")]/b/b,t[h(a,"dx")]+=y*w,t[h(a,"dy")]+=x*w):b<0&&(w=-p*t[h(a,"mass")]*s[g(r,"mass")]/b,t[h(a,"dx")]+=y*w,t[h(a,"dy")]+=x*w):b>0&&(w=p*t[h(a,"mass")]*s[g(r,"mass")]/b/b,t[h(a,"dx")]+=y*w,t[h(a,"dy")]+=x*w),s[g(r,"nextSibling")]<0)break;r=s[g(r,"nextSibling")];continue}r=s[g(r,"firstChild")]}else{if(s[g(r,"node")]>=0&&s[g(r,"node")]!==a&&(y=t[h(a,"x")]-t[h(s[g(r,"node")],"x")],x=t[h(a,"y")]-t[h(s[g(r,"node")],"y")],b=Math.sqrt(y*y+x*x),n.settings.adjustSizes?b>0?(w=p*t[h(a,"mass")]*t[h(s[g(r,"node")],"mass")]/b/b,t[h(a,"dx")]+=y*w,t[h(a,"dy")]+=x*w):b<0&&(w=-p*t[h(a,"mass")]*t[h(s[g(r,"node")],"mass")]/b,t[h(a,"dx")]+=y*w,t[h(a,"dy")]+=x*w):b>0&&(w=p*t[h(a,"mass")]*t[h(s[g(r,"node")],"mass")]/b/b,t[h(a,"dx")]+=y*w,t[h(a,"dy")]+=x*w)),s[g(r,"nextSibling")]<0)break;r=s[g(r,"nextSibling")]}else for(p=n.settings.scalingRatio,o=0;o0?(w=p*t[h(o,"mass")]*t[h(d,"mass")]/b/b,t[h(o,"dx")]+=y*w,t[h(o,"dy")]+=x*w,t[h(d,"dx")]+=y*w,t[h(d,"dy")]+=x*w):b<0&&(w=100*p*t[h(o,"mass")]*t[h(d,"mass")],t[h(o,"dx")]+=y*w,t[h(o,"dy")]+=x*w,t[h(d,"dx")]-=y*w,t[h(d,"dy")]-=x*w):(b=Math.sqrt(y*y+x*x))>0&&(w=p*t[h(o,"mass")]*t[h(d,"mass")]/b/b,t[h(o,"dx")]+=y*w,t[h(o,"dy")]+=x*w,t[h(d,"dx")]-=y*w,t[h(d,"dy")]-=x*w);for(m=n.settings.gravity/n.settings.scalingRatio,p=n.settings.scalingRatio,a=0;a0&&(w=p*t[h(a,"mass")]*m):b>0&&(w=p*t[h(a,"mass")]*m/b),t[h(a,"dx")]-=y*w,t[h(a,"dy")]-=x*w;for(p=1*(n.settings.outboundAttractionDistribution?f:1),c=0;c0&&(w=-p*v*Math.log(1+b)/b/t[h(o,"mass")]):b>0&&(w=-p*v*Math.log(1+b)/b):n.settings.outboundAttractionDistribution?b>0&&(w=-p*v/t[h(o,"mass")]):b>0&&(w=-p*v)):(b=Math.sqrt(Math.pow(y,2)+Math.pow(x,2)),n.settings.linLogMode?n.settings.outboundAttractionDistribution?b>0&&(w=-p*v*Math.log(1+b)/b/t[h(o,"mass")]):b>0&&(w=-p*v*Math.log(1+b)/b):n.settings.outboundAttractionDistribution?(b=1,w=-p*v/t[h(o,"mass")]):(b=1,w=-p*v)),b>0&&(t[h(o,"dx")]+=y*w,t[h(o,"dy")]+=x*w,t[h(d,"dx")]-=y*w,t[h(d,"dy")]-=x*w);if(n.settings.adjustSizes)for(a=0;an.maxForce&&(t[h(a,"dx")]=t[h(a,"dx")]*n.maxForce/E,t[h(a,"dy")]=t[h(a,"dy")]*n.maxForce/E),C=t[h(a,"mass")]*Math.sqrt((t[h(a,"old_dx")]-t[h(a,"dx")])*(t[h(a,"old_dx")]-t[h(a,"dx")])+(t[h(a,"old_dy")]-t[h(a,"dy")])*(t[h(a,"old_dy")]-t[h(a,"dy")])),k=Math.sqrt((t[h(a,"old_dx")]+t[h(a,"dx")])*(t[h(a,"old_dx")]+t[h(a,"dx")])+(t[h(a,"old_dy")]+t[h(a,"dy")])*(t[h(a,"old_dy")]+t[h(a,"dy")]))/2,M=.1*Math.log(1+k)/(1+Math.sqrt(C)),t[h(a,"x")]=t[h(a,"x")]+t[h(a,"dx")]*(M/n.settings.slowDown),t[h(a,"y")]=t[h(a,"y")]+t[h(a,"dy")]*(M/n.settings.slowDown));else for(a=0;a{var s=e[i];null!=e[i]&&Number.isFinite(e[i])&&(s=n.a.int(e[i])),t[i]=s}),t}_neo4jToSigmaNode(e){var t={id:e.identity.toString(),labels:e.labels,properties:e.properties,x:Math.random(),y:Math.random(),size:5,color:"#000",label:e.identity.toString()};return t.labels.forEach(e=>{if(this.style.labels){let i=this.style.labels[e];i&&(t.size=i.size||5,t.color=i.color||"#000",i.icon&&(t.icon=i.icon),i.type&&(t.type=i.type),t.type=i.type||"circle",i.label&&t.properties[i.label]&&(t.label=t.properties[i.label]))}}),t}_neo4jToSigmaEdge(e){var t={id:e.identity.toString(),rel_type:e.type,source:e.start.toString(),target:e.end.toString(),properties:e.properties,size:2,color:"#000",label:e.type,type:"paracurve"};if(this.style.edges){let e=this.style.edges[t.rel_type];e&&(t.size=e.size||2,t.color=e.color||"#000",t.type=e.type||"paracurve",e.label&&t.properties[e.label]&&(t.label=t.properties[e.label]))}return t}graph(e,t={}){let i=this._convertParams(t),s=this.driver.session();return new Promise((t,n)=>{s.run(e,i).then(e=>{let i={nodes:[],edges:[]},s=[],n=[];e.records.forEach(e=>{e.forEach((e,t)=>{e&&e.hasOwnProperty("labels")&&-1===s.indexOf(e.identity.toString())&&(i.nodes.push(this._neo4jToSigmaNode(e)),s.push(e.identity.toString())),e&&e.hasOwnProperty("type")&&-1===n.indexOf(e.identity.toString())&&(i.edges.push(this._neo4jToSigmaEdge(e)),n.push(e.identity.toString())),e&&e.hasOwnProperty("segments")&&e.segments.forEach(t=>{-1===s.indexOf(t.start.identity.toString())&&(i.nodes.push(this._neo4jToSigmaNode(t.start)),s.push(t.start.identity.toString())),-1===s.indexOf(t.end.identity.toString())&&(i.nodes.push(this._neo4jToSigmaNode(t.end)),s.push(t.end.identity.toString())),-1===n.indexOf(e.identity.toString())&&(i.edges.push(this._neo4jToSigmaEdge(t.rel)),n.push(t.rel.identity.toString()))})})}),t(i)},e=>{n(e)}).catch(e=>{n(e)})})}}window.Neo4jGraph=function(e,t,i,s){return new r(e,t).graph(i,s)}},function(e,t){(function(){(function(){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.plugins");var e=0,t={};function i(e){if(t[e])return t[e];var i=[0,0,0];return e.match(/^#/)?i=3===(e=(e||"").replace(/^#/,"")).length?[parseInt(e.charAt(0)+e.charAt(0),16),parseInt(e.charAt(1)+e.charAt(1),16),parseInt(e.charAt(2)+e.charAt(2),16)]:[parseInt(e.charAt(0)+e.charAt(1),16),parseInt(e.charAt(2)+e.charAt(3),16),parseInt(e.charAt(4)+e.charAt(5),16)]:e.match(/^ *rgba? *\(/)&&(i=[+(e=e.match(/^ *rgba? *\( *([0-9]*) *, *([0-9]*) *, *([0-9]*) *(,.*)?\) *$/))[1],+e[2],+e[3]]),t[e]={r:i[0],g:i[1],b:i[2]},t[e]}function s(e,t,s){return e=i(e),t=i(t),"rgb("+[0|e.r*(1-s)+t.r*s,0|e.g*(1-s)+t.g*s,0|e.b*(1-s)+t.b*s].join(",")+")"}sigma.plugins.animate=function(t,i,n){var r,a,o,d=n||{},h=++e,l=d.duration||t.settings("animationsTime"),g="string"==typeof d.easing?sigma.utils.easings[d.easing]:"function"==typeof d.easing?d.easing:sigma.utils.easings.quadraticInOut,c=sigma.utils.dateNow();for(o in r=d.nodes&&d.nodes.length?"object"==typeof d.nodes[0]?d.nodes:t.graph.nodes(d.nodes):t.graph.nodes(),a=r.reduce(function(e,t){var s;for(s in e[t.id]={},i)s in t&&(e[t.id][s]=t[s]);return e},{}),t.animations=t.animations||Object.create({}),sigma.plugins.kill(t),t.cameras)t.cameras[o].edgequadtree._enabled=!1;!function e(){var n=(sigma.utils.dateNow()-c)/l;if(n>=1){var o;for(o in r.forEach(function(e){for(var t in i)t in i&&(e[t]=e[i[t]])}),t.cameras)t.cameras[o].edgequadtree._enabled=!0;t.refresh(),"function"==typeof d.onComplete&&d.onComplete()}else n=g(n),r.forEach(function(e){for(var t in i)t in i&&(t.match(/color$/)?e[t]=s(a[e.id][t],e[i[t]],n):e[t]=e[i[t]]*n+a[e.id][t]*(1-n))}),t.refresh(),t.animations[h]=requestAnimationFrame(e)}()},sigma.plugins.kill=function(e){for(var t in e.animations||{})cancelAnimationFrame(e.animations[t]);for(t in e.cameras)e.cameras[t].edgequadtree._enabled=!0}}).call(window)}).call(window)},function(e,t){(function(){(function(){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";function e(e,t){sigma.classes.dispatcher.extend(this);var i=this,s=e,n=document.body,r=t,a=t.container.lastChild,o=t.camera,d=null,h="",l=[],g={},c=!1,u=!1;function m(e){g[e.data.node.id]||(l.push(e.data.node),g[e.data.node.id]=!0,l.length&&!c&&(d=l[l.length-1],a.addEventListener("mousedown",p)))}function f(e){var t=l.map(function(e){return e}).indexOf(e.data.node);l.splice(t,1),delete g[e.data.node.id],l.length&&!c?d=l[l.length-1]:a.removeEventListener("mousedown",p)}function p(e){c=!0;var t=s.graph.nodes().length;if(d&&t>1){var o,h;for(o in a.removeEventListener("mousedown",p),n.addEventListener("mousemove",x),n.addEventListener("mouseup",y),s.cameras)void 0!==(h=s.cameras[o]).edgequadtree&&(h.edgequadtree._enabled=!1);r.settings({mouseEnabled:!1,enableHovering:!1}),s.refresh(),i.dispatchEvent("startdrag",{node:d,captor:e,renderer:r})}}function y(e){var t,o;for(t in c=!1,a.addEventListener("mousedown",p),n.removeEventListener("mousemove",x),n.removeEventListener("mouseup",y),s.cameras)void 0!==(o=s.cameras[t]).edgequadtree&&(o.edgequadtree._enabled=!0);r.settings({mouseEnabled:!0,enableHovering:!0}),s.refresh(),u&&i.dispatchEvent("drop",{node:d,captor:e,renderer:r}),i.dispatchEvent("dragend",{node:d,captor:e,renderer:r}),u=!1,d=null}function x(e){if(navigator.userAgent.toLowerCase().indexOf("firefox")>-1){clearTimeout(t);var t=setTimeout(n,0)}else n();function n(){for(var t,n,a,l=(t=r.container,n=window.getComputedStyle(t),a=function(e){return parseInt(n.getPropertyValue(e).replace("px",""))||0},{left:t.getBoundingClientRect().left+a("padding-left"),top:t.getBoundingClientRect().top+a("padding-top")}),g=e.clientX-l.left,c=e.clientY-l.top,m=Math.cos(o.angle),f=Math.sin(o.angle),p=s.graph.nodes(),y=[],x=0;x<2;x++){var v=p[x],b={x:v.x*m+v.y*f,y:v.y*m-v.x*f,renX:v[h+"x"],renY:v[h+"y"]};y.push(b)}if(y[0].x===y[1].x&&y[0].y===y[1].y){var w=0===y[0].renX?1:y[0].renX,E=0===y[0].renY?1:y[0].renY;g=y[0].x/w*(g-y[0].renX)+y[0].x,c=y[0].y/E*(c-y[0].renY)+y[0].y}else{w=(y[1].renX-y[0].renX)/(y[1].x-y[0].x),E=(y[1].renY-y[0].renY)/(y[1].y-y[0].y);y[1].x===y[0].x&&(w=E),y[1].y===y[0].y&&(E=w),g=(g-y[0].renX)/w+y[0].x,c=(c-y[0].renY)/E+y[0].y}d.x=g*m-c*f,d.y=c*m+g*f,s.refresh(),u=!0,i.dispatchEvent("drag",{node:d,captor:e,renderer:r})}}t instanceof sigma.renderers.svg&&(a=t.container.firstChild),h=t instanceof sigma.renderers.webgl?t.options.prefix.substr(5):t.options.prefix,t.bind("overNode",m),t.bind("outNode",f),t.bind("click",function(e){c=!1,n.removeEventListener("mousemove",x),n.removeEventListener("mouseup",y),l.length||(d=null)}),s.bind("kill",function(){i.unbindAll()}),this.unbindAll=function(){a.removeEventListener("mousedown",p),n.removeEventListener("mousemove",x),n.removeEventListener("mouseup",y),r.unbind("overNode",m),r.unbind("outNode",f)}}sigma.utils.pkg("sigma.plugins");var t={};sigma.plugins.dragNodes=function(i,s){return t[i.id]||(t[i.id]=new e(i,s)),i.bind("kill",function(){sigma.plugins.killDragNodes(i)}),t[i.id]},sigma.plugins.killDragNodes=function(i){t[i.id]instanceof e&&(t[i.id].unbindAll(),delete t[i.id])}}).call(window)}).call(window)},function(e,t){(function(){(function(e){"use strict";if("undefined"==typeof sigma)throw new Error("sigma is not declared");sigma.classes.graph.hasMethod("getNeighbors")||sigma.classes.graph.addMethod("getCardinalityBetweenNodes",function(e,t){let i=0,s=this.inNeighborsIndex[e];s[t]&&(i=Object.keys(s[t]).length);let n=this.outNeighborsIndex[e];return n[t]&&(i+=Object.keys(n[t]).length),i}),sigma.classes.graph.attach("addEdge","sigma.extend.graph.addEdge",function(e){let t=this.getCardinalityBetweenNodes(e.source,e.target);this.edges(e.id).order=t})}).call(this)}).call(window)},function(e,t){(function(){(function(e){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.canvas.edges.labels"),sigma.canvas.edges.labels.paracurve=function(e,t,i,s,n){var r=n("prefix")||"",a=e.hidden||!1,o=(e.active,e.order||0),d=e.color||n("defaultEdgeColor"),h=e[r+"size"]||n("defaultEdgeSize"),l=t[r+"x"],g=t[r+"y"],c=i[r+"x"],u=i[r+"y"];if(!a&&"string"==typeof e.label&&h>=n("edgeLabelThreshold")){var m,f,p;if(t.id===i.id)m=sigma.canvas.utils.getSelfLoopControlPoints(l,g,t[r+"size"],h,o),f=sigma.utils.getPointOnBezierCurve(.5,l,g,c,u,m.x1,m.y1,m.x2,m.y2),p=Math.atan2(1,1);else{m=sigma.canvas.utils.getQuadraticControlPoint(l,g,c,u,h,o),f=sigma.utils.getPointOnQuadraticCurve(.5,l,g,c,u,m.x,m.y);var y=c-l,x=u-g,v=lh-g&&ml-g&&fu[s].size){u.splice(s,0,d),c=!0;break}c||u.push(d)}return u}function d(i){if(!a.settings("enableEdgeHovering"))return[];var s=sigma.renderers.canvas&&a instanceof sigma.renderers.canvas;if(!s)throw new Error("The edge events feature is not compatible with the WebGL renderer");i&&(n="x"in i.data?i.data.x:n,r="y"in i.data?i.data.y:r);var o,d,h,l,g,c,u,m,f,p,y=a.settings("edgeHoverPrecision"),x={},v=[],b=n+a.width/2,w=r+a.height/2,E=a.camera.cameraPosition(n,r),C=[];if(s)for(o=0,h=(l=a.camera.quadtree.area(a.camera.getRectangle(a.width,a.height))).length;oe[d].size){e.splice(d,0,t),p=!0;break}p||e.push(t)}if(a.camera.edgequadtree!==e&&(C=a.camera.edgequadtree.point(E.x,E.y)),C.length)for(o=0,h=C.length;ou[t+"size"]&&sigma.utils.getDistance(m[t+"x"],m[t+"y"],b,w)>m[t+"size"]&&("curve"==g.type||g.type,u.id===m.id?(f=sigma.canvas.utils.getSelfLoopControlPoints(u[t+"x"],u[t+"y"],u[t+"size"],g[t+"size"],g.order),sigma.utils.isPointOnBezierCurve(b,w,u[t+"x"],u[t+"y"],m[t+"x"],m[t+"y"],f.x1,f.y1,f.x2,f.y2,Math.max(c,y))&&k(v,g)):(f=sigma.canvas.utils.getQuadraticControlPoint(u[t+"x"],u[t+"y"],m[t+"x"],m[t+"y"],g[t+"size"],g.order),sigma.utils.isPointOnQuadraticCurve(b,w,u[t+"x"],u[t+"y"],m[t+"x"],m[t+"y"],f.x,f.y,Math.max(c,y))&&k(v,g)));return v}function h(e){var t,i,s={},n={};function r(e){if(a.settings("eventsEnabled")){t=o(e),i=d(e);var r,h,l,g,c=[],u=[],m={},f=t.length,p=[],y=[],x={},v=i.length;for(r=0;r=1?(t.isAnimated=!1,t.goTo({x:s.x!==e?s.x:h.x,y:s.y!==e?s.y:h.y,ratio:s.ratio!==e?s.ratio:h.ratio,angle:s.angle!==e?s.angle:h.angle}),cancelAnimationFrame(a),delete sigma.misc.animation.running[a],"function"==typeof l.onComplete&&l.onComplete()):(i=d(n),t.isAnimated=!0,t.goTo({x:s.x!==e?h.x+(s.x-h.x)*i:h.x,y:s.y!==e?h.y+(s.y-h.y)*i:h.y,ratio:s.ratio!==e?h.ratio+(s.ratio-h.ratio)*i:h.ratio,angle:s.angle!==e?h.angle+(s.angle-h.angle)*i:h.angle}),"function"==typeof l.onNewFrame&&l.onNewFrame(),o.frameId=requestAnimationFrame(r))},a=i(),o={frameId:requestAnimationFrame(r),target:t,type:"camera",options:l,fn:r},sigma.misc.animation.running[a]=o,a},sigma.misc.animation.kill=function(e){if(1!==arguments.length||"number"!=typeof e)throw"animation.kill: Wrong arguments.";var t=sigma.misc.animation.running[e];return t&&(cancelAnimationFrame(e),delete sigma.misc.animation.running[t.frameId],"camera"===t.type&&(t.target.isAnimated=!1),"function"==typeof(t.options||{}).onComplete&&t.options.onComplete()),this},sigma.misc.animation.killAll=function(e){var t,i,s=0,n="string"==typeof e?e:null,r="object"==typeof e?e:null,a=sigma.misc.animation.running;for(i in a)n&&a[i].type!==n||r&&a[i].target!==r||(t=sigma.misc.animation.running[i],cancelAnimationFrame(t.frameId),delete sigma.misc.animation.running[i],"camera"===t.type&&(t.target.isAnimated=!1),s++,"function"==typeof(t.options||{}).onComplete&&t.options.onComplete());return s},sigma.misc.animation.has=function(e){var t,i="string"==typeof e?e:null,s="object"==typeof e?e:null,n=sigma.misc.animation.running;for(t in n)if(!(i&&n[t].type!==i||s&&n[t].target!==s))return!0;return!1}}).call(this)}).call(window)},function(e,t){(function(){(function(e){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.middlewares"),sigma.middlewares.copy=function(e,t){var i,s,n;if(t+""!=e+""){for(i=0,s=(n=this.graph.nodes()).length;i=n.length/d.ATTRIBUTES&&t===e.length-1?(delete this.jobs[i],!1):(r>=n.length/d.ATTRIBUTES?(t++,n=this.edgeFloatArrays[e[t]].array,d=sigma.webgl.edges[e[t]],a=0,r=Math.min(a+h*d.POINTS,n.length/d.ATTRIBUTES)):(a=r,r=Math.min(a+h*d.POINTS,n.length/d.ATTRIBUTES)),!0)},this.jobs[i]=s,conrad.addJob(i,s.bind(this)))}).call(this);else for(r in this.edgeFloatArrays)o=sigma.webgl.edges[r],this.edgePrograms[r]||(this.edgePrograms[r]=o.initProgram(l)),this.edgeFloatArrays[r]&&(l.useProgram(this.edgePrograms[r]),o.render(l,this.edgePrograms[r],this.edgeFloatArrays[r].array,{settings:this.settings,matrix:g,width:this.width,height:this.height,ratio:this.camera.ratio,scalingRatio:this.settings(c,"webglOversamplingRatio"),indicesData:this.edgeIndicesArrays[r]}));if(f)for(r in h.blendFunc(h.SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA),h.enable(h.BLEND),this.nodeFloatArrays)o=sigma.webgl.nodes[r],this.nodePrograms[r]||(this.nodePrograms[r]=o.initProgram(h)),this.nodeFloatArrays[r]&&(h.useProgram(this.nodePrograms[r]),o.render(h,this.nodePrograms[r],this.nodeFloatArrays[r].array,{settings:this.settings,matrix:g,width:this.width,height:this.height,ratio:this.camera.ratio,scalingRatio:this.settings(c,"webglOversamplingRatio")}));if(u)for(i=this.camera.quadtree.area(this.camera.getRectangle(this.width,this.height)),this.camera.applyView(e,e,{nodes:i,edges:[],width:this.width,height:this.height}),a=function(e){return d.settings({prefix:d.camera.prefix},e)},s=0,n=i.length;s100&&g,m.dispatchEvent("click",t)}return e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!1}function C(e){var t,i,s,n=sigma.utils.getDelta(e);if(y("mouseEnabled")&&y("mouseWheelEnabled")&&0!==n)return i=n>0?1/y("zoomingRatio"):y("zoomingRatio"),t=p.cameraPosition(sigma.utils.getX(e)-sigma.utils.getCenter(e).x,sigma.utils.getY(e)-sigma.utils.getCenter(e).y,!0),s={duration:y("mouseZoomDuration")},sigma.utils.zoomTo(p,t.x,t.y,i,s),e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!1}sigma.classes.dispatcher.extend(this),sigma.utils.doubleClick(f,"click",function(e){var t,i,s;if(y("mouseEnabled"))return i=1/y("doubleClickZoomingRatio"),m.dispatchEvent("doubleclick",sigma.utils.mouseCoords(e,o,d)),y("doubleClickEnabled")&&(t=p.cameraPosition(sigma.utils.getX(e)-sigma.utils.getCenter(e).x,sigma.utils.getY(e)-sigma.utils.getCenter(e).y,!0),s={duration:y("doubleClickZoomDuration")},sigma.utils.zoomTo(p,t.x,t.y,i,s)),e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!1}),f.addEventListener("DOMMouseScroll",C,!1),f.addEventListener("mousewheel",C,!1),f.addEventListener("mousemove",x,!1),f.addEventListener("mousedown",b,!1),f.addEventListener("click",E,!1),f.addEventListener("mouseout",w,!1),document.addEventListener("mouseup",v,!1),this.kill=function(){sigma.utils.unbindDoubleClick(f,"click"),f.removeEventListener("DOMMouseScroll",C),f.removeEventListener("mousewheel",C),f.removeEventListener("mousemove",x),f.removeEventListener("mousedown",b),f.removeEventListener("click",E),f.removeEventListener("mouseout",w),document.removeEventListener("mouseup",v)}}}).call(this)}).call(window)},function(e,t){(function(){(function(e){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.captors"),sigma.captors.touch=function(e,t,i){var s,n,r,a,o,d,h,l,g,c,u,m,f,p,y,x,v=this,b=e,w=t,E=i,C=[];function k(e){var t=sigma.utils.getOffset(b);return{x:e.pageX-t.left,y:e.pageY-t.top}}function M(e){var t,i,p,y,x,v;if(E("touchEnabled"))switch((C=e.touches).length){case 1:w.isMoving=!0,f=1,s=w.x,n=w.y,o=w.x,d=w.y,x=k(C[0]),h=x.x,l=x.y;break;case 2:return w.isMoving=!0,f=2,x=k(C[0]),v=k(C[1]),t=x.x,p=x.y,i=v.x,y=v.y,o=w.x,d=w.y,r=w.angle,a=w.ratio,s=w.x,n=w.y,h=t,l=p,g=i,c=y,u=Math.atan2(c-l,g-h),m=Math.sqrt((c-l)*(c-l)+(g-h)*(g-h)),e.preventDefault(),!1}}function A(e){if(E("touchEnabled")){C=e.touches;var t=E("touchInertiaRatio");switch(x&&(p=!1,clearTimeout(x)),f){case 2:if(1===e.touches.length){M(e),e.preventDefault();break}case 1:w.isMoving=!1,v.dispatchEvent("stopDrag"),p&&(y=!1,sigma.misc.animation.camera(w,{x:w.x+t*(w.x-o),y:w.y+t*(w.y-d)},{easing:"quadraticOut",duration:E("touchInertiaDuration")})),p=!1,f=0}}}function S(e){if(!y&&E("touchEnabled")){var t,i,b,M,A,S,O,N,z,T,P,I,j,_,L,F,D;switch(C=e.touches,p=!0,x&&clearTimeout(x),x=setTimeout(function(){p=!1},E("dragTimeout")),f){case 1:t=(N=k(C[0])).x,b=N.y,T=w.cameraPosition(t-h,b-l,!0),_=s-T.x,L=n-T.y,_===w.x&&L===w.y||(o=w.x,d=w.y,w.goTo({x:_,y:L}),v.dispatchEvent("mousemove",sigma.utils.mouseCoords(e,N.x,N.y)),v.dispatchEvent("drag"));break;case 2:N=k(C[0]),z=k(C[1]),t=N.x,b=N.y,i=z.x,M=z.y,P=w.cameraPosition((h+g)/2-sigma.utils.getCenter(e).x,(l+c)/2-sigma.utils.getCenter(e).y,!0),O=w.cameraPosition((t+i)/2-sigma.utils.getCenter(e).x,(b+M)/2-sigma.utils.getCenter(e).y,!0),I=Math.atan2(M-b,i-t)-u,j=Math.sqrt((M-b)*(M-b)+(i-t)*(i-t))/m,t=P.x,b=P.y,F=a/j,b*=j,D=r-I,i=(t*=j)*(A=Math.cos(-I))+b*(S=Math.sin(-I)),b=M=b*A-t*S,_=(t=i)-O.x+s,L=b-O.y+n,F===w.ratio&&D===w.angle&&_===w.x&&L===w.y||(o=w.x,d=w.y,w.angle,w.ratio,w.goTo({x:_,y:L,angle:D,ratio:F}),v.dispatchEvent("drag"))}return e.preventDefault(),!1}}sigma.classes.dispatcher.extend(this),sigma.utils.doubleClick(b,"touchstart",function(e){var t,i,s;if(e.touches&&1===e.touches.length&&E("touchEnabled"))return y=!0,i=1/E("doubleClickZoomingRatio"),t=k(e.touches[0]),v.dispatchEvent("doubleclick",sigma.utils.mouseCoords(e,t.x,t.y)),E("doubleClickEnabled")&&(t=w.cameraPosition(t.x-sigma.utils.getCenter(e).x,t.y-sigma.utils.getCenter(e).y,!0),s={duration:E("doubleClickZoomDuration"),onComplete:function(){y=!1}},sigma.utils.zoomTo(w,t.x,t.y,i,s)),e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!1}),b.addEventListener("touchstart",M,!1),b.addEventListener("touchend",A,!1),b.addEventListener("touchcancel",A,!1),b.addEventListener("touchleave",A,!1),b.addEventListener("touchmove",S,!1),this.kill=function(){sigma.utils.unbindDoubleClick(b,"touchstart"),b.addEventListener("touchstart",M),b.addEventListener("touchend",A),b.addEventListener("touchcancel",A),b.addEventListener("touchleave",A),b.addEventListener("touchmove",S)}}}).call(this)}).call(window)},function(e,t,i){(function(){(function(i){"use strict";var s={pointToSquare:function(e){return{x1:e.x-e.size,y1:e.y-e.size,x2:e.x+e.size,y2:e.y-e.size,height:2*e.size}},lineToSquare:function(e){return e.y1e.y1?{x1:e.x1-e.height,y1:e.y1,x2:e.x1,y2:e.y1,height:e.height}:e.x1===e.x2&&e.y2=l},collision:function(e,t){for(var i=this.axis(e,t),s=!0,n=0;n<4;n++)s=s&&this.axisCollision(i[n],e,t);return s}};function n(e,t){for(var i=[],s=0;s<4;s++)e.x2>=t[s][0].x&&e.x1<=t[s][1].x&&e.y1+e.height>=t[s][0].y&&e.y1<=t[s][2].y&&i.push(s);return i}function r(e,t){for(var i=[],n=0;n<4;n++)s.collision(e,t[n])&&i.push(n);return i}function a(e,t){var i,s,n=t.level+1,r=Math.round(t.bounds.width/2),a=Math.round(t.bounds.height/2),o=Math.round(t.bounds.x),h=Math.round(t.bounds.y);switch(e){case 0:i=o,s=h;break;case 1:i=o+r,s=h;break;case 2:i=o,s=h+a;break;case 3:i=o+r,s=h+a}return d({x:i,y:s,width:r,height:a},n,t.maxElements,t.maxLevel)}function o(e,t,s){if(s.levele.y1?{x1:e.x1-e.height,y1:e.y1,x2:e.x1,y2:e.y1,height:e.height}:e.x1===e.x2&&e.y2=l},collision:function(e,t){for(var i=this.axis(e,t),s=!0,n=0;n<4;n++)s=s&&this.axisCollision(i[n],e,t);return s}};function n(e,t){for(var i=[],s=0;s<4;s++)e.x2>=t[s][0].x&&e.x1<=t[s][1].x&&e.y1+e.height>=t[s][0].y&&e.y1<=t[s][2].y&&i.push(s);return i}function r(e,t){for(var i=[],n=0;n<4;n++)s.collision(e,t[n])&&i.push(n);return i}function a(e,t){var i,s,n=t.level+1,r=Math.round(t.bounds.width/2),a=Math.round(t.bounds.height/2),o=Math.round(t.bounds.x),h=Math.round(t.bounds.y);switch(e){case 0:i=o,s=h;break;case 1:i=o+r,s=h;break;case 2:i=o,s=h+a;break;case 3:i=o+r,s=h+a}return d({x:i,y:s,width:r,height:a},n,t.maxElements,t.maxLevel)}function o(e,t,s){if(s.level4)throw"attach: Wrong arguments.";var n;if("constructor"===e)n=r;else if(s){if(!o[e])throw'The method "'+e+'" does not exist.';n=o[e]}else{if(!a[e])throw'The method "'+e+'" does not exist.';n=a[e]}if(n[t])throw'A function "'+t+'" is already attached to the method "'+e+'".';return n[t]=i,this},l.attachBefore=function(e,t,i){return this.attach(e,t,i,!0)},l.addIndex=function(e,t){if("string"!=typeof e||Object(t)!==t||2!==arguments.length)throw"addIndex: Wrong arguments.";if(n[e])throw'The index "'+e+'" already exists.';var i;for(i in n[e]=t,t){if("function"!=typeof t[i])throw"The bindings must be functions.";l.attach(i,e,t[i])}return this},l.addMethod("addNode",function(e){if(Object(e)!==e||1!==arguments.length)throw"addNode: Wrong arguments.";if("string"!=typeof e.id&&"number"!=typeof e.id)throw"The node must have a string or number id.";if(this.nodesIndex[e.id])throw'The node "'+e.id+'" already exists.';var t,i=e.id,s=Object.create(null);if(this.settings("clone"))for(t in e)"id"!==t&&(s[t]=e[t]);else s=e;return this.settings("immutable")?Object.defineProperty(s,"id",{value:i,enumerable:!0}):s.id=i,this.inNeighborsIndex[i]=Object.create(null),this.outNeighborsIndex[i]=Object.create(null),this.allNeighborsIndex[i]=Object.create(null),this.inNeighborsCount[i]=0,this.outNeighborsCount[i]=0,this.allNeighborsCount[i]=0,this.nodesArray.push(s),this.nodesIndex[s.id]=s,this}),l.addMethod("addEdge",function(e){if(Object(e)!==e||1!==arguments.length)throw"addEdge: Wrong arguments.";if("string"!=typeof e.id&&"number"!=typeof e.id)throw"The edge must have a string or number id.";if("string"!=typeof e.source&&"number"!=typeof e.source||!this.nodesIndex[e.source])throw"The edge source must have an existing node id.";if("string"!=typeof e.target&&"number"!=typeof e.target||!this.nodesIndex[e.target])throw"The edge target must have an existing node id.";if(this.edgesIndex[e.id])throw'The edge "'+e.id+'" already exists.';var t,i=Object.create(null);if(this.settings("clone"))for(t in e)"id"!==t&&"source"!==t&&"target"!==t&&(i[t]=e[t]);else i=e;return this.settings("immutable")?(Object.defineProperty(i,"id",{value:e.id,enumerable:!0}),Object.defineProperty(i,"source",{value:e.source,enumerable:!0}),Object.defineProperty(i,"target",{value:e.target,enumerable:!0})):(i.id=e.id,i.source=e.source,i.target=e.target),this.edgesArray.push(i),this.edgesIndex[i.id]=i,this.inNeighborsIndex[i.target][i.source]||(this.inNeighborsIndex[i.target][i.source]=Object.create(null)),this.inNeighborsIndex[i.target][i.source][i.id]=i,this.outNeighborsIndex[i.source][i.target]||(this.outNeighborsIndex[i.source][i.target]=Object.create(null)),this.outNeighborsIndex[i.source][i.target][i.id]=i,this.allNeighborsIndex[i.source][i.target]||(this.allNeighborsIndex[i.source][i.target]=Object.create(null)),this.allNeighborsIndex[i.source][i.target][i.id]=i,i.target!==i.source&&(this.allNeighborsIndex[i.target][i.source]||(this.allNeighborsIndex[i.target][i.source]=Object.create(null)),this.allNeighborsIndex[i.target][i.source][i.id]=i),this.inNeighborsCount[i.target]++,this.outNeighborsCount[i.source]++,this.allNeighborsCount[i.target]++,this.allNeighborsCount[i.source]++,this}),l.addMethod("dropNode",function(e){if("string"!=typeof e&&"number"!=typeof e||1!==arguments.length)throw"dropNode: Wrong arguments.";if(!this.nodesIndex[e])throw'The node "'+e+'" does not exist.';var t,i,s;for(delete this.nodesIndex[e],t=0,s=this.nodesArray.length;t=0;t--)this.edgesArray[t].source!==e&&this.edgesArray[t].target!==e||this.dropEdge(this.edgesArray[t].id);for(i in delete this.inNeighborsIndex[e],delete this.outNeighborsIndex[e],delete this.allNeighborsIndex[e],delete this.inNeighborsCount[e],delete this.outNeighborsCount[e],delete this.allNeighborsCount[e],this.nodesIndex)delete this.inNeighborsIndex[i][e],delete this.outNeighborsIndex[i][e],delete this.allNeighborsIndex[i][e];return this}),l.addMethod("dropEdge",function(e){if("string"!=typeof e&&"number"!=typeof e||1!==arguments.length)throw"dropEdge: Wrong arguments.";if(!this.edgesIndex[e])throw'The edge "'+e+'" does not exist.';var t,i,s;for(s=this.edgesIndex[e],delete this.edgesIndex[e],t=0,i=this.edgesArray.length;t=0;e--)for(t in arguments[e])i[t]=arguments[e][t];return i},sigma.utils.dateNow=function(){return Date.now?Date.now():(new Date).getTime()},sigma.utils.pkg=function(e){return(e||"").split(".").reduce(function(e,t){return t in e?e[t]:e[t]={}},i)},sigma.utils.id=(t=0,function(){return++t});var s={};sigma.utils.floatColor=function(e){if(s[e])return s[e];var t=e,i=0,n=0,r=0;"#"===e[0]?3===(e=e.slice(1)).length?(i=parseInt(e.charAt(0)+e.charAt(0),16),n=parseInt(e.charAt(1)+e.charAt(1),16),r=parseInt(e.charAt(2)+e.charAt(2),16)):(i=parseInt(e.charAt(0)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(3),16),r=parseInt(e.charAt(4)+e.charAt(5),16)):e.match(/^ *rgba? *\(/)&&(i=+(e=e.match(/^ *rgba? *\( *([0-9]*) *, *([0-9]*) *, *([0-9]*) *(,.*)?\) *$/))[1],n=+e[2],r=+e[3]);var a=256*i*256+256*n+r;return s[t]=a,a},sigma.utils.zoomTo=function(e,t,i,s,n){var r,a,o,d=e.settings;(a=Math.max(d("zoomMin"),Math.min(d("zoomMax"),e.ratio*s)))!==e.ratio&&(o={x:t*(1-(s=a/e.ratio))+e.x,y:i*(1-s)+e.y,ratio:a},n&&n.duration?(r=sigma.misc.animation.killAll(e),n=sigma.utils.extend(n,{easing:r?"quadraticOut":"quadraticInOut"}),sigma.misc.animation.camera(e,o,n)):(e.goTo(o),n&&n.onComplete&&n.onComplete()))},sigma.utils.getQuadraticControlPoint=function(e,t,i,s){return{x:(e+i)/2+(s-t)/4,y:(t+s)/2+(e-i)/4}},sigma.utils.getPointOnQuadraticCurve=function(e,t,i,s,n,r,a){return{x:Math.pow(1-e,2)*t+2*(1-e)*e*r+Math.pow(e,2)*s,y:Math.pow(1-e,2)*i+2*(1-e)*e*a+Math.pow(e,2)*n}},sigma.utils.getPointOnBezierCurve=function(e,t,i,s,n,r,a,o,d){var h=Math.pow(1-e,3),l=3*e*Math.pow(1-e,2),g=3*Math.pow(e,2)*(1-e),c=Math.pow(e,3);return{x:h*t+l*r+g*o+c*s,y:h*i+l*a+g*d+c*n}},sigma.utils.getSelfLoopControlPoints=function(e,t,i){return{x1:e-7*i,y1:t,x2:e,y2:t+7*i}},sigma.utils.getDistance=function(e,t,i,s){return Math.sqrt(Math.pow(i-e,2)+Math.pow(s-t,2))},sigma.utils.getCircleIntersection=function(e,t,i,s,n,r){var a,o,d,h,l,g,c,u,m;return o=s-e,d=n-t,!((h=Math.sqrt(d*d+o*o))>i+r)&&(!(hh||Math.abs(t-s)>h)return!1;for(var l,g=.5,c=sigma.utils.getDistance(e,t,i,s)0&&g>=0&&g<=1&&f>d&&(c>.001||c<-.001);)l=f,m=sigma.utils.getPointOnQuadraticCurve(g,i,s,n,r,a,o),(f=sigma.utils.getDistance(e,t,m.x,m.y))>l?g+=c=-c/2:g+c<0||g+c>1?(c/=2,f=l):g+=c;return fg||Math.abs(t-s)>g)return!1;for(var c,u=.5,m=sigma.utils.getDistance(e,t,i,s)0&&u>=0&&u<=1&&y>l&&(m>.001||m<-.001);)c=y,p=sigma.utils.getPointOnBezierCurve(u,i,s,n,r,a,o,d,h),(y=sigma.utils.getDistance(e,t,p.x,p.y))>c?u+=m=-m/2:u+m<0||u+m>1?(m/=2,y=c):u+=m;return ywindow.screen.logicalXDPI?t=window.screen.systemXDPI/window.screen.logicalXDPI:window.devicePixelRatio!==e&&(t=window.devicePixelRatio),t},sigma.utils.getWidth=function(t){var i=t.target.ownerSVGElement?t.target.ownerSVGElement.width:t.target.width;return"number"==typeof i&&i||i!==e&&i.baseVal!==e&&i.baseVal.value},sigma.utils.getCenter=function(e){var t=-1!==e.target.namespaceURI.indexOf("svg")?1:sigma.utils.getPixelRatio();return{x:sigma.utils.getWidth(e)/(2*t),y:sigma.utils.getHeight(e)/(2*t)}},sigma.utils.mouseCoords=function(e,t,i){return t=t||sigma.utils.getX(e),i=i||sigma.utils.getY(e),{x:t-sigma.utils.getCenter(e).x,y:i-sigma.utils.getCenter(e).y,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,shiftKey:e.shiftKey}},sigma.utils.getHeight=function(t){var i=t.target.ownerSVGElement?t.target.ownerSVGElement.height:t.target.height;return"number"==typeof i&&i||i!==e&&i.baseVal!==e&&i.baseVal.value},sigma.utils.getDelta=function(t){return t.wheelDelta!==e&&t.wheelDelta||t.detail!==e&&-t.detail},sigma.utils.getOffset=function(e){for(var t=0,i=0;e;)i+=parseInt(e.offsetTop),t+=parseInt(e.offsetLeft),e=e.offsetParent;return{top:i,left:t}},sigma.utils.doubleClick=function(e,t,i){var s,n=0;e._doubleClickHandler=e._doubleClickHandler||{},e._doubleClickHandler[t]=e._doubleClickHandler[t]||[],(s=e._doubleClickHandler[t]).push(function(e){if(2===++n)return n=0,i(e);1===n&&setTimeout(function(){n=0},sigma.settings.doubleClickTimeout)}),e.addEventListener(t,s[s.length-1],!1)},sigma.utils.unbindDoubleClick=function(e,t){for(var i,s=(e._doubleClickHandler||{})[t]||[];i=s.pop();)e.removeEventListener(t,i);delete(e._doubleClickHandler||{})[t]},sigma.utils.easings=sigma.utils.easings||{},sigma.utils.easings.linearNone=function(e){return e},sigma.utils.easings.quadraticIn=function(e){return e*e},sigma.utils.easings.quadraticOut=function(e){return e*(2-e)},sigma.utils.easings.quadraticInOut=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},sigma.utils.easings.cubicIn=function(e){return e*e*e},sigma.utils.easings.cubicOut=function(e){return--e*e*e+1},sigma.utils.easings.cubicInOut=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},sigma.utils.loadShader=function(e,t,i,s){var n=e.createShader(i);return e.shaderSource(n,t),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS)?n:(s&&s('Error compiling shader "'+n+'":'+e.getShaderInfoLog(n)),e.deleteShader(n),null)},sigma.utils.loadProgram=function(e,t,i,s,n){var r,a=e.createProgram();for(r=0;ra.weightTime){o.splice(e,0,a),n=!0;break}n||o.push(a)}return s?a:null}function f(e){var t=o.length;a[e.id]=e,e.status="running",t&&(e.weightTime=o[t-1].weightTime,e.currentTime=e.weightTime*(e.weight||1)),e.startTime=E(),u("jobStarted",b(e)),o.push(e)}function p(){var e,t,i;for(e in r)(t=r[e]).after?d[e]=t:f(t),delete r[e];for(n=!!o.length;o.length&&E()-s=0;e--)for(t in arguments[e])i[t]=arguments[e][t];return i}function b(e){var t,i,s;if(!e)return e;if(Array.isArray(e))for(t=[],i=0,s=e.length;i1)for(s=0,n=(a=Array.isArray(t)?t:t.split(/ /)).length;s!==n;s+=1)r=a[s],c[r]||(c[r]=[]),c[r].push({handler:i})},unbind:function(e,t){var i,s,n,r,a,o,d=Array.isArray(e)?e:e.split(/ /);if(arguments.length)if(t)for(i=0,s=d.length;i!==s;i+=1){if(o=d[i],c[o]){for(a=[],n=0,r=c[o].length;n!==r;n+=1)c[o][n].handler!==t&&a.push(c[o][n]);c[o]=a}c[o]&&0===c[o].length&&delete c[o]}else for(i=0,s=d.length;i!==s;i+=1)delete c[d[i]];else c=Object.create(null)},version:"0.1.0"};void 0!==e&&e.exports&&(t=e.exports=C),t.conrad=C,i.conrad=C}(this)}).call(window)},function(e,t){(function(){(function(e){"use strict";var t={},i=function(e){var s,n,r,a,o;i.classes.dispatcher.extend(this);var d=this,h=e||{};if("string"==typeof h||h instanceof HTMLElement?h={renderers:[h]}:"[object Array]"===Object.prototype.toString.call(h)&&(h={renderers:h}),a=h.renderers||h.renderer||h.container,h.renderers&&0!==h.renderers.length||("string"==typeof a||a instanceof HTMLElement||"object"==typeof a&&"container"in a)&&(h.renderers=[a]),h.id){if(t[h.id])throw'sigma: Instance "'+h.id+'" already exists.';Object.defineProperty(this,"id",{value:h.id})}else{for(o=0;t[o];)o++;Object.defineProperty(this,"id",{value:""+o})}for(t[this.id]=this,this.settings=new i.classes.configurable(i.settings,h.settings||{}),Object.defineProperty(this,"graph",{value:new i.classes.graph(this.settings),configurable:!0}),Object.defineProperty(this,"middlewares",{value:[],configurable:!0}),Object.defineProperty(this,"cameras",{value:{},configurable:!0}),Object.defineProperty(this,"renderers",{value:{},configurable:!0}),Object.defineProperty(this,"renderersPerCamera",{value:{},configurable:!0}),Object.defineProperty(this,"cameraFrames",{value:{},configurable:!0}),Object.defineProperty(this,"camera",{get:function(){return this.cameras[0]}}),Object.defineProperty(this,"events",{value:["click","rightClick","clickStage","doubleClickStage","rightClickStage","clickNode","clickNodes","doubleClickNode","doubleClickNodes","rightClickNode","rightClickNodes","overNode","overNodes","outNode","outNodes","downNode","downNodes","upNode","upNodes"],configurable:!0}),this._handler=function(e){var t,i={};for(t in e.data)i[t]=e.data[t];i.renderer=e.target,this.dispatchEvent(e.type,i)}.bind(this),s=0,n=(r=h.renderers||[]).length;s=0;t--)this.killRenderer(i[t]);return delete this.renderersPerCamera[e.id],delete this.cameraFrames[e.id],delete this.cameras[e.id],e.kill&&e.kill(),this},i.prototype.addRenderer=function(e){var t,s,n,r,a=e||{};if("string"==typeof a?a={container:document.getElementById(a)}:a instanceof HTMLElement&&(a={container:a}),"string"==typeof a.container&&(a.container=document.getElementById(a.container)),"id"in a)t=a.id;else{for(t=0;this.renderers[""+t];)t++;t=""+t}if(this.renderers[t])throw'sigma.addRenderer: The renderer "'+t+'" already exists.';if(s=(s="function"==typeof a.type?a.type:i.renderers[a.type])||i.renderers.def,n="camera"in a?a.camera instanceof i.classes.camera?a.camera:this.cameras[a.camera]||this.addCamera(a.camera):this.addCamera(),this.cameras[n.id]!==n)throw"sigma.addRenderer: The camera is not properly referenced.";return r=new s(this.graph,n,this.settings,a),this.renderers[t]=r,Object.defineProperty(r,"id",{value:t}),r.bind&&r.bind(["click","rightClick","clickStage","doubleClickStage","rightClickStage","clickNode","clickNodes","clickEdge","clickEdges","doubleClickNode","doubleClickNodes","doubleClickEdge","doubleClickEdges","rightClickNode","rightClickNodes","rightClickEdge","rightClickEdges","overNode","overNodes","overEdge","overEdges","outNode","outNodes","outEdge","outEdges","downNode","downNodes","downEdge","downEdges","upNode","upNodes","upEdge","upEdges"],this._handler),this.renderersPerCamera[n.id].push(r),r},i.prototype.killRenderer=function(e){if(!(e="string"==typeof e?this.renderers[e]:e))throw"sigma.killRenderer: The renderer is undefined.";var t=this.renderersPerCamera[e.camera.id],i=t.indexOf(e);return i>=0&&t.splice(i,1),e.kill&&e.kill(),delete this.renderers[e.id],this},i.prototype.refresh=function(t){var s,n,r,a,o,d,h=0;for(t=t||{},s=0,n=(a=this.middlewares||[]).length;s