modular-studio 1.0.6 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/dist/assets/Badge-Bsy2H_p2.js +1 -0
  2. package/dist/assets/GraphPanel-D4X3faxA.js +47 -0
  3. package/dist/assets/{Input-ndEGQSgx.js → Input-Dyb88Erk.js} +1 -1
  4. package/dist/assets/KnowledgeTab-BccWz7Np.js +5 -0
  5. package/dist/assets/MemoryTab-Y_66cE01.js +16 -0
  6. package/dist/assets/QualificationTab-Dm9dEIpM.js +1 -0
  7. package/dist/assets/ReviewTab-BrfXSyyf.js +104 -0
  8. package/dist/assets/{Section-CgmwAj_2.js → Section-68XDCFTl.js} +1 -1
  9. package/dist/assets/TestTab-CLKRT63X.js +42 -0
  10. package/dist/assets/{ToolsTab-C10Ulm8b.js → ToolsTab-xumi9Uds.js} +1 -1
  11. package/dist/assets/icons-CS8RUPBi.js +1 -0
  12. package/dist/assets/index-B2bm0161.css +1 -0
  13. package/dist/assets/index-C626nWuA.js +422 -0
  14. package/dist/assets/services-BDk6yY4o.js +369 -0
  15. package/dist/index.html +4 -4
  16. package/dist-server/bin/modular-mcp.js +1 -0
  17. package/dist-server/server/index.d.ts.map +1 -1
  18. package/dist-server/server/index.js +30 -0
  19. package/dist-server/server/mcp/manager.d.ts +3 -0
  20. package/dist-server/server/mcp/manager.d.ts.map +1 -1
  21. package/dist-server/server/mcp/manager.js +64 -3
  22. package/dist-server/server/migrations/index.d.ts +11 -0
  23. package/dist-server/server/migrations/index.d.ts.map +1 -0
  24. package/dist-server/server/migrations/index.js +57 -0
  25. package/dist-server/server/routes/analytics.d.ts +3 -0
  26. package/dist-server/server/routes/analytics.d.ts.map +1 -0
  27. package/dist-server/server/routes/analytics.js +24 -0
  28. package/dist-server/server/routes/connectors/airtable.d.ts +7 -0
  29. package/dist-server/server/routes/connectors/airtable.d.ts.map +1 -0
  30. package/dist-server/server/routes/connectors/airtable.js +119 -0
  31. package/dist-server/server/routes/connectors/confluence.d.ts +7 -0
  32. package/dist-server/server/routes/connectors/confluence.d.ts.map +1 -0
  33. package/dist-server/server/routes/connectors/confluence.js +176 -0
  34. package/dist-server/server/routes/connectors/github.d.ts +7 -0
  35. package/dist-server/server/routes/connectors/github.d.ts.map +1 -0
  36. package/dist-server/server/routes/connectors/github.js +195 -0
  37. package/dist-server/server/routes/connectors/gmail.d.ts +7 -0
  38. package/dist-server/server/routes/connectors/gmail.d.ts.map +1 -0
  39. package/dist-server/server/routes/connectors/gmail.js +115 -0
  40. package/dist-server/server/routes/connectors/google-docs.d.ts +10 -0
  41. package/dist-server/server/routes/connectors/google-docs.d.ts.map +1 -0
  42. package/dist-server/server/routes/connectors/google-docs.js +165 -0
  43. package/dist-server/server/routes/connectors/google-drive.d.ts +7 -0
  44. package/dist-server/server/routes/connectors/google-drive.d.ts.map +1 -0
  45. package/dist-server/server/routes/connectors/google-drive.js +163 -0
  46. package/dist-server/server/routes/connectors/google-sheets.d.ts +7 -0
  47. package/dist-server/server/routes/connectors/google-sheets.d.ts.map +1 -0
  48. package/dist-server/server/routes/connectors/google-sheets.js +90 -0
  49. package/dist-server/server/routes/connectors/hubspot.d.ts +7 -0
  50. package/dist-server/server/routes/connectors/hubspot.d.ts.map +1 -0
  51. package/dist-server/server/routes/connectors/hubspot.js +134 -0
  52. package/dist-server/server/routes/connectors/index.d.ts +6 -0
  53. package/dist-server/server/routes/connectors/index.d.ts.map +1 -0
  54. package/dist-server/server/routes/connectors/index.js +38 -0
  55. package/dist-server/server/routes/connectors/jira.d.ts +7 -0
  56. package/dist-server/server/routes/connectors/jira.d.ts.map +1 -0
  57. package/dist-server/server/routes/connectors/jira.js +151 -0
  58. package/dist-server/server/routes/connectors/linear.d.ts +7 -0
  59. package/dist-server/server/routes/connectors/linear.d.ts.map +1 -0
  60. package/dist-server/server/routes/connectors/linear.js +154 -0
  61. package/dist-server/server/routes/connectors/notion.d.ts +10 -0
  62. package/dist-server/server/routes/connectors/notion.d.ts.map +1 -0
  63. package/dist-server/server/routes/connectors/notion.js +201 -0
  64. package/dist-server/server/routes/connectors/plane.d.ts +10 -0
  65. package/dist-server/server/routes/connectors/plane.d.ts.map +1 -0
  66. package/dist-server/server/routes/connectors/plane.js +189 -0
  67. package/dist-server/server/routes/connectors/shared.d.ts +25 -0
  68. package/dist-server/server/routes/connectors/shared.d.ts.map +1 -0
  69. package/dist-server/server/routes/connectors/shared.js +202 -0
  70. package/dist-server/server/routes/connectors/slack.d.ts +7 -0
  71. package/dist-server/server/routes/connectors/slack.d.ts.map +1 -0
  72. package/dist-server/server/routes/connectors/slack.js +153 -0
  73. package/dist-server/server/routes/cost.d.ts +3 -0
  74. package/dist-server/server/routes/cost.d.ts.map +1 -0
  75. package/dist-server/server/routes/cost.js +113 -0
  76. package/dist-server/server/routes/graph.d.ts +11 -0
  77. package/dist-server/server/routes/graph.d.ts.map +1 -0
  78. package/dist-server/server/routes/graph.js +213 -0
  79. package/dist-server/server/routes/lessons.d.ts.map +1 -1
  80. package/dist-server/server/routes/lessons.js +119 -5
  81. package/dist-server/server/routes/llm.d.ts.map +1 -1
  82. package/dist-server/server/routes/llm.js +85 -18
  83. package/dist-server/server/routes/metaprompt-v2.d.ts +3 -0
  84. package/dist-server/server/routes/metaprompt-v2.d.ts.map +1 -0
  85. package/dist-server/server/routes/metaprompt-v2.js +104 -0
  86. package/dist-server/server/routes/qualification.d.ts.map +1 -1
  87. package/dist-server/server/routes/qualification.js +61 -11
  88. package/dist-server/server/routes/skills-search.d.ts.map +1 -1
  89. package/dist-server/server/routes/skills-search.js +10 -0
  90. package/dist-server/server/routes/tool-analytics.d.ts +3 -0
  91. package/dist-server/server/routes/tool-analytics.d.ts.map +1 -0
  92. package/dist-server/server/routes/tool-analytics.js +47 -0
  93. package/dist-server/server/services/adapters/sqliteAdapter.d.ts +1 -0
  94. package/dist-server/server/services/adapters/sqliteAdapter.d.ts.map +1 -1
  95. package/dist-server/server/services/adapters/sqliteAdapter.js +78 -48
  96. package/dist-server/server/services/credentialStore.d.ts +10 -0
  97. package/dist-server/server/services/credentialStore.d.ts.map +1 -0
  98. package/dist-server/server/services/credentialStore.js +123 -0
  99. package/dist-server/server/services/hindsightClient.d.ts.map +1 -1
  100. package/dist-server/server/services/hindsightClient.js +1 -0
  101. package/dist-server/server/services/lessonExtractor.d.ts +2 -0
  102. package/dist-server/server/services/lessonExtractor.d.ts.map +1 -1
  103. package/dist-server/server/services/lessonExtractor.js +7 -2
  104. package/dist-server/server/services/repoIndexer.d.ts +7 -1
  105. package/dist-server/server/services/repoIndexer.d.ts.map +1 -1
  106. package/dist-server/server/services/repoIndexer.js +295 -94
  107. package/dist-server/server/services/sqliteStore.d.ts +64 -0
  108. package/dist-server/server/services/sqliteStore.d.ts.map +1 -1
  109. package/dist-server/server/services/sqliteStore.js +238 -0
  110. package/dist-server/src/config.d.ts +2 -0
  111. package/dist-server/src/config.d.ts.map +1 -0
  112. package/dist-server/src/config.js +3 -0
  113. package/dist-server/src/graph/db.d.ts +46 -0
  114. package/dist-server/src/graph/db.d.ts.map +1 -0
  115. package/dist-server/src/graph/db.js +241 -0
  116. package/dist-server/src/graph/extractors/code.d.ts +12 -0
  117. package/dist-server/src/graph/extractors/code.d.ts.map +1 -0
  118. package/dist-server/src/graph/extractors/code.js +239 -0
  119. package/dist-server/src/graph/extractors/cross-type.d.ts +16 -0
  120. package/dist-server/src/graph/extractors/cross-type.d.ts.map +1 -0
  121. package/dist-server/src/graph/extractors/cross-type.js +67 -0
  122. package/dist-server/src/graph/extractors/markdown.d.ts +29 -0
  123. package/dist-server/src/graph/extractors/markdown.d.ts.map +1 -0
  124. package/dist-server/src/graph/extractors/markdown.js +224 -0
  125. package/dist-server/src/graph/extractors/yaml.d.ts +15 -0
  126. package/dist-server/src/graph/extractors/yaml.d.ts.map +1 -0
  127. package/dist-server/src/graph/extractors/yaml.js +104 -0
  128. package/dist-server/src/graph/index.d.ts +62 -0
  129. package/dist-server/src/graph/index.d.ts.map +1 -0
  130. package/dist-server/src/graph/index.js +67 -0
  131. package/dist-server/src/graph/packer.d.ts +19 -0
  132. package/dist-server/src/graph/packer.d.ts.map +1 -0
  133. package/dist-server/src/graph/packer.js +134 -0
  134. package/dist-server/src/graph/resolver.d.ts +12 -0
  135. package/dist-server/src/graph/resolver.d.ts.map +1 -0
  136. package/dist-server/src/graph/resolver.js +81 -0
  137. package/dist-server/src/graph/scanner.d.ts +34 -0
  138. package/dist-server/src/graph/scanner.d.ts.map +1 -0
  139. package/dist-server/src/graph/scanner.js +252 -0
  140. package/dist-server/src/graph/traverser.d.ts +17 -0
  141. package/dist-server/src/graph/traverser.d.ts.map +1 -0
  142. package/dist-server/src/graph/traverser.js +185 -0
  143. package/dist-server/src/graph/types.d.ts +117 -0
  144. package/dist-server/src/graph/types.d.ts.map +1 -0
  145. package/dist-server/src/graph/types.js +63 -0
  146. package/dist-server/src/metaprompt/v2/assembler.d.ts +3 -0
  147. package/dist-server/src/metaprompt/v2/assembler.d.ts.map +1 -0
  148. package/dist-server/src/metaprompt/v2/assembler.js +261 -0
  149. package/dist-server/src/metaprompt/v2/context-strategist.d.ts +3 -0
  150. package/dist-server/src/metaprompt/v2/context-strategist.d.ts.map +1 -0
  151. package/dist-server/src/metaprompt/v2/context-strategist.js +173 -0
  152. package/dist-server/src/metaprompt/v2/evaluator.d.ts +3 -0
  153. package/dist-server/src/metaprompt/v2/evaluator.d.ts.map +1 -0
  154. package/dist-server/src/metaprompt/v2/evaluator.js +281 -0
  155. package/dist-server/src/metaprompt/v2/index.d.ts +41 -0
  156. package/dist-server/src/metaprompt/v2/index.d.ts.map +1 -0
  157. package/dist-server/src/metaprompt/v2/index.js +90 -0
  158. package/dist-server/src/metaprompt/v2/parser.d.ts +3 -0
  159. package/dist-server/src/metaprompt/v2/parser.d.ts.map +1 -0
  160. package/dist-server/src/metaprompt/v2/parser.js +138 -0
  161. package/dist-server/src/metaprompt/v2/pattern-selector.d.ts +3 -0
  162. package/dist-server/src/metaprompt/v2/pattern-selector.d.ts.map +1 -0
  163. package/dist-server/src/metaprompt/v2/pattern-selector.js +154 -0
  164. package/dist-server/src/metaprompt/v2/researcher.d.ts +3 -0
  165. package/dist-server/src/metaprompt/v2/researcher.d.ts.map +1 -0
  166. package/dist-server/src/metaprompt/v2/researcher.js +194 -0
  167. package/dist-server/src/metaprompt/v2/tool-discovery.d.ts +74 -0
  168. package/dist-server/src/metaprompt/v2/tool-discovery.d.ts.map +1 -0
  169. package/dist-server/src/metaprompt/v2/tool-discovery.js +290 -0
  170. package/dist-server/src/metaprompt/v2/types.d.ts +154 -0
  171. package/dist-server/src/metaprompt/v2/types.d.ts.map +1 -0
  172. package/dist-server/src/metaprompt/v2/types.js +2 -0
  173. package/dist-server/src/services/contradictionDetector.js +1 -1
  174. package/dist-server/src/services/llmService.d.ts +61 -0
  175. package/dist-server/src/services/llmService.d.ts.map +1 -0
  176. package/dist-server/src/services/llmService.js +222 -0
  177. package/dist-server/src/store/knowledgeBase.d.ts +5 -1
  178. package/dist-server/src/store/knowledgeBase.d.ts.map +1 -1
  179. package/dist-server/src/store/knowledgeBase.js +0 -1
  180. package/dist-server/src/store/mcp-registry.d.ts +29 -0
  181. package/dist-server/src/store/mcp-registry.d.ts.map +1 -0
  182. package/dist-server/src/store/mcp-registry.js +1303 -0
  183. package/dist-server/src/types/registry.types.d.ts +13 -0
  184. package/dist-server/src/types/registry.types.d.ts.map +1 -0
  185. package/dist-server/src/types/registry.types.js +2 -0
  186. package/dist-server/tsconfig.server.tsbuildinfo +1 -1
  187. package/package.json +118 -105
  188. package/scripts/cleanup-worktrees.ps1 +29 -0
  189. package/dist/assets/Badge-DrUmDAXz.js +0 -1
  190. package/dist/assets/KnowledgeTab-CxlC76Rf.js +0 -4
  191. package/dist/assets/MemoryTab-CUScYWs9.js +0 -16
  192. package/dist/assets/QualificationTab-BqnWSQHm.js +0 -1
  193. package/dist/assets/ReviewTab-DKYl6cR9.js +0 -103
  194. package/dist/assets/TestTab-iJ2vCf9l.js +0 -33
  195. package/dist/assets/icons-MKpPNvV8.js +0 -1
  196. package/dist/assets/index-B_ip7Amg.css +0 -1
  197. package/dist/assets/index-gBy3427k.js +0 -143
  198. package/dist/assets/services-CTWXQK6j.js +0 -356
