unisi 0.3.18__py3-none-any.whl → 0.3.19__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. unisi/llmrag.py +13 -2
  2. unisi/server.py +3 -4
  3. unisi/web/css/565.f35d8840.css +1 -0
  4. unisi/web/css/72.9393078c.css +1 -0
  5. unisi/web/css/{vendor.f7e3cefe.css → app.36cc37f3.css} +3 -3
  6. unisi/web/css/app.36cc37f3.css.gz +0 -0
  7. unisi/web/fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWuYjalmUiAw.2cafd699.woff +0 -0
  8. unisi/web/fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWuZtalmUiAw.7f471697.woff +0 -0
  9. unisi/web/fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWuaabVmUiAw.b69d1cce.woff +0 -0
  10. unisi/web/fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWub2bVmUiAw.2115c3bd.woff +0 -0
  11. unisi/web/fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbFmUiAw.bb8ee9ee.woff +0 -0
  12. unisi/web/fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbVmUiAw.eb9d7304.woff +0 -0
  13. unisi/web/index.html +1 -1
  14. unisi/web/js/260.1d50abd6.js +1 -0
  15. unisi/web/js/565.437dc595.js +3 -0
  16. unisi/web/js/565.437dc595.js.gz +0 -0
  17. unisi/web/js/609.a5c4177e.js +1 -0
  18. unisi/web/js/72.f1673470.js +1 -0
  19. unisi/web/js/935.a10cb1a0.js +1 -0
  20. unisi/web/js/app.aa62bd3c.js +1 -0
  21. unisi/web/js/echart.8f773fb7.js +1 -0
  22. unisi/web/js/echart.8f773fb7.js.gz +0 -0
  23. unisi/web/js/sigma.ce21336a.js +1 -0
  24. unisi/web/js/sigma.ce21336a.js.gz +0 -0
  25. unisi/web/js/vendor.6a64dcc5.js +57 -0
  26. unisi/web/js/vendor.6a64dcc5.js.gz +0 -0
  27. {unisi-0.3.18.dist-info → unisi-0.3.19.dist-info}/METADATA +1 -1
  28. unisi-0.3.19.dist-info/RECORD +58 -0
  29. unisi/web/css/131.703d8f36.css +0 -1
  30. unisi/web/css/app.31d6cfe0.css +0 -0
  31. unisi/web/fonts/KFOkCnqEu92Fr1MmgVxIIzQ.68bb21d0.woff +0 -0
  32. unisi/web/fonts/KFOlCnqEu92Fr1MmEU9fBBc-.48af7707.woff +0 -0
  33. unisi/web/fonts/KFOlCnqEu92Fr1MmSU5fBBc-.c2f7ab22.woff +0 -0
  34. unisi/web/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.77ecb942.woff +0 -0
  35. unisi/web/fonts/KFOlCnqEu92Fr1MmYUtfBBc-.f5677eb2.woff +0 -0
  36. unisi/web/fonts/KFOmCnqEu92Fr1Mu4mxM.f1e2a767.woff +0 -0
  37. unisi/web/js/131.76c61515.js +0 -3
  38. unisi/web/js/609.35dc13d3.js +0 -1
  39. unisi/web/js/935.cc0c012c.js +0 -1
  40. unisi/web/js/app.6f20f926.js +0 -1
  41. unisi/web/js/vendor.1bb14e9d.js +0 -45
  42. unisi-0.3.18.dist-info/RECORD +0 -49
  43. {unisi-0.3.18.dist-info → unisi-0.3.19.dist-info}/WHEEL +0 -0
  44. {unisi-0.3.18.dist-info → unisi-0.3.19.dist-info}/entry_points.txt +0 -0
  45. {unisi-0.3.18.dist-info → unisi-0.3.19.dist-info}/licenses/LICENSE +0 -0
