@visulima/vis 1.0.0-alpha.3 → 1.0.0-alpha.30

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 (172) hide show
  1. package/CHANGELOG.md +1117 -24
  2. package/LICENSE.md +11958 -0
  3. package/README.md +344 -20
  4. package/dashboard/dist/index.html +152 -0
  5. package/dist/bin.js +1 -146
  6. package/dist/binx.js +3 -0
  7. package/dist/config/index.d.ts +3154 -0
  8. package/dist/config/index.js +1 -0
  9. package/dist/generate/index.d.ts +157 -0
  10. package/dist/generate/index.js +1 -0
  11. package/dist/packem_chunks/bin.js +1415 -0
  12. package/dist/packem_chunks/bloom-status.js +2 -0
  13. package/dist/packem_chunks/bloom-sync.js +2 -0
  14. package/dist/packem_chunks/cache-attestation.js +1 -0
  15. package/dist/packem_chunks/config.js +19 -0
  16. package/dist/packem_chunks/devtools.js +82 -0
  17. package/dist/packem_chunks/doctor-probe.js +2 -0
  18. package/dist/packem_chunks/fix.js +11 -0
  19. package/dist/packem_chunks/handler.js +1 -0
  20. package/dist/packem_chunks/handler10.js +1 -0
  21. package/dist/packem_chunks/handler11.js +5 -0
  22. package/dist/packem_chunks/handler12.js +1 -0
  23. package/dist/packem_chunks/handler13.js +27 -0
  24. package/dist/packem_chunks/handler14.js +5 -0
  25. package/dist/packem_chunks/handler15.js +1 -0
  26. package/dist/packem_chunks/handler16.js +1 -0
  27. package/dist/packem_chunks/handler17.js +1 -0
  28. package/dist/packem_chunks/handler18.js +1 -0
  29. package/dist/packem_chunks/handler19.js +1 -0
  30. package/dist/packem_chunks/handler2.js +4 -0
  31. package/dist/packem_chunks/handler20.js +5 -0
  32. package/dist/packem_chunks/handler21.js +2 -0
  33. package/dist/packem_chunks/handler22.js +2 -0
  34. package/dist/packem_chunks/handler23.js +1 -0
  35. package/dist/packem_chunks/handler24.js +1 -0
  36. package/dist/packem_chunks/handler25.js +5 -0
  37. package/dist/packem_chunks/handler26.js +1 -0
  38. package/dist/packem_chunks/handler27.js +3 -0
  39. package/dist/packem_chunks/handler28.js +1 -0
  40. package/dist/packem_chunks/handler29.js +7 -0
  41. package/dist/packem_chunks/handler3.js +4 -0
  42. package/dist/packem_chunks/handler30.js +33 -0
  43. package/dist/packem_chunks/handler31.js +3 -0
  44. package/dist/packem_chunks/handler32.js +8 -0
  45. package/dist/packem_chunks/handler33.js +1 -0
  46. package/dist/packem_chunks/handler34.js +5 -0
  47. package/dist/packem_chunks/handler35.js +11 -0
  48. package/dist/packem_chunks/handler36.js +3 -0
  49. package/dist/packem_chunks/handler37.js +22 -0
  50. package/dist/packem_chunks/handler38.js +61 -0
  51. package/dist/packem_chunks/handler39.js +3 -0
  52. package/dist/packem_chunks/handler4.js +6 -0
  53. package/dist/packem_chunks/handler40.js +6 -0
  54. package/dist/packem_chunks/handler41.js +24 -0
  55. package/dist/packem_chunks/handler42.js +153 -0
  56. package/dist/packem_chunks/handler43.js +25 -0
  57. package/dist/packem_chunks/handler44.js +10 -0
  58. package/dist/packem_chunks/handler45.js +708 -0
  59. package/dist/packem_chunks/handler46.js +24 -0
  60. package/dist/packem_chunks/handler47.js +322 -0
  61. package/dist/packem_chunks/handler48.js +48 -0
  62. package/dist/packem_chunks/handler49.js +3 -0
  63. package/dist/packem_chunks/handler5.js +8 -0
  64. package/dist/packem_chunks/handler50.js +27 -0
  65. package/dist/packem_chunks/handler51.js +195 -0
  66. package/dist/packem_chunks/handler52.js +34 -0
  67. package/dist/packem_chunks/handler6.js +1 -0
  68. package/dist/packem_chunks/handler7.js +1 -0
  69. package/dist/packem_chunks/handler8.js +1 -0
  70. package/dist/packem_chunks/handler9.js +1 -0
  71. package/dist/packem_chunks/heal-accept.js +10 -0
  72. package/dist/packem_chunks/heal.js +14 -0
  73. package/dist/packem_chunks/help-command.js +8 -0
  74. package/dist/packem_chunks/index.js +7 -0
  75. package/dist/packem_chunks/keys-refresh.js +4 -0
  76. package/dist/packem_chunks/list.js +3 -0
  77. package/dist/packem_chunks/loader.js +4 -0
  78. package/dist/packem_chunks/loader2.js +1 -0
  79. package/dist/packem_chunks/prune.js +3 -0
  80. package/dist/packem_chunks/run.js +1 -0
  81. package/dist/packem_chunks/status.js +2 -0
  82. package/dist/packem_chunks/sync.js +2 -0
  83. package/dist/packem_chunks/sync2.js +2 -0
  84. package/dist/packem_chunks/tar.js +3 -0
  85. package/dist/packem_chunks/tripwire.js +2 -0
  86. package/dist/packem_chunks/verify-lockfile.js +2 -0
  87. package/dist/packem_shared/Table-DoSoazT6-DwnyTUsA.js +12 -0
  88. package/dist/packem_shared/_commonjsHelpers-CLblCigl.js +1 -0
  89. package/dist/packem_shared/advisories-BxXiKFbL.js +1 -0
  90. package/dist/packem_shared/affected-shas-BdnlfiV1.js +1 -0
  91. package/dist/packem_shared/ai-analysis-KP8b5lc0.js +68 -0
  92. package/dist/packem_shared/ai-fix-BkPUHA0z.js +43 -0
  93. package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
  94. package/dist/packem_shared/applyDefaults-BogleaFi.js +1 -0
  95. package/dist/packem_shared/build-scripts-DE6U8jVq.js +1 -0
  96. package/dist/packem_shared/cyclonedx-BpGVHqSW.js +4 -0
  97. package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
  98. package/dist/packem_shared/dependency-scan-BUbOcMwX.js +1 -0
  99. package/dist/packem_shared/docker-CTE3s4LW.js +60 -0
  100. package/dist/packem_shared/failure-log-34Wl3npC.js +2 -0
  101. package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
  102. package/dist/packem_shared/glob-D_7bct6p-D8itOHsr.js +1 -0
  103. package/dist/packem_shared/index-D1xC1Y_R.js +1 -0
  104. package/dist/packem_shared/index-DH-5hsrC.js +1 -0
  105. package/dist/packem_shared/index-hoWfZmNo.js +30 -0
  106. package/dist/packem_shared/license-zZU7aavK.js +1 -0
  107. package/dist/packem_shared/lifecycle-CXaqPGAQ.js +2 -0
  108. package/dist/packem_shared/lockfile-CrT86D6d.js +1 -0
  109. package/dist/packem_shared/lockfile-Cu2BH6bl.js +1 -0
  110. package/dist/packem_shared/manifests-BzWpKW8F.js +1 -0
  111. package/dist/packem_shared/min-release-age-BPVXwPUg.js +34 -0
  112. package/dist/packem_shared/native-config-sync-BRZZetn3.js +21 -0
  113. package/dist/packem_shared/osv-bloom-DSZcHLsM.js +2 -0
  114. package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
  115. package/dist/packem_shared/peer-warnings-EvSJ18gE.js +1 -0
  116. package/dist/packem_shared/pm-runner-DmKT2FqF.js +1 -0
  117. package/dist/packem_shared/provenance-DkCA8BrN.js +1 -0
  118. package/dist/packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js +1 -0
  119. package/dist/packem_shared/registry-keys-Mixm4eAY.js +1 -0
  120. package/dist/packem_shared/resolve-explicit-D5E72FfN.js +5 -0
  121. package/dist/packem_shared/runtime-check-CilFOqUU.js +1 -0
  122. package/dist/packem_shared/s1ngularity-Qxc6tRRI.js +1 -0
  123. package/dist/packem_shared/scan-progress-DVtCtI2z.js +2 -0
  124. package/dist/packem_shared/selectors-DkgYFzdq.js +3 -0
  125. package/dist/packem_shared/signatures-byuFrtAH.js +2 -0
  126. package/dist/packem_shared/spinner-C8xs6QZv.js +1 -0
  127. package/dist/packem_shared/spinners-f91Rbo99-Bjf3NcO0.js +1 -0
  128. package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
  129. package/dist/packem_shared/tabs-xZkm6Y_J.js +1 -0
  130. package/dist/packem_shared/toolchain-DoG6b_G_.js +5 -0
  131. package/dist/packem_shared/typosquats-BiDxQj7R.js +1 -0
  132. package/dist/packem_shared/use-measured-height-Lea6TCVD.js +1 -0
  133. package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
  134. package/dist/packem_shared/verify-cLcZwKqe.js +1 -0
  135. package/dist/packem_shared/vis-update-app-BCKzlqj8.js +1 -0
  136. package/dist/packem_shared/watch-DEL0yol9.js +1 -0
  137. package/dist/packem_shared/watch-loop-C31Ar7BX.js +11 -0
  138. package/index.d.ts +436 -0
  139. package/index.js +613 -0
  140. package/package.json +71 -26
  141. package/schemas/project.schema.json +991 -0
  142. package/schemas/vis-config.schema.json +4958 -0
  143. package/skills/vis/SKILL.md +96 -0
  144. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  145. package/templates/buildkite-ci/template.yml +20 -0
  146. package/dist/ai-analysis.d.ts +0 -40
  147. package/dist/ai-cache.d.ts +0 -21
  148. package/dist/bin.d.ts +0 -1
  149. package/dist/catalog.d.ts +0 -110
  150. package/dist/commands/affected.d.ts +0 -3
  151. package/dist/commands/ai.d.ts +0 -3
  152. package/dist/commands/analyze.d.ts +0 -3
  153. package/dist/commands/check.d.ts +0 -3
  154. package/dist/commands/graph.d.ts +0 -3
  155. package/dist/commands/hook/constants.d.ts +0 -8
  156. package/dist/commands/hook/index.d.ts +0 -3
  157. package/dist/commands/hook/install.d.ts +0 -7
  158. package/dist/commands/hook/migrate.d.ts +0 -27
  159. package/dist/commands/hook/uninstall.d.ts +0 -3
  160. package/dist/commands/migrate/constants.d.ts +0 -12
  161. package/dist/commands/migrate/deps.d.ts +0 -32
  162. package/dist/commands/migrate/index.d.ts +0 -3
  163. package/dist/commands/migrate/json.d.ts +0 -20
  164. package/dist/commands/migrate/lint-staged.d.ts +0 -62
  165. package/dist/commands/migrate/types.d.ts +0 -20
  166. package/dist/commands/run.d.ts +0 -3
  167. package/dist/commands/staged.d.ts +0 -3
  168. package/dist/commands/update.d.ts +0 -3
  169. package/dist/config.d.ts +0 -40
  170. package/dist/config.js +0 -1
  171. package/dist/package-manager.d.ts +0 -23
  172. package/dist/workspace.d.ts +0 -58