@@ -0,0 +1,47 @@
1
+ import{r as L,j as T,R as Jo,g as ta}from"./vendor-D1h_O76p.js";import{u as ee}from"./index-C626nWuA.js";import{u as xt}from"./KnowledgeTab-BccWz7Np.js";import{u as ea,z as na,A as ra}from"./services-BDk6yY4o.js";import{C as br,a as wr,ao as Ri,X as ia}from"./icons-CS8RUPBi.js";import"./stores-CeKWz7ou.js";const tr="#10b981",Ae="#f59e0b",er="#ef4444";function oa(e){return e>=71?tr:e>=41?Ae:er}function aa(e,n=!1){const r=n?1-e:e;return r>=.71?tr:r>=.41?Ae:er}function ji({value:e,color:n,height:r=4}){const i=ee();return T.jsx("div",{style:{flex:1,height:r,background:i.border,borderRadius:2,overflow:"hidden"},children:T.jsx("div",{style:{width:`${Math.min(100,e*100)}%`,height:"100%",background:n,borderRadius:2}})})}function ne({label:e,pct:n,count:r,invert:i=!1,warn:o=!1}){const a=ee(),s=n!==void 0?aa(n,i):o&&(r??0)>0?Ae:a.textSecondary;return T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,height:28},children:[T.jsx("span",{style:{fontSize:11,color:a.textSecondary,width:100,flexShrink:0},children:e}),n!==void 0?T.jsx(ji,{value:n,color:s,height:4}):T.jsx("div",{style:{flex:1}}),T.jsxs("span",{style:{fontSize:11,fontFamily:"'Geist Mono', monospace",color:s,width:44,textAlign:"right",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:3},children:[o&&(r??0)>0&&T.jsx(Ri,{size:10,color:Ae}),n!==void 0?`${Math.round(n*100)}%`:r]})]})}function sa({readiness:e,rootPath:n,nodes:r,relations:i}){const o=ee(),[a,s]=L.useState(!1),[l,u]=L.useState(!1),c=n?`modular-readiness-${n}`:null,h=L.useMemo(()=>{if(!c)return null;const m=localStorage.getItem(c);if(!m)return null;const S=parseInt(m,10);return isNaN(S)?null:S},[c]);L.useEffect(()=>{c&&localStorage.setItem(c,String(e.score))},[c,e.score]);const f=h!==null?e.score-h:null,d=f===null?"":f>0?`↑${f}`:f<0?`↓${Math.abs(f)}`:"=",p=f===null?o.textDim:f>0?tr:f<0?er:o.textDim,y=L.useMemo(()=>{const m=new Map;for(const S of i)S.kind==="imports"&&m.set(S.targetFile,(m.get(S.targetFile)??0)+1);return[...m.entries()].sort((S,b)=>b[1]-S[1]).slice(0,3).map(([S,b])=>({path:r.find(C=>C.id===S)?.path??S,count:b}))},[r,i]),x=L.useMemo(()=>{const m=new Set;for(const S of i)m.add(S.sourceFile),m.add(S.targetFile);return m},[i]),v=L.useMemo(()=>r.filter(m=>!x.has(m.id)).slice(0,20).map(m=>m.path),[r,x]),g=oa(e.score);return T.jsxs("div",{style:{background:o.surfaceElevated,border:`1px solid ${o.border}`,borderRadius:8,margin:"8px 12px",overflow:"hidden"},children:[T.jsxs("button",{onClick:()=>s(m=>!m),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"7px 10px",background:"transparent",border:"none",cursor:"pointer",color:o.textPrimary},children:[a?T.jsx(br,{size:13,color:o.textDim}):T.jsx(wr,{size:13,color:o.textDim}),T.jsx("span",{style:{fontSize:12,fontWeight:600,flex:1,textAlign:"left"},children:"Readiness Score"}),f!==null&&T.jsx("span",{style:{fontSize:11,fontFamily:"'Geist Mono', monospace",color:p},children:d}),T.jsx("span",{style:{fontSize:13,fontFamily:"'Geist Mono', monospace",fontWeight:700,color:g,background:`${g}18`,padding:"1px 7px",borderRadius:4},children:e.score})]}),!a&&T.jsxs("div",{style:{padding:"0 10px 8px"},children:[T.jsx("div",{style:{marginBottom:6},children:T.jsx(ji,{value:e.score/100,color:g,height:6})}),T.jsx(ne,{label:"Coverage",pct:e.coverage}),T.jsx(ne,{label:"Test Coupling",pct:e.testCoupling}),T.jsx(ne,{label:"Doc Coupling",pct:e.docCoupling}),T.jsx(ne,{label:"Circular Deps",count:e.circularDeps,warn:!0}),T.jsx(ne,{label:"Hub Risk",pct:e.hubConcentration,invert:!0}),T.jsx(ne,{label:"Orphan Files",count:e.orphanFiles}),T.jsxs("button",{onClick:()=>u(m=>!m),style:{display:"flex",alignItems:"center",gap:4,marginTop:6,padding:"3px 0",background:"transparent",border:"none",cursor:"pointer",color:o.textDim,fontSize:11},children:[l?T.jsx(wr,{size:11}):T.jsx(br,{size:11}),"Details"]}),l&&T.jsxs("div",{style:{marginTop:4,display:"flex",flexDirection:"column",gap:8},children:[e.circularDeps>0&&T.jsx("div",{children:T.jsxs("div",{style:{fontSize:11,color:Ae,marginBottom:2,display:"flex",alignItems:"center",gap:4},children:[T.jsx(Ri,{size:11})," ",e.circularDeps," circular dependency cycle",e.circularDeps>1?"s":""," detected"]})}),y.length>0&&T.jsxs("div",{children:[T.jsx("div",{style:{fontSize:11,color:o.textDim,marginBottom:3},children:"Top hub files (fan-in):"}),y.map(m=>T.jsxs("div",{style:{fontSize:10,fontFamily:"'Geist Mono', monospace",color:o.textSecondary,display:"flex",justifyContent:"space-between",padding:"1px 0"},children:[T.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"80%"},children:m.path}),T.jsx("span",{style:{color:o.textDim},children:m.count})]},m.path))]}),v.length>0&&T.jsxs("div",{children:[T.jsxs("div",{style:{fontSize:11,color:o.textDim,marginBottom:3},children:["Orphan files (",e.orphanFiles,"):"]}),v.map(m=>T.jsx("div",{style:{fontSize:10,fontFamily:"'Geist Mono', monospace",color:o.textSecondary,padding:"1px 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m},m))]})]})]})]})}function la(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function ua(e,n,r){return n=_a(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function kr(e,n){return ha(e)||la(e,n)||Ii(e,n)||ga()}function ca(e){return fa(e)||da(e)||Ii(e)||pa()}function fa(e){if(Array.isArray(e))return Rn(e)}function ha(e){if(Array.isArray(e))return e}function da(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ii(e,n){if(e){if(typeof e=="string")return Rn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rn(e,n)}}function Rn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function pa(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ga(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ya(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function _a(e){var n=ya(e,"string");return typeof n=="symbol"?n:String(n)}var va=function(n,r){var i=new Set(r);return Object.assign.apply(Object,[{}].concat(ca(Object.entries(n).filter(function(o){var a=kr(o,1),s=a[0];return!i.has(s)}).map(function(o){var a=kr(o,2),s=a[0],l=a[1];return ua({},s,l)}))))};function jn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function ma(e){if(Array.isArray(e))return e}function xa(e){if(Array.isArray(e))return jn(e)}function ba(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wa(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function ka(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sa(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
5
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ca(e,n){return ma(e)||wa(e,n)||Ni(e,n)||ka()}function Sr(e){return xa(e)||ba(e)||Ni(e)||Sa()}function Ni(e,n){if(e){if(typeof e=="string")return jn(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jn(e,n):void 0}}function Aa(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.wrapperElementType,i=r===void 0?"div":r,o=n.nodeMapper,a=o===void 0?function(h){return h}:o,s=n.methodNames,l=s===void 0?[]:s,u=n.initPropNames,c=u===void 0?[]:u;return L.forwardRef(function(h,f){var d=L.useRef(),p=L.useMemo(function(){var v=Object.fromEntries(c.filter(function(g){return h.hasOwnProperty(g)}).map(function(g){return[g,h[g]]}));return e(v)},[]);Cr(function(){p(a(d.current))},L.useLayoutEffect),Cr(function(){return p._destructor instanceof Function?p._destructor:void 0});var y=L.useCallback(function(v){for(var g=arguments.length,m=new Array(g>1?g-1:0),S=1;S<g;S++)m[S-1]=arguments[S];return p[v]instanceof Function?p[v].apply(p,m):void 0},[p]),x=L.useRef({});return Object.keys(va(h,[].concat(Sr(l),Sr(c)))).filter(function(v){return x.current[v]!==h[v]}).forEach(function(v){return y(v,h[v])}),x.current=h,L.useImperativeHandle(f,function(){return Object.fromEntries(l.map(function(v){return[v,function(){for(var g=arguments.length,m=new Array(g),S=0;S<g;S++)m[S]=arguments[S];return y.apply(void 0,[v].concat(m))}]}))},[y]),Jo.createElement(i,{ref:d})})}function Cr(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L.useEffect,r=L.useRef(),i=L.useRef(!1),o=L.useRef(!1),a=L.useState(0),s=Ca(a,2);s[0];var l=s[1];i.current&&(o.current=!0),n(function(){return i.current||(r.current=e(),i.current=!0),l(function(u){return u+1}),function(){o.current&&r.current&&r.current()}},[])}var In="http://www.w3.org/1999/xhtml";const Ar={svg:"http://www.w3.org/2000/svg",xhtml:In,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fn(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Ar.hasOwnProperty(n)?{space:Ar[n],local:e}:e}function Ma(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===In&&n.documentElement.namespaceURI===In?n.createElement(e):n.createElementNS(r,e)}}function Ta(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Di(e){var n=fn(e);return(n.local?Ta:Ma)(n)}function Pa(){}function nr(e){return e==null?Pa:function(){return this.querySelector(e)}}function Ea(e){typeof e!="function"&&(e=nr(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c,h=0;h<s;++h)(u=a[h])&&(c=e.call(u,u.__data__,h,a))&&("__data__"in u&&(c.__data__=u.__data__),l[h]=c);return new _t(i,this._parents)}function Oa(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function za(){return[]}function $i(e){return e==null?za:function(){return this.querySelectorAll(e)}}function Ra(e){return function(){return Oa(e.apply(this,arguments))}}function ja(e){typeof e=="function"?e=Ra(e):e=$i(e);for(var n=this._groups,r=n.length,i=[],o=[],a=0;a<r;++a)for(var s=n[a],l=s.length,u,c=0;c<l;++c)(u=s[c])&&(i.push(e.call(u,u.__data__,c,s)),o.push(u));return new _t(i,o)}function Fi(e){return function(){return this.matches(e)}}function Li(e){return function(n){return n.matches(e)}}var Ia=Array.prototype.find;function Na(e){return function(){return Ia.call(this.children,e)}}function Da(){return this.firstElementChild}function $a(e){return this.select(e==null?Da:Na(typeof e=="function"?e:Li(e)))}var Fa=Array.prototype.filter;function La(){return Array.from(this.children)}function Ua(e){return function(){return Fa.call(this.children,e)}}function Ha(e){return this.selectAll(e==null?La:Ua(typeof e=="function"?e:Li(e)))}function qa(e){typeof e!="function"&&(e=Fi(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,l=i[o]=[],u,c=0;c<s;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&l.push(u);return new _t(i,this._parents)}function Ui(e){return new Array(e.length)}function Ga(){return new _t(this._enter||this._groups.map(Ui),this._parents)}function Ke(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Ke.prototype={constructor:Ke,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Wa(e){return function(){return e}}function Ba(e,n,r,i,o,a){for(var s=0,l,u=n.length,c=a.length;s<c;++s)(l=n[s])?(l.__data__=a[s],i[s]=l):r[s]=new Ke(e,a[s]);for(;s<u;++s)(l=n[s])&&(o[s]=l)}function Va(e,n,r,i,o,a,s){var l,u,c=new Map,h=n.length,f=a.length,d=new Array(h),p;for(l=0;l<h;++l)(u=n[l])&&(d[l]=p=s.call(u,u.__data__,l,n)+"",c.has(p)?o[l]=u:c.set(p,u));for(l=0;l<f;++l)p=s.call(e,a[l],l,a)+"",(u=c.get(p))?(i[l]=u,u.__data__=a[l],c.delete(p)):r[l]=new Ke(e,a[l]);for(l=0;l<h;++l)(u=n[l])&&c.get(d[l])===u&&(o[l]=u)}function Xa(e){return e.__data__}function Ya(e,n){if(!arguments.length)return Array.from(this,Xa);var r=n?Va:Ba,i=this._parents,o=this._groups;typeof e!="function"&&(e=Wa(e));for(var a=o.length,s=new Array(a),l=new Array(a),u=new Array(a),c=0;c<a;++c){var h=i[c],f=o[c],d=f.length,p=Ka(e.call(h,h&&h.__data__,c,i)),y=p.length,x=l[c]=new Array(y),v=s[c]=new Array(y),g=u[c]=new Array(d);r(h,f,x,v,g,p,n);for(var m=0,S=0,b,_;m<y;++m)if(b=x[m]){for(m>=S&&(S=m+1);!(_=v[S])&&++S<y;);b._next=_||null}}return s=new _t(s,i),s._enter=l,s._exit=u,s}function Ka(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Za(){return new _t(this._exit||this._groups.map(Ui),this._parents)}function Qa(e,n,r){var i=this.enter(),o=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),r==null?a.remove():r(a),i&&o?i.merge(o).order():o}function Ja(e){for(var n=e.selection?e.selection():e,r=this._groups,i=n._groups,o=r.length,a=i.length,s=Math.min(o,a),l=new Array(o),u=0;u<s;++u)for(var c=r[u],h=i[u],f=c.length,d=l[u]=new Array(f),p,y=0;y<f;++y)(p=c[y]||h[y])&&(d[y]=p);for(;u<o;++u)l[u]=r[u];return new _t(l,this._parents)}function ts(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var i=e[n],o=i.length-1,a=i[o],s;--o>=0;)(s=i[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function es(e){e||(e=ns);function n(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a){for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,h=0;h<l;++h)(c=s[h])&&(u[h]=c);u.sort(n)}return new _t(o,this._parents).order()}function ns(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function rs(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function is(){return Array.from(this)}function os(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length;o<a;++o){var s=i[o];if(s)return s}return null}function as(){let e=0;for(const n of this)++e;return e}function ss(){return!this.node()}function ls(e){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length,l;a<s;++a)(l=o[a])&&e.call(l,l.__data__,a,o);return this}function us(e){return function(){this.removeAttribute(e)}}function cs(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fs(e,n){return function(){this.setAttribute(e,n)}}function hs(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function ds(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function ps(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function gs(e,n){var r=fn(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((n==null?r.local?cs:us:typeof n=="function"?r.local?ps:ds:r.local?hs:fs)(r,n))}function Hi(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ys(e){return function(){this.style.removeProperty(e)}}function _s(e,n,r){return function(){this.style.setProperty(e,n,r)}}function vs(e,n,r){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function ms(e,n,r){return arguments.length>1?this.each((n==null?ys:typeof n=="function"?vs:_s)(e,n,r??"")):se(this.node(),e)}function se(e,n){return e.style.getPropertyValue(n)||Hi(e).getComputedStyle(e,null).getPropertyValue(n)}function xs(e){return function(){delete this[e]}}function bs(e,n){return function(){this[e]=n}}function ws(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function ks(e,n){return arguments.length>1?this.each((n==null?xs:typeof n=="function"?ws:bs)(e,n)):this.node()[e]}function qi(e){return e.trim().split(/^|\s+/)}function rr(e){return e.classList||new Gi(e)}function Gi(e){this._node=e,this._names=qi(e.getAttribute("class")||"")}Gi.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Wi(e,n){for(var r=rr(e),i=-1,o=n.length;++i<o;)r.add(n[i])}function Bi(e,n){for(var r=rr(e),i=-1,o=n.length;++i<o;)r.remove(n[i])}function Ss(e){return function(){Wi(this,e)}}function Cs(e){return function(){Bi(this,e)}}function As(e,n){return function(){(n.apply(this,arguments)?Wi:Bi)(this,e)}}function Ms(e,n){var r=qi(e+"");if(arguments.length<2){for(var i=rr(this.node()),o=-1,a=r.length;++o<a;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof n=="function"?As:n?Ss:Cs)(r,n))}function Ts(){this.textContent=""}function Ps(e){return function(){this.textContent=e}}function Es(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function Os(e){return arguments.length?this.each(e==null?Ts:(typeof e=="function"?Es:Ps)(e)):this.node().textContent}function zs(){this.innerHTML=""}function Rs(e){return function(){this.innerHTML=e}}function js(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function Is(e){return arguments.length?this.each(e==null?zs:(typeof e=="function"?js:Rs)(e)):this.node().innerHTML}function Ns(){this.nextSibling&&this.parentNode.appendChild(this)}function Ds(){return this.each(Ns)}function $s(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Fs(){return this.each($s)}function Ls(e){var n=typeof e=="function"?e:Di(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function Us(){return null}function Hs(e,n){var r=typeof e=="function"?e:Di(e),i=n==null?Us:typeof n=="function"?n:nr(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function qs(){var e=this.parentNode;e&&e.removeChild(this)}function Gs(){return this.each(qs)}function Ws(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function Bs(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function Vs(e){return this.select(e?Bs:Ws)}function Xs(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ys(e){return function(n){e.call(this,n,this.__data__)}}function Ks(e){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");return i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),{type:n,name:r}})}function Zs(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,o=n.length,a;r<o;++r)a=n[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):n[++i]=a;++i?n.length=i:delete this.__on}}}function Qs(e,n,r){return function(){var i=this.__on,o,a=Ys(n);if(i){for(var s=0,l=i.length;s<l;++s)if((o=i[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=n;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:n,listener:a,options:r},i?i.push(o):this.__on=[o]}}function Js(e,n,r){var i=Ks(e+""),o,a=i.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,h;u<c;++u)for(o=0,h=l[u];o<a;++o)if((s=i[o]).type===h.type&&s.name===h.name)return h.value}return}for(l=n?Qs:Zs,o=0;o<a;++o)this.each(l(i[o],n,r));return this}function Vi(e,n,r){var i=Hi(e),o=i.CustomEvent;typeof o=="function"?o=new o(n,r):(o=i.document.createEvent("Event"),r?(o.initEvent(n,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function tl(e,n){return function(){return Vi(this,e,n)}}function el(e,n){return function(){return Vi(this,e,n.apply(this,arguments))}}function nl(e,n){return this.each((typeof n=="function"?el:tl)(e,n))}function*rl(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&(yield s)}var Xi=[null];function _t(e,n){this._groups=e,this._parents=n}function Re(){return new _t([[document.documentElement]],Xi)}function il(){return this}_t.prototype=Re.prototype={constructor:_t,select:Ea,selectAll:ja,selectChild:$a,selectChildren:Ha,filter:qa,data:Ya,enter:Ga,exit:Za,join:Qa,merge:Ja,selection:il,order:ts,sort:es,call:rs,nodes:is,node:os,size:as,empty:ss,each:ls,attr:gs,style:ms,property:ks,classed:Ms,text:Os,html:Is,raise:Ds,lower:Fs,append:Ls,insert:Hs,remove:Gs,clone:Vs,datum:Xs,on:Js,dispatch:nl,[Symbol.iterator]:rl};function wt(e){return typeof e=="string"?new _t([[document.querySelector(e)]],[document.documentElement]):new _t([[e]],Xi)}function ol(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Et(e,n){if(e=ol(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}var al={value:()=>{}};function je(){for(var e=0,n=arguments.length,r={},i;e<n;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new We(r)}function We(e){this._=e}function sl(e,n){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}We.prototype=je.prototype={constructor:We,on:function(e,n){var r=this._,i=sl(e+"",r),o,a=-1,s=i.length;if(arguments.length<2){for(;++a<s;)if((o=(e=i[a]).type)&&(o=ll(r[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++a<s;)if(o=(e=i[a]).type)r[o]=Mr(r[o],e.name,n);else if(n==null)for(o in r)r[o]=Mr(r[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new We(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,a;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,o=a.length;i<o;++i)a[i].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,a=i.length;o<a;++o)i[o].value.apply(n,r)}};function ll(e,n){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===n)return o.value}function Mr(e,n,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===n){e[i]=al,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:n,value:r}),e}const ul={passive:!1},Me={capture:!0,passive:!1};function vn(e){e.stopImmediatePropagation()}function oe(e){e.preventDefault(),e.stopImmediatePropagation()}function Yi(e){var n=e.document.documentElement,r=wt(e).on("dragstart.drag",oe,Me);"onselectstart"in n?r.on("selectstart.drag",oe,Me):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Ki(e,n){var r=e.document.documentElement,i=wt(e).on("dragstart.drag",null);n&&(i.on("click.drag",oe,Me),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const De=e=>()=>e;function Nn(e,{sourceEvent:n,subject:r,target:i,identifier:o,active:a,x:s,y:l,dx:u,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}Nn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function cl(e){return!e.ctrlKey&&!e.button}function fl(){return this.parentNode}function hl(e,n){return n??{x:e.x,y:e.y}}function dl(){return navigator.maxTouchPoints||"ontouchstart"in this}function pl(){var e=cl,n=fl,r=hl,i=dl,o={},a=je("start","drag","end"),s=0,l,u,c,h,f=0;function d(b){b.on("mousedown.drag",p).filter(i).on("touchstart.drag",v).on("touchmove.drag",g,ul).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(b,_){if(!(h||!e.call(this,b,_))){var C=S(this,n.call(this,b,_),b,_,"mouse");C&&(wt(b.view).on("mousemove.drag",y,Me).on("mouseup.drag",x,Me),Yi(b.view),vn(b),c=!1,l=b.clientX,u=b.clientY,C("start",b))}}function y(b){if(oe(b),!c){var _=b.clientX-l,C=b.clientY-u;c=_*_+C*C>f}o.mouse("drag",b)}function x(b){wt(b.view).on("mousemove.drag mouseup.drag",null),Ki(b.view,c),oe(b),o.mouse("end",b)}function v(b,_){if(e.call(this,b,_)){var C=b.changedTouches,k=n.call(this,b,_),M=C.length,R,O;for(R=0;R<M;++R)(O=S(this,k,b,_,C[R].identifier,C[R]))&&(vn(b),O("start",b,C[R]))}}function g(b){var _=b.changedTouches,C=_.length,k,M;for(k=0;k<C;++k)(M=o[_[k].identifier])&&(oe(b),M("drag",b,_[k]))}function m(b){var _=b.changedTouches,C=_.length,k,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),k=0;k<C;++k)(M=o[_[k].identifier])&&(vn(b),M("end",b,_[k]))}function S(b,_,C,k,M,R){var O=a.copy(),I=Et(R||C,_),N,H,A;if((A=r.call(b,new Nn("beforestart",{sourceEvent:C,target:d,identifier:M,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:O}),k))!=null)return N=A.x-I[0]||0,H=A.y-I[1]||0,function j(P,D,q){var B=I,G;switch(P){case"start":o[M]=j,G=s++;break;case"end":delete o[M],--s;case"drag":I=Et(q||D,_),G=s;break}O.call(P,b,new Nn(P,{sourceEvent:D,subject:A,target:d,identifier:M,active:G,x:I[0]+N,y:I[1]+H,dx:I[0]-B[0],dy:I[1]-B[1],dispatch:O}),k)}}return d.filter=function(b){return arguments.length?(e=typeof b=="function"?b:De(!!b),d):e},d.container=function(b){return arguments.length?(n=typeof b=="function"?b:De(b),d):n},d.subject=function(b){return arguments.length?(r=typeof b=="function"?b:De(b),d):r},d.touchable=function(b){return arguments.length?(i=typeof b=="function"?b:De(!!b),d):i},d.on=function(){var b=a.on.apply(a,arguments);return b===a?d:b},d.clickDistance=function(b){return arguments.length?(f=(b=+b)*b,d):Math.sqrt(f)},d}function ir(e,n,r){e.prototype=n.prototype=r,r.constructor=e}function Zi(e,n){var r=Object.create(e.prototype);for(var i in n)r[i]=n[i];return r}function Ie(){}var Te=.7,Ze=1/Te,ae="\\s*([+-]?\\d+)\\s*",Pe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gl=/^#([0-9a-f]{3,8})$/,yl=new RegExp(`^rgb\\(${ae},${ae},${ae}\\)$`),_l=new RegExp(`^rgb\\(${zt},${zt},${zt}\\)$`),vl=new RegExp(`^rgba\\(${ae},${ae},${ae},${Pe}\\)$`),ml=new RegExp(`^rgba\\(${zt},${zt},${zt},${Pe}\\)$`),xl=new RegExp(`^hsl\\(${Pe},${zt},${zt}\\)$`),bl=new RegExp(`^hsla\\(${Pe},${zt},${zt},${Pe}\\)$`),Tr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ir(Ie,Ee,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Pr,formatHex:Pr,formatHex8:wl,formatHsl:kl,formatRgb:Er,toString:Er});function Pr(){return this.rgb().formatHex()}function wl(){return this.rgb().formatHex8()}function kl(){return Qi(this).formatHsl()}function Er(){return this.rgb().formatRgb()}function Ee(e){var n,r;return e=(e+"").trim().toLowerCase(),(n=gl.exec(e))?(r=n[1].length,n=parseInt(n[1],16),r===6?Or(n):r===3?new dt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):r===8?$e(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):r===4?$e(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=yl.exec(e))?new dt(n[1],n[2],n[3],1):(n=_l.exec(e))?new dt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=vl.exec(e))?$e(n[1],n[2],n[3],n[4]):(n=ml.exec(e))?$e(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=xl.exec(e))?jr(n[1],n[2]/100,n[3]/100,1):(n=bl.exec(e))?jr(n[1],n[2]/100,n[3]/100,n[4]):Tr.hasOwnProperty(e)?Or(Tr[e]):e==="transparent"?new dt(NaN,NaN,NaN,0):null}function Or(e){return new dt(e>>16&255,e>>8&255,e&255,1)}function $e(e,n,r,i){return i<=0&&(e=n=r=NaN),new dt(e,n,r,i)}function Sl(e){return e instanceof Ie||(e=Ee(e)),e?(e=e.rgb(),new dt(e.r,e.g,e.b,e.opacity)):new dt}function Dn(e,n,r,i){return arguments.length===1?Sl(e):new dt(e,n,r,i??1)}function dt(e,n,r,i){this.r=+e,this.g=+n,this.b=+r,this.opacity=+i}ir(dt,Dn,Zi(Ie,{brighter(e){return e=e==null?Ze:Math.pow(Ze,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Te:Math.pow(Te,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dt(Qt(this.r),Qt(this.g),Qt(this.b),Qe(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zr,formatHex:zr,formatHex8:Cl,formatRgb:Rr,toString:Rr}));function zr(){return`#${Zt(this.r)}${Zt(this.g)}${Zt(this.b)}`}function Cl(){return`#${Zt(this.r)}${Zt(this.g)}${Zt(this.b)}${Zt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rr(){const e=Qe(this.opacity);return`${e===1?"rgb(":"rgba("}${Qt(this.r)}, ${Qt(this.g)}, ${Qt(this.b)}${e===1?")":`, ${e})`}`}function Qe(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Zt(e){return e=Qt(e),(e<16?"0":"")+e.toString(16)}function jr(e,n,r,i){return i<=0?e=n=r=NaN:r<=0||r>=1?e=n=NaN:n<=0&&(e=NaN),new At(e,n,r,i)}function Qi(e){if(e instanceof At)return new At(e.h,e.s,e.l,e.opacity);if(e instanceof Ie||(e=Ee(e)),!e)return new At;if(e instanceof At)return e;e=e.rgb();var n=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(n,r,i),a=Math.max(n,r,i),s=NaN,l=a-o,u=(a+o)/2;return l?(n===a?s=(r-i)/l+(r<i)*6:r===a?s=(i-n)/l+2:s=(n-r)/l+4,l/=u<.5?a+o:2-a-o,s*=60):l=u>0&&u<1?0:s,new At(s,l,u,e.opacity)}function Al(e,n,r,i){return arguments.length===1?Qi(e):new At(e,n,r,i??1)}function At(e,n,r,i){this.h=+e,this.s=+n,this.l=+r,this.opacity=+i}ir(At,Al,Zi(Ie,{brighter(e){return e=e==null?Ze:Math.pow(Ze,e),new At(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Te:Math.pow(Te,e),new At(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*n,o=2*r-i;return new dt(mn(e>=240?e-240:e+120,o,i),mn(e,o,i),mn(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new At(Ir(this.h),Fe(this.s),Fe(this.l),Qe(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Qe(this.opacity);return`${e===1?"hsl(":"hsla("}${Ir(this.h)}, ${Fe(this.s)*100}%, ${Fe(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ir(e){return e=(e||0)%360,e<0?e+360:e}function Fe(e){return Math.max(0,Math.min(1,e||0))}function mn(e,n,r){return(e<60?n+(r-n)*e/60:e<180?r:e<240?n+(r-n)*(240-e)/60:n)*255}const Ji=e=>()=>e;function Ml(e,n){return function(r){return e+r*n}}function Tl(e,n,r){return e=Math.pow(e,r),n=Math.pow(n,r)-e,r=1/r,function(i){return Math.pow(e+i*n,r)}}function Pl(e){return(e=+e)==1?to:function(n,r){return r-n?Tl(n,r,e):Ji(isNaN(n)?r:n)}}function to(e,n){var r=n-e;return r?Ml(e,r):Ji(isNaN(e)?n:e)}const Nr=(function e(n){var r=Pl(n);function i(o,a){var s=r((o=Dn(o)).r,(a=Dn(a)).r),l=r(o.g,a.g),u=r(o.b,a.b),c=to(o.opacity,a.opacity);return function(h){return o.r=s(h),o.g=l(h),o.b=u(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function Bt(e,n){return e=+e,n=+n,function(r){return e*(1-r)+n*r}}var $n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xn=new RegExp($n.source,"g");function El(e){return function(){return e}}function Ol(e){return function(n){return e(n)+""}}function zl(e,n){var r=$n.lastIndex=xn.lastIndex=0,i,o,a,s=-1,l=[],u=[];for(e=e+"",n=n+"";(i=$n.exec(e))&&(o=xn.exec(n));)(a=o.index)>r&&(a=n.slice(r,a),l[s]?l[s]+=a:l[++s]=a),(i=i[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,u.push({i:s,x:Bt(i,o)})),r=xn.lastIndex;return r<n.length&&(a=n.slice(r),l[s]?l[s]+=a:l[++s]=a),l.length<2?u[0]?Ol(u[0].x):El(n):(n=u.length,function(c){for(var h=0,f;h<n;++h)l[(f=u[h]).i]=f.x(c);return l.join("")})}var Dr=180/Math.PI,Fn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function eo(e,n,r,i,o,a){var s,l,u;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(u=e*r+n*i)&&(r-=e*u,i-=n*u),(l=Math.sqrt(r*r+i*i))&&(r/=l,i/=l,u/=l),e*i<n*r&&(e=-e,n=-n,u=-u,s=-s),{translateX:o,translateY:a,rotate:Math.atan2(n,e)*Dr,skewX:Math.atan(u)*Dr,scaleX:s,scaleY:l}}var Le;function Rl(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Fn:eo(n.a,n.b,n.c,n.d,n.e,n.f)}function jl(e){return e==null||(Le||(Le=document.createElementNS("http://www.w3.org/2000/svg","g")),Le.setAttribute("transform",e),!(e=Le.transform.baseVal.consolidate()))?Fn:(e=e.matrix,eo(e.a,e.b,e.c,e.d,e.e,e.f))}function no(e,n,r,i){function o(c){return c.length?c.pop()+" ":""}function a(c,h,f,d,p,y){if(c!==f||h!==d){var x=p.push("translate(",null,n,null,r);y.push({i:x-4,x:Bt(c,f)},{i:x-2,x:Bt(h,d)})}else(f||d)&&p.push("translate("+f+n+d+r)}function s(c,h,f,d){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),d.push({i:f.push(o(f)+"rotate(",null,i)-2,x:Bt(c,h)})):h&&f.push(o(f)+"rotate("+h+i)}function l(c,h,f,d){c!==h?d.push({i:f.push(o(f)+"skewX(",null,i)-2,x:Bt(c,h)}):h&&f.push(o(f)+"skewX("+h+i)}function u(c,h,f,d,p,y){if(c!==f||h!==d){var x=p.push(o(p)+"scale(",null,",",null,")");y.push({i:x-4,x:Bt(c,f)},{i:x-2,x:Bt(h,d)})}else(f!==1||d!==1)&&p.push(o(p)+"scale("+f+","+d+")")}return function(c,h){var f=[],d=[];return c=e(c),h=e(h),a(c.translateX,c.translateY,h.translateX,h.translateY,f,d),s(c.rotate,h.rotate,f,d),l(c.skewX,h.skewX,f,d),u(c.scaleX,c.scaleY,h.scaleX,h.scaleY,f,d),c=h=null,function(p){for(var y=-1,x=d.length,v;++y<x;)f[(v=d[y]).i]=v.x(p);return f.join("")}}}var Il=no(Rl,"px, ","px)","deg)"),Nl=no(jl,", ",")",")"),Dl=1e-12;function $r(e){return((e=Math.exp(e))+1/e)/2}function $l(e){return((e=Math.exp(e))-1/e)/2}function Fl(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ll=(function e(n,r,i){function o(a,s){var l=a[0],u=a[1],c=a[2],h=s[0],f=s[1],d=s[2],p=h-l,y=f-u,x=p*p+y*y,v,g;if(x<Dl)g=Math.log(d/c)/n,v=function(k){return[l+k*p,u+k*y,c*Math.exp(n*k*g)]};else{var m=Math.sqrt(x),S=(d*d-c*c+i*x)/(2*c*r*m),b=(d*d-c*c-i*x)/(2*d*r*m),_=Math.log(Math.sqrt(S*S+1)-S),C=Math.log(Math.sqrt(b*b+1)-b);g=(C-_)/n,v=function(k){var M=k*g,R=$r(_),O=c/(r*m)*(R*Fl(n*M+_)-$l(_));return[l+O*p,u+O*y,c*R/$r(n*M+_)]}}return v.duration=g*1e3*n/Math.SQRT2,v}return o.rho=function(a){var s=Math.max(.001,+a),l=s*s,u=l*l;return e(s,l,u)},o})(Math.SQRT2,2,4);var le=0,me=0,fe=0,ro=1e3,Je,xe,tn=0,te=0,hn=0,Oe=typeof performance=="object"&&performance.now?performance:Date,io=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function or(){return te||(io(Ul),te=Oe.now()+hn)}function Ul(){te=0}function en(){this._call=this._time=this._next=null}en.prototype=ar.prototype={constructor:en,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?or():+r)+(n==null?0:+n),!this._next&&xe!==this&&(xe?xe._next=this:Je=this,xe=this),this._call=e,this._time=r,Ln()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ln())}};function ar(e,n,r){var i=new en;return i.restart(e,n,r),i}function Hl(){or(),++le;for(var e=Je,n;e;)(n=te-e._time)>=0&&e._call.call(void 0,n),e=e._next;--le}function Fr(){te=(tn=Oe.now())+hn,le=me=0;try{Hl()}finally{le=0,Gl(),te=0}}function ql(){var e=Oe.now(),n=e-tn;n>ro&&(hn-=n,tn=e)}function Gl(){for(var e,n=Je,r,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:Je=r);xe=e,Ln(i)}function Ln(e){if(!le){me&&(me=clearTimeout(me));var n=e-te;n>24?(e<1/0&&(me=setTimeout(Fr,e-Oe.now()-hn)),fe&&(fe=clearInterval(fe))):(fe||(tn=Oe.now(),fe=setInterval(ql,ro)),le=1,io(Fr))}}function Lr(e,n,r){var i=new en;return n=n==null?0:+n,i.restart(o=>{i.stop(),e(o+n)},n,r),i}var Wl=je("start","end","cancel","interrupt"),Bl=[],oo=0,Ur=1,Un=2,Be=3,Hr=4,Hn=5,Ve=6;function dn(e,n,r,i,o,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Vl(e,r,{name:n,index:i,group:o,on:Wl,tween:Bl,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:oo})}function sr(e,n){var r=Tt(e,n);if(r.state>oo)throw new Error("too late; already scheduled");return r}function jt(e,n){var r=Tt(e,n);if(r.state>Be)throw new Error("too late; already running");return r}function Tt(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function Vl(e,n,r){var i=e.__transition,o;i[n]=r,r.timer=ar(a,0,r.time);function a(c){r.state=Ur,r.timer.restart(s,r.delay,r.time),r.delay<=c&&s(c-r.delay)}function s(c){var h,f,d,p;if(r.state!==Ur)return u();for(h in i)if(p=i[h],p.name===r.name){if(p.state===Be)return Lr(s);p.state===Hr?(p.state=Ve,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[h]):+h<n&&(p.state=Ve,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[h])}if(Lr(function(){r.state===Be&&(r.state=Hr,r.timer.restart(l,r.delay,r.time),l(c))}),r.state=Un,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Un){for(r.state=Be,o=new Array(d=r.tween.length),h=0,f=-1;h<d;++h)(p=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++f]=p);o.length=f+1}}function l(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(u),r.state=Hn,1),f=-1,d=o.length;++f<d;)o[f].call(e,h);r.state===Hn&&(r.on.call("end",e,e.__data__,r.index,r.group),u())}function u(){r.state=Ve,r.timer.stop(),delete i[n];for(var c in i)return;delete e.__transition}}function Xe(e,n){var r=e.__transition,i,o,a=!0,s;if(r){n=n==null?null:n+"";for(s in r){if((i=r[s]).name!==n){a=!1;continue}o=i.state>Un&&i.state<Hn,i.state=Ve,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[s]}a&&delete e.__transition}}function Xl(e){return this.each(function(){Xe(this,e)})}function Yl(e,n){var r,i;return function(){var o=jt(this,e),a=o.tween;if(a!==r){i=r=a;for(var s=0,l=i.length;s<l;++s)if(i[s].name===n){i=i.slice(),i.splice(s,1);break}}o.tween=i}}function Kl(e,n,r){var i,o;if(typeof r!="function")throw new Error;return function(){var a=jt(this,e),s=a.tween;if(s!==i){o=(i=s).slice();for(var l={name:n,value:r},u=0,c=o.length;u<c;++u)if(o[u].name===n){o[u]=l;break}u===c&&o.push(l)}a.tween=o}}function Zl(e,n){var r=this._id;if(e+="",arguments.length<2){for(var i=Tt(this.node(),r).tween,o=0,a=i.length,s;o<a;++o)if((s=i[o]).name===e)return s.value;return null}return this.each((n==null?Yl:Kl)(r,e,n))}function lr(e,n,r){var i=e._id;return e.each(function(){var o=jt(this,i);(o.value||(o.value={}))[n]=r.apply(this,arguments)}),function(o){return Tt(o,i).value[n]}}function ao(e,n){var r;return(typeof n=="number"?Bt:n instanceof Ee?Nr:(r=Ee(n))?(n=r,Nr):zl)(e,n)}function Ql(e){return function(){this.removeAttribute(e)}}function Jl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tu(e,n,r){var i,o=r+"",a;return function(){var s=this.getAttribute(e);return s===o?null:s===i?a:a=n(i=s,r)}}function eu(e,n,r){var i,o=r+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===i?a:a=n(i=s,r)}}function nu(e,n,r){var i,o,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=l+"",s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l)))}}function ru(e,n,r){var i,o,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=l+"",s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l)))}}function iu(e,n){var r=fn(e),i=r==="transform"?Nl:ao;return this.attrTween(e,typeof n=="function"?(r.local?ru:nu)(r,i,lr(this,"attr."+e,n)):n==null?(r.local?Jl:Ql)(r):(r.local?eu:tu)(r,i,n))}function ou(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function au(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function su(e,n){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&au(e,a)),r}return o._value=n,o}function lu(e,n){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&ou(e,a)),r}return o._value=n,o}function uu(e,n){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;var i=fn(e);return this.tween(r,(i.local?su:lu)(i,n))}function cu(e,n){return function(){sr(this,e).delay=+n.apply(this,arguments)}}function fu(e,n){return n=+n,function(){sr(this,e).delay=n}}function hu(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?cu:fu)(n,e)):Tt(this.node(),n).delay}function du(e,n){return function(){jt(this,e).duration=+n.apply(this,arguments)}}function pu(e,n){return n=+n,function(){jt(this,e).duration=n}}function gu(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?du:pu)(n,e)):Tt(this.node(),n).duration}function yu(e,n){if(typeof n!="function")throw new Error;return function(){jt(this,e).ease=n}}function _u(e){var n=this._id;return arguments.length?this.each(yu(n,e)):Tt(this.node(),n).ease}function vu(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;jt(this,e).ease=r}}function mu(e){if(typeof e!="function")throw new Error;return this.each(vu(this._id,e))}function xu(e){typeof e!="function"&&(e=Fi(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,l=i[o]=[],u,c=0;c<s;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&l.push(u);return new qt(i,this._parents,this._name,this._id)}function bu(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],h=u.length,f=s[l]=new Array(h),d,p=0;p<h;++p)(d=u[p]||c[p])&&(f[p]=d);for(;l<i;++l)s[l]=n[l];return new qt(s,this._parents,this._name,this._id)}function wu(e){return(e+"").trim().split(/^|\s+/).every(function(n){var r=n.indexOf(".");return r>=0&&(n=n.slice(0,r)),!n||n==="start"})}function ku(e,n,r){var i,o,a=wu(n)?sr:jt;return function(){var s=a(this,e),l=s.on;l!==i&&(o=(i=l).copy()).on(n,r),s.on=o}}function Su(e,n){var r=this._id;return arguments.length<2?Tt(this.node(),r).on.on(e):this.each(ku(r,e,n))}function Cu(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function Au(){return this.on("end.remove",Cu(this._id))}function Mu(e){var n=this._name,r=this._id;typeof e!="function"&&(e=nr(e));for(var i=this._groups,o=i.length,a=new Array(o),s=0;s<o;++s)for(var l=i[s],u=l.length,c=a[s]=new Array(u),h,f,d=0;d<u;++d)(h=l[d])&&(f=e.call(h,h.__data__,d,l))&&("__data__"in h&&(f.__data__=h.__data__),c[d]=f,dn(c[d],n,r,d,c,Tt(h,r)));return new qt(a,this._parents,n,r)}function Tu(e){var n=this._name,r=this._id;typeof e!="function"&&(e=$i(e));for(var i=this._groups,o=i.length,a=[],s=[],l=0;l<o;++l)for(var u=i[l],c=u.length,h,f=0;f<c;++f)if(h=u[f]){for(var d=e.call(h,h.__data__,f,u),p,y=Tt(h,r),x=0,v=d.length;x<v;++x)(p=d[x])&&dn(p,n,r,x,d,y);a.push(d),s.push(h)}return new qt(a,s,n,r)}var Pu=Re.prototype.constructor;function Eu(){return new Pu(this._groups,this._parents)}function Ou(e,n){var r,i,o;return function(){var a=se(this,e),s=(this.style.removeProperty(e),se(this,e));return a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function so(e){return function(){this.style.removeProperty(e)}}function zu(e,n,r){var i,o=r+"",a;return function(){var s=se(this,e);return s===o?null:s===i?a:a=n(i=s,r)}}function Ru(e,n,r){var i,o,a;return function(){var s=se(this,e),l=r(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),se(this,e))),s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l))}}function ju(e,n){var r,i,o,a="style."+n,s="end."+a,l;return function(){var u=jt(this,e),c=u.on,h=u.value[a]==null?l||(l=so(n)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(s,o=h),u.on=i}}function Iu(e,n,r){var i=(e+="")=="transform"?Il:ao;return n==null?this.styleTween(e,Ou(e,i)).on("end.style."+e,so(e)):typeof n=="function"?this.styleTween(e,Ru(e,i,lr(this,"style."+e,n))).each(ju(this._id,e)):this.styleTween(e,zu(e,i,n),r).on("end.style."+e,null)}function Nu(e,n,r){return function(i){this.style.setProperty(e,n.call(this,i),r)}}function Du(e,n,r){var i,o;function a(){var s=n.apply(this,arguments);return s!==o&&(i=(o=s)&&Nu(e,s,r)),i}return a._value=n,a}function $u(e,n,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,Du(e,n,r??""))}function Fu(e){return function(){this.textContent=e}}function Lu(e){return function(){var n=e(this);this.textContent=n??""}}function Uu(e){return this.tween("text",typeof e=="function"?Lu(lr(this,"text",e)):Fu(e==null?"":e+""))}function Hu(e){return function(n){this.textContent=e.call(this,n)}}function qu(e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Hu(o)),n}return i._value=e,i}function Gu(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,qu(e))}function Wu(){for(var e=this._name,n=this._id,r=lo(),i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],l=s.length,u,c=0;c<l;++c)if(u=s[c]){var h=Tt(u,n);dn(u,e,r,c,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new qt(i,this._parents,e,r)}function Bu(){var e,n,r=this,i=r._id,o=r.size();return new Promise(function(a,s){var l={value:s},u={value:function(){--o===0&&a()}};r.each(function(){var c=jt(this,i),h=c.on;h!==e&&(n=(e=h).copy(),n._.cancel.push(l),n._.interrupt.push(l),n._.end.push(u)),c.on=n}),o===0&&a()})}var Vu=0;function qt(e,n,r,i){this._groups=e,this._parents=n,this._name=r,this._id=i}function lo(){return++Vu}var It=Re.prototype;qt.prototype={constructor:qt,select:Mu,selectAll:Tu,selectChild:It.selectChild,selectChildren:It.selectChildren,filter:xu,merge:bu,selection:Eu,transition:Wu,call:It.call,nodes:It.nodes,node:It.node,size:It.size,empty:It.empty,each:It.each,on:Su,attr:iu,attrTween:uu,style:Iu,styleTween:$u,text:Uu,textTween:Gu,remove:Au,tween:Zl,delay:hu,duration:gu,ease:_u,easeVarying:mu,end:Bu,[Symbol.iterator]:It[Symbol.iterator]};function Xu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Yu={time:null,delay:0,duration:250,ease:Xu};function Ku(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return r}function Zu(e){var n,r;e instanceof qt?(n=e._id,e=e._name):(n=lo(),(r=Yu).time=or(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],l=s.length,u,c=0;c<l;++c)(u=s[c])&&dn(u,e,n,c,s,r||Ku(u,n));return new qt(i,this._parents,e,n)}Re.prototype.interrupt=Xl;Re.prototype.transition=Zu;const Ue=e=>()=>e;function Qu(e,{sourceEvent:n,target:r,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Lt(e,n,r){this.k=e,this.x=n,this.y=r}Lt.prototype={constructor:Lt,scale:function(e){return e===1?this:new Lt(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Lt(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ur=new Lt(1,0,0);Pt.prototype=Lt.prototype;function Pt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ur;return e.__zoom}function bn(e){e.stopImmediatePropagation()}function he(e){e.preventDefault(),e.stopImmediatePropagation()}function Ju(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tc(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function qr(){return this.__zoom||ur}function ec(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nc(){return navigator.maxTouchPoints||"ontouchstart"in this}function rc(e,n,r){var i=e.invertX(n[0][0])-r[0][0],o=e.invertX(n[1][0])-r[1][0],a=e.invertY(n[0][1])-r[0][1],s=e.invertY(n[1][1])-r[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function ic(){var e=Ju,n=tc,r=rc,i=ec,o=nc,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=Ll,c=je("start","zoom","end"),h,f,d,p=500,y=150,x=0,v=10;function g(A){A.property("__zoom",qr).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",O).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(A,j,P,D){var q=A.selection?A.selection():A;q.property("__zoom",qr),A!==q?_(A,j,P,D):q.interrupt().each(function(){C(this,arguments).event(D).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(A,j,P,D){g.scaleTo(A,function(){var q=this.__zoom.k,B=typeof j=="function"?j.apply(this,arguments):j;return q*B},P,D)},g.scaleTo=function(A,j,P,D){g.transform(A,function(){var q=n.apply(this,arguments),B=this.__zoom,G=P==null?b(q):typeof P=="function"?P.apply(this,arguments):P,Y=B.invert(G),W=typeof j=="function"?j.apply(this,arguments):j;return r(S(m(B,W),G,Y),q,s)},P,D)},g.translateBy=function(A,j,P,D){g.transform(A,function(){return r(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof P=="function"?P.apply(this,arguments):P),n.apply(this,arguments),s)},null,D)},g.translateTo=function(A,j,P,D,q){g.transform(A,function(){var B=n.apply(this,arguments),G=this.__zoom,Y=D==null?b(B):typeof D=="function"?D.apply(this,arguments):D;return r(ur.translate(Y[0],Y[1]).scale(G.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof P=="function"?-P.apply(this,arguments):-P),B,s)},D,q)};function m(A,j){return j=Math.max(a[0],Math.min(a[1],j)),j===A.k?A:new Lt(j,A.x,A.y)}function S(A,j,P){var D=j[0]-P[0]*A.k,q=j[1]-P[1]*A.k;return D===A.x&&q===A.y?A:new Lt(A.k,D,q)}function b(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function _(A,j,P,D){A.on("start.zoom",function(){C(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(D).end()}).tween("zoom",function(){var q=this,B=arguments,G=C(q,B).event(D),Y=n.apply(q,B),W=P==null?b(Y):typeof P=="function"?P.apply(q,B):P,et=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),J=q.__zoom,ut=typeof j=="function"?j.apply(q,B):j,vt=u(J.invert(W).concat(et/J.k),ut.invert(W).concat(et/ut.k));return function(gt){if(gt===1)gt=ut;else{var St=vt(gt),ce=et/St[2];gt=new Lt(ce,W[0]-St[0]*ce,W[1]-St[1]*ce)}G.zoom(null,gt)}})}function C(A,j,P){return!P&&A.__zooming||new k(A,j)}function k(A,j){this.that=A,this.args=j,this.active=0,this.sourceEvent=null,this.extent=n.apply(A,j),this.taps=0}k.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,j){return this.mouse&&A!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var j=wt(this.that).datum();c.call(A,this.that,new Qu(A,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),j)}};function M(A,...j){if(!e.apply(this,arguments))return;var P=C(this,j).event(A),D=this.__zoom,q=Math.max(a[0],Math.min(a[1],D.k*Math.pow(2,i.apply(this,arguments)))),B=Et(A);if(P.wheel)(P.mouse[0][0]!==B[0]||P.mouse[0][1]!==B[1])&&(P.mouse[1]=D.invert(P.mouse[0]=B)),clearTimeout(P.wheel);else{if(D.k===q)return;P.mouse=[B,D.invert(B)],Xe(this),P.start()}he(A),P.wheel=setTimeout(G,y),P.zoom("mouse",r(S(m(D,q),P.mouse[0],P.mouse[1]),P.extent,s));function G(){P.wheel=null,P.end()}}function R(A,...j){if(d||!e.apply(this,arguments))return;var P=A.currentTarget,D=C(this,j,!0).event(A),q=wt(A.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",et,!0),B=Et(A,P),G=A.clientX,Y=A.clientY;Yi(A.view),bn(A),D.mouse=[B,this.__zoom.invert(B)],Xe(this),D.start();function W(J){if(he(J),!D.moved){var ut=J.clientX-G,vt=J.clientY-Y;D.moved=ut*ut+vt*vt>x}D.event(J).zoom("mouse",r(S(D.that.__zoom,D.mouse[0]=Et(J,P),D.mouse[1]),D.extent,s))}function et(J){q.on("mousemove.zoom mouseup.zoom",null),Ki(J.view,D.moved),he(J),D.event(J).end()}}function O(A,...j){if(e.apply(this,arguments)){var P=this.__zoom,D=Et(A.changedTouches?A.changedTouches[0]:A,this),q=P.invert(D),B=P.k*(A.shiftKey?.5:2),G=r(S(m(P,B),D,q),n.apply(this,j),s);he(A),l>0?wt(this).transition().duration(l).call(_,G,D,A):wt(this).call(g.transform,G,D,A)}}function I(A,...j){if(e.apply(this,arguments)){var P=A.touches,D=P.length,q=C(this,j,A.changedTouches.length===D).event(A),B,G,Y,W;for(bn(A),G=0;G<D;++G)Y=P[G],W=Et(Y,this),W=[W,this.__zoom.invert(W),Y.identifier],q.touch0?!q.touch1&&q.touch0[2]!==W[2]&&(q.touch1=W,q.taps=0):(q.touch0=W,B=!0,q.taps=1+!!h);h&&(h=clearTimeout(h)),B&&(q.taps<2&&(f=W[0],h=setTimeout(function(){h=null},p)),Xe(this),q.start())}}function N(A,...j){if(this.__zooming){var P=C(this,j).event(A),D=A.changedTouches,q=D.length,B,G,Y,W;for(he(A),B=0;B<q;++B)G=D[B],Y=Et(G,this),P.touch0&&P.touch0[2]===G.identifier?P.touch0[0]=Y:P.touch1&&P.touch1[2]===G.identifier&&(P.touch1[0]=Y);if(G=P.that.__zoom,P.touch1){var et=P.touch0[0],J=P.touch0[1],ut=P.touch1[0],vt=P.touch1[1],gt=(gt=ut[0]-et[0])*gt+(gt=ut[1]-et[1])*gt,St=(St=vt[0]-J[0])*St+(St=vt[1]-J[1])*St;G=m(G,Math.sqrt(gt/St)),Y=[(et[0]+ut[0])/2,(et[1]+ut[1])/2],W=[(J[0]+vt[0])/2,(J[1]+vt[1])/2]}else if(P.touch0)Y=P.touch0[0],W=P.touch0[1];else return;P.zoom("touch",r(S(G,Y,W),P.extent,s))}}function H(A,...j){if(this.__zooming){var P=C(this,j).event(A),D=A.changedTouches,q=D.length,B,G;for(bn(A),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),B=0;B<q;++B)G=D[B],P.touch0&&P.touch0[2]===G.identifier?delete P.touch0:P.touch1&&P.touch1[2]===G.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(G=Et(G,this),Math.hypot(f[0]-G[0],f[1]-G[1])<v)){var Y=wt(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return g.wheelDelta=function(A){return arguments.length?(i=typeof A=="function"?A:Ue(+A),g):i},g.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Ue(!!A),g):e},g.touchable=function(A){return arguments.length?(o=typeof A=="function"?A:Ue(!!A),g):o},g.extent=function(A){return arguments.length?(n=typeof A=="function"?A:Ue([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),g):n},g.scaleExtent=function(A){return arguments.length?(a[0]=+A[0],a[1]=+A[1],g):[a[0],a[1]]},g.translateExtent=function(A){return arguments.length?(s[0][0]=+A[0][0],s[1][0]=+A[1][0],s[0][1]=+A[0][1],s[1][1]=+A[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(A){return arguments.length?(r=A,g):r},g.duration=function(A){return arguments.length?(l=+A,g):l},g.interpolate=function(A){return arguments.length?(u=A,g):u},g.on=function(){var A=c.on.apply(c,arguments);return A===c?g:A},g.clickDistance=function(A){return arguments.length?(x=(A=+A)*A,g):Math.sqrt(x)},g.tapDistance=function(A){return arguments.length?(v=+A,g):v},g}class Gr extends Map{constructor(n,r=sc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),n!=null)for(const[i,o]of n)this.set(i,o)}get(n){return super.get(Wr(this,n))}has(n){return super.has(Wr(this,n))}set(n,r){return super.set(oc(this,n),r)}delete(n){return super.delete(ac(this,n))}}function Wr({_intern:e,_key:n},r){const i=n(r);return e.has(i)?e.get(i):r}function oc({_intern:e,_key:n},r){const i=n(r);return e.has(i)?e.get(i):(e.set(i,r),r)}function ac({_intern:e,_key:n},r){const i=n(r);return e.has(i)&&(r=e.get(i),e.delete(i)),r}function sc(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Br(e,n){let r;if(n===void 0)for(const i of e)i!=null&&(r<i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let o of e)(o=n(o,++i,e))!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}return r}function Vr(e,n){let r;if(n===void 0)for(const i of e)i!=null&&(r>i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let o of e)(o=n(o,++i,e))!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}return r}function lc(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var uc=typeof global=="object"&&global&&global.Object===Object&&global,cc=typeof self=="object"&&self&&self.Object===Object&&self,uo=uc||cc||Function("return this")(),nn=uo.Symbol,co=Object.prototype,fc=co.hasOwnProperty,hc=co.toString,de=nn?nn.toStringTag:void 0;function dc(e){var n=fc.call(e,de),r=e[de];try{e[de]=void 0;var i=!0}catch{}var o=hc.call(e);return i&&(n?e[de]=r:delete e[de]),o}var pc=Object.prototype,gc=pc.toString;function yc(e){return gc.call(e)}var _c="[object Null]",vc="[object Undefined]",Xr=nn?nn.toStringTag:void 0;function mc(e){return e==null?e===void 0?vc:_c:Xr&&Xr in Object(e)?dc(e):yc(e)}function xc(e){return e!=null&&typeof e=="object"}var bc="[object Symbol]";function wc(e){return typeof e=="symbol"||xc(e)&&mc(e)==bc}var kc=/\s/;function Sc(e){for(var n=e.length;n--&&kc.test(e.charAt(n)););return n}var Cc=/^\s+/;function Ac(e){return e&&e.slice(0,Sc(e)+1).replace(Cc,"")}function rn(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Yr=NaN,Mc=/^[-+]0x[0-9a-f]+$/i,Tc=/^0b[01]+$/i,Pc=/^0o[0-7]+$/i,Ec=parseInt;function Kr(e){if(typeof e=="number")return e;if(wc(e))return Yr;if(rn(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=rn(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Ac(e);var r=Tc.test(e);return r||Pc.test(e)?Ec(e.slice(2),r?2:8):Mc.test(e)?Yr:+e}var wn=function(){return uo.Date.now()},Oc="Expected a function",zc=Math.max,Rc=Math.min;function fo(e,n,r){var i,o,a,s,l,u,c=0,h=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(Oc);n=Kr(n)||0,rn(r)&&(h=!!r.leading,f="maxWait"in r,a=f?zc(Kr(r.maxWait)||0,n):a,d="trailing"in r?!!r.trailing:d);function p(C){var k=i,M=o;return i=o=void 0,c=C,s=e.apply(M,k),s}function y(C){return c=C,l=setTimeout(g,n),h?p(C):s}function x(C){var k=C-u,M=C-c,R=n-k;return f?Rc(R,a-M):R}function v(C){var k=C-u,M=C-c;return u===void 0||k>=n||k<0||f&&M>=a}function g(){var C=wn();if(v(C))return m(C);l=setTimeout(g,x(C))}function m(C){return l=void 0,d&&i?p(C):(i=o=void 0,s)}function S(){l!==void 0&&clearTimeout(l),c=0,i=u=o=l=void 0}function b(){return l===void 0?s:m(wn())}function _(){var C=wn(),k=v(C);if(i=arguments,o=this,u=C,k){if(l===void 0)return y(u);if(f)return clearTimeout(l),l=setTimeout(g,n),p(u)}return l===void 0&&(l=setTimeout(g,n)),s}return _.cancel=S,_.flush=b,_}var jc="Expected a function";function Ic(e,n,r){var i=!0,o=!0;if(typeof e!="function")throw new TypeError(jc);return rn(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),fo(e,n,{leading:i,maxWait:n,trailing:o})}var Jt=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Jt.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Jt.Bounce.In(e*2)*.5:Jt.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),be=function(){return performance.now()},ho=(function(){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,n)}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];(n=s._group)===null||n===void 0||n.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];a._group=void 0,delete this._tweens[a.getId()],delete this._tweensAddedDuringUpdate[a.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(n){return!n.isPlaying()})},e.prototype.update=function(n,r){n===void 0&&(n=be()),r===void 0&&(r=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var a=this._tweens[i[o]],s=!r;a&&a.update(n,s)===!1&&!r&&this.remove(a)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),qn={Linear:function(e,n){var r=e.length-1,i=r*n,o=Math.floor(i),a=qn.Utils.Linear;return n<0?a(e[0],e[1],i):n>1?a(e[r],e[r-1],r-i):a(e[o],e[o+1>r?r:o+1],i-o)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},po=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Gn=new ho,Zr=(function(){function e(n,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Jt.Linear.None,this._interpolationFunction=qn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=po.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=n,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=Gn,Gn.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=be()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var a in this._valuesEnd)o[a]=this._valuesEnd[a];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,i,o,a){for(var s in i){var l=n[s],u=Array.isArray(l),c=u?"array":typeof l,h=!u&&Array.isArray(i[s]);if(!(c==="undefined"||c==="function")){if(h){var f=i[s];if(f.length===0)continue;for(var d=[l],p=0,y=f.length;p<y;p+=1){var x=this._handleRelativeValue(l,f[p]);if(isNaN(x)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(x)}h&&(i[s]=d)}if((c==="object"||u)&&l&&!h){r[s]=u?[]:{};var v=l;for(var g in v)r[s][g]=v[g];o[s]=u?[]:{};var f=i[s];if(!this._isDynamic){var m={};for(var g in f)m[g]=f[g];i[s]=f=m}this._setupProperties(v,r[s],f,o[s],a)}else(typeof r[s]>"u"||a)&&(r[s]=l),u||(r[s]*=1),h?o[s]=i[s].slice().reverse():o[s]=r[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(n){return n===void 0&&(n=be()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this)},e.prototype.resume=function(n){return n===void 0&&(n=be()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;n<r;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return n?(n.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var n;return(n=this._group)===null||n===void 0||n.remove(this),this},e.prototype.delay=function(n){return n===void 0&&(n=0),this._delayTime=n,this},e.prototype.repeat=function(n){return n===void 0&&(n=0),this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return n===void 0&&(n=!1),this._yoyo=n,this},e.prototype.easing=function(n){return n===void 0&&(n=Jt.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=qn.Linear),this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onEveryStart=function(n){return this._onEveryStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,r){var i=this,o;if(n===void 0&&(n=be()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(n,!0);else return!1;if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=n-this._startTime,l=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),u=this._duration+this._repeat*l,c=function(){if(i._duration===0||s>u)return 1;var x=Math.trunc(s/l),v=s-x*l,g=Math.min(v/i._duration,1);return g===0&&s===i._duration?1:g},h=c(),f=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||s>=this._duration)if(this._repeat>0){var d=Math.min(Math.trunc((s-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=d);for(a in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]=="string"&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,y=this._chainedTweens.length;p<y;p++)this._chainedTweens[p].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,r,i,o){for(var a in i)if(r[a]!==void 0){var s=r[a]||0,l=i[a],u=Array.isArray(n[a]),c=Array.isArray(l),h=!u&&c;h?n[a]=this._interpolationFunction(l,o):typeof l=="object"&&l?this._updateProperties(n[a],s,l,o):(l=this._handleRelativeValue(s,l),typeof l=="number"&&(n[a]=s+(l-s)*o))}},e.prototype._handleRelativeValue=function(n,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?n+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(n){var r=this._valuesStartRepeat[n],i=this._valuesEnd[n];typeof i=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=r},e.autoStartOnUpdate=!1,e})();po.nextId;var Rt=Gn;Rt.getAll.bind(Rt);Rt.removeAll.bind(Rt);Rt.add.bind(Rt);Rt.remove.bind(Rt);Rt.update.bind(Rt);function Qr(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Nc(e){if(Array.isArray(e))return e}function Dc(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function $c(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Fc(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function Lc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
6
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uc(e,n){return Nc(e)||Fc(e,n)||Hc(e,n)||Lc()}function Hc(e,n){if(e){if(typeof e=="string")return Qr(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Qr(e,n):void 0}}var qc=$c(function e(n,r){var i=r.default,o=i===void 0?null:i,a=r.triggerUpdate,s=a===void 0?!0:a,l=r.onChange,u=l===void 0?function(c,h){}:l;Dc(this,e),this.name=n,this.defaultVal=o,this.triggerUpdate=s,this.onChange=u});function cr(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,i=e.props,o=i===void 0?{}:i,a=e.methods,s=a===void 0?{}:a,l=e.aliases,u=l===void 0?{}:l,c=e.init,h=c===void 0?function(){}:c,f=e.update,d=f===void 0?function(){}:f,p=Object.keys(o).map(function(y){return new qc(y,o[y])});return function y(){for(var x=arguments.length,v=new Array(x),g=0;g<x;g++)v[g]=arguments[g];var m=!!(this instanceof y&&this.constructor),S=m?v.shift():void 0,b=v[0],_=b===void 0?{}:b,C=Object.assign({},r instanceof Function?r(_):r,{initialised:!1}),k={};function M(I){return R(I,_),O(),M}var R=function(N,H){h.call(M,N,C,H),C.initialised=!0},O=fo(function(){C.initialised&&(d.call(M,C,k),k={})},1);return p.forEach(function(I){M[I.name]=N(I);function N(H){var A=H.name,j=H.triggerUpdate,P=j===void 0?!1:j,D=H.onChange,q=D===void 0?function(Y,W){}:D,B=H.defaultVal,G=B===void 0?null:B;return function(Y){var W=C[A];if(!arguments.length)return W;var et=Y===void 0?G:Y;return C[A]=et,q.call(M,et,C,W),!k.hasOwnProperty(A)&&(k[A]=W),P&&O(),M}}}),Object.keys(s).forEach(function(I){M[I]=function(){for(var N,H=arguments.length,A=new Array(H),j=0;j<H;j++)A[j]=arguments[j];return(N=s[I]).call.apply(N,[M,C].concat(A))}}),Object.entries(u).forEach(function(I){var N=Uc(I,2),H=N[0],A=N[1];return M[H]=M[A]}),M.resetProps=function(){return p.forEach(function(I){M[I.name](I.defaultVal)}),M},M.resetProps(),C._rerender=O,m&&S&&M(S),M}}var Z=(function(e){return typeof e=="function"?e:typeof e=="string"?function(n){return n[e]}:function(n){return e}});function on(e){"@babel/helpers - typeof";return on=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},on(e)}var Gc=/^\s+/,Wc=/\s+$/;function F(e,n){if(e=e||"",n=n||{},e instanceof F)return e;if(!(this instanceof F))return new F(e,n);var r=Bc(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}F.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),r,i,o,a,s,l;return r=n.r/255,i=n.g/255,o=n.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),o<=.03928?l=o/12.92:l=Math.pow((o+.055)/1.055,2.4),.2126*a+.7152*s+.0722*l},setAlpha:function(n){return this._a=go(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=ti(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=ti(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),o=Math.round(n.v*100);return this._a==1?"hsv("+r+", "+i+"%, "+o+"%)":"hsva("+r+", "+i+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var n=Jr(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=Jr(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),o=Math.round(n.l*100);return this._a==1?"hsl("+r+", "+i+"%, "+o+"%)":"hsla("+r+", "+i+"%, "+o+"%, "+this._roundA+")"},toHex:function(n){return ei(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return Kc(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(nt(this._r,255)*100)+"%",g:Math.round(nt(this._g,255)*100)+"%",b:Math.round(nt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(nt(this._r,255)*100)+"%, "+Math.round(nt(this._g,255)*100)+"%, "+Math.round(nt(this._b,255)*100)+"%)":"rgba("+Math.round(nt(this._r,255)*100)+"%, "+Math.round(nt(this._g,255)*100)+"%, "+Math.round(nt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:uf[ei(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+ni(this._r,this._g,this._b,this._a),i=r,o=this._gradientType?"GradientType = 1, ":"";if(n){var a=F(n);i="#"+ni(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+i+")"},toString:function(n){var r=!!n;n=n||this._format;var i=!1,o=this._a<1&&this._a>=0,a=!r&&o&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return a?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(i=this.toRgbString()),n==="prgb"&&(i=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(i=this.toHexString()),n==="hex3"&&(i=this.toHexString(!0)),n==="hex4"&&(i=this.toHex8String(!0)),n==="hex8"&&(i=this.toHex8String()),n==="name"&&(i=this.toName()),n==="hsl"&&(i=this.toHslString()),n==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return F(this.toString())},_applyModification:function(n,r){var i=n.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(tf,arguments)},brighten:function(){return this._applyModification(ef,arguments)},darken:function(){return this._applyModification(nf,arguments)},desaturate:function(){return this._applyModification(Zc,arguments)},saturate:function(){return this._applyModification(Qc,arguments)},greyscale:function(){return this._applyModification(Jc,arguments)},spin:function(){return this._applyModification(rf,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(sf,arguments)},complement:function(){return this._applyCombination(of,arguments)},monochromatic:function(){return this._applyCombination(lf,arguments)},splitcomplement:function(){return this._applyCombination(af,arguments)},triad:function(){return this._applyCombination(ri,[3])},tetrad:function(){return this._applyCombination(ri,[4])}};F.fromRatio=function(e,n){if(on(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=we(e[i]));e=r}return F(e,n)};function Bc(e){var n={r:0,g:0,b:0},r=1,i=null,o=null,a=null,s=!1,l=!1;return typeof e=="string"&&(e=df(e)),on(e)=="object"&&(Nt(e.r)&&Nt(e.g)&&Nt(e.b)?(n=Vc(e.r,e.g,e.b),s=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Nt(e.h)&&Nt(e.s)&&Nt(e.v)?(i=we(e.s),o=we(e.v),n=Yc(e.h,i,o),s=!0,l="hsv"):Nt(e.h)&&Nt(e.s)&&Nt(e.l)&&(i=we(e.s),a=we(e.l),n=Xc(e.h,i,a),s=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=go(r),{ok:s,format:e.format||l,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function Vc(e,n,r){return{r:nt(e,255)*255,g:nt(n,255)*255,b:nt(r,255)*255}}function Jr(e,n,r){e=nt(e,255),n=nt(n,255),r=nt(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,l=(i+o)/2;if(i==o)a=s=0;else{var u=i-o;switch(s=l>.5?u/(2-i-o):u/(i+o),i){case e:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-e)/u+2;break;case r:a=(e-n)/u+4;break}a/=6}return{h:a,s,l}}function Xc(e,n,r){var i,o,a;e=nt(e,360),n=nt(n,100),r=nt(r,100);function s(c,h,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+(h-c)*6*f:f<1/2?h:f<2/3?c+(h-c)*(2/3-f)*6:c}if(n===0)i=o=a=r;else{var l=r<.5?r*(1+n):r+n-r*n,u=2*r-l;i=s(u,l,e+1/3),o=s(u,l,e),a=s(u,l,e-1/3)}return{r:i*255,g:o*255,b:a*255}}function ti(e,n,r){e=nt(e,255),n=nt(n,255),r=nt(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,l=i,u=i-o;if(s=i===0?0:u/i,i==o)a=0;else{switch(i){case e:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-e)/u+2;break;case r:a=(e-n)/u+4;break}a/=6}return{h:a,s,v:l}}function Yc(e,n,r){e=nt(e,360)*6,n=nt(n,100),r=nt(r,100);var i=Math.floor(e),o=e-i,a=r*(1-n),s=r*(1-o*n),l=r*(1-(1-o)*n),u=i%6,c=[r,s,a,a,l,r][u],h=[l,r,r,s,a,a][u],f=[a,a,l,r,r,s][u];return{r:c*255,g:h*255,b:f*255}}function ei(e,n,r,i){var o=[Mt(Math.round(e).toString(16)),Mt(Math.round(n).toString(16)),Mt(Math.round(r).toString(16))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function Kc(e,n,r,i,o){var a=[Mt(Math.round(e).toString(16)),Mt(Math.round(n).toString(16)),Mt(Math.round(r).toString(16)),Mt(yo(i))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function ni(e,n,r,i){var o=[Mt(yo(i)),Mt(Math.round(e).toString(16)),Mt(Math.round(n).toString(16)),Mt(Math.round(r).toString(16))];return o.join("")}F.equals=function(e,n){return!e||!n?!1:F(e).toRgbString()==F(n).toRgbString()};F.random=function(){return F.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Zc(e,n){n=n===0?0:n||10;var r=F(e).toHsl();return r.s-=n/100,r.s=pn(r.s),F(r)}function Qc(e,n){n=n===0?0:n||10;var r=F(e).toHsl();return r.s+=n/100,r.s=pn(r.s),F(r)}function Jc(e){return F(e).desaturate(100)}function tf(e,n){n=n===0?0:n||10;var r=F(e).toHsl();return r.l+=n/100,r.l=pn(r.l),F(r)}function ef(e,n){n=n===0?0:n||10;var r=F(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),F(r)}function nf(e,n){n=n===0?0:n||10;var r=F(e).toHsl();return r.l-=n/100,r.l=pn(r.l),F(r)}function rf(e,n){var r=F(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,F(r)}function of(e){var n=F(e).toHsl();return n.h=(n.h+180)%360,F(n)}function ri(e,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var r=F(e).toHsl(),i=[F(e)],o=360/n,a=1;a<n;a++)i.push(F({h:(r.h+a*o)%360,s:r.s,l:r.l}));return i}function af(e){var n=F(e).toHsl(),r=n.h;return[F(e),F({h:(r+72)%360,s:n.s,l:n.l}),F({h:(r+216)%360,s:n.s,l:n.l})]}function sf(e,n,r){n=n||6,r=r||30;var i=F(e).toHsl(),o=360/r,a=[F(e)];for(i.h=(i.h-(o*n>>1)+720)%360;--n;)i.h=(i.h+o)%360,a.push(F(i));return a}function lf(e,n){n=n||6;for(var r=F(e).toHsv(),i=r.h,o=r.s,a=r.v,s=[],l=1/n;n--;)s.push(F({h:i,s:o,v:a})),a=(a+l)%1;return s}F.mix=function(e,n,r){r=r===0?0:r||50;var i=F(e).toRgb(),o=F(n).toRgb(),a=r/100,s={r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a};return F(s)};F.readability=function(e,n){var r=F(e),i=F(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};F.isReadable=function(e,n,r){var i=F.readability(e,n),o,a;switch(a=!1,o=pf(r),o.level+o.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7;break}return a};F.mostReadable=function(e,n,r){var i=null,o=0,a,s,l,u;r=r||{},s=r.includeFallbackColors,l=r.level,u=r.size;for(var c=0;c<n.length;c++)a=F.readability(e,n[c]),a>o&&(o=a,i=F(n[c]));return F.isReadable(e,i,{level:l,size:u})||!s?i:(r.includeFallbackColors=!1,F.mostReadable(e,["#fff","#000"],r))};var Wn=F.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},uf=F.hexNames=cf(Wn);function cf(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function go(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function nt(e,n){ff(e)&&(e="100%");var r=hf(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function pn(e){return Math.min(1,Math.max(0,e))}function yt(e){return parseInt(e,16)}function ff(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function hf(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Mt(e){return e.length==1?"0"+e:""+e}function we(e){return e<=1&&(e=e*100+"%"),e}function yo(e){return Math.round(parseFloat(e)*255).toString(16)}function ii(e){return yt(e)/255}var Ct=(function(){var e="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function Nt(e){return!!Ct.CSS_UNIT.exec(e)}function df(e){e=e.replace(Gc,"").replace(Wc,"").toLowerCase();var n=!1;if(Wn[e])e=Wn[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Ct.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=Ct.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Ct.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=Ct.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Ct.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=Ct.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Ct.hex8.exec(e))?{r:yt(r[1]),g:yt(r[2]),b:yt(r[3]),a:ii(r[4]),format:n?"name":"hex8"}:(r=Ct.hex6.exec(e))?{r:yt(r[1]),g:yt(r[2]),b:yt(r[3]),format:n?"name":"hex"}:(r=Ct.hex4.exec(e))?{r:yt(r[1]+""+r[1]),g:yt(r[2]+""+r[2]),b:yt(r[3]+""+r[3]),a:ii(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=Ct.hex3.exec(e))?{r:yt(r[1]+""+r[1]),g:yt(r[2]+""+r[2]),b:yt(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function pf(e){var n,r;return e=e||{level:"AA",size:"small"},n=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}function Bn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function gf(e){if(Array.isArray(e))return Bn(e)}function _o(e,n,r){if(typeof e=="function"?e===n:e.has(n))return arguments.length<3?n:r;throw new TypeError("Private element is not present on this object")}function yf(e,n){if(n.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _f(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function mt(e,n){return e.get(_o(e,n))}function oi(e,n,r){yf(e,n),n.set(e,r)}function ai(e,n,r){return e.set(_o(e,n),r),r}function vf(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Sf(i.key),i)}}function mf(e,n,r){return n&&vf(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xf(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bf(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wf(e){return gf(e)||xf(e)||Cf(e)||bf()}function kf(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Sf(e){var n=kf(e,"string");return typeof n=="symbol"?n:n+""}function Cf(e,n){if(e){if(typeof e=="string")return Bn(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bn(e,n):void 0}}var Af=123,Mf=function(n){return"#".concat(Math.min(n,Math.pow(2,24)).toString(16).padStart(6,"0"))},vo=function(n,r,i){return(n<<16)+(r<<8)+i},Tf=function(n){var r=F(n).toRgb(),i=r.r,o=r.g,a=r.b;return vo(i,o,a)},si=function(n,r){return n*Af%Math.pow(2,r)},Yt=new WeakMap,Dt=new WeakMap,Pf=(function(){function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;_f(this,e),oi(this,Yt,void 0),oi(this,Dt,void 0),ai(Dt,this,n),this.reset()}return mf(e,[{key:"reset",value:function(){ai(Yt,this,["__reserved for background__"])}},{key:"register",value:function(r){if(mt(Yt,this).length>=Math.pow(2,24-mt(Dt,this)))return null;var i=mt(Yt,this).length,o=si(i,mt(Dt,this)),a=Mf(i+(o<<24-mt(Dt,this)));return mt(Yt,this).push(r),a}},{key:"lookup",value:function(r){if(!r)return null;var i=typeof r=="string"?Tf(r):vo.apply(void 0,wf(r));if(!i)return null;var o=i&Math.pow(2,24-mt(Dt,this))-1,a=i>>24-mt(Dt,this)&Math.pow(2,mt(Dt,this))-1;return si(o,mt(Dt,this))!==a||o>=mt(Yt,this).length?null:mt(Yt,this)[o]}}])})(),Ne,rt,mo,xo,Vt,li,bo,wo,ko,fr,Vn,Xn,an={},sn=[],Ef=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,gn=Array.isArray;function Ot(e,n){for(var r in n)e[r]=n[r];return e}function hr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Of(e,n,r){var i,o,a,s={};for(a in n)a=="key"?i=n[a]:a=="ref"?o=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?Ne.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return ke(e,s,i,o,null)}function ke(e,n,r,i,o){var a={type:e,props:n,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++mo,__i:-1,__u:0};return o==null&&rt.vnode!=null&&rt.vnode(a),a}function yn(e){return e.children}function Ye(e,n){this.props=e,this.context=n}function ue(e,n){if(n==null)return e.__?ue(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?ue(e):null}function zf(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],o=[],a=Ot({},n);a.__v=n.__v+1,rt.vnode&&rt.vnode(a),dr(e.__P,a,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??ue(n),!!(32&n.__u),o),a.__v=n.__v,a.__.__k[a.__i]=a,Mo(i,a,o),n.__e=n.__=null,a.__e!=r&&So(a)}}function So(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),So(e)}function ui(e){(!e.__d&&(e.__d=!0)&&Vt.push(e)&&!ln.__r++||li!=rt.debounceRendering)&&((li=rt.debounceRendering)||bo)(ln)}function ln(){try{for(var e,n=1;Vt.length;)Vt.length>n&&Vt.sort(wo),e=Vt.shift(),n=Vt.length,zf(e)}finally{Vt.length=ln.__r=0}}function Co(e,n,r,i,o,a,s,l,u,c,h){var f,d,p,y,x,v,g,m=i&&i.__k||sn,S=n.length;for(u=Rf(r,n,m,u,S),f=0;f<S;f++)(p=r.__k[f])!=null&&(d=p.__i!=-1&&m[p.__i]||an,p.__i=f,v=dr(e,p,d,o,a,s,l,u,c,h),y=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&pr(d.ref,null,p),h.push(p.ref,p.__c||y,p)),x==null&&y!=null&&(x=y),(g=!!(4&p.__u))||d.__k===p.__k?u=Ao(p,u,e,g):typeof p.type=="function"&&v!==void 0?u=v:y&&(u=y.nextSibling),p.__u&=-7);return r.__e=x,u}function Rf(e,n,r,i,o){var a,s,l,u,c,h=r.length,f=h,d=0;for(e.__k=new Array(o),a=0;a<o;a++)(s=n[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[a]=ke(null,s,null,null,null):gn(s)?s=e.__k[a]=ke(yn,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[a]=ke(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,u=a+d,s.__=e,s.__b=e.__b+1,l=null,(c=s.__i=jf(s,r,u,f))!=-1&&(f--,(l=r[c])&&(l.__u|=2)),l==null||l.__v==null?(c==-1&&(o>h?d--:o<h&&d++),typeof s.type!="function"&&(s.__u|=4)):c!=u&&(c==u-1?d--:c==u+1?d++:(c>u?d--:d++,s.__u|=4))):e.__k[a]=null;if(f)for(a=0;a<h;a++)(l=r[a])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=ue(l)),Po(l,l));return i}function Ao(e,n,r,i){var o,a;if(typeof e.type=="function"){for(o=e.__k,a=0;o&&a<o.length;a++)o[a]&&(o[a].__=e,n=Ao(o[a],n,r,i));return n}e.__e!=n&&(i&&(n&&e.type&&!n.parentNode&&(n=ue(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function jf(e,n,r,i){var o,a,s,l=e.key,u=e.type,c=n[r],h=c!=null&&(2&c.__u)==0;if(c===null&&l==null||h&&l==c.key&&u==c.type)return r;if(i>(h?1:0)){for(o=r-1,a=r+1;o>=0||a<n.length;)if((c=n[s=o>=0?o--:a++])!=null&&(2&c.__u)==0&&l==c.key&&u==c.type)return s}return-1}function ci(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||Ef.test(n)?r:r+"px"}function He(e,n,r,i,o){var a,s;t:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(n in i)r&&n in r||ci(e.style,n,"");if(r)for(n in r)i&&r[n]==i[n]||ci(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")a=n!=(n=n.replace(ko,"$1")),s=n.toLowerCase(),n=s in e||n=="onFocusOut"||n=="onFocusIn"?s.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+a]=r,r?i?r.u=i.u:(r.u=fr,e.addEventListener(n,a?Xn:Vn,a)):e.removeEventListener(n,a?Xn:Vn,a);else{if(o=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break t}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function fi(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=fr++;else if(n.t<r.u)return;return r(rt.event?rt.event(n):n)}}}function dr(e,n,r,i,o,a,s,l,u,c){var h,f,d,p,y,x,v,g,m,S,b,_,C,k,M,R=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),a=[l=n.__e=r.__e]),(h=rt.__b)&&h(n);t:if(typeof R=="function")try{if(g=n.props,m=R.prototype&&R.prototype.render,S=(h=R.contextType)&&i[h.__c],b=h?S?S.props.value:h.__:i,r.__c?v=(f=n.__c=r.__c).__=f.__E:(m?n.__c=f=new R(g,b):(n.__c=f=new Ye(g,b),f.constructor=R,f.render=Nf),S&&S.sub(f),f.state||(f.state={}),f.__n=i,d=f.__d=!0,f.__h=[],f._sb=[]),m&&f.__s==null&&(f.__s=f.state),m&&R.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Ot({},f.__s)),Ot(f.__s,R.getDerivedStateFromProps(g,f.__s))),p=f.props,y=f.state,f.__v=n,d)m&&R.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),m&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(m&&R.getDerivedStateFromProps==null&&g!==p&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(g,b),n.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(g,f.__s,b)===!1){n.__v!=r.__v&&(f.props=g,f.state=f.__s,f.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(O){O&&(O.__=n)}),sn.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break t}f.componentWillUpdate!=null&&f.componentWillUpdate(g,f.__s,b),m&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(p,y,x)})}if(f.context=b,f.props=g,f.__P=e,f.__e=!1,_=rt.__r,C=0,m)f.state=f.__s,f.__d=!1,_&&_(n),h=f.render(f.props,f.state,f.context),sn.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,_&&_(n),h=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++C<25);f.state=f.__s,f.getChildContext!=null&&(i=Ot(Ot({},i),f.getChildContext())),m&&!d&&f.getSnapshotBeforeUpdate!=null&&(x=f.getSnapshotBeforeUpdate(p,y)),k=h!=null&&h.type===yn&&h.key==null?To(h.props.children):h,l=Co(e,gn(k)?k:[k],n,r,i,o,a,s,l,u,c),f.base=n.__e,n.__u&=-161,f.__h.length&&s.push(f),v&&(f.__E=f.__=null)}catch(O){if(n.__v=null,u||a!=null)if(O.then){for(n.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,n.__e=l}else{for(M=a.length;M--;)hr(a[M]);Yn(n)}else n.__e=r.__e,n.__k=r.__k,O.then||Yn(n);rt.__e(O,n,r)}else a==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):l=n.__e=If(r.__e,n,r,i,o,a,s,u,c);return(h=rt.diffed)&&h(n),128&n.__u?void 0:l}function Yn(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Yn))}function Mo(e,n,r){for(var i=0;i<r.length;i++)pr(r[i],r[++i],r[++i]);rt.__c&&rt.__c(n,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){rt.__e(a,o.__v)}})}function To(e){return typeof e!="object"||e==null||e.__b>0?e:gn(e)?e.map(To):Ot({},e)}function If(e,n,r,i,o,a,s,l,u){var c,h,f,d,p,y,x,v=r.props||an,g=n.props,m=n.type;if(m=="svg"?o="http://www.w3.org/2000/svg":m=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(c=0;c<a.length;c++)if((p=a[c])&&"setAttribute"in p==!!m&&(m?p.localName==m:p.nodeType==3)){e=p,a[c]=null;break}}if(e==null){if(m==null)return document.createTextNode(g);e=document.createElementNS(o,m,g.is&&g),l&&(rt.__m&&rt.__m(n,a),l=!1),a=null}if(m==null)v===g||l&&e.data==g||(e.data=g);else{if(a=a&&Ne.call(e.childNodes),!l&&a!=null)for(v={},c=0;c<e.attributes.length;c++)v[(p=e.attributes[c]).name]=p.value;for(c in v)p=v[c],c=="dangerouslySetInnerHTML"?f=p:c=="children"||c in g||c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g||He(e,c,null,p,o);for(c in g)p=g[c],c=="children"?d=p:c=="dangerouslySetInnerHTML"?h=p:c=="value"?y=p:c=="checked"?x=p:l&&typeof p!="function"||v[c]===p||He(e,c,p,v[c],o);if(h)l||f&&(h.__html==f.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(f&&(e.innerHTML=""),Co(n.type=="template"?e.content:e,gn(d)?d:[d],n,r,i,m=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,s,a?a[0]:r.__k&&ue(r,0),l,u),a!=null)for(c=a.length;c--;)hr(a[c]);l||(c="value",m=="progress"&&y==null?e.removeAttribute("value"):y!=null&&(y!==e[c]||m=="progress"&&!y||m=="option"&&y!=v[c])&&He(e,c,y,v[c],o),c="checked",x!=null&&x!=e[c]&&He(e,c,x,v[c],o))}return e}function pr(e,n,r){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(o){rt.__e(o,r)}}function Po(e,n,r){var i,o;if(rt.unmount&&rt.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||pr(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(a){rt.__e(a,n)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&Po(i[o],n,r||typeof e.type!="function");r||hr(e.__e),e.__c=e.__=e.__e=void 0}function Nf(e,n,r){return this.constructor(e,r)}function Df(e,n,r){var i,o,a,s;n==document&&(n=document.documentElement),rt.__&&rt.__(e,n),o=(i=!1)?null:n.__k,a=[],s=[],dr(n,e=n.__k=Of(yn,null,[e]),o||an,an,n.namespaceURI,o?null:n.firstChild?Ne.call(n.childNodes):null,a,o?o.__e:n.firstChild,i,s),Mo(a,e,s)}function Eo(e,n,r){var i,o,a,s,l=Ot({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)a=="key"?i=n[a]:a=="ref"?o=n[a]:l[a]=n[a]===void 0&&s!=null?s[a]:n[a];return arguments.length>2&&(l.children=arguments.length>3?Ne.call(arguments,2):r),ke(e.type,l,i||e.key,o||e.ref,null)}Ne=sn.slice,rt={__e:function(e,n,r,i){for(var o,a,s;n=n.__;)if((o=n.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,i||{}),s=o.__d),s)return o.__E=o}catch(l){e=l}throw e}},mo=0,xo=function(e){return e!=null&&e.constructor===void 0},Ye.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ot({},this.state),typeof e=="function"&&(e=e(Ot({},r),this.props)),e&&Ot(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),ui(this))},Ye.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ui(this))},Ye.prototype.render=yn,Vt=[],bo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wo=function(e,n){return e.__v.__b-n.__v.__b},ln.__r=0,ko=/(PointerCapture)$|Capture$/i,fr=0,Vn=fi(!1),Xn=fi(!0);function hi(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function $f(e){if(Array.isArray(e))return e}function Ff(e,n,r){return(n=Wf(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Lf(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function Uf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function di(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function Hf(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?di(Object(r),!0).forEach(function(i){Ff(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):di(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function qf(e,n){return $f(e)||Lf(e,n)||Bf(e,n)||Uf()}function Gf(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Wf(e){var n=Gf(e,"string");return typeof n=="symbol"?n:n+""}function un(e){"@babel/helpers - typeof";return un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},un(e)}function Bf(e,n){if(e){if(typeof e=="string")return hi(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hi(e,n):void 0}}var Kn=function(n){if(un(n)!=="object")return n;var r=Eo(n);if(r.props){var i;r.props=Hf({},r.props),r!=null&&(i=r.props)!==null&&i!==void 0&&i.children&&(r.props.children=Array.isArray(r.props.children)?r.props.children.map(Kn):Kn(r.props.children))}return r},Vf=function(n){return xo(Eo(n))},Xf=function(n,r){delete r.__k,Df(Kn(n),r)};function Yf(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var Kf=`.float-tooltip-kap {
9
+ position: absolute;
10
+ width: max-content; /* prevent shrinking near right edge */
11
+ max-width: max(50%, 150px);
12
+ padding: 3px 5px;
13
+ border-radius: 3px;
14
+ font: 12px sans-serif;
15
+ color: #eee;
16
+ background: rgba(0,0,0,0.6);
17
+ pointer-events: none;
18
+ }
19
+ `;Yf(Kf);var Zf=cr({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.style,a=o===void 0?{}:o,s=!!n&&un(n)==="object"&&!!n.node&&typeof n.node=="function",l=wt(s?n.node():n);l.style("position")==="static"&&l.style("position","relative"),r.tooltipEl=l.append("div").attr("class","float-tooltip-kap"),Object.entries(a).forEach(function(c){var h=qf(c,2),f=h[0],d=h[1];return r.tooltipEl.style(f,d)}),r.tooltipEl.style("left","-10000px").style("display","none");var u="tooltip-".concat(Math.round(Math.random()*1e12));r.mouseInside=!1,l.on("mousemove.".concat(u),function(c){r.mouseInside=!0;var h=Et(c),f=l.node(),d=f.offsetWidth,p=f.offsetHeight,y=[r.offsetX===null||r.offsetX===void 0?"-".concat(h[0]/d*100,"%"):typeof r.offsetX=="number"?"calc(-50% + ".concat(r.offsetX,"px)"):r.offsetX,r.offsetY===null||r.offsetY===void 0?p>130&&p-h[1]<100?"calc(-100% - 6px)":"21px":typeof r.offsetY=="number"?r.offsetY<0?"calc(-100% - ".concat(Math.abs(r.offsetY),"px)"):"".concat(r.offsetY,"px"):r.offsetY];r.tooltipEl.style("left",h[0]+"px").style("top",h[1]+"px").style("transform","translate(".concat(y.join(","),")")),r.content&&r.tooltipEl.style("display","inline")}),l.on("mouseover.".concat(u),function(){r.mouseInside=!0,r.content&&r.tooltipEl.style("display","inline")}),l.on("mouseout.".concat(u),function(){r.mouseInside=!1,r.tooltipEl.style("display","none")})},update:function(n){n.tooltipEl.style("display",n.content&&n.mouseInside?"inline":"none"),n.content?n.content instanceof HTMLElement?(n.tooltipEl.text(""),n.tooltipEl.append(function(){return n.content})):typeof n.content=="string"?n.tooltipEl.html(n.content):Vf(n.content)?(n.tooltipEl.text(""),Xf(n.content,n.tooltipEl.node())):(n.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",n.content,n.content.toString())):n.tooltipEl.text("")}});function Qf(e,n,r){var i,o=1;e==null&&(e=0),n==null&&(n=0),r==null&&(r=0);function a(){var s,l=i.length,u,c=0,h=0,f=0;for(s=0;s<l;++s)u=i[s],c+=u.x||0,h+=u.y||0,f+=u.z||0;for(c=(c/l-e)*o,h=(h/l-n)*o,f=(f/l-r)*o,s=0;s<l;++s)u=i[s],c&&(u.x-=c),h&&(u.y-=h),f&&(u.z-=f)}return a.initialize=function(s){i=s},a.x=function(s){return arguments.length?(e=+s,a):e},a.y=function(s){return arguments.length?(n=+s,a):n},a.z=function(s){return arguments.length?(r=+s,a):r},a.strength=function(s){return arguments.length?(o=+s,a):o},a}function Jf(e){const n=+this._x.call(null,e);return Oo(this.cover(n),n,e)}function Oo(e,n,r){if(isNaN(n))return e;var i,o=e._root,a={data:r},s=e._x0,l=e._x1,u,c,h,f,d;if(!o)return e._root=a,e;for(;o.length;)if((h=n>=(u=(s+l)/2))?s=u:l=u,i=o,!(o=o[f=+h]))return i[f]=a,e;if(c=+e._x.call(null,o.data),n===c)return a.next=o,i?i[f]=a:e._root=a,e;do i=i?i[f]=new Array(2):e._root=new Array(2),(h=n>=(u=(s+l)/2))?s=u:l=u;while((f=+h)==(d=+(c>=u)));return i[d]=o,i[f]=a,e}function th(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n);let i=1/0,o=-1/0;for(let a=0,s;a<n;++a)isNaN(s=+this._x.call(null,e[a]))||(r[a]=s,s<i&&(i=s),s>o&&(o=s));if(i>o)return this;this.cover(i).cover(o);for(let a=0;a<n;++a)Oo(this,r[a],e[a]);return this}function eh(e){if(isNaN(e=+e))return this;var n=this._x0,r=this._x1;if(isNaN(n))r=(n=Math.floor(e))+1;else{for(var i=r-n||1,o=this._root,a,s;n>e||e>=r;)switch(s=+(e<n),a=new Array(2),a[s]=o,o=a,i*=2,s){case 0:r=n+i;break;case 1:n=r-i;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._x1=r,this}function nh(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function rh(e){return arguments.length?this.cover(+e[0][0]).cover(+e[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function Ht(e,n,r){this.node=e,this.x0=n,this.x1=r}function ih(e,n){var r,i=this._x0,o,a,s=this._x1,l=[],u=this._root,c,h;for(u&&l.push(new Ht(u,i,s)),n==null?n=1/0:(i=e-n,s=e+n);c=l.pop();)if(!(!(u=c.node)||(o=c.x0)>s||(a=c.x1)<i))if(u.length){var f=(o+a)/2;l.push(new Ht(u[1],f,a),new Ht(u[0],o,f)),(h=+(e>=f))&&(c=l[l.length-1],l[l.length-1]=l[l.length-1-h],l[l.length-1-h]=c)}else{var d=Math.abs(e-+this._x.call(null,u.data));d<n&&(n=d,i=e-d,s=e+d,r=u.data)}return r}function oh(e){if(isNaN(u=+this._x.call(null,e)))return this;var n,r=this._root,i,o,a,s=this._x0,l=this._x1,u,c,h,f,d;if(!r)return this;if(r.length)for(;;){if((h=u>=(c=(s+l)/2))?s=c:l=c,n=r,!(r=r[f=+h]))return this;if(!r.length)break;n[f+1&1]&&(i=n,d=f)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,o?(a?o.next=a:delete o.next,this):n?(a?n[f]=a:delete n[f],(r=n[0]||n[1])&&r===(n[1]||n[0])&&!r.length&&(i?i[d]=r:this._root=r),this):(this._root=a,this)}function ah(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function sh(){return this._root}function lh(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function uh(e){var n=[],r,i=this._root,o,a,s;for(i&&n.push(new Ht(i,this._x0,this._x1));r=n.pop();)if(!e(i=r.node,a=r.x0,s=r.x1)&&i.length){var l=(a+s)/2;(o=i[1])&&n.push(new Ht(o,l,s)),(o=i[0])&&n.push(new Ht(o,a,l))}return this}function ch(e){var n=[],r=[],i;for(this._root&&n.push(new Ht(this._root,this._x0,this._x1));i=n.pop();){var o=i.node;if(o.length){var a,s=i.x0,l=i.x1,u=(s+l)/2;(a=o[0])&&n.push(new Ht(a,s,u)),(a=o[1])&&n.push(new Ht(a,u,l))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.x1);return this}function fh(e){return e[0]}function hh(e){return arguments.length?(this._x=e,this):this._x}function zo(e,n){var r=new gr(n??fh,NaN,NaN);return e==null?r:r.addAll(e)}function gr(e,n,r){this._x=e,this._x0=n,this._x1=r,this._root=void 0}function pi(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var pt=zo.prototype=gr.prototype;pt.copy=function(){var e=new gr(this._x,this._x0,this._x1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=pi(n),e;for(r=[{source:n,target:e._root=new Array(2)}];n=r.pop();)for(var o=0;o<2;++o)(i=n.source[o])&&(i.length?r.push({source:i,target:n.target[o]=new Array(2)}):n.target[o]=pi(i));return e};pt.add=Jf;pt.addAll=th;pt.cover=eh;pt.data=nh;pt.extent=rh;pt.find=ih;pt.remove=oh;pt.removeAll=ah;pt.root=sh;pt.size=lh;pt.visit=uh;pt.visitAfter=ch;pt.x=hh;function dh(e){const n=+this._x.call(null,e),r=+this._y.call(null,e);return Ro(this.cover(n,r),n,r,e)}function Ro(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var o,a=e._root,s={data:i},l=e._x0,u=e._y0,c=e._x1,h=e._y1,f,d,p,y,x,v,g,m;if(!a)return e._root=s,e;for(;a.length;)if((x=n>=(f=(l+c)/2))?l=f:c=f,(v=r>=(d=(u+h)/2))?u=d:h=d,o=a,!(a=a[g=v<<1|x]))return o[g]=s,e;if(p=+e._x.call(null,a.data),y=+e._y.call(null,a.data),n===p&&r===y)return s.next=a,o?o[g]=s:e._root=s,e;do o=o?o[g]=new Array(4):e._root=new Array(4),(x=n>=(f=(l+c)/2))?l=f:c=f,(v=r>=(d=(u+h)/2))?u=d:h=d;while((g=v<<1|x)===(m=(y>=d)<<1|p>=f));return o[m]=a,o[g]=s,e}function ph(e){var n,r,i=e.length,o,a,s=new Array(i),l=new Array(i),u=1/0,c=1/0,h=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(o=+this._x.call(null,n=e[r]))||isNaN(a=+this._y.call(null,n))||(s[r]=o,l[r]=a,o<u&&(u=o),o>h&&(h=o),a<c&&(c=a),a>f&&(f=a));if(u>h||c>f)return this;for(this.cover(u,c).cover(h,f),r=0;r<i;++r)Ro(this,s[r],l[r],e[r]);return this}function gh(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,o=this._x1,a=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,a=(i=Math.floor(n))+1;else{for(var s=o-r||1,l=this._root,u,c;r>e||e>=o||i>n||n>=a;)switch(c=(n<i)<<1|e<r,u=new Array(4),u[c]=l,l=u,s*=2,c){case 0:o=r+s,a=i+s;break;case 1:r=o-s,a=i+s;break;case 2:o=r+s,i=a-s;break;case 3:r=o-s,i=a-s;break}this._root&&this._root.length&&(this._root=l)}return this._x0=r,this._y0=i,this._x1=o,this._y1=a,this}function yh(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function _h(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function ft(e,n,r,i,o){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=o}function vh(e,n,r){var i,o=this._x0,a=this._y0,s,l,u,c,h=this._x1,f=this._y1,d=[],p=this._root,y,x;for(p&&d.push(new ft(p,o,a,h,f)),r==null?r=1/0:(o=e-r,a=n-r,h=e+r,f=n+r,r*=r);y=d.pop();)if(!(!(p=y.node)||(s=y.x0)>h||(l=y.y0)>f||(u=y.x1)<o||(c=y.y1)<a))if(p.length){var v=(s+u)/2,g=(l+c)/2;d.push(new ft(p[3],v,g,u,c),new ft(p[2],s,g,v,c),new ft(p[1],v,l,u,g),new ft(p[0],s,l,v,g)),(x=(n>=g)<<1|e>=v)&&(y=d[d.length-1],d[d.length-1]=d[d.length-1-x],d[d.length-1-x]=y)}else{var m=e-+this._x.call(null,p.data),S=n-+this._y.call(null,p.data),b=m*m+S*S;if(b<r){var _=Math.sqrt(r=b);o=e-_,a=n-_,h=e+_,f=n+_,i=p.data}}return i}function mh(e){if(isNaN(h=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,i,o,a,s=this._x0,l=this._y0,u=this._x1,c=this._y1,h,f,d,p,y,x,v,g;if(!r)return this;if(r.length)for(;;){if((y=h>=(d=(s+u)/2))?s=d:u=d,(x=f>=(p=(l+c)/2))?l=p:c=p,n=r,!(r=r[v=x<<1|y]))return this;if(!r.length)break;(n[v+1&3]||n[v+2&3]||n[v+3&3])&&(i=n,g=v)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,o?(a?o.next=a:delete o.next,this):n?(a?n[v]=a:delete n[v],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[g]=r:this._root=r),this):(this._root=a,this)}function xh(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function bh(){return this._root}function wh(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function kh(e){var n=[],r,i=this._root,o,a,s,l,u;for(i&&n.push(new ft(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,a=r.x0,s=r.y0,l=r.x1,u=r.y1)&&i.length){var c=(a+l)/2,h=(s+u)/2;(o=i[3])&&n.push(new ft(o,c,h,l,u)),(o=i[2])&&n.push(new ft(o,a,h,c,u)),(o=i[1])&&n.push(new ft(o,c,s,l,h)),(o=i[0])&&n.push(new ft(o,a,s,c,h))}return this}function Sh(e){var n=[],r=[],i;for(this._root&&n.push(new ft(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var o=i.node;if(o.length){var a,s=i.x0,l=i.y0,u=i.x1,c=i.y1,h=(s+u)/2,f=(l+c)/2;(a=o[0])&&n.push(new ft(a,s,l,h,f)),(a=o[1])&&n.push(new ft(a,h,l,u,f)),(a=o[2])&&n.push(new ft(a,s,f,h,c)),(a=o[3])&&n.push(new ft(a,h,f,u,c))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Ch(e){return e[0]}function Ah(e){return arguments.length?(this._x=e,this):this._x}function Mh(e){return e[1]}function Th(e){return arguments.length?(this._y=e,this):this._y}function jo(e,n,r){var i=new yr(n??Ch,r??Mh,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function yr(e,n,r,i,o,a){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=o,this._y1=a,this._root=void 0}function gi(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var ht=jo.prototype=yr.prototype;ht.copy=function(){var e=new yr(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=gi(n),e;for(r=[{source:n,target:e._root=new Array(4)}];n=r.pop();)for(var o=0;o<4;++o)(i=n.source[o])&&(i.length?r.push({source:i,target:n.target[o]=new Array(4)}):n.target[o]=gi(i));return e};ht.add=dh;ht.addAll=ph;ht.cover=gh;ht.data=yh;ht.extent=_h;ht.find=vh;ht.remove=mh;ht.removeAll=xh;ht.root=bh;ht.size=wh;ht.visit=kh;ht.visitAfter=Sh;ht.x=Ah;ht.y=Th;function Ph(e){const n=+this._x.call(null,e),r=+this._y.call(null,e),i=+this._z.call(null,e);return Io(this.cover(n,r,i),n,r,i,e)}function Io(e,n,r,i,o){if(isNaN(n)||isNaN(r)||isNaN(i))return e;var a,s=e._root,l={data:o},u=e._x0,c=e._y0,h=e._z0,f=e._x1,d=e._y1,p=e._z1,y,x,v,g,m,S,b,_,C,k,M;if(!s)return e._root=l,e;for(;s.length;)if((b=n>=(y=(u+f)/2))?u=y:f=y,(_=r>=(x=(c+d)/2))?c=x:d=x,(C=i>=(v=(h+p)/2))?h=v:p=v,a=s,!(s=s[k=C<<2|_<<1|b]))return a[k]=l,e;if(g=+e._x.call(null,s.data),m=+e._y.call(null,s.data),S=+e._z.call(null,s.data),n===g&&r===m&&i===S)return l.next=s,a?a[k]=l:e._root=l,e;do a=a?a[k]=new Array(8):e._root=new Array(8),(b=n>=(y=(u+f)/2))?u=y:f=y,(_=r>=(x=(c+d)/2))?c=x:d=x,(C=i>=(v=(h+p)/2))?h=v:p=v;while((k=C<<2|_<<1|b)===(M=(S>=v)<<2|(m>=x)<<1|g>=y));return a[M]=s,a[k]=l,e}function Eh(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n),i=new Float64Array(n),o=new Float64Array(n);let a=1/0,s=1/0,l=1/0,u=-1/0,c=-1/0,h=-1/0;for(let f=0,d,p,y,x;f<n;++f)isNaN(p=+this._x.call(null,d=e[f]))||isNaN(y=+this._y.call(null,d))||isNaN(x=+this._z.call(null,d))||(r[f]=p,i[f]=y,o[f]=x,p<a&&(a=p),p>u&&(u=p),y<s&&(s=y),y>c&&(c=y),x<l&&(l=x),x>h&&(h=x));if(a>u||s>c||l>h)return this;this.cover(a,s,l).cover(u,c,h);for(let f=0;f<n;++f)Io(this,r[f],i[f],o[f],e[f]);return this}function Oh(e,n,r){if(isNaN(e=+e)||isNaN(n=+n)||isNaN(r=+r))return this;var i=this._x0,o=this._y0,a=this._z0,s=this._x1,l=this._y1,u=this._z1;if(isNaN(i))s=(i=Math.floor(e))+1,l=(o=Math.floor(n))+1,u=(a=Math.floor(r))+1;else{for(var c=s-i||1,h=this._root,f,d;i>e||e>=s||o>n||n>=l||a>r||r>=u;)switch(d=(r<a)<<2|(n<o)<<1|e<i,f=new Array(8),f[d]=h,h=f,c*=2,d){case 0:s=i+c,l=o+c,u=a+c;break;case 1:i=s-c,l=o+c,u=a+c;break;case 2:s=i+c,o=l-c,u=a+c;break;case 3:i=s-c,o=l-c,u=a+c;break;case 4:s=i+c,l=o+c,a=u-c;break;case 5:i=s-c,l=o+c,a=u-c;break;case 6:s=i+c,o=l-c,a=u-c;break;case 7:i=s-c,o=l-c,a=u-c;break}this._root&&this._root.length&&(this._root=h)}return this._x0=i,this._y0=o,this._z0=a,this._x1=s,this._y1=l,this._z1=u,this}function zh(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Rh(e){return arguments.length?this.cover(+e[0][0],+e[0][1],+e[0][2]).cover(+e[1][0],+e[1][1],+e[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function Q(e,n,r,i,o,a,s){this.node=e,this.x0=n,this.y0=r,this.z0=i,this.x1=o,this.y1=a,this.z1=s}function jh(e,n,r,i){var o,a=this._x0,s=this._y0,l=this._z0,u,c,h,f,d,p,y=this._x1,x=this._y1,v=this._z1,g=[],m=this._root,S,b;for(m&&g.push(new Q(m,a,s,l,y,x,v)),i==null?i=1/0:(a=e-i,s=n-i,l=r-i,y=e+i,x=n+i,v=r+i,i*=i);S=g.pop();)if(!(!(m=S.node)||(u=S.x0)>y||(c=S.y0)>x||(h=S.z0)>v||(f=S.x1)<a||(d=S.y1)<s||(p=S.z1)<l))if(m.length){var _=(u+f)/2,C=(c+d)/2,k=(h+p)/2;g.push(new Q(m[7],_,C,k,f,d,p),new Q(m[6],u,C,k,_,d,p),new Q(m[5],_,c,k,f,C,p),new Q(m[4],u,c,k,_,C,p),new Q(m[3],_,C,h,f,d,k),new Q(m[2],u,C,h,_,d,k),new Q(m[1],_,c,h,f,C,k),new Q(m[0],u,c,h,_,C,k)),(b=(r>=k)<<2|(n>=C)<<1|e>=_)&&(S=g[g.length-1],g[g.length-1]=g[g.length-1-b],g[g.length-1-b]=S)}else{var M=e-+this._x.call(null,m.data),R=n-+this._y.call(null,m.data),O=r-+this._z.call(null,m.data),I=M*M+R*R+O*O;if(I<i){var N=Math.sqrt(i=I);a=e-N,s=n-N,l=r-N,y=e+N,x=n+N,v=r+N,o=m.data}}return o}const Ih=(e,n,r,i,o,a)=>Math.sqrt((e-i)**2+(n-o)**2+(r-a)**2);function Nh(e,n,r,i){const o=[],a=e-i,s=n-i,l=r-i,u=e+i,c=n+i,h=r+i;return this.visit((f,d,p,y,x,v,g)=>{if(!f.length)do{const m=f.data;Ih(e,n,r,this._x(m),this._y(m),this._z(m))<=i&&o.push(m)}while(f=f.next);return d>u||p>c||y>h||x<a||v<s||g<l}),o}function Dh(e){if(isNaN(d=+this._x.call(null,e))||isNaN(p=+this._y.call(null,e))||isNaN(y=+this._z.call(null,e)))return this;var n,r=this._root,i,o,a,s=this._x0,l=this._y0,u=this._z0,c=this._x1,h=this._y1,f=this._z1,d,p,y,x,v,g,m,S,b,_,C;if(!r)return this;if(r.length)for(;;){if((m=d>=(x=(s+c)/2))?s=x:c=x,(S=p>=(v=(l+h)/2))?l=v:h=v,(b=y>=(g=(u+f)/2))?u=g:f=g,n=r,!(r=r[_=b<<2|S<<1|m]))return this;if(!r.length)break;(n[_+1&7]||n[_+2&7]||n[_+3&7]||n[_+4&7]||n[_+5&7]||n[_+6&7]||n[_+7&7])&&(i=n,C=_)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,o?(a?o.next=a:delete o.next,this):n?(a?n[_]=a:delete n[_],(r=n[0]||n[1]||n[2]||n[3]||n[4]||n[5]||n[6]||n[7])&&r===(n[7]||n[6]||n[5]||n[4]||n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[C]=r:this._root=r),this):(this._root=a,this)}function $h(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function Fh(){return this._root}function Lh(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Uh(e){var n=[],r,i=this._root,o,a,s,l,u,c,h;for(i&&n.push(new Q(i,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=n.pop();)if(!e(i=r.node,a=r.x0,s=r.y0,l=r.z0,u=r.x1,c=r.y1,h=r.z1)&&i.length){var f=(a+u)/2,d=(s+c)/2,p=(l+h)/2;(o=i[7])&&n.push(new Q(o,f,d,p,u,c,h)),(o=i[6])&&n.push(new Q(o,a,d,p,f,c,h)),(o=i[5])&&n.push(new Q(o,f,s,p,u,d,h)),(o=i[4])&&n.push(new Q(o,a,s,p,f,d,h)),(o=i[3])&&n.push(new Q(o,f,d,l,u,c,p)),(o=i[2])&&n.push(new Q(o,a,d,l,f,c,p)),(o=i[1])&&n.push(new Q(o,f,s,l,u,d,p)),(o=i[0])&&n.push(new Q(o,a,s,l,f,d,p))}return this}function Hh(e){var n=[],r=[],i;for(this._root&&n.push(new Q(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));i=n.pop();){var o=i.node;if(o.length){var a,s=i.x0,l=i.y0,u=i.z0,c=i.x1,h=i.y1,f=i.z1,d=(s+c)/2,p=(l+h)/2,y=(u+f)/2;(a=o[0])&&n.push(new Q(a,s,l,u,d,p,y)),(a=o[1])&&n.push(new Q(a,d,l,u,c,p,y)),(a=o[2])&&n.push(new Q(a,s,p,u,d,h,y)),(a=o[3])&&n.push(new Q(a,d,p,u,c,h,y)),(a=o[4])&&n.push(new Q(a,s,l,y,d,p,f)),(a=o[5])&&n.push(new Q(a,d,l,y,c,p,f)),(a=o[6])&&n.push(new Q(a,s,p,y,d,h,f)),(a=o[7])&&n.push(new Q(a,d,p,y,c,h,f))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.z0,i.x1,i.y1,i.z1);return this}function qh(e){return e[0]}function Gh(e){return arguments.length?(this._x=e,this):this._x}function Wh(e){return e[1]}function Bh(e){return arguments.length?(this._y=e,this):this._y}function Vh(e){return e[2]}function Xh(e){return arguments.length?(this._z=e,this):this._z}function No(e,n,r,i){var o=new _r(n??qh,r??Wh,i??Vh,NaN,NaN,NaN,NaN,NaN,NaN);return e==null?o:o.addAll(e)}function _r(e,n,r,i,o,a,s,l,u){this._x=e,this._y=n,this._z=r,this._x0=i,this._y0=o,this._z0=a,this._x1=s,this._y1=l,this._z1=u,this._root=void 0}function yi(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var lt=No.prototype=_r.prototype;lt.copy=function(){var e=new _r(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=yi(n),e;for(r=[{source:n,target:e._root=new Array(8)}];n=r.pop();)for(var o=0;o<8;++o)(i=n.source[o])&&(i.length?r.push({source:i,target:n.target[o]=new Array(8)}):n.target[o]=yi(i));return e};lt.add=Ph;lt.addAll=Eh;lt.cover=Oh;lt.data=zh;lt.extent=Rh;lt.find=jh;lt.findAllWithinRadius=Nh;lt.remove=Dh;lt.removeAll=$h;lt.root=Fh;lt.size=Lh;lt.visit=Uh;lt.visitAfter=Hh;lt.x=Gh;lt.y=Bh;lt.z=Xh;function Ut(e){return function(){return e}}function Ft(e){return(e()-.5)*1e-6}function Yh(e){return e.index}function _i(e,n){var r=e.get(n);if(!r)throw new Error("node not found: "+n);return r}function Kh(e){var n=Yh,r=d,i,o=Ut(30),a,s,l,u,c,h,f=1;e==null&&(e=[]);function d(g){return 1/Math.min(u[g.source.index],u[g.target.index])}function p(g){for(var m=0,S=e.length;m<f;++m)for(var b=0,_,C,k,M=0,R=0,O=0,I,N;b<S;++b)_=e[b],C=_.source,k=_.target,M=k.x+k.vx-C.x-C.vx||Ft(h),l>1&&(R=k.y+k.vy-C.y-C.vy||Ft(h)),l>2&&(O=k.z+k.vz-C.z-C.vz||Ft(h)),I=Math.sqrt(M*M+R*R+O*O),I=(I-a[b])/I*g*i[b],M*=I,R*=I,O*=I,k.vx-=M*(N=c[b]),l>1&&(k.vy-=R*N),l>2&&(k.vz-=O*N),C.vx+=M*(N=1-N),l>1&&(C.vy+=R*N),l>2&&(C.vz+=O*N)}function y(){if(s){var g,m=s.length,S=e.length,b=new Map(s.map((C,k)=>[n(C,k,s),C])),_;for(g=0,u=new Array(m);g<S;++g)_=e[g],_.index=g,typeof _.source!="object"&&(_.source=_i(b,_.source)),typeof _.target!="object"&&(_.target=_i(b,_.target)),u[_.source.index]=(u[_.source.index]||0)+1,u[_.target.index]=(u[_.target.index]||0)+1;for(g=0,c=new Array(S);g<S;++g)_=e[g],c[g]=u[_.source.index]/(u[_.source.index]+u[_.target.index]);i=new Array(S),x(),a=new Array(S),v()}}function x(){if(s)for(var g=0,m=e.length;g<m;++g)i[g]=+r(e[g],g,e)}function v(){if(s)for(var g=0,m=e.length;g<m;++g)a[g]=+o(e[g],g,e)}return p.initialize=function(g,...m){s=g,h=m.find(S=>typeof S=="function")||Math.random,l=m.find(S=>[1,2,3].includes(S))||2,y()},p.links=function(g){return arguments.length?(e=g,y(),p):e},p.id=function(g){return arguments.length?(n=g,p):n},p.iterations=function(g){return arguments.length?(f=+g,p):f},p.strength=function(g){return arguments.length?(r=typeof g=="function"?g:Ut(+g),x(),p):r},p.distance=function(g){return arguments.length?(o=typeof g=="function"?g:Ut(+g),v(),p):o},p}const Zh=1664525,Qh=1013904223,vi=4294967296;function Jh(){let e=1;return()=>(e=(Zh*e+Qh)%vi)/vi}var mi=3;function kn(e){return e.x}function xi(e){return e.y}function td(e){return e.z}var ed=10,nd=Math.PI*(3-Math.sqrt(5)),rd=Math.PI*20/(9+Math.sqrt(221));function id(e,n){n=n||2;var r=Math.min(mi,Math.max(1,Math.round(n))),i,o=1,a=.001,s=1-Math.pow(a,1/300),l=0,u=.6,c=new Map,h=ar(p),f=je("tick","end"),d=Jh();e==null&&(e=[]);function p(){y(),f.call("tick",i),o<a&&(h.stop(),f.call("end",i))}function y(g){var m,S=e.length,b;g===void 0&&(g=1);for(var _=0;_<g;++_)for(o+=(l-o)*s,c.forEach(function(C){C(o)}),m=0;m<S;++m)b=e[m],b.fx==null?b.x+=b.vx*=u:(b.x=b.fx,b.vx=0),r>1&&(b.fy==null?b.y+=b.vy*=u:(b.y=b.fy,b.vy=0)),r>2&&(b.fz==null?b.z+=b.vz*=u:(b.z=b.fz,b.vz=0));return i}function x(){for(var g=0,m=e.length,S;g<m;++g){if(S=e[g],S.index=g,S.fx!=null&&(S.x=S.fx),S.fy!=null&&(S.y=S.fy),S.fz!=null&&(S.z=S.fz),isNaN(S.x)||r>1&&isNaN(S.y)||r>2&&isNaN(S.z)){var b=ed*(r>2?Math.cbrt(.5+g):r>1?Math.sqrt(.5+g):g),_=g*nd,C=g*rd;r===1?S.x=b:r===2?(S.x=b*Math.cos(_),S.y=b*Math.sin(_)):(S.x=b*Math.sin(_)*Math.cos(C),S.y=b*Math.cos(_),S.z=b*Math.sin(_)*Math.sin(C))}(isNaN(S.vx)||r>1&&isNaN(S.vy)||r>2&&isNaN(S.vz))&&(S.vx=0,r>1&&(S.vy=0),r>2&&(S.vz=0))}}function v(g){return g.initialize&&g.initialize(e,d,r),g}return x(),i={tick:y,restart:function(){return h.restart(p),i},stop:function(){return h.stop(),i},numDimensions:function(g){return arguments.length?(r=Math.min(mi,Math.max(1,Math.round(g))),c.forEach(v),i):r},nodes:function(g){return arguments.length?(e=g,x(),c.forEach(v),i):e},alpha:function(g){return arguments.length?(o=+g,i):o},alphaMin:function(g){return arguments.length?(a=+g,i):a},alphaDecay:function(g){return arguments.length?(s=+g,i):+s},alphaTarget:function(g){return arguments.length?(l=+g,i):l},velocityDecay:function(g){return arguments.length?(u=1-g,i):1-u},randomSource:function(g){return arguments.length?(d=g,c.forEach(v),i):d},force:function(g,m){return arguments.length>1?(m==null?c.delete(g):c.set(g,v(m)),i):c.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),m=g.shift()||0,S=(r>1?g.shift():null)||0,b=(r>2?g.shift():null)||0,_=g.shift()||1/0,C=0,k=e.length,M,R,O,I,N,H;for(_*=_,C=0;C<k;++C)N=e[C],M=m-N.x,R=S-(N.y||0),O=b-(N.z||0),I=M*M+R*R+O*O,I<_&&(H=N,_=I);return H},on:function(g,m){return arguments.length>1?(f.on(g,m),i):f.on(g)}}}function od(){var e,n,r,i,o,a=Ut(-30),s,l=1,u=1/0,c=.81;function h(y){var x,v=e.length,g=(n===1?zo(e,kn):n===2?jo(e,kn,xi):n===3?No(e,kn,xi,td):null).visitAfter(d);for(o=y,x=0;x<v;++x)r=e[x],g.visit(p)}function f(){if(e){var y,x=e.length,v;for(s=new Array(x),y=0;y<x;++y)v=e[y],s[v.index]=+a(v,y,e)}}function d(y){var x=0,v,g,m=0,S,b,_,C,k=y.length;if(k){for(S=b=_=C=0;C<k;++C)(v=y[C])&&(g=Math.abs(v.value))&&(x+=v.value,m+=g,S+=g*(v.x||0),b+=g*(v.y||0),_+=g*(v.z||0));x*=Math.sqrt(4/k),y.x=S/m,n>1&&(y.y=b/m),n>2&&(y.z=_/m)}else{v=y,v.x=v.data.x,n>1&&(v.y=v.data.y),n>2&&(v.z=v.data.z);do x+=s[v.data.index];while(v=v.next)}y.value=x}function p(y,x,v,g,m){if(!y.value)return!0;var S=[v,g,m][n-1],b=y.x-r.x,_=n>1?y.y-r.y:0,C=n>2?y.z-r.z:0,k=S-x,M=b*b+_*_+C*C;if(k*k/c<M)return M<u&&(b===0&&(b=Ft(i),M+=b*b),n>1&&_===0&&(_=Ft(i),M+=_*_),n>2&&C===0&&(C=Ft(i),M+=C*C),M<l&&(M=Math.sqrt(l*M)),r.vx+=b*y.value*o/M,n>1&&(r.vy+=_*y.value*o/M),n>2&&(r.vz+=C*y.value*o/M)),!0;if(y.length||M>=u)return;(y.data!==r||y.next)&&(b===0&&(b=Ft(i),M+=b*b),n>1&&_===0&&(_=Ft(i),M+=_*_),n>2&&C===0&&(C=Ft(i),M+=C*C),M<l&&(M=Math.sqrt(l*M)));do y.data!==r&&(k=s[y.data.index]*o/M,r.vx+=b*k,n>1&&(r.vy+=_*k),n>2&&(r.vz+=C*k));while(y=y.next)}return h.initialize=function(y,...x){e=y,i=x.find(v=>typeof v=="function")||Math.random,n=x.find(v=>[1,2,3].includes(v))||2,f()},h.strength=function(y){return arguments.length?(a=typeof y=="function"?y:Ut(+y),f(),h):a},h.distanceMin=function(y){return arguments.length?(l=y*y,h):Math.sqrt(l)},h.distanceMax=function(y){return arguments.length?(u=y*y,h):Math.sqrt(u)},h.theta=function(y){return arguments.length?(c=y*y,h):Math.sqrt(c)},h}function ad(e,n,r,i){var o,a,s=Ut(.1),l,u;typeof e!="function"&&(e=Ut(+e)),n==null&&(n=0),r==null&&(r=0),i==null&&(i=0);function c(f){for(var d=0,p=o.length;d<p;++d){var y=o[d],x=y.x-n||1e-6,v=(y.y||0)-r||1e-6,g=(y.z||0)-i||1e-6,m=Math.sqrt(x*x+v*v+g*g),S=(u[d]-m)*l[d]*f/m;y.vx+=x*S,a>1&&(y.vy+=v*S),a>2&&(y.vz+=g*S)}}function h(){if(o){var f,d=o.length;for(l=new Array(d),u=new Array(d),f=0;f<d;++f)u[f]=+e(o[f],f,o),l[f]=isNaN(u[f])?0:+s(o[f],f,o)}}return c.initialize=function(f,...d){o=f,a=d.find(p=>[1,2,3].includes(p))||2,h()},c.strength=function(f){return arguments.length?(s=typeof f=="function"?f:Ut(+f),h(),c):s},c.radius=function(f){return arguments.length?(e=typeof f=="function"?f:Ut(+f),h(),c):e},c.x=function(f){return arguments.length?(n=+f,c):n},c.y=function(f){return arguments.length?(r=+f,c):r},c.z=function(f){return arguments.length?(i=+f,c):i},c}const{abs:pe,cos:$t,sin:re,acos:sd,atan2:ge,sqrt:Gt,pow:bt}=Math;function ye(e){return e<0?-bt(-e,1/3):bt(e,1/3)}const Do=Math.PI,qe=2*Do,Wt=Do/2,ld=1e-6,Sn=Number.MAX_SAFE_INTEGER||9007199254740991,Cn=Number.MIN_SAFE_INTEGER||-9007199254740991,ud={x:0,y:0,z:0},z={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(e,n){const r=n(e);let i=r.x*r.x+r.y*r.y;return typeof r.z<"u"&&(i+=r.z*r.z),Gt(i)},compute:function(e,n,r){if(e===0)return n[0].t=0,n[0];const i=n.length-1;if(e===1)return n[i].t=1,n[i];const o=1-e;let a=n;if(i===0)return n[0].t=e,n[0];if(i===1){const l={x:o*a[0].x+e*a[1].x,y:o*a[0].y+e*a[1].y,t:e};return r&&(l.z=o*a[0].z+e*a[1].z),l}if(i<4){let l=o*o,u=e*e,c,h,f,d=0;i===2?(a=[a[0],a[1],a[2],ud],c=l,h=o*e*2,f=u):i===3&&(c=l*o,h=l*e*3,f=o*u*3,d=e*u);const p={x:c*a[0].x+h*a[1].x+f*a[2].x+d*a[3].x,y:c*a[0].y+h*a[1].y+f*a[2].y+d*a[3].y,t:e};return r&&(p.z=c*a[0].z+h*a[1].z+f*a[2].z+d*a[3].z),p}const s=JSON.parse(JSON.stringify(n));for(;s.length>1;){for(let l=0;l<s.length-1;l++)s[l]={x:s[l].x+(s[l+1].x-s[l].x)*e,y:s[l].y+(s[l+1].y-s[l].y)*e},typeof s[l].z<"u"&&(s[l].z=s[l].z+(s[l+1].z-s[l].z)*e);s.splice(s.length-1,1)}return s[0].t=e,s[0]},computeWithRatios:function(e,n,r,i){const o=1-e,a=r,s=n;let l=a[0],u=a[1],c=a[2],h=a[3],f;if(l*=o,u*=e,s.length===2)return f=l+u,{x:(l*s[0].x+u*s[1].x)/f,y:(l*s[0].y+u*s[1].y)/f,z:i?(l*s[0].z+u*s[1].z)/f:!1,t:e};if(l*=o,u*=2*o,c*=e*e,s.length===3)return f=l+u+c,{x:(l*s[0].x+u*s[1].x+c*s[2].x)/f,y:(l*s[0].y+u*s[1].y+c*s[2].y)/f,z:i?(l*s[0].z+u*s[1].z+c*s[2].z)/f:!1,t:e};if(l*=o,u*=1.5*o,c*=3*o,h*=e*e*e,s.length===4)return f=l+u+c+h,{x:(l*s[0].x+u*s[1].x+c*s[2].x+h*s[3].x)/f,y:(l*s[0].y+u*s[1].y+c*s[2].y+h*s[3].y)/f,z:i?(l*s[0].z+u*s[1].z+c*s[2].z+h*s[3].z)/f:!1,t:e}},derive:function(e,n){const r=[];for(let i=e,o=i.length,a=o-1;o>1;o--,a--){const s=[];for(let l=0,u;l<a;l++)u={x:a*(i[l+1].x-i[l].x),y:a*(i[l+1].y-i[l].y)},n&&(u.z=a*(i[l+1].z-i[l].z)),s.push(u);r.push(s),i=s}return r},between:function(e,n,r){return n<=e&&e<=r||z.approximately(e,n)||z.approximately(e,r)},approximately:function(e,n,r){return pe(e-n)<=(r||ld)},length:function(e){const r=z.Tvalues.length;let i=0;for(let o=0,a;o<r;o++)a=.5*z.Tvalues[o]+.5,i+=z.Cvalues[o]*z.arcfn(a,e);return .5*i},map:function(e,n,r,i,o){const a=r-n,s=o-i,l=e-n,u=l/a;return i+s*u},lerp:function(e,n,r){const i={x:n.x+e*(r.x-n.x),y:n.y+e*(r.y-n.y)};return n.z!==void 0&&r.z!==void 0&&(i.z=n.z+e*(r.z-n.z)),i},pointToString:function(e){let n=e.x+"/"+e.y;return typeof e.z<"u"&&(n+="/"+e.z),n},pointsToString:function(e){return"["+e.map(z.pointToString).join(", ")+"]"},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,n,r){const i=n.x-e.x,o=n.y-e.y,a=r.x-e.x,s=r.y-e.y,l=i*s-o*a,u=i*a+o*s;return ge(l,u)},round:function(e,n){const r=""+e,i=r.indexOf(".");return parseFloat(r.substring(0,i+1+n))},dist:function(e,n){const r=e.x-n.x,i=e.y-n.y;return Gt(r*r+i*i)},closest:function(e,n){let r=bt(2,63),i,o;return e.forEach(function(a,s){o=z.dist(n,a),o<r&&(r=o,i=s)}),{mdist:r,mpos:i}},abcratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=bt(e,n)+bt(1-e,n),i=r-1;return pe(i/r)},projectionratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=bt(1-e,n),i=bt(e,n)+r;return r/i},lli8:function(e,n,r,i,o,a,s,l){const u=(e*i-n*r)*(o-s)-(e-r)*(o*l-a*s),c=(e*i-n*r)*(a-l)-(n-i)*(o*l-a*s),h=(e-r)*(a-l)-(n-i)*(o-s);return h==0?!1:{x:u/h,y:c/h}},lli4:function(e,n,r,i){const o=e.x,a=e.y,s=n.x,l=n.y,u=r.x,c=r.y,h=i.x,f=i.y;return z.lli8(o,a,s,l,u,c,h,f)},lli:function(e,n){return z.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new tt(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=Sn,r=Sn,i=Cn,o=Cn;return e.forEach(function(a){const s=a.bbox();n>s.x.min&&(n=s.x.min),r>s.y.min&&(r=s.y.min),i<s.x.max&&(i=s.x.max),o<s.y.max&&(o=s.y.max)}),{x:{min:n,mid:(n+i)/2,max:i,size:i-n},y:{min:r,mid:(r+o)/2,max:o,size:o-r}}},shapeintersections:function(e,n,r,i,o){if(!z.bboxoverlap(n,i))return[];const a=[],s=[e.startcap,e.forward,e.back,e.endcap],l=[r.startcap,r.forward,r.back,r.endcap];return s.forEach(function(u){u.virtual||l.forEach(function(c){if(c.virtual)return;const h=u.intersects(c,o);h.length>0&&(h.c1=u,h.c2=c,h.s1=e,h.s2=r,a.push(h))})}),a},makeshape:function(e,n,r){const i=n.points.length,o=e.points.length,a=z.makeline(n.points[i-1],e.points[0]),s=z.makeline(e.points[o-1],n.points[0]),l={startcap:a,forward:e,back:n,endcap:s,bbox:z.findbbox([a,e,n,s])};return l.intersections=function(u){return z.shapeintersections(l,l.bbox,u,u.bbox,r)},l},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let i=Sn,o=Cn,a,s;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let l=0,u=r.length;l<u;l++)a=r[l],s=e.get(a),s[n]<i&&(i=s[n]),s[n]>o&&(o=s[n]);return{min:i,mid:(i+o)/2,max:o,size:o-i}},align:function(e,n){const r=n.p1.x,i=n.p1.y,o=-ge(n.p2.y-i,n.p2.x-r),a=function(s){return{x:(s.x-r)*$t(o)-(s.y-i)*re(o),y:(s.x-r)*re(o)+(s.y-i)*$t(o)}};return e.map(a)},roots:function(e,n){n=n||{p1:{x:0,y:0},p2:{x:1,y:0}};const r=e.length-1,i=z.align(e,n),o=function(k){return 0<=k&&k<=1};if(r===2){const k=i[0].y,M=i[1].y,R=i[2].y,O=k-2*M+R;if(O!==0){const I=-Gt(M*M-k*R),N=-k+M,H=-(I+N)/O,A=-(-I+N)/O;return[H,A].filter(o)}else if(M!==R&&O===0)return[(2*M-R)/(2*M-2*R)].filter(o);return[]}const a=i[0].y,s=i[1].y,l=i[2].y,u=i[3].y;let c=-a+3*s-3*l+u,h=3*a-6*s+3*l,f=-3*a+3*s,d=a;if(z.approximately(c,0)){if(z.approximately(h,0))return z.approximately(f,0)?[]:[-d/f].filter(o);const k=Gt(f*f-4*h*d),M=2*h;return[(k-f)/M,(-f-k)/M].filter(o)}h/=c,f/=c,d/=c;const p=(3*f-h*h)/3,y=p/3,x=(2*h*h*h-9*h*f+27*d)/27,v=x/2,g=v*v+y*y*y;let m,S,b,_,C;if(g<0){const k=-p/3,M=k*k*k,R=Gt(M),O=-x/(2*R),I=O<-1?-1:O>1?1:O,N=sd(I),H=ye(R),A=2*H;return b=A*$t(N/3)-h/3,_=A*$t((N+qe)/3)-h/3,C=A*$t((N+2*qe)/3)-h/3,[b,_,C].filter(o)}else{if(g===0)return m=v<0?ye(-v):-ye(v),b=2*m-h/3,_=-m-h/3,[b,_].filter(o);{const k=Gt(g);return m=ye(-v+k),S=ye(v+k),[m-S-h/3].filter(o)}}},droots:function(e){if(e.length===3){const n=e[0],r=e[1],i=e[2],o=n-2*r+i;if(o!==0){const a=-Gt(r*r-n*i),s=-n+r,l=-(a+s)/o,u=-(-a+s)/o;return[l,u]}else if(r!==i&&o===0)return[(2*r-i)/(2*(r-i))];return[]}if(e.length===2){const n=e[0],r=e[1];return n!==r?[n/(n-r)]:[]}return[]},curvature:function(e,n,r,i,o){let a,s,l,u,c=0,h=0;const f=z.compute(e,n),d=z.compute(e,r),p=f.x*f.x+f.y*f.y;if(i?(a=Gt(bt(f.y*d.z-d.y*f.z,2)+bt(f.z*d.x-d.z*f.x,2)+bt(f.x*d.y-d.x*f.y,2)),s=bt(p+f.z*f.z,3/2)):(a=f.x*d.y-f.y*d.x,s=bt(p,3/2)),a===0||s===0)return{k:0,r:0};if(c=a/s,h=s/a,!o){const y=z.curvature(e-.001,n,r,i,!0).k,x=z.curvature(e+.001,n,r,i,!0).k;u=(x-c+(c-y))/2,l=(pe(x-c)+pe(c-y))/2}return{k:c,r:h,dk:u,adk:l}},inflections:function(e){if(e.length<4)return[];const n=z.align(e,{p1:e[0],p2:e.slice(-1)[0]}),r=n[2].x*n[1].y,i=n[3].x*n[1].y,o=n[1].x*n[2].y,a=n[3].x*n[2].y,s=18*(-3*r+2*i+3*o-a),l=18*(3*r-i-3*o),u=18*(o-r);if(z.approximately(s,0)){if(!z.approximately(l,0)){let d=-u/l;if(0<=d&&d<=1)return[d]}return[]}const c=2*s;if(z.approximately(c,0))return[];const h=l*l-4*s*u;if(h<0)return[];const f=Math.sqrt(h);return[(f-l)/c,-(l+f)/c].filter(function(d){return 0<=d&&d<=1})},bboxoverlap:function(e,n){const r=["x","y"],i=r.length;for(let o=0,a,s,l,u;o<i;o++)if(a=r[o],s=e[a].mid,l=n[a].mid,u=(e[a].size+n[a].size)/2,pe(s-l)>=u)return!1;return!0},expandbox:function(e,n){n.x.min<e.x.min&&(e.x.min=n.x.min),n.y.min<e.y.min&&(e.y.min=n.y.min),n.z&&n.z.min<e.z.min&&(e.z.min=n.z.min),n.x.max>e.x.max&&(e.x.max=n.x.max),n.y.max>e.y.max&&(e.y.max=n.y.max),n.z&&n.z.max>e.z.max&&(e.z.max=n.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,n,r){const i=e.bbox(),o=n.bbox(),a=1e5,s=r||.5;if(i.x.size+i.y.size<s&&o.x.size+o.y.size<s)return[(a*(e._t1+e._t2)/2|0)/a+"/"+(a*(n._t1+n._t2)/2|0)/a];let l=e.split(.5),u=n.split(.5),c=[{left:l.left,right:u.left},{left:l.left,right:u.right},{left:l.right,right:u.right},{left:l.right,right:u.left}];c=c.filter(function(f){return z.bboxoverlap(f.left.bbox(),f.right.bbox())});let h=[];return c.length===0||(c.forEach(function(f){h=h.concat(z.pairiteration(f.left,f.right,s))}),h=h.filter(function(f,d){return h.indexOf(f)===d})),h},getccenter:function(e,n,r){const i=n.x-e.x,o=n.y-e.y,a=r.x-n.x,s=r.y-n.y,l=i*$t(Wt)-o*re(Wt),u=i*re(Wt)+o*$t(Wt),c=a*$t(Wt)-s*re(Wt),h=a*re(Wt)+s*$t(Wt),f=(e.x+n.x)/2,d=(e.y+n.y)/2,p=(n.x+r.x)/2,y=(n.y+r.y)/2,x=f+l,v=d+u,g=p+c,m=y+h,S=z.lli8(f,d,x,v,p,y,g,m),b=z.dist(S,e);let _=ge(e.y-S.y,e.x-S.x),C=ge(n.y-S.y,n.x-S.x),k=ge(r.y-S.y,r.x-S.x),M;return _<k?((_>C||C>k)&&(_+=qe),_>k&&(M=k,k=_,_=M)):k<C&&C<_?(M=k,k=_,_=M):k+=qe,S.s=_,S.e=k,S.r=b,S},numberSort:function(e,n){return e-n}};class Se{constructor(n){this.curves=[],this._3d=!1,n&&(this.curves=n,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return"["+this.curves.map(function(n){return z.pointsToString(n.points)}).join(", ")+"]"}addCurve(n){this.curves.push(n),this._3d=this._3d||n._3d}length(){return this.curves.map(function(n){return n.length()}).reduce(function(n,r){return n+r})}curve(n){return this.curves[n]}bbox(){const n=this.curves;for(var r=n[0].bbox(),i=1;i<n.length;i++)z.expandbox(r,n[i].bbox());return r}offset(n){const r=[];return this.curves.forEach(function(i){r.push(...i.offset(n))}),new Se(r)}}const{abs:_e,min:bi,max:wi,cos:cd,sin:fd,acos:hd,sqrt:ve}=Math,dd=Math.PI;class tt{constructor(n){let r=n&&n.forEach?n:Array.from(arguments).slice(),i=!1;if(typeof r[0]=="object"){i=r.length;const p=[];r.forEach(function(y){["x","y","z"].forEach(function(x){typeof y[x]<"u"&&p.push(y[x])})}),r=p}let o=!1;const a=r.length;if(i){if(i>4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");o=!0}}else if(a!==6&&a!==8&&a!==9&&a!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const s=this._3d=!o&&(a===9||a===12)||n&&n[0]&&typeof n[0].z<"u",l=this.points=[];for(let p=0,y=s?3:2;p<a;p+=y){var u={x:r[p],y:r[p+1]};s&&(u.z=r[p+2]),l.push(u)}const c=this.order=l.length-1,h=this.dims=["x","y"];s&&h.push("z"),this.dimlen=h.length;const f=z.align(l,{p1:l[0],p2:l[c]}),d=z.dist(l[0],l[c]);this._linear=f.reduce((p,y)=>p+_e(y.y),0)<d/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(n,r,i,o){if(typeof o>"u"&&(o=.5),o===0)return new tt(r,r,i);if(o===1)return new tt(n,r,r);const a=tt.getABC(2,n,r,i,o);return new tt(n,a.A,i)}static cubicFromPoints(n,r,i,o,a){typeof o>"u"&&(o=.5);const s=tt.getABC(3,n,r,i,o);typeof a>"u"&&(a=z.dist(r,s.C));const l=a*(1-o)/o,u=z.dist(n,i),c=(i.x-n.x)/u,h=(i.y-n.y)/u,f=a*c,d=a*h,p=l*c,y=l*h,x={x:r.x-f,y:r.y-d},v={x:r.x+p,y:r.y+y},g=s.A,m={x:g.x+(x.x-g.x)/(1-o),y:g.y+(x.y-g.y)/(1-o)},S={x:g.x+(v.x-g.x)/o,y:g.y+(v.y-g.y)/o},b={x:n.x+(m.x-n.x)/o,y:n.y+(m.y-n.y)/o},_={x:i.x+(S.x-i.x)/(1-o),y:i.y+(S.y-i.y)/(1-o)};return new tt(n,b,_,i)}static getUtils(){return z}getUtils(){return tt.getUtils()}static get PolyBezier(){return Se}valueOf(){return this.toString()}toString(){return z.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const n=this.points,r=n[0].x,i=n[0].y,o=["M",r,i,this.order===2?"Q":"C"];for(let a=1,s=n.length;a<s;a++)o.push(n[a].x),o.push(n[a].y);return o.join(" ")}setRatios(n){if(n.length!==this.points.length)throw new Error("incorrect number of ratio values");this.ratios=n,this._lut=[]}verify(){const n=this.coordDigest();n!==this._print&&(this._print=n,this.update())}coordDigest(){return this.points.map(function(n,r){return""+r+n.x+n.y+(n.z?n.z:0)}).join("")}update(){this._lut=[],this.dpoints=z.derive(this.points,this._3d),this.computedirection()}computedirection(){const n=this.points,r=z.angle(n[0],n[this.order],n[1]);this.clockwise=r>0}length(){return z.length(this.derivative.bind(this))}static getABC(n=2,r,i,o,a=.5){const s=z.projectionratio(a,n),l=1-s,u={x:s*r.x+l*o.x,y:s*r.y+l*o.y},c=z.abcratio(a,n);return{A:{x:i.x+(i.x-u.x)/c,y:i.y+(i.y-u.y)/c},B:i,C:u,S:r,E:o}}getABC(n,r){r=r||this.get(n);let i=this.points[0],o=this.points[this.order];return tt.getABC(this.order,i,r,o,n)}getLUT(n){if(this.verify(),n=n||100,this._lut.length===n+1)return this._lut;this._lut=[],n++,this._lut=[];for(let r=0,i,o;r<n;r++)o=r/(n-1),i=this.compute(o),i.t=o,this._lut.push(i);return this._lut}on(n,r){r=r||5;const i=this.getLUT(),o=[];for(let a=0,s,l=0;a<i.length;a++)s=i[a],z.dist(s,n)<r&&(o.push(s),l+=a/i.length);return o.length?t/=o.length:!1}project(n){const r=this.getLUT(),i=r.length-1,o=z.closest(r,n),a=o.mpos,s=(a-1)/i,l=(a+1)/i,u=.1/i;let c=o.mdist,h=s,f=h,d;c+=1;for(let p;h<l+u;h+=u)d=this.compute(h),p=z.dist(n,d),p<c&&(c=p,f=h);return f=f<0?0:f>1?1:f,d=this.compute(f),d.t=f,d.d=c,d}get(n){return this.compute(n)}point(n){return this.points[n]}compute(n){return this.ratios?z.computeWithRatios(n,this.points,this.ratios,this._3d):z.compute(n,this.points,this._3d,this.ratios)}raise(){const n=this.points,r=[n[0]],i=n.length;for(let o=1,a,s;o<i;o++)a=n[o],s=n[o-1],r[o]={x:(i-o)/i*a.x+o/i*s.x,y:(i-o)/i*a.y+o/i*s.y};return r[i]=n[i-1],new tt(r)}derivative(n){return z.compute(n,this.dpoints[0],this._3d)}dderivative(n){return z.compute(n,this.dpoints[1],this._3d)}align(){let n=this.points;return new tt(z.align(n,{p1:n[0],p2:n[n.length-1]}))}curvature(n){return z.curvature(n,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return z.inflections(this.points)}normal(n){return this._3d?this.__normal3(n):this.__normal2(n)}__normal2(n){const r=this.derivative(n),i=ve(r.x*r.x+r.y*r.y);return{t:n,x:-r.y/i,y:r.x/i}}__normal3(n){const r=this.derivative(n),i=this.derivative(n+.01),o=ve(r.x*r.x+r.y*r.y+r.z*r.z),a=ve(i.x*i.x+i.y*i.y+i.z*i.z);r.x/=o,r.y/=o,r.z/=o,i.x/=a,i.y/=a,i.z/=a;const s={x:i.y*r.z-i.z*r.y,y:i.z*r.x-i.x*r.z,z:i.x*r.y-i.y*r.x},l=ve(s.x*s.x+s.y*s.y+s.z*s.z);s.x/=l,s.y/=l,s.z/=l;const u=[s.x*s.x,s.x*s.y-s.z,s.x*s.z+s.y,s.x*s.y+s.z,s.y*s.y,s.y*s.z-s.x,s.x*s.z-s.y,s.y*s.z+s.x,s.z*s.z];return{t:n,x:u[0]*r.x+u[1]*r.y+u[2]*r.z,y:u[3]*r.x+u[4]*r.y+u[5]*r.z,z:u[6]*r.x+u[7]*r.y+u[8]*r.z}}hull(n){let r=this.points,i=[],o=[],a=0;for(o[a++]=r[0],o[a++]=r[1],o[a++]=r[2],this.order===3&&(o[a++]=r[3]);r.length>1;){i=[];for(let s=0,l,u=r.length-1;s<u;s++)l=z.lerp(n,r[s],r[s+1]),o[a++]=l,i.push(l);r=i}return o}split(n,r){if(n===0&&r)return this.split(r).left;if(r===1)return this.split(n).right;const i=this.hull(n),o={left:this.order===2?new tt([i[0],i[3],i[5]]):new tt([i[0],i[4],i[7],i[9]]),right:this.order===2?new tt([i[5],i[4],i[2]]):new tt([i[9],i[8],i[6],i[3]]),span:i};return o.left._t1=z.map(0,0,1,this._t1,this._t2),o.left._t2=z.map(n,0,1,this._t1,this._t2),o.right._t1=z.map(n,0,1,this._t1,this._t2),o.right._t2=z.map(1,0,1,this._t1,this._t2),r?(r=z.map(r,n,1,0,1),o.right.split(r).left):o}extrema(){const n={};let r=[];return this.dims.forEach((function(i){let o=function(s){return s[i]},a=this.dpoints[0].map(o);n[i]=z.droots(a),this.order===3&&(a=this.dpoints[1].map(o),n[i]=n[i].concat(z.droots(a))),n[i]=n[i].filter(function(s){return s>=0&&s<=1}),r=r.concat(n[i].sort(z.numberSort))}).bind(this)),n.values=r.sort(z.numberSort).filter(function(i,o){return r.indexOf(i)===o}),n}bbox(){const n=this.extrema(),r={};return this.dims.forEach((function(i){r[i]=z.getminmax(this,i,n[i])}).bind(this)),r}overlaps(n){const r=this.bbox(),i=n.bbox();return z.bboxoverlap(r,i)}offset(n,r){if(typeof r<"u"){const i=this.get(n),o=this.normal(n),a={c:i,n:o,x:i.x+o.x*r,y:i.y+o.y*r};return this._3d&&(a.z=i.z+o.z*r),a}if(this._linear){const i=this.normal(0),o=this.points.map(function(a){const s={x:a.x+n*i.x,y:a.y+n*i.y};return a.z&&i.z&&(s.z=a.z+n*i.z),s});return[new tt(o)]}return this.reduce().map(function(i){return i._linear?i.offset(n)[0]:i.scale(n)})}simple(){if(this.order===3){const o=z.angle(this.points[0],this.points[3],this.points[1]),a=z.angle(this.points[0],this.points[3],this.points[2]);if(o>0&&a<0||o<0&&a>0)return!1}const n=this.normal(0),r=this.normal(1);let i=n.x*r.x+n.y*r.y;return this._3d&&(i+=n.z*r.z),_e(hd(i))<dd/3}reduce(){let n,r=0,i=0,o=.01,a,s=[],l=[],u=this.extrema().values;for(u.indexOf(0)===-1&&(u=[0].concat(u)),u.indexOf(1)===-1&&u.push(1),r=u[0],n=1;n<u.length;n++)i=u[n],a=this.split(r,i),a._t1=r,a._t2=i,s.push(a),r=i;return s.forEach(function(c){for(r=0,i=0;i<=1;)for(i=r+o;i<=1+o;i+=o)if(a=c.split(r,i),!a.simple()){if(i-=o,_e(r-i)<o)return[];a=c.split(r,i),a._t1=z.map(r,0,1,c._t1,c._t2),a._t2=z.map(i,0,1,c._t1,c._t2),l.push(a),r=i;break}r<1&&(a=c.split(r,1),a._t1=z.map(r,0,1,c._t1,c._t2),a._t2=c._t2,l.push(a))}),l}translate(n,r,i){i=typeof i=="number"?i:r;const o=this.order;let a=this.points.map((s,l)=>(1-l/o)*r+l/o*i);return new tt(this.points.map((s,l)=>({x:s.x+n.x*a[l],y:s.y+n.y*a[l]})))}scale(n){const r=this.order;let i=!1;if(typeof n=="function"&&(i=n),i&&r===2)return this.raise().scale(i);const o=this.clockwise,a=this.points;if(this._linear)return this.translate(this.normal(0),i?i(0):n,i?i(1):n);const s=i?i(0):n,l=i?i(1):n,u=[this.offset(0,10),this.offset(1,10)],c=[],h=z.lli4(u[0],u[0].c,u[1],u[1].c);if(!h)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(f){const d=c[f*r]=z.copy(a[f*r]);d.x+=(f?l:s)*u[f].n.x,d.y+=(f?l:s)*u[f].n.y}),i?([0,1].forEach(function(f){if(!(r===2&&f)){var d=a[f+1],p={x:d.x-h.x,y:d.y-h.y},y=i?i((f+1)/r):n;i&&!o&&(y=-y);var x=ve(p.x*p.x+p.y*p.y);p.x/=x,p.y/=x,c[f+1]={x:d.x+y*p.x,y:d.y+y*p.y}}}),new tt(c)):([0,1].forEach(f=>{if(r===2&&f)return;const d=c[f*r],p=this.derivative(f),y={x:d.x+p.x,y:d.y+p.y};c[f+1]=z.lli4(d,y,h,a[f+1])}),new tt(c))}outline(n,r,i,o){if(r=r===void 0?n:r,this._linear){const _=this.normal(0),C=this.points[0],k=this.points[this.points.length-1];let M,R,O;i===void 0&&(i=n,o=r),M={x:C.x+_.x*n,y:C.y+_.y*n},O={x:k.x+_.x*i,y:k.y+_.y*i},R={x:(M.x+O.x)/2,y:(M.y+O.y)/2};const I=[M,R,O];M={x:C.x-_.x*r,y:C.y-_.y*r},O={x:k.x-_.x*o,y:k.y-_.y*o},R={x:(M.x+O.x)/2,y:(M.y+O.y)/2};const N=[O,R,M],H=z.makeline(N[2],I[0]),A=z.makeline(I[2],N[0]),j=[H,new tt(I),A,new tt(N)];return new Se(j)}const a=this.reduce(),s=a.length,l=[];let u=[],c,h=0,f=this.length();const d=typeof i<"u"&&typeof o<"u";function p(_,C,k,M,R){return function(O){const I=M/k,N=(M+R)/k,H=C-_;return z.map(O,0,1,_+I*H,_+N*H)}}a.forEach(function(_){const C=_.length();d?(l.push(_.scale(p(n,i,f,h,C))),u.push(_.scale(p(-r,-o,f,h,C)))):(l.push(_.scale(n)),u.push(_.scale(-r))),h+=C}),u=u.map(function(_){return c=_.points,c[3]?_.points=[c[3],c[2],c[1],c[0]]:_.points=[c[2],c[1],c[0]],_}).reverse();const y=l[0].points[0],x=l[s-1].points[l[s-1].points.length-1],v=u[s-1].points[u[s-1].points.length-1],g=u[0].points[0],m=z.makeline(v,y),S=z.makeline(x,g),b=[m].concat(l).concat([S]).concat(u);return new Se(b)}outlineshapes(n,r,i){r=r||n;const o=this.outline(n,r).curves,a=[];for(let s=1,l=o.length;s<l/2;s++){const u=z.makeshape(o[s],o[l-s],i);u.startcap.virtual=s>1,u.endcap.virtual=s<l/2-1,a.push(u)}return a}intersects(n,r){return n?n.p1&&n.p2?this.lineIntersects(n):(n instanceof tt&&(n=n.reduce()),this.curveintersects(this.reduce(),n,r)):this.selfintersects(r)}lineIntersects(n){const r=bi(n.p1.x,n.p2.x),i=bi(n.p1.y,n.p2.y),o=wi(n.p1.x,n.p2.x),a=wi(n.p1.y,n.p2.y);return z.roots(this.points,n).filter(s=>{var l=this.get(s);return z.between(l.x,r,o)&&z.between(l.y,i,a)})}selfintersects(n){const r=this.reduce(),i=r.length-2,o=[];for(let a=0,s,l,u;a<i;a++)l=r.slice(a,a+1),u=r.slice(a+2),s=this.curveintersects(l,u,n),o.push(...s);return o}curveintersects(n,r,i){const o=[];n.forEach(function(s){r.forEach(function(l){s.overlaps(l)&&o.push({left:s,right:l})})});let a=[];return o.forEach(function(s){const l=z.pairiteration(s.left,s.right,i);l.length>0&&(a=a.concat(l))}),a}arcs(n){return n=n||.5,this._iterate(n,[])}_error(n,r,i,o){const a=(o-i)/4,s=this.get(i+a),l=this.get(o-a),u=z.dist(n,r),c=z.dist(n,s),h=z.dist(n,l);return _e(c-u)+_e(h-u)}_iterate(n,r){let i=0,o=1,a;do{a=0,o=1;let s=this.get(i),l,u,c,h,f=!1,d=!1,p,y=o,x=1;do if(d=f,h=c,y=(i+o)/2,l=this.get(y),u=this.get(o),c=z.getccenter(s,l,u),c.interval={start:i,end:o},f=this._error(c,s,i,o)<=n,p=d&&!f,p||(x=o),f){if(o>=1){if(c.interval.end=x=1,h=c,o>1){let g={x:c.x+c.r*cd(c.e),y:c.y+c.r*fd(c.e)};c.e+=z.angle({x:c.x,y:c.y},g,this.get(1))}break}o=o+(o-i)/2}else o=y;while(!p&&a++<100);if(a>=100)break;h=h||c,r.push(h),i=x}while(o<1);return r}}function Zn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function pd(e){if(Array.isArray(e))return e}function gd(e){if(Array.isArray(e))return Zn(e)}function yd(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _d(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function vd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
20
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function md(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
21
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xd(e,n){if(e==null)return{};var r,i,o=bd(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],n.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function bd(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.includes(i))continue;r[i]=e[i]}return r}function wd(e,n){return pd(e)||_d(e,n)||$o(e,n)||vd()}function kd(e){return gd(e)||yd(e)||$o(e)||md()}function Sd(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Cd(e){var n=Sd(e,"string");return typeof n=="symbol"?n:n+""}function $o(e,n){if(e){if(typeof e=="string")return Zn(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zn(e,n):void 0}}var Ad=(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=(n instanceof Array?n.length?n:[void 0]:[n]).map(function(l){return{keyAccessor:l,isProp:!(l instanceof Function)}}),a=e.reduce(function(l,u){var c=l,h=u;return o.forEach(function(f,d){var p=f.keyAccessor,y=f.isProp,x;if(y){var v=h,g=v[p],m=xd(v,[p].map(Cd));x=g,h=m}else x=p(h,d);d+1<o.length?(c.hasOwnProperty(x)||(c[x]={}),c=c[x]):r?(c.hasOwnProperty(x)||(c[x]=[]),c[x].push(h)):c[x]=h}),l},{});r instanceof Function&&(function l(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;c===o.length?Object.keys(u).forEach(function(h){return u[h]=r(u[h])}):Object.values(u).forEach(function(h){return l(h,c+1)})})(a);var s=a;return i&&(s=[],(function l(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];c.length===o.length?s.push({keys:c,vals:u}):Object.entries(u).forEach(function(h){var f=wd(h,2),d=f[0],p=f[1];return l(p,[].concat(kd(c),[d]))})})(a),n instanceof Array&&n.length===0&&s.length===1&&(s[0].keys=[])),s});function Md(e,n){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(n).domain(e);break}return this}const ki=Symbol("implicit");function Fo(){var e=new Gr,n=[],r=[],i=ki;function o(a){let s=e.get(a);if(s===void 0){if(i!==ki)return i;e.set(a,s=n.push(a)-1)}return r[s%r.length]}return o.domain=function(a){if(!arguments.length)return n.slice();n=[],e=new Gr;for(const s of a)e.has(s)||e.set(s,n.push(s)-1);return o},o.range=function(a){return arguments.length?(r=Array.from(a),o):r.slice()},o.unknown=function(a){return arguments.length?(i=a,o):i},o.copy=function(){return Fo(n,r).unknown(i)},Md.apply(o,arguments),o}function Td(e){for(var n=e.length/6|0,r=new Array(n),i=0;i<n;)r[i]="#"+e.slice(i*6,++i*6);return r}const Pd=Td("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function Ed(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var Od=`.force-graph-container canvas {
22
+ display: block;
23
+ user-select: none;
24
+ outline: none;
25
+ -webkit-tap-highlight-color: transparent;
26
+ }
27
+
28
+ .force-graph-container .clickable {
29
+ cursor: pointer;
30
+ }
31
+
32
+ .force-graph-container .grabbable {
33
+ cursor: move;
34
+ cursor: grab;
35
+ cursor: -moz-grab;
36
+ cursor: -webkit-grab;
37
+ }
38
+
39
+ .force-graph-container .grabbable:active {
40
+ cursor: grabbing;
41
+ cursor: -moz-grabbing;
42
+ cursor: -webkit-grabbing;
43
+ }
44
+ `;Ed(Od);function Qn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function zd(e){if(Array.isArray(e))return e}function Rd(e){if(Array.isArray(e))return Qn(e)}function Si(e,n,r){if(Lo())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,n);var o=new(e.bind.apply(e,i));return o}function ze(e,n,r){return(n=Fd(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Lo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lo=function(){return!!e})()}function jd(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Id(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function Nd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
45
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dd(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
46
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ci(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function ie(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Ci(Object(r),!0).forEach(function(i){ze(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ci(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Ce(e,n){return zd(e)||Id(e,n)||Uo(e,n)||Nd()}function kt(e){return Rd(e)||jd(e)||Uo(e)||Dd()}function $d(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Fd(e){var n=$d(e,"string");return typeof n=="symbol"?n:n+""}function Jn(e){"@babel/helpers - typeof";return Jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Jn(e)}function Uo(e,n){if(e){if(typeof e=="string")return Qn(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Qn(e,n):void 0}}var Ld=Fo(Pd);function Ai(e,n,r){!n||typeof r!="string"||e.filter(function(i){return!i[r]}).forEach(function(i){i[r]=Ld(n(i))})}function Ud(e,n){var r=e.nodes,i=e.links,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.nodeFilter,s=a===void 0?function(){return!0}:a,l=o.onLoopError,u=l===void 0?function(p){throw"Invalid DAG structure! Found cycle in node path: ".concat(p.join(" -> "),".")}:l,c={};r.forEach(function(p){return c[n(p)]={data:p,out:[],depth:-1,skip:!s(p)}}),i.forEach(function(p){var y=p.source,x=p.target,v=b(y),g=b(x);if(!c.hasOwnProperty(v))throw"Missing source node with id: ".concat(v);if(!c.hasOwnProperty(g))throw"Missing target node with id: ".concat(g);var m=c[v],S=c[g];m.out.push(S);function b(_){return Jn(_)==="object"?n(_):_}});var h=[];d(Object.values(c));var f=Object.assign.apply(Object,[{}].concat(kt(Object.entries(c).filter(function(p){var y=Ce(p,2),x=y[1];return!x.skip}).map(function(p){var y=Ce(p,2),x=y[0],v=y[1];return ze({},x,v.depth)}))));return f;function d(p){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,v=function(){var b=p[g];if(y.indexOf(b)!==-1){var _=[].concat(kt(y.slice(y.indexOf(b))),[b]).map(function(C){return n(C.data)});return h.some(function(C){return C.length===_.length&&C.every(function(k,M){return k===_[M]})})||(h.push(_),u(_)),1}x>b.depth&&(b.depth=x,d(b.out,[].concat(kt(y),[b]),x+(b.skip?0:1)))},g=0,m=p.length;g<m;g++)v()}}var Hd=2,ct=function(n,r){return r.onNeedsRedraw&&r.onNeedsRedraw()},Mi=function(n,r){if(!r.isShadow){var i=Z(r.linkDirectionalParticles);r.graphData.links.forEach(function(o){var a=Math.round(Math.abs(i(o)));a?o.__photons=kt(Array(a)).map(function(){return{}}):delete o.__photons})}},cn=cr({props:{graphData:{default:{nodes:[],links:[]},onChange:function(n,r){r.engineRunning=!1,Mi(n,r)}},dagMode:{onChange:function(n,r){!n&&(r.graphData.nodes||[]).forEach(function(i){return i.fx=i.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(n){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:ct},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:ct},nodeColor:{default:"color",triggerUpdate:!1,onChange:ct},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:ct},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:ct},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:ct},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:ct},linkColor:{default:"color",triggerUpdate:!1,onChange:ct},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:ct},linkWidth:{default:1,triggerUpdate:!1,onChange:ct},linkCurvature:{default:0,triggerUpdate:!1,onChange:ct},linkCanvasObject:{triggerUpdate:!1,onChange:ct},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:ct},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:ct},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:ct},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:ct},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:Mi},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaDecay(n)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaTarget(n)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.velocityDecay(n)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(n,r,i){return i===void 0?n.forceLayout.force(r):(n.forceLayout.force(r,i),this)},d3ReheatSimulation:function(n){return n.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(n){return n.cntTicks=0,n.startTickTime=new Date,n.engineRunning=!0,this},isEngineRunning:function(n){return!!n.engineRunning},tickFrame:function(n){return!n.isShadow&&r(),o(),!n.isShadow&&a(),!n.isShadow&&s(),i(),this;function r(){n.engineRunning&&(++n.cntTicks>n.cooldownTicks||new Date-n.startTickTime>n.cooldownTime||n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin?(n.engineRunning=!1,n.onEngineStop()):(n.forceLayout.tick(),n.onEngineTick()))}function i(){var l=Z(n.nodeVisibility),u=Z(n.nodeVal),c=Z(n.nodeColor),h=Z(n.nodeCanvasObjectMode),f=n.ctx,d=n.isShadow/n.globalScale,p=n.graphData.nodes.filter(l);f.save(),p.forEach(function(y){var x=h(y);if(n.nodeCanvasObject&&(x==="before"||x==="replace")&&(n.nodeCanvasObject(y,f,n.globalScale),x==="replace")){f.restore();return}var v=Math.sqrt(Math.max(0,u(y)||1))*n.nodeRelSize+d;f.beginPath(),f.arc(y.x,y.y,v,0,2*Math.PI,!1),f.fillStyle=c(y)||"rgba(31, 120, 180, 0.92)",f.fill(),n.nodeCanvasObject&&x==="after"&&n.nodeCanvasObject(y,n.ctx,n.globalScale)}),f.restore()}function o(){var l=Z(n.linkVisibility),u=Z(n.linkColor),c=Z(n.linkWidth),h=Z(n.linkLineDash),f=Z(n.linkCurvature),d=Z(n.linkCanvasObjectMode),p=n.ctx,y=n.isShadow*2,x=n.graphData.links.filter(l);x.forEach(C);var v=[],g=[],m=x;if(n.linkCanvasObject){var S=[],b=[];x.forEach(function(k){return({before:v,after:g,replace:S}[d(k)]||b).push(k)}),m=[].concat(kt(v),g,b),v=v.concat(S)}p.save(),v.forEach(function(k){return n.linkCanvasObject(k,p,n.globalScale)}),p.restore();var _=Ad(m,[u,c,h]);p.save(),Object.entries(_).forEach(function(k){var M=Ce(k,2),R=M[0],O=M[1],I=!R||R==="undefined"?"rgba(0,0,0,0.15)":R;Object.entries(O).forEach(function(N){var H=Ce(N,2),A=H[0],j=H[1],P=(A||1)/n.globalScale+y;Object.entries(j).forEach(function(D){var q=Ce(D,2);q[0];var B=q[1],G=h(B[0]);p.beginPath(),B.forEach(function(Y){var W=Y.source,et=Y.target;if(!(!W||!et||!W.hasOwnProperty("x")||!et.hasOwnProperty("x"))){p.moveTo(W.x,W.y);var J=Y.__controlPoints;J?p[J.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(p,kt(J).concat([et.x,et.y])):p.lineTo(et.x,et.y)}}),p.strokeStyle=I,p.lineWidth=P,p.setLineDash(G||[]),p.stroke()})})}),p.restore(),p.save(),g.forEach(function(k){return n.linkCanvasObject(k,p,n.globalScale)}),p.restore();function C(k){var M=f(k);if(!M){k.__controlPoints=null;return}var R=k.source,O=k.target;if(!(!R||!O||!R.hasOwnProperty("x")||!O.hasOwnProperty("x"))){var I=Math.sqrt(Math.pow(O.x-R.x,2)+Math.pow(O.y-R.y,2));if(I>0){var N=Math.atan2(O.y-R.y,O.x-R.x),H=I*M,A={x:(R.x+O.x)/2+H*Math.cos(N-Math.PI/2),y:(R.y+O.y)/2+H*Math.sin(N-Math.PI/2)};k.__controlPoints=[A.x,A.y]}else{var j=M*70;k.__controlPoints=[O.x,O.y-j,O.x+j,O.y]}}}}function a(){var l=1.6,u=.2,c=Z(n.linkDirectionalArrowLength),h=Z(n.linkDirectionalArrowRelPos),f=Z(n.linkVisibility),d=Z(n.linkDirectionalArrowColor||n.linkColor),p=Z(n.nodeVal),y=n.ctx;y.save(),n.graphData.links.filter(f).forEach(function(x){var v=c(x);if(!(!v||v<0)){var g=x.source,m=x.target;if(!(!g||!m||!g.hasOwnProperty("x")||!m.hasOwnProperty("x"))){var S=Math.sqrt(Math.max(0,p(g)||1))*n.nodeRelSize,b=Math.sqrt(Math.max(0,p(m)||1))*n.nodeRelSize,_=Math.min(1,Math.max(0,h(x))),C=d(x)||"rgba(0,0,0,0.28)",k=v/l/2,M=x.__controlPoints&&Si(tt,[g.x,g.y].concat(kt(x.__controlPoints),[m.x,m.y])),R=M?function(P){return M.get(P)}:function(P){return{x:g.x+(m.x-g.x)*P||0,y:g.y+(m.y-g.y)*P||0}},O=M?M.length():Math.sqrt(Math.pow(m.x-g.x,2)+Math.pow(m.y-g.y,2)),I=S+v+(O-S-b-v)*_,N=R(I/O),H=R((I-v)/O),A=R((I-v*(1-u))/O),j=Math.atan2(N.y-H.y,N.x-H.x)-Math.PI/2;y.beginPath(),y.moveTo(N.x,N.y),y.lineTo(H.x+k*Math.cos(j),H.y+k*Math.sin(j)),y.lineTo(A.x,A.y),y.lineTo(H.x-k*Math.cos(j),H.y-k*Math.sin(j)),y.fillStyle=C,y.fill()}}}),y.restore()}function s(){var l=Z(n.linkDirectionalParticles),u=Z(n.linkDirectionalParticleSpeed),c=Z(n.linkDirectionalParticleOffset),h=Z(n.linkDirectionalParticleWidth),f=Z(n.linkVisibility),d=Z(n.linkDirectionalParticleColor||n.linkColor),p=n.ctx;p.save(),n.graphData.links.filter(f).forEach(function(y){var x=l(y);if(!(!y.hasOwnProperty("__photons")||!y.__photons.length)){var v=y.source,g=y.target;if(!(!v||!g||!v.hasOwnProperty("x")||!g.hasOwnProperty("x"))){var m=u(y),S=Math.abs(c(y)),b=y.__photons||[],_=Math.max(0,h(y)/2)/Math.sqrt(n.globalScale),C=d(y)||"rgba(0,0,0,0.28)";p.fillStyle=C;var k=y.__controlPoints?Si(tt,[v.x,v.y].concat(kt(y.__controlPoints),[g.x,g.y])):null,M=0,R=!1;b.forEach(function(O){var I=!!O.__singleHop;if(O.hasOwnProperty("__progressRatio")||(O.__progressRatio=I?0:(M+S)/x),!I&&M++,O.__progressRatio+=m,O.__progressRatio>=1)if(!I)O.__progressRatio=O.__progressRatio%1;else{R=!0;return}var N=O.__progressRatio,H=k?k.get(N):{x:v.x+(g.x-v.x)*N||0,y:v.y+(g.y-v.y)*N||0};n.linkDirectionalParticleCanvasObject?n.linkDirectionalParticleCanvasObject(H.x,H.y,y,p,n.globalScale):(p.beginPath(),p.arc(H.x,H.y,_,0,2*Math.PI,!1),p.fill())}),R&&(y.__photons=y.__photons.filter(function(O){return!O.__singleHop||O.__progressRatio<=1}))}}}),p.restore()}},emitParticle:function(n,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:id().force("link",Kh()).force("charge",od()).force("center",Qf()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(n,r){r.ctx=n},update:function(n,r){n.engineRunning=!1,n.onUpdate(),n.nodeAutoColorBy!==null&&Ai(n.graphData.nodes,Z(n.nodeAutoColorBy),n.nodeColor),n.linkAutoColorBy!==null&&Ai(n.graphData.links,Z(n.linkAutoColorBy),n.linkColor),n.graphData.links.forEach(function(d){d.source=d[n.linkSource],d.target=d[n.linkTarget]}),n.forceLayout.stop().alpha(1).nodes(n.graphData.nodes);var i=n.forceLayout.force("link");i&&i.id(function(d){return d[n.nodeId]}).links(n.graphData.links);var o=n.dagMode&&Ud(n.graphData,function(d){return d[n.nodeId]},{nodeFilter:n.dagNodeFilter,onLoopError:n.onDagError||void 0}),a=Math.max.apply(Math,kt(Object.values(o||[]))),s=n.dagLevelDistance||n.graphData.nodes.length/(a||1)*Hd*(["radialin","radialout"].indexOf(n.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var l=["lr","rl"].includes(r.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return delete d[l]})}if(["lr","rl","td","bu"].includes(n.dagMode)){var u=["rl","bu"].includes(n.dagMode),c=function(p){return(o[p[n.nodeId]]-a/2)*s*(u?-1:1)},h=["lr","rl"].includes(n.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return d[h]=c(d)})}n.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(n.dagMode)!==-1?ad(function(d){var p=o[d[n.nodeId]]||-1;return(n.dagMode==="radialin"?a-p:p)*s}).strength(function(d){return n.dagNodeFilter(d)?1:0}):null);for(var f=0;f<n.warmupTicks&&!(n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin);f++)n.forceLayout.tick();this.resetCountdown(),n.onFinishUpdate()}});function Ho(e,n){var r=e instanceof Array?e:[e],i=new n;return i._destructor&&i._destructor(),{linkProp:function(a){return{default:i[a](),onChange:function(l,u){r.forEach(function(c){return u[c][a](l)})},triggerUpdate:!1}},linkMethod:function(a){return function(s){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];var h=[];return r.forEach(function(f){var d=s[f],p=d[a].apply(d,u);p!==d&&h.push(p)}),h.length?h[0]:this}}}}var qd=800,Gd=4,Wd=5,qo=Ho("forceGraph",cn),Bd=Ho(["forceGraph","shadowGraph"],cn),Vd=Object.assign.apply(Object,kt(["nodeColor","nodeAutoColorBy","nodeCanvasObject","nodeCanvasObjectMode","linkColor","linkAutoColorBy","linkLineDash","linkWidth","linkCanvasObject","linkCanvasObjectMode","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleOffset","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleCanvasObject","dagMode","dagLevelDistance","dagNodeFilter","onDagError","d3AlphaMin","d3AlphaDecay","d3VelocityDecay","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map(function(e){return ze({},e,qo.linkProp(e))})).concat(kt(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(e){return ze({},e,Bd.linkProp(e))})))),Xd=Object.assign.apply(Object,kt(["d3Force","d3ReheatSimulation","emitParticle"].map(function(e){return ze({},e,qo.linkMethod(e))})));function An(e){if(e.canvas){var n=e.canvas.width,r=e.canvas.height;n===300&&r===150&&(n=r=0);var i=window.devicePixelRatio;n/=i,r/=i,[e.canvas,e.shadowCanvas].forEach(function(a){a.style.width="".concat(e.width,"px"),a.style.height="".concat(e.height,"px"),a.width=e.width*i,a.height=e.height*i,!n&&!r&&a.getContext("2d").scale(i,i)});var o=Pt(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-n)/2/o,(e.height-r)/2/o),e.needsRedraw=!0}}function Go(e){var n=window.devicePixelRatio;e.setTransform(n,0,0,n,0,0)}function Ti(e,n,r){e.save(),Go(e),e.clearRect(0,0,n,r),e.restore()}var Yd=cr({props:ie({width:{default:window.innerWidth,onChange:function(n,r){return An(r)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(n,r){return An(r)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(n,r){[n.nodes,n.links].every(function(o){return(o||[]).every(function(a){return!a.hasOwnProperty("__indexColor")})})&&r.colorTracker.reset(),[{type:"Node",objs:n.nodes},{type:"Link",objs:n.links}].forEach(i),r.forceGraph.graphData(n),r.shadowGraph.graphData(n);function i(o){var a=o.type,s=o.objs;s.filter(function(l){if(!l.hasOwnProperty("__indexColor"))return!0;var u=r.colorTracker.lookup(l.__indexColor);return!u||!u.hasOwnProperty("d")||u.d!==l}).forEach(function(l){l.__indexColor=r.colorTracker.register({type:a,d:l})})}},triggerUpdate:!1},backgroundColor:{onChange:function(n,r){r.canvas&&n&&(r.canvas.style.background=n)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(n,r){r.shadowGraph.nodeCanvasObject(n?function(i,o,a){return n(i,i.__indexColor,o,a)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(n,r){r.shadowGraph.linkCanvasObject(n?function(i,o,a){return n(i,i.__indexColor,o,a)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(n,r){r.zoom.scaleExtent([n,r.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(n,r){r.zoom.scaleExtent([r.zoom.scaleExtent()[0],n])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(n,r){r.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},showPointerCursor:{default:!0,triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1}},Vd),aliases:{stopAnimation:"pauseAnimation"},methods:ie({graph2ScreenCoords:function(n,r,i){var o=Pt(n.canvas);return{x:r*o.k+o.x,y:i*o.k+o.y}},screen2GraphCoords:function(n,r,i){var o=Pt(n.canvas);return{x:(r-o.x)/o.k,y:(i-o.y)/o.k}},centerAt:function(n,r,i,o){if(!n.canvas)return null;if(r!==void 0||i!==void 0){var a=Object.assign({},r!==void 0?{x:r}:{},i!==void 0?{y:i}:{});return o?n.tweenGroup.add(new Zr(s()).to(a,o).easing(Jt.Quadratic.Out).onUpdate(l).onComplete(function(){n.tweenGroup.remove(this)}).start()):l(a),this}return s();function s(){var u=Pt(n.canvas);return{x:(n.width/2-u.x)/u.k,y:(n.height/2-u.y)/u.k}}function l(u){var c=u.x,h=u.y;n.zoom.translateTo(n.zoom.__baseElem,c===void 0?s().x:c,h===void 0?s().y:h),n.needsRedraw=!0}},zoom:function(n,r,i){if(!n.canvas)return null;if(r!==void 0)return i?n.tweenGroup.add(new Zr({k:o()}).to({k:r},i).easing(Jt.Quadratic.Out).onUpdate(function(s){var l=s.k;return a(l)}).onComplete(function(){n.tweenGroup.remove(this)}).start()):a(r),this;return o();function o(){return Pt(n.canvas).k}function a(s){n.zoom.scaleTo(n.zoom.__baseElem,s),n.needsRedraw=!0}},zoomToFit:function(n){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,o=arguments.length,a=new Array(o>3?o-3:0),s=3;s<o;s++)a[s-3]=arguments[s];var l=this.getGraphBbox.apply(this,a);if(l){var u={x:(l.x[0]+l.x[1])/2,y:(l.y[0]+l.y[1])/2},c=Math.max(1e-12,Math.min(1e12,(n.width-i*2)/(l.x[1]-l.x[0]),(n.height-i*2)/(l.y[1]-l.y[0])));this.centerAt(u.x,u.y,r),this.zoom(c,r)}return this},getGraphBbox:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},i=Z(n.nodeVal),o=function(l){return Math.sqrt(Math.max(0,i(l)||1))*n.nodeRelSize},a=n.graphData.nodes.filter(r).map(function(s){return{x:s.x,y:s.y,r:o(s)}});return a.length?{x:[Vr(a,function(s){return s.x-s.r}),Br(a,function(s){return s.x+s.r})],y:[Vr(a,function(s){return s.y-s.r}),Br(a,function(s){return s.y+s.r})]}:null},pauseAnimation:function(n){return n.animationFrameRequestId&&(cancelAnimationFrame(n.animationFrameRequestId),n.animationFrameRequestId=null),this},resumeAnimation:function(n){return n.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},Xd),stateInit:function(){return{lastSetZoom:1,zoom:ic(),forceGraph:new cn,shadowGraph:new cn().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new Pf,tweenGroup:new ho}},init:function(n,r){var i=this;n.innerHTML="";var o=document.createElement("div");o.classList.add("force-graph-container"),o.style.position="relative",n.appendChild(o),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),o.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");var a=r.canvas.getContext("2d"),s=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),l={x:-1e12,y:-1e12},u=function(){var f=null,d=window.devicePixelRatio,p=l.x>0&&l.y>0?s.getImageData(l.x*d,l.y*d,1,1):null;return p&&(f=r.colorTracker.lookup(p.data)),f};wt(r.canvas).call(pl().subject(function(){if(!r.enableNodeDrag)return null;var h=u();return h&&h.type==="Node"?h.d:null}).on("start",function(h){var f=h.subject;f.__initialDragPos={x:f.x,y:f.y,fx:f.fx,fy:f.fy},h.active||(f.fx=f.x,f.fy=f.y),r.canvas.classList.add("grabbable")}).on("drag",function(h){var f=h.subject,d=f.__initialDragPos,p=h,y=Pt(r.canvas).k,x={x:d.x+(p.x-d.x)/y-f.x,y:d.y+(p.y-d.y)/y-f.y};["x","y"].forEach(function(v){return f["f".concat(v)]=f[v]=d[v]+(p[v]-d[v])/y}),!(!f.__dragged&&Wd>=Math.sqrt(lc(["x","y"].map(function(v){return Math.pow(h[v]-d[v],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,f.__dragged=!0,r.onNodeDrag(f,x))}).on("end",function(h){var f=h.subject,d=f.__initialDragPos,p={x:f.x-d.x,y:f.y-d.y};d.fx===void 0&&(f.fx=void 0),d.fy===void 0&&(f.fy=void 0),delete f.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,f.__dragged&&(delete f.__dragged,r.onNodeDragEnd(f,p))})),r.zoom(r.zoom.__baseElem=wt(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(h){return!h.button&&r.enableZoomPanInteraction&&(h.type!=="wheel"||Z(r.enableZoomInteraction)(h))&&(h.type==="wheel"||Z(r.enablePanInteraction)(h))}).on("zoom",function(h){var f=h.transform;[a,s].forEach(function(d){Go(d),d.translate(f.x,f.y),d.scale(f.k,f.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(ie(ie({},f),i.centerAt())),r.needsRedraw=!0}).on("end",function(h){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(ie(ie({},h.transform),i.centerAt()))}),An(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){Pt(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=Gd/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new Zf(o),["pointermove","pointerdown"].forEach(function(h){return o.addEventListener(h,function(f){h==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=f),!r.isPointerDragging&&f.type==="pointermove"&&r.onBackgroundClick&&(f.pressure>0||r.isPointerPressed)&&(f.pointerType==="mouse"||f.movementX===void 0||[f.movementX,f.movementY].some(function(y){return Math.abs(y)>1}))&&(r.isPointerDragging=!0);var d=p(o);l.x=f.pageX-d.left,l.y=f.pageY-d.top;function p(y){var x=y.getBoundingClientRect(),v=window.pageXOffset||document.documentElement.scrollLeft,g=window.pageYOffset||document.documentElement.scrollTop;return{top:x.top+g,left:x.left+v}}},{passive:!0})}),o.addEventListener("pointerup",function(h){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var f=[h,r.pointerDownEvent];requestAnimationFrame(function(){if(h.button===0)if(r.hoverObj){var d=r["on".concat(r.hoverObj.type,"Click")];d&&d.apply(void 0,[r.hoverObj.d].concat(f))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,f);if(h.button===2)if(r.hoverObj){var p=r["on".concat(r.hoverObj.type,"RightClick")];p&&p.apply(void 0,[r.hoverObj.d].concat(f))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,f)})}},{passive:!0}),o.addEventListener("contextmenu",function(h){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(h.preventDefault(),!1)}),r.forceGraph(a),r.shadowGraph(s);var c=Ic(function(){Ti(s,r.width,r.height),r.shadowGraph.linkWidth(function(f){return Z(r.linkWidth)(f)+r.linkHoverPrecision});var h=Pt(r.canvas);r.shadowGraph.globalScale(h.k).tickFrame()},qd);r.flushShadowCanvas=c.flush,(this._animationCycle=function h(){var f=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(S){return S.__photons&&S.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var d=r.isPointerDragging?null:u();if(d!==r.hoverObj){var p=r.hoverObj,y=p?p.type:null,x=d?d.type:null;if(y&&y!==x){var v=r["on".concat(y,"Hover")];v&&v(null,p.d)}if(x){var g=r["on".concat(x,"Hover")];g&&g(d.d,y===x?p.d:null)}r.tooltip.content(d&&Z(r["".concat(d.type.toLowerCase(),"Label")])(d.d)||null),r.canvas.classList[(d&&r["on".concat(x,"Click")]||!d&&r.onBackgroundClick)&&Z(r.showPointerCursor)(d?.d)?"add":"remove"]("clickable"),r.hoverObj=d}f&&c()}if(f){Ti(a,r.width,r.height);var m=Pt(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(a,m),r.forceGraph.globalScale(m).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(a,m)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(h)})()},update:function(n){}}),Mn={exports:{}},Tn,Pi;function Kd(){if(Pi)return Tn;Pi=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Tn=e,Tn}var Pn,Ei;function Zd(){if(Ei)return Pn;Ei=1;var e=Kd();function n(){}function r(){}return r.resetWarningCache=n,Pn=function(){function i(s,l,u,c,h,f){if(f!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}i.isRequired=i;function o(){return i}var a={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:n};return a.PropTypes=a,a},Pn}var Oi;function Qd(){return Oi||(Oi=1,Mn.exports=Zd()()),Mn.exports}var Jd=Qd();const w=ta(Jd),_n={width:w.number,height:w.number,graphData:w.shape({nodes:w.arrayOf(w.object).isRequired,links:w.arrayOf(w.object).isRequired}),backgroundColor:w.string,nodeRelSize:w.number,nodeId:w.string,nodeLabel:w.oneOfType([w.string,w.func]),nodeVal:w.oneOfType([w.number,w.string,w.func]),nodeVisibility:w.oneOfType([w.bool,w.string,w.func]),nodeColor:w.oneOfType([w.string,w.func]),nodeAutoColorBy:w.oneOfType([w.string,w.func]),onNodeHover:w.func,onNodeClick:w.func,linkSource:w.string,linkTarget:w.string,linkLabel:w.oneOfType([w.string,w.func]),linkVisibility:w.oneOfType([w.bool,w.string,w.func]),linkColor:w.oneOfType([w.string,w.func]),linkAutoColorBy:w.oneOfType([w.string,w.func]),linkWidth:w.oneOfType([w.number,w.string,w.func]),linkCurvature:w.oneOfType([w.number,w.string,w.func]),linkDirectionalArrowLength:w.oneOfType([w.number,w.string,w.func]),linkDirectionalArrowColor:w.oneOfType([w.string,w.func]),linkDirectionalArrowRelPos:w.oneOfType([w.number,w.string,w.func]),linkDirectionalParticles:w.oneOfType([w.number,w.string,w.func]),linkDirectionalParticleSpeed:w.oneOfType([w.number,w.string,w.func]),linkDirectionalParticleOffset:w.oneOfType([w.number,w.string,w.func]),linkDirectionalParticleWidth:w.oneOfType([w.number,w.string,w.func]),linkDirectionalParticleColor:w.oneOfType([w.string,w.func]),onLinkHover:w.func,onLinkClick:w.func,dagMode:w.oneOf(["td","bu","lr","rl","zin","zout","radialin","radialout"]),dagLevelDistance:w.number,dagNodeFilter:w.func,onDagError:w.func,d3AlphaMin:w.number,d3AlphaDecay:w.number,d3VelocityDecay:w.number,warmupTicks:w.number,cooldownTicks:w.number,cooldownTime:w.number,onEngineTick:w.func,onEngineStop:w.func,getGraphBbox:w.func},Wo={zoomToFit:w.func,onNodeRightClick:w.func,onNodeDrag:w.func,onNodeDragEnd:w.func,onLinkRightClick:w.func,linkHoverPrecision:w.number,onBackgroundClick:w.func,onBackgroundRightClick:w.func,showPointerCursor:w.oneOfType([w.bool,w.func]),enablePointerInteraction:w.bool,enableNodeDrag:w.bool},vr={showNavInfo:w.bool,nodeOpacity:w.number,nodeResolution:w.number,nodeThreeObject:w.oneOfType([w.object,w.string,w.func]),nodeThreeObjectExtend:w.oneOfType([w.bool,w.string,w.func]),nodePositionUpdate:w.func,linkOpacity:w.number,linkResolution:w.number,linkCurveRotation:w.oneOfType([w.number,w.string,w.func]),linkMaterial:w.oneOfType([w.object,w.string,w.func]),linkThreeObject:w.oneOfType([w.object,w.string,w.func]),linkThreeObjectExtend:w.oneOfType([w.bool,w.string,w.func]),linkPositionUpdate:w.func,linkDirectionalArrowResolution:w.number,linkDirectionalParticleResolution:w.number,linkDirectionalParticleThreeObject:w.oneOfType([w.object,w.string,w.func]),forceEngine:w.oneOf(["d3","ngraph"]),ngraphPhysics:w.object,numDimensions:w.oneOf([1,2,3])},tp=Object.assign({},_n,Wo,{linkLineDash:w.oneOfType([w.arrayOf(w.number),w.string,w.func]),nodeCanvasObjectMode:w.oneOfType([w.string,w.func]),nodeCanvasObject:w.func,nodePointerAreaPaint:w.func,linkCanvasObjectMode:w.oneOfType([w.string,w.func]),linkCanvasObject:w.func,linkPointerAreaPaint:w.func,linkDirectionalParticleCanvasObject:w.func,autoPauseRedraw:w.bool,minZoom:w.number,maxZoom:w.number,enableZoomInteraction:w.oneOfType([w.bool,w.func]),enablePanInteraction:w.oneOfType([w.bool,w.func]),onZoom:w.func,onZoomEnd:w.func,onRenderFramePre:w.func,onRenderFramePost:w.func});Object.assign({},_n,Wo,vr,{enableNavigationControls:w.bool,controlType:w.oneOf(["trackball","orbit","fly"]),rendererConfig:w.object,extraRenderers:w.arrayOf(w.shape({render:w.func.isRequired}))});Object.assign({},_n,vr,{nodeDesc:w.oneOfType([w.string,w.func]),linkDesc:w.oneOfType([w.string,w.func])});Object.assign({},_n,vr,{markerAttrs:w.object,yOffset:w.number,glScale:w.number});const mr=Aa(Yd,{methodNames:["emitParticle","d3Force","d3ReheatSimulation","stopAnimation","pauseAnimation","resumeAnimation","centerAt","zoom","zoomToFit","getGraphBbox","screen2GraphCoords","graph2ScreenCoords"]});mr.displayName="ForceGraph2D";mr.propTypes=tp;function ep({node:e,relations:n,allNodes:r,onClose:i,onNavigate:o}){const a=ee(),s=new Map(r.map(h=>[h.id,h])),l=n.filter(h=>h.sourceFile===e.id),u=n.filter(h=>h.targetFile===e.id),c={typescript:"#3178c6",python:"#f7d854",markdown:"#44b78b",yaml:"#888",json:"#a0a0a0"};return T.jsxs("div",{style:{width:340,borderLeft:`1px solid ${a.border}`,background:a.surface,overflow:"auto",padding:16,flexShrink:0},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[T.jsxs("div",{children:[T.jsx("div",{style:{fontSize:14,fontWeight:600,color:a.textPrimary,wordBreak:"break-all"},children:e.path.split("/").pop()}),T.jsx("div",{style:{fontSize:11,color:a.textSecondary,marginTop:2},children:e.path})]}),T.jsx("button",{onClick:i,style:{background:"none",border:"none",cursor:"pointer",color:a.textSecondary,padding:4},children:T.jsx(ia,{size:16})})]}),T.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16,flexWrap:"wrap"},children:[T.jsx("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:4,background:`${c[e.language]??"#666"}20`,color:c[e.language]??"#666",fontWeight:500},children:e.language}),T.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:4,background:"#FE500010",color:a.textSecondary},children:[e.tokens.toLocaleString()," tokens"]}),T.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:4,background:"#FE500010",color:a.textSecondary},children:[e.symbols.length," symbols"]})]}),e.symbols.length>0&&T.jsxs(En,{title:`Symbols (${e.symbols.length})`,children:[e.symbols.slice(0,30).map((h,f)=>T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 0"},children:[T.jsx("span",{style:{fontSize:10,fontFamily:"monospace",padding:"1px 4px",borderRadius:3,background:`${a.border}80`,color:a.textSecondary,minWidth:50,textAlign:"center"},children:h.kind}),T.jsx("span",{style:{fontSize:12,color:h.isExported?a.textPrimary:a.textSecondary,fontWeight:h.isExported?500:400},children:h.name}),h.isExported&&T.jsx("span",{style:{fontSize:9,color:"#10b981"},children:"exported"})]},f)),e.symbols.length>30&&T.jsxs("div",{style:{fontSize:11,color:a.textSecondary,marginTop:4},children:["+",e.symbols.length-30," more"]})]}),l.length>0&&T.jsx(En,{title:`Depends on (${l.length})`,children:l.map((h,f)=>{const d=s.get(h.targetFile);return T.jsx(zi,{label:d?.path??h.targetFile,kind:h.kind,weight:h.weight,symbol:h.targetSymbol,onClick:()=>d&&o(d.id),textColor:a.textPrimary,dimColor:a.textSecondary,borderColor:a.border},f)})}),u.length>0&&T.jsx(En,{title:`Depended on by (${u.length})`,children:u.map((h,f)=>{const d=s.get(h.sourceFile);return T.jsx(zi,{label:d?.path??h.sourceFile,kind:h.kind,weight:h.weight,symbol:h.sourceSymbol,onClick:()=>d&&o(d.id),textColor:a.textPrimary,dimColor:a.textSecondary,borderColor:a.border},f)})})]})}function En({title:e,children:n}){const r=ee();return T.jsxs("div",{style:{marginBottom:16},children:[T.jsx("div",{style:{fontSize:12,fontWeight:600,color:r.textPrimary,marginBottom:8,paddingBottom:4,borderBottom:`1px solid ${r.border}`},children:e}),n]})}function zi({label:e,kind:n,weight:r,symbol:i,onClick:o,textColor:a,dimColor:s,borderColor:l}){return T.jsxs("div",{onClick:o,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 6px",borderRadius:4,cursor:"pointer",marginBottom:2},onMouseEnter:u=>{u.currentTarget.style.background=`${l}40`},onMouseLeave:u=>{u.currentTarget.style.background="transparent"},children:[T.jsx("span",{style:{fontSize:10,fontFamily:"monospace",padding:"1px 4px",borderRadius:3,background:`${l}80`,color:s,minWidth:55,textAlign:"center",whiteSpace:"nowrap"},children:n}),T.jsxs("span",{style:{fontSize:12,color:a,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.split("/").pop(),i&&T.jsxs("span",{style:{color:s},children:[" · ",i]})]}),T.jsxs("span",{style:{fontSize:10,color:s},children:[(r*100).toFixed(0),"%"]})]})}const On={typescript:"#3178c6",python:"#f7d854",markdown:"#44b78b",yaml:"#888888",json:"#a0a0a0",unknown:"#666666"},np={imports:"#3178c6",calls:"#f59e0b",extends:"#8b5cf6",implements:"#8b5cf6",uses_type:"#6366f1",tested_by:"#10b981",tests:"#10b981",links_to:"#44b78b",references:"#94a3b8",continues:"#64748b",supersedes:"#ef4444",depends_on:"#f97316",defined_in:"#06b6d4",documents:"#84cc16",configured_by:"#a1a1aa",related:"#d4d4d8"},zn={Code:["imports","calls","extends","implements","uses_type"],Tests:["tested_by","tests"],Markdown:["links_to","references","continues","supersedes","depends_on","defined_in"],"Cross-type":["documents","configured_by","related"]};function Ge(e){const n=e.split("/");return n.length<=2?n[0]||e:n.slice(0,2).join("/")}function Kt(e){return typeof e=="object"?e.id:e}function rp(e,n,r){const i=new Map;for(const u of r){const c=Kt(u.source),h=Kt(u.target);i.has(c)||i.set(c,[]),i.has(h)||i.set(h,[]),i.get(c).push(h),i.get(h).push(c)}const o=new Map;o.set(e,null);const a=[e];t:for(;a.length>0;){const u=a.shift();for(const c of i.get(u)??[])if(!o.has(c)){if(o.set(c,u),c===n)break t;a.push(c)}}const s=new Set;if(!o.has(n))return s;let l=n;for(;l!==null;){s.add(l);const u=o.get(l);l=u===void 0?null:u}return s}function ip({nodes:e,relations:n,onScan:r,scanning:i,highlightIds:o}){const a=ee(),s=L.useRef(null),l=L.useRef(null),[u,c]=L.useState(null),[h,f]=L.useState(null),[d,p]=L.useState(""),[y,x]=L.useState(new Set(Object.keys(zn))),[v,g]=L.useState({width:600,height:400}),[m,S]=L.useState(-1),[b,_]=L.useState(!1),[C,k]=L.useState(null),[M,R]=L.useState(null),[O,I]=L.useState(null),[N,H]=L.useState(new Set),[A,j]=L.useState(""),P=L.useRef(null),{lastQueryResult:D,query:q,querying:B}=xt(),G=L.useRef(null);L.useEffect(()=>{if(!l.current)return;const E=new ResizeObserver($=>{const{width:X,height:V}=$[0].contentRect;g({width:Math.max(300,X),height:Math.max(200,V)})});return E.observe(l.current),()=>E.disconnect()},[]),L.useEffect(()=>{if(!C)return;const E=()=>k(null);return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[C]),L.useEffect(()=>()=>{P.current&&clearTimeout(P.current),G.current&&clearTimeout(G.current)},[]);const Y=L.useMemo(()=>{const E=new Set;for(const[$,X]of Object.entries(zn))if(y.has($))for(const V of X)E.add(V);return E},[y]),W=L.useMemo(()=>{const E=new Map(e.map(U=>[U.id,U])),$=d.toLowerCase(),X=d?e.filter(U=>U.path.toLowerCase().includes($)||U.symbols.some(st=>st.name.toLowerCase().includes($))):e,V=new Set(X.map(U=>U.id)),it=new Set(V);for(const U of n)Y.has(U.kind)&&(V.has(U.sourceFile)&&it.add(U.targetFile),V.has(U.targetFile)&&it.add(U.sourceFile));let K=[];for(const U of it){const st=E.get(U);st&&K.push({id:st.id,path:st.path,language:st.language,tokens:st.tokens,symbolCount:st.symbols.length,val:Math.max(2,Math.log2(st.tokens+1)),color:On[st.language]??On.unknown})}if(M){const U=new Set([M]);for(const st of n)Y.has(st.kind)&&(st.sourceFile===M&&U.add(st.targetFile),st.targetFile===M&&U.add(st.sourceFile));K=K.filter(st=>U.has(st.id))}const ot=new Set(K.map(U=>U.id)),at=n.filter(U=>Y.has(U.kind)&&ot.has(U.sourceFile)&&ot.has(U.targetFile)).map(U=>({source:U.sourceFile,target:U.targetFile,kind:U.kind,weight:U.weight,color:np[U.kind]??"#888"}));return{nodes:K,links:at}},[e,n,d,Y,M]),et=L.useMemo(()=>{if(!A.trim()||!D)return null;const E=new Map;for(const $ of D.items)E.set($.path,$.depth);return E},[A,D]),J=L.useMemo(()=>!A.trim()||!D?null:new Set(D.entryPoints.map(E=>E.fileId)),[A,D]);L.useEffect(()=>{const E=()=>{s.current&&s.current.d3Force("cluster",X=>{const V=W.nodes,it=new Map;for(const K of V){if(K.x==null)continue;const ot=Ge(K.path),at=it.get(ot)??{x:0,y:0,count:0};at.x+=K.x,at.y+=K.y,at.count++,it.set(ot,at)}for(const K of it.values())K.x/=K.count,K.y/=K.count;for(const K of V){if(K.x==null)continue;const ot=it.get(Ge(K.path));!ot||ot.count<=1||(K.vx=(K.vx??0)+(ot.x-K.x)*.03*X,K.vy=(K.vy??0)+(ot.y-K.y)*.03*X)}})};E();const $=setTimeout(E,0);return()=>clearTimeout($)},[W.nodes]);const ut=m>=0&&m<W.nodes.length?W.nodes[m]:null,vt=u?e.find(E=>E.id===u):null,gt=u?n.filter(E=>E.sourceFile===u||E.targetFile===u):[],St=W.nodes.length<=500,ce=L.useCallback(E=>{const $=E;if(O){H(rp(O.sourceId,$.id,W.links)),I(null);return}c($.id)},[O,W.links]),xr=L.useRef(null),Bo=L.useCallback(E=>{xr.current=E?.id??null,!G.current&&(G.current=setTimeout(()=>{G.current=null,f(xr.current)},50))},[]),Vo=L.useCallback((E,$)=>{$.preventDefault();const X=E,V=l.current?.getBoundingClientRect();V&&k({node:X,x:$.clientX-V.left,y:$.clientY-V.top})},[]),Xo=L.useCallback(E=>{const $=W.nodes;if(E.key==="Tab"){if(E.preventDefault(),!$.length)return;S(X=>E.shiftKey?X<=0?$.length-1:X-1:X>=$.length-1?0:X+1)}else if(E.key==="Enter")m>=0&&m<$.length&&c($[m].id);else if(E.key==="Escape")c(null),k(null),I(null),H(new Set),_(!1);else if(["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"].includes(E.key)){if(!u)return;const X=W.links.filter(U=>Kt(U.source)===u||Kt(U.target)===u).map(U=>Kt(U.source)===u?Kt(U.target):Kt(U.source));if(!X.length)return;const V=ut?.id,it=V?X.indexOf(V):-1,K=E.key==="ArrowRight"||E.key==="ArrowDown"?1:-1,ot=X[(it+K+X.length)%X.length],at=$.findIndex(U=>U.id===ot);at>=0&&S(at)}else E.key==="?"&&_(X=>!X)},[W.nodes,W.links,m,ut,u]),Yo=L.useCallback(E=>{j(E),P.current&&clearTimeout(P.current),E.trim()&&(P.current=setTimeout(()=>q(E),300))},[q]),Ko=L.useCallback(E=>{x($=>{const X=new Set($);return X.has(E)?X.delete(E):X.add(E),X})},[]),Zo=L.useCallback((E,$)=>{const X=W.nodes,V=new Map;for(const it of X){if(it.x==null)continue;const K=Ge(it.path),ot=V.get(K)??{sx:0,sy:0,count:0};ot.sx+=it.x,ot.sy+=it.y,ot.count++,V.set(K,ot)}for(const[it,K]of V){if(K.count<2)continue;const ot=K.sx/K.count,at=K.sy/K.count;let U=20;for(const Xt of X)Xt.x==null||Ge(Xt.path)!==it||(U=Math.max(U,Math.hypot(Xt.x-ot,Xt.y-at)));const st=U+20;if(E.beginPath(),E.arc(ot,at,st,0,2*Math.PI),E.fillStyle=a.isDark?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.04)",E.fill(),E.strokeStyle=a.isDark?"rgba(255,255,255,0.07)":"rgba(0,0,0,0.08)",E.lineWidth=1/$,E.stroke(),$<.8){const Xt=Math.min(14,11/$);E.font=`${Xt}px Inter, sans-serif`,E.textAlign="center",E.textBaseline="middle",E.fillStyle=a.isDark?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.2)",E.fillText(it,ot,at-st+Xt)}}},[W.nodes,a]),Qo=L.useCallback((E,$,X)=>{const V=E,it=V.val,K=X>.3,ot=Math.max(10,12/X);let at;if(et){const U=et.get(V.path);U==null?at="rgba(120,120,120,0.2)":U===0?at="#10b981":U<=2?at="#f59e0b":at="rgba(239,68,68,0.6)"}else N.size>0&&N.has(V.id)?at="#f59e0b":o?.has(V.id)||V.id===u?at="#FE5000":V.id===h?at="#FFaa40":at=V.color;if(ut?.id===V.id&&($.beginPath(),$.arc(V.x,V.y,it+3/X,0,2*Math.PI),$.strokeStyle="#60a5fa",$.lineWidth=2/X,$.stroke()),J?.has(V.id)&&($.shadowColor="#10b981",$.shadowBlur=8/X),J?.has(V.id)){const U=it*1.4;$.beginPath(),$.moveTo(V.x,V.y-U),$.lineTo(V.x+U,V.y),$.lineTo(V.x,V.y+U),$.lineTo(V.x-U,V.y),$.closePath()}else $.beginPath(),$.arc(V.x,V.y,it,0,2*Math.PI);if($.fillStyle=at,$.fill(),$.shadowBlur=0,K){const U=V.path.split("/").pop()??"";$.font=`${ot}px Inter, sans-serif`,$.textAlign="center",$.textBaseline="top",$.fillStyle=a.textPrimary,$.fillText(U,V.x,V.y+it+2)}},[et,J,N,o,u,h,ut,a]);return T.jsxs("div",{style:{display:"flex",height:"100%",gap:0},children:[T.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"8px 12px",borderBottom:`1px solid ${a.border}`,flexWrap:"wrap"},children:[T.jsxs("span",{style:{fontSize:12,color:a.textSecondary},children:[W.nodes.length," files · ",W.links.length," relations"]}),T.jsx("input",{type:"text",placeholder:B?"Querying...":"Simulate query...",value:A,onChange:E=>Yo(E.target.value),style:{padding:"4px 8px",fontSize:12,borderRadius:4,border:`1px solid ${A?"#10b981":a.border}`,background:a.surface,color:a.textPrimary,width:160,outline:"none"}}),T.jsx("input",{type:"text",placeholder:"Search symbols...",value:d,onChange:E=>p(E.target.value),style:{padding:"4px 8px",fontSize:12,borderRadius:4,border:`1px solid ${a.border}`,background:a.surface,color:a.textPrimary,width:160,outline:"none"}}),Object.keys(zn).map(E=>T.jsx("button",{onClick:()=>Ko(E),style:{fontSize:11,padding:"3px 8px",borderRadius:4,cursor:"pointer",background:y.has(E)?"#FE500020":"transparent",color:y.has(E)?"#FE5000":a.textSecondary,border:`1px solid ${y.has(E)?"#FE500040":a.border}`},children:E},E)),T.jsx("button",{onClick:()=>_(E=>!E),title:"Keyboard shortcuts",style:{fontSize:11,padding:"3px 7px",borderRadius:4,cursor:"pointer",background:b?"#60a5fa20":"transparent",color:b?"#60a5fa":a.textSecondary,border:`1px solid ${b?"#60a5fa40":a.border}`},children:"?"}),r&&T.jsx("button",{onClick:r,disabled:i,style:{marginLeft:"auto",fontSize:11,padding:"3px 10px",borderRadius:4,cursor:i?"default":"pointer",background:"#FE5000",color:"#fff",border:"none",opacity:i?.6:1},children:i?"Scanning...":"Re-index"})]}),M&&T.jsxs("div",{style:{padding:"4px 12px",fontSize:12,display:"flex",alignItems:"center",gap:8,background:"#FE500015",borderBottom:"1px solid #FE500040"},children:[T.jsx("span",{style:{color:"#FE5000"},children:"Showing neighbors only"}),T.jsx("button",{onClick:()=>R(null),style:{fontSize:11,color:"#FE5000",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear"})]}),O&&T.jsxs("div",{style:{padding:"4px 12px",fontSize:12,display:"flex",alignItems:"center",gap:8,background:"#f59e0b15",borderBottom:"1px solid #f59e0b40"},children:[T.jsx("span",{style:{color:"#f59e0b"},children:"Click a node to highlight the shortest path"}),T.jsx("button",{onClick:()=>I(null),style:{fontSize:11,color:"#f59e0b",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Cancel"})]}),T.jsxs("div",{ref:l,style:{flex:1,position:"relative",outline:"none",cursor:O?"crosshair":"default"},tabIndex:0,onKeyDown:Xo,children:[b&&T.jsxs("div",{onMouseDown:E=>E.stopPropagation(),style:{position:"absolute",top:8,right:8,zIndex:200,background:"#1e1e2e",border:`1px solid ${a.border}`,borderRadius:8,padding:"12px 16px",minWidth:240,boxShadow:"0 4px 24px rgba(0,0,0,0.5)"},children:[T.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:10},children:[T.jsx("strong",{style:{color:a.textPrimary,fontSize:13},children:"Keyboard Shortcuts"}),T.jsx("button",{onClick:()=>_(!1),style:{background:"none",border:"none",color:a.textSecondary,cursor:"pointer",fontSize:16,lineHeight:"1"},children:"×"})]}),[["Tab / Shift+Tab","Cycle nodes"],["Enter","Select focused node"],["Escape","Deselect / close"],["← → ↑ ↓","Navigate connected"],["?","Toggle shortcuts"]].map(([E,$])=>T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6,fontSize:12},children:[T.jsx("kbd",{style:{background:a.surface,border:`1px solid ${a.border}`,borderRadius:3,padding:"2px 6px",fontFamily:"monospace",color:a.textPrimary,whiteSpace:"nowrap",fontSize:11},children:E}),T.jsx("span",{style:{color:a.textSecondary},children:$})]},E))]}),C&&T.jsx("div",{onMouseDown:E=>E.stopPropagation(),style:{position:"absolute",left:C.x,top:C.y,zIndex:300,background:"#1e1e2e",border:`1px solid ${a.border}`,borderRadius:6,padding:"4px 0",minWidth:180,boxShadow:"0 4px 16px rgba(0,0,0,0.5)"},children:[["Show neighbors only",()=>{R(C.node.id),k(null)}],["Highlight path to...",()=>{I({sourceId:C.node.id}),k(null)}],["Copy path",()=>{navigator.clipboard.writeText(C.node.path).catch(()=>{}),k(null)}]].map(([E,$])=>T.jsx("button",{onClick:$,style:{display:"block",width:"100%",textAlign:"left",padding:"7px 14px",fontSize:12,cursor:"pointer",background:"none",border:"none",color:"#e2e8f0"},onMouseEnter:X=>{X.currentTarget.style.background="rgba(255,255,255,0.08)"},onMouseLeave:X=>{X.currentTarget.style.background="none"},children:E},E))}),W.nodes.length>0?T.jsx(mr,{ref:s,graphData:W,width:v.width,height:v.height,nodeVal:"val",nodeLabel:E=>{const $=E;return`${$.path}
47
+ ${$.tokens} tokens · ${$.symbolCount} symbols`},linkColor:E=>E.color,linkWidth:E=>Math.max(.5,E.weight*2),linkDirectionalArrowLength:4,linkDirectionalArrowRelPos:.9,onNodeClick:ce,onNodeHover:Bo,onNodeRightClick:Vo,backgroundColor:a.surface,nodeCanvasObject:Qo,nodeCanvasObjectMode:()=>"replace",enableNodeDrag:St,warmupTicks:100,cooldownTicks:200,d3AlphaDecay:.05,d3VelocityDecay:.3,onRenderFramePre:Zo}):T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:a.textSecondary,fontSize:14},children:e.length===0?'No files indexed. Click "Re-index" to scan your project.':"No matches for current filters."})]}),T.jsx("div",{style:{display:"flex",gap:12,padding:"6px 12px",borderTop:`1px solid ${a.border}`,flexWrap:"wrap"},children:Object.entries(On).filter(([E])=>E!=="unknown").map(([E,$])=>T.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,fontSize:11,color:a.textSecondary},children:[T.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:$,display:"inline-block"}}),E]},E))})]}),vt&&T.jsx(ep,{node:vt,relations:gt,allNodes:e,onClose:()=>c(null),onNavigate:E=>c(E)})]})}function op(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function hp(){const e=ee(),n=xt(_=>_.nodes),r=xt(_=>_.relations),i=xt(_=>_.scanning),o=xt(_=>_.highlightIds),a=xt(_=>_.stats),s=xt(_=>_.lastScanResult),l=xt(_=>_.rootPath),u=xt(_=>_.readiness),c=xt(_=>_.scan),h=xt(_=>_.scanSources),f=xt(_=>_.error),d=ea(_=>_.channels),p=na(_=>_.indexes),[y,x]=L.useState("all"),[v,g]=L.useState(""),m=d.filter(_=>_.enabled),S=L.useCallback(async()=>{const _=[],C=new Set;for(const k of m){if(k.repoMeta||k.contentSourceId||/\.compressed\.md$/i.test(k.path)){const M=k.path.replace(/[/\\]\.modular-knowledge[/\\].*$/,"").replace(/[/\\][^/\\]*\.compressed\.md$/,"");M&&M!==k.path&&C.add(M);continue}if(k.content){_.push({path:k.path||k.name,content:k.content});continue}if(k.path&&!k.path.startsWith("http")){const M=k.path.replace(/\\/g,"/");if(Array.from(C).some(N=>M.startsWith(N.replace(/\\/g,"/")+"/")))continue;if(!(M.split("/").pop()||"").includes(".")||M.endsWith("/")){C.add(k.path.replace(/[/\\]$/,""));continue}try{const N=await fetch(`${ra}/knowledge/read?path=${encodeURIComponent(k.path)}`);if(N.ok){const H=await N.json();H.status==="ok"&&H.data?.content&&_.push({path:k.path,content:H.data.content})}}catch{}}}if(C.size>0){const k=Array.from(C)[0];await c(k),_.length>0}else _.length>0&&await h(_)},[m,p,c,h]),b=L.useCallback(()=>{v.trim()&&c(v.trim())},[v,c]);return m.length===0?T.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:400,gap:12,color:e.textSecondary},children:[T.jsx("p",{style:{fontSize:14,margin:0},children:"No knowledge sources added."}),T.jsx("p",{style:{fontSize:12,color:e.textDim,margin:0},children:"Add files, repos, or connectors in the other tabs to enable graph scanning."})]}):T.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",minHeight:480},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderBottom:`1px solid ${e.border}`,background:e.isDark?"#ffffff06":"#00000006",flexWrap:"wrap"},children:[T.jsxs("span",{style:{fontSize:11,color:e.textDim,fontFamily:"'Geist Mono', monospace"},children:[m.length," sources"]}),T.jsxs("div",{style:{display:"flex",gap:2,background:e.isDark?"#ffffff08":"#00000008",borderRadius:4,padding:2},children:[T.jsx("button",{onClick:()=>x("all"),style:{fontSize:10,padding:"2px 8px",borderRadius:3,cursor:"pointer",border:"none",background:y==="all"?"#FE500020":"transparent",color:y==="all"?"#FE5000":e.textDim},children:"All Sources"}),T.jsx("button",{onClick:()=>x("path"),style:{fontSize:10,padding:"2px 8px",borderRadius:3,cursor:"pointer",border:"none",background:y==="path"?"#FE500020":"transparent",color:y==="path"?"#FE5000":e.textDim},children:"Directory"})]}),y==="path"&&T.jsx("input",{type:"text",placeholder:"Path to scan...",value:v,onChange:_=>g(_.target.value),style:{padding:"3px 8px",fontSize:11,borderRadius:4,border:`1px solid ${e.border}`,background:e.surface,color:e.textPrimary,width:200,outline:"none",fontFamily:"'Geist Mono', monospace"}}),s?T.jsxs("div",{style:{display:"flex",gap:12,fontSize:12,color:e.textSecondary},children:[T.jsxs("span",{children:[s.totalFiles," files"]}),T.jsxs("span",{children:[s.totalRelations," relations"]}),T.jsx("span",{children:op(s.durationMs)})]}):T.jsx("span",{style:{fontSize:11,color:e.textDim,fontStyle:"italic"},children:"Not scanned yet"}),f&&T.jsx("span",{style:{fontSize:11,color:"#e74c3c"},children:f}),a&&T.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:e.textSecondary,fontFamily:"'Geist Mono', monospace"},children:[a.nodes," nodes · ",a.relations," edges"]})]}),T.jsx("div",{style:{flex:1,minHeight:0},children:T.jsx(ip,{nodes:n,relations:r,onScan:y==="all"?S:b,scanning:i,highlightIds:o})}),u&&T.jsx(sa,{readiness:u,rootPath:l,nodes:n,relations:r})]})}export{hp as GraphPanel,hp as default};