Binary file
@@ -0,0 +1 @@
1
+ (globalThis["webpackChunkuniqua"]=globalThis["webpackChunkuniqua"]||[]).push([[324],{5793:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NodeImageProgram:()=>ve,NodePictogramProgram:()=>me,createNodeImageProgram:()=>pe});var i=n(1109),r=n(4271),o=n(520),a=WebGLRenderingContext,s=(a.UNSIGNED_BYTE,a.FLOAT,"\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute float a_normalCoef;\nattribute vec2 a_positionStart;\nattribute vec2 a_positionEnd;\nattribute float a_positionCoef;\nattribute float a_sourceRadius;\nattribute float a_targetRadius;\nattribute float a_sourceRadiusCoef;\nattribute float a_targetRadiusCoef;\n\nuniform mat3 u_matrix;\nuniform float u_zoomRatio;\nuniform float u_sizeRatio;\nuniform float u_pixelRatio;\nuniform float u_correctionRatio;\nuniform float u_minEdgeThickness;\nuniform float u_lengthToThicknessRatio;\nuniform float u_feather;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\nvarying float v_feather;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float minThickness = u_minEdgeThickness;\n\n vec2 normal = a_normal * a_normalCoef;\n vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;\n\n float normalLength = length(normal);\n vec2 unitNormal = normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;\n\n // Here, we move the point to leave space for the arrow heads:\n // Source arrow head\n float sourceRadius = a_sourceRadius * a_sourceRadiusCoef;\n float sourceDirection = sign(sourceRadius);\n float webGLSourceRadius = sourceDirection * sourceRadius * 2.0 * u_correctionRatio / u_sizeRatio;\n float webGLSourceArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;\n vec2 sourceCompensationVector =\n vec2(-sourceDirection * unitNormal.y, sourceDirection * unitNormal.x)\n * (webGLSourceRadius + webGLSourceArrowHeadLength);\n \n // Target arrow head\n float targetRadius = a_targetRadius * a_targetRadiusCoef;\n float targetDirection = sign(targetRadius);\n float webGLTargetRadius = targetDirection * targetRadius * 2.0 * u_correctionRatio / u_sizeRatio;\n float webGLTargetArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;\n vec2 targetCompensationVector =\n vec2(-targetDirection * unitNormal.y, targetDirection * unitNormal.x)\n * (webGLTargetRadius + webGLTargetArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + sourceCompensationVector + targetCompensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_zoomRatio;\n\n v_normal = unitNormal;\n\n v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n\n v_color.a *= bias;\n}\n"),u=s,h=WebGLRenderingContext,c=h.UNSIGNED_BYTE,d=h.FLOAT,l=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],f={lengthToThicknessRatio:i.D.lengthToThicknessRatio};function g(e){var t=(0,i._)((0,i._)({},f),e||{});return function(e){function n(){return(0,r.b)(this,n),(0,r.c)(this,n,arguments)}return(0,r._)(n,e),(0,r.a)(n,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:u,FRAGMENT_SHADER_SOURCE:i.F,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:l,ATTRIBUTES:[{name:"a_positionStart",size:2,type:d},{name:"a_positionEnd",size:2,type:d},{name:"a_normal",size:2,type:d},{name:"a_color",size:4,type:c,normalized:!0},{name:"a_id",size:4,type:c,normalized:!0},{name:"a_sourceRadius",size:1,type:d},{name:"a_targetRadius",size:1,type:d}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:d},{name:"a_normalCoef",size:1,type:d},{name:"a_sourceRadiusCoef",size:1,type:d},{name:"a_targetRadiusCoef",size:1,type:d}],CONSTANT_DATA:[[0,1,-1,0],[0,-1,1,0],[1,1,0,1],[1,1,0,1],[0,-1,1,0],[1,-1,0,-1]]}}},{key:"processVisibleItem",value:function(e,t,n,i,r){var a=r.size||1,s=n.x,u=n.y,h=i.x,c=i.y,d=(0,o.f)(r.color),l=h-s,f=c-u,g=n.size||1,p=i.size||1,v=l*l+f*f,m=0,y=0;v&&(v=1/Math.sqrt(v),m=-f*v*a,y=l*v*a);var b=this.array;b[t++]=s,b[t++]=u,b[t++]=h,b[t++]=c,b[t++]=m,b[t++]=y,b[t++]=d,b[t++]=e,b[t++]=g,b[t++]=p}},{key:"setUniforms",value:function(e,n){var i=n.gl,r=n.uniformLocations,o=r.u_matrix,a=r.u_zoomRatio,s=r.u_feather,u=r.u_pixelRatio,h=r.u_correctionRatio,c=r.u_sizeRatio,d=r.u_minEdgeThickness,l=r.u_lengthToThicknessRatio;i.uniformMatrix3fv(o,!1,e.matrix),i.uniform1f(a,e.zoomRatio),i.uniform1f(c,e.sizeRatio),i.uniform1f(h,e.correctionRatio),i.uniform1f(u,e.pixelRatio),i.uniform1f(s,e.antiAliasingFeather),i.uniform1f(d,e.minEdgeThickness),i.uniform1f(l,t.lengthToThicknessRatio)}}])}(i.g)}g();function p(e){return(0,i.h)([g(e),(0,i.i)(e),(0,i.i)((0,i._)((0,i._)({},e),{},{extremity:"source"}))])}p();var v=WebGLRenderingContext,m=(v.UNSIGNED_BYTE,v.FLOAT,WebGLRenderingContext),y=(m.UNSIGNED_BYTE,m.FLOAT,n(9235),n(640));function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function w(e){if(Array.isArray(e))return b(e)}function _(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function x(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e){return w(e)||_(e)||x(e)||E()}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function C(e){var t=R(e,"string");return"symbol"==typeof t?t:t+""}function S(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,C(i.key),i)}}function A(e,t,n){return t&&S(e.prototype,t),n&&S(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function G(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(G=function(){return!!e})()}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return D(e)}function F(e,t,n){return t=L(t),N(e,G()?Reflect.construct(t,n||[],L(e).constructor):t.apply(e,n))}function M(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=L(e)););return e}function P(){return P="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=M(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},P.apply(null,arguments)}function z(e,t,n,i){var r=P(L(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}function I(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}function U(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(t.includes(i))continue;n[i]=e[i]}return n}function j(e,t){if(null==e)return{};var n,i,r=B(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){U(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function V(e){var t=e.texturesCount,n="\nprecision highp float;\n\nvarying vec4 v_color;\nvarying vec2 v_diffVector;\nvarying float v_radius;\nvarying vec4 v_texture;\nvarying float v_textureIndex;\n\nuniform sampler2D u_atlas[".concat(t,"];\nuniform float u_correctionRatio;\nuniform float u_cameraAngle;\nuniform float u_percentagePadding;\nuniform bool u_colorizeImages;\nuniform bool u_keepWithinCircle;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n\nconst float radius = 0.5;\n\nvoid main(void) {\n float border = 2.0 * u_correctionRatio;\n float dist = length(v_diffVector);\n vec4 color = gl_FragColor;\n\n float c = cos(-u_cameraAngle);\n float s = sin(-u_cameraAngle);\n vec2 diffVector = mat2(c, s, -s, c) * (v_diffVector);\n\n // No antialiasing for picking mode:\n #ifdef PICKING_MODE\n border = 0.0;\n color = v_color;\n\n #else\n // First case: No image to display\n if (v_texture.w <= 0.0) {\n if (!u_colorizeImages) {\n color = v_color;\n }\n }\n\n // Second case: Image loaded into the texture\n else {\n float paddingRatio = 1.0 + 2.0 * u_percentagePadding;\n float coef = u_keepWithinCircle ? 1.0 : ").concat(Math.SQRT2,";\n vec2 coordinateInTexture = diffVector * vec2(paddingRatio, -paddingRatio) / v_radius / 2.0 * coef + vec2(0.5, 0.5);\n int index = int(v_textureIndex + 0.5); // +0.5 avoid rounding errors\n\n bool noTextureFound = false;\n vec4 texel;\n\n ").concat(k(new Array(t)).map((function(e,t){return"if (index == ".concat(t,") texel = texture2D(u_atlas[").concat(t,"], (v_texture.xy + coordinateInTexture * v_texture.zw), -1.0);")})).join("\n else ")+"else {\n texel = texture2D(u_atlas[0], (v_texture.xy + coordinateInTexture * v_texture.zw), -1.0);\n noTextureFound = true;\n }",'\n\n if (noTextureFound) {\n color = v_color;\n } else {\n // Colorize all visible image pixels:\n if (u_colorizeImages) {\n color = mix(gl_FragColor, v_color, texel.a);\n }\n\n // Colorize background pixels, keep image pixel colors:\n else {\n color = vec4(mix(v_color, texel, texel.a).rgb, max(texel.a, v_color.a));\n }\n\n // Erase pixels "in the padding":\n if (abs(diffVector.x) > v_radius / paddingRatio || abs(diffVector.y) > v_radius / paddingRatio) {\n color = u_colorizeImages ? gl_FragColor : v_color;\n }\n }\n }\n #endif\n\n // Crop in a circle when u_keepWithinCircle is truthy:\n if (u_keepWithinCircle) {\n if (dist < v_radius - border) {\n gl_FragColor = color;\n } else if (dist < v_radius) {\n gl_FragColor = mix(transparent, color, (v_radius - dist) / border);\n }\n }\n\n // Crop in a square else:\n else {\n float squareHalfSize = v_radius * ').concat(Math.SQRT1_2*Math.cos(Math.PI/12),";\n if (abs(diffVector.x) > squareHalfSize || abs(diffVector.y) > squareHalfSize) {\n gl_FragColor = transparent;\n } else {\n gl_FragColor = color;\n }\n }\n}\n");return n}var q="\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute vec2 a_position;\nattribute float a_size;\nattribute float a_angle;\nattribute vec4 a_texture;\nattribute float a_textureIndex;\n\nuniform mat3 u_matrix;\nuniform float u_sizeRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_diffVector;\nvarying float v_radius;\nvarying vec4 v_texture;\nvarying float v_textureIndex;\n\nconst float bias = 255.0 / 254.0;\nconst float marginRatio = 1.05;\n\nvoid main() {\n float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;\n vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));\n vec2 position = a_position + diffVector * marginRatio;\n gl_Position = vec4(\n (u_matrix * vec3(position, 1)).xy,\n 0,\n 1\n );\n\n v_diffVector = diffVector;\n v_radius = size / 2.0 / marginRatio;\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n\n // Pass the texture coordinates:\n v_textureIndex = a_textureIndex;\n v_texture = a_texture;\n #endif\n\n v_color.a *= bias;\n}\n",Y=q;function X(){X=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function h(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),s=new L(i||[]);return r(a,"_invoke",{value:R(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var l="suspendedStart",f="suspendedYield",g="executing",p="completed",v={};function m(){}function y(){}function b(){}var w={};h(w,a,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(G([])));x&&x!==n&&i.call(x,a)&&(w=x);var E=b.prototype=m.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(r,o,a,s){var u=d(e[r],e,o);if("throw"!==u.type){var h=u.arg,c=h.value;return c&&"object"==typeof c&&i.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(c).then((function(e){h.value=e,a(h)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var o;r(this,"_invoke",{value:function(e,i){function r(){return new t((function(t,r){n(e,i,t,r)}))}return o=o?o.then(r,r):r()}})}function R(t,n,i){var r=l;return function(o,a){if(r===g)throw Error("Generator is already running");if(r===p){if("throw"===o)throw a;return{value:e,done:!0}}for(i.method=o,i.arg=a;;){var s=i.delegate;if(s){var u=C(s,i);if(u){if(u===v)continue;return u}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===l)throw r=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=g;var h=d(t,n,i);if("normal"===h.type){if(r=i.done?p:f,h.arg===v)continue;return{value:h.arg,done:i.done}}"throw"===h.type&&(r=p,i.method="throw",i.arg=h.arg)}}}function C(t,n){var i=n.method,r=t.iterator[i];if(r===e)return n.delegate=null,"throw"===i&&t.iterator.return&&(n.method="return",n.arg=e,C(t,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),v;var o=d(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function G(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r<t.length;)if(i.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return y.prototype=b,r(E,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:y,configurable:!0}),y.displayName=h(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,h(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},k(T.prototype),h(T.prototype,s,(function(){return this})),t.AsyncIterator=T,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new T(c(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(E),h(E,u,"Generator"),h(E,a,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=G,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(i,r){return s.type="throw",s.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),h=i.call(a,"finallyLoc");if(u&&h){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;A(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:G(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),v}},t}function Z(e,t,n,i,r,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function K(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){Z(o,i,r,a,s,"next",e)}function s(e){Z(o,i,r,a,s,"throw",e)}a(void 0)}))}}var Q={size:{mode:"max",value:512},objectFit:"cover",correctCentering:!1,maxTextureSize:4096,debounceTimeout:500,crossOrigin:"anonymous"},$=1;function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.crossOrigin;return new Promise((function(t,i){var r=new Image;r.addEventListener("load",(function(){t(r)}),{once:!0}),r.addEventListener("error",(function(e){i(e.error)}),{once:!0}),n&&r.setAttribute("crossOrigin",n),r.src=e}))}function ee(e){return te.apply(this,arguments)}function te(){return te=K(X().mark((function e(t){var n,i,r,o,a,s,u,h,c,d,l,f,g,p=arguments;return X().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=p.length>1&&void 0!==p[1]?p[1]:{},i=n.size,r=n.crossOrigin,"use-credentials"!==r){e.next=7;break}return e.next=4,fetch(t,{credentials:"include"});case 4:o=e.sent,e.next=10;break;case 7:return e.next=9,fetch(t);case 9:o=e.sent;case 10:return e.next=12,o.text();case 12:if(a=e.sent,s=(new DOMParser).parseFromString(a,"image/svg+xml"),u=s.documentElement,h=u.getAttribute("width"),c=u.getAttribute("height"),h&&c){e.next=19;break}throw new Error("loadSVGImage: cannot use `size` if target SVG has no definite dimensions.");case 19:return"number"===typeof i&&(u.setAttribute("width",""+i),u.setAttribute("height",""+i)),d=(new XMLSerializer).serializeToString(s),l=new Blob([d],{type:"image/svg+xml"}),f=URL.createObjectURL(l),g=J(f),g["finally"]((function(){return URL.revokeObjectURL(f)})),e.abrupt("return",g);case 26:case"end":return e.stop()}}),e)}))),te.apply(this,arguments)}function ne(e){return ie.apply(this,arguments)}function ie(){return ie=K(X().mark((function e(t){var n,i,r,o,a,s,u=arguments;return X().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=u.length>1&&void 0!==u[1]?u[1]:{},r=i.size,o=i.crossOrigin,a="svg"===(null===(n=t.split(/[#?]/)[0].split(".").pop())||void 0===n?void 0:n.trim().toLowerCase()),!a||!r){e.next=16;break}return e.prev=3,e.next=6,ee(t,{size:r,crossOrigin:o});case 6:s=e.sent,e.next=14;break;case 9:return e.prev=9,e.t0=e["catch"](3),e.next=13,J(t,{crossOrigin:o});case 13:s=e.sent;case 14:e.next=19;break;case 16:return e.next=18,J(t,{crossOrigin:o});case 18:s=e.sent;case 19:return e.abrupt("return",s);case 20:case"end":return e.stop()}}),e,null,[[3,9]])}))),ie.apply(this,arguments)}function re(e,t,n){var i=n.objectFit,r=n.size,o=n.correctCentering,a="contain"===i?Math.max(e.width,e.height):Math.min(e.width,e.height),s="auto"===r.mode?a:"force"===r.mode?r.value:Math.min(r.value,a),u=(e.width-a)/2,h=(e.height-a)/2;if(o){var c=t.getCorrectionOffset(e,a);u=c.x,h=c.y}return{sourceX:u,sourceY:h,sourceSize:a,destinationSize:s}}function oe(e,t,n){for(var i=t.canvas,r=i.width,o=i.height,a=[],s=n.x,u=n.y,h=n.rowHeight,c=n.maxRowWidth,d={},l=0,f=e.length;l<f;l++){var g=e[l],p=g.key,v=g.image,m=g.sourceSize,y=g.sourceX,b=g.sourceY,w=g.destinationSize,_=w+$;u+_>o||s+_>r&&u+_+h>o||(s+_>r&&(c=Math.max(c,s),s=0,u+=h,h=_),a.push({key:p,image:v,sourceX:y,sourceY:b,sourceSize:m,destinationX:s,destinationY:u,destinationSize:w}),d[p]={x:s,y:u,size:w},s+=_,h=Math.max(h,_))}c=Math.max(c,s);for(var x=c,E=u+h,k=0,T=a.length;k<T;k++){var R=a[k],C=R.image,S=R.sourceSize,A=R.sourceX,L=R.sourceY,G=R.destinationSize,D=R.destinationX,N=R.destinationY;t.drawImage(C,A,L,S,S,D,N,G,G)}return{atlas:d,texture:t.getImageData(0,0,x,E),cursor:{x:s,y:u,rowHeight:h,maxRowWidth:c}}}function ae(e,t,n){var i=e.atlas,r=e.textures,o=e.cursor,a={atlas:H({},i),textures:k(r.slice(0,-1)),cursor:H({},o)},s=[];for(var u in t){var h,c=t[u];if("ready"===c.status){var d=null===(h=i[u])||void 0===h?void 0:h.textureIndex;"number"!==typeof d&&s.push(H({key:u},c))}}var l=function(){var e=oe(s,n,a.cursor),t=e.atlas,i=e.texture,r=e.cursor;a.cursor=r;var o=[];s.forEach((function(e){t[e.key]?a.atlas[e.key]=H(H({},t[e.key]),{},{textureIndex:a.textures.length}):o.push(e)})),a.textures.push(i),s=o,s.length&&(a.cursor={x:0,y:0,rowHeight:0,maxRowWidth:0},n.clearRect(0,0,n.canvas.width,n.canvas.height))};while(s.length)l();return a}var se=function(){function e(){T(this,e),this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",{willReadFrequently:!0})}return A(e,[{key:"getCorrectionOffset",value:function(e,t){this.canvas.width=t,this.canvas.height=t,this.context.clearRect(0,0,t,t),this.context.drawImage(e,0,0,t,t);for(var n=this.context.getImageData(0,0,t,t).data,i=new Uint8ClampedArray(n.length/4),r=0;r<n.length;r++)i[r]=n[4*r+3];for(var o=0,a=0,s=0,u=0;u<t;u++)for(var h=0;h<t;h++){var c=i[u*t+h];s+=c,o+=c*h,a+=c*u}var d=o/s,l=a/s;return{x:d-t/2,y:l-t/2}}}]),e}(),ue=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return T(this,t),e=F(this,t),U(D(e),"canvas",document.createElement("canvas")),U(D(e),"ctx",e.canvas.getContext("2d",{willReadFrequently:!0})),U(D(e),"corrector",new se),U(D(e),"imageStates",{}),U(D(e),"textures",[e.ctx.getImageData(0,0,1,1)]),U(D(e),"lastTextureCursor",{x:0,y:0,rowHeight:0,maxRowWidth:0}),U(D(e),"atlas",{}),e.options=H(H({},Q),n),e.canvas.width=e.options.maxTextureSize,e.canvas.height=e.options.maxTextureSize,e}return I(t,e),A(t,[{key:"scheduleGenerateTexture",value:function(){var e=this;"number"!==typeof this.frameId&&("number"===typeof this.options.debounceTimeout?this.frameId=window.setTimeout((function(){e.generateTextures(),e.frameId=void 0}),this.options.debounceTimeout):this.generateTextures())}},{key:"generateTextures",value:function(){var e=ae({atlas:this.atlas,textures:this.textures,cursor:this.lastTextureCursor},this.imageStates,this.ctx),n=e.atlas,i=e.textures,r=e.cursor;this.atlas=n,this.textures=i,this.lastTextureCursor=r,this.emit(t.NEW_TEXTURE_EVENT,{atlas:n,textures:i})}},{key:"registerImage",value:function(){var e=K(X().mark((function e(t){var n,i;return X().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!this.imageStates[t]){e.next=2;break}return e.abrupt("return");case 2:return this.imageStates[t]={status:"loading"},e.prev=3,n=this.options.size,e.next=7,ne(t,{size:"force"===n.mode?n.value:void 0,crossOrigin:this.options.crossOrigin||void 0});case 7:i=e.sent,this.imageStates[t]=H({status:"ready",image:i},re(i,this.corrector,this.options)),this.scheduleGenerateTexture(),e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](3),this.imageStates[t]={status:"error"};case 15:case"end":return e.stop()}}),e,this,[[3,12]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getAtlas",value:function(){return this.atlas}},{key:"getTextures",value:function(){return this.textures}}]),t}(y.EventEmitter);U(ue,"NEW_TEXTURE_EVENT","newTexture");var he=["drawHover","drawLabel","drawingMode","keepWithinCircle","padding","colorAttribute","imageAttribute"],ce=WebGLRenderingContext,de=ce.UNSIGNED_BYTE,le=ce.FLOAT,fe=H(H({},Q),{},{drawingMode:"background",keepWithinCircle:!0,drawLabel:void 0,drawHover:void 0,padding:0,colorAttribute:"color",imageAttribute:"image"}),ge=["u_sizeRatio","u_correctionRatio","u_cameraAngle","u_percentagePadding","u_matrix","u_colorizeImages","u_keepWithinCircle","u_atlas"];function pe(e){var t,n=document.createElement("canvas").getContext("webgl"),r=Math.min(n.getParameter(n.MAX_TEXTURE_SIZE),Q.maxTextureSize);n.canvas.remove();var a=H(H(H({},fe),{maxTextureSize:r}),e||{}),s=a.drawHover,u=a.drawLabel,h=a.drawingMode,c=a.keepWithinCircle,d=a.padding,l=a.colorAttribute,f=a.imageAttribute,g=j(a,he),p=new ue(g);return t=function(e){function t(e,n,i){var r;return T(this,t),r=F(this,t,[e,n,i]),U(D(r),"drawLabel",u),U(D(r),"drawHover",s),U(D(r),"textureManagerCallback",null),r.textureManagerCallback=function(e){var t=e.atlas,n=e.textures,i=n.length!==r.textures.length;r.atlas=t,r.textureImages=n,i&&r.upgradeShaders(),r.bindTextures(),r.latestRenderParams&&r.render(r.latestRenderParams),r.renderer&&r.renderer.refresh&&r.renderer.refresh()},p.on(ue.NEW_TEXTURE_EVENT,r.textureManagerCallback),r.atlas=p.getAtlas(),r.textureImages=p.getTextures(),r.textures=r.textureImages.map((function(){return e.createTexture()})),r.bindTextures(),r}return I(t,e),A(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:Y,FRAGMENT_SHADER_SOURCE:V({texturesCount:p.getTextures().length}),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:ge,ATTRIBUTES:[{name:"a_position",size:2,type:le},{name:"a_size",size:1,type:le},{name:"a_color",size:4,type:de,normalized:!0},{name:"a_id",size:4,type:de,normalized:!0},{name:"a_texture",size:4,type:le},{name:"a_textureIndex",size:1,type:le}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:le}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"upgradeShaders",value:function(){var e=this.getDefinition(),t=this.normalProgram,n=t.program,i=t.buffer,r=t.vertexShader,o=t.fragmentShader,a=t.gl;a.deleteProgram(n),a.deleteBuffer(i),a.deleteShader(r),a.deleteShader(o),this.normalProgram=this.getProgramInfo("normal",a,e.VERTEX_SHADER_SOURCE,e.FRAGMENT_SHADER_SOURCE,null)}},{key:"kill",value:function(){var e,n=null===(e=this.normalProgram)||void 0===e?void 0:e.gl;if(n)for(var i=0;i<this.textures.length;i++)n.deleteTexture(this.textures[i]);this.textureManagerCallback&&(p.off(ue.NEW_TEXTURE_EVENT,this.textureManagerCallback),this.textureManagerCallback=null),z(t,"kill",this,3)([])}},{key:"bindTextures",value:function(){for(var e=this.normalProgram.gl,t=0;t<this.textureImages.length;t++){if(t>=this.textures.length){var n=e.createTexture();n&&this.textures.push(n)}e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.textures[t]),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.textureImages[t]),e.generateMipmap(e.TEXTURE_2D)}}},{key:"renderProgram",value:function(e,n){if(!n.isPicking)for(var i=n.gl,r=0;r<this.textureImages.length;r++)i.activeTexture(i.TEXTURE0+r),i.bindTexture(i.TEXTURE_2D,this.textures[r]);z(t,"renderProgram",this,3)([e,n])}},{key:"processVisibleItem",value:function(e,t,n){var i=this.array,r=(0,o.f)(n[l]),a=n[f],s=a?this.atlas[a]:void 0;if("string"!==typeof a||s||p.registerImage(a),i[t++]=n.x,i[t++]=n.y,i[t++]=n.size,i[t++]=r,i[t++]=e,s&&"number"===typeof s.textureIndex){var u=this.textureImages[s.textureIndex],h=u.width,c=u.height;i[t++]=s.x/h,i[t++]=s.y/c,i[t++]=s.size/h,i[t++]=s.size/c,i[t++]=s.textureIndex}else i[t++]=0,i[t++]=0,i[t++]=0,i[t++]=0,i[t++]=0}},{key:"setUniforms",value:function(e,t){var n=t.gl,i=t.uniformLocations,r=i.u_sizeRatio,o=i.u_correctionRatio,a=i.u_matrix,s=i.u_atlas,u=i.u_colorizeImages,l=i.u_keepWithinCircle,f=i.u_cameraAngle,g=i.u_percentagePadding;this.latestRenderParams=e,n.uniform1f(o,e.correctionRatio),n.uniform1f(r,c?e.sizeRatio:e.sizeRatio/Math.SQRT2),n.uniform1f(f,e.cameraAngle),n.uniform1f(g,d),n.uniformMatrix3fv(a,!1,e.matrix),n.uniform1iv(s,k(new Array(this.textureImages.length)).map((function(e,t){return t}))),n.uniform1i(u,"color"===h?1:0),n.uniform1i(l,c?1:0)}}]),t}(i.f),U(t,"ANGLE_1",0),U(t,"ANGLE_2",2*Math.PI/3),U(t,"ANGLE_3",4*Math.PI/3),U(t,"textureManager",p),t}var ve=pe(),me=pe({keepWithinCircle:!1,size:{mode:"force",value:256},drawingMode:"color",correctCentering:!0})},9692:e=>{e.exports={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}},8085:(e,t)=>{var n=10,i=3;t.assign=function(e){e=e||{};var t,n,i,r=Array.prototype.slice.call(arguments).slice(1);for(t=0,i=r.length;t<i;t++)if(r[t])for(n in r[t])e[n]=r[t][n];return e},t.validateSettings=function(e){return"linLogMode"in e&&"boolean"!==typeof e.linLogMode?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in e&&"boolean"!==typeof e.outboundAttractionDistribution?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in e&&"boolean"!==typeof e.adjustSizes?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in e&&"number"!==typeof e.edgeWeightInfluence?{message:"the `edgeWeightInfluence` setting should be a number."}:!("scalingRatio"in e)||"number"===typeof e.scalingRatio&&e.scalingRatio>=0?"strongGravityMode"in e&&"boolean"!==typeof e.strongGravityMode?{message:"the `strongGravityMode` setting should be a boolean."}:!("gravity"in e)||"number"===typeof e.gravity&&e.gravity>=0?"slowDown"in e&&!("number"===typeof e.slowDown||e.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in e&&"boolean"!==typeof e.barnesHutOptimize?{message:"the `barnesHutOptimize` setting should be a boolean."}:!("barnesHutTheta"in e)||"number"===typeof e.barnesHutTheta&&e.barnesHutTheta>=0?null:{message:"the `barnesHutTheta` setting should be a number >= 0."}:{message:"the `gravity` setting should be a number >= 0."}:{message:"the `scalingRatio` setting should be a number >= 0."}},t.graphToByteArrays=function(e,t){var r,o=e.order,a=e.size,s={},u=new Float32Array(o*n),h=new Float32Array(a*i);return r=0,e.forEachNode((function(e,t){s[e]=r,u[r]=t.x,u[r+1]=t.y,u[r+2]=0,u[r+3]=0,u[r+4]=0,u[r+5]=0,u[r+6]=1,u[r+7]=1,u[r+8]=t.size||1,u[r+9]=t.fixed?1:0,r+=n})),r=0,e.forEachEdge((function(e,n,o,a,c,d,l){var f=s[o],g=s[a],p=t(e,n,o,a,c,d,l);u[f+6]+=p,u[g+6]+=p,h[r]=f,h[r+1]=g,h[r+2]=p,r+=i})),{nodes:u,edges:h}},t.assignLayoutChanges=function(e,t,i){var r=0;e.updateEachNodeAttributes((function(e,o){return o.x=t[r],o.y=t[r+1],r+=n,i?i(e,o):o}))},t.readGraphPositions=function(e,t){var i=0;e.forEachNode((function(e,r){t[i]=r.x,t[i+1]=r.y,i+=n}))},t.collectLayoutChanges=function(e,t,i){for(var r=e.nodes(),o={},a=0,s=0,u=t.length;a<u;a+=n){if(i){var h=Object.assign({},e.getNodeAttributes(r[s]));h.x=t[a],h.y=t[a+1],h=i(r[s],h),o[r[s]]={x:h.x,y:h.y}}else o[r[s]]={x:t[a],y:t[a+1]};s++}return o},t.createWorker=function(e){var t=window.URL||window.webkitURL,n=e.toString(),i=t.createObjectURL(new Blob(["("+n+").call(this);"],{type:"text/javascript"})),r=new Worker(i);return t.revokeObjectURL(i),r}},1944:(e,t,n)=>{var i=n(9235),r=n(2936).Fd,o=n(2454),a=n(8085),s=n(9692);function u(e,t,n){if(!i(t))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");"number"===typeof n&&(n={iterations:n});var u=n.iterations;if("number"!==typeof u)throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(u<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var h=r("getEdgeWeight"in n?n.getEdgeWeight:"weight").fromEntry,c="function"===typeof n.outputReducer?n.outputReducer:null,d=a.assign({},s,n.settings),l=a.validateSettings(d);if(l)throw new Error("graphology-layout-forceatlas2: "+l.message);var f,g=a.graphToByteArrays(t,h);for(f=0;f<u;f++)o(d,g.nodes,g.edges);if(!e)return a.collectLayoutChanges(t,g.nodes);a.assignLayoutChanges(t,g.nodes,c)}function h(e){var t="number"===typeof e?e:e.order;return{barnesHutOptimize:t>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(t)}}var c=u.bind(null,!1);c.assign=u.bind(null,!0),c.inferSettings=h,e.exports=c},2454:e=>{var t=0,n=1,i=2,r=3,o=4,a=5,s=6,u=7,h=8,c=9,d=0,l=1,f=2,g=0,p=1,v=2,m=3,y=4,b=5,w=6,_=7,x=8,E=3,k=10,T=3,R=9,C=10;e.exports=function(e,S,A){var L,G,D,N,F,M,P,z,O,I,U,B,j,W,H,V,q,Y,X,Z,K,Q,$,J=S.length,ee=A.length,te=e.adjustSizes,ne=e.barnesHutTheta*e.barnesHutTheta,ie=[];for(D=0;D<J;D+=k)S[D+o]=S[D+i],S[D+a]=S[D+r],S[D+i]=0,S[D+r]=0;if(e.outboundAttractionDistribution){for(U=0,D=0;D<J;D+=k)U+=S[D+s];U/=J/k}if(e.barnesHutOptimize){var re,oe,ae,se=1/0,ue=-1/0,he=1/0,ce=-1/0;for(D=0;D<J;D+=k)se=Math.min(se,S[D+t]),ue=Math.max(ue,S[D+t]),he=Math.min(he,S[D+n]),ce=Math.max(ce,S[D+n]);var de=ue-se,le=ce-he;for(de>le?(he-=(de-le)/2,ce=he+de):(se-=(le-de)/2,ue=se+le),ie[0+g]=-1,ie[0+p]=(se+ue)/2,ie[0+v]=(he+ce)/2,ie[0+m]=Math.max(ue-se,ce-he),ie[0+y]=-1,ie[0+b]=-1,ie[0+w]=0,ie[0+_]=0,ie[0+x]=0,L=1,D=0;D<J;D+=k){G=0,ae=E;while(1){if(!(ie[G+b]>=0)){if(ie[G+g]<0){ie[G+g]=D;break}if(ie[G+b]=L*R,z=ie[G+m]/2,O=ie[G+b],ie[O+g]=-1,ie[O+p]=ie[G+p]-z,ie[O+v]=ie[G+v]-z,ie[O+m]=z,ie[O+y]=O+R,ie[O+b]=-1,ie[O+w]=0,ie[O+_]=0,ie[O+x]=0,O+=R,ie[O+g]=-1,ie[O+p]=ie[G+p]-z,ie[O+v]=ie[G+v]+z,ie[O+m]=z,ie[O+y]=O+R,ie[O+b]=-1,ie[O+w]=0,ie[O+_]=0,ie[O+x]=0,O+=R,ie[O+g]=-1,ie[O+p]=ie[G+p]+z,ie[O+v]=ie[G+v]-z,ie[O+m]=z,ie[O+y]=O+R,ie[O+b]=-1,ie[O+w]=0,ie[O+_]=0,ie[O+x]=0,O+=R,ie[O+g]=-1,ie[O+p]=ie[G+p]+z,ie[O+v]=ie[G+v]+z,ie[O+m]=z,ie[O+y]=ie[G+y],ie[O+b]=-1,ie[O+w]=0,ie[O+_]=0,ie[O+x]=0,L+=4,re=S[ie[G+g]+t]<ie[G+p]?S[ie[G+g]+n]<ie[G+v]?ie[G+b]:ie[G+b]+R:S[ie[G+g]+n]<ie[G+v]?ie[G+b]+2*R:ie[G+b]+3*R,ie[G+w]=S[ie[G+g]+s],ie[G+_]=S[ie[G+g]+t],ie[G+x]=S[ie[G+g]+n],ie[re+g]=ie[G+g],ie[G+g]=-1,oe=S[D+t]<ie[G+p]?S[D+n]<ie[G+v]?ie[G+b]:ie[G+b]+R:S[D+n]<ie[G+v]?ie[G+b]+2*R:ie[G+b]+3*R,re===oe){if(ae--){G=re;continue}ae=E;break}ie[oe+g]=D;break}re=S[D+t]<ie[G+p]?S[D+n]<ie[G+v]?ie[G+b]:ie[G+b]+R:S[D+n]<ie[G+v]?ie[G+b]+2*R:ie[G+b]+3*R,ie[G+_]=(ie[G+_]*ie[G+w]+S[D+t]*S[D+s])/(ie[G+w]+S[D+s]),ie[G+x]=(ie[G+x]*ie[G+w]+S[D+n]*S[D+s])/(ie[G+w]+S[D+s]),ie[G+w]+=S[D+s],G=re}}}if(e.barnesHutOptimize)for(B=e.scalingRatio,D=0;D<J;D+=k){G=0;while(1)if(ie[G+b]>=0){if(V=Math.pow(S[D+t]-ie[G+_],2)+Math.pow(S[D+n]-ie[G+x],2),I=ie[G+m],4*I*I/V<ne){if(j=S[D+t]-ie[G+_],W=S[D+n]-ie[G+x],!0===te?V>0?(q=B*S[D+s]*ie[G+w]/V,S[D+i]+=j*q,S[D+r]+=W*q):V<0&&(q=-B*S[D+s]*ie[G+w]/Math.sqrt(V),S[D+i]+=j*q,S[D+r]+=W*q):V>0&&(q=B*S[D+s]*ie[G+w]/V,S[D+i]+=j*q,S[D+r]+=W*q),G=ie[G+y],G<0)break;continue}G=ie[G+b]}else if(M=ie[G+g],M>=0&&M!==D&&(j=S[D+t]-S[M+t],W=S[D+n]-S[M+n],V=j*j+W*W,!0===te?V>0?(q=B*S[D+s]*S[M+s]/V,S[D+i]+=j*q,S[D+r]+=W*q):V<0&&(q=-B*S[D+s]*S[M+s]/Math.sqrt(V),S[D+i]+=j*q,S[D+r]+=W*q):V>0&&(q=B*S[D+s]*S[M+s]/V,S[D+i]+=j*q,S[D+r]+=W*q)),G=ie[G+y],G<0)break}else for(B=e.scalingRatio,N=0;N<J;N+=k)for(F=0;F<N;F+=k)j=S[N+t]-S[F+t],W=S[N+n]-S[F+n],!0===te?(V=Math.sqrt(j*j+W*W)-S[N+h]-S[F+h],V>0?(q=B*S[N+s]*S[F+s]/V/V,S[N+i]+=j*q,S[N+r]+=W*q,S[F+i]-=j*q,S[F+r]-=W*q):V<0&&(q=100*B*S[N+s]*S[F+s],S[N+i]+=j*q,S[N+r]+=W*q,S[F+i]-=j*q,S[F+r]-=W*q)):(V=Math.sqrt(j*j+W*W),V>0&&(q=B*S[N+s]*S[F+s]/V/V,S[N+i]+=j*q,S[N+r]+=W*q,S[F+i]-=j*q,S[F+r]-=W*q));for(O=e.gravity/e.scalingRatio,B=e.scalingRatio,D=0;D<J;D+=k)q=0,j=S[D+t],W=S[D+n],V=Math.sqrt(Math.pow(j,2)+Math.pow(W,2)),e.strongGravityMode?V>0&&(q=B*S[D+s]*O):V>0&&(q=B*S[D+s]*O/V),S[D+i]-=j*q,S[D+r]-=W*q;for(B=1*(e.outboundAttractionDistribution?U:1),P=0;P<ee;P+=T)N=A[P+d],F=A[P+l],z=A[P+f],H=Math.pow(z,e.edgeWeightInfluence),j=S[N+t]-S[F+t],W=S[N+n]-S[F+n],!0===te?(V=Math.sqrt(j*j+W*W)-S[N+h]-S[F+h],e.linLogMode?e.outboundAttractionDistribution?V>0&&(q=-B*H*Math.log(1+V)/V/S[N+s]):V>0&&(q=-B*H*Math.log(1+V)/V):e.outboundAttractionDistribution?V>0&&(q=-B*H/S[N+s]):V>0&&(q=-B*H)):(V=Math.sqrt(Math.pow(j,2)+Math.pow(W,2)),e.linLogMode?e.outboundAttractionDistribution?V>0&&(q=-B*H*Math.log(1+V)/V/S[N+s]):V>0&&(q=-B*H*Math.log(1+V)/V):e.outboundAttractionDistribution?(V=1,q=-B*H/S[N+s]):(V=1,q=-B*H)),V>0&&(S[N+i]+=j*q,S[N+r]+=W*q,S[F+i]-=j*q,S[F+r]-=W*q);if(!0===te)for(D=0;D<J;D+=k)1!==S[D+c]&&(Y=Math.sqrt(Math.pow(S[D+i],2)+Math.pow(S[D+r],2)),Y>C&&(S[D+i]=S[D+i]*C/Y,S[D+r]=S[D+r]*C/Y),X=S[D+s]*Math.sqrt((S[D+o]-S[D+i])*(S[D+o]-S[D+i])+(S[D+a]-S[D+r])*(S[D+a]-S[D+r])),Z=Math.sqrt((S[D+o]+S[D+i])*(S[D+o]+S[D+i])+(S[D+a]+S[D+r])*(S[D+a]+S[D+r]))/2,K=.1*Math.log(1+Z)/(1+Math.sqrt(X)),Q=S[D+t]+S[D+i]*(K/e.slowDown),S[D+t]=Q,$=S[D+n]+S[D+r]*(K/e.slowDown),S[D+n]=$);else for(D=0;D<J;D+=k)1!==S[D+c]&&(X=S[D+s]*Math.sqrt((S[D+o]-S[D+i])*(S[D+o]-S[D+i])+(S[D+a]-S[D+r])*(S[D+a]-S[D+r])),Z=Math.sqrt((S[D+o]+S[D+i])*(S[D+o]+S[D+i])+(S[D+a]+S[D+r])*(S[D+a]+S[D+r]))/2,K=S[D+u]*Math.log(1+Z)/(1+Math.sqrt(X)),S[D+u]=Math.min(1,Math.sqrt(K*(Math.pow(S[D+i],2)+Math.pow(S[D+r],2))/(1+Math.sqrt(X)))),Q=S[D+t]+S[D+i]*(K/e.slowDown),S[D+t]=Q,$=S[D+n]+S[D+r]*(K/e.slowDown),S[D+n]=$);return{}}},6168:e=>{e.exports=function(){var e,t,n={};(function(){var e=0,t=1,i=2,r=3,o=4,a=5,s=6,u=7,h=8,c=9,d=0,l=1,f=2,g=0,p=1,v=2,m=3,y=4,b=5,w=6,_=7,x=8,E=3,k=10,T=3,R=9,C=10;n.exports=function(n,S,A){var L,G,D,N,F,M,P,z,O,I,U,B,j,W,H,V,q,Y,X,Z,K,Q,$,J=S.length,ee=A.length,te=n.adjustSizes,ne=n.barnesHutTheta*n.barnesHutTheta,ie=[];for(D=0;D<J;D+=k)S[D+o]=S[D+i],S[D+a]=S[D+r],S[D+i]=0,S[D+r]=0;if(n.outboundAttractionDistribution){for(U=0,D=0;D<J;D+=k)U+=S[D+s];U/=J/k}if(n.barnesHutOptimize){var re,oe,ae,se=1/0,ue=-1/0,he=1/0,ce=-1/0;for(D=0;D<J;D+=k)se=Math.min(se,S[D+e]),ue=Math.max(ue,S[D+e]),he=Math.min(he,S[D+t]),ce=Math.max(ce,S[D+t]);var de=ue-se,le=ce-he;for(de>le?(he-=(de-le)/2,ce=he+de):(se-=(le-de)/2,ue=se+le),ie[0+g]=-1,ie[0+p]=(se+ue)/2,ie[0+v]=(he+ce)/2,ie[0+m]=Math.max(ue-se,ce-he),ie[0+y]=-1,ie[0+b]=-1,ie[0+w]=0,ie[0+_]=0,ie[0+x]=0,L=1,D=0;D<J;D+=k){G=0,ae=E;while(1){if(!(ie[G+b]>=0)){if(ie[G+g]<0){ie[G+g]=D;break}if(ie[G+b]=L*R,z=ie[G+m]/2,O=ie[G+b],ie[O+g]=-1,ie[O+p]=ie[G+p]-z,ie[O+v]=ie[G+v]-z,ie[O+m]=z,ie[O+y]=O+R,ie[O+b]=-1,ie[O+w]=0,ie[O+_]=0,ie[O+x]=0,O+=R,ie[O+g]=-1,ie[O+p]=ie[G+p]-z,ie[O+v]=ie[G+v]+z,ie[O+m]=z,ie[O+y]=O+R,ie[O+b]=-1,ie[O+w]=0,ie[O+_]=0,ie[O+x]=0,O+=R,ie[O+g]=-1,ie[O+p]=ie[G+p]+z,ie[O+v]=ie[G+v]-z,ie[O+m]=z,ie[O+y]=O+R,ie[O+b]=-1,ie[O+w]=0,ie[O+_]=0,ie[O+x]=0,O+=R,ie[O+g]=-1,ie[O+p]=ie[G+p]+z,ie[O+v]=ie[G+v]+z,ie[O+m]=z,ie[O+y]=ie[G+y],ie[O+b]=-1,ie[O+w]=0,ie[O+_]=0,ie[O+x]=0,L+=4,re=S[ie[G+g]+e]<ie[G+p]?S[ie[G+g]+t]<ie[G+v]?ie[G+b]:ie[G+b]+R:S[ie[G+g]+t]<ie[G+v]?ie[G+b]+2*R:ie[G+b]+3*R,ie[G+w]=S[ie[G+g]+s],ie[G+_]=S[ie[G+g]+e],ie[G+x]=S[ie[G+g]+t],ie[re+g]=ie[G+g],ie[G+g]=-1,oe=S[D+e]<ie[G+p]?S[D+t]<ie[G+v]?ie[G+b]:ie[G+b]+R:S[D+t]<ie[G+v]?ie[G+b]+2*R:ie[G+b]+3*R,re===oe){if(ae--){G=re;continue}ae=E;break}ie[oe+g]=D;break}re=S[D+e]<ie[G+p]?S[D+t]<ie[G+v]?ie[G+b]:ie[G+b]+R:S[D+t]<ie[G+v]?ie[G+b]+2*R:ie[G+b]+3*R,ie[G+_]=(ie[G+_]*ie[G+w]+S[D+e]*S[D+s])/(ie[G+w]+S[D+s]),ie[G+x]=(ie[G+x]*ie[G+w]+S[D+t]*S[D+s])/(ie[G+w]+S[D+s]),ie[G+w]+=S[D+s],G=re}}}if(n.barnesHutOptimize)for(B=n.scalingRatio,D=0;D<J;D+=k){G=0;while(1)if(ie[G+b]>=0){if(V=Math.pow(S[D+e]-ie[G+_],2)+Math.pow(S[D+t]-ie[G+x],2),I=ie[G+m],4*I*I/V<ne){if(j=S[D+e]-ie[G+_],W=S[D+t]-ie[G+x],!0===te?V>0?(q=B*S[D+s]*ie[G+w]/V,S[D+i]+=j*q,S[D+r]+=W*q):V<0&&(q=-B*S[D+s]*ie[G+w]/Math.sqrt(V),S[D+i]+=j*q,S[D+r]+=W*q):V>0&&(q=B*S[D+s]*ie[G+w]/V,S[D+i]+=j*q,S[D+r]+=W*q),G=ie[G+y],G<0)break;continue}G=ie[G+b]}else if(M=ie[G+g],M>=0&&M!==D&&(j=S[D+e]-S[M+e],W=S[D+t]-S[M+t],V=j*j+W*W,!0===te?V>0?(q=B*S[D+s]*S[M+s]/V,S[D+i]+=j*q,S[D+r]+=W*q):V<0&&(q=-B*S[D+s]*S[M+s]/Math.sqrt(V),S[D+i]+=j*q,S[D+r]+=W*q):V>0&&(q=B*S[D+s]*S[M+s]/V,S[D+i]+=j*q,S[D+r]+=W*q)),G=ie[G+y],G<0)break}else for(B=n.scalingRatio,N=0;N<J;N+=k)for(F=0;F<N;F+=k)j=S[N+e]-S[F+e],W=S[N+t]-S[F+t],!0===te?(V=Math.sqrt(j*j+W*W)-S[N+h]-S[F+h],V>0?(q=B*S[N+s]*S[F+s]/V/V,S[N+i]+=j*q,S[N+r]+=W*q,S[F+i]-=j*q,S[F+r]-=W*q):V<0&&(q=100*B*S[N+s]*S[F+s],S[N+i]+=j*q,S[N+r]+=W*q,S[F+i]-=j*q,S[F+r]-=W*q)):(V=Math.sqrt(j*j+W*W),V>0&&(q=B*S[N+s]*S[F+s]/V/V,S[N+i]+=j*q,S[N+r]+=W*q,S[F+i]-=j*q,S[F+r]-=W*q));for(O=n.gravity/n.scalingRatio,B=n.scalingRatio,D=0;D<J;D+=k)q=0,j=S[D+e],W=S[D+t],V=Math.sqrt(Math.pow(j,2)+Math.pow(W,2)),n.strongGravityMode?V>0&&(q=B*S[D+s]*O):V>0&&(q=B*S[D+s]*O/V),S[D+i]-=j*q,S[D+r]-=W*q;for(B=1*(n.outboundAttractionDistribution?U:1),P=0;P<ee;P+=T)N=A[P+d],F=A[P+l],z=A[P+f],H=Math.pow(z,n.edgeWeightInfluence),j=S[N+e]-S[F+e],W=S[N+t]-S[F+t],!0===te?(V=Math.sqrt(j*j+W*W)-S[N+h]-S[F+h],n.linLogMode?n.outboundAttractionDistribution?V>0&&(q=-B*H*Math.log(1+V)/V/S[N+s]):V>0&&(q=-B*H*Math.log(1+V)/V):n.outboundAttractionDistribution?V>0&&(q=-B*H/S[N+s]):V>0&&(q=-B*H)):(V=Math.sqrt(Math.pow(j,2)+Math.pow(W,2)),n.linLogMode?n.outboundAttractionDistribution?V>0&&(q=-B*H*Math.log(1+V)/V/S[N+s]):V>0&&(q=-B*H*Math.log(1+V)/V):n.outboundAttractionDistribution?(V=1,q=-B*H/S[N+s]):(V=1,q=-B*H)),V>0&&(S[N+i]+=j*q,S[N+r]+=W*q,S[F+i]-=j*q,S[F+r]-=W*q);if(!0===te)for(D=0;D<J;D+=k)1!==S[D+c]&&(Y=Math.sqrt(Math.pow(S[D+i],2)+Math.pow(S[D+r],2)),Y>C&&(S[D+i]=S[D+i]*C/Y,S[D+r]=S[D+r]*C/Y),X=S[D+s]*Math.sqrt((S[D+o]-S[D+i])*(S[D+o]-S[D+i])+(S[D+a]-S[D+r])*(S[D+a]-S[D+r])),Z=Math.sqrt((S[D+o]+S[D+i])*(S[D+o]+S[D+i])+(S[D+a]+S[D+r])*(S[D+a]+S[D+r]))/2,K=.1*Math.log(1+Z)/(1+Math.sqrt(X)),Q=S[D+e]+S[D+i]*(K/n.slowDown),S[D+e]=Q,$=S[D+t]+S[D+r]*(K/n.slowDown),S[D+t]=$);else for(D=0;D<J;D+=k)1!==S[D+c]&&(X=S[D+s]*Math.sqrt((S[D+o]-S[D+i])*(S[D+o]-S[D+i])+(S[D+a]-S[D+r])*(S[D+a]-S[D+r])),Z=Math.sqrt((S[D+o]+S[D+i])*(S[D+o]+S[D+i])+(S[D+a]+S[D+r])*(S[D+a]+S[D+r]))/2,K=S[D+u]*Math.log(1+Z)/(1+Math.sqrt(X)),S[D+u]=Math.min(1,Math.sqrt(K*(Math.pow(S[D+i],2)+Math.pow(S[D+r],2))/(1+Math.sqrt(X)))),Q=S[D+e]+S[D+i]*(K/n.slowDown),S[D+e]=Q,$=S[D+t]+S[D+r]*(K/n.slowDown),S[D+t]=$);return{}}})();var i=n.exports;self.addEventListener("message",(function(n){var r=n.data;e=new Float32Array(r.nodes),r.edges&&(t=new Float32Array(r.edges)),i(r.settings,e,t),self.postMessage({nodes:e.buffer},[e.buffer])}))}},3668:(e,t,n)=>{var i=n(6168),r=n(9235),o=n(2936).Fd,a=n(8085),s=n(9692);function u(e,t){if(t=t||{},!r(e))throw new Error("graphology-layout-forceatlas2/worker: the given graph is not a valid graphology instance.");var n=o("getEdgeWeight"in t?t.getEdgeWeight:"weight").fromEntry,i=a.assign({},s,t.settings),u=a.validateSettings(i);if(u)throw new Error("graphology-layout-forceatlas2/worker: "+u.message);this.worker=null,this.graph=e,this.settings=i,this.getEdgeWeight=n,this.matrices=null,this.running=!1,this.killed=!1,this.outputReducer="function"===typeof t.outputReducer?t.outputReducer:null,this.handleMessage=this.handleMessage.bind(this);var h=void 0,c=this;this.handleGraphUpdate=function(){c.worker&&c.worker.terminate(),h&&clearTimeout(h),h=setTimeout((function(){h=void 0,c.spawnWorker()}),0)},e.on("nodeAdded",this.handleGraphUpdate),e.on("edgeAdded",this.handleGraphUpdate),e.on("nodeDropped",this.handleGraphUpdate),e.on("edgeDropped",this.handleGraphUpdate),this.spawnWorker()}u.prototype.isRunning=function(){return this.running},u.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=a.createWorker(i),this.worker.addEventListener("message",this.handleMessage),this.running&&(this.running=!1,this.start())},u.prototype.handleMessage=function(e){if(this.running){var t=new Float32Array(e.data.nodes);a.assignLayoutChanges(this.graph,t,this.outputReducer),this.outputReducer&&a.readGraphPositions(this.graph,t),this.matrices.nodes=t,this.askForIterations()}},u.prototype.askForIterations=function(e){var t=this.matrices,n={settings:this.settings,nodes:t.nodes.buffer},i=[t.nodes.buffer];return e&&(n.edges=t.edges.buffer,i.push(t.edges.buffer)),this.worker.postMessage(n,i),this},u.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-forceatlas2/worker.start: layout was killed.");return this.running||(this.matrices=a.graphToByteArrays(this.graph,this.getEdgeWeight),this.running=!0,this.askForIterations(!0)),this},u.prototype.stop=function(){return this.running=!1,this},u.prototype.kill=function(){if(this.killed)return this;this.running=!1,this.killed=!0,this.matrices=null,this.worker.terminate(),this.graph.removeListener("nodeAdded",this.handleGraphUpdate),this.graph.removeListener("edgeAdded",this.handleGraphUpdate),this.graph.removeListener("nodeDropped",this.handleGraphUpdate),this.graph.removeListener("edgeDropped",this.handleGraphUpdate)},e.exports=u},2936:(e,t)=>{function n(e){return"number"!==typeof e||isNaN(e)?1:e}function i(e,t){var n={},i=function(e){return"undefined"===typeof e?t:e};"function"===typeof t&&(i=t);var r=function(t){return i(t[e])},o=function(){return i(void 0)};return"string"===typeof e?(n.fromAttributes=r,n.fromGraph=function(e,t){return r(e.getNodeAttributes(t))},n.fromEntry=function(e,t){return r(t)}):"function"===typeof e?(n.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},n.fromGraph=function(t,n){return i(e(n,t.getNodeAttributes(n)))},n.fromEntry=function(t,n){return i(e(t,n))}):(n.fromAttributes=o,n.fromGraph=o,n.fromEntry=o),n}function r(e,t){var n={},i=function(e){return"undefined"===typeof e?t:e};"function"===typeof t&&(i=t);var r=function(t){return i(t[e])},o=function(){return i(void 0)};return"string"===typeof e?(n.fromAttributes=r,n.fromGraph=function(e,t){return r(e.getEdgeAttributes(t))},n.fromEntry=function(e,t){return r(t)},n.fromPartialEntry=n.fromEntry,n.fromMinimalEntry=n.fromEntry):"function"===typeof e?(n.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},n.fromGraph=function(t,n){var r=t.extremities(n);return i(e(n,t.getEdgeAttributes(n),r[0],r[1],t.getNodeAttributes(r[0]),t.getNodeAttributes(r[1]),t.isUndirected(n)))},n.fromEntry=function(t,n,r,o,a,s,u){return i(e(t,n,r,o,a,s,u))},n.fromPartialEntry=function(t,n,r,o){return i(e(t,n,r,o))},n.fromMinimalEntry=function(t,n){return i(e(t,n))}):(n.fromAttributes=o,n.fromGraph=o,n.fromEntry=o,n.fromMinimalEntry=o),n}t.Fd=function(e){return r(e,n)}},9235:e=>{e.exports=function(e){return null!==e&&"object"===typeof e&&"function"===typeof e.addUndirectedEdgeWithKey&&"function"===typeof e.dropNode&&"boolean"===typeof e.multi}},8911:function(e){!function(t,n){e.exports=n()}(0,(function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)}function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function r(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return o=r()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&i(o,n.prototype),o},o.apply(null,arguments)}function a(e){var t="function"==typeof Map?new Map:void 0;return a=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,n(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),i(a,e)},a(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var u=function(){for(var e=arguments[0],t=1,n=arguments.length;t<n;t++)if(arguments[t])for(var i in arguments[t])e[i]=arguments[t][i];return e};function h(e,t,n,i){var r=e._nodes.get(t),o=null;return r?o="mixed"===i?r.out&&r.out[n]||r.undirected&&r.undirected[n]:"directed"===i?r.out&&r.out[n]:r.undirected&&r.undirected[n]:o}function c(t){return"object"===e(t)&&null!==t}function d(e){var t;for(t in e)return!1;return!0}function l(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function f(e,t,n){var i={enumerable:!0,configurable:!0};"function"==typeof n?i.get=n:(i.value=n,i.writable=!1),Object.defineProperty(e,t,i)}function g(e){return!!c(e)&&!(e.attributes&&!Array.isArray(e.attributes))}"function"==typeof Object.assign&&(u=Object.assign);var p,v={exports:{}},m="object"==typeof Reflect?Reflect:null,y=m&&"function"==typeof m.apply?m.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};p=m&&"function"==typeof m.ownKeys?m.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var b=Number.isNaN||function(e){return e!=e};function w(){w.init.call(this)}v.exports=w,v.exports.once=function(e,t){return new Promise((function(n,i){function r(n){e.removeListener(t,o),i(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}L(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&L(e,"error",t,n)}(e,r,{once:!0})}))},w.EventEmitter=w,w.prototype._events=void 0,w.prototype._eventsCount=0,w.prototype._maxListeners=void 0;var _=10;function x(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function E(e){return void 0===e._maxListeners?w.defaultMaxListeners:e._maxListeners}function k(e,t,n,i){var r,o,a,s;if(x(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=i?[n,a]:[a,n]:i?a.unshift(n):a.push(n),(r=E(e))>0&&a.length>r&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function T(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function R(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=T.bind(i);return r.listener=n,i.wrapFn=r,r}function C(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):A(r,r.length)}function S(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function A(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}function L(e,t,n,i){if("function"==typeof e.on)i.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(o){i.once&&e.removeEventListener(t,r),n(o)}))}}function G(e){if("function"!=typeof e)throw new Error("obliterator/iterator: expecting a function!");this.next=e}Object.defineProperty(w,"defaultMaxListeners",{enumerable:!0,get:function(){return _},set:function(e){if("number"!=typeof e||e<0||b(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");_=e}}),w.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},w.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||b(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},w.prototype.getMaxListeners=function(){return E(this)},w.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=r[e];if(void 0===s)return!1;if("function"==typeof s)y(s,this,t);else{var u=s.length,h=A(s,u);for(n=0;n<u;++n)y(h[n],this,t)}return!0},w.prototype.addListener=function(e,t){return k(this,e,t,!1)},w.prototype.on=w.prototype.addListener,w.prototype.prependListener=function(e,t){return k(this,e,t,!0)},w.prototype.once=function(e,t){return x(t),this.on(e,R(this,e,t)),this},w.prototype.prependOnceListener=function(e,t){return x(t),this.prependListener(e,R(this,e,t)),this},w.prototype.removeListener=function(e,t){var n,i,r,o,a;if(x(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,a||t)}return this},w.prototype.off=w.prototype.removeListener,w.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,o=Object.keys(n);for(i=0;i<o.length;++i)"removeListener"!==(r=o[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},w.prototype.listeners=function(e){return C(this,e,!0)},w.prototype.rawListeners=function(e){return C(this,e,!1)},w.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):S.call(e,t)},w.prototype.listenerCount=S,w.prototype.eventNames=function(){return this._eventsCount>0?p(this._events):[]},"undefined"!=typeof Symbol&&(G.prototype[Symbol.iterator]=function(){return this}),G.of=function(){var e=arguments,t=e.length,n=0;return new G((function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}}))},G.empty=function(){return new G((function(){return{done:!0}}))},G.fromSequence=function(e){var t=0,n=e.length;return new G((function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}}))},G.is=function(e){return e instanceof G||"object"==typeof e&&null!==e&&"function"==typeof e.next};var D=G,N={};N.ARRAY_BUFFER_SUPPORT="undefined"!=typeof ArrayBuffer,N.SYMBOL_SUPPORT="undefined"!=typeof Symbol;var F=D,M=N,P=M.ARRAY_BUFFER_SUPPORT,z=M.SYMBOL_SUPPORT,O=function(e){var t=function(e){return"string"==typeof e||Array.isArray(e)||P&&ArrayBuffer.isView(e)?F.fromSequence(e):"object"!=typeof e||null===e?null:z&&"function"==typeof e[Symbol.iterator]?e[Symbol.iterator]():"function"==typeof e.next?e:null}(e);if(!t)throw new Error("obliterator: target is not iterable nor a valid iterator.");return t},I=O,U=function(e,t){for(var n,i=arguments.length>1?t:1/0,r=i!==1/0?new Array(i):[],o=0,a=I(e);;){if(o===i)return r;if((n=a.next()).done)return o!==t&&(r.length=o),r;r[o++]=n.value}},B=function(e){function n(t){var n;return(n=e.call(this)||this).name="GraphError",n.message=t,n}return t(n,e),n}(a(Error)),j=function(e){function n(t){var i;return(i=e.call(this,t)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(B),W=function(e){function n(t){var i;return(i=e.call(this,t)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(B),H=function(e){function n(t){var i;return(i=e.call(this,t)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(B);function V(e,t){this.key=e,this.attributes=t,this.clear()}function q(e,t){this.key=e,this.attributes=t,this.clear()}function Y(e,t){this.key=e,this.attributes=t,this.clear()}function X(e,t,n,i,r){this.key=t,this.attributes=r,this.undirected=e,this.source=n,this.target=i}function Z(e,t,n,i,r,o,a){var s,u,h,c;if(i=""+i,0===n){if(!(s=e._nodes.get(i)))throw new W("Graph.".concat(t,': could not find the "').concat(i,'" node in the graph.'));h=r,c=o}else if(3===n){if(r=""+r,!(u=e._edges.get(r)))throw new W("Graph.".concat(t,': could not find the "').concat(r,'" edge in the graph.'));var d=u.source.key,l=u.target.key;if(i===d)s=u.target;else{if(i!==l)throw new W("Graph.".concat(t,': the "').concat(i,'" node is not attached to the "').concat(r,'" edge (').concat(d,", ").concat(l,")."));s=u.source}h=o,c=a}else{if(!(u=e._edges.get(i)))throw new W("Graph.".concat(t,': could not find the "').concat(i,'" edge in the graph.'));s=1===n?u.source:u.target,h=r,c=o}return[s,h,c]}V.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}},q.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}},Y.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}},X.prototype.attach=function(){var e="out",t="in";this.undirected&&(e=t="undirected");var n=this.source.key,i=this.target.key;this.source[e][i]=this,this.undirected&&n===i||(this.target[t][n]=this)},X.prototype.attachMulti=function(){var e="out",t="in",n=this.source.key,i=this.target.key;this.undirected&&(e=t="undirected");var r=this.source[e],o=r[i];if(void 0===o)return r[i]=this,void(this.undirected&&n===i||(this.target[t][n]=this));o.previous=this,this.next=o,r[i]=this,this.target[t][n]=this},X.prototype.detach=function(){var e=this.source.key,t=this.target.key,n="out",i="in";this.undirected&&(n=i="undirected"),delete this.source[n][t],delete this.target[i][e]},X.prototype.detachMulti=function(){var e=this.source.key,t=this.target.key,n="out",i="in";this.undirected&&(n=i="undirected"),void 0===this.previous?void 0===this.next?(delete this.source[n][t],delete this.target[i][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[i][e]=this.next):(this.previous.next=this.next,void 0!==this.next&&(this.next.previous=this.previous))};var K=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o=Z(this,t,n,e,i,r),a=o[0],s=o[1];return a.attributes[s]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i){return Z(this,t,n,e,i)[0].attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o=Z(this,t,n,e,i,r),a=o[0],s=o[1];return a.attributes.hasOwnProperty(s)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r,o){var a=Z(this,t,n,e,i,r,o),s=a[0],u=a[1],h=a[2];return s.attributes[u]=h,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:u}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r,o){var a=Z(this,t,n,e,i,r,o),s=a[0],u=a[1],h=a[2];if("function"!=typeof h)throw new j("Graph.".concat(t,": updater should be a function."));var c=s.attributes,d=h(c[u]);return c[u]=d,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:u}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o=Z(this,t,n,e,i,r),a=o[0],s=o[1];return delete a.attributes[s],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:s}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o=Z(this,t,n,e,i,r),a=o[0],s=o[1];if(!c(s))throw new j("Graph.".concat(t,": provided attributes are not a plain object."));return a.attributes=s,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o=Z(this,t,n,e,i,r),a=o[0],s=o[1];if(!c(s))throw new j("Graph.".concat(t,": provided attributes are not a plain object."));return u(a.attributes,s),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:s}),this}}},{name:function(e){return"update".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o=Z(this,t,n,e,i,r),a=o[0],s=o[1];if("function"!=typeof s)throw new j("Graph.".concat(t,": provided updater is not a function."));return a.attributes=s(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}}],Q=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=h(this,o,a,n)))throw new W("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(r=this._edges.get(e)))throw new W("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return r.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new H("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var r=""+e,o=""+arguments[1];if(!(i=h(this,r,o,n)))throw new W("Graph.".concat(t,': could not find an edge for the given path ("').concat(r,'" - "').concat(o,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(i=this._edges.get(e)))throw new W("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=h(this,o,a,n)))throw new W("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(r=this._edges.get(e)))throw new W("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return r.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new H("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],r=arguments[3],!(o=h(this,a,s,n)))throw new W("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(o=this._edges.get(e)))throw new W("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return o.attributes[i]=r,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i,r){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new H("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],r=arguments[3],!(o=h(this,a,s,n)))throw new W("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(o=this._edges.get(e)))throw new W("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if("function"!=typeof r)throw new j("Graph.".concat(t,": updater should be a function."));return o.attributes[i]=r(o.attributes[i]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=h(this,o,a,n)))throw new W("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(r=this._edges.get(e)))throw new W("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return delete r.attributes[i],this.emit("edgeAttributesUpdated",{key:r.key,type:"remove",attributes:r.attributes,name:i}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=h(this,o,a,n)))throw new W("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(r=this._edges.get(e)))throw new W("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if(!c(i))throw new j("Graph.".concat(t,": provided attributes are not a plain object."));return r.attributes=i,this.emit("edgeAttributesUpdated",{key:r.key,type:"replace",attributes:r.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=h(this,o,a,n)))throw new W("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(r=this._edges.get(e)))throw new W("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if(!c(i))throw new j("Graph.".concat(t,": provided attributes are not a plain object."));return u(r.attributes,i),this.emit("edgeAttributesUpdated",{key:r.key,type:"merge",attributes:r.attributes,data:i}),this}}},{name:function(e){return"update".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,i){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+i;if(i=arguments[2],!(r=h(this,o,a,n)))throw new W("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(r=this._edges.get(e)))throw new W("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if("function"!=typeof i)throw new j("Graph.".concat(t,": provided updater is not a function."));return r.attributes=i(r.attributes),this.emit("edgeAttributesUpdated",{key:r.key,type:"update",attributes:r.attributes}),this}}}],$=D,J=O,ee=function(){var e=arguments,t=null,n=-1;return new $((function(){for(var i=null;;){if(null===t){if(++n>=e.length)return{done:!0};t=J(e[n])}if(!0!==(i=t.next()).done)break;t=null}return i}))},te=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function ne(e,t,n,i){var r=!1;for(var o in t)if(o!==i){var a=t[o];if(r=n(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),e&&r)return a.key}}function ie(e,t,n,i){var r,o,a,s=!1;for(var u in t)if(u!==i){r=t[u];do{if(o=r.source,a=r.target,s=n(r.key,r.attributes,o.key,a.key,o.attributes,a.attributes,r.undirected),e&&s)return r.key;r=r.next}while(void 0!==r)}}function re(e,t){var n,i=Object.keys(e),r=i.length,o=0;return new D((function(){do{if(n)n=n.next;else{if(o>=r)return{done:!0};var a=i[o++];if(a===t){n=void 0;continue}n=e[a]}}while(!n);return{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}}}))}function oe(e,t,n,i){var r=t[n];if(r){var o=r.source,a=r.target;return i(r.key,r.attributes,o.key,a.key,o.attributes,a.attributes,r.undirected)&&e?r.key:void 0}}function ae(e,t,n,i){var r=t[n];if(r){var o=!1;do{if(o=i(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected),e&&o)return r.key;r=r.next}while(void 0!==r)}}function se(e,t){var n=e[t];return void 0!==n.next?new D((function(){if(!n)return{done:!0};var e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}})):D.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function ue(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return"function"==typeof Array.from?Array.from(e._edges.keys()):U(e._edges.keys(),e._edges.size);for(var n,i,r="undirected"===t?e.undirectedSize:e.directedSize,o=new Array(r),a="undirected"===t,s=e._edges.values(),u=0;!0!==(n=s.next()).done;)(i=n.value).undirected===a&&(o[u++]=i.key);return o}function he(e,t,n,i){if(0!==t.size)for(var r,o,a="mixed"!==n&&n!==t.type,s="undirected"===n,u=!1,h=t._edges.values();!0!==(r=h.next()).done;)if(o=r.value,!a||o.undirected===s){var c=o,d=c.key,l=c.attributes,f=c.source,g=c.target;if(u=i(d,l,f.key,g.key,f.attributes,g.attributes,o.undirected),e&&u)return d}}function ce(e,t){if(0===e.size)return D.empty();var n="mixed"!==t&&t!==e.type,i="undirected"===t,r=e._edges.values();return new D((function(){for(var e,t;;){if((e=r.next()).done)return e;if(t=e.value,!n||t.undirected===i)break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}))}function de(e,t,n,i,r,o){var a,s=t?ie:ne;if("undirected"!==n){if("out"!==i&&(a=s(e,r.in,o),e&&a))return a;if("in"!==i&&(a=s(e,r.out,o,i?void 0:r.key),e&&a))return a}if("directed"!==n&&(a=s(e,r.undirected,o),e&&a))return a}function le(e,t,n,i){var r=[];return de(!1,e,t,n,i,(function(e){r.push(e)})),r}function fe(e,t,n){var i=D.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(i=ee(i,re(n.in))),"in"!==t&&void 0!==n.out&&(i=ee(i,re(n.out,t?void 0:n.key)))),"directed"!==e&&void 0!==n.undirected&&(i=ee(i,re(n.undirected))),i}function ge(e,t,n,i,r,o,a){var s,u=n?ae:oe;if("undirected"!==t){if(void 0!==r.in&&"out"!==i&&(s=u(e,r.in,o,a),e&&s))return s;if(void 0!==r.out&&"in"!==i&&(i||r.key!==o)&&(s=u(e,r.out,o,a),e&&s))return s}if("directed"!==t&&void 0!==r.undirected&&(s=u(e,r.undirected,o,a),e&&s))return s}function pe(e,t,n,i,r){var o=[];return ge(!1,e,t,n,i,r,(function(e){o.push(e)})),o}function ve(e,t,n,i){var r=D.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&i in n.in&&(r=ee(r,se(n.in,i))),void 0!==n.out&&"in"!==t&&i in n.out&&(t||n.key!==i)&&(r=ee(r,se(n.out,i)))),"directed"!==e&&void 0!==n.undirected&&i in n.undirected&&(r=ee(r,se(n.undirected,i))),r}var me=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function ye(){this.A=null,this.B=null}function be(e,t,n,i,r){for(var o in i){var a=i[o],s=a.source,u=a.target,h=s===n?u:s;if(!t||!t.has(h.key)){var c=r(h.key,h.attributes);if(e&&c)return h.key}}}function we(e,t,n,i,r){if("mixed"!==t){if("undirected"===t)return be(e,null,i,i.undirected,r);if("string"==typeof n)return be(e,null,i,i[n],r)}var o,a=new ye;if("undirected"!==t){if("out"!==n){if(o=be(e,null,i,i.in,r),e&&o)return o;a.wrap(i.in)}if("in"!==n){if(o=be(e,a,i,i.out,r),e&&o)return o;a.wrap(i.out)}}if("directed"!==t&&(o=be(e,a,i,i.undirected,r),e&&o))return o}function _e(e,t,n){var i=Object.keys(n),r=i.length,o=0;return new D((function(){var a=null;do{if(o>=r)return e&&e.wrap(n),{done:!0};var s=n[i[o++]],u=s.source,h=s.target;a=u===t?h:u,e&&e.has(a.key)&&(a=null)}while(null===a);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}))}function xe(e,t){var n=t.name,i=t.type,r=t.direction;e.prototype[n]=function(e){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return[];e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new W("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var i=[];return we(!1,e,t,n,(function(e){i.push(e)})),i}("mixed"===i?this.type:i,r,t)}}function Ee(e,t){var n=t.name,i=t.type,r=t.direction,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(e){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return D.empty();e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new W("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return _e(null,n,n.undirected);if("string"==typeof t)return _e(null,n,n[t])}var i=D.empty(),r=new ye;return"undirected"!==e&&("out"!==t&&(i=ee(i,_e(r,n,n.in))),"in"!==t&&(i=ee(i,_e(r,n,n.out)))),"directed"!==e&&(i=ee(i,_e(r,n,n.undirected))),i}("mixed"===i?this.type:i,r,t)}}function ke(e,t,n,i,r){for(var o,a,s,u,h,c,d,l=i._nodes.values(),f=i.type;!0!==(o=l.next()).done;){var g=!1;if(a=o.value,"undirected"!==f)for(s in u=a.out){h=u[s];do{if(c=h.target,g=!0,d=r(a.key,c.key,a.attributes,c.attributes,h.key,h.attributes,h.undirected),e&&d)return h;h=h.next}while(h)}if("directed"!==f)for(s in u=a.undirected)if(!(t&&a.key>s)){h=u[s];do{if((c=h.target).key!==s&&(c=h.source),g=!0,d=r(a.key,c.key,a.attributes,c.attributes,h.key,h.attributes,h.undirected),e&&d)return h;h=h.next}while(h)}if(n&&!g&&(d=r(a.key,null,a.attributes,null,null,null,null),e&&d))return null}}function Te(e){if(!c(e))throw new j('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new j("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!c(e.attributes)||null===e.attributes))throw new j("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function Re(e){if(!c(e))throw new j('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new j("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new j("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!c(e.attributes)||null===e.attributes))throw new j("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&"boolean"!=typeof e.undirected)throw new j("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}ye.prototype.wrap=function(e){null===this.A?this.A=e:null===this.B&&(this.B=e)},ye.prototype.has=function(e){return null!==this.A&&e in this.A||null!==this.B&&e in this.B};var Ce,Se=(Ce=255&Math.floor(256*Math.random()),function(){return Ce++}),Ae=new Set(["directed","undirected","mixed"]),Le=new Set(["domain","_events","_eventsCount","_maxListeners"]),Ge={allowSelfLoops:!0,multi:!1,type:"mixed"};function De(e,t,n){var i=new e.NodeDataClass(t,n);return e._nodes.set(t,i),e.emit("nodeAdded",{key:t,attributes:n}),i}function Ne(e,t,n,i,r,o,a,s){if(!i&&"undirected"===e.type)throw new H("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(i&&"directed"===e.type)throw new H("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!c(s))throw new j("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!e.allowSelfLoops&&o===a)throw new H("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=e._nodes.get(o),h=e._nodes.get(a);if(!u)throw new W("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!h)throw new W("Graph.".concat(t,': target node "').concat(a,'" not found.'));var d={key:null,undirected:i,source:o,target:a,attributes:s};if(n)r=e._edgeKeyGenerator();else if(r=""+r,e._edges.has(r))throw new H("Graph.".concat(t,': the "').concat(r,'" edge already exists in the graph.'));if(!e.multi&&(i?void 0!==u.undirected[a]:void 0!==u.out[a]))throw new H("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var l=new X(i,r,u,h,s);e._edges.set(r,l);var f=o===a;return i?(u.undirectedDegree++,h.undirectedDegree++,f&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,h.inDegree++,f&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?l.attachMulti():l.attach(),i?e._undirectedSize++:e._directedSize++,d.key=r,e.emit("edgeAdded",d),r}function Fe(e,t,n,i,r,o,a,s,h){if(!i&&"undirected"===e.type)throw new H("Graph.".concat(t,": you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead."));if(i&&"directed"===e.type)throw new H("Graph.".concat(t,": you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead."));if(s)if(h){if("function"!=typeof s)throw new j("Graph.".concat(t,': invalid updater function. Expecting a function but got "').concat(s,'"'))}else if(!c(s))throw new j("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));var d;if(o=""+o,a=""+a,h&&(d=s,s=void 0),!e.allowSelfLoops&&o===a)throw new H("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l,f,g=e._nodes.get(o),p=e._nodes.get(a);if(!n&&(l=e._edges.get(r))){if(!(l.source.key===o&&l.target.key===a||i&&l.source.key===a&&l.target.key===o))throw new H("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(r,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. ("').concat(l.source.key,'", "').concat(l.target.key,'").'));f=l}if(f||e.multi||!g||(f=i?g.undirected[a]:g.out[a]),f){var v=[f.key,!1,!1,!1];if(h?!d:!s)return v;if(h){var m=f.attributes;f.attributes=d(m),e.emit("edgeAttributesUpdated",{type:"replace",key:f.key,attributes:f.attributes})}else u(f.attributes,s),e.emit("edgeAttributesUpdated",{type:"merge",key:f.key,attributes:f.attributes,data:s});return v}s=s||{},h&&d&&(s=d(s));var y={key:null,undirected:i,source:o,target:a,attributes:s};if(n)r=e._edgeKeyGenerator();else if(r=""+r,e._edges.has(r))throw new H("Graph.".concat(t,': the "').concat(r,'" edge already exists in the graph.'));var b=!1,w=!1;g||(g=De(e,o,{}),b=!0,o===a&&(p=g,w=!0)),p||(p=De(e,a,{}),w=!0),l=new X(i,r,g,p,s),e._edges.set(r,l);var _=o===a;return i?(g.undirectedDegree++,p.undirectedDegree++,_&&(g.undirectedLoops++,e._undirectedSelfLoopCount++)):(g.outDegree++,p.inDegree++,_&&(g.directedLoops++,e._directedSelfLoopCount++)),e.multi?l.attachMulti():l.attach(),i?e._undirectedSize++:e._directedSize++,y.key=r,e.emit("edgeAdded",y),[r,!0,b,w]}function Me(e,t){e._edges.delete(t.key);var n=t.source,i=t.target,r=t.attributes,o=t.undirected,a=n===i;o?(n.undirectedDegree--,i.undirectedDegree--,a&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,i.inDegree--,a&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),o?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:r,source:n.key,target:i.key,undirected:o})}var Pe=function(n){function i(e){var t;if(t=n.call(this)||this,"boolean"!=typeof(e=u({},Ge,e)).multi)throw new j("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(e.multi,'".'));if(!Ae.has(e.type))throw new j('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(e.type,'".'));if("boolean"!=typeof e.allowSelfLoops)throw new j("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(e.allowSelfLoops,'".'));var i="mixed"===e.type?V:"directed"===e.type?q:Y;l(s(t),"NodeDataClass",i);var r="geid_"+Se()+"_",o=0;return l(s(t),"_attributes",{}),l(s(t),"_nodes",new Map),l(s(t),"_edges",new Map),l(s(t),"_directedSize",0),l(s(t),"_undirectedSize",0),l(s(t),"_directedSelfLoopCount",0),l(s(t),"_undirectedSelfLoopCount",0),l(s(t),"_edgeKeyGenerator",(function(){var e;do{e=r+o++}while(t._edges.has(e));return e})),l(s(t),"_options",e),Le.forEach((function(e){return l(s(t),e,t[e])})),f(s(t),"order",(function(){return t._nodes.size})),f(s(t),"size",(function(){return t._edges.size})),f(s(t),"directedSize",(function(){return t._directedSize})),f(s(t),"undirectedSize",(function(){return t._undirectedSize})),f(s(t),"selfLoopCount",(function(){return t._directedSelfLoopCount+t._undirectedSelfLoopCount})),f(s(t),"directedSelfLoopCount",(function(){return t._directedSelfLoopCount})),f(s(t),"undirectedSelfLoopCount",(function(){return t._undirectedSelfLoopCount})),f(s(t),"multi",t._options.multi),f(s(t),"type",t._options.type),f(s(t),"allowSelfLoops",t._options.allowSelfLoops),f(s(t),"implementation",(function(){return"graphology"})),t}t(i,n);var r=i.prototype;return r._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0},r.hasNode=function(e){return this._nodes.has(""+e)},r.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=""+e,i=this._edges.get(n);return!!i&&!i.undirected}if(2===arguments.length){e=""+e,t=""+t;var r=this._nodes.get(e);return!!r&&r.out.hasOwnProperty(t)}throw new j("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=""+e,i=this._edges.get(n);return!!i&&i.undirected}if(2===arguments.length){e=""+e,t=""+t;var r=this._nodes.get(e);return!!r&&r.undirected.hasOwnProperty(t)}throw new j("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasEdge=function(e,t){if(1===arguments.length){var n=""+e;return this._edges.has(n)}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);return!!i&&(void 0!==i.out&&i.out.hasOwnProperty(t)||void 0!==i.undirected&&i.undirected.hasOwnProperty(t))}throw new j("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new H("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new W('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new W('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var i=n.out&&n.out[t]||void 0;return i?i.key:void 0}},r.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new H("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new W('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new W('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var i=n.undirected&&n.undirected[t]||void 0;return i?i.key:void 0}},r.edge=function(e,t){if(this.multi)throw new H("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new W('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new W('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var i=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(i)return i.key},r.areDirectedNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new W('Graph.areDirectedNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&(t in n.in||t in n.out)},r.areOutNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new W('Graph.areOutNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.out},r.areInNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new W('Graph.areInNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.in},r.areUndirectedNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new W('Graph.areUndirectedNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"directed"!==this.type&&t in n.undirected},r.areNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new W('Graph.areNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&(t in n.in||t in n.out)||"directed"!==this.type&&t in n.undirected},r.areInboundNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new W('Graph.areInboundNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.in||"directed"!==this.type&&t in n.undirected},r.areOutboundNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new W('Graph.areOutboundNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.out||"directed"!==this.type&&t in n.undirected},r.inDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree},r.outDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.outDegree},r.directedDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree+t.outDegree},r.undirectedDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:t.undirectedDegree},r.inboundDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.inboundDegree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=t.undirectedDegree),"undirected"!==this.type&&(n+=t.inDegree),n},r.outboundDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.outboundDegree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=t.undirectedDegree),"undirected"!==this.type&&(n+=t.outDegree),n},r.degree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=t.undirectedDegree),"undirected"!==this.type&&(n+=t.inDegree+t.outDegree),n},r.inDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.inDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree-t.directedLoops},r.outDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.outDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.outDegree-t.directedLoops},r.directedDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.directedDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree+t.outDegree-2*t.directedLoops},r.undirectedDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.undirectedDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:t.undirectedDegree-2*t.undirectedLoops},r.inboundDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.inboundDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var n=0,i=0;return"directed"!==this.type&&(n+=t.undirectedDegree,i+=2*t.undirectedLoops),"undirected"!==this.type&&(n+=t.inDegree,i+=t.directedLoops),n-i},r.outboundDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.outboundDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var n=0,i=0;return"directed"!==this.type&&(n+=t.undirectedDegree,i+=2*t.undirectedLoops),"undirected"!==this.type&&(n+=t.outDegree,i+=t.directedLoops),n-i},r.degreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new W('Graph.degreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var n=0,i=0;return"directed"!==this.type&&(n+=t.undirectedDegree,i+=2*t.undirectedLoops),"undirected"!==this.type&&(n+=t.inDegree+t.outDegree,i+=2*t.directedLoops),n-i},r.source=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new W('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},r.target=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new W('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},r.extremities=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new W('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},r.opposite=function(e,t){e=""+e,t=""+t;var n=this._edges.get(t);if(!n)throw new W('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var i=n.source.key,r=n.target.key;if(e===i)return r;if(e===r)return i;throw new W('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(i,", ").concat(r,")."))},r.hasExtremity=function(e,t){e=""+e,t=""+t;var n=this._edges.get(e);if(!n)throw new W('Graph.hasExtremity: could not find the "'.concat(e,'" edge in the graph.'));return n.source.key===t||n.target.key===t},r.isUndirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new W('Graph.isUndirected: could not find the "'.concat(e,'" edge in the graph.'));return t.undirected},r.isDirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new W('Graph.isDirected: could not find the "'.concat(e,'" edge in the graph.'));return!t.undirected},r.isSelfLoop=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new W('Graph.isSelfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},r.addNode=function(e,t){var n=function(e,t,n){if(n&&!c(n))throw new j('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(t=""+t,n=n||{},e._nodes.has(t))throw new H('Graph.addNode: the "'.concat(t,'" node already exist in the graph.'));var i=new e.NodeDataClass(t,n);return e._nodes.set(t,i),e.emit("nodeAdded",{key:t,attributes:n}),i}(this,e,t);return n.key},r.mergeNode=function(e,t){if(t&&!c(t))throw new j('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));e=""+e,t=t||{};var n=this._nodes.get(e);return n?(t&&(u(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])},r.updateNode=function(e,t){if(t&&"function"!=typeof t)throw new j('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(t,'"'));e=""+e;var n=this._nodes.get(e);if(n){if(t){var i=n.attributes;n.attributes=t(i),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})}return[e,!1]}var r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:r}),[e,!0]},r.dropNode=function(e){e=""+e;var t,n=this._nodes.get(e);if(!n)throw new W('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));if("undirected"!==this.type){for(var i in n.out){t=n.out[i];do{Me(this,t),t=t.next}while(t)}for(var r in n.in){t=n.in[r];do{Me(this,t),t=t.next}while(t)}}if("directed"!==this.type)for(var o in n.undirected){t=n.undirected[o];do{Me(this,t),t=t.next}while(t)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},r.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],i=""+arguments[1];if(!(t=h(this,n,i,this.type)))throw new W('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(i,'" edge in the graph.'))}else if(e=""+e,!(t=this._edges.get(e)))throw new W('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));return Me(this,t),this},r.dropDirectedEdge=function(e,t){if(arguments.length<2)throw new H("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new H("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=h(this,e=""+e,t=""+t,"directed");if(!n)throw new W('Graph.dropDirectedEdge: could not find a "'.concat(e,'" -> "').concat(t,'" edge in the graph.'));return Me(this,n),this},r.dropUndirectedEdge=function(e,t){if(arguments.length<2)throw new H("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new H("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=h(this,e,t,"undirected");if(!n)throw new W('Graph.dropUndirectedEdge: could not find a "'.concat(e,'" -> "').concat(t,'" edge in the graph.'));return Me(this,n),this},r.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")},r.clearEdges=function(){for(var e,t=this._nodes.values();!0!==(e=t.next()).done;)e.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")},r.getAttribute=function(e){return this._attributes[e]},r.getAttributes=function(){return this._attributes},r.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},r.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},r.updateAttribute=function(e,t){if("function"!=typeof t)throw new j("Graph.updateAttribute: updater should be a function.");var n=this._attributes[e];return this._attributes[e]=t(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},r.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},r.replaceAttributes=function(e){if(!c(e))throw new j("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},r.mergeAttributes=function(e){if(!c(e))throw new j("Graph.mergeAttributes: provided attributes are not a plain object.");return u(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this},r.updateAttributes=function(e){if("function"!=typeof e)throw new j("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this},r.updateEachNodeAttributes=function(e,t){if("function"!=typeof e)throw new j("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!g(t))throw new j("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r=this._nodes.values();!0!==(n=r.next()).done;)(i=n.value).attributes=e(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},r.updateEachEdgeAttributes=function(e,t){if("function"!=typeof e)throw new j("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!g(t))throw new j("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,i,r,o,a=this._edges.values();!0!==(n=a.next()).done;)r=(i=n.value).source,o=i.target,i.attributes=e(i.key,i.attributes,r.key,o.key,r.attributes,o.attributes,i.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},r.forEachAdjacencyEntry=function(e){if("function"!=typeof e)throw new j("Graph.forEachAdjacencyEntry: expecting a callback.");ke(!1,!1,!1,this,e)},r.forEachAdjacencyEntryWithOrphans=function(e){if("function"!=typeof e)throw new j("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");ke(!1,!1,!0,this,e)},r.forEachAssymetricAdjacencyEntry=function(e){if("function"!=typeof e)throw new j("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");ke(!1,!0,!1,this,e)},r.forEachAssymetricAdjacencyEntryWithOrphans=function(e){if("function"!=typeof e)throw new j("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");ke(!1,!0,!0,this,e)},r.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):U(this._nodes.keys(),this._nodes.size)},r.forEachNode=function(e){if("function"!=typeof e)throw new j("Graph.forEachNode: expecting a callback.");for(var t,n,i=this._nodes.values();!0!==(t=i.next()).done;)e((n=t.value).key,n.attributes)},r.findNode=function(e){if("function"!=typeof e)throw new j("Graph.findNode: expecting a callback.");for(var t,n,i=this._nodes.values();!0!==(t=i.next()).done;)if(e((n=t.value).key,n.attributes))return n.key},r.mapNodes=function(e){if("function"!=typeof e)throw new j("Graph.mapNode: expecting a callback.");for(var t,n,i=this._nodes.values(),r=new Array(this.order),o=0;!0!==(t=i.next()).done;)n=t.value,r[o++]=e(n.key,n.attributes);return r},r.someNode=function(e){if("function"!=typeof e)throw new j("Graph.someNode: expecting a callback.");for(var t,n,i=this._nodes.values();!0!==(t=i.next()).done;)if(e((n=t.value).key,n.attributes))return!0;return!1},r.everyNode=function(e){if("function"!=typeof e)throw new j("Graph.everyNode: expecting a callback.");for(var t,n,i=this._nodes.values();!0!==(t=i.next()).done;)if(!e((n=t.value).key,n.attributes))return!1;return!0},r.filterNodes=function(e){if("function"!=typeof e)throw new j("Graph.filterNodes: expecting a callback.");for(var t,n,i=this._nodes.values(),r=[];!0!==(t=i.next()).done;)e((n=t.value).key,n.attributes)&&r.push(n.key);return r},r.reduceNodes=function(e,t){if("function"!=typeof e)throw new j("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new j("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");for(var n,i,r=t,o=this._nodes.values();!0!==(n=o.next()).done;)r=e(r,(i=n.value).key,i.attributes);return r},r.nodeEntries=function(){var e=this._nodes.values();return new D((function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}))},r.export=function(){var e=this,t=new Array(this._nodes.size),n=0;this._nodes.forEach((function(e,i){t[n++]=function(e,t){var n={key:e};return d(t.attributes)||(n.attributes=u({},t.attributes)),n}(i,e)}));var i=new Array(this._edges.size);return n=0,this._edges.forEach((function(t,r){i[n++]=function(e,t,n){var i={key:t,source:n.source.key,target:n.target.key};return d(n.attributes)||(i.attributes=u({},n.attributes)),"mixed"===e&&n.undirected&&(i.undirected=!0),i}(e.type,r,t)})),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:i}},r.import=function(e){var t,n,r,o,a,s=this,u=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof i)return e.forEachNode((function(e,t){u?s.mergeNode(e,t):s.addNode(e,t)})),e.forEachEdge((function(e,t,n,i,r,o,a){u?a?s.mergeUndirectedEdgeWithKey(e,n,i,t):s.mergeDirectedEdgeWithKey(e,n,i,t):a?s.addUndirectedEdgeWithKey(e,n,i,t):s.addDirectedEdgeWithKey(e,n,i,t)})),this;if(!c(e))throw new j("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!c(e.attributes))throw new j("Graph.import: invalid attributes. Expecting a plain object.");u?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}if(e.nodes){if(r=e.nodes,!Array.isArray(r))throw new j("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=r.length;t<n;t++){Te(o=r[t]);var h=o,d=h.key,l=h.attributes;u?this.mergeNode(d,l):this.addNode(d,l)}}if(e.edges){var f=!1;if("undirected"===this.type&&(f=!0),r=e.edges,!Array.isArray(r))throw new j("Graph.import: invalid edges. Expecting an array.");for(t=0,n=r.length;t<n;t++){Re(a=r[t]);var g=a,p=g.source,v=g.target,m=g.attributes,y=g.undirected,b=void 0===y?f:y;"key"in a?(u?b?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:b?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,a.key,p,v,m):(u?b?this.mergeUndirectedEdge:this.mergeDirectedEdge:b?this.addUndirectedEdge:this.addDirectedEdge).call(this,p,v,m)}}return this},r.nullCopy=function(e){var t=new i(u({},this._options,e));return t.replaceAttributes(u({},this.getAttributes())),t},r.emptyCopy=function(e){var t=this.nullCopy(e);return this._nodes.forEach((function(e,n){var i=u({},e.attributes);e=new t.NodeDataClass(n,i),t._nodes.set(n,e)})),t},r.copy=function(e){if("string"==typeof(e=e||{}).type&&e.type!==this.type&&"mixed"!==e.type)throw new H('Graph.copy: cannot create an incompatible copy from "'.concat(this.type,'" type to "').concat(e.type,'" because this would mean losing information about the current graph.'));if("boolean"==typeof e.multi&&e.multi!==this.multi&&!0!==e.multi)throw new H("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if("boolean"==typeof e.allowSelfLoops&&e.allowSelfLoops!==this.allowSelfLoops&&!0!==e.allowSelfLoops)throw new H("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");for(var t,n,i=this.emptyCopy(e),r=this._edges.values();!0!==(t=r.next()).done;)Ne(i,"copy",!1,(n=t.value).undirected,n.key,n.source.key,n.target.key,u({},n.attributes));return i},r.toJSON=function(){return this.export()},r.toString=function(){return"[object Graph]"},r.inspect=function(){var t=this,n={};this._nodes.forEach((function(e,t){n[t]=e.attributes}));var i={},r={};this._edges.forEach((function(e,n){var o,a=e.undirected?"--":"->",s="",u=e.source.key,h=e.target.key;e.undirected&&u>h&&(o=u,u=h,h=o);var c="(".concat(u,")").concat(a,"(").concat(h,")");n.startsWith("geid_")?t.multi&&(void 0===r[c]?r[c]=0:r[c]++,s+="".concat(r[c],". ")):s+="[".concat(n,"]: "),i[s+=c]=e.attributes}));var o={};for(var a in this)this.hasOwnProperty(a)&&!Le.has(a)&&"function"!=typeof this[a]&&"symbol"!==e(a)&&(o[a]=this[a]);return o.attributes=this._attributes,o.nodes=n,o.edges=i,l(o,"constructor",this.constructor),o},i}(v.exports.EventEmitter);"undefined"!=typeof Symbol&&(Pe.prototype[Symbol.for("nodejs.util.inspect.custom")]=Pe.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(e){["add","merge","update"].forEach((function(t){var n=e.name(t),i="add"===t?Ne:Fe;e.generateKey?Pe.prototype[n]=function(r,o,a){return i(this,n,!0,"undirected"===(e.type||this.type),null,r,o,a,"update"===t)}:Pe.prototype[n]=function(r,o,a,s){return i(this,n,!1,"undirected"===(e.type||this.type),r,o,a,s,"update"===t)}}))})),function(e){K.forEach((function(t){var n=t.name,i=t.attacher;i(e,n("Node"),0),i(e,n("Source"),1),i(e,n("Target"),2),i(e,n("Opposite"),3)}))}(Pe),function(e){Q.forEach((function(t){var n=t.name,i=t.attacher;i(e,n("Edge"),"mixed"),i(e,n("DirectedEdge"),"directed"),i(e,n("UndirectedEdge"),"undirected")}))}(Pe),function(e){te.forEach((function(t){!function(e,t){var n=t.name,i=t.type,r=t.direction;e.prototype[n]=function(e,t){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return[];if(!arguments.length)return ue(this,i);if(1===arguments.length){e=""+e;var o=this._nodes.get(e);if(void 0===o)throw new W("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return le(this.multi,"mixed"===i?this.type:i,r,o)}if(2===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new W("Graph.".concat(n,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new W("Graph.".concat(n,': could not find the "').concat(t,'" target node in the graph.'));return pe(i,this.multi,r,a,t)}throw new j("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,i=t.type,r=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===i||"mixed"===this.type||i===this.type){if(1===arguments.length)return he(!1,this,i,n=e);if(2===arguments.length){e=""+e,n=t;var a=this._nodes.get(e);if(void 0===a)throw new W("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return de(!1,this.multi,"mixed"===i?this.type:i,r,a,n)}if(3===arguments.length){e=""+e,t=""+t;var s=this._nodes.get(e);if(!s)throw new W("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new W("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return ge(!1,i,this.multi,r,s,t,n)}throw new j("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}};var a="map"+n[0].toUpperCase()+n.slice(1);e.prototype[a]=function(){var e,t=Array.prototype.slice.call(arguments),n=t.pop();if(0===t.length){var r=0;"directed"!==i&&(r+=this.undirectedSize),"undirected"!==i&&(r+=this.directedSize),e=new Array(r);var a=0;t.push((function(t,i,r,o,s,u,h){e[a++]=n(t,i,r,o,s,u,h)}))}else e=[],t.push((function(t,i,r,o,a,s,u){e.push(n(t,i,r,o,a,s,u))}));return this[o].apply(this,t),e};var s="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((function(e,i,r,o,a,s,u){t(e,i,r,o,a,s,u)&&n.push(e)})),this[o].apply(this,e),n};var u="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){var e,t,n=Array.prototype.slice.call(arguments);if(n.length<2||n.length>4)throw new j("Graph.".concat(u,": invalid number of arguments (expecting 2, 3 or 4 and got ").concat(n.length,")."));if("function"==typeof n[n.length-1]&&"function"!=typeof n[n.length-2])throw new j("Graph.".concat(u,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));2===n.length?(e=n[0],t=n[1],n=[]):3===n.length?(e=n[1],t=n[2],n=[n[0]]):4===n.length&&(e=n[2],t=n[3],n=[n[0],n[1]]);var i=t;return n.push((function(t,n,r,o,a,s,u){i=e(i,t,n,r,o,a,s,u)})),this[o].apply(this,n),i}}(e,t),function(e,t){var n=t.name,i=t.type,r=t.direction,o="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return!1;if(1===arguments.length)return he(!0,this,i,n=e);if(2===arguments.length){e=""+e,n=t;var a=this._nodes.get(e);if(void 0===a)throw new W("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return de(!0,this.multi,"mixed"===i?this.type:i,r,a,n)}if(3===arguments.length){e=""+e,t=""+t;var s=this._nodes.get(e);if(!s)throw new W("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new W("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return ge(!0,i,this.multi,r,s,t,n)}throw new j("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))};var a="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((function(e,n,i,r,o,a,s){return t(e,n,i,r,o,a,s)})),!!this[o].apply(this,e)};var s="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((function(e,n,i,r,o,a,s){return!t(e,n,i,r,o,a,s)})),!this[o].apply(this,e)}}(e,t),function(e,t){var n=t.name,i=t.type,r=t.direction,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(e,t){if("mixed"!==i&&"mixed"!==this.type&&i!==this.type)return D.empty();if(!arguments.length)return ce(this,i);if(1===arguments.length){e=""+e;var n=this._nodes.get(e);if(!n)throw new W("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return fe(i,r,n)}if(2===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new W("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new W("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return ve(i,r,a,t)}throw new j("Graph.".concat(o,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)}))}(Pe),function(e){me.forEach((function(t){xe(e,t),function(e,t){var n=t.name,i=t.type,r=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===i||"mixed"===this.type||i===this.type){e=""+e;var n=this._nodes.get(e);if(void 0===n)throw new W("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));we(!1,"mixed"===i?this.type:i,r,n,t)}};var a="map"+n[0].toUpperCase()+n.slice(1);e.prototype[a]=function(e,t){var n=[];return this[o](e,(function(e,i){n.push(t(e,i))})),n};var s="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){var n=[];return this[o](e,(function(e,i){t(e,i)&&n.push(e)})),n};var u="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(e,t,n){if(arguments.length<3)throw new j("Graph.".concat(u,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var i=n;return this[o](e,(function(e,n){i=t(i,e,n)})),i}}(e,t),function(e,t){var n=t.name,i=t.type,r=t.direction,o=n[0].toUpperCase()+n.slice(1,-1),a="find"+o;e.prototype[a]=function(e,t){if("mixed"===i||"mixed"===this.type||i===this.type){e=""+e;var n=this._nodes.get(e);if(void 0===n)throw new W("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return we(!0,"mixed"===i?this.type:i,r,n,t)}};var s="some"+o;e.prototype[s]=function(e,t){return!!this[a](e,t)};var u="every"+o;e.prototype[u]=function(e,t){return!this[a](e,(function(e,n){return!t(e,n)}))}}(e,t),Ee(e,t)}))}(Pe);var ze=function(e){function n(t){var n=u({type:"directed"},t);if("multi"in n&&!1!==n.multi)throw new j("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new j('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe),Oe=function(e){function n(t){var n=u({type:"undirected"},t);if("multi"in n&&!1!==n.multi)throw new j("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new j('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe),Ie=function(e){function n(t){var n=u({multi:!0},t);if("multi"in n&&!0!==n.multi)throw new j("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return e.call(this,n)||this}return t(n,e),n}(Pe),Ue=function(e){function n(t){var n=u({type:"directed",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new j("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new j('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe),Be=function(e){function n(t){var n=u({type:"undirected",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new j("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new j('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe);function je(e){e.from=function(t,n){var i=u({},t.options,n),r=new e(i);return r.import(t),r}}return je(Pe),je(ze),je(Oe),je(Ie),je(Ue),je(Be),Pe.Graph=Pe,Pe.DirectedGraph=ze,Pe.UndirectedGraph=Oe,Pe.MultiGraph=Ie,Pe.MultiDirectedGraph=Ue,Pe.MultiUndirectedGraph=Be,Pe.InvalidArgumentsGraphError=j,Pe.NotFoundGraphError=W,Pe.UsageGraphError=H,Pe}))},520:(e,t,n)=>{"use strict";function i(e){if(Array.isArray(e))return e}function r(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],u=!0,h=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);u=!0);}catch(e){h=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(h)throw r}}return s}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function a(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){return i(e)||r(e,t)||a(e,t)||s()}n.d(t,{_:()=>u,a:()=>o,b:()=>a,c:()=>x,f:()=>b,g:()=>E,i:()=>_});var h={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"};var c=new Int8Array(4),d=new Int32Array(c.buffer,0,1),l=new Float32Array(c.buffer,0,1),f=/^\s*rgba?\s*\(/,g=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function p(e){var t=0,n=0,i=0,r=1;if("#"===e[0])4===e.length?(t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),i=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),i=parseInt(e.charAt(5)+e.charAt(6),16)),9===e.length&&(r=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(f.test(e)){var o=e.match(g);o&&(t=+o[1],n=+o[2],i=+o[3],o[4]&&(r=+o[4]))}return{r:t,g:n,b:i,a:r}}var v={};for(var m in h)v[m]=b(h[m]),v[h[m]]=v[m];function y(e,t,n,i,r){return d[0]=i<<24|n<<16|t<<8|e,r&&(d[0]=4278190079&d[0]),l[0]}function b(e){if(e=e.toLowerCase(),"undefined"!==typeof v[e])return v[e];var t=p(e),n=t.r,i=t.g,r=t.b,o=t.a;o=255*o|0;var a=y(n,i,r,o,!0);return v[e]=a,a}var w={};function _(e){if("undefined"!==typeof w[e])return w[e];var t=(16711680&e)>>>16,n=(65280&e)>>>8,i=255&e,r=255,o=y(t,n,i,r,!0);return w[e]=o,o}function x(e,t,n,i){return n+(t<<8)+(e<<16)}function E(e,t,n,i,r,o){var a=Math.floor(n/o*r),s=Math.floor(e.drawingBufferHeight/o-i/o*r),h=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(a,s,1,1,e.RGBA,e.UNSIGNED_BYTE,h);var c=u(h,4),d=c[0],l=c[1],f=c[2],g=c[3];return[d,l,f,g]}},1109:(e,t,n)=>{"use strict";n.d(t,{D:()=>H,E:()=>re,F:()=>Y,N:()=>M,_:()=>s,a:()=>o,b:()=>T,c:()=>R,d:()=>k,e:()=>de,f:()=>_,g:()=>x,h:()=>E,i:()=>V});var i=n(4271),r=n(520);function o(e,t,n){return(t=(0,i.d)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=(0,i.e)(e)););return e}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=u(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},h.apply(null,arguments)}function c(e,t,n,r){var o=h((0,i.e)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function d(e){return e.normalized?1:e.size}function l(e){var t=0;return e.forEach((function(e){return t+=d(e)})),t}function f(e,t,n){var i="VERTEX"===e?t.VERTEX_SHADER:t.FRAGMENT_SHADER,r=t.createShader(i);if(null===r)throw new Error("loadShader: error while creating the shader");t.shaderSource(r,n),t.compileShader(r);var o=t.getShaderParameter(r,t.COMPILE_STATUS);if(!o){var a=t.getShaderInfoLog(r);throw t.deleteShader(r),new Error("loadShader: error while compiling the shader:\n".concat(a,"\n").concat(n))}return r}function g(e,t){return f("VERTEX",e,t)}function p(e,t){return f("FRAGMENT",e,t)}function v(e,t){var n,i,r=e.createProgram();if(null===r)throw new Error("loadProgram: error while creating the program.");for(n=0,i=t.length;n<i;n++)e.attachShader(r,t[n]);e.linkProgram(r);var o=e.getProgramParameter(r,e.LINK_STATUS);if(!o)throw e.deleteProgram(r),new Error("loadProgram: error while linking the program.");return r}function m(e){var t=e.gl,n=e.buffer,i=e.program,r=e.vertexShader,o=e.fragmentShader;t.deleteShader(r),t.deleteShader(o),t.deleteProgram(i),t.deleteBuffer(n)}var y="#define PICKING_MODE\n",b=o(o(o(o(o(o(o(o({},WebGL2RenderingContext.BOOL,1),WebGL2RenderingContext.BYTE,1),WebGL2RenderingContext.UNSIGNED_BYTE,1),WebGL2RenderingContext.SHORT,2),WebGL2RenderingContext.UNSIGNED_SHORT,2),WebGL2RenderingContext.INT,4),WebGL2RenderingContext.UNSIGNED_INT,4),WebGL2RenderingContext.FLOAT,4),w=function(){function e(t,n,r){(0,i.b)(this,e),o(this,"array",new Float32Array),o(this,"constantArray",new Float32Array),o(this,"capacity",0),o(this,"verticesCount",0);var a=this.getDefinition();if(this.VERTICES=a.VERTICES,this.VERTEX_SHADER_SOURCE=a.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=a.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=a.UNIFORMS,this.ATTRIBUTES=a.ATTRIBUTES,this.METHOD=a.METHOD,this.CONSTANT_ATTRIBUTES="CONSTANT_ATTRIBUTES"in a?a.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA="CONSTANT_DATA"in a?a.CONSTANT_DATA:[],this.isInstanced="CONSTANT_ATTRIBUTES"in a,this.ATTRIBUTES_ITEMS_COUNT=l(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=r,this.normalProgram=this.getProgramInfo("normal",t,a.VERTEX_SHADER_SOURCE,a.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=n?this.getProgramInfo("pick",t,y+a.VERTEX_SHADER_SOURCE,y+a.FRAGMENT_SHADER_SOURCE,n):null,this.isInstanced){var s=l(this.CONSTANT_ATTRIBUTES);if(this.CONSTANT_DATA.length!==this.VERTICES)throw new Error("Program: error while getting constant data (expected ".concat(this.VERTICES," items, received ").concat(this.CONSTANT_DATA.length," instead)"));this.constantArray=new Float32Array(this.CONSTANT_DATA.length*s);for(var u=0;u<this.CONSTANT_DATA.length;u++){var h=this.CONSTANT_DATA[u];if(h.length!==s)throw new Error("Program: error while getting constant data (one vector has ".concat(h.length," items instead of ").concat(s,")"));for(var c=0;c<h.length;c++)this.constantArray[u*s+c]=h[c]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return(0,i.a)(e,[{key:"kill",value:function(){m(this.normalProgram),this.pickProgram&&(m(this.pickProgram),this.pickProgram=null)}},{key:"getProgramInfo",value:function(e,t,n,i,r){var o=this.getDefinition(),a=t.createBuffer();if(null===a)throw new Error("Program: error while creating the WebGL buffer.");var s=g(t,n),u=p(t,i),h=v(t,[s,u]),c={};o.UNIFORMS.forEach((function(e){var n=t.getUniformLocation(h,e);n&&(c[e]=n)}));var d,l={};if(o.ATTRIBUTES.forEach((function(e){l[e.name]=t.getAttribLocation(h,e.name)})),"CONSTANT_ATTRIBUTES"in o&&(o.CONSTANT_ATTRIBUTES.forEach((function(e){l[e.name]=t.getAttribLocation(h,e.name)})),d=t.createBuffer(),null===d))throw new Error("Program: error while creating the WebGL constant buffer.");return{name:e,program:h,gl:t,frameBuffer:r,buffer:a,constantBuffer:d||{},uniformLocations:c,attributeLocations:l,isPicking:"pick"===e,vertexShader:s,fragmentShader:u}}},{key:"bindProgram",value:function(e){var t=this,n=0,i=e.gl,r=e.buffer;this.isInstanced?(i.bindBuffer(i.ARRAY_BUFFER,e.constantBuffer),n=0,this.CONSTANT_ATTRIBUTES.forEach((function(i){return n+=t.bindAttribute(i,e,n,!1)})),i.bufferData(i.ARRAY_BUFFER,this.constantArray,i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,e.buffer),n=0,this.ATTRIBUTES.forEach((function(i){return n+=t.bindAttribute(i,e,n,!0)})),i.bufferData(i.ARRAY_BUFFER,this.array,i.DYNAMIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,r),n=0,this.ATTRIBUTES.forEach((function(i){return n+=t.bindAttribute(i,e,n)})),i.bufferData(i.ARRAY_BUFFER,this.array,i.DYNAMIC_DRAW)),i.bindBuffer(i.ARRAY_BUFFER,null)}},{key:"unbindProgram",value:function(e){var t=this;this.isInstanced?(this.CONSTANT_ATTRIBUTES.forEach((function(n){return t.unbindAttribute(n,e,!1)})),this.ATTRIBUTES.forEach((function(n){return t.unbindAttribute(n,e,!0)}))):this.ATTRIBUTES.forEach((function(n){return t.unbindAttribute(n,e)}))}},{key:"bindAttribute",value:function(e,t,n,i){var r=b[e.type];if("number"!==typeof r)throw new Error('Program.bind: yet unsupported attribute type "'.concat(e.type,'"'));var o=t.attributeLocations[e.name],a=t.gl;if(-1!==o){a.enableVertexAttribArray(o);var s=this.isInstanced?(i?this.ATTRIBUTES_ITEMS_COUNT:l(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT:this.ATTRIBUTES_ITEMS_COUNT*Float32Array.BYTES_PER_ELEMENT;if(a.vertexAttribPointer(o,e.size,e.type,e.normalized||!1,s,n),this.isInstanced&&i)if(a instanceof WebGL2RenderingContext)a.vertexAttribDivisor(o,1);else{var u=a.getExtension("ANGLE_instanced_arrays");u&&u.vertexAttribDivisorANGLE(o,1)}}return e.size*r}},{key:"unbindAttribute",value:function(e,t,n){var i=t.attributeLocations[e.name],r=t.gl;if(-1!==i&&(r.disableVertexAttribArray(i),this.isInstanced&&n))if(r instanceof WebGL2RenderingContext)r.vertexAttribDivisor(i,0);else{var o=r.getExtension("ANGLE_instanced_arrays");o&&o.vertexAttribDivisorANGLE(i,0)}}},{key:"reallocate",value:function(e){e!==this.capacity&&(this.capacity=e,this.verticesCount=this.VERTICES*e,this.array=new Float32Array(this.isInstanced?this.capacity*this.ATTRIBUTES_ITEMS_COUNT:this.verticesCount*this.ATTRIBUTES_ITEMS_COUNT))}},{key:"hasNothingToRender",value:function(){return 0===this.verticesCount}},{key:"renderProgram",value:function(e,t){var n=t.gl,i=t.program;n.enable(n.BLEND),n.useProgram(i),this.setUniforms(e,t),this.drawWebGL(this.METHOD,t)}},{key:"render",value:function(e){this.hasNothingToRender()||(this.pickProgram&&(this.pickProgram.gl.viewport(0,0,e.width*e.pixelRatio/e.downSizingRatio,e.height*e.pixelRatio/e.downSizingRatio),this.bindProgram(this.pickProgram),this.renderProgram(s(s({},e),{},{pixelRatio:e.pixelRatio/e.downSizingRatio}),this.pickProgram),this.unbindProgram(this.pickProgram)),this.normalProgram.gl.viewport(0,0,e.width*e.pixelRatio,e.height*e.pixelRatio),this.bindProgram(this.normalProgram),this.renderProgram(e,this.normalProgram),this.unbindProgram(this.normalProgram))}},{key:"drawWebGL",value:function(e,t){var n=t.gl,i=t.frameBuffer;if(n.bindFramebuffer(n.FRAMEBUFFER,i),this.isInstanced)if(n instanceof WebGL2RenderingContext)n.drawArraysInstanced(e,0,this.VERTICES,this.capacity);else{var r=n.getExtension("ANGLE_instanced_arrays");r&&r.drawArraysInstancedANGLE(e,0,this.VERTICES,this.capacity)}else n.drawArrays(e,0,this.verticesCount)}}])}(),_=function(e){function t(){return(0,i.b)(this,t),(0,i.c)(this,t,arguments)}return(0,i._)(t,e),(0,i.a)(t,[{key:"kill",value:function(){c(t,"kill",this,3)([])}},{key:"process",value:function(e,t,n){var i=t*this.STRIDE;if(!n.hidden)return this.processVisibleItem((0,r.i)(e),i,n);for(var o=i+this.STRIDE;i<o;i++)this.array[i]=0}}])}(w);var x=function(e){function t(){var e;(0,i.b)(this,t);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e=(0,i.c)(this,t,[].concat(r)),o(e,"drawLabel",void 0),e}return(0,i._)(t,e),(0,i.a)(t,[{key:"kill",value:function(){c(t,"kill",this,3)([])}},{key:"process",value:function(e,t,n,i,o){var a=t*this.STRIDE;if(!(o.hidden||n.hidden||i.hidden))return this.processVisibleItem((0,r.i)(e),a,n,i,o);for(var s=a+this.STRIDE;a<s;a++)this.array[a]=0}}])}(w);function E(e,t){return function(){function n(r,a,s){(0,i.b)(this,n),o(this,"drawLabel",t),this.programs=e.map((function(e){return new e(r,a,s)}))}return(0,i.a)(n,[{key:"reallocate",value:function(e){this.programs.forEach((function(t){return t.reallocate(e)}))}},{key:"process",value:function(e,t,n,i,r){this.programs.forEach((function(o){return o.process(e,t,n,i,r)}))}},{key:"render",value:function(e){this.programs.forEach((function(t){return t.render(e)}))}},{key:"kill",value:function(){this.programs.forEach((function(e){return e.kill()}))}}])}()}function k(e,t,n,i,r){var o=r.edgeLabelSize,a=r.edgeLabelFont,s=r.edgeLabelWeight,u=r.edgeLabelColor.attribute?t[r.edgeLabelColor.attribute]||r.edgeLabelColor.color||"#000":r.edgeLabelColor.color,h=t.label;if(h){e.fillStyle=u,e.font="".concat(s," ").concat(o,"px ").concat(a);var c=n.size,d=i.size,l=n.x,f=n.y,g=i.x,p=i.y,v=(l+g)/2,m=(f+p)/2,y=g-l,b=p-f,w=Math.sqrt(y*y+b*b);if(!(w<c+d)){l+=y*c/w,f+=b*c/w,g-=y*d/w,p-=b*d/w,v=(l+g)/2,m=(f+p)/2,y=g-l,b=p-f,w=Math.sqrt(y*y+b*b);var _,x=e.measureText(h).width;if(x>w){var E="…";h+=E,x=e.measureText(h).width;while(x>w&&h.length>1)h=h.slice(0,-2)+E,x=e.measureText(h).width;if(h.length<4)return}_=y>0?b>0?Math.acos(y/w):Math.asin(b/w):b>0?Math.acos(y/w)+Math.PI:Math.asin(y/w)+Math.PI/2,e.save(),e.translate(v,m),e.rotate(_),e.fillText(h,-x/2,t.size/2+o),e.restore()}}}function T(e,t,n){if(t.label){var i=n.labelSize,r=n.labelFont,o=n.labelWeight,a=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=a,e.font="".concat(o," ").concat(i,"px ").concat(r),e.fillText(t.label,t.x+t.size+3,t.y+i/3)}}function R(e,t,n){var i=n.labelSize,r=n.labelFont,o=n.labelWeight;e.font="".concat(o," ").concat(i,"px ").concat(r),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var a=2;if("string"===typeof t.label){var s=e.measureText(t.label).width,u=Math.round(s+5),h=Math.round(i+2*a),c=Math.max(t.size,i/2)+a,d=Math.asin(h/2/c),l=Math.sqrt(Math.abs(Math.pow(c,2)-Math.pow(h/2,2)));e.beginPath(),e.moveTo(t.x+l,t.y+h/2),e.lineTo(t.x+c+u,t.y+h/2),e.lineTo(t.x+c+u,t.y-h/2),e.lineTo(t.x+l,t.y-h/2),e.arc(t.x,t.y,c,d,-d),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+a,0,2*Math.PI),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,T(e,t,n)}var C="\nprecision highp float;\n\nvarying vec4 v_color;\nvarying vec2 v_diffVector;\nvarying float v_radius;\n\nuniform float u_correctionRatio;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n\nvoid main(void) {\n float border = u_correctionRatio * 2.0;\n float dist = length(v_diffVector) - v_radius + border;\n\n // No antialiasing for picking mode:\n #ifdef PICKING_MODE\n if (dist > border)\n gl_FragColor = transparent;\n else\n gl_FragColor = v_color;\n\n #else\n float t = 0.0;\n if (dist > border)\n t = 1.0;\n else if (dist > 0.0)\n t = dist / border;\n\n gl_FragColor = mix(v_color, transparent, t);\n #endif\n}\n",S=C,A="\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute vec2 a_position;\nattribute float a_size;\nattribute float a_angle;\n\nuniform mat3 u_matrix;\nuniform float u_sizeRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_diffVector;\nvarying float v_radius;\nvarying float v_border;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;\n vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));\n vec2 position = a_position + diffVector;\n gl_Position = vec4(\n (u_matrix * vec3(position, 1)).xy,\n 0,\n 1\n );\n\n v_diffVector = diffVector;\n v_radius = size / 2.0;\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n\n v_color.a *= bias;\n}\n",L=A,G=WebGLRenderingContext,D=G.UNSIGNED_BYTE,N=G.FLOAT,F=["u_sizeRatio","u_correctionRatio","u_matrix"],M=function(e){function t(){return(0,i.b)(this,t),(0,i.c)(this,t,arguments)}return(0,i._)(t,e),(0,i.a)(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:L,FRAGMENT_SHADER_SOURCE:S,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:F,ATTRIBUTES:[{name:"a_position",size:2,type:N},{name:"a_size",size:1,type:N},{name:"a_color",size:4,type:D,normalized:!0},{name:"a_id",size:4,type:D,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:N}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(e,t,n){var i=this.array,o=(0,r.f)(n.color);i[t++]=n.x,i[t++]=n.y,i[t++]=n.size,i[t++]=o,i[t++]=e}},{key:"setUniforms",value:function(e,t){var n=t.gl,i=t.uniformLocations,r=i.u_sizeRatio,o=i.u_correctionRatio,a=i.u_matrix;n.uniform1f(o,e.correctionRatio),n.uniform1f(r,e.sizeRatio),n.uniformMatrix3fv(a,!1,e.matrix)}}])}(_);o(M,"ANGLE_1",0),o(M,"ANGLE_2",2*Math.PI/3),o(M,"ANGLE_3",4*Math.PI/3);var P="\nprecision mediump float;\n\nvarying vec4 v_color;\n\nvoid main(void) {\n gl_FragColor = v_color;\n}\n",z=P,O="\nattribute vec2 a_position;\nattribute vec2 a_normal;\nattribute float a_radius;\nattribute vec3 a_barycentric;\n\n#ifdef PICKING_MODE\nattribute vec4 a_id;\n#else\nattribute vec4 a_color;\n#endif\n\nuniform mat3 u_matrix;\nuniform float u_sizeRatio;\nuniform float u_correctionRatio;\nuniform float u_minEdgeThickness;\nuniform float u_lengthToThicknessRatio;\nuniform float u_widenessToThicknessRatio;\n\nvarying vec4 v_color;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float minThickness = u_minEdgeThickness;\n\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl and\n // edge.clamped.vert.glsl. Please read it to get better comments on what's\n // happening:\n float pixelsThickness = max(normalLength / u_sizeRatio, minThickness);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio;\n float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;\n float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio;\n\n float da = a_barycentric.x;\n float db = a_barycentric.y;\n float dc = a_barycentric.z;\n\n vec2 delta = vec2(\n da * (webGLNodeRadius * unitNormal.y)\n + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x)\n + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x),\n\n da * (-webGLNodeRadius * unitNormal.x)\n + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y)\n + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y)\n );\n\n vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;\n\n gl_Position = vec4(position, 0, 1);\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n\n v_color.a *= bias;\n}\n",I=O,U=WebGLRenderingContext,B=U.UNSIGNED_BYTE,j=U.FLOAT,W=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],H={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function V(e){var t=s(s({},H),e||{});return function(e){function n(){return(0,i.b)(this,n),(0,i.c)(this,n,arguments)}return(0,i._)(n,e),(0,i.a)(n,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:I,FRAGMENT_SHADER_SOURCE:z,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:W,ATTRIBUTES:[{name:"a_position",size:2,type:j},{name:"a_normal",size:2,type:j},{name:"a_radius",size:1,type:j},{name:"a_color",size:4,type:B,normalized:!0},{name:"a_id",size:4,type:B,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:j}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(e,n,i,o,a){if("source"===t.extremity){var s=[o,i];i=s[0],o=s[1]}var u=a.size||1,h=o.size||1,c=i.x,d=i.y,l=o.x,f=o.y,g=(0,r.f)(a.color),p=l-c,v=f-d,m=p*p+v*v,y=0,b=0;m&&(m=1/Math.sqrt(m),y=-v*m*u,b=p*m*u);var w=this.array;w[n++]=l,w[n++]=f,w[n++]=-y,w[n++]=-b,w[n++]=h,w[n++]=g,w[n++]=e}},{key:"setUniforms",value:function(e,n){var i=n.gl,r=n.uniformLocations,o=r.u_matrix,a=r.u_sizeRatio,s=r.u_correctionRatio,u=r.u_minEdgeThickness,h=r.u_lengthToThicknessRatio,c=r.u_widenessToThicknessRatio;i.uniformMatrix3fv(o,!1,e.matrix),i.uniform1f(a,e.sizeRatio),i.uniform1f(s,e.correctionRatio),i.uniform1f(u,e.minEdgeThickness),i.uniform1f(h,t.lengthToThicknessRatio),i.uniform1f(c,t.widenessToThicknessRatio)}}])}(x)}V();var q="\nprecision mediump float;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\nvarying float v_feather;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n\nvoid main(void) {\n // We only handle antialiasing for normal mode:\n #ifdef PICKING_MODE\n gl_FragColor = v_color;\n #else\n float dist = length(v_normal) * v_thickness;\n\n float t = smoothstep(\n v_thickness - v_feather,\n v_thickness,\n dist\n );\n\n gl_FragColor = mix(v_color, transparent, t);\n #endif\n}\n",Y=q,X="\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute float a_normalCoef;\nattribute vec2 a_positionStart;\nattribute vec2 a_positionEnd;\nattribute float a_positionCoef;\nattribute float a_radius;\nattribute float a_radiusCoef;\n\nuniform mat3 u_matrix;\nuniform float u_zoomRatio;\nuniform float u_sizeRatio;\nuniform float u_pixelRatio;\nuniform float u_correctionRatio;\nuniform float u_minEdgeThickness;\nuniform float u_lengthToThicknessRatio;\nuniform float u_feather;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\nvarying float v_feather;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float minThickness = u_minEdgeThickness;\n\n float radius = a_radius * a_radiusCoef;\n vec2 normal = a_normal * a_normalCoef;\n vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;\n\n float normalLength = length(normal);\n vec2 unitNormal = normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;\n\n // Here, we move the point to leave space for the arrow head:\n float direction = sign(radius);\n float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio;\n float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;\n\n vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_zoomRatio;\n\n v_normal = unitNormal;\n\n v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n\n v_color.a *= bias;\n}\n",Z=X,K=WebGLRenderingContext,Q=K.UNSIGNED_BYTE,$=K.FLOAT,J=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],ee={lengthToThicknessRatio:H.lengthToThicknessRatio};function te(e){var t=s(s({},ee),e||{});return function(e){function n(){return(0,i.b)(this,n),(0,i.c)(this,n,arguments)}return(0,i._)(n,e),(0,i.a)(n,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:Z,FRAGMENT_SHADER_SOURCE:Y,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:J,ATTRIBUTES:[{name:"a_positionStart",size:2,type:$},{name:"a_positionEnd",size:2,type:$},{name:"a_normal",size:2,type:$},{name:"a_color",size:4,type:Q,normalized:!0},{name:"a_id",size:4,type:Q,normalized:!0},{name:"a_radius",size:1,type:$}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:$},{name:"a_normalCoef",size:1,type:$},{name:"a_radiusCoef",size:1,type:$}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(e,t,n,i,o){var a=o.size||1,s=n.x,u=n.y,h=i.x,c=i.y,d=(0,r.f)(o.color),l=h-s,f=c-u,g=i.size||1,p=l*l+f*f,v=0,m=0;p&&(p=1/Math.sqrt(p),v=-f*p*a,m=l*p*a);var y=this.array;y[t++]=s,y[t++]=u,y[t++]=h,y[t++]=c,y[t++]=v,y[t++]=m,y[t++]=d,y[t++]=e,y[t++]=g}},{key:"setUniforms",value:function(e,n){var i=n.gl,r=n.uniformLocations,o=r.u_matrix,a=r.u_zoomRatio,s=r.u_feather,u=r.u_pixelRatio,h=r.u_correctionRatio,c=r.u_sizeRatio,d=r.u_minEdgeThickness,l=r.u_lengthToThicknessRatio;i.uniformMatrix3fv(o,!1,e.matrix),i.uniform1f(a,e.zoomRatio),i.uniform1f(c,e.sizeRatio),i.uniform1f(h,e.correctionRatio),i.uniform1f(u,e.pixelRatio),i.uniform1f(s,e.antiAliasingFeather),i.uniform1f(d,e.minEdgeThickness),i.uniform1f(l,t.lengthToThicknessRatio)}}])}(x)}te();function ne(e){return E([te(e),V(e)])}var ie=ne(),re=ie,oe='\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute float a_normalCoef;\nattribute vec2 a_positionStart;\nattribute vec2 a_positionEnd;\nattribute float a_positionCoef;\n\nuniform mat3 u_matrix;\nuniform float u_sizeRatio;\nuniform float u_zoomRatio;\nuniform float u_pixelRatio;\nuniform float u_correctionRatio;\nuniform float u_minEdgeThickness;\nuniform float u_feather;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\nvarying float v_feather;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float minThickness = u_minEdgeThickness;\n\n vec2 normal = a_normal * a_normalCoef;\n vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;\n\n float normalLength = length(normal);\n vec2 unitNormal = normal / normalLength;\n\n // We require edges to be at least "minThickness" pixels thick *on screen*\n // (so we need to compensate the size ratio):\n float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);\n\n // Then, we need to retrieve the normalized thickness of the edge in the WebGL\n // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction\n // ratio:\n float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1);\n\n // For the fragment shader though, we need a thickness that takes the "magic"\n // correction ratio into account (as in webGLThickness), but so that the\n // antialiasing effect does not depend on the zoom level. So here\'s yet\n // another thickness version:\n v_thickness = webGLThickness / u_zoomRatio;\n\n v_normal = unitNormal;\n\n v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n\n v_color.a *= bias;\n}\n',ae=oe,se=WebGLRenderingContext,ue=se.UNSIGNED_BYTE,he=se.FLOAT,ce=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],de=function(e){function t(){return(0,i.b)(this,t),(0,i.c)(this,t,arguments)}return(0,i._)(t,e),(0,i.a)(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:ae,FRAGMENT_SHADER_SOURCE:Y,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:ce,ATTRIBUTES:[{name:"a_positionStart",size:2,type:he},{name:"a_positionEnd",size:2,type:he},{name:"a_normal",size:2,type:he},{name:"a_color",size:4,type:ue,normalized:!0},{name:"a_id",size:4,type:ue,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:he},{name:"a_normalCoef",size:1,type:he}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(e,t,n,i,o){var a=o.size||1,s=n.x,u=n.y,h=i.x,c=i.y,d=(0,r.f)(o.color),l=h-s,f=c-u,g=l*l+f*f,p=0,v=0;g&&(g=1/Math.sqrt(g),p=-f*g*a,v=l*g*a);var m=this.array;m[t++]=s,m[t++]=u,m[t++]=h,m[t++]=c,m[t++]=p,m[t++]=v,m[t++]=d,m[t++]=e}},{key:"setUniforms",value:function(e,t){var n=t.gl,i=t.uniformLocations,r=i.u_matrix,o=i.u_zoomRatio,a=i.u_feather,s=i.u_pixelRatio,u=i.u_correctionRatio,h=i.u_sizeRatio,c=i.u_minEdgeThickness;n.uniformMatrix3fv(r,!1,e.matrix),n.uniform1f(o,e.zoomRatio),n.uniform1f(h,e.sizeRatio),n.uniform1f(u,e.correctionRatio),n.uniform1f(s,e.pixelRatio),n.uniform1f(a,e.antiAliasingFeather),n.uniform1f(c,e.minEdgeThickness)}}])}(x)},4271:(e,t,n)=>{"use strict";function i(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function r(e){var t=i(e,"string");return"symbol"==typeof t?t:t+""}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function s(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function l(e,t,n){return t=u(t),d(e,h()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}n.d(t,{_:()=>g,a:()=>s,b:()=>o,c:()=>l,d:()=>r,e:()=>u})},6747:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Camera:()=>W,MouseCaptor:()=>te,Sigma:()=>be,TouchCaptor:()=>re,default:()=>we});var i=n(1109),r=n(4271),o=n(640),a=function(e){function t(){var e;return(0,r.b)(this,t),e=(0,r.c)(this,t),e.rawEmitter=e,e}return(0,r._)(t,e),(0,r.a)(t)}(o.EventEmitter),s=n(9235),u=n.n(s),h=n(520),c=function(e){return e},d=function(e){return e*e},l=function(e){return e*(2-e)},f=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},g=function(e){return e*e*e},p=function(e){return--e*e*e+1},v=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},m={linear:c,quadraticIn:d,quadraticOut:l,quadraticInOut:f,cubicIn:g,cubicOut:p,cubicInOut:v},y={easing:"quadraticInOut",duration:150};function b(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function w(e,t,n){return e[0]=t,e[4]="number"===typeof n?n:t,e}function _(e,t){var n=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=n,e[3]=-n,e[4]=i,e}function x(e,t,n){return e[6]=t,e[7]=n,e}function E(e,t){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],d=t[0],l=t[1],f=t[2],g=t[3],p=t[4],v=t[5],m=t[6],y=t[7],b=t[8];return e[0]=d*n+l*o+f*u,e[1]=d*i+l*a+f*h,e[2]=d*r+l*s+f*c,e[3]=g*n+p*o+v*u,e[4]=g*i+p*a+v*h,e[5]=g*r+p*s+v*c,e[6]=m*n+y*o+b*u,e[7]=m*i+y*a+b*h,e[8]=m*r+y*s+b*c,e}function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=e[0],r=e[1],o=e[3],a=e[4],s=e[6],u=e[7],h=t.x,c=t.y;return{x:h*i+c*o+s*n,y:h*r+c*a+u*n}}function T(e,t){var n=e.height/e.width,i=t.height/t.width;return n<1&&i>1||n>1&&i<1?1:Math.min(Math.max(i,1/i),Math.max(1/n,n))}function R(e,t,n,i,r){var o=e.angle,a=e.ratio,s=e.x,u=e.y,h=t.width,c=t.height,d=b(),l=Math.min(h,c)-2*i,f=T(t,n);return r?(E(d,x(b(),s,u)),E(d,w(b(),a)),E(d,_(b(),o)),E(d,w(b(),h/l/2/f,c/l/2/f))):(E(d,w(b(),l/h*2*f,l/c*2*f)),E(d,_(b(),-o)),E(d,w(b(),1/a)),E(d,x(b(),-s,-u))),d}function C(e,t,n){var i=k(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),r=i.x,o=i.y;return 1/Math.sqrt(Math.pow(r,2)+Math.pow(o,2))/n.width}function S(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,i=1/0,r=-1/0;return e.forEachNode((function(e,o){var a=o.x,s=o.y;a<t&&(t=a),a>n&&(n=a),s<i&&(i=s),s>r&&(r=s)})),{x:[t,n],y:[i,r]}}function A(e){if(!u()(e))throw new Error("Sigma: invalid graph instance.");e.forEachNode((function(e,t){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))throw new Error("Sigma: Coordinates of node ".concat(e," are invalid. A node must have a numeric 'x' and 'y' attribute."))}))}function L(e,t,n){var i=document.createElement(e);if(t)for(var r in t)i.style[r]=t[r];if(n)for(var o in n)i.setAttribute(o,n[o]);return i}function G(){return"undefined"!==typeof window.devicePixelRatio?window.devicePixelRatio:1}function D(e,t,n){return n.sort((function(e,n){var i=t(e)||0,r=t(n)||0;return i<r?-1:i>r?1:0}))}function N(e){var t=(0,h._)(e.x,2),n=t[0],i=t[1],r=(0,h._)(e.y,2),o=r[0],a=r[1],s=Math.max(i-n,a-o),u=(i+n)/2,c=(a+o)/2;(0===s||Math.abs(s)===1/0||isNaN(s))&&(s=1),isNaN(u)&&(u=0),isNaN(c)&&(c=0);var d=function(e){return{x:.5+(e.x-u)/s,y:.5+(e.y-c)/s}};return d.applyTo=function(e){e.x=.5+(e.x-u)/s,e.y=.5+(e.y-c)/s},d.inverse=function(e){return{x:u+s*(e.x-.5),y:c+s*(e.y-.5)}},d.ratio=s,d}function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function M(e,t){var n=t.size;if(0!==n){var i=e.length;e.length+=n;var r=0;t.forEach((function(t){e[i+r]=t,r++}))}}function P(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;t++){var i=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];i&&Object.assign(e,i)}return e}var z={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!1,enableEdgeEvents:!1,defaultNodeColor:"#999",defaultNodeType:"circle",defaultEdgeColor:"#ccc",defaultEdgeType:"line",labelFont:"Arial",labelSize:14,labelWeight:"normal",labelColor:{color:"#000"},edgeLabelFont:"Arial",edgeLabelSize:14,edgeLabelWeight:"normal",edgeLabelColor:{attribute:"color"},stagePadding:30,defaultDrawEdgeLabel:i.d,defaultDrawNodeLabel:i.b,defaultDrawNodeHover:i.c,minEdgeThickness:1.7,antiAliasingFeather:1,dragTimeout:100,draggedEventsTolerance:3,inertiaDuration:200,inertiaRatio:3,zoomDuration:250,zoomingRatio:1.7,doubleClickTimeout:300,doubleClickZoomingRatio:2.2,doubleClickZoomingDuration:200,tapMoveTolerance:10,zoomToSizeRatioFunction:Math.sqrt,itemSizesReference:"screen",autoRescale:!0,autoCenter:!0,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,nodeReducer:null,edgeReducer:null,zIndex:!1,minCameraRatio:null,maxCameraRatio:null,enableCameraZooming:!0,enableCameraPanning:!0,enableCameraRotation:!0,cameraPanBoundaries:null,allowInvalidContainer:!1,nodeProgramClasses:{},nodeHoverProgramClasses:{},edgeProgramClasses:{}},O={circle:i.N},I={arrow:i.E,line:i.e};function U(e){if("number"!==typeof e.labelDensity||e.labelDensity<0)throw new Error("Settings: invalid `labelDensity`. Expecting a positive number.");var t=e.minCameraRatio,n=e.maxCameraRatio;if("number"===typeof t&&"number"===typeof n&&n<t)throw new Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")}function B(e){var t=P({},z,e);return t.nodeProgramClasses=P({},O,t.nodeProgramClasses),t.edgeProgramClasses=P({},I,t.edgeProgramClasses),t}var j=1.5,W=function(e){function t(){var e;return(0,r.b)(this,t),e=(0,r.c)(this,t),(0,i.a)(e,"x",.5),(0,i.a)(e,"y",.5),(0,i.a)(e,"angle",0),(0,i.a)(e,"ratio",1),(0,i.a)(e,"minRatio",null),(0,i.a)(e,"maxRatio",null),(0,i.a)(e,"enabledZooming",!0),(0,i.a)(e,"enabledPanning",!0),(0,i.a)(e,"enabledRotation",!0),(0,i.a)(e,"clean",null),(0,i.a)(e,"nextFrame",null),(0,i.a)(e,"previousState",null),(0,i.a)(e,"enabled",!0),e.previousState=e.getState(),e}return(0,r._)(t,e),(0,r.a)(t,[{key:"enable",value:function(){return this.enabled=!0,this}},{key:"disable",value:function(){return this.enabled=!1,this}},{key:"getState",value:function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}}},{key:"hasState",value:function(e){return this.x===e.x&&this.y===e.y&&this.ratio===e.ratio&&this.angle===e.angle}},{key:"getPreviousState",value:function(){var e=this.previousState;return e?{x:e.x,y:e.y,angle:e.angle,ratio:e.ratio}:null}},{key:"getBoundedRatio",value:function(e){var t=e;return"number"===typeof this.minRatio&&(t=Math.max(t,this.minRatio)),"number"===typeof this.maxRatio&&(t=Math.min(t,this.maxRatio)),t}},{key:"validateState",value:function(e){var t={};return this.enabledPanning&&"number"===typeof e.x&&(t.x=e.x),this.enabledPanning&&"number"===typeof e.y&&(t.y=e.y),this.enabledZooming&&"number"===typeof e.ratio&&(t.ratio=this.getBoundedRatio(e.ratio)),this.enabledRotation&&"number"===typeof e.angle&&(t.angle=e.angle),this.clean?this.clean((0,i._)((0,i._)({},this.getState()),t)):t}},{key:"isAnimated",value:function(){return!!this.nextFrame}},{key:"setState",value:function(e){if(!this.enabled)return this;this.previousState=this.getState();var t=this.validateState(e);return"number"===typeof t.x&&(this.x=t.x),"number"===typeof t.y&&(this.y=t.y),"number"===typeof t.ratio&&(this.ratio=t.ratio),"number"===typeof t.angle&&(this.angle=t.angle),this.hasState(this.previousState)||this.emit("updated",this.getState()),this}},{key:"updateState",value:function(e){return this.setState(e(this.getState())),this}},{key:"animate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!r)return new Promise((function(i){return t.animate(e,n,i)}));if(this.enabled){var o=(0,i._)((0,i._)({},y),n),a=this.validateState(e),s="function"===typeof o.easing?o.easing:m[o.easing],u=Date.now(),h=this.getState(),c=function(){var e=(Date.now()-u)/o.duration;if(e>=1)return t.nextFrame=null,t.setState(a),void(t.animationCallback&&(t.animationCallback.call(null),t.animationCallback=void 0));var n=s(e),i={};"number"===typeof a.x&&(i.x=h.x+(a.x-h.x)*n),"number"===typeof a.y&&(i.y=h.y+(a.y-h.y)*n),t.enabledRotation&&"number"===typeof a.angle&&(i.angle=h.angle+(a.angle-h.angle)*n),"number"===typeof a.ratio&&(i.ratio=h.ratio+(a.ratio-h.ratio)*n),t.setState(i),t.nextFrame=requestAnimationFrame(c)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(c)):c(),this.animationCallback=r}}},{key:"animatedZoom",value:function(e){return e?"number"===typeof e?this.animate({ratio:this.ratio/e}):this.animate({ratio:this.ratio/(e.factor||j)},e):this.animate({ratio:this.ratio/j})}},{key:"animatedUnzoom",value:function(e){return e?"number"===typeof e?this.animate({ratio:this.ratio*e}):this.animate({ratio:this.ratio*(e.factor||j)},e):this.animate({ratio:this.ratio*j})}},{key:"animatedReset",value:function(e){return this.animate({x:.5,y:.5,ratio:1,angle:0},e)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(e){var n=new t;return n.setState(e)}}])}(a);function H(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function V(e,t){var n=(0,i._)((0,i._)({},H(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function q(e){var t="x"in e?e:(0,i._)((0,i._)({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function Y(e,t){return(0,i._)((0,i._)({},V(e,t)),{},{delta:Q(e)})}var X=2;function Z(e){for(var t=[],n=0,i=Math.min(e.length,X);n<i;n++)t.push(e[n]);return t}function K(e,t,n){var i={touches:Z(e.touches).map((function(e){return H(e,n)})),previousTouches:t.map((function(e){return H(e,n)})),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){i.sigmaDefaultPrevented=!0},original:e};return i}function Q(e){if("undefined"!==typeof e.deltaY)return-3*e.deltaY/360;if("undefined"!==typeof e.detail)return e.detail/-9;throw new Error("Captor: could not extract delta from event.")}var $=function(e){function t(e,n){var i;return(0,r.b)(this,t),i=(0,r.c)(this,t),i.container=e,i.renderer=n,i}return(0,r._)(t,e),(0,r.a)(t)}(a),J=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],ee=J.reduce((function(e,t){return(0,i._)((0,i._)({},e),{},(0,i.a)({},t,z[t]))}),{}),te=function(e){function t(e,n){var o;return(0,r.b)(this,t),o=(0,r.c)(this,t,[e,n]),(0,i.a)(o,"enabled",!0),(0,i.a)(o,"draggedEvents",0),(0,i.a)(o,"downStartTime",null),(0,i.a)(o,"lastMouseX",null),(0,i.a)(o,"lastMouseY",null),(0,i.a)(o,"isMouseDown",!1),(0,i.a)(o,"isMoving",!1),(0,i.a)(o,"movingTimeout",null),(0,i.a)(o,"startCameraState",null),(0,i.a)(o,"clicks",0),(0,i.a)(o,"doubleClickTimeout",null),(0,i.a)(o,"currentWheelDirection",0),(0,i.a)(o,"settings",ee),o.handleClick=o.handleClick.bind(o),o.handleRightClick=o.handleRightClick.bind(o),o.handleDown=o.handleDown.bind(o),o.handleUp=o.handleUp.bind(o),o.handleMove=o.handleMove.bind(o),o.handleWheel=o.handleWheel.bind(o),o.handleLeave=o.handleLeave.bind(o),o.handleEnter=o.handleEnter.bind(o),e.addEventListener("click",o.handleClick,{capture:!1}),e.addEventListener("contextmenu",o.handleRightClick,{capture:!1}),e.addEventListener("mousedown",o.handleDown,{capture:!1}),e.addEventListener("wheel",o.handleWheel,{capture:!1}),e.addEventListener("mouseleave",o.handleLeave,{capture:!1}),e.addEventListener("mouseenter",o.handleEnter,{capture:!1}),document.addEventListener("mousemove",o.handleMove,{capture:!1}),document.addEventListener("mouseup",o.handleUp,{capture:!1}),o}return(0,r._)(t,e),(0,r.a)(t,[{key:"kill",value:function(){var e=this.container;e.removeEventListener("click",this.handleClick),e.removeEventListener("contextmenu",this.handleRightClick),e.removeEventListener("mousedown",this.handleDown),e.removeEventListener("wheel",this.handleWheel),e.removeEventListener("mouseleave",this.handleLeave),e.removeEventListener("mouseenter",this.handleEnter),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)}},{key:"handleClick",value:function(e){var t=this;if(this.enabled){if(this.clicks++,2===this.clicks)return this.clicks=0,"number"===typeof this.doubleClickTimeout&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null),this.handleDoubleClick(e);setTimeout((function(){t.clicks=0,t.doubleClickTimeout=null}),this.settings.doubleClickTimeout),this.draggedEvents<this.settings.draggedEventsTolerance&&this.emit("click",V(e,this.container))}}},{key:"handleRightClick",value:function(e){this.enabled&&this.emit("rightClick",V(e,this.container))}},{key:"handleDoubleClick",value:function(e){if(this.enabled){e.preventDefault(),e.stopPropagation();var t=V(e,this.container);if(this.emit("doubleClick",t),!t.sigmaDefaultPrevented){var n=this.renderer.getCamera(),i=n.getBoundedRatio(n.getState().ratio/this.settings.doubleClickZoomingRatio);n.animate(this.renderer.getViewportZoomedState(H(e,this.container),i),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}}},{key:"handleDown",value:function(e){if(this.enabled){if(0===e.button){this.startCameraState=this.renderer.getCamera().getState();var t=H(e,this.container),n=t.x,i=t.y;this.lastMouseX=n,this.lastMouseY=i,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",V(e,this.container))}}},{key:"handleUp",value:function(e){var t=this;if(this.enabled&&this.isMouseDown){var n=this.renderer.getCamera();this.isMouseDown=!1,"number"===typeof this.movingTimeout&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var i=H(e,this.container),r=i.x,o=i.y,a=n.getState(),s=n.getPreviousState()||{x:0,y:0};this.isMoving?n.animate({x:a.x+this.settings.inertiaRatio*(a.x-s.x),y:a.y+this.settings.inertiaRatio*(a.y-s.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):this.lastMouseX===r&&this.lastMouseY===o||n.setState({x:a.x,y:a.y}),this.isMoving=!1,setTimeout((function(){var e=t.draggedEvents>0;t.draggedEvents=0,e&&t.renderer.getSetting("hideEdgesOnMove")&&t.renderer.refresh()}),0),this.emit("mouseup",V(e,this.container))}}},{key:"handleMove",value:function(e){var t=this;if(this.enabled){var n=V(e,this.container);if(this.emit("mousemovebody",n),e.target!==this.container&&e.composedPath()[0]!==this.container||this.emit("mousemove",n),!n.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,"number"===typeof this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout((function(){t.movingTimeout=null,t.isMoving=!1}),this.settings.dragTimeout);var i=this.renderer.getCamera(),r=H(e,this.container),o=r.x,a=r.y,s=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),u=this.renderer.viewportToFramedGraph({x:o,y:a}),h=s.x-u.x,c=s.y-u.y,d=i.getState(),l=d.x+h,f=d.y+c;i.setState({x:l,y:f}),this.lastMouseX=o,this.lastMouseY=a,e.preventDefault(),e.stopPropagation()}}}},{key:"handleLeave",value:function(e){this.emit("mouseleave",V(e,this.container))}},{key:"handleEnter",value:function(e){this.emit("mouseenter",V(e,this.container))}},{key:"handleWheel",value:function(e){var t=this,n=this.renderer.getCamera();if(this.enabled&&n.enabledZooming){var i=Q(e);if(i){var r=Y(e,this.container);if(this.emit("wheel",r),r.sigmaDefaultPrevented)return e.preventDefault(),void e.stopPropagation();var o=n.getState().ratio,a=i>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,s=n.getBoundedRatio(o*a),u=i>0?1:-1,h=Date.now();o!==s&&(e.preventDefault(),e.stopPropagation(),this.currentWheelDirection===u&&this.lastWheelTriggerTime&&h-this.lastWheelTriggerTime<this.settings.zoomDuration/5||(n.animate(this.renderer.getViewportZoomedState(H(e,this.container),s),{easing:"quadraticOut",duration:this.settings.zoomDuration},(function(){t.currentWheelDirection=0})),this.currentWheelDirection=u,this.lastWheelTriggerTime=h))}}}},{key:"setSettings",value:function(e){this.settings=e}}])}($),ne=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],ie=ne.reduce((function(e,t){return(0,i._)((0,i._)({},e),{},(0,i.a)({},t,z[t]))}),{}),re=function(e){function t(e,n){var o;return(0,r.b)(this,t),o=(0,r.c)(this,t,[e,n]),(0,i.a)(o,"enabled",!0),(0,i.a)(o,"isMoving",!1),(0,i.a)(o,"hasMoved",!1),(0,i.a)(o,"touchMode",0),(0,i.a)(o,"startTouchesPositions",[]),(0,i.a)(o,"lastTouches",[]),(0,i.a)(o,"lastTap",null),(0,i.a)(o,"settings",ie),o.handleStart=o.handleStart.bind(o),o.handleLeave=o.handleLeave.bind(o),o.handleMove=o.handleMove.bind(o),e.addEventListener("touchstart",o.handleStart,{capture:!1}),e.addEventListener("touchcancel",o.handleLeave,{capture:!1}),document.addEventListener("touchend",o.handleLeave,{capture:!1,passive:!1}),document.addEventListener("touchmove",o.handleMove,{capture:!1,passive:!1}),o}return(0,r._)(t,e),(0,r.a)(t,[{key:"kill",value:function(){var e=this.container;e.removeEventListener("touchstart",this.handleStart),e.removeEventListener("touchcancel",this.handleLeave),document.removeEventListener("touchend",this.handleLeave),document.removeEventListener("touchmove",this.handleMove)}},{key:"getDimensions",value:function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}}},{key:"handleStart",value:function(e){var t=this;if(this.enabled){e.preventDefault();var n=Z(e.touches);if(this.touchMode=n.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=n.map((function(e){return H(e,t.container)})),2===this.touchMode){var i=(0,h._)(this.startTouchesPositions,2),r=i[0],o=r.x,a=r.y,s=i[1],u=s.x,c=s.y;this.startTouchesAngle=Math.atan2(c-a,u-o),this.startTouchesDistance=Math.sqrt(Math.pow(u-o,2)+Math.pow(c-a,2))}this.emit("touchdown",K(e,this.lastTouches,this.container)),this.lastTouches=n,this.lastTouchesPositions=this.startTouchesPositions}}},{key:"handleLeave",value:function(e){if(this.enabled&&this.startTouchesPositions.length){switch(e.cancelable&&e.preventDefault(),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(1===e.touches.length){this.handleStart(e),e.preventDefault();break}case 1:if(this.isMoving){var t=this.renderer.getCamera(),n=t.getState(),i=t.getPreviousState()||{x:0,y:0};t.animate({x:n.x+this.settings.inertiaRatio*(n.x-i.x),y:n.y+this.settings.inertiaRatio*(n.y-i.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",K(e,this.lastTouches,this.container)),!e.touches.length){var r=H(this.lastTouches[0],this.container),o=this.startTouchesPositions[0],a=Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2);if(!e.touches.length&&a<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var s=K(e,this.lastTouches,this.container);if(this.emit("doubletap",s),this.lastTap=null,!s.sigmaDefaultPrevented){var u=this.renderer.getCamera(),h=u.getBoundedRatio(u.getState().ratio/this.settings.doubleClickZoomingRatio);u.animate(this.renderer.getViewportZoomedState(r,h),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var c=K(e,this.lastTouches,this.container);this.emit("tap",c),this.lastTap={time:Date.now(),position:c.touches[0]||c.previousTouches[0]}}}this.lastTouches=Z(e.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(e){var t=this;if(this.enabled&&this.startTouchesPositions.length){e.preventDefault();var n=Z(e.touches),i=n.map((function(e){return H(e,t.container)})),r=this.lastTouches;this.lastTouches=n,this.lastTouchesPositions=i;var o=K(e,r,this.container);if(this.emit("touchmove",o),!o.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=i.some((function(e,n){var i=t.startTouchesPositions[n];return i&&(e.x!==i.x||e.y!==i.y)}))),this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout((function(){t.isMoving=!1}),this.settings.dragTimeout);var a=this.renderer.getCamera(),s=this.startCameraState,u=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:var h=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),c=h.x,d=h.y,l=this.renderer.viewportToFramedGraph(i[0]),f=l.x,g=l.y;a.setState({x:s.x+c-f,y:s.y+d-g});break;case 2:var p={x:.5,y:.5,angle:0,ratio:1},v=i[0],m=v.x,y=v.y,b=i[1],w=b.x,_=b.y,x=Math.atan2(_-y,w-m)-this.startTouchesAngle,E=Math.hypot(_-y,w-m)/this.startTouchesDistance,k=a.getBoundedRatio(s.ratio/E);p.ratio=k,p.angle=s.angle+x;var T=this.getDimensions(),R=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:s}),C=Math.min(T.width,T.height)-2*u,S=C/T.width,A=C/T.height,L=k/C,G=m-C/2/S,D=y-C/2/A,N=[G*Math.cos(-p.angle)-D*Math.sin(-p.angle),D*Math.cos(-p.angle)+G*Math.sin(-p.angle)];G=N[0],D=N[1],p.x=R.x-G*L,p.y=R.y+D*L,a.setState(p);break}}}}},{key:"setSettings",value:function(e){this.settings=e}}])}($);function oe(e){if(Array.isArray(e))return(0,h.a)(e)}function ae(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function se(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ue(e){return oe(e)||ae(e)||(0,h.b)(e)||se()}function he(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(t.includes(i))continue;n[i]=e[i]}return n}function ce(e,t){if(null==e)return{};var n,i,r=he(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var de=function(){function e(t,n){(0,r.b)(this,e),this.key=t,this.size=n}return(0,r.a)(e,null,[{key:"compare",value:function(e,t){return e.size>t.size?-1:e.size<t.size||e.key>t.key?1:-1}}])}(),le=function(){function e(){(0,r.b)(this,e),(0,i.a)(this,"width",0),(0,i.a)(this,"height",0),(0,i.a)(this,"cellSize",0),(0,i.a)(this,"columns",0),(0,i.a)(this,"rows",0),(0,i.a)(this,"cells",{})}return(0,r.a)(e,[{key:"resizeAndClear",value:function(e,t){this.width=e.width,this.height=e.height,this.cellSize=t,this.columns=Math.ceil(e.width/t),this.rows=Math.ceil(e.height/t),this.cells={}}},{key:"getIndex",value:function(e){var t=Math.floor(e.x/this.cellSize),n=Math.floor(e.y/this.cellSize);return n*this.columns+t}},{key:"add",value:function(e,t,n){var i=new de(e,t),r=this.getIndex(n),o=this.cells[r];o||(o=[],this.cells[r]=o),o.push(i)}},{key:"organize",value:function(){for(var e in this.cells){var t=this.cells[e];t.sort(de.compare)}}},{key:"getLabelsToDisplay",value:function(e,t){var n=this.cellSize*this.cellSize,i=n/e/e,r=i*t/n,o=Math.ceil(r),a=[];for(var s in this.cells)for(var u=this.cells[s],h=0;h<Math.min(o,u.length);h++)a.push(u[h].key);return a}}])}();function fe(e){var t=e.graph,n=e.hoveredNode,i=e.highlightedNodes,r=e.displayedNodeLabels,o=[];return t.forEachEdge((function(e,t,a,s){(a===n||s===n||i.has(a)||i.has(s)||r.has(a)&&r.has(s))&&o.push(e)})),o}var ge=150,pe=50,ve=Object.prototype.hasOwnProperty;function me(e,t,n){if(!ve.call(n,"x")||!ve.call(n,"y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(t,'". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?'));return n.color||(n.color=e.defaultNodeColor),n.label||""===n.label||(n.label=null),void 0!==n.label&&null!==n.label?n.label=""+n.label:n.label=null,n.size||(n.size=2),ve.call(n,"hidden")||(n.hidden=!1),ve.call(n,"highlighted")||(n.highlighted=!1),ve.call(n,"forceLabel")||(n.forceLabel=!1),n.type&&""!==n.type||(n.type=e.defaultNodeType),n.zIndex||(n.zIndex=0),n}function ye(e,t,n){return n.color||(n.color=e.defaultEdgeColor),n.label||(n.label=""),n.size||(n.size=.5),ve.call(n,"hidden")||(n.hidden=!1),ve.call(n,"forceLabel")||(n.forceLabel=!1),n.type&&""!==n.type||(n.type=e.defaultEdgeType),n.zIndex||(n.zIndex=0),n}var be=function(e){function t(e,n){var o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((0,r.b)(this,t),o=(0,r.c)(this,t),(0,i.a)(o,"elements",{}),(0,i.a)(o,"canvasContexts",{}),(0,i.a)(o,"webGLContexts",{}),(0,i.a)(o,"pickingLayers",new Set),(0,i.a)(o,"textures",{}),(0,i.a)(o,"frameBuffers",{}),(0,i.a)(o,"activeListeners",{}),(0,i.a)(o,"labelGrid",new le),(0,i.a)(o,"nodeDataCache",{}),(0,i.a)(o,"edgeDataCache",{}),(0,i.a)(o,"nodeProgramIndex",{}),(0,i.a)(o,"edgeProgramIndex",{}),(0,i.a)(o,"nodesWithForcedLabels",new Set),(0,i.a)(o,"edgesWithForcedLabels",new Set),(0,i.a)(o,"nodeExtent",{x:[0,1],y:[0,1]}),(0,i.a)(o,"nodeZExtent",[1/0,-1/0]),(0,i.a)(o,"edgeZExtent",[1/0,-1/0]),(0,i.a)(o,"matrix",b()),(0,i.a)(o,"invMatrix",b()),(0,i.a)(o,"correctionRatio",1),(0,i.a)(o,"customBBox",null),(0,i.a)(o,"normalizationFunction",N({x:[0,1],y:[0,1]})),(0,i.a)(o,"graphToViewportRatio",1),(0,i.a)(o,"itemIDsIndex",{}),(0,i.a)(o,"nodeIndices",{}),(0,i.a)(o,"edgeIndices",{}),(0,i.a)(o,"width",0),(0,i.a)(o,"height",0),(0,i.a)(o,"pixelRatio",G()),(0,i.a)(o,"pickingDownSizingRatio",2*o.pixelRatio),(0,i.a)(o,"displayedNodeLabels",new Set),(0,i.a)(o,"displayedEdgeLabels",new Set),(0,i.a)(o,"highlightedNodes",new Set),(0,i.a)(o,"hoveredNode",null),(0,i.a)(o,"hoveredEdge",null),(0,i.a)(o,"renderFrame",null),(0,i.a)(o,"renderHighlightedNodesFrame",null),(0,i.a)(o,"needToProcess",!1),(0,i.a)(o,"checkEdgesEventsFrame",null),(0,i.a)(o,"nodePrograms",{}),(0,i.a)(o,"nodeHoverPrograms",{}),(0,i.a)(o,"edgePrograms",{}),o.settings=B(a),U(o.settings),A(e),!(n instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");for(var s in o.graph=e,o.container=n,o.createWebGLContext("edges",{picking:a.enableEdgeEvents}),o.createCanvasContext("edgeLabels"),o.createWebGLContext("nodes",{picking:!0}),o.createCanvasContext("labels"),o.createCanvasContext("hovers"),o.createWebGLContext("hoverNodes"),o.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),o.resize(),o.settings.nodeProgramClasses)o.registerNodeProgram(s,o.settings.nodeProgramClasses[s],o.settings.nodeHoverProgramClasses[s]);for(var u in o.settings.edgeProgramClasses)o.registerEdgeProgram(u,o.settings.edgeProgramClasses[u]);return o.camera=new W,o.bindCameraHandlers(),o.mouseCaptor=new te(o.elements.mouse,o),o.mouseCaptor.setSettings(o.settings),o.touchCaptor=new re(o.elements.mouse,o),o.touchCaptor.setSettings(o.settings),o.bindEventHandlers(),o.bindGraphHandlers(),o.handleSettingsUpdate(),o.refresh(),o}return(0,r._)(t,e),(0,r.a)(t,[{key:"registerNodeProgram",value:function(e,t,n){return this.nodePrograms[e]&&this.nodePrograms[e].kill(),this.nodeHoverPrograms[e]&&this.nodeHoverPrograms[e].kill(),this.nodePrograms[e]=new t(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[e]=new(n||t)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(e,t){return this.edgePrograms[e]&&this.edgePrograms[e].kill(),this.edgePrograms[e]=new t(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(e){if(this.nodePrograms[e]){var t=this.nodePrograms,n=t[e],i=ce(t,[e].map(r.d));n.kill(),this.nodePrograms=i}if(this.nodeHoverPrograms[e]){var o=this.nodeHoverPrograms,a=o[e],s=ce(o,[e].map(r.d));a.kill(),this.nodePrograms=s}return this}},{key:"unregisterEdgeProgram",value:function(e){if(this.edgePrograms[e]){var t=this.edgePrograms,n=t[e],i=ce(t,[e].map(r.d));n.kill(),this.edgePrograms=i}return this}},{key:"resetWebGLTexture",value:function(e){var t=this.webGLContexts[e],n=this.frameBuffers[e],i=this.textures[e];i&&t.deleteTexture(i);var r=t.createTexture();return t.bindFramebuffer(t.FRAMEBUFFER,n),t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),this.textures[e]=r,this}},{key:"bindCameraHandlers",value:function(){var e=this;return this.activeListeners.camera=function(){e.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(e){var t=e.x,n=e.y,i=(0,h.g)(this.webGLContexts.nodes,this.frameBuffers.nodes,t,n,this.pixelRatio,this.pickingDownSizingRatio),r=h.c.apply(void 0,ue(i)),o=this.itemIDsIndex[r];return o&&"node"===o.type?o.id:null}},{key:"bindEventHandlers",value:function(){var e=this;this.activeListeners.handleResize=function(){e.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(t){var n=q(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}},o=e.getNodeAtPosition(n);if(o&&e.hoveredNode!==o&&!e.nodeDataCache[o].hidden)return e.hoveredNode&&e.emit("leaveNode",(0,i._)((0,i._)({},r),{},{node:e.hoveredNode})),e.hoveredNode=o,e.emit("enterNode",(0,i._)((0,i._)({},r),{},{node:o})),void e.scheduleHighlightedNodesRender();if(e.hoveredNode&&e.getNodeAtPosition(n)!==e.hoveredNode){var a=e.hoveredNode;return e.hoveredNode=null,e.emit("leaveNode",(0,i._)((0,i._)({},r),{},{node:a})),void e.scheduleHighlightedNodesRender()}if(e.settings.enableEdgeEvents){var s=e.hoveredNode?null:e.getEdgeAtPoint(r.event.x,r.event.y);s!==e.hoveredEdge&&(e.hoveredEdge&&e.emit("leaveEdge",(0,i._)((0,i._)({},r),{},{edge:e.hoveredEdge})),s&&e.emit("enterEdge",(0,i._)((0,i._)({},r),{},{edge:s})),e.hoveredEdge=s)}},this.activeListeners.handleMoveBody=function(t){var n=q(t);e.emit("moveBody",{event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(t){var n=q(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}};e.hoveredNode&&(e.emit("leaveNode",(0,i._)((0,i._)({},r),{},{node:e.hoveredNode})),e.scheduleHighlightedNodesRender()),e.settings.enableEdgeEvents&&e.hoveredEdge&&(e.emit("leaveEdge",(0,i._)((0,i._)({},r),{},{edge:e.hoveredEdge})),e.scheduleHighlightedNodesRender()),e.emit("leaveStage",(0,i._)({},r))},this.activeListeners.handleEnter=function(t){var n=q(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}};e.emit("enterStage",(0,i._)({},r))};var t=function(t){return function(n){var r=q(n),o={event:r,preventSigmaDefault:function(){r.preventSigmaDefault()}},a=e.getNodeAtPosition(r);if(a)return e.emit("".concat(t,"Node"),(0,i._)((0,i._)({},o),{},{node:a}));if(e.settings.enableEdgeEvents){var s=e.getEdgeAtPoint(r.x,r.y);if(s)return e.emit("".concat(t,"Edge"),(0,i._)((0,i._)({},o),{},{edge:s}))}return e.emit("".concat(t,"Stage"),o)}};return this.activeListeners.handleClick=t("click"),this.activeListeners.handleRightClick=t("rightClick"),this.activeListeners.handleDoubleClick=t("doubleClick"),this.activeListeners.handleWheel=t("wheel"),this.activeListeners.handleDown=t("down"),this.activeListeners.handleUp=t("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var e=this,t=this.graph,n=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(i){var r,o=null===(r=i.hints)||void 0===r?void 0:r.attributes;e.graph.forEachNode((function(t){return e.updateNode(t)}));var a=!o||o.some((function(e){return n.has(e)}));e.refresh({partialGraph:{nodes:t.nodes()},skipIndexation:!a,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(n){var i,r=null===(i=n.hints)||void 0===i?void 0:i.attributes;e.graph.forEachEdge((function(t){return e.updateEdge(t)}));var o=r&&["zIndex","type"].some((function(e){return null===r||void 0===r?void 0:r.includes(e)}));e.refresh({partialGraph:{edges:t.edges()},skipIndexation:!o,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(t){var n=t.key;e.addNode(n),e.refresh({partialGraph:{nodes:[n]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(t){var n=t.key;e.refresh({partialGraph:{nodes:[n]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(t){var n=t.key;e.removeNode(n),e.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(t){var n=t.key;e.addEdge(n),e.refresh({partialGraph:{edges:[n]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(t){var n=t.key;e.refresh({partialGraph:{edges:[n]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(t){var n=t.key;e.removeEdge(n),e.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){e.clearEdgeState(),e.clearEdgeIndices(),e.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){e.clearEdgeState(),e.clearNodeState(),e.clearEdgeIndices(),e.clearNodeIndices(),e.refresh({schedule:!0})},t.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),t.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),t.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),t.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),t.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),t.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),t.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),t.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),t.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),t.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var e=this.graph;e.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),e.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),e.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),e.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),e.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),e.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),e.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),e.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),e.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),e.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(e,t){var n=(0,h.g)(this.webGLContexts.edges,this.frameBuffers.edges,e,t,this.pixelRatio,this.pickingDownSizingRatio),i=h.c.apply(void 0,ue(n)),r=this.itemIDsIndex[i];return r&&"edge"===r.type?r.id:null}},{key:"process",value:function(){var e=this;this.emit("beforeProcess");var t=this.graph,n=this.settings,i=this.getDimensions();if(this.nodeExtent=S(this.graph),!this.settings.autoRescale){var r=i.width,o=i.height,a=this.nodeExtent,s=a.x,u=a.y;this.nodeExtent={x:[(s[0]+s[1])/2-r/2,(s[0]+s[1])/2+r/2],y:[(u[0]+u[1])/2-o/2,(u[0]+u[1])/2+o/2]}}this.normalizationFunction=N(this.customBBox||this.nodeExtent);var h=new W,c=R(h.getState(),i,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(i,n.labelGridCellSize);for(var d={},l={},f={},g={},p=1,v=t.nodes(),m=0,y=v.length;m<y;m++){var b=v[m],w=this.nodeDataCache[b],_=t.getNodeAttributes(b);w.x=_.x,w.y=_.y,this.normalizationFunction.applyTo(w),"string"!==typeof w.label||w.hidden||this.labelGrid.add(b,w.size,this.framedGraphToViewport(w,{matrix:c})),d[w.type]=(d[w.type]||0)+1}for(var x in this.labelGrid.organize(),this.nodePrograms){if(!ve.call(this.nodePrograms,x))throw new Error('Sigma: could not find a suitable program for node type "'.concat(x,'"!'));this.nodePrograms[x].reallocate(d[x]||0),d[x]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(v=D(this.nodeZExtent,(function(t){return e.nodeDataCache[t].zIndex}),v));for(var E=0,k=v.length;E<k;E++){var T=v[E];l[T]=p,g[l[T]]={type:"node",id:T},p++;var C=this.nodeDataCache[T];this.addNodeToProgram(T,l[T],d[C.type]++)}for(var A={},L=t.edges(),G=0,F=L.length;G<F;G++){var M=L[G],P=this.edgeDataCache[M];A[P.type]=(A[P.type]||0)+1}for(var z in this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(L=D(this.edgeZExtent,(function(t){return e.edgeDataCache[t].zIndex}),L)),this.edgePrograms){if(!ve.call(this.edgePrograms,z))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(z,'"!'));this.edgePrograms[z].reallocate(A[z]||0),A[z]=0}for(var O=0,I=L.length;O<I;O++){var U=L[O];f[U]=p,g[f[U]]={type:"edge",id:U},p++;var B=this.edgeDataCache[U];this.addEdgeToProgram(U,f[U],A[B.type]++)}return this.itemIDsIndex=g,this.nodeIndices=l,this.edgeIndices=f,this.emit("afterProcess"),this}},{key:"handleSettingsUpdate",value:function(e){var t=this,n=this.settings;if(this.camera.minRatio=n.minCameraRatio,this.camera.maxRatio=n.maxCameraRatio,this.camera.enabledZooming=n.enableCameraZooming,this.camera.enabledPanning=n.enableCameraPanning,this.camera.enabledRotation=n.enableCameraRotation,n.cameraPanBoundaries?this.camera.clean=function(e){return t.cleanCameraState(e,n.cameraPanBoundaries&&"object"===F(n.cameraPanBoundaries)?n.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),e){if(e.edgeProgramClasses!==n.edgeProgramClasses){for(var i in n.edgeProgramClasses)n.edgeProgramClasses[i]!==e.edgeProgramClasses[i]&&this.registerEdgeProgram(i,n.edgeProgramClasses[i]);for(var r in e.edgeProgramClasses)n.edgeProgramClasses[r]||this.unregisterEdgeProgram(r)}if(e.nodeProgramClasses!==n.nodeProgramClasses||e.nodeHoverProgramClasses!==n.nodeHoverProgramClasses){for(var o in n.nodeProgramClasses)n.nodeProgramClasses[o]===e.nodeProgramClasses[o]&&n.nodeHoverProgramClasses[o]===e.nodeHoverProgramClasses[o]||this.registerNodeProgram(o,n.nodeProgramClasses[o],n.nodeHoverProgramClasses[o]);for(var a in e.nodeProgramClasses)n.nodeProgramClasses[a]||this.unregisterNodeProgram(a)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:"cleanCameraState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.tolerance,r=void 0===n?0:n,o=t.boundaries,a=(0,i._)({},e),s=o||this.nodeExtent,u=(0,h._)(s.x,2),c=u[0],d=u[1],l=(0,h._)(s.y,2),f=l[0],g=l[1],p=[this.graphToViewport({x:c,y:f},{cameraState:e}),this.graphToViewport({x:d,y:f},{cameraState:e}),this.graphToViewport({x:c,y:g},{cameraState:e}),this.graphToViewport({x:d,y:g},{cameraState:e})],v=1/0,m=-1/0,y=1/0,b=-1/0;p.forEach((function(e){var t=e.x,n=e.y;v=Math.min(v,t),m=Math.max(m,t),y=Math.min(y,n),b=Math.max(b,n)}));var w=m-v,_=b-y,x=this.getDimensions(),E=x.width,k=x.height,T=0,R=0;if(w>=E?m<E-r?T=m-(E-r):v>r&&(T=v-r):m>E+r?T=m-(E+r):v<-r&&(T=v+r),_>=k?b<k-r?R=b-(k-r):y>r&&(R=y-r):b>k+r?R=b-(k+r):y<-r&&(R=y+r),T||R){var C=this.viewportToFramedGraph({x:0,y:0},{cameraState:e}),S=this.viewportToFramedGraph({x:T,y:R},{cameraState:e});T=S.x-C.x,R=S.y-C.y,a.x+=T,a.y+=R}return a}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var e=this.camera.getState(),t=this.labelGrid.getLabelsToDisplay(e.ratio,this.settings.labelDensity);M(t,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var n=this.canvasContexts.labels,r=0,o=t.length;r<o;r++){var a=t[r],s=this.nodeDataCache[a];if(!this.displayedNodeLabels.has(a)&&!s.hidden){var u=this.framedGraphToViewport(s),h=u.x,c=u.y,d=this.scaleSize(s.size);if((s.forceLabel||!(d<this.settings.labelRenderedSizeThreshold))&&!(h<-ge||h>this.width+ge||c<-pe||c>this.height+pe)){this.displayedNodeLabels.add(a);var l=this.settings.defaultDrawNodeLabel,f=this.nodePrograms[s.type],g=(null===f||void 0===f?void 0:f.drawLabel)||l;g(n,(0,i._)((0,i._)({key:a},s),{},{size:d,x:h,y:c}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var e=this.canvasContexts.edgeLabels;e.clearRect(0,0,this.width,this.height);var t=fe({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});M(t,this.edgesWithForcedLabels);for(var n=new Set,r=0,o=t.length;r<o;r++){var a=t[r],s=this.graph.extremities(a),u=this.nodeDataCache[s[0]],h=this.nodeDataCache[s[1]],c=this.edgeDataCache[a];if(!n.has(a)&&!(c.hidden||u.hidden||h.hidden)){var d=this.settings.defaultDrawEdgeLabel,l=this.edgePrograms[c.type],f=(null===l||void 0===l?void 0:l.drawLabel)||d;f(e,(0,i._)((0,i._)({key:a},c),{},{size:this.scaleSize(c.size)}),(0,i._)((0,i._)((0,i._)({key:s[0]},u),this.framedGraphToViewport(u)),{},{size:this.scaleSize(u.size)}),(0,i._)((0,i._)((0,i._)({key:s[1]},h),this.framedGraphToViewport(h)),{},{size:this.scaleSize(h.size)}),this.settings),n.add(a)}}return this.displayedEdgeLabels=n,this}},{key:"renderHighlightedNodes",value:function(){var e=this,t=this.canvasContexts.hovers;t.clearRect(0,0,this.width,this.height);var n=function(n){var r=e.nodeDataCache[n],o=e.framedGraphToViewport(r),a=o.x,s=o.y,u=e.scaleSize(r.size),h=e.settings.defaultDrawNodeHover,c=e.nodePrograms[r.type],d=(null===c||void 0===c?void 0:c.drawHover)||h;d(t,(0,i._)((0,i._)({key:n},r),{},{size:u,x:a,y:s}),e.settings)},r=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&r.push(this.hoveredNode),this.highlightedNodes.forEach((function(t){t!==e.hoveredNode&&r.push(t)})),r.forEach((function(e){return n(e)}));var o={};for(var a in r.forEach((function(t){var n=e.nodeDataCache[t].type;o[n]=(o[n]||0)+1})),this.nodeHoverPrograms)this.nodeHoverPrograms[a].reallocate(o[a]||0),o[a]=0;r.forEach((function(t){var n=e.nodeDataCache[t];e.nodeHoverPrograms[n.type].process(0,o[n.type]++,n)})),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var s=this.getRenderParams();for(var u in this.nodeHoverPrograms){var h=this.nodeHoverPrograms[u];h.render(s)}}},{key:"scheduleHighlightedNodesRender",value:function(){var e=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=requestAnimationFrame((function(){e.renderHighlightedNodesFrame=null,e.renderHighlightedNodes(),e.renderEdgeLabels()})))}},{key:"render",value:function(){var e=this;this.emit("beforeRender");var t=function(){return e.emit("afterRender"),e};if(this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.resize(),this.needToProcess&&this.process(),this.needToProcess=!1,this.clear(),this.pickingLayers.forEach((function(t){return e.resetWebGLTexture(t)})),!this.graph.order)return t();var n=this.mouseCaptor,i=this.camera.isAnimated()||n.isMoving||n.draggedEvents||n.currentWheelDirection,r=this.camera.getState(),o=this.getDimensions(),a=this.getGraphDimensions(),s=this.getStagePadding();this.matrix=R(r,o,a,s),this.invMatrix=R(r,o,a,s,!0),this.correctionRatio=C(this.matrix,r,o),this.graphToViewportRatio=this.getGraphToViewportRatio();var u=this.getRenderParams();for(var h in this.nodePrograms){var c=this.nodePrograms[h];c.render(u)}if(!this.settings.hideEdgesOnMove||!i)for(var d in this.edgePrograms){var l=this.edgePrograms[d];l.render(u)}return this.settings.hideLabelsOnMove&&i||(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes()),t()}},{key:"addNode",value:function(e){var t=Object.assign({},this.graph.getNodeAttributes(e));this.settings.nodeReducer&&(t=this.settings.nodeReducer(e,t));var n=me(this.settings,e,t);this.nodeDataCache[e]=n,this.nodesWithForcedLabels["delete"](e),n.forceLabel&&!n.hidden&&this.nodesWithForcedLabels.add(e),this.highlightedNodes["delete"](e),n.highlighted&&!n.hidden&&this.highlightedNodes.add(e),this.settings.zIndex&&(n.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=n.zIndex),n.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=n.zIndex))}},{key:"updateNode",value:function(e){this.addNode(e);var t=this.nodeDataCache[e];this.normalizationFunction.applyTo(t)}},{key:"removeNode",value:function(e){delete this.nodeDataCache[e],delete this.nodeProgramIndex[e],this.highlightedNodes["delete"](e),this.hoveredNode===e&&(this.hoveredNode=null),this.nodesWithForcedLabels["delete"](e)}},{key:"addEdge",value:function(e){var t=Object.assign({},this.graph.getEdgeAttributes(e));this.settings.edgeReducer&&(t=this.settings.edgeReducer(e,t));var n=ye(this.settings,e,t);this.edgeDataCache[e]=n,this.edgesWithForcedLabels["delete"](e),n.forceLabel&&!n.hidden&&this.edgesWithForcedLabels.add(e),this.settings.zIndex&&(n.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=n.zIndex),n.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=n.zIndex))}},{key:"updateEdge",value:function(e){this.addEdge(e)}},{key:"removeEdge",value:function(e){delete this.edgeDataCache[e],delete this.edgeProgramIndex[e],this.hoveredEdge===e&&(this.hoveredEdge=null),this.edgesWithForcedLabels["delete"](e)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new le,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0]}},{key:"clearEdgeIndices",value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:"clearIndices",value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:"clearNodeState",value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:"clearEdgeState",value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:"clearState",value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:"addNodeToProgram",value:function(e,t,n){var i=this.nodeDataCache[e],r=this.nodePrograms[i.type];if(!r)throw new Error('Sigma: could not find a suitable program for node type "'.concat(i.type,'"!'));r.process(t,n,i),this.nodeProgramIndex[e]=n}},{key:"addEdgeToProgram",value:function(e,t,n){var i=this.edgeDataCache[e],r=this.edgePrograms[i.type];if(!r)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(i.type,'"!'));var o=this.graph.extremities(e),a=this.nodeDataCache[o[0]],s=this.nodeDataCache[o[1]];r.process(t,n,a,s,i),this.edgeProgramIndex[e]=n}},{key:"getRenderParams",value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:"getStagePadding",value:function(){var e=this.settings,t=e.stagePadding,n=e.autoRescale;return n&&t||0}},{key:"createLayer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.elements[e])throw new Error('Sigma: a layer named "'.concat(e,'" already exists'));var i=L(t,{position:"absolute"},{class:"sigma-".concat(e)});return n.style&&Object.assign(i.style,n.style),this.elements[e]=i,"beforeLayer"in n&&n.beforeLayer?this.elements[n.beforeLayer].before(i):"afterLayer"in n&&n.afterLayer?this.elements[n.afterLayer].after(i):this.container.appendChild(i),i}},{key:"createCanvas",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.createLayer(e,"canvas",t)}},{key:"createCanvasContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.createCanvas(e,t),i={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[e]=n.getContext("2d",i),this}},{key:"createWebGLContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(null===t||void 0===t?void 0:t.canvas)||this.createCanvas(e,t);t.hidden&&n.remove();var r,o=(0,i._)({preserveDrawingBuffer:!1,antialias:!1},t);r=n.getContext("webgl2",o),r||(r=n.getContext("webgl",o)),r||(r=n.getContext("experimental-webgl",o));var a=r;if(this.webGLContexts[e]=a,a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),t.picking){this.pickingLayers.add(e);var s=a.createFramebuffer();if(!s)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(e));this.frameBuffers[e]=s}return a}},{key:"killLayer",value:function(e){var t=this.elements[e];if(!t)throw new Error("Sigma: cannot kill layer ".concat(e,", which does not exist"));if(this.webGLContexts[e]){var n,i=this.webGLContexts[e];null===(n=i.getExtension("WEBGL_lose_context"))||void 0===n||n.loseContext(),delete this.webGLContexts[e]}else this.canvasContexts[e]&&delete this.canvasContexts[e];return t.remove(),delete this.elements[e],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(e){this.unbindCameraHandlers(),this.camera=e,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(e){e!==this.graph&&(this.hoveredNode&&!e.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!e.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),null!==this.checkEdgesEventsFrame&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=e,this.bindGraphHandlers(),this.refresh())}},{key:"getMouseCaptor",value:function(){return this.mouseCaptor}},{key:"getTouchCaptor",value:function(){return this.touchCaptor}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"getGraphDimensions",value:function(){var e=this.customBBox||this.nodeExtent;return{width:e.x[1]-e.x[0]||1,height:e.y[1]-e.y[0]||1}}},{key:"getNodeDisplayData",value:function(e){var t=this.nodeDataCache[e];return t?Object.assign({},t):void 0}},{key:"getEdgeDisplayData",value:function(e){var t=this.edgeDataCache[e];return t?Object.assign({},t):void 0}},{key:"getNodeDisplayedLabels",value:function(){return new Set(this.displayedNodeLabels)}},{key:"getEdgeDisplayedLabels",value:function(){return new Set(this.displayedEdgeLabels)}},{key:"getSettings",value:function(){return(0,i._)({},this.settings)}},{key:"getSetting",value:function(e){return this.settings[e]}},{key:"setSetting",value:function(e,t){var n=(0,i._)({},this.settings);return this.settings[e]=t,U(this.settings),this.handleSettingsUpdate(n),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(e,t){return this.setSetting(e,t(this.settings[e])),this}},{key:"setSettings",value:function(e){var t=(0,i._)({},this.settings);return this.settings=(0,i._)((0,i._)({},this.settings),e),U(this.settings),this.handleSettingsUpdate(t),this.scheduleRefresh(),this}},{key:"resize",value:function(e){var t=this.width,n=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=G(),0===this.width){if(!this.settings.allowInvalidContainer)throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");this.width=1}if(0===this.height){if(!this.settings.allowInvalidContainer)throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");this.height=1}if(!e&&t===this.width&&n===this.height)return this;for(var i in this.elements){var r=this.elements[i];r.style.width=this.width+"px",r.style.height=this.height+"px"}for(var o in this.canvasContexts)this.elements[o].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[o].setAttribute("height",this.height*this.pixelRatio+"px"),1!==this.pixelRatio&&this.canvasContexts[o].scale(this.pixelRatio,this.pixelRatio);for(var a in this.webGLContexts){this.elements[a].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[a].setAttribute("height",this.height*this.pixelRatio+"px");var s=this.webGLContexts[a];if(s.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(a)){var u=this.textures[a];u&&s.deleteTexture(u)}}return this.emit("resize"),this}},{key:"clear",value:function(){return this.emit("beforeClear"),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit("afterClear"),this}},{key:"refresh",value:function(e){var t=this,n=void 0!==(null===e||void 0===e?void 0:e.skipIndexation)&&(null===e||void 0===e?void 0:e.skipIndexation),i=void 0!==(null===e||void 0===e?void 0:e.schedule)&&e.schedule,r=!e||!e.partialGraph;if(r)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode((function(e){return t.addNode(e)})),this.graph.forEachEdge((function(e){return t.addEdge(e)}));else{for(var o,a,s=(null===(o=e.partialGraph)||void 0===o?void 0:o.nodes)||[],u=0,h=(null===s||void 0===s?void 0:s.length)||0;u<h;u++){var c=s[u];if(this.updateNode(c),n){var d=this.nodeProgramIndex[c];if(void 0===d)throw new Error('Sigma: node "'.concat(c,"\" can't be repaint"));this.addNodeToProgram(c,this.nodeIndices[c],d)}}for(var l=(null===e||void 0===e||null===(a=e.partialGraph)||void 0===a?void 0:a.edges)||[],f=0,g=l.length;f<g;f++){var p=l[f];if(this.updateEdge(p),n){var v=this.edgeProgramIndex[p];if(void 0===v)throw new Error('Sigma: edge "'.concat(p,"\" can't be repaint"));this.addEdgeToProgram(p,this.edgeIndices[p],v)}}}return!r&&n||(this.needToProcess=!0),i?this.scheduleRender():this.render(),this}},{key:"scheduleRender",value:function(){var e=this;return this.renderFrame||(this.renderFrame=requestAnimationFrame((function(){e.render()}))),this}},{key:"scheduleRefresh",value:function(e){return this.refresh((0,i._)((0,i._)({},e),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(e,t){var n=this.camera.getState(),i=n.ratio,r=n.angle,o=n.x,a=n.y,s=this.settings,u=s.minCameraRatio,h=s.maxCameraRatio;"number"===typeof h&&(t=Math.min(t,h)),"number"===typeof u&&(t=Math.max(t,u));var c=t/i,d={x:this.width/2,y:this.height/2},l=this.viewportToFramedGraph(e),f=this.viewportToFramedGraph(d);return{angle:r,x:(l.x-f.x)*(1-c)+o,y:(l.y-f.y)*(1-c)+a,ratio:t}}},{key:"viewRectangle",value:function(){var e=this.viewportToFramedGraph({x:0,y:0}),t=this.viewportToFramedGraph({x:this.width,y:0}),n=this.viewportToFramedGraph({x:0,y:this.height});return{x1:e.x,y1:e.y,x2:t.x,y2:t.y,height:t.y-n.y}}},{key:"framedGraphToViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!!t.cameraState||!!t.viewportDimensions||!!t.graphDimensions,i=t.matrix?t.matrix:n?R(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding()):this.matrix,r=k(i,e);return{x:(1+r.x)*this.width/2,y:(1-r.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!!t.cameraState||!!t.viewportDimensions||!t.graphDimensions,i=t.matrix?t.matrix:n?R(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding(),!0):this.invMatrix,r=k(i,{x:e.x/this.width*2-1,y:1-e.y/this.height*2});return isNaN(r.x)&&(r.x=0),isNaN(r.y)&&(r.y=0),r}},{key:"viewportToGraph",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(e,t))}},{key:"graphToViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(e),t)}},{key:"getGraphToViewportRatio",value:function(){var e={x:0,y:0},t={x:1,y:1},n=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),i=this.graphToViewport(e),r=this.graphToViewport(t),o=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2));return o/n}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(e){return this.customBBox=e,this.scheduleRender(),this}},{key:"kill",value:function(){this.emit("kill"),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&(cancelAnimationFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);var e=this.container;while(e.firstChild)e.removeChild(e.firstChild);for(var t in this.canvasContexts={},this.webGLContexts={},this.elements={},this.nodePrograms)this.nodePrograms[t].kill();for(var n in this.nodeHoverPrograms)this.nodeHoverPrograms[n].kill();for(var i in this.edgePrograms)this.edgePrograms[i].kill();for(var r in this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={},this.elements)this.killLayer(r)}},{key:"scaleSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.camera.ratio;return e/this.settings.zoomToSizeRatioFunction(t)*("positions"===this.getSetting("itemSizesReference")?t*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var e={};for(var t in this.elements)this.elements[t]instanceof HTMLCanvasElement&&(e[t]=this.elements[t]);return e}}])}(a),we=be}}]);
Binary file