semiotic 3.8.9 → 3.9.1

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 (502) hide show
  1. package/README.md +55 -81
  2. package/agent-skill/semiotic-charts/SKILL.md +11 -2
  3. package/ai/behaviorContracts.cjs +33 -3
  4. package/ai/cli.js +53 -2
  5. package/ai/componentMetadata.cjs +15 -0
  6. package/ai/dist/mcp-server.js +1530 -611
  7. package/ai/examples.md +48 -42
  8. package/{CLAUDE.md → ai/reference.md} +43 -22
  9. package/ai/schema.json +10603 -986
  10. package/ai/surface-manifest.json +643 -2
  11. package/ai/system-prompt.md +83 -130
  12. package/dist/c-3BLJEQNG.min.js +1 -0
  13. package/dist/c-3KZD6AXJ.min.js +1 -0
  14. package/dist/c-4TWEX5HG.min.js +1 -0
  15. package/dist/c-52TEGIUJ.min.js +1 -0
  16. package/dist/c-5YCIX3VZ.min.js +1 -0
  17. package/dist/c-6FEKTA3U.min.js +1 -0
  18. package/dist/c-6O5EVOPH.min.js +1 -0
  19. package/dist/c-74HEEZGK.min.js +1 -0
  20. package/dist/c-AKAF6JAD.min.js +1 -0
  21. package/dist/c-BBKITSXB.min.js +1 -0
  22. package/dist/c-BWNB6USU.min.js +1 -0
  23. package/dist/c-C25ENHIK.min.js +1 -0
  24. package/dist/c-CDR5AO3R.min.js +1 -0
  25. package/dist/c-COHXCW3Q.min.js +1 -0
  26. package/dist/{chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js → c-DADXPJXV.min.js} +0 -1
  27. package/dist/c-E3JFRRMI.min.js +1 -0
  28. package/dist/c-EBFPQHHO.min.js +1 -0
  29. package/dist/c-G36WS6LN.min.js +1 -0
  30. package/dist/c-GIKRQI4X.min.js +1 -0
  31. package/dist/c-GPYOFETM.min.js +1 -0
  32. package/dist/c-IDUHYYSI.min.js +1 -0
  33. package/dist/{chunk-chunk-FQPKOAIH.module.min.js → c-IUHFPMHD.min.js} +0 -1
  34. package/dist/c-J5G56TUH.min.js +1 -0
  35. package/dist/c-JAZ73J32.min.js +1 -0
  36. package/dist/c-KG3NXHAL.min.js +1 -0
  37. package/dist/c-KII3PLZE.min.js +1 -0
  38. package/dist/c-LIXGXMNS.min.js +1 -0
  39. package/dist/c-LVEY6D6B.min.js +1 -0
  40. package/dist/c-M4Y3BHFR.min.js +1 -0
  41. package/dist/c-MAIICR2Z.min.js +1 -0
  42. package/dist/c-MG5DM6VE.min.js +1 -0
  43. package/dist/{chunk-minimapBrushOverlay-JU57U7NM.module.min.js → c-MNF2S4AA.min.js} +0 -1
  44. package/dist/c-MT3WBK7M.min.js +1 -0
  45. package/dist/c-NY3JWV2K.min.js +1 -0
  46. package/dist/c-O6U6K4CW.min.js +1 -0
  47. package/dist/c-OCI56QF2.min.js +1 -0
  48. package/dist/c-OQ7M4AGV.min.js +1 -0
  49. package/dist/c-OXYMVK7Q.min.js +1 -0
  50. package/dist/c-PPWDL5ZI.min.js +1 -0
  51. package/dist/c-QHF5YON3.min.js +1 -0
  52. package/dist/c-RR3GO5SW.min.js +1 -0
  53. package/dist/{chunk-chunk-J5QD4RAM.module.min.js → c-RSVIHIQ4.min.js} +0 -1
  54. package/dist/{chunk-chunk-EMO5NUGE.module.min.js → c-S2BXNNJN.min.js} +0 -1
  55. package/dist/{chunk-chunk-YCQYG6J5.module.min.js → c-SLGMUBUL.min.js} +0 -1
  56. package/dist/c-SUILCHWU.min.js +1 -0
  57. package/dist/c-TZW3JGJ5.min.js +1 -0
  58. package/dist/c-US5ZFT6E.min.js +1 -0
  59. package/dist/{chunk-chunk-RZH7VZYS.module.min.js → c-USFMFKIH.min.js} +0 -1
  60. package/dist/c-UUKVD4WB.min.js +1 -0
  61. package/dist/{chunk-chunk-SV4XAZ3Q.module.min.js → c-VGW3VG3I.min.js} +0 -1
  62. package/dist/c-W3CE4A4S.min.js +1 -0
  63. package/dist/{chunk-chunk-2NVFEB7P.module.min.js → c-WJCD5EUY.min.js} +0 -1
  64. package/dist/{chunk-chunk-2JGJ5GUG.module.min.js → c-X5UBGU2V.min.js} +0 -1
  65. package/dist/c-YDAY2WFR.min.js +1 -0
  66. package/dist/c-ZOWWU34K.min.js +1 -0
  67. package/dist/components/AccessibleNavTree.d.ts +1 -1
  68. package/dist/components/CategoryColors.d.ts +1 -1
  69. package/dist/components/GradientLegend.d.ts +14 -0
  70. package/dist/components/Legend.d.ts +2 -7
  71. package/dist/components/LinkedCharts.d.ts +1 -1
  72. package/dist/components/MobileAnnotationCalloutList.d.ts +1 -1
  73. package/dist/components/ObservationReadout.d.ts +45 -0
  74. package/dist/components/ThemeProvider.d.ts +4 -4
  75. package/dist/components/Tooltip/FlippingTooltip.d.ts +5 -7
  76. package/dist/components/Tooltip/Tooltip.d.ts +30 -5
  77. package/dist/components/Tooltip/tooltipChrome.d.ts +43 -0
  78. package/dist/components/ai/chartCapabilityTypes.d.ts +86 -2
  79. package/dist/components/ai/chartClinic.d.ts +2 -0
  80. package/dist/components/ai/deriveProfileFields.d.ts +40 -0
  81. package/dist/components/ai/evaluateChart.d.ts +85 -0
  82. package/dist/components/ai/fieldPolicy.d.ts +7 -0
  83. package/dist/components/ai/fieldRoles.d.ts +24 -0
  84. package/dist/components/ai/generativeChart.d.ts +18 -2
  85. package/dist/components/ai/inferIntent.d.ts +26 -2
  86. package/dist/components/ai/intents.d.ts +35 -0
  87. package/dist/components/ai/navigationTree.d.ts +2 -2
  88. package/dist/components/ai/observedSceneAudit.d.ts +2 -1
  89. package/dist/components/ai/profileData.d.ts +11 -0
  90. package/dist/components/ai/repairChartConfig.d.ts +2 -3
  91. package/dist/components/ai/semanticEvidence.d.ts +4 -0
  92. package/dist/components/ai/semanticViability.d.ts +11 -0
  93. package/dist/components/ai/semanticViabilityRegistry.d.ts +5 -0
  94. package/dist/components/ai/streamingTypes.d.ts +4 -0
  95. package/dist/components/ai/suggestCharts.d.ts +5 -6
  96. package/dist/components/ai/suggestDashboard.d.ts +2 -3
  97. package/dist/components/ai/suggestStreamCharts.d.ts +1 -1
  98. package/dist/components/ai/suggestStretchCharts.d.ts +2 -3
  99. package/dist/components/ai/suggestionPropContracts.d.ts +20 -0
  100. package/dist/components/ai/variantDiscovery.d.ts +3 -1
  101. package/dist/components/charts/custom/NetworkCustomChart.d.ts +3 -0
  102. package/dist/components/charts/custom/OrdinalCustomChart.d.ts +3 -0
  103. package/dist/components/charts/custom/XYCustomChart.d.ts +1 -1
  104. package/dist/components/charts/geo/ChoroplethMap.d.ts +3 -1
  105. package/dist/components/charts/geo/DistanceCartogram.d.ts +2 -7
  106. package/dist/components/charts/geo/cartogramOverlay.d.ts +28 -0
  107. package/dist/components/charts/index.d.ts +4 -3
  108. package/dist/components/charts/network/ProcessSankey.d.ts +2 -136
  109. package/dist/components/charts/network/ProcessSankeyProps.d.ts +139 -0
  110. package/dist/components/charts/network/Treemap.d.ts +2 -1
  111. package/dist/components/charts/network/processSankey/boundaryHubOrdering.d.ts +23 -0
  112. package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +2 -0
  113. package/dist/components/charts/network/processSankey/ordering.d.ts +3 -41
  114. package/dist/components/charts/network/processSankey/orderingTypes.d.ts +32 -0
  115. package/dist/components/charts/network/processSankey/packing.d.ts +1 -1
  116. package/dist/components/charts/network/processSankey/packingCache.d.ts +1 -1
  117. package/dist/components/charts/network/processSankey/packingOptimization.d.ts +72 -0
  118. package/dist/components/charts/ordinal/BarChart.d.ts +4 -3
  119. package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
  120. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -2
  121. package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
  122. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +2 -2
  123. package/dist/components/charts/physics/GaltonBoardChart.d.ts +2 -9
  124. package/dist/components/charts/physics/GauntletChart.d.ts +10 -41
  125. package/dist/components/charts/physics/ProcessFlowChart.d.ts +1 -1
  126. package/dist/components/charts/physics/chainReactionAccessibleTable.d.ts +9 -0
  127. package/dist/components/charts/physics/chainReactionRuntime.d.ts +2 -1
  128. package/dist/components/charts/physics/chainReactionTypes.d.ts +5 -1
  129. package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +2 -2
  130. package/dist/components/charts/physics/crucibleClone.d.ts +6 -0
  131. package/dist/components/charts/physics/crucibleEffects.d.ts +1 -2
  132. package/dist/components/charts/physics/crucibleRecord.d.ts +7 -0
  133. package/dist/components/charts/physics/gauntletChrome.d.ts +4 -4
  134. package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
  135. package/dist/components/charts/physics/gauntletPublic.d.ts +4 -0
  136. package/dist/components/charts/physics/packetFlowOverlay.d.ts +7 -0
  137. package/dist/components/charts/physics/physicsChartLayout.d.ts +8 -0
  138. package/dist/components/charts/physics/physicsChartShared.d.ts +3 -1
  139. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  140. package/dist/components/charts/physics/physicsHocUtils.d.ts +25 -12
  141. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +24 -0
  142. package/dist/components/charts/physics/processFlowOverlays.d.ts +9 -0
  143. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +15 -12
  144. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +10 -7
  145. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +35 -14
  146. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +21 -14
  147. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +20 -13
  148. package/dist/components/charts/realtime/aggregate.d.ts +4 -1
  149. package/dist/components/charts/realtime/eventTime.d.ts +4 -0
  150. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +27 -0
  151. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +30 -0
  152. package/dist/components/charts/realtime/useRealtimeCategoryColors.d.ts +30 -0
  153. package/dist/components/charts/shared/FrameTextAnnotationSVG.d.ts +10 -0
  154. package/dist/components/charts/shared/annotationActivation.d.ts +3 -7
  155. package/dist/components/charts/shared/annotationBandFill.d.ts +6 -0
  156. package/dist/components/charts/shared/annotationDispatch.d.ts +31 -0
  157. package/dist/components/charts/shared/annotationIdentity.d.ts +8 -0
  158. package/dist/components/charts/shared/annotationRules.d.ts +1 -15
  159. package/dist/components/charts/shared/boundedCategoryRegistry.d.ts +8 -0
  160. package/dist/components/charts/shared/chainReactionChartSpec.d.ts +3 -0
  161. package/dist/components/charts/shared/chartMode.d.ts +3 -2
  162. package/dist/components/charts/shared/chartSpecCore.d.ts +1 -0
  163. package/dist/components/charts/shared/frameTextAnnotation.d.ts +63 -0
  164. package/dist/components/charts/shared/gradient.d.ts +16 -0
  165. package/dist/components/charts/shared/hatchFill.d.ts +15 -0
  166. package/dist/components/charts/shared/hooks.d.ts +4 -4
  167. package/dist/components/charts/shared/legendUtils.d.ts +1 -0
  168. package/dist/components/charts/shared/streamPropsHelpers.d.ts +2 -1
  169. package/dist/components/charts/shared/styleRules.d.ts +9 -2
  170. package/dist/components/charts/shared/styleRulesWireSchema.d.ts +353 -0
  171. package/dist/components/charts/shared/types.d.ts +18 -9
  172. package/dist/components/charts/shared/useChartLegend.d.ts +43 -9
  173. package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
  174. package/dist/components/charts/shared/useCustomChartSetup.d.ts +5 -2
  175. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +5 -1
  176. package/dist/components/charts/shared/useOrdinalBrush.d.ts +3 -3
  177. package/dist/components/charts/shared/useStreamingLegend.d.ts +6 -1
  178. package/dist/components/charts/value/types.d.ts +1 -1
  179. package/dist/components/charts/xy/BubbleChart.d.ts +1 -1
  180. package/dist/components/charts/xy/BumpChart.capability.d.ts +14 -1
  181. package/dist/components/charts/xy/BumpChart.d.ts +13 -73
  182. package/dist/components/charts/xy/BumpChart.semanticViability.d.ts +5 -0
  183. package/dist/components/charts/xy/CandlestickChart.d.ts +2 -2
  184. package/dist/components/charts/xy/LineChart.d.ts +2 -2
  185. package/dist/components/charts/xy/Scatterplot.d.ts +1 -1
  186. package/dist/components/charts/xy/bumpData.d.ts +44 -0
  187. package/dist/components/charts/xy/bumpIdentity.d.ts +2 -0
  188. package/dist/components/charts/xy/bumpLayout.d.ts +45 -0
  189. package/dist/components/charts/xy/bumpTooltip.d.ts +20 -0
  190. package/dist/components/legendLayout.d.ts +131 -4
  191. package/dist/components/realtime/ReorderBuffer.d.ts +2 -0
  192. package/dist/components/realtime/types.d.ts +10 -1
  193. package/dist/components/recipes/balanceSnapshotsToFlows.d.ts +42 -0
  194. package/dist/components/recipes/directedReachability.d.ts +14 -0
  195. package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +6 -6
  196. package/dist/components/recipes/gridObservatory.d.ts +1 -1
  197. package/dist/components/recipes/networkAnalysis.d.ts +1 -18
  198. package/dist/components/recipes/physics.d.ts +7 -4
  199. package/dist/components/recipes/processPhysics.d.ts +0 -1
  200. package/dist/components/recipes/waffle.d.ts +7 -4
  201. package/dist/components/semiotic-ai-core.d.ts +13 -4
  202. package/dist/components/semiotic-ai-observations.d.ts +3 -0
  203. package/dist/components/semiotic-ai.d.ts +16 -9
  204. package/dist/components/semiotic-client-shared.d.ts +10 -0
  205. package/dist/components/semiotic-experimental.d.ts +1 -1
  206. package/dist/components/semiotic-geo.d.ts +4 -1
  207. package/dist/components/semiotic-network.d.ts +7 -4
  208. package/dist/components/semiotic-ordinal.d.ts +4 -1
  209. package/dist/components/semiotic-physics.d.ts +11 -4
  210. package/dist/components/semiotic-realtime-core.d.ts +11 -4
  211. package/dist/components/semiotic-realtime-react.d.ts +4 -3
  212. package/dist/components/semiotic-realtime.d.ts +3 -1
  213. package/dist/components/semiotic-recipes-core.d.ts +7 -5
  214. package/dist/components/semiotic-server-edge.d.ts +3 -2
  215. package/dist/components/semiotic-server.d.ts +3 -2
  216. package/dist/components/semiotic-themes-core.d.ts +5 -48
  217. package/dist/components/semiotic-utils-core.d.ts +10 -5
  218. package/dist/components/semiotic-utils-react.d.ts +2 -0
  219. package/dist/components/semiotic-utils.d.ts +1 -1
  220. package/dist/components/semiotic-xy.d.ts +4 -1
  221. package/dist/components/semiotic.d.ts +68 -26
  222. package/dist/components/server/animatedGif.d.ts +1 -1
  223. package/dist/components/server/renderEvidence.d.ts +25 -2
  224. package/dist/components/server/renderToStaticSVG.d.ts +15 -7
  225. package/dist/components/server/serverChartConfigShared.d.ts +8 -1
  226. package/dist/components/server/serverChartConfigs.d.ts +1 -0
  227. package/dist/components/server/serverChartConfigsNetwork.d.ts +3 -3
  228. package/dist/components/server/serverChartConfigsNetworkChord.d.ts +2 -0
  229. package/dist/components/server/serverChartConfigsNetworkForce.d.ts +2 -0
  230. package/dist/components/server/serverChartConfigsNetworkHierarchy.d.ts +3 -0
  231. package/dist/components/server/serverChartConfigsXY.d.ts +3 -3
  232. package/dist/components/server/serverChartConfigsXYBubble.d.ts +5 -0
  233. package/dist/components/server/serverChartConfigsXYBump.d.ts +7 -0
  234. package/dist/components/server/serverChartConfigsXYScatter.d.ts +5 -0
  235. package/dist/components/server/staticAnnotationFallbacks.d.ts +10 -0
  236. package/dist/components/server/staticAnnotations.d.ts +28 -1
  237. package/dist/components/server/staticAxisTickLabel.d.ts +13 -0
  238. package/dist/components/server/staticLegend.d.ts +1 -1
  239. package/dist/components/server/staticLegendMargin.d.ts +41 -0
  240. package/dist/components/server/staticOrdinal.d.ts +8 -2
  241. package/dist/components/server/staticPhysics.d.ts +13 -1
  242. package/dist/components/server/staticPhysicsChrome.d.ts +20 -0
  243. package/dist/components/server/staticRawLegend.d.ts +15 -0
  244. package/dist/components/server/staticSVGChrome.d.ts +16 -55
  245. package/dist/components/server/staticXYAxes.d.ts +27 -0
  246. package/dist/components/server/staticXYAxisTicks.d.ts +39 -0
  247. package/dist/components/server/staticXYGrid.d.ts +11 -0
  248. package/dist/components/server/themeResolver.d.ts +5 -1
  249. package/dist/components/store/ThemeStore.d.ts +2 -98
  250. package/dist/components/store/designTokens.d.ts +1 -1
  251. package/dist/components/store/themeCSSVariables.d.ts +10 -0
  252. package/dist/components/store/themeCore.d.ts +91 -0
  253. package/dist/components/store/themePresets.d.ts +81 -0
  254. package/dist/components/store/themeSerialization.d.ts +2 -1
  255. package/dist/components/stream/AccessibleDataTable.d.ts +12 -14
  256. package/dist/components/stream/AccessibleTablePortalImpl.d.ts +6 -0
  257. package/dist/components/stream/GeoTileRenderer.d.ts +2 -0
  258. package/dist/components/stream/NetworkCanvasHitTester.d.ts +3 -1
  259. package/dist/components/stream/NetworkSSRFrame.d.ts +2 -1
  260. package/dist/components/stream/NetworkSVGOverlay.d.ts +3 -31
  261. package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -0
  262. package/dist/components/stream/SVGChartTitle.d.ts +9 -0
  263. package/dist/components/stream/SVGOverlay.d.ts +1 -21
  264. package/dist/components/stream/SVGUnderlay.d.ts +24 -0
  265. package/dist/components/stream/SceneToSVG.d.ts +1 -1
  266. package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
  267. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
  268. package/dist/components/stream/StreamXYFrame.d.ts +1 -1
  269. package/dist/components/stream/accessibleDataRows.d.ts +11 -0
  270. package/dist/components/stream/accessibleDataTableModel.d.ts +40 -0
  271. package/dist/components/stream/accessibleTableTypes.d.ts +11 -0
  272. package/dist/components/stream/axisTickUtils.d.ts +19 -0
  273. package/dist/components/stream/canvasBackground.d.ts +10 -0
  274. package/dist/components/stream/canvasSetup.d.ts +9 -0
  275. package/dist/components/stream/frameCursorInteraction.d.ts +25 -0
  276. package/dist/components/stream/frameDefaultMargins.d.ts +37 -0
  277. package/dist/components/stream/frameGraphics.d.ts +18 -0
  278. package/dist/components/stream/frameGraphicsSubscription.d.ts +26 -0
  279. package/dist/components/stream/frameLegendOptions.d.ts +18 -0
  280. package/dist/components/stream/geoFrameCursorInteraction.d.ts +9 -0
  281. package/dist/components/stream/geoFrameHelpers.d.ts +29 -1
  282. package/dist/components/stream/geoTypes.d.ts +10 -11
  283. package/dist/components/stream/hitTarget.d.ts +61 -2
  284. package/dist/components/stream/moduleWorkerSession.d.ts +6 -0
  285. package/dist/components/stream/networkAnnotationAnchors.d.ts +37 -0
  286. package/dist/components/stream/networkCustomLayout.d.ts +2 -2
  287. package/dist/components/stream/networkFrameCursorInteraction.d.ts +12 -0
  288. package/dist/components/stream/networkFrameInteraction.d.ts +2 -0
  289. package/dist/components/stream/networkFramePaint.d.ts +7 -0
  290. package/dist/components/stream/networkPipelineConfig.d.ts +1 -1
  291. package/dist/components/stream/networkTypes.d.ts +30 -32
  292. package/dist/components/stream/normalizeXYData.d.ts +7 -0
  293. package/dist/components/stream/ordinalFrameCursorInteraction.d.ts +7 -0
  294. package/dist/components/stream/ordinalFrameInteraction.d.ts +29 -0
  295. package/dist/components/stream/ordinalSceneSVG.d.ts +10 -0
  296. package/dist/components/stream/ordinalTypes.d.ts +10 -4
  297. package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +9 -1
  298. package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +25 -0
  299. package/dist/components/stream/physics/PhysicsControllers.d.ts +0 -3
  300. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +4 -1
  301. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +3 -24
  302. package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +9 -21
  303. package/dist/components/stream/physics/PhysicsSettledSVGElement.d.ts +37 -0
  304. package/dist/components/stream/physics/PhysicsSettledScene.d.ts +7 -3
  305. package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +1 -1
  306. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +23 -4
  307. package/dist/components/stream/physics/physicsAnnotationContext.d.ts +19 -0
  308. package/dist/components/stream/physics/physicsBodyCanvas.d.ts +4 -0
  309. package/dist/components/stream/physics/physicsSettledChrome.d.ts +7 -0
  310. package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +32 -0
  311. package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +36 -0
  312. package/dist/components/stream/pipelineConfig.d.ts +6 -17
  313. package/dist/components/stream/pipelineDomainResolution.d.ts +1 -1
  314. package/dist/components/stream/renderBackend.d.ts +2 -0
  315. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +13 -2
  316. package/dist/components/stream/renderers/resolveCSSColor.d.ts +7 -0
  317. package/dist/components/stream/responsiveSize.d.ts +17 -0
  318. package/dist/components/stream/sceneCursor.d.ts +41 -0
  319. package/dist/components/stream/sceneRevisionDiagnostics.d.ts +1 -1
  320. package/dist/components/stream/svgOverlayUtils.d.ts +22 -1
  321. package/dist/components/stream/types.d.ts +25 -12
  322. package/dist/components/stream/useCanvasFrameHost.d.ts +3 -1
  323. package/dist/components/stream/useFrame.d.ts +24 -1
  324. package/dist/components/stream/useResponsiveSize.d.ts +6 -1
  325. package/dist/components/stream/useStalenessCheck.d.ts +1 -1
  326. package/dist/components/stream/xyFrameAxisTypes.d.ts +15 -4
  327. package/dist/components/stream/xyFrameCursorInteraction.d.ts +6 -0
  328. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +1 -1
  329. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -26
  330. package/dist/components/types/legendTypes.d.ts +6 -0
  331. package/dist/components/types/marginType.d.ts +7 -8
  332. package/dist/controls.min.js +1 -1
  333. package/dist/controls.module.min.js +1 -1
  334. package/dist/forceLayoutWorker.js +1 -1
  335. package/dist/geo.min.js +1 -1
  336. package/dist/geo.module.min.js +1 -1
  337. package/dist/network.min.js +1 -1
  338. package/dist/network.module.min.js +1 -1
  339. package/dist/ordinal.min.js +1 -1
  340. package/dist/ordinal.module.min.js +1 -1
  341. package/dist/physics-matter.module.min.js +1 -1
  342. package/dist/physics-rapier.module.min.js +1 -1
  343. package/dist/physics.min.js +1 -1
  344. package/dist/physics.module.min.js +1 -1
  345. package/dist/physicsWorker.js +1 -1
  346. package/dist/processSankeyLayoutWorker.js +1 -1
  347. package/dist/realtime.min.js +1 -1
  348. package/dist/realtime.module.min.js +1 -1
  349. package/dist/rough.min.js +1 -1
  350. package/dist/rough.module.min.js +1 -1
  351. package/dist/semiotic-ai-core.d.ts +13 -4
  352. package/dist/semiotic-ai-core.min.js +1 -1
  353. package/dist/semiotic-ai-core.module.min.js +1 -1
  354. package/dist/semiotic-ai.d.ts +16 -9
  355. package/dist/semiotic-ai.min.js +1 -1
  356. package/dist/semiotic-ai.module.min.js +1 -1
  357. package/dist/semiotic-client-cjs-shared.min.js +1 -0
  358. package/dist/semiotic-client-glyph.module.min.js +2 -0
  359. package/dist/semiotic-client-responsive.module.min.js +2 -0
  360. package/dist/semiotic-client-shared.module.min.js +2 -0
  361. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -0
  362. package/dist/semiotic-data.min.js +1 -1
  363. package/dist/semiotic-data.module.min.js +1 -1
  364. package/dist/semiotic-experimental-auxiliary.module.min.js +2 -0
  365. package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -0
  366. package/dist/semiotic-experimental-node.module.min.js +2 -0
  367. package/dist/semiotic-experimental-react-shared.module.min.js +2 -0
  368. package/dist/semiotic-experimental-vacp.min.js +1 -1
  369. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  370. package/dist/semiotic-experimental.d.ts +1 -1
  371. package/dist/semiotic-experimental.min.js +1 -1
  372. package/dist/semiotic-experimental.module.min.js +1 -1
  373. package/dist/semiotic-geo.d.ts +4 -1
  374. package/dist/semiotic-network.d.ts +7 -4
  375. package/dist/semiotic-ordinal.d.ts +4 -1
  376. package/dist/semiotic-physics.d.ts +11 -4
  377. package/dist/semiotic-realtime-core.d.ts +11 -4
  378. package/dist/semiotic-realtime-core.min.js +2 -1
  379. package/dist/semiotic-realtime-core.module.min.js +2 -1
  380. package/dist/semiotic-realtime-react.d.ts +4 -3
  381. package/dist/semiotic-realtime-react.min.js +1 -1
  382. package/dist/semiotic-realtime-react.module.min.js +1 -1
  383. package/dist/semiotic-realtime.d.ts +3 -1
  384. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -0
  385. package/dist/semiotic-recipes-core.d.ts +7 -5
  386. package/dist/semiotic-recipes-core.min.js +9 -1
  387. package/dist/semiotic-recipes-core.module.min.js +1 -1
  388. package/dist/semiotic-recipes-geo-cjs.min.js +1 -0
  389. package/dist/semiotic-recipes-react.min.js +1 -1
  390. package/dist/semiotic-recipes-react.module.min.js +1 -1
  391. package/dist/semiotic-recipes.min.js +7 -1
  392. package/dist/semiotic-recipes.module.min.js +2 -1
  393. package/dist/semiotic-server-edge-node.module.min.js +1 -0
  394. package/dist/semiotic-server-edge.d.ts +3 -2
  395. package/dist/semiotic-server-edge.min.js +1 -1
  396. package/dist/semiotic-server-edge.module.min.js +1 -1
  397. package/dist/semiotic-server-node.min.js +1 -1
  398. package/dist/semiotic-server-node.module.min.js +1 -1
  399. package/dist/semiotic-server.d.ts +3 -2
  400. package/dist/semiotic-themes-core.d.ts +5 -48
  401. package/dist/semiotic-themes-core.min.js +1 -1
  402. package/dist/semiotic-themes-core.module.min.js +1 -1
  403. package/dist/semiotic-themes-react.min.js +1 -1
  404. package/dist/semiotic-themes-react.module.min.js +1 -1
  405. package/dist/semiotic-themes.min.js +1 -1
  406. package/dist/semiotic-themes.module.min.js +1 -1
  407. package/dist/semiotic-utils-core.d.ts +10 -5
  408. package/dist/semiotic-utils-core.min.js +1 -1
  409. package/dist/semiotic-utils-core.module.min.js +1 -1
  410. package/dist/semiotic-utils-react.d.ts +2 -0
  411. package/dist/semiotic-utils-react.min.js +1 -1
  412. package/dist/semiotic-utils-react.module.min.js +1 -1
  413. package/dist/semiotic-utils.d.ts +1 -1
  414. package/dist/semiotic-utils.min.js +2 -1
  415. package/dist/semiotic-utils.module.min.js +2 -1
  416. package/dist/semiotic-value.min.js +1 -1
  417. package/dist/semiotic-value.module.min.js +1 -1
  418. package/dist/semiotic-xy.d.ts +4 -1
  419. package/dist/semiotic.d.ts +68 -26
  420. package/dist/semiotic.min.js +1 -1
  421. package/dist/semiotic.module.min.js +1 -1
  422. package/dist/server.min.js +1 -1
  423. package/dist/server.module.min.js +1 -1
  424. package/dist/xy.min.js +1 -1
  425. package/dist/xy.module.min.js +1 -1
  426. package/package.json +53 -19
  427. package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +0 -20
  428. package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +0 -2
  429. package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +0 -1
  430. package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +0 -2
  431. package/dist/chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js +0 -2
  432. package/dist/chunk-chunk-2B3AIKUZ.module.min.js +0 -2
  433. package/dist/chunk-chunk-2CXCXRB4.module.min.js +0 -1
  434. package/dist/chunk-chunk-2X3FJCME.module.min.js +0 -1
  435. package/dist/chunk-chunk-2ZHHWZQM.module.min.js +0 -2
  436. package/dist/chunk-chunk-4ITOQRXM.module.min.js +0 -2
  437. package/dist/chunk-chunk-5UKL5W76.module.min.js +0 -2
  438. package/dist/chunk-chunk-5VVNW5AZ.module.min.js +0 -1
  439. package/dist/chunk-chunk-5ZON5NMV.module.min.js +0 -2
  440. package/dist/chunk-chunk-66PCWJUG.module.min.js +0 -1
  441. package/dist/chunk-chunk-6S3YGYW7.module.min.js +0 -1
  442. package/dist/chunk-chunk-6V5VQVCT.module.min.js +0 -2
  443. package/dist/chunk-chunk-7C5EDZ3Z.module.min.js +0 -2
  444. package/dist/chunk-chunk-A3I4HBD5.module.min.js +0 -1
  445. package/dist/chunk-chunk-ACLDBMRH.module.min.js +0 -2
  446. package/dist/chunk-chunk-AFQHURLO.module.min.js +0 -2
  447. package/dist/chunk-chunk-DDB4TLQG.module.min.js +0 -2
  448. package/dist/chunk-chunk-DTH3SUOU.module.min.js +0 -2
  449. package/dist/chunk-chunk-DTSNLGRK.module.min.js +0 -2
  450. package/dist/chunk-chunk-DVCWU7MT.module.min.js +0 -2
  451. package/dist/chunk-chunk-FEPXDKJP.module.min.js +0 -1
  452. package/dist/chunk-chunk-FJ76HWQZ.module.min.js +0 -1
  453. package/dist/chunk-chunk-FSIHAW6L.module.min.js +0 -2
  454. package/dist/chunk-chunk-G2RGVEYY.module.min.js +0 -2
  455. package/dist/chunk-chunk-G75OPF5N.module.min.js +0 -2
  456. package/dist/chunk-chunk-HADHLMY5.module.min.js +0 -1
  457. package/dist/chunk-chunk-HAJVODLO.module.min.js +0 -2
  458. package/dist/chunk-chunk-HBFA4NN6.module.min.js +0 -1
  459. package/dist/chunk-chunk-HIV7AW2V.module.min.js +0 -2
  460. package/dist/chunk-chunk-IY7RYD4S.module.min.js +0 -1
  461. package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
  462. package/dist/chunk-chunk-J3XWETBJ.module.min.js +0 -2
  463. package/dist/chunk-chunk-JZAMMSQQ.module.min.js +0 -2
  464. package/dist/chunk-chunk-KTWEBFMX.module.min.js +0 -2
  465. package/dist/chunk-chunk-LSJUXBMF.module.min.js +0 -1
  466. package/dist/chunk-chunk-MXMRXSCI.module.min.js +0 -2
  467. package/dist/chunk-chunk-MXVBXFKW.module.min.js +0 -2
  468. package/dist/chunk-chunk-NWIGA3UK.module.min.js +0 -1
  469. package/dist/chunk-chunk-OFAP623Y.module.min.js +0 -2
  470. package/dist/chunk-chunk-OHLRAEQZ.module.min.js +0 -2
  471. package/dist/chunk-chunk-OZK46A5U.module.min.js +0 -1
  472. package/dist/chunk-chunk-PMR47KRY.module.min.js +0 -2
  473. package/dist/chunk-chunk-PRNXOCYZ.module.min.js +0 -2
  474. package/dist/chunk-chunk-Q2YADC2V.module.min.js +0 -2
  475. package/dist/chunk-chunk-RLKZVJMQ.module.min.js +0 -2
  476. package/dist/chunk-chunk-ROP4HI7H.module.min.js +0 -2
  477. package/dist/chunk-chunk-SK2TQMG4.module.min.js +0 -2
  478. package/dist/chunk-chunk-SKLYXNYW.module.min.js +0 -2
  479. package/dist/chunk-chunk-TCMHJWFJ.module.min.js +0 -1
  480. package/dist/chunk-chunk-TSCFL235.module.min.js +0 -1
  481. package/dist/chunk-chunk-U4NZCU5T.module.min.js +0 -2
  482. package/dist/chunk-chunk-U66USBWU.module.min.js +0 -1
  483. package/dist/chunk-chunk-UOQRPGPK.module.min.js +0 -2
  484. package/dist/chunk-chunk-VKL6DI43.module.min.js +0 -2
  485. package/dist/chunk-chunk-W62673ZE.module.min.js +0 -1
  486. package/dist/chunk-chunk-WFHZHWT7.module.min.js +0 -1
  487. package/dist/chunk-chunk-XCC25CZZ.module.min.js +0 -2
  488. package/dist/chunk-chunk-XECNOUZY.module.min.js +0 -2
  489. package/dist/chunk-chunk-XYZDTYAF.module.min.js +0 -2
  490. package/dist/chunk-chunk-YHNZCPOZ.module.min.js +0 -2
  491. package/dist/chunk-chunk-YWZB3KPI.module.min.js +0 -2
  492. package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +0 -2
  493. package/dist/components/stream/test-utils/frameScheduler.d.ts +0 -12
  494. package/dist/components/stream/test-utils/revisionConsumption.d.ts +0 -13
  495. package/dist/test-utils/canvasMock.d.ts +0 -86
  496. package/dist/test-utils/capturedFrameProps.d.ts +0 -67
  497. package/dist/test-utils/frameMock.d.ts +0 -81
  498. package/dist/test-utils/ordinalFixtures.d.ts +0 -48
  499. /package/dist/{chunk-chunk-JJ2OOIET.module.min.js → c-GGISSW5E.min.js} +0 -0
  500. /package/dist/{chunk-chunk-SIRIJ3DY.module.min.js → c-N4G2L7ID.min.js} +0 -0
  501. /package/dist/{chunk-chunk-CA3YDW6F.module.min.js → c-S6U5CGT5.min.js} +0 -0
  502. /package/dist/components/recipes/{mobileAnnotationStrategy.d.ts → mobileAnnotationBehavior.d.ts} +0 -0
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{buildRegressionAnnotation as e}from"./chunk-chunk-YCQYG6J5.module.min.js";import{mergeShapeStyle as t,normalizePartialMargin as o,useChartSetup as i,useCustomChartSetup as n,useFrameImperativeHandle as r,useResolvedSelection as a}from"./chunk-chunk-MXMRXSCI.module.min.js";import{validateArrayData as s}from"./chunk-chunk-J5QD4RAM.module.min.js";import{StreamXYFrame_default as l}from"./chunk-chunk-FSIHAW6L.module.min.js";import{normalizeColorGradient as c,normalizeGradient as h,normalizeSemanticGradient as d,reverseGradient as u}from"./chunk-chunk-U4NZCU5T.module.min.js";import{accessorName as m,bandTooltipFields as p,buildBaseMetadataProps as y,buildCustomBehaviorProps as f,buildDefaultTooltip as g,buildTooltipProps as x}from"./chunk-chunk-DVCWU7MT.module.min.js";import{useCustomLayoutSelection as b}from"./chunk-chunk-5UKL5W76.module.min.js";import{makeXYRuleContext as v,resolveStyleRules as A}from"./chunk-chunk-EMO5NUGE.module.min.js";import{COLOR_SCHEMES as w,DEFAULT_COLOR as k,DEFAULT_COLORS as S,DEFAULT_SELECTION_OPACITY as C,LinkedCharts as L,MultiPointTooltip as R,composeLegendConfigs as _,defaultTooltipStyle as H,filterSparseArray as I,getColor as P,getCrosshairProps as B,getSequentialInterpolator as F,getSize as D,interpolateViridis as N,normalizeLinkedBrush as M,normalizeTooltip as W,resolveDefaultFill as O,resolveMobileInteraction as T,resolveMultiCapableTooltip as E,resolveXYAxisChrome as G,useBrushSelection as j,useChartLegendAndMargin as z,useChartMode as V,useChartSelection as $,useColorScale as Q,useLegendInteraction as X,useSelection as Y,useSelectionSelector as U,useThemeCategorical as q,useThemeSequential as K,wrapStyleWithSelection as J}from"./chunk-chunk-SK2TQMG4.module.min.js";import{getMax as Z,getMinMax as ee}from"./chunk-chunk-2NVFEB7P.module.min.js";import{useTheme as te}from"./chunk-chunk-PMR47KRY.module.min.js";import{ChartError as oe,SafeRender as ie,renderEmptyState as ne,renderLoadingState as re,warnMissingField as ae}from"./chunk-chunk-ACLDBMRH.module.min.js";import*as se from"react";import{useMemo as le,useCallback as ce,forwardRef as he,useRef as de}from"react";import{useMemo as ue}from"react";function me(e){const{colorBy:o,colorScale:i,color:n,pointRadius:r=5,radiusFn:a,fillOpacity:s=1,fallbackFill:l,baseStyleExtras:c,stroke:h,strokeWidth:d,opacity:u,effectiveSelectionHook:m,resolvedSelection:p,colorDatumAccessor:y,styleRules:f,ruleContext:g}=e,x=ue(()=>e=>{const t="function"==typeof c?c(e):c,h=t?{...t}:{};if(void 0===h.fillOpacity&&(h.fillOpacity=s),void 0===h.fill)if(o){if(i){const t=y?y(e):e;h.fill=P(t,o,i)}}else h.fill=l?l(e):n||k;return void 0===h.r&&(h.r=a?a(e):r),f&&f.length>0&&Object.assign(h,A(e,f,g?g(e):{value:void 0})),h},[o,i,n,r,a,s,l,c,y,f,g]),b=ue(()=>t(x,{stroke:h,strokeWidth:d,opacity:u}),[x,h,d,u]);return ue(()=>J(b,m??null,p),[b,m,p])}import{useCallback as pe,useMemo as ye,useRef as fe,useState as ge}from"react";function xe(e){const{accessor:t,data:o,isPushMode:i}=e,n=fe(null),[r,a]=ge(0),s=pe(e=>{if(!i||!t)return;let o=!1;for(const i of e){const e="function"==typeof t?t(i):i[t];if(null==e)continue;const r="number"==typeof e?e:Number(e);Number.isFinite(r)&&(n.current?(n.current[0]>r&&(n.current[0]=r,o=!0),r>n.current[1]&&(n.current[1]=r,o=!0)):(n.current=[r,r],o=!0))}o&&a(e=>e+1)},[i,t]),l=pe(()=>{i&&(n.current=null,a(e=>e+1))},[i]);return{domain:ye(()=>{if(i)return n.current??void 0;if(!t||0===o.length)return;const e="function"==typeof t?t:e=>e[t];let r=1/0,a=-1/0;for(const t of o){const o=e(t);if(null==o)continue;const i="number"==typeof o?o:Number(o);Number.isFinite(i)&&(r>i&&(r=i),i>a&&(a=i))}return Number.isFinite(r)&&Number.isFinite(a)?[r,a]:void 0},[o,t,i,r]),trackPushed:s,reset:l}}import{useEffect as be,useMemo as ve,useRef as Ae,useState as we}from"react";var ke="__forecastSegment",Se=null;async function Ce(){return Se||(Se=await import("./chunk-statisticalOverlays-HMYYSGPE.module.min.js")),Se}var Le="__semiotic_resolvedX",Re="__semiotic_resolvedY";function _e(e){const{data:t,xAccessor:o,yAccessor:i,forecast:n,anomaly:r,groupBy:a}=e,s="string"==typeof o?o:Le,l="string"==typeof i?i:Re,c=ve(()=>{if(!n&&!r)return t;const e="function"==typeof o,a="function"==typeof i;return e||a?t.map(t=>{const n={...t};return e&&(n[Le]=o(t)),a&&(n[Re]=i(t)),n}):t},[t,n,r,o,i]),[h,d]=we(null),[u,m]=we([]),p=Ae(n),y=Ae(r);return be(()=>{if(!n&&!r)return void((p.current||y.current)&&(d(null),m([]),p.current=n,y.current=r));let e=!1;const t=n!==p.current||r!==y.current;if(p.current=n,y.current=r,t&&(d(null),m([])),n){const t=a&&"string"==typeof a&&"object"==typeof n?{...n,_groupBy:a}:n;(async function(...e){return(await Ce()).buildForecast(...e)})(c,s,l,t,r).then(t=>{e||(d(t),m(t.annotations))}).catch(()=>{e||(d(null),m([]))})}else r&&async function(...e){return(await Ce()).buildAnomalyAnnotations(...e)}(r).then(t=>{e||(d(null),m(t))}).catch(()=>{e||m([])});return()=>{e=!0}},[c,n,r,s,l,a]),{effectiveData:h?h.processedData:t,statisticalAnnotations:u,hasForecast:!!h,xAccessorKey:s,yAccessorKey:l}}import{jsx as He}from"react/jsx-runtime";var Ie=he(function(t,o){const n=de(null),a=V(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,xLabel:t.xLabel,yLabel:t.yLabel,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),{data:c,margin:h,className:d,xFormat:u,yFormat:p,xAccessor:b="x",yAccessor:A="y",xScaleType:w,yScaleType:k,colorBy:S,colorScheme:C,styleRules:L,sizeBy:R,sizeRange:_=[3,15],symbolBy:H,symbolMap:P,pointRadius:B=5,pointOpacity:F=.8,tooltip:N,marginalGraphics:W,pointIdAccessor:O,annotations:T,regression:E,forecast:z,anomaly:$,xExtent:Q,yExtent:X,frameProps:Y={},selection:U,linkedHover:q,linkedBrush:K,onObservation:J,onClick:Z,hoverHighlight:ee,chartId:te,loading:ne,loadingContent:re,emptyContent:he,legendInteraction:ue,legendPosition:pe,color:ye,stroke:fe,strokeWidth:ge,opacity:be}=t,{width:ve,height:Ae,enableHover:we,showGrid:ke,showLegend:Se,title:Ce,description:Le,summary:Re,accessibleTable:Ie,xLabel:Pe,yLabel:Be}=a,Fe=le(()=>I(c),[c]),De=void 0===c,{domain:Ne,trackPushed:Me,reset:We}=xe({accessor:R,data:Fe,isPushMode:De}),Oe=ce(e=>{Me([e]),n.current?.push(e)},[Me]),Te=ce(e=>{Me(e),n.current?.pushMany(e)},[Me]);r(o,{variant:"xy",frameRef:n,overrides:{push:Oe,pushMany:Te,clear:()=>{We(),n.current?.clear()}}});const Ee=i({data:Fe,rawData:c,colorBy:S,colorScheme:C,legendInteraction:ue,legendPosition:pe,selection:U,linkedHover:q,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:J,onClick:Z,hoverHighlight:ee,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"Scatterplot",chartId:te,showLegend:Se,userMargin:h,marginDefaults:a.marginDefaults,loading:ne,loadingContent:re,emptyContent:he,width:ve,height:Ae,hasTitle:!!Ce,axisChrome:G({showAxes:a.showAxes,xLabel:Pe})}),Ge=M(K),je=j({name:Ge?.name||"__unused_brush__",xField:Ge?.xField||("string"==typeof b?b:void 0),yField:Ge?.yField||("string"==typeof A?A:void 0)}),ze=Ge?"xyBrush"===je.brushInteraction.brush?"xy":"xBrush"===je.brushInteraction.brush?"x":"y":void 0,Ve=se.useRef(je.brushInteraction);Ve.current=je.brushInteraction;const $e=ce(e=>{const t=Ve.current;t.end(e?"xyBrush"===t.brush?[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:"xBrush"===t.brush?e.x:e.y:null)},[]);ae("Scatterplot",Fe,"xAccessor",b),ae("Scatterplot",Fe,"yAccessor",A);const Qe=le(()=>R?Ne??[0,1]:void 0,[R,Ne]),Xe=le(()=>R?e=>D(e,R,_,Qe):void 0,[R,_,Qe]),Ye=le(()=>v(b,A),[b,A]),Ue=me({colorBy:S,colorScale:Ee.colorScale,color:ye,pointRadius:B,fillOpacity:F,radiusFn:Xe,stroke:fe,strokeWidth:ge,opacity:be,styleRules:L,ruleContext:Ye,effectiveSelectionHook:Ee.effectiveSelectionHook,resolvedSelection:Ee.resolvedSelection}),qe=le(()=>g([{label:Pe||m(b),accessor:b,role:"x",format:u},{label:Be||m(A),accessor:A,role:"y",format:p},...S?[{label:m(S),accessor:S,role:"color"}]:[],...R?[{label:m(R),accessor:R,role:"size"}]:[]]),[b,A,Pe,Be,S,R,u,p]),{effectiveData:Ke,statisticalAnnotations:Je}=_e({data:Fe,xAccessor:b,yAccessor:A,forecast:z,anomaly:$}),Ze=le(()=>{const t=e(E);return t||0!==Je.length?[...t?[t]:[],...T||[],...Je]:T},[E,T,Je]);if(Ee.earlyReturn)return Ee.earlyReturn;const et=s({componentName:"Scatterplot",data:c,accessors:{xAccessor:b,yAccessor:A}});if(et)return He(oe,{componentName:"Scatterplot",message:et,width:ve,height:Ae});const tt={chartType:"scatter",...null!=c&&{data:Ke},xAccessor:b,yAccessor:A,xScaleType:w,yScaleType:k,colorAccessor:S||void 0,sizeAccessor:R||void 0,...H&&{symbolAccessor:H},...P&&{symbolMap:P},sizeRange:_,pointStyle:Ue,colorScheme:C,size:[ve,Ae],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:Ee.margin,showAxes:a.showAxes,xLabel:Pe,yLabel:Be,xFormat:u,yFormat:p,enableHover:we,showGrid:ke,...Ee.legendBehaviorProps,...y({title:Ce,description:Le,summary:Re,accessibleTable:Ie,className:d,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...x({tooltip:N,defaultTooltipContent:qe}),...f({linkedHover:q,selection:U,onObservation:J,onClick:Z,hoverHighlight:ee,mobileInteraction:Ee.mobileInteraction,customHoverBehavior:Ee.customHoverBehavior,customClickBehavior:Ee.customClickBehavior}),...W&&{marginalGraphics:W},...O&&{pointIdAccessor:O},...Ze&&Ze.length>0&&{annotations:Ze},...Q&&{xExtent:Q},...X&&{yExtent:X},...Ge&&{brush:{dimension:ze},onBrush:$e},...Ee.crosshairProps,...Y};return He(ie,{componentName:"Scatterplot",width:ve,height:Ae,children:He(l,{ref:n,...tt})})});Ie.displayName="Scatterplot";import{useMemo as Pe,forwardRef as Be,useRef as Fe}from"react";import{Fragment as De,jsx as Ne}from"react/jsx-runtime";function Me(e,t){return N(1===t?.5:e/(t-1))}var We=Be(function(t,o){const n=Fe(null);r(o,{variant:"xy",frameRef:n});const a=V(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,title:t.title,xLabel:t.xLabel,yLabel:t.yLabel,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),{data:c,margin:h,className:d,xFormat:u,yFormat:p,xAccessor:b="x",yAccessor:A="y",orderAccessor:w,orderLabel:k,styleRules:S,pointRadius:L=4,tooltip:R,pointIdAccessor:_,annotations:H,regression:I,forecast:P,anomaly:B,xExtent:F,yExtent:D,frameProps:N={},selection:M,linkedHover:W,onObservation:O,onClick:T,hoverHighlight:E,chartId:j,loading:z,loadingContent:$,emptyContent:Q,legendInteraction:X,stroke:Y,strokeWidth:U,opacity:q}=t,{width:K,height:J,enableHover:Z,showGrid:ee,title:te,description:ne,summary:re,accessibleTable:se,xLabel:le,yLabel:ce}=a,{safeData:he,orderMap:de}=Pe(()=>{const e=c||[],t="function"==typeof b?b:e=>e[b],o="function"==typeof A?A:e=>e[A];let i=e;if(w&&e.length>0){const t="function"==typeof w?w:e=>e[w];i=[...e].sort((e,o)=>{const i=t(e),n=t(o);return(i instanceof Date?i.getTime():+i)-(n instanceof Date?n.getTime():+n)})}const n=new WeakMap;let r=0;for(const e of i){const i=t(e),n=o(e);null!=i&&null!=n&&isFinite(i)&&isFinite(n)&&r++}let a=0;for(const e of i){const i=t(e),s=o(e);null!=i&&null!=s&&isFinite(i)&&isFinite(s)&&n.set(e,{idx:a++,total:r})}return{safeData:i,orderMap:n}},[c,w,b,A]);ae("ConnectedScatterplot",he,"xAccessor",b),ae("ConnectedScatterplot",he,"yAccessor",A);const ue=i({data:he,rawData:c,colorBy:void 0,colorScheme:void 0,legendInteraction:X,selection:M,linkedHover:W,fallbackFields:[],unwrapData:!1,onObservation:O,onClick:T,hoverHighlight:E,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"ConnectedScatterplot",chartId:j,showLegend:void 0,userMargin:h,marginDefaults:a.marginDefaults,loading:z,loadingContent:$,emptyContent:Q,width:K,height:J,hasTitle:!!te,axisChrome:G({showAxes:a.showAxes,xLabel:le})}),pe=ue.resolvedSelection?.unselectedOpacity??C,ye=Pe(()=>(e,t)=>{const o=t.filter(e=>"point"===e.type);if(2>o.length)return;const i=ue.effectiveSelectionHook?.isActive,n=ue.effectiveSelectionHook?.predicate,r=100>o.length,a=o.length;e.lineCap="round";for(let t=0;a-1>t;t++){const s=o[t],l=o[t+1],c=Me(t,a),h=!i||!n||n(s.datum??s)||n(l.datum??l),d=i?h?1:pe:1;r&&(e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(l.x,l.y),e.strokeStyle="white",e.lineWidth=L+2,e.globalAlpha=.5*d,e.stroke()),e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(l.x,l.y),e.strokeStyle=c,e.lineWidth=L,e.globalAlpha=d,e.stroke()}e.globalAlpha=1},[L,ue.effectiveSelectionHook,pe]),fe=Pe(()=>[ye],[ye]),ge=Pe(()=>(e,t,o)=>{const i=e.filter(e=>"point"===e.type);if(2>i.length)return null;const n=i.length,r=100>n,a=[];for(let e=0;n-1>e;e++){const t=i[e],o=i[e+1],s=Me(e,n),l=Math.min("number"==typeof t.style?.opacity?t.style.opacity:1,"number"==typeof o.style?.opacity?o.style.opacity:1);r&&a.push(Ne("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:"white",strokeWidth:L+2,strokeLinecap:"round",opacity:.5*l},"halo-"+e)),a.push(Ne("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:s,strokeWidth:L,strokeLinecap:"round",opacity:l},"seg-"+e))}return Ne(De,{children:a})},[L]),xe=Pe(()=>[ge],[ge]),be=me({colorScale:void 0,baseStyleExtras:Pe(()=>e=>{const t=de.get(e),o=t?.idx??0,i=t?.total??1;return{fill:i>0?Me(o,i):"#6366f1",stroke:"white",strokeWidth:1,r:L,fillOpacity:1}},[L,de]),stroke:Y,strokeWidth:U,opacity:q,styleRules:S,ruleContext:Pe(()=>v(b,A),[b,A]),effectiveSelectionHook:ue.effectiveSelectionHook,resolvedSelection:ue.resolvedSelection}),ve=k||("string"==typeof w?w:"Order"),Ae=Pe(()=>g([{label:le||m(b),accessor:b,role:"x",format:u},{label:ce||m(A),accessor:A,role:"y",format:p},...w?[{label:ve,accessor:w,role:"group"}]:[]]),[b,A,le,ce,w,ve,u,p]),we=s({componentName:"ConnectedScatterplot",data:c,accessors:{xAccessor:b,yAccessor:A}}),{effectiveData:ke,statisticalAnnotations:Se}=_e({data:he,xAccessor:b,yAccessor:A,forecast:P,anomaly:B});if(ue.earlyReturn)return ue.earlyReturn;const Ce=e(I),Le=Ce||Se.length>0?[...Ce?[Ce]:[],...H||[],...Se]:H,Re={chartType:"scatter",...null!=c&&{data:ke},xAccessor:b,yAccessor:A,pointStyle:be,size:[K,J],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ue.margin,showAxes:a.showAxes,xLabel:le,yLabel:ce,xFormat:u,yFormat:p,enableHover:Z,showGrid:ee,...y({title:te,description:ne,summary:re,accessibleTable:se,className:d,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...x({tooltip:R,defaultTooltipContent:Ae}),...f({linkedHover:W,selection:M,onObservation:O,onClick:T,hoverHighlight:E,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior}),..._&&{pointIdAccessor:_},canvasPreRenderers:fe,svgPreRenderers:xe,...Le&&Le.length>0&&{annotations:Le},...F&&{xExtent:F},...D&&{yExtent:D},...ue.crosshairProps,...N};return we?Ne(oe,{componentName:"ConnectedScatterplot",message:we,width:K,height:J}):Ne(ie,{componentName:"ConnectedScatterplot",width:K,height:J,children:Ne(l,{ref:n,...Re})})});We.displayName="ConnectedScatterplot";import{useMemo as Oe,useCallback as Te,useState as Ee,useEffect as Ge,forwardRef as je,useRef as ze}from"react";import{useMemo as Ve}from"react";function $e(e){const{lineWidth:o=2,colorBy:i,colorScale:n,color:r,resolveStroke:a,fillArea:s,areaOpacity:l=.3,stroke:c,strokeWidth:h,opacity:d,effectiveSelectionHook:u,resolvedSelection:m,styleRules:p,ruleContext:y}=e,f=Ve(()=>function(e){const{lineWidth:t=2,colorBy:o,colorScale:i,color:n,resolveStroke:r,fillArea:a,areaOpacity:s=.3,styleRules:l,ruleContext:c}=e;return(e,h)=>{const d={strokeWidth:t},u=!0===a||Array.isArray(a)&&null!=h&&a.includes(h);let m;return r?m=r(e,h):o?i&&(m=P(e,o,i)):m=n||k,void 0!==m&&(d.stroke=m,u&&(d.fill=m,d.fillOpacity=s)),l?.length&&Object.assign(d,A(e,l,c?c(e,h):{value:void 0,category:h})),d}}({lineWidth:o,colorBy:i,colorScale:n,color:r,resolveStroke:a,fillArea:s,areaOpacity:l,styleRules:p,ruleContext:y}),[o,i,n,r,a,s,l,p,y]),g=Ve(()=>t(f,{stroke:c,strokeWidth:h,opacity:d}),[f,c,h,d]);return Ve(()=>J(g,u??null,m),[g,u,m])}import{jsx as Qe}from"react/jsx-runtime";var Xe="__lineObjectSeries",Ye=je(function(e,t){const o=ze(null);r(t,{variant:"xy",frameRef:o});const n=V(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:h,className:d,xFormat:u,yFormat:y,axisExtent:x,xAccessor:b="x",yAccessor:A="y",lineBy:w,lineDataAccessor:S="coordinates",colorBy:C,colorScheme:L,styleRules:H,curve:B="linear",showPoints:F=!1,pointRadius:D=3,fillArea:N=!1,areaOpacity:M=.3,lineWidth:W=2,lineGradient:O,tooltip:T,pointIdAccessor:j,annotations:z,directLabel:$,gapStrategy:Q="break",anomaly:X,forecast:Y,band:U,xExtent:q,yExtent:K,frameProps:J={},selection:Z,linkedHover:ee,onObservation:te,onClick:ne,hoverHighlight:re,hoverRadius:se,chartId:le,loading:ce,loadingContent:he,emptyContent:de,legendInteraction:ue,legendPosition:me,legend:pe,xScaleType:ye,yScaleType:fe,color:ge,stroke:xe,strokeWidth:be,opacity:ve}=e,{legend:Ae,...we}=J,Se=Oe(()=>_(Ae,pe),[Ae,pe]),{width:Le,height:Re,enableHover:He,showGrid:Ie,showLegend:Pe,title:Be,description:Fe,summary:De,accessibleTable:Ne,xLabel:Me,yLabel:We}=n,je=Oe(()=>I(a),[a]),Ve=Array.isArray(je[0]?.[S])?je[0][S]:je;ae("LineChart",Ve,"xAccessor",b),ae("LineChart",Ve,"yAccessor",A);const{effectiveData:Ye,statisticalAnnotations:Ue}=_e({data:je,xAccessor:b,yAccessor:A,forecast:Y,anomaly:X,groupBy:w}),qe="__compoundGroup",Ke=!(!Y||!w),Je=Ke?qe:Y?ke:w,Ze=Oe(()=>{if(!Ke)return Ye;const e="function"==typeof w?w:e=>e[w];return Ye.map(t=>{const o={...t};return o[qe]=`${e(t)}__${t[ke]||"observed"}`,o})},[Ye,Ke,w]),et=Ke?Ze:Ye,tt=C||w,ot=Oe(()=>{if(!Y)return;const e=Y.upperBounds,t=Y.lowerBounds;if(!e&&!t)return;const o="function"==typeof e?e:"string"==typeof e?t=>t[e]:null,i="function"==typeof t?t:"string"==typeof t?e=>e[t]:null;let n=1/0,r=-1/0;const a=Ye;for(const e of a){const t="function"==typeof A?A(e):+e[A];if(isFinite(t)&&(n>t&&(n=t),t>r&&(r=t)),o){const t=o(e);null!=t&&isFinite(t)&&(t>r&&(r=t),n>t&&(n=t))}if(i){const t=i(e);null!=t&&isFinite(t)&&(n>t&&(n=t),t>r&&(r=t))}}return isFinite(n)&&isFinite(r)?[n,r]:void 0},[Y,Ye,A]),it=Te(e=>{const t="function"==typeof b?b(e):e[b],o="function"==typeof A?A(e):e[A];return null==t||null==o||Number.isNaN(t)||Number.isNaN(o)},[b,A]),nt=void 0!==et[0]?.[S],rt=nt?Xe:Je,at=Oe(()=>{if(nt)return et.map((e,t)=>{const o="function"==typeof w?w(e):"string"==typeof w?e[w]:void 0,i=null==o?"line-"+t:o+"",n=Array.isArray(e[S])?e[S]:[];return{...e,[Xe]:i,[S]:n.map(t=>({...t,[Xe]:i,parentLine:e,..."string"==typeof w&&void 0!==e[w]?{[w]:e[w]}:{}}))}});if(Je){const e=et.reduce((e,t)=>{const o="function"==typeof Je?Je(t):t[Je];if(!e[o]){const i={[S]:[]};"string"==typeof Je&&(i[Je]=o),Ke&&(i[ke]=t[ke],"string"==typeof w&&(i[w]=t[w])),e[o]=i}return e[o][S].push(t),e},{});return Object.values(e)}return[{[S]:et}]},[nt,Je,S,et,w,Ke]),{gapProcessedLineData:st,hasGaps:lt}=Oe(()=>{if("interpolate"===Q){let e=!1;const t=[];for(const o of at){const i=(o[S]||[]).filter(t=>!it(t)||(e=!0,!1));i.length>0&&t.push({...o,[S]:i})}return{gapProcessedLineData:t,hasGaps:e}}if("break"===Q){let e=!1;const t=[];for(const o of at){const i=o[S]||[];let n=[],r=0;const a=rt&&"string"==typeof rt?o[rt]:void 0;for(const s of i)if(it(s))e=!0,n.length>0&&(t.push({...o,[S]:n}),n=[],r++);else{const e=null!=a?`${a}__seg${r}`:"__seg"+r;n.push({...s,_gapSegment:e})}n.length>0&&t.push({...o,[S]:n})}return{gapProcessedLineData:t,hasGaps:e}}if("zero"===Q){let e=!1;const t="string"==typeof A?A:"y",o=[];for(const i of at){const n=i[S]||[],r=[];for(const o of n)it(o)?(e=!0,r.push({...o,[t]:0})):r.push(o);o.push({...i,[S]:r})}return{gapProcessedLineData:o,hasGaps:e}}return{gapProcessedLineData:at,hasGaps:!1}},[at,Q,S,it,rt,A]),ct="object"==typeof $?$:{},ht=ct.position||"end",dt=ct.fontSize||11,ut=Oe(()=>{if(!$||!tt)return[];const e="function"==typeof tt?tt:e=>e[tt],t=new Set;for(const o of st){const i=o[S]||[];if(0===i.length)continue;const n=e("end"===ht?i[i.length-1]:i[0])??e(o);if(null==n)continue;const r=n+"";""!==r&&t.add(r)}return Array.from(t)},[$,tt,st,S,ht]),mt=Oe(()=>{if(!$)return n.marginDefaults;const e=ut.reduce((e,t)=>Math.max(e,t.length*(.6*dt)),0)+10,t="end"===ht?"right":"left";return{...n.marginDefaults,[t]:Math.max(n.marginDefaults[t]||0,e)}},[$,ut,dt,ht,n.marginDefaults]),pt=i({data:Ye,rawData:a,colorBy:tt,colorScheme:L,legendInteraction:ue,legendPosition:me,selection:Z,linkedHover:ee,fallbackFields:tt?["string"==typeof tt?tt:""]:[],unwrapData:!1,onObservation:te,onClick:ne,hoverHighlight:re,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"LineChart",chartId:le,showLegend:(!$||void 0!==Pe)&&Pe,legend:Se,userMargin:h,marginDefaults:mt,loading:ce,loadingContent:he,emptyContent:de,width:Le,height:Re,hasTitle:!!Be,axisChrome:G({showAxes:n.showAxes,xLabel:Me})}),yt=pt.colorScale,ft=pt.effectiveSelectionHook,gt=pt.resolvedSelection,xt=pt.customHoverBehavior,bt=pt.customClickBehavior,vt=pt.crosshairProps,At=Oe(()=>{if(tt)return nt?e=>{const t=e.parentLine||e;return"function"==typeof tt?tt(t):t[tt]}:tt},[tt,nt]),wt=Oe(()=>v(b,A),[b,A]),kt=$e({lineWidth:W,colorBy:At,colorScale:yt,color:ge,fillArea:N,areaOpacity:M,stroke:xe,strokeWidth:be,opacity:ve,effectiveSelectionHook:ft,resolvedSelection:gt,styleRules:H,ruleContext:wt}),[St,Ct]=Ee(null);Ge(()=>{if(!Y)return void Ct(null);let e=!1;return async function(...e){return(await Ce()).createSegmentLineStyle(...e)}(kt,Y).then(t=>{e||Ct(()=>t)}).catch(()=>{e||Ct(null)}),()=>{e=!0}},[kt,Y]);const Lt=St||kt,Rt=Oe(()=>{if(F)return e=>{const t={r:D,fillOpacity:1};return tt?yt&&(t.fill=P(e.parentLine||e,tt,yt)):t.fill=ge||k,t}},[F,D,tt,yt,ge]),_t=Array.isArray(N)?"mixed":N?"area":"line",Ht=Oe(()=>{if(!$||!tt)return[];const e="function"==typeof b?b:e=>e[b],t="function"==typeof A?A:e=>e[A],o="function"==typeof tt?tt:e=>e[tt],i=new Map;for(const e of st){const t=e[S]||[];if(0===t.length)continue;const n="end"===ht?t[t.length-1]:t[0],r=o(n)??o(e);if(null==r)continue;const a=r+"";""===a||i.has(a)||i.set(a,n)}const n=Array.from(i.entries()).map(([o,i])=>({type:"text",label:o,["string"==typeof b?b:"x"]:e(i),["string"==typeof A?A:"y"]:t(i),dx:"end"===ht?6:-6,dy:0,color:yt?yt(o):k,fontSize:dt}));n.sort((e,t)=>{const o="string"==typeof A?A:"y";return e[o]-t[o]});for(let e=1;n.length>e;e++){const t="string"==typeof A?A:"y",o=n[e-1],i=n[e];dt+2>Math.abs(i[t]+i.dy-(o[t]+o.dy))&&(i.dy+=dt+2)}return n},[$,tt,yt,st,S,b,A,ht,dt]),It=pt.margin,Pt=w||C,Bt=Oe(()=>g([{label:Me||m(b),accessor:b,role:"x",format:u},{label:We||m(A),accessor:A,role:"y",format:y},...Pt?[{label:m(Pt),accessor:Pt,role:"group"}]:[],...p(U,y)]),[b,A,Me,We,Pt,u,y,U]),Ft=s({componentName:"LineChart",data:nt?Ye[0]?.[S]||[]:a,accessors:{xAccessor:b,yAccessor:A}}),Dt=Oe(()=>nt||rt||lt?st.flatMap(e=>{const t=e[S]||[];return rt&&"string"==typeof rt?t.map(t=>({...t,[rt]:t[rt]??e[rt]})):t}):et,[st,S,nt,rt,et,lt]),Nt=c(O),Mt={chartType:_t,...Array.isArray(N)&&{areaGroups:N},...Nt&&{lineGradient:Nt},...null!=a&&{data:Dt},xAccessor:b,yAccessor:A,xScaleType:ye,yScaleType:fe,...q&&{xExtent:q},...!K||null==K[0]&&null==K[1]?ot?{yExtent:ot}:{}:{yExtent:K},groupAccessor:"break"===Q&&lt?"_gapSegment":rt||void 0,...U&&{band:U},curve:B,lineStyle:Lt,...F&&{pointStyle:Rt},size:[Le,Re],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:It,showAxes:n.showAxes,xLabel:Me,yLabel:We,xFormat:u,yFormat:y,...void 0!==x&&{axisExtent:x},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},enableHover:He,showGrid:Ie,...pt.legendBehaviorProps,...Be&&{title:Be},...Fe&&{description:Fe},...De&&{summary:De},...void 0!==Ne&&{accessibleTable:Ne},...d&&{className:d},...null!=e.animate&&{animate:e.animate},...E({tooltip:T,defaultTooltipContent:Bt,multiDefaultContent:R()}),...f({linkedHover:ee,selection:Z,onObservation:te,onClick:ne,hoverRadius:se,hoverHighlight:re,mobileInteraction:pt.mobileInteraction,customHoverBehavior:xt,customClickBehavior:bt}),...j&&{pointIdAccessor:j},...(z?.length||Ue.length||Ht.length)&&{annotations:[...z||[],...Ue,...Ht]},...vt,...we};return pt.earlyReturn?pt.earlyReturn:Ft?Qe(oe,{componentName:"LineChart",message:Ft,width:Le,height:Re}):Qe(ie,{componentName:"LineChart",width:Le,height:Re,children:Qe(l,{ref:o,...Mt})})});Ye.displayName="LineChart";import{forwardRef as Ue,useMemo as qe}from"react";import{jsx as Ke}from"react/jsx-runtime";var Je=Ue(function(e,t){const{data:o,layout:i,layoutConfig:r,onLayoutError:a,xExtent:s,yExtent:c,showAxes:h=!1,margin:d,className:u,annotations:m,onObservation:p,onClick:g,selection:x,linkedHover:b,hoverHighlight:v,chartId:A,loading:w,loadingContent:k,emptyContent:S,colorBy:C,colorScheme:L,legend:R,legendInteraction:H,legendPosition:I,frameProps:P={}}=e,{legend:B,...F}=P,D=qe(()=>_(B,R),[B,R]),{frameRef:N,resolved:M,safeData:W,setup:O,earlyReturn:T}=n({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"XYCustomChart",unwrapData:!1,data:o,colorBy:C,colorScheme:L,legend:D,legendInteraction:H,legendPosition:I,selection:x,linkedHover:b,hoverHighlight:v,onObservation:p,onClick:g,chartId:A,loading:w,loadingContent:k,emptyContent:S,margin:d,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules,xLabel:e.xLabel,yLabel:e.yLabel}),E=O.effectiveSelectionHook,G=qe(()=>E?.isActive?{isActive:!0,predicate:E.predicate}:null,[E?.isActive,E?.predicate]);if(T)return T;const{width:j,height:z,enableHover:V,showGrid:$,title:Q,description:X,summary:Y,accessibleTable:U,xLabel:q,yLabel:K}=M,J={chartType:"custom",...null!=o&&{data:W},customLayout:i,layoutConfig:r,onLayoutError:a,...G&&{layoutSelection:G},xExtent:s,yExtent:c,colorAccessor:C,colorScheme:L,size:[j,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:O.margin,showAxes:h,xLabel:q,yLabel:K,enableHover:V,showGrid:$,...O.legendBehaviorProps,...y({title:Q,description:X,summary:Y,accessibleTable:U,className:u,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...null!=e.tooltip&&{tooltipContent:e.tooltip},...f({linkedHover:b,selection:x,onObservation:p,onClick:g,hoverRadius:e.hoverRadius,hoverHighlight:v,mobileInteraction:O.mobileInteraction,customHoverBehavior:O.customHoverBehavior,customClickBehavior:O.customClickBehavior}),...m&&m.length>0&&{annotations:m},...O.crosshairProps,...F};return Ke(ie,{componentName:"XYCustomChart",width:j,height:z,children:Ke(l,{ref:N,...J})})});Je.displayName="XYCustomChart";import{forwardRef as Ze,useCallback as et,useMemo as tt}from"react";function ot(e,t,o,i,n){const r=1-n;return r*r*r*e+3*r*r*n*t+3*r*n*n*o+n*n*n*i}function it(e,t,o,i,n){const r=1-n;return 3*r*r*(t-e)+6*r*n*(o-t)+3*n*n*(i-o)}function nt(e,t,o,i,n){const r=[],a=(e.x+t.x)/2;for(let s=0;n>=s;s++){const l=s/n;let c,h,d,u;"linear"===i?(c=e.x+(t.x-e.x)*l,h=e.y+(t.y-e.y)*l,d=t.x-e.x,u=t.y-e.y):(c=ot(e.x,a,a,t.x,l),h=ot(e.y,e.y,t.y,t.y,l),d=it(e.x,a,a,t.x,l),u=it(e.y,e.y,t.y,t.y,l)),r.push({x:c,y:h,dx:d,dy:u,radius:e.radius+(t.radius-e.radius)*l,datumIndex:.5>l?o:o+1})}return r}function rt(e,t={}){const o=[],i=[],n=[];if(2>e.length)return{topPath:o,bottomPath:i,datumIndices:n};const r=t.curve??"smooth",a=Math.max(2,Math.floor(t.samplesPerSegment??12));for(let t=0;e.length-1>t;t++){const s=nt(e[t],e[t+1],t,r,a);for(let e=0===t?0:1;s.length>e;e++){const t=s[e],r=Math.hypot(t.dx,t.dy)||1,a=-t.dy/r,l=t.dx/r,c=Math.max(0,t.radius);o.push([t.x+a*c,t.y+l*c]),i.push([t.x-a*c,t.y-l*c]),n.push(t.datumIndex)}}return{topPath:o,bottomPath:i,datumIndices:n}}import{jsx as at,jsxs as st}from"react/jsx-runtime";function lt(e,t,o){return"function"==typeof e?e(t,o):t[e]}function ct(e){return e instanceof Date?"date:"+e.getTime():`${typeof e}:${e+""}`}function ht(e,t={}){const o=t.xAccessor??"x",i=t.yAccessor??"y",n=t.lineBy??"series",r=t.rankDirection??"descending",a=[],s=new Map,l=new Map,c=[],h=new Map;let d=1/0,u=-1/0;e.forEach((e,t)=>{const r=lt(o,e,t),m=ct(r);let p=s.get(m);null==p&&(p=a.length,s.set(m,p),a.push(r),l.set(p,[]));const y=lt(n,e,t)+"";h.has(y)||(h.set(y,c.length),c.push(y));const f=Number(lt(i,e,t));Number.isFinite(f)&&(d=Math.min(d,f),u=Math.max(u,f),l.get(p)?.push({datum:e,inputIndex:t,series:y,value:f}))});const m=[],p=new Map,y=new Map;for(let e=0;a.length>e;e++){const t=l.get(e)??[];t.sort((e,t)=>("descending"===r?t.value-e.value:e.value-t.value)||(h.get(e.series)??0)-(h.get(t.series)??0)),t.forEach((t,o)=>{const i=o+1;m.push({datum:t.datum,xIndex:e,xValue:a[e],series:t.series,value:t.value,rank:i}),p.set(t.series,(p.get(t.series)??0)+i),y.set(t.series,(y.get(t.series)??0)+1)})}const f=c.length+1,g=[...c].sort((e,t)=>{const o=y.get(e)??0,i=y.get(t)??0;return((p.get(e)??0)+(a.length-o)*f)/Math.max(1,a.length)-((p.get(t)??0)+(a.length-i)*f)/Math.max(1,a.length)||(h.get(e)??0)-(h.get(t)??0)}),x=new Set(g.slice(0,null==t.highlightTop?g.length:Math.max(0,Math.floor(t.highlightTop))));return{data:m.map(e=>{const t=x.has(e.series);return{...e.datum,x:e.xIndex,y:e.rank,__bumpRaw:e.datum,__bumpSeries:e.series,__bumpColorGroup:t?e.series:"Other",__bumpValue:e.value,__bumpRank:e.rank,__bumpXValue:e.xValue,__bumpHighlighted:t}}),xValues:a,seriesOrder:c,overallOrder:g,valueExtent:d===1/0?[0,0]:[d,u]}}function dt({datum:e,x:t,y:o,side:i,color:n,highlighted:r,labelStyle:a}){const s=b(),l=s.isActive&&!s.predicate(e),c="function"==typeof a?a(e.__bumpRaw):a;return at("text",{className:"semiotic-bump-label",x:t+("end"===i?8:-8),y:o,dy:"0.35em",textAnchor:"end"===i?"start":"end",fill:n,fillOpacity:l?.16:1,fontWeight:r?650:450,fontSize:12,style:{pointerEvents:"none",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-axis-label-font-size, 12px)",...c},children:e.__bumpSeries})}function ut(e,t,o){const[i,n]=t,[r,a]=o;return n===i?(r+a)/2:r+(a-r)*Math.max(0,Math.min(1,(e-i)/(n-i)))}function mt(e){const t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:void 0}function pt(e){return{value:e.__bumpValue,x:mt(e.__bumpXValue),y:e.__bumpValue,category:e.__bumpSeries}}function yt(e){const t=e.config,o=new Map;for(const t of e.data){const e=o.get(t.__bumpSeries)??[];e.push(t),o.set(t.__bumpSeries,e)}const i=t.seriesOrder.filter(e=>o.has(e)).sort((e,i)=>(o.get(e)?.[0]?.__bumpHighlighted?1:0)-(o.get(i)?.[0]?.__bumpHighlighted?1:0)||t.seriesOrder.indexOf(e)-t.seriesOrder.indexOf(i)),n=[],r=[];for(const a of i){const i=(o.get(a)??[]).sort((e,t)=>e.x-t.x);if(2>i.length)continue;const s=i[0].__bumpHighlighted,l=e.resolveColor(i[0].__bumpSeries,i[0]),c=t.color??(s?l:t.neutralColor??e.theme.semantic.textSecondary??e.theme.semantic.border??l),h=i.map(o=>({x:e.scales.x(o.x),y:e.scales.y(o.y),radius:t.ribbon?ut(o.__bumpValue,t.valueExtent,t.ribbonSizeRange)/2:Math.max(.5,t.lineWidth/2)})),d=rt(h,{curve:t.curve,samplesPerSegment:t.samplesPerSegment}),u=d.datumIndices.map(e=>i[e]),m={fill:c,fillOpacity:1,opacity:s?t.ribbon?t.ribbonOpacity:t.lineOpacity:Math.min(t.ribbon?t.ribbonOpacity:t.lineOpacity,.58)};t.styleRules?.length&&Object.assign(m,A(i[0].__bumpRaw,t.styleRules,pt(i[0]))),t.areaStyle&&Object.assign(m,t.areaStyle(i[0].__bumpRaw)??{}),void 0!==t.stroke&&(m.stroke=t.stroke),void 0!==t.strokeWidth&&(m.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(m.opacity=t.opacity),n.push({type:"area",topPath:d.topPath,bottomPath:d.bottomPath,style:m,datum:u,accessibleDatum:i.map(e=>e.__bumpRaw),accessibility:{label:a+" ranking trajectory",tableFields:i.map(e=>e.__bumpRaw)},group:a,interactive:!0}),t.showPoints&&i.forEach((e,o)=>{const i={fill:c,stroke:"none",opacity:s?1:.75};t.styleRules?.length&&Object.assign(i,A(e.__bumpRaw,t.styleRules,pt(e))),t.pointStyle&&Object.assign(i,t.pointStyle(e.__bumpRaw)??{}),void 0!==t.stroke&&(i.stroke=t.stroke),void 0!==t.strokeWidth&&(i.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(i.opacity=t.opacity),n.push({type:"point",x:h[o].x,y:h[o].y,r:i.r??t.pointRadius,style:i,datum:e,accessibleDatum:e.__bumpRaw,accessibility:{label:`${a}, rank ${e.__bumpRank}, value ${e.__bumpValue}`},pointId:`${a}:${e.x}`})});const p=!0===t.showLabels?"end":t.showLabels,y=(e,o,i)=>{r.push(at(dt,{datum:e,x:h[o].x,y:h[o].y,side:i,color:"string"==typeof m.fill?m.fill:c,highlighted:s,labelStyle:t.labelStyle},`${a}-${i}`))};"start"!==p&&"both"!==p||y(i[0],0,"start"),"end"!==p&&"both"!==p||y(i.at(-1),i.length-1,"end")}return{nodes:n,overlays:r.length?at("g",{className:"semiotic-bump-labels",children:r}):void 0,restyle:(e,t)=>{const o=function(e){const t=Array.isArray(e.datum)?e.datum[0]:e.datum;return t&&"object"==typeof t&&"__bumpSeries"in t?t:void 0}(e);if(t?.isActive&&o&&!t.predicate(o))return{opacity:.14}}}}var ft=Ze(function(e,t){const o=q(),i=te(),{data:n,xAccessor:r,yAccessor:a,lineBy:s,rankDirection:l="descending",ribbon:c=!1,curve:h="smooth",ribbonSizeRange:d=[4,28],samplesPerSegment:u=12,lineWidth:m=3,highlightTop:p,neutralColor:y,styleRules:f,labelStyle:g,colorScheme:x,ribbonOpacity:b=.82,lineOpacity:v=.9,showPoints:A=!1,pointRadius:w=3,showLabels:k=!0,showAxes:S=!0,showGrid:C=!0,showLegend:L=!1,enableHover:R=!0,hoverHighlight:_=!0,tooltip:I,frameProps:P={},xFormat:B,yFormat:F,onClick:D}=e,N=tt(()=>ht(n,{xAccessor:r,yAccessor:a,lineBy:s,rankDirection:l,highlightTop:p}),[n,r,a,s,l,p]),{axes:M,areaStyle:T,pointStyle:E,...G}=P,j=tt(()=>function(e){const{seriesOrder:t,overallOrder:o,highlightTop:i,color:n,colorScheme:r,neutralColor:a,themeCategorical:s,themeNeutral:l}=e;if(null==i&&null==n)return r;const c=new Set(o.slice(0,null==i?o.length:Math.max(0,Math.floor(i)))),h=new Map,d={};for(const e of t)d[e]=n??(c.has(e)?O(void 0,s,r,e,h):a??l??"#b8bec8");return d}({seriesOrder:N.seriesOrder,overallOrder:N.overallOrder,highlightTop:p,color:e.color,colorScheme:x,neutralColor:y,themeCategorical:o,themeNeutral:i.colors.textSecondary}),[N.seriesOrder,N.overallOrder,p,e.color,x,y,o,i.colors.textSecondary]),z=tt(()=>({ribbon:c,curve:h,samplesPerSegment:u,ribbonSizeRange:d,valueExtent:N.valueExtent,seriesOrder:N.seriesOrder,lineWidth:m,ribbonOpacity:b,lineOpacity:v,neutralColor:y,color:e.color,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,styleRules:f,areaStyle:T,pointStyle:E,labelStyle:g,showPoints:A,pointRadius:w,showLabels:k}),[c,h,u,d,N.valueExtent,N.seriesOrder,m,b,v,y,e.color,e.stroke,e.strokeWidth,e.opacity,f,T,E,g,A,w,k]),V=et((e,t)=>{if(0===N.xValues.length)return"";const o=N.xValues[Math.max(0,Math.min(N.xValues.length-1,Math.round(Number(e))))];return B?B(o,t):(o instanceof Date?o.toLocaleDateString():o)+""},[N.xValues,B]),$=et(e=>F?F(e):e.toLocaleString(),[F]),Q=tt(()=>"multi"===I?void 0:W(I),[I]),X=et(e=>{const t=e?.data??e;return t?!1===I?null:Q?Q({...e,data:t.__bumpRaw,__semioticHoverData:!0}):st("div",{className:"semiotic-tooltip",style:H,children:[at("div",{style:{fontWeight:700},children:t.__bumpSeries}),st("div",{children:[V(t.x)," · Rank ",t.__bumpRank]}),st("div",{children:["Value: ",$(t.__bumpValue)]})]}):null},[$,V,Q,I]),Y=tt(()=>{if(D)return(e,t)=>{D(e.__bumpRaw??e,t)}},[D]),U=Math.max(1,N.seriesOrder.length),K=N.xValues.map((e,t)=>t),J=Array.from({length:U},(e,t)=>t+1),Z=M??[{orient:"left",tickValues:J,tickFormat:e=>e+"",label:e.yLabel??"Rank",baseline:!1},{orient:"bottom",tickValues:K,tickFormat:V,label:e.xLabel,tickAnchor:"edges"}],ee=tt(()=>function(e,t){if(!e?.length)return;const o=new Map(t.map((e,t)=>[ct(e),t]));return e.map(e=>{const t={...e},i=i=>{if(!(i in e))return;const n=o.get(ct(e[i]));void 0!==n&&(t[i]=n)};return i("x"),i("x0"),i("x1"),"string"!=typeof e.type||"x-threshold"!==e.type&&"x"!==e.type||i("value"),t})}(e.annotations,N.xValues),[e.annotations,N.xValues]);return at(Je,{ref:t,data:N.data,layout:yt,layoutConfig:z,xExtent:[0,Math.max(1,N.xValues.length-1)],yExtent:[U+.5,.5],showAxes:S,showGrid:C,showLegend:L,enableHover:R,hoverHighlight:_,colorBy:"__bumpSeries",colorScheme:j,tooltip:X,onClick:Y,hoverRadius:e.hoverRadius,width:e.width,height:e.height,responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,responsiveRules:e.responsiveRules,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,mode:e.mode,margin:e.margin??{top:20,right:k?110:24,bottom:48,left:48},className:e.className,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,selection:e.selection,linkedHover:e.linkedHover,legend:e.legend,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,onObservation:e.onObservation,chartId:e.chartId,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,animate:e.animate,autoPlaceAnnotations:e.autoPlaceAnnotations,annotations:ee,xLabel:e.xLabel,yLabel:e.yLabel??"Rank",frameProps:{axes:Z,axisExtent:"exact",...G}})});ft.displayName="BumpChart";import{useMemo as gt,forwardRef as xt,useRef as bt}from"react";import{useMemo as vt}from"react";function At(e){const{safeData:o,data:i,areaBy:n,lineDataAccessor:r,colorBy:a,colorScale:s,color:l,stroke:c,strokeWidth:h,opacity:d,effectiveSelectionHook:u,resolvedSelection:y,areaOpacity:f,showLine:x,lineWidth:b,showPoints:v,pointRadius:w,xAccessor:S,yAccessor:C,xLabel:L,yLabel:R,xFormat:_,yFormat:H,groupField:I,styleRules:B,ruleContext:F}=e,D=vt(()=>function({data:e,safeData:t,areaBy:o,lineDataAccessor:i}){if(null==e)return[];const n=void 0!==t[0]?.[i];if(!n&&!o)return t;let r;if(n)r=t;else{const e=t.reduce((e,t)=>{const n="function"==typeof o?o(t):t[o],r=n+"";if(!e[r]){const t={[i]:[]};"string"==typeof o&&(t[o]=n),e[r]=t}return e[r][i].push(t),e},{});r=Object.values(e)}return r.flatMap(e=>{const t=Array.isArray(e[i])?e[i]:[];return"string"==typeof o?t.map(t=>({...t,[o]:t[o]??e[o]})):t})}({data:i,safeData:o,areaBy:n,lineDataAccessor:r}),[i,o,n,r]),N=vt(()=>e=>{const t={};if(a){if(s){const o=P(e,a,s);t.fill=o,x?(t.stroke=o,t.strokeWidth=b):t.stroke="none"}}else{const e=l||k;t.fill=e,x?(t.stroke=e,t.strokeWidth=b):t.stroke="none"}return t.fillOpacity=f,B&&B.length>0&&Object.assign(t,A(e,B,F?F(e):{value:void 0})),t},[a,s,l,f,x,b,B,F]),M=vt(()=>t(N,{stroke:c,strokeWidth:h,opacity:d}),[N,c,h,d]);return{flattenedData:D,lineStyle:vt(()=>J(M,u??null,y),[M,u,y]),pointStyle:vt(()=>{if(v)return e=>{const t={r:w,fillOpacity:1};return a?s&&(t.fill=P(e.parentLine||e,a,s)):t.fill=l||k,t}},[v,w,a,s,l]),defaultTooltipContent:vt(()=>g([{label:L||m(S),accessor:S,role:"x",format:_},{label:R||m(C),accessor:C,role:"y",format:H},...I?[{label:m(I),accessor:I,role:"group"}]:[],...p(e.band,H)]),[S,C,L,R,I,_,H,e.band])}}import{jsx as wt}from"react/jsx-runtime";var kt=xt(function(e,t){const o=bt(null);r(t,{variant:"xy",frameRef:o});const n=V(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:m,className:p,xFormat:g,yFormat:x,xAccessor:b="x",yAccessor:A="y",areaBy:w,y0Accessor:k,gradientFill:S=!1,semanticGradient:C,semanticLine:L=!0,lineDataAccessor:_="coordinates",colorBy:H,colorScheme:P,styleRules:B,curve:F="monotoneX",areaOpacity:D=.7,lineGradient:N,showLine:M=!0,lineWidth:W=2,showPoints:O=!1,pointRadius:T=3,tooltip:j,annotations:z,forecast:$,anomaly:Q,band:X,xExtent:Y,yExtent:U,frameProps:q={},selection:K,linkedHover:J,onObservation:Z,onClick:ee,hoverHighlight:te,chartId:ne,loading:re,loadingContent:se,emptyContent:le,legendInteraction:ce,legendPosition:he,color:de,stroke:ue,strokeWidth:me,opacity:pe}=e,{width:ye,height:fe,enableHover:ge,showGrid:xe,showLegend:be,title:ve,description:Ae,summary:we,accessibleTable:ke,xLabel:Se,yLabel:Ce}=n,Le=gt(()=>I(a),[a]),Re=H||w,He=gt(()=>d(C),[C]),Ie=gt(()=>He?.stops.length?u(He):h(S),[He,S]),Pe=gt(()=>c(N),[N]),Be=gt(()=>L&&He?.stops.length?He.stops.flatMap(({offset:e,color:t})=>t?[{offset:e,color:t}]:[]):void 0,[He,L]);ae("AreaChart",Le,"xAccessor",b),ae("AreaChart",Le,"yAccessor",A);const Fe=i({data:Le,rawData:a,colorBy:Re,colorScheme:P,legendInteraction:ce,legendPosition:he,selection:K,linkedHover:J,fallbackFields:Re?["string"==typeof Re?Re:""]:[],unwrapData:!1,onObservation:Z,onClick:ee,hoverHighlight:te,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"AreaChart",chartId:ne,showLegend:be,userMargin:m,marginDefaults:n.marginDefaults,loading:re,loadingContent:se,emptyContent:le,width:ye,height:fe,hasTitle:!!ve,axisChrome:G({showAxes:n.showAxes,xLabel:Se})}),{effectiveData:De,statisticalAnnotations:Ne}=_e({data:Le,xAccessor:b,yAccessor:A,forecast:$,anomaly:Q,groupBy:w}),Me=gt(()=>v(b,A),[b,A]),{flattenedData:We,lineStyle:Oe,pointStyle:Te,defaultTooltipContent:Ee}=At({safeData:De,data:a,areaBy:w,lineDataAccessor:_,colorBy:Re,colorScale:Fe.colorScale,color:de,stroke:ue,strokeWidth:me,opacity:pe,effectiveSelectionHook:Fe.effectiveSelectionHook,resolvedSelection:Fe.resolvedSelection,areaOpacity:D,showLine:M,lineWidth:W,showPoints:O,pointRadius:T,xAccessor:b,yAccessor:A,xLabel:Se,yLabel:Ce,xFormat:g,yFormat:x,groupField:w||H,band:X,styleRules:B,ruleContext:Me}),Ge=s({componentName:"AreaChart",data:a,accessors:{xAccessor:b,yAccessor:A}}),je={chartType:"area",...null!=a&&{data:We},xAccessor:b,yAccessor:A,groupAccessor:w||void 0,...k&&{y0Accessor:k},...X&&{band:X},...Ie&&{gradientFill:Ie},...Pe&&{lineGradient:Pe},...Be&&{semanticLineStops:Be},curve:F,lineStyle:Oe,...O&&Te&&{pointStyle:Te},size:[ye,fe],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Fe.margin,showAxes:n.showAxes,xLabel:Se,yLabel:Ce,xFormat:g,yFormat:x,enableHover:ge,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:xe,...Fe.legendBehaviorProps,...y({title:ve,description:Ae,summary:we,accessibleTable:ke,className:p,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:j,defaultTooltipContent:Ee,multiDefaultContent:R()}),...f({linkedHover:J,selection:K,onObservation:Z,onClick:ee,hoverHighlight:te,mobileInteraction:Fe.mobileInteraction,customHoverBehavior:Fe.customHoverBehavior,customClickBehavior:Fe.customClickBehavior}),...(z&&z.length>0||Ne.length>0)&&{annotations:[...z||[],...Ne]},...Y&&{xExtent:Y},...U&&{yExtent:U},...Fe.crosshairProps,...q};return Fe.earlyReturn?Fe.earlyReturn:Ge?wt(oe,{componentName:"AreaChart",message:Ge,width:ye,height:fe}):wt(ie,{componentName:"AreaChart",width:ye,height:fe,children:wt(l,{ref:o,...je})})});kt.displayName="AreaChart";import{useMemo as St,forwardRef as Ct,useRef as Lt,useState as Rt,useImperativeHandle as _t,useCallback as Ht}from"react";import{jsx as It,jsxs as Pt}from"react/jsx-runtime";function Bt(e){if(null==e)return NaN;if("number"==typeof e)return e;if(e instanceof Date)return e.getTime();if("string"==typeof e){if(""===e.trim())return NaN;const t=+e;return Number.isFinite(t)?t:NaN}return NaN}var Ft=Ct(function(e,t){const o=Lt(null),n=V(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:a,className:s,xFormat:c,yFormat:d,xAccessor:u="x",seriesAAccessor:m="a",seriesBAccessor:p="b",seriesALabel:g="A",seriesBLabel:x="B",seriesAColor:b="var(--semiotic-danger, #dc2626)",seriesBColor:v="var(--semiotic-info, #2563eb)",showLines:A=!0,lineWidth:w=1.5,showPoints:k=!1,pointRadius:S=3,curve:C="linear",areaOpacity:L=.6,gradientFill:R,tooltip:_,annotations:P,xExtent:B,yExtent:F,frameProps:D={},selection:N,linkedHover:M,onObservation:W,onClick:O,hoverHighlight:T,chartId:j,loading:z,loadingContent:$,emptyContent:Q,legendInteraction:X,legendPosition:Y,pointIdAccessor:U,windowSize:q}=e,{width:K,height:J,enableHover:Z,showGrid:ee,showLegend:te,title:oe,description:ne,summary:re,accessibleTable:ae,xLabel:se,yLabel:le}=n,ce=St(()=>"function"==typeof u?e=>Bt(u(e)):e=>Bt(e[u]),[u]),he=St(()=>"function"==typeof m?e=>Bt(m(e)):e=>Bt(e[m]),[m]),de=St(()=>"function"==typeof p?e=>Bt(p(e)):e=>Bt(e[p]),[p]),[ue,me]=Rt([]),pe=Lt([]),ye=null==r,fe=St(()=>I(ye?ue:r),[ye,ue,r]),ge=St(()=>function(e,t,o,i){if(!e.length)return[];const n=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];let a=0,s=null,l=null,c=[];const h=(e,t)=>e>t?"A":t>e?"B":null,d=e=>`seg-${a}-${e}`,u=e=>r.push(e),m=(e,t)=>{u({__x:e.x,__y:e.y,__y0:e.y,__diffSegment:d(t),__diffWinner:t,__valA:e.y,__valB:e.y,__sourceDatum:e.datum})};for(let e=0;n.length>e;e++){const r=n[e],p=t(r),y=o(r),f=i(r);if(!Number.isFinite(p)||!Number.isFinite(y)||!Number.isFinite(f))continue;const g=h(y,f);if(null!==g)if(null!=s){if(l&&l.w!==g){let e,t;if(c.length>0)e=c[0].x,t=c[0].y;else{const o=y-l.a-(f-l.b);if(0!==o){const i=Math.max(0,Math.min(1,(l.b-l.a)/o));e=l.x+i*(p-l.x),t=l.a+i*(y-l.a)}else e=l.x,t=l.a}u({__x:e,__y:t,__y0:t,__diffSegment:d(s),__diffWinner:s,__valA:t,__valB:t}),a++,s=g,u({__x:e,__y:t,__y0:t,__diffSegment:d(s),__diffWinner:s,__valA:t,__valB:t});for(let e=1;c.length>e;e++)m(c[e],s)}else for(const e of c)m(e,s);c=[],u({__x:p,__y:f>y?f:y,__y0:f>y?y:f,__diffSegment:d(s),__diffWinner:s,__valA:y,__valB:f,__sourceDatum:r}),l={x:p,a:y,b:f,w:g}}else{s=g;for(const e of c)m(e,s);c=[],u({__x:p,__y:f>y?f:y,__y0:f>y?y:f,__diffSegment:d(s),__diffWinner:s,__valA:y,__valB:f,__sourceDatum:r}),l={x:p,a:y,b:f,w:g}}else c.push({x:p,y:y,datum:r})}for(const e of c)m(e,s??"A");return r}(fe,ce,he,de),[fe,ce,he,de]),xe=St(()=>A?function(e,t,o,i){if(!e.length)return[];const n=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];for(const e of n){const n=t(e),a=o(e),s=i(e);Number.isFinite(a)&&r.push({__x:n,__y:a,__diffSegment:"line-A"}),Number.isFinite(s)&&r.push({__x:n,__y:s,__diffSegment:"line-B"})}return r}(fe,ce,he,de):[],[A,fe,ce,he,de]),be=St(()=>[...ge,...xe],[ge,xe]),ve=St(()=>{const e=new Set;for(const t of ge)e.add(t.__diffSegment);return Array.from(e)},[ge]);_t(t,()=>{const e=e=>{const t=q&&e.length>q?e.slice(e.length-q):e;pe.current=t,me(t)},t=U?"function"==typeof U?U:e=>e[U]:null;return{push:t=>e([...pe.current,t]),pushMany:t=>e([...pe.current,...t]),remove:o=>{if(!t)return[];const i=Array.isArray(o)?o:[o],n=[],r=[];for(const e of pe.current)i.includes(t(e))?n.push(e):r.push(e);return e(r),n},update:(o,i)=>{if(!t)return[];const n=Array.isArray(o)?o:[o],r=[],a=pe.current.map(e=>{if(n.includes(t(e))){const t=i(e);return r.push(t),t}return e});return e(a),r},clear:()=>e([]),getData:()=>ye?pe.current:fe,getScales:()=>o.current?.getScales()??null}},[ye,fe,U,q]);const Ae=i({data:fe,rawData:r,colorBy:"__diffWinner",colorScheme:[b,v],legendInteraction:X,legendPosition:Y,selection:N,linkedHover:M,fallbackFields:["__diffWinner"],unwrapData:!1,onObservation:W,onClick:O,hoverHighlight:T,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DifferenceChart",chartId:j,showLegend:te,userMargin:a,marginDefaults:n.marginDefaults,loading:z,loadingContent:$,emptyContent:Q,width:K,height:J,hasTitle:!!oe,axisChrome:G({showAxes:n.showAxes,xLabel:se})}),we=St(()=>{if(!1!==te)return{legendGroups:[{label:"",type:"fill",styleFn:e=>({fill:e.color||"currentColor"}),items:[{label:g,color:b},{label:x,color:v}]}]}},[te,g,x,b,v]),ke=Ht(e=>{const t=e.__diffSegment;return{fill:"A"==(t?.endsWith("-A")?"A":"B")?b:v,stroke:"none",fillOpacity:L}},[b,v,L]),Se=Ht(e=>({stroke:"A"==("line-A"===e.__diffSegment?"A":"B")?b:v,strokeWidth:w,fill:"none"}),[b,v,w]),Ce=Ht(e=>({fill:"A"==("line-A"===e.__diffSegment?"A":"B")?b:v,r:S}),[b,v,S]),Le=Ht(e=>{const t=e.data,o=e.allSeries,i=e.xValue??t?.__x;let n=t?.__valA,r=t?.__valB;if(o&&o.length>0){const e=o.find(e=>"line-A"===e.group),t=o.find(e=>"line-B"===e.group);null!=e?.value&&Number.isFinite(e.value)&&(n=e.value),null!=t?.value&&Number.isFinite(t.value)&&(r=t.value)}if(null!=i&&(null==n||null==r)){const e=fe.find(e=>ce(e)===i);e&&(null==n&&(n=he(e)),null==r&&(r=de(e)))}const a=e=>null!=e&&Number.isFinite(e)?""+Math.round(100*e)/100:"—",s=c&&null!=i?c(i):null!=i?i+"":"";return Pt("div",{className:"semiotic-tooltip",style:H,children:[s&&It("div",{style:{fontWeight:600,marginBottom:4},children:s}),Pt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[It("span",{style:{width:10,height:10,background:b,display:"inline-block",borderRadius:2}}),Pt("span",{children:[g,": ",a(n)]})]}),Pt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[It("span",{style:{width:10,height:10,background:v,display:"inline-block",borderRadius:2}}),Pt("span",{children:[x,": ",a(r)]})]}),null!=n&&null!=r&&Number.isFinite(n)&&Number.isFinite(r)&&Pt("div",{style:{marginTop:4,opacity:.7},children:["Δ = ",a(n-r)]})]})},[fe,ce,he,de,c,b,v,g,x]),{tooltipContent:Re,tooltipMode:_e}=St(()=>E({tooltip:_,defaultTooltipContent:Le,multiDefaultContent:Le}),[_,Le]),He=St(()=>h(R,{stops:[{offset:0,opacity:.85},{offset:1,opacity:.15}]}),[R]);if(Ae.earlyReturn)return Ae.earlyReturn;const Ie={chartType:"mixed",data:be,xAccessor:"__x",yAccessor:"__y",y0Accessor:"__y0",groupAccessor:"__diffSegment",areaGroups:ve,curve:C,areaStyle:ke,lineStyle:Se,...k&&{pointStyle:Ce},size:[K,J],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Ae.margin,showAxes:n.showAxes,xLabel:se,yLabel:le,xFormat:c,yFormat:d,enableHover:Z,showGrid:ee,...He&&{gradientFill:He},...we&&{legend:we,legendPosition:Ae.legendPosition},...y({title:oe,description:ne,summary:re,accessibleTable:ae,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),tooltipContent:Re,..."multi"===_e&&{tooltipMode:"multi"},...f({linkedHover:M,selection:N,onObservation:W,onClick:O,hoverHighlight:T,mobileInteraction:Ae.mobileInteraction,customHoverBehavior:Ae.customHoverBehavior,customClickBehavior:Ae.customClickBehavior}),...P&&P.length>0&&{annotations:P},...B&&{xExtent:B},...F&&{yExtent:F},...Ae.crosshairProps,...D};return It(ie,{componentName:"DifferenceChart",width:K,height:J,children:It(l,{ref:o,...Ie})})});"function"==typeof Ft&&(Ft.displayName="DifferenceChart");import{useMemo as Dt,forwardRef as Nt,useRef as Mt}from"react";import{jsx as Wt}from"react/jsx-runtime";var Ot=Nt(function(e,t){const o=Mt(null),n=V(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:c,className:h,xFormat:d,yFormat:u,xAccessor:m="x",yAccessor:p="y",areaBy:g,lineDataAccessor:x="coordinates",colorBy:b,colorScheme:A,styleRules:w,curve:k="monotoneX",areaOpacity:S=.7,showLine:C=!0,lineWidth:L=2,showPoints:_=!1,pointRadius:H=3,normalize:P=!1,baseline:B="zero",stackOrder:F,tooltip:D,annotations:N,xExtent:M,yExtent:W,frameProps:O={},selection:T,linkedHover:j,onObservation:z,onClick:$,hoverHighlight:Q,chartId:X,loading:Y,loadingContent:U,emptyContent:q,legendInteraction:K,legendPosition:J,color:Z,stroke:ee,strokeWidth:te,opacity:ne}=e,{width:re,height:ae,enableHover:se,showGrid:le,showLegend:ce,title:he,description:de,summary:ue,accessibleTable:me,xLabel:pe,yLabel:ye}=n,fe=Dt(()=>I(a),[a]),ge=b||g;r(t,{variant:"xy",frameRef:o});const xe=i({data:fe,rawData:a,colorBy:ge,colorScheme:A,legendInteraction:K,legendPosition:J,selection:T,linkedHover:j,fallbackFields:ge?["string"==typeof ge?ge:""]:[],unwrapData:!1,onObservation:z,onClick:$,hoverHighlight:Q,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"StackedAreaChart",chartId:X,showLegend:ce,userMargin:c,marginDefaults:n.marginDefaults,loading:Y,loadingContent:U,emptyContent:q,width:re,height:ae,hasTitle:!!he,axisChrome:G({showAxes:n.showAxes,xLabel:pe})}),be=Dt(()=>v(m,p),[m,p]),{flattenedData:ve,lineStyle:Ae,pointStyle:we,defaultTooltipContent:ke}=At({safeData:fe,data:a,areaBy:g,lineDataAccessor:x,colorBy:ge,colorScale:xe.colorScale,color:Z,stroke:ee,strokeWidth:te,opacity:ne,effectiveSelectionHook:xe.effectiveSelectionHook,resolvedSelection:xe.resolvedSelection,areaOpacity:S,showLine:C,lineWidth:L,showPoints:_,pointRadius:H,xAccessor:m,yAccessor:p,xLabel:pe,yLabel:ye,xFormat:d,yFormat:u,groupField:g||b,styleRules:w,ruleContext:be}),Se=s({componentName:"StackedAreaChart",data:a,accessors:{xAccessor:m,yAccessor:p}}),Ce={chartType:"stackedarea",...null!=a&&{data:ve},xAccessor:m,yAccessor:p,groupAccessor:g||void 0,curve:k,normalize:P,baseline:P?"zero":B,stackOrder:F,lineStyle:Ae,..._&&we&&{pointStyle:we},size:[re,ae],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:xe.margin,showAxes:n.showAxes,xLabel:pe,yLabel:ye,xFormat:d,yFormat:u,enableHover:se,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:le,...xe.legendBehaviorProps,...y({title:he,description:de,summary:ue,accessibleTable:me,className:h,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:D,defaultTooltipContent:ke,multiDefaultContent:R()}),...f({linkedHover:j,selection:T,onObservation:z,onClick:$,hoverHighlight:Q,mobileInteraction:xe.mobileInteraction,customHoverBehavior:xe.customHoverBehavior,customClickBehavior:xe.customClickBehavior}),...N&&N.length>0&&{annotations:N},...M&&{xExtent:M},...W&&{yExtent:W},...xe.crosshairProps,...O};return xe.earlyReturn?xe.earlyReturn:Se?Wt(oe,{componentName:"StackedAreaChart",message:Se,width:re,height:ae}):Wt(ie,{componentName:"StackedAreaChart",width:re,height:ae,children:Wt(l,{ref:o,...Ce})})});Ot.displayName="StackedAreaChart";import{useMemo as Tt,forwardRef as Et,useRef as Gt}from"react";import{scaleSequential as jt}from"d3-scale";import{jsx as zt}from"react/jsx-runtime";var Vt=Et(function(e,t){const o=Gt(null);r(t,{variant:"xy",frameRef:o});const i=V(e.mode,{width:e.width,height:e.height,showGrid:void 0,enableHover:e.enableHover,showLegend:void 0,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:n,margin:c,className:h,xAccessor:d="x",yAccessor:u="y",valueAccessor:p="value",xFormat:b,yFormat:v,colorScheme:A,customColorScale:w,showValues:k=!1,valueFormat:S,cellBorderColor:C="#fff",cellBorderWidth:L=1,tooltip:R,annotations:_,xExtent:H,yExtent:P,frameProps:D={},selection:N,linkedHover:M,onObservation:W,onClick:O,hoverHighlight:T,chartId:E,loading:G,loadingContent:j,emptyContent:Q,showLegend:Y,legendPosition:U,legend:q,legendInteraction:J}=e,{width:Z,height:te,enableHover:ae,title:se,description:le,summary:ce,accessibleTable:he,xLabel:de,yLabel:ue}=i,me=re(G,Z,te,j),pe=me?null:ne(n,Z,te,Q),ye=Tt(()=>I(n),[n]),fe=K(),ge=A??fe??"blues",xe=Y??!1,be=U??"right",{customHoverBehavior:ve,customClickBehavior:Ae,crosshairSourceId:we}=$({selection:N,linkedHover:M,fallbackFields:[],onObservation:W,onClick:O,chartType:"Heatmap",chartId:E,hoverHighlight:T,colorByField:void 0,mobileInteraction:i.mobileInteraction});a(N);const ke=B(M,we);X(J,void 0,[]);const Se=Tt(()=>"function"==typeof p?e=>p(e):e=>e[p],[p]),Ce=Tt(()=>{const e=ye.map(Se);return ee(e)},[ye,Se]),Le=Tt(()=>{if("custom"===ge&&w)return w;const e=F(ge);return jt(e).domain(Ce)},[ge,w,Ce]),Re=Tt(()=>{const e=Number.isFinite(L)?Math.max(0,L):1;return()=>({stroke:C,strokeWidth:e})},[C,L]),_e=Tt(()=>g([{label:de||m(d),accessor:d,role:"x",format:b},{label:ue||m(u),accessor:u,role:"y",format:v},{label:m(p),accessor:p,role:"value",format:S}]),[d,u,de,ue,p,b,v,S]),He=s({componentName:"Heatmap",data:n,accessors:{xAccessor:d,yAccessor:u,valueAccessor:p}}),Ie=Tt(()=>{if(xe)return{gradient:{colorFn:e=>Le(e),domain:Ce,label:"string"==typeof p?p:"value",format:S},legendDistance:q?.legendDistance}},[xe,Le,Ce,p,S,q?.legendDistance]),{margin:Pe}=z({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:be,userMargin:c,defaults:i.marginDefaults,additionalLegend:Ie,chartWidth:Z,legendLayout:D.legendLayout,hasTitle:!!se,axisChrome:{hasAxis:!1!==i.showAxes,hasAxisLabel:!!de}}),Be={chartType:"heatmap",...null!=n&&{data:ye},xAccessor:d,yAccessor:u,valueAccessor:p,colorScheme:"custom"!==ge?ge:void 0,areaStyle:Re,showValues:k,heatmapValueFormat:S,size:[Z,te],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Pe,showAxes:i.showAxes,xLabel:de,yLabel:ue,xFormat:b,yFormat:v,enableHover:ae,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Ie&&{legend:Ie,legendPosition:be},...y({title:se,description:le,summary:ce,accessibleTable:he,className:h,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...x({tooltip:R,defaultTooltipContent:_e}),...f({linkedHover:M,selection:N,onObservation:W,onClick:O,hoverHighlight:T,mobileInteraction:i.mobileInteraction,customHoverBehavior:ve,customClickBehavior:Ae}),..._&&_.length>0&&{annotations:_},...H&&{xExtent:H},...P&&{yExtent:P},...ke,...D};return me||pe||(He?zt(oe,{componentName:"Heatmap",message:He,width:Z,height:te}):zt(ie,{componentName:"Heatmap",width:Z,height:te,children:zt(l,{ref:o,...Be})}))});Vt.displayName="Heatmap";import{useMemo as $t,useCallback as Qt,forwardRef as Xt,useRef as Yt}from"react";import{jsx as Ut}from"react/jsx-runtime";var qt=Xt(function(t,o){const n=Yt(null),a=V(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,xLabel:t.xLabel,yLabel:t.yLabel,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),{data:c,margin:h,className:d,xFormat:u,yFormat:p,xAccessor:b="x",yAccessor:A="y",sizeBy:w,sizeRange:k=[5,40],colorBy:S,colorScheme:C,styleRules:L,bubbleOpacity:R=.6,bubbleStrokeWidth:_=1,bubbleStrokeColor:H="white",tooltip:P,marginalGraphics:B,pointIdAccessor:F,annotations:N,regression:W,xExtent:O,yExtent:T,frameProps:E={},selection:z,linkedHover:$,linkedBrush:Q,onObservation:X,onClick:Y,hoverHighlight:U,chartId:q,loading:K,loadingContent:J,emptyContent:Z,legendInteraction:ee,legendPosition:te,color:ne,stroke:re,strokeWidth:ae,opacity:se}=t,{width:le,height:ce,enableHover:he,showGrid:de,showLegend:ue,title:pe,description:ye,summary:fe,accessibleTable:ge,xLabel:be,yLabel:ve}=a,Ae=$t(()=>I(c),[c]),we=void 0===c,ke=i({data:Ae,rawData:c,colorBy:S,colorScheme:C,legendInteraction:ee,legendPosition:te,selection:z,linkedHover:$,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:X,onClick:Y,hoverHighlight:U,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"BubbleChart",chartId:q,showLegend:ue,userMargin:h,marginDefaults:a.marginDefaults,loading:K,loadingContent:J,emptyContent:Z,width:le,height:ce,hasTitle:!!pe,axisChrome:G({showAxes:a.showAxes,xLabel:be})}),{domain:Se,trackPushed:Ce,reset:Le}=xe({accessor:w,data:Ae,isPushMode:we}),Re=Qt(e=>{Ce([e]),n.current?.push(e)},[Ce]),_e=Qt(e=>{Ce(e),n.current?.pushMany(e)},[Ce]);r(o,{variant:"xy",frameRef:n,overrides:{push:Re,pushMany:_e,clear:()=>{Le(),n.current?.clear()}}});const He=M(Q),Ie=(j({name:He?.name||"__unused_brush__",xField:He?.xField||("string"==typeof b?b:void 0),yField:He?.yField||("string"==typeof A?A:void 0)}),$t(()=>({stroke:H,strokeWidth:_}),[H,_])),Pe=$t(()=>Se??[0,1],[Se]),Be=Qt(e=>D(e,w,k,Pe),[w,k,Pe]),Fe=$t(()=>v(b,A),[b,A]),De=me({colorBy:S,colorScale:ke.colorScale,color:ne,fillOpacity:R,radiusFn:Be,baseStyleExtras:Ie,stroke:re,strokeWidth:ae,opacity:se,styleRules:L,ruleContext:Fe,effectiveSelectionHook:ke.effectiveSelectionHook,resolvedSelection:ke.resolvedSelection}),Ne=$t(()=>g([{label:be||m(b),accessor:b,role:"x",format:u},{label:ve||m(A),accessor:A,role:"y",format:p},{label:m(w),accessor:w,role:"size"},...S?[{label:m(S),accessor:S,role:"color"}]:[]]),[b,A,be,ve,w,S,u,p]);if(ke.earlyReturn)return ke.earlyReturn;const Me=s({componentName:"BubbleChart",data:c,accessors:{xAccessor:b,yAccessor:A},requiredProps:{sizeBy:w}});if(Me)return Ut(oe,{componentName:"BubbleChart",message:Me,width:le,height:ce});const We=e(W),Oe=We?[We,...N||[]]:N,Te={chartType:"bubble",...null!=c&&{data:Ae},xAccessor:b,yAccessor:A,colorAccessor:S||void 0,sizeAccessor:w,sizeRange:k,pointStyle:De,colorScheme:C,size:[le,ce],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ke.margin,showAxes:a.showAxes,xLabel:be,yLabel:ve,xFormat:u,yFormat:p,enableHover:he,showGrid:de,...ke.legendBehaviorProps,...y({title:pe,description:ye,summary:fe,accessibleTable:ge,className:d,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...x({tooltip:P,defaultTooltipContent:Ne}),...f({linkedHover:$,selection:z,onObservation:X,onClick:Y,hoverHighlight:U,mobileInteraction:ke.mobileInteraction,customHoverBehavior:ke.customHoverBehavior,customClickBehavior:ke.customClickBehavior}),...B&&{marginalGraphics:B},...F&&{pointIdAccessor:F},...Oe&&Oe.length>0&&{annotations:Oe},...O&&{xExtent:O},...T&&{yExtent:T},...ke.crosshairProps,...E};return Ut(ie,{componentName:"BubbleChart",width:le,height:ce,children:Ut(l,{ref:n,...Te})})});qt.displayName="BubbleChart";import*as Kt from"react";import{useMemo as Jt,useCallback as Zt,useState as eo,useRef as to}from"react";import*as oo from"react";import{jsx as io}from"react/jsx-runtime";var no=null,ro=null;function ao(e){const[t,o]=oo.useState(()=>no);return oo.useEffect(()=>{if(t)return;let e=!1;return(no?Promise.resolve(no):(ro||(ro=import("./chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js").then(e=>no=e.ScatterplotMatrixBrushOverlay).catch(e=>{throw ro=null,e})),ro)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?io(t,{...e}):null}import{jsx as so,jsxs as lo}from"react/jsx-runtime";var co="__splomIdx",ho={top:4,bottom:4,left:4,right:4};function uo({data:e,xField:t,yField:o,cellSize:i,pointRadius:n,pointOpacity:r,colorBy:a,colorScale:s,brushSelectionName:c,hoverSelectionName:h,unselectedOpacity:d,maxDevicePixelRatio:u,mobileInteraction:m,mode:p,onPointHover:y,onPointClick:g}){const x=to(null),b=Y({name:c,clientId:`splom-${t}-${o}`,fields:[t,o]}),v=j({name:c,xField:t,yField:o}),A=Y({name:h,clientId:"splom-hover-source",fields:[co]}),w=A.selectPoints,S=Zt(e=>{e?v.brushInteraction.during(e):v.brushInteraction.end(null)},[v.brushInteraction]),C=Zt(e=>{if(!e)return void y?.(null);const t=e.data,o=t?.[co];void 0!==o&&(w({[co]:[o]}),y?.(t,e.x+ho.left,e.y+ho.top))},[w,y]),L=Zt(e=>{if(!e)return void g?.(null);const t=e.data;t&&g?.(t,e.x+ho.left,e.y+ho.top)},[g]),R=Zt(e=>{const t={opacity:r,r:n};return t.fill=a?P(e,a,s):k,"hover"===p?A.isActive&&A.predicate(e)?(t.opacity=1,t.r=2.5*n,t.stroke="#333",t.strokeWidth=1.5):A.isActive&&(t.opacity=.6*r):b.isActive&&!b.predicate(e)&&(t.opacity=d),t},[r,n,a,p,s,A,b,d]);return lo("div",{style:{position:"relative",width:i,height:i},children:[so(l,{ref:x,chartType:"scatter",data:e,size:[i,i],xAccessor:t,yAccessor:o,pointStyle:R,margin:ho,showAxes:!1,maxDevicePixelRatio:u,enableHover:"hover"===p,...f({forceHoverBehavior:"hover"===p,forceClickBehavior:!!g,mobileInteraction:m,customHoverBehavior:C,customClickBehavior:L}),tooltipContent:"hover"===p?()=>null:void 0}),"brush"===p&&so(ao,{frameRef:x,cellSize:i,onBrush:S})]})}function mo({data:e,field:t,label:o,cellSize:i,bins:n,colorBy:r,colorScale:a,brushSelectionName:s,hoverSelectionName:l,mode:c}){const h=Y({name:s,clientId:"splom-diag-"+t,fields:[t]}),d=Y({name:l,clientId:`splom-diag-${t}-hover`,fields:[co]}),u="hover"===c?d:h,m=u.isActive,p=u.predicate,y=Jt(()=>{const o="string"==typeof r?r:null,a=[],s=new Set;for(const i of e){const e=i[t];if(null==e||isNaN(e)||a.push(Number(e)),o){const e=i[o];null!=e&&s.add(e+"")}}if(0===a.length)return{bars:[],selectedBars:[],categoryBars:[],selectedCategoryBars:[],max:0,categories:[]};const[l,c]=ee(a),h=(c-l)/n||1,d=Array.from(s),u=new Map(d.map((e,t)=>[e,t])),y=Array(n).fill(0),f=Array(n).fill(0),g=Array.from({length:n},()=>Array(d.length).fill(0)),x=Array.from({length:n},()=>Array(d.length).fill(0));for(const i of e){const e=i[t];if(null==e||isNaN(e))continue;const r=Math.min(Math.floor((e-l)/h),n-1);if(y[r]++,m&&!p(i)||f[r]++,o){const e=u.get(i[o]+"");void 0!==e&&(g[r][e]++,m&&!p(i)||x[r][e]++)}}const b=Z(y,1),v=g.map((e,t)=>{let o=0;return e.map((e,r)=>{const a=e/b*(i-24),s={x:t/n*i,w:i/n-1,h:a,y0:o,category:d[r]};return o+=a,s})}),A=x.map((e,t)=>{let o=0;return e.map((e,r)=>{const a=e/b*(i-24),s={x:t/n*i,w:i/n-1,h:a,y0:o,category:d[r]};return o+=a,s})});return{bars:y.map((e,t)=>({x:t/n*i,w:i/n-1,h:e/b*(i-24),count:e})),selectedBars:f.map((e,t)=>({x:t/n*i,w:i/n-1,h:e/b*(i-24),count:e})),categoryBars:v,selectedCategoryBars:A,max:b,categories:d}},[e,t,n,i,m,p,r]);return lo("svg",{width:i,height:i,style:{overflow:"hidden"},children:[so("text",{x:i/2,y:14,textAnchor:"middle",fontSize:11,fontWeight:"bold",fill:"#333",children:o}),y.categories.length>0?y.categoryBars.map((e,t)=>e.map((e,o)=>so("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:a?a(e.category):k,opacity:m?.3:.6},`bg-${t}-${o}`))):y.bars.map((e,t)=>so("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:k,opacity:m?.3:.6},"bg-"+t)),m&&(y.categories.length>0?y.selectedCategoryBars.map((e,t)=>e.map((e,o)=>so("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:a?a(e.category):k,opacity:.7},`sel-${t}-${o}`))):y.selectedBars.map((e,t)=>so("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:k,opacity:.7},"sel-"+t)))]})}function po({label:e,cellSize:t}){return so("svg",{width:t,height:t,children:so("text",{x:t/2,y:t/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:12,fontWeight:"bold",fill:"#333",children:e})})}function yo(e){const{data:t,fields:o,fieldLabels:i={},colorBy:n,colorScheme:r,cellSize:a=150,cellGap:s=4,pointRadius:l=2,pointOpacity:c=.5,diagonal:h="histogram",histogramBins:d=20,brushMode:u="crossfilter",hoverMode:m=!0,unselectedOpacity:p=.1,showGrid:y=!1,maxDevicePixelRatio:f,tooltip:g,showLegend:x,idAccessor:b,width:v,className:A,onObservation:w,onClick:S,chartId:C}=e,L="splom",R="splom-hover",_=T(e.mobileInteraction,{mode:e.mode,width:v??o.length*a,mobileSemantics:e.mobileSemantics}),H=m?"hover":u?"brush":"hover",I=U(e=>e.clearSelection),[P,B]=eo(null),F=Zt(()=>{I(R),B(null)},[I,R]),D=Jt(()=>(t||[]).map((e,t)=>void 0!==e[co]?e:{...e,[co]:t}),[t]),N=Q(D,n,r),M=Zt((e,t,o,i)=>[40+e*(a+s)+(o??0),t*(a+s)+(i??0)],[40,a,s]),W=void 0!==x?x:!!n,O=Jt(()=>{if(!W||!n)return null;const e="string"==typeof n?n:null;return e?Array.from(new Set(D.map(t=>t[e]).filter(e=>null!=e))).map(e=>({label:e+"",color:N?N(e+""):k})):null},[W,n,D,N]),E=Jt(()=>({display:"grid",gridTemplateColumns:"40px "+o.map(()=>a+"px").join(" "),gridTemplateRows:o.map(()=>a+"px").join(" ")+" 40px",gap:s+"px",width:"fit-content"}),[o,a,s,40]);return lo("div",{className:A,style:{position:"relative"},children:[O&&so("div",{style:{display:"flex",gap:12,marginBottom:8,flexWrap:"wrap"},children:O.map(e=>lo("div",{style:{display:"flex",alignItems:"center",gap:4},children:[so("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",backgroundColor:e.color}}),so("span",{style:{fontSize:11},children:e.label})]},e.label))}),lo("div",{style:E,onMouseLeave:"hover"===H?F:void 0,children:[o.map((e,t)=>lo(Kt.Fragment,{children:[so("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:11,fontWeight:"bold",color:"#333"},children:i[e]||e}),o.map((o,r)=>t===r?"label"===h?so(po,{label:i[e]||e,cellSize:a},"diag-"+e):so(mo,{data:D,field:e,label:i[e]||e,cellSize:a,bins:d,colorBy:n,colorScale:N,brushSelectionName:L,hoverSelectionName:R,unselectedOpacity:p,mode:H},"diag-"+e):so(uo,{data:D,xField:o,yField:e,fieldLabels:i,cellSize:a,pointRadius:l,pointOpacity:c,colorBy:n,colorScale:N,brushSelectionName:L,hoverSelectionName:R,unselectedOpacity:p,showGrid:y,maxDevicePixelRatio:f,tooltip:g,mobileInteraction:_,mode:H,onPointHover:"hover"===H?(i,n,a)=>{if(i){if(B({datum:i,xField:o,yField:e,colIndex:r,rowIndex:t,px:n??0,py:a??0}),w){const[e,o]=M(r,t,n,a);w({type:"hover",datum:i,x:e,y:o,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:C})}}else B(null),w&&w({type:"hover-end",timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:C})}:void 0,onPointClick:S||w?(e,o,i)=>{if(!e)return;const[n,a]=M(r,t,o,i);S&&S(e,{x:n,y:a}),w&&w({type:"click",datum:e,x:n,y:a,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:C})}:void 0},`cell-${e}-${o}`))]},"row-"+e)),so("div",{})," ",o.map(e=>so("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:"bold",color:"#333"},children:i[e]||e},"col-label-"+e))]}),P&&"hover"===H&&(()=>{const e=P.datum,t=i[P.xField]||P.xField,o=i[P.yField]||P.yField,r=n?"function"==typeof n?n(e):e[n]:null,l=b?"function"==typeof b?b(e):e[b]:"Row "+e[co];return lo("div",{style:{position:"absolute",left:40+P.colIndex*(a+s)+P.px,top:P.rowIndex*(a+s)+P.py-8,transform:"translate(-50%, -100%)",color:"#333",background:"rgba(255,255,255,0.95)",border:"1px solid #ddd",borderRadius:3,padding:"4px 8px",fontSize:11,lineHeight:1.4,whiteSpace:"nowrap",pointerEvents:"none",zIndex:10},children:[so("div",{style:{fontWeight:"bold",marginBottom:2},children:l+""}),lo("div",{children:[t,": ",null!=e[P.xField]?Number(e[P.xField]).toFixed(1):"–"]}),lo("div",{children:[o,": ",null!=e[P.yField]?Number(e[P.yField]).toFixed(1):"–"]}),null!=r&&lo("div",{style:{opacity:.8},children:["string"==typeof n?n:"group",": ",r+""]})]})})()]})}function fo(e){const{brushMode:t="crossfilter",hoverMode:o=!0}=e,i={};return!o&&t&&(i.splom={resolution:t}),o&&(i["splom-hover"]={resolution:"union"}),so(L,{selections:i,children:so(yo,{...e})})}fo.displayName="ScatterplotMatrix";import{useState as go,useRef as xo,useEffect as bo,useMemo as vo,useCallback as Ao}from"react";import*as wo from"react";import{jsx as ko}from"react/jsx-runtime";var So=null,Co=null;function Lo(e){const[t,o]=wo.useState(()=>So);return wo.useEffect(()=>{if(t)return;let e=!1;return(So?Promise.resolve(So):(Co||(Co=import("./chunk-minimapBrushOverlay-JU57U7NM.module.min.js").then(e=>So=e.MinimapBrushOverlay).catch(e=>{throw Co=null,e})),Co)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?ko(t,{...e}):null}import{jsx as Ro,jsxs as _o}from"react/jsx-runtime";function Ho(e){const{data:t,width:o=600,height:i=400,margin:n,className:r,title:a,description:c,summary:h,xLabel:d,yLabel:u,xFormat:p,yFormat:y,xAccessor:f="x",yAccessor:x="y",lineBy:b,lineDataAccessor:v="coordinates",colorBy:A,colorScheme:w,curve:S="linear",lineWidth:C=2,fillArea:L=!1,areaOpacity:R=.3,showPoints:_=!1,pointRadius:H=3,enableHover:B=!0,showGrid:F=!1,showLegend:D,legendPosition:N,tooltip:M,minimap:O={},renderBefore:T=!1,onBrush:E,brushExtent:G,yExtent:j,frameProps:V={},loading:$,loadingContent:X,emptyContent:Y}=e,U=re($,o,i,X),q=U?null:ne(t,o,i,Y),K=vo(()=>I(t),[t]),[J,Z]=go(null),ee=G??J,te=Ao(e=>{G||Z(e),E?.(e)},[G,E]),ae=xo(null),[se,le]=go(null);bo(()=>{let e=0,t=!1;const o=()=>{if(t)return;const i=ae.current?.getScales?.();i?le(i):e=requestAnimationFrame(o)};return e=requestAnimationFrame(o),()=>{t=!0,e&&cancelAnimationFrame(e)}},[t]);const ce=void 0!==K[0]?.[v],he=vo(()=>{if(ce)return K;if(b){const e=K.reduce((e,t)=>{const o="function"==typeof b?b(t):t[b];if(!e[o]){const t={[v]:[]};"string"==typeof b&&(t[b]=o),e[o]=t}return e[o][v].push(t),e},{});return Object.values(e)}return[{[v]:K}]},[K,b,v,ce]),de=vo(()=>ce||b?he.flatMap(e=>{const t=e[v]||[];return b&&"string"==typeof b?t.map(t=>({...t,[b]:e[b]})):t}):K,[he,v,ce,b,K]),ue=Q(K,A,w),me=$e({lineWidth:C,colorBy:A,colorScale:ue,fillArea:L,areaOpacity:R}),pe=vo(()=>{if(O.lineStyle)return O.lineStyle},[O.lineStyle]),ye=$e({lineWidth:1,colorBy:A,colorScale:ue}),fe=pe??ye,ge=vo(()=>{if(_)return e=>{const t={r:H,fillOpacity:1};return t.fill=A?P(e.parentLine||e,A,ue):k,t}},[_,H,A,ue]),{legend:xe,margin:be,legendPosition:ve}=z({data:he,colorBy:A,colorScale:ue,showLegend:D,legendPosition:N,userMargin:n,chartWidth:o,hasTitle:!!a,axisChrome:{hasAxis:!0,hasAxisLabel:!!d}}),Ae=O.height||60,we=vo(()=>({top:O.margin?.top??0,bottom:O.margin?.bottom??20,left:O.margin?.left??be.left,right:O.margin?.right??be.right}),[O.margin,be]),ke=O.brushDirection||"x",Se=vo(()=>g([{label:d||m(f),accessor:f,role:"x",format:p},{label:u||m(x),accessor:x,role:"y",format:y}]),[f,x,d,u,p,y]),Ce=s({componentName:"MinimapChart",data:t,accessors:{xAccessor:f,yAccessor:x}});if(Ce)return Ro(oe,{componentName:"MinimapChart",message:Ce,width:o,height:i});const Le=L?"area":"line",Re={chartType:Le,data:de,xAccessor:f,yAccessor:x,groupAccessor:b||void 0,curve:S,lineStyle:me,..._&&{pointStyle:ge},size:[o,i],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:be,showAxes:!0,xLabel:d,yLabel:u,xFormat:p,yFormat:y,enableHover:B,showGrid:F,...xe&&{legend:xe,legendPosition:ve},...a&&{title:a},...c&&{description:c},...h&&{summary:h},tooltipContent:!1===M?()=>null:W(M)||Se,...ee&&{xExtent:ee},...j&&{yExtent:j},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...V},_e={chartType:Le,data:de,xAccessor:f,yAccessor:x,groupAccessor:b||void 0,curve:S,lineStyle:fe,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},size:[o,Ae+we.top+we.bottom],margin:we,showAxes:O.showAxes??!1,background:O.background,enableHover:!1,...j&&{yExtent:j}},He=_o("div",{style:{position:"relative",width:o,overflow:"hidden"},children:[Ro(l,{ref:ae,..._e}),Ro(Lo,{width:o-we.left-we.right,height:Ae,margin:we,scales:se,brushDirection:ke,extent:ee,onBrush:te})]},"minimap"),Ie=Ro("div",{style:{overflow:"hidden"},children:Ro(l,{...Re})},"main");return U||q||Ro(ie,{componentName:"MinimapChart",width:o,height:i,children:_o("div",{className:"minimap-chart"+(r?" "+r:""),children:[T?He:Ie,T?Ie:He]})})}Ho.displayName="MinimapChart";import{useMemo as Io,forwardRef as Po,useRef as Bo}from"react";var Fo={topLeft:{label:"Low / High",color:"#E9C46A",opacity:.08},topRight:{label:"High / High",color:"#2A9D8F",opacity:.08},bottomLeft:{label:"Low / Low",color:"#E76F51",opacity:.08},bottomRight:{label:"High / Low",color:"#86BBD8",opacity:.08}};import{Fragment as Do,jsx as No,jsxs as Mo}from"react/jsx-runtime";function Wo(e,t){return{label:t?.label??e.label,color:t?.color??e.color,opacity:t?.opacity??e.opacity}}var Oo=Po(function(e,t){const o=Bo(null);r(t,{variant:"xy",frameRef:o});const n=V(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:c,className:h,xFormat:d,yFormat:u,xAccessor:p="x",yAccessor:y="y",xCenter:x,yCenter:b,quadrants:A,centerlineStyle:w={},showQuadrantLabels:S=!0,quadrantLabelSize:C=12,colorBy:L,colorScheme:R,styleRules:_,sizeBy:H,sizeRange:P=[3,15],pointRadius:B=5,pointOpacity:F=.8,tooltip:N,pointIdAccessor:M,annotations:O,frameProps:T={},selection:E,linkedHover:j,onObservation:z,onClick:$,hoverHighlight:Q,chartId:X,loading:Y,loadingContent:U,emptyContent:q,legendInteraction:K,legendPosition:J,color:Z,stroke:te,strokeWidth:ne,opacity:re}=e,{width:se,height:le,enableHover:ce,showGrid:he,showLegend:de,title:ue,description:pe,summary:ye,accessibleTable:fe,xLabel:ge,yLabel:xe}=n,be=Io(()=>({topLeft:Wo(Fo.topLeft,A?.topLeft),topRight:Wo(Fo.topRight,A?.topRight),bottomLeft:Wo(Fo.bottomLeft,A?.bottomLeft),bottomRight:Wo(Fo.bottomRight,A?.bottomRight)}),[A]),ve=Io(()=>I(a),[a]),Ae=i({data:ve,rawData:a,colorBy:L,colorScheme:R,legendInteraction:K,legendPosition:J,selection:E,linkedHover:j,fallbackFields:"string"==typeof L?[L]:[],unwrapData:!1,onObservation:z,onClick:$,hoverHighlight:Q,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"QuadrantChart",chartId:X,showLegend:de,userMargin:c,marginDefaults:n.marginDefaults,loading:Y,loadingContent:U,emptyContent:q,width:se,height:le,hasTitle:!!ue,axisChrome:G({showAxes:n.showAxes,xLabel:ge})});ae("QuadrantChart",ve,"xAccessor",p),ae("QuadrantChart",ve,"yAccessor",y);const we=Io(()=>{if(!ve.length)return;const e="function"==typeof p?p:e=>+e[p],t="function"==typeof y?y:e=>+e[y];let o=1/0,i=-1/0,n=1/0,r=-1/0;for(const a of ve){const s=e(a),l=t(a);isFinite(s)&&(o>s&&(o=s),s>i&&(i=s)),isFinite(l)&&(n>l&&(n=l),l>r&&(r=l))}if(null!=x&&isFinite(x)&&(o>x&&(o=x),x>i&&(i=x)),null!=b&&isFinite(b)&&(n>b&&(n=b),b>r&&(r=b)),o===1/0)return;const a=.1*(i-o)||1,s=.1*(r-n)||1;return{xExtent:[o-a,i+a],yExtent:[n-s,r+s]}},[ve,p,y,x,b]),ke=Io(()=>{if(!H||0===ve.length)return;const e=ve.map(e=>"function"==typeof H?H(e):e[H]).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0!==e.length?ee(e):void 0},[ve,H]),Se=Io(()=>"function"==typeof p?p:e=>+e[p],[p]),Ce=Io(()=>"function"==typeof y?y:e=>+e[y],[y]),Le=Io(()=>e=>{const t=Se(e),o=Ce(e),i=null!=x?t>=x:void 0,n=null!=b?o>=b:void 0;return void 0===n||void 0===i?Z||k:n&&i?be.topRight.color:n&&!i?be.topLeft.color:!n&&i?be.bottomRight.color:be.bottomLeft.color},[Se,Ce,x,b,be,Z]),Re=Io(()=>H?e=>D(e,H,P,ke):void 0,[H,P,ke]),_e=Io(()=>v(p,y),[p,y]),He=me({colorBy:L,colorScale:Ae.colorScale,color:Z,pointRadius:B,fillOpacity:F,radiusFn:Re,fallbackFill:Le,stroke:te,strokeWidth:ne,opacity:re,styleRules:_,ruleContext:_e,effectiveSelectionHook:Ae.effectiveSelectionHook,resolvedSelection:Ae.resolvedSelection}),Ie=Io(()=>{if(!ve.length)return;const e=new Set;"string"==typeof p&&e.add(p),"string"==typeof y&&e.add(y),"string"==typeof L&&e.add(L),"string"==typeof H&&e.add(H);const t=ve[0];for(const o of Object.keys(t))if(!o.startsWith("_")&&!e.has(o)&&"string"==typeof t[o])return o},[ve,p,y,L,H]),Pe=Io(()=>g([...Ie?[{label:Ie,accessor:Ie,role:"title"}]:[],{label:ge||m(p),accessor:p,role:"x",format:d},{label:xe||m(y),accessor:y,role:"y",format:u},...L?[{label:m(L),accessor:L,role:"color"}]:[],...H?[{label:m(H),accessor:H,role:"size"}]:[]]),[Ie,p,y,ge,xe,L,H,d,u]),Be=s({componentName:"QuadrantChart",data:a,accessors:{xAccessor:p,yAccessor:y}}),Fe=Io(()=>{const e={stroke:w.stroke||"#999",strokeWidth:w.strokeWidth??1,dashArray:w.strokeDasharray||[]};return[(t,o,i,n)=>{if(!i?.x||!i?.y)return;const r=n.width,a=n.height,s=null!=x?i.x(x):r/2,l=null!=b?i.y(b):a/2;if(null!=x&&!isFinite(s))return;if(null!=b&&!isFinite(l))return;const c=Math.max(0,Math.min(r,s)),h=Math.max(0,Math.min(a,l)),d=[{config:be.topLeft,x:0,y:0,w:c,h:h},{config:be.topRight,x:c,y:0,w:r-c,h:h},{config:be.bottomLeft,x:0,y:h,w:c,h:a-h},{config:be.bottomRight,x:c,y:h,w:r-c,h:a-h}];for(const e of d)e.w>0&&e.h>0&&(t.fillStyle=e.config.color,t.globalAlpha=e.config.opacity??.08,t.fillRect(e.x,e.y,e.w,e.h));t.globalAlpha=1,t.strokeStyle=e.stroke,t.lineWidth=e.strokeWidth,e.dashArray.length>0&&t.setLineDash(e.dashArray),t.beginPath(),t.moveTo(c,0),t.lineTo(c,a),t.stroke(),t.beginPath(),t.moveTo(0,h),t.lineTo(r,h),t.stroke(),t.setLineDash([])}]},[x,b,be,w]),De=Io(()=>S?[...Fe,(e,t,o,i)=>{if(!o?.x||!o?.y)return;const n=i.width,r=i.height,a=null!=x?o.x(x):n/2,s=null!=b?o.y(b):r/2;(null==x||isFinite(a))&&(null==b||isFinite(s))&&(e.font=`600 ${C}px sans-serif`,e.globalAlpha=.5,e.fillStyle=be.topLeft.color,e.textAlign="left",e.textBaseline="top",e.fillText(be.topLeft.label,8,8),e.fillStyle=be.topRight.color,e.textAlign="right",e.textBaseline="top",e.fillText(be.topRight.label,n-8,8),e.fillStyle=be.bottomLeft.color,e.textAlign="left",e.textBaseline="bottom",e.fillText(be.bottomLeft.label,8,r-8),e.fillStyle=be.bottomRight.color,e.textAlign="right",e.textBaseline="bottom",e.fillText(be.bottomRight.label,n-8,r-8),e.globalAlpha=1)}]:Fe,[Fe,S,C,be,x,b]),Ne=Io(()=>{const e=T.canvasPreRenderers||[];return[...De,...e]},[De,T.canvasPreRenderers]),Me=Io(()=>{const e={stroke:w.stroke||"#999",strokeWidth:w.strokeWidth??1,dashArray:w.strokeDasharray?Array.isArray(w.strokeDasharray)?w.strokeDasharray.join(","):w.strokeDasharray:void 0};return[(t,o,i)=>{if(!o?.x||!o?.y)return null;const n=i.width,r=i.height,a=null!=x?o.x(x):n/2,s=null!=b?o.y(b):r/2;if(null!=x&&!isFinite(a))return null;if(null!=b&&!isFinite(s))return null;const l=Math.max(0,Math.min(n,a)),c=Math.max(0,Math.min(r,s));return Mo(Do,{children:[[{config:be.topLeft,x:0,y:0,w:l,h:c},{config:be.topRight,x:l,y:0,w:n-l,h:c},{config:be.bottomLeft,x:0,y:c,w:l,h:r-c},{config:be.bottomRight,x:l,y:c,w:n-l,h:r-c}].map((e,t)=>e.w>0&&e.h>0?No("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:e.config.color,opacity:e.config.opacity??.08},"qf-"+t):null),No("line",{x1:l,y1:0,x2:l,y2:r,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),No("line",{x1:0,y1:c,x2:n,y2:c,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),S&&Mo(Do,{children:[No("text",{x:8,y:8+C,fill:be.topLeft.color,fontWeight:600,fontSize:C,opacity:.5,children:be.topLeft.label}),No("text",{x:n-8,y:8+C,fill:be.topRight.color,fontWeight:600,fontSize:C,opacity:.5,textAnchor:"end",children:be.topRight.label}),No("text",{x:8,y:r-8,fill:be.bottomLeft.color,fontWeight:600,fontSize:C,opacity:.5,children:be.bottomLeft.label}),No("text",{x:n-8,y:r-8,fill:be.bottomRight.color,fontWeight:600,fontSize:C,opacity:.5,textAnchor:"end",children:be.bottomRight.label})]})]})}]},[x,b,be,w,S,C]);if(Ae.earlyReturn)return Ae.earlyReturn;const We={chartType:"scatter",...null!=a&&{data:ve},xAccessor:p,yAccessor:y,colorAccessor:L||void 0,sizeAccessor:H||void 0,sizeRange:P,pointStyle:He,colorScheme:R,size:[se,le],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:Ae.margin,showAxes:n.showAxes,xLabel:ge,yLabel:xe,xFormat:d,yFormat:u,enableHover:ce,showGrid:he,...we&&{xExtent:we.xExtent,yExtent:we.yExtent},...Ae.legendBehaviorProps,...ue&&{title:ue},...pe&&{description:pe},...ye&&{summary:ye},...void 0!==fe&&{accessibleTable:fe},...h&&{className:h},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===N?()=>null:!0===N||void 0===N?Pe:W(N)||Pe,...f({linkedHover:j,selection:E,onObservation:z,onClick:$,hoverHighlight:Q,mobileInteraction:Ae.mobileInteraction,customHoverBehavior:Ae.customHoverBehavior,customClickBehavior:Ae.customClickBehavior}),...M&&{pointIdAccessor:M},...O&&O.length>0&&{annotations:O},canvasPreRenderers:Ne,...Ae.crosshairProps,...T,...Ne.length>0&&{canvasPreRenderers:Ne},svgPreRenderers:Me};return Be?No(oe,{componentName:"QuadrantChart",message:Be,width:se,height:le}):No(ie,{componentName:"QuadrantChart",width:se,height:le,children:No(l,{ref:o,...We})})});Oo.displayName="QuadrantChart";import*as To from"react";import{useMemo as Eo,useCallback as Go,forwardRef as jo,useRef as zo,useImperativeHandle as Vo}from"react";import{jsx as $o}from"react/jsx-runtime";var Qo="__ma_unitized",Xo="__ma_series";function Yo(e,t){const o=t[1]-t[0];return 0===o?.5:(e-t[0])/o}function Uo(e,t){return t[0]+e*(t[1]-t[0])}var qo=jo(function(e,t){const o=zo(null),n=zo([]),r=zo(e.series);r.current=e.series,Vo(t,()=>{const e=()=>(r.current??[]).filter(e=>null!=e&&"object"==typeof e);return{push:t=>{if(!o.current)return;const i=e(),r=t;for(let e=0;i.length>e&&2>e;e++){const t=i[e],a=t.extent||n.current[e];if(!a)continue;const s=("function"==typeof t.yAccessor?t.yAccessor:e=>e[t.yAccessor])(r);null!=s&&isFinite(s)&&o.current.push({...r,[Qo]:Yo(s,a),[Xo]:t.label||"Series "+(e+1)})}},pushMany:t=>{if(!o.current)return;const i=e(),r=[];for(const e of t)for(let t=0;i.length>t&&2>t;t++){const o=i[t],a=o.extent||n.current[t];if(!a)continue;const s=("function"==typeof o.yAccessor?o.yAccessor:e=>e[o.yAccessor])(e);null!=s&&isFinite(s)&&r.push({...e,[Qo]:Yo(s,a),[Xo]:o.label||"Series "+(t+1)})}o.current.pushMany(r)},remove:e=>o.current?.remove(e)??[],update:(e,t)=>o.current?.update(e,t)??[],clear:()=>o.current?.clear(),getData:()=>o.current?.getData()??[],getScales:()=>o.current?.getScales()??null}},[]);const a=V(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:800,height:400}),{data:c,margin:h,className:d,xFormat:u,xAccessor:m="x",series:p,colorScheme:y,curve:g="monotoneX",lineWidth:x=2,tooltip:b,annotations:v,frameProps:A={},selection:k,linkedHover:C,onObservation:L,onClick:R,hoverHighlight:_,chartId:H,loading:P,loadingContent:B,emptyContent:F,legendInteraction:D,legendPosition:N,stroke:M,strokeWidth:O,opacity:T}=e,{width:E,height:j,enableHover:z,showGrid:$,showLegend:Q=!0,title:X,description:Y,summary:U,accessibleTable:K,xLabel:J}=a,Z=Eo(()=>I(c),[c]),ee=Eo(()=>I(p),[p]),te=ee,ae=2===ee.length,se=Eo(()=>ae?{...A.legendLayout,sideGutter:A.legendLayout?.sideGutter??70}:A.legendLayout,[A.legendLayout,ae]);"undefined"==typeof process||"production"===process.env?.NODE_ENV||ae||console.warn(`[MultiAxisLineChart] Expected exactly 2 series for dual-axis mode, got ${ee.length}. Rendering as a standard multi-line chart.`);const le=re(P,E,j,B),ce=le?null:ne(c,E,j,F),he=q(),de=Eo(()=>{let e;if(Array.isArray(y))e=y;else if(he&&he.length>0)e=he;else{const t=w[y];e=Array.isArray(t)?t:S}return te.map((t,o)=>t.color||e[o%e.length])},[te,y,he]),ue=Eo(()=>ee.map((e,t)=>e.label||"Series "+(t+1)),[ee]),{unitizedData:me,extents:pe}=Eo(()=>{if(0===Z.length){const e=ee.map(e=>e.extent||null).filter(Boolean);return e.length===ee.length&&(n.current=e),{unitizedData:[],extents:e.length===ee.length?e:[]}}const e=ee.map(e=>e.extent||function(e,t){let o=1/0,i=-1/0;const n="function"==typeof t?t:e=>e[t];for(const t of e){const e=n(t);null!=e&&isFinite(e)&&(o>e&&(o=e),e>i&&(i=e))}if(!isFinite(o)||!isFinite(i))return[0,1];if(o===i){const e=0===o?1:.1*Math.abs(o);return[o-e,i+e]}return[o,i]}(Z,e.yAccessor));if(n.current=e,!ae){const t=[];for(const e of Z)for(let o=0;ee.length>o;o++){const i=ee[o],n=("function"==typeof i.yAccessor?i.yAccessor:e=>e[i.yAccessor])(e);null!=n&&t.push({...e,[Qo]:n,[Xo]:ue[o]})}return{unitizedData:t,extents:e}}const t=[];for(const o of Z)for(let i=0;2>i;i++){const n=ee[i],r=("function"==typeof n.yAccessor?n.yAccessor:e=>e[n.yAccessor])(o);null!=r&&t.push({...o,[Qo]:Yo(r,e[i]),[Xo]:ue[i]})}return{unitizedData:t,extents:e}},[Z,ee,ae,ue]),ye=Eo(()=>{if(ae&&pe.length>=2)return[{orient:"left",label:ue[0],tickFormat:ee[0].format||(e=>{const t=Uo(e,pe[0]);return Number.isInteger(t)?t+"":t.toFixed(1)})},{orient:"right",label:ue[1],tickFormat:ee[1].format||(e=>{const t=Uo(e,pe[1]);return Number.isInteger(t)?t+"":t.toFixed(1)})},{orient:"bottom"}]},[ae,pe,ee,ue]),fe=Eo(()=>me.length>0?me:ue.map(e=>({[Xo]:e})),[me,ue]),ge=i({data:fe,rawData:c,colorBy:Xo,colorScheme:de,legendInteraction:D,legendPosition:N,selection:k,linkedHover:C,fallbackFields:[Xo],unwrapData:!1,onObservation:L,onClick:R,hoverHighlight:_,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"MultiAxisLineChart",chartId:H,showLegend:Q,legendLayout:se,userMargin:h,marginDefaults:ae?{...a.marginDefaults,left:70,right:70}:a.marginDefaults,loading:P,loadingContent:B,emptyContent:F,width:E,height:j,hasTitle:!!X,axisChrome:G({showAxes:a.showAxes,xLabel:J})}),xe=Eo(()=>{const e=new Map;return ue.forEach((t,o)=>e.set(t,de[o])),e},[ue,de]),be=$e({lineWidth:x,resolveStroke:Go(e=>xe.get(e[Xo])||de[0],[xe,de]),stroke:M,strokeWidth:O,opacity:T,effectiveSelectionHook:ge.effectiveSelectionHook,resolvedSelection:ge.resolvedSelection}),ve=Eo(()=>{if(!1===b)return()=>null;return W(b)||(e=>{const t=e.data||e,o=t[Xo],i=ue.indexOf(o),n=t[Qo],r=ae&&i>=0&&pe[i]?Uo(n,pe[i]):n,a=i>=0&&ee[i]?.format?ee[i].format:e=>Number.isInteger(e)?e+"":e.toFixed(2),s="function"==typeof m?m(t):t[m];return To.createElement("div",{style:{padding:"6px 10px",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-tooltip-font-size, 13px)"}},To.createElement("div",{style:{fontWeight:600,marginBottom:4,color:de[i]||"inherit"}},o),To.createElement("div",null,`${"string"==typeof m?m:"x"}: ${s}`),To.createElement("div",null,`${o}: ${a(r)}`))})},[b,ue,de,pe,ae,ee,m]);if(ge.earlyReturn)return ge.earlyReturn;const Ae=s({componentName:"MultiAxisLineChart",data:c,accessors:{xAccessor:m}}),we=ae?[0,1]:void 0,ke={chartType:"line",...null!=c&&{data:me},xAccessor:m,yAccessor:Qo,groupAccessor:Xo,lineStyle:be,colorScheme:de,size:[E,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:ge.margin,showAxes:a.showAxes,...ye&&{axes:ye},xLabel:J,...ae?{}:{yLabel:ue[0]},xFormat:u,...ae&&we&&{yExtent:we},enableHover:z,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:$,curve:g,...ge.legendBehaviorProps,...X&&{title:X},...Y&&{description:Y},...U&&{summary:U},...void 0!==K&&{accessibleTable:K},...d&&{className:d},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:ve,...v&&{annotations:v},...f({linkedHover:C,selection:k,onObservation:L,onClick:R,hoverHighlight:_,mobileInteraction:ge.mobileInteraction,customHoverBehavior:ge.customHoverBehavior,customClickBehavior:ge.customClickBehavior}),...ge.crosshairProps,...A,...se&&{legendLayout:se}};return le||ce||(Ae?$o(oe,{componentName:"MultiAxisLineChart",message:Ae,width:E,height:j}):$o(ie,{componentName:"MultiAxisLineChart",width:E,height:j,children:$o(l,{ref:o,...ke})}))});qo.displayName="MultiAxisLineChart";import{useMemo as Ko,forwardRef as Jo,useRef as Zo}from"react";import{jsx as ei}from"react/jsx-runtime";var ti=Jo(function(e,t){const i=Zo(null);r(t,{variant:"xy",frameRef:i});const n=V(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:c,className:h,xFormat:d,yFormat:u,xAccessor:p="x",highAccessor:b="high",lowAccessor:v="low",openAccessor:A,closeAccessor:w,candlestickStyle:k,tooltip:S,annotations:C,xExtent:L,yExtent:R,frameProps:_={},selection:H,linkedHover:P,onObservation:F,onClick:D,chartId:N,loading:M,loadingContent:W,emptyContent:O}=e,{width:T,height:E,enableHover:G,showGrid:j,title:z,description:Q,summary:X,accessibleTable:Y,xLabel:U,yLabel:q}=n,K=re(M,T,E,W),J=K?null:ne(a,T,E,O),Z=Ko(()=>I(a),[a]),ee=null==A||null==w;ae("CandlestickChart",Z,"xAccessor",p),ae("CandlestickChart",Z,"highAccessor",b),ae("CandlestickChart",Z,"lowAccessor",v),ee||(ae("CandlestickChart",Z,"openAccessor",A),ae("CandlestickChart",Z,"closeAccessor",w));const{customHoverBehavior:te,customClickBehavior:se,crosshairSourceId:le}=$({selection:H,linkedHover:P,onObservation:F,onClick:D,chartType:"CandlestickChart",chartId:N,mobileInteraction:n.mobileInteraction}),ce=B(P,le),he=Ko(()=>{const e=n.marginDefaults,t="sparkline"===n.mode?{...e,top:0,bottom:0}:e;return null==c?t:{...t,...o(c)}},[c,n.marginDefaults,n.mode]),de=Ko(()=>{const e=[{label:U||m(p),accessor:p,role:"x",format:d}];return ee?(e.push({label:"High",accessor:b,role:"y",format:u}),e.push({label:"Low",accessor:v,format:u})):(e.push({label:"Open",accessor:A,format:u}),e.push({label:"High",accessor:b,format:u}),e.push({label:"Low",accessor:v,format:u}),e.push({label:"Close",accessor:w,format:u})),g(e)},[p,U,d,u,b,v,A,w,ee]),ue=s({componentName:"CandlestickChart",data:a,accessors:{xAccessor:p,highAccessor:b,lowAccessor:v,...!ee&&{openAccessor:A,closeAccessor:w}}}),me={chartType:"candlestick",...null!=a&&{data:Z},xAccessor:p,yAccessor:b,highAccessor:b,lowAccessor:v,...!ee&&{openAccessor:A,closeAccessor:w},...k&&{candlestickStyle:k},scalePadding:Math.max(2,Math.min(12,Math.round(T/40))),extentPadding:T>200?.1:.02,size:[T,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:he,showAxes:n.showAxes,xLabel:U,yLabel:q,xFormat:d,yFormat:u,enableHover:G,showGrid:j,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...y({title:z,description:Q,summary:X,accessibleTable:Y,className:h,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...x({tooltip:S,defaultTooltipContent:de}),...f({linkedHover:P,selection:H,onObservation:F,onClick:D,mobileInteraction:n.mobileInteraction,customHoverBehavior:te,customClickBehavior:se}),...C&&C.length>0&&{annotations:C},...L&&{xExtent:L},...R&&{yExtent:R},...ce,..._};return K||J||(ue?ei(oe,{componentName:"CandlestickChart",message:ue,width:T,height:E}):ei(ie,{componentName:"CandlestickChart",width:T,height:E,children:ei(l,{ref:i,...me})}))});ti.displayName="CandlestickChart";export{Ie as Scatterplot,We as ConnectedScatterplot,Ye as LineChart,Je as XYCustomChart,ht as rankBumpData,ft as BumpChart,kt as AreaChart,Ft as DifferenceChart,Ot as StackedAreaChart,Vt as Heatmap,qt as BubbleChart,fo as ScatterplotMatrix,Ho as MinimapChart,Fo as DEFAULT_QUADRANTS,Oo as QuadrantChart,qo as MultiAxisLineChart,ti as CandlestickChart};
@@ -1 +0,0 @@
1
- function n(n,t){return n===t}function t(n,t){if("function"==typeof n)return t=>+n(t);const o=n||t;return n=>+n[o]}function o(n,t){if("function"==typeof n)return n;const o=n||t;return n=>n[o]}function u(n,t){return"function"==typeof n?n:n?t=>t[n]+"":t?n=>n[t]+"":void 0}function r(n){return n?"function"==typeof n?n:t=>t[n]||t.id:null}function f(n){return"string"==typeof n?n:n.id}export{n as accessorsEquivalent,t as resolveAccessor,o as resolveRawAccessor,u as resolveStringAccessor,r as resolveLabelFn,f as resolveNodeRefId};
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{needsDataCanvasPaint as e,paintCanvasBackground as t}from"./chunk-chunk-DTH3SUOU.module.min.js";import{networkSymbolRenderer as r}from"./chunk-chunk-PRNXOCYZ.module.min.js";import{StalenessBadge as n,attachUpdateResultStore as o,buildNavGraph as i,composeOverlays as a,computeDecayOpacity as s,createCustomLayoutFailureDiagnostic as c,extractNetworkNavPoints as l,findHitPointInQuadtree as u,formatVal as d,getHitRadius as h,hitTestRect as f,networkGlyphRenderer as y,nextNetworkIndex as g,normalizeAngle as p,paintSceneWithBackend as m,renderCirclePulse as v,renderRectPulse as x,renderSceneWithBackend as k,resolvePosition as b,useConfigSync as _,useLayoutSelectionSync as S,useStableShallow as w,useStalenessCheck as A,warnCustomLayoutDiagnostics as L}from"./chunk-chunk-DVCWU7MT.module.min.js";import{CustomLayoutSelectionProvider as E,wrapWithCustomLayoutSelection as P}from"./chunk-chunk-5UKL5W76.module.min.js";import{resolveLabelFn as D,resolveNodeRefId as R}from"./chunk-chunk-NWIGA3UK.module.min.js";import{filterAnnotationsByStatus as M}from"./chunk-chunk-XYZDTYAF.module.min.js";import{commonJsWorkerModuleUrl as N}from"./chunk-chunk-SV4XAZ3Q.module.min.js";import{buildResolveColor as T,resolveCustomLayoutPalette as C}from"./chunk-chunk-OHLRAEQZ.module.min.js";import{ANNOTATION_DISCLOSURE_REVEAL_CSS as I,AriaLiveTooltip as W,CanvasFrameBackground as $,DEFAULT_COLORS as z,FlippingTooltip as F,FocusRing as B,NetworkAccessibleDataTable as Y,SceneRevisionDiagnosticsObserver as O,ScreenReaderSummary as X,SkipToTableLink as j,TITLE_BASELINE as H,UpdateResultTracker as q,annotationActivationProps as V,annotationLayout as G,buildHoverData as Q,computeEasing as K,computeNetworkAriaLabel as Z,computeRawProgress as U,createDefaultAnnotationRules as J,createSeededFrameRandom as ee,defaultTooltipStyle as te,emitClickObservations as re,emitHoverObservations as ne,filterSparseArray as oe,getDevicePixelRatio as ie,isAnnotationActivationTarget as ae,isInteractiveKeyboardTarget as se,isServerEnvironment as ce,lerp as le,networkLabelToSVG as ue,networkSceneEdgeToSVG as de,networkSceneNodeToSVG as he,now as fe,observationInputType as ye,paintNetworkFill as ge,paintNetworkStroke as pe,prepareCanvas as me,renderAnnotationPass as ve,renderLegendFromConfig as xe,resolveCSSColor as ke,resolveCanvasFill as be,runSceneBuild as _e,schemeCategory10 as Se,smartTooltipEntries as we,symbolRadius as Ae,useAnnotationActivationOptions as Le,useFrame as Ee,useFrameCanvasHost as Pe,useSceneRevisionDiagnostics as De}from"./chunk-chunk-SK2TQMG4.module.min.js";import{getMinMax as Re}from"./chunk-chunk-2NVFEB7P.module.min.js";import{resolveThemeSemanticColors as Me}from"./chunk-chunk-PMR47KRY.module.min.js";import{glyphHitGeometry as Ne}from"./chunk-chunk-KTWEBFMX.module.min.js";import{renderLoadingState as Te,useHydration as Ce,useWasHydratingFromSSR as Ie}from"./chunk-chunk-ACLDBMRH.module.min.js";import*as We from"react";import{useRef as $e,useState as ze,useEffect as Fe,useMemo as Be,useCallback as Ye,useImperativeHandle as Oe,forwardRef as Xe,memo as je}from"react";var He={weightChange:.1,newEdge:.5,newNode:1,threshold:3,transitionDuration:500},qe={radius:3,opacity:.7,speedMultiplier:1,maxPerEdge:50,spawnRate:.1},Ve=class{constructor(e){this.capacity=e,this.particles=Array(e),this._freeIndices=Array(e);for(let t=0;e>t;t++)this.particles[t]={t:0,offset:0,edgeIndex:0,active:!1,x:0,y:0},this._freeIndices[t]=e-1-t}spawn(e,t=Math.random){const r=this._freeIndices.pop();if(void 0===r)return null;const n=this.particles[r];return n.active=!0,n.t=0,n.offset=t()-.5,n.edgeIndex=e,n.x=0,n.y=0,n}step(e,t,r,n){for(let o=0;this.capacity>o;o++){const i=this.particles[o];if(!i.active)continue;const a=r[i.edgeIndex];a&&a.bezier?(i.t+=e*t*(n?n[i.edgeIndex]??1:1)*(a.bezier.circular?.3:1),1>i.t?Ge(a.bezier,i.t,i.offset,i):(i.active=!1,this._freeIndices.push(o))):(i.active=!1,this._freeIndices.push(o))}}countForEdge(e){let t=0;for(let r=0;this.capacity>r;r++)this.particles[r].active&&this.particles[r].edgeIndex===e&&t++;return t}clear(){for(let e=0;this.capacity>e;e++)this.particles[e].active=!1;this._freeIndices.length=0;for(let e=this.capacity-1;e>=0;e--)this._freeIndices.push(e)}resize(e){if(this.capacity>=e)return;const t=this.particles;this.particles=Array(e);for(let r=0;e>r;r++)t.length>r?this.particles[r]=t[r]:(this.particles[r]={t:0,offset:0,edgeIndex:0,active:!1,x:0,y:0},this._freeIndices.push(r));this.capacity=e}};function Ge(e,t,r,n){if(e.circular&&e.segments)return void function(e,t,r,n,o){const i=e.length,a=t*i,s=Math.min(Math.floor(a),i-1),c=a-s,[l,u,d,h]=e[s];Qe(l,u,d,h,c,o);const f=h.x-l.x,y=h.y-l.y,g=Math.sqrt(f*f+y*y);if(g>.001){const e=f/g;o.x+=-y/g*r*n*2,o.y+=e*r*n*2}}(e.segments,t,r,e.halfWidth,n);if(!e.points)return n.x=0,void(n.y=0);const[o,i,a,s]=e.points;Qe(o,i,a,s,t,n);const c=s.x-o.x,l=s.y-o.y,u=Math.sqrt(c*c+l*l);if(u>.001){const t=c/u;n.x+=-l/u*r*e.halfWidth*2,n.y+=t*r*e.halfWidth*2}}function Qe(e,t,r,n,o,i){const a=1-o,s=a*a,c=s*a,l=o*o,u=l*o;i.x=c*e.x+3*s*o*t.x+3*a*l*r.x+u*n.x,i.y=c*e.y+3*s*o*t.y+3*a*l*r.y+u*n.y}function Ke(e,t){var r=e.get(t);if(!r)throw Error("missing: "+t);return r}function Ze(e,t){var r,n=[],o=[],i=[],a={},s=[];function c(e){i[e]=!1,a.hasOwnProperty(e)&&Object.keys(a[e]).forEach(function(t){delete a[e][t],i[t]&&c(t)})}function l(e){var t,n,d=!1;for(o.push(e),i[e]=!0,t=0;s[e].length>t;t++)(n=s[e][t])===r?(u(r,o),d=!0):i[n]||(d=l(n));if(d)c(e);else for(t=0;s[e].length>t;t++){var h=a[n=s[e][t]];h||(a[n]=h={}),h[n]=!0}return o.pop(),d}function u(e,r){var o=[].concat(r).concat(e);t?t(o):n.push(o)}function d(t){!function(t){for(var r=0;e.length>r;r++)r>=t&&e[r]||(e[r]=[]),e[r]=e[r].filter(function(e){return e>=t})}(t);for(var r,n=function(e){for(var t=e.length,r=Array(t),n=Array(t),o=Array(t),i=Array(t),a=Array(t),s=Array(t),c=0;t>c;++c)r[c]=-1,n[c]=0,o[c]=!1,i[c]=0,a[c]=-1,s[c]=[];var l,u=0,d=[],h=[];function f(t){var c=[t],l=[t];for(r[t]=n[t]=u,o[t]=!0,u+=1;l.length>0;){var f=e[t=l[l.length-1]];if(f.length>i[t]){for(var y=i[t];f.length>y;++y){var g=f[y];if(0>r[g]){r[g]=n[g]=u,o[g]=!0,u+=1,c.push(g),l.push(g);break}o[g]&&(n[t]=0|Math.min(n[t],n[g])),0>a[g]||s[t].push(a[g])}i[t]=y}else{if(n[t]===r[t]){var p=[],m=[],v=0;for(y=c.length-1;y>=0;--y){var x=c[y];if(o[x]=!1,p.push(x),m.push(s[x]),v+=s[x].length,a[x]=d.length,x===t){c.length=y;break}}d.push(p);var k=Array(v);for(y=0;m.length>y;y++)for(var b=0;m[y].length>b;b++)k[--v]=m[y][b];h.push(k)}l.pop()}}}for(c=0;t>c;++c)0>r[c]&&f(c);for(c=0;h.length>c;c++){var y=h[c];if(0!==y.length){y.sort(function(e,t){return e-t}),l=[y[0]];for(var g=1;y.length>g;g++)y[g]!==y[g-1]&&l.push(y[g]);h[c]=l}}return{components:d,adjacencyList:h}}(e),o=n.components.filter(function(e){return e.length>1}),i=1/0,a=0;o.length>a;a++)for(var s=0;o[a].length>s;s++)i>o[a][s]&&(i=o[a][s],r=a);var c=o[r];return!!c&&{leastVertex:i,adjList:e.map(function(e,t){return-1===c.indexOf(t)?[]:e.filter(function(e){return-1!==c.indexOf(e)})})}}r=0;for(var h=e.length;h>r;){var f=d(r);if(r=f.leastVertex,s=f.adjList){for(var y=0;s.length>y;y++)for(var g=0;s[y].length>g;g++){var p=s[y][g];i[+p]=!1,a[p]={}}l(r),r+=1}else r=h}return t?void 0:n}function Ue(e){return e.y0-e.y1>0?"up":"down"}function Je(e,t){return t(e.source)==t(e.target)}function et(e){var t=0;e.source.sourceLinks.forEach(function(e){t=e.circular?t+1:t});var r=0;return e.target.targetLinks.forEach(function(e){r=e.circular?r+1:r}),1>=t&&1>=r}function tt(e){return e.target.x0-e.source.x1}function rt(e,t){var r=ot(e),n=tt(t)/Math.tan(r);return"up"==Ue(e)?e.y1-n:e.y1+n}function nt(e,t){var r=ot(e),n=tt(t)/Math.tan(r);return"up"==Ue(e)?e.y1+n:e.y1-n}function ot(e){var t=Math.abs(e.y1-e.y0);return Math.atan(Math.abs(e.target.x0-e.source.x1)/t)}function it(e,t){return t(e)}function at(e){return ct(e.source)}function st(e){return ct(e.target)}function ct(e){return(e.y0+e.y1)/2}function lt(e){return e.virtual?0:e.value}function ut(e,t){var r=0;e.sourceLinks.forEach(function(e){r=e.circular&&!Je(e,t)?r+1:r});var n=0;return e.targetLinks.forEach(function(e){n=e.circular&&!Je(e,t)?n+1:n}),r+n}function dt(e){return e.target.depth}function ht(e,t){return e.sourceLinks.length?e.depth:t-1}function ft(e,t){return e.y0-t.y0}function yt(e,t){return t.y0-e.y0}function gt(e,t){return e.y1-t.y1}function pt(e,t){return t.y1-e.y1}function mt(e,t){return xt(e.source,t.source)||e.index-t.index}function vt(e,t){return xt(e.target,t.target)||e.index-t.index}function xt(e,t){return e.partOfCycle===t.partOfCycle?e.y0-t.y0:"top"===e.circularLinkType||"bottom"===t.circularLinkType?-1:1}function kt(e,t){return bt(e)==bt(t)?"bottom"==e.circularLinkType?yt(e,t):ft(e,t):bt(t)-bt(e)}function bt(e){return e.target.column-e.source.column}function _t(e,t){return St(e)==St(t)}function St(e){return e.y0-e.y1>0?"up":"down"}import{min as wt}from"d3-array";function At(e,t,r,n,o){let i=e;var a=Math.max(8,.15*(i.y1-i.y0));i.links.forEach(function(e){e.circular&&(e._circularWidth=Math.min(e.width,a))});var s=wt(i.links,function(e){return e.source.y0});i.links.forEach(function(e){e.circular&&(e.circularPathData={})});var c=i.links.filter(function(e){return e.circular});return c.sort(function(e,t){return t.value-e.value}),c.forEach(function(e,t){e._circularStub=t>=4}),Lt(i.links.filter(function(e){return"top"==e.circularLinkType}),t,r),Lt(i.links.filter(function(e){return"bottom"==e.circularLinkType}),t,r),i.links.forEach(function(e){if(e.circular){if(e.circularPathData.arcRadius=e._circularWidth+n,e.circularPathData.rightNodeBuffer=5,e.circularPathData.leftNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,Je(e,t)&&et(e))e.circularPathData.rightSmallArcRadius=n+e._circularWidth/2,e.circularPathData.rightLargeArcRadius=n+e._circularWidth/2,e.circularPathData.leftSmallArcRadius=n+e._circularWidth/2,e.circularPathData.leftLargeArcRadius=n+e._circularWidth/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+o+e.circularPathData.verticalBuffer,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-o-e.circularPathData.verticalBuffer,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius);else{var a=e.source.column,c=e.circularLinkType,l=i.links.filter(function(e){return e.source.column==a&&e.circularLinkType==c});l.sort("bottom"==e.circularLinkType?yt:ft);var u=0;l.forEach(function(t,o){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=n+e._circularWidth/2+u,e.circularPathData.rightLargeArcRadius=n+e._circularWidth/2+o*r+u),u+=t._circularWidth||t.width}),a=e.target.column,(l=i.links.filter(function(e){return e.target.column==a&&e.circularLinkType==c})).sort("bottom"==e.circularLinkType?pt:gt),u=0,l.forEach(function(t,o){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=n+e._circularWidth/2+u,e.circularPathData.leftLargeArcRadius=n+e._circularWidth/2+o*r+u),u+=t._circularWidth||t.width}),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i.y1,e.source.y1,e.target.y1)+o+e.circularPathData.verticalBuffer,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius):(e.circularPathData.verticalFullExtent=s-o-e.circularPathData.verticalBuffer,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius)}e.circularPathData.rightInnerExtent=e.circularPathData.sourceX+e.circularPathData.rightNodeBuffer,e.circularPathData.leftInnerExtent=e.circularPathData.targetX-e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.sourceX+e.circularPathData.rightLargeArcRadius+e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.targetX-e.circularPathData.leftLargeArcRadius-e.circularPathData.leftNodeBuffer}e.path=e.circular?function(e){return"top"==e.circularLinkType?"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 0 "+e.circularPathData.rightFullExtent+" "+(e.circularPathData.sourceY-e.circularPathData.rightSmallArcRadius)+" L"+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 0 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 0 "+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" L"+e.circularPathData.leftFullExtent+" "+(e.circularPathData.targetY-e.circularPathData.leftSmallArcRadius)+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 0 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY:"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 1 "+e.circularPathData.rightFullExtent+" "+(e.circularPathData.sourceY+e.circularPathData.rightSmallArcRadius)+" L"+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 1 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 1 "+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" L"+e.circularPathData.leftFullExtent+" "+(e.circularPathData.targetY+e.circularPathData.leftSmallArcRadius)+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 1 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY}(e):function(e){var t=e.source.x1,r=e.y0,n=e.target.x0,o=e.y1,i=(t+n)/2;return"M"+t+","+r+"C"+i+","+r+" "+i+","+o+" "+n+","+o}(e)}),i}function Lt(e,t,r){e.sort(kt);var n=e.filter(function(e){return!e._circularStub});return e.forEach(function(e,o){var i=0;if(e._circularStub)e.circularPathData.verticalBuffer=0;else if(Je(e,t)&&et(e))e.circularPathData.verticalBuffer=i+e._circularWidth/2;else{for(var a=0;n.length>a;a++){var s=n[a];if(s!==e&&s.circularPathData&&void 0!==s.circularPathData.verticalBuffer&&Et(e,s)){var c=s.circularPathData.verticalBuffer+(s._circularWidth||s.width)/2+r;i=c>i?c:i}}e.circularPathData.verticalBuffer=i+e._circularWidth/2}}),e}function Et(e,t){return e.source.column>=t.target.column&&t.source.column>=e.target.column}import{min as Pt,max as Dt,sum as Rt,mean as Mt,group as Nt,groups as Tt}from"d3-array";function Ct(e){return function(){return e}}function It(e){return e.index}function Wt(e){return e.nodes}function $t(e){return e.links}function zt(e,t,r){var n=Tt(e.nodes,function(e){return e.column}).sort(function(e,t){return e[0]-t[0]}).map(function(e){return e[1]});n.forEach(function(o,i){var a=o.length;if(t)o.sort(t);else if(i>0){var s=new Map;o.forEach(function(e,t){var r,n,o,i=(n=0,o=0,(r=e).targetLinks.forEach(function(e){if(!e.circular){var t=e.value||1;o+=ct(e.source)*t,n+=t}}),r.sourceLinks.forEach(function(e){if(!e.circular){var t=e.value||1;o+=ct(e.target)*t,n+=t}}),n>0?o/n:NaN);s.set(e,{bc:i,idx:t})}),o.sort(function(e,t){var r=s.get(e),n=s.get(t),o=r.bc,i=n.bc;if(e.circularLinkType!==t.circularLinkType){if("top"==e.circularLinkType&&"bottom"==t.circularLinkType)return-1;if("bottom"==e.circularLinkType&&"top"==t.circularLinkType)return 1;if("top"==e.circularLinkType)return-1;if("top"==t.circularLinkType)return 1;if("bottom"==e.circularLinkType)return 1;if("bottom"==t.circularLinkType)return-1}return isNaN(o)||isNaN(i)?isNaN(o)?isNaN(i)?r.idx-n.idx:1:-1:o-i})}else o.sort(function(e,t){return e.circularLinkType==t.circularLinkType?ut(t,r)-ut(e,r):"top"==e.circularLinkType&&"bottom"==t.circularLinkType||"top"==e.circularLinkType&&0==t.partOfCycle||0==e.partOfCycle&&"bottom"==t.circularLinkType?-1:0});o.forEach(function(t,o){t.depth==n.length-1&&1==a||0==t.depth&&1==a?(t.y0=e.y1/2-t.value*e.ky,t.y1=t.y0+t.value*e.ky):t.partOfCycle?0==ut(t,r)?(t.y0=e.y1/2+o,t.y1=t.y0+t.value*e.ky):"top"==t.circularLinkType?(t.y0=e.y0+o,t.y1=t.y0+t.value*e.ky):(t.y0=e.y1-t.value*e.ky-o,t.y1=t.y0+t.value*e.ky):0==e.y0||0==e.y1?(t.y0=(e.y1-e.y0)/a*o,t.y1=t.y0+t.value*e.ky):(t.y0=(e.y1-e.y0)/2-a/2+o,t.y1=t.y0+t.value*e.ky)})})}function Ft(e,t,r,n,o,i){var a=Tt(e.nodes,function(e){return e.column}).sort(function(e,t){return e[0]-t[0]}).map(function(e){return e[1]});u();for(var s=1,c=i;c>0;--c)l(s*=.99,r),u();function l(t,r){var n=a.length;a.forEach(function(o){var i=o.length,a=o[0].depth;o.forEach(function(o){var s;if(o.sourceLinks.length||o.targetLinks.length)if(o.partOfCycle&&ut(o,r)>0){var c=Mt(o.sourceLinks,st),l=Mt(o.targetLinks,at),u=c&&l?(c+l)/2:c||l;if(u){var d=(u-ct(o))*t*.3;o.y0+=d,o.y1+=d}}else if(0==a&&1==i)o.y0=e.y1/2-(s=o.y1-o.y0)/2,o.y1=e.y1/2+s/2;else if(a==n-1&&1==i)o.y0=e.y1/2-(s=o.y1-o.y0)/2,o.y1=e.y1/2+s/2;else if(1==o.targetLinks.length&&1==o.targetLinks[0].source.sourceLinks.length)s=o.y1-o.y0,o.y0=o.targetLinks[0].source.y0,o.y1=o.y0+s;else{var h=Mt(o.sourceLinks,st),f=Mt(o.targetLinks,at),y=((h&&f?(h+f)/2:h||f)-ct(o))*t;o.y0+=y,o.y1+=y}})})}function u(){a.forEach(function(r){var i,a,s,c=e.y0,l=r.length;for(r.sort(t||xt),s=0;l>s;++s)(a=c-(i=r[s]).y0)>0&&(i.y0+=a,i.y1+=a),c=i.y1+n;if((a=c-n-e.y1)>0)for(c=i.y0-=a,i.y1-=a,s=l-2;s>=0;--s)(a=(i=r[s]).y1+o-c)>0&&(i.y0-=a,i.y1-=a),c=i.y0})}}function Bt(e){e.nodes.forEach(function(e){e.sourceLinks.sort(vt),e.targetLinks.sort(mt)}),e.nodes.forEach(function(e){var t=e.y0,r=t,n=e.y1,o=n;e.sourceLinks.forEach(function(e){e.circular?(e.y0=n-e.width/2,n-=e.width):(e.y0=t+e.width/2,t+=e.width)}),e.targetLinks.forEach(function(e){e.circular?(e.y1=o-e.width/2,o-=e.width):(e.y1=r+e.width/2,r+=e.width)})})}function Yt(){var e=0,t=0,r=1,n=1,o=24,i=8,a=null,s=It,c=ht,l=void 0,u=32,d=2,h=Wt,f=$t;function y(){var y={nodes:h.apply(null,arguments),links:f.apply(null,arguments)};return function(h){h.x0=e,h.y0=t,h.x1=r,h.y1=n,h.py=0,function(e,t){e.nodes.forEach(function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]});var r=function(e,t){var r=new Map;return Nt(e,t).forEach(function(e,t){r.set(t,e[0])}),r}(e.nodes,t);e.links.forEach(function(e,t){e.index=t;var n=e.source,o=e.target;"object"!=typeof n&&(n=e.source=Ke(r,n)),"object"!=typeof o&&(o=e.target=Ke(r,o)),n.sourceLinks.push(e),o.targetLinks.push(e)})}(h,s),function(e,t){var r=0;if(null==t){for(var n=[],o=0;e.links.length>o;o++){var i=e.links[o],a=i.source.index,s=i.target.index;n[a]||(n[a]=[]),n[s]||(n[s]=[]),-1===n[a].indexOf(s)&&n[a].push(s)}var c=Ze(n);c.sort(function(e,t){return e.length-t.length});var l={};for(o=0;c.length>o;o++){var u=c[o].slice(-2);l[u[0]]||(l[u[0]]={}),l[u[0]][u[1]]=!0}e.links.forEach(function(e){var t=e.target.index,n=e.source.index;t===n||l[n]&&l[n][t]?(e.circular=!0,e.circularLinkID=r++):e.circular=!1})}else e.links.forEach(function(e){t(e.source)<t(e.target)?e.circular=!1:(e.circular=!0,e.circularLinkID=r++)})}(h,l),function(e,t){var r=0,n=0;e.links.forEach(function(o){o.circular&&(o.circularLinkType=o.source.circularLinkType||o.target.circularLinkType?o.source.circularLinkType?o.source.circularLinkType:o.target.circularLinkType:n>r?"top":"bottom","top"==o.circularLinkType?r++:n++,e.nodes.forEach(function(e){it(e,t)!=it(o.source,t)&&it(e,t)!=it(o.target,t)||(e.circularLinkType=o.circularLinkType)}))}),e.links.forEach(function(e){e.circular&&(e.source.circularLinkType==e.target.circularLinkType&&(e.circularLinkType=e.source.circularLinkType),Je(e,t)&&(e.circularLinkType=e.source.circularLinkType))})}(h,s),function(e){e.nodes.forEach(function(e){e.partOfCycle=!1,e.value=Math.max(Rt(e.sourceLinks,lt),Rt(e.targetLinks,lt)),e.sourceLinks.forEach(function(t){t.circular&&(e.partOfCycle=!0,e.circularLinkType=t.circularLinkType)}),e.targetLinks.forEach(function(t){t.circular&&(e.partOfCycle=!0,e.circularLinkType=t.circularLinkType)})})}(h),function(e,t,r){var n,o,i;if(null!=t){e.nodes.sort(function(e,r){return t(e)<t(r)?-1:1});var a=0,s=t(e.nodes[0]);e.nodes.forEach(function(e){a=t(e)==s?a:a+1,s=t(e)==s?s:t(e),e.column=a})}for(n=e.nodes,o=[],i=0;n.length;++i,n=o,o=[])n.forEach(function(e){e.depth=i,e.sourceLinks.forEach(function(e){0>o.indexOf(e.target)&&!e.circular&&o.push(e.target)})});for(n=e.nodes,o=[],i=0;n.length;++i,n=o,o=[])n.forEach(function(e){e.height=i,e.targetLinks.forEach(function(e){0>o.indexOf(e.source)&&!e.circular&&o.push(e.source)})});e.nodes.forEach(function(e){e.column=null==t?r(e,i):e.column})}(h,l,c);var f=i;if(null!==a){var y=Tt(h.nodes,function(e){return e.column}).sort(function(e,t){return e[0]-t[0]}).map(function(e){return e[1]}),g=Dt(y,function(e){return e.length});g>1&&(f=Math.max(1,(n-t)*a/(g-1)))}(function(e,t,r){var n=Tt(e.nodes,function(e){return e.column}).sort(function(e,t){return e[0]-t[0]}).map(function(e){return e[1]});e.py=t;var o=Pt(n,function(t){return(e.y1-e.y0-(t.length-1)*e.py)/Rt(t,function(e){return e.value})});e.ky=o,e.links.forEach(function(t){t.width=t.value*e.ky});var i=Dt(e.nodes,function(e){return e.column});e.nodes.forEach(i>0?function(t){t.x0=e.x0+t.column*((e.x1-e.x0-r)/i),t.x1=t.x0+r}:function(t){t.x0=e.x0,t.x1=t.x0+r})})(h,f,o),zt(h,l,s),Ft(h,l,s,f,f,u),Bt(h),At(h,s,d,10,8),zt(h,l,s),Ft(h,l,s,f,f,u),Bt(h),At(h,s,d,10,8),function(e,t){let r=e;r.nodes.forEach(function(e){e.y+(e.y1-e.y0)>r.y1&&(e.y=e.y-(e.y+(e.y1-e.y0)-r.y1));var n=r.links.filter(function(r){return it(r.source,t)==it(e,t)}),o=n.length;o>1&&n.sort(function(e,t){if(!e.circular&&!t.circular){if(e.target.column==t.target.column)return e.y1-t.y1;if(!_t(e,t))return e.y1-t.y1;if(e.target.column>t.target.column){var r=rt(t,e);return e.y1-r}if(t.target.column>e.target.column)return rt(e,t)-t.y1}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:"top"==e.circularLinkType?-1:1:void 0});var i=e.y0;n.forEach(function(e){e.y0=i+e.width/2,i+=e.width}),n.forEach(function(t,r){if("bottom"==t.circularLinkType){for(var i=r+1,a=0;o>i;i++)a+=n[i].width;t.y0=e.y1-a-t.width/2}})})}(h,s),function(e,t){let r=e;r.nodes.forEach(function(e){var n=r.links.filter(function(r){return it(r.target,t)==it(e,t)}),o=n.length;o>1&&n.sort(function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(!_t(e,t))return e.y0-t.y0;if(e.source.column>t.source.column){var r=nt(t,e);return e.y0-r}if(t.source.column>e.source.column)return nt(e,t)-t.y0}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.source.column===t.source.column?e.source.y1-t.source.y1:e.source.column-t.source.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.source.column===t.source.column?e.source.y1-t.source.y1:t.source.column-e.source.column:"top"==e.circularLinkType?-1:1:void 0});var i=e.y0;n.forEach(function(e){e.y1=i+e.width/2,i+=e.width}),n.forEach(function(t,r){if("bottom"==t.circularLinkType){for(var i=r+1,a=0;o>i;i++)a+=n[i].width;t.y1=e.y1-a-t.width/2}})})}(h,s),function(e){var t=e.nodes,r=e.links,n=!1,o=!1;if(r.forEach(function(e){"top"==e.circularLinkType?n=!0:"bottom"==e.circularLinkType&&(o=!0)}),0==n||0==o){let n=function(t){return(t-i)/(a-i)*(e.y1-e.y0)+e.y0};var i=Pt(t,function(e){return e.y0}),a=Dt(t,function(e){return e.y1}),s=(e.y1-e.y0)/(a-i);1>s?(t.forEach(function(e){e.y0=n(e.y0),e.y1=n(e.y1)}),r.forEach(function(e){e.y0=n(e.y0),e.y1=n(e.y1),e.width=e.width*s})):t.forEach(function(e){var t=e.y1-e.y0,r=n(e.y0)-e.y0;e.y0=n(e.y0),e.y1=e.y0+t,e.sourceLinks.forEach(function(e){e.y0=e.y0+r}),e.targetLinks.forEach(function(e){e.y1=e.y1+r})})}}(h),At(h,s,d,10,8)}(y),y}return y.update=function(e){return Bt(e),At(e,s,d,10,8),e},y.nodeWidth=function(e){return arguments.length?(o=+e,y):o},y.nodePadding=function(e){return arguments.length?(i=+e,y):i},y.nodePaddingRatio=function(e){return arguments.length?(a=+e,y):a},y.nodes=function(e){return arguments.length?(h="function"==typeof e?e:Ct(e),y):h},y.links=function(e){return arguments.length?(f="function"==typeof e?e:Ct(e),y):f},y.nodeId=function(e){return arguments.length?(s="function"==typeof e?e:Ct(e),y):s},y.nodeAlign=function(e){return arguments.length?(c="function"==typeof e?e:Ct(e),y):c},y.nodeSort=function(e){return arguments.length?(l=e,y):l},y.iterations=function(e){return arguments.length?(u=+e,y):u},y.circularLinkGap=function(e){return arguments.length?(d=+e,y):d},y.extent=function(o){return arguments.length?(e=+o[0][0],t=+o[0][1],r=+o[1][0],n=+o[1][1],y):[[e,t],[r,n]]},y.size=function(o){return arguments.length?(e=t=0,r=+o[0],n=+o[1],y):[r-e,n-t]},y}import{interpolateNumber as Ot}from"d3-interpolate";import{line as Xt,curveLinearClosed as jt}from"d3-shape";function Ht(e){const{sx:t,sTop:r,sBot:n,tx:o,tTop:i,tBot:a,cp1X:s,cp2X:c}=e,l=(r+n)/2,u=(i+a)/2;return{pathD:[`M${t},${r}`,`C${s},${r} ${c},${i} ${o},${i}`,`L${o},${a}`,`C${c},${a} ${s},${n} ${t},${n}`,"Z"].join(" "),bezier:{circular:!1,points:[{x:t,y:l},{x:s,y:l},{x:c,y:u},{x:o,y:u}],halfWidth:(n-r)/2}}}var qt=e=>{let t,r,n,o,i,a,s,c,l;if("down"===e.direction)return t=e.y0-e.sankeyWidth/2,r=e.y1-e.sankeyWidth/2,n=e.y1+e.sankeyWidth/2,o=e.y0+e.sankeyWidth/2,i=e.source.x1,a=e.target.x0,s=Ot(i,a),c=s(.5),l=s(.5),`M${t},${i}C${t},${c} ${r},${l} ${r},${a}L${n},${a}C${n},${l} ${o},${c} ${o},${i}Z`;const u=e.sankeyWidth/2,d=Ot(e.source.x1,e.target.x0),{pathD:h}=Ht({sx:e.source.x1,sTop:e.y0-u,sBot:e.y0+u,tx:e.target.x0,tTop:e.y1-u,tBot:e.y1+u,cp1X:d(.5),cp2X:d(.5)});return h};function Vt(e){const t=e.sankeyWidth/2,r=(e._circularWidth??e.sankeyWidth)/2,n=e.circularPathData;if(!n)return null;if("down"===e.direction)return null;if(e._circularStub){const r=n.sourceX,o=n.sourceY,i=n.targetX,a=n.targetY;if("object"!=typeof e.source||!e.source||"object"!=typeof e.target||!e.target)return null;const s=Math.max(15,Math.min(40,.33*(n.rightFullExtent-r))),c=Math.max(15,Math.min(40,.33*(i-n.leftFullExtent)));return`M${r},${o-t}L${r+s},${o-t}L${r+s},${o+t}L${r},${o+t}ZM${i},${a-t}L${i-c},${a-t}L${i-c},${a+t}L${i},${a+t}Z`}const o=n.sourceX,i=n.sourceY,a=n.targetX,s=n.targetY,c=n.rightFullExtent,l=n.leftFullExtent,u=n.verticalFullExtent,d="bottom"===e.circularLinkType?1:-1,h=Math.max(4,Math.min(r,15));return`M${o},${i-d*t}L${c},${i-d*t}L${c+r},${i-d*t+d*h}L${c+r},${u+d*r-d*h}L${c+r-h},${u+d*r}L${l-r+h},${u+d*r}L${l-r},${u+d*r-d*h}L${l-r},${s-d*t+d*h}L${l-r+h},${s-d*t}L${a},${s-d*t}L${a},${s+d*t}L${l+r},${s+d*t}L${l+r},${u-d*r}L${c-r},${u-d*r}L${c-r},${i+d*t}L${o},${i+d*t}Z`}var Gt=new Set,Qt=new WeakMap;function Kt(e,t){if("production"===process.env.NODE_ENV)return e;if(!e||!e.data||"object"!=typeof e.data)return e;let r=Qt.get(e);if(r){const e=r.get(t);if(e)return e}else r=new Map,Qt.set(e,r);const n=new Proxy(e,{get(e,r,n){if("string"==typeof r&&!(r in e)&&e.data&&r in e.data){const e=`${t}:${r}`;Gt.has(e)||(Gt.add(e),console.warn(`[Semiotic] "${t}" callback accessed "${r}" on the wrapper object, but it only exists on ".data". Use d.data.${r} (or d.data?.${r}) instead. Frame callbacks receive RealtimeNode/RealtimeEdge wrappers, not your raw data.`))}return Reflect.get(e,r,n)}});return r.set(t,n),n}var Zt={left:function(e){return e.depth},right:function(e,t){return t-1-e.height},center:function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?Math.min.apply(Math,e.sourceLinks.map(dt))-1:0},justify:ht},Ut={supportsStreaming:!0,hierarchical:!1,computeLayout(e,t,r,n){if(0===e.length)return;const o="vertical"===r.orientation?"down":"right",i=r.nodeAlign||"justify",a=r.nodeWidth??15,s=r.nodePaddingRatio??.05,c=r.iterations??100,l=e.map(e=>({...e})),u=t.map(e=>({...e,source:R(e.source),target:R(e.target),value:Math.sqrt(Math.max(1,e.value||1))}));let d;d="down"===o?[[0,0],[n[1],n[0]]]:[[0,0],[n[0],n[1]]];const h=Yt().extent(d).links(u).nodes(l).nodeAlign(Zt[i]||ht).nodeId(e=>e.id).nodeWidth(a).iterations(c);h.nodePaddingRatio&&h.nodePaddingRatio(s),h();{let e=1/0,t=-1/0,r=1/0,o=-1/0;for(const n of l)e>n.x0&&(e=n.x0),n.x1>t&&(t=n.x1),r>n.y0&&(r=n.y0),n.y1>o&&(o=n.y1);for(const n of u){if(!n.circular||!n.circularPathData)continue;const i=n.circularPathData,a=(n._circularWidth??n.width??0)/2;e>i.leftFullExtent-a&&(e=i.leftFullExtent-a),i.rightFullExtent+a>t&&(t=i.rightFullExtent+a),r>i.verticalFullExtent-a&&(r=i.verticalFullExtent-a),i.verticalFullExtent+a>o&&(o=i.verticalFullExtent+a)}const i=t-e,a=o-r,s=n[0],c=n[1];if(i>0&&a>0&&(0>e||0>r||t>s||o>c)){const t=Math.min(s/i,c/a),n=-e*t+(s-i*t)/2,o=-r*t+(c-a*t)/2;for(const e of l)e.x0=e.x0*t+n,e.x1=e.x1*t+n,e.y0=e.y0*t+o,e.y1=e.y1*t+o;for(const e of u)if(e.y0=e.y0*t+o,e.y1=e.y1*t+o,e.width=(e.width??0)*t,e._circularWidth&&(e._circularWidth*=t),e.circular&&e.circularPathData){const r=e.circularPathData;r.sourceX=r.sourceX*t+n,r.targetX=r.targetX*t+n,r.sourceY=r.sourceY*t+o,r.targetY=r.targetY*t+o,r.rightFullExtent=r.rightFullExtent*t+n,r.leftFullExtent=r.leftFullExtent*t+n,r.verticalFullExtent=r.verticalFullExtent*t+o,r.rightInnerExtent=r.rightInnerExtent*t+n,r.leftInnerExtent=r.leftInnerExtent*t+n,r.verticalRightInnerExtent=r.verticalRightInnerExtent*t+o,r.verticalLeftInnerExtent=r.verticalLeftInnerExtent*t+o,r.rightSmallArcRadius*=t,r.rightLargeArcRadius*=t,r.leftSmallArcRadius*=t,r.leftLargeArcRadius*=t,r.sourceWidth*=t,r.rightNodeBuffer*=t,r.leftNodeBuffer*=t,r.arcRadius*=t}}}const f=new Map;for(const t of e)f.set(t.id,t);for(const e of l){const t=f.get(e.id);t&&(t.x0=e.x0,t.x1=e.x1,t.y0=e.y0,t.y1=e.y1,t.value=e.value,t.depth=e.depth,t.sourceLinks=e.sourceLinks,t.targetLinks=e.targetLinks,t.width=e.x1-e.x0,t.height=e.y1-e.y0,t.x=e.x0+(e.x1-e.x0)/2,t.y=e.y0+(e.y1-e.y0)/2)}const y=new Map;for(const e of t)if(e._edgeKey)y.set(e._edgeKey,e);else{const t=R(e.source),r=R(e.target);y.set(`${t}\0${r}`,e)}for(const e of u){const t=R(e.source),r=R(e.target),n=y.get(e._edgeKey?e._edgeKey:`${t}\0${r}`);if(n){n.y0=e.y0,n.y1=e.y1,n.sankeyWidth=e.width??0,n.circular=!!e.circular,n.circularPathData=e.circularPathData,n._circularWidth=e._circularWidth,n._circularStub=e._circularStub,n.path=e.path,n.circularLinkType=e.circularLinkType,n.direction=o;const i=f.get(t),a=f.get(r);i&&(n.source=i),a&&(n.target=a)}}},buildScene(e,t,r,n){const o="vertical"===r.orientation?"down":"right",i=r.nodeStyle,a=r.edgeStyle,s=r.edgeOpacity??.5,c=r.edgeColorBy||"source",l=Array.isArray(r.colorScheme)?r.colorScheme:r.themeCategorical&&r.themeCategorical.length>0?r.themeCategorical:Se,u=new Map;e.forEach((e,t)=>{u.set(e.id,l[t%l.length])});const d=[],h=[],f=[],y=new Map;for(const t of e){const e=t.x1-t.x0,r=t.y1-t.y0;if(0>=e||0>=r)continue;const n=i?i(Kt(t,"nodeStyle")):{},a={fill:n.fill||u.get(t.id)||"#4d430c",stroke:n.stroke,strokeWidth:n.strokeWidth,opacity:n.opacity};y.set(t.id,("string"==typeof a.fill?a.fill:null)||u.get(t.id)||"#4d430c"),d.push("down"===o?{type:"rect",x:t.y0,y:t.x0,w:r,h:e,style:a,datum:t,id:t.id,label:t.id}:{type:"rect",x:t.x0,y:t.y0,w:e,h:r,style:a,datum:t,id:t.id,label:t.id})}const g=[...t].sort((e,t)=>(t.sankeyWidth||0)-(e.sankeyWidth||0));for(const e of g){if(!e.sankeyWidth||0>=e.sankeyWidth)continue;const t="object"==typeof e.source?e.source:null,n="object"==typeof e.target?e.target:null;if(!t||!n)continue;let o=r.themeSemantic?.border||r.themeSemantic?.secondary||"#999";o="function"==typeof c?c(e)||o:"target"===c?y.get(n.id)||u.get(n.id)||o:y.get(t.id)||u.get(t.id)||o;const i=a?a(Kt(e,"edgeStyle")):{};if(e._circularStub&&e.circular&&e.circularPathData){const t=e.circularPathData,r=e.sankeyWidth/2,n=Math.max(15,Math.min(40,.33*(t.rightFullExtent-t.sourceX))),a=Math.max(15,Math.min(40,.33*(t.targetX-t.leftFullExtent))),c=i.fill||o;h.push({type:"bezier",pathD:`M${t.sourceX},${t.sourceY-r}L${t.sourceX+n},${t.sourceY-r}L${t.sourceX+n},${t.sourceY+r}L${t.sourceX},${t.sourceY+r}Z`,style:{fill:c,fillOpacity:i.fillOpacity??s,stroke:"none",opacity:i.opacity},datum:e,_gradient:{direction:"right",from:1,to:0,x0:t.sourceX,x1:t.sourceX+n}}),h.push({type:"bezier",pathD:`M${t.targetX},${t.targetY-r}L${t.targetX-a},${t.targetY-r}L${t.targetX-a},${t.targetY+r}L${t.targetX},${t.targetY+r}Z`,style:{fill:c,fillOpacity:i.fillOpacity??s,stroke:"none",opacity:i.opacity},datum:e,_gradient:{direction:"left",from:0,to:1,x0:t.targetX-a,x1:t.targetX}});continue}let l;(l=e.circular&&e.circularPathData?Vt(e):qt(e),l)&&h.push({type:"bezier",pathD:l,bezierCache:e.bezier,style:{fill:i.fill||o,fillOpacity:i.fillOpacity??s,stroke:i.stroke||"none",strokeWidth:i.strokeWidth,opacity:i.opacity},datum:e})}if(!1!==r.showLabels){const t=D(r.nodeLabel);for(const r of e){const e=r.x1-r.x0,i=r.y1-r.y0;if(0>=e||0>=i)continue;const a=t?t(r):r.id;if(!a)continue;let s,c,l;"down"===o?(s=r.y0+(r.y1-r.y0)/2,c=r.x1+14,l="start"):(n[0]/2>r.x0+e/2?(s=r.x0-6,l="end"):(s=r.x1+6,l="start"),c=r.y0+i/2),f.push({x:s,y:c,text:a+"",anchor:"down"===o?"middle":l,baseline:"middle",fontSize:11})}}return{sceneNodes:d,sceneEdges:h,labels:f}}};import{forceSimulation as Jt,forceCenter as er,forceX as tr,forceY as rr,forceLink as nr,forceManyBody as or,forceCollide as ir}from"d3-force";import{scaleLinear as ar}from"d3-scale";var sr={supportsStreaming:!0,hierarchical:!1,computeLayout(e,t,r,n){if(0===e.length)return;const o=r.forceStrength??.1,i=n[0]/2,a=n[1]/2,s=Math.max(.1,Math.min(1,Math.min(n[0],n[1])/200)),c=Math.min(.5,.06+1.8*(1-s)),l=r.__previousPositions;let u=0;const d=[];for(const t of e){const e=null!=t.x&&null!=t.y&&(0!==t.x||0!==t.y),r=l?.get(t.id);e?u++:r?(t.x=r.x,t.y=r.y,u++):d.push(t)}const h=u>0&&.3>=(e.length>0?d.length/e.length:1);if(h){const r=new Map;for(const t of e)r.set(t.id,t);for(const e of d){const n=cr(e.id,t,r);if(n.length>0){let t=0,r=0;for(const e of n)t+=e.x,r+=e.y;const o=lr(e.id),i=o%360*(Math.PI/180),a=(10+o%20)*s;e.x=t/n.length+a*Math.cos(i),e.y=r/n.length+a*Math.sin(i)}else{const t=lr(e.id),r=t%360*(Math.PI/180),n=(15+t%30)*s;e.x=i+n*Math.cos(r),e.y=a+n*Math.sin(r)}}}else{const t=2.399963229728653;for(let r=0;e.length>r;r++){const n=e[r];if(null==n.x||null==n.y||0===n.x&&0===n.y){const e=10*Math.sqrt(r+.5)*s,o=r*t;n.x=i+e*Math.cos(o),n.y=a+e*Math.sin(o)}}}const f=r.__skipForceSimulation||0===r.iterations?0:h?40:r.iterations??Math.max(50,Math.min(300,Math.floor(300-2*(e.length-30)))),y=ur(r.nodeSize,r.nodeSizeRange,e),g=e=>y(e);if(f>0){const l=new Map,u=new Map;for(const t of e)l.set(t.id,0),u.set(t.id,t);for(const e of t){const t=R(e.source),r=R(e.target);l.set(t,(l.get(t)??0)+1),l.set(r,(l.get(r)??0)+1)}const d=nr().strength(e=>{const t=e.weight,r=R(e.source),n=R(e.target),i=Math.max(1,Math.min(l.get(r)??1,l.get(n)??1));return Math.min(2.5,(t&&t>0?Math.sqrt(t):1)*o/(.1*i))}).distance(e=>{const t="string"==typeof e.source?u.get(e.source):e.source,r="string"==typeof e.target?u.get(e.target):e.target,n=(t?g(t):0)+(r?g(r):0)+Math.max(6,12*s);return Math.max(16,40*s,n)}).id(e=>e.id),y=Jt();if(void 0===r.random&&void 0===r.seed||y.randomSource(r.random??ee(r.seed)),y.force("charge",or().strength(e=>{const t=l.get(e.id)??0;return-15*s*g(e)*Math.sqrt(t+1)})).force("collide",ir(e=>g(e)+3*s).strength(.9).iterations(2)).force("center",er(i,a).strength(.8)).force("x",tr(i).strength(c)).force("y",rr(a).strength(c)).force("bounds",function(e,t,r=2,n=.6){let o=[];const i=i=>{const a=n*Math.max(i,.2);for(const n of o){const o=n.x??e[0]/2,i=n.y??e[1]/2,s=n.vx??0,c=n.vy??0,l=t(n)+r,u=Math.min(e[0]/2,l),d=Math.max(e[0]/2,e[0]-l),h=Math.min(e[1]/2,l),f=Math.max(e[1]/2,e[1]-l),y=o+s,g=i+c;u>y?n.vx=s+(u-y)*a:y>d&&(n.vx=s+(d-y)*a),h>g?n.vy=c+(h-g)*a:g>f&&(n.vy=c+(f-g)*a)}};return i.initialize=e=>{o=e},i}(n,g)),y.nodes(e),t.length>0){const e=t.map(e=>({...e,source:R(e.source),target:R(e.target)}));d.links(e),y.force("link",d)}h?y.alpha(.3):.1>y.alpha()&&y.alpha(1),y.stop();for(let e=0;f>e;++e)y.tick()}for(const t of e){if(null==t.x||null==t.y)continue;const e=g(t),r=f>0?2:0,o=Math.min(n[0]/2,e+r),i=Math.min(n[1]/2,e+r);t.x=Math.max(o,Math.min(n[0]-o,t.x)),t.y=Math.max(i,Math.min(n[1]-i,t.y)),t.x0=0,t.x1=0,t.y0=0,t.y1=0}const p=new Map;for(const t of e)p.set(t.id,t);for(const e of t){if("string"==typeof e.source){const t=p.get(e.source);t&&(e.source=t)}if("string"==typeof e.target){const t=p.get(e.target);t&&(e.target=t)}}},buildScene(e,t,r,n){const o=r.nodeStyle,i=r.edgeStyle,a=ur(r.nodeSize,r.nodeSizeRange,e),s=Array.isArray(r.colorScheme)?r.colorScheme:r.themeCategorical&&r.themeCategorical.length>0?r.themeCategorical:Se,c=new Map;e.forEach((e,t)=>{c.set(e.id,s[t%s.length])});const l=[],u=[],d=[];for(const t of e){if(null==t.x||null==t.y)continue;const e=a(Kt(t,"nodeSize")),n=o?o(Kt(t,"nodeStyle")):{},i={fill:n.fill||c.get(t.id)||r.themeSemantic?.primary||"#007bff",stroke:n.stroke||r.themeSemantic?.surface||"#fff",strokeWidth:n.strokeWidth??2,opacity:n.opacity};l.push({type:"circle",cx:t.x,cy:t.y,r:e,style:i,datum:t,id:t.id,label:t.id})}const h=new Map;for(const t of e)h.set(t.id,t);for(const e of t){const t="object"==typeof e.source?e.source:h.get(e.source),n="object"==typeof e.target?e.target:h.get(e.target);if(!t||!n)continue;if(null==t.x||null==t.y)continue;if(null==n.x||null==n.y)continue;const o=i?i(Kt(e,"edgeStyle")):{};u.push({type:"line",x1:t.x,y1:t.y,x2:n.x,y2:n.y,style:{stroke:o.stroke||r.themeSemantic?.border||r.themeSemantic?.secondary||"#999",strokeWidth:o.strokeWidth??1,opacity:o.opacity??.6},datum:e})}if(!1!==r.showLabels){const t=D(r.nodeLabel);for(const r of e){if(null==r.x||null==r.y)continue;const e=t?t(r):r.id;if(!e)continue;const n=a(Kt(r,"nodeSize"));d.push({x:r.x,y:r.y-n-4,text:e+"",anchor:"middle",baseline:"auto",fontSize:11})}}return{sceneNodes:l,sceneEdges:u,labels:d}}};function cr(e,t,r){const n=[];for(const o of t){const t=R(o.source),i=R(o.target);let a=null;if(t===e?a=i:i===e&&(a=t),a){const e=r.get(a);!e||0===e.x&&0===e.y||n.push({x:e.x,y:e.y})}}return n}function lr(e){let t=0;for(let r=0;e.length>r;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return Math.abs(t)}function ur(e,t,r){if(r.some(e=>null!=e.__forceRadius))return e=>e.__forceRadius??8;if(null==e)return()=>8;if("number"==typeof e)return()=>e;if("function"==typeof e)return t=>e(t)||8;const n=t||[5,20],o=[];for(const t of r){const r=t.data?.[e];"number"==typeof r&&o.push(r)}if(0===o.length)return()=>n[0];const[i,a]=Re(o);if(i===a)return()=>(n[0]+n[1])/2;const s=ar().domain([i,a]).range(n).clamp(!0);return t=>{const r=t.data?.[e];return null==r||"number"!=typeof r?n[0]:s(r)}}import{chord as dr,ribbon as hr}from"d3-chord";import{arc as fr}from"d3-shape";var yr=Se,gr={supportsStreaming:!1,hierarchical:!1,computeLayout(e,t,r,n){if(0===e.length)return;const{padAngle:o=.01,groupWidth:i=20,sortGroups:a}=r,s=Math.min(n[0],n[1])/2,c=s-i,l=n[0]/2,u=n[1]/2,d=(h=r.valueAccessor)?"function"==typeof h?h:e=>e[h]??1:e=>e.value??1;var h;const f=new Map;for(let t=0;e.length>t;t++)f.set(e[t].id,t);const y=e.length,g=Array.from({length:y},()=>Array.from({length:y},()=>0));for(const e of t){const t=R(e.source),r=R(e.target),n=f.get(t),o=f.get(r);if(void 0===n||void 0===o)continue;const i=d(e);g[n][o]=i}const p=dr().padAngle(o);a&&p.sortGroups(a);const m=p(g),v=m.groups,x=fr().innerRadius(c).outerRadius(s);for(const t of v){const r=e[t.index],n=x.centroid({innerRadius:c,outerRadius:s,startAngle:t.startAngle,endAngle:t.endAngle});r.x=n[0]+l,r.y=n[1]+u,r.__arcData={startAngle:t.startAngle,endAngle:t.endAngle}}const k=new Map;for(const t of e)k.set(t.id,t);for(const e of t){const t=R(e.source),r=R(e.target),n=k.get(t),o=k.get(r);n&&(e.source=n),o&&(e.target=o)}const b=new Map;for(const e of t){const t=R(e.source),r=R(e.target);b.set(`${t}\0${r}`,e)}for(const t of m){const r=e[t.source.index].id,n=e[t.target.index].id,o=b.get(`${r}\0${n}`)||b.get(`${n}\0${r}`);o&&(o.__chordData=t)}},buildScene(e,t,r,n){const{groupWidth:o=20,edgeOpacity:i=.5}=r,a=Math.min(n[0],n[1])/2,s=a-o,c=n[0]/2,l=n[1]/2,u=r.nodeStyle,d=r.edgeStyle,h=r.edgeColorBy||"source",f=Array.isArray(r.colorScheme)?r.colorScheme:r.themeCategorical&&r.themeCategorical.length>0?r.themeCategorical:yr,y=new Map;e.forEach((e,t)=>{y.set(e.id,f[t%f.length])});const g=hr().radius(s),p=[],m=[],v=[];for(let t=0;e.length>t;t++){const r=e[t],n=r.__arcData;if(!n)continue;let o;o=u?u(Kt(r,"nodeStyle")).fill||y.get(r.id)||f[t%f.length]:y.get(r.id)||f[t%f.length];const i=u?u(Kt(r,"nodeStyle")):{};p.push({type:"arc",cx:c,cy:l,innerR:s,outerR:a,startAngle:n.startAngle-Math.PI/2,endAngle:n.endAngle-Math.PI/2,style:{fill:o,stroke:i.stroke||"black",strokeWidth:i.strokeWidth??1,opacity:i.opacity},datum:r,id:r.id,label:r.id})}for(const e of t){const t=e.__chordData;if(!t)continue;const n=g(t);if(!n)continue;const o=pr(n,c,l);let a=r.themeSemantic?.border||r.themeSemantic?.secondary||"#999";if(d)a=d(Kt(e,"edgeStyle")).fill||a;else{const t="object"==typeof e.source?e.source:null,r="object"==typeof e.target?e.target:null;"target"===h&&r?a=y.get(r.id)||a:t&&(a=y.get(t.id)||a)}const s=d?d(Kt(e,"edgeStyle")):{};m.push({type:"ribbon",pathD:o,style:{fill:a,fillOpacity:s.fillOpacity??i,stroke:s.stroke||"none",strokeWidth:s.strokeWidth,opacity:s.opacity},datum:e})}if(!1!==r.showLabels){const t=D(r.nodeLabel),n=a+12;for(const r of e){const e=r.__arcData;if(!e)continue;const o=t?t(r):r.id;if(!o)continue;const i=(e.startAngle+e.endAngle)/2,a=i-Math.PI/2;v.push({x:c+Math.cos(a)*n,y:l+Math.sin(a)*n,text:o+"",anchor:i>Math.PI?"end":"start",baseline:"middle",fontSize:11})}}return{sceneNodes:p,sceneEdges:m,labels:v}}};function pr(e,t,r){const n=e.match(/[a-zA-Z]|[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?/g);if(!n)return e;const o=[];let i=0;for(;n.length>i;){const e=n[i];if("M"===e||"L"===e)for(o.push(e),i++;n.length>i&&!isNaN(Number(n[i]));)o.push(Number(n[i])+t+""),i++,n.length>i&&!isNaN(Number(n[i]))&&(o.push(Number(n[i])+r+""),i++);else if("C"===e)for(o.push(e),i++;n.length>i&&!isNaN(Number(n[i]));)for(let e=0;3>e&&n.length>i&&!isNaN(Number(n[i]));e++)o.push(Number(n[i])+t+""),i++,n.length>i&&!isNaN(Number(n[i]))&&(o.push(Number(n[i])+r+""),i++);else if("Q"===e)for(o.push(e),i++;n.length>i&&!isNaN(Number(n[i]));)for(let e=0;2>e&&n.length>i&&!isNaN(Number(n[i]));e++)o.push(Number(n[i])+t+""),i++,n.length>i&&!isNaN(Number(n[i]))&&(o.push(Number(n[i])+r+""),i++);else if("A"===e)for(o.push(e),i++;n.length>i&&!isNaN(Number(n[i]));)o.push(n[i++]),n.length>i&&o.push(n[i++]),n.length>i&&o.push(n[i++]),n.length>i&&o.push(n[i++]),n.length>i&&o.push(n[i++]),n.length>i&&(o.push(Number(n[i])+t+""),i++),n.length>i&&(o.push(Number(n[i])+r+""),i++);else"Z"===e||"z"===e?(o.push(e),i++):(o.push(n[i]),i++)}return o.join(" ")}import{hierarchy as mr,tree as vr,cluster as xr,treemap as kr,pack as br,partition as _r,treemapBinary as Sr}from"d3-hierarchy";var wr=["#e8d5b7","#b8d4e3","#d4e3b8","#e3c4d4","#d4d4e3","#e3d4b8","#b8e3d4","#e3b8b8"];function Ar(e){const[t,r,n]=function(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}const t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}(e);return.299*t+.587*r+.114*n>150?"#222":"#fff"}function Lr(e,t,r){const n=t.nodeIDAccessor;return"function"==typeof n?n(e.data)+"":"string"==typeof n&&void 0!==e.data[n]?e.data[n]+"":void 0!==e.data.name?e.data.name+"":void 0!==e.data.id?e.data.id+"":"node-"+r}function Er(e){if(!e)return null;if("function"==typeof e){const t=e;return e=>t(e.data??e)}return t=>t.data?.[e]||t[e]||t.id}function Pr(e){return Array.isArray(e.colorScheme)?e.colorScheme:e.themeCategorical&&e.themeCategorical.length>0?e.themeCategorical:wr}function Dr(e){return Array.isArray(e.colorScheme)&&e.colorScheme.length>0?e.colorScheme[0]:e.themeSemantic?.primary?e.themeSemantic.primary:e.themeCategorical&&e.themeCategorical.length>0?e.themeCategorical[0]:"#4d430c"}function Rr(e,t,r,n,o){if("horizontal"===o){const o=(e+r)/2;return`M ${e},${t} C ${o},${t} ${o},${n} ${r},${n}`}if("radial"===o){const o=(e+r)/2;return`M ${e},${t} Q ${o},${t} ${o},${(t+n)/2} T ${r},${n}`}{const o=(t+n)/2;return`M ${e},${t} C ${e},${o} ${r},${o} ${r},${n}`}}var Mr={supportsStreaming:!1,hierarchical:!0,computeLayout(e,t,r,n){const o=r.__hierarchyRoot;if(!o)return;const i=r.chartType,a=function(e){if(e)return"function"==typeof e?e:t=>t[e]}(r.childrenAccessor),s=r.hierarchySum,c="function"==typeof s?s:"string"==typeof s?e=>Number(e[s])||0:e=>Number(e.value)||0,l=mr(o,a);l.sum(c),l.sort((e,t)=>(t.value??0)-(e.value??0));const[u,d]=n;switch(i){case"tree":!function(e,t,r,n){const o=t.treeOrientation||"vertical",i=vr();i.size("horizontal"===o?[n,r]:"radial"===o?[2*Math.PI,Math.min(r,n)/2*.8]:[r,n]),i(e)}(l,r,u,d);break;case"cluster":!function(e,t,r,n){const o=t.treeOrientation||"vertical",i=xr();i.size("horizontal"===o?[n,r]:"radial"===o?[2*Math.PI,Math.min(r,n)/2*.8]:[r,n]),i(e)}(l,r,u,d);break;case"treemap":!function(e,t,r,n){const o=t.padding??4,i=t.paddingTop??0,a=kr().size([r,n]).tile(Sr).padding(o);i>0&&a.paddingTop(i),a(e)}(l,r,u,d);break;case"circlepack":!function(e,t,r,n){const o=t.padding??4;br().size([r,n]).padding(o)(e)}(l,r,u,d);break;case"partition":!function(e,t,r,n){_r().size([r,n]).padding(t.padding??1)(e)}(l,r,u,d)}const h=l.descendants();e.length=0,t.length=0;const f=new Map;for(let t=0;h.length>t;t++){const n=h[t],o={id:Lr(n,r,t),x:0,y:0,x0:0,x1:0,y0:0,y1:0,width:0,height:0,value:n.value??0,depth:n.depth,data:n.data,createdByFrame:!0};"tree"===i||"cluster"===i?Nr(o,n,r):"treemap"===i||"partition"===i?Tr(o,n):"circlepack"===i&&Cr(o,n),o.__hierarchyNode=n,e.push(o),f.set(n,o)}if("tree"===i||"cluster"===i)for(const e of h)if(e.parent){const r=f.get(e.parent),n=f.get(e);r&&n&&t.push({source:r,target:n,value:1,y0:0,y1:0,sankeyWidth:0,data:{depth:e.depth}})}},buildScene(e,t,r,n){const o=r.nodeStyle||(()=>({})),i=r.edgeStyle||(()=>({}));switch(r.chartType){case"tree":case"cluster":return function(e,t,r,n,o,i){const a=[],s=[],c=[],l=r.treeOrientation||"vertical",u="radial"===l,d=n[0]/2,h=n[1]/2,f="number"==typeof(y=r.nodeSize)?y:5;var y;for(const t of e){let e=t.x,n=t.y;u&&(e+=d,n+=h);const i=o(Kt(t,"nodeStyle"));let s=i.fill||Dr(r);if(r.colorByDepth&&void 0!==t.depth){const e=Pr(r);s=e[t.depth%e.length]}a.push({type:"circle",cx:e,cy:n,r:f,style:{fill:s,stroke:i.stroke||r.themeSemantic?.surface||"#fff",strokeWidth:i.strokeWidth??1,opacity:i.opacity},datum:t,id:t.id,label:t.id,depth:t.depth})}const g=r.edgeOpacity??.5;for(const e of t){const t="object"==typeof e.source?e.source:null,n="object"==typeof e.target?e.target:null;if(!t||!n)continue;let o=t.x,a=t.y,c=n.x,f=n.y;u&&(o+=d,a+=h,c+=d,f+=h);const y=Rr(o,a,c,f,l),p=i(Kt(e,"edgeStyle"));s.push({type:"curved",pathD:y,style:{fill:"none",stroke:p.stroke||r.themeSemantic?.border||r.themeSemantic?.secondary||"#999",strokeWidth:p.strokeWidth??1.5,opacity:p.opacity??g},datum:e})}if(!1!==r.showLabels){const t=Er(r.nodeLabel);for(const r of e){const e=t?t(r):r.id;if(!e)continue;let n,o,i,a=r.x,s=r.y;if(u&&(a+=d,s+=h),u){const e=a-d,t=s-h,r=Math.sqrt(e*e+t*t);r>0?(n=a+e/r*10,o=s+t/r*10,i=0>e?"end":"start"):(n=a,o=s-12,i="middle")}else"horizontal"===l?(r.data?.children&&0!==r.data.children.length?(n=a-f-6,i="end"):(n=a+f+6,i="start"),o=s):(n=a,o=s+f+14,i="middle");c.push({x:n,y:o,text:e+"",anchor:i,baseline:"middle",fontSize:11})}}return{sceneNodes:a,sceneEdges:s,labels:c}}(e,t,r,n,o,i);case"treemap":case"partition":return function(e,t,r,n){const o=[],i=[];for(const r of e){const e=r.x1-r.x0,i=r.y1-r.y0;if(0>=e||0>=i)continue;const a=n(Kt(r,"nodeStyle"));let s=a.fill||Dr(t);if(t.colorByDepth&&void 0!==r.depth){const e=Pr(t);s=e[r.depth%e.length]}o.push({type:"rect",x:r.x0,y:r.y0,w:e,h:i,style:{fill:s,stroke:a.stroke||t.themeSemantic?.surface||"#fff",strokeWidth:a.strokeWidth??1,opacity:a.opacity,fillOpacity:a.fillOpacity,strokeOpacity:a.strokeOpacity},datum:r,id:r.id,label:r.id,depth:r.depth})}if(!1!==t.showLabels){const r=Er(t.nodeLabel),o=t.labelMode||"leaf",a="partition"===t.chartType;for(const s of e){const e=s.x1-s.x0,c=s.y1-s.y0;if(0>=e||0>=c)continue;const l=!(s.data?.children&&s.data.children.length>0);if(!a){if("leaf"===o&&!l)continue;if("parent"===o&&l)continue}const u=r?r(s):s.id;if(!u)continue;if((l?30:40)>e||(l?16:14)>c)continue;let d=n(Kt(s,"nodeStyle")).fill||Dr(t);if(t.colorByDepth&&void 0!==s.depth){const e=Pr(t);d=e[s.depth%e.length]}const h="string"==typeof d?Ar(d):t.themeSemantic?.text??"#000";i.push(l?{x:s.x0+e/2,y:s.y0+c/2,text:u+"",anchor:"middle",baseline:"middle",fontSize:Math.min(11,Math.max(8,Math.min(e,c)/6)),fill:h}:{x:s.x0+4,y:s.y0+12,text:u+"",anchor:"start",baseline:"auto",fontSize:11,fontWeight:600,fill:h})}}return{sceneNodes:o,sceneEdges:[],labels:i}}(e,r,0,o);case"circlepack":return function(e,t,r,n){const o=[],i=[];for(const r of e){const e=r.__radius??5;if(0>=e)continue;const i=n(Kt(r,"nodeStyle"));let a=i.fill||Dr(t);if(t.colorByDepth&&void 0!==r.depth){const e=Pr(t);a=e[r.depth%e.length]}o.push({type:"circle",cx:r.x,cy:r.y,r:e,style:{fill:a,stroke:i.stroke||t.themeSemantic?.surface||"#fff",strokeWidth:i.strokeWidth??1,opacity:i.opacity??.7},datum:r,id:r.id,label:r.id,depth:r.depth})}if(!1!==t.showLabels){const r=Er(t.nodeLabel);for(const o of e){const e=o.__radius??5,a=r?r(o):o.id;if(!a)continue;if(15>e)continue;const s=!(o.data?.children&&o.data.children.length>0);let c=n(Kt(o,"nodeStyle")).fill||Dr(t);if(t.colorByDepth&&void 0!==o.depth){const e=Pr(t);c=e[o.depth%e.length]}if(s){const r="string"==typeof c?Ar(c):t.themeSemantic?.text??"#000";i.push({x:o.x,y:o.y,text:a+"",anchor:"middle",baseline:"middle",fontSize:Math.min(11,Math.max(8,e/3)),fill:r})}else i.push({x:o.x,y:o.y-e+14,text:a+"",anchor:"middle",baseline:"hanging",fontSize:Math.min(11,Math.max(8,e/3)),fill:t.themeSemantic?.text||"#000",stroke:t.themeSemantic?.surface||"#fff",strokeWidth:3,paintOrder:"stroke"})}}return{sceneNodes:o,sceneEdges:[],labels:i}}(e,r,0,o);default:return{sceneNodes:[],sceneEdges:[],labels:[]}}}};function Nr(e,t,r){const n=r.treeOrientation||"vertical";if("radial"===n){const r=t.x,n=t.y;e.x=n*Math.cos(r-Math.PI/2),e.y=n*Math.sin(r-Math.PI/2)}else"horizontal"===n?(e.x=t.y,e.y=t.x):(e.x=t.x,e.y=t.y);e.x0=e.x-5,e.x1=e.x+5,e.y0=e.y-5,e.y1=e.y+5,e.width=10,e.height=10}function Tr(e,t){e.x0=t.x0,e.x1=t.x1,e.y0=t.y0,e.y1=t.y1,e.x=(t.x0+t.x1)/2,e.y=(t.y0+t.y1)/2,e.width=t.x1-t.x0,e.height=t.y1-t.y0}function Cr(e,t){const r=t.r??0;e.x=t.x,e.y=t.y,e.x0=t.x-r,e.x1=t.x+r,e.y0=t.y-r,e.y1=t.y+r,e.width=2*r,e.height=2*r,e.__radius=r}import{pie as Ir}from"d3-shape";function Wr(e){let t=e.__orbitState;return t||(t={metaMap:new Map,startTime:"undefined"!=typeof performance?performance.now():Date.now()},e.__orbitState=t),t}var $r={sankey:Ut,force:sr,chord:gr,tree:Mr,cluster:Mr,treemap:Mr,circlepack:Mr,partition:Mr,orbit:{supportsStreaming:!1,hierarchical:!0,supportsAnimation:!0,computeLayout(e,t,r,n){const o=r.__hierarchyRoot;o&&function(e,t,r,n,o){const i=function(e){if("function"==typeof e)return e;const t=e||"children";return e=>e[t]||null}(r.childrenAccessor),a=function(e){if("function"==typeof e)return e;const t=e||"name";return e=>(e[t]??"")+""}(r.nodeIDAccessor),s=function(e){if(Array.isArray(e))return e;switch(e){case"solar":return[1];case"atomic":return[2,8];default:return[9999]}}(r.orbitMode),c=r.orbitSize??2.95,l=r.orbitEccentricity??1,u="number"==typeof c?()=>c:c,d="number"==typeof l?()=>l:l,h=Wr(r);h.metaMap.clear(),n.length=0,o.length=0;const f=new Map;function y(e){const t=f.get(e)??0;return f.set(e,t+1),0===t?e:`${e}__${t}`}const g=t[0]/2,p=t[1]/2,m=Math.min(t[0],t[1])/2*.85,v=y(a(e));n.push({id:v,x:g,y:p,x0:g,x1:g,y0:p,y1:p,width:0,height:0,value:0,depth:0,data:e}),h.metaMap.set(v,{ring:m,angle:0,depth:0,parentId:null,eccentricity:1}),function e(t,r,c,l,f,g,p){const m=i(t);if(!m?.length)return;const v=m.length;let x=0,k=0,b=0;for(;v>k;)k+=s[Math.min(b,s.length-1)],b++,x++;let _=0;for(let v=0;x>v;v++){const k=s[Math.min(v,s.length-1)],b=m.slice(_,_+k);if(!b.length)break;const S=(v+1)/x,w={id:r,depth:g,data:t,parentId:r},A=p?f/u(w)*S:f*S,L=Ir().value(e=>{const t=i(e)?.length;return t?4:1}).sort(null)(b),E=d(w);for(let t=0;b.length>t;t++){const i=(L[t].startAngle+L[t].endAngle)/2,s=b[t],u=y(a(s)),d=c+A*Math.sin(i),f=l+A*Math.cos(i)*E;n.push({id:u,x:d,y:f,x0:d,x1:d,y0:f,y1:f,width:0,height:0,value:0,depth:g,data:s}),h.metaMap.set(u,{ring:A,angle:i,depth:g,parentId:r,eccentricity:E}),o.push({source:r,target:u,value:1,y0:0,y1:0,sankeyWidth:0,data:{source:r,target:u}}),e(s,u,d,f,A,g+1,!0)}_+=k}}(e,v,g,p,m,1,!1)}(o,n,r,e,t)},buildScene(e,t,r,n){const o=r.nodeStyle,i=r.nodeSize,a="number"==typeof i?()=>i:"function"==typeof i?i:()=>6,s=[],c=[],l=[];if(!1!==r.orbitShowRings){const t=Wr(r),n=new Map;for(const t of e)n.set(t.id,t);const o=new Map;for(const[,e]of t.metaMap){if(!e.parentId)continue;const t=n.get(e.parentId);if(!t)continue;const r=`${e.parentId}:${e.ring}`;o.has(r)||o.set(r,{parentX:t.x,parentY:t.y,ring:e.ring,ecc:e.eccentricity})}const i=48,a={stroke:"rgba(128,128,128,0.35)",strokeWidth:.5,opacity:1};for(const[,{parentX:e,parentY:t,ring:r,ecc:n}]of o)for(let o=0;i>o;o++){const s=o/i*Math.PI*2,l=(o+1)/i*Math.PI*2;c.push({type:"line",x1:e+r*Math.sin(s),y1:t+r*Math.cos(s)*n,x2:e+r*Math.sin(l),y2:t+r*Math.cos(l)*n,style:a,datum:null})}}for(const t of e){if(null==t.x||null==t.y)continue;const e=a(Kt(t,"nodeSize")),n=o?o(Kt(t,"nodeStyle")):{};s.push({type:"circle",cx:t.x,cy:t.y,r:e,style:{fill:n.fill||r.themeSemantic?.primary||"#6366f1",stroke:n.stroke||r.themeSemantic?.surface||"#fff",strokeWidth:n.strokeWidth??1,opacity:n.opacity??(0===(t.depth??0)?1:.85)},datum:t,id:t.id,label:t.id,depth:t.depth})}const u=new Map;for(const t of e)u.set(t.id,t);for(const e of t){const t="object"==typeof e.source?e.source:u.get(e.source),r="object"==typeof e.target?e.target:u.get(e.target);t&&r&&(null!=t.x&&null!=r.x&&c.push({type:"line",x1:t.x,y1:t.y,x2:r.x,y2:r.y,style:{stroke:"rgba(128,128,128,0.35)",strokeWidth:.5,opacity:1},datum:e}))}if(r.showLabels){const t=r.nodeLabel;for(const r of e){const e=a(Kt(r,"nodeSize"));if(4>=e)continue;const n="function"==typeof t?t(r):t?r.data?.[t]??r.id:r.id;l.push({x:r.x,y:r.y+e+12,text:n+"",anchor:"middle",fontSize:10,fill:"currentColor"})}}return{sceneNodes:s,sceneEdges:c,labels:l}},tick:(e,t,r,n,o)=>!1!==r.orbitAnimated&&(function(e,t){const r=Wr(t),n=t.orbitSpeed??.25,o=t.orbitRevolution??function(e){switch(e){case"decay":return e=>Math.pow(.6,e.depth??0);case"alternate":return e=>{const t=e.depth??0;return(t%2==0?1:-1)/(t+1)};default:return e=>1/((e.depth??0)+1)}}(t.orbitRevolutionStyle),i=(("undefined"!=typeof performance?performance.now():Date.now())-r.startTime)/1e3,a=n*(Math.PI/6),s=new Map;for(const t of e)s.set(t.id,t);for(const t of e){const e=r.metaMap.get(t.id);if(!e||!e.parentId)continue;const n=s.get(e.parentId);if(!n)continue;const c=e.angle+i*a*o({id:t.id,depth:e.depth,data:t.data,parentId:e.parentId});t.x=n.x+e.ring*Math.sin(c),t.y=n.y+e.ring*Math.cos(c)*e.eccentricity,t.x0=t.x,t.x1=t.x,t.y0=t.y,t.y1=t.y}}(e,r),!0)}};function zr(e){return $r[e]}import{quadtree as Fr}from"d3-quadtree";function Br(e){return{id:e,x0:0,x1:0,y0:0,y1:0,x:0,y:0,width:0,height:0,value:0,createdByFrame:!0}}function Yr(e){if(!e||"object"!=typeof e)return!1;const t=e;if("boolean"!=typeof t.circular)return!1;if("number"!=typeof t.halfWidth||!Number.isFinite(t.halfWidth))return!1;if(t.circular){if(!Array.isArray(t.segments)||0===t.segments.length)return!1;for(const e of t.segments)if(!Or(e))return!1;return!0}return Or(t.points)}function Or(e){if(!Array.isArray(e)||4!==e.length)return!1;for(const t of e){if(!t||"object"!=typeof t)return!1;const e=t;if("number"!=typeof e.x||!Number.isFinite(e.x))return!1;if("number"!=typeof e.y||!Number.isFinite(e.y))return!1}return!0}import{interpolateNumber as Xr}from"d3-interpolate";var jr="rgba(34, 197, 94, 0.7)",Hr=2e3,qr=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Vr=["scene-style","data-paint","accessibility","evidence"],Gr=(e,t)=>({retainedData:e,invalidations:t}),Qr=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Kr=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Zr=["scene-geometry","data-paint","overlay","accessibility","evidence"],Ur=["scene-style","data-paint","accessibility","evidence"],Jr=["scene-geometry","data-paint","overlay","accessibility","evidence"],en=[],tn={chartType:Gr("rebuild",Qr),nodeIDAccessor:Gr("rebuild",Qr),sourceAccessor:Gr("rebuild",Qr),targetAccessor:Gr("rebuild",Qr),valueAccessor:Gr("rebuild",Qr),edgeIdAccessor:Gr("rebuild",Qr),childrenAccessor:Gr("rebuild",Qr),hierarchySum:Gr("rebuild",Qr),orientation:Gr("preserve",Kr),nodeAlign:Gr("preserve",Kr),nodePaddingRatio:Gr("preserve",Kr),nodeWidth:Gr("preserve",Kr),edgeSort:Gr("preserve",Kr),iterations:Gr("preserve",Kr),forceStrength:Gr("preserve",Kr),padAngle:Gr("preserve",Kr),groupWidth:Gr("preserve",Kr),sortGroups:Gr("preserve",Kr),treeOrientation:Gr("preserve",Kr),edgeType:Gr("preserve",Kr),padding:Gr("preserve",Kr),paddingTop:Gr("preserve",Kr),orbitMode:Gr("preserve",Kr),orbitSize:Gr("preserve",Kr),orbitSpeed:Gr("preserve",Kr),orbitRevolution:Gr("preserve",Kr),orbitRevolutionStyle:Gr("preserve",Kr),orbitEccentricity:Gr("preserve",Kr),orbitShowRings:Gr("preserve",Kr),orbitAnimated:Gr("preserve",Kr),customNetworkLayout:Gr("preserve",Kr),layoutConfig:Gr("preserve",Kr),nodeSize:Gr("preserve",Zr),nodeSizeRange:Gr("preserve",Zr),colorByDepth:Gr("preserve",Zr),nodeLabel:Gr("preserve",Jr),showLabels:Gr("preserve",Jr),labelMode:Gr("preserve",Jr),nodeStyle:Gr("preserve",Ur),edgeStyle:Gr("preserve",Ur),colorBy:Gr("preserve",Ur),colorScheme:Gr("preserve",Ur),themeCategorical:Gr("preserve",Ur),themeSemantic:Gr("preserve",Ur),edgeColorBy:Gr("preserve",Ur),edgeOpacity:Gr("preserve",Ur),showParticles:Gr("preserve",Ur),particleStyle:Gr("preserve",Ur),decay:Gr("preserve",Ur),pulse:Gr("preserve",Ur),thresholds:Gr("preserve",Ur),staleness:Gr("preserve",Ur),layoutSelection:Gr("preserve",Ur),clock:Gr("preserve",en),random:Gr("preserve",en),seed:Gr("preserve",en),tensionConfig:Gr("preserve",en),transition:Gr("preserve",en),introAnimation:Gr("preserve",en),onLayoutError:Gr("preserve",en),__skipForceSimulation:Gr("preserve",en),__hierarchyRoot:Gr("preserve",en),__orbitState:Gr("preserve",en),__previousPositions:Gr("preserve",en)},rn=Gr("preserve",Kr),nn=class{constructor(){this.tracker=new q}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},qr)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Vr):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const r=new Set;for(const n of e){const e=tn[n]??rn;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)r.add(t)}return{retainedData:t,invalidations:r}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}},on=class e{constructor(e){this.nodes=new Map,this.edges=new Map,this.tension=0,this.layoutVersion=0,this.sceneNodes=[],this.sceneEdges=[],this.labels=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this.customLayoutHtmlMarks=[],this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._nodeQuadtree=null,this._maxNodeRadius=0,this._sceneNodesRevision=0,this._nodeQuadtreeRevision=-1,this._nodesArrCache=null,this._edgesArrCache=null,this._arrCacheVersion=-1,this.particlePool=null,this.updateResults=new nn,this.transition=null,this._hasRenderedOnce=!1,this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,this.lastIngestTime=0,this.nodeTimestamps=new Map,this.edgeTimestamps=new Map,this._decaySortedNodes=null,this._decayAgeMap=null,this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set,this.lastTopologyChangeTime=0,this.previousNodeIds=new Set,this.previousEdgeKeys=new Set,this._networkDecayCache=null,this._lastPositionSnapshot=null,this.config=e,this.tensionConfig={...He,...e.tensionConfig},e.showParticles&&("sankey"===e.chartType||e.customNetworkLayout)&&(this.particlePool=new Ve(2e3))}currentTime(){return this.config.clock?.()??fe()}updateConfig(e){const t=this.config,r={...t,...e};t.__orbitState&&(r.__orbitState=t.__orbitState),t.__hierarchyRoot&&(r.__hierarchyRoot=t.__hierarchyRoot),void 0===e.layoutSelection&&null!=t.layoutSelection&&(r.layoutSelection=t.layoutSelection);const n=[...new Set([...Object.keys(t),...Object.keys(r)])].filter(e=>t[e]!==r[e]);this.config=r,this.tensionConfig={...He,...r.tensionConfig},!r.showParticles||"sankey"!==r.chartType&&!r.customNetworkLayout||this.particlePool||(this.particlePool=new Ve(2e3)),this.updateResults.recordConfig(n)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}ingestHierarchy(e,t){this._boundedPrevSnapshot=new Map;for(const[e,t]of this.nodes)0===t.x0&&0===t.x1&&0===t.y0&&0===t.y1||this._boundedPrevSnapshot.set(e,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});this.nodes.clear(),this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this.config.__hierarchyRoot=e,this.runLayout(t),this._boundedPrevSnapshot=null,this.updateResults.recordData("replace",1)}ingestBounded(e,t,r,n){const{nodeIDAccessor:o="id",sourceAccessor:i="source",targetAccessor:a="target",valueAccessor:s="value"}=this.config,c="function"==typeof o?o:e=>e[o],l="function"==typeof i?i:e=>e[i],u="function"==typeof a?a:e=>e[a],d="function"==typeof s?s:e=>e[s]??1;this._boundedPrevSnapshot=new Map;for(const[e,t]of this.nodes)0===t.x0&&0===t.x1&&0===t.y0&&0===t.y1||this._boundedPrevSnapshot.set(e,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});this._boundedEdgeSnapshot=new Map;for(const[,e]of this.edges)e.sankeyWidth>0&&this._boundedEdgeSnapshot.set(`${"string"==typeof e.source?e.source:e.source.id}\0${"string"==typeof e.target?e.target:e.target.id}`,{y0:e.y0,y1:e.y1,sankeyWidth:e.sankeyWidth});this.nodes.clear(),this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null;for(const t of e){const e=c(t)+"";this.nodes.set(e,{...Br(e),data:t})}for(let e=0;t.length>e;e++){const r=t[e],n=l(r)+"",o=u(r)+"",i=d(r),a=null==i?NaN:Number(i),s=Number.isFinite(a)?a:1;this.nodes.has(n)||this.nodes.set(n,{...Br(n),data:r}),this.nodes.has(o)||this.nodes.set(o,{...Br(o),data:r});const c=`${n}\0${o}\0${e}`,h={source:n,target:o,value:s,y0:0,y1:0,sankeyWidth:0,data:r,_edgeKey:c};r&&"object"==typeof r&&Yr(r.bezier)&&(h.bezier=r.bezier),this.edges.set(c,h)}n?.deferLayout||this.runLayout(r),this.updateResults.recordData("replace",e.length+t.length)}ingestBoundedWithResult(e,t,r,n){return this.ingestBounded(e,t,r,n),this.updateResults.last}applyForceLayoutPositions(e,t){for(const[t,r]of Object.entries(e)){const e=this.nodes.get(t);e&&(e.x=r.x,e.y=r.y)}this.config.__skipForceSimulation=!0;try{this.runLayout(t)}finally{this.config.__skipForceSimulation=void 0}}edgeKey(e,t){return`${e}\0${t}`}ingestEdge(e){const{source:t,target:r,value:n}=e,o=0===this.nodes.size;let i=!1;const a=this.currentTime();this.lastIngestTime=a,this._decaySortedNodes=null,this._networkDecayCache=null,this.nodes.has(t)||(this.nodes.set(t,Br(t)),this.nodeTimestamps.set(t,a),this.tension+=this.tensionConfig.newNode,i=!0),this.nodes.has(r)||(this.nodes.set(r,Br(r)),this.nodeTimestamps.set(r,a),this.tension+=this.tensionConfig.newNode,i=!0);const s=this.edgeKey(t,r),c=this.edges.get(s);let l=!1;c?(c.value+=n,this.edgeTimestamps.set(s,a),this.tension+=this.tensionConfig.weightChange,l=!0):(this.edges.set(s,{source:t,target:r,value:n,y0:0,y1:0,sankeyWidth:0}),this.edgeTimestamps.set(s,a),this.tension+=this.tensionConfig.newEdge,i=!0);const u=o||i||l||this.tension>=this.tensionConfig.threshold;return this.updateResults.recordData("ingest",1),u}ingestEdgeWithResult(e){return this.ingestEdge(e),this.updateResults.last}runLayout(e){if(this.config.customNetworkLayout)return this.recordTopologyDiff(),void this.layoutVersion++;const t=zr(this.config.chartType);if(!t)return;let r=Array.from(this.nodes.values());const n=Array.from(this.edges.values());if(0===r.length&&!t.hierarchical)return;if(this.prepareForRelayout(),t.supportsStreaming&&!t.hierarchical){const e=new Map;for(const t of r)void 0!==t._prevX0?e.set(t.id,{x:(t._prevX0??0)+((t._prevX1??0)-(t._prevX0??0))/2,y:(t._prevY0??0)+((t._prevY1??0)-(t._prevY0??0))/2}):0===t.x&&0===t.y||e.set(t.id,{x:t.x,y:t.y});if(this._lastPositionSnapshot)for(const[t,r]of this._lastPositionSnapshot)e.has(t)||e.set(t,r);this.config.__previousPositions=e.size>0?e:void 0}if(t.computeLayout(r,n,this.config,e),this.config.__previousPositions=void 0,t.hierarchical&&r.length>0){this.nodes.clear(),this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null;for(const e of r)this.nodes.set(e.id,e);for(let e=0;n.length>e;e++){const t=n[e],r=t._edgeKey||`${"string"==typeof t.source?t.source:t.source.id}\0${"string"==typeof t.target?t.target:t.target.id}\0${e}`;t._edgeKey=r,this.edges.set(r,t)}const e=this._boundedPrevSnapshot;if(e&&e.size>0)for(const t of this.nodes.values()){const r=e.get(t.id);r&&(t._prevX0=r.x0,t._prevX1=r.x1,t._prevY0=r.y0,t._prevY1=r.y1)}this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,r=Array.from(this.nodes.values())}this.finalizeLayout();const o=new Map;for(const e of this.nodes.values())0===e.x&&0===e.y||o.set(e.id,{x:e.x,y:e.y});this._lastPositionSnapshot=o,this.saveTargetPositions();const i=r.some(e=>void 0!==e._prevX0&&(0!==e._prevX0||0!==e._prevX1||0!==e._prevY0||0!==e._prevY1)),a=this.config.transition?.duration??this.tensionConfig.transitionDuration,s=["sankey","tree","treemap","circlepack","partition"].includes(this.config.chartType);if(!this._hasRenderedOnce&&this.config.introAnimation&&s&&r.length>0&&a>0){const t=e[0]/2,r=e[1]/2;for(const e of this.nodes.values())e._prevX0=t,e._prevX1=t,e._prevY0=r,e._prevY1=r;for(const e of this.edges.values())e._prevY0=r,e._prevY1=r,e._prevSankeyWidth=0,e._introFromZero=!0;this.restorePreviousPositions(),this.transition={startTime:this.currentTime(),duration:a}}else i&&a>0&&(this.restorePreviousPositions(),this.transition={startTime:this.currentTime(),duration:a});this._hasRenderedOnce=!0,this.recordTopologyDiff(),this.layoutVersion++}recordTopologyDiff(){const e=new Set(this.nodes.keys()),t=new Set(this.edges.keys());this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set;for(const t of e)this.previousNodeIds.has(t)||this.addedNodes.add(t);for(const t of this.previousNodeIds)e.has(t)||this.removedNodes.add(t);for(const e of t)this.previousEdgeKeys.has(e)||this.addedEdges.add(e);for(const e of this.previousEdgeKeys)t.has(e)||this.removedEdges.add(e);(this.addedNodes.size>0||this.removedNodes.size>0||this.addedEdges.size>0||this.removedEdges.size>0)&&(this.lastTopologyChangeTime=this.currentTime()),this.previousNodeIds=e,this.previousEdgeKeys=t}restyleScene(e){const t=function({nodes:e,edges:t,restyle:r,restyleEdge:n,baseStyles:o,selection:i}){const a=!(!r&&!n);if(r)for(const t of e){const e=o.get(t)??t.style,n=r(t,i);t.style=n?{...e,...n}:e}if(n)for(const e of t){const t=o.get(e)??e.style,r=n(e,i);e.style=r?{...t,...r}:t}return a}({nodes:this.sceneNodes,edges:this.sceneEdges,restyle:this._customRestyle,restyleEdge:this._customRestyleEdge,baseStyles:this._baseStyles,selection:e});this.markStylePaintPending(),this.updateResults.recordRestyle(t)}buildScene(e){if(this.config.customNetworkLayout){const t=function({config:e,customLayout:t,size:r,nodes:n,edges:o,previousResult:i,revision:a}){const s=C(e.colorScheme,e.themeCategorical,Se),l={nodes:n,edges:o,dimensions:{width:r[0],height:r[1],plot:{x:0,y:0,width:r[0],height:r[1]}},theme:{semantic:e.themeSemantic??{},categorical:[...s]},resolveColor:T(s,e.colorScheme),config:e.layoutConfig??{},selection:e.layoutSelection??null};try{return{kind:"success",result:t(l)}}catch(t){const r=null!==i,n=c("network",t,r,a);"production"!==process.env.NODE_ENV&&console.error("[semiotic] customNetworkLayout threw:",t);try{e.onLayoutError?.(n)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:n,preservedLastGoodScene:r}}}({config:this.config,customLayout:this.config.customNetworkLayout,size:e,nodes:Array.from(this.nodes.values()),edges:Array.from(this.edges.values()),previousResult:this.lastCustomLayoutResult,revision:this.layoutVersion});if("failure"===t.kind)return this.lastCustomLayoutFailure=t.diagnostic,void(t.preservedLastGoodScene||(this.sceneNodes=[],this.sceneEdges=[],this.labels=[],this.customLayoutOverlays=null,this.customLayoutHtmlMarks=[],this.lastCustomLayoutResult=null,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._sceneNodesRevision++));const r=t.result;return this.sceneNodes=r.sceneNodes??[],this.sceneEdges=r.sceneEdges??[],this.labels=r.labels??[],this.customLayoutOverlays=r.overlays??null,this.customLayoutHtmlMarks=r.htmlMarks??[],this.lastCustomLayoutResult=r,this.lastCustomLayoutFailure=null,this._sceneNodesRevision++,this._customRestyle=r.restyle,this._customRestyleEdge=r.restyleEdge,this.hasCustomRestyle=!(!r.restyle&&!r.restyleEdge),this.hasCustomRestyle&&(this._baseStyles=function(e,t){const r=new WeakMap;for(const t of e)r.set(t,t.style);for(const e of t)r.set(e,e.style);return r}(this.sceneNodes,this.sceneEdges),this.restyleScene(this.config.layoutSelection??null)),void L({label:"customNetworkLayout",nodes:this.sceneNodes,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned})}this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.customLayoutOverlays=null,this.customLayoutHtmlMarks=[],this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null;const t=zr(this.config.chartType);if(!t)return void this._sceneNodesRevision++;const r=t.hierarchical?Array.from(this.nodes.values()):this.nodesArray,n=t.hierarchical?Array.from(this.edges.values()):this.edgesArray,{sceneNodes:o,sceneEdges:i,labels:a}=t.buildScene(r,n,this.config,e);this.sceneNodes=o,this.sceneEdges=i,this.labels=a,this._sceneNodesRevision++}rebuildNodeQuadtree(){let t=0,r=0;for(const e of this.sceneNodes)"circle"===e.type&&(t++,e.r>r&&(r=e.r));if(this._maxNodeRadius=r,e.QUADTREE_THRESHOLD>=t)return void(this._nodeQuadtree=null);const n=Array(t);let o=0;for(const e of this.sceneNodes)"circle"===e.type&&(n[o++]=e);this._nodeQuadtree=Fr().x(e=>e.cx).y(e=>e.cy).addAll(n)}get nodeQuadtree(){return this._nodeQuadtreeRevision!==this._sceneNodesRevision&&(this.rebuildNodeQuadtree(),this._nodeQuadtreeRevision=this._sceneNodesRevision),this._nodeQuadtree}get maxNodeRadius(){return this._maxNodeRadius}_ensureArrays(){this._arrCacheVersion===this.layoutVersion&&this._nodesArrCache&&this._edgesArrCache||(this._nodesArrCache=Array.from(this.nodes.values()),this._edgesArrCache=Array.from(this.edges.values()),this._arrCacheVersion=this.layoutVersion)}get nodesArray(){return this._ensureArrays(),this._nodesArrCache}get edgesArray(){return this._ensureArrays(),this._edgesArrCache}get isAnimating(){const e=zr(this.config.chartType);return!!e?.supportsAnimation&&!1!==this.config.orbitAnimated}tickAnimation(e,t){const r=zr(this.config.chartType);if(!r?.tick)return!1;const n=r.hierarchical?Array.from(this.nodes.values()):this.nodesArray,o=r.hierarchical?Array.from(this.edges.values()):this.edgesArray;return r.tick(n,o,this.config,e,t)}cancelIntroAnimation(){this.transition=null;for(const e of this.nodes.values())e._prevX0=void 0,e._prevX1=void 0,e._prevY0=void 0,e._prevY1=void 0;for(const e of this.edges.values())e._prevY0=void 0,e._prevY1=void 0,e._prevSankeyWidth=void 0,e._introFromZero=!1}advanceTransition(e){if(!this.transition)return!1;const t=U(e,this.transition),r=K(t);for(const e of this.nodes.values())void 0===e._targetX0||void 0===e._prevX0||0===e._prevX0&&0===e._prevX1||(e.x0=le(e._prevX0,e._targetX0,r),e.x1=le(e._prevX1,e._targetX1,r),e.y0=le(e._prevY0,e._targetY0,r),e.y1=le(e._prevY1,e._targetY1,r));for(const e of this.edges.values())void 0!==e._targetY0&&void 0!==e._prevY0&&void 0!==e._prevSankeyWidth&&(e._prevSankeyWidth>0||e._introFromZero)&&(e.y0=le(e._prevY0,e._targetY0,r),e.y1=le(e._prevY1,e._targetY1,r),e.sankeyWidth=le(e._prevSankeyWidth,e._targetSankeyWidth,r));return this.rebuildAllBeziers(),1>t||(this.snapToTargets(),this.transition=null,!1)}prepareForRelayout(){const e=this._boundedPrevSnapshot;for(const t of this.nodes.values()){const r=e?.get(t.id);r&&0===t.x0&&0===t.x1&&0===t.y0&&0===t.y1?(t._prevX0=r.x0,t._prevX1=r.x1,t._prevY0=r.y0,t._prevY1=r.y1):(t._prevX0=t.x0,t._prevX1=t.x1,t._prevY0=t.y0,t._prevY1=t.y1)}const t=this._boundedEdgeSnapshot;for(const e of this.edges.values()){if(t&&0===e.sankeyWidth){const r=t.get(`${"string"==typeof e.source?e.source:e.source.id}\0${"string"==typeof e.target?e.target:e.target.id}`);if(r){e._prevY0=r.y0,e._prevY1=r.y1,e._prevSankeyWidth=r.sankeyWidth;continue}}e._prevY0=e.y0,e._prevY1=e.y1,e._prevSankeyWidth=e.sankeyWidth}this.nodes.size>0&&(this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null)}finalizeLayout(){const e="vertical"===this.config.orientation?"down":"right";for(const e of this.nodes.values())if(0!==e.x0||0!==e.x1||0!==e.y0||0!==e.y1)e.width=e.x1-e.x0,e.height=e.y1-e.y0,e.x=e.x0+e.width/2,e.y=e.y0+e.height/2;else{const t=5;e.x0=e.x-t,e.x1=e.x+t,e.y0=e.y-t,e.y1=e.y+t,e.width=2*t,e.height=2*t}for(const t of this.edges.values())t.direction=e,this.updateEdgeBezier(t);this.tension=0}saveTargetPositions(){for(const e of this.nodes.values())e._targetX0=e.x0,e._targetX1=e.x1,e._targetY0=e.y0,e._targetY1=e.y1;for(const e of this.edges.values())e._targetY0=e.y0,e._targetY1=e.y1,e._targetSankeyWidth=e.sankeyWidth}restorePreviousPositions(){for(const e of this.nodes.values())void 0===e._prevX0||0===e._prevX0&&0===e._prevX1||(e.x0=e._prevX0,e.x1=e._prevX1,e.y0=e._prevY0,e.y1=e._prevY1);for(const e of this.edges.values())void 0!==e._prevY0&&void 0!==e._prevSankeyWidth&&e._prevSankeyWidth>0&&(e.y0=e._prevY0,e.y1=e._prevY1,e.sankeyWidth=e._prevSankeyWidth);this.rebuildAllBeziers()}snapToTargets(){for(const e of this.nodes.values())void 0!==e._targetX0&&(e.x0=e._targetX0,e.x1=e._targetX1,e.y0=e._targetY0,e.y1=e._targetY1);for(const e of this.edges.values())void 0!==e._targetY0&&(e.y0=e._targetY0,e.y1=e._targetY1,e.sankeyWidth=e._targetSankeyWidth),e._introFromZero=void 0;this.rebuildAllBeziers()}updateEdgeBezier(e){!function(e,t,r=.5){const n="string"==typeof e.source?t.get(e.source):e.source,o="string"==typeof e.target?t.get(e.target):e.target;!n||!o||(e.bezier=e.circular&&e.circularPathData?function(e){const t=(e._circularWidth||e.sankeyWidth||1)/2,r=e.circularPathData;if(!r)throw Error("buildCircularBezier requires circularPathData");if(e._circularStub){const e=Math.max(15,Math.min(40,.33*(r.rightFullExtent-r.sourceX))),n=Math.max(15,Math.min(40,.33*(r.targetX-r.leftFullExtent)));return{circular:!0,segments:[[{x:r.sourceX,y:r.sourceY},{x:r.sourceX+.33*e,y:r.sourceY},{x:r.sourceX+.66*e,y:r.sourceY},{x:r.sourceX+e,y:r.sourceY}],[{x:r.targetX-n,y:r.targetY},{x:r.targetX-.66*n,y:r.targetY},{x:r.targetX-.33*n,y:r.targetY},{x:r.targetX,y:r.targetY}]],halfWidth:t}}let n;n="down"===e.direction?[{x:r.sourceY,y:r.sourceX},{x:r.sourceY,y:r.rightFullExtent},{x:r.verticalFullExtent,y:r.rightFullExtent},{x:r.verticalFullExtent,y:r.leftFullExtent},{x:r.targetY,y:r.leftFullExtent},{x:r.targetY,y:r.targetX}]:[{x:r.sourceX,y:r.sourceY},{x:r.rightFullExtent,y:r.sourceY},{x:r.rightFullExtent,y:r.verticalFullExtent},{x:r.leftFullExtent,y:r.verticalFullExtent},{x:r.leftFullExtent,y:r.targetY},{x:r.targetX,y:r.targetY}];const o=[];for(let e=0;n.length-1>e;e++){const t=n[e],r=n[e+1],i=r.x-t.x,a=r.y-t.y;o.push([t,{x:t.x+i/3,y:t.y+a/3},{x:t.x+2*i/3,y:t.y+2*a/3},r])}return{circular:!0,segments:o,halfWidth:t}}(e):function(e,t,r,n=.5){const o=(e.sankeyWidth||1)/2;if("down"===e.direction){const i=t.x1,a=r.x0,s=Xr(i,a);return{circular:!1,points:[{x:e.y0,y:i},{x:e.y0,y:s(n)},{x:e.y1,y:s(1-n)},{x:e.y1,y:a}],halfWidth:o}}const i=t.x1,a=r.x0,s=Xr(i,a);return{circular:!1,points:[{x:i,y:e.y0},{x:s(n),y:e.y0},{x:s(1-n),y:e.y1},{x:a,y:e.y1}],halfWidth:o}}(e,n,o,r))}(e,this.nodes,.5)}rebuildAllBeziers(){for(const e of this.nodes.values())e.width=e.x1-e.x0,e.height=e.y1-e.y0,e.x=e.x0+e.width/2,e.y=e.y0+e.height/2;for(const e of this.edges.values())this.updateEdgeBezier(e)}applyPulse(e){!function(e){const t=e.pulse;if(!t)return;const r=t.duration??500,n=t.color??"rgba(255,255,255,0.6)",o=t.glowRadius??4,{now:i}=e;for(const t of e.sceneNodes){const a=t.id;if(!a)continue;const s=e.nodeTimestamps.get(a);if(!s)continue;const c=i-s;r>c&&(t._pulseIntensity=1-c/r,t._pulseColor=n,t._pulseGlowRadius=o)}for(const t of e.sceneEdges){const o=t.datum;if(!o)continue;const a="object"==typeof o.source?o.source?.id:o.source,s="object"==typeof o.target?o.target?.id:o.target;if(!a||!s)continue;const c=e.edgeTimestamps.get(`${a}\0${s}`);if(!c)continue;const l=i-c;r>l&&(t._pulseIntensity=1-l/r,t._pulseColor=n)}}({sceneNodes:this.sceneNodes,sceneEdges:this.sceneEdges,nodeTimestamps:this.nodeTimestamps,edgeTimestamps:this.edgeTimestamps,pulse:this.config.pulse,now:e})}applyDecay(){this._networkDecayCache||(this._networkDecayCache={sortedNodes:null,ageMap:null}),this._decaySortedNodes||(this._networkDecayCache.sortedNodes=null,this._networkDecayCache.ageMap=null),function(e){const t=e.decay;if(!t)return;const r=e.nodeTimestamps.size;if(1>=r)return;if(!e.cache.sortedNodes){e.cache.sortedNodes=Array.from(e.nodeTimestamps.entries()).sort((e,t)=>e[1]-t[1]);const t=new Map;for(let r=0;e.cache.sortedNodes.length>r;r++)t.set(e.cache.sortedNodes[r][0],r);e.cache.ageMap=t}const n=e.cache.ageMap;for(const o of e.sceneNodes){const e=o.id;if(!e)continue;const i=n.get(e);if(void 0===i)continue;const a=s(t,i,r);o.style={...o.style,opacity:(o.style?.opacity??1)*a}}}({sceneNodes:this.sceneNodes,nodeTimestamps:this.nodeTimestamps,decay:this.config.decay,cache:this._networkDecayCache}),this._decaySortedNodes=this._networkDecayCache.sortedNodes,this._decayAgeMap=this._networkDecayCache.ageMap}applyTopologyDiff(e){!function(e){for(const t of e.sceneNodes)t._pulseColor===jr&&(t._pulseIntensity=0,t._pulseColor=void 0,t._pulseGlowRadius=void 0);if(0===e.addedNodes.size)return;const t=e.now-e.lastTopologyChangeTime;if(t>=Hr)return;const r=1-t/Hr;for(const t of e.sceneNodes){const n=t.id;n&&e.addedNodes.has(n)&&(t._pulseIntensity=Math.max(t._pulseIntensity??0,r),t._pulseColor=jr,t._pulseGlowRadius=8)}}({sceneNodes:this.sceneNodes,addedNodes:this.addedNodes,lastTopologyChangeTime:this.lastTopologyChangeTime,now:e})}get hasActiveTopologyDiff(){return function(e,t,r=("undefined"!=typeof performance?performance.now():Date.now())){return 0!==e.size&&Hr>r-t}(this.addedNodes,this.lastTopologyChangeTime)}applyThresholds(e){!function(e){const t=e.thresholds;if(!t)return;const r=t.warningColor??"#f59e0b",n=t.criticalColor??"#ef4444",o=!1!==t.pulse;for(const i of e.sceneNodes){const a=i.id;if(!a)continue;const s=e.nodes.get(a);if(!s)continue;const c=t.metric(s);let l=null;void 0===t.critical||t.critical>c?void 0===t.warning||t.warning>c||(l=r):l=n,l&&(i.style={...i.style,fill:l},o&&(i._pulseIntensity=.6+.4*Math.sin(e.now/300),i._pulseColor=l,i._pulseGlowRadius=6))}}({sceneNodes:this.sceneNodes,nodes:this.nodes,thresholds:this.config.thresholds,now:e})}get hasActiveThresholds(){return function(e,t){if(!t)return!1;for(const r of e){const e=t.metric(r);if(void 0!==t.warning&&e>=t.warning||void 0!==t.critical&&e>=t.critical)return!0}return!1}(this.nodes.values(),this.config.thresholds)}get hasActivePulses(){return function(e){const t=e.pulse;if(!t||0===e.lastIngestTime)return!1;const r=e.now??("undefined"!=typeof performance?performance.now():Date.now());return(t.duration??500)>r-e.lastIngestTime}({pulse:this.config.pulse,lastIngestTime:this.lastIngestTime})}getLayoutData(){return{nodes:Array.from(this.nodes.values()),edges:Array.from(this.edges.values())}}updateNode(e,t){const r=this.nodes.get(e);if(!r)return this.updateResults.recordNoop("update"),null;const n=r.data?{...r.data}:{};return r.data=t(r.data??{}),this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",1),n}updateEdge(e,t,r){const n=this.config.valueAccessor,o="function"==typeof n?n:n?e=>e[n]:e=>e.value,i=[];for(const[,n]of this.edges)if(("string"==typeof n.source?n.source:n.source.id)===e&&("string"==typeof n.target?n.target:n.target.id)===t){i.push(n.data?{...n.data}:{}),n.data=r(n.data??{});const e=o(n.data);null!=e&&(n.value=Number(e))}return i.length>0?(this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",i.length)):this.updateResults.recordNoop("update"),i}removeNode(e){if(!this.nodes.has(e))return this.updateResults.recordNoop("remove"),!1;this.nodes.delete(e),this.nodeTimestamps.delete(e);for(const[t,r]of this.edges)("string"==typeof r.source?r.source:r.source.id)!==e&&("string"==typeof r.target?r.target:r.target.id)!==e||(this.edges.delete(t),this.edgeTimestamps.delete(t));return this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",1),!0}removeEdge(e,t){const r=[];if(void 0===t){const t=this.config.edgeIdAccessor;if(!t)throw Error("removeEdge(edgeId) requires edgeIdAccessor to be configured. Use removeEdge(sourceId, targetId) instead.");const n="function"==typeof t?t:e=>e?.[t];for(const[t,o]of this.edges)o.data&&n(o.data)===e&&r.push(t)}else for(const[n,o]of this.edges)("string"==typeof o.source?o.source:o.source.id)===e&&("string"==typeof o.target?o.target:o.target.id)===t&&r.push(n);for(const e of r)this.edges.delete(e),this.edgeTimestamps.delete(e);return r.length>0?(this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length)):this.updateResults.recordNoop("remove"),r.length>0}clear(){this.nodes.clear(),this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this._decayAgeMap=null,this._nodeQuadtree=null,this._nodesArrCache=null,this._edgesArrCache=null,this._sceneNodesRevision++,this.tension=0,this.layoutVersion++,this.sceneNodes=[],this.sceneEdges=[],this.labels=[],this.customLayoutOverlays=null,this.customLayoutHtmlMarks=[],this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.transition=null,this._hasRenderedOnce=!1,this.lastIngestTime=0,this._lastPositionSnapshot=null,this.nodeTimestamps.clear(),this.edgeTimestamps.clear(),this.previousNodeIds=new Set,this.previousEdgeKeys=new Set,this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set,this.lastTopologyChangeTime=0,this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,this.particlePool&&this.particlePool.clear(),this.updateResults.recordData("clear")}};on.QUADTREE_THRESHOLD=500;var an=on;o(an);import*as sn from"react";import{Fragment as cn,jsx as ln,jsxs as un}from"react/jsx-runtime";function dn(e){const{width:t,height:r,totalWidth:n,totalHeight:o,margin:i,labels:a,title:s,legend:c,legendHoverBehavior:l,legendClickBehavior:u,legendHighlightedCategory:d,legendIsolatedCategories:h,legendPosition:f="right",legendLayout:y,foregroundGraphics:g,sceneNodes:p,annotations:m,onAnnotationActivate:v,onObservation:x,chartId:k,chartType:b,autoPlaceAnnotations:_,svgAnnotationRules:S}=e,w=Le({onAnnotationActivate:v,onObservation:x,chartId:k,chartType:b}),A=sn.useMemo(()=>{const e=(p||[]).flatMap(e=>{const t=function(e){if("glyph"===e.type&&e.glyph&&"number"==typeof e.size){const t=e.cx??e.x,r=e.cy??e.y;if("number"!=typeof t||"number"!=typeof r)return null;const n=Ne(e.glyph,e.size);return{x:t+n.centerDx,y:r+n.centerDy,r:Math.max(1,n.radius)}}const t=e.cx??(null!=e.x&&null!=e.w?e.x+e.w/2:e.x),r=e.cy??(null!=e.y&&null!=e.h?e.y+e.h/2:e.y);return"number"!=typeof t||"number"!=typeof r?null:{x:t,y:r,r:"number"==typeof e.r?Math.max(1,e.r):"number"==typeof e.outerR?Math.max(1,e.outerR):"number"==typeof e.size?Math.max(1,Ae(e.size)):Math.max(1,e.w??0,e.h??0)/2}}(e),r=function(e){const t=e.id??e.datum?.id??e.datum?.data?.id??e.datum?.data?.name;return null==t?void 0:t+""}(e);return t?[{pointId:r,...t}]:[]});return{scales:null,width:t,height:r,frameType:"network",pointNodes:e,sceneNodes:p}},[r,p,t]),L=sn.useMemo(()=>{if(!m)return m;const e=M(m);return _?G({annotations:e,context:A,..."object"==typeof _?_:{}}):e},[m,_,A]),E=sn.useMemo(()=>J("network"),[]),P=L?ve(L.filter(e=>"widget"!==e.type),E,S,A):null,D=!0===L?.some(e=>"widget"===e.type&&!0===e._annotationDeferred);return un(cn,{children:[D&&ln("style",{children:I},"annotation-widget-disclosure-style"),un("svg",{role:"img",width:n,height:o,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[ln("title",{children:"string"==typeof s?s:"Network Chart"}),ln("desc",{children:"string"==typeof s?s+" (network data visualization)":"Network data visualization"}),un("g",{transform:`translate(${i.left},${i.top})`,children:[a.map((e,t)=>ln("text",{x:e.x,y:e.y,textAnchor:e.anchor||"start",dominantBaseline:e.baseline||"middle",fontSize:e.fontSize||11,fontWeight:e.fontWeight,fill:e.fill||"var(--semiotic-text, #333)",stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:e.paintOrder,style:{pointerEvents:"none"},children:e.text},"label-"+t)),P,g]}),s&&"string"==typeof s?ln("text",{x:n/2,y:H,textAnchor:"middle",fontWeight:600,fill:"currentColor",fontSize:14,className:"semiotic-chart-title",style:{fontSize:"var(--semiotic-title-font-size, 14px)"},children:s}):s?ln("foreignObject",{x:0,y:0,width:n,height:i.top,children:s}):null,xe({legend:c,totalWidth:n,totalHeight:o,margin:i,legendPosition:f,title:s,legendLayout:y,legendHoverBehavior:l,legendClickBehavior:u,legendHighlightedCategory:d,legendIsolatedCategories:h})]}),L?.filter(e=>"widget"===e.type&&e.nodeId&&p).map((e,t)=>{const r=!0===e._annotationDeferred,n=p.find(t=>t.id===e.nodeId||t.datum?.id===e.nodeId||t.datum?.data?.id===e.nodeId||t.datum?.data?.name===e.nodeId);if(!n)return null;const o=i.left+(n.cx??(null!=n.x&&null!=n.w?n.x+n.w/2:n.x??0)),a=i.top+(n.cy??(null!=n.y&&null!=n.h?n.y+n.h/2:n.y??0)),s=e.dx??0,c=e.dy??-16,l=e.width??32,u=e.height??32,d=e.content??ln("span",{style:{fontSize:18,cursor:"default"},children:"ℹ️"});return ln("div",{...V(e,w),className:r?"annotation-deferred":void 0,"data-annotation-disclosure":r?"deferred":void 0,style:{position:"absolute",left:o+s-l/2,top:a+c-u/2,width:l,height:u,display:"flex",alignItems:"center",justifyContent:"center",zIndex:5},children:d},"widget-"+t)})]})}dn.displayName="NetworkSVGOverlay";import*as hn from"react";import{jsx as fn}from"react/jsx-runtime";var yn={position:"absolute",top:0,left:0,pointerEvents:"none"};function gn({marks:e,margin:t,selection:r=null,overscan:n=400}){const o=hn.useRef(null),i=function(e,t,r){const[n,o]=hn.useState(null);return hn.useLayoutEffect(()=>{const e=t.current,r=function(e){let t=e?.parentElement??null;for(;t;){const{overflow:e,overflowX:r,overflowY:n}=window.getComputedStyle(t);if(/(auto|scroll|overlay)/.test(`${e} ${n} ${r}`))return t;t=t.parentElement}return null}(e);if(!e||!r)return void o(null);let n=0;const i=()=>{n=0;const t=r.getBoundingClientRect(),i=e.getBoundingClientRect();o(0!==t.width&&0!==t.height?{scroll:{left:t.left,top:t.top,right:t.right,bottom:t.bottom},originX:i.left,originY:i.top}:null)},a=()=>{0===n&&(n=window.requestAnimationFrame(i))};i(),r.addEventListener("scroll",a,{passive:!0});const s=new ResizeObserver(a);return s.observe(r),()=>{0!==n&&window.cancelAnimationFrame(n),r.removeEventListener("scroll",a),s.disconnect()}},[t,e,r]),hn.useMemo(()=>{if(!e||!n)return e;const{scroll:t,originX:o,originY:i}=n,a=t.left-r,s=t.right+r,c=t.top-r,l=t.bottom+r;return e.filter(e=>{const t=o+e.x,r=i+e.y;return!(a>t+e.width||t>s||c>r+e.height||r>l)})},[e,n,r])}(e,o,n);if(!e||0===e.length)return null;const a=fn("div",{className:"semiotic-network-html-marks",ref:o,style:{...yn,transform:`translate(${t.left}px, ${t.top}px)`},children:(i??e).map(e=>fn("div",{className:"semiotic-network-html-mark","data-mark-id":e.id,style:{position:"absolute",transform:`translate(${e.x}px, ${e.y}px)`,width:e.width,height:e.height,pointerEvents:"none"},children:e.content},e.id))});return null!=r?fn(E,{value:r,children:a}):a}import{jsx as pn,jsxs as mn}from"react/jsx-runtime";function vn({props:e,store:t,responsiveRef:r,size:n,margin:o,adjustedWidth:i,adjustedHeight:s,resolvedBackground:c,resolvedForeground:l}){const{chartType:u,nodes:d,edges:h,data:f,className:y,description:g,title:p,responsiveWidth:m,responsiveHeight:v,summary:x,background:b,renderMode:_,legend:S,legendPosition:w,legendLayout:A,legendHoverBehavior:L,legendClickBehavior:E,legendHighlightedCategory:D,legendIsolatedCategories:R,layoutSelection:M,annotations:N,onAnnotationActivate:T,annotationObservationCallback:C,onObservation:I,chartId:W,autoPlaceAnnotations:$,svgAnnotationRules:z}=e;if(t){const e=["tree","cluster","treemap","circlepack","partition","orbit"].includes(u),r=e?f||(Array.isArray(h)?void 0:h):void 0;if(e&&r)t.ingestHierarchy(r,[i,s]),t.buildScene([i,s]);else{const e=oe(d),r=Array.isArray(h)?oe(h):[];(e.length>0||r.length>0)&&(t.ingestBounded(e,r,[i,s]),t.buildScene([i,s]))}}const F=t?.sceneNodes??[],B=t?.sceneEdges??[],Y=t?.labels??[];return mn("div",{ref:r,className:"stream-network-frame"+(y?" "+y:""),role:"img","aria-label":g||("string"==typeof p?p:"Network chart"),style:{position:"relative",width:m?"100%":n[0],height:v?"100%":n[1]},children:[pn(X,{summary:x}),mn("svg",{xmlns:"http://www.w3.org/2000/svg",width:n[0],height:n[1],style:{position:"absolute",left:0,top:0},children:[c&&pn("g",{transform:`translate(${o.left},${o.top})`,children:c}),mn("g",{transform:`translate(${o.left},${o.top})`,children:[b&&pn("rect",{x:0,y:0,width:i,height:s,fill:b}),B.map((e,t)=>k({node:e,index:t,renderMode:_,fallback:()=>de(e,t)})).filter(Boolean),F.map((e,t)=>k({node:e,index:t,renderMode:_,fallback:()=>he(e,t)})).filter(Boolean),Y.map((e,t)=>ue(e,t)).filter(Boolean)]})]}),pn(dn,{width:i,height:s,totalWidth:n[0],totalHeight:n[1],margin:o,labels:Y,sceneNodes:F,title:p,legend:S,legendPosition:w,legendLayout:A,legendHoverBehavior:L,legendClickBehavior:E,legendHighlightedCategory:D,legendIsolatedCategories:R,foregroundGraphics:a(l,P(t?.customLayoutOverlays,M??null)),annotations:N,onAnnotationActivate:T,onObservation:C??I,chartId:W,chartType:"StreamNetworkFrame",autoPlaceAnnotations:$,svgAnnotationRules:z,annotationFrame:0}),pn(gn,{marks:t?.customLayoutHtmlMarks,margin:o,selection:M??null})]})}function xn(e){if("undefined"!=typeof DOMException)return new DOMException(e+" aborted","AbortError");const t=Error(e+" aborted");return t.name="AbortError",t}function kn(e){const t=Error(e.message);return t.name=e.name??"Error",e.stack&&(t.stack=e.stack),t}function bn(e){return e&&"object"==typeof e?{requestId:e.requestId,error:e.error}:{}}var _n=class{constructor(e){this.nextRequestId=1,this.pending=new Map,this.dead=!1,this.options=e,this.worker=e.createWorker(),this.worker.onmessage=e=>{const t=this.options.parseMessage(e.data),r=t.requestId,n=null!=r?this.pending.get(r):this.pending.values().next().value;if(n){if(null!=r)this.pending.delete(r);else{for(const e of this.pending.values())e!==n&&(e.cleanup(),e.reject(Error(this.options.name+" worker response missing requestId")));this.pending.clear()}n.cleanup(),t.ok?n.resolve(t.payload):n.reject(t.error)}},this.worker.onerror=e=>{this.rejectAll(Error(e.message||this.options.name+" worker failed")),this.terminate()}}get isDead(){return this.dead}request(e,t){if(this.dead)return Promise.reject(Error(this.options.name+" worker session is closed"));if(t?.aborted)return Promise.reject(xn(this.options.name));const r=this.nextRequestId;this.nextRequestId+=1;const n=this.options.encodeRequest?.(r,e)??{requestId:r,request:e};return new Promise((e,o)=>{const i=()=>{this.pending.delete(r),t?.removeEventListener("abort",i),o(xn(this.options.name))},a=()=>t?.removeEventListener("abort",i);this.pending.set(r,{cleanup:a,reject:o,resolve:e}),t?.addEventListener("abort",i,{once:!0});try{this.worker.postMessage(n)}catch(e){this.pending.delete(r),a(),o(e instanceof Error?e:Error(e+""))}})}terminate(){this.dead||(this.dead=!0,this.rejectAll(Error(this.options.name+" worker terminated")),this.worker.terminate())}rejectAll(e){for(const t of this.pending.values())t.cleanup(),t.reject(e);this.pending.clear()}};function Sn(e){let t=null;return{get:()=>(t&&!t.isDead||(t=e()),t),resetForTest:()=>{if(t){try{t.terminate()}catch{}t=null}}}}function wn(e,t,r,n,o=4e4){return"sync"!==e&&("worker"===e||n*(t+r)>=o)}function An(){return"undefined"!=typeof window&&"undefined"!=typeof Worker}var Ln=class{constructor(e=function(){const e="string"==typeof import.meta.url&&import.meta.url?new URL("./forceLayoutWorker.js",import.meta.url):N("forceLayoutWorker.js");return new Worker(e,{type:"module",name:"semiotic-force-layout"})}()){this.session=new _n({name:"Force layout",createWorker:()=>e,parseMessage:e=>{const t=e,{requestId:r,error:n}=bn(t);return n?{requestId:r,ok:!1,error:kn(n)}:{requestId:r,ok:!0,payload:{positions:t.positions??{}}}}})}get isDead(){return this.session.isDead}request(e,t){return this.session.request(e,t)}terminate(){this.session.terminate()}},En=Sn(()=>new Ln);function Pn(e,t){return An()?En.get().request(e,t):Promise.reject(Error("Web Workers are unavailable"))}import{jsx as Dn,jsxs as Rn}from"react/jsx-runtime";var Mn=/^(value|amount|total|count|weight|score)$/i;function Nn({data:e}){if("edge"===e.nodeOrEdge){const t=e.data;return t?Rn("div",{className:"semiotic-tooltip",style:te,children:[Rn("div",{style:{fontWeight:600},children:["object"==typeof t.source?t.source.id:t.source," → ","object"==typeof t.target?t.target.id:t.target]}),null!=t.value&&Rn("div",{style:{marginTop:4,opacity:.8},children:["Value:"," ","number"==typeof t.value?t.value.toLocaleString():t.value+""]})]}):null}const t=e.data;if(!t)return null;const r=t.__hierarchyNode;if(r){const e=[];let n=r;for(;n;){const r=n.data?.name??n.data?.id??t.id;null!=r&&e.unshift(r+""),n=n.parent}e.length>1&&e.shift();const o=e.length-1;return Rn("div",{className:"semiotic-tooltip",style:te,children:[Dn("div",{children:e.map((e,t)=>Rn("span",{children:[t>0&&Dn("span",{style:{margin:"0 3px",opacity:.5},children:" → "}),t===o?Dn("strong",{children:e}):Dn("span",{style:{opacity:.7},children:e})]},t))}),null!=t.value&&t.value>0&&Dn("div",{style:{marginTop:4,opacity:.8},children:"number"==typeof t.value?t.value.toLocaleString():t.value+""})]})}const n=(t.sourceLinks?.length||0)+(t.targetLinks?.length||0),o=(t.sourceLinks||[]).reduce((e,t)=>e+(t.value||0),0)+(t.targetLinks||[]).reduce((e,t)=>e+(t.value||0),0),i=we(t.data??t),a=null!=i.title?i.title+"":t.id,s=i.entries.some(e=>Mn.test(e.key));return Rn("div",{className:"semiotic-tooltip",style:te,children:[Dn("div",{style:{fontWeight:600},children:a}),i.entries.map(e=>Rn("div",{style:{marginTop:4,opacity:.8},children:[e.key,": ",d(e.value)]},e.key)),!s&&null!=t.value&&t.value>0&&Rn("div",{style:{marginTop:4,opacity:.8},children:["Total:"," ","number"==typeof t.value?t.value.toLocaleString():t.value+""]}),n>0&&Rn("div",{style:{marginTop:4,opacity:.8},children:["Connections: ",n,o!==n&&` (weighted: ${o.toLocaleString()})`]})]})}function Tn(e){return e._cachedPath2D&&e._cachedPath2DSource===e.pathD||(e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD),e._cachedPath2D}function Cn(e,t){if(!t.pathD)return;e.save();const r=Tn(t);if(t.style.fill&&"none"!==t.style.fill){const n=t._gradient;if(n){const r=e.createLinearGradient(n.x0,n.y0??0,n.x1,n.y1??0),o=t.style.fillOpacity??t.style.opacity??.5,i="string"==typeof t.style.fill?t.style.fill:"#999",a=ke(e,i)||i;r.addColorStop(0,1===n.from?a:"transparent"),r.addColorStop(1,1===n.to?a:"transparent"),e.fillStyle=r,e.globalAlpha=o}else e.fillStyle=be(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??t.style.opacity??.5;e.fill(r)}t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=ke(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth??.5,e.globalAlpha=.5*(t.style.opacity??1),e.stroke(r)),t._pulseIntensity&&t._pulseIntensity>0&&(e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.globalAlpha=.2*t._pulseIntensity,e.fill(r)),e.restore()}function In(e,t){e.save();const r=t.style.stroke||"#999";e.strokeStyle=ke(e,r)||r,e.lineWidth=t.style.strokeWidth??1,void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),t.style.strokeDasharray&&e.setLineDash(t.style.strokeDasharray.split(/[\s,]+/).map(Number)),e.beginPath(),e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.stroke(),t._pulseIntensity&&t._pulseIntensity>0&&(e.setLineDash([]),e.strokeStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=(t.style.strokeWidth??1)+3*t._pulseIntensity,e.globalAlpha=.4*t._pulseIntensity,e.beginPath(),e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.stroke()),e.restore()}function Wn(e,t){if(!t.pathD)return;e.save();const r=Tn(t);t.style.fill&&"none"!==t.style.fill&&(e.fillStyle=be(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??t.style.opacity??.5,e.fill(r)),t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=ke(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth??.5,e.globalAlpha=.3*(t.style.opacity??1),e.stroke(r)),t._pulseIntensity&&t._pulseIntensity>0&&(e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.globalAlpha=.25*t._pulseIntensity,e.fill(r)),e.restore()}function $n(e,t){if(!t.pathD)return;e.save();const r=Tn(t),n=t.style.stroke||"#999";e.strokeStyle=ke(e,n)||n,e.lineWidth=t.style.strokeWidth??1,void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),e.stroke(r),t.style.fill&&"none"!==t.style.fill&&(e.fillStyle=be(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??.1,e.fill(r)),e.restore()}function zn(e,t,r,n=30){switch(e.type){case"circle":return function(e,t,r,n=30){const o=t-e.cx,i=r-e.cy,a=Math.sqrt(o*o+i*i);return a>h(e.r,n)?null:{type:"node",datum:e.datum,x:e.cx,y:e.cy,distance:a}}(e,t,r,n);case"rect":return function(e,t,r){const n=f(t,r,e);return n.hit?{type:"node",datum:e.datum,x:n.cx,y:n.cy,distance:0}:null}(e,t,r);case"arc":return function(e,t,r){const n=t-e.cx,o=r-e.cy,i=Math.sqrt(n*n+o*o);if(e.innerR-2>i||i>e.outerR+2)return null;const a=p(Math.atan2(o,n)),s=p(e.startAngle),c=p(e.endAngle);if(s>c?a>=s||c>=a:a>=s&&c>=a){const t=(e.startAngle+e.endAngle)/2,r=(e.innerR+e.outerR)/2;return{type:"node",datum:e.datum,x:e.cx+r*Math.cos(t),y:e.cy+r*Math.sin(t),distance:0}}return null}(e,t,r);case"symbol":return function(e,t,r,n=30){const o=t-e.cx,i=r-e.cy,a=Math.sqrt(o*o+i*i);return a>h(Ae(e.size),n)?null:{type:"node",datum:e.datum,x:e.cx,y:e.cy,distance:a}}(e,t,r,n);case"glyph":return function(e,t,r,n=30){if(null==e.datum)return null;const o=Ne(e.glyph,e.size),i=e.cx+o.centerDx,a=e.cy+o.centerDy,s=t-i,c=r-a,l=Math.sqrt(s*s+c*c);return l>h(o.radius,n)?null:{type:"node",datum:e.datum,x:i,y:a,distance:l}}(e,t,r,n);default:return null}}Nn.ownsChrome=!0;var Fn=null,Bn=null;function Yn(){return Bn||((Fn=document.createElement("canvas")).width=1,Fn.height=1,Bn=Fn.getContext("2d")),Bn}function On(e){if(e._cachedPath2D&&e._cachedPath2DSource===e.pathD)return e._cachedPath2D;try{return e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD,e._cachedPath2D}catch{return null}}function Xn(e,t,r){switch(e.type){case"bezier":return function(e,t,r){if(!e.pathD)return null;const n=On(e),o=Yn();if(!n||!o)return null;try{if(o.isPointInPath(n,t,r))return{type:"edge",datum:e.datum,x:t,y:r,distance:0};const i=o.lineWidth;o.lineWidth=10;const a=o.isPointInStroke(n,t,r);if(o.lineWidth=i,a)return{type:"edge",datum:e.datum,x:t,y:r,distance:4}}catch{}return null}(e,t,r);case"line":return function(e,t,r){const n=e.x2-e.x1,o=e.y2-e.y1,i=n*n+o*o;if(0===i)return null;let a=((t-e.x1)*n+(r-e.y1)*o)/i;a=Math.max(0,Math.min(1,a));const s=e.x1+a*n,c=e.y1+a*o,l=Math.sqrt((t-s)**2+(r-c)**2);return l>5?null:{type:"edge",datum:e.datum,x:s,y:c,distance:l}}(e,t,r);case"ribbon":case"curved":return function(e,t,r){if(!e.pathD)return null;const n=On(e),o=Yn();if(!n||!o)return null;try{if(o.isPointInPath(n,t,r))return{type:"edge",datum:e.datum,x:t,y:r,distance:0};const i=o.lineWidth;o.lineWidth=10;const a=o.isPointInStroke(n,t,r);if(o.lineWidth=i,a)return{type:"edge",datum:e.datum,x:t,y:r,distance:4}}catch{}return null}(e,t,r);default:return null}}function jn(e){const{clientX:t,clientY:r,canvasRect:n,margin:o,adjustedWidth:i,adjustedHeight:a,sceneNodes:s,sceneEdges:c,nodeQuadtree:l,maxNodeRadius:d,hitRadius:h=30}=e,f=t-n.left-o.left,y=r-n.top-o.top;if(0>f||f>i||0>y||y>a)return{kind:"miss-outside"};const g=function(e,t,r,n,o=30,i,a=0){let s=null,c=o,l=1/0;if(i){const e=u(i,r,n,o,a,e=>e.cx,e=>e.cy,e=>e.r);e&&(s={type:"node",datum:e.node.datum,x:e.node.cx,y:e.node.cy,distance:e.distance},c=e.distance)}for(const t of e){if(i&&"circle"===t.type)continue;const e=zn(t,r,n,o);if(e)if("rect"===t.type){const r=t.w*t.h;l>r&&(s=e,l=r)}else c>e.distance&&(s=e,c=e.distance)}if(s)return s;for(const e of t){if(!1===e.interactive)continue;const t=Xn(e,r,n);t&&c>t.distance&&(s=t,c=t.distance)}return s}(s,c,f,y,h,l,d);return g?{kind:"hit",hover:Q(g.datum||{},g.x,g.y,{nodeOrEdge:g.type})}:{kind:"miss"}}import{useCallback as Hn}from"react";var qn="StreamNetworkFrame";import{jsx as Vn,jsxs as Gn}from"react/jsx-runtime";var Qn={top:20,right:80,bottom:20,left:80},Kn={top:40,right:40,bottom:40,left:40},Zn=new Set(["chord","force","circlepack","orbit"]),Un=[800,600],Jn=je(Xe(function(o,s){const{chartType:c,nodes:u,edges:d,data:h,initialEdges:f,nodeIDAccessor:p="id",sourceAccessor:k="source",targetAccessor:L="target",valueAccessor:E="value",edgeIdAccessor:D,childrenAccessor:R,hierarchySum:M,orientation:N="horizontal",nodeAlign:T="justify",nodePaddingRatio:C=.05,nodeWidth:I=15,iterations:H=300,forceStrength:q=.1,layoutExecution:V="auto",layoutLoadingContent:G,onLayoutStateChange:K,padAngle:U=.01,groupWidth:J=20,sortGroups:ee,edgeSort:te,treeOrientation:le="vertical",edgeType:ue="curve",padding:de,paddingTop:he,tensionConfig:fe,showParticles:ve=!1,particleStyle:xe,renderMode:be,nodeStyle:Se,edgeStyle:we,colorBy:Ae,colorScheme:Le="category10",edgeColorBy:Re="source",edgeOpacity:Ne=.5,colorByDepth:Xe=!1,nodeSize:je=8,nodeSizeRange:Ve=[5,20],nodeLabel:Ge,showLabels:Qe=!0,labelMode:Ke,size:Ze=Un,responsiveWidth:Ue,responsiveHeight:Je,margin:et,className:tt,background:rt,maxDevicePixelRatio:nt,enableHover:ot=!0,tooltipContent:it,customHoverBehavior:at,customClickBehavior:st,onObservation:ct,annotationObservationCallback:lt,chartId:ut,onTopologyChange:dt,annotations:ht,onAnnotationActivate:ft,autoPlaceAnnotations:yt,svgAnnotationRules:gt,legend:pt,legendPosition:mt,legendLayout:vt,legendHoverBehavior:xt,legendClickBehavior:kt,legendHighlightedCategory:bt,legendIsolatedCategories:_t,title:St,foregroundGraphics:wt,backgroundGraphics:At,decay:Lt,pulse:Et,transition:Pt,animate:Dt,staleness:Rt,frameScheduler:Mt,clock:Nt,random:Tt,seed:Ct,paused:It=!1,suspendWhenHidden:Wt=!0,thresholds:$t,accessibleTable:zt=!0,description:Ft,summary:Bt,orbitMode:Yt,orbitSize:Ot,orbitSpeed:Xt,orbitRevolution:jt,orbitRevolutionStyle:Ht,orbitEccentricity:qt,orbitShowRings:Vt,orbitAnimated:Gt,customNetworkLayout:Qt,onLayoutError:Kt,layoutConfig:Zt,layoutSelection:Ut}=o,Jt=Zn.has(c)?Kn:Qn,er=$e(!0),tr=Ee({sizeProp:Ze,responsiveWidth:Ue,responsiveHeight:Je,userMargin:et,marginDefault:Jt,title:St,legend:pt,legendPosition:mt,foregroundGraphics:wt,backgroundGraphics:At,animate:Dt,transitionProp:Pt,frameScheduler:Mt,clock:Nt,random:Tt,seed:Ct,paused:It,suspendWhenHidden:Wt,themeDirtyRef:er}),{reducedMotionRef:rr,responsiveRef:nr,size:or,margin:ir,adjustedWidth:ar,adjustedHeight:sr,resolvedForeground:cr,resolvedBackground:lr,transition:dr,introEnabled:hr,tableId:fr,rafRef:yr,renderFnRef:gr,scheduleRender:pr,frameRuntime:mr,currentTheme:vr}=tr,xr=Ce(),kr=Ie(),br=Be(()=>oe(u),[u]),_r=Be(()=>Array.isArray(d)?oe(d):d,[d]),Sr=Be(()=>({...He,...fe}),[fe]),wr=Be(()=>({...qe,...xe}),[xe]),Ar=Be(()=>{return{chartType:(e={chartType:c,clock:mr.now,random:Tt,seed:Ct,nodeIDAccessor:p,sourceAccessor:k,targetAccessor:L,valueAccessor:E,edgeIdAccessor:D,childrenAccessor:R,hierarchySum:M,orientation:N,nodeAlign:T,nodePaddingRatio:C,nodeWidth:I,iterations:H,forceStrength:q,padAngle:U,groupWidth:J,sortGroups:ee,edgeSort:te,treeOrientation:le,edgeType:ue,padding:de,paddingTop:he,tensionConfig:Sr,showParticles:ve,particleStyle:wr,nodeStyle:Se,edgeStyle:we,nodeLabel:Ge,showLabels:Qe,labelMode:Ke,colorBy:Ae,colorScheme:Le,edgeColorBy:Re,edgeOpacity:Ne,colorByDepth:Xe,nodeSize:je,nodeSizeRange:Ve,decay:Lt,pulse:Et,transition:dr,introAnimation:hr,staleness:Rt,thresholds:$t,orbitMode:Yt,orbitSize:Ot,orbitSpeed:Xt,orbitRevolution:jt,orbitRevolutionStyle:Ht,orbitEccentricity:qt,orbitShowRings:Vt,orbitAnimated:Gt,customNetworkLayout:Qt,onLayoutError:Kt,layoutConfig:Zt,currentTheme:vr}).chartType,clock:e.clock,random:e.random,seed:e.seed,nodeIDAccessor:e.nodeIDAccessor,sourceAccessor:e.sourceAccessor,targetAccessor:e.targetAccessor,valueAccessor:e.valueAccessor,edgeIdAccessor:e.edgeIdAccessor,childrenAccessor:e.childrenAccessor,hierarchySum:e.hierarchySum,orientation:e.orientation,nodeAlign:e.nodeAlign,nodePaddingRatio:e.nodePaddingRatio,nodeWidth:e.nodeWidth,iterations:e.iterations,forceStrength:e.forceStrength,padAngle:e.padAngle,groupWidth:e.groupWidth,sortGroups:e.sortGroups,edgeSort:e.edgeSort,treeOrientation:e.treeOrientation,edgeType:e.edgeType,padding:e.padding,paddingTop:e.paddingTop,tensionConfig:e.tensionConfig,showParticles:e.showParticles,particleStyle:e.particleStyle,nodeStyle:e.nodeStyle,edgeStyle:e.edgeStyle,nodeLabel:e.nodeLabel,showLabels:e.showLabels,labelMode:e.labelMode,colorBy:e.colorBy,colorScheme:e.colorScheme,themeCategorical:e.currentTheme?.colors?.categorical,themeSemantic:Me(e.currentTheme),edgeColorBy:e.edgeColorBy,edgeOpacity:e.edgeOpacity,colorByDepth:e.colorByDepth,nodeSize:e.nodeSize,nodeSizeRange:e.nodeSizeRange,decay:e.decay,pulse:e.pulse,transition:e.transition,introAnimation:e.introAnimation,staleness:e.staleness,thresholds:e.thresholds,orbitMode:e.orbitMode,orbitSize:e.orbitSize,orbitSpeed:e.orbitSpeed,orbitRevolution:e.orbitRevolution,orbitRevolutionStyle:e.orbitRevolutionStyle,orbitEccentricity:e.orbitEccentricity,orbitShowRings:e.orbitShowRings,orbitAnimated:e.orbitAnimated,customNetworkLayout:e.customNetworkLayout,onLayoutError:e.onLayoutError,layoutConfig:e.layoutConfig};var e},[c,mr.now,Tt,Ct,p,k,L,E,D,R,M,N,T,C,I,H,q,U,J,ee,te,le,ue,de,he,Sr,ve,wr,Se,we,Ge,Qe,Ke,Ae,Le,Re,Ne,Xe,je,Ve,Lt,Et,dr,hr,Rt,$t,Yt,Ot,Xt,jt,Ht,qt,Vt,Gt,Qt,Kt,Zt,vr]),Lr=w(Ar),Er=w({chartType:(Pr={chartType:c,nodeIDAccessor:p,sourceAccessor:k,targetAccessor:L,valueAccessor:E,edgeIdAccessor:D,childrenAccessor:R,hierarchySum:M,orientation:N,nodeAlign:T,nodePaddingRatio:C,nodeWidth:I,iterations:H,forceStrength:q,padAngle:U,groupWidth:J,sortGroups:ee,edgeSort:te,treeOrientation:le,edgeType:ue,padding:de,paddingTop:he,random:Tt,seed:Ct,tensionConfig:Sr,customNetworkLayout:Qt,orbitMode:Yt,orbitSize:Ot,orbitEccentricity:qt}).chartType,nodeIDAccessor:Pr.nodeIDAccessor,sourceAccessor:Pr.sourceAccessor,targetAccessor:Pr.targetAccessor,valueAccessor:Pr.valueAccessor,edgeIdAccessor:Pr.edgeIdAccessor,childrenAccessor:Pr.childrenAccessor,hierarchySum:Pr.hierarchySum,orientation:Pr.orientation,nodeAlign:Pr.nodeAlign,nodePaddingRatio:Pr.nodePaddingRatio,nodeWidth:Pr.nodeWidth,iterations:Pr.iterations,forceStrength:Pr.forceStrength,padAngle:Pr.padAngle,groupWidth:Pr.groupWidth,sortGroups:Pr.sortGroups,edgeSort:Pr.edgeSort,treeOrientation:Pr.treeOrientation,edgeType:Pr.edgeType,padding:Pr.padding,paddingTop:Pr.paddingTop,random:Pr.random,seed:Pr.seed,tensionConfig:Pr.tensionConfig,customNetworkLayout:Pr.customNetworkLayout,orbitMode:Pr.orbitMode,orbitSize:Pr.orbitSize,orbitEccentricity:Pr.orbitEccentricity});var Pr;const Dr=$e(0),Rr=$e(0),Mr=$e(!1),Nr=$e(null);Nr.current||(Nr.current=new an(Lr));const Tr=De("StreamNetworkFrame"),Cr=Ye((e,t,r=!1)=>_e(Tr.current,e,()=>e.buildScene(t),r),[Tr]),[Ir,Wr]=ze(null),[$r,zr]=ze(0),[Fr,Br]=ze(0),[Yr,Or]=ze(!1),[Xr,jr]=ze(!1),Hr=$e(0),qr=$e(null),Vr=$e(!1),Gr=$e(K);Gr.current=K;const Qr=$e(Lr);Qr.current=Lr;const Kr=$e(null),Zr=$e(new Map),Ur=$e(0),Jr=Ye(e=>function(e){const{node:t,colorBy:r,colorScheme:n,nodeColorMap:o,colorIndexRef:i}=e;if("function"==typeof r)return r(t)+"";if("string"==typeof r&&t.data){const e=t.data[r];if(void 0!==e){if(!o.has(e+"")){const t=Array.isArray(n)?n:z;o.set(e+"",t[i.current++%t.length])}return o.get(e+"")}}if(o.has(t.id))return o.get(t.id);const a=Array.isArray(n)?n:z,s=r?a[i.current++%a.length]:a[0];return o.set(t.id,s),s}({node:e,colorBy:Ae,colorScheme:Le,nodeColorMap:Zr.current,colorIndexRef:Ur}),[Ae,Le]),en=Ye(e=>{Ur.current=function(e){const{sceneNodes:t,nodes:r,nodeColorMap:n,colorScheme:o}=e;for(const e of t)e.id&&"string"==typeof e.style?.fill&&n.set(e.id,e.style.fill);const i=Array.isArray(o)?o:z,a=Array.from(r);for(let e=0;a.length>e;e++){const t=a[e];n.has(t.id)||n.set(t.id,i[e%i.length])}return a.length}({sceneNodes:e.sceneNodes,nodes:e.nodes.values(),nodeColorMap:Zr.current,colorScheme:Le})},[Le]),tn=Ye((e,t)=>{Cr(e,t),en(e),er.current=!1,e.markStylePaintPending()},[Cr,en]),rn=Ye(()=>{Nr.current?.markStylePaintPending()},[]),nn=(on=vr,on?.colors?.border||on?.colors?.secondary||on?.colors?.primary||"#999");var on;const sn=Ye(e=>function(e,t){return e?"object"==typeof e?e:t?.get(e)??null:null}(e,Nr.current?.nodes),[]),cn=Ye(e=>function(e){const{edge:t,edgeColorBy:r,getNodeColor:n,resolveEndpoint:o,fallback:i}=e;if("function"==typeof r)return r(t);const a=o(t.source),s=o(t.target);return"target"===r&&s?n(s):a?n(a):i}({edge:e,edgeColorBy:Re,getNodeColor:Jr,resolveEndpoint:sn,fallback:nn}),[Re,Jr,nn,sn]),ln=Ye(e=>function(e){const{edge:t,particleStyleColor:r,particleColorBy:n,hasExplicitParticleColorBy:o,getEdgeColor:i,getNodeColor:a,resolveEndpoint:s,fallback:c}=e;if("function"==typeof r){const e=s(t.source);return e?r(t,e):c}if(!o)return i(t);const l=n,u=s(t.source),d=s(t.target);return"target"===l&&d?a(d):u?a(u):c}({edge:e,particleStyleColor:wr.color,particleColorBy:wr.colorBy,hasExplicitParticleColorBy:!!xe?.colorBy,getEdgeColor:cn,getNodeColor:Jr,resolveEndpoint:sn,fallback:nn}),[xe?.colorBy,wr.color,wr.colorBy,Jr,cn,nn,sn]),un=function(e,t,r,n,o){return("sankey"===e||t)&&r||n||o}(c,!!Qt,ve,!!Et,Nr.current?.isAnimating??!1);_(Nr,Lr,er,pr),S(Nr,Ut,er,pr),Fe(()=>{const e=Nr.current;e&&(tn(e,[ar,sr]),zr(e=>e+1),pr())},[vr,ar,sr,tn,pr]);const hn=Ye(()=>{const e=Nr.current;if(e&&(e.runLayout([ar,sr]),tn(e,[ar,sr]),zr(e.layoutVersion),dt)){const{nodes:t,edges:r}=e.getLayoutData();dt(t,r)}},[ar,sr,tn,dt]),fn=$e(!1),yn=Ye((e=!1)=>!(!e&&!fn.current||(fn.current=!1,hn(),0)),[hn]),pn=Ye(()=>yn(!1),[yn]),mn=Ye(e=>{const t=Nr.current;if(!t)return!1;let r=!1,n=fn.current;for(const o of e)null!=o&&"object"==typeof o&&(r=!0,t.ingestEdge(o)&&(n=!0));const o=yn(n);return r||o},[yn]),xn=Ye(e=>{if(null==e||"object"!=typeof e)return;const t=Nr.current;t&&(t.ingestEdge(e)&&(fn.current=!0),mr.isActive?pr():pn())},[pn,mr,pr]),kn=Ye(e=>{mn(e)&&pr()},[mn,pr]);Fe(()=>mr.subscribe(()=>{mr.isActive||pn()}),[pn,mr]);const bn=Ye(()=>{fn.current=!1,Nr.current?.clear(),Zr.current.clear(),Ur.current=0,zr(Nr.current?.layoutVersion??0),Wr(null),Kr.current=null,er.current=!0,pr()},[pr]),_n=Ye(()=>{const e=Nr.current;e&&(e.tension+=999,yn(!0),pr())},[yn,pr]);Oe(s,()=>({push:xn,pushMany:kn,removeNode:e=>{const t=Nr.current?.removeNode(e)??!1;if(t){const t=Kr.current?.data?"function"==typeof p?p(Kr.current.data):Kr.current.data[p]:void 0;Kr.current&&"node"===Kr.current.nodeOrEdge&&t===e&&(Kr.current=null,Wr(null)),Zr.current.delete(e)}return yn(t)&&(er.current=!0,pr()),t},removeEdge:(e,t)=>{const r=Nr.current?.removeEdge(e,t)??!1;if(r&&Kr.current&&"edge"===Kr.current.nodeOrEdge){const r=Kr.current.data;let n;n=void 0!==t?("object"==typeof r?.source?r.source.id:r?.source)===e&&("object"==typeof r?.target?r.target.id:r?.target)===t:!D||!r||("function"==typeof D?D:e=>e?.[D])(r)===e,n&&(Kr.current=null,Wr(null))}return yn(r)&&(er.current=!0,pr()),r},updateNode:(e,t)=>{const r=Nr.current?.updateNode(e,t)??null;return yn(null!==r)&&(er.current=!0,pr()),r},updateEdge:(e,t,r)=>{const n=Nr.current?.updateEdge(e,t,r)??[];return yn(n.length>0)&&(er.current=!0,pr()),n},clear:bn,getTopology:()=>(pn(),Nr.current?.getLayoutData()??{nodes:[],edges:[]}),getCustomLayout:()=>(pn(),Nr.current?.lastCustomLayoutResult??null),getLayoutFailure:()=>(pn(),Nr.current?.lastCustomLayoutFailure??null),getTopologyDiff:()=>{pn();const e=Nr.current;return e?{addedNodes:Array.from(e.addedNodes),removedNodes:Array.from(e.removedNodes),addedEdges:Array.from(e.addedEdges),removedEdges:Array.from(e.removedEdges)}:{addedNodes:[],removedNodes:[],addedEdges:[],removedEdges:[]}},relayout:_n,getTension:()=>(pn(),Nr.current?.tension??0)}),[xn,kn,bn,_n,pn,yn,p,pr,D]);const Sn=["tree","cluster","treemap","circlepack","partition","orbit"].includes(c),Ln=Sn?h||(Array.isArray(d)?void 0:d):void 0;Fe(()=>{const e=Nr.current;if(!e)return;const t=++Hr.current;if(qr.current?.abort(),qr.current=null,Sn&&Ln)fn.current=!1,e.ingestHierarchy(Ln,[ar,sr]),tn(e,[ar,sr]),zr(e.layoutVersion),jr(!1),Gr.current?.("ready"),pr();else{const r=br,n=Array.isArray(_r)?_r:[];if(null==u&&null==d||(fn.current=!1),0===r.length&&0===n.length)return null==u&&null==d||0>=e.nodes.size&&0>=e.edges.size||bn(),jr(!1),void Gr.current?.("ready");const o=[ar,sr],i="force"===c&&!Qt&&An()&&!Tt&&wn(V,r.length,n.length,H);if(i&&kr&&!Vr.current&&e.sceneNodes.length>0)return Vr.current=!0,jr(!1),Gr.current?.("ready"),er.current=!0,void pr();if(i){const i=new AbortController;qr.current=i;const a=e._lastPositionSnapshot;e.ingestBounded(r,n,o,{deferLayout:!0});const s=e.getLayoutData(),c=function(e,t,r,n,o){const i=ur(r.nodeSize,r.nodeSizeRange,e);return{kind:"frame",nodes:e.map(e=>{const t=o?.get(e.id);return{id:e.id,x:0!==e.x||0!==e.y?e.x:t?.x??0,y:0!==e.x||0!==e.y?e.y:t?.y??0,x0:0,x1:0,y0:0,y1:0,width:0,height:0,value:e.value,__forceRadius:i(e)}}),edges:t.map(e=>{const t="string"==typeof e.source?e.source:e.source.id,r="string"==typeof e.target?e.target:e.target.id,n=e.data?.weight,o="number"==typeof n&&Number.isFinite(n)?n:e.value;return{source:t,target:r,value:e.value,y0:0,y1:0,sankeyWidth:0,weight:o}}),config:{chartType:"force",iterations:r.iterations,forceStrength:r.forceStrength,seed:r.seed},size:n}}(s.nodes,s.edges,Qr.current,o,a);return jr(!0),Gr.current?.("pending"),Pn(c,i.signal).then(({positions:r})=>{t===Hr.current&&(e.applyForceLayoutPositions(r,o),tn(e,o),jr(!1),Gr.current?.("ready"),zr(e.layoutVersion),pr())}).catch(r=>{"AbortError"!==r.name&&t===Hr.current&&(e.runLayout(o),tn(e,o),jr(!1),Gr.current?.("error"),zr(e.layoutVersion),pr())}),()=>i.abort()}e.ingestBounded(r,n,o),tn(e,o),zr(e.layoutVersion),jr(!1),Gr.current?.("ready"),pr()}},[br,_r,u,d,h,Ln,Sn,ar,sr,Er,V,H,kr,c,Qt,Tt,pr,bn,tn]);const En=We.useRef(!1);Fe(()=>{En.current||f&&f.length>0&&(En.current=!0,kn(f))},[f,kn]);const{customHoverBehavior:Dn,customClickBehavior:Rn}=function({customHoverBehavior:e,customClickBehavior:t,onObservation:r,chartId:n}){return{customHoverBehavior:Hn((t,o)=>{e?.(t,o),ne({onObservation:r,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:qn,chartId:n,context:o})},[e,r,n]),customClickBehavior:Hn((e,o)=>{t?.(e,o),re({onObservation:r,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:qn,chartId:n,context:o})},[t,r,n])}}({customHoverBehavior:at,customClickBehavior:st,onObservation:ct,chartId:ut}),{hoverHandlerRef:Mn,hoverLeaveRef:Tn,onPointerMove:zn,onPointerLeave:Fn}=tr,Bn=()=>!Qt||(Nr.current?.hasCustomRestyle??!1);Mn.current=e=>{if(!ot)return;const t=Bn(),r=no.current;if(!r)return;const n=Nr.current;if(!n)return;const o=jn({clientX:e.clientX,clientY:e.clientY,canvasRect:r.getBoundingClientRect(),margin:ir,adjustedWidth:ar,adjustedHeight:sr,sceneNodes:n.sceneNodes,sceneEdges:n.sceneEdges,nodeQuadtree:n.nodeQuadtree,maxNodeRadius:n.maxNodeRadius});"hit"===o.kind?(Kr.current=o.hover,Wr(o.hover),Dn?.(o.hover),t&&pr()):Kr.current&&(Kr.current=null,Wr(null),Dn?.(null),t&&pr())},Tn.current=()=>{if(Kr.current){const e=Bn();Kr.current=null,Wr(null),Dn?.(null),e&&pr()}};const Yn=$e(()=>{});Yn.current=e=>{if(ae(e.target))return;if(!st&&!ct)return;const t=no.current;if(!t)return;const r=Nr.current;if(!r)return;const n=jn({clientX:e.clientX,clientY:e.clientY,canvasRect:t.getBoundingClientRect(),margin:ir,adjustedWidth:ar,adjustedHeight:sr,sceneNodes:r.sceneNodes,sceneEdges:r.sceneEdges,nodeQuadtree:r.nodeQuadtree,maxNodeRadius:r.maxNodeRadius});"hit"===n.kind?Rn(n.hover,{type:"activate",inputType:ye(e.nativeEvent.pointerType)}):"miss"===n.kind&&Rn(null)};const On=Ye(e=>Yn.current(e),[]),Xn=$e(-1),Jn=$e(null),eo=$e(-1),to=Ye(e=>{if(se(e))return;const t=Nr.current;if(!t)return;const r=()=>{Xn.current=-1,Jn.current=null,eo.current=-1,Kr.current=null,Wr(null),Dn?.(null),pr()},n=l(t.sceneNodes);if(0===n.length)return void(0>Xn.current||r());const o=i(n);let a=Xn.current;if(o.flat.length>a||(r(),a=-1)," "===e.key&&a>=0){e.preventDefault();const t=o.flat[a];return void Rn?.(Q(t.datum||{},t.x,t.y,{nodeOrEdge:"node"}),{type:"activate",inputType:"keyboard"})}if(0>a){if("Escape"===e.key)return;if(!["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Enter"].includes(e.key))return;e.preventDefault(),Xn.current=0,eo.current=-1;const t=o.flat[0];Jn.current={shape:t.shape,w:t.w,h:t.h};const r=Q(t.datum||{},t.x,t.y,{nodeOrEdge:"node"});return Kr.current=r,Wr(r),Dn?.(r,{type:"focus",inputType:"keyboard"}),void pr()}const s=b(o,a),c=g(e.key,s,o,t.sceneEdges??[],eo);if(null===c)return;if(e.preventDefault(),0>c)return void r();Xn.current=c;const u=o.flat[c];Jn.current={shape:u.shape,w:u.w,h:u.h};const d={data:u.datum||{},x:u.x,y:u.y,__semioticHoverData:!0,nodeOrEdge:"node"};Kr.current=d,Wr(d),Dn?.(d,{type:"focus",inputType:"keyboard"}),pr()},[Rn,Dn,pr]),ro=Ye(e=>{Xn.current=-1,Jn.current=null,zn(e)},[zn]);gr.current=()=>{if(yr.current=null,pn(),!mr.isActive)return;const n=no.current;if(!n)return;const o=Nr.current;o&&function(n){const{canvas:o,store:i,sceneRevisionDiagnostics:a,size:s,margin:c,adjustedWidth:l,adjustedHeight:u,background:d,maxDevicePixelRatio:h,renderMode:f,hasBackgroundGraphics:g=!1,dirtyRef:p,resolutionDirtyRef:k,lastFrameTimeRef:b,now:_,random:S,reducedMotion:w,showParticles:A,isContinuous:L,animate:E,decay:P,pulse:D,thresholds:R,staleness:M,particleStyle:N,getParticleColor:T,pendingAnnotationFrameRef:C,lastAnnotationFrameTimeRef:I,setAnnotationFrame:W,scheduleNextFrame:$,syncColorMap:z}=n,F=o.getContext("2d");if(!F)return;const B=b.current?Math.min((_-b.current)/1e3,.1):.016;b.current=_;const Y=i.advanceTransition(w?_+1e6:_),O=!w&&Y,X=!w&&i.tickAnimation([l,u],B),j=p.current,H=a?.beforeCompute(i.getLastUpdateResult(),O),q=Y||j||X;q&&(i.buildScene([l,u]),j&&z?.()),H&&a?.afterCompute(H,q,!1);const V=A&&!w&&!!i.particlePool,G=!!P||!!D||!!R||!1!==E&&i.hasActiveTopologyDiff||i.hasActivePulses||i.hasActiveThresholds,Q=i.consumeStylePaintPending(),K=e({dirtyOrRebuilt:j,transitioning:O,animationTicked:X,continuous:V||L,liveEncoding:G,forced:Q||!0===k?.current});k&&(k.current=!1);const U=!!M&&i.lastIngestTime>0&&_-i.lastIngestTime>(M?.threshold??5e3);if(K){const e=ie(h);if(!me(o,s,c,e))return;if(F.clearRect(-c.left,-c.top,s[0],s[1]),t(F,{background:d,hasBackgroundGraphics:g,width:l,height:u}),P&&i.applyDecay(),D&&i.applyPulse(_),R&&i.applyThresholds(_),!1!==E&&i.applyTopologyDiff(_),U&&(F.globalAlpha=M?.dimOpacity??.5),m({context:F,nodes:i.sceneEdges,renderMode:f,pixelRatio:e,paintBuiltIn:e=>function(e,t){for(const r of t)switch(r.type){case"bezier":Cn(e,r);break;case"line":In(e,r);break;case"ribbon":Wn(e,r);break;case"curved":$n(e,r)}}(F,e)}),m({context:F,nodes:i.sceneNodes,renderMode:f,pixelRatio:e,paintBuiltIn:e=>{const t=e;!function(e,t){for(const r of t){if("rect"!==r.type)continue;const t=r;t.w>0&&t.h>0&&(e.save(),void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),ge(e,t.style,"#007bff",()=>e.fillRect(t.x,t.y,t.w,t.h)),pe(e,t.style,()=>e.strokeRect(t.x,t.y,t.w,t.h)),x(e,t),e.restore())}}(F,t),function(e,t){for(const r of t){if("circle"!==r.type)continue;const t=r;t.r>0&&(e.save(),void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),e.beginPath(),e.arc(t.cx,t.cy,t.r,0,2*Math.PI),ge(e,t.style,"#007bff",()=>e.fill()),pe(e,t.style,()=>e.stroke()),v(e,t),e.restore())}}(F,t),function(e,t){for(const r of t){if("arc"!==r.type)continue;const t=r;e.save(),void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),e.beginPath(),e.arc(t.cx,t.cy,t.outerR,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerR,t.endAngle,t.startAngle,!0),e.closePath(),ge(e,t.style,"#007bff",()=>e.fill()),pe(e,t.style,()=>e.stroke()),e.restore()}}(F,t),r(F,t),y(F,t)}}),V&&!U){const e=i.edgesArray;if(e.length>0){!function(e,t,r,n,o=Math.random){const i=n.spawnRate??.1,a=n.maxPerEdge??50;for(let n=0;t.length>n;n++){const s=t[n];if(!s.bezier)continue;if(e.countForEdge(n)>=a)continue;const c=s.value*i*r*(s.bezier.circular?.3:1),l=Math.floor(c),u=c-l;let d=l;o()<u&&d++;for(let t=0;d>t&&e.countForEdge(n)<a;t++)e.spawn(n,o)}}(i.particlePool,e,B,N,S);const t=.5*(N.speedMultiplier??1);let r;if(N.proportionalSpeed){const t=e.reduce((e,t)=>Math.max(e,t.value||1),1);r=e.map(e=>.3+(e.value||1)/t*1.7)}i.particlePool.step(B,t,e,r),function(e,t,r,n,o){const i=n.radius??3;e.globalAlpha=n.opacity??.7;for(let a=0;t.particles.length>a;a++){const s=t.particles[a];if(!s.active)continue;const c=r[s.edgeIndex];if(!c)continue;let l;l="string"==typeof n.color&&"inherit"!==n.color?n.color:o(c),e.fillStyle=ke(e,l)||l,e.beginPath(),e.arc(s.x,s.y,i,0,2*Math.PI),e.fill()}e.globalAlpha=1}(F,i.particlePool,e,N,T)}}U&&(F.globalAlpha=1)}p.current=!1,(j||O||X)&&o.setAttribute("aria-label",Z(i.sceneNodes?.length??0,i.sceneEdges?.length??0,"Network chart"));const J=j||O||X||C.current;J&&_-I.current>=33?(W(e=>e+1),I.current=_,C.current=!1):C.current=!!J,(L||O||null!=i.transition||X||i.hasActivePulses||i.hasActiveThresholds||!1!==E&&i.hasActiveTopologyDiff||C.current)&&$()}({canvas:n,store:o,sceneRevisionDiagnostics:Tr.current,size:or,margin:ir,adjustedWidth:ar,adjustedHeight:sr,background:rt,maxDevicePixelRatio:nt,renderMode:be,hasBackgroundGraphics:!!At,dirtyRef:er,resolutionDirtyRef:oo,lastFrameTimeRef:Dr,now:mr.now(),random:mr.random,reducedMotion:!!rr.current,showParticles:ve,isContinuous:un,animate:Dt,decay:Lt,pulse:Et,thresholds:$t,staleness:Rt,particleStyle:wr,getParticleColor:ln,pendingAnnotationFrameRef:Mr,lastAnnotationFrameTimeRef:Rr,setAnnotationFrame:Br,scheduleNextFrame:()=>{pr()},syncColorMap:()=>en(o)})};const{canvasRef:no,resolutionDirtyRef:oo}=Pe(tr,{hydrated:xr,wasHydratingFromSSR:kr,storeRef:Nr,dirtyRef:er,skipInitialCanvasPaintInvalidation:!0,canvasPaintInvalidator:rn,maxDevicePixelRatio:nt,canvasPaintDependencies:[c,ar,sr,rt,At,be,pr]});A(Rt,Nr,er,pr,Yr,Or);const io=ot&&Ir?Vn(F,{x:Ir.x,y:Ir.y,containerWidth:ar,containerHeight:sr,margin:ir,className:"stream-network-tooltip",zIndex:2,children:it?it(Ir):Vn(Nn,{data:Ir})}):null;if(ce||!xr&&kr)return Vn(vn,{props:o,store:Nr.current,responsiveRef:nr,size:or,margin:ir,adjustedWidth:ar,adjustedHeight:sr,resolvedBackground:lr,resolvedForeground:cr});const ao=Nr.current;return Gn("div",{ref:nr,className:"stream-network-frame"+(tt?" "+tt:""),role:"group","aria-label":Ft||("string"==typeof St?St:"Network chart"),tabIndex:0,"aria-busy":Xr||void 0,style:{position:"relative",width:Ue?"100%":or[0],height:Je?"100%":or[1],overflow:"visible"},onKeyDown:to,children:["production"!==process.env.NODE_ENV&&Nr.current&&Vn(O,{store:Nr.current,diagnostics:Tr.current}),zt&&Vn(j,{tableId:fr}),zt&&Vn(Y,{nodes:ao?.sceneNodes??[],edges:ao?.sceneEdges??[],chartType:"Network chart",tableId:fr,chartTitle:"string"==typeof St?St:void 0}),Vn(X,{summary:Bt}),Vn(W,{hoverPoint:Ir}),Gn("div",{role:"img","aria-label":Ft||("string"==typeof St?St:"Network chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:ot?ro:void 0,onMouseLeave:ot?Fn:void 0,onClick:st||ct?On:void 0,children:[Xr&&!1!==G&&Vn("div",{style:{position:"absolute",inset:0,zIndex:3,background:"var(--semiotic-bg, #fff)"},children:Te(!0,or[0],or[1],G)}),Vn($,{size:or,margin:ir,overflowVisible:!0,children:lr}),Vn("canvas",{ref:no,"aria-label":Z(ao?.sceneNodes?.length??0,ao?.sceneEdges?.length??0,"Network chart"),style:{position:"absolute",top:0,left:0}}),Vn(dn,{width:ar,height:sr,totalWidth:or[0],totalHeight:or[1],margin:ir,labels:ao?.labels||[],sceneNodes:ao?.sceneNodes,title:St,legend:pt,legendPosition:mt,legendLayout:vt,legendHoverBehavior:xt,legendClickBehavior:kt,legendHighlightedCategory:bt,legendIsolatedCategories:_t,foregroundGraphics:a(cr,P(Nr.current?.customLayoutOverlays,Ut??null)),annotations:ht,onAnnotationActivate:ft,onObservation:lt??ct,chartId:ut,chartType:"StreamNetworkFrame",autoPlaceAnnotations:yt,svgAnnotationRules:gt,annotationFrame:Fr}),Vn(gn,{marks:ao?.customLayoutHtmlMarks,margin:ir,selection:Ut??null}),Vn(B,{active:Xn.current>=0,hoverPoint:Ir,margin:ir,size:or,shape:Jn.current?.shape,width:Jn.current?.w,height:Jn.current?.h}),io,Rt?.showBadge&&Vn(n,{isStale:Yr,position:Rt.badgePosition})]})]})}));Jn.displayName="StreamNetworkFrame";var eo=Jn;export{Ht as buildRibbonGeometry,kn as errorFromPayload,bn as parseModuleWorkerErrorField,_n as ModuleWorkerSession,Sn as createSharedWorkerSessionHolder,wn as shouldUseForceWorker,An as canUseForceWorker,Pn as runForceLayoutWorker,eo as StreamNetworkFrame_default};
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{resolveCategoricalPalette as t,resolveExplicitColor as r}from"./chunk-chunk-SK2TQMG4.module.min.js";function e(r,e,n){return t(r,e,n)}function n(t,e){const n=e&&"object"==typeof e&&!Array.isArray(e)?e:void 0;return 0===t.length?t=>n&&r(n,t)||"#4e79a7":e=>{if(n){const t=r(n,e);if(t)return t}let o=0;for(let t=0;e.length>t;t++)o=31*o+e.charCodeAt(t)|0;return t[Math.abs(o)%t.length]??"#4e79a7"}}export{e as resolveCustomLayoutPalette,n as buildResolveColor};