semiotic 3.9.0 → 3.9.2

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 (331) hide show
  1. package/README.md +102 -90
  2. package/agent-skill/semiotic-charts/SKILL.md +14 -10
  3. package/ai/componentMetadata.cjs +13 -3
  4. package/ai/dist/mcp-server.js +140 -36407
  5. package/ai/examples.md +109 -6
  6. package/ai/reference.md +55 -18
  7. package/ai/schema.json +5964 -1190
  8. package/ai/surface-manifest.json +51 -7
  9. package/ai/system-prompt.md +16 -3
  10. package/dist/c-3SCUN5HI.min.js +1 -0
  11. package/dist/c-3VVKFA4M.min.js +1 -0
  12. package/dist/c-43TJZS3F.min.js +1 -0
  13. package/dist/c-4DTZPSUD.min.js +1 -0
  14. package/dist/c-4ES5367Y.min.js +1 -0
  15. package/dist/c-54IRWOGM.min.js +1 -0
  16. package/dist/c-5D2S4RMI.min.js +1 -0
  17. package/dist/c-5JWCTX3G.min.js +1 -0
  18. package/dist/c-6CMMSN6N.min.js +1 -0
  19. package/dist/c-6HRB2L7H.min.js +1 -0
  20. package/dist/c-7W4SV36A.min.js +1 -0
  21. package/dist/c-A4WRGZFX.min.js +1 -0
  22. package/dist/c-AG7WWVIH.min.js +1 -0
  23. package/dist/c-AH6J4MTN.min.js +1 -0
  24. package/dist/c-ALYR5LKK.min.js +1 -0
  25. package/dist/c-BYDPC44I.min.js +1 -0
  26. package/dist/c-CFFIU2MW.min.js +1 -0
  27. package/dist/c-CGNHBHCE.min.js +1 -0
  28. package/dist/c-CJYSXIFV.min.js +1 -0
  29. package/dist/c-CKLIFCGN.min.js +1 -0
  30. package/dist/c-CZF7MV67.min.js +1 -0
  31. package/dist/c-D53OKBSY.min.js +1 -0
  32. package/dist/c-DBQ2V7CH.min.js +1 -0
  33. package/dist/c-DPMVAUAW.min.js +1 -0
  34. package/dist/c-ECJCKLYY.min.js +1 -0
  35. package/dist/c-EGATGOWJ.min.js +1 -0
  36. package/dist/c-EGR6VYBW.min.js +1 -0
  37. package/dist/c-ENF72HU5.min.js +1 -0
  38. package/dist/c-ESNR43AN.min.js +1 -0
  39. package/dist/c-F3LIKINL.min.js +1 -0
  40. package/dist/c-F5ZB5GJ6.min.js +1 -0
  41. package/dist/c-G3VYMHKE.min.js +1 -0
  42. package/dist/c-GR6MOEQC.min.js +1 -0
  43. package/dist/c-GSVCN34B.min.js +1 -0
  44. package/dist/c-GYOQCEFP.min.js +1 -0
  45. package/dist/c-H3DNMTCC.min.js +1 -0
  46. package/dist/c-I6J3FEZE.min.js +1 -0
  47. package/dist/c-IGH6MGJ5.min.js +1 -0
  48. package/dist/c-II2EEAJN.min.js +1 -0
  49. package/dist/c-J6M4JHRS.min.js +1 -0
  50. package/dist/c-JM3MGLQV.min.js +1 -0
  51. package/dist/c-KM3N7F7R.min.js +1 -0
  52. package/dist/c-LF5BZFNC.min.js +1 -0
  53. package/dist/c-LKBSGFQC.min.js +1 -0
  54. package/dist/c-NDJADPIF.min.js +1 -0
  55. package/dist/c-NVPQCIL5.min.js +1 -0
  56. package/dist/c-OFWJBEE5.min.js +1 -0
  57. package/dist/c-OYFHP5F5.min.js +1 -0
  58. package/dist/c-PGKQGGQ2.min.js +1 -0
  59. package/dist/c-Q2IPZ3MU.min.js +1 -0
  60. package/dist/c-QKHMBE2E.min.js +1 -0
  61. package/dist/c-QMVM3AY6.min.js +1 -0
  62. package/dist/c-QSGWX53A.min.js +1 -0
  63. package/dist/c-RJKEKZOO.min.js +1 -0
  64. package/dist/c-SFDIIU5G.min.js +1 -0
  65. package/dist/c-SRTBCRVE.min.js +1 -0
  66. package/dist/c-T6UAIKBH.min.js +1 -0
  67. package/dist/c-TMCTEVVW.min.js +1 -0
  68. package/dist/c-TMOSJLT3.min.js +1 -0
  69. package/dist/c-U6ESPM7V.min.js +1 -0
  70. package/dist/c-UC5PTTFI.min.js +1 -0
  71. package/dist/c-VGKUEZBC.min.js +1 -0
  72. package/dist/c-VN2HG5BS.min.js +1 -0
  73. package/dist/{c-J5G56TUH.min.js → c-VPZDY5Q4.min.js} +1 -1
  74. package/dist/c-VRXUB2F2.min.js +1 -0
  75. package/dist/c-VUBQNQJH.min.js +1 -0
  76. package/dist/c-VUH4PGZY.min.js +1 -0
  77. package/dist/c-XDRV7RKW.min.js +1 -0
  78. package/dist/c-YGZHURXZ.min.js +1 -0
  79. package/dist/components/Annotation.d.ts +1 -1
  80. package/dist/components/access/chartAccessCapabilities.generated.d.ts +14 -0
  81. package/dist/components/access/chartAccessContract.d.ts +90 -0
  82. package/dist/components/access/chartAccessContractFixtures.d.ts +11 -0
  83. package/dist/components/ai/aestheticProfileTypes.d.ts +35 -0
  84. package/dist/components/ai/annotationProvenance.d.ts +2 -7
  85. package/dist/components/ai/auditVisualHierarchy.d.ts +49 -0
  86. package/dist/components/ai/builtInChartRecipeLayouts.d.ts +2 -0
  87. package/dist/components/ai/builtInChartRecipePublic.d.ts +4 -0
  88. package/dist/components/ai/builtInChartRecipes.d.ts +26 -0
  89. package/dist/components/ai/chartCapabilities.d.ts +3 -1
  90. package/dist/components/ai/chartRecipeRegistry.d.ts +2 -1
  91. package/dist/components/ai/chartRecipes.d.ts +6 -0
  92. package/dist/components/ai/colorEvidence.d.ts +12 -0
  93. package/dist/components/ai/evaluateAesthetics.d.ts +47 -0
  94. package/dist/components/ai/geoNavigation.d.ts +4 -0
  95. package/dist/components/ai/hierarchyNavigation.d.ts +4 -0
  96. package/dist/components/ai/navigationTree.d.ts +7 -1
  97. package/dist/components/ai/qualityFixtures.d.ts +8 -0
  98. package/dist/components/ai/suggestionPropContracts.d.ts +1 -1
  99. package/dist/components/ai/useNavigationSync.d.ts +3 -3
  100. package/dist/components/charts/index.d.ts +4 -0
  101. package/dist/components/charts/network/ChordDiagram.d.ts +5 -1
  102. package/dist/components/charts/network/CirclePack.d.ts +8 -1
  103. package/dist/components/charts/network/OrbitDiagram.d.ts +9 -0
  104. package/dist/components/charts/network/TreeDiagram.d.ts +8 -1
  105. package/dist/components/charts/network/Treemap.d.ts +8 -1
  106. package/dist/components/charts/ordinal/BarChart.d.ts +6 -0
  107. package/dist/components/charts/ordinal/BoxPlot.d.ts +3 -0
  108. package/dist/components/charts/ordinal/DonutChart.d.ts +3 -0
  109. package/dist/components/charts/ordinal/DotPlot.d.ts +3 -0
  110. package/dist/components/charts/ordinal/FunnelChart.d.ts +3 -0
  111. package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
  112. package/dist/components/charts/ordinal/Histogram.d.ts +3 -0
  113. package/dist/components/charts/ordinal/LikertChart.d.ts +3 -0
  114. package/dist/components/charts/ordinal/PieChart.d.ts +3 -0
  115. package/dist/components/charts/ordinal/RadarChart.capability.d.ts +2 -0
  116. package/dist/components/charts/ordinal/RadarChart.d.ts +75 -0
  117. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +3 -0
  118. package/dist/components/charts/ordinal/SwarmPlot.d.ts +3 -0
  119. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +3 -0
  120. package/dist/components/charts/ordinal/ViolinPlot.d.ts +3 -0
  121. package/dist/components/charts/physics/GauntletChart.d.ts +1 -5
  122. package/dist/components/charts/physics/chainReactionTypes.d.ts +3 -0
  123. package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
  124. package/dist/components/charts/physics/physicsHocUtils.d.ts +7 -1
  125. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +10 -1
  126. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +11 -1
  127. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +14 -5
  128. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +7 -1
  129. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +7 -1
  130. package/dist/components/charts/realtime/aggregate.d.ts +12 -1
  131. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +4 -2
  132. package/dist/components/charts/realtime/realtimeStyleRules.d.ts +4 -0
  133. package/dist/components/charts/shared/annotationStatusFilter.d.ts +18 -0
  134. package/dist/components/charts/shared/chartDefinitionPilot.d.ts +5 -4
  135. package/dist/components/charts/shared/chartSpecCore.d.ts +2 -2
  136. package/dist/components/charts/shared/heatmapStyleRules.d.ts +13 -0
  137. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  138. package/dist/components/charts/shared/networkUtils.d.ts +14 -0
  139. package/dist/components/charts/shared/selectionUtils.d.ts +3 -1
  140. package/dist/components/charts/shared/types.d.ts +4 -2
  141. package/dist/components/charts/shared/useChartLegend.d.ts +2 -1
  142. package/dist/components/charts/shared/useLikertAggregation.d.ts +8 -2
  143. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +9 -5
  144. package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +1 -1
  145. package/dist/components/charts/shared/useXYBrush.d.ts +24 -0
  146. package/dist/components/charts/xy/Heatmap.d.ts +16 -0
  147. package/dist/components/charts/xy/LineChart.d.ts +9 -0
  148. package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
  149. package/dist/components/charts/xy/WaterfallChart.capability.d.ts +2 -0
  150. package/dist/components/charts/xy/WaterfallChart.d.ts +68 -0
  151. package/dist/components/evidence/chartEvidenceEnvelope.d.ts +146 -0
  152. package/dist/components/evidence/evidenceGate.d.ts +28 -0
  153. package/dist/components/realtime/BinAccumulator.d.ts +5 -1
  154. package/dist/components/realtime/types.d.ts +16 -7
  155. package/dist/components/recipes/adjacencyFlow.d.ts +12 -0
  156. package/dist/components/recipes/adjacencyFlowAggregation.d.ts +72 -0
  157. package/dist/components/recipes/adjacencyFlowGeometry.d.ts +79 -0
  158. package/dist/components/recipes/lineageDag.d.ts +17 -0
  159. package/dist/components/recipes/lineageDagHulls.d.ts +22 -0
  160. package/dist/components/recipes/transitDiagram.d.ts +75 -0
  161. package/dist/components/recipes/transitDiagramGeometry.d.ts +47 -0
  162. package/dist/components/semiotic-access.d.ts +9 -0
  163. package/dist/components/semiotic-ai-audits.d.ts +17 -0
  164. package/dist/components/semiotic-ai-core.d.ts +9 -0
  165. package/dist/components/semiotic-ai.d.ts +5 -17
  166. package/dist/components/semiotic-evidence.d.ts +10 -0
  167. package/dist/components/semiotic-line.d.ts +9 -0
  168. package/dist/components/semiotic-network.d.ts +3 -0
  169. package/dist/components/semiotic-ordinal.d.ts +2 -0
  170. package/dist/components/semiotic-realtime-core.d.ts +3 -2
  171. package/dist/components/semiotic-recipes-core.d.ts +6 -0
  172. package/dist/components/semiotic-themes-core.d.ts +3 -0
  173. package/dist/components/semiotic-utils-core.d.ts +5 -0
  174. package/dist/components/semiotic-utils.d.ts +1 -1
  175. package/dist/components/semiotic-xy.d.ts +3 -0
  176. package/dist/components/semiotic.d.ts +9 -3
  177. package/dist/components/server/renderDashboard.d.ts +37 -0
  178. package/dist/components/server/renderEvidence.d.ts +27 -0
  179. package/dist/components/server/renderToStaticSVG.d.ts +2 -30
  180. package/dist/components/server/serverChartConfigShared.d.ts +13 -0
  181. package/dist/components/server/serverChartConfigs.d.ts +9 -0
  182. package/dist/components/server/serverChartConfigsComposite.d.ts +4 -0
  183. package/dist/components/server/serverChartConfigsCustom.d.ts +2 -0
  184. package/dist/components/server/serverChartConfigsGeo.d.ts +1 -0
  185. package/dist/components/server/serverChartConfigsOrdinal.d.ts +3 -2
  186. package/dist/components/server/serverChartConfigsXY.d.ts +1 -0
  187. package/dist/components/server/serverChartConfigsXYExtra.d.ts +3 -0
  188. package/dist/components/server/serverCompositeChainReaction.d.ts +3 -0
  189. package/dist/components/server/serverOrdinalGauge.d.ts +3 -0
  190. package/dist/components/server/serverOrdinalLikert.d.ts +2 -0
  191. package/dist/components/store/selectionProvenance.d.ts +8 -0
  192. package/dist/components/store/themeCore.d.ts +5 -1
  193. package/dist/components/stream/GeoPipelineStore.d.ts +1 -1
  194. package/dist/components/stream/MarginalGraphics.d.ts +3 -3
  195. package/dist/components/stream/MarginalGraphicsLazy.d.ts +22 -0
  196. package/dist/components/stream/NetworkPipelineStore.d.ts +2 -0
  197. package/dist/components/stream/OrdinalPipelineStore.d.ts +1 -1
  198. package/dist/components/stream/PipelineStore.d.ts +1 -1
  199. package/dist/components/stream/SceneToSVG.d.ts +1 -1
  200. package/dist/components/stream/canvasSetup.d.ts +8 -2
  201. package/dist/components/stream/customLayoutAttempt.d.ts +21 -0
  202. package/dist/components/stream/geoTypes.d.ts +1 -1
  203. package/dist/components/stream/isServerEnvironment.d.ts +6 -0
  204. package/dist/components/stream/layouts/forceLayoutNodeSize.d.ts +12 -0
  205. package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +2 -9
  206. package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +2 -21
  207. package/dist/components/stream/layouts/forceLayoutWorkerPolicy.d.ts +21 -0
  208. package/dist/components/stream/layouts/index.d.ts +6 -12
  209. package/dist/components/stream/layouts/missingPlugin.d.ts +7 -0
  210. package/dist/components/stream/layouts/registerBuiltIn.d.ts +1 -0
  211. package/dist/components/stream/layouts/registry.d.ts +12 -0
  212. package/dist/components/stream/marginalConfig.d.ts +3 -0
  213. package/dist/components/stream/networkCustomLayout.d.ts +7 -0
  214. package/dist/components/stream/networkCustomLayoutOutput.d.ts +13 -0
  215. package/dist/components/stream/networkCustomLayoutRunner.d.ts +1 -1
  216. package/dist/components/stream/networkTypes.d.ts +5 -1
  217. package/dist/components/stream/ordinalTypes.d.ts +1 -1
  218. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +1 -1
  219. package/dist/components/stream/pipelineDomainResolution.d.ts +6 -0
  220. package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +4 -0
  221. package/dist/components/stream/renderers/resolveCSSColor.d.ts +4 -4
  222. package/dist/components/stream/types.d.ts +8 -1
  223. package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +18 -0
  224. package/dist/components/stream/useMarginalValues.d.ts +13 -0
  225. package/dist/components/stream/xyCanvasRenderers.d.ts +4 -4
  226. package/dist/components/stream/xyPlugins/areaPlugin.d.ts +2 -0
  227. package/dist/components/stream/xyPlugins/barPlugin.d.ts +2 -0
  228. package/dist/components/stream/xyPlugins/candlestickPlugin.d.ts +2 -0
  229. package/dist/components/stream/xyPlugins/customPlugin.d.ts +6 -0
  230. package/dist/components/stream/xyPlugins/heatmapPlugin.d.ts +2 -0
  231. package/dist/components/stream/xyPlugins/lineFamily.d.ts +5 -0
  232. package/dist/components/stream/xyPlugins/linePlugin.d.ts +2 -0
  233. package/dist/components/stream/xyPlugins/missingPlugin.d.ts +7 -0
  234. package/dist/components/stream/xyPlugins/mixedPlugin.d.ts +2 -0
  235. package/dist/components/stream/xyPlugins/pointPlugin.d.ts +3 -0
  236. package/dist/components/stream/xyPlugins/registerBuiltIn.d.ts +1 -0
  237. package/dist/components/stream/xyPlugins/registry.d.ts +31 -0
  238. package/dist/components/stream/xyPlugins/stackedAreaPlugin.d.ts +2 -0
  239. package/dist/components/stream/xyPlugins/swarmPlugin.d.ts +2 -0
  240. package/dist/components/stream/xyPlugins/waterfallPlugin.d.ts +2 -0
  241. package/dist/forceLayoutWorker.js +1 -1
  242. package/dist/geo.min.js +1 -1
  243. package/dist/geo.module.min.js +1 -1
  244. package/dist/network.module.min.js +1 -1
  245. package/dist/ordinal.module.min.js +1 -1
  246. package/dist/physics.module.min.js +1 -1
  247. package/dist/rough.module.min.js +1 -1
  248. package/dist/semiotic-access.d.ts +9 -0
  249. package/dist/semiotic-access.min.js +2 -0
  250. package/dist/semiotic-access.module.min.js +2 -0
  251. package/dist/semiotic-ai-core.d.ts +9 -0
  252. package/dist/semiotic-ai-core.min.js +1 -1
  253. package/dist/semiotic-ai-core.module.min.js +1 -1
  254. package/dist/semiotic-ai.d.ts +5 -17
  255. package/dist/semiotic-ai.module.min.js +1 -1
  256. package/dist/semiotic-client-cjs-shared.min.js +1 -1
  257. package/dist/semiotic-client-shared.module.min.js +1 -1
  258. package/dist/semiotic-evidence.d.ts +10 -0
  259. package/dist/semiotic-evidence.min.js +1 -0
  260. package/dist/semiotic-evidence.module.min.js +1 -0
  261. package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
  262. package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
  263. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  264. package/dist/semiotic-experimental-vacp.min.js +1 -1
  265. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  266. package/dist/semiotic-line.d.ts +9 -0
  267. package/dist/semiotic-line.min.js +2 -0
  268. package/dist/semiotic-line.module.min.js +2 -0
  269. package/dist/semiotic-network.d.ts +3 -0
  270. package/dist/semiotic-ordinal.d.ts +2 -0
  271. package/dist/semiotic-realtime-core.d.ts +3 -2
  272. package/dist/semiotic-realtime-core.module.min.js +1 -1
  273. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  274. package/dist/semiotic-recipes-core.d.ts +6 -0
  275. package/dist/semiotic-recipes-core.module.min.js +1 -1
  276. package/dist/semiotic-server-edge-node.module.min.js +1 -1
  277. package/dist/semiotic-server-edge.min.js +1 -1
  278. package/dist/semiotic-server-edge.module.min.js +1 -1
  279. package/dist/semiotic-server-node.min.js +1 -1
  280. package/dist/semiotic-server-node.module.min.js +1 -1
  281. package/dist/semiotic-themes-core.d.ts +3 -0
  282. package/dist/semiotic-themes-core.min.js +1 -1
  283. package/dist/semiotic-themes-core.module.min.js +1 -1
  284. package/dist/semiotic-themes.min.js +1 -1
  285. package/dist/semiotic-themes.module.min.js +1 -1
  286. package/dist/semiotic-utils-core.d.ts +5 -0
  287. package/dist/semiotic-utils-core.min.js +1 -1
  288. package/dist/semiotic-utils-core.module.min.js +1 -1
  289. package/dist/semiotic-utils.d.ts +1 -1
  290. package/dist/semiotic-utils.module.min.js +1 -1
  291. package/dist/semiotic-xy.d.ts +3 -0
  292. package/dist/semiotic.d.ts +9 -3
  293. package/dist/semiotic.module.min.js +1 -1
  294. package/dist/server.min.js +1 -1
  295. package/dist/server.module.min.js +1 -1
  296. package/dist/xy.module.min.js +1 -1
  297. package/package.json +39 -60
  298. package/dist/c-3KZD6AXJ.min.js +0 -1
  299. package/dist/c-4TWEX5HG.min.js +0 -1
  300. package/dist/c-5YCIX3VZ.min.js +0 -1
  301. package/dist/c-6FEKTA3U.min.js +0 -1
  302. package/dist/c-74HEEZGK.min.js +0 -1
  303. package/dist/c-BWNB6USU.min.js +0 -1
  304. package/dist/c-C25ENHIK.min.js +0 -1
  305. package/dist/c-CDR5AO3R.min.js +0 -1
  306. package/dist/c-E3JFRRMI.min.js +0 -1
  307. package/dist/c-EBFPQHHO.min.js +0 -1
  308. package/dist/c-GIKRQI4X.min.js +0 -1
  309. package/dist/c-GPYOFETM.min.js +0 -1
  310. package/dist/c-IDUHYYSI.min.js +0 -1
  311. package/dist/c-JAZ73J32.min.js +0 -1
  312. package/dist/c-KG3NXHAL.min.js +0 -1
  313. package/dist/c-KII3PLZE.min.js +0 -1
  314. package/dist/c-LIXGXMNS.min.js +0 -1
  315. package/dist/c-LVEY6D6B.min.js +0 -1
  316. package/dist/c-M4Y3BHFR.min.js +0 -1
  317. package/dist/c-MAIICR2Z.min.js +0 -1
  318. package/dist/c-MG5DM6VE.min.js +0 -1
  319. package/dist/c-O6U6K4CW.min.js +0 -1
  320. package/dist/c-OQ7M4AGV.min.js +0 -1
  321. package/dist/c-OXYMVK7Q.min.js +0 -1
  322. package/dist/c-QHF5YON3.min.js +0 -1
  323. package/dist/c-RR3GO5SW.min.js +0 -1
  324. package/dist/c-S2BXNNJN.min.js +0 -1
  325. package/dist/c-SUILCHWU.min.js +0 -1
  326. package/dist/c-US5ZFT6E.min.js +0 -1
  327. package/dist/c-UUKVD4WB.min.js +0 -1
  328. package/dist/c-WJCD5EUY.min.js +0 -1
  329. package/dist/c-YDAY2WFR.min.js +0 -1
  330. package/dist/c-ZOWWU34K.min.js +0 -1
  331. /package/dist/{c-COHXCW3Q.min.js → c-YZVRZGX2.min.js} +0 -0
