@canonry/canonry 4.158.0 → 4.159.0

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 (50) hide show
  1. package/README.md +2 -2
  2. package/THIRD_PARTY_NOTICES.md +102 -0
  3. package/assets/THIRD_PARTY_NOTICES.md +102 -0
  4. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +1 -0
  5. package/assets/assets/{AuditHistoryPanel-McQfjoU9.js → AuditHistoryPanel-BiloGcQA.js} +1 -1
  6. package/assets/assets/{BacklinksPage-Da8y1Wv8.js → BacklinksPage-CPM1O2bC.js} +1 -1
  7. package/assets/assets/{HistoryPage-9MJfhRyT.js → HistoryPage-1YOjtdJy.js} +1 -1
  8. package/assets/assets/{MeasurementPropertyPage-BiNAHEJW.js → MeasurementPropertyPage-CVDTY_gC.js} +1 -1
  9. package/assets/assets/ProjectPage-DnGXMx1n.js +12 -0
  10. package/assets/assets/{RunRow-DCG2LBlS.js → RunRow-fIaadH4h.js} +1 -1
  11. package/assets/assets/{RunsPage-ByWA_FSk.js → RunsPage-DfifdM5z.js} +1 -1
  12. package/assets/assets/{SettingsPage-DdSeKAKF.js → SettingsPage-efA2EEmS.js} +1 -1
  13. package/assets/assets/SiteHealthSection-BROtQGfu.js +4 -0
  14. package/assets/assets/{TrafficPage-5u8rPcBt.js → TrafficPage-Wk43Bm_q.js} +1 -1
  15. package/assets/assets/{TrafficSourceDetailPage-Dm-fK87u.js → TrafficSourceDetailPage-BhBvoLWu.js} +1 -1
  16. package/assets/assets/extract-error-message-YGzZFvWs.js +1 -0
  17. package/assets/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  18. package/assets/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  19. package/assets/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  20. package/assets/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  21. package/assets/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  22. package/assets/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  23. package/assets/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  24. package/assets/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  25. package/assets/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  26. package/assets/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  27. package/assets/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  28. package/assets/assets/index-CACRaOmZ.css +1 -0
  29. package/assets/assets/index-DmsIZQAm.js +83 -0
  30. package/assets/assets/{react-sigma_core.esm.min-ComIyDKi.js → react-sigma_core.esm.min-DM9XptbM.js} +2 -2
  31. package/assets/assets/{vendor-lucide-BtYdosYk.js → vendor-lucide-nYKv-BB7.js} +1 -1
  32. package/assets/assets/{vendor-markdown-D274_wsI.js → vendor-markdown-Bn7fRwrx.js} +1 -1
  33. package/assets/assets/{vendor-radix-BxMXSwbC.js → vendor-radix-4UOaVWza.js} +1 -1
  34. package/assets/assets/{vendor-recharts-C4ktw_aE.js → vendor-recharts-D8rt5lKn.js} +1 -1
  35. package/assets/assets/{vendor-tanstack-pFxw0eGP.js → vendor-tanstack-Dock0eH1.js} +1 -1
  36. package/assets/index.html +7 -7
  37. package/dist/{chunk-YP4K2KXH.js → chunk-5AFWHKKI.js} +776 -32
  38. package/dist/{chunk-4VZP64GZ.js → chunk-BZPBVOAM.js} +625 -262
  39. package/dist/{chunk-LK6YFHG4.js → chunk-ZEG43TY2.js} +45 -15
  40. package/dist/{chunk-DEVAEC2S.js → chunk-ZL3VY435.js} +213 -8
  41. package/dist/cli.js +42 -4
  42. package/dist/index.d.ts +9 -0
  43. package/dist/index.js +4 -4
  44. package/dist/{intelligence-service-LQ6ZRWMF.js → intelligence-service-DHY5CYWX.js} +2 -2
  45. package/dist/mcp.js +2 -2
  46. package/package.json +11 -10
  47. package/assets/assets/ProjectPage-mWSMjXrR.js +0 -15
  48. package/assets/assets/extract-error-message-CtxkAd6E.js +0 -1
  49. package/assets/assets/index-DUfg50Pl.js +0 -83
  50. package/assets/assets/index-cXb3mfeQ.css +0 -1
