m&&(N.dx*=m/_,N.dy*=m/_),S.fromGraph(r,C)?N.fixed=!0:(N.x+=N.dx,N.y+=N.dy,N.fixed=!1)}return{converged:x}},Nm}var Od={},JN;function o5(){return JN||(JN=1,Od.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:r,nodeYAttribute:a}=n;e.updateEachNodeAttributes((o,s)=>{const u=t[o];return!u||u.fixed||(s[r]=u.x,s[a]=u.y),s},{attributes:["x","y"]})},Od.collectLayoutChanges=function(e){const t={};for(const n in e){const r=e[n];t[n]={x:r.x,y:r.y}}return t}),Od}var Om,eO;function i5(){return eO||(eO=1,Om={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),Om}var Dm,tO;function Mne(){if(tO)return Dm;tO=1;const e=ua(),t=ec(),n=a5(),r=o5(),a=i5();function o(u,c,d){if(!e(c))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof d=="number"?d={maxIterations:d}:d=d||{};const p=d.maxIterations;if(d=t(d,a),typeof p!="number"||p<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const g={};let m=null,b;for(b=0;bthis.runFrame())},o.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},o.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},Im=o,Im}var Bne=zne();const Une=un(Bne);function jne(e={maxIterations:100}){return Js(Pne,e)}function Gne(e={}){return kT(Une,e)}var Lm,rO;function Hne(){if(rO)return Lm;rO=1;var e=0,t=1,n=2,r=3,a=4,o=5,s=6,u=7,c=8,d=9,p=0,g=1,m=2,b=0,y=1,S=2,k=3,R=4,x=5,A=6,C=7,N=8,_=3,O=10,F=3,D=9,L=10;return Lm=function($,U,W){var Z,j,H,z,Y,I,V,B,M,K,J=U.length,le=W.length,oe=$.adjustSizes,Q=$.barnesHutTheta*$.barnesHutTheta,pe,re,Ee,we,De,_e,Se,ee=[];for(H=0;HNe?(be-=(me-Ne)/2,xe=be+me):(fe-=(Ne-me)/2,Te=fe+Ne),ee[0+b]=-1,ee[0+y]=(fe+Te)/2,ee[0+S]=(be+xe)/2,ee[0+k]=Math.max(Te-fe,xe-be),ee[0+R]=-1,ee[0+x]=-1,ee[0+A]=0,ee[0+C]=0,ee[0+N]=0,Z=1,H=0;H=0){U[H+e]=0)if(_e=Math.pow(U[H+e]-ee[j+C],2)+Math.pow(U[H+t]-ee[j+N],2),K=ee[j+k],4*K*K/_e0?(Se=re*U[H+s]*ee[j+A]/_e,U[H+n]+=Ee*Se,U[H+r]+=we*Se):_e<0&&(Se=-re*U[H+s]*ee[j+A]/Math.sqrt(_e),U[H+n]+=Ee*Se,U[H+r]+=we*Se):_e>0&&(Se=re*U[H+s]*ee[j+A]/_e,U[H+n]+=Ee*Se,U[H+r]+=we*Se),j=ee[j+R],j<0)break;continue}else{j=ee[j+x];continue}else{if(I=ee[j+b],I>=0&&I!==H&&(Ee=U[H+e]-U[I+e],we=U[H+t]-U[I+t],_e=Ee*Ee+we*we,oe===!0?_e>0?(Se=re*U[H+s]*U[I+s]/_e,U[H+n]+=Ee*Se,U[H+r]+=we*Se):_e<0&&(Se=-re*U[H+s]*U[I+s]/Math.sqrt(_e),U[H+n]+=Ee*Se,U[H+r]+=we*Se):_e>0&&(Se=re*U[H+s]*U[I+s]/_e,U[H+n]+=Ee*Se,U[H+r]+=we*Se)),j=ee[j+R],j<0)break;continue}else for(re=$.scalingRatio,z=0;z0?(Se=re*U[z+s]*U[Y+s]/_e/_e,U[z+n]+=Ee*Se,U[z+r]+=we*Se,U[Y+n]-=Ee*Se,U[Y+r]-=we*Se):_e<0&&(Se=100*re*U[z+s]*U[Y+s],U[z+n]+=Ee*Se,U[z+r]+=we*Se,U[Y+n]-=Ee*Se,U[Y+r]-=we*Se)):(_e=Math.sqrt(Ee*Ee+we*we),_e>0&&(Se=re*U[z+s]*U[Y+s]/_e/_e,U[z+n]+=Ee*Se,U[z+r]+=we*Se,U[Y+n]-=Ee*Se,U[Y+r]-=we*Se));for(M=$.gravity/$.scalingRatio,re=$.scalingRatio,H=0;H0&&(Se=re*U[H+s]*M):_e>0&&(Se=re*U[H+s]*M/_e),U[H+n]-=Ee*Se,U[H+r]-=we*Se;for(re=1*($.outboundAttractionDistribution?pe:1),V=0;V0&&(Se=-re*De*Math.log(1+_e)/_e/U[z+s]):_e>0&&(Se=-re*De*Math.log(1+_e)/_e):$.outboundAttractionDistribution?_e>0&&(Se=-re*De/U[z+s]):_e>0&&(Se=-re*De)):(_e=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),$.linLogMode?$.outboundAttractionDistribution?_e>0&&(Se=-re*De*Math.log(1+_e)/_e/U[z+s]):_e>0&&(Se=-re*De*Math.log(1+_e)/_e):$.outboundAttractionDistribution?(_e=1,Se=-re*De/U[z+s]):(_e=1,Se=-re*De)),_e>0&&(U[z+n]+=Ee*Se,U[z+r]+=we*Se,U[Y+n]-=Ee*Se,U[Y+r]-=we*Se);var te,ce,Ce,Fe,We,yt;if(oe===!0)for(H=0;HL&&(U[H+n]=U[H+n]*L/te,U[H+r]=U[H+r]*L/te),ce=U[H+s]*Math.sqrt((U[H+a]-U[H+n])*(U[H+a]-U[H+n])+(U[H+o]-U[H+r])*(U[H+o]-U[H+r])),Ce=Math.sqrt((U[H+a]+U[H+n])*(U[H+a]+U[H+n])+(U[H+o]+U[H+r])*(U[H+o]+U[H+r]))/2,Fe=.1*Math.log(1+Ce)/(1+Math.sqrt(ce)),We=U[H+e]+U[H+n]*(Fe/$.slowDown),U[H+e]=We,yt=U[H+t]+U[H+r]*(Fe/$.slowDown),U[H+t]=yt);else for(H=0;H=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in n&&typeof n.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in n&&!(typeof n.gravity=="number"&&n.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in n&&!(typeof n.slowDown=="number"||n.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in n&&typeof n.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in n&&!(typeof n.barnesHutTheta=="number"&&n.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},Ia.graphToByteArrays=function(n,r){var a=n.order,o=n.size,s={},u,c=new Float32Array(a*e),d=new Float32Array(o*t);return u=0,n.forEachNode(function(p,g){s[p]=u,c[u]=g.x,c[u+1]=g.y,c[u+2]=0,c[u+3]=0,c[u+4]=0,c[u+5]=0,c[u+6]=1,c[u+7]=1,c[u+8]=g.size||1,c[u+9]=g.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(p,g,m,b,y,S,k){var R=s[m],x=s[b],A=r(p,g,m,b,y,S,k);c[R+6]+=A,c[x+6]+=A,d[u]=R,d[u+1]=x,d[u+2]=A,u+=t}),{nodes:c,edges:d}},Ia.assignLayoutChanges=function(n,r,a){var o=0;n.updateEachNodeAttributes(function(s,u){return u.x=r[o],u.y=r[o+1],o+=e,a?a(s,u):u})},Ia.readGraphPositions=function(n,r){var a=0;n.forEachNode(function(o,s){r[a]=s.x,r[a+1]=s.y,a+=e})},Ia.collectLayoutChanges=function(n,r,a){for(var o=n.nodes(),s={},u=0,c=0,d=r.length;u2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(d)}}var u=o.bind(null,!1);return u.assign=o.bind(null,!0),u.inferSettings=s,Fm=u,Fm}var qne=$ne();const Vne=un(qne);var Pm,sO;function Wne(){return sO||(sO=1,Pm=function(){var t,n,r={};(function(){var o=0,s=1,u=2,c=3,d=4,p=5,g=6,m=7,b=8,y=9,S=0,k=1,R=2,x=0,A=1,C=2,N=3,_=4,O=5,F=6,D=7,L=8,G=3,$=10,U=3,W=9,Z=10;r.exports=function(H,z,Y){var I,V,B,M,K,J,le,oe,Q,pe,re=z.length,Ee=Y.length,we=H.adjustSizes,De=H.barnesHutTheta*H.barnesHutTheta,_e,Se,ee,fe,Te,be,xe,se=[];for(B=0;BWe?(me-=(Fe-We)/2,Ne=me+Fe):(ze-=(We-Fe)/2,Be=ze+We),se[0+x]=-1,se[0+A]=(ze+Be)/2,se[0+C]=(me+Ne)/2,se[0+N]=Math.max(Be-ze,Ne-me),se[0+_]=-1,se[0+O]=-1,se[0+F]=0,se[0+D]=0,se[0+L]=0,I=1,B=0;B=0){z[B+o]=0)if(be=Math.pow(z[B+o]-se[V+D],2)+Math.pow(z[B+s]-se[V+L],2),pe=se[V+N],4*pe*pe/be0?(xe=Se*z[B+g]*se[V+F]/be,z[B+u]+=ee*xe,z[B+c]+=fe*xe):be<0&&(xe=-Se*z[B+g]*se[V+F]/Math.sqrt(be),z[B+u]+=ee*xe,z[B+c]+=fe*xe):be>0&&(xe=Se*z[B+g]*se[V+F]/be,z[B+u]+=ee*xe,z[B+c]+=fe*xe),V=se[V+_],V<0)break;continue}else{V=se[V+O];continue}else{if(J=se[V+x],J>=0&&J!==B&&(ee=z[B+o]-z[J+o],fe=z[B+s]-z[J+s],be=ee*ee+fe*fe,we===!0?be>0?(xe=Se*z[B+g]*z[J+g]/be,z[B+u]+=ee*xe,z[B+c]+=fe*xe):be<0&&(xe=-Se*z[B+g]*z[J+g]/Math.sqrt(be),z[B+u]+=ee*xe,z[B+c]+=fe*xe):be>0&&(xe=Se*z[B+g]*z[J+g]/be,z[B+u]+=ee*xe,z[B+c]+=fe*xe)),V=se[V+_],V<0)break;continue}else for(Se=H.scalingRatio,M=0;M0?(xe=Se*z[M+g]*z[K+g]/be/be,z[M+u]+=ee*xe,z[M+c]+=fe*xe,z[K+u]-=ee*xe,z[K+c]-=fe*xe):be<0&&(xe=100*Se*z[M+g]*z[K+g],z[M+u]+=ee*xe,z[M+c]+=fe*xe,z[K+u]-=ee*xe,z[K+c]-=fe*xe)):(be=Math.sqrt(ee*ee+fe*fe),be>0&&(xe=Se*z[M+g]*z[K+g]/be/be,z[M+u]+=ee*xe,z[M+c]+=fe*xe,z[K+u]-=ee*xe,z[K+c]-=fe*xe));for(Q=H.gravity/H.scalingRatio,Se=H.scalingRatio,B=0;B0&&(xe=Se*z[B+g]*Q):be>0&&(xe=Se*z[B+g]*Q/be),z[B+u]-=ee*xe,z[B+c]-=fe*xe;for(Se=1*(H.outboundAttractionDistribution?_e:1),le=0;le0&&(xe=-Se*Te*Math.log(1+be)/be/z[M+g]):be>0&&(xe=-Se*Te*Math.log(1+be)/be):H.outboundAttractionDistribution?be>0&&(xe=-Se*Te/z[M+g]):be>0&&(xe=-Se*Te)):(be=Math.sqrt(Math.pow(ee,2)+Math.pow(fe,2)),H.linLogMode?H.outboundAttractionDistribution?be>0&&(xe=-Se*Te*Math.log(1+be)/be/z[M+g]):be>0&&(xe=-Se*Te*Math.log(1+be)/be):H.outboundAttractionDistribution?(be=1,xe=-Se*Te/z[M+g]):(be=1,xe=-Se*Te)),be>0&&(z[M+u]+=ee*xe,z[M+c]+=fe*xe,z[K+u]-=ee*xe,z[K+c]-=fe*xe);var yt,xt,ht,et,kt,ot;if(we===!0)for(B=0;BZ&&(z[B+u]=z[B+u]*Z/yt,z[B+c]=z[B+c]*Z/yt),xt=z[B+g]*Math.sqrt((z[B+d]-z[B+u])*(z[B+d]-z[B+u])+(z[B+p]-z[B+c])*(z[B+p]-z[B+c])),ht=Math.sqrt((z[B+d]+z[B+u])*(z[B+d]+z[B+u])+(z[B+p]+z[B+c])*(z[B+p]+z[B+c]))/2,et=.1*Math.log(1+ht)/(1+Math.sqrt(xt)),kt=z[B+o]+z[B+u]*(et/H.slowDown),z[B+o]=kt,ot=z[B+s]+z[B+c]*(et/H.slowDown),z[B+s]=ot);else for(B=0;B1&&Ee.has(xe))&&(z>1&&Ee.add(xe),Se=c[De+e],fe=c[De+t],be=c[De+n],se=Se-_e,ze=fe-ee,Be=Math.sqrt(se*se+ze*ze),me=Be0?(O[De]+=se/Be*(1+Te),F[De]+=ze/Be*(1+Te)):(O[De]+=U*o(),F[De]+=W*o())));for(y=0,S=0;y1&&Se.has(me))&&(B>1&&Se.add(me),be=m[fe+a],se=m[fe+o],Be=m[fe+s],Ne=be-Te,te=se-xe,ce=Math.sqrt(Ne*Ne+te*te),Ce=ce0?(G[fe]+=Ne/ce*(1+ze),$[fe]+=te/ce*(1+ze)):(G[fe]+=H*d(),$[fe]+=z*d())));for(x=0,A=0;x=0;)g=Wk(e,t,n,r,d+1,o+1,s),g>p&&(d===a?g*=mO:bre.test(e.charAt(d-1))?(g*=pre,b=e.slice(a,d-1).match(yre),b&&a>0&&(g*=Math.pow(Vm,b.length))):vre.test(e.charAt(d-1))?(g*=fre,y=e.slice(a,d-1).match(f5),y&&a>0&&(g*=Math.pow(Vm,y.length))):(g*=gre,a>0&&(g*=Math.pow(Vm,d-a))),e.charAt(d)!==t.charAt(o)&&(g*=hre)),(gg&&(g=m*qm)),g>p&&(p=g),d=n.indexOf(c,d+1);return s[u]=p,p}function bO(e){return e.toLowerCase().replace(f5," ")}function Sre(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Wk(e,t,bO(e),bO(t),0,0,{})}var Wm={exports:{}},Ym={};/**
+`);return a}var n5=.25,xne={arrowHead:null,curvatureAttribute:"curvature",defaultCurvature:n5},r5=WebGLRenderingContext,qN=r5.UNSIGNED_BYTE,So=r5.FLOAT;function xT(e){var t=Tf(Tf({},xne),e||{}),n=t,r=n.arrowHead,a=n.curvatureAttribute,o=n.drawLabel,s=(r==null?void 0:r.extremity)==="target"||(r==null?void 0:r.extremity)==="both",u=(r==null?void 0:r.extremity)==="source"||(r==null?void 0:r.extremity)==="both",c=["u_matrix","u_sizeRatio","u_dimensions","u_pixelRatio","u_feather","u_minEdgeThickness"].concat(km(r?["u_lengthToThicknessRatio","u_widenessToThicknessRatio"]:[]));return function(d){gne(p,d);function p(){var g;une(this,p);for(var m=arguments.length,b=new Array(m),y=0;y{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});Da(this,"getEdge",(t,n=!0)=>{const r=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(r!==void 0)return this.edges[r]});Da(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let t=0;t({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,moveToSelectedNode:!1,isFetching:!1,shouldRender:!1,graphDataFetchAttempted:!1,labelsFetchAttempted:!1,rawGraph:null,sigmaGraph:null,sigmaInstance:null,allDatabaseLabels:["*"],searchEngine:null,setIsFetching:t=>e({isFetching:t}),setShouldRender:t=>e({shouldRender:t}),setSelectedNode:(t,n)=>e({selectedNode:t,moveToSelectedNode:n}),setFocusedNode:t=>e({focusedNode:t}),setSelectedEdge:t=>e({selectedEdge:t}),setFocusedEdge:t=>e({focusedEdge:t}),clearSelection:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null}),reset:()=>{e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,rawGraph:null,sigmaGraph:null,searchEngine:null,moveToSelectedNode:!1,shouldRender:!1})},setRawGraph:t=>e({rawGraph:t}),setSigmaGraph:t=>{e({sigmaGraph:t})},setAllDatabaseLabels:t=>e({allDatabaseLabels:t}),fetchAllDatabaseLabels:async()=>{try{console.log("Fetching all database labels...");const t=await AV();e({allDatabaseLabels:["*",...t]});return}catch(t){throw console.error("Failed to fetch all database labels:",t),e({allDatabaseLabels:["*"]}),t}},setMoveToSelectedNode:t=>e({moveToSelectedNode:t}),setSigmaInstance:t=>e({sigmaInstance:t}),setSearchEngine:t=>e({searchEngine:t}),resetSearchEngine:()=>e({searchEngine:null}),setGraphDataFetchAttempted:t=>e({graphDataFetchAttempted:t}),setLabelsFetchAttempted:t=>e({labelsFetchAttempted:t}),nodeToExpand:null,nodeToPrune:null,triggerNodeExpand:t=>e({nodeToExpand:t}),triggerNodePrune:t=>e({nodeToPrune:t})})),Pe=C0(Rne),_ne=({node:e,move:t})=>{const n=Tr(),{gotoNode:r}=H4();return E.useEffect(()=>{const a=n.getGraph();if(t){if(e&&a.hasNode(e))try{a.setNodeAttribute(e,"highlighted",!0),r(e)}catch(o){console.error("Error focusing on node:",o)}else n.setCustomBBox(null),n.getCamera().animate({x:.5,y:.5,ratio:1},{duration:0});Pe.getState().setMoveToSelectedNode(!1)}else if(e&&a.hasNode(e))try{a.setNodeAttribute(e,"highlighted",!0)}catch(o){console.error("Error highlighting node:",o)}return()=>{if(e&&a.hasNode(e))try{a.setNodeAttribute(e,"highlighted",!1)}catch(o){console.error("Error cleaning up node highlight:",o)}}},[e,t,n,r]),null};function Js(e,t){const n=Tr(),r=E.useRef(t);return Ju(r.current,t)||(r.current=t),{positions:E.useCallback(()=>r.current?e(n.getGraph(),r.current):{},[n,r,e]),assign:E.useCallback(()=>{r.current&&e.assign(n.getGraph(),r.current)},[n,r,e])}}function kT(e,t){const n=Tr(),[r,a]=E.useState(!1),[o,s]=E.useState(null),u=E.useRef(t);return Ju(u.current,t)||(u.current=t),E.useEffect(()=>{a(!1);let c=null;return u.current&&(c=new e(n.getGraph(),u.current)),s(c),()=>{c!==null&&c.kill()}},[n,u,s,a,e]),{stop:E.useCallback(()=>{o&&(o.stop(),a(!1))},[o,a]),start:E.useCallback(()=>{o&&(o.start(),a(!0))},[o,a]),kill:E.useCallback(()=>{o&&o.kill(),a(!1)},[o,a]),isRunning:r}}var Tm,VN;function ec(){if(VN)return Tm;VN=1;function e(n){return!n||typeof n!="object"||typeof n=="function"||Array.isArray(n)||n instanceof Set||n instanceof Map||n instanceof RegExp||n instanceof Date}function t(n,r){n=n||{};var a={};for(var o in r){var s=n[o],u=r[o];if(!e(u)){a[o]=t(s,u);continue}s===void 0?a[o]=u:a[o]=s}return a}return Tm=t,Tm}var Am,WN;function Cne(){if(WN)return Am;WN=1;function e(n){return function(r,a){return r+Math.floor(n()*(a-r+1))}}var t=e(Math.random);return t.createRandom=e,Am=t,Am}var Rm,YN;function Nne(){if(YN)return Rm;YN=1;var e=Cne().createRandom;function t(r){var a=e(r);return function(o){for(var s=o.length,u=s-1,c=-1;++c0},a.prototype.addChild=function(O,F){this.children[O]=F,++this.countChildren},a.prototype.getChild=function(O){if(!this.children.hasOwnProperty(O)){var F=new a;this.children[O]=F,++this.countChildren}return this.children[O]},a.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var O=this;for(var F in O.children){var D=O.children[F];D.x+=O.x,D.y+=O.y,D.applyPositionToChildren()}}};function o(O,F,D){for(var L in F.children){var G=F.children[L];G.hasChildren()?o(O,G,D):D[G.id]={x:G.x,y:G.y}}}function s(O,F){var D=O.r-F.r,L=F.x-O.x,G=F.y-O.y;return D<0||D*D0&&D*D>L*L+G*G}function c(O,F){for(var D=0;DZ?(G=(j+Z-$)/(2*j),W=Math.sqrt(Math.max(0,Z/j-G*G)),D.x=O.x-G*L-W*U,D.y=O.y-G*U+W*L):(G=(j+$-Z)/(2*j),W=Math.sqrt(Math.max(0,$/j-G*G)),D.x=F.x+G*L-W*U,D.y=F.y+G*U+W*L)):(D.x=F.x+D.r,D.y=F.y)}function R(O,F){var D=O.r+F.r-1e-6,L=F.x-O.x,G=F.y-O.y;return D>0&&D*D>L*L+G*G}function x(O,F){var D=O.length;if(D===0)return 0;var L,G,$,U,W,Z,j,H,z,Y;if(L=O[0],L.x=0,L.y=0,D<=1)return L.r;if(G=O[1],L.x=-G.r,G.x=L.r,G.y=0,D<=2)return L.r+G.r;$=O[2],k(G,L,$),L=new a(null,null,null,null,L),G=new a(null,null,null,null,G),$=new a(null,null,null,null,$),L.next=$.previous=G,G.next=L.previous=$,$.next=G.previous=L;e:for(Z=3;Z"u"?a:d};typeof a=="function"&&(s=a);var u=function(d){return s(d[r])},c=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getNodeAttributes(p))},o.fromEntry=function(d,p){return u(p)}):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){return s(r(p,d.getNodeAttributes(p)))},o.fromEntry=function(d,p){return s(r(d,p))}):(o.fromAttributes=c,o.fromGraph=c,o.fromEntry=c),o}function n(r,a){var o={},s=function(d){return typeof d>"u"?a:d};typeof a=="function"&&(s=a);var u=function(d){return s(d[r])},c=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getEdgeAttributes(p))},o.fromEntry=function(d,p){return u(p)},o.fromPartialEntry=o.fromEntry,o.fromMinimalEntry=o.fromEntry):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){var g=d.extremities(p);return s(r(p,d.getEdgeAttributes(p),g[0],g[1],d.getNodeAttributes(g[0]),d.getNodeAttributes(g[1]),d.isUndirected(p)))},o.fromEntry=function(d,p,g,m,b,y,S){return s(r(d,p,g,m,b,y,S))},o.fromPartialEntry=function(d,p,g,m){return s(r(d,p,g,m))},o.fromMinimalEntry=function(d,p){return s(r(d,p))}):(o.fromAttributes=c,o.fromGraph=c,o.fromEntry=c,o.fromMinimalEntry=c),o}return lu.createNodeValueGetter=t,lu.createEdgeValueGetter=n,lu.createEdgeWeightGetter=function(r){return n(r,e)},lu}var Nm,QN;function a5(){if(QN)return Nm;QN=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=TT();return Nm=function(r,a,o){const{nodeXAttribute:s,nodeYAttribute:u}=o,{attraction:c,repulsion:d,gravity:p,inertia:g,maxMove:m}=o.settings;let{shouldSkipNode:b,shouldSkipEdge:y,isNodeFixed:S}=o;S=e(S),b=e(b,!1),y=t(y,!1);const k=r.filterNodes((A,C)=>!b.fromEntry(A,C)),R=k.length;for(let A=0;A{if(N===_||b.fromEntry(N,O)||b.fromEntry(_,F)||y.fromEntry(A,C,N,_,O,F,D))return;const L=a[N],G=a[_],$=G.x-L.x,U=G.y-L.y,W=Math.sqrt($*$+U*U)||1,Z=c*W*$,j=c*W*U;L.dx+=Z,L.dy+=j,G.dx-=Z,G.dy-=j}),p)for(let A=0;Am&&(N.dx*=m/_,N.dy*=m/_),S.fromGraph(r,C)?N.fixed=!0:(N.x+=N.dx,N.y+=N.dy,N.fixed=!1)}return{converged:x}},Nm}var Od={},JN;function o5(){return JN||(JN=1,Od.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:r,nodeYAttribute:a}=n;e.updateEachNodeAttributes((o,s)=>{const u=t[o];return!u||u.fixed||(s[r]=u.x,s[a]=u.y),s},{attributes:["x","y"]})},Od.collectLayoutChanges=function(e){const t={};for(const n in e){const r=e[n];t[n]={x:r.x,y:r.y}}return t}),Od}var Om,eO;function i5(){return eO||(eO=1,Om={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),Om}var Dm,tO;function Bne(){if(tO)return Dm;tO=1;const e=ca(),t=ec(),n=a5(),r=o5(),a=i5();function o(u,c,d){if(!e(c))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof d=="number"?d={maxIterations:d}:d=d||{};const p=d.maxIterations;if(d=t(d,a),typeof p!="number"||p<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const g={};let m=null,b;for(b=0;bthis.runFrame())},o.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},o.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},Im=o,Im}var Hne=Gne();const $ne=un(Hne);function qne(e={maxIterations:100}){return Js(jne,e)}function Vne(e={}){return kT($ne,e)}var Lm,rO;function Wne(){if(rO)return Lm;rO=1;var e=0,t=1,n=2,r=3,a=4,o=5,s=6,u=7,c=8,d=9,p=0,g=1,m=2,b=0,y=1,S=2,k=3,R=4,x=5,A=6,C=7,N=8,_=3,O=10,F=3,D=9,L=10;return Lm=function($,U,W){var Z,j,H,z,Y,I,V,B,M,K,J=U.length,le=W.length,oe=$.adjustSizes,Q=$.barnesHutTheta*$.barnesHutTheta,pe,re,Ee,we,De,_e,Se,ee=[];for(H=0;HNe?(be-=(me-Ne)/2,xe=be+me):(fe-=(Ne-me)/2,Te=fe+Ne),ee[0+b]=-1,ee[0+y]=(fe+Te)/2,ee[0+S]=(be+xe)/2,ee[0+k]=Math.max(Te-fe,xe-be),ee[0+R]=-1,ee[0+x]=-1,ee[0+A]=0,ee[0+C]=0,ee[0+N]=0,Z=1,H=0;H=0){U[H+e]=0)if(_e=Math.pow(U[H+e]-ee[j+C],2)+Math.pow(U[H+t]-ee[j+N],2),K=ee[j+k],4*K*K/_e0?(Se=re*U[H+s]*ee[j+A]/_e,U[H+n]+=Ee*Se,U[H+r]+=we*Se):_e<0&&(Se=-re*U[H+s]*ee[j+A]/Math.sqrt(_e),U[H+n]+=Ee*Se,U[H+r]+=we*Se):_e>0&&(Se=re*U[H+s]*ee[j+A]/_e,U[H+n]+=Ee*Se,U[H+r]+=we*Se),j=ee[j+R],j<0)break;continue}else{j=ee[j+x];continue}else{if(I=ee[j+b],I>=0&&I!==H&&(Ee=U[H+e]-U[I+e],we=U[H+t]-U[I+t],_e=Ee*Ee+we*we,oe===!0?_e>0?(Se=re*U[H+s]*U[I+s]/_e,U[H+n]+=Ee*Se,U[H+r]+=we*Se):_e<0&&(Se=-re*U[H+s]*U[I+s]/Math.sqrt(_e),U[H+n]+=Ee*Se,U[H+r]+=we*Se):_e>0&&(Se=re*U[H+s]*U[I+s]/_e,U[H+n]+=Ee*Se,U[H+r]+=we*Se)),j=ee[j+R],j<0)break;continue}else for(re=$.scalingRatio,z=0;z0?(Se=re*U[z+s]*U[Y+s]/_e/_e,U[z+n]+=Ee*Se,U[z+r]+=we*Se,U[Y+n]-=Ee*Se,U[Y+r]-=we*Se):_e<0&&(Se=100*re*U[z+s]*U[Y+s],U[z+n]+=Ee*Se,U[z+r]+=we*Se,U[Y+n]-=Ee*Se,U[Y+r]-=we*Se)):(_e=Math.sqrt(Ee*Ee+we*we),_e>0&&(Se=re*U[z+s]*U[Y+s]/_e/_e,U[z+n]+=Ee*Se,U[z+r]+=we*Se,U[Y+n]-=Ee*Se,U[Y+r]-=we*Se));for(M=$.gravity/$.scalingRatio,re=$.scalingRatio,H=0;H0&&(Se=re*U[H+s]*M):_e>0&&(Se=re*U[H+s]*M/_e),U[H+n]-=Ee*Se,U[H+r]-=we*Se;for(re=1*($.outboundAttractionDistribution?pe:1),V=0;V0&&(Se=-re*De*Math.log(1+_e)/_e/U[z+s]):_e>0&&(Se=-re*De*Math.log(1+_e)/_e):$.outboundAttractionDistribution?_e>0&&(Se=-re*De/U[z+s]):_e>0&&(Se=-re*De)):(_e=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),$.linLogMode?$.outboundAttractionDistribution?_e>0&&(Se=-re*De*Math.log(1+_e)/_e/U[z+s]):_e>0&&(Se=-re*De*Math.log(1+_e)/_e):$.outboundAttractionDistribution?(_e=1,Se=-re*De/U[z+s]):(_e=1,Se=-re*De)),_e>0&&(U[z+n]+=Ee*Se,U[z+r]+=we*Se,U[Y+n]-=Ee*Se,U[Y+r]-=we*Se);var te,ce,Ce,Fe,We,yt;if(oe===!0)for(H=0;HL&&(U[H+n]=U[H+n]*L/te,U[H+r]=U[H+r]*L/te),ce=U[H+s]*Math.sqrt((U[H+a]-U[H+n])*(U[H+a]-U[H+n])+(U[H+o]-U[H+r])*(U[H+o]-U[H+r])),Ce=Math.sqrt((U[H+a]+U[H+n])*(U[H+a]+U[H+n])+(U[H+o]+U[H+r])*(U[H+o]+U[H+r]))/2,Fe=.1*Math.log(1+Ce)/(1+Math.sqrt(ce)),We=U[H+e]+U[H+n]*(Fe/$.slowDown),U[H+e]=We,yt=U[H+t]+U[H+r]*(Fe/$.slowDown),U[H+t]=yt);else for(H=0;H=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in n&&typeof n.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in n&&!(typeof n.gravity=="number"&&n.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in n&&!(typeof n.slowDown=="number"||n.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in n&&typeof n.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in n&&!(typeof n.barnesHutTheta=="number"&&n.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},La.graphToByteArrays=function(n,r){var a=n.order,o=n.size,s={},u,c=new Float32Array(a*e),d=new Float32Array(o*t);return u=0,n.forEachNode(function(p,g){s[p]=u,c[u]=g.x,c[u+1]=g.y,c[u+2]=0,c[u+3]=0,c[u+4]=0,c[u+5]=0,c[u+6]=1,c[u+7]=1,c[u+8]=g.size||1,c[u+9]=g.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(p,g,m,b,y,S,k){var R=s[m],x=s[b],A=r(p,g,m,b,y,S,k);c[R+6]+=A,c[x+6]+=A,d[u]=R,d[u+1]=x,d[u+2]=A,u+=t}),{nodes:c,edges:d}},La.assignLayoutChanges=function(n,r,a){var o=0;n.updateEachNodeAttributes(function(s,u){return u.x=r[o],u.y=r[o+1],o+=e,a?a(s,u):u})},La.readGraphPositions=function(n,r){var a=0;n.forEachNode(function(o,s){r[a]=s.x,r[a+1]=s.y,a+=e})},La.collectLayoutChanges=function(n,r,a){for(var o=n.nodes(),s={},u=0,c=0,d=r.length;u