@@ -0,0 +1 @@
1
+ import{getChartRecipe as e,isJsonSafe as r,recipeIntentId as t,resolveChartRecipe as o}from"./c-XDRV7RKW.min.js";var n=["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"],i=new Set(n);function a(e){return i.has(e)}var c=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend","recipe","layout"]),s=new Set(["data","nodes","edges","points","areas","lines","flows"]);function p(e){if(null==e)return e;if("function"==typeof e)return;if("object"!=typeof e)return e;if(e.$$typeof)return;if(Array.isArray(e))return e.map(p).filter(e=>void 0!==e);if(e instanceof Date)return e;const r={};for(const[t,o]of Object.entries(e)){if("function"==typeof o)continue;if(o&&"object"==typeof o&&o.$$typeof)continue;const e=p(o);void 0!==e&&(r[t]=e)}return r}function l(e,r){return!!s.has(e)&&("areas"!==e||"string"!=typeof r)}var f="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function u(i,s,u){const m=e(i)??o(s.recipe)??o(s.recipeId);if(m)return function(e,o,n){const i=function(e,t,o){const n={};for(const[i,a]of Object.entries(e))if(null!=a&&!c.has(i)&&"recipeId"!==i&&(t||!l(i,a)))if("function"==typeof a||a?.$$typeof){if(o)throw Error(`Portable recipe prop "${i}" is not JSON-safe.`)}else if(r(a))n[i]=f(a);else if(o)throw Error(`Portable recipe prop "${i}" is not JSON-safe.`);return n}(o,!1!==n?.includeData,"portable"===e.portability),a=e.intents.map(t).filter(e=>!!e),s={name:e.name,intents:a,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily};if("portable"===e.portability){if(!r(i))throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:i,manifest:s,version:"1",createdAt:(new Date).toISOString(),...n?.selections?{selections:n.selections}:{}}}return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:"Recipe contains or may depend on non-serializable local layout callbacks.",warnings:["This config is inspectable but cannot be rendered remotely by CLI or MCP."],props:i,manifest:s,version:"1",createdAt:(new Date).toISOString(),...n?.selections?{selections:n.selections}:{}}}(m,s,u);if(!a(i))throw Error(`Unknown component "${i}". Known components: ${n.join(", ")}`);const h=!1!==u?.includeData,d={};for(const[e,r]of Object.entries(s))if(null!=r&&!c.has(e)&&(h||!l(e,r))&&"function"!=typeof r&&!r?.$$typeof)try{d[e]=f(p(r))}catch{}return{component:i,props:d,version:"1",createdAt:(new Date).toISOString(),...u?.selections?{selections:u.selections}:{}}}function m(r){if(!r.component||!r.props)throw Error("Invalid chart config: missing component or props");if("ChartRecipe"===r.component||"LocalChartRecipe"===r.component){if(!r.recipeId)throw Error("Invalid chart recipe config: missing recipeId");const t=e(r.recipeId);if(!t)throw Error(`Unknown chart recipe "${r.recipeId}". Register it before deserializing this config.`);if("LocalChartRecipe"!==r.component&&!1!==r.portable&&"portable"!==t.portability)throw Error(`Chart recipe "${r.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...f(r.props),recipeId:r.recipeId}}}if(!a(r.component))throw Error(`Unknown component "${r.component}". This config may require a newer version of semiotic.`);return{componentName:r.component,props:f(r.props)}}function h(e){const r=JSON.stringify(e);return"sc="+btoa(unescape(encodeURIComponent(r))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function d(e){const r=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!r)throw Error("No chart config found in URL (missing 'sc' parameter)");const t=r.replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(escape(atob(t)));return JSON.parse(o)}async function C(e,r="json"){const t="jsx"===r?g(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(t)}function g(e){const{props:r}=e,t=["<"+("LocalChartRecipe"===e.component?"ChartRecipe":e.component)];e.recipeId&&t.push(` recipeId="${e.recipeId}"`);for(const[e,o]of Object.entries(r))if("string"==typeof o)t.push(` ${e}="${o}"`);else if("boolean"==typeof o&&!0===o)t.push(" "+e);else if("boolean"==typeof o&&!1===o)t.push(` ${e}={false}`);else if("number"==typeof o)t.push(` ${e}={${o}}`);else{const r=JSON.stringify(o);t.push(80>r.length?` ${e}={${r}}`:` ${e}={${JSON.stringify(o,null,2)}}`)}return t.push("/>"),t.join("\n")}export{u as toConfig,m as fromConfig,h as toURL,d as fromURL,C as copyConfig,g as configToJSX};
@@ -0,0 +1 @@
1
+ function e(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function a(e,a,r){const f=e=>e.toString(16).padStart(2,"0");return`#${f(e)}${f(a)}${f(r)}`}function r(r){const f=r.map(e),t=f.length-1;return e=>{if(Number.isNaN(e)&&(e=0),0>=e){const[e,r,t]=f[0];return a(e,r,t)}if(e>=1){const[e,r,d]=f[t];return a(e,r,d)}const r=e*t,d=Math.floor(r),n=r-d,[o,c,b]=f[d],[l,i,s]=f[d+1];return a(Math.round(o+(l-o)*n),Math.round(c+(i-c)*n),Math.round(b+(s-b)*n))}}var f=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],t=r(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),d=r(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),n=r(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),o=r(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),c=r(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),b=r(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),l=r(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),i=r(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),s=r(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),u=r(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),g=r(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),y=r(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),h={blues:t,reds:d,greens:n,viridis:l,oranges:o,purples:c,greys:b,plasma:i,inferno:s,magma:u,cividis:g,turbo:y};function p(e){return e&&Object.prototype.hasOwnProperty.call(h,e)?h[e]:t}var m=r(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),k=r(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),w=r(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),v=r(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),A=r(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),q=r(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),O=r(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]);import{scaleOrdinal as j}from"d3-scale";var N={category10:f,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],...h},M=f,P="#007bff";function S(e,a,r=M){if(e&&"object"==typeof e&&!Array.isArray(e)){const a=Object.values(e).filter(e=>"string"==typeof e&&e.length>0);if(a.length>0)return a}if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e){const a=Object.prototype.hasOwnProperty.call(N,e)?N[e]:void 0;if(Array.isArray(a)&&a.length>0)return a}return a&&a.length>0?a:r}var I=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],W=["#f0f0f0","#b5d4ea","#f4c2a1","#b8dab2","#d4b5e0","#f9e0a2","#a8d8d8"],$=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]);function C(e,a,r){if("function"==typeof a){const f=a(e);return r&&f&&"string"==typeof f&&!function(e){const a=e.toLowerCase();return a.startsWith("#")||a.startsWith("rgb")||a.startsWith("hsl")||$.has(a)}(f)?r(f):f}const f=e?.[a]+"";return r?r(f):M[Math.abs(function(e){let a=0;for(let r=0;e.length>r;r++)a=(a<<5)-a+e.charCodeAt(r),a&=a;return Math.abs(a)}(f))%M.length]}function x(e,a){if(null==a||!Object.prototype.hasOwnProperty.call(e,a))return;const r=e[a];return"string"==typeof r&&r.length>0?r:void 0}function z(e,a,r="category10"){if(r&&"object"==typeof r&&!Array.isArray(r)){const e=r;return a=>x(e,a)??"#999"}const f=Array.from(new Set(e.map(e=>e?.[a]).filter(e=>null!=e).map(e=>e+""))),t=f.every(e=>!isNaN(Number(e)));if(Array.isArray(r))return j().domain(f).range(r).unknown("#999");const d=Object.prototype.hasOwnProperty.call(N,r)?N[r]:N.category10;if(t&&"function"==typeof d){let e=-1/0;for(const a of f){const r=Number(a);r>e&&(e=r)}return a=>d(0===e?0:Number(a)/e)}{const e=Array.isArray(d)?d:M;return j().domain(f).range(e).unknown("#999")}}function L(e,a,r=[3,20],f){let t;if(t="function"==typeof a?a(e):e?.[a],!f)return t;const[d,n]=f,[o,c]=r;if(n===d)return(o+c)/2;let b=(t-d)/(n-d);return 0>b?b=0:b>1&&(b=1),o+b*(c-o)}export{f as schemeCategory10,l as interpolateViridis,h as SEQUENTIAL_INTERPOLATORS,p as getSequentialInterpolator,m as interpolateRdBu,k as interpolatePiYG,w as interpolatePRGn,v as interpolateBrBG,A as interpolateRdYlBu,q as interpolateRdYlGn,O as interpolateSpectral,N as COLOR_SCHEMES,M as DEFAULT_COLORS,P as DEFAULT_COLOR,S as resolveCategoricalPalette,I as STREAMING_PALETTE,W as DEPTH_PALETTE_COLORS,C as getColor,x as resolveExplicitColor,z as createColorScale,L as getSize};
@@ -0,0 +1 @@
1
+ function t(t){return"string"==typeof t?{type:t}:t}export{t as normalizeMarginalConfig};
@@ -0,0 +1 @@
1
+ import{MarginalGraphics as e}from"./c-IGH6MGJ5.min.js";import{registerLineFamilyXYPlugins as t,useSeriesFeatures as o,useXYBrush as i,useXYLineStyle as a}from"./c-YGZHURXZ.min.js";import{buildRegressionAnnotation as n}from"./c-SLGMUBUL.min.js";import{normalizePartialMargin as r,useCustomChartSetup as s}from"./c-U6ESPM7V.min.js";import{validateArrayData as l}from"./c-RSVIHIQ4.min.js";import{useChartSetup as c,useFrameImperativeHandle as h,useResolvedSelection as m}from"./c-F5ZB5GJ6.min.js";import{makeHeatmapRuleContext as d}from"./c-A4WRGZFX.min.js";import{bubbleXYPlugin as u,candlestickXYPlugin as p,heatmapXYPlugin as f,scatterXYPlugin as y,stackedAreaXYPlugin as g,waterfallXYPlugin as b}from"./c-VUBQNQJH.min.js";import{customXYPlugin as x}from"./c-I6J3FEZE.min.js";import{DefaultTooltip as v,StreamXYFrame_default as A,provideMarginalGraphics as w}from"./c-J6M4JHRS.min.js";import{areaXYPlugin as S,lineXYPlugin as k,mixedXYPlugin as C,registerXYPlugin as L}from"./c-TMOSJLT3.min.js";import{normalizeColorGradient as R,normalizeGradient as _,normalizeSemanticGradient as H,reverseGradient as I,semanticLineStopsForGradient as P}from"./c-F3LIKINL.min.js";import{accessorName as B,bandTooltipFields as F,buildBaseMetadataProps as D,buildCustomBehaviorProps as N,buildDefaultTooltip as M,buildTooltipProps as W,mergeShapeStyle as T}from"./c-AG7WWVIH.min.js";import{useCustomLayoutSelection as O}from"./c-G36WS6LN.min.js";import{AccessibleDataTable as E,AccessibleTablePortal as j,ChartError as G,DEFAULT_SELECTION_OPACITY as z,FlippingTooltip as V,LinkedCharts as $,MultiPointTooltip as X,SafeRender as Q,ScreenReaderSummary as J,SkipToTableLink as Y,TooltipRoot as q,composeLegendConfigs as U,composeStyleRules as Z,defaultTooltipStyle as K,filterSparseArray as ee,getCrosshairProps as te,isMultiTooltip as oe,isMultiTooltipConfig as ie,makeXYRuleContext as ae,normalizeLinkedBrush as ne,normalizeTooltip as re,renderEmptyState as se,renderLoadingState as le,resolveDefaultFill as ce,resolveMobileInteraction as he,resolveMultiCapableTooltip as me,resolveStyleRules as de,resolveXYFramePropsAxisChrome as ue,useBrushSelection as pe,useChartLegendAndMargin as fe,useChartMode as ye,useChartSelection as ge,useColorScale as be,useLegendInteraction as xe,useSelection as ve,useThemeCategorical as Ae,useThemeSequential as we,warnMissingField as Se,wrapStyleWithSelection as ke}from"./c-VN2HG5BS.min.js";import{useSelectionSelector as Ce,useTheme as Le}from"./c-VRXUB2F2.min.js";import{getMax as Re,getMinMax as _e}from"./c-GGISSW5E.min.js";import{COLOR_SCHEMES as He,DEFAULT_COLOR as Ie,DEFAULT_COLORS as Pe,getColor as Be,getSequentialInterpolator as Fe,getSize as De,interpolateViridis as Ne,resolveExplicitColor as Me}from"./c-EGR6VYBW.min.js";import{resolveCSSColor as We}from"./c-QKHMBE2E.min.js";import{useMemo as Te,useCallback as Oe,forwardRef as Ee,useRef as je}from"react";import{useMemo as Ge}from"react";function ze(e){const{colorBy:t,colorScale:o,color:i,pointRadius:a=5,radiusFn:n,fillOpacity:r=1,fallbackFill:s,baseStyleExtras:l,stroke:c,strokeWidth:h,opacity:m,effectiveSelectionHook:d,resolvedSelection:u,colorDatumAccessor:p,styleRules:f,ruleContext:y}=e,g=Ge(()=>e=>{const c="function"==typeof l?l(e):l,h=c?{...c}:{};if(void 0===h.fillOpacity&&(h.fillOpacity=r),void 0===h.fill)if(t){if(o){const i=p?p(e):e;h.fill=Be(i,t,o)}}else h.fill=s?s(e):i||Ie;return void 0===h.r&&(h.r=n?n(e):a),f&&f.length>0&&Object.assign(h,de(e,f,y?y(e):{value:void 0})),h},[t,o,i,a,n,r,s,l,p,f,y]),b=Ge(()=>T(g,{stroke:c,strokeWidth:h,opacity:m}),[g,c,h,m]);return Ge(()=>ke(b,d??null,u),[b,d,u])}import{useCallback as Ve,useMemo as $e,useRef as Xe,useState as Qe}from"react";function Je(e){const{accessor:t,data:o,isPushMode:i}=e,a=Xe(null),[n,r]=Qe(0),s=Ve(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 n="number"==typeof e?e:Number(e);Number.isFinite(n)&&(a.current?(a.current[0]>n&&(a.current[0]=n,o=!0),n>a.current[1]&&(a.current[1]=n,o=!0)):(a.current=[n,n],o=!0))}o&&r(e=>e+1)},[i,t]),l=Ve(()=>{i&&(a.current=null,r(e=>e+1))},[i]);return{domain:$e(()=>{if(i)return a.current??void 0;if(!t||0===o.length)return;const e="function"==typeof t?t:e=>e[t];let n=1/0,r=-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)&&(n>i&&(n=i),i>r&&(r=i))}return Number.isFinite(n)&&Number.isFinite(r)?[n,r]:void 0},[o,t,i,n]),trackPushed:s,reset:l}}import{jsx as Ye}from"react/jsx-runtime";w(e),L(y);var qe=Ee(function(e,t){const a=je(null),r=ye(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:s,margin:m,className:d,xFormat:u,yFormat:p,xAccessor:f="x",yAccessor:y="y",xScaleType:g,yScaleType:b,colorBy:x,colorScheme:v,styleRules:w,sizeBy:S,sizeRange:k=[3,15],symbolBy:C,symbolMap:L,pointRadius:R=5,pointOpacity:_=.8,tooltip:H,marginalGraphics:I,pointIdAccessor:P,annotations:F,regression:T,forecast:O,anomaly:E,xExtent:j,yExtent:z,frameProps:V={},selection:$,linkedHover:X,linkedBrush:J,brush:Y,onBrush:q,onObservation:U,onClick:Z,hoverHighlight:K,chartId:te,loading:oe,loadingContent:ie,emptyContent:ne,legendInteraction:re,legendPosition:se,color:le,stroke:ce,strokeWidth:he,opacity:me}=e,{width:de,height:pe,enableHover:fe,showGrid:ge,showLegend:be,title:xe,description:ve,summary:Ae,accessibleTable:we,xLabel:ke,yLabel:Ce}=r,Le=Te(()=>ee(s),[s]),Re=void 0===s,{domain:_e,trackPushed:He,reset:Ie}=Je({accessor:S,data:Le,isPushMode:Re}),Pe=Oe(e=>{He([e]),a.current?.push(e)},[He]),Be=Oe(e=>{He(e),a.current?.pushMany(e)},[He]);h(t,{variant:"xy",frameRef:a,overrides:{push:Pe,pushMany:Be,clear:()=>{Ie(),a.current?.clear()}}});const Fe=c({data:Le,rawData:s,colorBy:x,colorScheme:v,legendInteraction:re,legendPosition:se,frameLegend:V,selection:$,linkedHover:X,fallbackFields:x?["string"==typeof x?x:""]:[],unwrapData:!1,onObservation:U,onClick:Z,hoverHighlight:K,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"Scatterplot",chartId:te,showLegend:be,userMargin:m,marginDefaults:r.marginDefaults,loading:oe,loadingContent:ie,emptyContent:ne,width:de,height:pe,hasTitle:!!xe,axisChrome:ue(V,{showAxes:r.showAxes,xLabel:ke,yLabel:Ce})}),{brushStreamProps:Ne}=i({brush:Y,onBrush:q,linkedBrush:J,xAccessor:f,yAccessor:y,defaultDimension:"xy"});Se("Scatterplot",Le,"xAccessor",f),Se("Scatterplot",Le,"yAccessor",y);const Me=Te(()=>S?_e??[0,1]:void 0,[S,_e]),We=Te(()=>S?e=>De(e,S,k,Me):void 0,[S,k,Me]),Ee=Te(()=>ae(f,y),[f,y]),Ge=ze({colorBy:x,colorScale:Fe.colorScale,color:le,pointRadius:R,fillOpacity:_,radiusFn:We,stroke:ce,strokeWidth:he,opacity:me,styleRules:w,ruleContext:Ee,effectiveSelectionHook:Fe.effectiveSelectionHook,resolvedSelection:Fe.resolvedSelection}),Ve=Te(()=>M([{label:ke||B(f),accessor:f,role:"x",format:u},{label:Ce||B(y),accessor:y,role:"y",format:p},...x?[{label:B(x),accessor:x,role:"color"}]:[],...S?[{label:B(S),accessor:S,role:"size"}]:[]]),[f,y,ke,Ce,x,S,u,p]),{effectiveData:$e,statisticalAnnotations:Xe}=o({data:Le,xAccessor:f,yAccessor:y,forecast:O,anomaly:E}),Qe=Te(()=>{const e=n(T);return e||0!==Xe.length?[...e?[e]:[],...F||[],...Xe]:F},[T,F,Xe]);if(Fe.earlyReturn)return Fe.earlyReturn;const qe=l({componentName:"Scatterplot",data:s,accessors:{xAccessor:f,yAccessor:y}});if(qe)return Ye(G,{componentName:"Scatterplot",message:qe,width:de,height:pe});const Ue={chartType:"scatter",...null!=s&&{data:$e},xAccessor:f,yAccessor:y,xScaleType:g,yScaleType:b,colorAccessor:x||void 0,sizeAccessor:S||void 0,...C&&{symbolAccessor:C},...L&&{symbolMap:L},sizeRange:k,pointStyle:Ge,colorScheme:v,size:[de,pe],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Fe.margin,showAxes:r.showAxes,xLabel:ke,yLabel:Ce,xFormat:u,yFormat:p,enableHover:fe,showGrid:ge,...Fe.legendBehaviorProps,...D({title:xe,description:ve,summary:Ae,accessibleTable:we,className:d,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:H,defaultTooltipContent:Ve}),...N({linkedHover:X,selection:$,onObservation:U,onClick:Z,hoverHighlight:K,hoverRadius:e.hoverRadius,mobileInteraction:Fe.mobileInteraction,customHoverBehavior:Fe.customHoverBehavior,customClickBehavior:Fe.customClickBehavior}),...I&&{marginalGraphics:I},...P&&{pointIdAccessor:P},...Qe&&Qe.length>0&&{annotations:Qe},...j&&{xExtent:j},...z&&{yExtent:z},...Ne,...Fe.crosshairProps,...V};return Ye(Q,{componentName:"Scatterplot",width:de,height:pe,children:Ye(A,{ref:a,...Ue})})});qe.displayName="Scatterplot";import{useMemo as Ue,forwardRef as Ze,useRef as Ke}from"react";import{Fragment as et,jsx as tt}from"react/jsx-runtime";function ot(e,t){return Ne(1===t?.5:e/(t-1))}L(y);var it=Ze(function(e,t){const i=Ke(null);h(t,{variant:"xy",frameRef:i});const a=ye(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:s,className:m,xFormat:d,yFormat:u,xAccessor:p="x",yAccessor:f="y",orderAccessor:y,orderLabel:g,styleRules:b,pointRadius:x=4,tooltip:v,pointIdAccessor:w,annotations:S,regression:k,forecast:C,anomaly:L,xExtent:R,yExtent:_,frameProps:H={},selection:I,linkedHover:P,onObservation:F,onClick:T,hoverHighlight:O,chartId:E,loading:j,loadingContent:V,emptyContent:$,legendInteraction:X,stroke:J,strokeWidth:Y,opacity:q}=e,{width:U,height:Z,enableHover:K,showGrid:ee,title:te,description:oe,summary:ie,accessibleTable:ne,xLabel:re,yLabel:se}=a,{safeData:le,orderMap:ce}=Ue(()=>{const e=r||[],t="function"==typeof p?p:e=>e[p],o="function"==typeof f?f:e=>e[f];let i=e;if(y&&e.length>0){const t="function"==typeof y?y:e=>e[y];i=[...e].sort((e,o)=>{const i=t(e),a=t(o);return(i instanceof Date?i.getTime():+i)-(a instanceof Date?a.getTime():+a)})}const a=new WeakMap;let n=0;for(const e of i){const i=t(e),a=o(e);null!=i&&null!=a&&isFinite(i)&&isFinite(a)&&n++}let s=0;for(const e of i){const i=t(e),r=o(e);null!=i&&null!=r&&isFinite(i)&&isFinite(r)&&a.set(e,{idx:s++,total:n})}return{safeData:i,orderMap:a}},[r,y,p,f]);Se("ConnectedScatterplot",le,"xAccessor",p),Se("ConnectedScatterplot",le,"yAccessor",f);const he=c({data:le,rawData:r,colorBy:void 0,colorScheme:void 0,legendInteraction:X,selection:I,linkedHover:P,fallbackFields:[],unwrapData:!1,onObservation:F,onClick:T,hoverHighlight:O,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"ConnectedScatterplot",chartId:E,showLegend:void 0,userMargin:s,marginDefaults:a.marginDefaults,loading:j,loadingContent:V,emptyContent:$,width:U,height:Z,hasTitle:!!te,axisChrome:ue(H,{showAxes:a.showAxes,xLabel:re,yLabel:se})}),me=he.resolvedSelection?.unselectedOpacity??z,de=Ue(()=>(e,t)=>{const o=t.filter(e=>"point"===e.type);if(2>o.length)return;const i=he.effectiveSelectionHook?.isActive,a=he.effectiveSelectionHook?.predicate,n=100>o.length,r=o.length;e.lineCap="round";for(let t=0;r-1>t;t++){const s=o[t],l=o[t+1],c=ot(t,r),h=!i||!a||a(s.datum??s)||a(l.datum??l),m=i?h?1:me:1;n&&(e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(l.x,l.y),e.strokeStyle="white",e.lineWidth=x+2,e.globalAlpha=.5*m,e.stroke()),e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(l.x,l.y),e.strokeStyle=c,e.lineWidth=x,e.globalAlpha=m,e.stroke()}e.globalAlpha=1},[x,he.effectiveSelectionHook,me]),pe=Ue(()=>[de],[de]),fe=Ue(()=>(e,t,o)=>{const i=e.filter(e=>"point"===e.type);if(2>i.length)return null;const a=i.length,n=100>a,r=[];for(let e=0;a-1>e;e++){const t=i[e],o=i[e+1],s=ot(e,a),l=Math.min("number"==typeof t.style?.opacity?t.style.opacity:1,"number"==typeof o.style?.opacity?o.style.opacity:1);n&&r.push(tt("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:"white",strokeWidth:x+2,strokeLinecap:"round",opacity:.5*l},"halo-"+e)),r.push(tt("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:s,strokeWidth:x,strokeLinecap:"round",opacity:l},"seg-"+e))}return tt(et,{children:r})},[x]),ge=Ue(()=>[fe],[fe]),be=ze({colorScale:void 0,baseStyleExtras:Ue(()=>e=>{const t=ce.get(e),o=t?.idx??0,i=t?.total??1;return{fill:i>0?ot(o,i):"#6366f1",stroke:"white",strokeWidth:1,r:x,fillOpacity:1}},[x,ce]),stroke:J,strokeWidth:Y,opacity:q,styleRules:b,ruleContext:Ue(()=>ae(p,f),[p,f]),effectiveSelectionHook:he.effectiveSelectionHook,resolvedSelection:he.resolvedSelection}),xe=g||("string"==typeof y?y:"Order"),ve=Ue(()=>M([{label:re||B(p),accessor:p,role:"x",format:d},{label:se||B(f),accessor:f,role:"y",format:u},...y?[{label:xe,accessor:y,role:"group"}]:[]]),[p,f,re,se,y,xe,d,u]),Ae=l({componentName:"ConnectedScatterplot",data:r,accessors:{xAccessor:p,yAccessor:f}}),{effectiveData:we,statisticalAnnotations:ke}=o({data:le,xAccessor:p,yAccessor:f,forecast:C,anomaly:L});if(he.earlyReturn)return he.earlyReturn;const Ce=n(k),Le=Ce||ke.length>0?[...Ce?[Ce]:[],...S||[],...ke]:S,Re={chartType:"scatter",...null!=r&&{data:we},xAccessor:p,yAccessor:f,pointStyle:be,size:[U,Z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:he.margin,showAxes:a.showAxes,xLabel:re,yLabel:se,xFormat:d,yFormat:u,enableHover:K,showGrid:ee,...D({title:te,description:oe,summary:ie,accessibleTable:ne,className:m,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:v,defaultTooltipContent:ve}),...N({linkedHover:P,selection:I,onObservation:F,onClick:T,hoverHighlight:O,hoverRadius:e.hoverRadius,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...w&&{pointIdAccessor:w},canvasPreRenderers:pe,svgPreRenderers:ge,...Le&&Le.length>0&&{annotations:Le},...R&&{xExtent:R},..._&&{yExtent:_},...he.crosshairProps,...H};return Ae?tt(G,{componentName:"ConnectedScatterplot",message:Ae,width:U,height:Z}):tt(Q,{componentName:"ConnectedScatterplot",width:U,height:Z,children:tt(A,{ref:i,...Re})})});it.displayName="ConnectedScatterplot";import{forwardRef as at,useMemo as nt}from"react";import{jsx as rt}from"react/jsx-runtime";L(x);var st=at(function(e,t){const{data:o,layout:i,layoutConfig:a,onLayoutError:n,xExtent:r,yExtent:l,showAxes:c=!1,margin:h,className:m,annotations:d,onObservation:u,onClick:p,selection:f,linkedHover:y,hoverHighlight:g,chartId:b,loading:x,loadingContent:w,emptyContent:S,colorBy:k,colorScheme:C,legend:L,legendInteraction:R,legendPosition:_,frameProps:H={}}=e,{legend:I,...P}=H,B=nt(()=>U(I,L),[I,L]),{frameRef:F,resolved:M,safeData:W,setup:T,earlyReturn:O}=s({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"XYCustomChart",unwrapData:!1,data:o,colorBy:k,colorScheme:C,legend:B,legendInteraction:R,legendPosition:_,frameLegend:P,selection:f,linkedHover:y,hoverHighlight:g,onObservation:u,onClick:p,chartId:b,loading:x,loadingContent:w,emptyContent:S,margin:h,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=T.effectiveSelectionHook,j=nt(()=>E?.isActive?{isActive:!0,predicate:E.predicate}:null,[E?.isActive,E?.predicate]),G=nt(()=>me({tooltip:e.tooltip,defaultTooltipContent:e=>rt(v,{hover:e})}),[e.tooltip]);if(O)return O;const{width:z,height:V,enableHover:$,showGrid:X,title:J,description:Y,summary:q,accessibleTable:Z,xLabel:K,yLabel:ee}=M,te={chartType:"custom",...null!=o&&{data:W},customLayout:i,layoutConfig:a,onLayoutError:n,...j&&{layoutSelection:j},xExtent:r,yExtent:l,colorAccessor:k,colorScheme:C,size:[z,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:T.margin,showAxes:c,xLabel:K,yLabel:ee,enableHover:$,showGrid:X,...T.legendBehaviorProps,...D({title:J,description:Y,summary:q,accessibleTable:Z,className:m,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G,...N({linkedHover:y,selection:f,onObservation:u,onClick:p,hoverRadius:e.hoverRadius,hoverHighlight:g,mobileInteraction:T.mobileInteraction,customHoverBehavior:T.customHoverBehavior,customClickBehavior:T.customClickBehavior}),...d&&d.length>0&&{annotations:d},...T.crosshairProps,...P};return rt(Q,{componentName:"XYCustomChart",width:z,height:V,children:rt(A,{ref:F,...te})})});function lt(e){return e instanceof Date?"date:"+e.getTime():`${typeof e}:${e+""}`}function ct(e,t,o){return"function"==typeof e?e(t,o):t[e]}function ht(e,t={}){const o=t.xAccessor??"x",i=t.yAccessor??"y",a=t.lineBy??"series",n=t.rankDirection??"descending",r=[],s=new Map,l=new Map,c=[],h=new Map;let m=1/0,d=-1/0;e.forEach((e,t)=>{const n=ct(o,e,t),u=lt(n);let p=s.get(u);null==p&&(p=r.length,s.set(u,p),r.push(n),l.set(p,[]));const f=ct(a,e,t)+"";h.has(f)||(h.set(f,c.length),c.push(f));const y=Number(ct(i,e,t));Number.isFinite(y)&&(m=Math.min(m,y),d=Math.max(d,y),l.get(p)?.push({datum:e,inputIndex:t,series:f,value:y}))});const u=[],p=new Map,f=new Map;for(let e=0;r.length>e;e++){const t=l.get(e)??[];t.sort((e,t)=>("descending"===n?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;u.push({datum:t.datum,xIndex:e,xValue:r[e],series:t.series,value:t.value,rank:i}),p.set(t.series,(p.get(t.series)??0)+i),f.set(t.series,(f.get(t.series)??0)+1)})}const y=c.length+1,g=[...c].sort((e,t)=>{const o=f.get(e)??0,i=f.get(t)??0;return((p.get(e)??0)+(r.length-o)*y)/Math.max(1,r.length)-((p.get(t)??0)+(r.length-i)*y)/Math.max(1,r.length)||(h.get(e)??0)-(h.get(t)??0)}),b=new Set(g.slice(0,null==t.highlightTop?g.length:Math.max(0,Math.floor(t.highlightTop))));return{data:u.map(e=>{const t=b.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:r,seriesOrder:c,overallOrder:g,valueExtent:m===1/0?[0,0]:[m,d]}}st.displayName="XYCustomChart";import{forwardRef as mt,useMemo as dt}from"react";import{useCallback as ut,useMemo as pt}from"react";import{jsx as ft,jsxs as yt}from"react/jsx-runtime";function gt(e,t,o,i,a){const n=1-a;return n*n*n*e+3*n*n*a*t+3*n*a*a*o+a*a*a*i}function bt(e,t,o,i,a){const n=1-a;return 3*n*n*(t-e)+6*n*a*(o-t)+3*a*a*(i-o)}function xt(e,t,o,i,a){const n=[],r=(e.x+t.x)/2;for(let s=0;a>=s;s++){const l=s/a;let c,h,m,d;"linear"===i?(c=e.x+(t.x-e.x)*l,h=e.y+(t.y-e.y)*l,m=t.x-e.x,d=t.y-e.y):(c=gt(e.x,r,r,t.x,l),h=gt(e.y,e.y,t.y,t.y,l),m=bt(e.x,r,r,t.x,l),d=bt(e.y,e.y,t.y,t.y,l)),n.push({x:c,y:h,dx:m,dy:d,radius:e.radius+(t.radius-e.radius)*l,datumIndex:.5>l?o:o+1})}return n}function vt(e,t={}){const o=[],i=[],a=[];if(2>e.length)return{topPath:o,bottomPath:i,datumIndices:a};const n=t.curve??"smooth",r=Math.max(2,Math.floor(t.samplesPerSegment??12));for(let t=0;e.length-1>t;t++){const s=xt(e[t],e[t+1],t,n,r);for(let e=0===t?0:1;s.length>e;e++){const t=s[e],n=Math.hypot(t.dx,t.dy)||1,r=-t.dy/n,l=t.dx/n,c=Math.max(0,t.radius);o.push([t.x+r*c,t.y+l*c]),i.push([t.x-r*c,t.y-l*c]),a.push(t.datumIndex)}}return{topPath:o,bottomPath:i,datumIndices:a}}import{jsx as At}from"react/jsx-runtime";function wt({datum:e,x:t,y:o,side:i,color:a,highlighted:n,labelStyle:r}){const s=O(),l=s.isActive&&!s.predicate(e),c="function"==typeof r?r(e.__bumpRaw):r;return At("text",{className:"semiotic-bump-label",x:t+("end"===i?8:-8),y:o,dy:"0.35em",textAnchor:"end"===i?"start":"end",fill:a,fillOpacity:l?.16:1,fontWeight:n?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 St(e,t,o){const[i,a]=t,[n,r]=o;return a===i?(n+r)/2:n+(r-n)*Math.max(0,Math.min(1,(e-i)/(a-i)))}function kt(e){const t=e.__bumpXValue instanceof Date?e.__bumpXValue.getTime():Number(e.__bumpXValue);return{value:e.__bumpValue,x:Number.isFinite(t)?t:void 0,y:e.__bumpValue,category:e.__bumpSeries}}function Ct(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)),a=[],n=[],r=[];for(const n of i){const i=(o.get(n)??[]).sort((e,t)=>e.x-t.x);if(2>i.length)continue;const s=i[0].__bumpHighlighted,l=(t.colorMap&&Me(t.colorMap,n))??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?St(o.__bumpValue,t.valueExtent,t.ribbonSizeRange)/2:Math.max(.5,t.lineWidth/2)})),m=vt(h,{curve:t.curve,samplesPerSegment:t.samplesPerSegment}),d={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(d,de(i[0].__bumpRaw,t.styleRules,kt(i[0]))),t.areaStyle&&Object.assign(d,t.areaStyle(i[0].__bumpRaw)??{}),void 0!==t.stroke&&(d.stroke=t.stroke),void 0!==t.strokeWidth&&(d.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(d.opacity=t.opacity),a.push({type:"area",topPath:m.topPath,bottomPath:m.bottomPath,style:d,datum:m.datumIndices.map(e=>i[e]),accessibleDatum:i.map(e=>e.__bumpRaw),accessibility:{label:n+" ranking trajectory",tableFields:i.map(e=>e.__bumpRaw)},group:n,interactive:!0}),t.showPoints&&i.forEach((e,o)=>{const i={fill:c,stroke:"none",opacity:s?1:.75};t.styleRules?.length&&Object.assign(i,de(e.__bumpRaw,t.styleRules,kt(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),a.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:`${n}, rank ${e.__bumpRank}, value ${e.__bumpValue}`},pointId:`${n}:${e.x}`})});const u=!0===t.showLabels?"end":t.showLabels,p=(e,o,i)=>{const a=null==t.labelPriorityAccessor?void 0:"function"==typeof t.labelPriorityAccessor?t.labelPriorityAccessor(e.__bumpRaw):Number(e.__bumpRaw[t.labelPriorityAccessor]);r.push({id:`${n}\0${i}`,datum:e,x:h[o].x,y:h[o].y,side:i,rank:e.__bumpRank,highlighted:s,priority:Number.isFinite(a)?a:void 0,color:"string"==typeof d.fill?d.fill:c})};"start"!==u&&"both"!==u||p(i[0],0,"start"),"end"!==u&&"both"!==u&&"auto"!==u||p(i.at(-1),i.length-1,"end")}const s=function(e,t,o,i){const a=Math.max(1,Math.floor(t/18)),n="auto"===o?Number.isFinite(i)&&(i??0)>=0?Math.min(a,Math.floor(i)):a:1/0,r=e.map((e,t)=>({candidate:e,index:t})).sort((e,t)=>(t.candidate.priority??0)-(e.candidate.priority??0)||Number(t.candidate.highlighted)-Number(e.candidate.highlighted)||e.candidate.rank-t.candidate.rank||e.index-t.index),s=[];for(const{candidate:e}of r){if(s.length>=n)break;s.some(t=>t.side===e.side&&14>Math.abs(t.y-e.y))||s.push(e)}return new Set(s.map(e=>e.id))}(r,e.dimensions.plot.height,"auto"!==(!0===t.showLabels?"end":t.showLabels)||"auto",t.maxLabels);for(const e of r)s.has(e.id)&&n.push(At(wt,{datum:e.datum,x:e.x,y:e.y,side:e.side,color:e.color,highlighted:e.highlighted,labelStyle:t.labelStyle},e.id));return{nodes:a,overlays:n.length?At("g",{className:"semiotic-bump-labels",children:n}):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}}}}import{jsx as Lt}from"react/jsx-runtime";var Rt=mt(function(e,t){const o=Ae(),i=Le(),{data:a,xAccessor:n,yAccessor:r,lineBy:s,rankDirection:l="descending",ribbon:c=!1,curve:h="smooth",ribbonSizeRange:m=[4,28],samplesPerSegment:d=12,lineWidth:u=3,highlightTop:p,neutralColor:f,styleRules:y,labelStyle:g,colorScheme:b,ribbonOpacity:x=.82,lineOpacity:v=.9,showPoints:A=!1,pointRadius:w=3,showLabels:S=!0,labelPriorityAccessor:k,maxLabels:C,showAxes:L=!0,showGrid:R=!0,showLegend:_=!1,enableHover:H=!0,hoverHighlight:I=!0,tooltip:P,frameProps:B={},xFormat:F,yFormat:D,onClick:N}=e,M=dt(()=>ht(a,{xAccessor:n,yAccessor:r,lineBy:s,rankDirection:l,highlightTop:p}),[a,n,r,s,l,p]),{axes:W,areaStyle:T,pointStyle:O,...E}=B,j=dt(()=>function(e){const{seriesOrder:t,overallOrder:o,highlightTop:i,color:a,colorScheme:n,neutralColor:r,themeCategorical:s,themeNeutral:l}=e;if(null==i&&null==a)return n;const c=new Set(o.slice(0,null==i?o.length:Math.max(0,Math.floor(i)))),h=new Map,m={};for(const e of t)Object.defineProperty(m,e,{configurable:!0,enumerable:!0,writable:!0,value:a??(c.has(e)?ce(void 0,s,n,e,h):r??l??"#b8bec8")});return m}({seriesOrder:M.seriesOrder,overallOrder:M.overallOrder,highlightTop:p,color:e.color,colorScheme:b,neutralColor:f,themeCategorical:o,themeNeutral:i.colors.textSecondary}),[M.seriesOrder,M.overallOrder,p,e.color,b,f,o,i.colors.textSecondary]),G=dt(()=>({ribbon:c,curve:h,samplesPerSegment:d,ribbonSizeRange:m,valueExtent:M.valueExtent,seriesOrder:M.seriesOrder,lineWidth:u,ribbonOpacity:x,lineOpacity:v,neutralColor:f,color:e.color,colorMap:j&&"object"==typeof j&&!Array.isArray(j)?j:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,styleRules:y,areaStyle:T,pointStyle:O,labelStyle:g,showPoints:A,pointRadius:w,showLabels:S,labelPriorityAccessor:k,maxLabels:C}),[c,h,d,m,M.valueExtent,M.seriesOrder,u,x,v,f,j,e.color,e.stroke,e.strokeWidth,e.opacity,y,T,O,g,A,w,S,k,C]),{tooltip:z,formatX:V}=function({tooltip:e,xValues:t,xFormat:o,yFormat:i}){const a=ut((e,i)=>{if(0===t.length)return"";const a=t[Math.max(0,Math.min(t.length-1,Math.round(Number(e))))];return o?o(a,i):(a instanceof Date?a.toLocaleDateString():a)+""},[o,t]),n=ut(e=>i?i(e):e.toLocaleString(),[i]),r=oe(e),s=pt(()=>r?void 0:re(e),[r,e]),l=ut(t=>{const o=t?.data??t;return o&&!1!==e?s?s({...t,data:o.__bumpRaw,__semioticHoverData:!0}):yt(q,{children:[ft("div",{style:{fontWeight:700},children:o.__bumpSeries}),yt("div",{children:[a(o.x)," · Rank ",o.__bumpRank]}),yt("div",{children:["Value: ",n(o.__bumpValue)]})]}):null},[n,a,s,e]),c=ut(t=>{const o=(Array.isArray(t.allSeries)?t.allSeries:[]).map(e=>{const t=e.datum;return{...e,value:t?.__bumpValue??e.value,rank:t?.__bumpRank,datum:t?.__bumpRaw??e.datum}}),i=t?.data??t,r={...i?.__bumpRaw??{},xValue:i?.__bumpXValue??t.xValue,allSeries:o};if(ie(e)&&"function"==typeof e.content)return e.content(r);const s=t.xValue??i?.x;return yt(q,{children:[null!=s&&ft("div",{style:{fontWeight:700,marginBottom:4},children:a(s)}),o.map((e,t)=>yt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[ft("span",{style:{width:8,height:8,borderRadius:"50%",background:e.color,flexShrink:0}}),ft("span",{style:{flex:1},children:e.group}),yt("span",{children:[null!=e.rank?`Rank ${e.rank} · `:"",n(e.value)]})]},`${e.group}-${t}`))]})},[n,a,e]);return{tooltip:pt(()=>!1!==e&&(r?{mode:"multi",content:c}:l),[r,c,l,e]),formatX:a}}({tooltip:P,xValues:M.xValues,xFormat:F,yFormat:D}),$=dt(()=>{if(N)return(e,t)=>{N(e.__bumpRaw??e,t)}},[N]),X=Math.max(1,M.seriesOrder.length),Q=M.xValues.map((e,t)=>t),J=Array.from({length:X},(e,t)=>t+1),Y=W??[{orient:"left",tickValues:J,tickFormat:e=>e+"",label:e.yLabel??"Rank",baseline:!1},{orient:"bottom",tickValues:Q,tickFormat:V,label:e.xLabel,tickAnchor:"edges"}],U=dt(()=>function(e,t){if(!e?.length)return;const o=new Map(t.map((e,t)=>[lt(e),t]));return e.map(e=>{const t={...e},i=i=>{if(!(i in e))return;const a=o.get(lt(e[i]));void 0!==a&&(t[i]=a)};return i("x"),i("x0"),i("x1"),"string"!=typeof e.type||"x-threshold"!==e.type&&"x"!==e.type||i("value"),t})}(e.annotations,M.xValues),[e.annotations,M.xValues]);return Lt(st,{ref:t,data:M.data,layout:Ct,layoutConfig:G,xExtent:[0,Math.max(1,M.xValues.length-1)],yExtent:[X+.5,.5],showAxes:L,showGrid:R,showLegend:_,enableHover:H,hoverHighlight:I,colorBy:"__bumpSeries",colorScheme:j,tooltip:z,onClick:$,hoverRadius:e.hoverRadius,width:e.width,height:e.height,responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,responsiveRules:e.responsiveRules,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,mode:e.mode,margin:e.margin??{top:20,right:S?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:U,xLabel:e.xLabel,yLabel:e.yLabel??"Rank",frameProps:{axes:Y,axisExtent:"exact",...E}})});Rt.displayName="BumpChart";import{useMemo as _t,forwardRef as Ht,useRef as It}from"react";import{useMemo as Pt}from"react";function Bt(e){const{safeData:t,data:o,areaBy:i,lineDataAccessor:a,colorBy:n,colorScale:r,color:s,stroke:l,strokeWidth:c,opacity:h,effectiveSelectionHook:m,resolvedSelection:d,areaOpacity:u,showLine:p,lineWidth:f,showPoints:y,pointRadius:g,xAccessor:b,yAccessor:x,xLabel:v,yLabel:A,xFormat:w,yFormat:S,groupField:k,styleRules:C,ruleContext:L}=e,R=Pt(()=>function({data:e,safeData:t,areaBy:o,lineDataAccessor:i}){if(null==e)return[];const a=void 0!==t[0]?.[i];if(!a&&!o)return t;let n;if(a)n=t;else{const e=t.reduce((e,t)=>{const a="function"==typeof o?o(t):t[o],n=a+"";if(!e[n]){const t={[i]:[]};"string"==typeof o&&(t[o]=a),e[n]=t}return e[n][i].push(t),e},{});n=Object.values(e)}return n.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:o,safeData:t,areaBy:i,lineDataAccessor:a}),[o,t,i,a]),_=Pt(()=>e=>{const t={};if(n){if(r){const o=Be(e,n,r);t.fill=o,p?(t.stroke=o,t.strokeWidth=f):t.stroke="none"}}else{const e=s||Ie;t.fill=e,p?(t.stroke=e,t.strokeWidth=f):t.stroke="none"}return t.fillOpacity=u,C&&C.length>0&&Object.assign(t,de(e,C,L?L(e):{value:void 0})),t},[n,r,s,u,p,f,C,L]),H=Pt(()=>T(_,{stroke:l,strokeWidth:c,opacity:h}),[_,l,c,h]);return{flattenedData:R,lineStyle:Pt(()=>ke(H,m??null,d),[H,m,d]),pointStyle:Pt(()=>{if(y)return e=>{const t={r:g,fillOpacity:1};return n?r&&(t.fill=Be(e.parentLine||e,n,r)):t.fill=s||Ie,t}},[y,g,n,r,s]),defaultTooltipContent:Pt(()=>M([{label:v||B(b),accessor:b,role:"x",format:w},{label:A||B(x),accessor:x,role:"y",format:S},...k?[{label:B(k),accessor:k,role:"group"}]:[],...F(e.band,S)]),[b,x,v,A,k,w,S,e.band])}}import{jsx as Ft}from"react/jsx-runtime";L(S);var Dt=Ht(function(e,t){const i=It(null);h(t,{variant:"xy",frameRef:i});const a=ye(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:n,margin:r,className:s,xFormat:m,yFormat:d,xAccessor:u="x",yAccessor:p="y",areaBy:f,y0Accessor:y,gradientFill:g=!1,semanticGradient:b,semanticLine:x=!0,lineDataAccessor:v="coordinates",colorBy:w,colorScheme:S,styleRules:k,curve:C="monotoneX",areaOpacity:L=.7,lineGradient:B,showLine:F=!0,lineWidth:M=2,showPoints:W=!1,pointRadius:T=3,tooltip:O,annotations:E,forecast:j,anomaly:z,band:V,xExtent:$,yExtent:J,frameProps:Y={},selection:q,linkedHover:U,onObservation:Z,onClick:K,hoverHighlight:te,chartId:oe,loading:ie,loadingContent:ne,emptyContent:re,legendInteraction:se,legendPosition:le,color:ce,stroke:he,strokeWidth:de,opacity:pe}=e,{width:fe,height:ge,enableHover:be,showGrid:xe,showLegend:ve,title:Ae,description:we,summary:ke,accessibleTable:Ce,xLabel:Le,yLabel:Re}=a,_e=_t(()=>ee(n),[n]),He=w||f,Ie=_t(()=>H(b),[b]),Pe=_t(()=>Ie?.stops.length?I(Ie):_(g),[Ie,g]),Be=_t(()=>R(B),[B]),Fe=_t(()=>x?P(Ie):void 0,[Ie,x]);Se("AreaChart",_e,"xAccessor",u),Se("AreaChart",_e,"yAccessor",p);const De=c({data:_e,rawData:n,colorBy:He,colorScheme:S,legendInteraction:se,legendPosition:le,frameLegend:Y,selection:q,linkedHover:U,fallbackFields:He?["string"==typeof He?He:""]:[],unwrapData:!1,onObservation:Z,onClick:K,hoverHighlight:te,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"AreaChart",chartId:oe,showLegend:ve,userMargin:r,marginDefaults:a.marginDefaults,loading:ie,loadingContent:ne,emptyContent:re,width:fe,height:ge,hasTitle:!!Ae,axisChrome:ue(Y,{showAxes:a.showAxes,xLabel:Le,yLabel:Re})}),{effectiveData:Ne,statisticalAnnotations:Me}=o({data:_e,xAccessor:u,yAccessor:p,forecast:j,anomaly:z,groupBy:f}),We=_t(()=>ae(u,p),[u,p]),{flattenedData:Te,lineStyle:Oe,pointStyle:Ee,defaultTooltipContent:je}=Bt({safeData:Ne,data:n,areaBy:f,lineDataAccessor:v,colorBy:He,colorScale:De.colorScale,color:ce,stroke:he,strokeWidth:de,opacity:pe,effectiveSelectionHook:De.effectiveSelectionHook,resolvedSelection:De.resolvedSelection,areaOpacity:L,showLine:F,lineWidth:M,showPoints:W,pointRadius:T,xAccessor:u,yAccessor:p,xLabel:Le,yLabel:Re,xFormat:m,yFormat:d,groupField:f||w,band:V,styleRules:k,ruleContext:We}),Ge=l({componentName:"AreaChart",data:n,accessors:{xAccessor:u,yAccessor:p}}),ze={chartType:"area",...null!=n&&{data:Te},xAccessor:u,yAccessor:p,groupAccessor:f||void 0,...y&&{y0Accessor:y},...V&&{band:V},...Pe&&{gradientFill:Pe},...Be&&{lineGradient:Be},...Fe&&{semanticLineStops:Fe},curve:C,lineStyle:Oe,...W&&Ee&&{pointStyle:Ee},size:[fe,ge],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:De.margin,showAxes:a.showAxes,xLabel:Le,yLabel:Re,xFormat:m,yFormat:d,enableHover:be,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:xe,...De.legendBehaviorProps,...D({title:Ae,description:we,summary:ke,accessibleTable:Ce,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...me({tooltip:O,defaultTooltipContent:je,multiDefaultContent:X()}),...N({linkedHover:U,selection:q,onObservation:Z,onClick:K,hoverHighlight:te,hoverRadius:e.hoverRadius,mobileInteraction:De.mobileInteraction,customHoverBehavior:De.customHoverBehavior,customClickBehavior:De.customClickBehavior}),...(E&&E.length>0||Me.length>0)&&{annotations:[...E||[],...Me]},...$&&{xExtent:$},...J&&{yExtent:J},...De.crosshairProps,...Y};return De.earlyReturn?De.earlyReturn:Ge?Ft(G,{componentName:"AreaChart",message:Ge,width:fe,height:ge}):Ft(Q,{componentName:"AreaChart",width:fe,height:ge,children:Ft(A,{ref:i,...ze})})});Dt.displayName="AreaChart";import{useMemo as Nt,forwardRef as Mt,useRef as Wt,useState as Tt,useImperativeHandle as Ot,useCallback as Et}from"react";import{jsx as jt,jsxs as Gt}from"react/jsx-runtime";function zt(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}L(C);var Vt=Mt(function(e,t){const o=Wt(null),i=ye(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:n,className:r,xFormat:s,yFormat:l,xAccessor:h="x",seriesAAccessor:m="a",seriesBAccessor:d="b",seriesALabel:u="A",seriesBLabel:p="B",seriesAColor:f="var(--semiotic-danger, #dc2626)",seriesBColor:y="var(--semiotic-info, #2563eb)",showLines:g=!0,lineWidth:b=1.5,showPoints:x=!1,pointRadius:v=3,curve:w="linear",areaOpacity:S=.6,gradientFill:k,tooltip:C,annotations:L,xExtent:R,yExtent:H,frameProps:I={},selection:P,linkedHover:B,onObservation:F,onClick:M,hoverHighlight:W,chartId:T,loading:O,loadingContent:E,emptyContent:j,legendInteraction:G,legendPosition:z,pointIdAccessor:V,windowSize:$}=e,{width:X,height:J,enableHover:Y,showGrid:q,showLegend:U,title:Z,description:te,summary:oe,accessibleTable:ie,xLabel:ae,yLabel:ne}=i,re=Nt(()=>"function"==typeof h?e=>zt(h(e)):e=>zt(e[h]),[h]),se=Nt(()=>"function"==typeof m?e=>zt(m(e)):e=>zt(e[m]),[m]),le=Nt(()=>"function"==typeof d?e=>zt(d(e)):e=>zt(e[d]),[d]),[ce,he]=Tt([]),de=Wt([]),pe=null==a,fe=Nt(()=>ee(pe?ce:a),[pe,ce,a]),ge=Nt(()=>function(e,t,o,i){if(!e.length)return[];const a=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),n=[];let r=0,s=null,l=null,c=[];const h=(e,t)=>e>t?"A":t>e?"B":null,m=e=>`seg-${r}-${e}`,d=e=>n.push(e),u=(e,t)=>{d({__x:e.x,__y:e.y,__y0:e.y,__diffSegment:m(t),__diffWinner:t,__valA:e.y,__valB:e.y,__sourceDatum:e.datum})};for(let e=0;a.length>e;e++){const n=a[e],p=t(n),f=o(n),y=i(n);if(!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(y))continue;const g=h(f,y);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=f-l.a-(y-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*(f-l.a)}else e=l.x,t=l.a}d({__x:e,__y:t,__y0:t,__diffSegment:m(s),__diffWinner:s,__valA:t,__valB:t}),r++,s=g,d({__x:e,__y:t,__y0:t,__diffSegment:m(s),__diffWinner:s,__valA:t,__valB:t});for(let e=1;c.length>e;e++)u(c[e],s)}else for(const e of c)u(e,s);c=[],d({__x:p,__y:y>f?y:f,__y0:y>f?f:y,__diffSegment:m(s),__diffWinner:s,__valA:f,__valB:y,__sourceDatum:n}),l={x:p,a:f,b:y,w:g}}else{s=g;for(const e of c)u(e,s);c=[],d({__x:p,__y:y>f?y:f,__y0:y>f?f:y,__diffSegment:m(s),__diffWinner:s,__valA:f,__valB:y,__sourceDatum:n}),l={x:p,a:f,b:y,w:g}}else c.push({x:p,y:f,datum:n})}for(const e of c)u(e,s??"A");return n}(fe,re,se,le),[fe,re,se,le]),be=Nt(()=>g?function(e,t,o,i){if(!e.length)return[];const a=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),n=[];for(const e of a){const a=t(e),r=o(e),s=i(e);Number.isFinite(r)&&n.push({__x:a,__y:r,__diffSegment:"line-A",__diffWinner:"A"}),Number.isFinite(s)&&n.push({__x:a,__y:s,__diffSegment:"line-B",__diffWinner:"B"})}return n}(fe,re,se,le):[],[g,fe,re,se,le]),xe=Nt(()=>[...ge,...be],[ge,be]),ve=Nt(()=>{const e=new Set;for(const t of ge)e.add(t.__diffSegment);return Array.from(e)},[ge]);Ot(t,()=>{const e=e=>{const t=$&&e.length>$?e.slice(e.length-$):e;de.current=t,he(t)},t=V?"function"==typeof V?V:e=>e[V]:null;return{push:t=>e([...de.current,t]),pushMany:t=>e([...de.current,...t]),remove:o=>{if(!t)return[];const i=Array.isArray(o)?o:[o],a=[],n=[];for(const e of de.current)i.includes(t(e))?a.push(e):n.push(e);return e(n),a},update:(o,i)=>{if(!t)return[];const a=Array.isArray(o)?o:[o],n=[],r=de.current.map(e=>{if(a.includes(t(e))){const t=i(e);return n.push(t),t}return e});return e(r),n},clear:()=>e([]),getData:()=>pe?de.current:fe,getScales:()=>o.current?.getScales()??null}},[pe,fe,V,$]);const Ae=Nt(()=>{if(!1!==U)return{legendGroups:[{label:"",type:"fill",styleFn:e=>({fill:e.color||"currentColor"}),items:[{label:u,color:f},{label:p,color:y}]}]}},[U,u,p,f,y]),we=Object.hasOwn(I,"legend")?I:{...I,legend:Ae},Se=c({data:fe,rawData:a,colorBy:"__diffWinner",colorScheme:[f,y],legendInteraction:G,legendPosition:z,frameLegend:we,selection:P,linkedHover:B,fallbackFields:["__diffWinner"],unwrapData:!1,onObservation:F,onClick:M,hoverHighlight:W,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DifferenceChart",chartId:T,showLegend:U,userMargin:n,marginDefaults:i.marginDefaults,loading:O,loadingContent:E,emptyContent:j,width:X,height:J,hasTitle:!!Z,axisChrome:ue(I,{showAxes:i.showAxes,xLabel:ae,yLabel:ne})}),Ce=Et(e=>{const t=e.__diffSegment;return{fill:"A"==(t?.endsWith("-A")?"A":"B")?f:y,stroke:"none",fillOpacity:S}},[f,y,S]),Le=Et(e=>({stroke:"A"==("line-A"===e.__diffSegment?"A":"B")?f:y,strokeWidth:b,fill:"none"}),[f,y,b]),Re=Et(e=>({fill:"A"==("line-A"===e.__diffSegment?"A":"B")?f:y,r:v}),[f,y,v]),[_e,He,Ie]=Nt(()=>[Ce,Le,Re].map(e=>ke(e,Se.effectiveSelectionHook,Se.resolvedSelection)),[Ce,Le,Re,Se.effectiveSelectionHook,Se.resolvedSelection]),Pe=Et(e=>{const t=e.data,o=e.allSeries,i=e.xValue??t?.__x;let a=t?.__valA,n=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)&&(a=e.value),null!=t?.value&&Number.isFinite(t.value)&&(n=t.value)}if(null!=i&&(null==a||null==n)){const e=fe.find(e=>re(e)===i);e&&(null==a&&(a=se(e)),null==n&&(n=le(e)))}const r=e=>null!=e&&Number.isFinite(e)?""+Math.round(100*e)/100:"—",l=s&&null!=i?s(i):null!=i?i+"":"";return Gt("div",{className:"semiotic-tooltip",style:K,children:[l&&jt("div",{style:{fontWeight:600,marginBottom:4},children:l}),Gt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[jt("span",{style:{width:10,height:10,background:f,display:"inline-block",borderRadius:2}}),Gt("span",{children:[u,": ",r(a)]})]}),Gt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[jt("span",{style:{width:10,height:10,background:y,display:"inline-block",borderRadius:2}}),Gt("span",{children:[p,": ",r(n)]})]}),null!=a&&null!=n&&Number.isFinite(a)&&Number.isFinite(n)&&Gt("div",{style:{marginTop:4,opacity:.7},children:["Δ = ",r(a-n)]})]})},[fe,re,se,le,s,f,y,u,p]),{tooltipContent:Be,tooltipMode:Fe}=Nt(()=>me({tooltip:C,defaultTooltipContent:Pe,multiDefaultContent:Pe}),[C,Pe]),De=Nt(()=>_(k,{stops:[{offset:0,opacity:.85},{offset:1,opacity:.15}]}),[k]);if(Se.earlyReturn)return Se.earlyReturn;const Ne={chartType:"mixed",data:xe,xAccessor:"__x",yAccessor:"__y",y0Accessor:"__y0",groupAccessor:"__diffSegment",areaGroups:ve,curve:w,areaStyle:_e,lineStyle:He,...x&&{pointStyle:Ie},size:[X,J],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Se.margin,showAxes:i.showAxes,xLabel:ae,yLabel:ne,xFormat:s,yFormat:l,enableHover:Y,showGrid:q,...De&&{gradientFill:De},...Se.legendBehaviorProps,...D({title:Z,description:te,summary:oe,accessibleTable:ie,className:r,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),tooltipContent:Be,..."multi"===Fe&&{tooltipMode:"multi"},...N({linkedHover:B,selection:P,onObservation:F,onClick:M,hoverHighlight:W,hoverRadius:e.hoverRadius,mobileInteraction:Se.mobileInteraction,customHoverBehavior:Se.customHoverBehavior,customClickBehavior:Se.customClickBehavior}),...L&&L.length>0&&{annotations:L},...R&&{xExtent:R},...H&&{yExtent:H},...Se.crosshairProps,...I};return jt(Q,{componentName:"DifferenceChart",width:X,height:J,children:jt(A,{ref:o,...Ne})})});"function"==typeof Vt&&(Vt.displayName="DifferenceChart");import{useMemo as $t,forwardRef as Xt,useRef as Qt}from"react";import{jsx as Jt}from"react/jsx-runtime";L(g);var Yt=Xt(function(e,t){const o=Qt(null),i=ye(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:n,className:r,xFormat:s,yFormat:m,xAccessor:d="x",yAccessor:u="y",areaBy:p,lineDataAccessor:f="coordinates",colorBy:y,colorScheme:g,styleRules:b,curve:x="monotoneX",areaOpacity:v=.7,showLine:w=!0,lineWidth:S=2,showPoints:k=!1,pointRadius:C=3,normalize:L=!1,baseline:R="zero",stackOrder:_,tooltip:H,annotations:I,xExtent:P,yExtent:B,frameProps:F={},selection:M,linkedHover:W,onObservation:T,onClick:O,hoverHighlight:E,chartId:j,loading:z,loadingContent:V,emptyContent:$,legendInteraction:J,legendPosition:Y,color:q,stroke:U,strokeWidth:Z,opacity:K}=e,{width:te,height:oe,enableHover:ie,showGrid:ne,showLegend:re,title:se,description:le,summary:ce,accessibleTable:he,xLabel:de,yLabel:pe}=i,fe=$t(()=>ee(a),[a]),ge=y||p;h(t,{variant:"xy",frameRef:o});const be=c({data:fe,rawData:a,colorBy:ge,colorScheme:g,legendInteraction:J,legendPosition:Y,frameLegend:F,selection:M,linkedHover:W,fallbackFields:ge?["string"==typeof ge?ge:""]:[],unwrapData:!1,onObservation:T,onClick:O,hoverHighlight:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"StackedAreaChart",chartId:j,showLegend:re,userMargin:n,marginDefaults:i.marginDefaults,loading:z,loadingContent:V,emptyContent:$,width:te,height:oe,hasTitle:!!se,axisChrome:ue(F,{showAxes:i.showAxes,xLabel:de,yLabel:pe})}),xe=$t(()=>ae(d,u),[d,u]),{flattenedData:ve,lineStyle:Ae,pointStyle:we,defaultTooltipContent:Se}=Bt({safeData:fe,data:a,areaBy:p,lineDataAccessor:f,colorBy:ge,colorScale:be.colorScale,color:q,stroke:U,strokeWidth:Z,opacity:K,effectiveSelectionHook:be.effectiveSelectionHook,resolvedSelection:be.resolvedSelection,areaOpacity:v,showLine:w,lineWidth:S,showPoints:k,pointRadius:C,xAccessor:d,yAccessor:u,xLabel:de,yLabel:pe,xFormat:s,yFormat:m,groupField:p||y,styleRules:b,ruleContext:xe}),ke=l({componentName:"StackedAreaChart",data:a,accessors:{xAccessor:d,yAccessor:u}}),Ce={chartType:"stackedarea",...null!=a&&{data:ve},xAccessor:d,yAccessor:u,groupAccessor:p||void 0,curve:x,normalize:L,baseline:L?"zero":R,stackOrder:_,lineStyle:Ae,...k&&we&&{pointStyle:we},size:[te,oe],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be.margin,showAxes:i.showAxes,xLabel:de,yLabel:pe,xFormat:s,yFormat:m,enableHover:ie,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:ne,...be.legendBehaviorProps,...D({title:se,description:le,summary:ce,accessibleTable:he,className:r,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...me({tooltip:H,defaultTooltipContent:Se,multiDefaultContent:X()}),...N({linkedHover:W,selection:M,onObservation:T,onClick:O,hoverHighlight:E,hoverRadius:e.hoverRadius,mobileInteraction:be.mobileInteraction,customHoverBehavior:be.customHoverBehavior,customClickBehavior:be.customClickBehavior}),...I&&I.length>0&&{annotations:I},...P&&{xExtent:P},...B&&{yExtent:B},...be.crosshairProps,...F};return be.earlyReturn?be.earlyReturn:ke?Jt(G,{componentName:"StackedAreaChart",message:ke,width:te,height:oe}):Jt(Q,{componentName:"StackedAreaChart",width:te,height:oe,children:Jt(A,{ref:o,...Ce})})});Yt.displayName="StackedAreaChart";import{useMemo as qt,forwardRef as Ut,useRef as Zt}from"react";import{scaleSequential as Kt}from"d3-scale";import{jsx as eo}from"react/jsx-runtime";L(f);var to=Ut(function(e,t){const o=Zt(null);h(t,{variant:"xy",frameRef:o});const i=ye(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:a,margin:n,className:r,xAccessor:s="x",yAccessor:c="y",valueAccessor:u="value",xFormat:p,yFormat:f,colorScheme:y,customColorScale:g,showValues:b=!1,valueFormat:x,cellBorderColor:v="#fff",cellBorderWidth:w=1,tooltip:S,annotations:k,heatmapAggregation:C,heatmapXBins:L,heatmapYBins:R,styleRules:_,xExtent:H,yExtent:I,frameProps:P={},selection:F,linkedHover:T,onObservation:O,onClick:E,hoverHighlight:j,chartId:z,loading:V,loadingContent:$,emptyContent:X,showLegend:J,legendPosition:Y,legend:q,legendInteraction:U}=e,{width:K,height:oe,enableHover:ie,title:ae,description:ne,summary:re,accessibleTable:ce,xLabel:he,yLabel:me}=i,de=le(V,K,oe,$),pe=de?null:se(a,K,oe,X),be=qt(()=>ee(a),[a]),ve=we(),Ae=("string"==typeof P.colorScheme?P.colorScheme:void 0)??y??ve??"blues",Se="function"==typeof P.heatmapColorScale?P.heatmapColorScale:"custom"===Ae&&"function"==typeof g?g:void 0,Ce=J??!1,Le=Y??"right",{activeSelectionHook:Re,customHoverBehavior:He,customClickBehavior:Ie,crosshairSourceId:Pe}=ge({selection:F,linkedHover:T,fallbackFields:[],onObservation:O,onClick:E,chartType:"Heatmap",chartId:z,hoverHighlight:j,colorByField:void 0,mobileInteraction:i.mobileInteraction}),Be=m(F),De=te(T,Pe);xe(U,void 0,[]);const Ne=qt(()=>"function"==typeof u?e=>u(e):e=>e[u],[u]),Me=qt(()=>{const e=be.map(Ne);return _e(e)},[be,Ne]),We=qt(()=>{if(Se)return Se;const e=Fe(Ae);return Kt(e).domain(Me)},[Ae,Se,Me]),Te=qt(()=>{const e=Number.isFinite(w)?Math.max(0,w):1;return()=>({stroke:v,strokeWidth:e})},[v,w]),Oe=qt(()=>d(s,c,u),[s,c,u]),Ee=qt(()=>Z(Te,_,Oe),[Te,_,Oe]),je=qt(()=>ke(Ee,Re,Be),[Re,Ee,Be]),Ge=qt(()=>M([{label:he||B(s),accessor:s,role:"x",format:p},{label:me||B(c),accessor:c,role:"y",format:f},{label:B(u),accessor:u,role:"value",format:x}]),[s,c,he,me,u,p,f,x]),ze=l({componentName:"Heatmap",data:a,accessors:{xAccessor:s,yAccessor:c,valueAccessor:u}}),Ve=qt(()=>{if(Ce)return{gradient:{colorFn:e=>We(e),domain:Me,label:"string"==typeof u?u:"value",format:x},legendDistance:q?.legendDistance}},[Ce,We,Me,u,x,q?.legendDistance]),{margin:$e,legend:Xe,legendPosition:Qe,legendMarginReserved:Je}=fe({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:Le,userMargin:n,defaults:i.marginDefaults,additionalLegend:Ve,chartWidth:K,chartHeight:oe,legendLayout:P.legendLayout,frameLegend:P,hasTitle:!!ae,axisChrome:ue(P,{showAxes:i.showAxes,xLabel:he,yLabel:me})}),Ye={chartType:"heatmap",...null!=a&&{data:be},xAccessor:s,yAccessor:c,valueAccessor:u,colorScheme:"custom"!==Ae?Ae:void 0,...Se&&{heatmapColorScale:Se},areaStyle:je,showValues:b,heatmapValueFormat:x,size:[K,oe],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:$e,showAxes:i.showAxes,xLabel:he,yLabel:me,xFormat:p,yFormat:f,enableHover:ie,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Xe&&{legend:Xe,legendPosition:Qe},...Je&&{__legendMarginReservedFor:Xe},...D({title:ae,description:ne,summary:re,accessibleTable:ce,className:r,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:S,defaultTooltipContent:Ge}),...N({linkedHover:T,selection:F,onObservation:O,onClick:E,hoverHighlight:j,hoverRadius:e.hoverRadius,mobileInteraction:i.mobileInteraction,customHoverBehavior:He,customClickBehavior:Ie}),...k&&k.length>0&&{annotations:k},...C&&{heatmapAggregation:C},...null!=L&&{heatmapXBins:L},...null!=R&&{heatmapYBins:R},...H&&{xExtent:H},...I&&{yExtent:I},...De,...P};return de||pe||(ze?eo(G,{componentName:"Heatmap",message:ze,width:K,height:oe}):eo(Q,{componentName:"Heatmap",width:K,height:oe,children:eo(A,{ref:o,...Ye})}))});to.displayName="Heatmap";import{useMemo as oo,useCallback as io,forwardRef as ao,useRef as no}from"react";import{jsx as ro}from"react/jsx-runtime";w(e),L(u);var so=ao(function(e,t){const o=no(null),i=ye(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:r,className:s,xFormat:m,yFormat:d,xAccessor:u="x",yAccessor:p="y",sizeBy:f,sizeRange:y=[5,40],colorBy:g,colorScheme:b,styleRules:x,bubbleOpacity:v=.6,bubbleStrokeWidth:w=1,bubbleStrokeColor:S="white",tooltip:k,marginalGraphics:C,pointIdAccessor:L,annotations:R,regression:_,xExtent:H,yExtent:I,frameProps:P={},selection:F,linkedHover:T,linkedBrush:O,onObservation:E,onClick:j,hoverHighlight:z,chartId:V,loading:$,loadingContent:X,emptyContent:J,legendInteraction:Y,legendPosition:q,color:U,stroke:Z,strokeWidth:K,opacity:te}=e,{width:oe,height:ie,enableHover:re,showGrid:se,showLegend:le,title:ce,description:he,summary:me,accessibleTable:de,xLabel:fe,yLabel:ge}=i,be=oo(()=>ee(a),[a]),xe=void 0===a,ve=c({data:be,rawData:a,colorBy:g,colorScheme:b,legendInteraction:Y,legendPosition:q,frameLegend:P,selection:F,linkedHover:T,fallbackFields:g?["string"==typeof g?g:""]:[],unwrapData:!1,onObservation:E,onClick:j,hoverHighlight:z,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"BubbleChart",chartId:V,showLegend:le,userMargin:r,marginDefaults:i.marginDefaults,loading:$,loadingContent:X,emptyContent:J,width:oe,height:ie,hasTitle:!!ce,axisChrome:ue(P,{showAxes:i.showAxes,xLabel:fe,yLabel:ge})}),{domain:Ae,trackPushed:we,reset:Se}=Je({accessor:f,data:be,isPushMode:xe}),ke=io(e=>{we([e]),o.current?.push(e)},[we]),Ce=io(e=>{we(e),o.current?.pushMany(e)},[we]);h(t,{variant:"xy",frameRef:o,overrides:{push:ke,pushMany:Ce,clear:()=>{Se(),o.current?.clear()}}});const Le=ne(O),Re=(pe({name:Le?.name||"__unused_brush__",xField:Le?.xField||("string"==typeof u?u:void 0),yField:Le?.yField||("string"==typeof p?p:void 0)}),oo(()=>({stroke:S,strokeWidth:w}),[S,w])),_e=oo(()=>Ae??[0,1],[Ae]),He=io(e=>De(e,f,y,_e),[f,y,_e]),Ie=oo(()=>ae(u,p),[u,p]),Pe=ze({colorBy:g,colorScale:ve.colorScale,color:U,fillOpacity:v,radiusFn:He,baseStyleExtras:Re,stroke:Z,strokeWidth:K,opacity:te,styleRules:x,ruleContext:Ie,effectiveSelectionHook:ve.effectiveSelectionHook,resolvedSelection:ve.resolvedSelection}),Be=oo(()=>M([{label:fe||B(u),accessor:u,role:"x",format:m},{label:ge||B(p),accessor:p,role:"y",format:d},{label:B(f),accessor:f,role:"size"},...g?[{label:B(g),accessor:g,role:"color"}]:[]]),[u,p,fe,ge,f,g,m,d]);if(ve.earlyReturn)return ve.earlyReturn;const Fe=l({componentName:"BubbleChart",data:a,accessors:{xAccessor:u,yAccessor:p},requiredProps:{sizeBy:f}});if(Fe)return ro(G,{componentName:"BubbleChart",message:Fe,width:oe,height:ie});const Ne=n(_),Me=Ne?[Ne,...R||[]]:R,We={chartType:"bubble",...null!=a&&{data:be},xAccessor:u,yAccessor:p,colorAccessor:g||void 0,sizeAccessor:f,sizeRange:y,pointStyle:Pe,colorScheme:b,size:[oe,ie],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ve.margin,showAxes:i.showAxes,xLabel:fe,yLabel:ge,xFormat:m,yFormat:d,enableHover:re,showGrid:se,...ve.legendBehaviorProps,...D({title:ce,description:he,summary:me,accessibleTable:de,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:k,defaultTooltipContent:Be}),...N({linkedHover:T,selection:F,onObservation:E,onClick:j,hoverHighlight:z,hoverRadius:e.hoverRadius,mobileInteraction:ve.mobileInteraction,customHoverBehavior:ve.customHoverBehavior,customClickBehavior:ve.customClickBehavior}),...C&&{marginalGraphics:C},...L&&{pointIdAccessor:L},...Me&&Me.length>0&&{annotations:Me},...H&&{xExtent:H},...I&&{yExtent:I},...ve.crosshairProps,...P};return ro(Q,{componentName:"BubbleChart",width:oe,height:ie,children:ro(A,{ref:o,...We})})});so.displayName="BubbleChart";import*as lo from"react";import{useMemo as co,useCallback as ho,useState as mo,useRef as uo}from"react";import*as po from"react";import{jsx as fo}from"react/jsx-runtime";var yo=null,go=null;function bo(e){const[t,o]=po.useState(()=>yo);return po.useEffect(()=>{if(t)return;let e=!1;return(yo?Promise.resolve(yo):(go||(go=import("./c-DADXPJXV.min.js").then(e=>yo=e.ScatterplotMatrixBrushOverlay).catch(e=>{throw go=null,e})),go)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?fo(t,{...e}):null}import{jsx as xo,jsxs as vo}from"react/jsx-runtime";L(y);var Ao="__splomIdx",wo={top:4,bottom:4,left:4,right:4};function So({data:e,xField:t,yField:o,fieldLabels:i,cellSize:a,pointRadius:n,pointOpacity:r,colorBy:s,colorScale:l,brushSelectionName:c,hoverSelectionName:h,unselectedOpacity:m,maxDevicePixelRatio:d,mobileInteraction:u,mode:p,onPointHover:f,onPointClick:y}){const g=uo(null),b=ve({name:c,clientId:`splom-${t}-${o}`,fields:[t,o]}),x=pe({name:c,xField:t,yField:o}),v=ve({name:h,clientId:"splom-hover-source",fields:[Ao]}),w=v.selectPoints,S=ho(e=>{e?x.brushInteraction.during(e):x.brushInteraction.end(null)},[x.brushInteraction]),k=ho(e=>{if(!e)return void f?.(null);const t=e.data,o=t?.[Ao];void 0!==o&&(w({[Ao]:[o]}),f?.(t,e.x+wo.left,e.y+wo.top))},[w,f]),C=ho(e=>{if(!e)return void y?.(null);const t=e.data;t&&y?.(t,e.x+wo.left,e.y+wo.top)},[y]),L=ho(e=>{const t={opacity:r,r:n};return t.fill=s?Be(e,s,l):Ie,"hover"===p?v.isActive&&v.predicate(e)?(t.opacity=1,t.r=2.5*n,t.stroke="#333",t.strokeWidth=1.5):v.isActive&&(t.opacity=.6*r):b.isActive&&!b.predicate(e)&&(t.opacity=m),t},[r,n,s,p,l,v,b,m]);return vo("div",{style:{position:"relative",width:a,height:a},children:[xo(A,{ref:g,chartType:"scatter",data:e,size:[a,a],xAccessor:t,yAccessor:o,pointStyle:L,margin:wo,showAxes:!1,maxDevicePixelRatio:d,enableHover:"hover"===p,accessibleTable:!1,description:`${Me(i,t)??t} versus ${Me(i,o)??o} scatterplot`,...N({forceHoverBehavior:"hover"===p,forceClickBehavior:!!y,mobileInteraction:u,customHoverBehavior:k,customClickBehavior:C}),tooltipContent:"hover"===p?()=>null:void 0}),"brush"===p&&xo(bo,{frameRef:g,cellSize:a,onBrush:S})]})}function ko({data:e,field:t,label:o,cellSize:i,bins:a,colorBy:n,colorScale:r,brushSelectionName:s,hoverSelectionName:l,mode:c}){const h=ve({name:s,clientId:"splom-diag-"+t,fields:[t]}),m=ve({name:l,clientId:`splom-diag-${t}-hover`,fields:[Ao]}),d="hover"===c?m:h,u=d.isActive,p=d.predicate,f=co(()=>{const o="string"==typeof n?n:null,r=[],s=new Set;for(const i of e){const e=i[t];if(null==e||isNaN(e)||r.push(Number(e)),o){const e=i[o];null!=e&&s.add(e+"")}}if(0===r.length)return{bars:[],selectedBars:[],categoryBars:[],selectedCategoryBars:[],max:0,categories:[]};const[l,c]=_e(r),h=(c-l)/a||1,m=Array.from(s),d=new Map(m.map((e,t)=>[e,t])),f=Array(a).fill(0),y=Array(a).fill(0),g=Array.from({length:a},()=>Array(m.length).fill(0)),b=Array.from({length:a},()=>Array(m.length).fill(0));for(const i of e){const e=i[t];if(null==e||isNaN(e))continue;const n=Math.min(Math.floor((e-l)/h),a-1);if(f[n]++,u&&!p(i)||y[n]++,o){const e=d.get(i[o]+"");void 0!==e&&(g[n][e]++,u&&!p(i)||b[n][e]++)}}const x=Re(f,1),v=g.map((e,t)=>{let o=0;return e.map((e,n)=>{const r=e/x*(i-24),s={x:t/a*i,w:i/a-1,h:r,y0:o,category:m[n]};return o+=r,s})}),A=b.map((e,t)=>{let o=0;return e.map((e,n)=>{const r=e/x*(i-24),s={x:t/a*i,w:i/a-1,h:r,y0:o,category:m[n]};return o+=r,s})});return{bars:f.map((e,t)=>({x:t/a*i,w:i/a-1,h:e/x*(i-24),count:e})),selectedBars:y.map((e,t)=>({x:t/a*i,w:i/a-1,h:e/x*(i-24),count:e})),categoryBars:v,selectedCategoryBars:A,max:x,categories:m}},[e,t,a,i,u,p,n]);return vo("svg",{width:i,height:i,style:{overflow:"hidden"},children:[xo("text",{x:i/2,y:14,textAnchor:"middle",fontSize:11,fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)",children:o}),f.categories.length>0?f.categoryBars.map((e,t)=>e.map((e,o)=>xo("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:r?r(e.category):Ie,opacity:u?.3:.6},`bg-${t}-${o}`))):f.bars.map((e,t)=>xo("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:Ie,opacity:u?.3:.6},"bg-"+t)),u&&(f.categories.length>0?f.selectedCategoryBars.map((e,t)=>e.map((e,o)=>xo("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:r?r(e.category):Ie,opacity:.7},`sel-${t}-${o}`))):f.selectedBars.map((e,t)=>xo("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:Ie,opacity:.7},"sel-"+t)))]})}function Co({label:e,cellSize:t}){return xo("svg",{width:t,height:t,children:xo("text",{x:t/2,y:t/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:12,fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)",children:e})})}function Lo(e){const{data:t,fields:o,fieldLabels:i={},colorBy:a,colorScheme:n,cellSize:r=150,cellGap:s=4,pointRadius:l=2,pointOpacity:c=.5,diagonal:h="histogram",histogramBins:m=20,brushMode:d="crossfilter",hoverMode:u=!0,unselectedOpacity:p=.1,showGrid:f=!1,maxDevicePixelRatio:y,tooltip:g,showLegend:b,idAccessor:x,width:v,className:A,title:w,description:S,summary:k,accessibleTable:C=!0,onObservation:L,onClick:R,chartId:_}=e,H="splom",I="splom-hover",P=he(e.mobileInteraction,{mode:e.mode,width:v??o.length*r,mobileSemantics:e.mobileSemantics}),B=u?"hover":d?"brush":"hover",F=Ce(e=>e.clearSelection),[D,N]=mo(null),M=ho(()=>{F(I),N(null)},[F,I]),W=co(()=>(t||[]).map((e,t)=>void 0!==e[Ao]?e:{...e,[Ao]:t}),[t]),T=be(W,a,n),O=lo.useId().replace(/:/g,"")+"-data-table",G=co(()=>(t||[]).map(e=>({type:"point",datum:e})),[t]),z=co(()=>re(g),[g]),$=40,X=ho((e,t,o,i)=>[$+s+e*(r+s)+(o??0),t*(r+s)+(i??0)],[$,r,s]),Q=void 0!==b?b:!!a,U=co(()=>{if(!Q||!a)return null;const e="string"==typeof a?a:null;return e?Array.from(new Set(W.map(t=>t[e]).filter(e=>null!=e))).map(e=>({label:e+"",color:T?T(e+""):Ie})):null},[Q,a,W,T]),Z=co(()=>({display:"grid",gridTemplateColumns:"40px "+o.map(()=>r+"px").join(" "),gridTemplateRows:o.map(()=>r+"px").join(" ")+" 40px",gap:s+"px",width:"fit-content"}),[o,r,s,$]);return vo("div",{className:A,style:{position:"relative",color:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)"},role:"group","aria-label":S||w||`Scatterplot matrix comparing ${o.length} fields`,children:[w&&xo("div",{className:"semiotic-chart-title",style:{fontWeight:600,marginBottom:8},children:w}),C&&xo(j,{accessibleTable:C,children:xo(Y,{tableId:O})}),xo(J,{summary:k}),U&&xo("div",{style:{display:"flex",gap:12,marginBottom:8,flexWrap:"wrap"},children:U.map(e=>vo("div",{style:{display:"flex",alignItems:"center",gap:4},children:[xo("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",backgroundColor:e.color}}),xo("span",{style:{fontSize:11},children:e.label})]},e.label))}),vo("div",{style:{position:"relative",width:"fit-content"},children:[vo("div",{style:Z,onMouseLeave:"hover"===B?M:void 0,children:[o.map((e,t)=>vo(lo.Fragment,{children:[xo("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:11,fontWeight:"bold",color:"var(--semiotic-text, #333)"},children:Me(i,e)??e}),o.map((o,n)=>t===n?"label"===h?xo(Co,{label:Me(i,e)??e,cellSize:r},"diag-"+e):xo(ko,{data:W,field:e,label:Me(i,e)??e,cellSize:r,bins:m,colorBy:a,colorScale:T,brushSelectionName:H,hoverSelectionName:I,unselectedOpacity:p,mode:B},"diag-"+e):xo(So,{data:W,xField:o,yField:e,fieldLabels:i,cellSize:r,pointRadius:l,pointOpacity:c,colorBy:a,colorScale:T,brushSelectionName:H,hoverSelectionName:I,unselectedOpacity:p,showGrid:f,maxDevicePixelRatio:y,mobileInteraction:P,mode:B,onPointHover:"hover"===B?(i,a,r)=>{if(i){if(N({datum:i,xField:o,yField:e,colIndex:n,rowIndex:t,px:a??0,py:r??0}),L){const[e,o]=X(n,t,a,r);L({type:"hover",datum:i,x:e,y:o,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:_})}}else N(null),L&&L({type:"hover-end",timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:_})}:void 0,onPointClick:R||L?(e,o,i)=>{if(!e)return;const[a,r]=X(n,t,o,i);R&&R(e,{x:a,y:r}),L&&L({type:"click",datum:e,x:a,y:r,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:_})}:void 0},`cell-${e}-${o}`))]},"row-"+e)),xo("div",{})," ",o.map(e=>xo("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:"bold",color:"#333"},children:Me(i,e)??e},"col-label-"+e))]}),D&&"hover"===B&&!1!==g&&(()=>{const e=D.datum,t=Me(i,D.xField)??D.xField,n=Me(i,D.yField)??D.yField,l=a?"function"==typeof a?a(e):e[a]:null,c=x?"function"==typeof x?x(e):e[x]:"Row "+e[Ao],h=$+s+D.colIndex*(r+s)+D.px,m=D.rowIndex*(r+s)+D.py,d={...e};delete d[Ao];const u="function"==typeof z,p=u?z(d):null,f=vo(q,{style:{color:"var(--semiotic-tooltip-text, #333)",background:"var(--semiotic-tooltip-bg, rgba(255,255,255,0.95))",border:"1px solid var(--semiotic-border, #ddd)",borderRadius:3,padding:"4px 8px",fontSize:11,lineHeight:1.4,whiteSpace:"nowrap",boxShadow:"none"},children:[xo("div",{style:{fontWeight:"bold",marginBottom:2},children:c+""}),vo("div",{children:[t,": ",null!=e[D.xField]?Number(e[D.xField]).toFixed(1):"–"]}),vo("div",{children:[n,": ",null!=e[D.yField]?Number(e[D.yField]).toFixed(1):"–"]}),null!=l&&vo("div",{style:{opacity:.8},children:["string"==typeof a?a:"group",": ",l+""]})]}),y=u?p:f;return y?xo(V,{x:h,y:m,containerWidth:$+o.length*r+o.length*s,containerHeight:o.length*r+$+o.length*s,margin:{top:0,right:0,bottom:0,left:0},className:"scatterplot-matrix-tooltip",zIndex:10,children:y}):null})()]}),C&&xo(j,{accessibleTable:C,children:xo(E,{scene:G,chartType:"scatterplot matrix",tableId:O,chartTitle:w})})]})}function Ro(e){const{brushMode:t="crossfilter",hoverMode:o=!0}=e,i={};return!o&&t&&(i.splom={resolution:t}),o&&(i["splom-hover"]={resolution:"union"}),xo($,{selections:i,children:xo(Lo,{...e})})}Ro.displayName="ScatterplotMatrix";import{useState as _o,useRef as Ho,useEffect as Io,useMemo as Po,useCallback as Bo}from"react";import*as Fo from"react";import{jsx as Do}from"react/jsx-runtime";var No=null,Mo=null;function Wo(e){const[t,o]=Fo.useState(()=>No);return Fo.useEffect(()=>{if(t)return;let e=!1;return(No?Promise.resolve(No):(Mo||(Mo=import("./c-MNF2S4AA.min.js").then(e=>No=e.MinimapBrushOverlay).catch(e=>{throw Mo=null,e})),Mo)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?Do(t,{...e}):null}import{jsx as To,jsxs as Oo}from"react/jsx-runtime";function Eo(e){const{data:t,width:o=600,height:i=400,margin:n,className:r,title:s,description:c,summary:h,xLabel:m,yLabel:d,xFormat:u,yFormat:p,xAccessor:f="x",yAccessor:y="y",lineBy:g,lineDataAccessor:b="coordinates",colorBy:x,colorScheme:v,curve:w="linear",lineWidth:S=2,fillArea:k=!1,areaOpacity:C=.3,showPoints:L=!1,pointRadius:R=3,enableHover:_=!0,showGrid:H=!1,showLegend:I,legendPosition:P,tooltip:F,minimap:D={},renderBefore:N=!1,onBrush:W,brushExtent:T,yExtent:O,frameProps:E={},loading:j,loadingContent:z,emptyContent:V}=e,$=le(j,o,i,z),X=$?null:se(t,o,i,V),J=Po(()=>ee(t),[t]),[Y,q]=_o(null),U=T??Y,Z=Bo(e=>{T||q(e),W?.(e)},[T,W]),K=Ho(null),[te,oe]=_o(null);Io(()=>{let e=0,t=!1;const o=()=>{if(t)return;const i=K.current?.getScales?.();i?oe(i):e=requestAnimationFrame(o)};return e=requestAnimationFrame(o),()=>{t=!0,e&&cancelAnimationFrame(e)}},[t]);const ie=void 0!==J[0]?.[b],ae=Po(()=>{if(ie)return J;if(g){const e=J.reduce((e,t)=>{const o="function"==typeof g?g(t):t[g];if(!e[o]){const t={[b]:[]};"string"==typeof g&&(t[g]=o),e[o]=t}return e[o][b].push(t),e},{});return Object.values(e)}return[{[b]:J}]},[J,g,b,ie]),ne=Po(()=>ie||g?ae.flatMap(e=>{const t=e[b]||[];return g&&"string"==typeof g?t.map(t=>({...t,[g]:e[g]})):t}):J,[ae,b,ie,g,J]),re=be(J,x,v),ce=a({lineWidth:S,colorBy:x,colorScale:re,fillArea:k,areaOpacity:C}),he=Po(()=>{if(D.lineStyle)return D.lineStyle},[D.lineStyle]),de=a({lineWidth:1,colorBy:x,colorScale:re}),pe=he??de,ye=Po(()=>{if(L)return e=>{const t={r:R,fillOpacity:1};return t.fill=x?Be(e.parentLine||e,x,re):Ie,t}},[L,R,x,re]),{legend:ge,margin:xe,legendPosition:ve,legendMarginReserved:Ae}=fe({data:ae,colorBy:x,colorScale:re,showLegend:I,legendPosition:P,userMargin:n,chartWidth:o,chartHeight:i,frameLegend:E,hasTitle:!!s,axisChrome:ue(E,{showAxes:!0,xLabel:m,yLabel:d})}),we=D.height||60,Se=Po(()=>({top:D.margin?.top??0,bottom:D.margin?.bottom??20,left:D.margin?.left??xe.left,right:D.margin?.right??xe.right}),[D.margin,xe]),ke=D.brushDirection||"x",Ce=Po(()=>M([{label:m||B(f),accessor:f,role:"x",format:u},{label:d||B(y),accessor:y,role:"y",format:p}]),[f,y,m,d,u,p]),Le=l({componentName:"MinimapChart",data:t,accessors:{xAccessor:f,yAccessor:y}});if(Le)return To(G,{componentName:"MinimapChart",message:Le,width:o,height:i});const Re=k?"area":"line",_e={chartType:Re,data:ne,xAccessor:f,yAccessor:y,groupAccessor:g||void 0,curve:w,lineStyle:ce,...L&&{pointStyle:ye},size:[o,i],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:xe,showAxes:!0,xLabel:m,yLabel:d,xFormat:u,yFormat:p,enableHover:_,showGrid:H,...ge&&{legend:ge,legendPosition:ve},...Ae&&{__legendMarginReservedFor:ge},...s&&{title:s},...c&&{description:c},...h&&{summary:h},...void 0!==e.accessibleTable&&{accessibleTable:e.accessibleTable},...void 0!==e.animate&&{animate:e.animate},...void 0!==e.hoverRadius&&{hoverRadius:e.hoverRadius},...me({tooltip:F,defaultTooltipContent:Ce}),...U&&{xExtent:U},...O&&{yExtent:O},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...E},He={chartType:Re,data:ne,xAccessor:f,yAccessor:y,groupAccessor:g||void 0,curve:w,lineStyle:pe,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},size:[o,we+Se.top+Se.bottom],margin:Se,showAxes:D.showAxes??!1,background:D.background,enableHover:!1,accessibleTable:!1,description:(c||s||"Chart")+" overview minimap",animate:!1,...O&&{yExtent:O}},Pe=Oo("div",{style:{position:"relative",width:o,overflow:"hidden"},children:[To(A,{ref:K,...He}),To(Wo,{width:o-Se.left-Se.right,height:we,margin:Se,scales:te,brushDirection:ke,extent:U,onBrush:Z})]},"minimap"),Fe=To("div",{style:{overflow:"hidden"},children:To(A,{..._e})},"main");return $||X||To(Q,{componentName:"MinimapChart",width:o,height:i,children:Oo("div",{className:"minimap-chart"+(r?" "+r:""),role:"group","aria-label":c||s||"Chart with overview minimap",children:[N?Pe:Fe,N?Fe:Pe]})})}t(),Eo.displayName="MinimapChart";import{useMemo as jo,forwardRef as Go,useRef as zo}from"react";var Vo={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 $o,jsx as Xo,jsxs as Qo}from"react/jsx-runtime";function Jo(e,t){return{label:t?.label??e.label,color:t?.color??e.color,opacity:t?.opacity??e.opacity}}L(y);var Yo=Go(function(e,t){const o=zo(null);h(t,{variant:"xy",frameRef:o});const i=ye(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:n,className:r,xFormat:s,yFormat:m,xAccessor:d="x",yAccessor:u="y",xCenter:p,yCenter:f,quadrants:y,centerlineStyle:g={},showQuadrantLabels:b=!0,quadrantLabelSize:x=12,colorBy:v,colorScheme:w,styleRules:S,sizeBy:k,sizeRange:C=[3,15],pointRadius:L=5,pointOpacity:R=.8,tooltip:_,pointIdAccessor:H,annotations:I,frameProps:P={},selection:F,linkedHover:D,onObservation:W,onClick:T,hoverHighlight:O,chartId:E,loading:j,loadingContent:z,emptyContent:V,legendInteraction:$,legendPosition:X,color:J,stroke:Y,strokeWidth:q,opacity:U}=e,{width:Z,height:K,enableHover:te,showGrid:oe,showLegend:ie,title:ne,description:se,summary:le,accessibleTable:ce,xLabel:he,yLabel:me}=i,de=jo(()=>({topLeft:Jo(Vo.topLeft,y?.topLeft),topRight:Jo(Vo.topRight,y?.topRight),bottomLeft:Jo(Vo.bottomLeft,y?.bottomLeft),bottomRight:Jo(Vo.bottomRight,y?.bottomRight)}),[y]),pe=jo(()=>ee(a),[a]),fe=c({data:pe,rawData:a,colorBy:v,colorScheme:w,legendInteraction:$,legendPosition:X,frameLegend:P,selection:F,linkedHover:D,fallbackFields:"string"==typeof v?[v]:[],unwrapData:!1,onObservation:W,onClick:T,hoverHighlight:O,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"QuadrantChart",chartId:E,showLegend:ie,userMargin:n,marginDefaults:i.marginDefaults,loading:j,loadingContent:z,emptyContent:V,width:Z,height:K,hasTitle:!!ne,axisChrome:ue(P,{showAxes:i.showAxes,xLabel:he,yLabel:me})});Se("QuadrantChart",pe,"xAccessor",d),Se("QuadrantChart",pe,"yAccessor",u);const ge=jo(()=>{if(!pe.length)return;const e="function"==typeof d?d:e=>+e[d],t="function"==typeof u?u:e=>+e[u];let o=1/0,i=-1/0,a=1/0,n=-1/0;for(const r of pe){const s=e(r),l=t(r);isFinite(s)&&(o>s&&(o=s),s>i&&(i=s)),isFinite(l)&&(a>l&&(a=l),l>n&&(n=l))}if(null!=p&&isFinite(p)&&(o>p&&(o=p),p>i&&(i=p)),null!=f&&isFinite(f)&&(a>f&&(a=f),f>n&&(n=f)),o===1/0)return;const r=.1*(i-o)||1,s=.1*(n-a)||1;return{xExtent:[o-r,i+r],yExtent:[a-s,n+s]}},[pe,d,u,p,f]),be=jo(()=>{if(!k||0===pe.length)return;const e=pe.map(e=>"function"==typeof k?k(e):e[k]).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0!==e.length?_e(e):void 0},[pe,k]),xe=jo(()=>"function"==typeof d?d:e=>+e[d],[d]),ve=jo(()=>"function"==typeof u?u:e=>+e[u],[u]),Ae=jo(()=>e=>{const t=xe(e),o=ve(e),i=null!=p?t>=p:void 0,a=null!=f?o>=f:void 0;return void 0===a||void 0===i?J||Ie:a&&i?de.topRight.color:a&&!i?de.topLeft.color:!a&&i?de.bottomRight.color:de.bottomLeft.color},[xe,ve,p,f,de,J]),we=jo(()=>k?e=>De(e,k,C,be):void 0,[k,C,be]),ke=jo(()=>ae(d,u),[d,u]),Ce=ze({colorBy:v,colorScale:fe.colorScale,color:J,pointRadius:L,fillOpacity:R,radiusFn:we,fallbackFill:Ae,stroke:Y,strokeWidth:q,opacity:U,styleRules:S,ruleContext:ke,effectiveSelectionHook:fe.effectiveSelectionHook,resolvedSelection:fe.resolvedSelection}),Le=jo(()=>{if(!pe.length)return;const e=new Set;"string"==typeof d&&e.add(d),"string"==typeof u&&e.add(u),"string"==typeof v&&e.add(v),"string"==typeof k&&e.add(k);const t=pe[0];for(const o of Object.keys(t))if(!o.startsWith("_")&&!e.has(o)&&"string"==typeof t[o])return o},[pe,d,u,v,k]),Re=jo(()=>M([...Le?[{label:Le,accessor:Le,role:"title"}]:[],{label:he||B(d),accessor:d,role:"x",format:s},{label:me||B(u),accessor:u,role:"y",format:m},...v?[{label:B(v),accessor:v,role:"color"}]:[],...k?[{label:B(k),accessor:k,role:"size"}]:[]]),[Le,d,u,he,me,v,k,s,m]),He=l({componentName:"QuadrantChart",data:a,accessors:{xAccessor:d,yAccessor:u}}),Pe=jo(()=>{const e={stroke:g.stroke||"#999",strokeWidth:g.strokeWidth??1,dashArray:g.strokeDasharray||[]};return[(t,o,i,a)=>{if(!i?.x||!i?.y)return;const n=a.width,r=a.height,s=null!=p?i.x(p):n/2,l=null!=f?i.y(f):r/2;if(null!=p&&!isFinite(s))return;if(null!=f&&!isFinite(l))return;const c=Math.max(0,Math.min(n,s)),h=Math.max(0,Math.min(r,l)),m=[{config:de.topLeft,x:0,y:0,w:c,h:h},{config:de.topRight,x:c,y:0,w:n-c,h:h},{config:de.bottomLeft,x:0,y:h,w:c,h:r-h},{config:de.bottomRight,x:c,y:h,w:n-c,h:r-h}];for(const e of m)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,r),t.stroke(),t.beginPath(),t.moveTo(0,h),t.lineTo(n,h),t.stroke(),t.setLineDash([])}]},[p,f,de,g]),Be=jo(()=>b?[...Pe,(e,t,o,i)=>{if(!o?.x||!o?.y)return;const a=i.width,n=i.height,r=null!=p?o.x(p):a/2,s=null!=f?o.y(f):n/2;if(null!=p&&!isFinite(r))return;if(null!=f&&!isFinite(s))return;const l=We(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif";e.font=`600 ${x}px ${l}`,e.globalAlpha=.5,e.fillStyle=de.topLeft.color,e.textAlign="left",e.textBaseline="top",e.fillText(de.topLeft.label,8,8),e.fillStyle=de.topRight.color,e.textAlign="right",e.textBaseline="top",e.fillText(de.topRight.label,a-8,8),e.fillStyle=de.bottomLeft.color,e.textAlign="left",e.textBaseline="bottom",e.fillText(de.bottomLeft.label,8,n-8),e.fillStyle=de.bottomRight.color,e.textAlign="right",e.textBaseline="bottom",e.fillText(de.bottomRight.label,a-8,n-8),e.globalAlpha=1}]:Pe,[Pe,b,x,de,p,f]),Fe=jo(()=>{const e=P.canvasPreRenderers||[];return[...Be,...e]},[Be,P.canvasPreRenderers]),Ne=jo(()=>{const e={stroke:g.stroke||"#999",strokeWidth:g.strokeWidth??1,dashArray:g.strokeDasharray?Array.isArray(g.strokeDasharray)?g.strokeDasharray.join(","):g.strokeDasharray:void 0};return[(t,o,i)=>{if(!o?.x||!o?.y)return null;const a=i.width,n=i.height,r=null!=p?o.x(p):a/2,s=null!=f?o.y(f):n/2;if(null!=p&&!isFinite(r))return null;if(null!=f&&!isFinite(s))return null;const l=Math.max(0,Math.min(a,r)),c=Math.max(0,Math.min(n,s));return Qo($o,{children:[[{config:de.topLeft,x:0,y:0,w:l,h:c},{config:de.topRight,x:l,y:0,w:a-l,h:c},{config:de.bottomLeft,x:0,y:c,w:l,h:n-c},{config:de.bottomRight,x:l,y:c,w:a-l,h:n-c}].map((e,t)=>e.w>0&&e.h>0?Xo("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),Xo("line",{x1:l,y1:0,x2:l,y2:n,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),Xo("line",{x1:0,y1:c,x2:a,y2:c,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),b&&Qo($o,{children:[Xo("text",{x:8,y:8+x,fill:de.topLeft.color,fontWeight:600,fontSize:x,opacity:.5,children:de.topLeft.label}),Xo("text",{x:a-8,y:8+x,fill:de.topRight.color,fontWeight:600,fontSize:x,opacity:.5,textAnchor:"end",children:de.topRight.label}),Xo("text",{x:8,y:n-8,fill:de.bottomLeft.color,fontWeight:600,fontSize:x,opacity:.5,children:de.bottomLeft.label}),Xo("text",{x:a-8,y:n-8,fill:de.bottomRight.color,fontWeight:600,fontSize:x,opacity:.5,textAnchor:"end",children:de.bottomRight.label})]})]})}]},[p,f,de,g,b,x]);if(fe.earlyReturn)return fe.earlyReturn;const Me={chartType:"scatter",...null!=a&&{data:pe},xAccessor:d,yAccessor:u,colorAccessor:v||void 0,sizeAccessor:k||void 0,sizeRange:C,pointStyle:Ce,colorScheme:w,size:[Z,K],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:fe.margin,showAxes:i.showAxes,xLabel:he,yLabel:me,xFormat:s,yFormat:m,enableHover:te,showGrid:oe,...ge&&{xExtent:ge.xExtent,yExtent:ge.yExtent},...fe.legendBehaviorProps,...ne&&{title:ne},...se&&{description:se},...le&&{summary:le},...void 0!==ce&&{accessibleTable:ce},...r&&{className:r},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===_?()=>null:!0===_||void 0===_?Re:re(_)||Re,...N({linkedHover:D,selection:F,onObservation:W,onClick:T,hoverHighlight:O,hoverRadius:e.hoverRadius,mobileInteraction:fe.mobileInteraction,customHoverBehavior:fe.customHoverBehavior,customClickBehavior:fe.customClickBehavior}),...H&&{pointIdAccessor:H},...I&&I.length>0&&{annotations:I},canvasPreRenderers:Fe,...fe.crosshairProps,...P,...Fe.length>0&&{canvasPreRenderers:Fe},svgPreRenderers:Ne};return He?Xo(G,{componentName:"QuadrantChart",message:He,width:Z,height:K}):Xo(Q,{componentName:"QuadrantChart",width:Z,height:K,children:Xo(A,{ref:o,...Me})})});Yo.displayName="QuadrantChart";import*as qo from"react";import{useMemo as Uo,useCallback as Zo,forwardRef as Ko,useRef as ei,useImperativeHandle as ti}from"react";import{jsx as oi}from"react/jsx-runtime";L(k);var ii="__ma_unitized",ai="__ma_series";function ni(e,t){const o=t[1]-t[0];return 0===o?.5:(e-t[0])/o}function ri(e,t){return t[0]+e*(t[1]-t[0])}var si=Ko(function(e,t){const o=ei(null),i=ei([]),n=ei(e.series);n.current=e.series,ti(t,()=>{const e=()=>(n.current??[]).filter(e=>null!=e&&"object"==typeof e);return{push:t=>{if(!o.current)return;const a=e(),n=t;for(let e=0;a.length>e&&2>e;e++){const t=a[e],r=t.extent||i.current[e];if(!r)continue;const s=("function"==typeof t.yAccessor?t.yAccessor:e=>e[t.yAccessor])(n);null!=s&&isFinite(s)&&o.current.push({...n,[ii]:ni(s,r),[ai]:t.label||"Series "+(e+1)})}},pushMany:t=>{if(!o.current)return;const a=e(),n=[];for(const e of t)for(let t=0;a.length>t&&2>t;t++){const o=a[t],r=o.extent||i.current[t];if(!r)continue;const s=("function"==typeof o.yAccessor?o.yAccessor:e=>e[o.yAccessor])(e);null!=s&&isFinite(s)&&n.push({...e,[ii]:ni(s,r),[ai]:o.label||"Series "+(t+1)})}o.current.pushMany(n)},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 r=ye(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:s,margin:h,className:m,xFormat:d,xAccessor:u="x",series:p,colorScheme:f,curve:y="monotoneX",lineWidth:g=2,tooltip:b,annotations:x,frameProps:v={},selection:w,linkedHover:S,onObservation:k,onClick:C,hoverHighlight:L,chartId:R,loading:_,loadingContent:H,emptyContent:I,legendInteraction:P,legendPosition:B,stroke:F,strokeWidth:D,opacity:M}=e,{width:W,height:T,enableHover:O,showGrid:E,showLegend:j=!0,title:z,description:V,summary:$,accessibleTable:J,xLabel:Y}=r,q=Uo(()=>ee(s),[s]),U=Uo(()=>ee(p),[p]),Z=U,K=2===U.length,te=Uo(()=>K?{...v.legendLayout,sideGutter:v.legendLayout?.sideGutter??70}:v.legendLayout,[v.legendLayout,K]);"undefined"==typeof process||"production"===process.env?.NODE_ENV||K||console.warn(`[MultiAxisLineChart] Expected exactly 2 series for dual-axis mode, got ${U.length}. Rendering as a standard multi-line chart.`);const oe=le(_,W,T,H),ae=oe?null:se(s,W,T,I),ne=Ae(),re=Uo(()=>{let e;if(Array.isArray(f))e=f;else if(ne&&ne.length>0)e=ne;else{const t=He[f];e=Array.isArray(t)?t:Pe}return Z.map((t,o)=>t.color||e[o%e.length])},[Z,f,ne]),ce=Uo(()=>U.map((e,t)=>e.label||"Series "+(t+1)),[U]),{unitizedData:he,extents:de}=Uo(()=>{if(0===q.length){const e=U.map(e=>e.extent||null).filter(Boolean);return e.length===U.length&&(i.current=e),{unitizedData:[],extents:e.length===U.length?e:[]}}const e=U.map(e=>e.extent||function(e,t){let o=1/0,i=-1/0;const a="function"==typeof t?t:e=>e[t];for(const t of e){const e=a(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]}(q,e.yAccessor));if(i.current=e,!K){const t=[];for(const e of q)for(let o=0;U.length>o;o++){const i=U[o],a=("function"==typeof i.yAccessor?i.yAccessor:e=>e[i.yAccessor])(e);null!=a&&t.push({...e,[ii]:a,[ai]:ce[o]})}return{unitizedData:t,extents:e}}const t=[];for(const o of q)for(let i=0;2>i;i++){const a=U[i],n=("function"==typeof a.yAccessor?a.yAccessor:e=>e[a.yAccessor])(o);null!=n&&t.push({...o,[ii]:ni(n,e[i]),[ai]:ce[i]})}return{unitizedData:t,extents:e}},[q,U,K,ce]),pe=Uo(()=>{if(!K||2>de.length)return;const e=e=>t=>{const o=ri(t,de[e]),i=U[e]?.format;return"function"==typeof i?i(o):Number.isInteger(o)?o+"":o.toFixed(1)},t=e(0),o=e(1);return[{orient:"left",label:ce[0],tickFormat:t},{orient:"right",label:ce[1],tickFormat:o},{orient:"bottom"}]},[K,de,U,ce]),fe=Uo(()=>he.length>0?he:ce.map(e=>({[ai]:e})),[he,ce]),ge=c({data:fe,rawData:s,colorBy:ai,colorScheme:re,legendInteraction:P,legendPosition:B,frameLegend:{...v,legendLayout:te},selection:w,linkedHover:S,fallbackFields:[ai],unwrapData:!1,onObservation:k,onClick:C,hoverHighlight:L,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"MultiAxisLineChart",chartId:R,showLegend:j,legendLayout:te,userMargin:h,marginDefaults:K?{...r.marginDefaults,left:70,right:70}:r.marginDefaults,loading:_,loadingContent:H,emptyContent:I,width:W,height:T,hasTitle:!!z,axisChrome:ue(v,{showAxes:r.showAxes,xLabel:Y,yLabel:ce[0],yLabelRight:ce[1],axes:pe})}),be=Uo(()=>{const e=new Map;return ce.forEach((t,o)=>e.set(t,re[o])),e},[ce,re]),xe=Zo(e=>be.get(e[ai])||re[0],[be,re]),ve=a({lineWidth:g,resolveStroke:xe,stroke:F,strokeWidth:D,opacity:M,effectiveSelectionHook:ge.effectiveSelectionHook,resolvedSelection:ge.resolvedSelection}),we=Uo(()=>e=>{const t=e.data||e,o=t[ai],i=ce.indexOf(o),a=t[ii],n=K&&i>=0&&de[i]?ri(a,de[i]):a,r=i>=0&&U[i]?.format?U[i].format:e=>Number.isInteger(e)?e+"":e.toFixed(2),s="function"==typeof u?u(t):t[u];return qo.createElement("div",{style:{padding:"6px 10px",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-tooltip-font-size, 13px)"}},qo.createElement("div",{style:{fontWeight:600,marginBottom:4,color:re[i]||"inherit"}},o),qo.createElement("div",null,`${"string"==typeof u?u:"x"}: ${s}`),qo.createElement("div",null,`${o}: ${r(n)}`))},[ce,re,de,K,U,u]),Se=Zo(e=>{const t=(Array.isArray(e.allSeries)?e.allSeries:[]).map(e=>{const t=ce.indexOf(e.group),o=K&&t>=0&&de[t]?ri(e.value,de[t]):e.value;let i=e.datum;return i&&(i={...i},delete i[ii],delete i[ai]),{...e,value:o,datum:i}}),o=e.data&&"object"==typeof e.data&&!Array.isArray(e.data)?{...e.data}:e.data;o&&"object"==typeof o&&!Array.isArray(o)&&(delete o[ii],delete o[ai]);const i={...e,data:o,allSeries:t};return delete i[ii],delete i[ai],i},[de,K,ce]),ke=Uo(()=>X(),[]),Ce=Zo(e=>ke(Se(e)),[ke,Se]),Le=Uo(()=>ie(b)&&"function"==typeof b.content?{mode:"multi",content:e=>b.content(Se(e))}:b,[Se,b]),Re=Uo(()=>me({tooltip:Le,defaultTooltipContent:we,multiDefaultContent:Ce}),[we,Ce,Le]);if(ge.earlyReturn)return ge.earlyReturn;const _e=l({componentName:"MultiAxisLineChart",data:s,accessors:{xAccessor:u}}),Ie=K?[0,1]:void 0,Be={chartType:"line",...null!=s&&{data:he},xAccessor:u,yAccessor:ii,groupAccessor:ai,lineStyle:ve,colorScheme:re,size:[W,T],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:ge.margin,showAxes:r.showAxes,...pe&&{axes:pe},xLabel:Y,...K?{}:{yLabel:ce[0]},xFormat:d,...K&&Ie&&{yExtent:Ie},enableHover:O,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:E,curve:y,...ge.legendBehaviorProps,...z&&{title:z},...V&&{description:V},...$&&{summary:$},...void 0!==J&&{accessibleTable:J},...m&&{className:m},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...Re,...x&&{annotations:x},...N({linkedHover:S,selection:w,onObservation:k,onClick:C,hoverHighlight:L,hoverRadius:e.hoverRadius,mobileInteraction:ge.mobileInteraction,customHoverBehavior:ge.customHoverBehavior,customClickBehavior:ge.customClickBehavior}),...ge.crosshairProps,...v,...te&&{legendLayout:te}};return oe||ae||(_e?oi(G,{componentName:"MultiAxisLineChart",message:_e,width:W,height:T}):oi(Q,{componentName:"MultiAxisLineChart",width:W,height:T,children:oi(A,{ref:o,...Be})}))});si.displayName="MultiAxisLineChart";import{useMemo as li,forwardRef as ci,useRef as hi}from"react";import{jsx as mi}from"react/jsx-runtime";L(p);var di=ci(function(e,t){const o=hi(null);h(t,{variant:"xy",frameRef:o});const i=ye(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:n,className:s,xFormat:c,yFormat:d,xAccessor:u="x",highAccessor:p="high",lowAccessor:f="low",openAccessor:y,closeAccessor:g,candlestickStyle:b,tooltip:x,annotations:v,xExtent:w,yExtent:S,frameProps:k={},selection:C,linkedHover:L,onObservation:R,onClick:_,chartId:H,loading:I,loadingContent:P,emptyContent:F}=e,{width:T,height:O,enableHover:E,showGrid:j,title:z,description:V,summary:$,accessibleTable:X,xLabel:J,yLabel:Y}=i,q=le(I,T,O,P),U=q?null:se(a,T,O,F),Z=li(()=>ee(a),[a]),K=null==y||null==g;Se("CandlestickChart",Z,"xAccessor",u),Se("CandlestickChart",Z,"highAccessor",p),Se("CandlestickChart",Z,"lowAccessor",f),K||(Se("CandlestickChart",Z,"openAccessor",y),Se("CandlestickChart",Z,"closeAccessor",g));const{activeSelectionHook:oe,customHoverBehavior:ie,customClickBehavior:ae,crosshairSourceId:ne}=ge({selection:C,linkedHover:L,onObservation:R,onClick:_,chartType:"CandlestickChart",chartId:H,mobileInteraction:i.mobileInteraction}),re=m(C),ce=li(()=>ke(()=>({}),oe,re),[oe,re]),he=te(L,ne),me=li(()=>{const e=i.marginDefaults,t="sparkline"===i.mode?{...e,top:0,bottom:0}:e;return null==n?t:{...t,...r(n)}},[n,i.marginDefaults,i.mode]),de=li(()=>{const e=[{label:J||B(u),accessor:u,role:"x",format:c}];return K?(e.push({label:"High",accessor:p,role:"y",format:d}),e.push({label:"Low",accessor:f,format:d})):(e.push({label:"Open",accessor:y,format:d}),e.push({label:"High",accessor:p,format:d}),e.push({label:"Low",accessor:f,format:d}),e.push({label:"Close",accessor:g,format:d})),M(e)},[u,J,c,d,p,f,y,g,K]),ue=l({componentName:"CandlestickChart",data:a,accessors:{xAccessor:u,highAccessor:p,lowAccessor:f,...!K&&{openAccessor:y,closeAccessor:g}}}),pe={chartType:"candlestick",...null!=a&&{data:Z},xAccessor:u,yAccessor:p,highAccessor:p,lowAccessor:f,...!K&&{openAccessor:y,closeAccessor:g},...b&&{candlestickStyle:b},...oe&&{pointStyle:ce},scalePadding:Math.max(2,Math.min(12,Math.round(T/40))),extentPadding:T>200?.1:.02,size:[T,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:me,showAxes:i.showAxes,xLabel:J,yLabel:Y,xFormat:c,yFormat:d,enableHover:E,showGrid:j,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...D({title:z,description:V,summary:$,accessibleTable:X,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:x,defaultTooltipContent:de}),...N({linkedHover:L,selection:C,onObservation:R,onClick:_,hoverRadius:e.hoverRadius,mobileInteraction:i.mobileInteraction,customHoverBehavior:ie,customClickBehavior:ae}),...v&&v.length>0&&{annotations:v},...w&&{xExtent:w},...S&&{yExtent:S},...he,...k};return q||U||(ue?mi(G,{componentName:"CandlestickChart",message:ue,width:T,height:O}):mi(Q,{componentName:"CandlestickChart",width:T,height:O,children:mi(A,{ref:o,...pe})}))});di.displayName="CandlestickChart";import{useMemo as ui,forwardRef as pi,useRef as fi}from"react";import{jsx as yi}from"react/jsx-runtime";L(b);var gi=pi(function(e,t){const o=fi(null);h(t,{variant:"xy",frameRef:o});const i=ye(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:n,className:r,xFormat:s,yFormat:m,xAccessor:d="x",yAccessor:u="y",pointIdAccessor:p,xScaleType:f,positiveColor:y,negativeColor:g,connectorStroke:b,connectorWidth:x,gap:v,tooltip:w,annotations:S,xExtent:k,yExtent:C,frameProps:L={},selection:R,linkedHover:_,onObservation:H,onClick:I,hoverHighlight:P,chartId:F,loading:T,loadingContent:O,emptyContent:E,legendInteraction:j,legendPosition:z}=e,{areaStyle:V,...$}=L,{width:X,height:J,enableHover:Y,showGrid:q,showLegend:U,title:Z,description:K,summary:te,accessibleTable:oe,xLabel:ie,yLabel:ae}=i,ne=ui(()=>ee(a),[a]),re=fi({next:0,indexOf:new WeakMap,idOf:new Map,labels:new Map}),{plotData:se,plotXAccessor:le,plotXFormat:ce,usesIndex:he}=ui(()=>{const e="function"==typeof d?d:e=>e[d],t=p?"function"==typeof p?p:e=>e[p]:void 0,o=e=>"number"==typeof e&&Number.isFinite(e)||e instanceof Date,i=(e,t)=>{const o=e??t;return s?s(o):o+""};if(null!=a&&!ne.some((t,i)=>!o(e(t,i))))return{plotData:ne,plotXAccessor:d,plotXFormat:s,usesIndex:!1};if(null!=a){const t=ne.map((t,o)=>e(t,o));return{plotData:ne.map((e,t)=>({...e,__waterfallX:t})),plotXAccessor:"__waterfallX",plotXFormat:e=>i(t[Number(e)],e),usesIndex:!0}}const n=re.current,r=(e,t,o,i)=>{e&&"object"==typeof e&&(n.indexOf.set(e,t),Object.isFrozen(e)||Object.isSealed(e)||(e.__waterfallX=t)),o&&n.idOf.set(o,t),n.labels.set(t,i)};return{plotData:ne,plotXAccessor:(i,a)=>{const s=e(i,a);if(o(s))return s;const l=t?(t(i,a)??"")+"":"",c=i&&"object"==typeof i?i.__waterfallX:void 0,h="number"==typeof c&&Number.isFinite(c)?c:(i&&"object"==typeof i?n.indexOf.get(i):void 0)??(l?n.idOf.get(l):void 0);if("number"==typeof h)return r(i,h,l,s),h;const m="number"==typeof a?a:n.next;return n.next=Math.max(n.next,m+1),r(i,m,l,s),m},plotXFormat:e=>i(n.labels.get(Number(e)),e),usesIndex:!0}},[a,ne,d,s,p]),me=ui(()=>{if(he&&null!=a)return[{orient:"bottom",tickValues:se.map((e,t)=>t)}]},[a,se,he]),de=c({data:se,rawData:a,colorBy:void 0,colorScheme:void 0,legendInteraction:j,legendPosition:z,frameLegend:L,selection:R,linkedHover:_,fallbackFields:["string"==typeof d?d:"x"],unwrapData:!1,onObservation:H,onClick:I,hoverHighlight:P,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"WaterfallChart",chartId:F,showLegend:U,userMargin:n,marginDefaults:i.marginDefaults,loading:T,loadingContent:O,emptyContent:E,width:X,height:J,hasTitle:!!Z,axisChrome:ue(L,{showAxes:i.showAxes,xLabel:ie,yLabel:ae,axes:L.axes??me})}),pe=ui(()=>({positiveColor:y,negativeColor:g,connectorStroke:b,connectorWidth:x,gap:v,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity}),[y,g,b,x,v,e.stroke,e.strokeWidth,e.opacity]),fe=ui(()=>ke(V??(()=>({})),de.effectiveSelectionHook,de.resolvedSelection),[V,de.effectiveSelectionHook,de.resolvedSelection]),ge=ui(()=>M([{label:ie||B(d),accessor:d,role:"x",format:s},{label:ae||"Change",accessor:u,role:"y",format:m}]),[d,u,ie,ae,s,m]);if(de.earlyReturn)return de.earlyReturn;const be=l({componentName:"WaterfallChart",data:a,accessors:{xAccessor:d,yAccessor:u}});if(be)return yi(G,{componentName:"WaterfallChart",message:be,width:X,height:J});const xe={chartType:"waterfall",...null!=a&&{data:se},xAccessor:le,yAccessor:u,xScaleType:null!=a&&he?"linear":f,waterfallStyle:pe,areaStyle:fe,size:[X,J],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:de.margin,showAxes:i.showAxes,xLabel:ie,yLabel:ae,xFormat:ce,yFormat:m,enableHover:Y,showGrid:q,...me&&{axes:me},...de.legendBehaviorProps,...D({title:Z,description:K,summary:te,accessibleTable:oe,className:r,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:w,defaultTooltipContent:ge}),...N({linkedHover:_,selection:R,onObservation:H,onClick:I,hoverHighlight:P,hoverRadius:e.hoverRadius,mobileInteraction:de.mobileInteraction,customHoverBehavior:de.customHoverBehavior,customClickBehavior:de.customClickBehavior}),...p&&{pointIdAccessor:p},...S&&S.length>0&&{annotations:S},...k&&{xExtent:k},...C&&{yExtent:C},...$};return yi(Q,{componentName:"WaterfallChart",width:X,height:J,children:yi(A,{ref:o,...xe})})});gi.displayName="WaterfallChart";export{qe as Scatterplot,it as ConnectedScatterplot,st as XYCustomChart,lt as bumpXIdentity,ht as rankBumpData,Rt as BumpChart,Dt as AreaChart,Vt as DifferenceChart,Yt as StackedAreaChart,to as Heatmap,so as BubbleChart,Ro as ScatterplotMatrix,Eo as MinimapChart,Vo as DEFAULT_QUADRANTS,Yo as QuadrantChart,si as MultiAxisLineChart,di as CandlestickChart,gi as WaterfallChart};
@@ -0,0 +1 @@
1
+ var t={stops:[{offset:0,opacity:.8},{offset:1,opacity:.05}]};function o(o,e=t){if(o)return!0===o?e:"stops"in o?Array.isArray(o.stops)?o:void 0:"colorStops"in o?Array.isArray(o.colorStops)?{stops:o.colorStops.map(({offset:t,color:o})=>({offset:t,color:o}))}:void 0:{stops:[{offset:0,opacity:o.topOpacity??e.stops[0]?.opacity??.8},{offset:1,opacity:o.bottomOpacity??e.stops.at(-1)?.opacity??.05}]}}function e(t){return t?o(t):void 0}function s(t){if(t)return Array.isArray(t)?{stops:t.map(({at:t,color:o,opacity:e})=>({offset:t/100,color:o,...null!=e&&{opacity:e}}))}:Array.isArray(t.stops)?t:void 0}function n(t){const o=t?.stops.filter(t=>"string"==typeof t.color&&Number.isFinite(t.offset)).map(({offset:t,color:o,opacity:e})=>({offset:Math.max(0,Math.min(1,t)),color:o,...Number.isFinite(e)&&{opacity:Math.max(0,Math.min(1,e))}})).sort((t,o)=>t.offset-o.offset);if(!o?.length)return;const e=o[0];return e.offset>0?[{...e,offset:0},...o]:o}function r(t){return{stops:t.stops.map(t=>({...t,offset:1-t.offset})).sort((t,o)=>t.offset-o.offset)}}function f(t,o,e,s,n,r){const f=[];for(const n of t){const t=e(n),r=s(n);Number.isFinite(t)&&Number.isFinite(r)&&f.push({px:o.x(t),py:o.y(r),rawY:r,d:n})}f.sort((t,o)=>t.px-o.px);const i=Array(f.length),a=Array(f.length),c=Array(f.length);for(let t=0;f.length>t;t++){const o=f[t];i[t]=[o.px,o.py],a[t]=o.rawY,c[t]=o.d}return{type:"line",path:i,rawValues:a,style:n,datum:c,group:r}}function i(t,o,e,s,n,r,f,i){const a=[];for(const r of t){const t=e(r),f=s(r);if(!Number.isFinite(t)||!Number.isFinite(f))continue;const c=o.x(t),p=i?i(r):n;a.push({px:c,topY:o.y(f),botY:o.y(p),rawY:f})}a.sort((t,o)=>t.px-o.px);const c=Array(a.length),p=Array(a.length),u=Array(a.length);for(let t=0;a.length>t;t++){const o=a[t];c[t]=[o.px,o.topY],p[t]=[o.px,o.botY],u[t]=o.rawY}return{type:"area",topPath:c,bottomPath:p,rawValues:u,style:r,datum:t,group:f}}function a(t,o,e,s){const n=new Map;if("silhouette"===s)for(const s of t){let t=0;for(const n of o)t+=e(n,s)||0;n.set(s,-t/2)}else if("wiggle"===s){t.length>0&&n.set(t[0],0);for(let s=1;t.length>s;s++){const r=t[s-1],f=t[s];let i=0,a=0,c=0;for(const t of o){const o=e(t,f)||0;i+=(2*c+o)*(o-(e(t,r)||0)),a+=o,c+=o}const p=n.get(r)??0;n.set(f,p-(a>0?i/(2*a):0))}if(t.length>0){let s=0;for(const r of t){let t=0;for(const s of o)t+=e(s,r)||0;s+=(n.get(r)??0)+t/2}const r=s/t.length;for(const o of t)n.set(o,(n.get(o)??0)-r)}}else for(const o of t)n.set(o,0);return n}function c(t,o,e){let s=0,n=0;for(const r of t){let t=0,f=0;for(const s of o){const o=e(s,r)||0;0>o?f+=o:t+=o}s>f&&(s=f),t>n&&(n=t)}return[s,n]}function p(t,o,e,s,n,r,f,i="zero"){const c=new Set;for(const o of t)for(const t of o.data){const o=e(t);Number.isFinite(o)&&c.add(o)}const p=Array.from(c).sort((t,o)=>t-o),u=new Map;for(const o of t){const t=new Map;for(const n of o.data){const o=e(n),r=s(n);Number.isFinite(o)&&Number.isFinite(r)&&t.set(o,(t.get(o)||0)+r)}u.set(o.key,t)}let l;if(r){l=new Map;for(const o of p){let e=0;for(const s of t)e+=u.get(s.key)?.get(o)||0;l.set(o,e||1)}}const y=a(p,t.map(t=>t.key),(t,o)=>u.get(t)?.get(o)||0,i),m="diverging"===i&&!r,g=[],h=new Map,d=new Map,b=new Map,w=new Map;for(const t of p)d.set(t,y.get(t)??0),b.set(t,0),w.set(t,0);for(const e of t){const t=u.get(e.key),s=new Map;let i=[],a=[];const c=()=>{if(i.length>=2){const t={type:"area",topPath:i,bottomPath:a,style:n(e.key,e.data[0]),datum:e.data,group:e.key};f&&(t.curve=f),g.push(t)}i=[],a=[]};for(const e of p){const n=t.has(e);let f,p,u=n?t.get(e):0;if(r&&n&&(u/=l.get(e)),!n||!Number.isFinite(u)||0===u){c();continue}m?u>0?(f=b.get(e),p=f+u,b.set(e,p)):(f=w.get(e),p=f+u,w.set(e,p)):(f=d.get(e),p=f+u,d.set(e,p));const y=o.x(e);a.push([y,o.y(f)]),i.push([y,o.y(p)]),s.set(e,p)}c(),h.set(e.key,s)}return{nodes:g,stackedTops:h}}function u(t,o,e,s,n,r,f){const i=e(t),a=s(t);if(!Number.isFinite(i)||!Number.isFinite(a))return null;const c={type:"point",x:o.x(i),y:o.y(a),r:n,style:r,datum:t};return void 0!==f&&(c.pointId=f),c}function l(t,o,e,s,n,r,f,i){const a=e(t),c=s(t);if(!Number.isFinite(a)||!Number.isFinite(c))return null;const p={type:"symbol",x:o.x(a),y:o.y(c),size:n,symbolType:r,style:f,datum:t};return void 0!==i&&(p.pointId=i),p}function y(t,o,e,s,n,r,f){return{type:"rect",x:t,y:o,w:e,h:s,style:n,datum:r,group:f}}function m(t,o,e,s,n,r,f){const i={type:"heatcell",x:t,y:o,w:e,h:s,fill:n,datum:r};return void 0!==f?.value&&(i.value=f.value),f?.showValues&&(i.showValues=!0,f.valueFormat&&(i.valueFormat=f.valueFormat)),i}export{f as buildLineNode,i as buildAreaNode,a as computeStackOffsets,c as computeDivergingStackExtent,p as buildStackedAreaNodes,u as buildPointNode,l as buildSymbolNode,y as buildRectNode,m as buildHeatcellNode,o as normalizeGradient,e as normalizeColorGradient,s as normalizeSemanticGradient,n as semanticLineStopsForGradient,r as reverseGradient};
@@ -0,0 +1 @@
1
+ import{distinctCategories as e,filterSparseArray as t,getCrosshairProps as r,renderEmptyState as n,renderLoadingState as o,resolveMobileInteraction as a,useCategoryColors as i,useChartLegendAndMargin as u,useChartSelection as c,useColorScale as l,useLegendInteraction as s,useThemeCategorical as g}from"./c-VN2HG5BS.min.js";import{useThemeSelector as d}from"./c-VRXUB2F2.min.js";import{STREAMING_PALETTE as h,createColorScale as m,resolveExplicitColor as y}from"./c-EGR6VYBW.min.js";import{useMemo as p}from"react";function f(e){const t=d(e=>e.theme.colors.selectionOpacity);return p(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}import{useCallback as v,useMemo as L,useState as C}from"react";function k(d){const{data:p,rawData:k,colorBy:H,colorScheme:S,legendInteraction:M,legendPosition:B,selection:F,linkedHover:D,fallbackFields:P,unwrapData:b=!1,onObservation:w,chartType:A,chartId:I,showLegend:R,legend:T,legendLayout:x,frameLegend:O,userMargin:_,marginDefaults:j,onClick:N,hoverHighlight:V,mobileInteraction:G,mobileSemantics:W,loading:E,loadingContent:U,emptyContent:X,width:Y,height:q,hasTitle:z,axisChrome:J}=d,K=void 0===k,Q=L(()=>t(p),[p]),[Z,$]=C([]),ee=v(e=>{$(t=>t.length===e.length&&t.every((t,r)=>t===e[r])?t:e)},[]),te="string"==typeof H?H:void 0,re=L(()=>a(G,{width:Y,mobileSemantics:W}),[G,Y,W]),{activeSelectionHook:ne,hoverSelectionHook:oe,customHoverBehavior:ae,customClickBehavior:ie,crosshairSourceId:ue}=c({selection:F,linkedHover:D,fallbackFields:P,unwrapData:b,onObservation:w,chartType:A,chartId:I,onClick:N,hoverHighlight:V,colorByField:te,mobileInteraction:re}),ce=r(D,ue),le=l(Q,H,S),se=L(()=>e(Q,H),[Q,H]),ge=L(()=>K&&Z.length>0?Z:se,[K,Z,se]),de=s(M,H,ge),he=L(()=>oe||(de.legendSelectionHook?de.legendSelectionHook:ne),[oe,de.legendSelectionHook,ne]),me=f(F),ye=g(),pe=i(),fe=L(()=>{if(le)return le;if(!H||0===ge.length)return;const e=Array.isArray(S)&&S.length>0||"string"==typeof S&&S.length>0?S:ye&&ye.length>0?ye:h,t="__streamCat",r=ge.map(e=>({[t]:e})),n=m(r,t,e);return e=>(pe?y(pe,e):void 0)??n(e)??"#999"},[le,H,ge,S,ye,pe]),{legend:ve,margin:Le,legendPosition:Ce,legendLayout:ke,legendMarginReserved:He}=u({data:Q,colorBy:H,colorScale:fe,showLegend:R,legendPosition:B,userMargin:_,defaults:j,categories:ge,additionalLegend:T,chartWidth:Y,chartHeight:q,legendLayout:x,frameLegend:O,hasTitle:z,axisChrome:J}),Se=L(()=>{const e={};return ve&&(e.legend=ve,e.legendPosition=Ce,He&&(e.__legendMarginReservedFor=ve),ke&&(e.legendLayout=ke)),M&&"none"!==M&&(e.legendHoverBehavior=de.onLegendHover,e.legendClickBehavior=de.onLegendClick,e.legendHighlightedCategory=de.highlightedCategory,e.legendIsolatedCategories=de.isolatedCategories),K&&H&&(e.legendCategoryAccessor=H,e.onCategoriesChange=ee),e},[ve,Ce,ke,He,M,de.onLegendHover,de.onLegendClick,de.highlightedCategory,de.isolatedCategories,K,H,ee]),Me=Array.isArray(k)?t(k):k,Be=o(E,Y,q,U),Fe=Be?null:n(Me,Y,q,X);return{data:Q,colorScale:le,allCategories:ge,legendState:de,effectiveSelectionHook:he,activeSelectionHook:ne,customHoverBehavior:ae,customClickBehavior:ie,mobileInteraction:re,legend:ve,margin:Le,legendPosition:Ce,earlyReturn:Be||Fe||null,legendBehaviorProps:Se,crosshairProps:ce,resolvedSelection:me}}import{useImperativeHandle as H,useRef as S}from"react";function M(e,t){const{variant:r,frameRef:n,overrides:o}=t,a=S(o);a.current=o,H(e,()=>{const e=function(e,t){if("xy"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,r)=>e.current?.update(t,r)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{const r=Array.isArray(t)?t:[t],n=e.current?.getTopology()?.nodes??[],o=[];for(const t of r){const r=n.find(e=>e.id===t);r&&o.push({...r.data??{},id:t}),e.current?.removeNode(t)}return o},update:(t,r)=>(Array.isArray(t)?t:[t]).flatMap(t=>{const n=e.current?.updateNode(t,r);return n?[{...n,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,r)=>{const n=e.current?.removePoint(t)??[];for(const t of n)e.current?.push(r(t));return n},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const r=t;return{push:e=>r.current?.pushLine(e),pushMany:e=>r.current?.pushManyLines(e),remove:e=>r.current?.removeLine(e)??[],update:(e,t)=>{const n=r.current?.removeLine(e)??[];for(const e of n)r.current?.pushLine(t(e));return n},clear:()=>r.current?.clear(),getData:()=>r.current?.getLines()??[],getCustomLayout:()=>r.current?.getCustomLayout?.()??null,getLayoutFailure:()=>r.current?.getLayoutFailure?.()??null}}(r,n);return new Proxy(e,{get(e,t,r){if("string"==typeof t){const e=a.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,r)},has:(e,t)=>!("string"!=typeof t||!a.current||!(t in a.current))||Reflect.has(e,t)})},[])}export{f as useResolvedSelection,k as useChartSetup,M as useFrameImperativeHandle};
@@ -0,0 +1 @@
1
+ import{renderRectPulse as e}from"./c-UC5PTTFI.min.js";import{buildLinearFillGradient as o,clampCornerRadii as t,hasAnyCornerRadius as l,resolveCSSColor as r,resolveCanvasFill as n}from"./c-QKHMBE2E.min.js";function i(e,o){const{x:l,y:r,w:n,h:i}=o,{tl:c,tr:s,br:a,bl:y}=t(o);e.beginPath(),e.moveTo(l+c,r),e.lineTo(l+n-s,r),s>0&&e.arcTo(l+n,r,l+n,r+s,s),e.lineTo(l+n,r+i-a),a>0&&e.arcTo(l+n,r+i,l+n-a,r+i,a),e.lineTo(l+y,r+i),y>0&&e.arcTo(l,r+i,l,r+i-y,y),e.lineTo(l,r+c),c>0&&e.arcTo(l,r,l+c,r,c),e.closePath()}function c(e,t){const l=n(e,t.style.fill,r(e,"var(--semiotic-primary, #007bff)")),i=function(e){switch(e.roundedEdge){case"bottom":return{x0:e.x,y0:e.y+e.h,x1:e.x,y1:e.y};case"right":return{x0:e.x+e.w,y0:e.y,x1:e.x,y1:e.y};case"left":return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y};default:return{x0:e.x,y0:e.y,x1:e.x,y1:e.y+e.h}}}(t);return(t.fillGradient&&"string"==typeof l?o(e,t.fillGradient,l,i.x0,i.y0,i.x1,i.y1):null)||l}function s(e,o){if(!o.style.stroke||"none"===o.style.stroke)return!1;const t=o.style.strokeWidth??1;return t>0&&(e.strokeStyle=r(e,o.style.stroke)||o.style.stroke,e.lineWidth=t,!0)}var a=(o,t,r,n)=>{const a=t.filter(e=>"rect"===e.type);for(const t of a){if(null!=t.style.opacity&&(o.globalAlpha=t.style.opacity),t.style.icon)y(o,t);else if(t.cornerRadii&&l(t.cornerRadii))o.fillStyle=c(o,t),i(o,t),o.fill(),s(o,t)&&o.stroke();else if(t.roundedTop&&t.roundedTop>0){o.fillStyle=c(o,t);const e=Math.min(t.roundedTop,t.w/2,t.h/2);o.beginPath();const{x:l,y:r,w:n,h:i}=t;switch(t.roundedEdge){case"right":o.moveTo(l,r),o.lineTo(l+n-e,r),o.arcTo(l+n,r,l+n,r+e,e),o.lineTo(l+n,r+i-e),o.arcTo(l+n,r+i,l+n-e,r+i,e),o.lineTo(l,r+i);break;case"left":o.moveTo(l+n,r),o.lineTo(l+e,r),o.arcTo(l,r,l,r+e,e),o.lineTo(l,r+i-e),o.arcTo(l,r+i,l+e,r+i,e),o.lineTo(l+n,r+i);break;case"bottom":o.moveTo(l,r),o.lineTo(l+n,r),o.lineTo(l+n,r+i-e),o.arcTo(l+n,r+i,l+n-e,r+i,e),o.lineTo(l+e,r+i),o.arcTo(l,r+i,l,r+i-e,e);break;default:o.moveTo(l,r+i),o.lineTo(l,r+e),o.arcTo(l,r,l+e,r,e),o.lineTo(l+n-e,r),o.arcTo(l+n,r,l+n,r+e,e),o.lineTo(l+n,r+i)}o.closePath(),o.fill(),s(o,t)&&o.stroke()}else o.fillStyle=c(o,t),o.fillRect(t.x,t.y,t.w,t.h),s(o,t)&&o.strokeRect(t.x,t.y,t.w,t.h);e(o,t),o.globalAlpha=1}};function y(e,o){const t=o.style.icon,l=o.style.iconPadding||2,r=Math.min(o.w,o.h)-l;if(0>=r)return;const n=o.h>o.w;if(e.save(),e.beginPath(),e.rect(o.x,o.y,o.w,o.h),e.clip(),n){const n=r+l,i=o.x+(o.w-r)/2;for(let l=o.y+o.h-r;l>=o.y-r;l-=n)e.drawImage(t,i,l,r,r)}else{const n=r+l,i=o.y+(o.h-r)/2;for(let l=o.x;o.x+o.w>l;l+=n)e.drawImage(t,l,i,r,r)}e.restore()}export{a as barCanvasRenderer};
@@ -0,0 +1 @@
1
+ function t(t){return Math.round(100*t)/100}function n(n){const o=[0,0,0,0];let e=0;for(const[t,r]of n)null!==r&&(e++,o[0]+=t,o[1]+=r,o[2]+=t*t,o[3]+=t*r);const r=e*o[2]-o[0]*o[0],u=0===r?0:t((e*o[3]-o[0]*o[1])/r),s=t(o[1]/e-u*o[0]/e);return{points:n.map(([n])=>[t(n),t(u*n+s)]),equation:[u,s]}}function o(n,o=2){const e=[],r=[],u=o+1;for(let t=0;u>t;t++){let o=0;for(const[e,r]of n)null!==r&&(o+=e**t*r);e.push(o);const s=[];for(let o=0;u>o;o++){let e=0;for(const[r,u]of n)null!==u&&(e+=r**(t+o));s.push(e)}r.push(s)}r.push(e);const s=function(t,n){const o=t,e=t.length-1,r=[n];for(let t=0;e>t;t++){let n=t;for(let r=t+1;e>r;r++)Math.abs(o[t][r])>Math.abs(o[t][n])&&(n=r);for(let r=t;e+1>r;r++){const e=o[r][t];o[r][t]=o[r][n],o[r][n]=e}for(let n=t+1;e>n;n++)for(let r=e;r>=t;r--)o[r][n]-=o[r][t]*o[t][n]/o[t][t]}for(let t=e-1;t>=0;t--){let n=0;for(let u=t+1;e>u;u++)n+=o[u][t]*r[u];r[t]=(o[e][t]-n)/o[t][t]}return r}(r,u).map(t);return{points:n.map(([n])=>[t(n),t(s.reduce((t,o,e)=>t+o*n**e,0))]),equation:[...s].reverse()}}function e(t){const n=t.length;let o=0,e=0,r=0,u=0;for(const[n,s]of t)o+=n,e+=s,r+=n*n,u+=n*s;const s=n*r-o*o;if(1e-12>Math.abs(s))return null;const c=(n*u-o*e)/s,l=(e-c*o)/n;return t=>l+c*t}function r(t,n){const o=t.length,e=t.map(([t,o])=>o-n(t)).reduce((t,n)=>t+n*n,0),r=Math.sqrt(e/Math.max(o-2,1)),u=t.reduce((t,n)=>t+n[0],0)/o,s=t.reduce((t,n)=>t+(n[0]-u)**2,0);return{se:r,meanX:u,ssX:s}}function u(t){return.99>t?.95>t?.9>t?1:1.645:1.96:2.576}export{n as linearRegression,o as polynomialRegression,e as fitLinearForForecast,r as forecastIntervalStats,u as confidenceZScore};
@@ -0,0 +1 @@
1
+ var t={top:50,right:40,bottom:60,left:70},o={top:20,right:80,bottom:20,left:80},r={top:40,right:40,bottom:40,left:40},e=new Set(["chord","force","circlepack","orbit"]);function c(t){return e.has(t)?r:o}export{t as AXIS_FRAME_DEFAULT_MARGIN,c as networkFrameDefaultMargin};
@@ -0,0 +1 @@
1
+ import{makeHeatmapRuleContext as e}from"./c-A4WRGZFX.min.js";import{barXYPlugin as t,heatmapXYPlugin as n,swarmXYPlugin as o,waterfallXYPlugin as i}from"./c-VUBQNQJH.min.js";import{StreamXYFrame_default as s}from"./c-J6M4JHRS.min.js";import{lineXYPlugin as r,registerXYPlugin as a}from"./c-TMOSJLT3.min.js";import{useStreamingLegend as l}from"./c-3VVKFA4M.min.js";import{buildCustomBehaviorProps as c,extractCategoryDomain as u,mergeShapeStyle as m}from"./c-AG7WWVIH.min.js";import{MultiPointTooltip as d,composeStyleRules as h,makeXYRuleContext as g,normalizeLinkedBrush as p,renderEmptyState as v,renderLoadingState as f,resolveBoundedCategoryIndex as y,resolveMultiCapableTooltip as w,resolveTooltipContent as x,useBrushSelection as b,useCategoryColors as k,useChartLegendAndMargin as A,useChartMode as _,useChartSelection as C,useGradientLegendInteraction as S,useLegendInteraction as H,useLinkedChartsActive as P,useThemeCategorical as T,wrapStyleWithSelection as I}from"./c-VN2HG5BS.min.js";import{DEFAULT_COLORS as M,STREAMING_PALETTE as R,getSequentialInterpolator as F,resolveExplicitColor as N}from"./c-EGR6VYBW.min.js";var B=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;const t=e-this._mean;this._mean+=t/this._count,this._m2+=t*(e-this._mean),this._min>e&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);const t=this._count+e._count,n=e._mean-this._mean;this._mean+=n*e._count/t,this._m2+=e._m2+n*n*this._count*e._count/t,this._count=t,this._min>e._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){const t=new e;return t._count=this._count,t._mean=this._mean,t._m2=this._m2,t._min=this._min,t._max=this._max,t}get count(){return this._count}get mean(){return 0===this._count?0:this._mean}get sum(){return 0===this._count?0:this._mean*this._count}get variance(){return 2>this._count?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return 2>this._count?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},z=class{constructor(e){this.windows=new Map,this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;const t=e.hop??e.size;this.hop=t>0&&e.size>=t?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0}push(e,t){Number.isFinite(e)&&Number.isFinite(t)&&(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t):this.pushFixed(e,t),this.prune())}pushFixed(e,t){if("tumbling"===this.type||this.hop>=this.size)return void this.bump(Math.floor(e/this.size)*this.size,t);const n=this.hop,o=Math.floor(e/n);for(let i=Math.floor((e-this.size)/n)+1;o>=i;i++)this.bump(i*n,t)}bump(e,t){let n=this.windows.get(e);n||(n=new B,this.windows.set(e,n)),n.push(t)}pushSession(e,t){const n=this.gap,o=new B;o.push(t);let i=e,s=e;const r=[],a={start:i,end:s,stats:o};for(const t of this.sessions)e-n>t.end||t.start>e+n?r.push(t):(a.stats.merge(t.stats),i>t.start&&(i=t.start),t.end>s&&(s=t.end));a.start=i,a.end=s,r.push(a),r.sort((e,t)=>e.start-t.start),this.sessions=r}prune(){if(this.retain===1/0)return;if("session"===this.type)return void(this.sessions.length>this.retain&&(this.sessions=this.sessions.slice(this.sessions.length-this.retain)));if(this.retain>=this.windows.size)return;const e=[...this.windows.keys()].sort((e,t)=>e-t),t=e.length-this.retain;for(let n=0;t>n;n++)this.windows.delete(e[n])}emit(){return"session"===this.type?this.emitSessions():this.emitFixed()}emitFixed(){const e=[];for(const[t,n]of this.windows){const o=t+this.size;e.push(this.row(t,o,n,o>this.latest))}return e.sort((e,t)=>e.start-t.start),e}emitSessions(){return this.sessions.map(e=>this.row(e.start,e.end,e.stats,this.gap>this.latest-e.end))}row(e,t,n,o){return{start:e,end:t,count:n.count,mean:n.mean,sum:n.sum,min:n.min,max:n.max,stddev:n.stddev,partial:o}}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.sessions=[],this.latest=-1/0}};function D(e,t){switch(t){case"sum":return e.sum;case"min":return e.min;case"max":return e.max;case"count":return e.count;default:return e.mean}}function L(e,t,n,o=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];const i=D(e,n),s=e.stddev*o;return[i-s,i+s]}var O={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},E=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g;function j(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;const t=e.trim();if(""===t)return null;E.lastIndex=0;let n,o=0,i=0;for(;null!==(n=E.exec(t));){const e=parseFloat(n[1]),t=O[n[2]];if(null==t||!Number.isFinite(e))return null;o+=e*t,i+=n[0].length}return i!==t.length?null:o>0?o:null}var W=class{constructor(e){this.held=[],this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){const t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};const n=[];return this._watermark!==-1/0&&Math.max(this._watermark-this.lateness,this._releasedThrough)>t?(this._lateCount+=1,n.push(e),"drop"===this.latePolicy?{released:[],late:n}:{released:[e],late:n}):(t>this._watermark&&(this._watermark=t),this.held.push(e),{released:this.drain(),late:n})}drain(){const e=this._watermark-this.lateness;if(0===this.held.length)return[];const t=[],n=[];for(const o of this.held)this.getTime(o)>e?n.push(o):t.push(o);return this.held=n,t.sort((e,t)=>this.getTime(e)-this.getTime(t)),this.markReleased(t),t}flush(){const e=this.held;return this.held=[],e.sort((e,t)=>this.getTime(e)-this.getTime(t)),this.markReleased(e),e}markReleased(e){for(const t of e){const e=this.getTime(t);Number.isFinite(e)&&e>this._releasedThrough&&(this._releasedThrough=e)}}clear(){this.held=[],this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}};import{useRef as V,useImperativeHandle as $,forwardRef as G,useCallback as K,useState as J,useEffect as X,useMemo as Y}from"react";import{jsx as q,jsxs as Q}from"react/jsx-runtime";var U={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},Z={opacity:.7,marginRight:4};function ee(e,t,n){if(null!=e)return"function"==typeof t?t(e):e["string"==typeof t?t:n]}function te(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function ne(e={}){const{timeAccessor:t,valueAccessor:n,xLabel:o="x",yLabel:i="y"}=e;return e=>{const s=e?.data??null,r=ee(s,t,"time"),a=ee(s,n,"value");return Q("div",{className:"semiotic-tooltip",style:U,children:[Q("div",{children:[Q("span",{style:Z,children:[o,":"]}),te(r)]}),Q("div",{children:[Q("span",{style:Z,children:[i,":"]}),te(a)]})]})}}function oe(e={}){const{timeAccessor:t,valueAccessor:n}=e;return e=>{const o=e?.data??null,i=ee(o,t,"time"),s=o?.delta??ee(o,n,"value"),r=o?.cumEnd,a="number"==typeof s?0>s?te(s):"+"+te(s):te(s);return Q("div",{className:"semiotic-tooltip",style:U,children:[Q("div",{children:[q("span",{style:Z,children:"x:"}),te(i)]}),Q("div",{children:[q("span",{style:Z,children:"Δ:"}),a]}),null!=r&&Q("div",{children:[q("span",{style:Z,children:"total:"}),te(r)]})]})}}function ie(e={}){const{timeAccessor:t,valueAccessor:n}=e;return e=>{const o=e?.data??null;if(null==o?.binStart||null==o?.binEnd){const e=ee(o,t,"time"),i=ee(o,n,"value");return Q("div",{className:"semiotic-tooltip",style:U,children:[Q("div",{children:[q("span",{style:Z,children:"x:"}),te(e)]}),Q("div",{children:[q("span",{style:Z,children:"y:"}),te(i)]})]})}return Q("div",{className:"semiotic-tooltip",style:U,children:[Q("div",{children:[q("span",{style:Z,children:"range:"}),te(o.binStart),"–",te(o.binEnd)]}),null!=o.total&&Q("div",{children:[q("span",{style:Z,children:"count:"}),te(o.total)]}),null!=o.category&&Q("div",{children:[q("span",{style:Z,children:"category:"}),te(o.category)]})]})}}function se(e={}){const{timeAccessor:t,valueAccessor:n,xLabel:o="x",yLabel:i="y"}=e;return e=>{const s=e?.data??null,r=s?.xCenter??ee(s,t,"time"),a=s?.yCenter??ee(s,n,"value"),l=s?.count,c=s?.sum,u=s?.value,m=s?.agg??"count";return Q("div",{className:"semiotic-tooltip",style:U,children:[Q("div",{children:[Q("span",{style:Z,children:[o,":"]}),te(r)]}),Q("div",{children:[Q("span",{style:Z,children:[i,":"]}),te(a)]}),null!=l&&Q("div",{children:[q("span",{style:Z,children:"count:"}),te(l)]}),"sum"===m&&null!=c&&Q("div",{children:[q("span",{style:Z,children:"sum:"}),te(c)]}),"mean"===m&&null!=u&&Q("div",{children:[q("span",{style:Z,children:"mean:"}),te(u)]})]})}}function re(e,t){return null!=e?e:Math.max(t?.length??0,200)}var ae="time",le="value",ce="__aggLower",ue="__aggUpper",me="__aggPartial",de="count",he="__aggStart",ge="__aggEnd";function pe(e,t){const n=t.stat??"mean",o=t.band??"none",i=t.sigma??1;return e.emit().map(e=>{const t={[ae]:(e.start+e.end)/2,[le]:D(e,n),[de]:e.count,[me]:e.partial,[he]:e.start,[ge]:e.end},s=L(e,o,n,i);return s&&(t[ce]=s[0],t[ue]=s[1]),t})}import*as ve from"react";function fe(e,t,n){const o="function"==typeof t?t(e):e[(t??n)+""];if(null==o)return null;if(o instanceof Date)return o.getTime();const i=Number(o);return Number.isFinite(i)?i:null}function ye(e){return _(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showLegend:e.showLegend,enableHover:null==e.enableHover?void 0:!!e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules})}function we(e,t){ve.useImperativeHandle(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,n)=>t.current?.update(e,e=>n(e))??[],clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t])}var xe=()=>({});function be(e,t,n){const o=t.find(Boolean)??null;return ve.useMemo(()=>o?I(e??xe,o,n):e,[o,e,n])}function ke(e,t,n){return{title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,legendHoverBehavior:t.onLegendHover,legendClickBehavior:t.onLegendClick,legendHighlightedCategory:t.highlightedCategory,legendIsolatedCategories:"isolate"===n?t.isolatedCategories:void 0}}import{jsx as Ae}from"react/jsx-runtime";a(r);var _e=G(function(e,t){const n=ye(e),{size:o,margin:i,className:r,arrowOfTime:a="right",windowMode:l="sliding",windowSize:u,data:p,timeAccessor:y,valueAccessor:x,timeExtent:b,valueExtent:k,extentPadding:_,stroke:S,strokeWidth:P,strokeDasharray:T,opacity:I,cursor:M,styleRules:R,background:F,tooltipContent:N,tooltip:B,onHover:D,annotations:L,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:G,tickFormatValue:q,decay:Q,pulse:U,staleness:Z,transition:ee,linkedHover:te,selection:oe,onObservation:ie,chartId:se,loading:me,loadingContent:de,emptyContent:he,emphasis:ge,legendPosition:ve,aggregate:we,eventTime:xe}=e,_e=n.showAxes,Ce=n.enableHover,Se=o??[n.width,n.height],He=S??"#007bff",Pe=P??2,Te="string"==typeof x?x:"Value",Ie=Y(()=>{if(n.showLegend)return{legendGroups:[{label:"Series",type:"line",items:[{label:Te,color:He}],styleFn:e=>({stroke:e.color||"var(--semiotic-primary, #007bff)",strokeWidth:Pe??2})}]}},[n.showLegend,Te,He,Pe]),Me=H(e.legendInteraction,()=>Te,[Te]),{legend:Re,margin:Fe,legendPosition:Ne}=A({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ve,userMargin:i,defaults:n.marginDefaults,additionalLegend:Ie,chartWidth:Se[0],chartHeight:Se[1],axisChrome:{hasAxis:!1!==n.showAxes}}),Be=ne({timeAccessor:y,valueAccessor:x}),ze=d(),De=w({tooltip:B,defaultTooltipContent:Be,customFunctionContext:"hover",multiDefaultContent:e=>ze({...e,allSeries:Array.isArray(e.allSeries)?e.allSeries.map(e=>({...e,group:e.group||("string"==typeof x?x:"value")})):e.allSeries})}),Le=N??De.tooltipContent,Oe=V(null),{activeSelectionHook:Ee,customHoverBehavior:je,customClickBehavior:We}=C({selection:oe,linkedHover:te,unwrapData:!0,onObservation:ie,chartType:"RealtimeLineChart",chartId:se,mobileInteraction:n.mobileInteraction}),Ve=K(e=>{D&&D(e),je(e)},[D,je]),$e=null!=we,[Ge,Ke]=J([]),Je=V(null),Xe=V(we);Xe.current=we;const Ye=V($e);Ye.current=$e;const qe=V(Ge);qe.current=Ge;const Qe=V({timeAccessor:y,valueAccessor:x});Qe.current={timeAccessor:y,valueAccessor:x},X(()=>{if(!$e)return void(Je.current=null);const e=Xe.current,t=function(e){const t=e.window??"tumbling",n=j("session"===t?e.gap??e.size:e.size);if(null==n)return null;const o=null!=e.hop?j(e.hop):void 0,i=null!=e.gap?j(e.gap):void 0;return new z({window:t,size:n,hop:o??void 0,gap:i??void 0,retain:e.retain})}(e);if(Je.current=t,t&&p){const{timeAccessor:e,valueAccessor:n}=Qe.current;for(const o of p){const i=fe(o,e,"time"),s=fe(o,n,"value");null!=i&&null!=s&&t.push(i,s)}}Ke(t?pe(t,e):[])},[$e?[we.window??"tumbling",we.size,we.hop??"",we.gap??"",we.retain??""].join("|"):"",$e,p,y,x]),X(()=>{$e&&Je.current&&Ke(pe(Je.current,Xe.current))},[we?.stat,we?.band,we?.sigma]);const Ue=K(e=>{const t=Je.current,n=Xe.current;if(!t||!n)return;const{timeAccessor:o,valueAccessor:i}=Qe.current;for(const n of e){const e=fe(n,o,"time"),s=fe(n,i,"value");null!=e&&null!=s&&t.push(e,s)}Ke(pe(t,n))},[]),Ze=null!=xe,et=V(null),tt=V(xe);tt.current=xe;const nt=V(Ze);nt.current=Ze;const ot=V(ie);ot.current=ie;const it=V(se);it.current=se;const st=Ze?`${xe.lateness}|${xe.latePolicy??"drop"}`:"",rt=K(e=>{0!==e.length&&(Ye.current?Ue(e):Oe.current?.pushMany(e))},[Ue]);X(()=>{const e=et.current;if(e&&rt(e.flush()),!Ze)return void(et.current=null);const t=y;et.current=function(e){const n=j(e.lateness);return null==n?null:new W({lateness:n,getTime:e=>fe(e,t,"time")??NaN,latePolicy:e.latePolicy??"drop"})}(tt.current)},[st,Ze,rt,y]);const at=K(e=>{const t=et.current;if(!nt.current||!t)return void rt(e);const n=[];for(const o of e){const e=t.push(o);if(e.released.length&&n.push(...e.released),e.late.length){const n=ot.current;if(n){const{timeAccessor:o}=Qe.current,i=tt.current?.latePolicy??"drop";for(const s of e.late)n({type:"late-data",datum:s,eventTime:fe(s,o,"time")??NaN,watermark:t.watermark,policy:i,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:it.current})}}}rt(n)},[rt]),lt=K(()=>{const e=et.current;nt.current&&e&&rt(e.flush())},[rt]);$(t,()=>({push:e=>at([e]),pushMany:e=>at(e),flush:lt,remove:e=>Ye.current?[]:Oe.current?.remove(e)??[],update:(e,t)=>Ye.current?[]:Oe.current?.update(e,t)??[],clear:()=>{et.current?.clear(),Ye.current?(Je.current?.clear(),Ke([])):Oe.current?.clear()},getData:()=>Ye.current?qe.current:Oe.current?.getData()??[],getScales:()=>Oe.current?.getScales()??null}),[lt,at]);const ct=f(me,Se[0],Se[1],de),ut=ct?null:v($e?void 0:p,Se[0],Se[1],he),mt=Y(()=>()=>({stroke:"#007bff",strokeWidth:2}),[]),dt=Y(()=>g($e?ae:y??"time",$e?le:x??"value"),[$e,y,x]),ht=Y(()=>h(mt,R,dt),[mt,R,dt]),gt=Y(()=>m(ht,{stroke:S,strokeWidth:P,opacity:I}),[ht,S,P,I]),pt=Y(()=>e=>({...gt(e),...null!=T&&{strokeDasharray:T},...null!=M&&{cursor:M}}),[gt,T,M]),vt=be(pt,[Ee],oe),ft=re(u,p),yt=ge?`${r||""} semiotic-emphasis-${ge}`.trim():r,wt=$e?Ge:p,xt=$e?ae:y,bt=$e?le:x,kt=$e?"growing":l,At=$e?Math.max(1,we?.retain??Math.max(Ge.length,600)):ft,_t=$e&&we&&"none"!==(we.band??"none")?{y0Accessor:ce,y1Accessor:ue,perSeries:!1}:void 0;return ct||ut||Ae(s,{ref:Oe,chartType:"line",runtimeMode:"streaming",size:Se,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Fe,className:yt,...ke(n,Me,e.legendInteraction),arrowOfTime:a,windowMode:kt,windowSize:At,data:wt,timeAccessor:xt,valueAccessor:bt,xExtent:b,yExtent:k,extentPadding:_,band:_t,lineStyle:vt??pt,showAxes:_e,background:F,hoverAnnotation:Ce,tooltipContent:Le,tooltipMode:De.tooltipMode,...c({linkedHover:te,selection:oe,onObservation:ie,forceHoverBehavior:!0,mobileInteraction:n.mobileInteraction,customHoverBehavior:Ve,customClickBehavior:We}),annotations:L,legend:Re,legendPosition:Ne,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:G,tickFormatValue:q,decay:Q,pulse:U,staleness:Z,transition:ee,pointIdAccessor:e.pointIdAccessor})});_e.displayName="RealtimeLineChart";import{useRef as Ce,forwardRef as Se,useCallback as He,useMemo as Pe}from"react";function Te(e,t,n){const o="function"==typeof t?t(e):e[t??n];if(null==o)return null;if(o instanceof Date)return o.getTime();if("string"==typeof o&&""===o.trim())return null;const i=Number(o);return Number.isFinite(i)?i:null}import{useEffect as Ie,useLayoutEffect as Me,useMemo as Re,useRef as Fe}from"react";var Ne=Symbol("realtime-function-category-domain"),Be="undefined"==typeof window?Ie:Me;function ze({enabled:e,categories:t,colors:n,fallbackColor:o,order:i="discovery",domainKey:s}){const r=k(),a=P(),l=T(),c="function"==typeof s?Ne:s,u=Fe(null),m=Re(()=>{const e=u.current,o=e&&Object.is(e.domainKey,c)?new Map(e.indexes):new Map,s=new Set(t),r="explicit-then-alpha"===i?[...Object.keys(n??{}).filter(e=>s.has(e)),...t.filter(e=>!Object.prototype.hasOwnProperty.call(n??{},e)).sort()]:t;for(const e of r)y(o,e);return{domainKey:c,indexes:o}},[t,n,i,c]);Be(()=>{u.current=m},[m]);const d=m.indexes,h=Re(()=>{if(!e)return;const t=l&&l.length>0?l:a?M:R;return e=>{const i=y(d,e),s=r?N(r,e):void 0;if(s)return s;return(n?N(n,e):void 0)||o||t[i%t.length]}},[d,n,e,o,a,r,l]),g=Re(()=>{if(!e||!h)return n;const o=Object.keys(n??{}),s=new Set(o),r=t.filter(e=>!s.has(e));"explicit-then-alpha"===i&&r.sort();const a=[...o,...r];if(0===a.length)return;const l=new Set(t),c=[];for(const e of a){if(l.has(e)){c.push([e,h(e)]);continue}const t=n?N(n,e):void 0;t&&c.push([e,t])}return c.length>0?Object.fromEntries(c):void 0},[t,h,n,e,i]);return{colorScale:h,colorMap:g}}import{jsx as De}from"react/jsx-runtime";a(t);var Le=[],Oe=Se(function(e,t){const n=ye(e),{binSize:o,size:i,margin:r,className:a,arrowOfTime:m="right",windowMode:d="sliding",windowSize:g,data:y,timeAccessor:w,valueAccessor:k,direction:_="up",timeExtent:S,valueExtent:P,extentPadding:T,categoryAccessor:I,colors:M,fill:R,stroke:F,strokeWidth:N,opacity:B,cursor:z,styleRules:D,gap:L,background:O,tooltipContent:E,tooltip:j,onHover:W,annotations:V,autoPlaceAnnotations:$,svgAnnotationRules:G,tickFormatTime:K,tickFormatValue:J,linkedHover:X,selection:Y,decay:q,pulse:Q,staleness:U,transition:Z,onObservation:ee,chartId:te,loading:ne,loadingContent:oe,emptyContent:se,emphasis:ae,legendPosition:le,legend:ce,brush:ue,onBrush:me,linkedBrush:de}=e,he=n.showAxes,ge=n.enableHover,pe=i??[n.width,n.height],ve=l({isPushMode:void 0===y,colorBy:I,colorScheme:M,showLegend:!1,legendPosition:le,trackCategoryDomain:!1!==n.showLegend,registerLinkedCategories:!1}),fe=Pe(()=>u(y??[],I),[y,I]),xe=void 0===y?ve.categories:fe,{colorScale:Ae,colorMap:_e}=ze({enabled:!!I,categories:xe,colors:M,fallbackColor:R,order:"explicit-then-alpha",domainKey:I}),Se=Pe(()=>{if(!_e)return xe;const e=new Set(xe);return Object.keys(_e).filter(t=>e.has(t))},[xe,_e]),Ie=He(e=>null!=e.category?e.category+"":("function"==typeof I?I(e):I?e[I]:"")+"",[I]),{legend:Me,margin:Re,legendPosition:Fe,hasAutomaticLegend:Ne}=A({data:Le,colorBy:I,colorScale:Ae,showLegend:n.showLegend,legendPosition:le,userMargin:r,defaults:n.marginDefaults,categories:Se,additionalLegend:ce,chartWidth:pe[0],chartHeight:pe[1],axisChrome:{hasAxis:!1!==n.showAxes}}),Be=H(e.legendInteraction,I?Ie:void 0,Se,Ne,!0),Oe=E??x({tooltip:j,defaultTooltipContent:ie({timeAccessor:w,valueAccessor:k}),customFunctionContext:"hover"}).tooltipContent,Ee=Ce(null),{activeSelectionHook:je,hoverSelectionHook:We,customHoverBehavior:Ve,customClickBehavior:$e}=C({selection:Y,linkedHover:X,unwrapData:!0,onObservation:ee,chartType:"RealtimeHistogram",chartId:te,mobileInteraction:n.mobileInteraction}),Ge=He(e=>{W&&W(e),Ve(e)},[W,Ve]),Ke=!0===ue?{dimension:"x",snap:"bin"}:"x"===ue?{dimension:"x"}:"object"==typeof ue?ue:void 0,Je=p(de),Xe="string"==typeof w?w:"time",Ye=b({name:Je?.name||"__unused_hist_brush__",xField:Je?.xField||Xe,...Je?.yField?{yField:Je.yField}:{}}),qe=Ce(Ye.brushInteraction);qe.current=Ye.brushInteraction;const Qe=He(e=>{if(me&&me(e),ee&&ee(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:te}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:te}),Je){const t=qe.current;t.end(e?"xBrush"===t.brush?e.x:"yBrush"===t.brush?e.y:[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:null)}},[me,ee,te,Je]);we(t,Ee);const Ue=f(ne,pe[0],pe[1],oe),Ze=Ue?null:v(y,pe[0],pe[1],se),et={};null!=R&&(et.fill=R),null!=F&&(et.stroke=F),null!=N&&(et.strokeWidth=N),null!=B&&(et.opacity=B),null!=z&&(et.cursor=z),null!=L&&(et.gap=L);const tt=Pe(()=>{if(I&&Ae)return e=>null==e.category?{}:{fill:Ae(e.category+"")}},[I,Ae]),nt=Pe(()=>e=>{const t=e.categoryValue??e.total,n="number"==typeof t&&Number.isFinite(t)?t:void 0,o=Number(e.binStart),i=Number(e.binEnd);return{value:n,x:Number.isFinite(o)&&Number.isFinite(i)?(o+i)/2:void 0,y:n,category:null==e.category?void 0:e.category+""}},[]),ot=Pe(()=>h(tt,D,nt),[tt,D,nt]),it=be(Pe(()=>e=>({...ot(e),...!I&&null!=R&&{fill:R},...null!=F&&{stroke:F},...null!=N&&{strokeWidth:N},...null!=B&&{opacity:B},...null!=z&&{cursor:z}}),[ot,I,R,F,N,B,z]),[We||Be.legendSelectionHook||je],Y),st=ae?`${a||""} semiotic-emphasis-${ae}`.trim():a,rt=re(g,y),at=Pe(()=>"down"!==_?P:function({data:e,valueAccessor:t,timeAccessor:n,binSize:o,valueExtent:i,extentPadding:s}){if(i)return[i[1],i[0]];if(!e||0===e.length)return;const r=new Map;for(const i of e){const e=Te(i,n,"time"),s=Te(i,t,"value");if(null==e||null==s)continue;const a=Math.floor(e/o)*o;r.set(a,(r.get(a)??0)+s)}let a=0;for(const e of r.values())a=Math.max(a,e);return[a>0?a+a*(s??.1):1,0]}({data:y,valueAccessor:k,timeAccessor:w,binSize:o,valueExtent:P,extentPadding:T}),[_,y,k,w,o,P,T]);return Ue||Ze||De(s,{ref:Ee,chartType:"bar",runtimeMode:"streaming",size:pe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Re,className:st,...ke(n,Be,e.legendInteraction),arrowOfTime:m,windowMode:d,windowSize:rt,data:y,timeAccessor:w,valueAccessor:k,xExtent:S,yExtent:at,extentPadding:T,binSize:o,categoryAccessor:I,barColors:_e,barStyle:et,areaStyle:it,showAxes:he,background:O,hoverAnnotation:ge,tooltipContent:Oe,...c({linkedHover:X,selection:Y,onObservation:ee,forceHoverBehavior:!0,mobileInteraction:n.mobileInteraction,customHoverBehavior:Ge,customClickBehavior:$e}),annotations:V,autoPlaceAnnotations:$,svgAnnotationRules:G,tickFormatTime:K,tickFormatValue:J,decay:q,pulse:Q,staleness:U,transition:Z,pointIdAccessor:e.pointIdAccessor,legend:Me,legendPosition:Fe,...ve.categoryDomainProps,brush:Ke||(de?{dimension:"x"}:void 0),onBrush:Ke||de?Qe:void 0})});function Ee(e){return De(Oe,{...e,windowMode:"growing"})}Oe.displayName="RealtimeHistogram",Ee.displayName="TemporalHistogram";var je=Oe;import{useRef as We,forwardRef as Ve,useCallback as $e,useMemo as Ge}from"react";import{jsx as Ke}from"react/jsx-runtime";a(o);var Je=[],Xe=Ve(function(e,t){const n=ye(e),{size:o,margin:i,className:r,arrowOfTime:a="right",windowMode:m="sliding",windowSize:d,data:p,timeAccessor:y,valueAccessor:w,timeExtent:b,valueExtent:k,yScaleType:_,extentPadding:S,decay:P,pulse:T,staleness:I,transition:M,categoryAccessor:R,colors:F,radius:N,fill:B,opacity:z,stroke:D,strokeWidth:L,cursor:O,pointStyle:E,styleRules:j,background:W,tooltipContent:V,tooltip:$,onHover:G,annotations:K,autoPlaceAnnotations:J,svgAnnotationRules:X,tickFormatTime:Y,tickFormatValue:q,linkedHover:Q,selection:U,onObservation:Z,chartId:ee,loading:te,loadingContent:oe,emptyContent:ie,emphasis:se,legendPosition:ae}=e,le=n.showAxes,ce=n.enableHover,ue=!0===n.showLegend,me=o??[n.width,n.height],de=l({isPushMode:void 0===p,colorBy:R,colorScheme:F,showLegend:!1,legendPosition:ae,trackCategoryDomain:ue,registerLinkedCategories:!1}),he=Ge(()=>u(p??[],R),[p,R]),ge=void 0===p?de.categories:he,{colorScale:pe}=ze({enabled:!!R,categories:ge,colors:F,fallbackColor:B,domainKey:R}),{legend:ve,margin:fe,legendPosition:xe,hasAutomaticLegend:Ae}=A({data:Je,colorBy:R,colorScale:pe,showLegend:ue,legendPosition:ae,userMargin:i,defaults:n.marginDefaults,categories:ge,chartWidth:me[0],chartHeight:me[1],axisChrome:{hasAxis:!1!==n.showAxes}}),_e=H(e.legendInteraction,R,ge,Ae,!0),Ce=V??x({tooltip:$,defaultTooltipContent:ne({timeAccessor:y,valueAccessor:w}),customFunctionContext:"hover"}).tooltipContent,Se=We(null),{activeSelectionHook:He,hoverSelectionHook:Pe,customHoverBehavior:Te,customClickBehavior:Ie}=C({selection:U,linkedHover:Q,unwrapData:!0,onObservation:Z,chartType:"RealtimeSwarmChart",chartId:ee,mobileInteraction:n.mobileInteraction}),Me=$e(e=>{G&&G(e),Te(e)},[G,Te]);we(t,Se);const Re=f(te,me[0],me[1],oe),Fe=Re?null:v(p,me[0],me[1],ie),Ne={};null!=N&&(Ne.radius=N),null!=B&&(Ne.fill=B),null!=z&&(Ne.opacity=z),null!=D&&(Ne.stroke=D),null!=L&&(Ne.strokeWidth=L),null!=O&&(Ne.cursor=O);const Be=E,De=Ge(()=>{if(R)return e=>{const t="function"==typeof R?R(e):R?e[R]:void 0;return{...R&&pe?{fill:pe(t+"")}:void 0}}},[R,pe]),Le=Ge(()=>{const e=g(y??"time",w??"value");return t=>{const n="function"==typeof R?R(t):R?t[R]:void 0;return e(t,null==n?void 0:n+"")}},[y,w,R]),Oe=Ge(()=>h(De,j,Le),[De,j,Le]),Ee=be(Ge(()=>e=>({...Oe(e),...Be?.(e)}),[Oe,Be]),[Pe||_e.legendSelectionHook||He],U),je=se?`${r||""} semiotic-emphasis-${se}`.trim():r,Ve=re(d,p);return Re||Fe||Ke(s,{ref:Se,chartType:"swarm",runtimeMode:"streaming",size:me,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:fe,className:je,...ke(n,_e,e.legendInteraction),arrowOfTime:a,windowMode:m,windowSize:Ve,data:p,timeAccessor:y,valueAccessor:w,xExtent:b,yExtent:k,yScaleType:_,extentPadding:S,decay:P,pulse:T,staleness:I,transition:M,categoryAccessor:R,swarmStyle:Ne,pointStyle:Ee,showAxes:le,background:W,hoverAnnotation:ce,tooltipContent:Ce,...c({linkedHover:Q,selection:U,onObservation:Z,forceHoverBehavior:!0,mobileInteraction:n.mobileInteraction,customHoverBehavior:Me,customClickBehavior:Ie}),annotations:K,autoPlaceAnnotations:J,svgAnnotationRules:X,tickFormatTime:Y,tickFormatValue:q,legend:ve,legendPosition:xe,...de.categoryDomainProps,pointIdAccessor:e.pointIdAccessor})});Xe.displayName="RealtimeSwarmChart";import{useRef as Ye,forwardRef as qe,useCallback as Qe,useMemo as Ue}from"react";import{jsx as Ze}from"react/jsx-runtime";a(i);var et=qe(function(e,t){const n=ye(e),{size:o,margin:i,className:r,arrowOfTime:a="right",windowMode:l="sliding",windowSize:u,data:m,timeAccessor:d,valueAccessor:p,timeExtent:y,valueExtent:w,extentPadding:b,decay:k,pulse:_,staleness:S,transition:P,positiveColor:T,negativeColor:I,connectorStroke:M,connectorWidth:R,gap:F,stroke:N,strokeWidth:B,opacity:z,cursor:D,styleRules:L,background:O,tooltipContent:E,tooltip:j,onHover:W,annotations:V,autoPlaceAnnotations:$,svgAnnotationRules:G,tickFormatTime:K,tickFormatValue:J,linkedHover:X,selection:Y,onObservation:q,chartId:Q,loading:U,loadingContent:Z,emptyContent:ee,emphasis:te,legendPosition:ne}=e,ie=n.showAxes,se=n.enableHover,ae=o??[n.width,n.height],le=Ue(()=>{if(n.showLegend)return{legendGroups:[{label:"Change",type:"fill",items:[{label:"Positive",color:T},{label:"Negative",color:I}],styleFn:e=>({fill:e.color||("Positive"===e.label?"var(--semiotic-success, #28a745)":"var(--semiotic-danger, #dc3545)")})}]}},[I,T,n.showLegend]),ce=Qe(e=>{const t=e.delta??("function"==typeof p?p(e):e[p??"value"]);return 0>Number(t)?"Negative":"Positive"},[p]),ue=H(e.legendInteraction,ce,["Positive","Negative"]),{legend:me,margin:de,legendPosition:he}=A({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ne,userMargin:i,defaults:n.marginDefaults,additionalLegend:le,chartWidth:ae[0],chartHeight:ae[1],axisChrome:{hasAxis:!1!==n.showAxes}}),ge=E??x({tooltip:j,defaultTooltipContent:oe({timeAccessor:d,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,pe=Ye(null),{activeSelectionHook:ve,hoverSelectionHook:fe,customHoverBehavior:xe,customClickBehavior:Ae}=C({selection:Y,linkedHover:X,unwrapData:!0,onObservation:q,chartType:"RealtimeWaterfallChart",chartId:Q,mobileInteraction:n.mobileInteraction}),_e=Qe(e=>{W&&W(e),xe(e)},[W,xe]);we(t,pe);const Ce=f(U,ae[0],ae[1],Z),Se=Ce?null:v(m,ae[0],ae[1],ee),He={};null!=T&&(He.positiveColor=T),null!=I&&(He.negativeColor=I),null!=M&&(He.connectorStroke=M),null!=R&&(He.connectorWidth=R),null!=F&&(He.gap=F),null!=N&&(He.stroke=N),null!=B&&(He.strokeWidth=B),null!=z&&(He.opacity=z),null!=D&&(He.cursor=D);const Pe=fe||ue.legendSelectionHook||ve,Te=Ue(()=>g(d??"time",p??"value"),[d,p]),Ie=Ue(()=>h(void 0,L,Te),[L,Te]),Me=be(Ue(()=>e=>({...Ie(e),...null!=N&&{stroke:N},...null!=B&&{strokeWidth:B},...null!=z&&{opacity:z},...null!=D&&{cursor:D}}),[Ie,N,B,z,D]),[Pe],Y),Re=te?`${r||""} semiotic-emphasis-${te}`.trim():r,Fe=re(u,m);return Ce||Se||Ze(s,{ref:pe,chartType:"waterfall",runtimeMode:"streaming",size:ae,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:de,className:Re,...ke(n,ue,e.legendInteraction),arrowOfTime:a,windowMode:l,windowSize:Fe,data:m,timeAccessor:d,valueAccessor:p,xExtent:y,yExtent:w,extentPadding:b,decay:k,pulse:_,staleness:S,transition:P,waterfallStyle:He,areaStyle:Me,showAxes:ie,background:O,hoverAnnotation:se,tooltipContent:ge,...c({linkedHover:X,selection:Y,onObservation:q,forceHoverBehavior:!0,mobileInteraction:n.mobileInteraction,customHoverBehavior:_e,customClickBehavior:Ae}),annotations:V,autoPlaceAnnotations:$,svgAnnotationRules:G,tickFormatTime:K,tickFormatValue:J,legend:me,legendPosition:he,pointIdAccessor:e.pointIdAccessor})});et.displayName="RealtimeWaterfallChart";import{useRef as tt,forwardRef as nt,useCallback as ot,useMemo as it,useState as st}from"react";import{jsx as rt}from"react/jsx-runtime";a(n);var at=nt(function(t,n){const o=ye(t),{size:i,margin:r,className:a,arrowOfTime:l="right",windowMode:u="sliding",windowSize:m,data:d,timeAccessor:g,valueAccessor:p,categoryAccessor:y,timeExtent:w,valueExtent:b,extentPadding:k,heatmapXBins:_=20,heatmapYBins:H=20,aggregation:P="count",colorScheme:T,customColorScale:I,cursor:M,styleRules:R,background:N,tooltipContent:B,tooltip:z,onHover:D,annotations:L,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:j,tickFormatValue:W,decay:V,pulse:$,staleness:G,linkedHover:K,selection:J,onObservation:X,chartId:Y,loading:q,loadingContent:Q,emptyContent:U,emphasis:Z,legendPosition:ee}=t,te=o.showAxes,ne=o.enableHover,oe=i??[o.width,o.height],[ie,ae]=st(null),le=it(()=>ie??[0,1],[ie]),ce=it(()=>{if("custom"===T&&I)return I;const e=F(T||"blues");return t=>e(Math.max(0,Math.min(1,(t-le[0])/(le[1]-le[0]||1))))},[T,I,le]),ue=S(t.legendInteraction,e=>Number(e.value),le),me=it(()=>{if(o.showLegend)return{gradient:{colorFn:ce,domain:le,label:P}}},[P,ce,o.showLegend,le]),{legend:de,margin:he,legendPosition:ge}=A({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ee,userMargin:r,defaults:o.marginDefaults,additionalLegend:me,chartWidth:oe[0],chartHeight:oe[1],axisChrome:{hasAxis:!1!==o.showAxes}}),pe=B??x({tooltip:z,defaultTooltipContent:se({timeAccessor:g,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,ve=tt(null),{activeSelectionHook:fe,hoverSelectionHook:xe,customHoverBehavior:Ae,customClickBehavior:_e}=C({selection:J,linkedHover:K,unwrapData:!0,onObservation:X,chartType:"RealtimeHeatmap",chartId:Y,mobileInteraction:o.mobileInteraction}),Ce=ot(e=>{D&&D(e),Ae(e)},[D,Ae]);we(n,ve);const Se=f(q,oe[0],oe[1],Q),He=Se?null:v(d,oe[0],oe[1],U),Pe=Z?`${a||""} semiotic-emphasis-${Z}`.trim():a,Te=re(m,d),Ie=it(()=>{if(null==M)return;const e={cursor:M};return()=>e},[M]),Me=it(()=>e(g??"time",p??"value",p??"value"),[g,p]),Re=be(it(()=>h(Ie,R,Me),[Ie,R,Me]),[xe,ue.legendSelectionHook,fe],J);return Se||He||rt(s,{ref:ve,chartType:"heatmap",runtimeMode:"streaming",size:oe,maxDevicePixelRatio:t.maxDevicePixelRatio,margin:he,className:Pe,...ke(o,ue,t.legendInteraction),arrowOfTime:l,windowMode:u,windowSize:Te,data:d,timeAccessor:g,valueAccessor:p,categoryAccessor:y,xExtent:w,yExtent:b,extentPadding:k,heatmapXBins:_,heatmapYBins:H,heatmapAggregation:P,colorScheme:"custom"!==T?T:void 0,heatmapColorScale:"custom"===T&&"function"==typeof I?I:void 0,onColorDomainChange:ae,areaStyle:Re,showAxes:te,background:N,hoverAnnotation:ne,tooltipContent:pe,...c({linkedHover:K,selection:J,onObservation:X,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:Ce,customClickBehavior:_e}),annotations:L,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:j,tickFormatValue:W,decay:V,pulse:$,staleness:G,legend:de,legendPosition:ge,pointIdAccessor:t.pointIdAccessor})});at.displayName="RealtimeHeatmap";export{B as RunningStats,z as WindowAccumulator,D as statValue,L as bandBounds,j as parseWindowDuration,W as ReorderBuffer,_e as RealtimeLineChart,Oe as RealtimeHistogram,Ee as TemporalHistogram,je as RealtimeTemporalHistogram,Xe as RealtimeSwarmChart,et as RealtimeWaterfallChart,at as RealtimeHeatmap};