@reddb-io/ui 0.1.1 → 0.3.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 (60) hide show
  1. package/build/_app/immutable/assets/0.DQDLkSdR.css +1 -0
  2. package/build/_app/immutable/assets/Workspace.CvP5De7i.css +1 -0
  3. package/build/_app/immutable/chunks/65XjEwaF.js +367 -0
  4. package/build/_app/immutable/chunks/BjFADNkA.js +992 -0
  5. package/build/_app/immutable/chunks/{ALqaDrNQ.js → C278awGv.js} +1 -1
  6. package/build/_app/immutable/chunks/{Ov8N-vxt.js → C9rXzYLu.js} +1 -1
  7. package/build/_app/immutable/chunks/CDKIdLnm.js +187 -0
  8. package/build/_app/immutable/chunks/{DXY_Rxa7.js → CXNPJgv1.js} +7 -7
  9. package/build/_app/immutable/chunks/{Bgso8cDH.js → DqvWKbSc.js} +1 -1
  10. package/build/_app/immutable/chunks/pDJnDxXM.js +1 -0
  11. package/build/_app/immutable/entry/app.DdaMXHAv.js +2 -0
  12. package/build/_app/immutable/entry/start.-MLBtQXB.js +1 -0
  13. package/build/_app/immutable/nodes/{0.CHPiFxDo.js → 0.Ysoz3Y3h.js} +1 -1
  14. package/build/_app/immutable/nodes/{1.BC_4YZ0h.js → 1.C2jbGTOJ.js} +1 -1
  15. package/build/_app/immutable/nodes/11.CAG5_cGP.js +1 -0
  16. package/build/_app/immutable/nodes/{10.B7DMKSNc.js → 12.DQG5zpEx.js} +5 -5
  17. package/build/_app/immutable/nodes/7.CAG5_cGP.js +1 -0
  18. package/build/_app/immutable/nodes/{7.BZX9Iird.js → 8.CrHI4F9p.js} +1 -1
  19. package/build/_app/version.json +1 -1
  20. package/build/index.html +12 -12
  21. package/dist/embed/{RedUiEmbedRoot-BGoLxJf1.js → RedUiEmbedRoot-BwFUA5X-.js} +12715 -10653
  22. package/dist/embed/RedUiEmbedRoot-BwFUA5X-.js.map +1 -0
  23. package/dist/embed/index-DGhgtnaK.js +577 -0
  24. package/dist/embed/{index-B6ZQhCsu.js.map → index-DGhgtnaK.js.map} +1 -1
  25. package/dist/embed/{index-fad77a13.esm-BqPj0saH.js → index-fad77a13.esm-BMULHdcE.js} +22 -20
  26. package/dist/embed/{index-fad77a13.esm-BqPj0saH.js.map → index-fad77a13.esm-BMULHdcE.js.map} +1 -1
  27. package/dist/embed/index.js +1 -1
  28. package/dist/embed/sigma-edge-curve.esm-CAT5Xrom.js +536 -0
  29. package/dist/embed/sigma-edge-curve.esm-CAT5Xrom.js.map +1 -0
  30. package/dist/embed/{sigma-node-border.esm-CGtlgqmo.js → sigma-node-border.esm-Bnk4BRbw.js} +32 -32
  31. package/dist/embed/{sigma-node-border.esm-CGtlgqmo.js.map → sigma-node-border.esm-Bnk4BRbw.js.map} +1 -1
  32. package/dist/embed/{sigma.esm-y0qgY-OC.js → sigma.esm-D5yoExsH.js} +3 -3
  33. package/dist/embed/{sigma.esm-y0qgY-OC.js.map → sigma.esm-D5yoExsH.js.map} +1 -1
  34. package/package.json +5 -3
  35. package/src/lib/Appearance.svelte +90 -0
  36. package/src/lib/CommandPalette.svelte +2 -0
  37. package/src/lib/SettingsView.svelte +376 -0
  38. package/src/lib/Topbar.svelte +15 -1
  39. package/src/lib/Workspace.svelte +14 -1
  40. package/src/lib/index.ts +2 -0
  41. package/src/lib/renderers/GraphRenderer.svelte +448 -44
  42. package/src/lib/renderers/graph-bundle.ts +401 -0
  43. package/src/lib/renderers/graph-communities.ts +193 -0
  44. package/src/lib/renderers/graph-render.ts +48 -5
  45. package/src/lib/renderers/graph-sigma.ts +274 -8
  46. package/src/lib/router.svelte.ts +84 -57
  47. package/src/lib/settings-sections.ts +267 -0
  48. package/src/lib/skins/skins.svelte.ts +64 -0
  49. package/src/lib/skins/skins.ts +178 -0
  50. package/build/_app/immutable/assets/0.C63jY5jX.css +0 -1
  51. package/build/_app/immutable/assets/Workspace.BCzG1DsH.css +0 -1
  52. package/build/_app/immutable/chunks/BMHKbvs8.js +0 -1
  53. package/build/_app/immutable/chunks/BQHbwf54.js +0 -916
  54. package/build/_app/immutable/chunks/Bmgx1mfv.js +0 -310
  55. package/build/_app/immutable/entry/app.D_IVtpdv.js +0 -2
  56. package/build/_app/immutable/entry/start.3oC0UQ_Q.js +0 -1
  57. package/dist/embed/RedUiEmbedRoot-BGoLxJf1.js.map +0 -1
  58. package/dist/embed/index-B6ZQhCsu.js +0 -577
  59. /package/build/_app/immutable/assets/{10.Dblyk0Kr.css → 12.Dblyk0Kr.css} +0 -0
  60. /package/build/_app/immutable/nodes/{8.CAG5_cGP.js → 10.CAG5_cGP.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{g as Y,e as O,d as Z,c as j,i as Q,n as Re,o as Ne,p as Me,N as Ge,a as Ie,E as Fe,h as v,f as c,j as ne,r as ge,m as ve,k as ze,_ as Ae}from"./Bgso8cDH.js";import{s as Ue,A as He,t as Be}from"./Bmgx1mfv.js";var ue=(function(s){function n(){var i;return Z(this,n),i=j(this,n),i.rawEmitter=i,i}return Y(n,s),O(n)})(Ue.EventEmitter),We=He();const Oe=Be(We);var Ze=function(n){return n},_e=function(n){return n*n},Ve=function(n){return n*(2-n)},qe=function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},Ye=function(n){return n*n*n},je=function(n){return--n*n*n+1},Xe=function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},Ke={linear:Ze,quadraticIn:_e,quadraticOut:Ve,quadraticInOut:qe,cubicIn:Ye,cubicOut:je,cubicInOut:Xe},Je={easing:"quadraticInOut",duration:150};function N(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function ee(s,n,i){return s[0]=n,s[4]=typeof i=="number"?i:n,s}function fe(s,n){var i=Math.sin(n),e=Math.cos(n);return s[0]=e,s[1]=i,s[3]=-i,s[4]=e,s}function me(s,n,i){return s[6]=n,s[7]=i,s}function W(s,n){var i=s[0],e=s[1],t=s[2],a=s[3],r=s[4],o=s[5],h=s[6],d=s[7],l=s[8],u=n[0],g=n[1],f=n[2],m=n[3],p=n[4],y=n[5],E=n[6],b=n[7],x=n[8];return s[0]=u*i+g*a+f*h,s[1]=u*e+g*r+f*d,s[2]=u*t+g*o+f*l,s[3]=m*i+p*a+y*h,s[4]=m*e+p*r+y*d,s[5]=m*t+p*o+y*l,s[6]=E*i+b*a+x*h,s[7]=E*e+b*r+x*d,s[8]=E*t+b*o+x*l,s}function de(s,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,e=s[0],t=s[1],a=s[3],r=s[4],o=s[6],h=s[7],d=n.x,l=n.y;return{x:d*e+l*a+o*i,y:d*t+l*r+h*i}}function Qe(s,n){var i=s.height/s.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 X(s,n,i,e,t){var a=s.angle,r=s.ratio,o=s.x,h=s.y,d=n.width,l=n.height,u=N(),g=Math.min(d,l)-2*e,f=Qe(n,i);return t?(W(u,me(N(),o,h)),W(u,ee(N(),r)),W(u,fe(N(),a)),W(u,ee(N(),d/g/2/f,l/g/2/f))):(W(u,ee(N(),2*(g/d)*f,2*(g/l)*f)),W(u,fe(N(),-a)),W(u,ee(N(),1/r)),W(u,me(N(),-o,-h))),u}function $e(s,n,i){var e=de(s,{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 et(s){if(!s.order)return{x:[0,1],y:[0,1]};var n=1/0,i=-1/0,e=1/0,t=-1/0;return s.forEachNode(function(a,r){var o=r.x,h=r.y;o<n&&(n=o),o>i&&(i=o),h<e&&(e=h),h>t&&(t=h)}),{x:[n,i],y:[e,t]}}function tt(s){if(!Oe(s))throw new Error("Sigma: invalid graph instance.");s.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 it(s,n,i){var e=document.createElement(s);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 pe(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function ye(s,n,i){return i.sort(function(e,t){var a=n(e)||0,r=n(t)||0;return a<r?-1:a>r?1:0})}function be(s){var n=Q(s.x,2),i=n[0],e=n[1],t=Q(s.y,2),a=t[0],r=t[1],o=Math.max(e-i,r-a),h=(e+i)/2,d=(r+a)/2;(o===0||Math.abs(o)===1/0||isNaN(o))&&(o=1),isNaN(h)&&(h=0),isNaN(d)&&(d=0);var l=function(g){return{x:.5+(g.x-h)/o,y:.5+(g.y-d)/o}};return l.applyTo=function(u){u.x=.5+(u.x-h)/o,u.y=.5+(u.y-d)/o},l.inverse=function(u){return{x:h+o*(u.x-.5),y:d+o*(u.y-.5)}},l.ratio=o,l}function le(s){"@babel/helpers - typeof";return le=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},le(s)}function xe(s,n){var i=n.size;if(i!==0){var e=s.length;s.length+=i;var t=0;n.forEach(function(a){s[e+t]=a,t++})}}function se(s){s=s||{};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(s,e)}return s}var ce={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:Me,defaultDrawNodeLabel:Ne,defaultDrawNodeHover:Re,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:{}},at={circle:Ge},rt={arrow:Fe,line:Ie};function oe(s){if(typeof s.labelDensity!="number"||s.labelDensity<0)throw new Error("Settings: invalid `labelDensity`. Expecting a positive number.");var n=s.minCameraRatio,i=s.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 nt(s){var n=se({},ce,s);return n.nodeProgramClasses=se({},at,n.nodeProgramClasses),n.edgeProgramClasses=se({},rt,n.edgeProgramClasses),n}var te=1.5,Ce=(function(s){function n(){var i;return Z(this,n),i=j(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 Y(n,s),O(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(v(v({},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]:{},r=arguments.length>2?arguments[2]:void 0;if(!r)return new Promise(function(f){return t.animate(e,a,f)});if(this.enabled){var o=v(v({},Je),a),h=this.validateState(e),d=typeof o.easing=="function"?o.easing:Ke[o.easing],l=Date.now(),u=this.getState(),g=function(){var m=(Date.now()-l)/o.duration;if(m>=1){t.nextFrame=null,t.setState(h),t.animationCallback&&(t.animationCallback.call(null),t.animationCallback=void 0);return}var p=d(m),y={};typeof h.x=="number"&&(y.x=u.x+(h.x-u.x)*p),typeof h.y=="number"&&(y.y=u.y+(h.y-u.y)*p),t.enabledRotation&&typeof h.angle=="number"&&(y.angle=u.angle+(h.angle-u.angle)*p),typeof h.ratio=="number"&&(y.ratio=u.ratio+(h.ratio-u.ratio)*p),t.setState(y),t.nextFrame=requestAnimationFrame(g)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(g)):g(),this.animationCallback=r}}},{key:"animatedZoom",value:function(e){return e?typeof e=="number"?this.animate({ratio:this.ratio/e}):this.animate({ratio:this.ratio/(e.factor||te)},e):this.animate({ratio:this.ratio/te})}},{key:"animatedUnzoom",value:function(e){return e?typeof e=="number"?this.animate({ratio:this.ratio*e}):this.animate({ratio:this.ratio*(e.factor||te)},e):this.animate({ratio:this.ratio*te})}},{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)}}])})(ue);function M(s,n){var i=n.getBoundingClientRect();return{x:s.clientX-i.left,y:s.clientY-i.top}}function F(s,n){var i=v(v({},M(s,n)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){i.sigmaDefaultPrevented=!0},original:s});return i}function K(s){var n="x"in s?s:v(v({},s.touches[0]||s.previousTouches[0]),{},{original:s.original,sigmaDefaultPrevented:s.sigmaDefaultPrevented,preventSigmaDefault:function(){s.sigmaDefaultPrevented=!0,n.sigmaDefaultPrevented=!0}});return n}function st(s,n){return v(v({},F(s,n)),{},{delta:Te(s)})}var ot=2;function ie(s){for(var n=[],i=0,e=Math.min(s.length,ot);i<e;i++)n.push(s[i]);return n}function J(s,n,i){var e={touches:ie(s.touches).map(function(t){return M(t,i)}),previousTouches:n.map(function(t){return M(t,i)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0},original:s};return e}function Te(s){if(typeof s.deltaY<"u")return s.deltaY*-3/360;if(typeof s.detail<"u")return s.detail/-9;throw new Error("Captor: could not extract delta from event.")}var De=(function(s){function n(i,e){var t;return Z(this,n),t=j(this,n),t.container=i,t.renderer=e,t}return Y(n,s),O(n)})(ue),ht=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],dt=ht.reduce(function(s,n){return v(v({},s),{},c({},n,ce[n]))},{}),lt=(function(s){function n(i,e){var t;return Z(this,n),t=j(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",dt),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 Y(n,s),O(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",F(e,this.container))}}},{key:"handleRightClick",value:function(e){this.enabled&&this.emit("rightClick",F(e,this.container))}},{key:"handleDoubleClick",value:function(e){if(this.enabled){e.preventDefault(),e.stopPropagation();var t=F(e,this.container);if(this.emit("doubleClick",t),!t.sigmaDefaultPrevented){var a=this.renderer.getCamera(),r=a.getBoundedRatio(a.getState().ratio/this.settings.doubleClickZoomingRatio);a.animate(this.renderer.getViewportZoomedState(M(e,this.container),r),{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=M(e,this.container),a=t.x,r=t.y;this.lastMouseX=a,this.lastMouseY=r,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",F(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 r=M(e,this.container),o=r.x,h=r.y,d=a.getState(),l=a.getPreviousState()||{x:0,y:0};this.isMoving?a.animate({x:d.x+this.settings.inertiaRatio*(d.x-l.x),y:d.y+this.settings.inertiaRatio*(d.y-l.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):(this.lastMouseX!==o||this.lastMouseY!==h)&&a.setState({x:d.x,y:d.y}),this.isMoving=!1,setTimeout(function(){var u=t.draggedEvents>0;t.draggedEvents=0,u&&t.renderer.getSetting("hideEdgesOnMove")&&t.renderer.refresh()},0),this.emit("mouseup",F(e,this.container))}}},{key:"handleMove",value:function(e){var t=this;if(this.enabled){var a=F(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 r=this.renderer.getCamera(),o=M(e,this.container),h=o.x,d=o.y,l=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),u=this.renderer.viewportToFramedGraph({x:h,y:d}),g=l.x-u.x,f=l.y-u.y,m=r.getState(),p=m.x+g,y=m.y+f;r.setState({x:p,y}),this.lastMouseX=h,this.lastMouseY=d,e.preventDefault(),e.stopPropagation()}}}},{key:"handleLeave",value:function(e){this.emit("mouseleave",F(e,this.container))}},{key:"handleEnter",value:function(e){this.emit("mouseenter",F(e,this.container))}},{key:"handleWheel",value:function(e){var t=this,a=this.renderer.getCamera();if(!(!this.enabled||!a.enabledZooming)){var r=Te(e);if(r){var o=st(e,this.container);if(this.emit("wheel",o),o.sigmaDefaultPrevented){e.preventDefault(),e.stopPropagation();return}var h=a.getState().ratio,d=r>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,l=a.getBoundedRatio(h*d),u=r>0?1:-1,g=Date.now();h!==l&&(e.preventDefault(),e.stopPropagation(),!(this.currentWheelDirection===u&&this.lastWheelTriggerTime&&g-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(a.animate(this.renderer.getViewportZoomedState(M(e,this.container),l),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){t.currentWheelDirection=0}),this.currentWheelDirection=u,this.lastWheelTriggerTime=g))}}}},{key:"setSettings",value:function(e){this.settings=e}}])})(De),ut=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],ct=ut.reduce(function(s,n){return v(v({},s),{},c({},n,ce[n]))},{}),gt=(function(s){function n(i,e){var t;return Z(this,n),t=j(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",ct),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 Y(n,s),O(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=ie(e.touches);if(this.touchMode=a.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=a.map(function(f){return M(f,t.container)}),this.touchMode===2){var r=Q(this.startTouchesPositions,2),o=r[0],h=o.x,d=o.y,l=r[1],u=l.x,g=l.y;this.startTouchesAngle=Math.atan2(g-d,u-h),this.startTouchesDistance=Math.sqrt(Math.pow(u-h,2)+Math.pow(g-d,2))}this.emit("touchdown",J(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(),r=t.getPreviousState()||{x:0,y:0};t.animate({x:a.x+this.settings.inertiaRatio*(a.x-r.x),y:a.y+this.settings.inertiaRatio*(a.y-r.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",J(e,this.lastTouches,this.container)),!e.touches.length){var o=M(this.lastTouches[0],this.container),h=this.startTouchesPositions[0],d=Math.pow(o.x-h.x,2)+Math.pow(o.y-h.y,2);if(!e.touches.length&&d<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var l=J(e,this.lastTouches,this.container);if(this.emit("doubletap",l),this.lastTap=null,!l.sigmaDefaultPrevented){var u=this.renderer.getCamera(),g=u.getBoundedRatio(u.getState().ratio/this.settings.doubleClickZoomingRatio);u.animate(this.renderer.getViewportZoomedState(o,g),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var f=J(e,this.lastTouches,this.container);this.emit("tap",f),this.lastTap={time:Date.now(),position:f.touches[0]||f.previousTouches[0]}}}this.lastTouches=ie(e.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(e){var t=this;if(!(!this.enabled||!this.startTouchesPositions.length)){e.preventDefault();var a=ie(e.touches),r=a.map(function(B){return M(B,t.container)}),o=this.lastTouches;this.lastTouches=a,this.lastTouchesPositions=r;var h=J(e,o,this.container);if(this.emit("touchmove",h),!h.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=r.some(function(B,ae){var G=t.startTouchesPositions[ae];return G&&(B.x!==G.x||B.y!==G.y)})),!!this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){t.isMoving=!1},this.settings.dragTimeout);var d=this.renderer.getCamera(),l=this.startCameraState,u=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var g=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),f=g.x,m=g.y,p=this.renderer.viewportToFramedGraph(r[0]),y=p.x,E=p.y;d.setState({x:l.x+f-y,y:l.y+m-E});break}case 2:{var b={x:.5,y:.5,angle:0,ratio:1},x=r[0],C=x.x,I=x.y,A=r[1],w=A.x,k=A.y,T=Math.atan2(k-I,w-C)-this.startTouchesAngle,L=Math.hypot(k-I,w-C)/this.startTouchesDistance,D=d.getBoundedRatio(l.ratio/L);b.ratio=D,b.angle=l.angle+T;var S=this.getDimensions(),_=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:l}),P=Math.min(S.width,S.height)-2*u,R=P/S.width,U=P/S.height,$=D/P,q=C-P/2/R,V=I-P/2/U,H=[q*Math.cos(-b.angle)-V*Math.sin(-b.angle),V*Math.cos(-b.angle)+q*Math.sin(-b.angle)];q=H[0],V=H[1],b.x=_.x-q*$,b.y=_.y+V*$,d.setState(b);break}}}}}},{key:"setSettings",value:function(e){this.settings=e}}])})(De);function vt(s){if(Array.isArray(s))return Ae(s)}function ft(s){if(typeof Symbol<"u"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function mt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{h as Y,f as O,e as Z,d as j,j as Q,o as Re,p as Ne,q as Me,N as Ge,b as Ie,E as Fe,i as v,g as c,k as ne,s as ge,n as ve,l as ze,_ as Ae}from"./DqvWKbSc.js";import{s as Ue,A as He,t as Be}from"./65XjEwaF.js";var ue=(function(s){function n(){var i;return Z(this,n),i=j(this,n),i.rawEmitter=i,i}return Y(n,s),O(n)})(Ue.EventEmitter),We=He();const Oe=Be(We);var Ze=function(n){return n},_e=function(n){return n*n},Ve=function(n){return n*(2-n)},qe=function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},Ye=function(n){return n*n*n},je=function(n){return--n*n*n+1},Xe=function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},Ke={linear:Ze,quadraticIn:_e,quadraticOut:Ve,quadraticInOut:qe,cubicIn:Ye,cubicOut:je,cubicInOut:Xe},Je={easing:"quadraticInOut",duration:150};function N(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function ee(s,n,i){return s[0]=n,s[4]=typeof i=="number"?i:n,s}function fe(s,n){var i=Math.sin(n),e=Math.cos(n);return s[0]=e,s[1]=i,s[3]=-i,s[4]=e,s}function me(s,n,i){return s[6]=n,s[7]=i,s}function W(s,n){var i=s[0],e=s[1],t=s[2],a=s[3],r=s[4],o=s[5],h=s[6],d=s[7],l=s[8],u=n[0],g=n[1],f=n[2],m=n[3],p=n[4],y=n[5],E=n[6],b=n[7],x=n[8];return s[0]=u*i+g*a+f*h,s[1]=u*e+g*r+f*d,s[2]=u*t+g*o+f*l,s[3]=m*i+p*a+y*h,s[4]=m*e+p*r+y*d,s[5]=m*t+p*o+y*l,s[6]=E*i+b*a+x*h,s[7]=E*e+b*r+x*d,s[8]=E*t+b*o+x*l,s}function de(s,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,e=s[0],t=s[1],a=s[3],r=s[4],o=s[6],h=s[7],d=n.x,l=n.y;return{x:d*e+l*a+o*i,y:d*t+l*r+h*i}}function Qe(s,n){var i=s.height/s.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 X(s,n,i,e,t){var a=s.angle,r=s.ratio,o=s.x,h=s.y,d=n.width,l=n.height,u=N(),g=Math.min(d,l)-2*e,f=Qe(n,i);return t?(W(u,me(N(),o,h)),W(u,ee(N(),r)),W(u,fe(N(),a)),W(u,ee(N(),d/g/2/f,l/g/2/f))):(W(u,ee(N(),2*(g/d)*f,2*(g/l)*f)),W(u,fe(N(),-a)),W(u,ee(N(),1/r)),W(u,me(N(),-o,-h))),u}function $e(s,n,i){var e=de(s,{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 et(s){if(!s.order)return{x:[0,1],y:[0,1]};var n=1/0,i=-1/0,e=1/0,t=-1/0;return s.forEachNode(function(a,r){var o=r.x,h=r.y;o<n&&(n=o),o>i&&(i=o),h<e&&(e=h),h>t&&(t=h)}),{x:[n,i],y:[e,t]}}function tt(s){if(!Oe(s))throw new Error("Sigma: invalid graph instance.");s.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 it(s,n,i){var e=document.createElement(s);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 pe(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function ye(s,n,i){return i.sort(function(e,t){var a=n(e)||0,r=n(t)||0;return a<r?-1:a>r?1:0})}function be(s){var n=Q(s.x,2),i=n[0],e=n[1],t=Q(s.y,2),a=t[0],r=t[1],o=Math.max(e-i,r-a),h=(e+i)/2,d=(r+a)/2;(o===0||Math.abs(o)===1/0||isNaN(o))&&(o=1),isNaN(h)&&(h=0),isNaN(d)&&(d=0);var l=function(g){return{x:.5+(g.x-h)/o,y:.5+(g.y-d)/o}};return l.applyTo=function(u){u.x=.5+(u.x-h)/o,u.y=.5+(u.y-d)/o},l.inverse=function(u){return{x:h+o*(u.x-.5),y:d+o*(u.y-.5)}},l.ratio=o,l}function le(s){"@babel/helpers - typeof";return le=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},le(s)}function xe(s,n){var i=n.size;if(i!==0){var e=s.length;s.length+=i;var t=0;n.forEach(function(a){s[e+t]=a,t++})}}function se(s){s=s||{};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(s,e)}return s}var ce={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:Me,defaultDrawNodeLabel:Ne,defaultDrawNodeHover:Re,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:{}},at={circle:Ge},rt={arrow:Fe,line:Ie};function oe(s){if(typeof s.labelDensity!="number"||s.labelDensity<0)throw new Error("Settings: invalid `labelDensity`. Expecting a positive number.");var n=s.minCameraRatio,i=s.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 nt(s){var n=se({},ce,s);return n.nodeProgramClasses=se({},at,n.nodeProgramClasses),n.edgeProgramClasses=se({},rt,n.edgeProgramClasses),n}var te=1.5,Ce=(function(s){function n(){var i;return Z(this,n),i=j(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 Y(n,s),O(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(v(v({},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]:{},r=arguments.length>2?arguments[2]:void 0;if(!r)return new Promise(function(f){return t.animate(e,a,f)});if(this.enabled){var o=v(v({},Je),a),h=this.validateState(e),d=typeof o.easing=="function"?o.easing:Ke[o.easing],l=Date.now(),u=this.getState(),g=function(){var m=(Date.now()-l)/o.duration;if(m>=1){t.nextFrame=null,t.setState(h),t.animationCallback&&(t.animationCallback.call(null),t.animationCallback=void 0);return}var p=d(m),y={};typeof h.x=="number"&&(y.x=u.x+(h.x-u.x)*p),typeof h.y=="number"&&(y.y=u.y+(h.y-u.y)*p),t.enabledRotation&&typeof h.angle=="number"&&(y.angle=u.angle+(h.angle-u.angle)*p),typeof h.ratio=="number"&&(y.ratio=u.ratio+(h.ratio-u.ratio)*p),t.setState(y),t.nextFrame=requestAnimationFrame(g)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(g)):g(),this.animationCallback=r}}},{key:"animatedZoom",value:function(e){return e?typeof e=="number"?this.animate({ratio:this.ratio/e}):this.animate({ratio:this.ratio/(e.factor||te)},e):this.animate({ratio:this.ratio/te})}},{key:"animatedUnzoom",value:function(e){return e?typeof e=="number"?this.animate({ratio:this.ratio*e}):this.animate({ratio:this.ratio*(e.factor||te)},e):this.animate({ratio:this.ratio*te})}},{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)}}])})(ue);function M(s,n){var i=n.getBoundingClientRect();return{x:s.clientX-i.left,y:s.clientY-i.top}}function F(s,n){var i=v(v({},M(s,n)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){i.sigmaDefaultPrevented=!0},original:s});return i}function K(s){var n="x"in s?s:v(v({},s.touches[0]||s.previousTouches[0]),{},{original:s.original,sigmaDefaultPrevented:s.sigmaDefaultPrevented,preventSigmaDefault:function(){s.sigmaDefaultPrevented=!0,n.sigmaDefaultPrevented=!0}});return n}function st(s,n){return v(v({},F(s,n)),{},{delta:Te(s)})}var ot=2;function ie(s){for(var n=[],i=0,e=Math.min(s.length,ot);i<e;i++)n.push(s[i]);return n}function J(s,n,i){var e={touches:ie(s.touches).map(function(t){return M(t,i)}),previousTouches:n.map(function(t){return M(t,i)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0},original:s};return e}function Te(s){if(typeof s.deltaY<"u")return s.deltaY*-3/360;if(typeof s.detail<"u")return s.detail/-9;throw new Error("Captor: could not extract delta from event.")}var De=(function(s){function n(i,e){var t;return Z(this,n),t=j(this,n),t.container=i,t.renderer=e,t}return Y(n,s),O(n)})(ue),ht=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],dt=ht.reduce(function(s,n){return v(v({},s),{},c({},n,ce[n]))},{}),lt=(function(s){function n(i,e){var t;return Z(this,n),t=j(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",dt),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 Y(n,s),O(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",F(e,this.container))}}},{key:"handleRightClick",value:function(e){this.enabled&&this.emit("rightClick",F(e,this.container))}},{key:"handleDoubleClick",value:function(e){if(this.enabled){e.preventDefault(),e.stopPropagation();var t=F(e,this.container);if(this.emit("doubleClick",t),!t.sigmaDefaultPrevented){var a=this.renderer.getCamera(),r=a.getBoundedRatio(a.getState().ratio/this.settings.doubleClickZoomingRatio);a.animate(this.renderer.getViewportZoomedState(M(e,this.container),r),{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=M(e,this.container),a=t.x,r=t.y;this.lastMouseX=a,this.lastMouseY=r,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",F(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 r=M(e,this.container),o=r.x,h=r.y,d=a.getState(),l=a.getPreviousState()||{x:0,y:0};this.isMoving?a.animate({x:d.x+this.settings.inertiaRatio*(d.x-l.x),y:d.y+this.settings.inertiaRatio*(d.y-l.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):(this.lastMouseX!==o||this.lastMouseY!==h)&&a.setState({x:d.x,y:d.y}),this.isMoving=!1,setTimeout(function(){var u=t.draggedEvents>0;t.draggedEvents=0,u&&t.renderer.getSetting("hideEdgesOnMove")&&t.renderer.refresh()},0),this.emit("mouseup",F(e,this.container))}}},{key:"handleMove",value:function(e){var t=this;if(this.enabled){var a=F(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 r=this.renderer.getCamera(),o=M(e,this.container),h=o.x,d=o.y,l=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),u=this.renderer.viewportToFramedGraph({x:h,y:d}),g=l.x-u.x,f=l.y-u.y,m=r.getState(),p=m.x+g,y=m.y+f;r.setState({x:p,y}),this.lastMouseX=h,this.lastMouseY=d,e.preventDefault(),e.stopPropagation()}}}},{key:"handleLeave",value:function(e){this.emit("mouseleave",F(e,this.container))}},{key:"handleEnter",value:function(e){this.emit("mouseenter",F(e,this.container))}},{key:"handleWheel",value:function(e){var t=this,a=this.renderer.getCamera();if(!(!this.enabled||!a.enabledZooming)){var r=Te(e);if(r){var o=st(e,this.container);if(this.emit("wheel",o),o.sigmaDefaultPrevented){e.preventDefault(),e.stopPropagation();return}var h=a.getState().ratio,d=r>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,l=a.getBoundedRatio(h*d),u=r>0?1:-1,g=Date.now();h!==l&&(e.preventDefault(),e.stopPropagation(),!(this.currentWheelDirection===u&&this.lastWheelTriggerTime&&g-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(a.animate(this.renderer.getViewportZoomedState(M(e,this.container),l),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){t.currentWheelDirection=0}),this.currentWheelDirection=u,this.lastWheelTriggerTime=g))}}}},{key:"setSettings",value:function(e){this.settings=e}}])})(De),ut=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],ct=ut.reduce(function(s,n){return v(v({},s),{},c({},n,ce[n]))},{}),gt=(function(s){function n(i,e){var t;return Z(this,n),t=j(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",ct),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 Y(n,s),O(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=ie(e.touches);if(this.touchMode=a.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=a.map(function(f){return M(f,t.container)}),this.touchMode===2){var r=Q(this.startTouchesPositions,2),o=r[0],h=o.x,d=o.y,l=r[1],u=l.x,g=l.y;this.startTouchesAngle=Math.atan2(g-d,u-h),this.startTouchesDistance=Math.sqrt(Math.pow(u-h,2)+Math.pow(g-d,2))}this.emit("touchdown",J(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(),r=t.getPreviousState()||{x:0,y:0};t.animate({x:a.x+this.settings.inertiaRatio*(a.x-r.x),y:a.y+this.settings.inertiaRatio*(a.y-r.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",J(e,this.lastTouches,this.container)),!e.touches.length){var o=M(this.lastTouches[0],this.container),h=this.startTouchesPositions[0],d=Math.pow(o.x-h.x,2)+Math.pow(o.y-h.y,2);if(!e.touches.length&&d<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var l=J(e,this.lastTouches,this.container);if(this.emit("doubletap",l),this.lastTap=null,!l.sigmaDefaultPrevented){var u=this.renderer.getCamera(),g=u.getBoundedRatio(u.getState().ratio/this.settings.doubleClickZoomingRatio);u.animate(this.renderer.getViewportZoomedState(o,g),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var f=J(e,this.lastTouches,this.container);this.emit("tap",f),this.lastTap={time:Date.now(),position:f.touches[0]||f.previousTouches[0]}}}this.lastTouches=ie(e.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(e){var t=this;if(!(!this.enabled||!this.startTouchesPositions.length)){e.preventDefault();var a=ie(e.touches),r=a.map(function(B){return M(B,t.container)}),o=this.lastTouches;this.lastTouches=a,this.lastTouchesPositions=r;var h=J(e,o,this.container);if(this.emit("touchmove",h),!h.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=r.some(function(B,ae){var G=t.startTouchesPositions[ae];return G&&(B.x!==G.x||B.y!==G.y)})),!!this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){t.isMoving=!1},this.settings.dragTimeout);var d=this.renderer.getCamera(),l=this.startCameraState,u=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var g=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),f=g.x,m=g.y,p=this.renderer.viewportToFramedGraph(r[0]),y=p.x,E=p.y;d.setState({x:l.x+f-y,y:l.y+m-E});break}case 2:{var b={x:.5,y:.5,angle:0,ratio:1},x=r[0],C=x.x,I=x.y,A=r[1],w=A.x,k=A.y,T=Math.atan2(k-I,w-C)-this.startTouchesAngle,L=Math.hypot(k-I,w-C)/this.startTouchesDistance,D=d.getBoundedRatio(l.ratio/L);b.ratio=D,b.angle=l.angle+T;var S=this.getDimensions(),_=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:l}),P=Math.min(S.width,S.height)-2*u,R=P/S.width,U=P/S.height,$=D/P,q=C-P/2/R,V=I-P/2/U,H=[q*Math.cos(-b.angle)-V*Math.sin(-b.angle),V*Math.cos(-b.angle)+q*Math.sin(-b.angle)];q=H[0],V=H[1],b.x=_.x-q*$,b.y=_.y+V*$,d.setState(b);break}}}}}},{key:"setSettings",value:function(e){this.settings=e}}])})(De);function vt(s){if(Array.isArray(s))return Ae(s)}function ft(s){if(typeof Symbol<"u"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function mt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ee(s){return vt(s)||ft(s)||ze(s)||mt()}function pt(s,n){if(s==null)return{};var i={};for(var e in s)if({}.hasOwnProperty.call(s,e)){if(n.indexOf(e)!==-1)continue;i[e]=s[e]}return i}function he(s,n){if(s==null)return{};var i,e,t=pt(s,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(s);for(e=0;e<a.length;e++)i=a[e],n.indexOf(i)===-1&&{}.propertyIsEnumerable.call(s,i)&&(t[i]=s[i])}return t}var we=(function(){function s(n,i){Z(this,s),this.key=n,this.size=i}return O(s,null,[{key:"compare",value:function(i,e){return i.size>e.size?-1:i.size<e.size||i.key>e.key?1:-1}}])})(),Le=(function(){function s(){Z(this,s),c(this,"width",0),c(this,"height",0),c(this,"cellSize",0),c(this,"columns",0),c(this,"rows",0),c(this,"cells",{})}return O(s,[{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 we(i,e),r=this.getIndex(t),o=this.cells[r];o||(o=[],this.cells[r]=o),o.push(a)}},{key:"organize",value:function(){for(var i in this.cells){var e=this.cells[i];e.sort(we.compare)}}},{key:"getLabelsToDisplay",value:function(i,e){var t=this.cellSize*this.cellSize,a=t/i/i,r=a*e/t,o=Math.ceil(r),h=[];for(var d in this.cells)for(var l=this.cells[d],u=0;u<Math.min(o,l.length);u++)h.push(l[u].key);return h}}])})();function yt(s){var n=s.graph,i=s.hoveredNode,e=s.highlightedNodes,t=s.displayedNodeLabels,a=[];return n.forEachEdge(function(r,o,h,d){(h===i||d===i||e.has(h)||e.has(d)||t.has(h)&&t.has(d))&&a.push(r)}),a}var Se=150,Pe=50,z=Object.prototype.hasOwnProperty;function bt(s,n,i){if(!z.call(i,"x")||!z.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=s.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),z.call(i,"hidden")||(i.hidden=!1),z.call(i,"highlighted")||(i.highlighted=!1),z.call(i,"forceLabel")||(i.forceLabel=!1),(!i.type||i.type==="")&&(i.type=s.defaultNodeType),i.zIndex||(i.zIndex=0),i}function xt(s,n,i){return i.color||(i.color=s.defaultEdgeColor),i.label||(i.label=""),i.size||(i.size=.5),z.call(i,"hidden")||(i.hidden=!1),z.call(i,"forceLabel")||(i.forceLabel=!1),(!i.type||i.type==="")&&(i.type=s.defaultEdgeType),i.zIndex||(i.zIndex=0),i}var Ct=(function(s){function n(i,e){var t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(Z(this,n),t=j(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 Le),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",N()),c(t,"invMatrix",N()),c(t,"correctionRatio",1),c(t,"customBBox",null),c(t,"normalizationFunction",be({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",pe()),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=nt(a),oe(t.settings),tt(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 r in t.settings.nodeProgramClasses)t.registerNodeProgram(r,t.settings.nodeProgramClasses[r],t.settings.nodeHoverProgramClasses[r]);for(var o in t.settings.edgeProgramClasses)t.registerEdgeProgram(o,t.settings.edgeProgramClasses[o]);return t.camera=new Ce,t.bindCameraHandlers(),t.mouseCaptor=new lt(t.elements.mouse,t),t.mouseCaptor.setSettings(t.settings),t.touchCaptor=new gt(t.elements.mouse,t),t.touchCaptor.setSettings(t.settings),t.bindEventHandlers(),t.bindGraphHandlers(),t.handleSettingsUpdate(),t.refresh(),t}return Y(n,s),O(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],r=he(t,[e].map(ne));a.kill(),this.nodePrograms=r}if(this.nodeHoverPrograms[e]){var o=this.nodeHoverPrograms,h=o[e],d=he(o,[e].map(ne));h.kill(),this.nodePrograms=d}return this}},{key:"unregisterEdgeProgram",value:function(e){if(this.edgePrograms[e]){var t=this.edgePrograms,a=t[e],r=he(t,[e].map(ne));a.kill(),this.edgePrograms=r}return this}},{key:"resetWebGLTexture",value:function(e){var t=this.webGLContexts[e],a=this.frameBuffers[e],r=this.textures[e];r&&t.deleteTexture(r);var o=t.createTexture();return t.bindFramebuffer(t.FRAMEBUFFER,a),t.bindTexture(t.TEXTURE_2D,o),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,o,0),this.textures[e]=o,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,r=ge(this.webGLContexts.nodes,this.frameBuffers.nodes,t,a,this.pixelRatio,this.pickingDownSizingRatio),o=ve.apply(void 0,Ee(r)),h=this.itemIDsIndex[o];return h&&h.type==="node"?h.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 r=K(a),o={event:r,preventSigmaDefault:function(){r.preventSigmaDefault()}},h=e.getNodeAtPosition(r);if(h&&e.hoveredNode!==h&&!e.nodeDataCache[h].hidden){e.hoveredNode&&e.emit("leaveNode",v(v({},o),{},{node:e.hoveredNode})),e.hoveredNode=h,e.emit("enterNode",v(v({},o),{},{node:h})),e.scheduleHighlightedNodesRender();return}if(e.hoveredNode&&e.getNodeAtPosition(r)!==e.hoveredNode){var d=e.hoveredNode;e.hoveredNode=null,e.emit("leaveNode",v(v({},o),{},{node:d})),e.scheduleHighlightedNodesRender();return}if(e.settings.enableEdgeEvents){var l=e.hoveredNode?null:e.getEdgeAtPoint(o.event.x,o.event.y);l!==e.hoveredEdge&&(e.hoveredEdge&&e.emit("leaveEdge",v(v({},o),{},{edge:e.hoveredEdge})),l&&e.emit("enterEdge",v(v({},o),{},{edge:l})),e.hoveredEdge=l)}},this.activeListeners.handleMoveBody=function(a){var r=K(a);e.emit("moveBody",{event:r,preventSigmaDefault:function(){r.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(a){var r=K(a),o={event:r,preventSigmaDefault:function(){r.preventSigmaDefault()}};e.hoveredNode&&(e.emit("leaveNode",v(v({},o),{},{node:e.hoveredNode})),e.scheduleHighlightedNodesRender()),e.settings.enableEdgeEvents&&e.hoveredEdge&&(e.emit("leaveEdge",v(v({},o),{},{edge:e.hoveredEdge})),e.scheduleHighlightedNodesRender()),e.emit("leaveStage",v({},o))},this.activeListeners.handleEnter=function(a){var r=K(a),o={event:r,preventSigmaDefault:function(){r.preventSigmaDefault()}};e.emit("enterStage",v({},o))};var t=function(r){return function(o){var h=K(o),d={event:h,preventSigmaDefault:function(){h.preventSigmaDefault()}},l=e.getNodeAtPosition(h);if(l)return e.emit("".concat(r,"Node"),v(v({},d),{},{node:l}));if(e.settings.enableEdgeEvents){var u=e.getEdgeAtPoint(h.x,h.y);if(u)return e.emit("".concat(r,"Edge"),v(v({},d),{},{edge:u}))}return e.emit("".concat(r,"Stage"),d)}};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(r){var o,h=(o=r.hints)===null||o===void 0?void 0:o.attributes;e.graph.forEachNode(function(l){return e.updateNode(l)});var d=!h||h.some(function(l){return a.has(l)});e.refresh({partialGraph:{nodes:t.nodes()},skipIndexation:!d,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(r){var o,h=(o=r.hints)===null||o===void 0?void 0:o.attributes;e.graph.forEachEdge(function(l){return e.updateEdge(l)});var d=h&&["zIndex","type"].some(function(l){return h==null?void 0:h.includes(l)});e.refresh({partialGraph:{edges:t.edges()},skipIndexation:!d,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(r){var o=r.key;e.addNode(o),e.refresh({partialGraph:{nodes:[o]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(r){var o=r.key;e.refresh({partialGraph:{nodes:[o]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(r){var o=r.key;e.removeNode(o),e.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(r){var o=r.key;e.addEdge(o),e.refresh({partialGraph:{edges:[o]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(r){var o=r.key;e.refresh({partialGraph:{edges:[o]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(r){var o=r.key;e.removeEdge(o),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=ge(this.webGLContexts.edges,this.frameBuffers.edges,e,t,this.pixelRatio,this.pickingDownSizingRatio),r=ve.apply(void 0,Ee(a)),o=this.itemIDsIndex[r];return o&&o.type==="edge"?o.id:null}},{key:"process",value:function(){var e=this;this.emit("beforeProcess");var t=this.graph,a=this.settings,r=this.getDimensions();if(this.nodeExtent=et(this.graph),!this.settings.autoRescale){var o=r.width,h=r.height,d=this.nodeExtent,l=d.x,u=d.y;this.nodeExtent={x:[(l[0]+l[1])/2-o/2,(l[0]+l[1])/2+o/2],y:[(u[0]+u[1])/2-h/2,(u[0]+u[1])/2+h/2]}}this.normalizationFunction=be(this.customBBox||this.nodeExtent);var g=new Ce,f=X(g.getState(),r,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(r,a.labelGridCellSize);for(var m={},p={},y={},E={},b=1,x=t.nodes(),C=0,I=x.length;C<I;C++){var A=x[C],w=this.nodeDataCache[A],k=t.getNodeAttributes(A);w.x=k.x,w.y=k.y,this.normalizationFunction.applyTo(w),typeof w.label=="string"&&!w.hidden&&this.labelGrid.add(A,w.size,this.framedGraphToViewport(w,{matrix:f})),m[w.type]=(m[w.type]||0)+1}this.labelGrid.organize();for(var T in this.nodePrograms){if(!z.call(this.nodePrograms,T))throw new Error('Sigma: could not find a suitable program for node type "'.concat(T,'"!'));this.nodePrograms[T].reallocate(m[T]||0),m[T]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(x=ye(this.nodeZExtent,function(re){return e.nodeDataCache[re].zIndex},x));for(var L=0,D=x.length;L<D;L++){var S=x[L];p[S]=b,E[p[S]]={type:"node",id:S},b++;var _=this.nodeDataCache[S];this.addNodeToProgram(S,p[S],m[_.type]++)}for(var P={},R=t.edges(),U=0,$=R.length;U<$;U++){var q=R[U],V=this.edgeDataCache[q];P[V.type]=(P[V.type]||0)+1}this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(R=ye(this.edgeZExtent,function(re){return e.edgeDataCache[re].zIndex},R));for(var H in this.edgePrograms){if(!z.call(this.edgePrograms,H))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(H,'"!'));this.edgePrograms[H].reallocate(P[H]||0),P[H]=0}for(var B=0,ae=R.length;B<ae;B++){var G=R[B];y[G]=b,E[y[G]]={type:"edge",id:G},b++;var ke=this.edgeDataCache[G];this.addEdgeToProgram(G,y[G],P[ke.type]++)}return this.itemIDsIndex=E,this.nodeIndices=p,this.edgeIndices=y,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(l){return t.cleanCameraState(l,a.cameraPanBoundaries&&le(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 r in a.edgeProgramClasses)a.edgeProgramClasses[r]!==e.edgeProgramClasses[r]&&this.registerEdgeProgram(r,a.edgeProgramClasses[r]);for(var o in e.edgeProgramClasses)a.edgeProgramClasses[o]||this.unregisterEdgeProgram(o)}if(e.nodeProgramClasses!==a.nodeProgramClasses||e.nodeHoverProgramClasses!==a.nodeHoverProgramClasses){for(var h in a.nodeProgramClasses)(a.nodeProgramClasses[h]!==e.nodeProgramClasses[h]||a.nodeHoverProgramClasses[h]!==e.nodeHoverProgramClasses[h])&&this.registerNodeProgram(h,a.nodeProgramClasses[h],a.nodeHoverProgramClasses[h]);for(var d in e.nodeProgramClasses)a.nodeProgramClasses[d]||this.unregisterNodeProgram(d)}}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,r=a===void 0?0:a,o=t.boundaries,h=v({},e),d=o||this.nodeExtent,l=Q(d.x,2),u=l[0],g=l[1],f=Q(d.y,2),m=f[0],p=f[1],y=[this.graphToViewport({x:u,y:m},{cameraState:e}),this.graphToViewport({x:g,y:m},{cameraState:e}),this.graphToViewport({x:u,y:p},{cameraState:e}),this.graphToViewport({x:g,y:p},{cameraState:e})],E=1/0,b=-1/0,x=1/0,C=-1/0;y.forEach(function(P){var R=P.x,U=P.y;E=Math.min(E,R),b=Math.max(b,R),x=Math.min(x,U),C=Math.max(C,U)});var I=b-E,A=C-x,w=this.getDimensions(),k=w.width,T=w.height,L=0,D=0;if(I>=k?b<k-r?L=b-(k-r):E>r&&(L=E-r):b>k+r?L=b-(k+r):E<-r&&(L=E+r),A>=T?C<T-r?D=C-(T-r):x>r&&(D=x-r):C>T+r?D=C-(T+r):x<-r&&(D=x+r),L||D){var S=this.viewportToFramedGraph({x:0,y:0},{cameraState:e}),_=this.viewportToFramedGraph({x:L,y:D},{cameraState:e});L=_.x-S.x,D=_.y-S.y,h.x+=L,h.y+=D}return h}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var e=this.camera.getState(),t=this.labelGrid.getLabelsToDisplay(e.ratio,this.settings.labelDensity);xe(t,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var a=this.canvasContexts.labels,r=0,o=t.length;r<o;r++){var h=t[r],d=this.nodeDataCache[h];if(!this.displayedNodeLabels.has(h)&&!d.hidden){var l=this.framedGraphToViewport(d),u=l.x,g=l.y,f=this.scaleSize(d.size);if(!(!d.forceLabel&&f<this.settings.labelRenderedSizeThreshold)&&!(u<-Se||u>this.width+Se||g<-Pe||g>this.height+Pe)){this.displayedNodeLabels.add(h);var m=this.settings.defaultDrawNodeLabel,p=this.nodePrograms[d.type],y=(p==null?void 0:p.drawLabel)||m;y(a,v(v({key:h},d),{},{size:f,x:u,y:g}),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=yt({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});xe(t,this.edgesWithForcedLabels);for(var a=new Set,r=0,o=t.length;r<o;r++){var h=t[r],d=this.graph.extremities(h),l=this.nodeDataCache[d[0]],u=this.nodeDataCache[d[1]],g=this.edgeDataCache[h];if(!a.has(h)&&!(g.hidden||l.hidden||u.hidden)){var f=this.settings.defaultDrawEdgeLabel,m=this.edgePrograms[g.type],p=(m==null?void 0:m.drawLabel)||f;p(e,v(v({key:h},g),{},{size:this.scaleSize(g.size)}),v(v(v({key:d[0]},l),this.framedGraphToViewport(l)),{},{size:this.scaleSize(l.size)}),v(v(v({key:d[1]},u),this.framedGraphToViewport(u)),{},{size:this.scaleSize(u.size)}),this.settings),a.add(h)}}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(f){var m=e.nodeDataCache[f],p=e.framedGraphToViewport(m),y=p.x,E=p.y,b=e.scaleSize(m.size),x=e.settings.defaultDrawNodeHover,C=e.nodePrograms[m.type],I=(C==null?void 0:C.drawHover)||x;I(t,v(v({key:f},m),{},{size:b,x:y,y:E}),e.settings)},r=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&r.push(this.hoveredNode),this.highlightedNodes.forEach(function(g){g!==e.hoveredNode&&r.push(g)}),r.forEach(function(g){return a(g)});var o={};r.forEach(function(g){var f=e.nodeDataCache[g].type;o[f]=(o[f]||0)+1});for(var h in this.nodeHoverPrograms)this.nodeHoverPrograms[h].reallocate(o[h]||0),o[h]=0;r.forEach(function(g){var f=e.nodeDataCache[g];e.nodeHoverPrograms[f.type].process(0,o[f.type]++,f)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var d=this.getRenderParams();for(var l in this.nodeHoverPrograms){var u=this.nodeHoverPrograms[l];u.render(d)}}},{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(y){return e.resetWebGLTexture(y)}),!this.graph.order)return t();var a=this.mouseCaptor,r=this.camera.isAnimated()||a.isMoving||a.draggedEvents||a.currentWheelDirection,o=this.camera.getState(),h=this.getDimensions(),d=this.getGraphDimensions(),l=this.getStagePadding();this.matrix=X(o,h,d,l),this.invMatrix=X(o,h,d,l,!0),this.correctionRatio=$e(this.matrix,o,h),this.graphToViewportRatio=this.getGraphToViewportRatio();var u=this.getRenderParams();for(var g in this.nodePrograms){var f=this.nodePrograms[g];f.render(u)}if(!this.settings.hideEdgesOnMove||!r)for(var m in this.edgePrograms){var p=this.edgePrograms[m];p.render(u)}return this.settings.hideLabelsOnMove&&r||(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=bt(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=xt(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 Le,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 r=this.nodeDataCache[e],o=this.nodePrograms[r.type];if(!o)throw new Error('Sigma: could not find a suitable program for node type "'.concat(r.type,'"!'));o.process(t,a,r),this.nodeProgramIndex[e]=a}},{key:"addEdgeToProgram",value:function(e,t,a){var r=this.edgeDataCache[e],o=this.edgePrograms[r.type];if(!o)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(r.type,'"!'));var h=this.graph.extremities(e),d=this.nodeDataCache[h[0]],l=this.nodeDataCache[h[1]];o.process(t,a,d,l,r),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 r=it(t,{position:"absolute"},{class:"sigma-".concat(e)});return a.style&&Object.assign(r.style,a.style),this.elements[e]=r,"beforeLayer"in a&&a.beforeLayer?this.elements[a.beforeLayer].before(r):"afterLayer"in a&&a.afterLayer?this.elements[a.afterLayer].after(r):this.container.appendChild(r),r}},{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),r={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[e]=a.getContext("2d",r),this}},{key:"createWebGLContext",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=(t==null?void 0:t.canvas)||this.createCanvas(e,t);t.hidden&&a.remove();var r=v({preserveDrawingBuffer:!1,antialias:!1},t),o;o=a.getContext("webgl2",r),o||(o=a.getContext("webgl",r)),o||(o=a.getContext("experimental-webgl",r));var h=o;if(this.webGLContexts[e]=h,h.blendFunc(h.ONE,h.ONE_MINUS_SRC_ALPHA),t.picking){this.pickingLayers.add(e);var d=h.createFramebuffer();if(!d)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(e));this.frameBuffers[e]=d}return h}},{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,r=this.webGLContexts[e];(a=r.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 v({},this.settings)}},{key:"getSetting",value:function(e){return this.settings[e]}},{key:"setSetting",value:function(e,t){var a=v({},this.settings);return this.settings[e]=t,oe(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=v({},this.settings);return this.settings=v(v({},this.settings),e),oe(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=pe(),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 r in this.elements){var o=this.elements[r];o.style.width=this.width+"px",o.style.height=this.height+"px"}for(var h in this.canvasContexts)this.elements[h].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[h].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[h].scale(this.pixelRatio,this.pixelRatio);for(var d in this.webGLContexts){this.elements[d].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[d].setAttribute("height",this.height*this.pixelRatio+"px");var l=this.webGLContexts[d];if(l.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(d)){var u=this.textures[d];u&&l.deleteTexture(u)}}return this.emit("resize"),this}},{key:"clear",value:function(){return this.emit("beforeClear"),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit("afterClear"),this}},{key:"refresh",value:function(e){var t=this,a=(e==null?void 0:e.skipIndexation)!==void 0?e==null?void 0:e.skipIndexation:!1,r=(e==null?void 0:e.schedule)!==void 0?e.schedule:!1,o=!e||!e.partialGraph;if(o)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(C){return t.addNode(C)}),this.graph.forEachEdge(function(C){return t.addEdge(C)});else{for(var h,d,l=((h=e.partialGraph)===null||h===void 0?void 0:h.nodes)||[],u=0,g=(l==null?void 0:l.length)||0;u<g;u++){var f=l[u];if(this.updateNode(f),a){var m=this.nodeProgramIndex[f];if(m===void 0)throw new Error('Sigma: node "'.concat(f,`" can't be repaint`));this.addNodeToProgram(f,this.nodeIndices[f],m)}}for(var p=(e==null||(d=e.partialGraph)===null||d===void 0?void 0:d.edges)||[],y=0,E=p.length;y<E;y++){var b=p[y];if(this.updateEdge(b),a){var x=this.edgeProgramIndex[b];if(x===void 0)throw new Error('Sigma: edge "'.concat(b,`" can't be repaint`));this.addEdgeToProgram(b,this.edgeIndices[b],x)}}}return(o||!a)&&(this.needToProcess=!0),r?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(v(v({},e),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(e,t){var a=this.camera.getState(),r=a.ratio,o=a.angle,h=a.x,d=a.y,l=this.settings,u=l.minCameraRatio,g=l.maxCameraRatio;typeof g=="number"&&(t=Math.min(t,g)),typeof u=="number"&&(t=Math.max(t,u));var f=t/r,m={x:this.width/2,y:this.height/2},p=this.viewportToFramedGraph(e),y=this.viewportToFramedGraph(m);return{angle:o,x:(p.x-y.x)*(1-f)+h,y:(p.y-y.y)*(1-f)+d,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,r=t.matrix?t.matrix:a?X(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding()):this.matrix,o=de(r,e);return{x:(1+o.x)*this.width/2,y:(1-o.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,r=t.matrix?t.matrix:a?X(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding(),!0):this.invMatrix,o=de(r,{x:e.x/this.width*2-1,y:1-e.y/this.height*2});return isNaN(o.x)&&(o.x=0),isNaN(o.y)&&(o.y=0),o}},{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)),r=this.graphToViewport(e),o=this.graphToViewport(t),h=Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2));return h/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 r in this.edgePrograms)this.edgePrograms[r].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var o in this.elements)this.killLayer(o);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}}])})(ue),Lt=Ct;export{Ce as Camera,lt as MouseCaptor,Ct as Sigma,gt as TouchCaptor,Lt as default};
@@ -1 +1 @@
1
- import{a as e,p as r}from"./BMHKbvs8.js";const t={get error(){return r.error},get status(){return r.status},get url(){return r.url}};e.updated.check;const a=t;export{a as p};
1
+ import{a as e,p as r}from"./pDJnDxXM.js";const t={get error(){return r.error},get status(){return r.status},get url(){return r.url}};e.updated.check;const a=t;export{a as p};
@@ -0,0 +1,187 @@
1
+ import{D as ne,r as _e,a as he}from"./DqvWKbSc.js";function be(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oe(e){var t=be(e,"string");return typeof t=="symbol"?t:t+""}function ie(e,t,r){return(t=oe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?te(Object(r),!0).forEach(function(n){ie(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):te(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,oe(n.key),n)}}function Te(e,t,r){return t&&me(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function N(e){return N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},N(e)}function ae(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ae=function(){return!!e})()}function ce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ce(e)}function we(e,t,r){return t=N(t),xe(e,ae()?Reflect.construct(t,r||[],N(e).constructor):t.apply(e,r))}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},V(e,t)}function Ae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&V(e,t)}function G(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Ee(e){if(Array.isArray(e))return G(e)}function Se(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Re(e,t){if(e){if(typeof e=="string")return G(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(e,t):void 0}}function Oe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(e){return Ee(e)||Se(e)||Re(e)||Oe()}function ue(e,t,r,n){var l=Math.pow(1-e,2)*t.x+2*(1-e)*e*r.x+Math.pow(e,2)*n.x,i=Math.pow(1-e,2)*t.y+2*(1-e)*e*r.y+Math.pow(e,2)*n.y;return{x:l,y:i}}function ke(e,t,r){for(var n=20,l=0,i=e,h=0;h<n;h++){var u=ue((h+1)/n,e,t,r);l+=Math.sqrt(Math.pow(i.x-u.x,2)+Math.pow(i.y-u.y,2)),i=u}return l}function Pe(e){var t=e.curvatureAttribute,r=e.defaultCurvature,n=e.keepLabelUpright,l=n===void 0?!0:n;return function(i,h,u,p,x){var b=x.edgeLabelSize,s=h[t]||r,v=x.edgeLabelFont,c=x.edgeLabelWeight,a=x.edgeLabelColor.attribute?h[x.edgeLabelColor.attribute]||x.edgeLabelColor.color||"#000":x.edgeLabelColor.color,o=h.label;if(o){i.fillStyle=a,i.font="".concat(c," ").concat(b,"px ").concat(v);var y=!l||u.x<p.x,f=y?u.x:p.x,_=y?u.y:p.y,w=y?p.x:u.x,d=y?p.y:u.y,R=(f+w)/2,m=(_+d)/2,T=w-f,A=d-_,g=Math.sqrt(Math.pow(T,2)+Math.pow(A,2)),C=y?1:-1,E=R+A*s*C,S=m-T*s*C,k=h.size*.7+5,I={x:S-_,y:-(E-f)},Y=Math.sqrt(Math.pow(I.x,2)+Math.pow(I.y,2)),M={x:d-S,y:-(w-E)},W=Math.sqrt(Math.pow(M.x,2)+Math.pow(M.y,2));f+=k*I.x/Y,_+=k*I.y/Y,w+=k*M.x/W,d+=k*M.y/W,E+=k*A/g,S-=k*T/g;var q={x:E,y:S},K={x:f,y:_},Q={x:w,y:d},j=ke(K,q,Q);if(!(j<u.size+p.size)){var L=i.measureText(o).width,$=j-u.size-p.size;if(L>$){var J="…";for(o=o+J,L=i.measureText(o).width;L>$&&o.length>1;)o=o.slice(0,-2)+J,L=i.measureText(o).width;if(o.length<4)return}for(var H={},U=0,le=o.length;U<le;U++){var F=o[U];H[F]||(H[F]=i.measureText(F).width*(1+s*.35))}for(var P=.5-L/j/2,D=0,fe=o.length;D<fe;D++){var Z=o[D],ee=ue(P,K,q,Q),de=2*(1-P)*(E-f)+2*P*(w-E),ge=2*(1-P)*(S-_)+2*P*(d-S),pe=Math.atan2(ge,de);i.save(),i.translate(ee.x,ee.y),i.rotate(pe),i.fillText(Z,0,0),i.restore(),P+=H[Z]/j}}}}}function ze(e){var t=e.arrowHead,r=(t==null?void 0:t.extremity)==="target"||(t==null?void 0:t.extremity)==="both",n=(t==null?void 0:t.extremity)==="source"||(t==null?void 0:t.extremity)==="both",l=`
3
+ precision highp float;
4
+
5
+ varying vec4 v_color;
6
+ varying float v_thickness;
7
+ varying float v_feather;
8
+ varying vec2 v_cpA;
9
+ varying vec2 v_cpB;
10
+ varying vec2 v_cpC;
11
+ `.concat(r?`
12
+ varying float v_targetSize;
13
+ varying vec2 v_targetPoint;`:"",`
14
+ `).concat(n?`
15
+ varying float v_sourceSize;
16
+ varying vec2 v_sourcePoint;`:"",`
17
+ `).concat(t?`
18
+ uniform float u_lengthToThicknessRatio;
19
+ uniform float u_widenessToThicknessRatio;`:"",`
20
+
21
+ float det(vec2 a, vec2 b) {
22
+ return a.x * b.y - b.x * a.y;
23
+ }
24
+
25
+ vec2 getDistanceVector(vec2 b0, vec2 b1, vec2 b2) {
26
+ float a = det(b0, b2), b = 2.0 * det(b1, b0), d = 2.0 * det(b2, b1);
27
+ float f = b * d - a * a;
28
+ vec2 d21 = b2 - b1, d10 = b1 - b0, d20 = b2 - b0;
29
+ vec2 gf = 2.0 * (b * d21 + d * d10 + a * d20);
30
+ gf = vec2(gf.y, -gf.x);
31
+ vec2 pp = -f * gf / dot(gf, gf);
32
+ vec2 d0p = b0 - pp;
33
+ float ap = det(d0p, d20), bp = 2.0 * det(d10, d0p);
34
+ float t = clamp((ap + bp) / (2.0 * a + b + d), 0.0, 1.0);
35
+ return mix(mix(b0, b1, t), mix(b1, b2, t), t);
36
+ }
37
+
38
+ float distToQuadraticBezierCurve(vec2 p, vec2 b0, vec2 b1, vec2 b2) {
39
+ return length(getDistanceVector(b0 - p, b1 - p, b2 - p));
40
+ }
41
+
42
+ const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
43
+
44
+ void main(void) {
45
+ float dist = distToQuadraticBezierCurve(gl_FragCoord.xy, v_cpA, v_cpB, v_cpC);
46
+ float thickness = v_thickness;
47
+ `).concat(r?`
48
+ float distToTarget = length(gl_FragCoord.xy - v_targetPoint);
49
+ float targetArrowLength = v_targetSize + thickness * u_lengthToThicknessRatio;
50
+ if (distToTarget < targetArrowLength) {
51
+ thickness = (distToTarget - v_targetSize) / (targetArrowLength - v_targetSize) * u_widenessToThicknessRatio * thickness;
52
+ }`:"",`
53
+ `).concat(n?`
54
+ float distToSource = length(gl_FragCoord.xy - v_sourcePoint);
55
+ float sourceArrowLength = v_sourceSize + thickness * u_lengthToThicknessRatio;
56
+ if (distToSource < sourceArrowLength) {
57
+ thickness = (distToSource - v_sourceSize) / (sourceArrowLength - v_sourceSize) * u_widenessToThicknessRatio * thickness;
58
+ }`:"",`
59
+
60
+ float halfThickness = thickness / 2.0;
61
+ if (dist < halfThickness) {
62
+ #ifdef PICKING_MODE
63
+ gl_FragColor = v_color;
64
+ #else
65
+ float t = smoothstep(
66
+ halfThickness - v_feather,
67
+ halfThickness,
68
+ dist
69
+ );
70
+
71
+ gl_FragColor = mix(v_color, transparent, t);
72
+ #endif
73
+ } else {
74
+ gl_FragColor = transparent;
75
+ }
76
+ }
77
+ `);return l}function Ce(e){var t=e.arrowHead,r=(t==null?void 0:t.extremity)==="target"||(t==null?void 0:t.extremity)==="both",n=(t==null?void 0:t.extremity)==="source"||(t==null?void 0:t.extremity)==="both",l=`
78
+ attribute vec4 a_id;
79
+ attribute vec4 a_color;
80
+ attribute float a_direction;
81
+ attribute float a_thickness;
82
+ attribute vec2 a_source;
83
+ attribute vec2 a_target;
84
+ attribute float a_current;
85
+ attribute float a_curvature;
86
+ `.concat(r?`attribute float a_targetSize;
87
+ `:"",`
88
+ `).concat(n?`attribute float a_sourceSize;
89
+ `:"",`
90
+
91
+ uniform mat3 u_matrix;
92
+ uniform float u_sizeRatio;
93
+ uniform float u_pixelRatio;
94
+ uniform vec2 u_dimensions;
95
+ uniform float u_minEdgeThickness;
96
+ uniform float u_feather;
97
+
98
+ varying vec4 v_color;
99
+ varying float v_thickness;
100
+ varying float v_feather;
101
+ varying vec2 v_cpA;
102
+ varying vec2 v_cpB;
103
+ varying vec2 v_cpC;
104
+ `).concat(r?`
105
+ varying float v_targetSize;
106
+ varying vec2 v_targetPoint;`:"",`
107
+ `).concat(n?`
108
+ varying float v_sourceSize;
109
+ varying vec2 v_sourcePoint;`:"",`
110
+ `).concat(t?`
111
+ uniform float u_widenessToThicknessRatio;`:"",`
112
+
113
+ const float bias = 255.0 / 254.0;
114
+ const float epsilon = 0.7;
115
+
116
+ vec2 clipspaceToViewport(vec2 pos, vec2 dimensions) {
117
+ return vec2(
118
+ (pos.x + 1.0) * dimensions.x / 2.0,
119
+ (pos.y + 1.0) * dimensions.y / 2.0
120
+ );
121
+ }
122
+
123
+ vec2 viewportToClipspace(vec2 pos, vec2 dimensions) {
124
+ return vec2(
125
+ pos.x / dimensions.x * 2.0 - 1.0,
126
+ pos.y / dimensions.y * 2.0 - 1.0
127
+ );
128
+ }
129
+
130
+ void main() {
131
+ float minThickness = u_minEdgeThickness;
132
+
133
+ // Selecting the correct position
134
+ // Branchless "position = a_source if a_current == 1.0 else a_target"
135
+ vec2 position = a_source * max(0.0, a_current) + a_target * max(0.0, 1.0 - a_current);
136
+ position = (u_matrix * vec3(position, 1)).xy;
137
+
138
+ vec2 source = (u_matrix * vec3(a_source, 1)).xy;
139
+ vec2 target = (u_matrix * vec3(a_target, 1)).xy;
140
+
141
+ vec2 viewportPosition = clipspaceToViewport(position, u_dimensions);
142
+ vec2 viewportSource = clipspaceToViewport(source, u_dimensions);
143
+ vec2 viewportTarget = clipspaceToViewport(target, u_dimensions);
144
+
145
+ vec2 delta = viewportTarget.xy - viewportSource.xy;
146
+ float len = length(delta);
147
+ vec2 normal = vec2(-delta.y, delta.x) * a_direction;
148
+ vec2 unitNormal = normal / len;
149
+ float boundingBoxThickness = len * a_curvature;
150
+
151
+ float curveThickness = max(minThickness, a_thickness / u_sizeRatio);
152
+ v_thickness = curveThickness * u_pixelRatio;
153
+ v_feather = u_feather;
154
+
155
+ v_cpA = viewportSource;
156
+ v_cpB = 0.5 * (viewportSource + viewportTarget) + unitNormal * a_direction * boundingBoxThickness;
157
+ v_cpC = viewportTarget;
158
+
159
+ vec2 viewportOffsetPosition = (
160
+ viewportPosition +
161
+ unitNormal * (boundingBoxThickness / 2.0 + sign(boundingBoxThickness) * (`).concat(t?"curveThickness * u_widenessToThicknessRatio":"curveThickness",` + epsilon)) *
162
+ max(0.0, a_direction) // NOTE: cutting the bounding box in half to avoid overdraw
163
+ );
164
+
165
+ position = viewportToClipspace(viewportOffsetPosition, u_dimensions);
166
+ gl_Position = vec4(position, 0, 1);
167
+
168
+ `).concat(r?`
169
+ v_targetSize = a_targetSize * u_pixelRatio / u_sizeRatio;
170
+ v_targetPoint = viewportTarget;
171
+ `:"",`
172
+ `).concat(n?`
173
+ v_sourceSize = a_sourceSize * u_pixelRatio / u_sizeRatio;
174
+ v_sourcePoint = viewportSource;
175
+ `:"",`
176
+
177
+ #ifdef PICKING_MODE
178
+ // For picking mode, we use the ID as the color:
179
+ v_color = a_id;
180
+ #else
181
+ // For normal mode, we use the color:
182
+ v_color = a_color;
183
+ #endif
184
+
185
+ v_color.a *= bias;
186
+ }
187
+ `);return l}var se=.25,Le={arrowHead:null,curvatureAttribute:"curvature",defaultCurvature:se},Ie={edgeIndexAttribute:"parallelIndex",edgeMinIndexAttribute:"parallelMinIndex",edgeMaxIndexAttribute:"parallelMaxIndex"};function je(e,t){var r=z(z({},Ie),t||{}),n={},l={},i={},h=0;e.forEachNode(function(m){n[m]=++h+""}),e.forEachEdge(function(m,T,A,g){var C=n[A],E=n[g],S=[C,E].join("-");l[m]=S,i[S]=[C,E].sort().join("-")});var u={},p={};e.forEachEdge(function(m){var T=l[m],A=i[T];u[T]=u[T]||[],u[T].push(m),p[A]=p[A]||[],p[A].push(m)});for(var x in u){var b=u[x],s=b.length,v=p[i[x]].length;if(s===1&&v===1){var c=b[0];e.setEdgeAttribute(c,r.edgeIndexAttribute,null),e.setEdgeAttribute(c,r.edgeMaxIndexAttribute,null)}else if(s===1){var a=b[0];e.setEdgeAttribute(a,r.edgeIndexAttribute,1),e.setEdgeAttribute(a,r.edgeMaxIndexAttribute,1)}else if(s===v)for(var o=(s-1)/2,y=-o,f=0;f<s;f++){var _=b[f],w=-(s-1)/2+f;e.setEdgeAttribute(_,r.edgeIndexAttribute,w),e.setEdgeAttribute(_,r.edgeMinIndexAttribute,y),e.setEdgeAttribute(_,r.edgeMaxIndexAttribute,o)}else for(var d=0;d<s;d++){var R=b[d];e.setEdgeAttribute(R,r.edgeIndexAttribute,d+1),e.setEdgeAttribute(R,r.edgeMaxIndexAttribute,s)}}}var ve=WebGLRenderingContext,re=ve.UNSIGNED_BYTE,O=ve.FLOAT;function X(e){var t=z(z({},Le),e||{}),r=t,n=r.arrowHead,l=r.curvatureAttribute,i=r.drawLabel,h=(n==null?void 0:n.extremity)==="target"||(n==null?void 0:n.extremity)==="both",u=(n==null?void 0:n.extremity)==="source"||(n==null?void 0:n.extremity)==="both",p=["u_matrix","u_sizeRatio","u_dimensions","u_pixelRatio","u_feather","u_minEdgeThickness"].concat(B(n?["u_lengthToThicknessRatio","u_widenessToThicknessRatio"]:[]));return(function(x){Ae(b,x);function b(){var s;ye(this,b);for(var v=arguments.length,c=new Array(v),a=0;a<v;a++)c[a]=arguments[a];return s=we(this,b,[].concat(c)),ie(ce(s),"drawLabel",i||Pe(t)),s}return Te(b,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:Ce(t),FRAGMENT_SHADER_SOURCE:ze(t),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:p,ATTRIBUTES:[{name:"a_source",size:2,type:O},{name:"a_target",size:2,type:O}].concat(B(h?[{name:"a_targetSize",size:1,type:O}]:[]),B(u?[{name:"a_sourceSize",size:1,type:O}]:[]),[{name:"a_thickness",size:1,type:O},{name:"a_curvature",size:1,type:O},{name:"a_color",size:4,type:re,normalized:!0},{name:"a_id",size:4,type:re,normalized:!0}]),CONSTANT_ATTRIBUTES:[{name:"a_current",size:1,type:O},{name:"a_direction",size:1,type:O}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[0,-1],[1,1],[1,-1]]}}},{key:"processVisibleItem",value:function(v,c,a,o,y){var f,_=y.size||1,w=a.x,d=a.y,R=o.x,m=o.y,T=_e(y.color),A=(f=y[l])!==null&&f!==void 0?f:se,g=this.array;g[c++]=w,g[c++]=d,g[c++]=R,g[c++]=m,h&&(g[c++]=o.size),u&&(g[c++]=a.size),g[c++]=_,g[c++]=A,g[c++]=T,g[c++]=v}},{key:"setUniforms",value:function(v,c){var a=c.gl,o=c.uniformLocations,y=o.u_matrix,f=o.u_pixelRatio,_=o.u_feather,w=o.u_sizeRatio,d=o.u_dimensions,R=o.u_minEdgeThickness;if(a.uniformMatrix3fv(y,!1,v.matrix),a.uniform1f(f,v.pixelRatio),a.uniform1f(w,v.sizeRatio),a.uniform1f(_,v.antiAliasingFeather),a.uniform2f(d,v.width*v.pixelRatio,v.height*v.pixelRatio),a.uniform1f(R,v.minEdgeThickness),n){var m=o.u_lengthToThicknessRatio,T=o.u_widenessToThicknessRatio;a.uniform1f(m,n.lengthToThicknessRatio),a.uniform1f(T,n.widenessToThicknessRatio)}}}]),b})(he)}var Ne=X(),He=X({arrowHead:ne}),Ue=X({arrowHead:z(z({},ne),{},{extremity:"both"})});export{se as DEFAULT_EDGE_CURVATURE,Le as DEFAULT_EDGE_CURVE_PROGRAM_OPTIONS,Ie as DEFAULT_INDEX_PARALLEL_EDGES_OPTIONS,He as EdgeCurvedArrowProgram,Ue as EdgeCurvedDoubleArrowProgram,Pe as createDrawCurvedEdgeLabel,X as createEdgeCurveProgram,Ne as default,je as indexParallelEdgesIndex};
@@ -1,6 +1,6 @@
1
- import{q as x,l as H,b as K,s as E}from"./Bgso8cDH.js";function k(r){if(Array.isArray(r))return r}function W(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,a,o,i,l=[],u=!0,d=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(u=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(s){d=!0,a=s}finally{try{if(!u&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(d)throw a}}return l}}function h(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function A(r,e){if(r){if(typeof r=="string")return h(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h(r,e):void 0}}function Y(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q(r,e){return k(r)||W(r,e)||A(r,e)||Y()}function X(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Z(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function P(r){var e=Z(r,"string");return typeof e=="symbol"?e:e+""}function $(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,P(n.key),n)}}function J(r,e,t){return e&&$(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function g(r){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(r)}function T(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T=function(){return!!r})()}function S(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Q(r,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S(r)}function rr(r,e,t){return e=g(e),Q(r,T()?Reflect.construct(e,t||[],g(r).constructor):e.apply(r,t))}function O(r,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},O(r,e)}function er(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&O(r,e)}function v(r,e,t){return(e=P(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tr(r){if(Array.isArray(r))return h(r)}function or(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function nr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z(r){return tr(r)||or(r)||A(r)||nr()}function j(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function R(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?j(Object(t),!0).forEach(function(n){v(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var ar="relative",ir={drawLabel:void 0,drawHover:void 0,borders:[{size:{value:.1},color:{attribute:"borderColor"}},{size:{fill:!0},color:{attribute:"color"}}]},cr="#000000";function lr(r){var e=r.borders,t=E(e.filter(function(a){var o=a.size;return"fill"in o}).length),n=`
1
+ import{r as x,m as H,c as K,t as E}from"./DqvWKbSc.js";function k(r){if(Array.isArray(r))return r}function W(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,a,o,i,u=[],l=!0,d=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(l=(n=o.call(t)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(s){d=!0,a=s}finally{try{if(!l&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(d)throw a}}return u}}function h(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function A(r,e){if(r){if(typeof r=="string")return h(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h(r,e):void 0}}function Y(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X(r,e){return k(r)||W(r,e)||A(r,e)||Y()}function Z(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function $(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function P(r){var e=$(r,"string");return typeof e=="symbol"?e:e+""}function q(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,P(n.key),n)}}function J(r,e,t){return e&&q(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function g(r){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(r)}function T(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T=function(){return!!r})()}function S(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Q(r,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S(r)}function rr(r,e,t){return e=g(e),Q(r,T()?Reflect.construct(e,t||[],g(r).constructor):e.apply(r,t))}function O(r,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},O(r,e)}function er(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&O(r,e)}function v(r,e,t){return(e=P(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tr(r){if(Array.isArray(r))return h(r)}function or(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function nr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z(r){return tr(r)||or(r)||A(r)||nr()}function j(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function R(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?j(Object(t),!0).forEach(function(n){v(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var ar="relative",ir={drawLabel:void 0,drawHover:void 0,borders:[{size:{value:.1},color:{attribute:"borderColor"}},{size:{fill:!0},color:{attribute:"color"}}]},cr="#000000";function ur(r){var e=r.borders,t=E(e.filter(function(a){var o=a.size;return"fill"in o}).length),n=`
4
4
  precision highp float;
5
5
 
6
6
  varying vec2 v_diffVector;
@@ -37,7 +37,7 @@ void main(void) {
37
37
  }
38
38
  #else
39
39
  // Sizes:
40
- `).concat(e.flatMap(function(a,o){var i=a.size;if("fill"in i)return[];i=i;var l="attribute"in i?"v_borderSize_".concat(o+1):E(i.value),u=(i.mode||ar)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(o+1," = ").concat(u," * ").concat(l,";")]}).join(`
40
+ `).concat(e.flatMap(function(a,o){var i=a.size;if("fill"in i)return[];i=i;var u="attribute"in i?"v_borderSize_".concat(o+1):E(i.value),l=(i.mode||ar)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(o+1," = ").concat(l," * ").concat(u,";")]}).join(`
41
41
  `),`
42
42
  // Now, let's split the remaining space between "fill" borders:
43
43
  float fillBorderSize = (v_radius - (`).concat(e.flatMap(function(a,o){var i=a.size;return"fill"in i?[]:["borderSize_".concat(o+1)]}).join(" + "),") ) / ").concat(t,`;
@@ -51,7 +51,7 @@ void main(void) {
51
51
 
52
52
  // Colors:
53
53
  vec4 borderColor_0 = transparent;
54
- `).concat(e.map(function(a,o){var i=a.color,l=[];return"attribute"in i?l.push(" vec4 borderColor_".concat(o+1," = v_borderColor_").concat(o+1,";")):"transparent"in i?l.push(" vec4 borderColor_".concat(o+1," = vec4(0.0, 0.0, 0.0, 0.0);")):l.push(" vec4 borderColor_".concat(o+1," = u_borderColor_").concat(o+1,";")),l.push(" borderColor_".concat(o+1,".a *= bias;")),l.push(" if (borderSize_".concat(o+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(o+1," = borderColor_").concat(o,"; }")),l.join(`
54
+ `).concat(e.map(function(a,o){var i=a.color,u=[];return"attribute"in i?u.push(" vec4 borderColor_".concat(o+1," = v_borderColor_").concat(o+1,";")):"transparent"in i?u.push(" vec4 borderColor_".concat(o+1," = vec4(0.0, 0.0, 0.0, 0.0);")):u.push(" vec4 borderColor_".concat(o+1," = u_borderColor_").concat(o+1,";")),u.push(" borderColor_".concat(o+1,".a *= bias;")),u.push(" if (borderSize_".concat(o+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(o+1," = borderColor_").concat(o,"; }")),u.join(`
55
55
  `)}).join(`
56
56
  `),`
57
57
  if (dist > adjustedBorderSize_0) {
@@ -63,7 +63,7 @@ void main(void) {
63
63
  } else `)}).join(""),` { /* Nothing to add here */ }
64
64
  #endif
65
65
  }
66
- `);return n}function ur(r){var e=r.borders,t=`
66
+ `);return n}function lr(r){var e=r.borders,t=`
67
67
  attribute vec2 a_position;
68
68
  attribute float a_size;
69
69
  attribute float a_angle;
@@ -110,4 +110,4 @@ void main() {
110
110
  `),`
111
111
  #endif
112
112
  }
113
- `);return t}var N=WebGLRenderingContext,w=N.UNSIGNED_BYTE,m=N.FLOAT;function fr(r){var e,t=R(R({},ir),r||{}),n=t.borders,a=t.drawLabel,o=t.drawHover,i=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(z(n.flatMap(function(l,u){var d=l.color;return"value"in d?["u_borderColor_".concat(u+1)]:[]})));return e=(function(l){er(u,l);function u(){var d;X(this,u);for(var s=arguments.length,f=new Array(s),c=0;c<s;c++)f[c]=arguments[c];return d=rr(this,u,[].concat(f)),v(S(d),"drawLabel",a),v(S(d),"drawHover",o),d}return J(u,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:ur(t),FRAGMENT_SHADER_SOURCE:lr(t),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:i,ATTRIBUTES:[{name:"a_position",size:2,type:m},{name:"a_id",size:4,type:w,normalized:!0},{name:"a_size",size:1,type:m}].concat(z(n.flatMap(function(s,f){var c=s.color;return"attribute"in c?[{name:"a_borderColor_".concat(f+1),size:4,type:w,normalized:!0}]:[]})),z(n.flatMap(function(s,f){var c=s.size;return"attribute"in c?[{name:"a_borderSize_".concat(f+1),size:1,type:m}]:[]}))),CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:m}],CONSTANT_DATA:[[u.ANGLE_1],[u.ANGLE_2],[u.ANGLE_3]]}}},{key:"processVisibleItem",value:function(s,f,c){var _=this.array;_[f++]=c.x,_[f++]=c.y,_[f++]=s,_[f++]=c.size,n.forEach(function(p){var b=p.color;"attribute"in b&&(_[f++]=x(c[b.attribute]||b.defaultValue||cr))}),n.forEach(function(p){var b=p.size;"attribute"in b&&(_[f++]=c[b.attribute]||b.defaultValue)})}},{key:"setUniforms",value:function(s,f){var c=f.gl,_=f.uniformLocations,p=_.u_sizeRatio,b=_.u_correctionRatio,D=_.u_matrix;c.uniform1f(b,s.correctionRatio),c.uniform1f(p,s.sizeRatio),c.uniformMatrix3fv(D,!1,s.matrix),n.forEach(function(I,L){var C=I.color;if("value"in C){var B=_["u_borderColor_".concat(L+1)],M=H(C.value),y=q(M,4),F=y[0],G=y[1],U=y[2],V=y[3];c.uniform4f(B,F/255,G/255,U/255,V/255)}})}}]),u})(K),v(e,"ANGLE_1",0),v(e,"ANGLE_2",2*Math.PI/3),v(e,"ANGLE_3",4*Math.PI/3),e}var dr=fr();export{dr as NodeBorderProgram,fr as createNodeBorderProgram};
113
+ `);return t}var N=WebGLRenderingContext,w=N.UNSIGNED_BYTE,m=N.FLOAT;function fr(r){var e,t=R(R({},ir),r||{}),n=t.borders,a=t.drawLabel,o=t.drawHover,i=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(z(n.flatMap(function(u,l){var d=u.color;return"value"in d?["u_borderColor_".concat(l+1)]:[]})));return e=(function(u){er(l,u);function l(){var d;Z(this,l);for(var s=arguments.length,f=new Array(s),c=0;c<s;c++)f[c]=arguments[c];return d=rr(this,l,[].concat(f)),v(S(d),"drawLabel",a),v(S(d),"drawHover",o),d}return J(l,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:lr(t),FRAGMENT_SHADER_SOURCE:ur(t),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:i,ATTRIBUTES:[{name:"a_position",size:2,type:m},{name:"a_id",size:4,type:w,normalized:!0},{name:"a_size",size:1,type:m}].concat(z(n.flatMap(function(s,f){var c=s.color;return"attribute"in c?[{name:"a_borderColor_".concat(f+1),size:4,type:w,normalized:!0}]:[]})),z(n.flatMap(function(s,f){var c=s.size;return"attribute"in c?[{name:"a_borderSize_".concat(f+1),size:1,type:m}]:[]}))),CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:m}],CONSTANT_DATA:[[l.ANGLE_1],[l.ANGLE_2],[l.ANGLE_3]]}}},{key:"processVisibleItem",value:function(s,f,c){var _=this.array;_[f++]=c.x,_[f++]=c.y,_[f++]=s,_[f++]=c.size,n.forEach(function(p){var b=p.color;"attribute"in b&&(_[f++]=x(c[b.attribute]||b.defaultValue||cr))}),n.forEach(function(p){var b=p.size;"attribute"in b&&(_[f++]=c[b.attribute]||b.defaultValue)})}},{key:"setUniforms",value:function(s,f){var c=f.gl,_=f.uniformLocations,p=_.u_sizeRatio,b=_.u_correctionRatio,D=_.u_matrix;c.uniform1f(b,s.correctionRatio),c.uniform1f(p,s.sizeRatio),c.uniformMatrix3fv(D,!1,s.matrix),n.forEach(function(I,L){var C=I.color;if("value"in C){var B=_["u_borderColor_".concat(L+1)],M=H(C.value),y=X(M,4),F=y[0],G=y[1],U=y[2],V=y[3];c.uniform4f(B,F/255,G/255,U/255,V/255)}})}}]),l})(K),v(e,"ANGLE_1",0),v(e,"ANGLE_2",2*Math.PI/3),v(e,"ANGLE_3",4*Math.PI/3),e}var dr=fr();export{dr as NodeBorderProgram,fr as createNodeBorderProgram};
@@ -308,4 +308,4 @@ void main() {
308
308
 
309
309
  v_color.a *= bias;
310
310
  }
311
- `,nr=rr,Te=WebGLRenderingContext,ee=Te.UNSIGNED_BYTE,I=Te.FLOAT,ir=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],fr=(function(e){function r(){return F(this,r),O(this,r,arguments)}return D(r,e),S(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:nr,FRAGMENT_SHADER_SOURCE:me,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:ir,ATTRIBUTES:[{name:"a_positionStart",size:2,type:I},{name:"a_positionEnd",size:2,type:I},{name:"a_normal",size:2,type:I},{name:"a_color",size:4,type:ee,normalized:!0},{name:"a_id",size:4,type:ee,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:I},{name:"a_normalCoef",size:1,type:I}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(t,i,o,a,s){var l=s.size||1,u=o.x,c=o.y,h=a.x,_=a.y,d=L(s.color),v=h-u,m=_-c,E=v*v+m*m,y=0,g=0;E&&(E=1/Math.sqrt(E),y=-m*E*l,g=v*E*l);var f=this.array;f[i++]=u,f[i++]=c,f[i++]=h,f[i++]=_,f[i++]=y,f[i++]=g,f[i++]=d,f[i++]=t}},{key:"setUniforms",value:function(t,i){var o=i.gl,a=i.uniformLocations,s=a.u_matrix,l=a.u_zoomRatio,u=a.u_feather,c=a.u_pixelRatio,h=a.u_correctionRatio,_=a.u_sizeRatio,d=a.u_minEdgeThickness;o.uniformMatrix3fv(s,!1,t.matrix),o.uniform1f(l,t.zoomRatio),o.uniform1f(_,t.sizeRatio),o.uniform1f(h,t.correctionRatio),o.uniform1f(c,t.pixelRatio),o.uniform1f(u,t.antiAliasingFeather),o.uniform1f(d,t.minEdgeThickness)}}])})(W);export{cr as E,j as N,$ as _,fr as a,Pe as b,O as c,F as d,S as e,R as f,D as g,N as h,Fe as i,re as j,ye as k,tr as l,or as m,ur as n,Ge as o,lr as p,L as q,ar as r,sr as s};
311
+ `,nr=rr,Te=WebGLRenderingContext,ee=Te.UNSIGNED_BYTE,I=Te.FLOAT,ir=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],fr=(function(e){function r(){return F(this,r),O(this,r,arguments)}return D(r,e),S(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:nr,FRAGMENT_SHADER_SOURCE:me,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:ir,ATTRIBUTES:[{name:"a_positionStart",size:2,type:I},{name:"a_positionEnd",size:2,type:I},{name:"a_normal",size:2,type:I},{name:"a_color",size:4,type:ee,normalized:!0},{name:"a_id",size:4,type:ee,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:I},{name:"a_normalCoef",size:1,type:I}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(t,i,o,a,s){var l=s.size||1,u=o.x,c=o.y,h=a.x,_=a.y,d=L(s.color),v=h-u,m=_-c,E=v*v+m*m,y=0,g=0;E&&(E=1/Math.sqrt(E),y=-m*E*l,g=v*E*l);var f=this.array;f[i++]=u,f[i++]=c,f[i++]=h,f[i++]=_,f[i++]=y,f[i++]=g,f[i++]=d,f[i++]=t}},{key:"setUniforms",value:function(t,i){var o=i.gl,a=i.uniformLocations,s=a.u_matrix,l=a.u_zoomRatio,u=a.u_feather,c=a.u_pixelRatio,h=a.u_correctionRatio,_=a.u_sizeRatio,d=a.u_minEdgeThickness;o.uniformMatrix3fv(s,!1,t.matrix),o.uniform1f(l,t.zoomRatio),o.uniform1f(_,t.sizeRatio),o.uniform1f(h,t.correctionRatio),o.uniform1f(c,t.pixelRatio),o.uniform1f(u,t.antiAliasingFeather),o.uniform1f(d,t.minEdgeThickness)}}])})(W);export{he as D,cr as E,j as N,$ as _,W as a,fr as b,Pe as c,O as d,F as e,S as f,R as g,D as h,N as i,Fe as j,re as k,ye as l,tr as m,or as n,ur as o,Ge as p,lr as q,L as r,ar as s,sr as t};
@@ -0,0 +1 @@
1
+ var rt=e=>{throw TypeError(e)};var Vt=(e,t,n)=>t.has(e)||rt("Cannot "+n);var y=(e,t,n)=>(Vt(e,t,"read from private field"),n?n.call(e):t.get(e)),A=(e,t,n)=>t.has(e)?rt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);import{aR as $e,b7 as Bt,aU as at,bl as T,am as I,b9 as P,bq as we,bg as Kt}from"./oiO4RLqp.js";const M=[];function Ke(e,t=$e){let n=null;const r=new Set;function a(s){if(Bt(e,s)&&(e=s,n)){const l=!M.length;for(const c of r)c[1](),M.push(c,e);if(l){for(let c=0;c<M.length;c+=2)M[c][0](M[c+1]);M.length=0}}}function o(s){a(s(e))}function i(s,l=$e){const c=[s,l];return r.add(c),r.size===1&&(n=t(a,o)||$e),s(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:a,update:o,subscribe:i}}class Me{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class ze{constructor(t,n){try{new Headers({location:n})}catch{throw new Error(`Invalid redirect location ${JSON.stringify(n)}: this string contains characters that cannot be used in HTTP headers`)}this.status=t,this.location=n}}class Fe extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function Mt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function zt(e){return e.split("%25").map(decodeURI).join("%25")}function Ft(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function Oe({href:e}){return e.split("#")[0]}function j(){}function Gt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;function Ht(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Wt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:(t==null?void 0:t.method)||"GET")!=="GET"&&X.delete(Ge(e)),Wt(e,t));const X=new Map;function Jt(e,t){const n=Ge(e,t),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&X.set(n,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=Ht(a)),Promise.resolve(new Response(a,o))}return window.fetch(e,t)}function Yt(e,t,n){if(X.size>0){const r=Ge(e,n),a=X.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(a.body,a.init);X.delete(r)}}return window.fetch(t,n)}function Ge(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t!=null&&t.headers||t!=null&&t.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Gt(...a)}"]`}return r}const Xt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,Qt=/^\/\((?:[^)]+)\)$/;function Zt(e){const t=[];return{pattern:e==="/"||Qt.test(e)?/^\/$/:new RegExp(`^${tn(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return t.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return Ce(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return Ce(String.fromCharCode(...l.slice(2).split("-").map(m=>parseInt(m,16))));const u=Xt.exec(l),[,h,_,p,f]=u;return t.push({name:p,matcher:f,optional:!!h,rest:!!_,chained:_?c===1&&i[0]==="":!1}),_?"([^]*?)":h?"([^/]*)?":"([^/]+?)"}return Ce(l)}).join("")}).join("")}/?$`),params:t}}function en(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function tn(e){return e.slice(1).split("/").filter(en)}function nn(e,t,n){const r={},a=e.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;s<t.length;s+=1){const l=t[s];let c=a[s-i];if(l.chained&&l.rest&&i&&(c=a.slice(s-i,s+1).filter(u=>u).join("/"),i=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const u=t[s+1],h=a[s+1];u&&!u.rest&&u.optional&&h&&l.chained&&(i=0),!u&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(l.optional&&l.chained){i++;continue}return}if(!i)return r}function Ce(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function rn({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([s,[l,c,u]])=>{const{pattern:h,params:_}=Zt(s),p={id:s,exec:f=>{const m=h.exec(f);if(m)return nn(m,_,r)},errors:[1,...u||[]].map(f=>e[f]),layouts:[0,...c||[]].map(i),leaf:o(l)};return p.errors.length=p.layouts.length=Math.max(p.errors.length,p.layouts.length),p});function o(s){const l=s<0;return l&&(s=~s),[l,e[s]]}function i(s){return s===void 0?s:[a.has(s),e[s]]}}function wt(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function ot(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}var ht;const U=((ht=globalThis.__sveltekit_9pd66o)==null?void 0:ht.base)??"";var pt;const an=((pt=globalThis.__sveltekit_9pd66o)==null?void 0:pt.assets)??U??"",on="1780517377568",vt="sveltekit:snapshot",yt="sveltekit:scroll",bt="sveltekit:states",sn="sveltekit:pageurl",F="sveltekit:history",Z="sveltekit:navigation",V={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Ue=location.origin;function He(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function B(){return{x:pageXOffset,y:pageYOffset}}function z(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const st={...V,"":V.hover};function kt(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function St(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=kt(e)}}function qe(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const s=location.hash.split("#")[1]||"/";r.hash=`#${s}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,o=!r||!!a||Ae(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=(r==null?void 0:r.origin)===Ue&&e.hasAttribute("download");return{url:r,external:o,target:a,download:i}}function ve(e){let t=null,n=null,r=null,a=null,o=null,i=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=z(s,"preload-code")),a===null&&(a=z(s,"preload-data")),t===null&&(t=z(s,"keepfocus")),n===null&&(n=z(s,"noscroll")),o===null&&(o=z(s,"reload")),i===null&&(i=z(s,"replacestate")),s=kt(s);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:st[r??"off"],preload_data:st[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(o),replace_state:l(i)}}function it(e){const t=Ke(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function o(i){let s;return t.subscribe(l=>{(s===void 0||n&&l!==s)&&i(s=l)})}return{notify:r,set:a,subscribe:o}}const Et={v:j};function ln(){const{set:e,subscribe:t}=Ke(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${an}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==on;return i&&(e(!0),Et.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function Ae(e,t,n){return e.origin!==Ue||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function On(e){}const Rt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...Rt];const cn=new Set([...Rt]);[...cn];function fn(e){return e.filter(t=>t!=null)}function me(e,t){return e+"/"+t}function We(e){return e instanceof Me||e instanceof Fe?e.status:500}function un(e){return e instanceof Fe?e.text:"Internal Error"}let x,ee,je;const dn=at.toString().includes("$$")||/function \w+\(\) \{\}/.test(at.toString()),lt="a:";var oe,se,ie,le,ce,fe,ue,de,gt,he,mt,pe,_t;dn?(x={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(lt)},ee={current:null},je={current:!1}):(x=new(gt=class{constructor(){A(this,oe,T({}));A(this,se,T(null));A(this,ie,T(null));A(this,le,T({}));A(this,ce,T({id:null}));A(this,fe,T({}));A(this,ue,T(-1));A(this,de,T(new URL(lt)))}get data(){return I(y(this,oe))}set data(t){P(y(this,oe),t)}get form(){return I(y(this,se))}set form(t){P(y(this,se),t)}get error(){return I(y(this,ie))}set error(t){P(y(this,ie),t)}get params(){return I(y(this,le))}set params(t){P(y(this,le),t)}get route(){return I(y(this,ce))}set route(t){P(y(this,ce),t)}get state(){return I(y(this,fe))}set state(t){P(y(this,fe),t)}get status(){return I(y(this,ue))}set status(t){P(y(this,ue),t)}get url(){return I(y(this,de))}set url(t){P(y(this,de),t)}},oe=new WeakMap,se=new WeakMap,ie=new WeakMap,le=new WeakMap,ce=new WeakMap,fe=new WeakMap,ue=new WeakMap,de=new WeakMap,gt),ee=new(mt=class{constructor(){A(this,he,T(null))}get current(){return I(y(this,he))}set current(t){P(y(this,he),t)}},he=new WeakMap,mt),je=new(_t=class{constructor(){A(this,pe,T(!1))}get current(){return I(y(this,pe))}set current(t){P(y(this,pe),t)}},pe=new WeakMap,_t),Et.v=()=>je.current=!0);function xt(e){Object.assign(x,e)}const hn=new Set(["icon","shortcut icon","apple-touch-icon"]);let J=null;const q=wt(yt)??{},te=wt(vt)??{},N={url:it({}),page:it({}),navigating:Ke(null),updated:ln()};function Je(e){q[e]=B()}function pn(e,t){let n=e+1;for(;q[n];)delete q[n],n+=1;for(n=t+1;te[n];)delete te[n],n+=1}function ne(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(j)}async function Lt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(U||"/");e&&await e.update()}}let Ye,De,ye,$,Ve,S;const be=[],ke=[];let v=null;function Se(){var e;(e=v==null?void 0:v.fork)==null||e.then(t=>t==null?void 0:t.discard()),v=null}const _e=new Map,Ut=new Set,gn=new Set,Q=new Set;let w={branch:[],error:null,url:null},At=!1,Ee=!1,ct=!0,re=!1,Y=!1,Tt=!1,Xe=!1,It,k,L,C;const Re=new Set,ft=new Map,ut=new Map;async function qn(e,t,n){var o,i,s,l;globalThis.__sveltekit_9pd66o&&(globalThis.__sveltekit_9pd66o.query,globalThis.__sveltekit_9pd66o.prerender),document.URL!==location.href&&(location.href=location.href),S=e,await((i=(o=e.hooks).init)==null?void 0:i.call(o)),Ye=rn(e),$=document.documentElement,Ve=t,De=e.nodes[0],ye=e.nodes[1],De(),ye(),k=(s=history.state)==null?void 0:s[F],L=(l=history.state)==null?void 0:l[Z],k||(k=L=Date.now(),history.replaceState({...history.state,[F]:k,[Z]:L},""));const r=q[k];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Un(Ve,n)):(await G({type:"enter",url:He(S.hash?In(new URL(location.href)):location.href),replace_state:!0}),a()),Ln()}function mn(){be.length=0,Xe=!1}function Pt(e){ke.some(t=>t==null?void 0:t.snapshot)&&(te[e]=ke.map(t=>{var n;return(n=t==null?void 0:t.snapshot)==null?void 0:n.capture()}))}function $t(e){var t;(t=te[e])==null||t.forEach((n,r)=>{var a,o;(o=(a=ke[r])==null?void 0:a.snapshot)==null||o.restore(n)})}function dt(){Je(k),ot(yt,q),Pt(L),ot(vt,te)}async function Ot(e,t,n,r){let a,o;t.invalidateAll&&Se(),await G({type:"goto",url:He(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{if(t.invalidateAll){Xe=!0,a=new Set;for(const[i,s]of ft)for(const l of s.keys())a.add(me(i,l));o=new Set;for(const[i,s]of ut)for(const l of s.keys())o.add(me(i,l))}t.invalidate&&t.invalidate.forEach(xn)}}),t.invalidateAll&&we().then(we).then(()=>{for(const[i,s]of ft)for(const[l,{resource:c}]of s)a!=null&&a.has(me(i,l))&&c.refresh();for(const[i,s]of ut)for(const[l,{resource:c}]of s)o!=null&&o.has(me(i,l))&&c.reconnect()})}async function _n(e){if(e.id!==(v==null?void 0:v.id)){Se();const t={};Re.add(t),v={id:e.id,token:t,promise:jt({...e,preload:t}).then(n=>(Re.delete(t),n.type==="loaded"&&n.state.error&&Se(),n)),fork:null}}return v.promise}async function Ne(e){var n;const t=(n=await Te(e,!1))==null?void 0:n.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(r=>r[1]()))}async function Ct(e,t,n){var a;const r={params:w.params,route:{id:((a=w.route)==null?void 0:a.id)??null},url:new URL(location.href)};if(w={...e.state,nav:r},xt(e.props.page),It=new S.root({target:t,props:{...e.props,stores:N,components:ke},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),$t(L),n){const o={from:null,to:{...r,scroll:q[k]??B()},willUnload:!1,type:"enter",complete:Promise.resolve()};Q.forEach(i=>i(o))}Ee=!0}async function xe({url:e,params:t,branch:n,errors:r,status:a,error:o,route:i,form:s}){let l="never";if(U&&(e.pathname===U||e.pathname===U+"/"))l="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(l=f.slash);e.pathname=Mt(e.pathname,l),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:o,route:i},props:{constructors:fn(n).map(f=>f.node.component),page:nt(x)}};s!==void 0&&(c.props.form=s);let u={},h=!x,_=0;for(let f=0;f<Math.max(n.length,w.branch.length);f+=1){const m=n[f],d=w.branch[f];(m==null?void 0:m.data)!==(d==null?void 0:d.data)&&(h=!0),m&&(u={...u,...m.data},h&&(c.props[`data_${_}`]=u),_+=1)}return(!w.url||e.href!==w.url.href||w.error!==o||s!==void 0&&s!==x.form||h)&&(c.props.page={error:o,params:t,route:{id:(i==null?void 0:i.id)??null},state:{},status:a,url:new URL(e),form:s??null,data:h?u:x.data}),c}async function Qe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:o}){var c,u;let i=null;const s={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();return{node:l,loader:e,server:o,universal:(c=l.universal)!=null&&c.load?{type:"data",data:i,uses:s}:null,data:i??(o==null?void 0:o.data)??null,slash:((u=l.universal)==null?void 0:u.trailingSlash)??(o==null?void 0:o.slash)}}function wn(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const o=Ee?Yt(r,a.href,t):Jt(r,t);return{resolved:a,promise:o}}function vn(e,t,n,r,a,o){if(Xe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==w.params[i])return!0;for(const i of a.dependencies)if(be.some(s=>s(new URL(i))))return!0;return!1}function Ze(e,t){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?t??null:null}function yn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),o=t.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&n.delete(r)}return n}function bn({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:nt(x),constructors:[]}}}async function jt({id:e,invalidating:t,url:n,params:r,route:a,preload:o}){if((v==null?void 0:v.id)===e)return Re.delete(v.token),v.promise;const{errors:i,layouts:s,leaf:l}=a,c=[...s,l];i.forEach(d=>d==null?void 0:d().catch(j)),c.forEach(d=>d==null?void 0:d[1]().catch(j));const u=w.url?e!==Le(w.url):!1,h=w.route?a.id!==w.route.id:!1,_=yn(w.url,n);let p=!1;const f=c.map(async(d,g)=>{var O;if(!d)return;const b=w.branch[g];return d[1]===(b==null?void 0:b.loader)&&!vn(p,h,u,_,(O=b.universal)==null?void 0:O.uses,r)?b:(p=!0,Qe({loader:d[1],url:n,params:r,route:a,parent:async()=>{var ge;const D={};for(let K=0;K<g;K+=1)Object.assign(D,(ge=await f[K])==null?void 0:ge.data);return D},server_data_node:Ze(d[0]?{type:"skip"}:null,d[0]?b==null?void 0:b.server:void 0)}))});for(const d of f)d.catch(j);const m=[];for(let d=0;d<c.length;d+=1)if(c[d])try{m.push(await f[d])}catch(g){if(g instanceof ze)return{type:"redirect",location:g.location};if(Re.has(o))return bn({error:await ae(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let b=We(g),R;if(g instanceof Me)R=g.body;else{if(await N.updated.check())return await Lt(),await ne(n);R=await ae(g,{params:r,url:n,route:{id:a.id}})}const O=await kn(d,m,i);return O?xe({url:n,params:r,branch:m.slice(0,O.idx).concat(O.node),errors:i,status:b,error:R,route:a}):await qt(n,{id:a.id},R,b)}else m.push(void 0);return xe({url:n,params:r,branch:m,errors:i,status:200,error:null,route:a,form:t?void 0:null})}async function kn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function et({status:e,error:t,url:n,route:r}){const a={};let o=null;try{const i=await Qe({loader:De,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ze(o)}),s={node:await ye(),loader:ye,universal:null,server:null,data:null};return xe({url:n,params:a,branch:[i,s],status:e,error:t,errors:[],route:null})}catch(i){if(i instanceof ze)return Ot(new URL(i.location,location.href),{},0);throw i}}async function Sn(e){const t=e.href;if(_e.has(t))return _e.get(t);let n;try{const r=(async()=>{let a=await S.hooks.reroute({url:new URL(e),fetch:async(o,i)=>wn(o,i,e).promise})??e;if(typeof a=="string"){const o=new URL(e);S.hash?o.hash=a:o.pathname=a,a=o}return a})();_e.set(t,r),n=await r}catch{_e.delete(t);return}return n}async function Te(e,t){if(e&&!Ae(e,U,S.hash)){const n=await Sn(e);if(!n)return;const r=En(n);for(const a of Ye){const o=a.exec(r);if(o)return{id:Le(e),invalidating:t,route:a,params:Ft(o),url:e}}}}function En(e){return zt(S.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(U.length))||"/"}function Le(e){return(S.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function Nt({url:e,type:t,intent:n,delta:r,event:a,scroll:o}){let i=!1;const s=tt(w,n,e,t,o??null);r!==void 0&&(s.navigation.delta=r),a!==void 0&&(s.navigation.event=a);const l={...s.navigation,cancel:()=>{i=!0,s.reject(new Error("navigation cancelled"))}};return re||Ut.forEach(c=>c(l)),i?null:s}async function G({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:l={},accept:c=j,block:u=j,event:h}){var K;const _=C;C=l;const p=await Te(t,!1),f=e==="enter"?tt(w,p,t,e):Nt({url:t,type:e,delta:n==null?void 0:n.delta,intent:p,scroll:n==null?void 0:n.scroll,event:h});if(!f){u(),C===l&&(C=_);return}const m=k,d=L;c(),re=!0,Ee&&f.navigation.type!=="enter"&&N.navigating.set(ee.current=f.navigation);let g=p&&await jt(p);if(!g){if(Ae(t,U,S.hash))return await ne(t,o);g=await qt(t,{id:null},await ae(new Fe(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,o)}if(t=(p==null?void 0:p.url)||t,C!==l)return f.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(s<20){await G({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:o,state:i,redirect_count:s+1,nav_token:l}),f.fulfil(void 0);return}g=await et({status:500,error:await ae(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await N.updated.check()&&(await Lt(),await ne(t,o));if(mn(),Je(m),Pt(d),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),i=n?n.state:i,!n){const E=o?0:1,H={[F]:k+=E,[Z]:L+=E,[bt]:i};(o?history.replaceState:history.pushState).call(history,H,"",t),o||pn(k,L)}const b=p&&(v==null?void 0:v.id)===p.id?v.fork:null;v!=null&&v.fork&&!b&&Se(),v=null,g.props.page.state=i;let R;if(Ee){const E=(await Promise.all(Array.from(gn,W=>W(f.navigation)))).filter(W=>typeof W=="function");if(E.length>0){let W=function(){E.forEach(Pe=>{Q.delete(Pe)})};E.push(W),E.forEach(Pe=>{Q.add(Pe)})}const H=f.navigation.to;w={...g.state,nav:{params:H.params,route:H.route,url:H.url}},g.props.page&&(g.props.page.url=t);const Ie=b&&await b;Ie?R=Ie.commit():(J=null,It.$set(g.props),J&&Object.assign(g.props.page,J),xt(g.props.page),R=(K=Kt)==null?void 0:K()),Tt=!0}else await Ct(g,Ve,!1);const{activeElement:O}=document;if(await R,await we(),await we(),C!==l)return f.reject(new Error("navigation aborted")),!1;g.props.page&&J&&Object.assign(g.props.page,J);let D=null;if(ct){const E=n?n.scroll:a?B():null;E?scrollTo(E.x,E.y):(D=t.hash&&document.getElementById(Dt(t)))?D.scrollIntoView():scrollTo(0,0)}const ge=document.activeElement!==O&&document.activeElement!==document.body;!r&&!ge&&Tn(t,!D),ct=!0,re=!1,e==="popstate"&&$t(L),f.fulfil(void 0),f.navigation.to&&(f.navigation.to.scroll=B()),Q.forEach(E=>E(f.navigation)),N.navigating.set(ee.current=null)}async function qt(e,t,n,r,a){return e.origin===Ue&&e.pathname===location.pathname&&!At?await et({status:r,error:n,url:e,route:t}):await ne(e,a)}function Rn(){let e,t={element:void 0,href:void 0},n;$.addEventListener("mousemove",s=>{const l=s.target;clearTimeout(e),e=setTimeout(()=>{o(l,V.hover)},20)});function r(s){s.defaultPrevented||o(s.composedPath()[0],V.tap)}$.addEventListener("mousedown",r),$.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(s=>{for(const l of s)l.isIntersecting&&(Ne(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function o(s,l){const c=St(s,$),u=c===t.element&&(c==null?void 0:c.href)===t.href&&l>=n;if(!c||u)return;const{url:h,external:_,download:p}=qe(c,U,S.hash);if(_||p)return;const f=ve(c),m=h&&Le(w.url)===Le(h);if(!(f.reload||m))if(l<=f.preload_data){t={element:c,href:c.href},n=V.tap;const d=await Te(h,!1);if(!d)return;_n(d)}else l<=f.preload_code&&(t={element:c,href:c.href},n=l,Ne(h))}function i(){a.disconnect();for(const s of $.querySelectorAll("a")){const{url:l,external:c,download:u}=qe(s,U,S.hash);if(c||u)continue;const h=ve(s);h.reload||(h.preload_code===V.viewport&&a.observe(s),h.preload_code===V.eager&&Ne(l))}}Q.add(i),i()}function ae(e,t){if(e instanceof Me)return e.body;const n=We(e),r=un(e);return S.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Dn(e,t={}){return e=new URL(He(e)),e.origin!==Ue?Promise.reject(new Error("goto: invalid URL")):Ot(e,t,0)}function xn(e){if(typeof e=="function")be.push(e);else{const{href:t}=new URL(e,location.href);be.push(n=>n.href===t)}}function Ln(){var t,n;history.scrollRestoration="manual",addEventListener("beforeunload",r=>{let a=!1;if(dt(),!re){const o=tt(w,void 0,null,"leave"),i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};Ut.forEach(s=>s(i))}a?(r.preventDefault(),r.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&dt()}),!((t=navigator.connection)!=null&&t.saveData)&&!/2g/.test((n=navigator.connection)==null?void 0:n.effectiveType)&&Rn(),$.addEventListener("click",async r=>{if(r.button||r.which!==1||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.defaultPrevented)return;const a=St(r.composedPath()[0],$);if(!a)return;const{url:o,external:i,target:s,download:l}=qe(a,U,S.hash);if(!o)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const c=ve(a);if(!(a instanceof SVGAElement)&&o.protocol!==location.protocol&&!(o.protocol==="https:"||o.protocol==="http:")||l)return;const[h,_]=(S.hash?o.hash.replace(/^#/,""):o.href).split("#"),p=h===Oe(location);if(i||c.reload&&(!p||!_)){Nt({url:o,type:"link",event:r})?re=!0:r.preventDefault();return}if(_!==void 0&&p){const[,f]=w.url.href.split("#");if(f===_){if(r.preventDefault(),_===""||_==="top"&&a.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const m=a.ownerDocument.getElementById(decodeURIComponent(_));m&&(m.scrollIntoView(),m.focus())}return}if(Y=!0,Je(k),e(o),!c.replace_state)return;Y=!1}r.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await G({type:"link",url:o,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??o.href===location.href,event:r})}),$.addEventListener("submit",r=>{if(r.defaultPrevented)return;const a=HTMLFormElement.prototype.cloneNode.call(r.target),o=r.submitter;if(((o==null?void 0:o.formTarget)||a.target)==="_blank"||((o==null?void 0:o.formMethod)||a.method)!=="get")return;const l=new URL((o==null?void 0:o.hasAttribute("formaction"))&&(o==null?void 0:o.formAction)||a.action);if(Ae(l,U,!1))return;const c=r.target,u=ve(c);if(u.reload)return;r.preventDefault(),r.stopPropagation();const h=new FormData(c,o);l.search=new URLSearchParams(h).toString(),G({type:"form",url:l,keepfocus:u.keepfocus,noscroll:u.noscroll,replace_state:u.replace_state??l.href===location.href,event:r})}),addEventListener("popstate",async r=>{var a;if(!Be){if((a=r.state)!=null&&a[F]){const o=r.state[F];if(C={},o===k)return;const i=q[o],s=r.state[bt]??{},l=new URL(r.state[sn]??location.href),c=r.state[Z],u=w.url?Oe(location)===Oe(w.url):!1;if(c===L&&(Tt||u)){s!==x.state&&(x.state=s),e(l),q[k]=B(),i&&scrollTo(i.x,i.y),k=o;return}const _=o-k;await G({type:"popstate",url:l,popped:{state:s,scroll:i,delta:_},accept:()=>{k=o,L=c},block:()=>{history.go(-_)},nav_token:C,event:r})}else if(!Y){const o=new URL(location.href);e(o),S.hash&&location.reload()}}}),addEventListener("hashchange",()=>{Y&&(Y=!1,history.replaceState({...history.state,[F]:++k,[Z]:L},"",location.href))});for(const r of document.querySelectorAll("link"))hn.has(r.rel)&&(r.href=r.href);addEventListener("pageshow",r=>{r.persisted&&N.navigating.set(ee.current=null)});function e(r){w.url=x.url=r,N.page.set(nt(x)),N.page.notify()}}async function Un(e,{status:t=200,error:n,node_ids:r,params:a,route:o,server_route:i,data:s,form:l}){At=!0;const c=new URL(location.href);let u;({params:a={},route:o={id:null}}=await Te(c,!1)||{}),u=Ye.find(({id:p})=>p===o.id);let h,_=!0;try{const p=r.map(async(m,d)=>{const g=s[d];return g!=null&&g.uses&&(g.uses=An(g.uses)),Qe({loader:S.nodes[m],url:c,params:a,route:o,parent:async()=>{const b={};for(let R=0;R<d;R+=1)Object.assign(b,(await p[R]).data);return b},server_data_node:Ze(g)})}),f=await Promise.all(p);if(u){const m=u.layouts;for(let d=0;d<m.length;d++)m[d]||f.splice(d,0,void 0)}h=await xe({url:c,params:a,branch:f,status:t,error:n,errors:u==null?void 0:u.errors,form:l,route:u??null})}catch(p){if(p instanceof ze){await ne(new URL(p.location,location.href));return}h=await et({status:We(p),error:await ae(p,{url:c,params:a,route:o}),url:c,route:o}),e.textContent="",_=!1}finally{}h.props.page&&(h.props.page.state={}),await Ct(h,e,_)}function An(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}let Be=!1;function Tn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=Dt(e);if(r&&document.getElementById(r)){const{x:o,y:i}=B();setTimeout(()=>{const s=history.state;Be=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(s,"",e),t&&scrollTo(o,i),Be=!1})}else{const o=document.body,i=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),i!==null?o.setAttribute("tabindex",i):o.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const o=[];for(let i=0;i<a.rangeCount;i+=1)o.push(a.getRangeAt(i));setTimeout(()=>{if(a.rangeCount===o.length){for(let i=0;i<a.rangeCount;i+=1){const s=o[i],l=a.getRangeAt(i);if(s.commonAncestorContainer!==l.commonAncestorContainer||s.startContainer!==l.startContainer||s.endContainer!==l.endContainer||s.startOffset!==l.startOffset||s.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function tt(e,t,n,r,a=null){var c,u;let o,i;const s=new Promise((h,_)=>{o=h,i=_});return s.catch(j),{navigation:{from:{params:e.params,route:{id:((c=e.route)==null?void 0:c.id)??null},url:e.url,scroll:B()},to:n&&{params:(t==null?void 0:t.params)??null,route:{id:((u=t==null?void 0:t.route)==null?void 0:u.id)??null},url:n,scroll:a},willUnload:!t,type:r,complete:s},fulfil:o,reject:i}}function nt(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function In(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function Dt(e){let t;if(S.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{N as a,U as b,Dn as g,On as l,x as p,qn as s};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Ysoz3Y3h.js","../chunks/Bzak7iHL.js","../chunks/oiO4RLqp.js","../chunks/DIeogL5L.js","../chunks/BGcIe2ep.js","../chunks/65XjEwaF.js","../chunks/69_IOA4Y.js","../chunks/D9CTkMjK.js","../assets/EmptyState.RXcH7ryE.css","../chunks/pDJnDxXM.js","../chunks/C9rXzYLu.js","../chunks/BjFADNkA.js","../assets/Workspace.CvP5De7i.css","../assets/0.DQDLkSdR.css","../nodes/1.C2jbGTOJ.js","../nodes/2.CAG5_cGP.js","../nodes/3.CAG5_cGP.js","../nodes/4.CAG5_cGP.js","../nodes/5.CAG5_cGP.js","../nodes/6.CAG5_cGP.js","../nodes/7.CAG5_cGP.js","../nodes/8.CrHI4F9p.js","../chunks/BrvvOVaJ.js","../nodes/9.CAG5_cGP.js","../nodes/10.CAG5_cGP.js","../nodes/11.CAG5_cGP.js","../nodes/12.DQG5zpEx.js","../assets/12.Dblyk0Kr.css"])))=>i.map(i=>d[i]);
2
+ var q=e=>{throw TypeError(e)};var M=(e,t,r)=>t.has(e)||q("Cannot "+r);var o=(e,t,r)=>(M(e,t,"read from private field"),r?r.call(e):t.get(e)),L=(e,t,r)=>t.has(e)?q("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),A=(e,t,r,n)=>(M(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);import{p as D,i as I,c as T,b as V,_ as i}from"../chunks/D9CTkMjK.js";import{b9 as R,L as J,am as l,al as K,a9 as N,aP as Q,aZ as X,bx as $,bw as tt,aU as et,bq as rt,aj as O,bi as at,aW as st,bl as x,a0 as ot,b3 as nt,bp as it,bv as j}from"../chunks/oiO4RLqp.js";import{l as ct,o as _t,u as ut,a as p,d as w,j as G,t as mt,s as lt}from"../chunks/BGcIe2ep.js";import"../chunks/Bzak7iHL.js";function dt(e){return class extends ft{constructor(t){super({component:e,...t})}}}var d,_;class ft{constructor(t){L(this,d);L(this,_);var E;var r=new Map,n=(a,s)=>{var f=Q(s,!1,!1);return r.set(a,f),f};const m=new Proxy({...t.props||{},$$events:{}},{get(a,s){return l(r.get(s)??n(s,Reflect.get(a,s)))},has(a,s){return s===J?!0:(l(r.get(s)??n(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,f){return R(r.get(s)??n(s,f),f),Reflect.set(a,s,f)}});A(this,_,(t.hydrate?ct:_t)(t.component,{target:t.target,anchor:t.anchor,props:m,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((E=t==null?void 0:t.props)!=null&&E.$$host)||t.sync===!1)&&K(),A(this,d,m.$$events);for(const a of Object.keys(o(this,_)))a==="$set"||a==="$destroy"||a==="$on"||N(this,a,{get(){return o(this,_)[a]},set(s){o(this,_)[a]=s},enumerable:!0});o(this,_).$set=a=>{Object.assign(m,a)},o(this,_).$destroy=()=>{ut(o(this,_))}}$set(t){o(this,_).$set(t)}$on(t,r){o(this,d)[t]=o(this,d)[t]||[];const n=(...m)=>r.call(this,...m);return o(this,d)[t].push(n),()=>{o(this,d)[t]=o(this,d)[t].filter(m=>m!==n)}}$destroy(){o(this,_).$destroy()}}d=new WeakMap,_=new WeakMap;const Lt={};var ht=G('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),vt=G("<!> <!>",1);function gt(e,t){X(t,!0);let r=D(t,"components",23,()=>[]),n=D(t,"data_0",3,null),m=D(t,"data_1",3,null);$(()=>t.stores.page.set(t.page)),tt(()=>{t.stores,t.page,t.constructors,r(),t.form,n(),m(),t.stores.page.notify()});let E=x(!1),a=x(!1),s=x(null);et(()=>{const c=t.stores.page.subscribe(()=>{l(E)&&(R(a,!0),rt().then(()=>{R(s,document.title||"untitled page",!0)}))});return R(E,!0),c});const f=j(()=>t.constructors[1]);var k=vt(),C=O(k);{var W=c=>{const h=j(()=>t.constructors[0]);var v=w(),P=O(v);T(P,()=>l(h),(g,b)=>{V(b(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(u,bt)=>{var S=w(),B=O(S);T(B,()=>l(f),(F,H)=>{V(H(F,{get data(){return m()},get form(){return t.form},get params(){return t.page.params}}),y=>r()[1]=y,()=>{var y;return(y=r())==null?void 0:y[1]})}),p(u,S)},$$slots:{default:!0}}),u=>r()[0]=u,()=>{var u;return(u=r())==null?void 0:u[0]})}),p(c,v)},Y=c=>{const h=j(()=>t.constructors[0]);var v=w(),P=O(v);T(P,()=>l(h),(g,b)=>{V(b(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),u=>r()[0]=u,()=>{var u;return(u=r())==null?void 0:u[0]})}),p(c,v)};I(C,c=>{t.constructors[1]?c(W):c(Y,-1)})}var Z=at(C,2);{var z=c=>{var h=ht(),v=ot(h);{var P=g=>{var b=mt();it(()=>lt(b,l(s))),p(g,b)};I(v,g=>{l(a)&&g(P)})}nt(h),p(c,h)};I(Z,c=>{l(E)&&c(z)})}p(e,k),st()}const At=dt(gt),Dt=[()=>i(()=>import("../nodes/0.Ysoz3Y3h.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),()=>i(()=>import("../nodes/1.C2jbGTOJ.js"),__vite__mapDeps([14,1,2,3,4,10,9]),import.meta.url),()=>i(()=>import("../nodes/2.CAG5_cGP.js"),__vite__mapDeps([15,1,6,3]),import.meta.url),()=>i(()=>import("../nodes/3.CAG5_cGP.js"),__vite__mapDeps([16,1,6,3]),import.meta.url),()=>i(()=>import("../nodes/4.CAG5_cGP.js"),__vite__mapDeps([17,1,6,3]),import.meta.url),()=>i(()=>import("../nodes/5.CAG5_cGP.js"),__vite__mapDeps([18,1,6,3]),import.meta.url),()=>i(()=>import("../nodes/6.CAG5_cGP.js"),__vite__mapDeps([19,1,6,3]),import.meta.url),()=>i(()=>import("../nodes/7.CAG5_cGP.js"),__vite__mapDeps([20,1,6,3]),import.meta.url),()=>i(()=>import("../nodes/8.CrHI4F9p.js"),__vite__mapDeps([21,1,2,3,4,7,22,5,6,8,10,9]),import.meta.url),()=>i(()=>import("../nodes/9.CAG5_cGP.js"),__vite__mapDeps([23,1,6,3]),import.meta.url),()=>i(()=>import("../nodes/10.CAG5_cGP.js"),__vite__mapDeps([24,1,6,3]),import.meta.url),()=>i(()=>import("../nodes/11.CAG5_cGP.js"),__vite__mapDeps([25,1,6,3]),import.meta.url),()=>i(()=>import("../nodes/12.DQG5zpEx.js"),__vite__mapDeps([26,1,6,3,2,4,22,7,5,8,11,12,27]),import.meta.url)],It=[],Tt={"/":[2],"/appearance":[3],"/cluster":[6],"/collections":[7],"/c/[collection]":[4],"/c/[collection]/p/[subpage]":[5],"/graph":[8],"/query":[9],"/security":[10],"/settings":[11],"/shadow-dom-spike":[12]},U={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},Et=Object.fromEntries(Object.entries(U.transport).map(([e,t])=>[e,t.decode])),Vt=Object.fromEntries(Object.entries(U.transport).map(([e,t])=>[e,t.encode])),xt=!1,jt=(e,t)=>Et[e](t);export{jt as decode,Et as decoders,Tt as dictionary,Vt as encoders,xt as hash,U as hooks,Lt as matchers,Dt as nodes,At as root,It as server_loads};
@@ -0,0 +1 @@
1
+ import{l as o,s as r}from"../chunks/pDJnDxXM.js";export{o as load_css,r as start};
@@ -1 +1 @@
1
- import"../chunks/Bzak7iHL.js";import{am as o,bv as i,aZ as v,aj as c,aW as K}from"../chunks/oiO4RLqp.js";import{d as f,a as m}from"../chunks/BGcIe2ep.js";import{V as k}from"../chunks/Bmgx1mfv.js";import{i as S}from"../chunks/D9CTkMjK.js";import{g as j,b as n}from"../chunks/BMHKbvs8.js";import{p as l}from"../chunks/Ov8N-vxt.js";import{t as g,p as w,W as M}from"../chunks/BQHbwf54.js";const T=!1,W=!1,C="never",Z=Object.freeze(Object.defineProperty({__proto__:null,prerender:T,ssr:W,trailingSlash:C},Symbol.toStringTag,{value:"Module"}));function O(t){return t instanceof MouseEvent?t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey:!1}function P(){const t=i(()=>w(l.url.pathname.slice(n.length)||"/"));return{get view(){return o(t).view},get collection(){return o(t).collection},get subpage(){return o(t).subpage},get path(){return l.url.pathname},href:r=>n+g(r),go:(r,e,s)=>{O(e)||(e==null||e.preventDefault(),j(n+g(r),{replaceState:s??!1}))}}}function q(t,r){v(r,!0);const e=P(),s=i(()=>l.url.pathname.slice(n.length)||"/"),d=i(()=>o(s)==="/graph"||o(s)==="/shadow-dom-spike");var p=f(),h=c(p);{var _=a=>{var u=f(),y=c(u);k(y,()=>r.children),m(a,u)},b=a=>{M(a,{get router(){return e}})};S(h,a=>{o(d)?a(_):a(b,-1)})}m(t,p),K()}export{q as component,Z as universal};
1
+ import"../chunks/Bzak7iHL.js";import{am as o,bv as i,aZ as v,aj as c,aW as K}from"../chunks/oiO4RLqp.js";import{d as f,a as m}from"../chunks/BGcIe2ep.js";import{V as k}from"../chunks/65XjEwaF.js";import{i as S}from"../chunks/D9CTkMjK.js";import{g as j,b as n}from"../chunks/pDJnDxXM.js";import{p as l}from"../chunks/C9rXzYLu.js";import{t as g,p as w,W as M}from"../chunks/BjFADNkA.js";const T=!1,W=!1,C="never",Z=Object.freeze(Object.defineProperty({__proto__:null,prerender:T,ssr:W,trailingSlash:C},Symbol.toStringTag,{value:"Module"}));function O(t){return t instanceof MouseEvent?t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey:!1}function P(){const t=i(()=>w(l.url.pathname.slice(n.length)||"/"));return{get view(){return o(t).view},get collection(){return o(t).collection},get subpage(){return o(t).subpage},get path(){return l.url.pathname},href:r=>n+g(r),go:(r,e,s)=>{O(e)||(e==null||e.preventDefault(),j(n+g(r),{replaceState:s??!1}))}}}function q(t,r){v(r,!0);const e=P(),s=i(()=>l.url.pathname.slice(n.length)||"/"),d=i(()=>o(s)==="/graph"||o(s)==="/shadow-dom-spike");var p=f(),h=c(p);{var _=a=>{var u=f(),y=c(u);k(y,()=>r.children),m(a,u)},b=a=>{M(a,{get router(){return e}})};S(h,a=>{o(d)?a(_):a(b,-1)})}m(t,p),K()}export{q as component,Z as universal};