@@ -1,4 +1,4 @@
1
- import{g as Bt,t as S,r as C}from"./vendor-tanstack-pFxw0eGP.js";import{e as Ht,G as Wt}from"./ProjectPage-mWSMjXrR.js";import"./index-DUfg50Pl.js";import"./vendor-radix-BxMXSwbC.js";import"./vendor-recharts-C4ktw_aE.js";import"./vendor-lucide-BtYdosYk.js";import"./vendor-markdown-D274_wsI.js";import"./vendor-yaml-GWJz5H2G.js";import"./RunRow-DCG2LBlS.js";import"./ChartPrimitives-DXVLCdBi.js";import"./extract-error-message-CtxkAd6E.js";import"./AuditHistoryPanel-McQfjoU9.js";import"./v2-overview-adapter-COMP5UGt.js";function Vt(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var e=i.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function ae(r){var n=Vt(r,"string");return typeof n=="symbol"?n:n+""}function A(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function He(r,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,ae(e.key),e)}}function L(r,n,i){return n&&He(r.prototype,n),i&&He(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function Q(r){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(r)}function yt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yt=function(){return!!r})()}function jt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zt(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jt(r)}function I(r,n,i){return n=Q(n),Zt(r,yt()?Reflect.construct(n,i||[],Q(r).constructor):n.apply(r,i))}function xe(r,n){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},xe(r,n)}function G(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&xe(r,n)}function qt(r){if(Array.isArray(r))return r}function Yt(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var e,t,a,o,s=[],l=!0,h=!1;try{if(a=(i=i.call(r)).next,n===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(e=a.call(i)).done)&&(s.push(e.value),s.length!==n);l=!0);}catch(u){h=!0,t=u}finally{try{if(!l&&i.return!=null&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw t}}return s}}function Se(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,e=Array(n);i<n;i++)e[i]=r[i];return e}function Tt(r,n){if(r){if(typeof r=="string")return Se(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Se(r,n):void 0}}function Xt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{g as Bt,t as S,r as C}from"./vendor-tanstack-Dock0eH1.js";import{e as Ht,G as Wt}from"./SiteHealthSection-BROtQGfu.js";import"./index-DmsIZQAm.js";import"./vendor-radix-4UOaVWza.js";import"./vendor-recharts-D8rt5lKn.js";import"./vendor-lucide-nYKv-BB7.js";import"./vendor-markdown-Bn7fRwrx.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-DXVLCdBi.js";function Vt(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var e=i.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function ae(r){var n=Vt(r,"string");return typeof n=="symbol"?n:n+""}function A(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function He(r,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,ae(e.key),e)}}function L(r,n,i){return n&&He(r.prototype,n),i&&He(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function Q(r){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(r)}function yt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yt=function(){return!!r})()}function jt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zt(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jt(r)}function I(r,n,i){return n=Q(n),Zt(r,yt()?Reflect.construct(n,i||[],Q(r).constructor):n.apply(r,i))}function xe(r,n){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},xe(r,n)}function G(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&xe(r,n)}function qt(r){if(Array.isArray(r))return r}function Yt(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var e,t,a,o,s=[],l=!0,h=!1;try{if(a=(i=i.call(r)).next,n===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(e=a.call(i)).done)&&(s.push(e.value),s.length!==n);l=!0);}catch(u){h=!0,t=u}finally{try{if(!l&&i.return!=null&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw t}}return s}}function Se(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,e=Array(n);i<n;i++)e[i]=r[i];return e}function Tt(r,n){if(r){if(typeof r=="string")return Se(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Se(r,n):void 0}}function Xt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ee(r,n){return qt(r)||Yt(r,n)||Tt(r,n)||Xt()}var pe={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"},Ct=new Int8Array(4),be=new Int32Array(Ct.buffer,0,1),$t=new Float32Array(Ct.buffer,0,1),Kt=/^\s*rgba?\s*\(/,Jt=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function Qt(r){var n=0,i=0,e=0,t=1;if(r[0]==="#")r.length===4?(n=parseInt(r.charAt(1)+r.charAt(1),16),i=parseInt(r.charAt(2)+r.charAt(2),16),e=parseInt(r.charAt(3)+r.charAt(3),16)):(n=parseInt(r.charAt(1)+r.charAt(2),16),i=parseInt(r.charAt(3)+r.charAt(4),16),e=parseInt(r.charAt(5)+r.charAt(6),16)),r.length===9&&(t=parseInt(r.charAt(7)+r.charAt(8),16)/255);else if(Kt.test(r)){var a=r.match(Jt);a&&(n=+a[1],i=+a[2],e=+a[3],a[4]&&(t=+a[4]))}return{r:n,g:i,b:e,a:t}}var J={};for(var le in pe)J[le]=oe(pe[le]),J[pe[le]]=J[le];function Rt(r,n,i,e,t){return be[0]=e<<24|i<<16|n<<8|r,be[0]=be[0]&4278190079,$t[0]}function oe(r){if(r=r.toLowerCase(),typeof J[r]<"u")return J[r];var n=Qt(r),i=n.r,e=n.g,t=n.b,a=n.a;a=a*255|0;var o=Rt(i,e,t,a);return J[r]=o,o}var Ee={};function _t(r){if(typeof Ee[r]<"u")return Ee[r];var n=(r&16711680)>>>16,i=(r&65280)>>>8,e=r&255,t=255,a=Rt(n,i,e,t);return Ee[r]=a,a}function We(r,n,i,e){return i+(n<<8)+(r<<16)}function Ve(r,n,i,e,t,a){var o=Math.floor(i/a*t),s=Math.floor(r.drawingBufferHeight/a-e/a*t),l=new Uint8Array(4);r.bindFramebuffer(r.FRAMEBUFFER,n),r.readPixels(o,s,1,1,r.RGBA,r.UNSIGNED_BYTE,l);var h=ee(l,4),u=h[0],d=h[1],f=h[2],g=h[3];return[u,d,f,g]}function c(r,n,i){return(n=ae(n))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r}function je(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),i.push.apply(i,e)}return i}function b(r){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?je(Object(i),!0).forEach(function(e){c(r,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function ei(r,n){for(;!{}.hasOwnProperty.call(r,n)&&(r=Q(r))!==null;);return r}function Ae(){return Ae=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(r,n,i){var e=ei(r,n);if(e){var t=Object.getOwnPropertyDescriptor(e,n);return t.get?t.get.call(arguments.length<3?r:i):t.value}},Ae.apply(null,arguments)}function wt(r,n,i,e){var t=Ae(Q(r.prototype),n,i);return typeof t=="function"?function(a){return t.apply(i,a)}:t}function ti(r){return r.normalized?1:r.size}function ye(r){var n=0;return r.forEach(function(i){return n+=ti(i)}),n}function xt(r,n,i){var e=r==="VERTEX"?n.VERTEX_SHADER:n.FRAGMENT_SHADER,t=n.createShader(e);if(t===null)throw new Error("loadShader: error while creating the shader");n.shaderSource(t,i),n.compileShader(t);var a=n.getShaderParameter(t,n.COMPILE_STATUS);if(!a){var o=n.getShaderInfoLog(t);throw n.deleteShader(t),new Error(`loadShader: error while compiling the shader:
3
3
  `.concat(o,`
4
4
  `).concat(i))}return t}function ii(r,n){return xt("VERTEX",r,n)}function ri(r,n){return xt("FRAGMENT",r,n)}function ni(r,n){var i=r.createProgram();if(i===null)throw new Error("loadProgram: error while creating the program.");var e,t;for(e=0,t=n.length;e<t;e++)r.attachShader(i,n[e]);r.linkProgram(i);var a=r.getProgramParameter(i,r.LINK_STATUS);if(!a){var o=r.getProgramInfoLog(i);throw r.deleteProgram(i),new Error("loadProgram: error while linking the program: ".concat(o))}return i}function Ze(r){var n=r.gl,i=r.buffer,e=r.program,t=r.vertexShader,a=r.fragmentShader;n.deleteShader(t),n.deleteShader(a),n.deleteProgram(e),n.deleteBuffer(i)}var qe=`#define PICKING_MODE
@@ -309,4 +309,4 @@ void main() {
309
309
  v_color.a *= bias;
310
310
  }
311
311
  `,Li=Ai,Gt=WebGLRenderingContext,Ke=Gt.UNSIGNED_BYTE,te=Gt.FLOAT,ki=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],Fi=(function(r){function n(){return A(this,n),I(this,n,arguments)}return G(n,r),L(n,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:Li,FRAGMENT_SHADER_SOURCE:Dt,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:ki,ATTRIBUTES:[{name:"a_positionStart",size:2,type:te},{name:"a_positionEnd",size:2,type:te},{name:"a_normal",size:2,type:te},{name:"a_color",size:4,type:Ke,normalized:!0},{name:"a_id",size:4,type:Ke,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:te},{name:"a_normalCoef",size:1,type:te}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(e,t,a,o,s){var l=s.size||1,h=a.x,u=a.y,d=o.x,f=o.y,g=oe(s.color),m=d-h,v=f-u,p=m*m+v*v,R=0,y=0;p&&(p=1/Math.sqrt(p),R=-v*p*l,y=m*p*l);var E=this.array;E[t++]=h,E[t++]=u,E[t++]=d,E[t++]=f,E[t++]=R,E[t++]=y,E[t++]=g,E[t++]=e}},{key:"setUniforms",value:function(e,t){var a=t.gl,o=t.uniformLocations,s=o.u_matrix,l=o.u_zoomRatio,h=o.u_feather,u=o.u_pixelRatio,d=o.u_correctionRatio,f=o.u_sizeRatio,g=o.u_minEdgeThickness;a.uniformMatrix3fv(s,!1,e.matrix),a.uniform1f(l,e.zoomRatio),a.uniform1f(f,e.sizeRatio),a.uniform1f(d,e.correctionRatio),a.uniform1f(u,e.pixelRatio),a.uniform1f(h,e.antiAliasingFeather),a.uniform1f(g,e.minEdgeThickness)}}])})(Ge),Oe=(function(r){function n(){var i;return A(this,n),i=I(this,n),i.rawEmitter=i,i}return G(n,r),L(n)})(Ht.EventEmitter),Ce,Je;function Ni(){return Je||(Je=1,Ce=function(n){return n!==null&&typeof n=="object"&&typeof n.addUndirectedEdgeWithKey=="function"&&typeof n.dropNode=="function"&&typeof n.multi=="boolean"}),Ce}var Di=Ni();const Pi=Bt(Di);var Ii=function(n){return n},Gi=function(n){return n*n},Oi=function(n){return n*(2-n)},Mi=function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},zi=function(n){return n*n*n},Ui=function(n){return--n*n*n+1},Bi=function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},Hi={linear:Ii,quadraticIn:Gi,quadraticOut:Oi,quadraticInOut:Mi,cubicIn:zi,cubicOut:Ui,cubicInOut:Bi},Wi={easing:"quadraticInOut",duration:150};function z(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function ue(r,n,i){return r[0]=n,r[4]=typeof i=="number"?i:n,r}function Qe(r,n){var i=Math.sin(n),e=Math.cos(n);return r[0]=e,r[1]=i,r[3]=-i,r[4]=e,r}function et(r,n,i){return r[6]=n,r[7]=i,r}function q(r,n){var i=r[0],e=r[1],t=r[2],a=r[3],o=r[4],s=r[5],l=r[6],h=r[7],u=r[8],d=n[0],f=n[1],g=n[2],m=n[3],v=n[4],p=n[5],R=n[6],y=n[7],E=n[8];return r[0]=d*i+f*a+g*l,r[1]=d*e+f*o+g*h,r[2]=d*t+f*s+g*u,r[3]=m*i+v*a+p*l,r[4]=m*e+v*o+p*h,r[5]=m*t+v*s+p*u,r[6]=R*i+y*a+E*l,r[7]=R*e+y*o+E*h,r[8]=R*t+y*s+E*u,r}function Le(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,e=r[0],t=r[1],a=r[3],o=r[4],s=r[6],l=r[7],h=n.x,u=n.y;return{x:h*e+u*a+s*i,y:h*t+u*o+l*i}}function Vi(r,n){var i=r.height/r.width,e=n.height/n.width;return i<1&&e>1||i>1&&e<1?1:Math.min(Math.max(e,1/e),Math.max(1/i,i))}function ie(r,n,i,e,t){var a=r.angle,o=r.ratio,s=r.x,l=r.y,h=n.width,u=n.height,d=z(),f=Math.min(h,u)-2*e,g=Vi(n,i);return t?(q(d,et(z(),s,l)),q(d,ue(z(),o)),q(d,Qe(z(),a)),q(d,ue(z(),h/f/2/g,u/f/2/g))):(q(d,ue(z(),2*(f/h)*g,2*(f/u)*g)),q(d,Qe(z(),-a)),q(d,ue(z(),1/o)),q(d,et(z(),-s,-l))),d}function ji(r,n,i){var e=Le(r,{x:Math.cos(n.angle),y:Math.sin(n.angle)},0),t=e.x,a=e.y;return 1/Math.sqrt(Math.pow(t,2)+Math.pow(a,2))/i.width}function Zi(r){if(!r.order)return{x:[0,1],y:[0,1]};var n=1/0,i=-1/0,e=1/0,t=-1/0;return r.forEachNode(function(a,o){var s=o.x,l=o.y;s<n&&(n=s),s>i&&(i=s),l<e&&(e=l),l>t&&(t=l)}),{x:[n,i],y:[e,t]}}function qi(r){if(!Pi(r))throw new Error("Sigma: invalid graph instance.");r.forEachNode(function(n,i){if(!Number.isFinite(i.x)||!Number.isFinite(i.y))throw new Error("Sigma: Coordinates of node ".concat(n," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function Yi(r,n,i){var e=document.createElement(r);if(n)for(var t in n)e.style[t]=n[t];if(i)for(var a in i)e.setAttribute(a,i[a]);return e}function tt(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function it(r,n,i){return i.sort(function(e,t){var a=n(e)||0,o=n(t)||0;return a<o?-1:a>o?1:0})}function rt(r){var n=ee(r.x,2),i=n[0],e=n[1],t=ee(r.y,2),a=t[0],o=t[1],s=Math.max(e-i,o-a),l=(e+i)/2,h=(o+a)/2;(s===0||Math.abs(s)===1/0||isNaN(s))&&(s=1),isNaN(l)&&(l=0),isNaN(h)&&(h=0);var u=function(f){return{x:.5+(f.x-l)/s,y:.5+(f.y-h)/s}};return u.applyTo=function(d){d.x=.5+(d.x-l)/s,d.y=.5+(d.y-h)/s},u.inverse=function(d){return{x:l+s*(d.x-.5),y:h+s*(d.y-.5)}},u.ratio=s,u}function ke(r){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ke(r)}function nt(r,n){var i=n.size;if(i!==0){var e=r.length;r.length+=i;var t=0;n.forEach(function(a){r[e+t]=a,t++})}}function Re(r){r=r||{};for(var n=0,i=arguments.length<=1?0:arguments.length-1;n<i;n++){var e=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];e&&Object.assign(r,e)}return r}var Me={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:li,defaultDrawNodeLabel:At,defaultDrawNodeHover:hi,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:{}},Xi={circle:fe},$i={arrow:Si,line:Fi};function _e(r){if(typeof r.labelDensity!="number"||r.labelDensity<0)throw new Error("Settings: invalid `labelDensity`. Expecting a positive number.");var n=r.minCameraRatio,i=r.maxCameraRatio;if(typeof n=="number"&&typeof i=="number"&&i<n)throw new Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")}function Ki(r){var n=Re({},Me,r);return n.nodeProgramClasses=Re({},Xi,n.nodeProgramClasses),n.edgeProgramClasses=Re({},$i,n.edgeProgramClasses),n}var de=1.5,at=(function(r){function n(){var i;return A(this,n),i=I(this,n),c(i,"x",.5),c(i,"y",.5),c(i,"angle",0),c(i,"ratio",1),c(i,"minRatio",null),c(i,"maxRatio",null),c(i,"enabledZooming",!0),c(i,"enabledPanning",!0),c(i,"enabledRotation",!0),c(i,"clean",null),c(i,"nextFrame",null),c(i,"previousState",null),c(i,"enabled",!0),i.previousState=i.getState(),i}return G(n,r),L(n,[{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 typeof this.minRatio=="number"&&(t=Math.max(t,this.minRatio)),typeof this.maxRatio=="number"&&(t=Math.min(t,this.maxRatio)),t}},{key:"validateState",value:function(e){var t={};return this.enabledPanning&&typeof e.x=="number"&&(t.x=e.x),this.enabledPanning&&typeof e.y=="number"&&(t.y=e.y),this.enabledZooming&&typeof e.ratio=="number"&&(t.ratio=this.getBoundedRatio(e.ratio)),this.enabledRotation&&typeof e.angle=="number"&&(t.angle=e.angle),this.clean?this.clean(b(b({},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 typeof t.x=="number"&&(this.x=t.x),typeof t.y=="number"&&(this.y=t.y),typeof t.ratio=="number"&&(this.ratio=t.ratio),typeof t.angle=="number"&&(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,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(!o)return new Promise(function(g){return t.animate(e,a,g)});if(this.enabled){var s=b(b({},Wi),a),l=this.validateState(e),h=typeof s.easing=="function"?s.easing:Hi[s.easing],u=Date.now(),d=this.getState(),f=function(){var m=(Date.now()-u)/s.duration;if(m>=1){t.nextFrame=null,t.setState(l),t.animationCallback&&(t.animationCallback.call(null),t.animationCallback=void 0);return}var v=h(m),p={};typeof l.x=="number"&&(p.x=d.x+(l.x-d.x)*v),typeof l.y=="number"&&(p.y=d.y+(l.y-d.y)*v),t.enabledRotation&&typeof l.angle=="number"&&(p.angle=d.angle+(l.angle-d.angle)*v),typeof l.ratio=="number"&&(p.ratio=d.ratio+(l.ratio-d.ratio)*v),t.setState(p),t.nextFrame=requestAnimationFrame(f)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(f)):f(),this.animationCallback=o}}},{key:"animatedZoom",value:function(e){return e?typeof e=="number"?this.animate({ratio:this.ratio/e}):this.animate({ratio:this.ratio/(e.factor||de)},e):this.animate({ratio:this.ratio/de})}},{key:"animatedUnzoom",value:function(e){return e?typeof e=="number"?this.animate({ratio:this.ratio*e}):this.animate({ratio:this.ratio*(e.factor||de)},e):this.animate({ratio:this.ratio*de})}},{key:"animatedReset",value:function(e){return this.animate({x:.5,y:.5,ratio:1,angle:0},e)}},{key:"copy",value:function(){return n.from(this.getState())}}],[{key:"from",value:function(e){var t=new n;return t.setState(e)}}])})(Oe);function U(r,n){var i=n.getBoundingClientRect();return{x:r.clientX-i.left,y:r.clientY-i.top}}function H(r,n){var i=b(b({},U(r,n)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){i.sigmaDefaultPrevented=!0},original:r});return i}function re(r){var n="x"in r?r:b(b({},r.touches[0]||r.previousTouches[0]),{},{original:r.original,sigmaDefaultPrevented:r.sigmaDefaultPrevented,preventSigmaDefault:function(){r.sigmaDefaultPrevented=!0,n.sigmaDefaultPrevented=!0}});return n}function Ji(r,n){return b(b({},H(r,n)),{},{delta:Ot(r)})}var Qi=2;function ce(r){for(var n=[],i=0,e=Math.min(r.length,Qi);i<e;i++)n.push(r[i]);return n}function ne(r,n,i){var e={touches:ce(r.touches).map(function(t){return U(t,i)}),previousTouches:n.map(function(t){return U(t,i)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0},original:r};return e}function Ot(r){if(typeof r.deltaY<"u")return r.deltaY*-3/360;if(typeof r.detail<"u")return r.detail/-9;throw new Error("Captor: could not extract delta from event.")}var Mt=(function(r){function n(i,e){var t;return A(this,n),t=I(this,n),t.container=i,t.renderer=e,t}return G(n,r),L(n)})(Oe),er=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],tr=er.reduce(function(r,n){return b(b({},r),{},c({},n,Me[n]))},{}),ir=(function(r){function n(i,e){var t;return A(this,n),t=I(this,n,[i,e]),c(t,"enabled",!0),c(t,"draggedEvents",0),c(t,"downStartTime",null),c(t,"lastMouseX",null),c(t,"lastMouseY",null),c(t,"isMouseDown",!1),c(t,"isMoving",!1),c(t,"movingTimeout",null),c(t,"startCameraState",null),c(t,"clicks",0),c(t,"doubleClickTimeout",null),c(t,"currentWheelDirection",0),c(t,"settings",tr),t.handleClick=t.handleClick.bind(t),t.handleRightClick=t.handleRightClick.bind(t),t.handleDown=t.handleDown.bind(t),t.handleUp=t.handleUp.bind(t),t.handleMove=t.handleMove.bind(t),t.handleWheel=t.handleWheel.bind(t),t.handleLeave=t.handleLeave.bind(t),t.handleEnter=t.handleEnter.bind(t),i.addEventListener("click",t.handleClick,{capture:!1}),i.addEventListener("contextmenu",t.handleRightClick,{capture:!1}),i.addEventListener("mousedown",t.handleDown,{capture:!1}),i.addEventListener("wheel",t.handleWheel,{capture:!1}),i.addEventListener("mouseleave",t.handleLeave,{capture:!1}),i.addEventListener("mouseenter",t.handleEnter,{capture:!1}),document.addEventListener("mousemove",t.handleMove,{capture:!1}),document.addEventListener("mouseup",t.handleUp,{capture:!1}),t}return G(n,r),L(n,[{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++,this.clicks===2)return this.clicks=0,typeof this.doubleClickTimeout=="number"&&(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",H(e,this.container))}}},{key:"handleRightClick",value:function(e){this.enabled&&this.emit("rightClick",H(e,this.container))}},{key:"handleDoubleClick",value:function(e){if(this.enabled){e.preventDefault(),e.stopPropagation();var t=H(e,this.container);if(this.emit("doubleClick",t),!t.sigmaDefaultPrevented){var a=this.renderer.getCamera(),o=a.getBoundedRatio(a.getState().ratio/this.settings.doubleClickZoomingRatio);a.animate(this.renderer.getViewportZoomedState(U(e,this.container),o),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}}},{key:"handleDown",value:function(e){if(this.enabled){if(e.button===0){this.startCameraState=this.renderer.getCamera().getState();var t=U(e,this.container),a=t.x,o=t.y;this.lastMouseX=a,this.lastMouseY=o,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",H(e,this.container))}}},{key:"handleUp",value:function(e){var t=this;if(!(!this.enabled||!this.isMouseDown)){var a=this.renderer.getCamera();this.isMouseDown=!1,typeof this.movingTimeout=="number"&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var o=U(e,this.container),s=o.x,l=o.y,h=a.getState(),u=a.getPreviousState()||{x:0,y:0};this.isMoving?a.animate({x:h.x+this.settings.inertiaRatio*(h.x-u.x),y:h.y+this.settings.inertiaRatio*(h.y-u.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):(this.lastMouseX!==s||this.lastMouseY!==l)&&a.setState({x:h.x,y:h.y}),this.isMoving=!1,setTimeout(function(){var d=t.draggedEvents>0;t.draggedEvents=0,d&&t.renderer.getSetting("hideEdgesOnMove")&&t.renderer.refresh()},0),this.emit("mouseup",H(e,this.container))}}},{key:"handleMove",value:function(e){var t=this;if(this.enabled){var a=H(e,this.container);if(this.emit("mousemovebody",a),(e.target===this.container||e.composedPath()[0]===this.container)&&this.emit("mousemove",a),!a.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){t.movingTimeout=null,t.isMoving=!1},this.settings.dragTimeout);var o=this.renderer.getCamera(),s=U(e,this.container),l=s.x,h=s.y,u=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),d=this.renderer.viewportToFramedGraph({x:l,y:h}),f=u.x-d.x,g=u.y-d.y,m=o.getState(),v=m.x+f,p=m.y+g;o.setState({x:v,y:p}),this.lastMouseX=l,this.lastMouseY=h,e.preventDefault(),e.stopPropagation()}}}},{key:"handleLeave",value:function(e){this.emit("mouseleave",H(e,this.container))}},{key:"handleEnter",value:function(e){this.emit("mouseenter",H(e,this.container))}},{key:"handleWheel",value:function(e){var t=this,a=this.renderer.getCamera();if(!(!this.enabled||!a.enabledZooming)){var o=Ot(e);if(o){var s=Ji(e,this.container);if(this.emit("wheel",s),s.sigmaDefaultPrevented){e.preventDefault(),e.stopPropagation();return}var l=a.getState().ratio,h=o>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,u=a.getBoundedRatio(l*h),d=o>0?1:-1,f=Date.now();l!==u&&(e.preventDefault(),e.stopPropagation(),!(this.currentWheelDirection===d&&this.lastWheelTriggerTime&&f-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(a.animate(this.renderer.getViewportZoomedState(U(e,this.container),u),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){t.currentWheelDirection=0}),this.currentWheelDirection=d,this.lastWheelTriggerTime=f))}}}},{key:"setSettings",value:function(e){this.settings=e}}])})(Mt),rr=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],nr=rr.reduce(function(r,n){return b(b({},r),{},c({},n,Me[n]))},{}),ar=(function(r){function n(i,e){var t;return A(this,n),t=I(this,n,[i,e]),c(t,"enabled",!0),c(t,"isMoving",!1),c(t,"hasMoved",!1),c(t,"touchMode",0),c(t,"startTouchesPositions",[]),c(t,"lastTouches",[]),c(t,"lastTap",null),c(t,"settings",nr),t.handleStart=t.handleStart.bind(t),t.handleLeave=t.handleLeave.bind(t),t.handleMove=t.handleMove.bind(t),i.addEventListener("touchstart",t.handleStart,{capture:!1}),i.addEventListener("touchcancel",t.handleLeave,{capture:!1}),document.addEventListener("touchend",t.handleLeave,{capture:!1,passive:!1}),document.addEventListener("touchmove",t.handleMove,{capture:!1,passive:!1}),t}return G(n,r),L(n,[{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 a=ce(e.touches);if(this.touchMode=a.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=a.map(function(g){return U(g,t.container)}),this.touchMode===2){var o=ee(this.startTouchesPositions,2),s=o[0],l=s.x,h=s.y,u=o[1],d=u.x,f=u.y;this.startTouchesAngle=Math.atan2(f-h,d-l),this.startTouchesDistance=Math.sqrt(Math.pow(d-l,2)+Math.pow(f-h,2))}this.emit("touchdown",ne(e,this.lastTouches,this.container)),this.lastTouches=a,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(e.touches.length===1){this.handleStart(e),e.preventDefault();break}case 1:if(this.isMoving){var t=this.renderer.getCamera(),a=t.getState(),o=t.getPreviousState()||{x:0,y:0};t.animate({x:a.x+this.settings.inertiaRatio*(a.x-o.x),y:a.y+this.settings.inertiaRatio*(a.y-o.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",ne(e,this.lastTouches,this.container)),!e.touches.length){var s=U(this.lastTouches[0],this.container),l=this.startTouchesPositions[0],h=Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2);if(!e.touches.length&&h<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var u=ne(e,this.lastTouches,this.container);if(this.emit("doubletap",u),this.lastTap=null,!u.sigmaDefaultPrevented){var d=this.renderer.getCamera(),f=d.getBoundedRatio(d.getState().ratio/this.settings.doubleClickZoomingRatio);d.animate(this.renderer.getViewportZoomedState(s,f),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var g=ne(e,this.lastTouches,this.container);this.emit("tap",g),this.lastTap={time:Date.now(),position:g.touches[0]||g.previousTouches[0]}}}this.lastTouches=ce(e.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(e){var t=this;if(!(!this.enabled||!this.startTouchesPositions.length)){e.preventDefault();var a=ce(e.touches),o=a.map(function(Z){return U(Z,t.container)}),s=this.lastTouches;this.lastTouches=a,this.lastTouchesPositions=o;var l=ne(e,s,this.container);if(this.emit("touchmove",l),!l.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=o.some(function(Z,ve){var B=t.startTouchesPositions[ve];return B&&(Z.x!==B.x||Z.y!==B.y)})),!!this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){t.isMoving=!1},this.settings.dragTimeout);var h=this.renderer.getCamera(),u=this.startCameraState,d=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var f=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),g=f.x,m=f.y,v=this.renderer.viewportToFramedGraph(o[0]),p=v.x,R=v.y;h.setState({x:u.x+g-p,y:u.y+m-R});break}case 2:{var y={x:.5,y:.5,angle:0,ratio:1},E=o[0],T=E.x,x=E.y,w=o[1],_=w.x,O=w.y,D=Math.atan2(O-x,_-T)-this.startTouchesAngle,k=Math.hypot(O-x,_-T)/this.startTouchesDistance,P=h.getBoundedRatio(u.ratio/k);y.ratio=P,y.angle=u.angle+D;var F=this.getDimensions(),Y=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:u}),N=Math.min(F.width,F.height)-2*d,M=N/F.width,V=N/F.height,se=P/N,K=T-N/2/M,X=x-N/2/V,j=[K*Math.cos(-y.angle)-X*Math.sin(-y.angle),X*Math.cos(-y.angle)+K*Math.sin(-y.angle)];K=j[0],X=j[1],y.x=Y.x-K*se,y.y=Y.y+X*se,h.setState(y);break}}}}}},{key:"setSettings",value:function(e){this.settings=e}}])})(Mt);function or(r){if(Array.isArray(r))return Se(r)}function sr(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function lr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
312
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ot(r){return or(r)||sr(r)||Tt(r)||lr()}function hr(r,n){if(r==null)return{};var i={};for(var e in r)if({}.hasOwnProperty.call(r,e)){if(n.indexOf(e)!==-1)continue;i[e]=r[e]}return i}function we(r,n){if(r==null)return{};var i,e,t=hr(r,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(e=0;e<a.length;e++)i=a[e],n.indexOf(i)===-1&&{}.propertyIsEnumerable.call(r,i)&&(t[i]=r[i])}return t}var st=(function(){function r(n,i){A(this,r),this.key=n,this.size=i}return L(r,null,[{key:"compare",value:function(i,e){return i.size>e.size?-1:i.size<e.size||i.key>e.key?1:-1}}])})(),lt=(function(){function r(){A(this,r),c(this,"width",0),c(this,"height",0),c(this,"cellSize",0),c(this,"columns",0),c(this,"rows",0),c(this,"cells",{})}return L(r,[{key:"resizeAndClear",value:function(i,e){this.width=i.width,this.height=i.height,this.cellSize=e,this.columns=Math.ceil(i.width/e),this.rows=Math.ceil(i.height/e),this.cells={}}},{key:"getIndex",value:function(i){var e=Math.floor(i.x/this.cellSize),t=Math.floor(i.y/this.cellSize);return t*this.columns+e}},{key:"add",value:function(i,e,t){var a=new st(i,e),o=this.getIndex(t),s=this.cells[o];s||(s=[],this.cells[o]=s),s.push(a)}},{key:"organize",value:function(){for(var i in this.cells){var e=this.cells[i];e.sort(st.compare)}}},{key:"getLabelsToDisplay",value:function(i,e){var t=this.cellSize*this.cellSize,a=t/i/i,o=a*e/t,s=Math.ceil(o),l=[];for(var h in this.cells)for(var u=this.cells[h],d=0;d<Math.min(s,u.length);d++)l.push(u[d].key);return l}}])})();function ur(r){var n=r.graph,i=r.hoveredNode,e=r.highlightedNodes,t=r.displayedNodeLabels,a=[];return n.forEachEdge(function(o,s,l,h){(l===i||h===i||e.has(l)||e.has(h)||t.has(l)&&t.has(h))&&a.push(o)}),a}var ht=150,ut=50,W=Object.prototype.hasOwnProperty;function dr(r,n,i){if(!W.call(i,"x")||!W.call(i,"y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(n,'". 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 i.color||(i.color=r.defaultNodeColor),!i.label&&i.label!==""&&(i.label=null),i.label!==void 0&&i.label!==null?i.label=""+i.label:i.label=null,i.size||(i.size=2),W.call(i,"hidden")||(i.hidden=!1),W.call(i,"highlighted")||(i.highlighted=!1),W.call(i,"forceLabel")||(i.forceLabel=!1),(!i.type||i.type==="")&&(i.type=r.defaultNodeType),i.zIndex||(i.zIndex=0),i}function cr(r,n,i){return i.color||(i.color=r.defaultEdgeColor),i.label||(i.label=""),i.size||(i.size=.5),W.call(i,"hidden")||(i.hidden=!1),W.call(i,"forceLabel")||(i.forceLabel=!1),(!i.type||i.type==="")&&(i.type=r.defaultEdgeType),i.zIndex||(i.zIndex=0),i}var fr=(function(r){function n(i,e){var t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(A(this,n),t=I(this,n),c(t,"elements",{}),c(t,"canvasContexts",{}),c(t,"webGLContexts",{}),c(t,"pickingLayers",new Set),c(t,"textures",{}),c(t,"frameBuffers",{}),c(t,"activeListeners",{}),c(t,"labelGrid",new lt),c(t,"nodeDataCache",{}),c(t,"edgeDataCache",{}),c(t,"nodeProgramIndex",{}),c(t,"edgeProgramIndex",{}),c(t,"nodesWithForcedLabels",new Set),c(t,"edgesWithForcedLabels",new Set),c(t,"nodeExtent",{x:[0,1],y:[0,1]}),c(t,"nodeZExtent",[1/0,-1/0]),c(t,"edgeZExtent",[1/0,-1/0]),c(t,"matrix",z()),c(t,"invMatrix",z()),c(t,"correctionRatio",1),c(t,"customBBox",null),c(t,"normalizationFunction",rt({x:[0,1],y:[0,1]})),c(t,"graphToViewportRatio",1),c(t,"itemIDsIndex",{}),c(t,"nodeIndices",{}),c(t,"edgeIndices",{}),c(t,"width",0),c(t,"height",0),c(t,"pixelRatio",tt()),c(t,"pickingDownSizingRatio",2*t.pixelRatio),c(t,"displayedNodeLabels",new Set),c(t,"displayedEdgeLabels",new Set),c(t,"highlightedNodes",new Set),c(t,"hoveredNode",null),c(t,"hoveredEdge",null),c(t,"renderFrame",null),c(t,"renderHighlightedNodesFrame",null),c(t,"needToProcess",!1),c(t,"checkEdgesEventsFrame",null),c(t,"nodePrograms",{}),c(t,"nodeHoverPrograms",{}),c(t,"edgePrograms",{}),t.settings=Ki(a),_e(t.settings),qi(i),!(e instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");t.graph=i,t.container=e,t.createWebGLContext("edges",{picking:a.enableEdgeEvents}),t.createCanvasContext("edgeLabels"),t.createWebGLContext("nodes",{picking:!0}),t.createCanvasContext("labels"),t.createCanvasContext("hovers"),t.createWebGLContext("hoverNodes"),t.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),t.resize();for(var o in t.settings.nodeProgramClasses)t.registerNodeProgram(o,t.settings.nodeProgramClasses[o],t.settings.nodeHoverProgramClasses[o]);for(var s in t.settings.edgeProgramClasses)t.registerEdgeProgram(s,t.settings.edgeProgramClasses[s]);return t.camera=new at,t.bindCameraHandlers(),t.mouseCaptor=new ir(t.elements.mouse,t),t.mouseCaptor.setSettings(t.settings),t.touchCaptor=new ar(t.elements.mouse,t),t.touchCaptor.setSettings(t.settings),t.bindEventHandlers(),t.bindGraphHandlers(),t.handleSettingsUpdate(),t.refresh(),t}return G(n,r),L(n,[{key:"registerNodeProgram",value:function(e,t,a){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(a||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,a=t[e],o=we(t,[e].map(ae));a.kill(),this.nodePrograms=o}if(this.nodeHoverPrograms[e]){var s=this.nodeHoverPrograms,l=s[e],h=we(s,[e].map(ae));l.kill(),this.nodePrograms=h}return this}},{key:"unregisterEdgeProgram",value:function(e){if(this.edgePrograms[e]){var t=this.edgePrograms,a=t[e],o=we(t,[e].map(ae));a.kill(),this.edgePrograms=o}return this}},{key:"resetWebGLTexture",value:function(e){var t=this.webGLContexts[e],a=this.frameBuffers[e],o=this.textures[e];o&&t.deleteTexture(o);var s=t.createTexture();return t.bindFramebuffer(t.FRAMEBUFFER,a),t.bindTexture(t.TEXTURE_2D,s),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,s,0),this.textures[e]=s,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,a=e.y,o=Ve(this.webGLContexts.nodes,this.frameBuffers.nodes,t,a,this.pixelRatio,this.pickingDownSizingRatio),s=We.apply(void 0,ot(o)),l=this.itemIDsIndex[s];return l&&l.type==="node"?l.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(a){var o=re(a),s={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}},l=e.getNodeAtPosition(o);if(l&&e.hoveredNode!==l&&!e.nodeDataCache[l].hidden){e.hoveredNode&&e.emit("leaveNode",b(b({},s),{},{node:e.hoveredNode})),e.hoveredNode=l,e.emit("enterNode",b(b({},s),{},{node:l})),e.scheduleHighlightedNodesRender();return}if(e.hoveredNode&&e.getNodeAtPosition(o)!==e.hoveredNode){var h=e.hoveredNode;e.hoveredNode=null,e.emit("leaveNode",b(b({},s),{},{node:h})),e.scheduleHighlightedNodesRender();return}if(e.settings.enableEdgeEvents){var u=e.hoveredNode?null:e.getEdgeAtPoint(s.event.x,s.event.y);u!==e.hoveredEdge&&(e.hoveredEdge&&e.emit("leaveEdge",b(b({},s),{},{edge:e.hoveredEdge})),u&&e.emit("enterEdge",b(b({},s),{},{edge:u})),e.hoveredEdge=u)}},this.activeListeners.handleMoveBody=function(a){var o=re(a);e.emit("moveBody",{event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(a){var o=re(a),s={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}};e.hoveredNode&&(e.emit("leaveNode",b(b({},s),{},{node:e.hoveredNode})),e.scheduleHighlightedNodesRender()),e.settings.enableEdgeEvents&&e.hoveredEdge&&(e.emit("leaveEdge",b(b({},s),{},{edge:e.hoveredEdge})),e.scheduleHighlightedNodesRender()),e.emit("leaveStage",b({},s))},this.activeListeners.handleEnter=function(a){var o=re(a),s={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}};e.emit("enterStage",b({},s))};var t=function(o){return function(s){var l=re(s),h={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}},u=e.getNodeAtPosition(l);if(u)return e.emit("".concat(o,"Node"),b(b({},h),{},{node:u}));if(e.settings.enableEdgeEvents){var d=e.getEdgeAtPoint(l.x,l.y);if(d)return e.emit("".concat(o,"Edge"),b(b({},h),{},{edge:d}))}return e.emit("".concat(o,"Stage"),h)}};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,a=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(o){var s,l=(s=o.hints)===null||s===void 0?void 0:s.attributes;e.graph.forEachNode(function(u){return e.updateNode(u)});var h=!l||l.some(function(u){return a.has(u)});e.refresh({partialGraph:{nodes:t.nodes()},skipIndexation:!h,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(o){var s,l=(s=o.hints)===null||s===void 0?void 0:s.attributes;e.graph.forEachEdge(function(u){return e.updateEdge(u)});var h=l&&["zIndex","type"].some(function(u){return l?.includes(u)});e.refresh({partialGraph:{edges:t.edges()},skipIndexation:!h,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(o){var s=o.key;e.addNode(s),e.refresh({partialGraph:{nodes:[s]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(o){var s=o.key;e.refresh({partialGraph:{nodes:[s]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(o){var s=o.key;e.removeNode(s),e.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(o){var s=o.key;e.addEdge(s),e.refresh({partialGraph:{edges:[s]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(o){var s=o.key;e.refresh({partialGraph:{edges:[s]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(o){var s=o.key;e.removeEdge(s),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 a=Ve(this.webGLContexts.edges,this.frameBuffers.edges,e,t,this.pixelRatio,this.pickingDownSizingRatio),o=We.apply(void 0,ot(a)),s=this.itemIDsIndex[o];return s&&s.type==="edge"?s.id:null}},{key:"process",value:function(){var e=this;this.emit("beforeProcess");var t=this.graph,a=this.settings,o=this.getDimensions();if(this.nodeExtent=Zi(this.graph),!this.settings.autoRescale){var s=o.width,l=o.height,h=this.nodeExtent,u=h.x,d=h.y;this.nodeExtent={x:[(u[0]+u[1])/2-s/2,(u[0]+u[1])/2+s/2],y:[(d[0]+d[1])/2-l/2,(d[0]+d[1])/2+l/2]}}this.normalizationFunction=rt(this.customBBox||this.nodeExtent);var f=new at,g=ie(f.getState(),o,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(o,a.labelGridCellSize);for(var m={},v={},p={},R={},y=1,E=t.nodes(),T=0,x=E.length;T<x;T++){var w=E[T],_=this.nodeDataCache[w],O=t.getNodeAttributes(w);_.x=O.x,_.y=O.y,this.normalizationFunction.applyTo(_),typeof _.label=="string"&&!_.hidden&&this.labelGrid.add(w,_.size,this.framedGraphToViewport(_,{matrix:g})),m[_.type]=(m[_.type]||0)+1}this.labelGrid.organize();for(var D in this.nodePrograms){if(!W.call(this.nodePrograms,D))throw new Error('Sigma: could not find a suitable program for node type "'.concat(D,'"!'));this.nodePrograms[D].reallocate(m[D]||0),m[D]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(E=it(this.nodeZExtent,function(me){return e.nodeDataCache[me].zIndex},E));for(var k=0,P=E.length;k<P;k++){var F=E[k];v[F]=y,R[v[F]]={type:"node",id:F},y++;var Y=this.nodeDataCache[F];this.addNodeToProgram(F,v[F],m[Y.type]++)}for(var N={},M=t.edges(),V=0,se=M.length;V<se;V++){var K=M[V],X=this.edgeDataCache[K];N[X.type]=(N[X.type]||0)+1}this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(M=it(this.edgeZExtent,function(me){return e.edgeDataCache[me].zIndex},M));for(var j in this.edgePrograms){if(!W.call(this.edgePrograms,j))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(j,'"!'));this.edgePrograms[j].reallocate(N[j]||0),N[j]=0}for(var Z=0,ve=M.length;Z<ve;Z++){var B=M[Z];p[B]=y,R[p[B]]={type:"edge",id:B},y++;var Ut=this.edgeDataCache[B];this.addEdgeToProgram(B,p[B],N[Ut.type]++)}return this.itemIDsIndex=R,this.nodeIndices=v,this.edgeIndices=p,this.emit("afterProcess"),this}},{key:"handleSettingsUpdate",value:function(e){var t=this,a=this.settings;if(this.camera.minRatio=a.minCameraRatio,this.camera.maxRatio=a.maxCameraRatio,this.camera.enabledZooming=a.enableCameraZooming,this.camera.enabledPanning=a.enableCameraPanning,this.camera.enabledRotation=a.enableCameraRotation,a.cameraPanBoundaries?this.camera.clean=function(u){return t.cleanCameraState(u,a.cameraPanBoundaries&&ke(a.cameraPanBoundaries)==="object"?a.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),e){if(e.edgeProgramClasses!==a.edgeProgramClasses){for(var o in a.edgeProgramClasses)a.edgeProgramClasses[o]!==e.edgeProgramClasses[o]&&this.registerEdgeProgram(o,a.edgeProgramClasses[o]);for(var s in e.edgeProgramClasses)a.edgeProgramClasses[s]||this.unregisterEdgeProgram(s)}if(e.nodeProgramClasses!==a.nodeProgramClasses||e.nodeHoverProgramClasses!==a.nodeHoverProgramClasses){for(var l in a.nodeProgramClasses)(a.nodeProgramClasses[l]!==e.nodeProgramClasses[l]||a.nodeHoverProgramClasses[l]!==e.nodeHoverProgramClasses[l])&&this.registerNodeProgram(l,a.nodeProgramClasses[l],a.nodeHoverProgramClasses[l]);for(var h in e.nodeProgramClasses)a.nodeProgramClasses[h]||this.unregisterNodeProgram(h)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:"cleanCameraState",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t.tolerance,o=a===void 0?0:a,s=t.boundaries,l=b({},e),h=s||this.nodeExtent,u=ee(h.x,2),d=u[0],f=u[1],g=ee(h.y,2),m=g[0],v=g[1],p=[this.graphToViewport({x:d,y:m},{cameraState:e}),this.graphToViewport({x:f,y:m},{cameraState:e}),this.graphToViewport({x:d,y:v},{cameraState:e}),this.graphToViewport({x:f,y:v},{cameraState:e})],R=1/0,y=-1/0,E=1/0,T=-1/0;p.forEach(function(N){var M=N.x,V=N.y;R=Math.min(R,M),y=Math.max(y,M),E=Math.min(E,V),T=Math.max(T,V)});var x=y-R,w=T-E,_=this.getDimensions(),O=_.width,D=_.height,k=0,P=0;if(x>=O?y<O-o?k=y-(O-o):R>o&&(k=R-o):y>O+o?k=y-(O+o):R<-o&&(k=R+o),w>=D?T<D-o?P=T-(D-o):E>o&&(P=E-o):T>D+o?P=T-(D+o):E<-o&&(P=E+o),k||P){var F=this.viewportToFramedGraph({x:0,y:0},{cameraState:e}),Y=this.viewportToFramedGraph({x:k,y:P},{cameraState:e});k=Y.x-F.x,P=Y.y-F.y,l.x+=k,l.y+=P}return l}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var e=this.camera.getState(),t=this.labelGrid.getLabelsToDisplay(e.ratio,this.settings.labelDensity);nt(t,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var a=this.canvasContexts.labels,o=0,s=t.length;o<s;o++){var l=t[o],h=this.nodeDataCache[l];if(!this.displayedNodeLabels.has(l)&&!h.hidden){var u=this.framedGraphToViewport(h),d=u.x,f=u.y,g=this.scaleSize(h.size);if(!(!h.forceLabel&&g<this.settings.labelRenderedSizeThreshold)&&!(d<-ht||d>this.width+ht||f<-ut||f>this.height+ut)){this.displayedNodeLabels.add(l);var m=this.settings.defaultDrawNodeLabel,v=this.nodePrograms[h.type],p=v?.drawLabel||m;p(a,b(b({key:l},h),{},{size:g,x:d,y:f}),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=ur({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});nt(t,this.edgesWithForcedLabels);for(var a=new Set,o=0,s=t.length;o<s;o++){var l=t[o],h=this.graph.extremities(l),u=this.nodeDataCache[h[0]],d=this.nodeDataCache[h[1]],f=this.edgeDataCache[l];if(!a.has(l)&&!(f.hidden||u.hidden||d.hidden)){var g=this.settings.defaultDrawEdgeLabel,m=this.edgePrograms[f.type],v=m?.drawLabel||g;v(e,b(b({key:l},f),{},{size:this.scaleSize(f.size)}),b(b(b({key:h[0]},u),this.framedGraphToViewport(u)),{},{size:this.scaleSize(u.size)}),b(b(b({key:h[1]},d),this.framedGraphToViewport(d)),{},{size:this.scaleSize(d.size)}),this.settings),a.add(l)}}return this.displayedEdgeLabels=a,this}},{key:"renderHighlightedNodes",value:function(){var e=this,t=this.canvasContexts.hovers;t.clearRect(0,0,this.width,this.height);var a=function(g){var m=e.nodeDataCache[g],v=e.framedGraphToViewport(m),p=v.x,R=v.y,y=e.scaleSize(m.size),E=e.settings.defaultDrawNodeHover,T=e.nodePrograms[m.type],x=T?.drawHover||E;x(t,b(b({key:g},m),{},{size:y,x:p,y:R}),e.settings)},o=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&o.push(this.hoveredNode),this.highlightedNodes.forEach(function(f){f!==e.hoveredNode&&o.push(f)}),o.forEach(function(f){return a(f)});var s={};o.forEach(function(f){var g=e.nodeDataCache[f].type;s[g]=(s[g]||0)+1});for(var l in this.nodeHoverPrograms)this.nodeHoverPrograms[l].reallocate(s[l]||0),s[l]=0;o.forEach(function(f){var g=e.nodeDataCache[f];e.nodeHoverPrograms[g.type].process(0,s[g.type]++,g)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var h=this.getRenderParams();for(var u in this.nodeHoverPrograms){var d=this.nodeHoverPrograms[u];d.render(h)}}},{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(p){return e.resetWebGLTexture(p)}),!this.graph.order)return t();var a=this.mouseCaptor,o=this.camera.isAnimated()||a.isMoving||a.draggedEvents||a.currentWheelDirection,s=this.camera.getState(),l=this.getDimensions(),h=this.getGraphDimensions(),u=this.getStagePadding();this.matrix=ie(s,l,h,u),this.invMatrix=ie(s,l,h,u,!0),this.correctionRatio=ji(this.matrix,s,l),this.graphToViewportRatio=this.getGraphToViewportRatio();var d=this.getRenderParams();for(var f in this.nodePrograms){var g=this.nodePrograms[f];g.render(d)}if(!this.settings.hideEdgesOnMove||!o)for(var m in this.edgePrograms){var v=this.edgePrograms[m];v.render(d)}return this.settings.hideLabelsOnMove&&o||(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 a=dr(this.settings,e,t);this.nodeDataCache[e]=a,this.nodesWithForcedLabels.delete(e),a.forceLabel&&!a.hidden&&this.nodesWithForcedLabels.add(e),this.highlightedNodes.delete(e),a.highlighted&&!a.hidden&&this.highlightedNodes.add(e),this.settings.zIndex&&(a.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=a.zIndex),a.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=a.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 a=cr(this.settings,e,t);this.edgeDataCache[e]=a,this.edgesWithForcedLabels.delete(e),a.forceLabel&&!a.hidden&&this.edgesWithForcedLabels.add(e),this.settings.zIndex&&(a.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=a.zIndex),a.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=a.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 lt,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0],this.highlightedNodes=new Set}},{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,a){var o=this.nodeDataCache[e],s=this.nodePrograms[o.type];if(!s)throw new Error('Sigma: could not find a suitable program for node type "'.concat(o.type,'"!'));s.process(t,a,o),this.nodeProgramIndex[e]=a}},{key:"addEdgeToProgram",value:function(e,t,a){var o=this.edgeDataCache[e],s=this.edgePrograms[o.type];if(!s)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(o.type,'"!'));var l=this.graph.extremities(e),h=this.nodeDataCache[l[0]],u=this.nodeDataCache[l[1]];s.process(t,a,h,u,o),this.edgeProgramIndex[e]=a}},{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,a=e.autoRescale;return a&&t||0}},{key:"createLayer",value:function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[e])throw new Error('Sigma: a layer named "'.concat(e,'" already exists'));var o=Yi(t,{position:"absolute"},{class:"sigma-".concat(e)});return a.style&&Object.assign(o.style,a.style),this.elements[e]=o,"beforeLayer"in a&&a.beforeLayer?this.elements[a.beforeLayer].before(o):"afterLayer"in a&&a.afterLayer?this.elements[a.afterLayer].after(o):this.container.appendChild(o),o}},{key:"createCanvas",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(e,"canvas",t)}},{key:"createCanvasContext",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.createCanvas(e,t),o={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[e]=a.getContext("2d",o),this}},{key:"createWebGLContext",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t?.canvas||this.createCanvas(e,t);t.hidden&&a.remove();var o=b({preserveDrawingBuffer:!1,antialias:!1},t),s;s=a.getContext("webgl2",o),s||(s=a.getContext("webgl",o)),s||(s=a.getContext("experimental-webgl",o));var l=s;if(this.webGLContexts[e]=l,l.blendFunc(l.ONE,l.ONE_MINUS_SRC_ALPHA),t.picking){this.pickingLayers.add(e);var h=l.createFramebuffer();if(!h)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(e));this.frameBuffers[e]=h}return l}},{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 a,o=this.webGLContexts[e];(a=o.getExtension("WEBGL_lose_context"))===null||a===void 0||a.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(),this.checkEdgesEventsFrame!==null&&(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 b({},this.settings)}},{key:"getSetting",value:function(e){return this.settings[e]}},{key:"setSetting",value:function(e,t){var a=b({},this.settings);return this.settings[e]=t,_e(this.settings),this.handleSettingsUpdate(a),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=b({},this.settings);return this.settings=b(b({},this.settings),e),_e(this.settings),this.handleSettingsUpdate(t),this.scheduleRefresh(),this}},{key:"resize",value:function(e){var t=this.width,a=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=tt(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!e&&t===this.width&&a===this.height)return this;for(var o in this.elements){var s=this.elements[o];s.style.width=this.width+"px",s.style.height=this.height+"px"}for(var l in this.canvasContexts)this.elements[l].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[l].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[l].scale(this.pixelRatio,this.pixelRatio);for(var h in this.webGLContexts){this.elements[h].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[h].setAttribute("height",this.height*this.pixelRatio+"px");var u=this.webGLContexts[h];if(u.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(h)){var d=this.textures[h];d&&u.deleteTexture(d)}}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,a=e?.skipIndexation!==void 0?e?.skipIndexation:!1,o=e?.schedule!==void 0?e.schedule:!1,s=!e||!e.partialGraph;if(s)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(T){return t.addNode(T)}),this.graph.forEachEdge(function(T){return t.addEdge(T)});else{for(var l,h,u=((l=e.partialGraph)===null||l===void 0?void 0:l.nodes)||[],d=0,f=u?.length||0;d<f;d++){var g=u[d];if(this.updateNode(g),a){var m=this.nodeProgramIndex[g];if(m===void 0)throw new Error('Sigma: node "'.concat(g,`" can't be repaint`));this.addNodeToProgram(g,this.nodeIndices[g],m)}}for(var v=(e==null||(h=e.partialGraph)===null||h===void 0?void 0:h.edges)||[],p=0,R=v.length;p<R;p++){var y=v[p];if(this.updateEdge(y),a){var E=this.edgeProgramIndex[y];if(E===void 0)throw new Error('Sigma: edge "'.concat(y,`" can't be repaint`));this.addEdgeToProgram(y,this.edgeIndices[y],E)}}}return(s||!a)&&(this.needToProcess=!0),o?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(b(b({},e),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(e,t){var a=this.camera.getState(),o=a.ratio,s=a.angle,l=a.x,h=a.y,u=this.settings,d=u.minCameraRatio,f=u.maxCameraRatio;typeof f=="number"&&(t=Math.min(t,f)),typeof d=="number"&&(t=Math.max(t,d));var g=t/o,m={x:this.width/2,y:this.height/2},v=this.viewportToFramedGraph(e),p=this.viewportToFramedGraph(m);return{angle:s,x:(v.x-p.x)*(1-g)+l,y:(v.y-p.y)*(1-g)+h,ratio:t}}},{key:"viewRectangle",value:function(){var e=this.viewportToFramedGraph({x:0,y:0}),t=this.viewportToFramedGraph({x:this.width,y:0}),a=this.viewportToFramedGraph({x:0,y:this.height});return{x1:e.x,y1:e.y,x2:t.x,y2:t.y,height:t.y-a.y}}},{key:"framedGraphToViewport",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=!!t.cameraState||!!t.viewportDimensions||!!t.graphDimensions,o=t.matrix?t.matrix:a?ie(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding()):this.matrix,s=Le(o,e);return{x:(1+s.x)*this.width/2,y:(1-s.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=!!t.cameraState||!!t.viewportDimensions||!t.graphDimensions,o=t.matrix?t.matrix:a?ie(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding(),!0):this.invMatrix,s=Le(o,{x:e.x/this.width*2-1,y:1-e.y/this.height*2});return isNaN(s.x)&&(s.x=0),isNaN(s.y)&&(s.y=0),s}},{key:"viewportToGraph",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(e,t))}},{key:"graphToViewport",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(e),t)}},{key:"getGraphToViewportRatio",value:function(){var e={x:0,y:0},t={x:1,y:1},a=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),o=this.graphToViewport(e),s=this.graphToViewport(t),l=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2));return l/a}},{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);for(var e=this.container;e.firstChild;)e.removeChild(e.firstChild);for(var t in this.nodePrograms)this.nodePrograms[t].kill();for(var a in this.nodeHoverPrograms)this.nodeHoverPrograms[a].kill();for(var o in this.edgePrograms)this.edgePrograms[o].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var s in this.elements)this.killLayer(s);this.canvasContexts={},this.webGLContexts={},this.elements={}}},{key:"scaleSize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return e/this.settings.zoomToSizeRatioFunction(t)*(this.getSetting("itemSizesReference")==="positions"?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}}])})(Oe);const zt=C.createContext(null),gr=zt.Provider;function ze(){const r=C.useContext(zt);if(r==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of <SigmaContainer>");return r}function Ue(){return ze().sigma}function vr(){const{sigma:r}=ze();return C.useCallback((n=>{r&&Object.keys(n).forEach((i=>{r.setSetting(i,n[i])}))}),[r])}function ge(r){return new Set(Object.keys(r))}const dt=ge({clickNode:!0,rightClickNode:!0,downNode:!0,enterNode:!0,leaveNode:!0,doubleClickNode:!0,wheelNode:!0,clickEdge:!0,rightClickEdge:!0,downEdge:!0,enterEdge:!0,leaveEdge:!0,doubleClickEdge:!0,wheelEdge:!0,clickStage:!0,rightClickStage:!0,downStage:!0,doubleClickStage:!0,wheelStage:!0,beforeRender:!0,afterRender:!0,kill:!0,upStage:!0,upEdge:!0,upNode:!0,enterStage:!0,leaveStage:!0,resize:!0,afterClear:!0,afterProcess:!0,beforeClear:!0,beforeProcess:!0,moveBody:!0}),ct=ge({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),ft=ge({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),gt=ge({updated:!0});function Gr(){const r=Ue(),n=vr(),[i,e]=C.useState({});return C.useEffect((()=>{if(!r||!i)return;const t=i,a=Object.keys(t);return a.forEach((o=>{const s=t[o];dt.has(o)&&r.on(o,s),ct.has(o)&&r.getMouseCaptor().on(o,s),ft.has(o)&&r.getTouchCaptor().on(o,s),gt.has(o)&&r.getCamera().on(o,s)})),()=>{r&&a.forEach((o=>{const s=t[o];dt.has(o)&&r.off(o,s),ct.has(o)&&r.getMouseCaptor().off(o,s),ft.has(o)&&r.getTouchCaptor().off(o,s),gt.has(o)&&r.getCamera().off(o,s)}))}}),[r,i,n]),e}function Or(){const r=Ue();return C.useCallback(((n,i=!0)=>{r&&n&&(i&&r.getGraph().order>0&&r.getGraph().clear(),r.getGraph().import(n),r.refresh())}),[r])}function Be(r,n){if(r===n)return!0;if(typeof r=="object"&&r!=null&&typeof n=="object"&&n!=null){if(Object.keys(r).length!=Object.keys(n).length)return!1;for(const i in r)if(!Object.hasOwn(n,i)||!Be(r[i],n[i]))return!1;return!0}return!1}function Mr(r,n){let i;return e=>new Promise((t=>{i&&clearTimeout(i),i=setTimeout((()=>{t(r(e))}),n)}))}function mr(r){const n=Ue(),[i,e]=C.useState(r||{});C.useEffect((()=>{e((h=>Be(h,r||{})?h:r||{}))}),[r]);const t=C.useCallback((h=>{n.getCamera().animatedZoom(Object.assign(Object.assign({},i),h))}),[n,i]),a=C.useCallback((h=>{n.getCamera().animatedUnzoom(Object.assign(Object.assign({},i),h))}),[n,i]),o=C.useCallback((h=>{n.getCamera().animatedReset(Object.assign(Object.assign({},i),h))}),[n,i]),s=C.useCallback(((h,u)=>{n.getCamera().animate(h,Object.assign(Object.assign({},i),u))}),[n,i]),l=C.useCallback(((h,u)=>{const d=n.getNodeDisplayData(h);d?n.getCamera().animate(d,Object.assign(Object.assign({},i),u)):console.warn(`Node ${h} not found`)}),[n,i]);return{zoomIn:t,zoomOut:a,reset:o,goto:s,gotoNode:l}}function pr(r){const n=ze(),[i,e]=C.useState(!1),[t,a]=C.useState(r||n.container),o=C.useCallback((()=>e((s=>!s))),[]);return C.useEffect((()=>(document.addEventListener("fullscreenchange",o),()=>document.removeEventListener("fullscreenchange",o))),[o]),C.useEffect((()=>{a(r||n.container)}),[r,n.container]),{toggle:C.useCallback((()=>{var s;s=t,document.fullscreenElement!==s?s.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()}),[t]),isFullScreen:i}}const zr=C.forwardRef((({graph:r,id:n,className:i,style:e,settings:t={},children:a},o)=>{const s=C.useRef(null),l=C.useRef(null),h={className:`react-sigma ${i||""}`,id:n,style:e},[u,d]=C.useState(null),[f,g]=C.useState(t);C.useEffect((()=>{g((p=>Be(p,t)?p:t))}),[t]),C.useEffect((()=>{let p=null;if(l.current!==null){let R=new Wt;r&&(R=typeof r=="function"?new r:r),p=new fr(R,l.current,f),d((y=>{let E=null;return y&&(E=y.getCamera().getState()),E&&p.getCamera().setState(E),p}))}return()=>{p&&p.kill()}}),[l,r,f]),C.useImperativeHandle(o,(()=>u),[u]);const m=C.useMemo((()=>u&&s.current?{sigma:u,container:s.current}:null),[u,s]),v=m!==null?S.createElement(gr,{value:m},a):null;return S.createElement("div",Object.assign({},h,{ref:s}),S.createElement("div",{className:"sigma-container",ref:l}),v)})),Ur=({id:r,className:n,style:i,children:e,position:t="bottom-left"})=>{const a={className:`react-sigma-controls ${n||""} ${t}`,id:r,style:i};return S.createElement("div",Object.assign({},a),e)};var vt;function Fe(){return Fe=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e])}return r},Fe.apply(null,arguments)}var mt,br=function(r){return C.createElement("svg",Fe({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"dot-circle-regular_svg__svg-inline--fa dot-circle-regular_svg__fa-dot-circle dot-circle-regular_svg__fa-w-16","data-icon":"dot-circle","data-prefix":"far",viewBox:"0 0 512 512",width:"1em",height:"1em"},r),vt||(vt=C.createElement("path",{fill:"currentColor",d:"M256 56c110.532 0 200 89.451 200 200 0 110.532-89.451 200-200 200-110.532 0-200-89.451-200-200 0-110.532 89.451-200 200-200m0-48C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8m0 168c-44.183 0-80 35.817-80 80s35.817 80 80 80 80-35.817 80-80-35.817-80-80-80"})))};function Ne(){return Ne=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e])}return r},Ne.apply(null,arguments)}var pt,Er=function(r){return C.createElement("svg",Ne({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"minus-solid_svg__svg-inline--fa minus-solid_svg__fa-minus minus-solid_svg__fa-w-14","data-icon":"minus","data-prefix":"fas",viewBox:"0 0 448 512",width:"1em",height:"1em"},r),mt||(mt=C.createElement("path",{fill:"currentColor",d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32"})))};function De(){return De=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e])}return r},De.apply(null,arguments)}var yr=function(r){return C.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"plus-solid_svg__svg-inline--fa plus-solid_svg__fa-plus plus-solid_svg__fa-w-14","data-icon":"plus","data-prefix":"fas",viewBox:"0 0 448 512",width:"1em",height:"1em"},r),pt||(pt=C.createElement("path",{fill:"currentColor",d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32"})))};const Br=({className:r,style:n,animationDuration:i=200,children:e,labels:t={}})=>{const{zoomIn:a,zoomOut:o,reset:s}=mr({duration:i,factor:1.5}),l={style:n,className:`react-sigma-control ${r||""}`};return S.createElement(S.Fragment,null,S.createElement("div",Object.assign({},l),S.createElement("button",{onClick:()=>a(),title:t.zoomIn||"Zoom In"},e?e[0]:S.createElement(yr,{style:{width:"1em"}}))),S.createElement("div",Object.assign({},l),S.createElement("button",{onClick:()=>o(),title:t.zoomOut||"Zoom Out"},e?e[1]:S.createElement(Er,{style:{width:"1em"}}))),S.createElement("div",Object.assign({},l),S.createElement("button",{onClick:()=>s(),title:t.reset||"See whole graph"},e?e[2]:S.createElement(br,{style:{width:"1em"}}))))};var bt;function Pe(){return Pe=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e])}return r},Pe.apply(null,arguments)}var Et,Tr=function(r){return C.createElement("svg",Pe({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"compress-solid_svg__svg-inline--fa compress-solid_svg__fa-compress compress-solid_svg__fa-w-14","data-icon":"compress","data-prefix":"fas",viewBox:"0 0 448 512",width:"1em",height:"1em"},r),bt||(bt=C.createElement("path",{fill:"currentColor",d:"M436 192H312c-13.3 0-24-10.7-24-24V44c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v84h84c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12m-276-24V44c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v84H12c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24m0 300V344c0-13.3-10.7-24-24-24H12c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12m192 0v-84h84c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12H312c-13.3 0-24 10.7-24 24v124c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12"})))};function Ie(){return Ie=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e])}return r},Ie.apply(null,arguments)}var Cr=function(r){return C.createElement("svg",Ie({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"expand-solid_svg__svg-inline--fa expand-solid_svg__fa-expand expand-solid_svg__fa-w-14","data-icon":"expand","data-prefix":"fas",viewBox:"0 0 448 512",width:"1em",height:"1em"},r),Et||(Et=C.createElement("path",{fill:"currentColor",d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12M288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12m148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12M160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12"})))};const Hr=({id:r,className:n,style:i,container:e,children:t,labels:a={}})=>{const{isFullScreen:o,toggle:s}=pr(e?.current),l={className:`react-sigma-control ${n||""}`,id:r,style:i};return document.fullscreenEnabled?S.createElement("div",Object.assign({},l),S.createElement("button",{onClick:s,title:o?a.exit||"Exit fullscreen":a.enter||"Enter fullscreen"},t&&!o&&t[0],t&&o&&t[1],!t&&!o&&S.createElement(Cr,{style:{width:"1em"}}),!t&&o&&S.createElement(Tr,{style:{width:"1em"}}))):null};export{Ur as ControlsContainer,Hr as FullScreenControl,zr as SigmaContainer,zt as SigmaContext,gr as SigmaProvider,Br as ZoomControl,Mr as debounce,Be as isEqual,mr as useCamera,pr as useFullScreen,Or as useLoadGraph,Gr as useRegisterEvents,vr as useSetSettings,Ue as useSigma,ze as useSigmaContext};
312
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ot(r){return or(r)||sr(r)||Tt(r)||lr()}function hr(r,n){if(r==null)return{};var i={};for(var e in r)if({}.hasOwnProperty.call(r,e)){if(n.indexOf(e)!==-1)continue;i[e]=r[e]}return i}function we(r,n){if(r==null)return{};var i,e,t=hr(r,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(e=0;e<a.length;e++)i=a[e],n.indexOf(i)===-1&&{}.propertyIsEnumerable.call(r,i)&&(t[i]=r[i])}return t}var st=(function(){function r(n,i){A(this,r),this.key=n,this.size=i}return L(r,null,[{key:"compare",value:function(i,e){return i.size>e.size?-1:i.size<e.size||i.key>e.key?1:-1}}])})(),lt=(function(){function r(){A(this,r),c(this,"width",0),c(this,"height",0),c(this,"cellSize",0),c(this,"columns",0),c(this,"rows",0),c(this,"cells",{})}return L(r,[{key:"resizeAndClear",value:function(i,e){this.width=i.width,this.height=i.height,this.cellSize=e,this.columns=Math.ceil(i.width/e),this.rows=Math.ceil(i.height/e),this.cells={}}},{key:"getIndex",value:function(i){var e=Math.floor(i.x/this.cellSize),t=Math.floor(i.y/this.cellSize);return t*this.columns+e}},{key:"add",value:function(i,e,t){var a=new st(i,e),o=this.getIndex(t),s=this.cells[o];s||(s=[],this.cells[o]=s),s.push(a)}},{key:"organize",value:function(){for(var i in this.cells){var e=this.cells[i];e.sort(st.compare)}}},{key:"getLabelsToDisplay",value:function(i,e){var t=this.cellSize*this.cellSize,a=t/i/i,o=a*e/t,s=Math.ceil(o),l=[];for(var h in this.cells)for(var u=this.cells[h],d=0;d<Math.min(s,u.length);d++)l.push(u[d].key);return l}}])})();function ur(r){var n=r.graph,i=r.hoveredNode,e=r.highlightedNodes,t=r.displayedNodeLabels,a=[];return n.forEachEdge(function(o,s,l,h){(l===i||h===i||e.has(l)||e.has(h)||t.has(l)&&t.has(h))&&a.push(o)}),a}var ht=150,ut=50,W=Object.prototype.hasOwnProperty;function dr(r,n,i){if(!W.call(i,"x")||!W.call(i,"y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(n,'". 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 i.color||(i.color=r.defaultNodeColor),!i.label&&i.label!==""&&(i.label=null),i.label!==void 0&&i.label!==null?i.label=""+i.label:i.label=null,i.size||(i.size=2),W.call(i,"hidden")||(i.hidden=!1),W.call(i,"highlighted")||(i.highlighted=!1),W.call(i,"forceLabel")||(i.forceLabel=!1),(!i.type||i.type==="")&&(i.type=r.defaultNodeType),i.zIndex||(i.zIndex=0),i}function cr(r,n,i){return i.color||(i.color=r.defaultEdgeColor),i.label||(i.label=""),i.size||(i.size=.5),W.call(i,"hidden")||(i.hidden=!1),W.call(i,"forceLabel")||(i.forceLabel=!1),(!i.type||i.type==="")&&(i.type=r.defaultEdgeType),i.zIndex||(i.zIndex=0),i}var fr=(function(r){function n(i,e){var t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(A(this,n),t=I(this,n),c(t,"elements",{}),c(t,"canvasContexts",{}),c(t,"webGLContexts",{}),c(t,"pickingLayers",new Set),c(t,"textures",{}),c(t,"frameBuffers",{}),c(t,"activeListeners",{}),c(t,"labelGrid",new lt),c(t,"nodeDataCache",{}),c(t,"edgeDataCache",{}),c(t,"nodeProgramIndex",{}),c(t,"edgeProgramIndex",{}),c(t,"nodesWithForcedLabels",new Set),c(t,"edgesWithForcedLabels",new Set),c(t,"nodeExtent",{x:[0,1],y:[0,1]}),c(t,"nodeZExtent",[1/0,-1/0]),c(t,"edgeZExtent",[1/0,-1/0]),c(t,"matrix",z()),c(t,"invMatrix",z()),c(t,"correctionRatio",1),c(t,"customBBox",null),c(t,"normalizationFunction",rt({x:[0,1],y:[0,1]})),c(t,"graphToViewportRatio",1),c(t,"itemIDsIndex",{}),c(t,"nodeIndices",{}),c(t,"edgeIndices",{}),c(t,"width",0),c(t,"height",0),c(t,"pixelRatio",tt()),c(t,"pickingDownSizingRatio",2*t.pixelRatio),c(t,"displayedNodeLabels",new Set),c(t,"displayedEdgeLabels",new Set),c(t,"highlightedNodes",new Set),c(t,"hoveredNode",null),c(t,"hoveredEdge",null),c(t,"renderFrame",null),c(t,"renderHighlightedNodesFrame",null),c(t,"needToProcess",!1),c(t,"checkEdgesEventsFrame",null),c(t,"nodePrograms",{}),c(t,"nodeHoverPrograms",{}),c(t,"edgePrograms",{}),t.settings=Ki(a),_e(t.settings),qi(i),!(e instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");t.graph=i,t.container=e,t.createWebGLContext("edges",{picking:a.enableEdgeEvents}),t.createCanvasContext("edgeLabels"),t.createWebGLContext("nodes",{picking:!0}),t.createCanvasContext("labels"),t.createCanvasContext("hovers"),t.createWebGLContext("hoverNodes"),t.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),t.resize();for(var o in t.settings.nodeProgramClasses)t.registerNodeProgram(o,t.settings.nodeProgramClasses[o],t.settings.nodeHoverProgramClasses[o]);for(var s in t.settings.edgeProgramClasses)t.registerEdgeProgram(s,t.settings.edgeProgramClasses[s]);return t.camera=new at,t.bindCameraHandlers(),t.mouseCaptor=new ir(t.elements.mouse,t),t.mouseCaptor.setSettings(t.settings),t.touchCaptor=new ar(t.elements.mouse,t),t.touchCaptor.setSettings(t.settings),t.bindEventHandlers(),t.bindGraphHandlers(),t.handleSettingsUpdate(),t.refresh(),t}return G(n,r),L(n,[{key:"registerNodeProgram",value:function(e,t,a){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(a||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,a=t[e],o=we(t,[e].map(ae));a.kill(),this.nodePrograms=o}if(this.nodeHoverPrograms[e]){var s=this.nodeHoverPrograms,l=s[e],h=we(s,[e].map(ae));l.kill(),this.nodePrograms=h}return this}},{key:"unregisterEdgeProgram",value:function(e){if(this.edgePrograms[e]){var t=this.edgePrograms,a=t[e],o=we(t,[e].map(ae));a.kill(),this.edgePrograms=o}return this}},{key:"resetWebGLTexture",value:function(e){var t=this.webGLContexts[e],a=this.frameBuffers[e],o=this.textures[e];o&&t.deleteTexture(o);var s=t.createTexture();return t.bindFramebuffer(t.FRAMEBUFFER,a),t.bindTexture(t.TEXTURE_2D,s),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,s,0),this.textures[e]=s,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,a=e.y,o=Ve(this.webGLContexts.nodes,this.frameBuffers.nodes,t,a,this.pixelRatio,this.pickingDownSizingRatio),s=We.apply(void 0,ot(o)),l=this.itemIDsIndex[s];return l&&l.type==="node"?l.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(a){var o=re(a),s={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}},l=e.getNodeAtPosition(o);if(l&&e.hoveredNode!==l&&!e.nodeDataCache[l].hidden){e.hoveredNode&&e.emit("leaveNode",b(b({},s),{},{node:e.hoveredNode})),e.hoveredNode=l,e.emit("enterNode",b(b({},s),{},{node:l})),e.scheduleHighlightedNodesRender();return}if(e.hoveredNode&&e.getNodeAtPosition(o)!==e.hoveredNode){var h=e.hoveredNode;e.hoveredNode=null,e.emit("leaveNode",b(b({},s),{},{node:h})),e.scheduleHighlightedNodesRender();return}if(e.settings.enableEdgeEvents){var u=e.hoveredNode?null:e.getEdgeAtPoint(s.event.x,s.event.y);u!==e.hoveredEdge&&(e.hoveredEdge&&e.emit("leaveEdge",b(b({},s),{},{edge:e.hoveredEdge})),u&&e.emit("enterEdge",b(b({},s),{},{edge:u})),e.hoveredEdge=u)}},this.activeListeners.handleMoveBody=function(a){var o=re(a);e.emit("moveBody",{event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(a){var o=re(a),s={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}};e.hoveredNode&&(e.emit("leaveNode",b(b({},s),{},{node:e.hoveredNode})),e.scheduleHighlightedNodesRender()),e.settings.enableEdgeEvents&&e.hoveredEdge&&(e.emit("leaveEdge",b(b({},s),{},{edge:e.hoveredEdge})),e.scheduleHighlightedNodesRender()),e.emit("leaveStage",b({},s))},this.activeListeners.handleEnter=function(a){var o=re(a),s={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}};e.emit("enterStage",b({},s))};var t=function(o){return function(s){var l=re(s),h={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}},u=e.getNodeAtPosition(l);if(u)return e.emit("".concat(o,"Node"),b(b({},h),{},{node:u}));if(e.settings.enableEdgeEvents){var d=e.getEdgeAtPoint(l.x,l.y);if(d)return e.emit("".concat(o,"Edge"),b(b({},h),{},{edge:d}))}return e.emit("".concat(o,"Stage"),h)}};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,a=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(o){var s,l=(s=o.hints)===null||s===void 0?void 0:s.attributes;e.graph.forEachNode(function(u){return e.updateNode(u)});var h=!l||l.some(function(u){return a.has(u)});e.refresh({partialGraph:{nodes:t.nodes()},skipIndexation:!h,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(o){var s,l=(s=o.hints)===null||s===void 0?void 0:s.attributes;e.graph.forEachEdge(function(u){return e.updateEdge(u)});var h=l&&["zIndex","type"].some(function(u){return l?.includes(u)});e.refresh({partialGraph:{edges:t.edges()},skipIndexation:!h,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(o){var s=o.key;e.addNode(s),e.refresh({partialGraph:{nodes:[s]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(o){var s=o.key;e.refresh({partialGraph:{nodes:[s]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(o){var s=o.key;e.removeNode(s),e.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(o){var s=o.key;e.addEdge(s),e.refresh({partialGraph:{edges:[s]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(o){var s=o.key;e.refresh({partialGraph:{edges:[s]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(o){var s=o.key;e.removeEdge(s),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 a=Ve(this.webGLContexts.edges,this.frameBuffers.edges,e,t,this.pixelRatio,this.pickingDownSizingRatio),o=We.apply(void 0,ot(a)),s=this.itemIDsIndex[o];return s&&s.type==="edge"?s.id:null}},{key:"process",value:function(){var e=this;this.emit("beforeProcess");var t=this.graph,a=this.settings,o=this.getDimensions();if(this.nodeExtent=Zi(this.graph),!this.settings.autoRescale){var s=o.width,l=o.height,h=this.nodeExtent,u=h.x,d=h.y;this.nodeExtent={x:[(u[0]+u[1])/2-s/2,(u[0]+u[1])/2+s/2],y:[(d[0]+d[1])/2-l/2,(d[0]+d[1])/2+l/2]}}this.normalizationFunction=rt(this.customBBox||this.nodeExtent);var f=new at,g=ie(f.getState(),o,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(o,a.labelGridCellSize);for(var m={},v={},p={},R={},y=1,E=t.nodes(),T=0,x=E.length;T<x;T++){var w=E[T],_=this.nodeDataCache[w],O=t.getNodeAttributes(w);_.x=O.x,_.y=O.y,this.normalizationFunction.applyTo(_),typeof _.label=="string"&&!_.hidden&&this.labelGrid.add(w,_.size,this.framedGraphToViewport(_,{matrix:g})),m[_.type]=(m[_.type]||0)+1}this.labelGrid.organize();for(var D in this.nodePrograms){if(!W.call(this.nodePrograms,D))throw new Error('Sigma: could not find a suitable program for node type "'.concat(D,'"!'));this.nodePrograms[D].reallocate(m[D]||0),m[D]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(E=it(this.nodeZExtent,function(me){return e.nodeDataCache[me].zIndex},E));for(var k=0,P=E.length;k<P;k++){var F=E[k];v[F]=y,R[v[F]]={type:"node",id:F},y++;var Y=this.nodeDataCache[F];this.addNodeToProgram(F,v[F],m[Y.type]++)}for(var N={},M=t.edges(),V=0,se=M.length;V<se;V++){var K=M[V],X=this.edgeDataCache[K];N[X.type]=(N[X.type]||0)+1}this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(M=it(this.edgeZExtent,function(me){return e.edgeDataCache[me].zIndex},M));for(var j in this.edgePrograms){if(!W.call(this.edgePrograms,j))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(j,'"!'));this.edgePrograms[j].reallocate(N[j]||0),N[j]=0}for(var Z=0,ve=M.length;Z<ve;Z++){var B=M[Z];p[B]=y,R[p[B]]={type:"edge",id:B},y++;var Ut=this.edgeDataCache[B];this.addEdgeToProgram(B,p[B],N[Ut.type]++)}return this.itemIDsIndex=R,this.nodeIndices=v,this.edgeIndices=p,this.emit("afterProcess"),this}},{key:"handleSettingsUpdate",value:function(e){var t=this,a=this.settings;if(this.camera.minRatio=a.minCameraRatio,this.camera.maxRatio=a.maxCameraRatio,this.camera.enabledZooming=a.enableCameraZooming,this.camera.enabledPanning=a.enableCameraPanning,this.camera.enabledRotation=a.enableCameraRotation,a.cameraPanBoundaries?this.camera.clean=function(u){return t.cleanCameraState(u,a.cameraPanBoundaries&&ke(a.cameraPanBoundaries)==="object"?a.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),e){if(e.edgeProgramClasses!==a.edgeProgramClasses){for(var o in a.edgeProgramClasses)a.edgeProgramClasses[o]!==e.edgeProgramClasses[o]&&this.registerEdgeProgram(o,a.edgeProgramClasses[o]);for(var s in e.edgeProgramClasses)a.edgeProgramClasses[s]||this.unregisterEdgeProgram(s)}if(e.nodeProgramClasses!==a.nodeProgramClasses||e.nodeHoverProgramClasses!==a.nodeHoverProgramClasses){for(var l in a.nodeProgramClasses)(a.nodeProgramClasses[l]!==e.nodeProgramClasses[l]||a.nodeHoverProgramClasses[l]!==e.nodeHoverProgramClasses[l])&&this.registerNodeProgram(l,a.nodeProgramClasses[l],a.nodeHoverProgramClasses[l]);for(var h in e.nodeProgramClasses)a.nodeProgramClasses[h]||this.unregisterNodeProgram(h)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:"cleanCameraState",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t.tolerance,o=a===void 0?0:a,s=t.boundaries,l=b({},e),h=s||this.nodeExtent,u=ee(h.x,2),d=u[0],f=u[1],g=ee(h.y,2),m=g[0],v=g[1],p=[this.graphToViewport({x:d,y:m},{cameraState:e}),this.graphToViewport({x:f,y:m},{cameraState:e}),this.graphToViewport({x:d,y:v},{cameraState:e}),this.graphToViewport({x:f,y:v},{cameraState:e})],R=1/0,y=-1/0,E=1/0,T=-1/0;p.forEach(function(N){var M=N.x,V=N.y;R=Math.min(R,M),y=Math.max(y,M),E=Math.min(E,V),T=Math.max(T,V)});var x=y-R,w=T-E,_=this.getDimensions(),O=_.width,D=_.height,k=0,P=0;if(x>=O?y<O-o?k=y-(O-o):R>o&&(k=R-o):y>O+o?k=y-(O+o):R<-o&&(k=R+o),w>=D?T<D-o?P=T-(D-o):E>o&&(P=E-o):T>D+o?P=T-(D+o):E<-o&&(P=E+o),k||P){var F=this.viewportToFramedGraph({x:0,y:0},{cameraState:e}),Y=this.viewportToFramedGraph({x:k,y:P},{cameraState:e});k=Y.x-F.x,P=Y.y-F.y,l.x+=k,l.y+=P}return l}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var e=this.camera.getState(),t=this.labelGrid.getLabelsToDisplay(e.ratio,this.settings.labelDensity);nt(t,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var a=this.canvasContexts.labels,o=0,s=t.length;o<s;o++){var l=t[o],h=this.nodeDataCache[l];if(!this.displayedNodeLabels.has(l)&&!h.hidden){var u=this.framedGraphToViewport(h),d=u.x,f=u.y,g=this.scaleSize(h.size);if(!(!h.forceLabel&&g<this.settings.labelRenderedSizeThreshold)&&!(d<-ht||d>this.width+ht||f<-ut||f>this.height+ut)){this.displayedNodeLabels.add(l);var m=this.settings.defaultDrawNodeLabel,v=this.nodePrograms[h.type],p=v?.drawLabel||m;p(a,b(b({key:l},h),{},{size:g,x:d,y:f}),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=ur({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});nt(t,this.edgesWithForcedLabels);for(var a=new Set,o=0,s=t.length;o<s;o++){var l=t[o],h=this.graph.extremities(l),u=this.nodeDataCache[h[0]],d=this.nodeDataCache[h[1]],f=this.edgeDataCache[l];if(!a.has(l)&&!(f.hidden||u.hidden||d.hidden)){var g=this.settings.defaultDrawEdgeLabel,m=this.edgePrograms[f.type],v=m?.drawLabel||g;v(e,b(b({key:l},f),{},{size:this.scaleSize(f.size)}),b(b(b({key:h[0]},u),this.framedGraphToViewport(u)),{},{size:this.scaleSize(u.size)}),b(b(b({key:h[1]},d),this.framedGraphToViewport(d)),{},{size:this.scaleSize(d.size)}),this.settings),a.add(l)}}return this.displayedEdgeLabels=a,this}},{key:"renderHighlightedNodes",value:function(){var e=this,t=this.canvasContexts.hovers;t.clearRect(0,0,this.width,this.height);var a=function(g){var m=e.nodeDataCache[g],v=e.framedGraphToViewport(m),p=v.x,R=v.y,y=e.scaleSize(m.size),E=e.settings.defaultDrawNodeHover,T=e.nodePrograms[m.type],x=T?.drawHover||E;x(t,b(b({key:g},m),{},{size:y,x:p,y:R}),e.settings)},o=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&o.push(this.hoveredNode),this.highlightedNodes.forEach(function(f){f!==e.hoveredNode&&o.push(f)}),o.forEach(function(f){return a(f)});var s={};o.forEach(function(f){var g=e.nodeDataCache[f].type;s[g]=(s[g]||0)+1});for(var l in this.nodeHoverPrograms)this.nodeHoverPrograms[l].reallocate(s[l]||0),s[l]=0;o.forEach(function(f){var g=e.nodeDataCache[f];e.nodeHoverPrograms[g.type].process(0,s[g.type]++,g)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var h=this.getRenderParams();for(var u in this.nodeHoverPrograms){var d=this.nodeHoverPrograms[u];d.render(h)}}},{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(p){return e.resetWebGLTexture(p)}),!this.graph.order)return t();var a=this.mouseCaptor,o=this.camera.isAnimated()||a.isMoving||a.draggedEvents||a.currentWheelDirection,s=this.camera.getState(),l=this.getDimensions(),h=this.getGraphDimensions(),u=this.getStagePadding();this.matrix=ie(s,l,h,u),this.invMatrix=ie(s,l,h,u,!0),this.correctionRatio=ji(this.matrix,s,l),this.graphToViewportRatio=this.getGraphToViewportRatio();var d=this.getRenderParams();for(var f in this.nodePrograms){var g=this.nodePrograms[f];g.render(d)}if(!this.settings.hideEdgesOnMove||!o)for(var m in this.edgePrograms){var v=this.edgePrograms[m];v.render(d)}return this.settings.hideLabelsOnMove&&o||(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 a=dr(this.settings,e,t);this.nodeDataCache[e]=a,this.nodesWithForcedLabels.delete(e),a.forceLabel&&!a.hidden&&this.nodesWithForcedLabels.add(e),this.highlightedNodes.delete(e),a.highlighted&&!a.hidden&&this.highlightedNodes.add(e),this.settings.zIndex&&(a.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=a.zIndex),a.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=a.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 a=cr(this.settings,e,t);this.edgeDataCache[e]=a,this.edgesWithForcedLabels.delete(e),a.forceLabel&&!a.hidden&&this.edgesWithForcedLabels.add(e),this.settings.zIndex&&(a.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=a.zIndex),a.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=a.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 lt,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0],this.highlightedNodes=new Set}},{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,a){var o=this.nodeDataCache[e],s=this.nodePrograms[o.type];if(!s)throw new Error('Sigma: could not find a suitable program for node type "'.concat(o.type,'"!'));s.process(t,a,o),this.nodeProgramIndex[e]=a}},{key:"addEdgeToProgram",value:function(e,t,a){var o=this.edgeDataCache[e],s=this.edgePrograms[o.type];if(!s)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(o.type,'"!'));var l=this.graph.extremities(e),h=this.nodeDataCache[l[0]],u=this.nodeDataCache[l[1]];s.process(t,a,h,u,o),this.edgeProgramIndex[e]=a}},{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,a=e.autoRescale;return a&&t||0}},{key:"createLayer",value:function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[e])throw new Error('Sigma: a layer named "'.concat(e,'" already exists'));var o=Yi(t,{position:"absolute"},{class:"sigma-".concat(e)});return a.style&&Object.assign(o.style,a.style),this.elements[e]=o,"beforeLayer"in a&&a.beforeLayer?this.elements[a.beforeLayer].before(o):"afterLayer"in a&&a.afterLayer?this.elements[a.afterLayer].after(o):this.container.appendChild(o),o}},{key:"createCanvas",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(e,"canvas",t)}},{key:"createCanvasContext",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.createCanvas(e,t),o={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[e]=a.getContext("2d",o),this}},{key:"createWebGLContext",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t?.canvas||this.createCanvas(e,t);t.hidden&&a.remove();var o=b({preserveDrawingBuffer:!1,antialias:!1},t),s;s=a.getContext("webgl2",o),s||(s=a.getContext("webgl",o)),s||(s=a.getContext("experimental-webgl",o));var l=s;if(this.webGLContexts[e]=l,l.blendFunc(l.ONE,l.ONE_MINUS_SRC_ALPHA),t.picking){this.pickingLayers.add(e);var h=l.createFramebuffer();if(!h)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(e));this.frameBuffers[e]=h}return l}},{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 a,o=this.webGLContexts[e];(a=o.getExtension("WEBGL_lose_context"))===null||a===void 0||a.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(),this.checkEdgesEventsFrame!==null&&(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 b({},this.settings)}},{key:"getSetting",value:function(e){return this.settings[e]}},{key:"setSetting",value:function(e,t){var a=b({},this.settings);return this.settings[e]=t,_e(this.settings),this.handleSettingsUpdate(a),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=b({},this.settings);return this.settings=b(b({},this.settings),e),_e(this.settings),this.handleSettingsUpdate(t),this.scheduleRefresh(),this}},{key:"resize",value:function(e){var t=this.width,a=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=tt(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!e&&t===this.width&&a===this.height)return this;for(var o in this.elements){var s=this.elements[o];s.style.width=this.width+"px",s.style.height=this.height+"px"}for(var l in this.canvasContexts)this.elements[l].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[l].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[l].scale(this.pixelRatio,this.pixelRatio);for(var h in this.webGLContexts){this.elements[h].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[h].setAttribute("height",this.height*this.pixelRatio+"px");var u=this.webGLContexts[h];if(u.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(h)){var d=this.textures[h];d&&u.deleteTexture(d)}}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,a=e?.skipIndexation!==void 0?e?.skipIndexation:!1,o=e?.schedule!==void 0?e.schedule:!1,s=!e||!e.partialGraph;if(s)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(T){return t.addNode(T)}),this.graph.forEachEdge(function(T){return t.addEdge(T)});else{for(var l,h,u=((l=e.partialGraph)===null||l===void 0?void 0:l.nodes)||[],d=0,f=u?.length||0;d<f;d++){var g=u[d];if(this.updateNode(g),a){var m=this.nodeProgramIndex[g];if(m===void 0)throw new Error('Sigma: node "'.concat(g,`" can't be repaint`));this.addNodeToProgram(g,this.nodeIndices[g],m)}}for(var v=(e==null||(h=e.partialGraph)===null||h===void 0?void 0:h.edges)||[],p=0,R=v.length;p<R;p++){var y=v[p];if(this.updateEdge(y),a){var E=this.edgeProgramIndex[y];if(E===void 0)throw new Error('Sigma: edge "'.concat(y,`" can't be repaint`));this.addEdgeToProgram(y,this.edgeIndices[y],E)}}}return(s||!a)&&(this.needToProcess=!0),o?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(b(b({},e),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(e,t){var a=this.camera.getState(),o=a.ratio,s=a.angle,l=a.x,h=a.y,u=this.settings,d=u.minCameraRatio,f=u.maxCameraRatio;typeof f=="number"&&(t=Math.min(t,f)),typeof d=="number"&&(t=Math.max(t,d));var g=t/o,m={x:this.width/2,y:this.height/2},v=this.viewportToFramedGraph(e),p=this.viewportToFramedGraph(m);return{angle:s,x:(v.x-p.x)*(1-g)+l,y:(v.y-p.y)*(1-g)+h,ratio:t}}},{key:"viewRectangle",value:function(){var e=this.viewportToFramedGraph({x:0,y:0}),t=this.viewportToFramedGraph({x:this.width,y:0}),a=this.viewportToFramedGraph({x:0,y:this.height});return{x1:e.x,y1:e.y,x2:t.x,y2:t.y,height:t.y-a.y}}},{key:"framedGraphToViewport",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=!!t.cameraState||!!t.viewportDimensions||!!t.graphDimensions,o=t.matrix?t.matrix:a?ie(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding()):this.matrix,s=Le(o,e);return{x:(1+s.x)*this.width/2,y:(1-s.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=!!t.cameraState||!!t.viewportDimensions||!t.graphDimensions,o=t.matrix?t.matrix:a?ie(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding(),!0):this.invMatrix,s=Le(o,{x:e.x/this.width*2-1,y:1-e.y/this.height*2});return isNaN(s.x)&&(s.x=0),isNaN(s.y)&&(s.y=0),s}},{key:"viewportToGraph",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(e,t))}},{key:"graphToViewport",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(e),t)}},{key:"getGraphToViewportRatio",value:function(){var e={x:0,y:0},t={x:1,y:1},a=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),o=this.graphToViewport(e),s=this.graphToViewport(t),l=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2));return l/a}},{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);for(var e=this.container;e.firstChild;)e.removeChild(e.firstChild);for(var t in this.nodePrograms)this.nodePrograms[t].kill();for(var a in this.nodeHoverPrograms)this.nodeHoverPrograms[a].kill();for(var o in this.edgePrograms)this.edgePrograms[o].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var s in this.elements)this.killLayer(s);this.canvasContexts={},this.webGLContexts={},this.elements={}}},{key:"scaleSize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return e/this.settings.zoomToSizeRatioFunction(t)*(this.getSetting("itemSizesReference")==="positions"?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}}])})(Oe);const zt=C.createContext(null),gr=zt.Provider;function ze(){const r=C.useContext(zt);if(r==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of <SigmaContainer>");return r}function Ue(){return ze().sigma}function vr(){const{sigma:r}=ze();return C.useCallback((n=>{r&&Object.keys(n).forEach((i=>{r.setSetting(i,n[i])}))}),[r])}function ge(r){return new Set(Object.keys(r))}const dt=ge({clickNode:!0,rightClickNode:!0,downNode:!0,enterNode:!0,leaveNode:!0,doubleClickNode:!0,wheelNode:!0,clickEdge:!0,rightClickEdge:!0,downEdge:!0,enterEdge:!0,leaveEdge:!0,doubleClickEdge:!0,wheelEdge:!0,clickStage:!0,rightClickStage:!0,downStage:!0,doubleClickStage:!0,wheelStage:!0,beforeRender:!0,afterRender:!0,kill:!0,upStage:!0,upEdge:!0,upNode:!0,enterStage:!0,leaveStage:!0,resize:!0,afterClear:!0,afterProcess:!0,beforeClear:!0,beforeProcess:!0,moveBody:!0}),ct=ge({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),ft=ge({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),gt=ge({updated:!0});function Nr(){const r=Ue(),n=vr(),[i,e]=C.useState({});return C.useEffect((()=>{if(!r||!i)return;const t=i,a=Object.keys(t);return a.forEach((o=>{const s=t[o];dt.has(o)&&r.on(o,s),ct.has(o)&&r.getMouseCaptor().on(o,s),ft.has(o)&&r.getTouchCaptor().on(o,s),gt.has(o)&&r.getCamera().on(o,s)})),()=>{r&&a.forEach((o=>{const s=t[o];dt.has(o)&&r.off(o,s),ct.has(o)&&r.getMouseCaptor().off(o,s),ft.has(o)&&r.getTouchCaptor().off(o,s),gt.has(o)&&r.getCamera().off(o,s)}))}}),[r,i,n]),e}function Dr(){const r=Ue();return C.useCallback(((n,i=!0)=>{r&&n&&(i&&r.getGraph().order>0&&r.getGraph().clear(),r.getGraph().import(n),r.refresh())}),[r])}function Be(r,n){if(r===n)return!0;if(typeof r=="object"&&r!=null&&typeof n=="object"&&n!=null){if(Object.keys(r).length!=Object.keys(n).length)return!1;for(const i in r)if(!Object.hasOwn(n,i)||!Be(r[i],n[i]))return!1;return!0}return!1}function Pr(r,n){let i;return e=>new Promise((t=>{i&&clearTimeout(i),i=setTimeout((()=>{t(r(e))}),n)}))}function mr(r){const n=Ue(),[i,e]=C.useState(r||{});C.useEffect((()=>{e((h=>Be(h,r||{})?h:r||{}))}),[r]);const t=C.useCallback((h=>{n.getCamera().animatedZoom(Object.assign(Object.assign({},i),h))}),[n,i]),a=C.useCallback((h=>{n.getCamera().animatedUnzoom(Object.assign(Object.assign({},i),h))}),[n,i]),o=C.useCallback((h=>{n.getCamera().animatedReset(Object.assign(Object.assign({},i),h))}),[n,i]),s=C.useCallback(((h,u)=>{n.getCamera().animate(h,Object.assign(Object.assign({},i),u))}),[n,i]),l=C.useCallback(((h,u)=>{const d=n.getNodeDisplayData(h);d?n.getCamera().animate(d,Object.assign(Object.assign({},i),u)):console.warn(`Node ${h} not found`)}),[n,i]);return{zoomIn:t,zoomOut:a,reset:o,goto:s,gotoNode:l}}function pr(r){const n=ze(),[i,e]=C.useState(!1),[t,a]=C.useState(r||n.container),o=C.useCallback((()=>e((s=>!s))),[]);return C.useEffect((()=>(document.addEventListener("fullscreenchange",o),()=>document.removeEventListener("fullscreenchange",o))),[o]),C.useEffect((()=>{a(r||n.container)}),[r,n.container]),{toggle:C.useCallback((()=>{var s;s=t,document.fullscreenElement!==s?s.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()}),[t]),isFullScreen:i}}const Ir=C.forwardRef((({graph:r,id:n,className:i,style:e,settings:t={},children:a},o)=>{const s=C.useRef(null),l=C.useRef(null),h={className:`react-sigma ${i||""}`,id:n,style:e},[u,d]=C.useState(null),[f,g]=C.useState(t);C.useEffect((()=>{g((p=>Be(p,t)?p:t))}),[t]),C.useEffect((()=>{let p=null;if(l.current!==null){let R=new Wt;r&&(R=typeof r=="function"?new r:r),p=new fr(R,l.current,f),d((y=>{let E=null;return y&&(E=y.getCamera().getState()),E&&p.getCamera().setState(E),p}))}return()=>{p&&p.kill()}}),[l,r,f]),C.useImperativeHandle(o,(()=>u),[u]);const m=C.useMemo((()=>u&&s.current?{sigma:u,container:s.current}:null),[u,s]),v=m!==null?S.createElement(gr,{value:m},a):null;return S.createElement("div",Object.assign({},h,{ref:s}),S.createElement("div",{className:"sigma-container",ref:l}),v)})),Gr=({id:r,className:n,style:i,children:e,position:t="bottom-left"})=>{const a={className:`react-sigma-controls ${n||""} ${t}`,id:r,style:i};return S.createElement("div",Object.assign({},a),e)};var vt;function Fe(){return Fe=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e])}return r},Fe.apply(null,arguments)}var mt,br=function(r){return C.createElement("svg",Fe({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"dot-circle-regular_svg__svg-inline--fa dot-circle-regular_svg__fa-dot-circle dot-circle-regular_svg__fa-w-16","data-icon":"dot-circle","data-prefix":"far",viewBox:"0 0 512 512",width:"1em",height:"1em"},r),vt||(vt=C.createElement("path",{fill:"currentColor",d:"M256 56c110.532 0 200 89.451 200 200 0 110.532-89.451 200-200 200-110.532 0-200-89.451-200-200 0-110.532 89.451-200 200-200m0-48C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8m0 168c-44.183 0-80 35.817-80 80s35.817 80 80 80 80-35.817 80-80-35.817-80-80-80"})))};function Ne(){return Ne=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e])}return r},Ne.apply(null,arguments)}var pt,Er=function(r){return C.createElement("svg",Ne({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"minus-solid_svg__svg-inline--fa minus-solid_svg__fa-minus minus-solid_svg__fa-w-14","data-icon":"minus","data-prefix":"fas",viewBox:"0 0 448 512",width:"1em",height:"1em"},r),mt||(mt=C.createElement("path",{fill:"currentColor",d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32"})))};function De(){return De=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e])}return r},De.apply(null,arguments)}var yr=function(r){return C.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"plus-solid_svg__svg-inline--fa plus-solid_svg__fa-plus plus-solid_svg__fa-w-14","data-icon":"plus","data-prefix":"fas",viewBox:"0 0 448 512",width:"1em",height:"1em"},r),pt||(pt=C.createElement("path",{fill:"currentColor",d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32"})))};const Or=({className:r,style:n,animationDuration:i=200,children:e,labels:t={}})=>{const{zoomIn:a,zoomOut:o,reset:s}=mr({duration:i,factor:1.5}),l={style:n,className:`react-sigma-control ${r||""}`};return S.createElement(S.Fragment,null,S.createElement("div",Object.assign({},l),S.createElement("button",{onClick:()=>a(),title:t.zoomIn||"Zoom In"},e?e[0]:S.createElement(yr,{style:{width:"1em"}}))),S.createElement("div",Object.assign({},l),S.createElement("button",{onClick:()=>o(),title:t.zoomOut||"Zoom Out"},e?e[1]:S.createElement(Er,{style:{width:"1em"}}))),S.createElement("div",Object.assign({},l),S.createElement("button",{onClick:()=>s(),title:t.reset||"See whole graph"},e?e[2]:S.createElement(br,{style:{width:"1em"}}))))};var bt;function Pe(){return Pe=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e])}return r},Pe.apply(null,arguments)}var Et,Tr=function(r){return C.createElement("svg",Pe({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"compress-solid_svg__svg-inline--fa compress-solid_svg__fa-compress compress-solid_svg__fa-w-14","data-icon":"compress","data-prefix":"fas",viewBox:"0 0 448 512",width:"1em",height:"1em"},r),bt||(bt=C.createElement("path",{fill:"currentColor",d:"M436 192H312c-13.3 0-24-10.7-24-24V44c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v84h84c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12m-276-24V44c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v84H12c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24m0 300V344c0-13.3-10.7-24-24-24H12c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12m192 0v-84h84c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12H312c-13.3 0-24 10.7-24 24v124c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12"})))};function Ie(){return Ie=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e])}return r},Ie.apply(null,arguments)}var Cr=function(r){return C.createElement("svg",Ie({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"expand-solid_svg__svg-inline--fa expand-solid_svg__fa-expand expand-solid_svg__fa-w-14","data-icon":"expand","data-prefix":"fas",viewBox:"0 0 448 512",width:"1em",height:"1em"},r),Et||(Et=C.createElement("path",{fill:"currentColor",d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12M288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12m148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12M160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12"})))};const Mr=({id:r,className:n,style:i,container:e,children:t,labels:a={}})=>{const{isFullScreen:o,toggle:s}=pr(e?.current),l={className:`react-sigma-control ${n||""}`,id:r,style:i};return document.fullscreenEnabled?S.createElement("div",Object.assign({},l),S.createElement("button",{onClick:s,title:o?a.exit||"Exit fullscreen":a.enter||"Enter fullscreen"},t&&!o&&t[0],t&&o&&t[1],!t&&!o&&S.createElement(Cr,{style:{width:"1em"}}),!t&&o&&S.createElement(Tr,{style:{width:"1em"}}))):null};export{Gr as ControlsContainer,Mr as FullScreenControl,Ir as SigmaContainer,zt as SigmaContext,gr as SigmaProvider,Or as ZoomControl,Pr as debounce,Be as isEqual,mr as useCamera,pr as useFullScreen,Dr as useLoadGraph,Nr as useRegisterEvents,vr as useSetSettings,Ue as useSigma,ze as useSigmaContext};
@@ -1 +1 @@
1
- import{r as n}from"./vendor-tanstack-pFxw0eGP.js";const _=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,c)=>c?c.toUpperCase():o.toLowerCase()),y=a=>{const t=M(a);return t.charAt(0).toUpperCase()+t.slice(1)},r=(...a)=>a.filter((t,o,c)=>!!t&&t.trim()!==""&&c.indexOf(t)===o).join(" ").trim(),m=a=>{for(const t in a)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const u=n.forwardRef(({color:a="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:s="",children:h,iconNode:i,...d},k)=>n.createElement("svg",{ref:k,...v,width:t,height:t,stroke:a,strokeWidth:c?Number(o)*24/Number(t):o,className:r("lucide",s),...!h&&!m(d)&&{"aria-hidden":"true"},...d},[...i.map(([p,l])=>n.createElement(p,l)),...Array.isArray(h)?h:[h]]));const e=(a,t)=>{const o=n.forwardRef(({className:c,...s},h)=>n.createElement(u,{ref:h,iconNode:t,className:r(`lucide-${_(y(a))}`,`lucide-${a}`,c),...s}));return o.displayName=y(a),o};const x=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],k1=e("arrow-left",x);const g=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],p1=e("arrow-right",g);const w=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],l1=e("arrow-up",w);const $=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],_1=e("book-open",$);const N=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],M1=e("check",N);const f=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],m1=e("chevron-down",f);const z=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],v1=e("chevron-left",z);const q=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],u1=e("chevron-right",q);const C=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],x1=e("circle-check",C);const j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],g1=e("circle-question-mark",j);const b=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],w1=e("cloud",b);const A=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],$1=e("copy",A);const H=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],N1=e("download",H);const L=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],f1=e("external-link",L);const R=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],z1=e("file-text",R);const V=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],q1=e("github",V);const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],C1=e("globe",E);const P=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],j1=e("history",P);const Z=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],b1=e("layout-dashboard",Z);const S=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],A1=e("link-2",S);const U=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],H1=e("loader-circle",U);const B=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],L1=e("maximize-2",B);const D=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],R1=e("menu",D);const T=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],V1=e("minimize-2",T);const G=[["path",{d:"M5 12h14",key:"1ays0h"}]],E1=e("minus",G);const I=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],P1=e("panel-left-close",I);const W=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Z1=e("panel-left-open",W);const F=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],S1=e("play",F);const O=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],U1=e("plus",O);const J=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],B1=e("radar",J);const K=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],D1=e("radio",K);const Q=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],T1=e("refresh-cw",Q);const X=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],G1=e("rocket",X);const Y=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],I1=e("rotate-ccw",Y);const e1=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],W1=e("scan-search",e1);const t1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],F1=e("search",t1);const a1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],O1=e("settings-2",a1);const o1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],J1=e("settings",o1);const c1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],K1=e("trash-2",c1);const h1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Q1=e("triangle-alert",h1);const n1=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],X1=e("triangle",n1);const s1=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],Y1=e("unplug",s1);const d1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],ee=e("upload",d1);const y1=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],te=e("wrench",y1);const r1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ae=e("x",r1);export{p1 as A,_1 as B,m1 as C,N1 as D,f1 as E,z1 as F,C1 as G,j1 as H,X1 as I,k1 as J,H1 as L,V1 as M,S1 as P,D1 as R,F1 as S,Q1 as T,Y1 as U,te as W,ae as X,I1 as a,L1 as b,l1 as c,M1 as d,u1 as e,$1 as f,b1 as g,B1 as h,A1 as i,J1 as j,G1 as k,q1 as l,Z1 as m,P1 as n,R1 as o,U1 as p,v1 as q,T1 as r,ee as s,x1 as t,g1 as u,E1 as v,W1 as w,O1 as x,K1 as y,w1 as z};
1
+ import{r as n}from"./vendor-tanstack-Dock0eH1.js";const _=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,c)=>c?c.toUpperCase():o.toLowerCase()),y=a=>{const t=M(a);return t.charAt(0).toUpperCase()+t.slice(1)},r=(...a)=>a.filter((t,o,c)=>!!t&&t.trim()!==""&&c.indexOf(t)===o).join(" ").trim(),m=a=>{for(const t in a)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const u=n.forwardRef(({color:a="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:s="",children:h,iconNode:i,...d},k)=>n.createElement("svg",{ref:k,...v,width:t,height:t,stroke:a,strokeWidth:c?Number(o)*24/Number(t):o,className:r("lucide",s),...!h&&!m(d)&&{"aria-hidden":"true"},...d},[...i.map(([p,l])=>n.createElement(p,l)),...Array.isArray(h)?h:[h]]));const e=(a,t)=>{const o=n.forwardRef(({className:c,...s},h)=>n.createElement(u,{ref:h,iconNode:t,className:r(`lucide-${_(y(a))}`,`lucide-${a}`,c),...s}));return o.displayName=y(a),o};const x=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],k1=e("arrow-left",x);const g=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],p1=e("arrow-right",g);const w=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],l1=e("arrow-up",w);const $=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],_1=e("book-open",$);const N=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],M1=e("check",N);const f=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],m1=e("chevron-down",f);const z=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],v1=e("chevron-left",z);const q=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],u1=e("chevron-right",q);const C=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],x1=e("circle-check",C);const j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],g1=e("circle-question-mark",j);const b=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],w1=e("cloud",b);const A=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],$1=e("copy",A);const H=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],N1=e("download",H);const L=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],f1=e("external-link",L);const R=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],z1=e("file-text",R);const V=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],q1=e("github",V);const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],C1=e("globe",E);const P=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],j1=e("history",P);const Z=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],b1=e("layout-dashboard",Z);const S=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],A1=e("link-2",S);const U=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],H1=e("loader-circle",U);const B=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],L1=e("maximize-2",B);const D=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],R1=e("menu",D);const T=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],V1=e("minimize-2",T);const G=[["path",{d:"M5 12h14",key:"1ays0h"}]],E1=e("minus",G);const I=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],P1=e("panel-left-close",I);const W=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Z1=e("panel-left-open",W);const F=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],S1=e("play",F);const O=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],U1=e("plus",O);const J=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],B1=e("radar",J);const K=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],D1=e("radio",K);const Q=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],T1=e("refresh-cw",Q);const X=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],G1=e("rocket",X);const Y=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],I1=e("rotate-ccw",Y);const e1=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],W1=e("scan-search",e1);const t1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],F1=e("search",t1);const a1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],O1=e("settings-2",a1);const o1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],J1=e("settings",o1);const c1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],K1=e("trash-2",c1);const h1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Q1=e("triangle-alert",h1);const n1=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],X1=e("triangle",n1);const s1=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],Y1=e("unplug",s1);const d1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],ee=e("upload",d1);const y1=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],te=e("wrench",y1);const r1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ae=e("x",r1);export{p1 as A,_1 as B,m1 as C,N1 as D,f1 as E,z1 as F,C1 as G,j1 as H,W1 as I,O1 as J,H1 as L,V1 as M,S1 as P,D1 as R,F1 as S,Q1 as T,Y1 as U,te as W,ae as X,I1 as a,L1 as b,l1 as c,M1 as d,u1 as e,$1 as f,b1 as g,B1 as h,A1 as i,J1 as j,G1 as k,q1 as l,Z1 as m,P1 as n,R1 as o,U1 as p,T1 as q,ee as r,x1 as s,g1 as t,E1 as u,K1 as v,w1 as w,X1 as x,k1 as y,v1 as z};