@@ -0,0 +1,708 @@
1
+ var Fr=Object.defineProperty;var b=(n,e)=>Fr(n,"name",{value:e,configurable:!0});import{createRequire as Pr}from"node:module";import{E as ie,j as le,q as ft}from"../packem_shared/Table-DoSoazT6-DwnyTUsA.js";import{projectGraphToDot as Hr}from"@visulima/task-runner";import{a5 as h,a6 as $,n as y,aG as Vr,aH as Kr,aI as Xr,aF as Yr,w as te,af as Qr,aJ as Jr,aK as mt,C as Zr,S as ei,k as ti,R as ri,s as ii}from"./bin.js";import{g as di}from"../packem_shared/_commonjsHelpers-CLblCigl.js";import{d as ci}from"../packem_shared/anolilab-text-CAM_E6uK.js";const Wr=Pr(import.meta.url),_e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qe=b(n=>{if(typeof _e<"u"&&_e.versions&&_e.versions.node){const[e,t]=_e.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return _e.getBuiltinModule(n)}return Wr(n)},"__cjs_getBuiltinModule"),{readFileSync:qr,writeFileSync:Br}=qe("node:fs"),{createRequire:ni}=qe("node:module"),{join:oi,dirname:ai}=qe("node:path"),{EventEmitter:si}=qe("events");var li=Object.defineProperty,w=b((n,e)=>li(n,"name",{value:e,configurable:!0}),"h");function _t(){const n=arguments[0];for(let e=1,t=arguments.length;e<t;e++)if(arguments[e])for(const r in arguments[e])n[r]=arguments[e][r];return n}b(_t,"ft");w(_t,"assignPolyfill");let H=_t;typeof Object.assign=="function"&&(H=Object.assign);function Z(n,e,t,r){const i=n._nodes.get(e);let o=null;return i&&(r==="mixed"?o=i.out&&i.out[t]||i.undirected&&i.undirected[t]:r==="directed"?o=i.out&&i.out[t]:o=i.undirected&&i.undirected[t]),o}b(Z,"D$1");w(Z,"getMatchingEdge");function V(n){return typeof n=="object"&&n!==null}b(V,"G$1");w(V,"isPlainObject");function st(n){let e;for(e in n)return!1;return!0}b(st,"tt");w(st,"isEmpty");function J(n,e,t){Object.defineProperty(n,e,{enumerable:!1,configurable:!1,writable:!0,value:t})}b(J,"x");w(J,"privateProperty");function re(n,e,t){const r={enumerable:!0,configurable:!0};typeof t=="function"?r.get=t:(r.value=t,r.writable=!1),Object.defineProperty(n,e,r)}b(re,"A$1");w(re,"readOnlyProperty");function nt(n){return!(!V(n)||n.attributes&&!Array.isArray(n.attributes))}b(nt,"Q");w(nt,"validateHints");function Dt(){let n=Math.floor(Math.random()*256)&255;return()=>n++}b(Dt,"pt");w(Dt,"incrementalIdStartingFromRandomByte");function oe(){const n=arguments;let e=null,t=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(e===null){if(t++,t>=n.length)return{done:!0};e=n[t][Symbol.iterator]()}if(r=e.next(),r.done){e=null;continue}break}while(!0);return r}}}b(oe,"N$1");w(oe,"chain");function me(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}b(me,"L$2");w(me,"emptyIterator");let dt=class extends Error{static{b(this,"P")}static{w(this,"GraphError")}constructor(e){super(),this.name="GraphError",this.message=e}},E=class Mt extends dt{static{b(this,"g")}static{w(this,"InvalidArgumentsGraphError")}constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Mt.prototype.constructor)}},v=class It extends dt{static{b(this,"p")}static{w(this,"NotFoundGraphError")}constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,It.prototype.constructor)}},C=class Lt extends dt{static{b(this,"y")}static{w(this,"UsageGraphError")}constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Lt.prototype.constructor)}};function ct(n,e){this.key=n,this.attributes=e,this.clear()}b(ct,"et");w(ct,"MixedNodeData");ct.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function lt(n,e){this.key=n,this.attributes=e,this.clear()}b(lt,"it");w(lt,"DirectedNodeData");lt.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function ht(n,e){this.key=n,this.attributes=e,this.clear()}b(ht,"nt");w(ht,"UndirectedNodeData");ht.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function be(n,e,t,r,i){this.key=e,this.attributes=i,this.undirected=n,this.source=t,this.target=r}b(be,"M$1");w(be,"EdgeData");be.prototype.attach=function(){let n="out",e="in";this.undirected&&(n=e="undirected");const t=this.source.key,r=this.target.key;this.source[n][r]=this,!(this.undirected&&t===r)&&(this.target[e][t]=this)};be.prototype.attachMulti=function(){let n="out",e="in";const t=this.source.key,r=this.target.key;this.undirected&&(n=e="undirected");const i=this.source[n],o=i[r];if(typeof o>"u"){i[r]=this,this.undirected&&t===r||(this.target[e][t]=this);return}o.previous=this,this.next=o,i[r]=this,this.target[e][t]=this};be.prototype.detach=function(){const n=this.source.key,e=this.target.key;let t="out",r="in";this.undirected&&(t=r="undirected"),delete this.source[t][e],delete this.target[r][n]};be.prototype.detachMulti=function(){const n=this.source.key,e=this.target.key;let t="out",r="in";this.undirected&&(t=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][e],delete this.target[r][n]):(this.next.previous=void 0,this.source[t][e]=this.next,this.target[r][n]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Tt=0,Ot=1,hi=2,zt=3;function ae(n,e,t,r,i,o,a){let s,d,c,u;if(r=""+r,t===Tt){if(s=n._nodes.get(r),!s)throw new v(`Graph.${e}: could not find the "${r}" node in the graph.`);c=i,u=o}else if(t===zt){if(i=""+i,d=n._edges.get(i),!d)throw new v(`Graph.${e}: could not find the "${i}" edge in the graph.`);const l=d.source.key,g=d.target.key;if(r===l)s=d.target;else if(r===g)s=d.source;else throw new v(`Graph.${e}: the "${r}" node is not attached to the "${i}" edge (${l}, ${g}).`);c=o,u=a}else{if(d=n._edges.get(r),!d)throw new v(`Graph.${e}: could not find the "${r}" edge in the graph.`);t===Ot?s=d.source:s=d.target,c=i,u=o}return[s,c,u]}b(ae,"S$2");w(ae,"findRelevantNodeData");function Rt(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);return a.attributes[s]}}b(Rt,"gt");w(Rt,"attachNodeAttributeGetter");function Ut(n,e,t){n.prototype[e]=function(r,i){const[o]=ae(this,e,t,r,i);return o.attributes}}b(Ut,"yt");w(Ut,"attachNodeAttributesGetter");function Ft(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);return a.attributes.hasOwnProperty(s)}}b(Ft,"wt");w(Ft,"attachNodeAttributeChecker");function Pt(n,e,t){n.prototype[e]=function(r,i,o,a){const[s,d,c]=ae(this,e,t,r,i,o,a);return s.attributes[d]=c,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:d}),this}}b(Pt,"mt");w(Pt,"attachNodeAttributeSetter");function Wt(n,e,t){n.prototype[e]=function(r,i,o,a){const[s,d,c]=ae(this,e,t,r,i,o,a);if(typeof c!="function")throw new E(`Graph.${e}: updater should be a function.`);const u=s.attributes,l=c(u[d]);return u[d]=l,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:d}),this}}b(Wt,"bt");w(Wt,"attachNodeAttributeUpdater");function qt(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);return delete a.attributes[s],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:s}),this}}b(qt,"$t");w(qt,"attachNodeAttributeRemover");function Bt(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);if(!V(s))throw new E(`Graph.${e}: provided attributes are not a plain object.`);return a.attributes=s,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}b(Bt,"Gt");w(Bt,"attachNodeAttributesReplacer");function Ht(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);if(!V(s))throw new E(`Graph.${e}: provided attributes are not a plain object.`);return H(a.attributes,s),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:s}),this}}b(Ht,"Et");w(Ht,"attachNodeAttributesMerger");function Vt(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);if(typeof s!="function")throw new E(`Graph.${e}: provided updater is not a function.`);return a.attributes=s(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}b(Vt,"kt");w(Vt,"attachNodeAttributesUpdater");const pi=[{name:w(n=>`get${n}Attribute`,"name"),attacher:Rt},{name:w(n=>`get${n}Attributes`,"name"),attacher:Ut},{name:w(n=>`has${n}Attribute`,"name"),attacher:Ft},{name:w(n=>`set${n}Attribute`,"name"),attacher:Pt},{name:w(n=>`update${n}Attribute`,"name"),attacher:Wt},{name:w(n=>`remove${n}Attribute`,"name"),attacher:qt},{name:w(n=>`replace${n}Attributes`,"name"),attacher:Bt},{name:w(n=>`merge${n}Attributes`,"name"),attacher:Ht},{name:w(n=>`update${n}Attributes`,"name"),attacher:Vt}];function Kt(n){pi.forEach(function({name:e,attacher:t}){t(n,e("Node"),Tt),t(n,e("Source"),Ot),t(n,e("Target"),hi),t(n,e("Opposite"),zt)})}b(Kt,"xt");w(Kt,"attachNodeAttributesMethods");function Xt(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new C(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new C(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=Z(this,a,s,t),!o)throw new v(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new C(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new v(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return o.attributes[i]}}b(Xt,"Dt");w(Xt,"attachEdgeAttributeGetter");function Yt(n,e,t){n.prototype[e]=function(r){let i;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new C(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new C(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+arguments[1];if(i=Z(this,o,a,t),!i)throw new v(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(t!=="mixed")throw new C(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new v(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return i.attributes}}b(Yt,"At");w(Yt,"attachEdgeAttributesGetter");function Qt(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new C(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new C(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=Z(this,a,s,t),!o)throw new v(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new C(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new v(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return o.attributes.hasOwnProperty(i)}}b(Qt,"vt");w(Qt,"attachEdgeAttributeChecker");function Jt(n,e,t){n.prototype[e]=function(r,i,o){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new C(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new C(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,d=""+i;if(i=arguments[2],o=arguments[3],a=Z(this,s,d,t),!a)throw new v(`Graph.${e}: could not find an edge for the given path ("${s}" - "${d}").`)}else{if(t!=="mixed")throw new C(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new v(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return a.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:i}),this}}b(Jt,"Nt");w(Jt,"attachEdgeAttributeSetter");function Zt(n,e,t){n.prototype[e]=function(r,i,o){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new C(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new C(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,d=""+i;if(i=arguments[2],o=arguments[3],a=Z(this,s,d,t),!a)throw new v(`Graph.${e}: could not find an edge for the given path ("${s}" - "${d}").`)}else{if(t!=="mixed")throw new C(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new v(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof o!="function")throw new E(`Graph.${e}: updater should be a function.`);return a.attributes[i]=o(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:i}),this}}b(Zt,"St");w(Zt,"attachEdgeAttributeUpdater");function er(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new C(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new C(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=Z(this,a,s,t),!o)throw new v(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new C(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new v(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:i}),this}}b(er,"Ut");w(er,"attachEdgeAttributeRemover");function tr(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new C(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new C(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=Z(this,a,s,t),!o)throw new v(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new C(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new v(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!V(i))throw new E(`Graph.${e}: provided attributes are not a plain object.`);return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}b(tr,"Lt");w(tr,"attachEdgeAttributesReplacer");function rr(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new C(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new C(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=Z(this,a,s,t),!o)throw new v(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new C(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new v(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!V(i))throw new E(`Graph.${e}: provided attributes are not a plain object.`);return H(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:i}),this}}b(rr,"Mt");w(rr,"attachEdgeAttributesMerger");function ir(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new C(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new C(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=Z(this,a,s,t),!o)throw new v(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new C(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new v(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new E(`Graph.${e}: provided updater is not a function.`);return o.attributes=i(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}b(ir,"Ct");w(ir,"attachEdgeAttributesUpdater");const ui=[{name:w(n=>`get${n}Attribute`,"name"),attacher:Xt},{name:w(n=>`get${n}Attributes`,"name"),attacher:Yt},{name:w(n=>`has${n}Attribute`,"name"),attacher:Qt},{name:w(n=>`set${n}Attribute`,"name"),attacher:Jt},{name:w(n=>`update${n}Attribute`,"name"),attacher:Zt},{name:w(n=>`remove${n}Attribute`,"name"),attacher:er},{name:w(n=>`replace${n}Attributes`,"name"),attacher:tr},{name:w(n=>`merge${n}Attributes`,"name"),attacher:rr},{name:w(n=>`update${n}Attributes`,"name"),attacher:ir}];function nr(n){ui.forEach(function({name:e,attacher:t}){t(n,e("Edge"),"mixed"),t(n,e("DirectedEdge"),"directed"),t(n,e("UndirectedEdge"),"undirected")})}b(nr,"It");w(nr,"attachEdgeAttributesMethods");const gi=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function or(n,e,t,r){let i=!1;for(const o in e){if(o===r)continue;const a=e[o];if(i=t(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),n&&i)return a.key}}b(or,"Ot");w(or,"forEachSimple");function ar(n,e,t,r){let i,o,a,s=!1;for(const d in e)if(d!==r){i=e[d];do{if(o=i.source,a=i.target,s=t(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected),n&&s)return i.key;i=i.next}while(i!==void 0)}}b(ar,"Wt");w(ar,"forEachMulti");function Pe(n,e){const t=Object.keys(n),r=t.length;let i,o=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(o>=r)return{done:!0};const a=t[o++];if(a===e){i=void 0;continue}i=n[a]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}b(Pe,"K");w(Pe,"createIterator");function sr(n,e,t,r){const i=e[t];if(!i)return;const o=i.source,a=i.target;if(r(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected)&&n)return i.key}b(sr,"Kt");w(sr,"forEachForKeySimple");function dr(n,e,t,r){let i=e[t];if(!i)return;let o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),n&&o)return i.key;i=i.next}while(i!==void 0)}b(dr,"Tt");w(dr,"forEachForKeyMulti");function We(n,e){let t=n[e];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const i={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:i}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}b(We,"T$3");w(We,"createIteratorForKey");function cr(n,e){if(n.size===0)return[];if(e==="mixed"||e===n.type)return Array.from(n._edges.keys());const t=e==="undirected"?n.undirectedSize:n.directedSize,r=new Array(t),i=e==="undirected",o=n._edges.values();let a=0,s,d;for(;s=o.next(),s.done!==!0;)d=s.value,d.undirected===i&&(r[a++]=d.key);return r}b(cr,"Pt");w(cr,"createEdgeArray");function pt(n,e,t,r){if(e.size===0)return;const i=t!=="mixed"&&t!==e.type,o=t==="undirected";let a,s,d=!1;const c=e._edges.values();for(;a=c.next(),a.done!==!0;){if(s=a.value,i&&s.undirected!==o)continue;const{key:u,attributes:l,source:g,target:x}=s;if(d=r(u,l,g.key,x.key,g.attributes,x.attributes,s.undirected),n&&d)return u}}b(pt,"at");w(pt,"forEachEdge");function lr(n,e){if(n.size===0)return me();const t=e!=="mixed"&&e!==n.type,r=e==="undirected",i=n._edges.values();return{[Symbol.iterator](){return this},next(){let o,a;for(;;){if(o=i.next(),o.done)return o;if(a=o.value,!(t&&a.undirected!==r))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected},done:!1}}}}b(lr,"Ft");w(lr,"createEdgeIterator");function Be(n,e,t,r,i,o){const a=e?ar:or;let s;if(t!=="undirected"&&(r!=="out"&&(s=a(n,i.in,o),n&&s)||r!=="in"&&(s=a(n,i.out,o,r?void 0:i.key),n&&s))||t!=="directed"&&(s=a(n,i.undirected,o),n&&s))return s}b(Be,"F$1");w(Be,"forEachEdgeForNode");function hr(n,e,t,r){const i=[];return Be(!1,n,e,t,r,function(o){i.push(o)}),i}b(hr,"Bt");w(hr,"createEdgeArrayForNode");function pr(n,e,t){let r=me();return n!=="undirected"&&(e!=="out"&&typeof t.in<"u"&&(r=oe(r,Pe(t.in))),e!=="in"&&typeof t.out<"u"&&(r=oe(r,Pe(t.out,e?void 0:t.key)))),n!=="directed"&&typeof t.undirected<"u"&&(r=oe(r,Pe(t.undirected))),r}b(pr,"Rt");w(pr,"createEdgeIteratorForNode");function He(n,e,t,r,i,o,a){const s=t?dr:sr;let d;if(e!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(d=s(n,i.in,o,a),n&&d)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==o)&&(d=s(n,i.out,o,a),n&&d))||e!=="directed"&&typeof i.undirected<"u"&&(d=s(n,i.undirected,o,a),n&&d))return d}b(He,"B");w(He,"forEachEdgeForPath");function ur(n,e,t,r,i){const o=[];return He(!1,n,e,t,r,i,function(a){o.push(a)}),o}b(ur,"Yt");w(ur,"createEdgeArrayForPath");function gr(n,e,t,r){let i=me();return n!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&r in t.in&&(i=oe(i,We(t.in,r))),typeof t.out<"u"&&e!=="in"&&r in t.out&&(e||t.key!==r)&&(i=oe(i,We(t.out,r)))),n!=="directed"&&typeof t.undirected<"u"&&r in t.undirected&&(i=oe(i,We(t.undirected,r))),i}b(gr,"Ht");w(gr,"createEdgeIteratorForPath");function fr(n,e){const{name:t,type:r,direction:i}=e;n.prototype[t]=function(o,a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return cr(this,r);if(arguments.length===1){o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new v(`Graph.${t}: could not find the "${o}" node in the graph.`);return hr(this.multi,r==="mixed"?this.type:r,i,s)}if(arguments.length===2){o=""+o,a=""+a;const s=this._nodes.get(o);if(!s)throw new v(`Graph.${t}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(a))throw new v(`Graph.${t}: could not find the "${a}" target node in the graph.`);return ur(r,this.multi,i,s,a)}throw new E(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}b(fr,"Jt");w(fr,"attachEdgeArrayCreator");function mr(n,e){const{name:t,type:r,direction:i}=e,o="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(c,u,l){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return l=c,pt(!1,this,r,l);if(arguments.length===2){c=""+c,l=u;const g=this._nodes.get(c);if(typeof g>"u")throw new v(`Graph.${o}: could not find the "${c}" node in the graph.`);return Be(!1,this.multi,r==="mixed"?this.type:r,i,g,l)}if(arguments.length===3){c=""+c,u=""+u;const g=this._nodes.get(c);if(!g)throw new v(`Graph.${o}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(u))throw new v(`Graph.${o}: could not find the "${u}" target node in the graph.`);return He(!1,r,this.multi,i,g,u,l)}throw new E(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const a="map"+t[0].toUpperCase()+t.slice(1);n.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),u=c.pop();let l;if(c.length===0){let g=0;r!=="directed"&&(g+=this.undirectedSize),r!=="undirected"&&(g+=this.directedSize),l=new Array(g);let x=0;c.push((j,A,G,D,R,U,T)=>{l[x++]=u(j,A,G,D,R,U,T)})}else l=[],c.push((g,x,j,A,G,D,R)=>{l.push(u(g,x,j,A,G,D,R))});return this[o].apply(this,c),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(){const c=Array.prototype.slice.call(arguments),u=c.pop(),l=[];return c.push((g,x,j,A,G,D,R)=>{u(g,x,j,A,G,D,R)&&l.push(g)}),this[o].apply(this,c),l};const d="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[d]=function(){let c=Array.prototype.slice.call(arguments);if(c.length<2||c.length>4)throw new E(`Graph.${d}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new E(`Graph.${d}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let u,l;c.length===2?(u=c[0],l=c[1],c=[]):c.length===3?(u=c[1],l=c[2],c=[c[0]]):c.length===4&&(u=c[2],l=c[3],c=[c[0],c[1]]);let g=l;return c.push((x,j,A,G,D,R,U)=>{g=u(g,x,j,A,G,D,R,U)}),this[o].apply(this,c),g}}b(mr,"Vt");w(mr,"attachForEachEdge");function br(n,e){const{name:t,type:r,direction:i}=e,o="find"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(d,c,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return u=d,pt(!0,this,r,u);if(arguments.length===2){d=""+d,u=c;const l=this._nodes.get(d);if(typeof l>"u")throw new v(`Graph.${o}: could not find the "${d}" node in the graph.`);return Be(!0,this.multi,r==="mixed"?this.type:r,i,l,u)}if(arguments.length===3){d=""+d,c=""+c;const l=this._nodes.get(d);if(!l)throw new v(`Graph.${o}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(c))throw new v(`Graph.${o}: could not find the "${c}" target node in the graph.`);return He(!0,r,this.multi,i,l,c,u)}throw new E(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const a="some"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(){const d=Array.prototype.slice.call(arguments),c=d.pop();return d.push((u,l,g,x,j,A,G)=>c(u,l,g,x,j,A,G)),!!this[o].apply(this,d)};const s="every"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[s]=function(){const d=Array.prototype.slice.call(arguments),c=d.pop();return d.push((u,l,g,x,j,A,G)=>!c(u,l,g,x,j,A,G)),!this[o].apply(this,d)}}b(br,"qt");w(br,"attachFindEdge");function wr(n,e){const{name:t,type:r,direction:i}=e,o=t.slice(0,-1)+"Entries";n.prototype[o]=function(a,s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return me();if(!arguments.length)return lr(this,r);if(arguments.length===1){a=""+a;const d=this._nodes.get(a);if(!d)throw new v(`Graph.${o}: could not find the "${a}" node in the graph.`);return pr(r,i,d)}if(arguments.length===2){a=""+a,s=""+s;const d=this._nodes.get(a);if(!d)throw new v(`Graph.${o}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(s))throw new v(`Graph.${o}: could not find the "${s}" target node in the graph.`);return gr(r,i,d,s)}throw new E(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}b(wr,"Qt");w(wr,"attachEdgeIteratorCreator");function yr(n){gi.forEach(e=>{fr(n,e),mr(n,e),br(n,e),wr(n,e)})}b(yr,"Xt");w(yr,"attachEdgeIterationMethods");const fi=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Ie(){this.A=null,this.B=null}b(Ie,"W");w(Ie,"CompositeSetWrapper");Ie.prototype.wrap=function(n){this.A===null?this.A=n:this.B===null&&(this.B=n)};Ie.prototype.has=function(n){return this.A!==null&&n in this.A||this.B!==null&&n in this.B};function $e(n,e,t,r,i){for(const o in r){const a=r[o],s=a.source,d=a.target,c=s===t?d:s;if(e&&e.has(c.key))continue;const u=i(c.key,c.attributes);if(n&&u)return c.key}}b($e,"I$1");w($e,"forEachInObjectOnce");function Ve(n,e,t,r,i){if(e!=="mixed"){if(e==="undirected")return $e(n,null,r,r.undirected,i);if(typeof t=="string")return $e(n,null,r,r[t],i)}const o=new Ie;let a;if(e!=="undirected"){if(t!=="out"){if(a=$e(n,null,r,r.in,i),n&&a)return a;o.wrap(r.in)}if(t!=="in"){if(a=$e(n,o,r,r.out,i),n&&a)return a;o.wrap(r.out)}}if(e!=="directed"&&(a=$e(n,o,r,r.undirected,i),n&&a))return a}b(Ve,"R$1");w(Ve,"forEachNeighbor");function xr(n,e,t){if(n!=="mixed"){if(n==="undirected")return Object.keys(t.undirected);if(typeof e=="string")return Object.keys(t[e])}const r=[];return Ve(!1,n,e,t,function(i){r.push(i)}),r}b(xr,"te$1");w(xr,"createNeighborArrayForNode");function Ge(n,e,t){const r=Object.keys(t),i=r.length;let o=0;return{[Symbol.iterator](){return this},next(){let a=null;do{if(o>=i)return n&&n.wrap(t),{done:!0};const s=t[r[o++]],d=s.source,c=s.target;if(a=d===e?c:d,n&&n.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}}}b(Ge,"j");w(Ge,"createDedupedObjectIterator");function vr(n,e,t){if(n!=="mixed"){if(n==="undirected")return Ge(null,t,t.undirected);if(typeof e=="string")return Ge(null,t,t[e])}let r=me();const i=new Ie;return n!=="undirected"&&(e!=="out"&&(r=oe(r,Ge(i,t,t.in))),e!=="in"&&(r=oe(r,Ge(i,t,t.out)))),n!=="directed"&&(r=oe(r,Ge(i,t,t.undirected))),r}b(vr,"ee$1");w(vr,"createNeighborIterator");function kr(n,e){const{name:t,type:r,direction:i}=e;n.prototype[t]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];o=""+o;const a=this._nodes.get(o);if(typeof a>"u")throw new v(`Graph.${t}: could not find the "${o}" node in the graph.`);return xr(r==="mixed"?this.type:r,i,a)}}b(kr,"ie");w(kr,"attachNeighborArrayCreator");function Er(n,e){const{name:t,type:r,direction:i}=e,o="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(c,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;const l=this._nodes.get(c);if(typeof l>"u")throw new v(`Graph.${o}: could not find the "${c}" node in the graph.`);Ve(!1,r==="mixed"?this.type:r,i,l,u)};const a="map"+t[0].toUpperCase()+t.slice(1);n.prototype[a]=function(c,u){const l=[];return this[o](c,(g,x)=>{l.push(u(g,x))}),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(c,u){const l=[];return this[o](c,(g,x)=>{u(g,x)&&l.push(g)}),l};const d="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[d]=function(c,u,l){if(arguments.length<3)throw new E(`Graph.${d}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let g=l;return this[o](c,(x,j)=>{g=u(g,x,j)}),g}}b(Er,"ne");w(Er,"attachForEachNeighbor");function $r(n,e){const{name:t,type:r,direction:i}=e,o=t[0].toUpperCase()+t.slice(1,-1),a="find"+o;n.prototype[a]=function(c,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;const l=this._nodes.get(c);if(typeof l>"u")throw new v(`Graph.${a}: could not find the "${c}" node in the graph.`);return Ve(!0,r==="mixed"?this.type:r,i,l,u)};const s="some"+o;n.prototype[s]=function(c,u){return!!this[a](c,u)};const d="every"+o;n.prototype[d]=function(c,u){return!this[a](c,(l,g)=>!u(l,g))}}b($r,"re");w($r,"attachFindNeighbor");function Gr(n,e){const{name:t,type:r,direction:i}=e,o=t.slice(0,-1)+"Entries";n.prototype[o]=function(a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return me();a=""+a;const s=this._nodes.get(a);if(typeof s>"u")throw new v(`Graph.${o}: could not find the "${a}" node in the graph.`);return vr(r==="mixed"?this.type:r,i,s)}}b(Gr,"oe");w(Gr,"attachNeighborIteratorCreator");function jr(n){fi.forEach(e=>{kr(n,e),Er(n,e),$r(n,e),Gr(n,e)})}b(jr,"se");w(jr,"attachNeighborIterationMethods");function Me(n,e,t,r,i){const o=r._nodes.values(),a=r.type;let s,d,c,u,l,g,x;for(;s=o.next(),s.done!==!0;){let j=!1;if(d=s.value,a!=="undirected"){u=d.out;for(c in u){l=u[c];do{if(g=l.target,j=!0,x=i(d.key,g.key,d.attributes,g.attributes,l.key,l.attributes,l.undirected),n&&x)return l;l=l.next}while(l)}}if(a!=="directed"){u=d.undirected;for(c in u)if(!(e&&d.key>c)){l=u[c];do{if(g=l.target,g.key!==c&&(g=l.source),j=!0,x=i(d.key,g.key,d.attributes,g.attributes,l.key,l.attributes,l.undirected),n&&x)return l;l=l.next}while(l)}}if(t&&!j&&(x=i(d.key,null,d.attributes,null,null,null,null),n&&x))return null}}b(Me,"O");w(Me,"forEachAdjacency");function Ar(n,e){const t={key:n};return st(e.attributes)||(t.attributes=H({},e.attributes)),t}b(Ar,"ae");w(Ar,"serializeNode");function Sr(n,e,t){const r={key:e,source:t.source.key,target:t.target.key};return st(t.attributes)||(r.attributes=H({},t.attributes)),n==="mixed"&&t.undirected&&(r.undirected=!0),r}b(Sr,"ue");w(Sr,"serializeEdge");function Nr(n){if(!V(n))throw new E('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in n))throw new E("Graph.import: serialized node is missing its key.");if("attributes"in n&&(!V(n.attributes)||n.attributes===null))throw new E("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}b(Nr,"de");w(Nr,"validateSerializedNode");function Cr(n){if(!V(n))throw new E('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in n))throw new E("Graph.import: serialized edge is missing its source.");if(!("target"in n))throw new E("Graph.import: serialized edge is missing its target.");if("attributes"in n&&(!V(n.attributes)||n.attributes===null))throw new E("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in n&&typeof n.undirected!="boolean")throw new E("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}b(Cr,"he");w(Cr,"validateSerializedEdge");const mi=Dt(),bi=new Set(["directed","undirected","mixed"]),bt=new Set(["domain","_events","_eventsCount","_maxListeners"]),wi=[{name:w(n=>`${n}Edge`,"name"),generateKey:!0},{name:w(n=>`${n}DirectedEdge`,"name"),generateKey:!0,type:"directed"},{name:w(n=>`${n}UndirectedEdge`,"name"),generateKey:!0,type:"undirected"},{name:w(n=>`${n}EdgeWithKey`,"name")},{name:w(n=>`${n}DirectedEdgeWithKey`,"name"),type:"directed"},{name:w(n=>`${n}UndirectedEdgeWithKey`,"name"),type:"undirected"}],yi={allowSelfLoops:!0,multi:!1,type:"mixed"};function _r(n,e,t){if(t&&!V(t))throw new E(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(e=""+e,t=t||{},n._nodes.has(e))throw new C(`Graph.addNode: the "${e}" node already exist in the graph.`);const r=new n.NodeDataClass(e,t);return n._nodes.set(e,r),n.emit("nodeAdded",{key:e,attributes:t}),r}b(_r,"ge");w(_r,"addNode");function ot(n,e,t){const r=new n.NodeDataClass(e,t);return n._nodes.set(e,r),n.emit("nodeAdded",{key:e,attributes:t}),r}b(ot,"Z");w(ot,"unsafeAddNode");function ut(n,e,t,r,i,o,a,s){if(!r&&n.type==="undirected")throw new C(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&n.type==="directed")throw new C(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!V(s))throw new E(`Graph.${e}: invalid attributes. Expecting an object but got "${s}"`);if(o=""+o,a=""+a,s=s||{},!n.allowSelfLoops&&o===a)throw new C(`Graph.${e}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const d=n._nodes.get(o),c=n._nodes.get(a);if(!d)throw new v(`Graph.${e}: source node "${o}" not found.`);if(!c)throw new v(`Graph.${e}: target node "${a}" not found.`);const u={key:null,undirected:r,source:o,target:a,attributes:s};if(t)i=n._edgeKeyGenerator();else if(i=""+i,n._edges.has(i))throw new C(`Graph.${e}: the "${i}" edge already exists in the graph.`);if(!n.multi&&(r?typeof d.undirected[a]<"u":typeof d.out[a]<"u"))throw new C(`Graph.${e}: an edge linking "${o}" to "${a}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const l=new be(r,i,d,c,s);n._edges.set(i,l);const g=o===a;return r?(d.undirectedDegree++,c.undirectedDegree++,g&&(d.undirectedLoops++,n._undirectedSelfLoopCount++)):(d.outDegree++,c.inDegree++,g&&(d.directedLoops++,n._directedSelfLoopCount++)),n.multi?l.attachMulti():l.attach(),r?n._undirectedSize++:n._directedSize++,u.key=i,n.emit("edgeAdded",u),i}b(ut,"ut");w(ut,"addEdge");function Dr(n,e,t,r,i,o,a,s,d){if(!r&&n.type==="undirected")throw new C(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&n.type==="directed")throw new C(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(d){if(typeof s!="function")throw new E(`Graph.${e}: invalid updater function. Expecting a function but got "${s}"`)}else if(!V(s))throw new E(`Graph.${e}: invalid attributes. Expecting an object but got "${s}"`)}o=""+o,a=""+a;let c;if(d&&(c=s,s=void 0),!n.allowSelfLoops&&o===a)throw new C(`Graph.${e}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=n._nodes.get(o),l=n._nodes.get(a),g,x;if(!t&&(g=n._edges.get(i),g)){if((g.source.key!==o||g.target.key!==a)&&(!r||g.source.key!==a||g.target.key!==o))throw new C(`Graph.${e}: inconsistency detected when attempting to merge the "${i}" edge with "${o}" source & "${a}" target vs. ("${g.source.key}", "${g.target.key}").`);x=g}if(!x&&!n.multi&&u&&(x=r?u.undirected[a]:u.out[a]),x){const R=[x.key,!1,!1,!1];if(d?!c:!s)return R;if(d){const U=x.attributes;x.attributes=c(U),n.emit("edgeAttributesUpdated",{type:"replace",key:x.key,attributes:x.attributes})}else H(x.attributes,s),n.emit("edgeAttributesUpdated",{type:"merge",key:x.key,attributes:x.attributes,data:s});return R}s=s||{},d&&c&&(s=c(s));const j={key:null,undirected:r,source:o,target:a,attributes:s};if(t)i=n._edgeKeyGenerator();else if(i=""+i,n._edges.has(i))throw new C(`Graph.${e}: the "${i}" edge already exists in the graph.`);let A=!1,G=!1;u||(u=ot(n,o,{}),A=!0,o===a&&(l=u,G=!0)),l||(l=ot(n,a,{}),G=!0),g=new be(r,i,u,l,s),n._edges.set(i,g);const D=o===a;return r?(u.undirectedDegree++,l.undirectedDegree++,D&&(u.undirectedLoops++,n._undirectedSelfLoopCount++)):(u.outDegree++,l.inDegree++,D&&(u.directedLoops++,n._directedSelfLoopCount++)),n.multi?g.attachMulti():g.attach(),r?n._undirectedSize++:n._directedSize++,j.key=i,n.emit("edgeAdded",j),[i,!0,A,G]}b(Dr,"ye");w(Dr,"mergeEdge");function fe(n,e){n._edges.delete(e.key);const{source:t,target:r,attributes:i}=e,o=e.undirected,a=t===r;o?(t.undirectedDegree--,r.undirectedDegree--,a&&(t.undirectedLoops--,n._undirectedSelfLoopCount--)):(t.outDegree--,r.inDegree--,a&&(t.directedLoops--,n._directedSelfLoopCount--)),n.multi?e.detachMulti():e.detach(),o?n._undirectedSize--:n._directedSize--,n.emit("edgeDropped",{key:e.key,attributes:i,source:t.key,target:r.key,undirected:o})}b(fe,"U$1");w(fe,"dropEdgeFromData");let P=class at extends si{static{b(this,"m")}static{w(this,"Graph")}constructor(e){if(super(),e=H({},yi,e),typeof e.multi!="boolean")throw new E(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!bi.has(e.type))throw new E(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new E(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const t=e.type==="mixed"?ct:e.type==="directed"?lt:ht;J(this,"NodeDataClass",t);const r="geid_"+mi()+"_";let i=0;const o=w(()=>{let a;do a=r+i++;while(this._edges.has(a));return a},"edgeKeyGenerator");J(this,"_attributes",{}),J(this,"_nodes",new Map),J(this,"_edges",new Map),J(this,"_directedSize",0),J(this,"_undirectedSize",0),J(this,"_directedSelfLoopCount",0),J(this,"_undirectedSelfLoopCount",0),J(this,"_edgeKeyGenerator",o),J(this,"_options",e),bt.forEach(a=>J(this,a,this[a])),re(this,"order",()=>this._nodes.size),re(this,"size",()=>this._edges.size),re(this,"directedSize",()=>this._directedSize),re(this,"undirectedSize",()=>this._undirectedSize),re(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),re(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),re(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),re(this,"multi",this._options.multi),re(this,"type",this._options.type),re(this,"allowSelfLoops",this._options.allowSelfLoops),re(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?r.out.hasOwnProperty(t):!1}throw new E(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?r.undirected.hasOwnProperty(t):!1}throw new E(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){const r=""+e;return this._edges.has(r)}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?typeof r.out<"u"&&r.out.hasOwnProperty(t)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(t):!1}throw new E(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type==="undirected")return;if(e=""+e,t=""+t,this.multi)throw new C("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(e);if(!r)throw new v(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new v(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const i=r.out&&r.out[t]||void 0;if(i)return i.key}undirectedEdge(e,t){if(this.type==="directed")return;if(e=""+e,t=""+t,this.multi)throw new C("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(e);if(!r)throw new v(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new v(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const i=r.undirected&&r.undirected[t]||void 0;if(i)return i.key}edge(e,t){if(this.multi)throw new C("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new v(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new v(`Graph.edge: could not find the "${t}" target node in the graph.`);const i=r.out&&r.out[t]||r.undirected&&r.undirected[t]||void 0;if(i)return i.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new v(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.in||t in r.out}areOutNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new v(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.out}areInNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new v(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new v(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:t in r.undirected}areNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new v(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(t in r.in||t in r.out)||this.type!=="directed"&&t in r.undirected}areInboundNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new v(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in r.in||this.type!=="directed"&&t in r.undirected}areOutboundNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new v(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in r.out||this.type!=="directed"&&t in r.undirected}inDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.inDegree),r}outboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.outDegree),r}degree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.degree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.inDegree+t.outDegree),r}inDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.inDegree,i+=t.directedLoops),r-i}outboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.outDegree,i+=t.directedLoops),r-i}degreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.inDegree+t.outDegree,i+=t.directedLoops*2),r-i}source(e){e=""+e;const t=this._edges.get(e);if(!t)throw new v(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=""+e;const t=this._edges.get(e);if(!t)throw new v(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=""+e;const t=this._edges.get(e);if(!t)throw new v(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=""+e,t=""+t;const r=this._edges.get(t);if(!r)throw new v(`Graph.opposite: could not find the "${t}" edge in the graph.`);const i=r.source.key,o=r.target.key;if(e===i)return o;if(e===o)return i;throw new v(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${i}, ${o}).`)}hasExtremity(e,t){e=""+e,t=""+t;const r=this._edges.get(e);if(!r)throw new v(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return r.source.key===t||r.target.key===t}isUndirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new v(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new v(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=""+e;const t=this._edges.get(e);if(!t)throw new v(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return _r(this,e,t).key}mergeNode(e,t){if(t&&!V(t))throw new E(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let r=this._nodes.get(e);return r?(t&&(H(r.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:r.attributes,data:t})),[e,!1]):(r=new this.NodeDataClass(e,t),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!="function")throw new E(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let r=this._nodes.get(e);if(r){if(t){const o=r.attributes;r.attributes=t(o),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:r.attributes})}return[e,!1]}const i=t?t({}):{};return r=new this.NodeDataClass(e,i),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:i}),[e,!0]}dropNode(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new v(`Graph.dropNode: could not find the "${e}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in t.out){r=t.out[i];do fe(this,r),r=r.next;while(r)}for(const i in t.in){r=t.in[i];do fe(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in t.undirected){r=t.undirected[i];do fe(this,r),r=r.next;while(r)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(t=Z(this,r,i,this.type),!t)throw new v(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new v(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return fe(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new C("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new C("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;const r=Z(this,e,t,"directed");if(!r)throw new v(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return fe(this,r),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new C("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new C("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=Z(this,e,t,"undirected");if(!r)throw new v(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return fe(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!="function")throw new E("Graph.updateAttribute: updater should be a function.");const r=this._attributes[e];return this._attributes[e]=t(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!V(e))throw new E("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!V(e))throw new E("Graph.mergeAttributes: provided attributes are not a plain object.");return H(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new E("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!="function")throw new E("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!nt(t))throw new E("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,o.attributes=e(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!="function")throw new E("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!nt(t))throw new E("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,o,a,s;for(;i=r.next(),i.done!==!0;)o=i.value,a=o.source,s=o.target,o.attributes=e(o.key,o.attributes,a.key,s.key,a.attributes,s.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new E("Graph.forEachAdjacencyEntry: expecting a callback.");Me(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new E("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Me(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new E("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Me(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new E("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Me(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!="function")throw new E("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)}findNode(e){if(typeof e!="function")throw new E("Graph.findNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return i.key}mapNodes(e){if(typeof e!="function")throw new E("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let r,i;const o=new Array(this.order);let a=0;for(;r=t.next(),r.done!==!0;)i=r.value,o[a++]=e(i.key,i.attributes);return o}someNode(e){if(typeof e!="function")throw new E("Graph.someNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new E("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new E("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let r,i;const o=[];for(;r=t.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)&&o.push(i.key);return o}reduceNodes(e,t){if(typeof e!="function")throw new E("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new E("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=t;const i=this._nodes.values();let o,a;for(;o=i.next(),o.done!==!0;)a=o.value,r=e(r,a.key,a.attributes);return r}nodeEntries(){const e=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=e.next();if(t.done)return t;const r=t.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const e=new Array(this._nodes.size);let t=0;this._nodes.forEach((i,o)=>{e[t++]=Ar(o,i)});const r=new Array(this._edges.size);return t=0,this._edges.forEach((i,o)=>{r[t++]=Sr(this.type,o,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}}import(e,t=!1){if(e instanceof at)return e.forEachNode((d,c)=>{t?this.mergeNode(d,c):this.addNode(d,c)}),e.forEachEdge((d,c,u,l,g,x,j)=>{t?j?this.mergeUndirectedEdgeWithKey(d,u,l,c):this.mergeDirectedEdgeWithKey(d,u,l,c):j?this.addUndirectedEdgeWithKey(d,u,l,c):this.addDirectedEdgeWithKey(d,u,l,c)}),this;if(!V(e))throw new E("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!V(e.attributes))throw new E("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let r,i,o,a,s;if(e.nodes){if(o=e.nodes,!Array.isArray(o))throw new E("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=o.length;r<i;r++){a=o[r],Nr(a);const{key:d,attributes:c}=a;t?this.mergeNode(d,c):this.addNode(d,c)}}if(e.edges){let d=!1;if(this.type==="undirected"&&(d=!0),o=e.edges,!Array.isArray(o))throw new E("Graph.import: invalid edges. Expecting an array.");for(r=0,i=o.length;r<i;r++){s=o[r],Cr(s);const{source:c,target:u,attributes:l,undirected:g=d}=s;let x;"key"in s?(x=t?g?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:g?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,x.call(this,s.key,c,u,l)):(x=t?g?this.mergeUndirectedEdge:this.mergeDirectedEdge:g?this.addUndirectedEdge:this.addDirectedEdge,x.call(this,c,u,l))}}return this}nullCopy(e){const t=new at(H({},this._options,e));return t.replaceAttributes(H({},this.getAttributes())),t}emptyCopy(e){const t=this.nullCopy(e);return this._nodes.forEach((r,i)=>{const o=H({},r.attributes);r=new t.NodeDataClass(i,o),t._nodes.set(i,r)}),t}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new C(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new C("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new C("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(e),r=this._edges.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,ut(t,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,H({},o.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((o,a)=>{e[a]=o.attributes});const t={},r={};this._edges.forEach((o,a)=>{const s=o.undirected?"--":"->";let d="",c=o.source.key,u=o.target.key,l;o.undirected&&c>u&&(l=c,c=u,u=l);const g=`(${c})${s}(${u})`;a.startsWith("geid_")?this.multi&&(typeof r[g]>"u"?r[g]=0:r[g]++,d+=`${r[g]}. `):d+=`[${a}]: `,d+=g,t[d]=o.attributes});const i={};for(const o in this)this.hasOwnProperty(o)&&!bt.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=e,i.edges=t,J(i,"constructor",this.constructor),i}};typeof Symbol<"u"&&(P.prototype[Symbol.for("nodejs.util.inspect.custom")]=P.prototype.inspect);wi.forEach(n=>{["add","merge","update"].forEach(e=>{const t=n.name(e),r=e==="add"?ut:Dr;n.generateKey?P.prototype[t]=function(i,o,a){return r(this,t,!0,(n.type||this.type)==="undirected",null,i,o,a,e==="update")}:P.prototype[t]=function(i,o,a,s){return r(this,t,!1,(n.type||this.type)==="undirected",i,o,a,s,e==="update")}})});Kt(P);nr(P);yr(P);jr(P);class Mr extends P{static{b(this,"Y")}static{w(this,"DirectedGraph")}constructor(e){const t=H({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new E("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new E('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}let Ir=class extends P{static{b(this,"H")}static{w(this,"UndirectedGraph")}constructor(e){const t=H({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new E("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new E('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}},Lr=class extends P{static{b(this,"J")}static{w(this,"MultiGraph")}constructor(e){const t=H({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new E("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}};class Tr extends P{static{b(this,"V")}static{w(this,"MultiDirectedGraph")}constructor(e){const t=H({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new E("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new E('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Or extends P{static{b(this,"q")}static{w(this,"MultiUndirectedGraph")}constructor(e){const t=H({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new E("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new E('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function we(n){n.from=function(e,t){const r=H({},e.options,t),i=new n(r);return i.import(e),i}}b(we,"C$1");w(we,"attachStaticFromMethod");we(P);we(Mr);we(Ir);we(Lr);we(Tr);we(Or);P.Graph=P;P.DirectedGraph=Mr;P.UndirectedGraph=Ir;P.MultiGraph=Lr;P.MultiDirectedGraph=Tr;P.MultiUndirectedGraph=Or;P.InvalidArgumentsGraphError=E;P.NotFoundGraphError=v;P.UsageGraphError=C;var et,wt;function xi(){if(wt)return et;wt=1;var n=Object.defineProperty,e=b((t,r)=>n(t,"name",{value:r,configurable:!0}),"e");return et=e(function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"},"isGraph"),et}b(xi,"requireIsGraph");var De={},yt;function vi(){if(yt)return De;yt=1;var n=Object.defineProperty,e=b((o,a)=>n(o,"name",{value:a,configurable:!0}),"o");function t(o){return typeof o!="number"||isNaN(o)?1:o}b(t,"coerceWeight"),e(t,"coerceWeight");function r(o,a){var s={},d=e(function(l){return typeof l>"u"?a:l},"coerceToDefault");typeof a=="function"&&(d=a);var c=e(function(l){return d(l[o])},"get"),u=e(function(){return d(void 0)},"returnDefault");return typeof o=="string"?(s.fromAttributes=c,s.fromGraph=function(l,g){return c(l.getNodeAttributes(g))},s.fromEntry=function(l,g){return c(g)}):typeof o=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(l,g){return d(o(g,l.getNodeAttributes(g)))},s.fromEntry=function(l,g){return d(o(l,g))}):(s.fromAttributes=u,s.fromGraph=u,s.fromEntry=u),s}b(r,"createNodeValueGetter"),e(r,"createNodeValueGetter");function i(o,a){var s={},d=e(function(l){return typeof l>"u"?a:l},"coerceToDefault");typeof a=="function"&&(d=a);var c=e(function(l){return d(l[o])},"get"),u=e(function(){return d(void 0)},"returnDefault");return typeof o=="string"?(s.fromAttributes=c,s.fromGraph=function(l,g){return c(l.getEdgeAttributes(g))},s.fromEntry=function(l,g){return c(g)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof o=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(l,g){var x=l.extremities(g);return d(o(g,l.getEdgeAttributes(g),x[0],x[1],l.getNodeAttributes(x[0]),l.getNodeAttributes(x[1]),l.isUndirected(g)))},s.fromEntry=function(l,g,x,j,A,G,D){return d(o(l,g,x,j,A,G,D))},s.fromPartialEntry=function(l,g,x,j){return d(o(l,g,x,j))},s.fromMinimalEntry=function(l,g){return d(o(l,g))}):(s.fromAttributes=u,s.fromGraph=u,s.fromEntry=u,s.fromMinimalEntry=u),s}return b(i,"createEdgeValueGetter"),e(i,"createEdgeValueGetter"),De.createNodeValueGetter=r,De.createEdgeValueGetter=i,De.createEdgeWeightGetter=function(o){return i(o,t)},De}b(vi,"requireGetters");var tt,xt;function ki(){if(xt)return tt;xt=1;var n=Object.defineProperty,e=b((N,p)=>n(N,"name",{value:p,configurable:!0}),"$"),t=0,r=1,i=2,o=3,a=4,s=5,d=6,c=7,u=8,l=9,g=0,x=1,j=2,A=0,G=1,D=2,R=3,U=4,T=5,B=6,Y=7,Q=8,Se=3,X=10,Ye=3,I=9,L=10;return tt=e(function(N,p,ye){var Qe,k,f,F,q,he,xe,K,M,Je,ne=p.length,Rr=ye.length,Ne=N.adjustSizes,Ur=N.barnesHutTheta*N.barnesHutTheta,Le,W,O,z,se,_,S,m=[];for(f=0;f<ne;f+=X)p[f+a]=p[f+i],p[f+s]=p[f+o],p[f+i]=0,p[f+o]=0;if(N.outboundAttractionDistribution){for(Le=0,f=0;f<ne;f+=X)Le+=p[f+d];Le/=ne/X}if(N.barnesHutOptimize){var pe=1/0,ve=-1/0,ue=1/0,ke=-1/0,ee,Ee,Ze;for(f=0;f<ne;f+=X)pe=Math.min(pe,p[f+t]),ve=Math.max(ve,p[f+t]),ue=Math.min(ue,p[f+r]),ke=Math.max(ke,p[f+r]);var Te=ve-pe,Oe=ke-ue;for(Te>Oe?(ue-=(Te-Oe)/2,ke=ue+Te):(pe-=(Oe-Te)/2,ve=pe+Oe),m[0+A]=-1,m[0+G]=(pe+ve)/2,m[0+D]=(ue+ke)/2,m[0+R]=Math.max(ve-pe,ke-ue),m[0+U]=-1,m[0+T]=-1,m[0+B]=0,m[0+Y]=0,m[0+Q]=0,Qe=1,f=0;f<ne;f+=X)for(k=0,Ze=Se;;)if(m[k+T]>=0){p[f+t]<m[k+G]?p[f+r]<m[k+D]?ee=m[k+T]:ee=m[k+T]+I:p[f+r]<m[k+D]?ee=m[k+T]+I*2:ee=m[k+T]+I*3,m[k+Y]=(m[k+Y]*m[k+B]+p[f+t]*p[f+d])/(m[k+B]+p[f+d]),m[k+Q]=(m[k+Q]*m[k+B]+p[f+r]*p[f+d])/(m[k+B]+p[f+d]),m[k+B]+=p[f+d],k=ee;continue}else if(m[k+A]<0){m[k+A]=f;break}else{if(m[k+T]=Qe*I,K=m[k+R]/2,M=m[k+T],m[M+A]=-1,m[M+G]=m[k+G]-K,m[M+D]=m[k+D]-K,m[M+R]=K,m[M+U]=M+I,m[M+T]=-1,m[M+B]=0,m[M+Y]=0,m[M+Q]=0,M+=I,m[M+A]=-1,m[M+G]=m[k+G]-K,m[M+D]=m[k+D]+K,m[M+R]=K,m[M+U]=M+I,m[M+T]=-1,m[M+B]=0,m[M+Y]=0,m[M+Q]=0,M+=I,m[M+A]=-1,m[M+G]=m[k+G]+K,m[M+D]=m[k+D]-K,m[M+R]=K,m[M+U]=M+I,m[M+T]=-1,m[M+B]=0,m[M+Y]=0,m[M+Q]=0,M+=I,m[M+A]=-1,m[M+G]=m[k+G]+K,m[M+D]=m[k+D]+K,m[M+R]=K,m[M+U]=m[k+U],m[M+T]=-1,m[M+B]=0,m[M+Y]=0,m[M+Q]=0,Qe+=4,p[m[k+A]+t]<m[k+G]?p[m[k+A]+r]<m[k+D]?ee=m[k+T]:ee=m[k+T]+I:p[m[k+A]+r]<m[k+D]?ee=m[k+T]+I*2:ee=m[k+T]+I*3,m[k+B]=p[m[k+A]+d],m[k+Y]=p[m[k+A]+t],m[k+Q]=p[m[k+A]+r],m[ee+A]=m[k+A],m[k+A]=-1,p[f+t]<m[k+G]?p[f+r]<m[k+D]?Ee=m[k+T]:Ee=m[k+T]+I:p[f+r]<m[k+D]?Ee=m[k+T]+I*2:Ee=m[k+T]+I*3,ee===Ee)if(Ze--){k=ee;continue}else{Ze=Se;break}m[Ee+A]=f;break}}if(N.barnesHutOptimize)for(W=N.scalingRatio,f=0;f<ne;f+=X)for(k=0;;)if(m[k+T]>=0)if(_=Math.pow(p[f+t]-m[k+Y],2)+Math.pow(p[f+r]-m[k+Q],2),Je=m[k+R],4*Je*Je/_<Ur){if(O=p[f+t]-m[k+Y],z=p[f+r]-m[k+Q],Ne===!0?_>0?(S=W*p[f+d]*m[k+B]/_,p[f+i]+=O*S,p[f+o]+=z*S):_<0&&(S=-W*p[f+d]*m[k+B]/Math.sqrt(_),p[f+i]+=O*S,p[f+o]+=z*S):_>0&&(S=W*p[f+d]*m[k+B]/_,p[f+i]+=O*S,p[f+o]+=z*S),k=m[k+U],k<0)break;continue}else{k=m[k+T];continue}else{if(he=m[k+A],he>=0&&he!==f&&(O=p[f+t]-p[he+t],z=p[f+r]-p[he+r],_=O*O+z*z,Ne===!0?_>0?(S=W*p[f+d]*p[he+d]/_,p[f+i]+=O*S,p[f+o]+=z*S):_<0&&(S=-W*p[f+d]*p[he+d]/Math.sqrt(_),p[f+i]+=O*S,p[f+o]+=z*S):_>0&&(S=W*p[f+d]*p[he+d]/_,p[f+i]+=O*S,p[f+o]+=z*S)),k=m[k+U],k<0)break;continue}else for(W=N.scalingRatio,F=0;F<ne;F+=X)for(q=0;q<F;q+=X)O=p[F+t]-p[q+t],z=p[F+r]-p[q+r],Ne===!0?(_=Math.sqrt(O*O+z*z)-p[F+u]-p[q+u],_>0?(S=W*p[F+d]*p[q+d]/_/_,p[F+i]+=O*S,p[F+o]+=z*S,p[q+i]-=O*S,p[q+o]-=z*S):_<0&&(S=100*W*p[F+d]*p[q+d],p[F+i]+=O*S,p[F+o]+=z*S,p[q+i]-=O*S,p[q+o]-=z*S)):(_=Math.sqrt(O*O+z*z),_>0&&(S=W*p[F+d]*p[q+d]/_/_,p[F+i]+=O*S,p[F+o]+=z*S,p[q+i]-=O*S,p[q+o]-=z*S));for(M=N.gravity/N.scalingRatio,W=N.scalingRatio,f=0;f<ne;f+=X)S=0,O=p[f+t],z=p[f+r],_=Math.sqrt(Math.pow(O,2)+Math.pow(z,2)),N.strongGravityMode?_>0&&(S=W*p[f+d]*M):_>0&&(S=W*p[f+d]*M/_),p[f+i]-=O*S,p[f+o]-=z*S;for(W=1*(N.outboundAttractionDistribution?Le:1),xe=0;xe<Rr;xe+=Ye)F=ye[xe+g],q=ye[xe+x],K=ye[xe+j],se=Math.pow(K,N.edgeWeightInfluence),O=p[F+t]-p[q+t],z=p[F+r]-p[q+r],Ne===!0?(_=Math.sqrt(O*O+z*z)-p[F+u]-p[q+u],N.linLogMode?N.outboundAttractionDistribution?_>0&&(S=-W*se*Math.log(1+_)/_/p[F+d]):_>0&&(S=-W*se*Math.log(1+_)/_):N.outboundAttractionDistribution?_>0&&(S=-W*se/p[F+d]):_>0&&(S=-W*se)):(_=Math.sqrt(Math.pow(O,2)+Math.pow(z,2)),N.linLogMode?N.outboundAttractionDistribution?_>0&&(S=-W*se*Math.log(1+_)/_/p[F+d]):_>0&&(S=-W*se*Math.log(1+_)/_):N.outboundAttractionDistribution?(_=1,S=-W*se/p[F+d]):(_=1,S=-W*se)),_>0&&(p[F+i]+=O*S,p[F+o]+=z*S,p[q+i]-=O*S,p[q+o]-=z*S);var ze,Ce,Re,ge,Ue,Fe;if(Ne===!0)for(f=0;f<ne;f+=X)p[f+l]!==1&&(ze=Math.sqrt(Math.pow(p[f+i],2)+Math.pow(p[f+o],2)),ze>L&&(p[f+i]=p[f+i]*L/ze,p[f+o]=p[f+o]*L/ze),Ce=p[f+d]*Math.sqrt((p[f+a]-p[f+i])*(p[f+a]-p[f+i])+(p[f+s]-p[f+o])*(p[f+s]-p[f+o])),Re=Math.sqrt((p[f+a]+p[f+i])*(p[f+a]+p[f+i])+(p[f+s]+p[f+o])*(p[f+s]+p[f+o]))/2,ge=.1*Math.log(1+Re)/(1+Math.sqrt(Ce)),Ue=p[f+t]+p[f+i]*(ge/N.slowDown),p[f+t]=Ue,Fe=p[f+r]+p[f+o]*(ge/N.slowDown),p[f+r]=Fe);else for(f=0;f<ne;f+=X)p[f+l]!==1&&(Ce=p[f+d]*Math.sqrt((p[f+a]-p[f+i])*(p[f+a]-p[f+i])+(p[f+s]-p[f+o])*(p[f+s]-p[f+o])),Re=Math.sqrt((p[f+a]+p[f+i])*(p[f+a]+p[f+i])+(p[f+s]+p[f+o])*(p[f+s]+p[f+o]))/2,ge=p[f+c]*Math.log(1+Re)/(1+Math.sqrt(Ce)),p[f+c]=Math.min(1,Math.sqrt(ge*(Math.pow(p[f+i],2)+Math.pow(p[f+o],2))/(1+Math.sqrt(Ce)))),Ue=p[f+t]+p[f+i]*(ge/N.slowDown),p[f+t]=Ue,Fe=p[f+r]+p[f+o]*(ge/N.slowDown),p[f+r]=Fe);return{}},"iterate"),tt}b(ki,"requireIterate");var de={},vt;function Ei(){if(vt)return de;vt=1;var n=Object.defineProperty,e=b((i,o)=>n(i,"name",{value:o,configurable:!0}),"y"),t=10,r=3;return de.assign=function(i){i=i||{};var o=Array.prototype.slice.call(arguments).slice(1),a,s,d;for(a=0,d=o.length;a<d;a++)if(o[a])for(s in o[a])i[s]=o[a][s];return i},de.validateSettings=function(i){return"linLogMode"in i&&typeof i.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in i&&typeof i.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in i&&typeof i.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in i&&typeof i.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in i&&!(typeof i.scalingRatio=="number"&&i.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in i&&typeof i.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in i&&!(typeof i.gravity=="number"&&i.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in i&&!(typeof i.slowDown=="number"||i.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in i&&typeof i.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in i&&!(typeof i.barnesHutTheta=="number"&&i.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},de.graphToByteArrays=function(i,o){var a=i.order,s=i.size,d={},c,u=new Float32Array(a*t),l=new Float32Array(s*r);return c=0,i.forEachNode(function(g,x){d[g]=c,u[c]=x.x,u[c+1]=x.y,u[c+2]=0,u[c+3]=0,u[c+4]=0,u[c+5]=0,u[c+6]=1,u[c+7]=1,u[c+8]=x.size||1,u[c+9]=x.fixed?1:0,c+=t}),c=0,i.forEachEdge(function(g,x,j,A,G,D,R){var U=d[j],T=d[A],B=o(g,x,j,A,G,D,R);u[U+6]+=B,u[T+6]+=B,l[c]=U,l[c+1]=T,l[c+2]=B,c+=r}),{nodes:u,edges:l}},de.assignLayoutChanges=function(i,o,a){var s=0;i.updateEachNodeAttributes(function(d,c){return c.x=o[s],c.y=o[s+1],s+=t,a?a(d,c):c})},de.readGraphPositions=function(i,o){var a=0;i.forEachNode(function(s,d){o[a]=d.x,o[a+1]=d.y,a+=t})},de.collectLayoutChanges=function(i,o,a){for(var s=i.nodes(),d={},c=0,u=0,l=o.length;c<l;c+=t){if(a){var g=Object.assign({},i.getNodeAttributes(s[u]));g.x=o[c],g.y=o[c+1],g=a(s[u],g),d[s[u]]={x:g.x,y:g.y}}else d[s[u]]={x:o[c],y:o[c+1]};u++}return d},de.createWorker=e(function(i){var o=window.URL||window.webkitURL,a=i.toString(),s=o.createObjectURL(new Blob(["("+a+").call(this);"],{type:"text/javascript"})),d=new Worker(s);return o.revokeObjectURL(s),d},"createWorker"),de}b(Ei,"requireHelpers");var rt,kt;function $i(){return kt||(kt=1,rt={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),rt}b($i,"requireDefaults");var it,Et;function Gi(){if(Et)return it;Et=1;var n=Object.defineProperty,e=b((u,l)=>n(u,"name",{value:l,configurable:!0}),"a"),t=xi(),r=vi().createEdgeWeightGetter,i=ki(),o=Ei(),a=$i();function s(u,l,g){if(!t(l))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof g=="number"&&(g={iterations:g});var x=g.iterations;if(typeof x!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(x<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var j=r("getEdgeWeight"in g?g.getEdgeWeight:"weight").fromEntry,A=typeof g.outputReducer=="function"?g.outputReducer:null,G=o.assign({},a,g.settings),D=o.validateSettings(G);if(D)throw new Error("graphology-layout-forceatlas2: "+D.message);var R=o.graphToByteArrays(l,j),U;for(U=0;U<x;U++)i(G,R.nodes,R.edges);if(u){o.assignLayoutChanges(l,R.nodes,A);return}return o.collectLayoutChanges(l,R.nodes)}b(s,"abstractSynchronousLayout"),e(s,"abstractSynchronousLayout");function d(u){var l=typeof u=="number"?u:u.order;return{barnesHutOptimize:l>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(l)}}b(d,"inferSettings"),e(d,"inferSettings");var c=s.bind(null,!1);return c.assign=s.bind(null,!0),c.inferSettings=d,it=c,it}b(Gi,"requireGraphologyLayoutForceatlas2");var ji=Gi();const $t=di(ji);var Ai=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:""}}}@layer theme{:root,:host{--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-light:300;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--leading-tight:1.25;--leading-snug:1.375;--radius-sm:.25rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--sans);--default-mono-font-family:var(--mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--fg:#000;--muted:#555;--faint:#707070;--border:#e0e0e0;--border2:#bdbdbd;--row-hover:#f0f0f0;--accent:#d71921;--accent-soft:#d719210d;--link:#0050c0;--node-app:#000;--node-lib:#707070;--edge:#bdbdbd;--edge-faint:#e0e0e0;--mono:ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;--sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif}@media (prefers-color-scheme:dark){:root{--bg:#141414;--panel:#1c1c1c;--panel2:#242424;--fg:#fff;--muted:#b8b8b8;--faint:#8a8a8a;--border:#2e2e2e;--border2:#3e3e3e;--row-hover:#1f1f1f;--accent:#ff4d54;--accent-soft:#ff4d5414;--link:#7eb0f9;--node-app:#fff;--node-lib:#8a8a8a;--edge:#3e3e3e;--edge-faint:#2e2e2e}}html[data-theme=light]{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--fg:#000;--muted:#555;--faint:#707070;--border:#e0e0e0;--border2:#bdbdbd;--row-hover:#f0f0f0;--accent:#d71921;--accent-soft:#d719210d;--link:#0050c0;--node-app:#000;--node-lib:#707070;--edge:#bdbdbd;--edge-faint:#e0e0e0}html[data-theme=dark]{--bg:#141414;--panel:#1c1c1c;--panel2:#242424;--fg:#fff;--muted:#b8b8b8;--faint:#8a8a8a;--border:#2e2e2e;--border2:#3e3e3e;--row-hover:#1f1f1f;--accent:#ff4d54;--accent-soft:#ff4d5414;--link:#7eb0f9;--node-app:#fff;--node-lib:#8a8a8a;--edge:#3e3e3e;--edge-faint:#2e2e2e}body{background-image:radial-gradient(circle, var(--border) .5px, transparent .5px);font-feature-settings:"ss01";background-size:14px 14px}}@layer components{.tbtn-theme [data-icon=moon]{display:inline-flex}.tbtn-theme [data-icon=sun]{display:none}@media (prefers-color-scheme:dark){.tbtn-theme [data-icon=moon]{display:none}.tbtn-theme [data-icon=sun]{display:inline-flex}}html[data-theme=light] .tbtn-theme [data-icon=moon]{display:inline-flex}html[data-theme=light] .tbtn-theme [data-icon=sun],html[data-theme=dark] .tbtn-theme [data-icon=moon]{display:none}html[data-theme=dark] .tbtn-theme [data-icon=sun]{display:inline-flex}.anolilab-logo{width:auto;height:13px;fill:var(--fg)}.anolilab-accent{fill:#dfff1b}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-0{left:calc(var(--spacing) * 0)}.left-4{left:calc(var(--spacing) * 4)}.isolate{isolation:isolate}.z-20{z-index:20}.z-30{z-index:30}.z-\\[2\\]{z-index:2}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-12{margin-inline:calc(var(--spacing) * 12)}.mx-\\[0\\.12em\\]{margin-inline:.12em}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-8{margin-left:calc(var(--spacing) * 8)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-\\[7px\\]{width:7px;height:7px}.h-2{height:calc(var(--spacing) * 2)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-\\[6px\\]{height:6px}.h-\\[7px\\]{height:7px}.h-\\[8px\\]{height:8px}.h-\\[10px\\]{height:10px}.h-\\[18px\\]{height:18px}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.min-h-\\[400px\\]{min-height:400px}.min-h-\\[480px\\]{min-height:480px}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-7{width:calc(var(--spacing) * 7)}.w-9{width:calc(var(--spacing) * 9)}.w-\\[7px\\]{width:7px}.w-\\[8px\\]{width:8px}.w-full{width:100%}.w-px{width:1px}.max-w-\\[380px\\]{max-width:380px}.max-w-\\[1080px\\]{max-width:1080px}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[220px\\]{min-width:220px}.min-w-\\[260px\\]{min-width:260px}.flex-1{flex:1}.flex-\\[1_1_280px\\]{flex:280px}.flex-auto{flex:auto}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\\[72px_1fr\\]{grid-template-columns:72px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-16{gap:calc(var(--spacing) * 16)}.gap-\\[0\\.65rem\\]{gap:.65rem}.gap-\\[2px\\]{gap:2px}.gap-\\[7px\\]{gap:7px}.gap-px{gap:1px}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent,.border-accent\\/60{border-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.border-accent\\/60{border-color:color-mix(in oklab, var(--accent) 60%, transparent)}}.border-border{border-color:var(--border)}.border-border2{border-color:var(--border2)}.border-fg{border-color:var(--fg)}.border-link{border-color:var(--link)}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-accent\\/40{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/40{background-color:color-mix(in oklab, var(--accent) 40%, transparent)}}.bg-bg,.bg-bg\\/40{background-color:var(--bg)}@supports (color:color-mix(in lab, red, red)){.bg-bg\\/40{background-color:color-mix(in oklab, var(--bg) 40%, transparent)}}.bg-border{background-color:var(--border)}.bg-border2{background-color:var(--border2)}.bg-edge{background-color:var(--edge)}.bg-edge-faint{background-color:var(--edge-faint)}.bg-fg{background-color:var(--fg)}.bg-node-app{background-color:var(--node-app)}.bg-node-lib{background-color:var(--node-lib)}.bg-panel,.bg-panel\\/95{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/95{background-color:color-mix(in oklab, var(--panel) 95%, transparent)}}.bg-panel2{background-color:var(--panel2)}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-12{padding-inline:calc(var(--spacing) * 12)}.px-\\[5px\\]{padding-inline:5px}.px-\\[6px\\]{padding-inline:6px}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-\\[3px\\]{padding-block:3px}.py-px{padding-block:1px}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-7{padding-top:calc(var(--spacing) * 7)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-12{padding-top:calc(var(--spacing) * 12)}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-12{padding-bottom:calc(var(--spacing) * 12)}.pl-0{padding-left:calc(var(--spacing) * 0)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-\\[7px\\]{padding-left:7px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-top{vertical-align:top}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[28px\\]{font-size:28px}.text-\\[44px\\]{font-size:44px}.text-\\[72px\\]{font-size:72px}.text-\\[clamp\\(28px\\,5vw\\,52px\\)\\]{font-size:clamp(28px,5vw,52px)}.leading-\\[0\\.9\\]{--tw-leading:.9;line-height:.9}.leading-none{--tw-leading:1;line-height:1}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[-0\\.02em\\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-\\[0\\.11em\\]{--tw-tracking:.11em;letter-spacing:.11em}.tracking-\\[0\\.12em\\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\\[0\\.15em\\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\\[0\\.16em\\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-\\[0\\.22em\\]{--tw-tracking:.22em;letter-spacing:.22em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-accent{color:var(--accent)}.text-bg{color:var(--bg)}.text-faint{color:var(--faint)}.text-fg{color:var(--fg)}.text-link{color:var(--link)}.text-muted{color:var(--muted)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.opacity-40{opacity:.4}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_4px_12px_rgba\\(0\\,0\\,0\\,0\\.08\\)\\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_8px_24px_rgba\\(0\\,0\\,0\\,0\\.12\\)\\]{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-0{outline-style:var(--tw-outline-style);outline-width:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}.group-data-\\[state\\=off\\]\\:opacity-30:is(:where(.group)[data-state=off] *){opacity:.3}.placeholder\\:text-faint::placeholder{color:var(--faint)}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:left-0:before{content:var(--tw-content);left:calc(var(--spacing) * 0)}.before\\:text-faint:before{content:var(--tw-content);color:var(--faint)}.before\\:content-\\[\\'→\\'\\]:before{--tw-content:"→";content:var(--tw-content)}.after\\:ml-auto:after{content:var(--tw-content);margin-left:auto}.after\\:font-mono:after{content:var(--tw-content);font-family:var(--mono)}.after\\:text-\\[9px\\]:after{content:var(--tw-content);font-size:9px}.after\\:tracking-\\[0\\.1em\\]:after{content:var(--tw-content);--tw-tracking:.1em;letter-spacing:.1em}.after\\:text-accent:after{content:var(--tw-content);color:var(--accent)}.after\\:content-\\[\\'ON\\'\\]:after{--tw-content:"ON";content:var(--tw-content)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\\:border-fg:focus-within{border-color:var(--fg)}@media (hover:hover){.hover\\:border-fg:hover{border-color:var(--fg)}.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-row-hover:hover{background-color:var(--row-hover)}.hover\\:text-accent:hover{color:var(--accent)}.hover\\:text-fg:hover{color:var(--fg)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:opacity-90:hover{opacity:.9}}.focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-fg:focus-visible{--tw-ring-color:var(--fg)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-40:disabled{opacity:.4}.aria-selected\\:bg-row-hover[aria-selected=true]{background-color:var(--row-hover)}.data-\\[open\\=false\\]\\:hidden[data-open=false]{display:none}.data-\\[pinned\\=true\\]\\:pointer-events-auto[data-pinned=true]{pointer-events:auto}.data-\\[pinned\\=true\\]\\:border-accent[data-pinned=true]{border-color:var(--accent)}.data-\\[state\\=off\\]\\:text-faint[data-state=off]{color:var(--faint)}.data-\\[state\\=off\\]\\:line-through[data-state=off]{text-decoration-line:line-through}.data-\\[state\\=off\\]\\:after\\:text-faint[data-state=off]:after{content:var(--tw-content);color:var(--faint)}.data-\\[state\\=off\\]\\:after\\:content-\\[\\'OFF\\'\\][data-state=off]:after{--tw-content:"OFF";content:var(--tw-content)}.data-\\[state\\=selected\\]\\:bg-row-hover[data-state=selected]{background-color:var(--row-hover)}.data-\\[state\\=zero\\]\\:text-accent[data-state=zero]{color:var(--accent)}@media (min-width:40rem){.sm\\:min-w-\\[320px\\]{min-width:320px}}@media (min-width:48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\\:grid-cols-\\[1\\.4fr_1fr\\]{grid-template-columns:1.4fr 1fr}}.\\[\\&_svg\\]\\:size-\\[14px\\] svg{width:14px;height:14px}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_tr\\]\\:border-b-0 tr{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\\[\\&\\>\\*\\+\\*\\]\\:ml-6>*+*{margin-left:calc(var(--spacing) * 6)}.\\[\\&\\>\\*\\+\\*\\]\\:border-l>*+*{border-left-style:var(--tw-border-style);border-left-width:1px}.\\[\\&\\>\\*\\+\\*\\]\\:border-border>*+*{border-color:var(--border)}.\\[\\&\\>\\*\\+\\*\\]\\:pl-6>*+*{padding-left:calc(var(--spacing) * 6)}.\\[\\&\\>td\\]\\:border-b>td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\\[\\&\\>td\\]\\:border-border>td{border-color:var(--border)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}`,Si=Object.defineProperty,Ke=b((n,e)=>Si(n,"name",{value:e,configurable:!0}),"d$1");const Ni=Ai,Ci=ni(import.meta.url),Xe=Ke((n,e)=>{const t=Ci.resolve(n);return qr(oi(ai(t),e),"utf8")},"readUmd"),_i=Xe("sigma","sigma.min.js"),Di=Xe("graphology","graphology.umd.min.js"),Mi=Xe("@floating-ui/core","floating-ui.core.umd.min.js"),Ii=Xe("@floating-ui/dom","floating-ui.dom.umd.min.js"),Li='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>',Ti='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41m11.32-11.32 1.41-1.41"/></svg>',ce=Ke(n=>n.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;"),"escapeHtml"),Oi=9,zi=4,Ri=Ke((n,e)=>{if(n.length===0)return[];const t=new P({multi:!0,type:"directed"});for(const o of n){const a=t.order/n.length*Math.PI*2;t.addNode(o.name,{path:o.path,size:o.type==="application"?Oi:zi,type:o.type,x:Math.cos(a),y:Math.sin(a)})}for(const o of e)t.hasNode(o.source)&&t.hasNode(o.target)&&t.addEdge(o.source,o.target,{type:o.type});const r=$t.inferSettings(t);$t.assign(t,{iterations:600,settings:{...r,adjustSizes:!0,barnesHutOptimize:t.order>100,gravity:1.2,linLogMode:!0,scalingRatio:8,slowDown:4}});const i=[];return t.forEachNode((o,a)=>{i.push({name:o,path:a.path,size:a.size,type:a.type,x:a.x,y:a.y})}),i},"computeLayout"),Ui=Ke(n=>{const e=n.now??new Date,t=n.nodes.filter(u=>u.type==="application").length,r=n.nodes.length-t,i=Ri(n.nodes,n.edges),o=new Set(i.map(u=>u.name)),a=n.edges.filter(u=>o.has(u.source)&&o.has(u.target)),s={edges:a,nodes:i},d=n.nodes.length===0,c={chip:"font-mono tracking-[0.08em] text-muted border border-border2 inline-flex h-7 items-center justify-center rounded-[4px] px-3 text-[11px] font-medium uppercase",dvNum:"font-mono text-[22px] font-medium text-fg leading-none",labelMono:"font-mono text-[10px] uppercase tracking-[0.15em] text-faint"};return`<!doctype html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <title>${ce(n.tool.name)} graph · ${ce(e.toISOString().slice(0,10))}</title>
8
+ <style>${Ni}</style>
9
+ </head>
10
+ <body class="bg-bg text-fg">
11
+ <div class="min-h-screen flex flex-col">
12
+ <header class="flex flex-wrap items-end gap-4 px-8 pt-8 pb-5">
13
+ <div class="font-sans text-[clamp(28px,5vw,52px)] font-semibold text-fg leading-none tracking-tight">${(()=>{const[u,...l]=n.tool.name.split("-");return l.length>0?`${ce(u??n.tool.name)}<span class="text-accent mx-[0.12em] font-light">/</span>${ce(l.join("-"))}`:ce(n.tool.name)})()}<span class="font-mono tracking-[0.22em] text-faint mt-3 block text-[10px] font-medium uppercase">dependency graph</span></div>
14
+ <span class="flex-auto"></span>
15
+ <span class="${c.chip}">v${ce(n.tool.version)}</span>
16
+ <button id="theme" class="tbtn-theme font-mono text-muted border border-border2 inline-flex h-7 w-9 cursor-pointer items-center justify-center rounded-[4px] bg-transparent transition-colors duration-150 hover:text-fg hover:border-fg" type="button" aria-label="Toggle color theme" title="Toggle color theme"><span data-icon="moon" class="items-center justify-center">${Li}</span><span data-icon="sun" class="items-center justify-center">${Ti}</span></button>
17
+ </header>
18
+ <div class="flex flex-wrap items-end gap-6 px-8 pt-5 pb-5 border-b border-border">
19
+ <div class="flex flex-wrap items-stretch gap-0 [&>*+*]:pl-6 [&>*+*]:ml-6 [&>*+*]:border-l [&>*+*]:border-border">
20
+ <div class="flex items-baseline gap-[0.65rem]"><span class="${c.labelMono}">apps</span><span class="${c.dvNum}">${String(t)}</span></div>
21
+ <div class="flex items-baseline gap-[0.65rem]"><span class="${c.labelMono}">libraries</span><span class="${c.dvNum}">${String(r)}</span></div>
22
+ <div class="flex items-baseline gap-[0.65rem]"><span class="${c.labelMono}">dependencies</span><span class="${c.dvNum}">${String(a.length)}</span></div>
23
+ </div>
24
+ <span class="flex-auto"></span>
25
+ <div class="relative min-w-[260px] sm:min-w-[320px] ml-auto">
26
+ <label class="flex items-center gap-3 border-b border-border2 transition-colors duration-150 hover:border-fg focus-within:border-fg pb-1.5">
27
+ <span class="${c.labelMono} select-none">find:</span>
28
+ <input id="filter" type="search" class="w-full min-w-0 border-0 bg-transparent py-0.5 text-fg text-[12px] font-mono outline-0 placeholder:text-faint" placeholder="package name…" aria-label="Filter packages" autocomplete="off" spellcheck="false" />
29
+ <span id="filter-count" data-state="" class="font-mono text-faint text-[10px] tracking-[0.05em] shrink-0 select-none data-[state=zero]:text-accent" aria-live="polite"></span>
30
+ </label>
31
+ <div id="filter-results" data-open="false" class="data-[open=false]:hidden absolute z-20 top-full left-0 right-0 mt-2 bg-panel border border-border max-h-72 overflow-y-auto shadow-[0_4px_12px_rgba(0,0,0,0.08)]" role="listbox" aria-label="Matching packages"></div>
32
+ </div>
33
+ </div>
34
+ <main class="relative flex-1 min-h-[480px]">${d?'<div class="flex flex-col items-center justify-center min-h-[400px] gap-4 text-center"><div class="font-sans text-[72px] font-semibold text-fg leading-none tracking-tight">NONE</div><div class="font-mono text-faint text-[12px] uppercase tracking-[0.15em]">No projects discovered in this workspace.</div></div>':`<div id="graph" class="absolute inset-0"></div>
35
+ <div id="tooltip" data-pinned="false" class="fixed z-30 top-0 left-0 hidden bg-panel border border-border2 px-4 py-3 max-w-[380px] pointer-events-none font-sans shadow-[0_8px_24px_rgba(0,0,0,0.12)] data-[pinned=true]:pointer-events-auto data-[pinned=true]:border-accent"></div>
36
+ <div id="legend" class="absolute top-4 right-4 bg-panel/95 backdrop-blur-sm border border-border px-4 py-3 min-w-[200px]">
37
+ <div class="${c.labelMono} mb-2">Filter</div>
38
+ <div data-toggle="app" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-2 h-2 rounded-full bg-node-app shrink-0 group-data-[state=off]:opacity-30"></span>Application</div>
39
+ <div data-toggle="lib" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-2 h-2 rounded-full bg-node-lib shrink-0 group-data-[state=off]:opacity-30"></span>Library</div>
40
+ <div data-toggle="prod" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-edge shrink-0 group-data-[state=off]:opacity-30"></span>Static dep</div>
41
+ <div data-toggle="dev" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-edge-faint shrink-0 group-data-[state=off]:opacity-30"></span>Dev / implicit</div>
42
+ <div data-toggle="peer" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-accent shrink-0 group-data-[state=off]:opacity-30"></span>Peer</div>
43
+ </div>
44
+ <div class="absolute bottom-4 left-4 flex flex-wrap items-center gap-x-6 gap-y-2 bg-panel/95 backdrop-blur-sm border border-border px-4 py-2 font-mono text-[10px] uppercase tracking-[0.15em] text-faint">
45
+ <div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">/</span><span>Search</span></div>
46
+ <div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">R</span><span>Fit view</span></div>
47
+ <div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">Click</span><span>Pin · click empty to unpin</span></div>
48
+ </div>`}</main>
49
+ <footer class="flex flex-wrap items-center justify-between gap-x-6 gap-y-3 px-8 py-4 text-[10px] uppercase border-t border-border font-mono text-faint tracking-[0.1em]">
50
+ <span><b class="text-fg font-semibold">${ce(n.tool.name)}</b> ${ce(n.tool.version)} · generated ${ce(e.toISOString())}</span>
51
+ <span class="inline-flex items-center gap-2"><span>built by</span><a class="sig-by-link inline-flex items-center" href="https://anolilab.com" rel="noreferrer noopener" target="_blank" aria-label="Anolilab">${ci}</a></span>
52
+ </footer>
53
+ </div>
54
+ <script>${Di}<\/script>
55
+ <script>${_i}<\/script>
56
+ <script>${Mi}<\/script>
57
+ <script>${Ii}<\/script>
58
+ <script>
59
+ (() => {
60
+ const root = document.documentElement;
61
+ const themeBtn = document.getElementById('theme');
62
+ const mql = window.matchMedia('(prefers-color-scheme: dark)');
63
+
64
+ try {
65
+ const stored = localStorage.getItem('vis-graph-theme');
66
+ if (stored === 'light' || stored === 'dark') {
67
+ root.dataset.theme = stored;
68
+ }
69
+ } catch {}
70
+
71
+ const data = ${JSON.stringify(s).replaceAll("</",String.raw`<\/`)};
72
+ if (!data.nodes.length || !window.graphology || !window.Sigma) {
73
+ return;
74
+ }
75
+
76
+ // Reusable Tailwind utility-class strings for dynamically-created elements.
77
+ // Inline-everywhere is the system of record; these strings only exist
78
+ // because the JS DOM API can't read Tailwind from the markup.
79
+ const CLS = {
80
+ ttlName: 'font-sans text-fg text-[13px] font-semibold leading-tight mb-1 break-words',
81
+ ttlType: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em]',
82
+ ttlPath: 'font-mono text-muted text-[10px] mt-2 break-all',
83
+ ttlSection: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] mt-3 mb-1',
84
+ ttlEmpty: 'font-mono text-faint text-[10px] italic mt-2',
85
+ ttlMore: 'font-mono text-faint text-[10px] italic pl-3 mt-1',
86
+ ttlUl: 'mt-1 space-y-0.5',
87
+ ttlLi: "font-mono text-fg text-[11px] leading-snug pl-3 relative before:content-['→'] before:text-faint before:absolute before:left-0",
88
+ matchItem: 'flex items-center justify-between gap-3 px-3 py-2 cursor-pointer text-[12px] hover:bg-row-hover aria-selected:bg-row-hover',
89
+ miName: 'font-sans text-fg truncate',
90
+ miMark: 'bg-accent-soft text-accent rounded-sm px-0.5',
91
+ miKind: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] shrink-0',
92
+ matchEmpty: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] px-3 py-3',
93
+ };
94
+
95
+ // Read live colors from the rendered CSS so theme switches stay in one
96
+ // place: change vars → call sigma.refresh() and node/edge colors update.
97
+ const css = () => {
98
+ const s = getComputedStyle(root);
99
+ return {
100
+ app: s.getPropertyValue('--node-app').trim(),
101
+ lib: s.getPropertyValue('--node-lib').trim(),
102
+ edge: s.getPropertyValue('--edge').trim(),
103
+ edgeFaint: s.getPropertyValue('--edge-faint').trim(),
104
+ accent: s.getPropertyValue('--accent').trim(),
105
+ fg: s.getPropertyValue('--fg').trim(),
106
+ muted: s.getPropertyValue('--muted').trim(),
107
+ };
108
+ };
109
+
110
+ let theme = css();
111
+
112
+ const Graph = window.graphology.Graph || window.graphology;
113
+ const graph = new Graph({ multi: true, type: 'directed' });
114
+
115
+ const colorForNode = (type) => type === 'application' ? theme.app : theme.lib;
116
+ const colorForEdge = (type) => {
117
+ if (type === 'peerDependency') return theme.accent;
118
+ if (type === 'devDependency' || type === 'implicit') return theme.edgeFaint;
119
+ return theme.edge;
120
+ };
121
+
122
+ // Attribute is named "kind", not "type": sigma reads node.type as its
123
+ // program-class name and bails when it sees "application" / "library".
124
+ for (const n of data.nodes) {
125
+ graph.addNode(n.name, {
126
+ x: n.x,
127
+ y: n.y,
128
+ size: n.size,
129
+ label: n.name,
130
+ kind: n.type,
131
+ path: n.path,
132
+ color: colorForNode(n.type),
133
+ });
134
+ }
135
+
136
+ for (const e of data.edges) {
137
+ graph.addEdge(e.source, e.target, {
138
+ color: colorForEdge(e.type),
139
+ depType: e.type,
140
+ size: 1,
141
+ });
142
+ }
143
+
144
+ // Adjacency for tooltip & hover-emphasis.
145
+ const depMap = {}, rdepMap = {};
146
+ for (const n of data.nodes) { depMap[n.name] = []; rdepMap[n.name] = []; }
147
+ for (const e of data.edges) {
148
+ depMap[e.source].push(e.target);
149
+ rdepMap[e.target].push(e.source);
150
+ }
151
+
152
+ const container = document.getElementById('graph');
153
+ const tooltip = document.getElementById('tooltip');
154
+ const filterInput = document.getElementById('filter');
155
+ const filterCount = document.getElementById('filter-count');
156
+ const filterResults = document.getElementById('filter-results');
157
+
158
+ const renderer = new window.Sigma(graph, container, {
159
+ renderEdgeLabels: false,
160
+ labelColor: { color: theme.fg },
161
+ labelFont: 'system-ui, -apple-system, sans-serif',
162
+ labelSize: 11,
163
+ labelWeight: '500',
164
+ labelDensity: 0.7,
165
+ labelGridCellSize: 80,
166
+ defaultEdgeColor: theme.edge,
167
+ defaultNodeColor: theme.lib,
168
+ defaultEdgeType: 'arrow',
169
+ minCameraRatio: 0.05,
170
+ maxCameraRatio: 8,
171
+ // Suppress sigma's built-in hover label panel. We render our own tooltip,
172
+ // so its empty label box (the small rectangle near the cursor) is noise.
173
+ defaultDrawNodeHover: () => undefined,
174
+ });
175
+
176
+ // State: hover follows the mouse, focus is sticky (set by clicking a node
177
+ // or selecting a search result), pin keeps the tooltip locked in place.
178
+ let hoveredNode = null;
179
+ let focusedNode = null;
180
+ let pinned = false;
181
+ let filterTerm = '';
182
+ let matches = [];
183
+ let activeMatchIndex = -1;
184
+
185
+ // Legend filter state: each key toggles the visibility of a category.
186
+ // previewCategory is set transiently while hovering a legend row so the
187
+ // user can sneak-peek which lines/nodes belong to that category without
188
+ // committing to a toggle.
189
+ const visible = { app: true, lib: true, prod: true, dev: true, peer: true };
190
+ let previewCategory = null;
191
+ const isNodeCat = (k) => k === 'app' || k === 'lib';
192
+ const isEdgeCat = (k) => k === 'prod' || k === 'dev' || k === 'peer';
193
+ const edgeCategory = (depType) => {
194
+ if (depType === 'peerDependency') return 'peer';
195
+ if (depType === 'devDependency' || depType === 'implicit') return 'dev';
196
+ return 'prod';
197
+ };
198
+ const nodeVisible = (kind) => visible[kind === 'application' ? 'app' : 'lib'];
199
+
200
+ const activeNode = () => focusedNode || hoveredNode;
201
+
202
+ renderer.setSetting('nodeReducer', (node, attrs) => {
203
+ if (!nodeVisible(attrs.kind)) {
204
+ return { ...attrs, hidden: true, label: '' };
205
+ }
206
+ // Legend-row preview takes precedence over normal focus/hover emphasis:
207
+ // hovering a category gives an unambiguous "show me what's in this set".
208
+ if (previewCategory) {
209
+ const nodeCat = attrs.kind === 'application' ? 'app' : 'lib';
210
+ const inPreview = isNodeCat(previewCategory) ? nodeCat === previewCategory : false;
211
+ return {
212
+ ...attrs,
213
+ color: inPreview ? attrs.color : theme.edgeFaint,
214
+ label: inPreview ? attrs.label : '',
215
+ zIndex: inPreview ? 1 : 0,
216
+ };
217
+ }
218
+ const active = activeNode();
219
+ const matchedFilter = !filterTerm || node.toLowerCase().includes(filterTerm);
220
+ const isActive = active === node;
221
+ const isRelated = active && (depMap[active]?.includes(node) || rdepMap[active]?.includes(node));
222
+ const dim = (filterTerm && !matchedFilter) || (active && !isActive && !isRelated);
223
+ return {
224
+ ...attrs,
225
+ color: isActive ? theme.accent : attrs.color,
226
+ label: dim ? '' : attrs.label,
227
+ zIndex: isActive ? 2 : isRelated ? 1 : 0,
228
+ };
229
+ });
230
+
231
+ renderer.setSetting('edgeReducer', (edge, attrs) => {
232
+ if (!visible[edgeCategory(attrs.depType)]) {
233
+ return { ...attrs, hidden: true };
234
+ }
235
+ const ext = graph.extremities(edge);
236
+ if (!nodeVisible(graph.getNodeAttribute(ext[0], 'kind')) || !nodeVisible(graph.getNodeAttribute(ext[1], 'kind'))) {
237
+ return { ...attrs, hidden: true };
238
+ }
239
+ if (previewCategory) {
240
+ if (isEdgeCat(previewCategory)) {
241
+ const inPreview = edgeCategory(attrs.depType) === previewCategory;
242
+ return { ...attrs, color: inPreview ? theme.accent : theme.edgeFaint, size: inPreview ? 1.5 : 0.3, zIndex: inPreview ? 1 : 0 };
243
+ }
244
+ // Previewing a node category dims every edge — the focus is on the dots.
245
+ return { ...attrs, color: theme.edgeFaint, size: 0.3 };
246
+ }
247
+ const active = activeNode();
248
+ const touchesActive = active && (ext[0] === active || ext[1] === active);
249
+ if (active && !touchesActive) {
250
+ return { ...attrs, color: theme.edgeFaint, hidden: false, size: 0.5 };
251
+ }
252
+ if (touchesActive) {
253
+ return { ...attrs, color: theme.accent, size: 1.5, zIndex: 1 };
254
+ }
255
+ return attrs;
256
+ });
257
+
258
+ // Tooltip body assembled with safe DOM methods (createElement +
259
+ // textContent) — no innerHTML, no template strings of user data.
260
+ const MAX_TOOLTIP_ITEMS = 8;
261
+ const setTooltipContent = (name) => {
262
+ const node = graph.getNodeAttributes(name);
263
+ const deps = depMap[name] || [];
264
+ const rdeps = rdepMap[name] || [];
265
+ tooltip.textContent = '';
266
+
267
+ const nameEl = document.createElement('div');
268
+ nameEl.className = CLS.ttlName;
269
+ nameEl.textContent = name;
270
+ tooltip.appendChild(nameEl);
271
+
272
+ const typeEl = document.createElement('div');
273
+ typeEl.className = CLS.ttlType;
274
+ typeEl.textContent = node.kind + (pinned ? ' · pinned' : '');
275
+ tooltip.appendChild(typeEl);
276
+
277
+ if (node.path) {
278
+ const pathEl = document.createElement('div');
279
+ pathEl.className = CLS.ttlPath;
280
+ pathEl.textContent = node.path;
281
+ tooltip.appendChild(pathEl);
282
+ }
283
+
284
+ const addSection = (label, items) => {
285
+ const heading = document.createElement('div');
286
+ heading.className = CLS.ttlSection;
287
+ heading.textContent = label + ' (' + items.length + ')';
288
+ tooltip.appendChild(heading);
289
+ const ul = document.createElement('ul');
290
+ ul.className = CLS.ttlUl;
291
+ const shown = items.slice(0, MAX_TOOLTIP_ITEMS);
292
+ for (const item of shown) {
293
+ const li = document.createElement('li');
294
+ li.className = CLS.ttlLi;
295
+ li.textContent = item;
296
+ ul.appendChild(li);
297
+ }
298
+ if (items.length > MAX_TOOLTIP_ITEMS) {
299
+ const more = document.createElement('li');
300
+ more.className = CLS.ttlMore;
301
+ more.textContent = (items.length - MAX_TOOLTIP_ITEMS) + ' more';
302
+ ul.appendChild(more);
303
+ }
304
+ tooltip.appendChild(ul);
305
+ };
306
+
307
+ if (deps.length) addSection('Depends on', deps);
308
+ if (rdeps.length) addSection('Required by', rdeps);
309
+ if (!deps.length && !rdeps.length) {
310
+ const empty = document.createElement('div');
311
+ empty.className = CLS.ttlEmpty;
312
+ empty.textContent = 'No dependencies';
313
+ tooltip.appendChild(empty);
314
+ }
315
+ };
316
+
317
+ // Tooltip placement delegated to Floating UI. We build a virtual reference
318
+ // element that either follows the cursor (hover) or anchors to a node's
319
+ // viewport position (pinned), then run computePosition with flip + shift +
320
+ // size middleware so the tooltip always fits the viewport.
321
+ const FUI = window.FloatingUIDOM;
322
+ let lastMouse = null;
323
+ let anchorMode = 'cursor'; // 'cursor' (follows mouse) or 'node' (sticky to node)
324
+ let anchorNode = null;
325
+ let cleanupAutoUpdate = null;
326
+
327
+ const cursorRef = {
328
+ getBoundingClientRect() {
329
+ const x = lastMouse ? lastMouse.clientX : 0;
330
+ const y = lastMouse ? lastMouse.clientY : 0;
331
+ return { width: 0, height: 0, x, y, top: y, left: x, right: x, bottom: y };
332
+ },
333
+ };
334
+
335
+ const nodeRef = {
336
+ getBoundingClientRect() {
337
+ if (!anchorNode || !graph.hasNode(anchorNode)) {
338
+ return { width: 0, height: 0, x: 0, y: 0, top: 0, left: 0, right: 0, bottom: 0 };
339
+ }
340
+ const pos = renderer.getNodeDisplayData(anchorNode);
341
+ const vp = renderer.graphToViewport({ x: pos.x, y: pos.y });
342
+ const rect = container.getBoundingClientRect();
343
+ const r = (pos.size || 4) + 4;
344
+ const cx = rect.left + vp.x;
345
+ const cy = rect.top + vp.y;
346
+ return { width: r * 2, height: r * 2, x: cx - r, y: cy - r, top: cy - r, left: cx - r, right: cx + r, bottom: cy + r };
347
+ },
348
+ };
349
+
350
+ const updatePosition = async () => {
351
+ if (tooltip.style.display !== 'block') return;
352
+ const ref = anchorMode === 'node' ? nodeRef : cursorRef;
353
+ const { x, y } = await FUI.computePosition(ref, tooltip, {
354
+ placement: 'right-start',
355
+ strategy: 'fixed',
356
+ middleware: [
357
+ FUI.offset(12),
358
+ FUI.flip({ fallbackPlacements: ['left-start', 'right-end', 'left-end', 'top', 'bottom'] }),
359
+ FUI.shift({ padding: 12 }),
360
+ FUI.size({
361
+ padding: 12,
362
+ apply({ availableWidth, availableHeight, elements }) {
363
+ const maxW = Math.min(380, Math.max(220, availableWidth));
364
+ const maxH = Math.max(160, availableHeight);
365
+ Object.assign(elements.floating.style, {
366
+ maxWidth: maxW + 'px',
367
+ maxHeight: maxH + 'px',
368
+ overflowY: 'auto',
369
+ });
370
+ },
371
+ }),
372
+ ],
373
+ });
374
+ Object.assign(tooltip.style, { left: x + 'px', top: y + 'px' });
375
+ };
376
+
377
+ const stopAutoUpdate = () => {
378
+ if (cleanupAutoUpdate) { cleanupAutoUpdate(); cleanupAutoUpdate = null; }
379
+ };
380
+
381
+ // Auto-update is only used for the node-anchored (pinned) mode, where the
382
+ // reference is stable across events but its viewport position changes when
383
+ // the user pans, zooms, or resizes. In cursor mode we drive recomputation
384
+ // ourselves from the mousemove handler.
385
+ const startAutoUpdate = () => {
386
+ stopAutoUpdate();
387
+ if (anchorMode === 'node') {
388
+ cleanupAutoUpdate = FUI.autoUpdate(nodeRef, tooltip, updatePosition);
389
+ }
390
+ };
391
+
392
+ const showTooltipFor = (name, mode = 'cursor') => {
393
+ anchorMode = mode;
394
+ anchorNode = mode === 'node' ? name : null;
395
+ setTooltipContent(name);
396
+ tooltip.style.display = 'block';
397
+ startAutoUpdate();
398
+ updatePosition();
399
+ };
400
+
401
+ const hideTooltip = () => {
402
+ stopAutoUpdate();
403
+ tooltip.style.display = 'none';
404
+ tooltip.dataset.pinned = 'false';
405
+ anchorNode = null;
406
+ };
407
+
408
+ renderer.on('enterNode', (e) => {
409
+ hoveredNode = e.node;
410
+ if (!pinned) showTooltipFor(e.node, 'cursor');
411
+ renderer.refresh({ skipIndexation: true });
412
+ });
413
+
414
+ renderer.on('leaveNode', () => {
415
+ hoveredNode = null;
416
+ if (!pinned) hideTooltip();
417
+ renderer.refresh({ skipIndexation: true });
418
+ });
419
+
420
+ // Click a node to pin it; the anchor switches from the cursor to the node
421
+ // so the tooltip stays attached even when the mouse moves away.
422
+ renderer.on('clickNode', (e) => {
423
+ focusedNode = e.node;
424
+ pinned = true;
425
+ tooltip.dataset.pinned = 'true';
426
+ showTooltipFor(e.node, 'node');
427
+ renderer.refresh({ skipIndexation: true });
428
+ });
429
+
430
+ renderer.on('clickStage', () => {
431
+ if (pinned || focusedNode) {
432
+ focusedNode = null;
433
+ pinned = false;
434
+ tooltip.dataset.pinned = 'false';
435
+ if (hoveredNode) {
436
+ showTooltipFor(hoveredNode, 'cursor');
437
+ } else {
438
+ hideTooltip();
439
+ }
440
+ renderer.refresh({ skipIndexation: true });
441
+ }
442
+ });
443
+
444
+ let posRafQueued = false;
445
+ container.addEventListener('mousemove', (e) => {
446
+ lastMouse = { clientX: e.clientX, clientY: e.clientY };
447
+ if (anchorMode === 'cursor' && tooltip.style.display === 'block' && !posRafQueued) {
448
+ posRafQueued = true;
449
+ requestAnimationFrame(() => {
450
+ posRafQueued = false;
451
+ updatePosition();
452
+ });
453
+ }
454
+ });
455
+
456
+ const focusOnNode = (name, { pin = true } = {}) => {
457
+ if (!graph.hasNode(name)) return;
458
+ const pos = renderer.getNodeDisplayData(name);
459
+ if (pos) renderer.getCamera().animate({ x: pos.x, y: pos.y, ratio: 0.3 }, { duration: 600 });
460
+ focusedNode = name;
461
+ pinned = pin;
462
+ if (pin) tooltip.dataset.pinned = 'true';
463
+ showTooltipFor(name, pin ? 'node' : 'cursor');
464
+ renderer.refresh({ skipIndexation: true });
465
+ };
466
+
467
+ // ── Search results ───────────────────────────────────────────────────
468
+ const totalNodes = data.nodes.length;
469
+ const renderResults = () => {
470
+ filterResults.textContent = '';
471
+ if (!filterTerm) {
472
+ filterResults.dataset.open = 'false';
473
+ filterCount.textContent = '';
474
+ filterCount.dataset.state = '';
475
+ activeMatchIndex = -1;
476
+ return;
477
+ }
478
+ filterCount.textContent = matches.length + ' / ' + totalNodes;
479
+ filterCount.dataset.state = matches.length === 0 ? 'zero' : '';
480
+ if (matches.length === 0) {
481
+ const empty = document.createElement('div');
482
+ empty.className = CLS.matchEmpty;
483
+ const b = document.createElement('b'); b.textContent = 'No matches'; b.className = 'text-fg';
484
+ empty.appendChild(b);
485
+ empty.appendChild(document.createTextNode(' for "' + filterTerm + '"'));
486
+ filterResults.appendChild(empty);
487
+ filterResults.dataset.open = 'true';
488
+ activeMatchIndex = -1;
489
+ return;
490
+ }
491
+ const limit = Math.min(matches.length, 24);
492
+ for (let i = 0; i < limit; i++) {
493
+ const m = matches[i];
494
+ const row = document.createElement('div');
495
+ row.className = CLS.matchItem;
496
+ row.setAttribute('role', 'option');
497
+ row.dataset.index = String(i);
498
+ if (i === activeMatchIndex) row.setAttribute('aria-selected', 'true');
499
+
500
+ const nameEl = document.createElement('span');
501
+ nameEl.className = CLS.miName;
502
+ const idx = m.name.toLowerCase().indexOf(filterTerm);
503
+ if (idx >= 0) {
504
+ nameEl.appendChild(document.createTextNode(m.name.slice(0, idx)));
505
+ const mark = document.createElement('mark');
506
+ mark.className = CLS.miMark;
507
+ mark.textContent = m.name.slice(idx, idx + filterTerm.length);
508
+ nameEl.appendChild(mark);
509
+ nameEl.appendChild(document.createTextNode(m.name.slice(idx + filterTerm.length)));
510
+ } else {
511
+ nameEl.textContent = m.name;
512
+ }
513
+ row.appendChild(nameEl);
514
+
515
+ const kindEl = document.createElement('span');
516
+ kindEl.className = CLS.miKind;
517
+ kindEl.textContent = m.type === 'application' ? 'app' : 'lib';
518
+ row.appendChild(kindEl);
519
+
520
+ row.addEventListener('mousedown', (ev) => {
521
+ ev.preventDefault();
522
+ focusOnNode(m.name);
523
+ filterResults.dataset.open = 'false';
524
+ });
525
+ filterResults.appendChild(row);
526
+ }
527
+ if (matches.length > limit) {
528
+ const more = document.createElement('div');
529
+ more.className = CLS.matchEmpty;
530
+ more.textContent = '+ ' + (matches.length - limit) + ' more — refine to see';
531
+ filterResults.appendChild(more);
532
+ }
533
+ filterResults.dataset.open = 'true';
534
+ };
535
+
536
+ const recomputeMatches = () => {
537
+ if (!filterTerm) { matches = []; return; }
538
+ matches = [];
539
+ for (const n of data.nodes) {
540
+ if (n.name.toLowerCase().includes(filterTerm)) matches.push(n);
541
+ }
542
+ matches.sort((a, b) => {
543
+ // Apps first, then by closeness of match position, then by name.
544
+ if (a.type !== b.type) return a.type === 'application' ? -1 : 1;
545
+ const ai = a.name.toLowerCase().indexOf(filterTerm);
546
+ const bi = b.name.toLowerCase().indexOf(filterTerm);
547
+ if (ai !== bi) return ai - bi;
548
+ return a.name.localeCompare(b.name);
549
+ });
550
+ };
551
+
552
+ let rafQueued = false;
553
+ filterInput.addEventListener('input', () => {
554
+ filterTerm = filterInput.value.toLowerCase().trim();
555
+ recomputeMatches();
556
+ activeMatchIndex = matches.length ? 0 : -1;
557
+ renderResults();
558
+ if (!rafQueued) {
559
+ rafQueued = true;
560
+ requestAnimationFrame(() => {
561
+ rafQueued = false;
562
+ renderer.refresh({ skipIndexation: true });
563
+ });
564
+ }
565
+ });
566
+
567
+ filterInput.addEventListener('focus', () => {
568
+ if (filterTerm) filterResults.dataset.open = 'true';
569
+ });
570
+
571
+ document.addEventListener('mousedown', (e) => {
572
+ if (!filterResults.contains(e.target) && e.target !== filterInput) {
573
+ filterResults.dataset.open = 'false';
574
+ }
575
+ });
576
+
577
+ filterInput.addEventListener('keydown', (e) => {
578
+ if (e.key === 'ArrowDown') {
579
+ if (matches.length) {
580
+ e.preventDefault();
581
+ activeMatchIndex = (activeMatchIndex + 1) % matches.length;
582
+ renderResults();
583
+ }
584
+ } else if (e.key === 'ArrowUp') {
585
+ if (matches.length) {
586
+ e.preventDefault();
587
+ activeMatchIndex = (activeMatchIndex - 1 + matches.length) % matches.length;
588
+ renderResults();
589
+ }
590
+ } else if (e.key === 'Enter') {
591
+ if (matches.length && activeMatchIndex >= 0) {
592
+ e.preventDefault();
593
+ focusOnNode(matches[activeMatchIndex].name);
594
+ filterResults.dataset.open = 'false';
595
+ }
596
+ }
597
+ });
598
+
599
+ // ── Legend / category filter ─────────────────────────────────────────
600
+ const legend = document.getElementById('legend');
601
+ const toggleCategory = (key) => {
602
+ if (!(key in visible)) return;
603
+ visible[key] = !visible[key];
604
+ const row = legend?.querySelector('[data-toggle="' + key + '"]');
605
+ if (row) {
606
+ row.dataset.state = visible[key] ? 'on' : 'off';
607
+ row.setAttribute('aria-checked', String(visible[key]));
608
+ }
609
+ renderer.refresh({ skipIndexation: true });
610
+ };
611
+ let previewRafQueued = false;
612
+ const queuePreviewRefresh = () => {
613
+ if (previewRafQueued) return;
614
+ previewRafQueued = true;
615
+ requestAnimationFrame(() => {
616
+ previewRafQueued = false;
617
+ renderer.refresh({ skipIndexation: true });
618
+ });
619
+ };
620
+ legend?.querySelectorAll('[data-toggle]').forEach((row) => {
621
+ row.addEventListener('click', () => toggleCategory(row.dataset.toggle));
622
+ row.addEventListener('mouseenter', () => {
623
+ previewCategory = row.dataset.toggle;
624
+ queuePreviewRefresh();
625
+ });
626
+ row.addEventListener('mouseleave', () => {
627
+ previewCategory = null;
628
+ queuePreviewRefresh();
629
+ });
630
+ row.addEventListener('focus', () => {
631
+ previewCategory = row.dataset.toggle;
632
+ queuePreviewRefresh();
633
+ });
634
+ row.addEventListener('blur', () => {
635
+ previewCategory = null;
636
+ queuePreviewRefresh();
637
+ });
638
+ row.addEventListener('keydown', (e) => {
639
+ if (e.key === ' ' || e.key === 'Enter') {
640
+ e.preventDefault();
641
+ toggleCategory(row.dataset.toggle);
642
+ }
643
+ });
644
+ });
645
+
646
+ // ── Camera controls ──────────────────────────────────────────────────
647
+ const resetView = () => {
648
+ renderer.getCamera().animatedReset({ duration: 600 });
649
+ };
650
+
651
+ const applyTheme = () => {
652
+ theme = css();
653
+ graph.forEachNode((node, attrs) => {
654
+ graph.setNodeAttribute(node, 'color', colorForNode(attrs.kind));
655
+ });
656
+ graph.forEachEdge((edge, attrs) => {
657
+ graph.setEdgeAttribute(edge, 'color', colorForEdge(attrs.depType));
658
+ });
659
+ renderer.setSetting('labelColor', { color: theme.fg });
660
+ renderer.setSetting('defaultEdgeColor', theme.edge);
661
+ renderer.setSetting('defaultNodeColor', theme.lib);
662
+ renderer.refresh();
663
+ };
664
+
665
+ themeBtn?.addEventListener('click', () => {
666
+ const isDark = root.dataset.theme ? root.dataset.theme === 'dark' : mql.matches;
667
+ const next = isDark ? 'light' : 'dark';
668
+ root.dataset.theme = next;
669
+ try { localStorage.setItem('vis-graph-theme', next); } catch {}
670
+ applyTheme();
671
+ });
672
+
673
+ mql.addEventListener('change', () => {
674
+ if (!root.dataset.theme) applyTheme();
675
+ });
676
+
677
+ // Keyboard shortcuts: '/' focuses search, 'R' fits view, Esc clears + unpins.
678
+ window.addEventListener('keydown', (e) => {
679
+ const inField = document.activeElement === filterInput;
680
+ if (e.key === '/' && !inField) {
681
+ e.preventDefault();
682
+ filterInput.focus();
683
+ filterInput.select();
684
+ } else if ((e.key === 'r' || e.key === 'R') && !inField) {
685
+ e.preventDefault();
686
+ resetView();
687
+ } else if (e.key === 'Escape') {
688
+ if (inField) {
689
+ filterInput.value = '';
690
+ filterTerm = '';
691
+ matches = [];
692
+ renderResults();
693
+ renderer.refresh({ skipIndexation: true });
694
+ filterInput.blur();
695
+ } else if (pinned || focusedNode) {
696
+ focusedNode = null;
697
+ pinned = false;
698
+ tooltip.dataset.pinned = 'false';
699
+ if (!hoveredNode) hideTooltip();
700
+ renderer.refresh({ skipIndexation: true });
701
+ }
702
+ }
703
+ });
704
+ })();
705
+ <\/script>
706
+ </body>
707
+ </html>`},"emitGraphHtml");var Fi=Object.defineProperty,je=b((n,e)=>Fi(n,"name",{value:e,configurable:!0}),"l");const Pi={application:0,library:3,service:1,tool:2},Gt=je(n=>Pi[n]??Number.MAX_SAFE_INTEGER,"typeRank"),Wi=je(n=>{const e=new Map;for(const[t,r]of Object.entries(n.dependencies))for(const i of r){const o=e.get(i.target)??[];o.push(t),e.set(i.target,o)}return Object.values(n.nodes).map(t=>({deps:n.dependencies[t.name]??[],name:t.name,reverseDeps:e.get(t.name)??[],type:t.type})).sort((t,r)=>t.type!==r.type?Gt(t.type)-Gt(r.type):t.name.localeCompare(r.name))},"buildNodes"),qi=je((n,e,t)=>{let r=n;if(e==="app"?r=r.filter(i=>i.type==="application"):e==="lib"&&(r=r.filter(i=>i.type!=="application")),t){const i=t.toLowerCase();r=r.filter(o=>o.name.toLowerCase().includes(i))}return r},"filterNodes");class Bi{static{b(this,"GraphStore")}static{je(this,"GraphStore")}#e;#r=new Set;#i;constructor(e){this.#i=e;const t=Wi(e);this.#e={allNodes:t,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",selectedIndex:0}}getSnapshot=je(()=>this.#e,"getSnapshot");subscribe=je(e=>(this.#r.add(e),()=>{this.#r.delete(e)}),"subscribe");getFilteredNodes(){return qi(this.#e.allNodes,this.#e.filterType,this.#e.filterText)}getStats(){const e=this.#e.allNodes.filter(i=>i.type==="application").length,t=this.#e.allNodes.length,r=Object.values(this.#i.dependencies).reduce((i,o)=>i+o.length,0);return{apps:e,deps:r,libs:t-e,total:t}}setSelectedIndex(e){const t=this.getFilteredNodes(),r=t.length===0?-1:Math.max(0,Math.min(e,t.length-1));r!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:r})}setFocusedPanel(e){e!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:e})}setFilterType(e){e!==this.#e.filterType&&this.#t({...this.#e,filterType:e,selectedIndex:0})}setFilter(e){this.#t({...this.#e,filterText:e,selectedIndex:0})}setFilterActive(e){e!==this.#e.filterActive&&this.#t({...this.#e,filterActive:e,filterText:e?this.#e.filterText:"",selectedIndex:e?this.#e.selectedIndex:0})}#t(e){this.#e=e;for(const t of this.#r)try{t()}catch{}}}var Hi=Object.defineProperty,Vi=b((n,e)=>Hi(n,"name",{value:e,configurable:!0}),"p");const Ki=Vi(({focused:n,node:e,scrollRef:t})=>{const r=n?"white":"gray";if(!e)return h.jsx($,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:h.jsx(y,{dimColor:!0,children:"No project selected"})});const i=e.type==="application",o=i?"yellow":"cyan",a=i?"Application":"Library";return h.jsx($,{borderColor:r,borderStyle:"single",borderTopRightTitle:` ${a} `,borderTopTitle:` ${e.name} `,flexDirection:"column",flexGrow:1,children:h.jsxs(Vr,{flexGrow:1,flexShrink:1,paddingX:2,ref:t,scrollbar:!0,scrollbarColor:"gray",children:[h.jsxs($,{flexDirection:"column",marginTop:1,children:[h.jsxs($,{children:[h.jsx(y,{dimColor:!0,children:"── "}),h.jsx(y,{bold:!0,color:"white",children:"DEPENDS ON"}),h.jsxs(y,{dimColor:!0,children:[" ","(",e.deps.length,")"]})]}),e.deps.length===0?h.jsx($,{marginTop:1,paddingLeft:2,children:h.jsx(y,{dimColor:!0,children:"No dependencies"})}):h.jsx($,{flexDirection:"column",marginTop:1,children:e.deps.map(s=>h.jsxs($,{gap:1,paddingLeft:2,children:[h.jsx(y,{color:"cyan",children:"→"}),h.jsx(y,{children:s.target}),s.type!=="static"&&h.jsxs(y,{dimColor:!0,children:["(",s.type,")"]})]},s.target))})]}),h.jsxs($,{flexDirection:"column",marginTop:1,children:[h.jsxs($,{children:[h.jsx(y,{dimColor:!0,children:"── "}),h.jsx(y,{bold:!0,color:"white",children:"REQUIRED BY"}),h.jsxs(y,{dimColor:!0,children:[" ","(",e.reverseDeps.length,")"]})]}),e.reverseDeps.length===0?h.jsx($,{marginTop:1,paddingLeft:2,children:h.jsx(y,{dimColor:!0,children:"No reverse dependencies"})}):h.jsx($,{flexDirection:"column",marginTop:1,children:e.reverseDeps.map(s=>h.jsxs($,{gap:1,paddingLeft:2,children:[h.jsx(y,{color:"magenta",children:"←"}),h.jsx(y,{children:s})]},s))})]}),h.jsxs($,{flexDirection:"column",marginTop:1,children:[h.jsxs($,{children:[h.jsx(y,{dimColor:!0,children:"── "}),h.jsx(y,{bold:!0,color:"white",children:"INFO"})]}),h.jsxs($,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[h.jsxs($,{children:[h.jsx($,{width:16,children:h.jsx(y,{dimColor:!0,children:"Type:"})}),h.jsx(y,{color:o,children:a})]}),h.jsxs($,{children:[h.jsx($,{width:16,children:h.jsx(y,{dimColor:!0,children:"Dependencies:"})}),h.jsx(y,{children:String(e.deps.length)})]}),h.jsxs($,{children:[h.jsx($,{width:16,children:h.jsx(y,{dimColor:!0,children:"Required by:"})}),h.jsx(y,{children:String(e.reverseDeps.length)})]}),h.jsxs($,{children:[h.jsx($,{width:16,children:h.jsx(y,{dimColor:!0,children:"Connectivity:"})}),h.jsx(y,{children:String(e.deps.length+e.reverseDeps.length)})]})]})]})]})})},"ProjectDetailPanel");var Xi=Object.defineProperty,gt=b((n,e)=>Xi(n,"name",{value:e,configurable:!0}),"m");const Yi=[{key:"all",label:"All",shortcut:"1"},{key:"app",label:"Apps",shortcut:"2"},{key:"lib",label:"Libs",shortcut:"3"}],jt=gt(({isSelected:n,node:e})=>{const t=e.type==="application",r=t?"yellow":"cyan",i=t?"app":"lib";return h.jsxs($,{flexShrink:0,height:1,children:[h.jsxs(y,{children:[n?"▶":" "," "]}),h.jsx($,{flexGrow:1,children:h.jsx(y,{bold:n,inverse:n,wrap:"truncate",children:e.name})}),h.jsxs(y,{color:r,children:[" ",i]}),h.jsxs(y,{dimColor:!0,children:[" ","→",e.deps.length," ","←",e.reverseDeps.length]})]})},"ProjectRow"),At=gt(({count:n,label:e})=>h.jsxs($,{flexShrink:0,height:1,marginTop:1,children:[h.jsxs(y,{dimColor:!0,children:["▼"," "]}),h.jsx(y,{bold:!0,color:"white",children:e.toUpperCase()}),h.jsxs(y,{dimColor:!0,children:[" ","(",n,")"]})]}),"TypeHeader"),Qi=gt(({filterActive:n,filterText:e,filterType:t,focused:r,nodes:i,scrollOffset:o,selectedIndex:a,stats:s,viewportHeight:d})=>{const c=r?"white":"gray",u=i.filter(G=>G.type==="application"),l=i.filter(G=>G.type!=="application"),g=[];let x=0;if(u.length>0){g.push(h.jsx(At,{count:u.length,label:"Applications"},"hdr-apps"));for(const G of u){const D=x;g.push(h.jsx(jt,{isSelected:D===a,node:G},G.name)),x++}}if(l.length>0){g.push(h.jsx(At,{count:l.length,label:"Libraries"},"hdr-libs"));for(const G of l){const D=x;g.push(h.jsx(jt,{isSelected:D===a,node:G},G.name)),x++}}let j=0;u.length>0&&(j+=2+u.length),l.length>0&&(j+=2+l.length);const A=j>d&&d>0;return h.jsxs($,{borderColor:c,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[h.jsxs($,{flexShrink:0,gap:1,paddingX:1,children:[h.jsx(y,{bold:!0,inverse:!0,children:" VIS "}),h.jsxs(y,{wrap:"truncate",children:[s.total," ","packages"]}),h.jsxs(y,{dimColor:!0,children:["(",s.apps," ","apps,"," ",s.libs," ","libs,"," ",s.deps," ","deps)"]})]}),h.jsx($,{flexShrink:0,gap:1,paddingX:1,paddingY:1,children:Yi.map(G=>{const D=t===G.key;return h.jsxs($,{children:[h.jsx(y,{dimColor:!D,children:"["}),h.jsx(y,{bold:D,color:D?"cyan":"gray",children:G.shortcut}),h.jsx(y,{dimColor:!D,children:"]"}),h.jsxs(y,{color:D?"white":"gray",children:[" ",G.label]})]},G.key)})}),n&&h.jsxs($,{flexShrink:0,paddingX:1,children:[h.jsx(y,{bold:!0,color:"white",children:"/ "}),h.jsx(y,{children:e}),h.jsx(y,{inverse:!0,children:" "})]}),h.jsxs($,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[h.jsx($,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:h.jsx($,{flexDirection:"column",marginTop:-o,children:g})}),A&&h.jsx($,{flexShrink:0,marginLeft:1,marginRight:1,children:h.jsx(Kr,{contentHeight:j,placement:"inset",scrollOffset:o,style:"block",viewportHeight:d})})]})]})},"ProjectListPanel");var Ji=Object.defineProperty,Zi=b((n,e)=>Ji(n,"name",{value:e,configurable:!0}),"E");const en=100,tn=40,rn=10,St={1:"all",2:"app",3:"lib"},nn=Zi(({autoExitSeconds:n=0,store:e})=>{const{exit:t}=Xr(),{columns:r,rows:i}=Yr(),o=te.useSyncExternalStore(e.subscribe,e.getSnapshot),[a,s]=te.useState(!1),d=te.useRef(null),c=te.useRef(null),[u,l]=te.useState(0),[g,x]=te.useState(!1),j=te.useMemo(()=>e.getFilteredNodes(),[o.allNodes,o.filterType,o.filterText]),A=te.useMemo(()=>e.getStats(),[o.allNodes]),G=j[o.selectedIndex]??null,D=te.useMemo(()=>{let I=0,L=0;for(const N of j)N.type==="application"?I+=1:L+=1;return{appsCount:I,libsCount:L}},[j]),R=te.useCallback(I=>{const{appsCount:L,libsCount:N}=D;if(I<L)return(L>0?2:0)+I;const p=L>0?2+L:0,ye=N>0?2:0;return p+ye+(I-L)},[D]),U=Math.max(1,i-8-(o.filterActive?1:0)),T=te.useCallback(I=>{const L=R(I);l(N=>L>N+U-2?Math.max(0,L-U+2):L<N+1?Math.max(0,L-1):N)},[R,U]);if(te.useEffect(()=>{c.current?.scrollToTop()},[G?.name]),Qr((I,L)=>{if(I==="c"&&L.ctrl){t();return}if(!g){if(a){L.escape||I==="?"?s(!1):I==="q"?(s(!1),x(!0)):L.downArrow||I==="j"?d.current?.scrollBy(1):(L.upArrow||I==="k")&&d.current?.scrollBy(-1);return}if(I==="?"){s(!0);return}if(I==="q"){x(!0);return}if(L.tab){e.setFocusedPanel(o.focusedPanel==="list"?"detail":"list");return}if(St[I]){e.setFilterType(St[I]);return}if(o.filterActive){if(L.escape){e.setFilterActive(!1);return}if(L.return){e.setFilterActive(!1);return}if(L.backspace){e.setFilter(o.filterText.slice(0,-1));return}if(I&&!L.ctrl&&!L.meta){e.setFilter(o.filterText+I);return}return}if(o.focusedPanel==="list"){if(j.length===0){I==="/"&&e.setFilterActive(!0);return}if(L.downArrow||I==="j"){const N=Math.min(o.selectedIndex+1,j.length-1);e.setSelectedIndex(N),T(N);return}if(L.upArrow||I==="k"){const N=Math.max(o.selectedIndex-1,0);e.setSelectedIndex(N),T(N);return}if(L.pageDown){const N=Math.min(o.selectedIndex+10,j.length-1);e.setSelectedIndex(N),T(N);return}if(L.pageUp){const N=Math.max(o.selectedIndex-10,0);e.setSelectedIndex(N),T(N);return}if(L.home){e.setSelectedIndex(0),l(0);return}if(L.end){const N=j.length-1;e.setSelectedIndex(N),T(N);return}if(I==="/"){e.setFilterActive(!0);return}if(L.rightArrow){e.setFocusedPanel("detail");return}return}if(o.focusedPanel==="detail"){if(L.escape||L.leftArrow){e.setFocusedPanel("list");return}if(L.downArrow||I==="j"){c.current?.scrollBy(1);return}if(L.upArrow||I==="k"){c.current?.scrollBy(-1);return}if(L.pageDown){c.current?.scrollBy(10);return}if(L.pageUp){c.current?.scrollBy(-10);return}if(L.home){c.current?.scrollToTop();return}L.end&&c.current?.scrollToBottom()}}},{isActive:!0}),r<tn||i<rn)return h.jsx($,{alignItems:"center",height:i,justifyContent:"center",width:r,children:h.jsxs(y,{color:"yellow",children:["Terminal too small (",r,"x",i,")"]})});const B=r>=en,Y=h.jsx($,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:h.jsxs($,{flexWrap:"wrap",gap:2,paddingX:1,children:[h.jsxs($,{gap:1,children:[h.jsx(y,{bold:!0,color:"white",children:"q"}),h.jsx(y,{dimColor:!0,children:"QUIT"})]},"q"),h.jsxs($,{gap:1,children:[h.jsx(y,{bold:!0,color:"white",children:"?"}),h.jsx(y,{dimColor:!0,children:"HELP"})]},"?"),h.jsxs($,{gap:1,children:[h.jsx(y,{bold:!0,color:"white",children:"↑↓"}),h.jsx(y,{dimColor:!0,children:"NAV"})]},"nav"),h.jsxs($,{gap:1,children:[h.jsx(y,{bold:!0,color:"white",children:"1-3 /"}),h.jsx(y,{dimColor:!0,children:"FILTER"})]},"f"),h.jsxs($,{gap:1,children:[h.jsx(y,{bold:!0,color:"white",children:"Tab"}),h.jsx(y,{dimColor:!0,children:"PANEL"})]},"t")]})}),Q=h.jsxs(Jr,{footer:h.jsxs(y,{dimColor:!0,children:[h.jsx(y,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",h.jsx(y,{bold:!0,color:"white",children:"?"}),"/",h.jsx(y,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:d,title:"KEYBOARD SHORTCUTS",visible:a,width:52,children:[h.jsxs($,{flexDirection:"column",marginBottom:1,children:[h.jsxs($,{marginBottom:1,children:[h.jsx(y,{dimColor:!0,children:"── "}),h.jsx(y,{bold:!0,color:"white",children:"NAVIGATION"})]}),h.jsxs($,{children:[h.jsx($,{width:24,children:h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","↑","/k"]}),h.jsx(y,{dimColor:!0,children:" Move up"})]})}),h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","↓","/j"]}),h.jsx(y,{dimColor:!0,children:" Move down"})]})]}),h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","Tab"]}),h.jsx(y,{dimColor:!0,children:" Switch panel"})]}),h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","→","/","←"]}),h.jsx(y,{dimColor:!0,children:" Focus detail/list"})]}),h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","PgUp/PgDn"]}),h.jsx(y,{dimColor:!0,children:" Jump 10 items"})]}),h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","Home/End"]}),h.jsx(y,{dimColor:!0,children:" Jump to start/end"})]})]}),h.jsxs($,{flexDirection:"column",marginBottom:1,children:[h.jsxs($,{marginBottom:1,children:[h.jsx(y,{dimColor:!0,children:"── "}),h.jsx(y,{bold:!0,color:"white",children:"FILTERS"})]}),h.jsxs($,{children:[h.jsx($,{width:24,children:h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","1"]}),h.jsx(y,{dimColor:!0,children:" All"})]})}),h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","2"]}),h.jsx(y,{dimColor:!0,children:" Apps only"})]})]}),h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","3"]}),h.jsx(y,{dimColor:!0,children:" Libraries only"})]}),h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","/"]}),h.jsx(y,{dimColor:!0,children:" Text filter"})]})]}),h.jsxs($,{flexDirection:"column",children:[h.jsxs($,{marginBottom:1,children:[h.jsx(y,{dimColor:!0,children:"── "}),h.jsx(y,{bold:!0,color:"white",children:"ACTIONS"})]}),h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","q"]}),h.jsx(y,{dimColor:!0,children:" Quit"})]}),h.jsxs(y,{children:[h.jsxs(y,{bold:!0,color:"white",children:[" ","?"]}),h.jsx(y,{dimColor:!0,children:" Toggle help"})]})]})]}),Se=h.jsx(Qi,{filterActive:o.filterActive,filterText:o.filterText,filterType:o.filterType,focused:o.focusedPanel==="list",nodes:j,scrollOffset:u,selectedIndex:o.selectedIndex,stats:A,viewportHeight:U}),X=h.jsx(Ki,{focused:o.focusedPanel==="detail",node:G,scrollRef:c});if(B){const I=Math.floor(r*.35);return h.jsxs($,{flexDirection:"column",height:i,width:r,children:[h.jsxs($,{flexDirection:"row",flexGrow:1,children:[h.jsx($,{flexGrow:1,children:Se}),h.jsx($,{width:I,children:X})]}),Y,h.jsx(mt,{autoExitSeconds:n??3,onCancel:b(()=>{x(!1)},"onCancel"),visible:g}),Q]})}const Ye=Math.floor(i*.55);return h.jsxs($,{flexDirection:"column",height:i,width:r,children:[h.jsx($,{height:Ye,children:Se}),h.jsx($,{flexGrow:1,children:X}),Y,h.jsx(mt,{autoExitSeconds:n??3,onCancel:b(()=>{x(!1)},"onCancel"),visible:g}),Q]})},"VisGraphApp");var on=Object.defineProperty,Ae=b((n,e)=>on(n,"name",{value:e,configurable:!0}),"y");const zr=Ae((n,e,t,r,i,o,a,s)=>{const d=t?ie("└── "):ie("├── "),c=i.has(n),u=c?ie(" (*)"):"",l=r.get(n),g=l?.type==="application"?le(n):n;if(o.push(`${e}${d}${g}${u}`),c)return;i.add(n);const x=l?.deps??[],j=t?`${e} `:`${e}${ie("│")} `;if(s>=a&&x.length>0){o.push(`${j}${ie(`... ${x.length} more`)}`);return}for(let A=0;A<x.length;A++){const G=x[A];G&&zr(G.target,j,A===x.length-1,r,i,o,a,s+1)}},"printDepsTree"),Nt=Ae((n,e,t,r,i,o)=>{const a=e.get(n),s=a?.type==="application"?le(n):n;r.push(`${o}${s}`),t.add(n);const d=a?.deps??[];if(d.length===0){r.push(`${o} ${ie("(no dependencies)")}`);return}if(i<=0){r.push(`${o} ${ie(`... ${d.length} dependencies`)}`);return}for(let c=0;c<d.length;c++){const u=d[c];u&&zr(u.target,o,c===d.length-1,e,t,r,i,1)}},"printRootProject"),Ct=Ae((n,e)=>{const t=new Map;for(const[l,g]of Object.entries(n.nodes))t.set(l,{deps:(n.dependencies[l]??[]).map(x=>({target:x.target,type:x.type})),name:l,type:g.type});const r=[],i=[];for(const[l,g]of t)g.type==="application"?r.push(l):i.push(l);r.sort(),i.sort();const o=r.length+i.length,a=Object.values(n.dependencies).reduce((l,g)=>l+g.length,0),s=[le("Project Dependency Graph"),""];if(r.length>0){s.push(` ${le(ft(`Applications (${r.length})`))}`,"");for(const l of r)Nt(l,t,new Set,s,e," "),s.push("")}if(i.length>0){s.push(` ${le(ft(`Libraries (${i.length})`))}`,"");for(const l of i)Nt(l,t,new Set,s,e," "),s.push("")}const d=process.stdout.columns||80;s.push(ie("─".repeat(Math.min(d,60)))),s.push(`${le(String(o))} packages ${ie("·")} ${le(String(a))} dependencies ${ie("·")} ${le(String(r.length))} apps${ie(",")} ${le(String(i.length))} libraries`);const c=new Set;let u=!1;for(const l of[...r,...i]){const g=t.get(l)?.deps??[];for(const x of g)c.has(x.target)&&(u=!0),c.add(x.target);c.add(l)}return u&&s.push(ie("(*) = already shown above")),s.join(`
708
+ `)},"projectGraphToAscii"),an=Ae(n=>{const e=Object.values(n.nodes).map(t=>({name:t.name,type:t.type}));return{edges:Object.values(n.dependencies).flat(),nodes:e}},"projectGraphToJson"),sn=Ae(n=>{const e=Object.values(n.nodes).map(r=>({name:r.name,path:r.data?.root,type:r.type})),t=[];for(const r of Object.values(n.dependencies))for(const i of r)t.push({source:i.source,target:i.target,type:i.type});return Ui({edges:t,nodes:e,tool:{name:"vis-graph",version:"alpha"},workspaceRoot:process.cwd()})},"projectGraphToHtml"),wn=Ae(async({logger:n,options:e,visConfig:t,workspaceRoot:r})=>{if(!r)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const i=r,{packageJsons:o,workspace:a}=Zr(i,t),s=ei(i,a,o),d=!!process.stdout.isTTY&&!ii,c=e.format??(d?"tui":"ascii"),u=e.output,l=e.depth??1/0;let g;switch(c){case"dot":{g=Hr(s);break}case"html":{g=sn(s);break}case"json":{g=JSON.stringify(an(s),void 0,2);break}case"tui":{if(!d){g=Ct(s,l);break}const x=t?.tui?.autoExit===!0?3:typeof t?.tui?.autoExit=="number"?t.tui.autoExit:0;process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume());const j=setInterval(()=>{},1e3),A=new Bi(s);await ti(ri.createElement(nn,{autoExitSeconds:x,store:A}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),clearInterval(j);return}default:g=Ct(s,l)}u?(Br(u,g,"utf8"),n.info(`Graph written to ${u}`)):n.info(g)},"execute");export{wn as default};