semiotic 3.7.5 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (575) hide show
  1. package/CLAUDE.md +63 -18
  2. package/README.md +121 -27
  3. package/agent-skill/semiotic-charts/SKILL.md +146 -0
  4. package/ai/cli.js +133 -45
  5. package/ai/componentMetadata.cjs +6 -1
  6. package/ai/dist/mcp-server.js +1741 -163
  7. package/ai/examples.md +174 -0
  8. package/ai/schema.json +2733 -536
  9. package/ai/surface-manifest.json +201 -0
  10. package/ai/system-prompt.md +20 -4
  11. package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +20 -0
  12. package/dist/components/AccessibleNavTree.d.ts +7 -1
  13. package/dist/components/CategoryColors.d.ts +1 -1
  14. package/dist/components/ChartContainer.d.ts +91 -0
  15. package/dist/components/ChartGrid.d.ts +11 -1
  16. package/dist/components/CircularBrush.d.ts +61 -0
  17. package/dist/components/ContextLayout.d.ts +5 -1
  18. package/dist/components/DirectManipulationControl.d.ts +63 -0
  19. package/dist/components/LinkedCharts.d.ts +3 -1
  20. package/dist/components/MobileAnnotationCalloutList.d.ts +13 -0
  21. package/dist/components/MobileChartContainer.d.ts +51 -0
  22. package/dist/components/MobileStandardControls.d.ts +68 -0
  23. package/dist/components/SmallMultipleChart.d.ts +84 -0
  24. package/dist/components/Tooltip/FlippingTooltip.d.ts +21 -0
  25. package/dist/components/ai/ChartRecipe.d.ts +16 -0
  26. package/dist/components/ai/IntentMark.d.ts +15 -0
  27. package/dist/components/ai/chartCapabilities.d.ts +8 -1
  28. package/dist/components/ai/chartCapabilityTypes.d.ts +26 -1
  29. package/dist/components/ai/chartClinic.d.ts +91 -0
  30. package/dist/components/ai/chartClinicMetadata.generated.d.ts +15 -0
  31. package/dist/components/ai/chartRecipeRegistry.d.ts +14 -0
  32. package/dist/components/ai/chartRecipes.d.ts +278 -0
  33. package/dist/components/ai/dataPitfallsBridge.d.ts +102 -0
  34. package/dist/components/ai/describeChart.d.ts +7 -0
  35. package/dist/components/ai/describeRecipeChart.d.ts +16 -0
  36. package/dist/components/ai/generativeChart.d.ts +28 -3
  37. package/dist/components/ai/intentManifest.d.ts +62 -0
  38. package/dist/components/ai/navigationTree.d.ts +3 -0
  39. package/dist/components/ai/observedSceneAudit.d.ts +72 -0
  40. package/dist/components/ai/readerGrounding.d.ts +83 -0
  41. package/dist/components/ai/recipeCapability.d.ts +8 -0
  42. package/dist/components/ai/recipeNavigation.d.ts +13 -0
  43. package/dist/components/ai/recipeSemantics.d.ts +11 -0
  44. package/dist/components/ai/repairChartConfig.d.ts +9 -0
  45. package/dist/components/ai/suggestCharts.d.ts +11 -1
  46. package/dist/components/ai/useNavigationSync.d.ts +17 -2
  47. package/dist/components/chartContainerMobile.d.ts +9 -0
  48. package/dist/components/charts/custom/GeoCustomChart.d.ts +48 -0
  49. package/dist/components/charts/custom/NetworkCustomChart.d.ts +8 -2
  50. package/dist/components/charts/custom/OrdinalCustomChart.d.ts +8 -2
  51. package/dist/components/charts/custom/XYCustomChart.d.ts +11 -2
  52. package/dist/components/charts/geo/ChoroplethMap.d.ts +19 -2
  53. package/dist/components/charts/geo/DistanceCartogram.d.ts +15 -3
  54. package/dist/components/charts/geo/FlowMap.d.ts +11 -7
  55. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +15 -3
  56. package/dist/components/charts/geo/index.d.ts +2 -0
  57. package/dist/components/charts/index.d.ts +35 -1
  58. package/dist/components/charts/network/ChordDiagram.d.ts +10 -2
  59. package/dist/components/charts/network/CirclePack.d.ts +1 -1
  60. package/dist/components/charts/network/ForceDirectedGraph.d.ts +26 -5
  61. package/dist/components/charts/network/OrbitDiagram.d.ts +1 -1
  62. package/dist/components/charts/network/ProcessSankey.d.ts +1 -1
  63. package/dist/components/charts/network/SankeyDiagram.d.ts +10 -2
  64. package/dist/components/charts/network/TreeDiagram.d.ts +1 -1
  65. package/dist/components/charts/network/Treemap.d.ts +1 -1
  66. package/dist/components/charts/network/useForceLayout.d.ts +17 -0
  67. package/dist/components/charts/ordinal/BarChart.d.ts +22 -1
  68. package/dist/components/charts/ordinal/BoxPlot.d.ts +1 -1
  69. package/dist/components/charts/ordinal/DonutChart.d.ts +1 -1
  70. package/dist/components/charts/ordinal/DotPlot.d.ts +1 -1
  71. package/dist/components/charts/ordinal/FunnelChart.d.ts +1 -1
  72. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +12 -1
  73. package/dist/components/charts/ordinal/Histogram.d.ts +1 -1
  74. package/dist/components/charts/ordinal/PieChart.d.ts +1 -1
  75. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +1 -1
  76. package/dist/components/charts/ordinal/StackedBarChart.d.ts +12 -1
  77. package/dist/components/charts/ordinal/SwarmPlot.d.ts +1 -1
  78. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +1 -1
  79. package/dist/components/charts/ordinal/ViolinPlot.d.ts +1 -1
  80. package/dist/components/charts/physics/ChainReactionChart.d.ts +9 -0
  81. package/dist/components/charts/physics/CollisionSwarmChart.capability.d.ts +2 -0
  82. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +54 -0
  83. package/dist/components/charts/physics/EventDropChart.capability.d.ts +2 -0
  84. package/dist/components/charts/physics/EventDropChart.d.ts +60 -0
  85. package/dist/components/charts/physics/GaltonBoardChart.capability.d.ts +2 -0
  86. package/dist/components/charts/physics/GaltonBoardChart.d.ts +74 -0
  87. package/dist/components/charts/physics/GauntletChart.capability.d.ts +2 -0
  88. package/dist/components/charts/physics/GauntletChart.d.ts +73 -0
  89. package/dist/components/charts/physics/PhysicalFlowChart.capability.d.ts +2 -0
  90. package/dist/components/charts/physics/PhysicalFlowChart.d.ts +63 -0
  91. package/dist/components/charts/physics/PhysicsCustomChart.d.ts +99 -0
  92. package/dist/components/charts/physics/PhysicsPileChart.capability.d.ts +2 -0
  93. package/dist/components/charts/physics/PhysicsPileChart.d.ts +60 -0
  94. package/dist/components/charts/physics/ProcessFlowChart.capability.d.ts +2 -0
  95. package/dist/components/charts/physics/ProcessFlowChart.d.ts +96 -0
  96. package/dist/components/charts/physics/chainReactionOverlay.d.ts +22 -0
  97. package/dist/components/charts/physics/chainReactionRuntime.d.ts +37 -0
  98. package/dist/components/charts/physics/chainReactionTypes.d.ts +97 -0
  99. package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +27 -0
  100. package/dist/components/charts/physics/dependencyMachine.d.ts +188 -0
  101. package/dist/components/charts/physics/eventDropPhysics.d.ts +64 -0
  102. package/dist/components/charts/physics/galtonBoardPhysics.d.ts +28 -0
  103. package/dist/components/charts/physics/gauntletChartProps.d.ts +67 -0
  104. package/dist/components/charts/physics/gauntletChrome.d.ts +33 -0
  105. package/dist/components/charts/physics/gauntletController.d.ts +73 -0
  106. package/dist/components/charts/physics/gauntletEffects.d.ts +36 -0
  107. package/dist/components/charts/physics/gauntletPhysics.d.ts +71 -0
  108. package/dist/components/charts/physics/gauntletRuntime.d.ts +42 -0
  109. package/dist/components/charts/physics/gauntletTypes.d.ts +213 -0
  110. package/dist/components/charts/physics/physicalFlowPhysics.d.ts +57 -0
  111. package/dist/components/charts/physics/physicsChartShared.d.ts +57 -0
  112. package/dist/components/charts/physics/physicsChartUtils.d.ts +18 -0
  113. package/dist/components/charts/physics/physicsCustomLayout.d.ts +32 -0
  114. package/dist/components/charts/physics/physicsEncoding.d.ts +142 -0
  115. package/dist/components/charts/physics/physicsHocHandle.d.ts +53 -0
  116. package/dist/components/charts/physics/physicsHocUtils.d.ts +128 -0
  117. package/dist/components/charts/physics/physicsPilePhysics.d.ts +41 -0
  118. package/dist/components/charts/physics/physicsProcessPrimitives.d.ts +38 -0
  119. package/dist/components/charts/physics/processFlowPhysics.d.ts +97 -0
  120. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +9 -1
  121. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +9 -1
  122. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +9 -1
  123. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +16 -2
  124. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +9 -1
  125. package/dist/components/charts/shared/AnnotationLabel.d.ts +88 -0
  126. package/dist/components/charts/shared/annotationActivation.d.ts +35 -0
  127. package/dist/components/charts/shared/annotationLabelLayout.d.ts +5 -0
  128. package/dist/components/charts/shared/annotationRules.d.ts +2 -1
  129. package/dist/components/charts/shared/auditMobileVisualization.d.ts +91 -0
  130. package/dist/components/charts/shared/chartDefinitionPilot.d.ts +145 -0
  131. package/dist/components/charts/shared/chartFamilySets.d.ts +20 -0
  132. package/dist/components/charts/shared/chartSelectionUtils.d.ts +4 -0
  133. package/dist/components/charts/shared/chartSpecCore.d.ts +165 -0
  134. package/dist/components/charts/shared/chartSpecs.d.ts +8 -127
  135. package/dist/components/charts/shared/chartSpecsGeo.d.ts +2 -0
  136. package/dist/components/charts/shared/chartSpecsNetwork.d.ts +2 -0
  137. package/dist/components/charts/shared/chartSpecsOrdinal.d.ts +2 -0
  138. package/dist/components/charts/shared/chartSpecsPhysics.d.ts +2 -0
  139. package/dist/components/charts/shared/chartSpecsRealtime.d.ts +2 -0
  140. package/dist/components/charts/shared/chartSpecsValue.d.ts +2 -0
  141. package/dist/components/charts/shared/chartSpecsXY.d.ts +2 -0
  142. package/dist/components/charts/shared/colorContrast.d.ts +3 -0
  143. package/dist/components/charts/shared/colorUtils.d.ts +16 -1
  144. package/dist/components/charts/shared/datumTypes.d.ts +2 -0
  145. package/dist/components/charts/shared/diagnoseAnnotationChecks.d.ts +6 -0
  146. package/dist/components/charts/shared/diagnoseConfig.d.ts +9 -14
  147. package/dist/components/charts/shared/diagnoseMisleadingChecks.d.ts +9 -0
  148. package/dist/components/charts/shared/diagnosePhysicsChecks.d.ts +3 -0
  149. package/dist/components/charts/shared/diagnoseTypes.d.ts +10 -0
  150. package/dist/components/charts/shared/formatUtils.d.ts +3 -3
  151. package/dist/components/charts/shared/hatchFill.d.ts +87 -0
  152. package/dist/components/charts/shared/hooks.d.ts +34 -10
  153. package/dist/components/charts/shared/knownChartComponents.d.ts +9 -0
  154. package/dist/components/charts/shared/leastSquaresRegression.d.ts +16 -0
  155. package/dist/components/charts/shared/mergeShapeStyle.d.ts +3 -2
  156. package/dist/components/charts/shared/motionEncoding.d.ts +145 -0
  157. package/dist/components/charts/shared/responsiveRules.d.ts +56 -0
  158. package/dist/components/charts/shared/semanticInteractions.d.ts +42 -0
  159. package/dist/components/charts/shared/sparseArray.d.ts +1 -1
  160. package/dist/components/charts/shared/streamPropsHelpers.d.ts +17 -5
  161. package/dist/components/charts/shared/styleRules.d.ts +205 -0
  162. package/dist/components/charts/shared/temporalStrings.d.ts +7 -0
  163. package/dist/components/charts/shared/tooltipUtils.d.ts +22 -9
  164. package/dist/components/charts/shared/types.d.ts +58 -7
  165. package/dist/components/charts/shared/useAreaSeriesSetup.d.ts +16 -2
  166. package/dist/components/charts/shared/useChartSetup.d.ts +11 -4
  167. package/dist/components/charts/shared/useCustomChartSetup.d.ts +17 -5
  168. package/dist/components/charts/shared/useFrameImperativeHandle.d.ts +1 -2
  169. package/dist/components/charts/shared/useLikertAggregation.d.ts +4 -4
  170. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +6 -2
  171. package/dist/components/charts/shared/useOrdinalBrush.d.ts +2 -1
  172. package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +25 -2
  173. package/dist/components/charts/shared/useStreamingLegend.d.ts +2 -2
  174. package/dist/components/charts/shared/useSyncedPushData.d.ts +49 -0
  175. package/dist/components/charts/shared/useXYLineStyle.d.ts +10 -0
  176. package/dist/components/charts/shared/useXYPointStyle.d.ts +19 -1
  177. package/dist/components/charts/shared/validateChartData.d.ts +7 -5
  178. package/dist/components/charts/shared/validationMap.d.ts +7 -9
  179. package/dist/components/charts/shared/validationMap.generated.d.ts +6 -0
  180. package/dist/components/charts/shared/withChartWrapper.d.ts +4 -3
  181. package/dist/components/charts/value/targetPresentation.d.ts +22 -0
  182. package/dist/components/charts/value/types.d.ts +5 -6
  183. package/dist/components/charts/xy/AreaChart.d.ts +9 -1
  184. package/dist/components/charts/xy/BubbleChart.d.ts +10 -1
  185. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +7 -0
  186. package/dist/components/charts/xy/DifferenceChart.d.ts +1 -52
  187. package/dist/components/charts/xy/Heatmap.d.ts +2 -2
  188. package/dist/components/charts/xy/LineChart.d.ts +12 -1
  189. package/dist/components/charts/xy/MinimapChart.d.ts +1 -1
  190. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +2 -2
  191. package/dist/components/charts/xy/QuadrantChart.d.ts +8 -1
  192. package/dist/components/charts/xy/Scatterplot.d.ts +11 -1
  193. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +11 -1
  194. package/dist/components/charts/xy/StackedAreaChart.d.ts +16 -4
  195. package/dist/components/charts/xy/differenceSegments.d.ts +49 -0
  196. package/dist/components/charts/xy/scatterplotMatrixInteractionTypes.d.ts +12 -0
  197. package/dist/components/controls/SentenceFilter.d.ts +97 -0
  198. package/dist/components/controls/controlAudit.d.ts +24 -0
  199. package/dist/components/controls/controlContract.d.ts +57 -0
  200. package/dist/components/data/fromFlintChart.d.ts +74 -0
  201. package/dist/components/data/fromVegaLite.d.ts +46 -9
  202. package/dist/components/data/portability/index.d.ts +6 -3
  203. package/dist/components/data/portability/result.d.ts +52 -0
  204. package/dist/components/data/portability/spec.d.ts +31 -0
  205. package/dist/components/data/portability/vegaLite.d.ts +24 -6
  206. package/dist/components/export/chartConfig.d.ts +11 -0
  207. package/dist/components/realtime/types.d.ts +11 -0
  208. package/dist/components/recipes/annotationLayout.d.ts +29 -0
  209. package/dist/components/recipes/axisFixedForce.d.ts +119 -0
  210. package/dist/components/recipes/{gofishBoba.d.ts → boba.d.ts} +2 -2
  211. package/dist/components/recipes/cyclical.d.ts +39 -0
  212. package/dist/components/recipes/edgeRouter.d.ts +103 -0
  213. package/dist/components/recipes/forceLayout.d.ts +48 -0
  214. package/dist/components/recipes/forceLayoutAsync.d.ts +17 -0
  215. package/dist/components/recipes/gofishBobaHandwritten.d.ts +3 -0
  216. package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +37 -0
  217. package/dist/components/recipes/gofishIR.d.ts +178 -132
  218. package/dist/components/recipes/gofishIRExamples.d.ts +30 -81
  219. package/dist/components/recipes/intervalLanes.d.ts +87 -0
  220. package/dist/components/recipes/intervals.d.ts +80 -0
  221. package/dist/components/recipes/isometricLandmarks.d.ts +88 -0
  222. package/dist/components/recipes/isotypeGlyphs.d.ts +17 -0
  223. package/dist/components/recipes/mobileAnnotationStrategy.d.ts +48 -0
  224. package/dist/components/recipes/mobileChartFamilyRecipes.d.ts +59 -0
  225. package/dist/components/recipes/networkAnalysis.d.ts +102 -0
  226. package/dist/components/recipes/networkLayouts.d.ts +83 -0
  227. package/dist/components/recipes/physics.d.ts +122 -0
  228. package/dist/components/recipes/physicsReference.d.ts +102 -0
  229. package/dist/components/recipes/processAggregates.d.ts +32 -0
  230. package/dist/components/recipes/processChrome.d.ts +67 -0
  231. package/dist/components/recipes/processJourney.d.ts +54 -0
  232. package/dist/components/recipes/processPhysics.d.ts +300 -0
  233. package/dist/components/recipes/processVolumeGeometry.d.ts +28 -0
  234. package/dist/components/recipes/radialCoords.d.ts +69 -0
  235. package/dist/components/recipes/random.d.ts +2 -0
  236. package/dist/components/recipes/recipeChrome.d.ts +91 -0
  237. package/dist/components/recipes/recipeGlyph.d.ts +42 -0
  238. package/dist/components/recipes/recipeLegend.d.ts +53 -1
  239. package/dist/components/recipes/recipeUtils.d.ts +52 -0
  240. package/dist/components/recipes/runs.d.ts +59 -0
  241. package/dist/components/recipes/tokenEncoding.d.ts +157 -0
  242. package/dist/components/recipes/tokenLayer.d.ts +79 -0
  243. package/dist/components/recipes/unitize.d.ts +108 -0
  244. package/dist/components/recipes/vector.d.ts +28 -0
  245. package/dist/components/recipes/waffle.d.ts +43 -0
  246. package/dist/components/rough/createRoughRenderMode.d.ts +46 -0
  247. package/dist/components/semiotic-ai-core.d.ts +47 -0
  248. package/dist/components/semiotic-ai.d.ts +53 -9
  249. package/dist/components/semiotic-controls.d.ts +20 -0
  250. package/dist/components/semiotic-experimental.d.ts +38 -9
  251. package/dist/components/semiotic-geo.d.ts +15 -0
  252. package/dist/components/semiotic-network.d.ts +15 -0
  253. package/dist/components/semiotic-ordinal.d.ts +14 -0
  254. package/dist/components/semiotic-physics-matter.d.ts +10 -0
  255. package/dist/components/semiotic-physics-rapier.d.ts +9 -0
  256. package/dist/components/semiotic-physics.d.ts +60 -0
  257. package/dist/components/semiotic-realtime-core.d.ts +34 -0
  258. package/dist/components/semiotic-realtime-react.d.ts +10 -0
  259. package/dist/components/semiotic-realtime.d.ts +4 -30
  260. package/dist/components/semiotic-recipes-core.d.ts +92 -0
  261. package/dist/components/semiotic-recipes-react.d.ts +7 -0
  262. package/dist/components/semiotic-recipes.d.ts +4 -43
  263. package/dist/components/semiotic-rough.d.ts +4 -0
  264. package/dist/components/semiotic-server-edge.d.ts +8 -0
  265. package/dist/components/semiotic-server-node.d.ts +5 -0
  266. package/dist/components/semiotic-server.d.ts +2 -2
  267. package/dist/components/semiotic-themes-core.d.ts +53 -0
  268. package/dist/components/semiotic-themes-react.d.ts +4 -0
  269. package/dist/components/semiotic-themes.d.ts +6 -76
  270. package/dist/components/semiotic-utils-core.d.ts +50 -0
  271. package/dist/components/semiotic-utils-react.d.ts +5 -0
  272. package/dist/components/semiotic-utils.d.ts +3 -39
  273. package/dist/components/semiotic-xy.d.ts +12 -0
  274. package/dist/components/semiotic.d.ts +44 -8
  275. package/dist/components/server/animatedGif.d.ts +36 -0
  276. package/dist/components/server/optionalImageTypes.d.ts +37 -0
  277. package/dist/components/server/renderEvidence.d.ts +1 -1
  278. package/dist/components/server/renderToStaticSVG.d.ts +3 -35
  279. package/dist/components/server/serverChartConfigShared.d.ts +21 -0
  280. package/dist/components/server/serverChartConfigs.d.ts +22 -12
  281. package/dist/components/server/serverChartConfigsCustom.d.ts +5 -0
  282. package/dist/components/server/serverChartConfigsGeo.d.ts +9 -0
  283. package/dist/components/server/serverChartConfigsNetwork.d.ts +8 -0
  284. package/dist/components/server/serverChartConfigsOrdinal.d.ts +16 -0
  285. package/dist/components/server/serverChartConfigsPhysics.d.ts +9 -0
  286. package/dist/components/server/serverChartConfigsXY.d.ts +11 -0
  287. package/dist/components/server/staticAnnotations.d.ts +6 -3
  288. package/dist/components/server/staticGeo.d.ts +4 -0
  289. package/dist/components/server/staticLegend.d.ts +2 -2
  290. package/dist/components/server/staticNetwork.d.ts +8 -0
  291. package/dist/components/server/staticOrdinal.d.ts +11 -0
  292. package/dist/components/server/staticPhysics.d.ts +3 -0
  293. package/dist/components/server/staticSVGChrome.d.ts +110 -0
  294. package/dist/components/server/staticXY.d.ts +4 -0
  295. package/dist/components/store/ObservationStore.d.ts +23 -2
  296. package/dist/components/store/themeSerialization.d.ts +32 -0
  297. package/dist/components/store/useChartInterrogation.d.ts +9 -0
  298. package/dist/components/stream/AccessibleDataTable.d.ts +7 -23
  299. package/dist/components/stream/AriaLiveTooltip.d.ts +9 -0
  300. package/dist/components/stream/CanvasHitTester.d.ts +4 -4
  301. package/dist/components/stream/DataSourceAdapter.d.ts +1 -1
  302. package/dist/components/stream/FocusRing.d.ts +4 -2
  303. package/dist/components/stream/FrameRuntime.d.ts +57 -0
  304. package/dist/components/stream/GeoCanvasHitTester.d.ts +1 -1
  305. package/dist/components/stream/GeoParticlePool.d.ts +1 -1
  306. package/dist/components/stream/GeoPipelineStore.d.ts +62 -3
  307. package/dist/components/stream/GeoSVGOverlay.d.ts +64 -0
  308. package/dist/components/stream/NetworkCanvasHitTester.d.ts +2 -1
  309. package/dist/components/stream/NetworkPipelineStore.d.ts +44 -36
  310. package/dist/components/stream/NetworkSSRFrame.d.ts +17 -0
  311. package/dist/components/stream/NetworkSVGOverlay.d.ts +10 -1
  312. package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -2
  313. package/dist/components/stream/OrdinalPipelineStore.d.ts +55 -11
  314. package/dist/components/stream/OrdinalSVGOverlay.d.ts +9 -1
  315. package/dist/components/stream/OrdinalStyleResolver.d.ts +12 -0
  316. package/dist/components/stream/ParticlePool.d.ts +1 -1
  317. package/dist/components/stream/PipelineStore.d.ts +81 -174
  318. package/dist/components/stream/SVGOverlay.d.ts +6 -0
  319. package/dist/components/stream/SceneGraph.d.ts +12 -4
  320. package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
  321. package/dist/components/stream/StreamNetworkFrame.d.ts +1 -1
  322. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
  323. package/dist/components/stream/StreamXYFrame.d.ts +2 -18
  324. package/dist/components/stream/accessibleDataRows.d.ts +33 -0
  325. package/dist/components/stream/accessorUtils.d.ts +25 -12
  326. package/dist/components/stream/annotationAccessorResolver.d.ts +2 -2
  327. package/dist/components/stream/brushAccessibility.d.ts +25 -0
  328. package/dist/components/stream/canvasBackground.d.ts +24 -0
  329. package/dist/components/stream/canvasSetup.d.ts +4 -1
  330. package/dist/components/stream/customLayoutFailure.d.ts +33 -0
  331. package/dist/components/stream/customLayoutPalette.d.ts +19 -9
  332. package/dist/components/stream/frameGraphics.d.ts +4 -0
  333. package/dist/components/stream/frameKeyboardNavigation.d.ts +45 -0
  334. package/dist/components/stream/frameThemeColors.d.ts +24 -0
  335. package/dist/components/stream/geoAnnotationAnchors.d.ts +14 -0
  336. package/dist/components/stream/geoCartogram.d.ts +17 -0
  337. package/dist/components/stream/geoCustomLayout.d.ts +59 -0
  338. package/dist/components/stream/geoDefaultTooltip.d.ts +11 -0
  339. package/dist/components/stream/geoFrameHelpers.d.ts +34 -0
  340. package/dist/components/stream/geoPipelineHelpers.d.ts +46 -0
  341. package/dist/components/stream/geoPipelineUpdateResults.d.ts +34 -0
  342. package/dist/components/stream/geoSceneBuilder.d.ts +16 -0
  343. package/dist/components/stream/geoTypes.d.ts +97 -15
  344. package/dist/components/stream/glyphDef.d.ts +98 -0
  345. package/dist/components/stream/hitTarget.d.ts +170 -0
  346. package/dist/components/stream/hitTestUtils.d.ts +2 -2
  347. package/dist/components/stream/hoverUtils.d.ts +7 -2
  348. package/dist/components/stream/keyboardNav.d.ts +4 -1
  349. package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +9 -1
  350. package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +58 -0
  351. package/dist/components/stream/layouts/hierarchyUtils.d.ts +2 -2
  352. package/dist/components/stream/networkBezier.d.ts +10 -0
  353. package/dist/components/stream/networkColorAccessors.d.ts +49 -0
  354. package/dist/components/stream/networkCustomLayoutRunner.d.ts +23 -0
  355. package/dist/components/stream/networkCustomRestyle.d.ts +15 -0
  356. package/dist/components/stream/networkDefaultTooltip.d.ts +10 -0
  357. package/dist/components/stream/networkFrameAnimation.d.ts +7 -0
  358. package/dist/components/stream/networkFrameHandleTypes.d.ts +39 -0
  359. package/dist/components/stream/networkFrameInteraction.d.ts +37 -0
  360. package/dist/components/stream/networkFrameObservations.d.ts +15 -0
  361. package/dist/components/stream/networkFramePaint.d.ts +52 -0
  362. package/dist/components/stream/networkInteractionTypes.d.ts +26 -0
  363. package/dist/components/stream/networkPipelineConfig.d.ts +22 -0
  364. package/dist/components/stream/networkPipelineHelpers.d.ts +12 -0
  365. package/dist/components/stream/networkPipelineUpdateResults.d.ts +38 -0
  366. package/dist/components/stream/networkRealtimeEncoding.d.ts +41 -0
  367. package/dist/components/stream/networkTypes.d.ts +103 -51
  368. package/dist/components/stream/ordinalCanvasRenderers.d.ts +7 -0
  369. package/dist/components/stream/ordinalDataIndex.d.ts +5 -0
  370. package/dist/components/stream/ordinalDefaultTooltip.d.ts +10 -0
  371. package/dist/components/stream/ordinalDomain.d.ts +38 -0
  372. package/dist/components/stream/ordinalPipelineUpdateResults.d.ts +31 -0
  373. package/dist/components/stream/ordinalPulse.d.ts +10 -0
  374. package/dist/components/stream/ordinalPulseResources.d.ts +3 -0
  375. package/dist/components/stream/ordinalSceneBuilders/sceneBuilderMap.d.ts +5 -0
  376. package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -2
  377. package/dist/components/stream/ordinalSpatialIndex.d.ts +9 -0
  378. package/dist/components/stream/ordinalTypes.d.ts +68 -9
  379. package/dist/components/stream/paintNeeds.d.ts +31 -0
  380. package/dist/components/stream/physics/CapacityQueueController.d.ts +5 -0
  381. package/dist/components/stream/physics/CapacityQueueTypes.d.ts +134 -0
  382. package/dist/components/stream/physics/MatterPhysicsEngineAdapter.d.ts +42 -0
  383. package/dist/components/stream/physics/PhysicsAccessibility.d.ts +48 -0
  384. package/dist/components/stream/physics/PhysicsAnnotations.d.ts +58 -0
  385. package/dist/components/stream/physics/PhysicsBodyBudget.d.ts +26 -0
  386. package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +10 -0
  387. package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +26 -0
  388. package/dist/components/stream/physics/PhysicsControllers.d.ts +75 -0
  389. package/dist/components/stream/physics/PhysicsEngineAdapter.d.ts +59 -0
  390. package/dist/components/stream/physics/PhysicsEngineConformance.d.ts +23 -0
  391. package/dist/components/stream/physics/PhysicsEvidence.d.ts +25 -0
  392. package/dist/components/stream/physics/PhysicsKernel.d.ts +207 -0
  393. package/dist/components/stream/physics/PhysicsOptionalEngineAdapters.d.ts +12 -0
  394. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +86 -0
  395. package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +181 -0
  396. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +78 -0
  397. package/dist/components/stream/physics/PhysicsSediment.d.ts +69 -0
  398. package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +18 -0
  399. package/dist/components/stream/physics/PhysicsSettledScene.d.ts +21 -0
  400. package/dist/components/stream/physics/PhysicsWorkerClient.d.ts +24 -0
  401. package/dist/components/stream/physics/PhysicsWorkerProtocol.d.ts +101 -0
  402. package/dist/components/stream/physics/PhysicsWorkerRuntime.d.ts +5 -0
  403. package/dist/components/stream/physics/RapierPhysicsEngineAdapter.d.ts +18 -0
  404. package/dist/components/stream/physics/ServiceOperationsControllers.d.ts +27 -0
  405. package/dist/components/stream/physics/ServiceOperationsTypes.d.ts +89 -0
  406. package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +6 -0
  407. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +317 -0
  408. package/dist/components/stream/physics/physicsBodyCanvas.d.ts +27 -0
  409. package/dist/components/stream/physics/physicsFrameObservations.d.ts +19 -0
  410. package/dist/components/stream/physics/physicsFrameSetup.d.ts +4 -0
  411. package/dist/components/stream/physics/physicsPipelineControls.d.ts +4 -0
  412. package/dist/components/stream/physics/physicsPipelineHelpers.d.ts +41 -0
  413. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +14 -0
  414. package/dist/components/stream/physics/physicsPipelineUpdateResults.d.ts +27 -0
  415. package/dist/components/stream/physics/physicsRegionRuntime.d.ts +54 -0
  416. package/dist/components/stream/physics/physicsSemanticUI.d.ts +20 -0
  417. package/dist/components/stream/physics/usePhysicsFrameLifecyclePolicy.d.ts +18 -0
  418. package/dist/components/stream/pipelineBufferUtils.d.ts +26 -0
  419. package/dist/components/stream/pipelineConfig.d.ts +179 -0
  420. package/dist/components/stream/pipelineDecay.d.ts +21 -3
  421. package/dist/components/stream/pipelineDomainResolution.d.ts +62 -0
  422. package/dist/components/stream/pipelineIdentityOps.d.ts +26 -0
  423. package/dist/components/stream/pipelinePulse.d.ts +17 -3
  424. package/dist/components/stream/pipelineRibbons.d.ts +41 -0
  425. package/dist/components/stream/pipelineSpatialIndex.d.ts +12 -0
  426. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +33 -0
  427. package/dist/components/stream/pipelineStyleResolvers.d.ts +46 -0
  428. package/dist/components/stream/pipelineTransitions.d.ts +3 -1
  429. package/dist/components/stream/pipelineUpdateContract.d.ts +69 -0
  430. package/dist/components/stream/pipelineUpdateStore.d.ts +21 -0
  431. package/dist/components/stream/pulseFrameRefresh.d.ts +22 -0
  432. package/dist/components/stream/renderBackend.d.ts +27 -0
  433. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +15 -1
  434. package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +3 -2
  435. package/dist/components/stream/renderers/glyphCanvasRenderer.d.ts +6 -0
  436. package/dist/components/stream/renderers/networkParticleRenderer.d.ts +1 -1
  437. package/dist/components/stream/renderers/resolveCSSColor.d.ts +6 -0
  438. package/dist/components/stream/sceneRenderBackendTypes.d.ts +28 -0
  439. package/dist/components/stream/sceneRevisionDiagnostics.d.ts +45 -0
  440. package/dist/components/stream/streamSemanticTypes.d.ts +16 -0
  441. package/dist/components/stream/streamStoreSync.d.ts +37 -0
  442. package/dist/components/stream/streamThemeTypes.d.ts +14 -0
  443. package/dist/components/stream/svgOverlayUtils.d.ts +10 -0
  444. package/dist/components/stream/test-utils/frameScheduler.d.ts +12 -0
  445. package/dist/components/stream/test-utils/revisionConsumption.d.ts +13 -0
  446. package/dist/components/stream/titleLayout.d.ts +31 -0
  447. package/dist/components/stream/types.d.ts +165 -72
  448. package/dist/components/stream/useCanvasFrameHost.d.ts +71 -0
  449. package/dist/components/stream/useFrame.d.ts +44 -2
  450. package/dist/components/stream/useHydration.d.ts +6 -0
  451. package/dist/components/stream/useLegendCategoryEmission.d.ts +5 -0
  452. package/dist/components/stream/useSemanticFrameInteractions.d.ts +22 -0
  453. package/dist/components/stream/useUpdateResultSnapshot.d.ts +7 -0
  454. package/dist/components/stream/workerModuleUrl.d.ts +10 -0
  455. package/dist/components/stream/xyAnnotationAnchors.d.ts +13 -0
  456. package/dist/components/stream/xyCanvasRenderers.d.ts +7 -0
  457. package/dist/components/stream/xyCrosshair.d.ts +11 -0
  458. package/dist/components/stream/xyDateTicks.d.ts +9 -0
  459. package/dist/components/stream/xyDefaultTooltip.d.ts +10 -0
  460. package/dist/components/stream/xyFrameAxisTypes.d.ts +50 -0
  461. package/dist/components/stream/xySceneBuilders/types.d.ts +10 -9
  462. package/dist/controls.min.js +2 -0
  463. package/dist/controls.module.min.js +2 -0
  464. package/dist/forceLayoutWorker.js +1 -0
  465. package/dist/geo.min.js +1 -1
  466. package/dist/geo.module.min.js +1 -1
  467. package/dist/network.min.js +1 -1
  468. package/dist/network.module.min.js +1 -1
  469. package/dist/ordinal.min.js +1 -1
  470. package/dist/ordinal.module.min.js +1 -1
  471. package/dist/physics-matter.min.js +1 -0
  472. package/dist/physics-matter.module.min.js +1 -0
  473. package/dist/physics-rapier.min.js +1 -0
  474. package/dist/physics-rapier.module.min.js +1 -0
  475. package/dist/physics.min.js +2 -0
  476. package/dist/physics.module.min.js +2 -0
  477. package/dist/physicsWorker.js +1 -0
  478. package/dist/realtime.min.js +1 -1
  479. package/dist/realtime.module.min.js +1 -1
  480. package/dist/rough.min.js +1 -0
  481. package/dist/rough.module.min.js +1 -0
  482. package/dist/semiotic-ai-chunk-OG7BQUUW.module.min.js +2 -0
  483. package/dist/semiotic-ai-core.d.ts +47 -0
  484. package/dist/semiotic-ai-core.min.js +1 -0
  485. package/dist/semiotic-ai-core.module.min.js +1 -0
  486. package/dist/semiotic-ai-statisticalOverlays-CY4WKR4A.module.min.js +2 -0
  487. package/dist/semiotic-ai.d.ts +53 -9
  488. package/dist/semiotic-ai.min.js +1 -1
  489. package/dist/semiotic-ai.module.min.js +1 -1
  490. package/dist/semiotic-chunk-3FSVZ46U.module.min.js +2 -0
  491. package/dist/semiotic-controls.d.ts +20 -0
  492. package/dist/semiotic-data.min.js +1 -1
  493. package/dist/semiotic-data.module.min.js +1 -1
  494. package/dist/semiotic-experimental.d.ts +38 -9
  495. package/dist/semiotic-experimental.min.js +1 -1
  496. package/dist/semiotic-experimental.module.min.js +1 -1
  497. package/dist/semiotic-geo.d.ts +15 -0
  498. package/dist/semiotic-network.d.ts +15 -0
  499. package/dist/semiotic-ordinal.d.ts +14 -0
  500. package/dist/semiotic-physics-matter.d.ts +10 -0
  501. package/dist/semiotic-physics-rapier.d.ts +9 -0
  502. package/dist/semiotic-physics.d.ts +60 -0
  503. package/dist/semiotic-realtime-core.d.ts +34 -0
  504. package/dist/semiotic-realtime-core.min.js +1 -0
  505. package/dist/semiotic-realtime-core.module.min.js +1 -0
  506. package/dist/semiotic-realtime-react.d.ts +10 -0
  507. package/dist/semiotic-realtime-react.min.js +2 -0
  508. package/dist/semiotic-realtime-react.module.min.js +2 -0
  509. package/dist/semiotic-realtime.d.ts +4 -30
  510. package/dist/semiotic-recipes-core.d.ts +92 -0
  511. package/dist/semiotic-recipes-core.min.js +1 -0
  512. package/dist/semiotic-recipes-core.module.min.js +1 -0
  513. package/dist/semiotic-recipes-react.d.ts +7 -0
  514. package/dist/semiotic-recipes-react.min.js +2 -0
  515. package/dist/semiotic-recipes-react.module.min.js +2 -0
  516. package/dist/semiotic-recipes.d.ts +4 -43
  517. package/dist/semiotic-recipes.min.js +1 -1
  518. package/dist/semiotic-recipes.module.min.js +1 -1
  519. package/dist/semiotic-rough.d.ts +4 -0
  520. package/dist/semiotic-server-edge.d.ts +8 -0
  521. package/dist/semiotic-server-edge.min.js +1 -0
  522. package/dist/semiotic-server-edge.module.min.js +1 -0
  523. package/dist/semiotic-server-node.d.ts +5 -0
  524. package/dist/semiotic-server-node.min.js +1 -0
  525. package/dist/semiotic-server-node.module.min.js +1 -0
  526. package/dist/semiotic-server.d.ts +2 -2
  527. package/dist/semiotic-statisticalOverlays-UOMSFKVJ.module.min.js +2 -0
  528. package/dist/semiotic-themes-core.d.ts +53 -0
  529. package/dist/semiotic-themes-core.min.js +1 -0
  530. package/dist/semiotic-themes-core.module.min.js +1 -0
  531. package/dist/semiotic-themes-react.d.ts +4 -0
  532. package/dist/semiotic-themes-react.min.js +2 -0
  533. package/dist/semiotic-themes-react.module.min.js +2 -0
  534. package/dist/semiotic-themes.d.ts +6 -76
  535. package/dist/semiotic-themes.min.js +1 -2
  536. package/dist/semiotic-themes.module.min.js +1 -2
  537. package/dist/semiotic-utils-core.d.ts +50 -0
  538. package/dist/semiotic-utils-core.min.js +1 -0
  539. package/dist/semiotic-utils-core.module.min.js +1 -0
  540. package/dist/semiotic-utils-react.d.ts +5 -0
  541. package/dist/semiotic-utils-react.min.js +2 -0
  542. package/dist/semiotic-utils-react.module.min.js +2 -0
  543. package/dist/semiotic-utils.d.ts +3 -39
  544. package/dist/semiotic-utils.min.js +1 -2
  545. package/dist/semiotic-utils.module.min.js +1 -2
  546. package/dist/semiotic-value.min.js +1 -1
  547. package/dist/semiotic-value.module.min.js +1 -1
  548. package/dist/semiotic-xy.d.ts +12 -0
  549. package/dist/semiotic.d.ts +44 -8
  550. package/dist/semiotic.min.js +1 -1
  551. package/dist/semiotic.module.min.js +1 -1
  552. package/dist/server.min.js +1 -1
  553. package/dist/server.module.min.js +1 -1
  554. package/dist/test-utils/capturedFrameProps.d.ts +67 -0
  555. package/dist/test-utils/frameMock.d.ts +12 -9
  556. package/dist/xy-chunk-IWD6IB6V.module.min.js +2 -0
  557. package/dist/xy-statisticalOverlays-7RWG6LJT.module.min.js +2 -0
  558. package/dist/xy.min.js +1 -1
  559. package/dist/xy.module.min.js +1 -1
  560. package/package.json +259 -88
  561. package/spec/README.md +152 -0
  562. package/spec/bindings/README.md +35 -0
  563. package/spec/bindings/vega-lite.mjs +112 -0
  564. package/spec/v0.1/annotation-provenance.schema.json +127 -0
  565. package/spec/v0.1/audience-profile.schema.json +67 -0
  566. package/spec/v0.1/chart-capability.schema.json +186 -0
  567. package/dist/components/recipes/gofish.d.ts +0 -207
  568. package/dist/components/recipes/gofishInterpreter.d.ts +0 -52
  569. package/dist/components/recipes/gofishLambdas.d.ts +0 -145
  570. package/dist/semiotic-ai-semiotic-ai-u954ylUn.js +0 -2
  571. package/dist/semiotic-ai-statisticalOverlays-CU7jW05Q.js +0 -1
  572. package/dist/semiotic-semiotic-BmrYbi99.js +0 -2
  573. package/dist/semiotic-statisticalOverlays-IjZw8Lsu.js +0 -1
  574. package/dist/xy-semiotic-xy-Dufu3D0-.js +0 -2
  575. package/dist/xy-statisticalOverlays-3Ni9bRph.js +0 -1
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{A as AreaChart,B as BubbleChart,C as CandlestickChart,b as ConnectedScatterplot,D as DifferenceChart,H as Heatmap,L as LineChart,M as MinimapChart,c as MultiAxisLineChart,Q as QuadrantChart,S as Scatterplot,d as ScatterplotMatrix,e as StackedAreaChart,f as StreamXYFrame,X as XYCustomChart,u as useCustomLayoutSelection}from"./xy-semiotic-xy-Dufu3D0-.js";import"react/jsx-runtime";import"react";import"d3-selection";import"d3-brush";import"d3-scale";import"d3-quadtree";import"d3-shape";import"d3-array";import"d3-hierarchy";import"regression";
2
+ import{getMax as e,getMinMax as t}from"./xy-chunk-IWD6IB6V.module.min.js";import*as n from"react";import{useRef as o,useState as r,useEffect as i,useMemo as s,useCallback as a,useImperativeHandle as l,useId as c,forwardRef as u,memo as h}from"react";import{useRef as d,useEffect as f,useMemo as p}from"react";import{select as y}from"d3-selection";import{brush as m,brushX as g,brushY as b}from"d3-brush";import*as v from"react";import{jsx as x,jsxs as k}from"react/jsx-runtime";function w(e,t,n,o){const[r,i]=[Math.min(...t),Math.max(...t)],s=(i-r)/20;let[a,l]=e;if(o)0>n?a=Math.max(r,a-s):l=Math.min(i,l+s);else{const e=l-a;a=Math.max(r,Math.min(i-e,a+n*s)),l=a+e}return[a,l]}function A(e,t){let n=0,o=t.length-1;for(;o>n;){const r=n+o+1>>1;t[r]>e?o=r-1:n=r}return t[n]}function S(e,t){let n=0,o=t.length-1;for(;o>n;){const r=n+o>>1;e>t[r]?n=r+1:o=r}return t[n]}function C({width:e,height:t,totalWidth:n,totalHeight:o,margin:r,dimension:i,scales:s,onBrush:a,binSize:l,snap:c,binBoundaries:u,snapDuring:h,streaming:C}){const M=d(null),_=d(null),P=d(a);P.current=a;const L=d(s);L.current=s;const R=p(()=>u?[...u].sort((e,t)=>e-t):void 0,[u]),I=d(R);I.current=R;const T=d(!1),N=d(null),F=function({label:e="Data range brush",description:t="Use arrow keys to move the selected range, Shift plus an arrow key to resize it, and Escape to clear it.",onAction:n}={}){const o=v.useId().replace(/:/g,""),r=v.useRef(n);return r.current=n,{description:t,descriptionId:"semiotic-brush-description-"+o,svgProps:{role:"region",tabIndex:0,"aria-label":e,"aria-describedby":"semiotic-brush-description-"+o,onKeyDown:v.useCallback(e=>{const t=function(e){return"Escape"===e.key?{type:"clear"}:"ArrowLeft"===e.key?{type:"nudge",direction:"left",resize:e.shiftKey}:"ArrowRight"===e.key?{type:"nudge",direction:"right",resize:e.shiftKey}:"ArrowUp"===e.key?{type:"nudge",direction:"up",resize:e.shiftKey}:"ArrowDown"===e.key?{type:"nudge",direction:"down",resize:e.shiftKey}:null}(e);t&&(e.preventDefault(),r.current?.(t))},[])}}}({label:"xy"===i?"Two-dimensional data range brush":i.toUpperCase()+" data range brush",onAction:e=>{const t=L.current,n=_.current;if(!t||!n||!M.current)return;const o=y(M.current).select(".brush-g");if("clear"===e.type)return T.current=!0,o.call(n.move,null),T.current=!1,N.current=null,void P.current(null);const r=t.x.domain(),s=t.y.domain(),a=N.current;let l=a?.x??[r[0]+.4*(r[1]-r[0]),r[0]+.6*(r[1]-r[0])],c=a?.y??[s[0]+.4*(s[1]-s[0]),s[0]+.6*(s[1]-s[0])];const u="left"===e.direction||"right"===e.direction,h="left"===e.direction||"down"===e.direction?-1:1;if(u&&"y"!==i&&(l=w(l,r,h,e.resize)),u||"x"===i||(c=w(c,s,h,e.resize)),u&&"y"===i||!u&&"x"===i)return;const d={x:l,y:c};T.current=!0,o.call(n.move,"x"===i?[t.x(l[0]),t.x(l[1])]:"y"===i?[t.y(c[1]),t.y(c[0])]:[[t.x(l[0]),t.y(c[1])],[t.x(l[1]),t.y(c[0])]]),T.current=!1,N.current=d,P.current(d)}});return f(()=>{if(!M.current)return;const n=y(M.current).select(".brush-g"),o="x"===i?g():"y"===i?b():m();return o.extent([[0,0],[e,t]]),o.on("brush end",r=>{if(T.current)return;const s=L.current;if(!s)return;if(!r.selection)return N.current=null,void P.current(null);let a,u;if("x"===i){const[e,n]=r.selection;a=[s.x.invert(e),s.x.invert(n)],u=[s.y.invert(t),s.y.invert(0)]}else if("y"===i){const[t,n]=r.selection;a=[s.x.invert(0),s.x.invert(e)],u=[s.y.invert(n),s.y.invert(t)]}else{const[[e,t],[n,o]]=r.selection;a=[s.x.invert(e),s.x.invert(n)],u=[s.y.invert(o),s.y.invert(t)]}if("bin"===c&&"y"!==i&&("end"===r.type||"brush"===r.type&&h)){const e=I.current;e&&e.length>0?a=function(e,t){return 0===t.length?e:[A(e[0],t),S(e[1],t)]}(a,e):l&&l>0&&(a=[Math.floor(a[0]/l)*l,Math.ceil(a[1]/l)*l]);const t=s.x(a[0]),c=s.x(a[1]);if(T.current=!0,"x"===i)n.call(o.move,[t,c]);else if("xy"===i){const e=r.selection;n.call(o.move,[[t,e[0][1]],[c,e[1][1]]])}T.current=!1}const d={x:a,y:u};N.current=d,P.current(d)}),n.call(o),_.current=o,n.select(".selection").attr("fill","steelblue").attr("fill-opacity",.15).attr("stroke","steelblue").attr("stroke-width",1),()=>{o.on("brush end",null),_.current=null}},[e,t,i,c,l,h]),f(()=>{if(!(C&&s&&_.current&&N.current))return;if(!M.current)return;if("y"===i)return;const e=N.current,t=s.x.domain()[0],n=y(M.current).select(".brush-g");if(t>=e.x[1])return T.current=!0,n.call(_.current.move,null),T.current=!1,N.current=null,void P.current(null);let o=e.x[0],r=!1;if(t>e.x[0]){if(o=t,"bin"===c){const e=I.current;e&&e.length>0?o=S(t,e):l&&l>0&&(o=Math.ceil(t/l)*l)}if(o>=e.x[1])return T.current=!0,n.call(_.current.move,null),T.current=!1,N.current=null,void P.current(null);r=!0}const a=s.x(o),u=s.x(e.x[1]);if(T.current=!0,"x"===i)n.call(_.current.move,[a,u]);else{const t=s.y(e.y[1]),o=s.y(e.y[0]);n.call(_.current.move,[[a,t],[u,o]])}if(T.current=!1,r){const t={x:[o,e.x[1]],y:e.y};N.current=t,P.current(t)}},[s,C,i,c,l]),k("svg",{ref:M,width:n,height:o,...F.svgProps,style:{position:"absolute",top:0,left:0,pointerEvents:"all"},children:[x("title",{children:F.svgProps["aria-label"]}),x("desc",{id:F.descriptionId,children:F.description}),x("g",{className:"brush-g",transform:`translate(${r.left},${r.top})`})]})}var M=Object.freeze([]);function _(e){if(!e)return M;let t=!1;for(let n=0;e.length>n;n++){const o=e[n];if(null==o||"object"!=typeof o){t=!0;break}}if(!t)return e;const n=[];for(const t of e)null!=t&&"object"==typeof t&&n.push(t);return n}var P=class{constructor(e,t){this.lastBoundedData=null,this.chunkTimer=0,this.pushBuffer=[],this.flushScheduled=!1,this.callback=e,this.chunkThreshold=t?.chunkThreshold??5e3,this.chunkSize=t?.chunkSize??5e3}updateChunkOptions(e){null!=e.chunkThreshold&&(this.chunkThreshold=e.chunkThreshold),null!=e.chunkSize&&(this.chunkSize=e.chunkSize)}clearLastData(){this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0)}setBoundedData(e){if(e=_(e),this.lastBoundedData===e)return;if(this.lastBoundedData=e,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.chunkThreshold>=e.length)return void this.callback({inserts:e,bounded:!0});this.callback({inserts:e.slice(0,this.chunkSize),bounded:!0,totalSize:e.length});let t=this.chunkSize;const n=()=>{if(t>=e.length)return void(this.chunkTimer=0);if(e!==this.lastBoundedData)return void(this.chunkTimer=0);const o=Math.min(t+this.chunkSize,e.length);this.callback({inserts:e.slice(t,o),bounded:!1}),t=o,this.chunkTimer=e.length>t?requestAnimationFrame(n):0};this.chunkTimer=requestAnimationFrame(n)}setReplacementData(e){if(e=_(e),this.lastBoundedData=e,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.pushBuffer=[],this.flushScheduled=!1,this.chunkThreshold>=e.length)return void this.callback({inserts:e,bounded:!0,preserveCategoryOrder:!0});this.callback({inserts:e.slice(0,this.chunkSize),bounded:!0,preserveCategoryOrder:!0,totalSize:e.length});let t=this.chunkSize;const n=()=>{if(t>=e.length)return void(this.chunkTimer=0);if(e!==this.lastBoundedData)return void(this.chunkTimer=0);const o=Math.min(t+this.chunkSize,e.length);this.callback({inserts:e.slice(t,o),bounded:!1}),t=o,this.chunkTimer=e.length>t?requestAnimationFrame(n):0};this.chunkTimer=requestAnimationFrame(n)}flushPushBuffer(){if(this.flushScheduled=!1,0===this.pushBuffer.length)return;const e=this.pushBuffer;this.pushBuffer=[],this.callback({inserts:e,bounded:!1})}scheduleFlush(){this.flushScheduled||(this.flushScheduled=!0,queueMicrotask(()=>this.flushPushBuffer()))}push(e){null!=e&&"object"==typeof e&&(this.pushBuffer.push(e),this.scheduleFlush())}pushMany(e){if(0===e.length)return;let t=0;for(let n=0;e.length>n;n++){const o=e[n];null!=o&&"object"==typeof o&&(this.pushBuffer.push(o),t++)}0!==t&&this.scheduleFlush()}flush(){this.flushPushBuffer()}clear(){this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1}};import{createContext as L,useCallback as R,useContext as I,useMemo as T,useRef as N,useSyncExternalStore as F}from"react";import{jsx as B}from"react/jsx-runtime";function O(e){let t=null;const n=()=>(t||(t=L(null)),t),o=W(e);return[function({children:t,initialState:o}){const r=N(o),i=T(()=>W(e,r.current),[]),s=n();return B(s.Provider,{value:i,children:t})},(e,t)=>{const r=n(),i=I(r)??o,s=N(e);s.current=e;const a=N({hasValue:!1,value:void 0}),l=R(()=>{const e=s.current(i.getState()),n=a.current;return n.hasValue&&t&&t(n.value,e)?n.value:(a.current={hasValue:!0,value:e},e)},[i,t]),c=R(()=>s.current(i.getState()),[i]);return F(i.subscribe,l,c)}]}function W(e,t){const n=new Set;let o={...e(function(e){const t=e(o);if(function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}(t)){o={...o,...t};for(const e of n)e()}}),...t??{}};return{getState:()=>o,subscribe:function(e){return n.add(e),()=>{n.delete(e)}}}}function D(e){if(!e?.colors)return;const t=e.colors;return{primary:t.primary,secondary:t.secondary||t.primary,surface:t.surface||t.background,success:t.success,danger:t.danger,warning:t.warning,error:t.error,info:t.info,text:t.text,textSecondary:t.textSecondary,border:t.border,grid:t.grid}}function z(e){if(!e.accessibility)return e;let t=e;if(e.accessibility.colorBlindSafe&&(t={...t,colors:{...t.colors,categorical:H}}),e.accessibility.highContrast){const e="dark"===t.mode;t={...t,colors:{...t.colors,text:e?"#ffffff":"#000000",textSecondary:e?"#cccccc":"#333333",grid:e?"#666666":"#999999",border:e?"#888888":"#000000"}}}return t}var H=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],E={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},$={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},j={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:H,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"};function Y(e,t){if("light"===t)return E;if("dark"===t)return $;if("high-contrast"===t)return j;if("string"==typeof t)return void 0!==console&&console.warn(`[ThemeStore] Unknown theme preset "${t}". Keeping current theme.`),e;if(t.mode&&"auto"!==t.mode){const e="dark"===t.mode?$:E;return z({...e,...t,colors:{...e.colors,...t.colors||{}},typography:{...e.typography,...t.typography||{}}})}return z({...e,...t,colors:{...e.colors,...t.colors||{}},typography:{...e.typography,...t.typography||{}}})}var[G,V]=O(e=>({theme:E,setTheme(t){e(e=>({theme:Y(e.theme,t)}))}})),X=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const n of e){const e=this.push(n);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++)e(this.buffer[(t+n)%this._capacity],n)}toArray(){const e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++)e[n]=this.buffer[(t+n)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");const t=this.toArray();let n=0,o=[];t.length>e&&(n=t.length-e,o=t.slice(0,n)),this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(let e=n;t.length>e;e++)this.push(t[e]);return o}update(e,t){const n=[],o=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++){const i=(o+r)%this._capacity,s=this.buffer[i];if(e(s)){let e;e="object"!=typeof s||null===s?s:Array.isArray(s)?[...s]:{...s},n.push(e),this.buffer[i]=t(s)}}return n}remove(e){const t=[],n=[];if(this.forEach(o=>{e(o)?n.push(o):t.push(o)}),0===n.length)return n;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return n}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},q=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}evict(e){e!==this._min&&e!==this._max||(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(const n of e){const e=t?t(n):n;Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}};function U(e,t){return e===t}function K(e,t){if("function"==typeof e)return t=>+e(t);const n=e||t;return e=>+e[n]}function Q(e,t){if("function"==typeof e)return e;const n=e||t;return e=>e[n]}function Z(e,t){return"function"==typeof e?e:e?t=>t[e]+"":t?e=>e[t]+"":void 0}var J=/^\d{4}-\d{1,2}$/;function ee(e){const t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;const n=J.test(t)?t+"-01":t;if(n===t&&10>t.length)return NaN;const o=Date.parse(n);return Number.isFinite(o)?o:NaN}function te(e){return e instanceof Date?e.getTime():"string"==typeof e?ee(e):+e}function ne(e){return new Set(Array.isArray(e)?e:[e])}import{scaleOrdinal as oe}from"d3-scale";function re(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function ie(e,t,n){const o=e=>e.toString(16).padStart(2,"0");return`#${o(e)}${o(t)}${o(n)}`}function se(e){const t=e.map(re),n=t.length-1;return e=>{if(0>=e){const[e,n,o]=t[0];return ie(e,n,o)}if(e>=1){const[e,o,r]=t[n];return ie(e,o,r)}const o=e*n,r=Math.floor(o),i=o-r,[s,a,l]=t[r],[c,u,h]=t[r+1];return ie(Math.round(s+(c-s)*i),Math.round(a+(u-a)*i),Math.round(l+(h-l)*i))}}var ae=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],le=se(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),ce=se(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),ue=se(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),he=se(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),de=se(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),fe=se(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),pe=se(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),ye=se(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),me=se(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),ge=se(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),be=se(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),ve=se(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),xe={blues:le,reds:ce,greens:ue,viridis:pe,oranges:he,purples:de,greys:fe,plasma:ye,inferno:me,magma:ge,cividis:be,turbo:ve};function ke(e){return e&&xe[e]||le}se(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),se(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),se(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),se(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),se(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),se(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),se(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]);var we={category10:ae,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],...xe},Ae=ae,Se=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],Ce=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 Me(e,t,n){if("function"==typeof t){const o=t(e);return n&&o&&"string"==typeof o&&!function(e){const t=e.toLowerCase();return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||Ce.has(t)}(o)?n(o):o}const o=e?.[t]+"";return n?n(o):Ae[Math.abs(function(e){let t=0;for(let n=0;e.length>n;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}(o))%Ae.length]}function _e(e,t){if(null==t||!Object.prototype.hasOwnProperty.call(e,t))return;const n=e[t];return"string"==typeof n&&n.length>0?n:void 0}function Pe(e,t,n="category10"){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;return t=>_e(e,t)??"#999"}const o=Array.from(new Set(e.map(e=>e?.[t]).filter(e=>null!=e).map(e=>e+""))),r=o.every(e=>!isNaN(Number(e)));if(Array.isArray(n))return oe().domain(o).range(n).unknown("#999");const i=we[n]||we.category10;if(r&&"function"==typeof i){let e=-1/0;for(const t of o){const n=Number(t);n>e&&(e=n)}return t=>i(Number(t)/e)}{const e=Array.isArray(i)?i:Ae;return oe().domain(o).range(e).unknown("#999")}}function Le(e,t,n=[3,20],o){let r;if(r="function"==typeof t?t(e):e?.[t],!o)return r;const[i,s]=o,[a,l]=n;if(s===i)return(a+l)/2;let c=(r-i)/(s-i);return 0>c?c=0:c>1&&(c=1),a+c*(l-a)}function Re(e,t,n){return e+(t-e)*n}function Ie(){return"undefined"!=typeof performance?performance.now():Date.now()}function Te(e,t,n){if(1>=n)return 1;const o=n-1;return function(e){const t=Math.max(0,Math.min(1,e.minOpacity??.1));if(Number.isNaN(e.age))return 1;if(e.age===1/0)return t;if(!Number.isFinite(e.extent)||0>=e.extent)return 1;const n=Math.max(0,e.age);if("step"===e.type)return(e.threshold??.5*e.extent)>n?1:t;if("exponential"===e.type){const o=e.halfLife??e.extent/2;return t+Math.pow(.5,n/(o>0?o:e.extent/2))*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}({age:o-t,extent:o,type:e.type,halfLife:e.halfLife??n/2,threshold:e.stepThreshold??.5*n,minOpacity:e.minOpacity??.1})}function Ne(e){const t=new Map;for(let n=0;e.length>n;n++)t.set(e[n],n);return t}function Fe(e,t,n){const o=e.duration??500,r=n-t;return o>r?1-r/o:0}function Be(e,t,n,o){let r=!1;return t>0?(e._pulseIntensity!==t&&(e._pulseIntensity=t,r=!0),e._pulseColor!==n&&(e._pulseColor=n,r=!0),e._pulseGlowRadius!==o&&(e._pulseGlowRadius=o,r=!0),r):(0!==e._pulseIntensity&&(e._pulseIntensity=0,r=!0),void 0!==e._pulseColor&&(e._pulseColor=void 0,r=!0),void 0!==e._pulseGlowRadius&&(e._pulseGlowRadius=void 0,r=!0),r)}function Oe(e,t,n){if(t._transitionKey)return t._transitionKey;switch(t.type){case"point":if(t.pointId)return"p:"+t.pointId;if("streaming"===e.runtimeMode&&t.datum){const n=e.getX(t.datum),o=e.getY(t.datum);if(e.getCategory)return`p:${e.getCategory(t.datum)}:${n}:${o}`;if(null!=n&&null!=o)return`p:${n}:${o}`}return"p:"+n;case"glyph":return t.pointId?"g:"+t.pointId:"g:"+n;case"rect":return`r:${t.group||""}:${t.datum?.binStart??t.datum?.category??n}`;case"heatcell":return`h:${t.x}_${t.y}`;case"candlestick":return null==t.datum?"c:"+n:"c:"+e.getX(t.datum);case"line":return"l:"+(t.group||"_default");case"area":return"a:"+(t.group||"_default");default:return null}}function We(e,t,n,o,r,i){const s=[];for(const r of e){const e=n(r),i=o(r);Number.isFinite(e)&&Number.isFinite(i)&&s.push({px:t.x(e),py:t.y(i),rawY:i,d:r})}s.sort((e,t)=>e.px-t.px);const a=Array(s.length),l=Array(s.length),c=Array(s.length);for(let e=0;s.length>e;e++){const t=s[e];a[e]=[t.px,t.py],l[e]=t.rawY,c[e]=t.d}return{type:"line",path:a,rawValues:l,style:r,datum:c,group:i}}function De(e,t,n,o,r,i,s,a){const l=[];for(const i of e){const e=n(i),s=o(i);if(!Number.isFinite(e)||!Number.isFinite(s))continue;const c=t.x(e),u=a?a(i):r;l.push({px:c,topY:t.y(s),botY:t.y(u)})}l.sort((e,t)=>e.px-t.px);const c=Array(l.length),u=Array(l.length);for(let e=0;l.length>e;e++){const t=l[e];c[e]=[t.px,t.topY],u[e]=[t.px,t.botY]}return{type:"area",topPath:c,bottomPath:u,style:i,datum:e,group:s}}function ze(e,t,n,o){const r=new Map;if("silhouette"===o)for(const o of e){let e=0;for(const r of t)e+=n(r,o)||0;r.set(o,-e/2)}else if("wiggle"===o){e.length>0&&r.set(e[0],0);for(let o=1;e.length>o;o++){const i=e[o-1],s=e[o];let a=0,l=0,c=0;for(const e of t){const t=n(e,s)||0;a+=(2*c+t)*(t-(n(e,i)||0)),l+=t,c+=t}const u=r.get(i)??0;r.set(s,u-(l>0?a/(2*l):0))}if(e.length>0){let o=0;for(const i of e){let e=0;for(const o of t)e+=n(o,i)||0;o+=(r.get(i)??0)+e/2}const i=o/e.length;for(const t of e)r.set(t,(r.get(t)??0)-i)}}else for(const t of e)r.set(t,0);return r}function He(e,t,n,o,r,i,s){const a=n(e),l=o(e);if(!Number.isFinite(a)||!Number.isFinite(l))return null;const c={type:"point",x:t.x(a),y:t.y(l),r:r,style:i,datum:e};return void 0!==s&&(c.pointId=s),c}function Ee(e,t,n,o,r,i,s,a){const l=n(e),c=o(e);if(!Number.isFinite(l)||!Number.isFinite(c))return null;const u={type:"symbol",x:t.x(l),y:t.y(c),size:r,symbolType:i,style:s,datum:e};return void 0!==a&&(u.pointId=a),u}function $e(e,t,n,o,r,i,s){return{type:"rect",x:e,y:t,w:n,h:o,style:r,datum:i,group:s}}function je(e,t,n,o,r,i,s){const a={type:"heatcell",x:e,y:t,w:n,h:o,fill:r,datum:i};return s?.showValues&&(a.showValues=!0,a.value=s.value,s.valueFormat&&(a.valueFormat=s.valueFormat)),a}function Ye(e,t,n,o){return"function"==typeof t.style?t.style(o||{},n):t.style&&"object"==typeof t.style?t.style:e.resolveBoundsStyle(n,o)}function Ge(e,t,n,o){if(!e.scales)return null;const r=[],i=[];for(const n of t){const t=e.getX(n);if(!Number.isFinite(t))continue;const s=o.getTop(n),a=o.getBottom(n);if(!Number.isFinite(s)||!Number.isFinite(a))continue;const l=e.scales.x(t),c=e.scales.y(s),u=e.scales.y(a);Number.isFinite(l)&&Number.isFinite(c)&&Number.isFinite(u)&&(r.push([l,c]),i.push([l,u]))}return 2>r.length?null:{type:"area",topPath:r,bottomPath:i,style:Ye(e,o,n,t[0]),datum:t,group:n,interactive:o.interactive}}function Ve(e){const t=[],n=[];if(!e)return{perSeries:t,aggregate:n};for(const o of e)o.perSeries?t.push(o):n.push(o);return{perSeries:t,aggregate:n}}function Xe(e,t,n){const o=[];for(const r of n){const n=Ge(e,t,"__ribbon_aggregate",r);n&&o.push(n)}return o}function qe(e,t,n,o){const r=[];for(const i of o){const o=Ge(e,t,n,i);o&&r.push(o)}return r}function Ue(e,t){if(!e)return{};if(!t||0===t.length)return e;const n=[];for(const o of t){if("band"!==o.kind)continue;const t=o.getTop(e),r=o.getBottom(e);Number.isFinite(r)&&Number.isFinite(t)&&n.push({y0:r,y1:t})}return 0===n.length?e:{...e,band:n[0],bands:n}}function Ke(e,t,n,o){if(!e.config.pointStyle)return;const r=o??e.getY;for(const o of t){const t=e.resolveGroupColor(o.key);for(const i of o.data){let o=e.config.pointStyle(i);!o.fill&&t&&(o={...o,fill:t});const s=o.r??3,a=e.getPointId?e.getPointId(i)+"":void 0,l=He(i,e.scales,e.getX,r,s,o,a);l&&n.push(l)}}}function Qe(e){return"threshold"===e.type&&"string"==typeof e.color&&"number"==typeof e.value}var Ze={topOpacity:.8,bottomOpacity:.05};function Je(e){if(e)return!0===e?Ze:"colorStops"in e?e:{topOpacity:e.topOpacity??Ze.topOpacity,bottomOpacity:e.bottomOpacity??Ze.bottomOpacity}}import{symbol as et,symbolCircle as tt,symbolCross as nt,symbolDiamond as ot,symbolSquare as rt,symbolStar as it,symbolTriangle as st,symbolWye as at}from"d3-shape";var lt={circle:tt,square:rt,triangle:st,diamond:ot,star:it,cross:nt,wye:at},ct=["circle","triangle","diamond","star","square","chevron","cross","wye"];function ut(e,t,n){if(n)return n;const o=e??"circle";return"chevron"===o?function(e){const t=1.5*ht(e),n=.92*t;return`M0,${-t}L${n},${(.78*t).toFixed(3)}L0,${(.28*t).toFixed(3)}L${-n},${(.78*t).toFixed(3)}Z`}(t):et(lt[o]??tt,Math.max(1,t))()??""}function ht(e){return Math.sqrt(Math.max(1,e)/Math.PI)}var dt=new Map;function ft(e,t,n,o,r){const i=new Map;for(const s of e){const e=t(s),a=n(s);if(null==e||null==a||Number.isNaN(e)||Number.isNaN(a))continue;const l=Math.floor(e/o)*o;let c=i.get(l);if(c||(c={start:l,end:l+o,total:0,categories:new Map},i.set(l,c)),c.total+=a,r){const e=r(s);c.categories.set(e,(c.categories.get(e)||0)+a)}}return i}function pt(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(pt))}function yt(e,t,n){e.has(t)||(e.add(t),console.warn(n))}function mt(e,t){const n="function"==typeof e?e:n=>n[e||t];return e=>{const t=n(e);return null==t?NaN:+t}}function gt(e){const t=[],n=["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode,o=mt(n&&e.valueAccessor||e.yAccessor,n?"value":"y");if(e.boundsAccessor){const n=K(e.boundsAccessor,"bounds");t.push({kind:"bounds",getTop:e=>{const t=o(e);if(!Number.isFinite(t))return NaN;const r=n(e);return Number.isFinite(r)&&0!==r?t+r:t},getBottom:e=>{const t=o(e);if(!Number.isFinite(t))return NaN;const r=n(e);return Number.isFinite(r)&&0!==r?t-r:t},style:e.boundsStyle,perSeries:!0,interactive:!1})}if(e.band){const n=Array.isArray(e.band)?e.band:[e.band];for(const e of n)t.push({kind:"band",getTop:mt(e.y1Accessor,"y1"),getBottom:mt(e.y0Accessor,"y0"),style:e.style,perSeries:!1!==e.perSeries,interactive:!0===e.interactive})}return t}import{scaleLinear as bt,scaleLog as vt,scaleSymlog as xt,scaleTime as kt}from"d3-scale";function wt(e,t){return t?[t[0]??e[0],t[1]??e[1]]:e}function At(e,t,n){if("log"===e){const e=[Math.max(t[0],1e-6),Math.max(t[1],1e-6)];return vt().domain(e).range(n).clamp(!0)}return"symlog"===e?xt().domain(t).range(n):"time"===e?kt().domain([new Date(t[0]),new Date(t[1])]).range(n):bt().domain(t).range(n)}function St(e,t,n,o){const r=e.push(t);return n&&n.push(o),r}var Ct=new WeakMap;var Mt={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"};function _t(e,t){const n={...e};for(const e of t)n[Mt[e]]++;return n}function Pt(e,t,n){const o=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:o,revisions:_t(n,o)}}var Lt=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=Pt({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){const n=Pt(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}},Rt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],It=["scene-style","data-paint","accessibility","evidence"],Tt=(e,t)=>({retainedData:e,invalidations:t}),Nt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ft=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Bt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ot=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Wt=["scene-geometry","data-paint","accessibility","evidence"],Dt=["scene-style","data-paint","accessibility","evidence"],zt=[],Ht={chartType:Tt("rebuild",Nt),runtimeMode:Tt("rebuild",Nt),xAccessor:Tt("rebuild",Nt),yAccessor:Tt("rebuild",Nt),timeAccessor:Tt("rebuild",Nt),valueAccessor:Tt("rebuild",Nt),y0Accessor:Tt("rebuild",Nt),boundsAccessor:Tt("rebuild",Nt),band:Tt("rebuild",Nt),openAccessor:Tt("rebuild",Nt),highAccessor:Tt("rebuild",Nt),lowAccessor:Tt("rebuild",Nt),closeAccessor:Tt("rebuild",Nt),candlestickRangeMode:Tt("rebuild",Nt),accessorRevision:Tt("rebuild",Nt),groupAccessor:Tt("rebuild",Ft),categoryAccessor:Tt("rebuild",Ft),lineDataAccessor:Tt("rebuild",Ft),colorAccessor:Tt("rebuild",Dt),sizeAccessor:Tt("rebuild",Wt),symbolAccessor:Tt("rebuild",Wt),pointIdAccessor:Tt("rebuild",Wt),xScaleType:Tt("preserve",Bt),yScaleType:Tt("preserve",Bt),xExtent:Tt("preserve",Bt),yExtent:Tt("preserve",Bt),extentPadding:Tt("preserve",Bt),scalePadding:Tt("preserve",Bt),axisExtent:Tt("preserve",Bt),binSize:Tt("preserve",Bt),normalize:Tt("preserve",Bt),heatmapAggregation:Tt("preserve",Bt),heatmapXBins:Tt("preserve",Bt),heatmapYBins:Tt("preserve",Bt),arrowOfTime:Tt("preserve",Ot),baseline:Tt("preserve",Ot),stackOrder:Tt("preserve",Ot),sizeRange:Tt("preserve",Ot),curve:Tt("preserve",Ot),areaGroups:Tt("preserve",Ot),customLayout:Tt("preserve",Ot),layoutConfig:Tt("preserve",Ot),layoutMargin:Tt("preserve",Ot),symbolMap:Tt("preserve",Wt),showValues:Tt("preserve",Wt),heatmapValueFormat:Tt("preserve",Wt),lineStyle:Tt("preserve",Dt),pointStyle:Tt("preserve",Dt),areaStyle:Tt("preserve",Dt),barStyle:Tt("preserve",Dt),swarmStyle:Tt("preserve",Dt),waterfallStyle:Tt("preserve",Dt),candlestickStyle:Tt("preserve",Dt),boundsStyle:Tt("preserve",Dt),gradientFill:Tt("preserve",Dt),lineGradient:Tt("preserve",Dt),colorScheme:Tt("preserve",Dt),themeCategorical:Tt("preserve",Dt),themeSemantic:Tt("preserve",Dt),themeSequential:Tt("preserve",Dt),themeDiverging:Tt("preserve",Dt),barColors:Tt("preserve",Dt),decay:Tt("preserve",Dt),pulse:Tt("preserve",Dt),staleness:Tt("preserve",Dt),layoutSelection:Tt("preserve",Dt),annotations:Tt("preserve",["overlay","accessibility","evidence"]),windowSize:Tt("preserve",zt),windowMode:Tt("preserve",zt),maxCapacity:Tt("preserve",zt),clock:Tt("preserve",zt),transition:Tt("preserve",zt),introAnimation:Tt("preserve",zt),onLayoutError:Tt("preserve",zt)},Et=Tt("preserve",Ot),$t=class{constructor(){this.tracker=new Lt}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},Rt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},It):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const n=new Set;for(const o of e){const e=Ht[o]??Et;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)n.add(t)}return{retainedData:t,invalidations:n}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};import{quadtree as jt}from"d3-quadtree";var Yt=class{constructor(){this.maxRadius=0,this.tree=null}get quadtree(){return this.tree}get maxPointRadius(){return this.maxRadius}clear(){this.tree=null,this.maxRadius=0}rebuild(e,t){if("scatter"!==e&&"bubble"!==e&&"custom"!==e)return void this.clear();let n=0,o=0;for(const e of t)"point"===e.type&&(n++,e.r>o&&(o=e.r));if(this.maxRadius=o,500>=n)return void(this.tree=null);const r=Array(n);let i=0;for(const e of t)"point"===e.type&&(r[i++]=e);this.tree=jt().x(e=>e.x).y(e=>e.y).addAll(r)}},Gt=class e{constructor(e){if(this.xExtent=new q,this.yExtent=new q,this.growingCapacityWarned=!1,this.windowSizeWarned=!1,this.resolvedRibbons=[],this.timestampBuffer=null,this.activeTransition=null,this._hasRenderedOnce=!1,this.prevPositionMap=new Map,this.prevPathMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this._ingestVersion=0,this._datumIndexCache=null,this._bufferArrayCache=null,this._bufferDirty=!0,this.needsFullRebuild=!0,this.lastLayout=null,this.updateResults=new $t,this.scales=null,this.scene=[],this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.xIsDate=!1,this.spatialIndex=new Yt,this._lastBoundedInsertsRef=null,this.applyPulse=(e,t,n)=>!(!this.config.pulse||!this.timestampBuffer)&&function(e,t,n,o,r,i=("undefined"!=typeof performance?performance.now():Date.now())){const s=e.color??"rgba(255,255,255,0.6)",a=e.glowRadius??4;let l=!1;const c=r??(()=>{const e=new Map;for(let t=0;n.length>t;t++)e.set(n[t],t);return e})();for(const n of t){if("line"===n.type)continue;if("area"===n.type){const t=Array.isArray(n.datum)?n.datum:[n.datum];let r=0,a=!1;for(const n of t){const t=c.get(n);if(null==t)continue;a=!0;const s=o.get(t);if(null==s)continue;const l=Fe(e,s,i);l>r&&(r=l)}a&&(l=Be(n,r,s)||l);continue}const t=c.get(n.datum);if(null==t)continue;const r=o.get(t);l=Be(n,null==r?0:Fe(e,r,i),s,a)||l}return l}(this.config.pulse,e,t,this.timestampBuffer,this.getDatumIndexMap(t),n),this.config=e,this.buffer=new X(e.windowSize),this.growingCap=e.windowSize,["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode?(this.getX=K(e.timeAccessor||e.xAccessor,"time"),this.getY=K(e.valueAccessor||e.yAccessor,"value")):(this.getX=K(e.xAccessor,"x"),this.getY=K(e.yAccessor,"y")),this.getGroup=Z(e.groupAccessor),this.getCategory=Z(e.categoryAccessor),this.getSize=e.sizeAccessor?K(e.sizeAccessor,"size"):void 0,this.getColor=Z(e.colorAccessor),this.getSymbol=Z(e.symbolAccessor),this.getY0=e.y0Accessor?K(e.y0Accessor,"y0"):void 0,this.resolvedRibbons=gt(e),this.getPointId=Z(e.pointIdAccessor),"candlestick"===e.chartType){const t=null!=e.openAccessor,n=null!=e.closeAccessor;this.getOpen=t?K(e.openAccessor,"open"):void 0,this.getHigh=K(e.highAccessor,"high"),this.getLow=K(e.lowAccessor,"low"),this.getClose=n?K(e.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!t&&!n}e.pulse&&(this.timestampBuffer=new X(e.windowSize))}currentTime(){return this.config.clock?.()??Ie()}syncPulseTimestampBuffer(){this.config.pulse?null!=this.timestampBuffer&&this.timestampBuffer.capacity===this.buffer.capacity&&this.timestampBuffer.size===this.buffer.size||(this.timestampBuffer=function(e,t){const n=new X(e.capacity);return e.forEach(()=>n.push(t)),n}(this.buffer,this.currentTime())):this.timestampBuffer=null}pushDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.push(this.getHigh(e)),void this.yExtent.push(this.getLow(e));this.yExtent.push(this.getY(e)),this.getY0&&this.yExtent.push(this.getY0(e));for(const t of this.resolvedRibbons){const n=t.getTop(e),o=t.getBottom(e);Number.isFinite(n)&&this.yExtent.push(n),Number.isFinite(o)&&this.yExtent.push(o)}}evictDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.evict(this.getHigh(e)),void this.yExtent.evict(this.getLow(e));this.yExtent.evict(this.getY(e)),this.getY0&&this.yExtent.evict(this.getY0(e));for(const t of this.resolvedRibbons){const n=t.getTop(e),o=t.getBottom(e);Number.isFinite(n)&&this.yExtent.evict(n),Number.isFinite(o)&&this.yExtent.evict(o)}}rebuildYExtent(){this.yExtent.clear();for(const e of this.buffer)this.pushDatumYExtent(e)}rebuildExtents(){this.xExtent.clear(),this.yExtent.clear();for(const e of this.buffer)this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e)}ingest(e){if(e.bounded&&this._lastBoundedInsertsRef===e.inserts)return this.updateResults.recordNoop("replace"),!1;const t=this.currentTime();if(this.lastIngestTime=t,this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,e.bounded){this._lastBoundedInsertsRef=e.inserts,this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear();const i=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode;if(this.getX=i?K(this.config.timeAccessor||this.config.xAccessor,"time"):K(this.config.xAccessor,"x"),this.xIsDate=!1,e.inserts.length>0){const t=e.inserts[0],n=this.config.xAccessor,o="function"==typeof n?n(t):t[n||"x"],r=o instanceof Date,i="string"==typeof o&&Number.isFinite(ee(o));if(this.xIsDate=r||i,i){const e="string"==typeof n?n:void 0;this.getX=e?t=>te(t[e]):e=>te(n(e))}}r=this.timestampBuffer,(o=e.totalSize||e.inserts.length)>(n=this.buffer).capacity&&(n.resize(o),r&&o>r.capacity&&r.resize(o));for(const n of e.inserts)St(this.buffer,n,this.timestampBuffer,t),this.xExtent.push(this.getX(n)),this.pushDatumYExtent(n)}else for(const n of e.inserts){if("growing"===this.config.windowMode&&this.buffer.full){const e=this.config.maxCapacity??1e5;e>this.growingCap&&(this.growingCap=Math.min(2*this.growingCap,e),this.buffer.resize(this.growingCap),this.timestampBuffer&&this.timestampBuffer.resize(this.growingCap),"production"===process.env.NODE_ENV||this.growingCapacityWarned||5e4>this.growingCap||(this.growingCapacityWarned=!0,console.warn(`[Semiotic] Growing window buffer reached ${this.growingCap} points (cap ${e}). Large canvas scenes are expensive — prefer a sliding window, aggregation, or an explicit maxCapacity if this is intentional.`)))}const e=St(this.buffer,n,this.timestampBuffer,t);this.xExtent.push(this.getX(n)),this.pushDatumYExtent(n),null!=e&&(this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e))}var n,o,r;return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}computeScene(e){const{config:t,buffer:n}=this,o=this.scales,r=this.lastLayout;if(!this.needsFullRebuild&&!t.customLayout&&this.lastLayout&&this.scene.length>0&&this.scales&&0>=(this.config.scalePadding??0)&&(this.lastLayout.width!==e.width||this.lastLayout.height!==e.height))return void this.remapScene(e);this.xExtent.dirty&&this.xExtent.recalculate(n,this.getX),this.yExtent.dirty&&this.rebuildYExtent();const i=this.getBufferArray(),s=this.yExtent.extent;let a=wt(this.xExtent.extent,t.xExtent),l=wt(s,t.yExtent);const c=!(!(u=t.yExtent)||null==u[0]||null==u[1]);var u;const h="exact"===t.axisExtent;if("stackedarea"===t.chartType&&!c&&n.size>0){const e=function(e){const{config:t,groups:n,getX:o,getY:r}=e,i="exact"===t.axisExtent;if(t.normalize){const n=[0,i?1:1+t.extentPadding];return{yDomain:n,stackExtentCache:{key:`${e.bufferSize}:${e.ingestVersion}:norm`,yDomain:n}}}const s=`${e.bufferSize}:${e.ingestVersion}:${t.baseline??"zero"}:${t.stackOrder??"key"}`;if(e.stackExtentCache&&e.stackExtentCache.key===s)return{yDomain:e.stackExtentCache.yDomain,stackExtentCache:e.stackExtentCache};const a=new Map,l=new Set;let c=0;const u=new Map,h=new Map;for(const e of n){const t=new Map;let n=0;for(const i of e.data){const e=o(i),s=r(i);if(!Number.isFinite(e)||!Number.isFinite(s))continue;t.set(e,(t.get(e)||0)+s),l.add(e),n+=s;const a=(u.get(e)||0)+s;u.set(e,a),a>c&&(c=a)}a.set(e.key,t),h.set(e.key,n)}const d=t.stackOrder??"key",f=(e,t)=>t>e?-1:e>t?1:0;let p,y;if("input"===d)p=n.map(e=>e.key);else if("insideOut"===d){const e=[...n].map(e=>e.key).sort((e,t)=>{const n=(h.get(t)??0)-(h.get(e)??0);return 0!==n?n:f(e,t)}),t=[],o=[];let r=0,i=0;for(const n of e)i>r?(t.push(n),r+=h.get(n)??0):(o.push(n),i+=h.get(n)??0);p=[...o.reverse(),...t]}else p="asc"===d?n.map(e=>e.key).sort((e,t)=>{const n=(h.get(e)??0)-(h.get(t)??0);return 0!==n?n:f(e,t)}):"desc"===d?n.map(e=>e.key).sort((e,t)=>{const n=(h.get(t)??0)-(h.get(e)??0);return 0!==n?n:f(e,t)}):n.map(e=>e.key).sort(f);if("wiggle"===t.baseline||"silhouette"===t.baseline){const e=Array.from(l).sort((e,t)=>e-t),n=ze(e,p,(e,t)=>a.get(e)?.get(t)||0,t.baseline);let o=1/0,r=-1/0;for(const t of e){const e=n.get(t)??0,i=u.get(t)??0;o>e&&(o=e),e+i>r&&(r=e+i)}Number.isFinite(o)&&Number.isFinite(r)||(o=0,r=0);const s=r-o,c=i?0:s>0?s*t.extentPadding:1;y=[o-c,r+c]}else if("diverging"===t.baseline){const e=Array.from(l).sort((e,t)=>e-t),[n,o]=function(e,t,n){let o=0,r=0;for(const i of e){let e=0,s=0;for(const o of t){const t=n(o,i)||0;0>t?s+=t:e+=t}o>s&&(o=s),e>r&&(r=e)}return[o,r]}(e,p,(e,t)=>a.get(e)?.get(t)||0),r=o-n,s=i?0:r>0?r*t.extentPadding:1;y=[n-s,o+s]}else y=[0,c+(i?0:c>0?c*t.extentPadding:1)];return{yDomain:y,stackExtentCache:{key:s,yDomain:y}}}({config:t,groups:this.groupData(i),getX:this.getX,getY:this.getY,bufferSize:n.size,ingestVersion:this._ingestVersion,stackExtentCache:this._stackExtentCache});l=e.yDomain,this._stackExtentCache=e.stackExtentCache}else"bar"===t.chartType&&t.binSize&&!c&&n.size>0?l=function(e,t,n,o,r,i,s){const[,a]=function(e,t,n,o,r){const i=ft(e,t,n,o,r);if(0===i.size)return[0,0];let s=0;for(const e of i.values())e.total>s&&(s=e.total);return[0,s]}(e,t,n,o,r);return[0,s?a:a+a*i]}(n,this.getX,this.getY,t.binSize,this.getCategory,t.extentPadding,h):"waterfall"===t.chartType&&!c&&n.size>0?l=function(e,t,n,o){const[r,i]=function(e,t){let n=0,o=0,r=0;for(const i of e){const e=t(i);null==e||Number.isNaN(e)||(r+=e,n>r&&(n=r),r>o&&(o=r))}return[n,o]}(e,t),s=i-r,a=o?0:s>0?s*n:1;return[Math.min(0,r-Math.abs(a)),Math.max(0,i+Math.abs(a))]}(n,this.getY,t.extentPadding,h):c||l[0]===1/0||(l=function(e,t,n){if(!n.length)return e;let[o,r]=e;for(const e of t)for(const t of n){const n=t.getTop(e),i=t.getBottom(e);Number.isFinite(n)&&(o>n&&(o=n),n>r&&(r=n)),Number.isFinite(i)&&(o>i&&(o=i),i>r&&(r=i))}return[o,r]}(l,i,this.resolvedRibbons),l=function(e,t){const n=e[1]-e[0],o=t.exactMode?0:n>0?n*t.extentPadding:1,r=[null!=t.userMin?e[0]:e[0]-o,null!=t.userMax?e[1]:e[1]+o];return"log"!==t.yScaleType||r[0]>0||0>=t.dataYDomain[0]||t.exactMode||null==t.userMin&&(r[0]=t.dataYDomain[0]/(1+t.extentPadding)),r}(l,{exactMode:h,extentPadding:t.extentPadding,userMin:t.yExtent?.[0],userMax:t.yExtent?.[1],yScaleType:t.yScaleType,dataYDomain:s}));l=function(e,t,n){if(!t||n)return e;const o=t[0],r=t[1];return null==o&&null==r?e:[null!=o?o:e[0],null!=r?r:e[1]]}(l,t.yExtent,!!c),({xDomain:a,yDomain:l}=function(e,t,n){let o=e,r=t;if(o[0]===1/0||o[1]===-1/0)if("time"===n){const e=Date.now();o=[e-864e5,e]}else o=[0,1];return r[0]!==1/0&&r[1]!==-1/0||(r=[0,1]),{xDomain:o,yDomain:r}}(a,l,t.xScaleType)),this.scales=function(e){const{config:t,layout:n,xDomain:o,yDomain:r}=e,i="streaming"===t.runtimeMode,s=Math.max(0,Math.min(t.scalePadding||0,Math.min(n.width,n.height)/2-1));if(i){if("x"==("up"===(a=t.arrowOfTime)||"down"===a?"y":"x")){const e="right"===t.arrowOfTime?[s,n.width-s]:[n.width-s,s];return{x:bt().domain(o).range(e),y:At(t.yScaleType,r,[n.height-s,s])}}const e="down"===t.arrowOfTime?[s,n.height-s]:[n.height-s,s];return{x:At(t.yScaleType,r,[s,n.width-s]),y:bt().domain(o).range(e)}}var a;return{x:At(t.xScaleType,o,[s,n.width-s]),y:At(t.yScaleType,r,[n.height-s,s])}}({config:t,layout:e,xDomain:a,yDomain:l}),this._customLayoutFailedThisBuild=!1;const d=this.buildSceneNodes(e,i);if(this._customLayoutFailedThisBuild)return!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=o,this.lastLayout=r):(this.scene=[],this.spatialIndex.rebuild(this.config.chartType,this.scene)),void(this.needsFullRebuild=!0);this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=d,this.config.decay&&this.applyDecay(this.scene,i),this.config.pulse&&this.applyPulse(this.scene,i,this.currentTime()),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&(this.prevPositionMap.size>0||this.prevPathMap.size>0)&&this.startTransition(),this.spatialIndex.rebuild(this.config.chartType,this.scene),this.needsFullRebuild=!1,this.lastLayout={width:e.width,height:e.height},this.version++}get quadtree(){return this.spatialIndex.quadtree}get maxPointRadius(){return this.spatialIndex.maxPointRadius}remapScene(e){const t=e.width/this.lastLayout.width,n=e.height/this.lastLayout.height;for(const e of this.scene)switch(e.type){case"line":for(const o of e.path)o[0]*=t,o[1]*=n;break;case"area":for(const o of e.topPath)o[0]*=t,o[1]*=n;for(const o of e.bottomPath)o[0]*=t,o[1]*=n;e.clipRect&&(e.clipRect={x:e.clipRect.x*t,y:e.clipRect.y*n,width:e.clipRect.width*t,height:e.clipRect.height*n});break;case"point":case"glyph":e.x*=t,e.y*=n;break;case"rect":case"heatcell":e.x*=t,e.y*=n,e.w*=t,e.h*=n;break;case"candlestick":e.x*=t,e.openY*=n,e.closeY*=n,e.highY*=n,e.lowY*=n}const o=this.scales.x.domain(),r=this.scales.y.domain(),i=this.scales.x.range(),s=this.scales.y.range(),a=At,l=Math.max(0,Math.min(this.config.scalePadding||0,Math.min(e.width,e.height)/2-1)),c=s[1]>s[0];this.scales={x:a(this.config.xScaleType,o,i[0]>i[1]?[e.width-l,l]:[l,e.width-l]),y:a(this.config.yScaleType,r,c?[l,e.height-l]:[e.height-l,l])},this.lastLayout={width:e.width,height:e.height},this.spatialIndex.rebuild(this.config.chartType,this.scene),this.version++}buildSceneNodes(e,t){const{config:n,scales:o}=this;if(!o)return[];if(n.customLayout){const r={data:t,scales:o,dimensions:{width:e.width,height:e.height,margin:n.layoutMargin??{top:0,right:0,bottom:0,left:0},plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:n.themeSemantic??{},categorical:n.themeCategorical??Se},resolveColor:(e,t)=>{const o=this.resolveGroupColor(e);if(o)return o;const r=this.resolveLineStyle(e,t);return r.stroke?r.stroke:"string"==typeof r.fill?r.fill:n.themeSemantic?.primary??"#4e79a7"},config:n.layoutConfig??{},selection:n.layoutSelection??null};let i;try{i=n.customLayout(r)}catch(e){const t=null!==this.lastCustomLayoutResult,o=function(e,t,n,o){const r=function(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message||"Custom layout threw."};if("string"==typeof e)return{name:"Error",message:e};if(null==e)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:e+""}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}(t),i="network"===e?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:e,source:i,message:`Semiotic ${e} ${i} failed: ${r.message}`,error:r,recovery:n?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:n,affectedRevision:o}}("xy",e,t,this.version);this.lastCustomLayoutFailure=o,this._customLayoutFailedThisBuild=!0,"production"!==process.env.NODE_ENV&&console.error("[semiotic] customLayout threw:",e);try{n.onLayoutError?.(o)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return t?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[])}this.customLayoutOverlays=i.overlays??null,this.lastCustomLayoutResult=i,this.lastCustomLayoutFailure=null;const s=i.nodes??[];if(this._customRestyle=i.restyle,this.hasCustomRestyle=!!i.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(const e of s)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(s,n.layoutSelection??null)}return function(e){if("production"===process.env.NODE_ENV)return;const{label:t,nodes:n,overlays:o,warned:r}=e;pt(o)&&0===n.length&&yt(r,"overlay-only",`[semiotic] ${t} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),n.length>0&&n.every(e=>null==e.datum)&&yt(r,"null-datums",`[semiotic] ${t} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}({label:"customLayout",nodes:s,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),s}if(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,0===t.length)return[];const r={scales:o,config:n,getX:this.getX,getY:this.getY,getY0:this.getY0,getSize:this.getSize,getColor:this.getColor,getSymbol:this.getSymbol,getGroup:this.getGroup,getCategory:this.getCategory,getPointId:this.getPointId,ribbons:this.resolvedRibbons,getOpen:this.getOpen,getHigh:this.getHigh,getLow:this.getLow,getClose:this.getClose,resolveLineStyle:(e,t)=>this.resolveLineStyle(e,t),resolveAreaStyle:(e,t)=>this.resolveAreaStyle(e,t),resolveBoundsStyle:(e,t)=>this.resolveBoundsStyle(e,t),resolveColorMap:e=>this.resolveColorMap(e),resolveGroupColor:e=>this.resolveGroupColor(e),groupData:e=>this.groupData(e),barCategoryCache:this._barCategoryCache};switch(n.chartType){case"line":return function(e,t){const n=e.groupData(t),o=[],r=e.config.annotations?.filter(Qe).map(e=>({value:e.value,color:e.color,thresholdType:e.thresholdType||"greater"}));if(e.ribbons&&e.ribbons.length>0){const{perSeries:r,aggregate:i}=Ve(e.ribbons);if(i.length>0&&o.push(...Xe(e,t,i)),r.length>0)for(const t of n)o.push(...qe(e,t.data,t.key,r))}for(const t of n){const n=e.resolveLineStyle(t.key,t.data[0]),i=We(t.data,e.scales,e.getX,e.getY,n,t.key);r&&r.length>0&&(i.colorThresholds=r),e.config.curve&&"linear"!==e.config.curve&&(i.curve=e.config.curve),e.config.lineGradient&&(i.strokeGradient=e.config.lineGradient),o.push(i)}return Ke(e,n,o),o}(r,t);case"area":return function(e,t){const n=e.groupData(t),o=[];if(e.ribbons&&e.ribbons.length>0){const{perSeries:r,aggregate:i}=Ve(e.ribbons);if(i.length>0&&o.push(...Xe(e,t,i)),r.length>0)for(const t of n)o.push(...qe(e,t.data,t.key,r))}const r=e.scales.y.domain()[0],i=e.getY0?t=>{const n=e.getY0(t);return null==n?r:n}:void 0;for(const t of n){const n=e.resolveAreaStyle(t.key,t.data[0]),s=De(t.data,e.scales,e.getX,e.getY,r,n,t.key,i),a=Je(e.config.gradientFill);a&&(s.fillGradient=a),e.config.curve&&"linear"!==e.config.curve&&(s.curve=e.config.curve),e.config.lineGradient&&(s.strokeGradient=e.config.lineGradient),o.push(s)}return Ke(e,n,o),o}(r,t);case"mixed":return function(e,t){const n=e.groupData(t),o=[],r=e.config.areaGroups||new Set;if(e.ribbons&&e.ribbons.length>0){const{perSeries:r,aggregate:i}=Ve(e.ribbons);if(i.length>0&&o.push(...Xe(e,t,i)),r.length>0)for(const t of n)o.push(...qe(e,t.data,t.key,r))}const i=e.scales.y.domain()[0],s=e.getY0?t=>{const n=e.getY0(t);return null==n?i:n}:void 0;for(const t of n)if(r.has(t.key)){const n=e.resolveAreaStyle(t.key,t.data[0]),r=De(t.data,e.scales,e.getX,e.getY,i,n,t.key,s),a=Je(e.config.gradientFill);a&&(r.fillGradient=a),e.config.curve&&"linear"!==e.config.curve&&(r.curve=e.config.curve),e.config.lineGradient&&(r.strokeGradient=e.config.lineGradient),o.push(r)}else{const n=e.resolveLineStyle(t.key,t.data[0]),r=We(t.data,e.scales,e.getX,e.getY,n,t.key);e.config.curve&&"linear"!==e.config.curve&&(r.curve=e.config.curve),e.config.lineGradient&&(r.strokeGradient=e.config.lineGradient),o.push(r)}return Ke(e,n,o),o}(r,t);case"stackedarea":return function(e,t){const n=e.groupData(t),o=e.config.stackOrder??"key",r=()=>n.sort((e,t)=>t.key>e.key?-1:e.key>t.key?1:0);if("input"===o);else if("key"===o)r();else if("asc"===o||"desc"===o||"insideOut"===o){const t=new Map;for(const o of n){let n=0;for(const t of o.data){const o=e.getX(t),r=e.getY(t);Number.isFinite(o)&&Number.isFinite(r)&&(n+=r)}t.set(o.key,n)}const r=(e,t)=>t>e?-1:e>t?1:0;if("asc"===o)n.sort((e,n)=>{const o=(t.get(e.key)??0)-(t.get(n.key)??0);return 0!==o?o:r(e.key,n.key)});else if("desc"===o)n.sort((e,n)=>{const o=(t.get(n.key)??0)-(t.get(e.key)??0);return 0!==o?o:r(e.key,n.key)});else{const e=[...n].sort((e,n)=>{const o=(t.get(n.key)??0)-(t.get(e.key)??0);return 0!==o?o:r(e.key,n.key)}),o=[],i=[];let s=0,a=0;for(const n of e)a>s?(o.push(n),s+=t.get(n.key)??0):(i.push(n),a+=t.get(n.key)??0);n.length=0,n.push(...i.reverse(),...o)}}else r();const i=e.config.curve&&"linear"!==e.config.curve?e.config.curve:void 0,s=e.config.normalize?"zero":e.config.baseline??"zero",{nodes:a,stackedTops:l}=function(e,t,n,o,r,i,s,a="zero"){const l=new Set;for(const t of e)for(const e of t.data){const t=n(e);Number.isFinite(t)&&l.add(t)}const c=Array.from(l).sort((e,t)=>e-t),u=new Map;for(const t of e){const e=new Map;for(const r of t.data){const t=n(r),i=o(r);Number.isFinite(t)&&Number.isFinite(i)&&e.set(t,(e.get(t)||0)+i)}u.set(t.key,e)}let h;if(i){h=new Map;for(const t of c){let n=0;for(const o of e)n+=u.get(o.key)?.get(t)||0;h.set(t,n||1)}}const d=ze(c,e.map(e=>e.key),(e,t)=>u.get(e)?.get(t)||0,a),f="diverging"===a&&!i,p=[],y=new Map,m=new Map,g=new Map,b=new Map;for(const e of c)m.set(e,d.get(e)??0),g.set(e,0),b.set(e,0);for(const n of e){const e=u.get(n.key),o=new Map;let a=[],l=[];const d=()=>{if(a.length>=2){const e={type:"area",topPath:a,bottomPath:l,style:r(n.key,n.data[0]),datum:n.data,group:n.key};s&&(e.curve=s),p.push(e)}a=[],l=[]};for(const n of c){const r=e.has(n);let s,c,u=r?e.get(n):0;if(i&&r&&(u/=h.get(n)),!r||!Number.isFinite(u)||0===u){d();continue}f?u>0?(s=g.get(n),c=s+u,g.set(n,c)):(s=b.get(n),c=s+u,b.set(n,c)):(s=m.get(n),c=s+u,m.set(n,c));const p=t.x(n);l.push([p,t.y(s)]),a.push([p,t.y(c)]),o.set(n,c)}d(),y.set(n.key,o)}return{nodes:p,stackedTops:y}}(n,e.scales,e.getX,e.getY,(t,n)=>e.resolveAreaStyle(t,n),e.config.normalize,i,s),c=a;if(e.config.pointStyle){const t=new WeakMap;for(const o of n){const n=l.get(o.key);if(n)for(const r of o.data){const o=e.getX(r),i=e.getY(r);null==o||Number.isNaN(o)||null==i||Number.isNaN(i)||!n.has(o)||t.set(r,n.get(o))}}const o=n=>t.get(n)??e.getY(n);Ke(e,n,c,o)}return c}(r,t);case"scatter":case"bubble":return function(e,t){const n=[],o="bubble"===e.config.chartType?10:5,r=e.config.sizeRange||[3,15];let i=null;if(e.getSize&&!e.config.pointStyle){const n=t.map(t=>e.getSize(t)).filter(e=>null!=e&&!Number.isNaN(e));if(n.length>0){let e=1/0,t=-1/0;for(const o of n)e>o&&(e=o),o>t&&(t=o);i=n=>e===t?(r[0]+r[1])/2:r[0]+(n-e)/(t-e)*(r[1]-r[0])}}const s=e.getColor?e.resolveColorMap(t):null,a=e.config.themeSemantic?.primary||"#4e79a7",l=e.getSymbol,c=e.config.symbolMap,u=new Map;let h=0;const d=e=>{const t=c?.[e];if(t)return t;let n=u.get(e);return n||(n=ct[h%ct.length],h++,u.set(e,n)),n};for(const r of t){let t=e.config.pointStyle?e.config.pointStyle(r):{fill:a,opacity:.8},c=t.r||o;if(i&&e.getSize){const t=e.getSize(r);null==t||Number.isNaN(t)||(c=i(t))}if(s&&e.getColor&&!t.fill){const n=e.getColor(r);n&&s.has(n)&&(t={...t,fill:s.get(n)})}const u=e.getPointId?e.getPointId(r)+"":void 0;if(l){const o=d(l(r)+""),i=Ee(r,e.scales,e.getX,e.getY,Math.PI*c*c,o,t,u);i&&n.push(i)}else{const o=He(r,e.scales,e.getX,e.getY,c,t,u);o&&n.push(o)}}return n}(r,t);case"heatmap":return function(e,t,n){if(e.config.heatmapAggregation)return function(e,t,n){const o=Math.max(1,Math.floor(e.config.heatmapXBins??20)),r=Math.max(1,Math.floor(e.config.heatmapYBins??20)),i=e.config.heatmapAggregation??"count",s=K(e.config.valueAccessor,"value");if(!e.scales||0===t.length)return[];const[a,l]=e.scales.x.domain(),[c,u]=e.scales.y.domain(),h=(l-a||1)/o,d=(u-c||1)/r,f=o*r;if(f>1e6)return[];const p=new Int32Array(f),y=new Float64Array(f);for(let n=0;t.length>n;n++){const i=t[n],l=e.getX(i),u=e.getY(i);if(!isFinite(l)||!isFinite(u))continue;const f=Math.min(Math.floor((l-a)/h),o-1),m=Math.min(Math.floor((u-c)/d),r-1);if(0>f||0>m)continue;const g=m*o+f;p[g]++;const b=s(i);y[g]+=isFinite(b)?b:0}let m=1/0,g=-1/0;for(let e=0;f>e;e++){if(0===p[e])continue;let t;switch(i){case"sum":t=y[e];break;case"mean":t=y[e]/p[e];break;default:t=p[e]}m>t&&(m=t),t>g&&(g=t)}if(!isFinite(m))return[];const b=g-m||1,v=n.width/o,x=n.height/r,k=e.config.showValues,w=e.config.heatmapValueFormat,A=[];for(let e=0;r>e;e++){const t=e*o;for(let n=0;o>n;n++){const o=t+n;if(0===p[o])continue;let s;switch(i){case"sum":s=y[o];break;case"mean":s=y[o]/p[o];break;default:s=p[o]}const l=(s-m)/b;A.push(je(n*v,(r-1-e)*x,v,x,`rgb(${220-(180*l+.5)|0},${220-(100*l+.5)|0},${255-(50*l+.5)|0})`,{xi:n,yi:e,value:s,count:p[o],sum:y[o],xCenter:a+(n+.5)*h,yCenter:c+(e+.5)*d,agg:i},k?{value:s,showValues:!0,valueFormat:w}:void 0))}}return A}(e,t,n);if(0===t.length)return[];const o=K(e.config.valueAccessor,"value"),r=Q(e.config.xAccessor,"x"),i=Q(e.config.yAccessor,"y"),s=new Map,a=new Map,l=Array(t.length),c=Array(t.length);for(let e=0;t.length>e;e++){const n=t[e],o=r(n),u=i(n);l[e]=o,c[e]=u,s.has(o)||s.set(o,s.size),a.has(u)||a.set(u,a.size)}const u=s.size,h=a.size;if(0===u||0===h)return[];const d=Array.from(s.keys()),f=Array.from(a.keys()),p=d.every(e=>"number"==typeof e&&!isNaN(e)),y=f.every(e=>"number"==typeof e&&!isNaN(e));if(p){d.sort((e,t)=>Number(e)-Number(t)),s.clear();for(let e=0;d.length>e;e++)s.set(d[e],e)}if(y){f.sort((e,t)=>Number(e)-Number(t)),a.clear();for(let e=0;f.length>e;e++)a.set(f[e],e)}const m=new Float64Array(t.length),g=new Float64Array(t.length),b=Array(t.length),v=new Map;let x=0;for(let e=0;t.length>e;e++){const n=t[e],r=s.get(l[e]),i=a.get(c[e]);if(void 0===r||void 0===i)continue;const h=o(n),d=i*u+r,f=v.get(d);let p;void 0!==f?p=f:(p=x++,v.set(d,p)),m[p]=d,g[p]=h,b[p]=n}let k=1/0,w=-1/0;for(let e=0;x>e;e++){const t=g[e];isFinite(t)&&(k>t&&(k=t),t>w&&(w=t))}if(!isFinite(k)||!isFinite(w))return[];const A=function(e){const t=e in xe?e:"blues";let n=dt.get(t);if(n)return n;n=Array(256);const o=ke(t);for(let e=0;256>e;e++)n[e]=o(e/255);return dt.set(t,n),n}("string"==typeof e.config.colorScheme?e.config.colorScheme:e.config.themeSequential||"blues"),S=255/(w-k||1),C=n.width/u,M=n.height/h,_=e.config.showValues,P=e.config.heatmapValueFormat,L=[];for(let e=0;x>e;e++){const t=g[e];if(!isFinite(t))continue;const n=m[e],o=n%u;L.push(je(o*C,(h-1-(n-o)/u)*M,C,M,A[Math.min((t-k)*S+.5|0,255)],b[e],_?{value:t,showValues:!0,valueFormat:P}:void 0))}return L}(r,t,e);case"bar":{const e=function(e,t){if(!e.config.binSize)return{nodes:[],binBoundaries:[]};const n=ft(t,e.getX,e.getY,e.config.binSize,e.getCategory);if(0===n.size)return{nodes:[],binBoundaries:[]};let o=null;if(e.getCategory){const t=new Set;for(const e of n.values())for(const n of e.categories.keys())t.add(n);const r=e.config.barColors?Object.keys(e.config.barColors):[],i=new Set(r),s=Array.from(t).filter(e=>!i.has(e)).sort(),a=r.filter(e=>t.has(e)),l=a.join("\0")+""+s.join("\0");e.barCategoryCache&&e.barCategoryCache.key===l?o=e.barCategoryCache.order:(o=[...a,...s],e.barCategoryCache={key:l,order:o})}const r=[],i=e.scales,[s,a]=i.x.domain(),l=e.config.barStyle,c=e.config.themeSemantic?.primary,u=l?.gap,h="number"!=typeof u||0>u?1:u,d={};l?.stroke&&(d.stroke=l.stroke),"number"==typeof l?.strokeWidth&&(d.strokeWidth=l.strokeWidth),"number"==typeof l?.opacity&&(d.opacity=l.opacity);for(const t of n.values()){const n=Math.max(t.start,s),u=Math.min(t.end,a);if(n>=u)continue;const f=i.x(n),p=i.x(u),y=Math.abs(p-f),m=y>h+1?h:0,g=Math.min(f,p)+m/2,b=Math.max(y-m,1);if(b>0)if(o&&t.categories.size>0){let n=0;for(const s of o){const o=t.categories.get(s)||0;if(0===o)continue;const a=i.y(n),u=i.y(n+o);r.push($e(g,Math.min(a,u),b,Math.abs(a-u),{fill:e.config.barColors?.[s]||l?.fill||c||"#4e79a7",...d},{binStart:t.start,binEnd:t.end,total:t.total,category:s,categoryValue:o},s)),n+=o}}else{const e=i.y(0),n=i.y(t.total);r.push($e(g,Math.min(e,n),b,Math.abs(e-n),{fill:l?.fill||c||"#007bff",...d},{binStart:t.start,binEnd:t.end,total:t.total}))}}const f=new Set;for(const e of n.values())f.add(e.start),f.add(e.end);return{nodes:r,binBoundaries:Array.from(f).sort((e,t)=>e-t)}}(r,t);return this._barCategoryCache=r.barCategoryCache??null,this._binBoundaries=e.binBoundaries,e.nodes}case"swarm":return function(e,t){const n=[],o=e.config.swarmStyle||{},r=o.radius??3,i=o.fill??e.config.themeSemantic?.primary??"#007bff",s=o.opacity??.7,a=o.stroke,l=o.strokeWidth;for(const o of t){const t=e.getX(o),c=e.getY(o);if(null==c||Number.isNaN(c))continue;const u=e.scales.x(t),h=e.scales.y(c);let d=i;if(e.getCategory){const t=e.getCategory(o);d=e.config.barColors?.[t]||d}const{r:f,...p}=e.config.pointStyle?.(o)??{},y={type:"point",x:u,y:h,r:f??r,style:{fill:d,opacity:s,stroke:a,strokeWidth:l,...p},datum:o};e.getPointId&&(y.pointId=e.getPointId(o)+""),n.push(y)}return n}(r,t);case"waterfall":return function(e,t,n){const o=[],r=e.scales,i=e.config.waterfallStyle,s=t.filter(t=>{const n=e.getY(t),o=e.getX(t);return null!=n&&!Number.isNaN(n)&&null!=o&&isFinite(o)});if(0===s.length)return o;const a=i?.positiveColor??e.config.themeSemantic?.success??"#28a745",l=i?.negativeColor??e.config.themeSemantic?.danger??"#dc3545",c=i?.gap??1,u=i?.stroke,h=i?.strokeWidth,d=i?.opacity;let f=0;for(let t=0;s.length>t;t++){const p=s[t],y=e.getX(p),m=e.getY(p),g=f+m;let b;b=s.length-1>t?e.getX(s[t+1])-y:t>0?y-e.getX(s[t-1]):0;const v=r.x(y),x=0!==b?r.x(y+b):v+n.width/10,k=Math.min(v,x)+c/2,w=Math.max(v,x)-c/2-k;if(0>=w){f=g;continue}const A=r.y(f),S=r.y(g),C=Math.min(A,S),M=Math.abs(A-S),_={fill:0>m?l:a,stroke:u,strokeWidth:h};null!=d&&(_.opacity=d),o.push($e(k,C,w,M,_,{...p,baseline:f,cumEnd:g,delta:m,_connectorStroke:i?.connectorStroke,_connectorWidth:i?.connectorWidth})),f=g}return o}(r,t,e);case"candlestick":return function(e,t){if(!e.getHigh||!e.getLow||!e.scales)return[];const n=e.config.candlestickRangeMode??!1;if(!(n||e.getOpen&&e.getClose))return[];const o=[],r=e.config.candlestickStyle||{},i=r.rangeColor||"#6366f1",s=n?i:r.upColor||"#28a745",a=n?i:r.downColor||"#dc3545",l=n?i:r.wickColor||"#333",c=r.wickWidth||(n?2:1),u=t.map(t=>e.getX(t)).filter(e=>null!=e&&!Number.isNaN(e)).sort((e,t)=>e-t);let h=r.bodyWidth??0;if(null==r.bodyWidth)if(u.length>1){let t=1/0;for(let n=1;u.length>n;n++){const o=Math.abs(e.scales.x(u[n])-e.scales.x(u[n-1]));o>0&&t>o&&(t=o)}h=t!==1/0?Math.max(2,Math.min(.6*t,20)):6}else h=6;for(const r of t){const t=e.getX(r);if(null==t||Number.isNaN(t))continue;const i=e.getHigh(r),u=e.getLow(r);if(null==i||Number.isNaN(i)||null==u||Number.isNaN(u))continue;const d=n?i:e.getOpen(r),f=n?u:e.getClose(r);if(!n&&[d,f].some(e=>null==e||Number.isNaN(e)))continue;const p=f>=d,y={type:"candlestick",x:e.scales.x(t),openY:e.scales.y(d),closeY:e.scales.y(f),highY:e.scales.y(i),lowY:e.scales.y(u),bodyWidth:h,upColor:s,downColor:a,wickColor:l,wickWidth:c,isUp:p,datum:r};n&&(y.isRange=!0),o.push(y)}return o}(r,t);default:return[]}}resolveBoundsStyle(e,t){return function(e,t,n,o){const r=e.boundsStyle;return"function"==typeof r?r(n||{},t):r&&"object"==typeof r?r:{fill:o(t,n).stroke||e.themeSemantic?.primary||"#4e79a7",fillOpacity:.2,stroke:"none"}}(this.config,e,t,(e,t)=>this.resolveLineStyle(e,t))}computeDecayOpacity(e,t){const n=this.config.decay;return n&&t>1?Te(n,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._ingestVersion)return this._datumIndexCache.map;const t=Ne(e);return this._datumIndexCache={version:this._ingestVersion,map:t},t}applyDecay(e,t){this.config.decay&&function(e,t,n,o=Ne(n)){const r=n.length;if(r>1)for(const n of t){if("line"===n.type){const t=Array.isArray(n.datum)?n.datum:[];if(2>t.length)continue;const i=Array(t.length);let s=!1;for(let n=0;t.length>n;n++){const a=o.get(t[n]);null!=a?(i[n]=Te(e,a,r),1>i[n]&&(s=!0)):i[n]=1}s&&(n._decayOpacities=i);continue}if("area"===n.type){const t=Array.isArray(n.datum)?n.datum:[],i=n.topPath?n.topPath.length:t.length;if(2>i)continue;if(t.length===i){const s=Array(i);let a=!1;for(let n=0;t.length>n;n++){const i=o.get(t[n]);null!=i?(s[n]=Te(e,i,r),1>s[n]&&(a=!0)):s[n]=1}a&&(n._decayOpacities=s)}else{let s=1;for(const n of t){const t=o.get(n);if(null!=t){const n=Te(e,t,r);s>n&&(s=n)}}if(1>s){const e=Array(i);e.fill(s),n._decayOpacities=e}}continue}const t=o.get(n.datum);if(null==t)continue;const i=Te(e,t,r);"heatcell"===n.type?n.style={opacity:i}:"candlestick"===n.type?n._decayOpacity=i:n.style={...n.style,opacity:(n.style?.opacity??1)*i}}}(this.config.decay,e,t,this.getDatumIndexMap(t))}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&function(e,t,n=("undefined"!=typeof performance?performance.now():Date.now())){if(!t||0===t.size)return!1;const o=e.duration??500,r=t.peek();return null!=r&&o>n-r}(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}get transitionContext(){return{runtimeMode:this.config.runtimeMode,getX:this.getX,getY:this.getY,getCategory:this.getCategory}}snapshotPositions(){!function(e,t,n,o){n.clear(),o.clear();for(let r=0;t.length>r;r++){const i=t[r],s=Oe(e,i,r);s&&("point"===i.type?n.set(s,{x:i.x,y:i.y,r:i.r,opacity:i.style.opacity}):"glyph"===i.type?n.set(s,{x:i.x,y:i.y,r:i.size,opacity:i.style.opacity,glyph:i.glyph}):"rect"===i.type?n.set(s,{x:i.x,y:i.y,w:i.w,h:i.h,opacity:i.style.opacity}):"heatcell"===i.type?n.set(s,{x:i.x,y:i.y,w:i.w,h:i.h,opacity:i.style?.opacity}):"candlestick"===i.type?n.set(s,{x:i.x,y:i.openY,w:i.bodyWidth,openY:i.openY,closeY:i.closeY,highY:i.highY,lowY:i.lowY,opacity:i.style?.opacity}):"line"===i.type?o.set(s,{path:i.path.map(e=>[e[0],e[1]]),opacity:i.style?.opacity}):"area"===i.type&&o.set(s,{topPath:i.topPath.map(e=>[e[0],e[1]]),bottomPath:i.bottomPath.map(e=>[e[0],e[1]]),opacity:i.style?.opacity}))}}(this.transitionContext,this.scene,this.prevPositionMap,this.prevPathMap)}synthesizeIntroPositions(){this.prevPositionMap.clear(),this.prevPathMap.clear();const e=this.scales?.y(0)??0;for(let t=0;this.scene.length>t;t++){const n=this.scene[t],o=Oe(this.transitionContext,n,t);o&&("point"===n.type?this.prevPositionMap.set(o,{x:n.x,y:n.y,r:0,opacity:0}):"rect"===n.type?this.prevPositionMap.set(o,{x:n.x,y:e,w:n.w,h:0,opacity:n.style.opacity??1}):"heatcell"===n.type?this.prevPositionMap.set(o,{x:n.x,y:n.y,w:n.w,h:n.h,opacity:0}):"line"===n.type?(n._introClipFraction=0,this.prevPathMap.set(o,{path:n.path.map(e=>[e[0],e[1]]),opacity:n.style.opacity})):"area"===n.type&&(n._introClipFraction=0,this.prevPathMap.set(o,{topPath:n.topPath.map(e=>[e[0],e[1]]),bottomPath:n.bottomPath.map(e=>[e[0],e[1]]),opacity:n.style.opacity})))}}startTransition(){if(!this.config.transition)return;const e=function(e,t,n,o,r,i=Ie()){if(0===o.size&&0===r.size)return n;const s=t.duration??300;if(n.exitNodes.length>0){const e=new Set(n.exitNodes);n.scene=n.scene.filter(t=>!e.has(t)),n.exitNodes=[]}let a=!1;const l=new Set,c=new Set;for(let t=0;n.scene.length>t;t++){const i=n.scene[t],s=Oe(e,i,t);if(!s)continue;if(i._transitionKey=s,"line"===i.type||"area"===i.type){const e=r.get(s);if(e){if(c.add(s),"line"===i.type&&e.path&&e.path.length===i.path.length){i._targetPath=i.path.map(e=>[e[0],e[1]]),i._prevPath=e.path;for(let t=0;i.path.length>t;t++)i.path[t]=[e.path[t][0],e.path[t][1]];a=!0}else if("area"===i.type&&e.topPath&&e.bottomPath&&e.topPath.length===i.topPath.length&&e.bottomPath.length===i.bottomPath.length){i._targetTopPath=i.topPath.map(e=>[e[0],e[1]]),i._targetBottomPath=i.bottomPath.map(e=>[e[0],e[1]]),i._prevTopPath=e.topPath,i._prevBottomPath=e.bottomPath;for(let t=0;i.topPath.length>t;t++)i.topPath[t]=[e.topPath[t][0],e.topPath[t][1]];for(let t=0;i.bottomPath.length>t;t++)i.bottomPath[t]=[e.bottomPath[t][0],e.bottomPath[t][1]];a=!0}i._targetOpacity=i.style.opacity??1,i._startOpacity=e.opacity??i.style.opacity??1}else i._targetOpacity=i.style.opacity??1,i._startOpacity=0,i.style={...i.style,opacity:0},a=!0;continue}const u=o.get(s);if("point"===i.type)if(u){l.add(s);const e={x:i.x,y:i.y,r:i.r};i._targetOpacity=i.style.opacity??1,u.x===e.x&&u.y===e.y&&u.r===e.r||(i._targetX=e.x,i._targetY=e.y,i._targetR=e.r,i.x=u.x,i.y=u.y,i.r=u.r??i.r,a=!0)}else i._targetOpacity=i.style.opacity??1,i.style={...i.style,opacity:0},a=!0;else if("glyph"===i.type)if(u){l.add(s);const e={x:i.x,y:i.y,size:i.size};i._targetOpacity=i.style.opacity??1,u.x===e.x&&u.y===e.y&&u.r===e.size||(i._targetX=e.x,i._targetY=e.y,i._targetR=e.size,i.x=u.x,i.y=u.y,i.size=u.r??i.size,a=!0)}else i._targetOpacity=i.style.opacity??1,i.style={...i.style,opacity:0},a=!0;else if("rect"===i.type)if(u){l.add(s);const e={x:i.x,y:i.y,w:i.w,h:i.h};i._targetOpacity=i.style.opacity??1,u.x===e.x&&u.y===e.y&&u.w===e.w&&u.h===e.h||(i._targetX=e.x,i._targetY=e.y,i._targetW=e.w,i._targetH=e.h,i.x=u.x,i.y=u.y,i.w=u.w??i.w,i.h=u.h??i.h,a=!0)}else i._targetOpacity=i.style.opacity??1,i.style={...i.style,opacity:0},a=!0;else if("heatcell"===i.type)if(u){l.add(s);const e={x:i.x,y:i.y,w:i.w,h:i.h};i._targetOpacity=i.style?.opacity??1,u.x===e.x&&u.y===e.y&&u.w===e.w&&u.h===e.h||(i._targetX=e.x,i._targetY=e.y,i._targetW=e.w,i._targetH=e.h,i.x=u.x,i.y=u.y,i.w=u.w??i.w,i.h=u.h??i.h,a=!0)}else i._targetOpacity=i.style?.opacity??1,i.style={...i.style||{},opacity:0},a=!0;else if("candlestick"===i.type)if(u&&null!=u.openY){l.add(s);const e={x:i.x,openY:i.openY,closeY:i.closeY,highY:i.highY,lowY:i.lowY};i._targetOpacity=i.style?.opacity??1,(u.x!==e.x||u.openY!==e.openY||u.closeY!==e.closeY||u.highY!==e.highY||u.lowY!==e.lowY)&&(i._targetX=e.x,i._targetOpenY=e.openY,i._targetCloseY=e.closeY,i._targetHighY=e.highY,i._targetLowY=e.lowY,i.x=u.x,i.openY=u.openY,i.closeY=u.closeY??i.closeY,i.highY=u.highY??i.highY,i.lowY=u.lowY??i.lowY,a=!0)}else i._targetOpacity=i.style?.opacity??1,i.style={...i.style||{},opacity:0},a=!0}for(const[e,t]of r)if(!c.has(e))if(e.startsWith("l:")&&t.path){const o={type:"line",path:t.path.map(e=>[e[0],e[1]]),group:e.slice(2),style:{stroke:"#999",strokeWidth:1,opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e,datum:null};n.exitNodes.push(o),a=!0}else if(e.startsWith("a:")&&t.topPath&&t.bottomPath){const o={type:"area",topPath:t.topPath.map(e=>[e[0],e[1]]),bottomPath:t.bottomPath.map(e=>[e[0],e[1]]),group:e.slice(2),style:{fill:"#999",opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e,datum:null};n.exitNodes.push(o),a=!0}for(const[e,t]of o)if(!l.has(e)){if(e.startsWith("p:"))n.exitNodes.push({type:"point",x:t.x,y:t.y,r:t.r??3,style:{opacity:t.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("g:")&&t.glyph)n.exitNodes.push({type:"glyph",x:t.x,y:t.y,size:t.r??12,glyph:t.glyph,color:"#999",accent:"#999",style:{opacity:t.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))n.exitNodes.push({type:"rect",x:t.x,y:t.y,w:t.w??0,h:t.h??0,style:{opacity:t.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("h:"))n.exitNodes.push({type:"heatcell",x:t.x,y:t.y,w:t.w??0,h:t.h??0,fill:"#999",datum:null,style:{opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e});else if(e.startsWith("c:")){const o=t.openY??t.y;n.exitNodes.push({type:"candlestick",x:t.x,openY:o,closeY:t.closeY??o,highY:t.highY??o,lowY:t.lowY??o,bodyWidth:t.w??6,upColor:"#999",downColor:"#999",wickColor:"#999",wickWidth:1,isUp:!0,datum:null,style:{opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e})}a=!0}return n.exitNodes.length>0&&(n.scene=[...n.scene,...n.exitNodes]),a&&(n.activeTransition={startTime:i,duration:s}),n}(this.transitionContext,this.config.transition,{scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},this.prevPositionMap,this.prevPathMap,this.currentTime());this.scene=e.scene,this.exitNodes=e.exitNodes,this.activeTransition=e.activeTransition}advanceTransition(e){if(!this.activeTransition||!this.config.transition)return!1;const t={scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},n=function(e,t,n,o){if(!n.activeTransition)return!1;const r=function(e,t){return Math.min((e-t.startTime)/t.duration,1)}(e,n.activeTransition),i=function(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}(r,"linear"===t.easing?"linear":"ease-out-cubic");for(const e of n.scene){const t=e._transitionKey;if("point"===e.type){if(void 0!==e._targetOpacity){const n=t?o.get(t):void 0;e.style.opacity=Re(n?n.opacity??1:0,e._targetOpacity,i)}if(void 0===e._targetX)continue;if(!t)continue;const n=o.get(t);if(!n)continue;e.x=Re(n.x,e._targetX,i),e.y=Re(n.y,e._targetY,i),void 0!==e._targetR&&void 0!==n.r&&(e.r=Re(n.r,e._targetR,i))}else if("glyph"===e.type){if(void 0!==e._targetOpacity){const n=t?o.get(t):void 0;e.style.opacity=Re(n?n.opacity??1:0,e._targetOpacity,i)}if(void 0===e._targetX)continue;if(!t)continue;const n=o.get(t);if(!n)continue;e.x=Re(n.x,e._targetX,i),e.y=Re(n.y,e._targetY,i),void 0!==e._targetR&&void 0!==n.r&&(e.size=Re(n.r,e._targetR,i))}else if("rect"===e.type){if(void 0!==e._targetOpacity){const n=t?o.get(t):void 0;e.style.opacity=Re(n?n.opacity??1:0,e._targetOpacity,i)}if(void 0===e._targetX)continue;if(!t)continue;const n=o.get(t);if(!n)continue;e.x=Re(n.x,e._targetX,i),e.y=Re(n.y,e._targetY,i),void 0!==n.w&&(e.w=Re(n.w,e._targetW,i)),void 0!==n.h&&(e.h=Re(n.h,e._targetH,i))}else if("heatcell"===e.type){if(void 0!==e._targetOpacity){const n=t?o.get(t):void 0;e.style={...e.style||{},opacity:Re(n?n.opacity??1:0,e._targetOpacity,i)}}if(void 0===e._targetX)continue;if(!t)continue;const n=o.get(t);if(!n)continue;e.x=Re(n.x,e._targetX,i),e.y=Re(n.y,e._targetY,i),void 0!==n.w&&(e.w=Re(n.w,e._targetW,i)),void 0!==n.h&&(e.h=Re(n.h,e._targetH,i))}else if("candlestick"===e.type){if(void 0!==e._targetOpacity){const n=t?o.get(t):void 0;e.style={...e.style||{},opacity:Re(n?n.opacity??1:0,e._targetOpacity,i)}}if(void 0===e._targetX)continue;if(!t)continue;const n=o.get(t);if(!n)continue;e.x=Re(n.x,e._targetX,i),void 0!==n.openY&&(e.openY=Re(n.openY,e._targetOpenY,i)),void 0!==n.closeY&&(e.closeY=Re(n.closeY,e._targetCloseY,i)),void 0!==n.highY&&(e.highY=Re(n.highY,e._targetHighY,i)),void 0!==n.lowY&&(e.lowY=Re(n.lowY,e._targetLowY,i))}else if("line"===e.type){void 0!==e._targetOpacity&&(e.style={...e.style,opacity:Re(e._startOpacity??0,e._targetOpacity,i)}),void 0!==e._introClipFraction&&(e._introClipFraction=i);const t=e._prevPath,n=e._targetPath;if(t&&n&&t.length===e.path.length)for(let o=0;e.path.length>o;o++)e.path[o][0]=Re(t[o][0],n[o][0],i),e.path[o][1]=Re(t[o][1],n[o][1],i)}else if("area"===e.type){void 0!==e._targetOpacity&&(e.style={...e.style,opacity:Re(e._startOpacity??0,e._targetOpacity,i)}),void 0!==e._introClipFraction&&(e._introClipFraction=i);const t=e._prevTopPath,n=e._prevBottomPath,o=e._targetTopPath,r=e._targetBottomPath;if(t&&o&&t.length===e.topPath.length)for(let n=0;e.topPath.length>n;n++)e.topPath[n][0]=Re(t[n][0],o[n][0],i),e.topPath[n][1]=Re(t[n][1],o[n][1],i);if(n&&r&&n.length===e.bottomPath.length)for(let t=0;e.bottomPath.length>t;t++)e.bottomPath[t][0]=Re(n[t][0],r[t][0],i),e.bottomPath[t][1]=Re(n[t][1],r[t][1],i)}}if(r>=1){for(const e of n.scene){if(void 0!==e._targetOpacity){const t=e._targetOpacity;e.style="line"===e.type||"area"===e.type?{...e.style,opacity:0===t?0:t}:{...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}if("point"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("glyph"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.size=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else if("heatcell"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else if("candlestick"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,void 0!==e._targetOpenY&&(e.openY=e._targetOpenY),void 0!==e._targetCloseY&&(e.closeY=e._targetCloseY),void 0!==e._targetHighY&&(e.highY=e._targetHighY),void 0!==e._targetLowY&&(e.lowY=e._targetLowY),e._targetX=void 0,e._targetOpenY=void 0,e._targetCloseY=void 0,e._targetHighY=void 0,e._targetLowY=void 0}else if("line"===e.type){const t=e._targetPath;if(t)for(let n=0;e.path.length>n;n++)e.path[n]=t[n];e._prevPath=void 0,e._targetPath=void 0,e._introClipFraction=void 0}else if("area"===e.type){const t=e._targetTopPath,n=e._targetBottomPath;if(t)for(let n=0;e.topPath.length>n;n++)e.topPath[n]=t[n];if(n)for(let t=0;e.bottomPath.length>t;t++)e.bottomPath[t]=n[t];e._prevTopPath=void 0,e._prevBottomPath=void 0,e._targetTopPath=void 0,e._targetBottomPath=void 0,e._introClipFraction=void 0}}if(n.exitNodes.length>0){const e=new Set(n.exitNodes);n.scene=n.scene.filter(t=>!e.has(t)),n.exitNodes=[]}return n.activeTransition=null,!1}return!0}(e,this.config.transition,t,this.prevPositionMap);return this.scene=t.scene,this.exitNodes=t.exitNodes,this.activeTransition=t.activeTransition,n}cancelIntroAnimation(){this.prevPositionMap.clear(),this.prevPathMap.clear(),this.activeTransition=null;for(const e of this.scene)"line"!==e.type&&"area"!==e.type||(e._introClipFraction=void 0)}groupData(e){const{result:t,cache:n}=function(e,t,n,o){if(o&&o.version===n&&o.group===t&&o.data===e)return{result:o.result,cache:o};let r;if(t){const n=new Map;for(const o of e){const e=t(o);n.has(e)||n.set(e,[]),n.get(e).push(o)}r=Array.from(n.entries()).map(([e,t])=>({key:e,data:t}))}else r=[{key:"_default",data:e}];return{result:r,cache:{version:n,group:t,data:e,result:r}}}(e,this.getGroup,this._ingestVersion,this._groupDataCache);return this._groupDataCache=n,t}resolveColorMap(e){const{map:t,cache:n}=function(e,t,n,o,r){if(r&&r.version===o)return{map:r.map,cache:r};const i=new Set;if(t)for(const n of e){const e=t(n);e&&i.add(e)}const s=Array.from(i).sort(),a=s.join("\0");if(r&&r.key===a){const e={...r,version:o};return{map:e.map,cache:e}}const l=Array.isArray(n.colorScheme)?n.colorScheme:n.themeCategorical||Se,c=new Map;for(let e=0;s.length>e;e++)c.set(s[e],l[e%l.length]);return{map:c,cache:{key:a,map:c,version:o}}}(e,this.getColor,this.config,this._ingestVersion,this._colorMapCache);return this._colorMapCache=n,t}resolveLineStyle(e,t){return function(e,t,n,o){const r=e.lineStyle;if("function"==typeof r){const e=r(n||{},t);if(e&&!e.stroke&&t){const n=o(t);if(n)return{...e,stroke:n}}return e}const i=e.themeSemantic?.primary;return r&&"object"==typeof r?{stroke:r.stroke||i||"#007bff",strokeWidth:r.strokeWidth||2,strokeDasharray:r.strokeDasharray,fill:r.fill,fillOpacity:r.fillOpacity,opacity:r.opacity}:{stroke:o(t)||i||"#007bff",strokeWidth:2}}(this.config,e,t,e=>this.resolveGroupColor(e))}resolveAreaStyle(e,t){return function(e,t,n,o){if(e.areaStyle){const r=e.areaStyle(n||{});if(r&&!r.fill&&t){const e=o(t);if(e)return{...r,fill:e,stroke:r.stroke||e}}return r}const r=e.lineStyle;if("function"==typeof r){const e=r(n||{},t);if(e&&!e.fill&&t){const n=o(t);if(n)return{...e,fill:n,stroke:e.stroke||n}}return e}const i=e.themeSemantic?.primary;if(r&&"object"==typeof r)return{fill:r.fill||r.stroke||i||"#4e79a7",fillOpacity:r.fillOpacity??.7,stroke:r.stroke||i||"#4e79a7",strokeWidth:r.strokeWidth||2};const s=o(t)||i||"#4e79a7";return{fill:s,fillOpacity:.7,stroke:s,strokeWidth:2}}(this.config,e,t,e=>this.resolveGroupColor(e))}resolveGroupColor(t){const{color:n,groupColorCounter:o}=function(e){const{group:t,colorMapCache:n,groupColorMap:o,groupColorMapCap:r,config:i}=e;let{groupColorCounter:s}=e;if(n){const e=n.map.get(t);if(e)return{color:e,groupColorCounter:s}}const a=o.get(t);if(a)return{color:a,groupColorCounter:s};const l=(Array.isArray(i.colorScheme)&&i.colorScheme.length>0?i.colorScheme:null)||(Array.isArray(i.themeCategorical)&&i.themeCategorical.length>0?i.themeCategorical:null)||Se;if(0===l.length)return{color:null,groupColorCounter:s};const c=l[s%l.length];if(s++,o.set(t,c),o.size>r){const e=o.keys().next().value;void 0!==e&&o.delete(e)}return{color:c,groupColorCounter:s}}({group:t,colorMapCache:this._colorMapCache,groupColorMap:this._groupColorMap,groupColorCounter:this._groupColorCounter,groupColorMapCap:e.GROUP_COLOR_MAP_CAP,config:this.config});return this._groupColorCounter=o,n}getBufferArray(){return!this._bufferDirty&&this._bufferArrayCache||(this._bufferArrayCache=this.buffer.toArray(),this._bufferDirty=!1),this._bufferArrayCache}getData(){return this.getBufferArray()}remove(e){if(!this.getPointId)throw Error("remove() requires pointIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();const t=ne(e),n=this.getPointId,o=e=>t.has(n(e));!function(e,t,n){if(!t||0===t.size)return;const o=new Set;if(e.forEach((e,t)=>{n(e)&&o.add(t)}),0===o.size)return;const r=t.toArray();t.clear();for(let e=0;r.length>e;e++)o.has(e)||t.push(r[e])}(this.buffer,this.timestampBuffer,o);const r=this.buffer.remove(o);if(0===r.length)return this.updateResults.recordNoop("remove"),r;for(const e of r)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length),r}update(e,t){if(!this.getPointId)throw Error("update() requires pointIdAccessor to be configured");const n=ne(e),o=this.getPointId,r=new Set;this.buffer.forEach((e,t)=>{n.has(o(e))&&r.add(t)});const i=this.buffer.update(e=>n.has(o(e)),t);if(0===i.length)return this.updateResults.recordNoop("update"),i;for(const e of i)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.buffer.forEach((e,t)=>{r.has(t)&&(this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e))}),this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",i.length),i}getBinBoundaries(){return this._binBoundaries}getExtents(){return this.xExtent.min===1/0?null:{x:this.xExtent.extent,y:this.yExtent.extent}}clear(){this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.prevPathMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this._lastBoundedInsertsRef=null,this.needsFullRebuild=!0,this._bufferDirty=!0,this._bufferArrayCache=null,this._datumIndexCache=null,this.lastLayout=null,this.scales=null,this.scene=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.spatialIndex.clear(),this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getBuffer(){return this.buffer}getXAccessor(){return this.getX}getYAccessor(){return this.getY}getCategoryAccessor(){return this.getCategory}applyCustomRestyle(e,t){const n=this._customRestyle;if(n)for(const o of e){const e=this._baseStyles.get(o)??o.style??{},r=n(o,t);o.style=r?{...e,...r}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}updateConfig(e){const t={...this.config},n=Object.keys(e).filter(n=>e[n]!==t[n]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e||"themeCategorical"in e||"colorAccessor"in e)&&(this._colorMapCache=null,this._groupColorMap=new Map,this._groupColorCounter=0),("barColors"in e||"colorScheme"in e)&&(this._barCategoryCache=null),("normalize"in e||"extentPadding"in e||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e||"boundsAccessor"in e||"band"in e||"y0Accessor"in e||"openAccessor"in e||"highAccessor"in e||"lowAccessor"in e||"closeAccessor"in e||"groupAccessor"in e||"categoryAccessor"in e||"chartType"in e||"runtimeMode"in e)&&(this._stackExtentCache=null);let o=!1,r=!1;Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();const i="chartType"in e&&e.chartType!==t.chartType||"runtimeMode"in e&&e.runtimeMode!==t.runtimeMode;if(i||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e){const e=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode,n=e&&this.config.valueAccessor||this.config.yAccessor,s=e&&t.valueAccessor||t.yAccessor,a=i||!U(e&&this.config.timeAccessor||this.config.xAccessor,e&&t.timeAccessor||t.xAccessor),l=i||!U(n,s);(a||l)&&(e?(this.getX=K(this.config.timeAccessor||this.config.xAccessor,"time"),this.getY=K(this.config.valueAccessor||this.config.yAccessor,"value")):(this.getX=K(this.config.xAccessor,"x"),this.getY=K(this.config.yAccessor,"y")),l&&this.resolvedRibbons.some(e=>"bounds"===e.kind)&&(this.resolvedRibbons=gt(this.config)),o=!0,r=!0)}if("groupAccessor"in e&&!U(e.groupAccessor,t.groupAccessor)&&(this.getGroup=null!=this.config.groupAccessor?Z(this.config.groupAccessor):void 0,o=!0),"categoryAccessor"in e&&!U(e.categoryAccessor,t.categoryAccessor)&&(this.getCategory=null!=this.config.categoryAccessor?Z(this.config.categoryAccessor):void 0,o=!0),"sizeAccessor"in e&&!U(e.sizeAccessor,t.sizeAccessor)&&(this.getSize=this.config.sizeAccessor?K(this.config.sizeAccessor,"size"):void 0,o=!0),"symbolAccessor"in e&&!U(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?Z(this.config.symbolAccessor):void 0,o=!0),"colorAccessor"in e&&!U(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?Z(this.config.colorAccessor):void 0,o=!0),"y0Accessor"in e&&!U(e.y0Accessor,t.y0Accessor)&&(this.getY0=this.config.y0Accessor?K(this.config.y0Accessor,"y0"):void 0,o=!0,r=!0),("boundsAccessor"in e&&!U(e.boundsAccessor,t.boundsAccessor)||"band"in e&&e.band!==t.band||"boundsStyle"in e&&e.boundsStyle!==t.boundsStyle)&&(this.resolvedRibbons=gt(this.config),o=!0,r=!0),"pointIdAccessor"in e&&!U(e.pointIdAccessor,t.pointIdAccessor)&&(this.getPointId=null!=this.config.pointIdAccessor?Z(this.config.pointIdAccessor):void 0,o=!0),"candlestick"===this.config.chartType&&(i||"openAccessor"in e&&!U(e.openAccessor,t.openAccessor)||"closeAccessor"in e&&!U(e.closeAccessor,t.closeAccessor)||"highAccessor"in e&&!U(e.highAccessor,t.highAccessor)||"lowAccessor"in e&&!U(e.lowAccessor,t.lowAccessor))){const e=null!=this.config.openAccessor,t=null!=this.config.closeAccessor;this.getOpen=e?K(this.config.openAccessor,"open"):void 0,this.getHigh=K(this.config.highAccessor,"high"),this.getLow=K(this.config.lowAccessor,"low"),this.getClose=t?K(this.config.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!e&&!t,o=!0,r=!0}if("accessorRevision"in e&&e.accessorRevision!==t.accessorRevision&&(o=!0,r=!0),!o){const n=Object.keys(e).filter(e=>!e.endsWith("Accessor")&&"timeAccessor"!==e&&"valueAccessor"!==e);for(const r of n)if(e[r]!==t[r]){o=!0;break}}o&&(r&&this.rebuildExtents(),this.needsFullRebuild=!0),this.updateResults.recordConfig(n)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};Gt.GROUP_COLOR_MAP_CAP=1e3;var Vt=Gt;Object.assign(Vt.prototype,{getLastUpdateResult:function(){return this.updateResults.last},getUpdateSnapshot:function(){return this.updateResults.last},subscribeUpdateResult:function(e){return this.updateResults.subscribe(e)},setLayoutSelection:function(e){this.config.layoutSelection=e},markStylePaintPending:function(){Ct.set(this,!0)},consumeStylePaintPending:function(){const e=!0===Ct.get(this);return Ct.delete(this),e}});import{memo as Xt,useEffect as qt,useRef as Ut}from"react";var Kt={sceneGeometry:0,layout:0,domain:0};function Qt(e){const{domain:t,layout:n,sceneGeometry:o}=e.revisions;return{domain:t,layout:n,sceneGeometry:o}}function Zt(e,t){return{sceneGeometry:Math.max(e.sceneGeometry,t.sceneGeometry),layout:Math.max(e.layout,t.layout),domain:Math.max(e.domain,t.domain)}}var Jt="production"!==process.env.NODE_ENV,en={revisions:Kt,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},tn=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=Kt,this.lastObserved=Kt,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){Jt&&(this.lastObserved=Zt(this.lastObserved,Qt(e)))}beforeCompute(e,t){if(!Jt)return en;const n=Zt(Qt(e),this.lastObserved),o=function(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}(n),r=!((i=n).sceneGeometry===(s=this.lastConsumed).sceneGeometry&&i.layout===s.layout&&i.domain===s.domain);var i,s;return{revisions:n,signature:o,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:r,warnUnconsumed:!t&&r&&this.lastUnconsumedWarning!==o}}afterCompute(e,t,n){if(Jt){if(t&&e.wasUnconsumed&&(this.lastConsumed=e.revisions),e.warnUnconsumed&&!t)return console.warn(`[semiotic] ${this.hostName} observed scene-affecting revisions without a scene rebuild: ${e.signature}.`),void(this.lastUnconsumedWarning=e.signature);t&&e.sawSignals&&!e.wasUnconsumed&&!n&&this.lastDuplicateWarning!==e.signature?(console.warn(`[semiotic] ${this.hostName} performed scene rebuild with unchanged scene revisions: ${e.signature}.`),this.lastDuplicateWarning=e.signature):t&&!e.sawSignals&&(this.lastDuplicateWarning="")}}},nn=Xt(function({store:e,diagnostics:t}){return qt(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null});import*as on from"react";function rn(...e){const t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:on.createElement(on.Fragment,null,...t)}import*as sn from"react";import{jsx as an}from"react/jsx-runtime";var ln={isActive:!1,predicate:()=>!0},cn=sn.createContext(null);function un({value:e,children:t}){return an(cn.Provider,{value:e,children:t})}function hn(){return sn.useContext(cn)??ln}function dn(e,t){return null!=e?an(un,{value:t,children:e}):e}import{useEffect as fn,useRef as pn}from"react";function yn(e,t,n){return n.x>e||e>n.x+n.w||n.y>t||t>n.y+n.h?{hit:!1,cx:0,cy:0}:{hit:!0,cx:n.x+n.w/2,cy:n.y+n.h/2}}function mn(e,t=30){return Math.max((e??4)+5,12,t)}function gn(e){return e instanceof Date?e:"number"==typeof e&&e>1e9?new Date(e):null}function bn(e,t){const n=gn(e);if(!n)return!1;const o=gn(t);return!o||n.getFullYear()!==o.getFullYear()||n.getMonth()!==o.getMonth()}var vn=[40,40],xn=[.5,.5];function kn(e,t){const[n,o]=e.viewBox??vn,[r,i]=e.anchor??xn,s=o>0?o:1,a=Math.max(0,t)/s,l=(n>0?n:s)*a,c=s*a;return{width:l,height:c,scale:a,offsetX:-r*l,offsetY:-i*c}}function wn(e,t){const n=kn(e,t),o=[[n.offsetX,n.offsetY],[n.offsetX+n.width,n.offsetY],[n.offsetX,n.offsetY+n.height],[n.offsetX+n.width,n.offsetY+n.height]];let r=0;for(const[e,t]of o){const n=Math.sqrt(e*e+t*t);n>r&&(r=n)}return r}function An(e,t,n,o){if("none"!==e)return"color"===e||null==e?t??o:"accent"===e?n:e}var Sn=null;function Cn(e){if("undefined"==typeof Path2D)return null;Sn||(Sn=new Map);const t=Sn.get(e);if(t)return t;const n=new Path2D(e);return Sn.size>1024&&Sn.clear(),Sn.set(e,n),n}function Mn(e,t,n=0,o="horizontal"){const[r,i]=e.viewBox??vn,s=Math.min(1,Math.max(0,n)),a=Math.min(1,Math.max(0,t));return a>s?s>0||1>a?"vertical"===o?{x:0,y:i*(1-a),width:r,height:i*(a-s)}:{x:r*s,y:0,width:r*(a-s),height:i}:null:{x:0,y:0,width:0,height:0}}function _n(e,t){const n=kn(e,t);return{centerDx:n.offsetX+n.width/2,centerDy:n.offsetY+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2,radius:Math.hypot(n.width,n.height)/2}}function Pn(e,t,n,o,r,i=e=>e){for(const s of t.parts){const t=Cn(s.d);if(!t)continue;const a=s.opacity??1,l=e.globalAlpha;1!==a&&(e.globalAlpha=l*a);const c=r?"none"===s.fill?void 0:r:An(s.fill,n,o);c&&(e.fillStyle=i(c),e.fill(t));const u=r?s.stroke&&"none"!==s.stroke?r:void 0:An(s.stroke??"none",n,o);u&&(e.strokeStyle=i(u),e.lineWidth=s.strokeWidth??1,e.lineCap=s.strokeLinecap??"butt",e.lineJoin=s.strokeLinejoin??"miter",e.stroke(t)),1!==a&&(e.globalAlpha=l)}}var Ln=/^var\(\s*(--[^,)]+)(?:\s*,\s*([^)]+))?\s*\)$/,Rn=new WeakMap,In=0,Tn=!1,Nn=null,Fn=null;function Bn(e,t){if(!t)return t;const n=Ln.exec(t);if(!n)return t;const o=e.canvas;if(!o)return n[2]?.trim()||t;!function(){if(Tn)return;if("undefined"==typeof window||"undefined"==typeof document)return;Tn=!0;const e=()=>{In++};if("undefined"!=typeof MutationObserver&&document.documentElement&&new MutationObserver(e).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme"]}),"function"==typeof window.matchMedia)try{Nn=window.matchMedia("(prefers-color-scheme: dark)"),Fn=e,"function"==typeof Nn.addEventListener?Nn.addEventListener("change",Fn):"function"==typeof Nn.addListener&&Nn.addListener(Fn)}catch{}}();let r=Rn.get(o);r&&r.version===In||(r={version:In,map:new Map},Rn.set(o,r));const i=r.map.get(t);if(void 0!==i)return i;const s=getComputedStyle(o).getPropertyValue(n[1]).trim()||n[2]?.trim()||t;return r.map.set(t,s),s}var On=null;import{jsx as Wn,jsxs as Dn}from"react/jsx-runtime";function zn(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function Hn(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function En(e,t){let n=2166136261;const o=Hn(t);for(let e=0;o.length>e;e++)n^=o.charCodeAt(e),n=Math.imul(n,16777619);return`${e}-hatch-${(n>>>0).toString(36)}`}var $n=new Map;function jn(e,t){const{background:n="transparent",stroke:o="#000",lineWidth:r=1.5,spacing:i=6,angle:s=45,lineOpacity:a=1}=e,l=Math.max(8,Math.ceil(2*i));return Dn("pattern",{id:t,width:l,height:l,patternUnits:"userSpaceOnUse",patternTransform:0!==s?`rotate(${s})`:void 0,children:[n&&"transparent"!==n&&Wn("rect",{width:l,height:l,fill:n}),Wn("line",{x1:0,y1:0,x2:0,y2:l,stroke:o,strokeWidth:r,strokeOpacity:a}),Wn("line",{x1:i,y1:0,x2:i,y2:l,stroke:o,strokeWidth:r,strokeOpacity:a})]},t)}function Yn(e,t,n="#4e79a7"){if(zn(e)){const n=En(t,e);return{fill:`url(#${n})`,def:jn(e,n)}}return e&&"string"==typeof e?{fill:e}:{fill:n}}import{curveMonotoneX as Gn,curveMonotoneY as Vn,curveCardinal as Xn,curveCatmullRom as qn,curveStep as Un,curveStepBefore as Kn,curveStepAfter as Qn,curveBasis as Zn,curveNatural as Jn}from"d3-shape";function eo(e){switch(e){case"monotoneX":return Gn;case"monotoneY":return Vn;case"cardinal":return Xn;case"catmullRom":return qn;case"step":return Un;case"stepBefore":return Kn;case"stepAfter":return Qn;case"basis":return Zn;case"natural":return Jn;default:return null}}function to(e,t,n){if(null==t)return n;if(zn(t)){const o=function(e,t){const n="undefined"!=typeof window&&window.devicePixelRatio||1,o=`${Hn(e)}@${n}`,r=$n.get(o);if(void 0!==r)return r;const i=function(e={},t){const{background:n="transparent",stroke:o="#000",lineWidth:r=1.5,spacing:i=6,angle:s=45}=e,a=Math.max(8,Math.ceil(2*i));let l;try{l=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(On||(On=document.createElement("canvas")),On.width=e,On.height=e,On)}(a)}catch{return null}const c=l.getContext("2d");if(!c)return null;n&&"transparent"!==n?(c.fillStyle=n,c.fillRect(0,0,a,a)):c.clearRect(0,0,a,a),c.strokeStyle=o,c.lineWidth=r,c.lineCap="square";const u=s*Math.PI/180;if(45===s||-45===s){const e=s>0?1:-1;for(let t=-a;2*a>=t;t+=i)c.beginPath(),c.moveTo(t,0),c.lineTo(t+e*a,a),c.stroke()}else{c.save(),c.translate(a/2,a/2),c.rotate(u);const e=2*a;for(let t=-e;e>=t;t+=i)c.beginPath(),c.moveTo(-e,t),c.lineTo(e,t),c.stroke();c.restore()}return(t||c).createPattern(l,"repeat")}({background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle},t);return $n.set(o,i),i}(t,e);return o||t.background&&Bn(e,t.background)||n}return"string"!=typeof t?t:Bn(e,t)||n}function no(e,t,n,o,r,i,s){if("colorStops"in t){const n=t.colorStops.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color}));if(2>n.length)return null;const a=e.createLinearGradient(o,r,i,s);for(const e of n)a.addColorStop(e.offset,e.color);return a}const{topOpacity:a,bottomOpacity:l}=t;if(!Number.isFinite(a)||!Number.isFinite(l))return null;const c=Math.max(0,Math.min(1,a)),u=Math.max(0,Math.min(1,l)),h=e.createLinearGradient(o,r,i,s),[d,f,p]=function(e,t){const n=e.fillStyle,o="#010203";try{e.fillStyle=o,e.fillStyle=t}catch{return e.fillStyle=n,[78,121,167]}const r=e.fillStyle;if(e.fillStyle=n,"string"!=typeof r)return[78,121,167];if(r.toLowerCase()===o&&t.trim().toLowerCase()!==o)return[78,121,167];if(r.startsWith("#"))return[parseInt(r.slice(1,3),16),parseInt(r.slice(3,5),16),parseInt(r.slice(5,7),16)];const i=r.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return i?[+i[1],+i[2],+i[3]]:[78,121,167]}(e,n);return h.addColorStop(0,`rgba(${d},${f},${p},${c})`),h.addColorStop(1,`rgba(${d},${f},${p},${u})`),h}function oo(e,t,n,o,r,i){const s=t.colorStops.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color}));if(2>s.length)return null;const a=e.createLinearGradient(n,o,r,i);for(const e of s)a.addColorStop(e.offset,e.color);return a}import{line as ro}from"d3-shape";var io=new WeakMap;function so(e,t){const n=eo(t);if(!n)return e;const o=io.get(e);if(o)return o;const r=function(e,t,n=8){if(!t||2>e.length)return e.map(([e,t])=>[e,t]);const o=[];let r=null;const i={moveTo(e,t){r=[e,t],o.push([e,t])},lineTo(e,t){r=[e,t],o.push([e,t])},bezierCurveTo(e,t,i,s,a,l){if(!r)return r=[a,l],void o.push([a,l]);const[c,u]=r;for(let r=1;n>=r;r++){const h=r/n,d=1-h;o.push([d*d*d*c+3*d*d*h*e+3*d*h*h*i+h*h*h*a,d*d*d*u+3*d*d*h*t+3*d*h*h*s+h*h*h*l])}r=[a,l]},closePath(){},arc(){},rect(){},arcTo(){},quadraticCurveTo(e,t,n,i){r=[n,i],o.push([n,i])}};return ro().x(e=>e[0]).y(e=>e[1]).curve(t).context(i)(e),o}(e,n);return io.set(e,r),r}function ao(e,t,n,o=30,r,i=0){let s=null;if(r){const e=function(e,t,n,o,r,i=e=>e.x,s=e=>e.y,a=e=>e.r){const l=Math.max(o,r+5,12),c=t-l,u=t+l,h=n-l,d=n+l;let f=null,p=1/0;return e.visit((e,r,l,y,m)=>{if(r>u||c>y||l>d||h>m)return!0;if(!e.length){let r=e;do{const e=r.data,l=i(e)-t,c=s(e)-n,u=Math.sqrt(l*l+c*c);mn(a(e),o)>=u&&p>u&&(f=e,p=u),r=r.next}while(r)}return!1}),f?{node:f,distance:p}:null}(r,t,n,o,i);e&&(s={node:e.node,datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(const i of e){let e=null;switch(i.type){case"point":if(r)break;e=co(i,t,n,o);break;case"symbol":e=uo(i,t,n,o);break;case"glyph":e=ho(i,t,n,o);break;case"line":e=fo(i,t,n,o);break;case"rect":if(null==i.datum)break;e=yo(i,t,n);break;case"heatcell":e=mo(i,t,n);break;case"area":if(!1===i.interactive)break;e=bo(i,t,n);break;case"candlestick":e=go(i,t,n)}e&&o>e.distance&&(s&&e.distance>=s.distance||(s=e))}return s}function lo(e,t,n){if(0===e.length)return null;if(e[0][0]>t||t>e[e.length-1][0])return null;const o=vo(e,t);if(0>o)return null;if(Math.abs(e[o][0]-t)>n)return null;let r=o,i=o;o>0&&e[o][0]>=t?(r=o-1,i=o):e.length-1>o&&(r=o,i=o+1);const[s,a]=e[r],[l,c]=e[i];return l===s?a:a+Math.max(0,Math.min(1,(t-s)/(l-s)))*(c-a)}function co(e,t,n,o=30){const r=t-e.x,i=n-e.y,s=Math.sqrt(r*r+i*i);return s>mn(e.r,o)?null:{node:e,datum:e.datum,x:e.x,y:e.y,distance:s}}function uo(e,t,n,o=30){const r=t-e.x,i=n-e.y,s=Math.sqrt(r*r+i*i);return s>mn(ht(e.size),o)?null:{node:e,datum:e.datum,x:e.x,y:e.y,distance:s}}function ho(e,t,n,o=30){if(null==e.datum)return null;const r=_n(e.glyph,e.size),i=e.x+r.centerDx,s=e.y+r.centerDy,a=t-i,l=n-s,c=Math.sqrt(a*a+l*l);return c>mn(r.radius,o)?null:{node:e,datum:e.datum,x:i,y:s,distance:c}}function fo(e,t,n,o=30){if(0===e.path.length)return null;const r=vo(e.path,t);if(0>r)return null;const[i,s]=e.path[r];let a;if(e.path.length>1){let o=1/0;const i=Math.max(0,r-1),s=Math.min(e.path.length-2,r);for(let r=i;s>=r;r++){const[i,s]=e.path[r],[a,l]=e.path[r+1],c=po(t,n,i,s,a,l);o>c&&(o=c)}a=o}else{const e=t-i,o=n-s;a=Math.sqrt(e*e+o*o)}const l=e.style;return a>Math.max(5,(l.strokeWidth??l.lineWidth??1)/2+2,o)?null:{node:e,datum:Array.isArray(e.datum)&&e.datum[r]?e.datum[r]:e.datum,x:i,y:s,distance:a}}function po(e,t,n,o,r,i){const s=r-n,a=i-o,l=s*s+a*a;if(0===l)return Math.sqrt((e-n)**2+(t-o)**2);let c=((e-n)*s+(t-o)*a)/l;return c=Math.max(0,Math.min(1,c)),Math.sqrt((e-(n+c*s))**2+(t-(o+c*a))**2)}function yo(e,t,n){const o=yn(t,n,e);return o.hit?{node:e,datum:e.datum,x:o.cx,y:o.cy,distance:0}:null}function mo(e,t,n){const o=yn(t,n,e);return o.hit?{node:e,datum:e.datum,x:o.cx,y:o.cy,distance:0}:null}function go(e,t,n){const o=e.bodyWidth/2,r=Math.min(e.openY,e.closeY);if(!(e.x-o-3>t||t>e.x+o+3||e.highY-3>n||n>e.lowY+3)){const o=r+Math.max(Math.max(e.openY,e.closeY)-r,1)/2,i=t-e.x,s=n-o;return{node:e,datum:e.datum,x:e.x,y:o,distance:Math.sqrt(i*i+s*s)}}return null}function bo(e,t,n){if(0===e.topPath.length)return null;const o=vo(e.topPath,t);if(0>o)return null;const[r,i]=e.topPath[o],s=t-r,a=n-i,l=Math.sqrt(s*s+a*a);return{node:e,datum:Array.isArray(e.datum)&&e.datum[o]?e.datum[o]:e.datum,x:r,y:i,distance:l}}function vo(e,t){if(0===e.length)return-1;let n=0,o=e.length-1;for(;o>n;){const r=n+o>>1;t>e[r][0]?n=r+1:o=r}return n>0&&Math.abs(e[n][0]-t)>=Math.abs(e[n-1][0]-t)?n-1:n}import{useEffect as xo,useRef as ko}from"react";var wo={fresh:1,aging:.7,stale:.45,expired:.25},Ao={alpha:1,band:"fresh",isStale:!1};function So(e,t){if(!e||0>=t)return Ao;const n=null!=e.threshold&&e.threshold>0?e.threshold:5e3,o=e.graded;if(o){const e="object"==typeof o?o:{},r=function(e,t,n={}){return Number.isFinite(t)&&t>0?Number.isNaN(e)?"fresh":e===1/0?"expired":0>e||t*(n.fresh??1)>e?"fresh":t*(n.aging??1.5)>e?"aging":t*(n.stale??3)>e?"stale":"expired":"fresh"}(t,n,e.thresholds);return{alpha:{...wo,...e.opacities??{}}[r],band:r,isStale:"fresh"!==r}}return t>n?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:Ao}import{jsx as Co}from"react/jsx-runtime";function Mo({isStale:e,position:t}){return Co("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===t?{top:4,left:4}:"bottom-left"===t?{bottom:4,left:4}:"bottom-right"===t?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:e?"#dc3545":"#28a745",color:"white"},children:e?"STALE":"LIVE"})}import{useMemo as _o,useRef as Po,useEffect as Lo}from"react";import*as Ro from"react";import{jsx as Io,jsxs as To}from"react/jsx-runtime";var No={fill:(e,t)=>Io("rect",{style:e,width:t,height:t}),line:(e,t)=>Io("line",{style:e,x1:0,y1:0,x2:t,y2:t})};function Fo(e,t,n,o,r){let i;return i="function"==typeof n?n(e):(0,No[n])(o(e,t),r),i}function Bo({swatchSize:e}){return Io("path",{d:`M${.25*e},${.55*e} L${.45*e},${.75*e} L${.8*e},${.3*e}`,fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}function Oo(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}var Wo=(e,t,n,o,r,i,s,a,l,c,u)=>{const{type:h="fill",styleFn:d,items:f}=e,p=[];let y=0;const m=!(!t&&!n),g="isolate"===c||void 0===c&&null!=r,{swatchSize:b,labelGap:v,rowHeight:x}=u;return f.forEach((e,c)=>{const u=Fo(e,c,h,d,b),k=Oo(e,o,r),w=r&&r.size>0&&r.has(e.label);p.push(To("g",{transform:`translate(0,${y})`,onClick:t?()=>t(e):void 0,onMouseEnter:n?()=>n(e):void 0,onMouseLeave:n?()=>n(null):void 0,tabIndex:m?a===i&&c===s?0:-1:void 0,role:m?"option":void 0,"aria-selected":m&&g?w||!1:void 0,"aria-current":m&&!g&&null!=o&&e.label===o||void 0,"aria-label":e.label,onKeyDown:m?n=>{if("Enter"!==n.key&&" "!==n.key||(n.preventDefault(),t&&t(e)),"ArrowDown"===n.key||"ArrowUp"===n.key){n.preventDefault();const e=(c+("ArrowDown"===n.key?1:-1)+f.length)%f.length;l(a,e);const t=n.currentTarget.parentElement?.children[e];t instanceof SVGElement&&t.focus()}}:void 0,onFocus:m?t=>{l(a,c),n&&n(e);const o=t.currentTarget.querySelector(".semiotic-legend-focus-ring");o&&o.setAttribute("visibility","visible")}:void 0,onBlur:m?e=>{n&&n(null);const t=e.currentTarget.querySelector(".semiotic-legend-focus-ring");t&&t.setAttribute("visibility","hidden")}:void 0,style:{cursor:m?"pointer":"default",opacity:k,transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[m&&Io("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:b+v+2+7*e.label.length,height:b+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),u,w&&Io(Bo,{swatchSize:b}),Io("text",{y:b/2,x:b+v,dominantBaseline:"central",style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label})]},"legend-item-"+c)),y+=x}),p};function Do({config:e,orientation:t="vertical",width:n=100}){const{colorFn:o,domain:r,label:i,format:s}=e,a=s||(e=>Math.round(100*e)/100+""),l="grad-legend-"+Ro.useId();if("horizontal"===t){const e=12,t=Math.min(n,200),s=Math.max(0,(n-t)/2),c=[];for(let e=0;64>=e;e++){const t=e/64;c.push(Io("stop",{offset:100*t+"%",stopColor:o(r[0]+t*(r[1]-r[0]))},e))}return To("g",{"aria-label":i||"Gradient legend",children:[Io("defs",{children:Io("linearGradient",{id:l,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:c})}),i&&Io("text",{x:s+t/2,y:-4,textAnchor:"middle",fontSize:11,fill:"var(--semiotic-text, #333)",children:i}),Io("rect",{x:s,y:0,width:t,height:e,fill:`url(#${l})`,rx:2}),Io("text",{x:s,y:e+12,textAnchor:"start",fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:a(r[0])}),Io("text",{x:s+t,y:e+12,textAnchor:"end",fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:a(r[1])})]})}const c=[];for(let e=0;64>=e;e++){const t=e/64;c.push(Io("stop",{offset:100*t+"%",stopColor:o(r[1]-t*(r[1]-r[0]))},e))}return To("g",{"aria-label":i||"Gradient legend",children:[i&&Io("text",{x:7,y:-6,textAnchor:"middle",fontSize:11,fill:"var(--semiotic-text, #333)",children:i}),Io("defs",{children:Io("linearGradient",{id:l,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:c})}),Io("rect",{x:0,y:0,width:14,height:100,fill:`url(#${l})`,rx:2}),Io("text",{x:19,y:10,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:a(r[1])}),Io("text",{x:19,y:100,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:a(r[0])})]})}function zo(e){const{legendGroups:t,customClickBehavior:n,customHoverBehavior:o,highlightedCategory:r,isolatedCategories:i,legendInteraction:s,title:a="Legend",width:l=100,height:c=20,orientation:u="vertical",legendLayout:h}=e,d=function(e){const t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}(h),[f,p]=Ro.useState(0),[y,m]=Ro.useState(0),g=Ro.useCallback((e,t)=>{p(e),m(t)},[]),b="vertical"===u?(({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:o,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:s,focusedItemIndex:a,onFocusedIndexChange:l,legendInteraction:c,metrics:u})=>{let h=24;const d=[];return e.forEach((e,f)=>{h+=5,d.push(Io("line",{stroke:"gray",x1:0,y1:h,x2:t,y2:h},"legend-top-line legend-symbol-"+f)),h+=8,e.label&&(h+=16,d.push(Io("text",{y:h,className:"legend-group-label",style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label},"legend-text-"+f)),h+=8),d.push(Io("g",{className:"legend-item",transform:`translate(0,${h})`,children:Wo(e,n,o,r,i,s,a,f,l,c,u)},"legend-group-"+f)),h+=e.items.length*u.rowHeight+8}),d})({legendGroups:t||[],width:l,customClickBehavior:n,customHoverBehavior:o,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:f,focusedItemIndex:y,onFocusedIndexChange:g,legendInteraction:s,metrics:d}):(({legendGroups:e,height:t,width:n,customClickBehavior:o,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:s,focusedGroupIndex:a,focusedItemIndex:l,onFocusedIndexChange:c,legendInteraction:u,metrics:h})=>{let d=0;const f=[];e.forEach((e,t)=>{let p=0;e.label&&(p+=16);const y=((e,t,n,o,r,i,s,a,l,c,u,h)=>{const{type:d="fill",styleFn:f,items:p}=e,y=[],{swatchSize:m,labelGap:g,itemGap:b,rowHeight:v,align:x}=u,k=!(!t&&!n),w="isolate"===c||void 0===c&&null!=r,A=p.map(e=>m+g+7*e.label.length),S=[];let C=0,M=0;A.forEach((e,t)=>{const n=0===M?e:M+b+e;h&&h>0&&M>0&&n>h?(S.push({start:C,end:t,width:M}),C=t,M=e):M=n}),p.length>0&&S.push({start:C,end:p.length,width:M}),S.forEach((e,c)=>{let u="center"===x?Math.max(0,((h??e.width)-e.width)/2):"end"===x?Math.max(0,(h??e.width)-e.width):0;for(let h=e.start;e.end>h;h++){const e=p[h],x=Fo(e,h,d,f,m),S=Oo(e,o,r),C=r&&r.size>0&&r.has(e.label);y.push(To("g",{transform:`translate(${u},${c*v})`,onClick:t?()=>t(e):void 0,onMouseEnter:n?()=>n(e):void 0,onMouseLeave:n?()=>n(null):void 0,tabIndex:k?a===i&&h===s?0:-1:void 0,role:k?"option":void 0,"aria-selected":k&&w?C||!1:void 0,"aria-current":k&&!w&&null!=o&&e.label===o||void 0,"aria-label":e.label,onKeyDown:k?n=>{if("Enter"!==n.key&&" "!==n.key||(n.preventDefault(),t&&t(e)),"ArrowRight"===n.key||"ArrowLeft"===n.key){n.preventDefault();const e=(h+("ArrowRight"===n.key?1:-1)+p.length)%p.length;l(a,e);const t=n.currentTarget.parentElement?.children[e];t instanceof SVGElement&&t.focus()}}:void 0,onFocus:k?t=>{l(a,h),n&&n(e);const o=t.currentTarget.querySelector(".semiotic-legend-focus-ring");o&&o.setAttribute("visibility","visible")}:void 0,onBlur:k?e=>{n&&n(null);const t=e.currentTarget.querySelector(".semiotic-legend-focus-ring");t&&t.setAttribute("visibility","hidden")}:void 0,style:{cursor:k?"pointer":"default",opacity:S,transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[k&&Io("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:m+g+2+7*e.label.length,height:m+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),x,C&&Io(Bo,{swatchSize:m}),Io("text",{y:m/2,x:m+g,dominantBaseline:"central",style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label})]},"legend-item-"+h)),u+=A[h]+b}});const _=Math.max(0,...S.map(e=>e.width)),P=S.length;return{items:y,offset:_,totalRows:P,totalHeight:P*v}})(e,o,r,i,s,a,l,t,c,u,h,h.maxWidth??n);p+=y.offset+5,f.push({label:e.label,...y,offset:p,totalRows:y.totalRows,totalHeight:y.totalHeight}),d+=p+12});const p=h.maxWidth??n;let y=d>p?0:"center"===h.align?Math.max(0,(p-d)/2):"end"===h.align?Math.max(0,p-d):0;const m=[];return f.forEach((n,o)=>{const r=e[o];r.label&&(m.push(Io("text",{transform:`translate(${y},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:r.label},"legend-text-"+o)),y+=16),m.push(Io("g",{className:"legend-item",transform:`translate(${y},0)`,children:n.items},"legend-group-"+o)),y+=n.offset+5,e[o+1]&&m.push(Io("line",{stroke:"gray",x1:y,y1:-8,x2:y,y2:(n.totalHeight||t)+0+8},"legend-top-line legend-symbol-"+o)),y+=12}),Io("g",{children:m})})({legendGroups:t||[],title:a,height:c,width:l,customClickBehavior:n,customHoverBehavior:o,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:f,focusedItemIndex:y,onFocusedIndexChange:g,legendInteraction:s,metrics:d}),v=!(!n&&!o);return To("g",{role:v?"listbox":void 0,"aria-multiselectable":!(!v||"isolate"!==s&&(void 0!==s||null==i))||void 0,"aria-label":"Chart legend",style:{fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[void 0!==a&&""!==a&&"vertical"===u&&Io("text",{className:"legend-title",y:16,x:l/2,textAnchor:"middle",style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:a}),b]})}function Ho(e){return"object"==typeof e&&null!==e&&"legendGroups"in e}import{jsx as Eo}from"react/jsx-runtime";function $o(e){const{legend:t,totalWidth:n,totalHeight:o,margin:r,legendPosition:i="right",legendLayout:s,title:a,legendHoverBehavior:l,legendClickBehavior:c,legendHighlightedCategory:u,legendIsolatedCategories:h,legendInteraction:d}=e;if(!t)return null;const f="top"===i||"bottom"===i,p=!!a,y=Math.max(0,n-r.left-r.right),m=Math.max(1,f?s?.maxWidth??y:100);let g,b;return"left"===i?(g=Math.max(4,r.left-m-10),b=r.top):"top"===i?(g=r.left,b=p?32:8):"bottom"===i?(g=r.left,b=o-r.bottom+38):(g=n-r.right+10,b=r.top),Eo("g",{transform:`translate(${g}, ${b})`,children:(v=t,"object"==typeof v&&null!==v&&"gradient"in v?Eo(Do,{config:t.gradient,orientation:f?"horizontal":"vertical",width:m}):Ho(t)?Eo(zo,{legendGroups:t.legendGroups,title:"",width:m,orientation:f?"horizontal":"vertical",legendLayout:s,customHoverBehavior:l,customClickBehavior:c,highlightedCategory:u,isolatedCategories:h,legendInteraction:d}):t)});var v}import{useMemo as jo}from"react";import{bin as Yo}from"d3-array";import{jsx as Go,jsxs as Vo}from"react/jsx-runtime";function Xo(e){return"string"==typeof e?{type:e}:e}function qo({orient:t,config:n,values:o,scale:r,size:i,length:s}){const a=function(e){return{type:e.type,bins:e.bins??20,fill:e.fill??"#4e79a7",fillOpacity:e.fillOpacity??.5,stroke:e.stroke??"none",strokeWidth:e.strokeWidth??1}}(n),l="top"===t||"bottom"===t,c=jo(()=>{if(0===o.length)return null;const n=r.domain(),c=i-8;if("boxplot"===a.type){const e=function(e){const t=[...e].sort((e,t)=>e-t),n=t.length;if(0===n)return null;const o=t[Math.floor(.25*n)],r=t[Math.floor(.5*n)],i=t[Math.floor(.75*n)],s=i-o;return{q1:o,median:r,q3:i,whiskerLow:Math.max(t[0],o-1.5*s),whiskerHigh:Math.min(t[n-1],i+1.5*s)}}(o);if(!e)return null;const{q1:n,median:i,q3:s,whiskerLow:u,whiskerHigh:h}=e,d=Math.min(.5*c,20),f=(c-d)/2+4;if(l){const e=r(n),o=r(s),l=r(i),c=r(u),p=r(h),y="top"===t?-1:1,m=0;return Vo("g",{"data-testid":"marginal-boxplot-"+t,children:[Go("line",{x1:c,y1:m+y*(f+d/2),x2:p,y2:m+y*(f+d/2),stroke:a.fill,strokeWidth:a.strokeWidth}),Go("line",{x1:c,y1:m+y*f,x2:c,y2:m+y*(f+d),stroke:a.fill,strokeWidth:a.strokeWidth}),Go("line",{x1:p,y1:m+y*f,x2:p,y2:m+y*(f+d),stroke:a.fill,strokeWidth:a.strokeWidth}),Go("rect",{x:Math.min(e,o),y:"top"===t?m-f-d:m+f,width:Math.abs(o-e),height:d,fill:a.fill,fillOpacity:a.fillOpacity,stroke:"none"===a.stroke?a.fill:a.stroke,strokeWidth:a.strokeWidth}),Go("line",{x1:l,y1:"top"===t?m-f-d:m+f,x2:l,y2:"top"===t?m-f:m+f+d,stroke:a.fill,strokeWidth:2})]})}{const e=r(n),o=r(s),l=r(i),c=r(u),p=r(h),y="left"===t?-1:1,m=0;return Vo("g",{"data-testid":"marginal-boxplot-"+t,children:[Go("line",{x1:m+y*(f+d/2),y1:c,x2:m+y*(f+d/2),y2:p,stroke:a.fill,strokeWidth:a.strokeWidth}),Go("line",{x1:m+y*f,y1:c,x2:m+y*(f+d),y2:c,stroke:a.fill,strokeWidth:a.strokeWidth}),Go("line",{x1:m+y*f,y1:p,x2:m+y*(f+d),y2:p,stroke:a.fill,strokeWidth:a.strokeWidth}),Go("rect",{x:"left"===t?m-f-d:m+f,y:Math.min(e,o),width:d,height:Math.abs(o-e),fill:a.fill,fillOpacity:a.fillOpacity,stroke:"none"===a.stroke?a.fill:a.stroke,strokeWidth:a.strokeWidth}),Go("line",{x1:"left"===t?m-f-d:m+f,y1:l,x2:"left"===t?m-f:m+f+d,y2:l,stroke:a.fill,strokeWidth:2})]})}}const u=Yo().domain(n).thresholds(a.bins)(o);if(0===u.length)return null;const h=e(u.map(e=>e.length));if(0===h)return null;if("histogram"===a.type)return Go("g",{"data-testid":"marginal-histogram-"+t,children:u.map((e,n)=>{if(null==e.x0||null==e.x1)return null;const o=e.length/h*c;if(l){const i=r(e.x0),s=r(e.x1)-r(e.x0);return Go("rect",{x:i,y:"top"===t?-4-o:4,width:Math.max(s,.5),height:o,fill:a.fill,fillOpacity:a.fillOpacity,stroke:a.stroke,strokeWidth:a.strokeWidth},n)}{const i=r(e.x0),s=r(e.x1)-r(e.x0);return Go("rect",{x:"left"===t?-4-o:4,y:Math.min(i,i+s),width:o,height:Math.abs(s),fill:a.fill,fillOpacity:a.fillOpacity,stroke:a.stroke,strokeWidth:a.strokeWidth},n)}})});if("violin"===a.type){const e=c/2+4,n=[];for(const o of u){if(null==o.x0||null==o.x1)continue;const i=o.length/h*(c/2),s=r((o.x0+o.x1)/2);n.push(l?`${s},${"top"===t?-(e-i):e-i}`:`${"left"===t?-(e-i):e-i},${s}`)}for(let o=u.length-1;o>=0;o--){const i=u[o];if(null==i.x0||null==i.x1)continue;const s=i.length/h*(c/2),a=r((i.x0+i.x1)/2);n.push(l?`${a},${"top"===t?-(e+s):e+s}`:`${"left"===t?-(e+s):e+s},${a}`)}return Go("g",{"data-testid":"marginal-violin-"+t,children:Go("polygon",{points:n.join(" "),fill:a.fill,fillOpacity:a.fillOpacity,stroke:"none"===a.stroke?a.fill:a.stroke,strokeWidth:a.strokeWidth})})}if("ridgeline"===a.type){const e=[];if(l){const n=0,o=null!=u[0].x0?r(u[0].x0):0;e.push(`M${o},${n}`);for(const n of u){if(null==n.x0||null==n.x1)continue;const o=n.length/h*c,i=r((n.x0+n.x1)/2);e.push(`L${i},${"top"===t?-o-4:o+4}`)}const i=null!=u[u.length-1].x1?r(u[u.length-1].x1):s;e.push(`L${i},${n}`),e.push("Z")}else{const n=0,o=null!=u[0].x0?r(u[0].x0):0;e.push(`M${n},${o}`);for(const n of u){if(null==n.x0||null==n.x1)continue;const o=n.length/h*c,i=r((n.x0+n.x1)/2);e.push(`L${"left"===t?-o-4:o+4},${i}`)}const i=null!=u[u.length-1].x1?r(u[u.length-1].x1):s;e.push(`L${n},${i}`),e.push("Z")}return Go("g",{"data-testid":"marginal-ridgeline-"+t,children:Go("path",{d:e.join(" "),fill:a.fill,fillOpacity:a.fillOpacity,stroke:"none"===a.stroke?a.fill:a.stroke,strokeWidth:a.strokeWidth})})}return null},[o,r,a,i,s,t,l,4]);return c?Go("g",{className:"marginal-"+t,"data-testid":"marginal-"+t,children:c}):null}import*as Uo from"react";import{jsx as Ko,jsxs as Qo}from"react/jsx-runtime";function Zo(e,t=120,n=8){if(!e)return[];const o=Math.max(1,Math.floor(t/n)),r=e.split(/\s+/),i=[];let s="";for(const e of r)s&&s.length+1+e.length>o?(i.push(s),s=e):s=s?`${s} ${e}`:e;return s&&i.push(s),i}function Jo(e,t,n,o){return"curly"===e?o?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:o?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function er(e,t,n,o){if(!e)return Ko("g",{className:"annotation-note"});const{label:r,title:i,orientation:s,align:a,wrap:l=120,noWrap:c}=e;if(!r&&!i)return Ko("g",{className:"annotation-note"});let u=s;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");let h=a;h&&"dynamic"!==h||(h="topBottom"===u?0>t?"right":"left":0>n?"bottom":"top");let d="start";"topBottom"===u?"right"===h?d="end":"middle"===h&&(d="middle"):d=0>t?"end":"start";const f=16,p=i?c?[i]:Zo(i,l):[],y=r?c?[r]:Zo(r,l):[],m="leftRight"===u?"end"===d?-4:4:0;let g=0;const b=[],v=o||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";e.useHTML||e.html?b.push(Ko("foreignObject",{className:"annotation-note-html",x:"end"===d?m-l:"middle"===d?m-l/2:m,y:-16,width:l,height:Math.max(f,(p.length+y.length)*f+(i&&r?2:0))+f,style:{overflow:"visible"},children:Qo("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:v,fontSize:"12px",lineHeight:"16px",overflow:"visible",textAlign:"end"===d?"right":"middle"===d?"center":"left",whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[i&&Ko("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:i}),r&&Ko("div",{className:"annotation-note-label",children:r})]})},"annotation-note-html")):(p.length>0&&(b.push(Ko("text",{className:"annotation-note-title",fill:v,textAnchor:d,fontWeight:"bold",children:p.map((e,t)=>Ko("tspan",{x:m,dy:0===t?0:f,children:e},t))},"annotation-note-title")),g=p.length*f),y.length>0&&b.push(Ko("text",{className:"annotation-note-label",fill:v,textAnchor:d,y:g,children:y.map((e,t)=>Ko("tspan",{x:m,dy:0===t?0:f,children:e},t))},"annotation-note-label")));let x=null;if((i||r)&&(0!==t||0!==n))if("topBottom"===u){const e=Math.min(l,120);let t=0,n=e;"end"===d?(t=-e,n=0):"middle"===d&&(t=-e/2,n=e/2),x=Ko("line",{className:"note-line",x1:t,x2:n,y1:0,y2:0,stroke:o||"var(--semiotic-text-secondary, currentColor)"})}else{const e=(p.length+y.length)*f+(y.length>0?f:0);let t=0,n=e;"bottom"===h?(t=-e,n=0):"middle"===h&&(t=-e/2,n=e/2),x=Ko("line",{className:"note-line",x1:0,x2:0,y1:t,y2:n,stroke:o||"var(--semiotic-text-secondary, currentColor)"})}const k=Math.max(0,p.length+y.length-1)*f;let w=0;return"topBottom"===u?w=0>n?-(k+2):18:"leftRight"===u&&(w="middle"===h?-(k+f+(y.length>0&&p.length>0?2:0))/2+8:"bottom"===h||0>n?-(k+2):18),Qo("g",{className:"annotation-note",transform:`translate(${t},${n})`,children:[Ko("g",{className:"annotation-note-content",transform:0!==w?`translate(0,${w})`:void 0,children:b}),x]})}function tr(e,t,n,o,r){const i=[];switch(e){case"callout-circle":{const e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&i.push(Ko("circle",{r:e,fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"subject-circle"));break}case"callout-rect":{const e=t?.width||0,o=t?.height||0;(e>0||o>0)&&i.push(Ko("rect",{width:e,height:o,fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"subject-rect"));break}case"callout-custom":t?.custom&&i.push(...Array.isArray(t.custom)?t.custom:[t.custom]);break;case"xy-threshold":{const e=o||0,s=r||0;if(void 0!==t?.x){const o=(t.x||0)-e;i.push(Ko("line",{x1:o,y1:(t.y1||0)-s,x2:o,y2:(t.y2||0)-s,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"))}else if(void 0!==t?.y){const o=(t.y||0)-s;i.push(Ko("line",{x1:(t.x1||0)-e,y1:o,x2:(t.x2||0)-e,y2:o,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"))}else void 0!==t?.x1||void 0!==t?.x2?i.push(Ko("line",{x1:(t.x1||0)-e,y1:0,x2:(t.x2||0)-e,y2:0,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line")):void 0===t?.y1&&void 0===t?.y2||i.push(Ko("line",{x1:0,y1:(t.y1||0)-s,x2:0,y2:(t.y2||0)-s,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"));break}case"bracket":{const e=t?.type||"curly",o=t?.width??t?.height;void 0!==o&&i.push(Ko("path",{d:Jo(e,o,t?.depth||30,void 0===t?.width),fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"bracket-path"));break}}return Ko("g",{className:"annotation-subject",children:i})}function nr(e,t,n,o,r,i){const s=[];let a=0,l=0;if("callout-circle"!==r&&"label"!==r||!i?.radius){if("callout-rect"===r&&i){const n=i.width||0,o=i.height||0;if(n>0||o>0){const r=n/2,i=o/2,s=e-r,c=t-i;if(0!==s||0!==c){const e=Math.abs(s),t=Math.abs(c),u=n/2,h=o/2,d=e*h>t*u?u/e:h/t;a=r+s*d,l=i+c*d}}}else if("bracket"===r&&i){const e=i.width,t=i.height,n=i.depth||30;void 0!==e?(a=e/2,l=n):void 0!==t&&(a=n,l=t/2)}}else{const n=(i.radius||0)+(i.radiusPadding||0);if(n>0&&(0!==e||0!==t)){const o=Math.atan2(t,e);a=Math.cos(o)*n,l=Math.sin(o)*n}}const c=Math.sqrt((e-a)**2+(t-l)**2);if(c>.5){const r=o||"var(--semiotic-text-secondary, currentColor)",i="curve"===n?.type;let u=Math.atan2(t-l,e-a);if(i){const o=(a+e)/2,i=(l+t)/2,h=-(t-l)/c,d=(e-a)/c,f=(n?.curve??.25)*c,p=o+h*f,y=i+d*f;s.push(Ko("path",{className:"connector-curve",d:`M${a},${l}Q${p},${y} ${e},${t}`,fill:"none",stroke:r},"connector-line")),u=Math.atan2(y-l,p-a)}else s.push(Ko("line",{x1:a,y1:l,x2:e,y2:t,stroke:r},"connector-line"));if("arrow"===n?.end){const e=10,t=16/180*Math.PI;s.push(Ko("path",{d:`M${a},${l}L${a+e*Math.cos(u+t)},${l+e*Math.sin(u+t)}L${a+e*Math.cos(u-t)},${l+e*Math.sin(u-t)}Z`,fill:r,stroke:"none"},"connector-arrow"))}}return Ko("g",{className:"annotation-connector",children:s})}function or(e){const{x:t=0,y:n=0,dx:o,dy:r,nx:i,ny:s,note:a,connector:l,subject:c,type:u,color:h,className:d,disable:f,opacity:p,strokeDasharray:y,events:m={},"data-testid":g}=e,b=Array.isArray(t)?t[0]??0:t,v=Array.isArray(n)?n[0]??0:n,x=new Set(Array.isArray(f)?f:[]);let k=o||0,w=r||0;null!=i&&(k=i-b),null!=s&&(w=s-v);const A="string"==typeof u?u:"label";if("bracket"===A&&c&&0===k&&0===w)if(void 0!==c.width){k=c.width/2;const e=c.depth||30;w=e+(0>e?-5:5)}else if(void 0!==c.height){const e=c.depth||30;k=e+(0>e?-5:5),w=c.height/2}return Qo("g",{className:("annotation "+(d||"")).trim(),transform:`translate(${b},${v})`,"data-testid":g,...null!=p&&{opacity:p},...y&&{strokeDasharray:y},...m,children:[!x.has("connector")&&nr(k,w,l,h,A,c),!x.has("subject")&&tr(A,c,h,b,v),!x.has("note")&&er(a,k,w,h)]})}function rr(e){const{noteData:t}=e,{screenCoordinates:n}=t,o="string"==typeof t.type?t.type:"label",r=t.eventListeners||t.events||{};if(t.coordinates&&n){const e=t.nx||n[0][0]+(t.dx??0),r=t.ny||n[0][1]+(t.dy??0),i=n.map((n,i)=>{const s=Object.assign({},t,{note:0===i?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:r});return Ko(or,{"data-testid":"semiotic-annotation",...s,type:o},"multi-annotation-"+i)});return Ko("g",{children:i})}const i=t.note||{title:"none",label:t.label},s=`${i.label}-${i.title}-${t.i}`;return Ko(or,{"data-testid":"semiotic-annotation",events:r,...t,type:o},s)}import{packEnclose as ir}from"d3-hierarchy";import{area as sr,curveLinear as ar,curveMonotoneX as lr,curveMonotoneY as cr,curveStep as ur,curveStepAfter as hr,curveStepBefore as dr,curveBasis as fr,curveCardinal as pr,curveCatmullRom as yr}from"d3-shape";function mr(e){return Math.round(100*e)/100}function gr(e,t=2){const n=[],o=[],r=t+1;for(let t=0;r>t;t++){let i=0;for(const[n,o]of e)null!==o&&(i+=n**t*o);n.push(i);const s=[];for(let n=0;r>n;n++){let o=0;for(const[r,i]of e)null!==i&&(o+=r**(t+n));s.push(o)}o.push(s)}o.push(n);const i=function(e,t){const n=e,o=e.length-1,r=[t];for(let e=0;o>e;e++){let t=e;for(let r=e+1;o>r;r++)Math.abs(n[e][r])>Math.abs(n[e][t])&&(t=r);for(let r=e;o+1>r;r++){const o=n[r][e];n[r][e]=n[r][t],n[r][t]=o}for(let t=e+1;o>t;t++)for(let r=o;r>=e;r--)n[r][t]-=n[r][e]*n[e][t]/n[e][e]}for(let e=o-1;e>=0;e--){let t=0;for(let i=e+1;o>i;i++)t+=n[i][e]*r[i];r[e]=(n[o][e]-t)/n[e][e]}return r}(o,r).map(mr);return{points:e.map(([e])=>[mr(e),mr(i.reduce((t,n,o)=>t+n*e**o,0))]),equation:[...i].reverse()}}function br(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function vr(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function xr(e){return null==e?null:e+""}function kr(e,t,n){return t.stickyPositionCache?.set(e,n),n}function wr(e,t,n){const o=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===o){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let o=n.pointNodes.length-1;o>=0;o--){const r=n.pointNodes[o];if(r.pointId===e.pointId)return kr(t,n,{x:r.x,y:r.y})}const o=function(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],o=e.scales?.x??e.scales?.time,r=e.scales?.y??e.scales?.value;if(!o||!r)return null;const i=n[e.xAccessor||"x"],s=n[e.yAccessor||"y"];return null==i||null==s?null:{x:o(i),y:r(s)}}(n);return o?kr(t,n,o):null}if("semantic"===o){const o=function(e,t,n){const o=function(e){return xr(e.provenance?.stableId??e.stableId)}(e);if(!o)return null;const r=n.pointNodes?.find(e=>xr(e.pointId)===o);if(r)return kr(t,n,{x:r.x,y:r.y});const i=n.data?.find(e=>function(e){return xr(e.stableId??e.id??e.provenance?.stableId)}(e)===o);if(!i)return null;const s=br(i,n),a=vr(i,n);return null==s||null==a?null:kr(t,n,{x:s,y:a})}(e,t,n);if(o)return o}let r=null,i=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(r=t.x,i=t.y)}if(null!=r&&null!=i||(r=br(e,n),i=vr(e,n)),null!=r&&null!=i)return kr(t,n,{x:r,y:i});if("sticky"===o){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function Ar(e,t,n,o=50){return!(-o>e||e>(n.width||0)+o||-o>t||t>(n.height||0)+o)}import{jsx as Sr}from"react/jsx-runtime";var Cr={secondary:0,primary:3};function Mr(e){return!0===e?._annotationDeferred}function _r(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function Pr(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function Lr(e){return Math.max(.72,.95-.06*e)}import*as Rr from"react";var[Ir,Tr]=O(e=>({observations:[],maxObservations:100,version:0,pushObservation(t){e(e=>{const n=e.observations;return n.push(t),n.length>e.maxObservations&&n.shift(),{version:e.version+1}})},clearObservations(){e(()=>({observations:[],version:0}))}}));function Nr(e,t={}){const n=function(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:n+""}(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(o){const r=function(e){const t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}(o);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:r}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:r,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}import{jsx as Fr,jsxs as Br}from"react/jsx-runtime";var Or="var(--semiotic-bg, #ffffff)";function Wr(e){const{x:t,y:n,text:o,fill:r,fontSize:i=12,fontWeight:s,fontFamily:a,textAnchor:l="start",dominantBaseline:c,background:u,className:h}=e,d=function(e){return void 0===e||!0===e||"halo"===e?{type:"halo"}:!1===e||"none"===e?null:"box"===e?{type:"box"}:{type:e.type??"halo",...e}}(u),f=e=>Fr("text",{x:t,y:n,textAnchor:l,dominantBaseline:c,fill:r,fontSize:i,fontWeight:s,fontFamily:a,className:h,...e?{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}:{},children:o});if(!d)return f();if("halo"===d.type)return f({stroke:d.fill??Or,strokeWidth:d.haloWidth??3});const p=d.padding??{x:6,y:3},y="number"==typeof p?p:p.x,m="number"==typeof p?p:p.y,g=function(e,t){return(e+"").length*t*.6}(o,i),b=i+2*m;let v,x;return v="middle"===l?t-g/2-y:"end"===l?t-g-y:t-y,x="middle"===c||"central"===c?n-b/2:"hanging"===c||"text-before-edge"===c?n-m:n-.8*i-m,Br("g",{className:h,children:[Fr("rect",{x:v,y:x,width:g+2*y,height:b,rx:d.radius??3,ry:d.radius??3,fill:d.fill??Or,fillOpacity:d.opacity??.85,stroke:d.stroke,strokeWidth:d.strokeWidth}),f()]})}import{jsx as Dr,jsxs as zr}from"react/jsx-runtime";var Hr={linear:ar,monotoneX:lr,monotoneY:cr,step:ur,stepAfter:hr,stepBefore:dr,basis:fr,cardinal:pr,catmullRom:yr};var Er=new Set(["label","callout","callout-circle","callout-rect","text","widget"]);function $r(e){return!!e&&"object"==typeof e&&Er.has(function(e){return"string"==typeof e?.type?e.type:""}(e))}function jr(e){return"primary"===e?.emphasis||!0===e?.defensive}function Yr(e,t,n={}){return"number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations)?Math.max(0,Math.floor(n.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4))):1/0}function Gr(e){let t;const n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;const o=e?.provenance?.confidence;switch("number"==typeof o&&Number.isFinite(o)&&(t+=15*Math.max(0,Math.min(1,o))),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}new Set(["label","callout","callout-circle","callout-rect"]);var Vr=32,Xr=6,qr=4,Ur=8,Kr=72;var Qr={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};function Zr(e){if(!Jr(e))return e;const t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function Jr(e){return $r(e)}function ei(e,t){if(!e)return[];const n=Math.max(1,Math.floor(t/7)),o=e.split(/\s+/).filter(Boolean),r=[];let i="";for(const e of o)i&&i.length+e.length+1>n?(r.push(i),i=e):i=i?`${i} ${e}`:e;return i&&r.push(i),r}function ti(e,t,n,o,r){const i=e+n,s=t+o;return Math.abs(n)>Math.abs(o)?{x:0>n?i-r.width-4:i+4,y:0>o?s-r.height:s,width:r.width,height:r.height}:{x:0>n?i-r.width:i,y:0>o?s-r.height-4:s+4,width:r.width,height:r.height}}function ni(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function oi(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function ri(e,t,n,o,r,i,s,a){const l=ni(e,s);let c=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,n,o){const r=Math.max(0,o-e.x),i=Math.max(0,o-e.y);return(r+Math.max(0,e.x+e.width-(t-o)))*e.height+(i+Math.max(0,e.y+e.height-(n-o)))*e.width}(l,r,i,a);for(const e of n)c+=12*oi(l,e);for(const e of o)c+=4*oi(l,e);return c}function ii(e){const{annotations:t,context:n,defaultOffset:o=Vr,notePadding:r=Xr,markPadding:i=qr,edgePadding:s=Ur,preserveManualOffsets:a=!0,routeLongConnectors:l=!0,connectorThreshold:c=Kr,density:u,progressiveDisclosure:h=!1,redundantCues:d=!1,responsive:f,mobile:p,cohesion:y,audience:m}=e,g=n.width||0,b=n.height||0,v="object"==typeof p?p:{},x=v.breakpoint??480,k=!!p&&x>=g,w=k&&!1!==v.preferShortText?t.map(Zr):t,A=k&&!u?{maxAnnotations:v.maxAnnotations??("callout-list"===v.strategy?1:2),minVisible:v.minVisible??1}:u,S=h||k&&(!1!==v.progressiveDisclosure||"callout-list"===v.strategy),C=k&&!f?v.responsive??{minWidth:x}:f,M=k&&!y?v.cohesion:y;if(0===w.length||0>=g||0>=b)return w.slice();const _=[],P=function(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}(n,i);let L=!1;const R=w.map((e,t)=>{if(!Jr(e))return e;const i=function(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const o=e.pointId??e.nodeId;if(null!=o&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===o);if(e)return{x:e.x,y:e.y}}const r=e.coordinates,i=n.scales?.geoProjection;if(Array.isArray(r)&&r.length>=2&&i){const e=r[0],t=r[1];if("number"==typeof e&&"number"==typeof t){const n=i([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?wr(e,t,n):{x:e.x,y:e.y}}(e,t,n);if(!i)return e;const u=function(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t="number"==typeof e.wrap?e.wrap:120,n=[...ei("string"==typeof e.title?e.title:void 0,t),...ei("string"==typeof e.label?e.label:void 0,t)],o=n.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(t,7*o)+10),height:Math.max(18,16*n.length+6)}}(e);if(a&&("number"==typeof(h=e).dx||"number"==typeof h.dy)){const t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e);return _.push(ni(ti(i.x,i.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,u),r)),e}var h;let d=null,f=1/0;for(const e of function(e){const t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}(o)){const t=ri(ti(i.x,i.y,e.dx,e.dy,u),e,_,P,g,b,r,s);f>t&&(d=e,f=t)}if(!d)return e;const p=ni(ti(i.x,i.y,d.dx,d.dy,u),r);_.push(p);const y=Math.hypot(d.dx,d.dy),m=l&&y>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return L=!0,{...e,dx:d.dx,dy:d.dy,...m?{connector:m}:{}}}),I=L?R:w.slice();let T=I;if(d){let e=!1;const t=I.map(t=>{const n=function(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}(t);return n!==t&&(e=!0),n});T=e?t:I}{let e=!1;const t=T.map(t=>{if(!0!==t?.defensive)return t;const n=function(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?Qr[t.source]??t.source:null,o="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!o)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const r=[n,o].filter(Boolean).join(" · "),i="string"==typeof e.label?e.label:"";return i.includes(`(${r})`)?e:{...e,label:i?`${i} (${r})`:`(${r})`}}(t);return n!==t&&(e=!0),n});T=e?t:T}const N=new Set;if(A){const e="object"==typeof A?A:{},t=function(e){if(!e)return 1;const t=function(e){const t=e?.familiarity;if(!t)return 3;const n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}(e);return t>2?4>t?1:.6:1.5}(m),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??Yr(g,b,e))*t))},{deferred:o}=function(e){const{annotations:t,width:n,height:o}=e,r=Math.max(0,e.minVisible??1),i=Yr(n,o,e),s=t.map((e,t)=>{return{annotation:e,index:t,note:(n=e,$r(n))};var n}),a=s.filter(e=>e.note);if(0===a.length||i>=a.length)return{visible:t.slice(),deferred:[],budget:i};const l=a.filter(e=>jr(e.annotation)),c=a.filter(e=>!jr(e.annotation)).sort((e,t)=>Gr(t.annotation)-Gr(e.annotation)||e.index-t.index),u=Math.min(c.length,Math.max(Math.max(0,i-l.length),Math.max(0,r-l.length))),h=new Set([...l.map(e=>e.index),...c.slice(0,u).map(e=>e.index)]),d=[],f=[];for(const{annotation:e,index:t,note:n}of s)!n||h.has(t)?d.push(e):f.push(e);return{visible:d,deferred:f,budget:i}}({annotations:T,width:g,height:b,...n});for(const e of o)N.add(e)}if(C&&("object"==typeof C&&"number"==typeof C.minWidth?C.minWidth:480)>=g)for(const e of T)Jr(e)&&"secondary"===e.emphasis&&N.add(e);if(N.size>0)for(const e of T)!0===e?.defensive&&N.delete(e);let F;return F=0===N.size?T:S?T.map(e=>N.has(e)?{...e,_annotationDeferred:!0}:e):T.filter(e=>!N.has(e)),M?function(e,t){let n=!1;const o=e.map(e=>Jr(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?o:e}(F,M):F}import{useSyncExternalStore as si}from"react";var ai={positions:new Map},li=new Set;function ci(){for(const e of li)e()}function ui(e,t){const n=ai.positions.get(e);if(n?.locked)return;if(!n||n.sourceId!==t)return;const o=new Map(ai.positions);o.delete(e),ai={positions:o},ci()}function hi(e,t){const n=ai.positions.get(e);if(!n?.locked)return;if(t&&n.sourceId!==t)return;const o=new Map(ai.positions);o.delete(e),ai={positions:o},ci()}function di(){return ai}function fi(e){return li.add(e),()=>li.delete(e)}var pi={positions:new Map};function yi(){return()=>{}}function mi(){return pi}function gi(e,t,n){return"exact"===n?function(e,t){const n=e.domain(),o=n[0],r=n[n.length-1],i=o instanceof Date,s=o instanceof Date?o.getTime():o,a=r instanceof Date?r.getTime():r;if(2>t||s===a)return i?[new Date(s),new Date(a)]:[s,a];const l=(a-s)/(t-1),c=Array(t);for(let e=0;t>e;e++){const n=e===t-1?a:s+e*l;c[e]=i?new Date(n):n}return c}(e,t):e.ticks(t)}function bi(e,t,n){if("edges"===e){if(t)return"start";if(n)return"end"}return"middle"}function vi(e,t,n){if("edges"===e){if(t)return"hanging";if(n)return"auto"}return"middle"}function xi(e){if(0===e.length)return{min:null,max:null};let t=1/0,n=-1/0;for(const o of e)t>o.pixel&&(t=o.pixel),o.pixel>n&&(n=o.pixel);return{min:t,max:n}}function ki(e){if(e)return"dashed"===e?"6,4":"dotted"===e?"2,4":e}function wi(e,t,n){if("left"===e||"right"===e){const o="left"===e?n:0,r="left"===e?-1:1,i=Math.ceil(t/8);let s="M0,"+o;for(let e=0;i>e;e++){const n=8*(e+1);s+=`L${Math.min(8*e+4,t)},${o+4*r}`,s+=`L${Math.min(n,t)},${o}`}return s}const o="bottom"===e?0:t,r="bottom"===e?1:-1,i=Math.ceil(n/8);let s=`M${o},0`;for(let e=0;i>e;e++){const t=8*(e+1);s+=`L${o+4*r},${Math.min(8*e+4,n)}`,s+=`L${o},${Math.min(t,n)}`}return s}import{Fragment as Ai,jsx as Si,jsxs as Ci}from"react/jsx-runtime";function Mi(e){const{width:t,height:n,totalWidth:o,totalHeight:r,margin:i,scales:s,showAxes:a,axes:l,showGrid:c,xFormat:u,yFormat:h,axisExtent:d}=e,f=_o(()=>{if(!s)return[];const e=l?.find(e=>"bottom"===e.orient),n=e?.tickFormat||u||_i,o=Math.max(2,Math.floor(t/70)),r=e?.ticks??5,i="exact"===d?Math.max(2,r):Math.min(r,o),a=e?.tickValues??gi(s.x,i,d),c=a.map(e=>e.valueOf()),h=a.map((e,t)=>({value:e,pixel:s.x(e),label:n(e,t,c)})),f=h.reduce((e,t)=>Math.max(e,"string"==typeof t.label?6.5*t.label.length:"number"==typeof t.label?6.5*(t.label+"").length:60),0);return Pi(h,Math.max(55,f+8))},[s,l,u,t,d]),p=_o(()=>{if(!s)return[];const e=l?.find(e=>"left"===e.orient),t=e?.tickFormat||h||_i,o=Math.max(2,Math.floor(n/30)),r=e?.ticks??5,i="exact"===d?Math.max(2,r):Math.min(r,o);return Pi((e?.tickValues??gi(s.y,i,d)).map(e=>({value:e,pixel:s.y(e),label:t(e)})),22)},[s,l,h,n,d]),y=c&&s,m=a&&s;if(!y&&!m)return null;const g=l?.find(e=>"bottom"===e.orient),b=l?.find(e=>"left"===e.orient),v=m&&(!g||!1!==g.baseline),x=m&&(!b||!1!==b.baseline),k=g?.jaggedBase||!1,w=b?.jaggedBase||!1,A="var(--semiotic-border, #ccc)";return Si("svg",{width:o,height:r,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:Ci("g",{transform:`translate(${i.left},${i.top})`,children:[y&&(()=>{const e=ki(l?.find(e=>"bottom"===e.orient)?.gridStyle),o=ki(l?.find(e=>"left"===e.orient)?.gridStyle);return Ci("g",{className:"stream-grid",children:[f.map((t,o)=>Si("line",{x1:t.pixel,y1:0,x2:t.pixel,y2:n,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1,strokeDasharray:e},"xgrid-"+o)),p.map((e,n)=>Si("line",{x1:0,y1:e.pixel,x2:t,y2:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1,strokeDasharray:o},"ygrid-"+n))]})})(),v&&!k&&Si("line",{x1:0,y1:n,x2:t,y2:n,stroke:A,strokeWidth:1}),k&&Si("path",{d:wi("bottom",t,n),fill:"none",stroke:A,strokeWidth:1}),x&&!w&&Si("line",{x1:0,y1:0,x2:0,y2:n,stroke:A,strokeWidth:1}),w&&Si("path",{d:wi("left",t,n),fill:"none",stroke:A,strokeWidth:1})]})})}function _i(e,t,n){return e instanceof Date?`${e.toLocaleString("en",{month:"short"})} ${e.getDate()}`:"number"==typeof e?Math.round(100*e)/100+"":e+""}function Pi(e,t){if(2>=e.length)return e;const n=[e[0]];for(let o=1;e.length-1>o;o++)t>Math.abs(e[o].pixel-n[n.length-1].pixel)||n.push(e[o]);const o=e[e.length-1];return t>Math.abs(o.pixel-n[n.length-1].pixel)?n[n.length-1]=o:n.push(o),n}function Li(e){const{width:n,height:o,totalWidth:r,totalHeight:i,margin:s,scales:a,showAxes:l,axes:c,xLabel:u,yLabel:h,yLabelRight:d,xFormat:f,yFormat:p,axisExtent:y,showGrid:m,title:g,legend:b,legendHoverBehavior:v,legendClickBehavior:x,legendHighlightedCategory:k,legendIsolatedCategories:w,legendPosition:A="right",legendLayout:S,foregroundGraphics:C,marginalGraphics:M,xValues:_,yValues:P,annotations:L,onAnnotationActivate:R,onObservation:I,chartId:T,chartType:N,autoPlaceAnnotations:F,svgAnnotationRules:B,xAccessor:O,yAccessor:W,annotationData:D,pointNodes:z,curve:H,underlayRendered:E,canvasObscuresUnderlay:$=!0,linkedCrosshairName:j,linkedCrosshairSourceId:Y,children:G}=e,V=function(e){const t=Tr(e=>e.pushObservation),n=Rr.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return Rr.useMemo(()=>({...e,onObservation:n}),[n,e])}({onAnnotationActivate:R,onObservation:I,chartId:T,chartType:N}),X=_o(()=>{if(!l||!a)return[];const e=c?.find(e=>"bottom"===e.orient),t=e?.tickFormat||f||_i,o=Math.max(2,Math.floor(n/70)),r=e?.ticks??5,i="exact"===y?Math.max(2,r):Math.min(r,o),s=e?.tickValues??gi(a.x,i,y),u=s.map(e=>e.valueOf()),h=s.map((e,n)=>({value:e,pixel:a.x(e),label:t(e,n,u)})),d=h.reduce((e,t)=>Math.max(e,"string"==typeof t.label?6.5*t.label.length:"number"==typeof t.label?6.5*(t.label+"").length:60),0),p=e?.autoRotate?Math.max(20,Math.min(d+8,55)):Math.max(55,d+8);let m=Pi(h,p);if(m.length>1&&(m=m.filter((e,t)=>0===t||e.label+""!=m[t-1].label+"")),e?.includeMax&&m.length>0&&"exact"!==y&&!e?.tickValues){const e=a.x.domain()[1],n=a.x(e),o=m[m.length-1].pixel;if(Math.abs(n-o)>1){const r=t(e,m.length,u);p>n-o&&m.length>1&&(m=m.slice(0,-1)),m.push({value:e,pixel:n,label:r})}}return m},[l,a,c,f,n,y]),q=_o(()=>{if(!l||!a)return[];const e=c?.find(e=>"left"===e.orient),t=e?.tickFormat||p||_i,n=Math.max(2,Math.floor(o/30)),r=e?.ticks??5,i="exact"===y?Math.max(2,r):Math.min(r,n);let s=Pi((e?.tickValues??gi(a.y,i,y)).map(e=>({value:e,pixel:a.y(e),label:t(e)})),22);if(s.length>1&&(s=s.filter((e,t)=>0===t||e.label+""!=s[t-1].label+"")),e?.includeMax&&s.length>0&&"exact"!==y&&!e?.tickValues){const e=a.y.domain()[1],n=a.y(e),o=s[s.length-1].pixel;if(Math.abs(n-o)>1){const r=t(e);22>Math.abs(n-o)&&s.length>1&&(s=s.slice(0,-1)),s.push({value:e,pixel:n,label:r})}}return s},[l,a,c,p,o,y]),U=_o(()=>{if(!l||!a)return[];const e=c?.find(e=>"right"===e.orient);if(!e)return[];const t=e.tickFormat||p||_i,n=Math.max(2,Math.floor(o/30)),r=e.ticks??5;return Pi((e.tickValues??gi(a.y,"exact"===y?Math.max(2,r):Math.min(r,n),y)).map(e=>({value:e,pixel:a.y(e),label:t(e)})),22)},[l,a,c,p,o,y]),K=Po(new Map),Q=Po(L?.length??0),Z=L?.length??0;Q.current!==Z&&(Q.current=Z,K.current=new Map);const J=_o(()=>{if(!L||0===L.length)return null;const e=function(e,n={}){return function(e,o,r){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{const t=wr(e,o,r);if(!t)return null;const{x:n,y:i}=t;if(!Ar(n,i,r))return null;const s="callout"===e.type?"callout-circle":e.type,a="callout-circle"===s?{radius:e.radius??12,radiusPadding:e.radiusPadding}:"callout-rect"===s?{width:e.width,height:e.height}:void 0;return Dr(rr,{noteData:{x:n,y:i,dx:e.dx??30,dy:e.dy??-30,note:{label:e.label,title:e.title,wrap:e.wrap||120},type:s,...a?{subject:a}:{},connector:e.connector||{end:"arrow"},color:e.color,disable:e.disable,opacity:e.opacity,strokeDasharray:e.strokeDasharray,className:e.className}},"ann-"+o)}case"x-threshold":{const t=br(null!=e.value?{...e,x:e.value}:e,r);if(null==t)return null;const n=e.color||"#f97316",i=e.labelPosition||"top";let s;s="bottom"===i?(r.height||0)-4:"center"===i?(r.height||0)/2:16;const a=t>.6*(r.width||0),l=a?t-4:t+4,c=a?"end":"start";return zr("g",{opacity:e.opacity,children:[Dr("line",{x1:t,y1:0,x2:t,y2:r.height||0,stroke:n,strokeWidth:e.strokeWidth||1.5,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&Dr(Wr,{x:l,y:s,text:e.label,textAnchor:c,fill:n,fontSize:12,fontWeight:"bold",background:e.labelBackground??"halo"})]},"ann-"+o)}case"y-threshold":{const t=vr(null!=e.value?{...e,y:e.value}:e,r);if(null==t)return null;const n=e.color||"#f97316",i=e.labelPosition||"right";let s,l;"left"===i?(s=4,l="start"):"center"===i?(s=(r.width||0)/2,l="middle"):(s=(r.width||0)-4,l="end");const c=20>(a=t)?Math.min((r.height||0)-4,a+16):a-4;return zr("g",{opacity:e.opacity,children:[Dr("line",{x1:0,y1:t,x2:r.width||0,y2:t,stroke:n,strokeWidth:e.strokeWidth||1.5,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&Dr(Wr,{x:s,y:c,text:e.label,textAnchor:l,fill:n,fontSize:12,fontWeight:"bold",background:e.labelBackground??"halo"})]},"ann-"+o)}case"enclose":{const t=(e.coordinates||[]).map(e=>({x:br({...e,type:"point"},r),y:vr({...e,type:"point"},r),r:1})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;const n=ir(t),i=e.padding||10;return zr("g",{children:[Dr("circle",{cx:n.x,cy:n.y,r:n.r+i,fill:e.fill||"none",fillOpacity:e.fillOpacity||.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&Dr(Wr,{x:n.x,y:n.y-n.r-i-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+o)}case"rect-enclose":{const n=(e.coordinates||[]).map(e=>({x:br({...e,type:"point"},r),y:vr({...e,type:"point"},r)})).filter(e=>null!=e.x&&null!=e.y);if(2>n.length)return null;const i=e.padding||10,s=n.map(e=>e.x),a=n.map(e=>e.y),[l,c]=t(s),[u,h]=t(a),d=l-i,f=c+i,p=u-i;return zr("g",{children:[Dr("rect",{x:d,y:p,width:f-d,height:h+i-p,fill:e.fill||"none",fillOpacity:e.fillOpacity||.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&Dr(Wr,{x:(d+f)/2,y:p-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+o)}case"highlight":{const t=r.data||[],n="function"==typeof e.filter?t.filter(e.filter):e.field&&null!=e.value?t.filter(t=>t[e.field]===e.value):[],i={stroke:e.color||"#f97316",strokeWidth:2,fill:"none"};return Dr("g",{children:n.map((t,n)=>{const o=br(t,r),s=vr(t,r);if(null==o||null==s)return null;const a="function"==typeof e.r?e.r(t):e.r||6,l="function"==typeof e.style?e.style(t):e.style||i;return Dr("circle",{cx:o,cy:s,r:a,...l},"hl-"+n)})},"ann-"+o)}case"bracket":{const t=br(e,r),n=vr(e,r);return Dr(rr,{noteData:{x:t??0,y:n??0,dx:e.dx||0,dy:e.dy||0,note:{label:e.label,title:e.title,wrap:e.wrap||120},type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth||30},color:e.color}},"ann-"+o)}case"trend":{const t=r.data||[];if(2>t.length)return null;const n=r.xAccessor||"x",i=r.yAccessor||"y",s="ordinal"===r.frameType,a="horizontal"===r.projection,l=s?n:null,c=s?i:null;let u;const h=[],d=new Map;if(s&&l&&c){for(const e of t){const t=e[l];if(null==t)continue;const n=t+"";d.has(n)||(d.set(n,h.length),h.push(n))}u=t.map(e=>{const t=e[l],n=e[c];if(null==t||null==n)return null;const o=d.get(t+"");return null!=o?[o,+n]:null}).filter(e=>null!==e)}else u=t.map(e=>[e[n],e[i]]).filter(e=>null!=e[0]&&null!=e[1]);if(2>u.length)return null;const f=r.scales?.x??r.scales?.time,p=r.scales?.y??r.scales?.value;if(!f||!p)return null;const y=e=>t=>{const n=Math.max(0,Math.floor(t)),o=Math.min(h.length-1,n+1),r=t-n,i=e(h[n]);return i+(e(h[o])-i)*r},m=f,g=p;let b;if(s)if(a){const e=y(g);b=(t,n)=>[m(n),e(t)]}else{const e=y(m);b=(t,n)=>[e(t),g(n)]}else b=(e,t)=>[m(e),g(t)];const v=e.method||"linear";let x;if("loess"===v)x=function(e,t=.3){const n=e.length;if(2>n)return e.slice();const o=e.slice().sort((e,t)=>e[0]-t[0]),r=o.map(e=>e[0]),i=o.map(e=>e[1]),s=Math.max(2,Math.ceil(t*n)),a=[];for(let e=0;n>e;e++){const t=r[e],o=r.map(e=>Math.abs(e-t)),l=o.slice().sort((e,t)=>e-t)[Math.min(s-1,n-1)]||1,c=[];for(let e=0;n>e;e++){const t=0===l?0:o[e]/l;c[e]=1>t?Math.pow(1-Math.pow(t,3),3):0}let u=0,h=0,d=0,f=0,p=0;for(let e=0;n>e;e++){const t=c[e];0!==t&&(u+=t,h+=t*r[e],d+=t*i[e],f+=t*r[e]*r[e],p+=t*r[e]*i[e])}if(0===u){a.push([t,i[e]]);continue}const y=u*f-h*h;if(1e-12>Math.abs(y))a.push([t,d/u]);else{const e=(u*p-h*d)/y;a.push([t,(d-e*h)/u+e*t])}}return a}(u,e.bandwidth??.3);else{const t="polynomial"===v?gr(u,e.order||2):function(e){const t=[0,0,0,0];let n=0;for(const[o,r]of e)null!==r&&(n++,t[0]+=o,t[1]+=r,t[2]+=o*o,t[3]+=o*r);const o=n*t[2]-t[0]*t[0],r=0===o?0:mr((n*t[3]-t[0]*t[1])/o),i=mr(t[1]/n-r*t[0]/n);return{points:e.map(([e])=>[mr(e),mr(r*e+i)]),equation:[r,i]}}(u);x=t.points}const k=x.map(([e,t])=>{const[n,o]=b(e,t);return`${n},${o}`}).join(" "),w=e.color||"#6366f1",A=x[x.length-1],[S,C]=b(A[0],A[1]);return zr("g",{children:[Dr("polyline",{points:k,fill:"none",stroke:w,strokeWidth:e.strokeWidth||2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&Dr("text",{x:S+4,y:C-4,fill:w,fontSize:11,children:e.label})]},"ann-"+o)}case"band":{const t=r.scales?.y??r.scales?.value,n=t?.(e.y0)??0,a=t?.(e.y1)??(r.height||0),l=Yn(e.fill,"ann-"+o,"var(--semiotic-primary, #6366f1)");return zr("g",{opacity:e.opacity,children:[l.def&&Dr("defs",{children:l.def}),Dr("rect",{x:0,y:Math.min(n,a),width:r.width||0,height:Math.abs(a-n),fill:l.fill,fillOpacity:e.fillOpacity||.1}),e.label&&Dr(Wr,{x:(r.width||0)-4,y:(i=n,s=a,Math.max(Math.min(i,s),0)+16),textAnchor:"end",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+o)}case"x-band":{const t=r.scales?.x??r.scales?.time,n=null!=e.x0&&t?t(e.x0):null,i=null!=e.x1&&t?t(e.x1):null;if(null==n||null==i)return null;const s=Yn(e.fill||e.color,"ann-"+o,"var(--semiotic-primary, #6366f1)");return zr("g",{opacity:e.opacity,children:[s.def&&Dr("defs",{children:s.def}),Dr("rect",{x:Math.min(n,i),y:0,width:Math.abs(i-n),height:r.height||0,fill:s.fill,fillOpacity:e.fillOpacity??.1}),e.label&&Dr(Wr,{x:Math.min(n,i)+4,y:16,textAnchor:"start",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+o)}case"envelope":{const t=r.data||[];if(2>t.length)return null;const n=r.xAccessor||"x",i=r.scales?.x??r.scales?.time,s=r.scales?.y??r.scales?.value;if(!i||!s)return null;const a=e.upperAccessor||"upperBounds",l=e.lowerAccessor||"lowerBounds",c=e.filter,u=t.filter(e=>null!=e[a]&&null!=e[l]&&!(c&&!c(e))).sort((e,t)=>e[n]-t[n]);if(2>u.length)return null;const h=Hr[r.curve||"linear"]||ar,d=sr().x(e=>i(e[n])).y0(e=>s(e[l])).y1(e=>s(e[a])).curve(h)(u);if(!d)return null;const f=e.fill||"#6366f1";return zr("g",{children:[Dr("path",{d:d,fill:f,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&u.length>0&&Dr("text",{x:i(u[u.length-1][n])+4,y:s(u[u.length-1][a])-4,fill:f,fontSize:11,children:e.label})]},"ann-"+o)}case"anomaly-band":{const t=r.data||[];if(2>t.length)return null;const n=r.yAccessor||"y",i=r.scales?.x??r.scales?.time,s=r.scales?.y??r.scales?.value;if(!i||!s)return null;const a=t.map(e=>e[n]).filter(e=>null!=e&&isFinite(e));if(2>a.length)return null;const l=a.reduce((e,t)=>e+t,0)/a.length,c=a.reduce((e,t)=>e+(t-l)**2,0)/a.length,u=Math.sqrt(c),h=e.threshold??2,d=l-h*u,f=!1!==e.showBand,p=e.fill||"#6366f1",y=e.fillOpacity??.1,m=e.anomalyColor||"#ef4444",g=e.anomalyRadius??6,b=s(l+h*u),v=s(d),x=t.filter(e=>{const t=e[n];return null!=t&&Math.abs(t-l)>h*u});return zr("g",{children:[f&&Dr("rect",{x:0,y:Math.min(b,v),width:r.width||0,height:Math.abs(v-b),fill:p,fillOpacity:y}),x.map((e,t)=>{const n=br(e,r),o=vr(e,r);return null==n||null==o?null:Dr("circle",{cx:n,cy:o,r:g,fill:m,fillOpacity:.7,stroke:m,strokeWidth:1.5},"anomaly-"+t)}),e.label&&Dr("text",{x:(r.width||0)-4,y:Math.min(b,v)-4,textAnchor:"end",fill:p,fontSize:11,children:e.label})]},"ann-"+o)}case"forecast":{const t=r.data||[];if(3>t.length)return null;const n=r.xAccessor||"x",i=r.yAccessor||"y",s=r.scales?.x??r.scales?.time,a=r.scales?.y??r.scales?.value;if(!s||!a)return null;const l=t.map(e=>[e[n],e[i]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]);if(3>l.length)return null;let c;if("polynomial"===(e.method||"linear")){const t=gr(l,e.order||2).equation;c=e=>t.reduce((t,n,o)=>t+n*Math.pow(e,o),0)}else{const e=l.length;let t=0,n=0,o=0,r=0;for(const[e,i]of l)t+=e,n+=i,o+=e*e,r+=e*i;const i=e*o-t*t;if(1e-12>Math.abs(i))return null;const s=(e*r-t*n)/i,a=(n-s*t)/e;c=e=>a+s*e}const u=l.length,h=l.map(([e,t])=>t-c(e)),d=h.reduce((e,t)=>e+t*t,0),f=Math.sqrt(d/Math.max(u-2,1)),p=l.reduce((e,t)=>e+t[0],0)/u,y=l.reduce((e,t)=>e+(t[0]-p)**2,0),m=e.confidence??.95,g=.99>m?.95>m?.9>m?1:1.645:1.96:2.576,b=e.steps??5,v=l[u-1][0],x=(v-l[0][0])/Math.max(u-1,1),k=[];for(let e=1;b>=e;e++)k.push(v+e*x);const w=[];for(const e of k){const t=c(e),n=f*Math.sqrt(1+1/u+(y>0?(e-p)**2/y:0))*g;w.push({x:e,yCenter:t,yUpper:t+n,yLower:t-n})}const A=`M${w.map(e=>`${s(e.x)},${a(e.yUpper)}`).join(" L")} L${w.slice().reverse().map(e=>`${s(e.x)},${a(e.yLower)}`).join(" L")} Z`,S=w.map(e=>`${s(e.x)},${a(e.yCenter)}`).join(" "),C=`${s(v)},${a(c(v))}`,M=e.strokeColor||"#6366f1";return zr("g",{children:[Dr("path",{d:A,fill:e.fill||"#6366f1",fillOpacity:e.fillOpacity??.15,stroke:"none"}),Dr("polyline",{points:`${C} ${S}`,fill:"none",stroke:M,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&w.length>0&&Dr("text",{x:s(w[w.length-1].x)+4,y:a(w[w.length-1].yCenter)-4,fill:M,fontSize:11,children:e.label})]},"ann-"+o)}case"widget":{let t,i;if(null!=e.px&&null!=e.py)t=e.px,i=e.py;else{const n=wr(e,o,r);if(!n)return null;t=n.x,i=n.y}if(!Ar(t,i,r))return null;const s=e.dx??0,a=e.dy??0,l=e.width??32,c=e.height??32,u=e.content??Dr("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});return Dr("foreignObject",{x:t+s-l/2,y:i+a-c/2,width:l,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:Dr("div",{...Nr(e,n),style:{width:l,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},"ann-"+o)}case"text":{const t=wr(e,o,r);if(!t)return null;const{x:n,y:i}=t,s=n+(e.dx||0),a=i+(e.dy||0),l=e.color||"var(--semiotic-text, #333)",c=Dr("text",{x:s,y:a,fill:l,fontSize:e.fontSize||11,opacity:e.opacity,strokeDasharray:e.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:e.label});return!0!==e._redundantConnector?Uo.cloneElement(c,{key:"ann-text-"+o}):zr("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[Dr("line",{x1:n,y1:i,x2:s,y2:a,stroke:l,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),Uo.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},"ann-text-"+o)}case"category-highlight":{const t=e.category;if(null==t)return null;const n=e=>"function"==typeof e&&"function"==typeof e.bandwidth,i=r.scales?.o,s=r.scales?.x,a=r.scales?.y,l=n(i)?i:n(s)?s:n(a)?a:null;if(!l)return null;const c=l(t+"");if(null==c)return null;const u=l.bandwidth(),h=e.color||"var(--semiotic-primary, #4589ff)",d=e.opacity??.15,f=e.label;return zr("g",(r.projection?"vertical"===r.projection:l===s)?{children:[Dr("rect",{x:c,y:0,width:u,height:r.height||0,fill:h,fillOpacity:d}),f&&Dr(Wr,{x:c+u/2,y:16,textAnchor:"middle",fill:h,fontSize:12,fontWeight:"bold",text:f,background:e.labelBackground??"none"})]}:{children:[Dr("rect",{x:0,y:c,width:r.width||0,height:u,fill:h,fillOpacity:d}),f&&Dr(Wr,{x:12,y:c+u/2,dominantBaseline:"middle",fill:h,fontSize:12,fontWeight:"bold",text:f,background:e.labelBackground??"none"})]},"ann-"+o)}default:return null}var i,s,a}}(0,V),r={scales:a?{x:a.x,y:a.y,time:a.x,value:a.y}:null,timeAxis:"x",xAccessor:O,yAccessor:W,width:n,height:o,data:D,frameType:"xy",pointNodes:z,curve:H,stickyPositionCache:K.current};return function(e,t,n,o){const r=[];return e.forEach((e,i)=>{let s;if(n){const r=n(e,i,o);s=null!=r?r:t(e,i,o)}else s=t(e,i,o);s&&r.push({node:s,annotation:e})}),function(e){const t=e.map((e,t)=>{return{p:e,i:t,emphasis:(n=e.annotation,"primary"===n?.emphasis||"secondary"===n?.emphasis?n.emphasis:null),confidence:Pr(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),o=e.some(e=>Mr(e.annotation)),r=e.some(e=>null!=_r(e.annotation)),i=e.some(e=>"layer"===_r(e.annotation));if(!n&&!o&&!r)return e.map(e=>e.node);const s=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);s.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,s.length)});for(const e of t)e.emphasis&&(e.rank=Cr[e.emphasis]);const a=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{const{p:t,i:n,emphasis:o,readingOrder:r}=e,i=Mr(t.annotation);let s=t.node;if("primary"===o||"secondary"===o||null!=r){const e=null==o&&null!=r;s=Sr("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":"annotation-emphasis annotation-emphasis--"+o,..."secondary"===o?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:Lr(r),"data-annotation-reading-order":r}:{},children:t.node},"annotation-emphasis-"+n)}const a=_r(t.annotation);return a&&(s=Sr("g",{className:"annotation-cohesion--"+a,children:s},"annotation-cohesion-"+n)),i&&(s=Sr("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:s},"annotation-deferred-"+n)),s});return o&&a.unshift(Sr("style",{children:".annotation-deferred{opacity:0;pointer-events:none;transition:opacity .12s ease}.stream-xy-frame:hover .annotation-deferred,.stream-ordinal-frame:hover .annotation-deferred,.stream-network-frame:hover .annotation-deferred,.stream-geo-frame:hover .annotation-deferred,.stream-xy-frame:focus-within .annotation-deferred,.stream-ordinal-frame:focus-within .annotation-deferred,.stream-network-frame:focus-within .annotation-deferred,.stream-geo-frame:focus-within .annotation-deferred{opacity:1;pointer-events:auto}@media (prefers-reduced-motion:reduce){.annotation-deferred{transition:none}}"},"annotation-disclosure-style")),i&&a.unshift(Sr("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),a}(r)}(F?ii({annotations:L,context:r,..."object"==typeof F?F:{}}):L,e,B,r)},[L,F,B,n,o,O,W,D,a,z,H,V]),ee=function(e){const t=si(e?fi:yi,e?di:mi,e?di:mi);return e?t.positions.get(e)??null:null}(j);return Lo(()=>{if(!ee?.locked||!j)return;const e=e=>{"Escape"===e.key&&hi(j)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[ee?.locked,j]),l||g||b||C||M||J&&J.length>0||m||G||ee?Ci("svg",{role:"img",width:r,height:i,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[Si("title",{children:"string"==typeof g?g:"XY Chart"}),Si("desc",{children:"string"==typeof g?g+" — XY data visualization":"XY data visualization"}),Ci("g",{transform:`translate(${s.left},${s.top})`,children:[m&&a&&(!E||$)&&(()=>{const e=ki(c?.find(e=>"bottom"===e.orient)?.gridStyle),t=ki(c?.find(e=>"left"===e.orient)?.gridStyle);return Ci("g",{className:"stream-grid",children:[X.map((t,n)=>Si("line",{x1:t.pixel,y1:0,x2:t.pixel,y2:o,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1,strokeDasharray:e},"xgrid-"+n)),q.map((e,o)=>Si("line",{x1:0,y1:e.pixel,x2:n,y2:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1,strokeDasharray:t},"ygrid-"+o))]})})(),l&&a&&(()=>{const e=c?.find(e=>"left"===e.orient),t=c?.find(e=>"bottom"===e.orient),r=!e||!1!==e.baseline,i=!t||!1!==t.baseline,a=e?.jaggedBase||!1,l=t?.jaggedBase||!1,f=t?.landmarkTicks,p=e?.landmarkTicks,y="var(--semiotic-border, #ccc)",m="var(--semiotic-text-secondary, var(--semiotic-text, #666))",g="var(--semiotic-text, #333)",b=!!t?.autoRotate&&X.length>1&&(()=>{const e=n/Math.max(X.length-1,1);return X.reduce((e,t)=>Math.max(e,"string"==typeof t.label?6.5*t.label.length:60),0)+8>e})(),v=b?12:18,x=o+(b?58:40),k={fontSize:"var(--semiotic-tick-font-size, 12px)"},w={fontSize:"calc(var(--semiotic-tick-font-size, 12px) + 1px)"},A={fontSize:"var(--semiotic-axis-label-font-size, 12px)"},S=t?.tickAnchor,C=e?.tickAnchor,M=xi(X),_=xi(q);return Ci("g",{className:"stream-axes",style:{fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[Ci("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[(!E||$)&&i&&!l&&Si("line",{x1:0,y1:o,x2:n,y2:o,stroke:y,strokeWidth:1}),(!E||$)&&l&&Si("path",{d:wi("bottom",n,o),fill:"none",stroke:y,strokeWidth:1}),X.map((e,t)=>{const n=!!f&&("function"==typeof f?f(e.value,t):bn(e.value,t>0?X[t-1].value:void 0));return Ci("g",{transform:`translate(${e.pixel},${o})`,children:[Si("line",{y2:5,stroke:y,strokeWidth:1}),"string"==typeof e.label||"number"==typeof e.label?Si("text",{y:v,textAnchor:b?"end":bi(S,e.pixel===M.min,e.pixel===M.max),fontWeight:n?600:400,fill:m,className:"semiotic-axis-tick",style:{userSelect:"none",...n?w:k},transform:b?"rotate(-45)":void 0,children:e.label}):Si("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:Si("div",{style:{textAlign:"center",userSelect:"none",...k},children:e.label})})]},"xtick-"+t)}),u&&Si("text",{x:n/2,y:x,textAnchor:"middle",fill:g,className:"semiotic-axis-label",style:{userSelect:"none",...A},children:u})]}),Ci("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[(!E||$)&&r&&!a&&Si("line",{x1:0,y1:0,x2:0,y2:o,stroke:y,strokeWidth:1}),(!E||$)&&a&&Si("path",{d:wi("left",n,o),fill:"none",stroke:y,strokeWidth:1}),q.map((e,t)=>{const n=!!p&&("function"==typeof p?p(e.value,t):bn(e.value,t>0?q[t-1].value:void 0));return Ci("g",{transform:`translate(0,${e.pixel})`,children:[Si("line",{x2:-5,stroke:y,strokeWidth:1}),"string"==typeof e.label||"number"==typeof e.label?Si("text",{x:-8,textAnchor:"end",dominantBaseline:vi(C,e.pixel===_.min,e.pixel===_.max),fontWeight:n?600:400,fill:m,className:"semiotic-axis-tick",style:{userSelect:"none",...n?w:k},children:e.label}):Si("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:Si("div",{style:{textAlign:"right",userSelect:"none",...k},children:e.label})})]},"ytick-"+t)}),(()=>{const t=e?.label||h;return t?Si("text",{x:15-s.left,y:o/2,textAnchor:"middle",fill:g,transform:`rotate(-90, ${15-s.left}, ${o/2})`,className:"semiotic-axis-label",style:{userSelect:"none",...A},children:t}):null})()]}),(()=>{const e=c?.find(e=>"right"===e.orient);if(!e||0===U.length)return null;const t=!1!==e.baseline,r=e.landmarkTicks,i=e.label||d,a=e.tickAnchor,l=xi(U);return Ci("g",{className:"semiotic-axis semiotic-axis-right","data-orient":"right",children:[t&&Si("line",{x1:n,y1:0,x2:n,y2:o,stroke:y,strokeWidth:1}),U.map((e,t)=>{const o=!!r&&("function"==typeof r?r(e.value,t):bn(e.value,t>0?U[t-1].value:void 0));return Ci("g",{transform:`translate(${n},${e.pixel})`,children:[Si("line",{x2:5,stroke:y,strokeWidth:1}),"string"==typeof e.label||"number"==typeof e.label?Si("text",{x:8,textAnchor:"start",dominantBaseline:vi(a,e.pixel===l.min,e.pixel===l.max),fontWeight:o?600:400,fill:m,className:"semiotic-axis-tick",style:{userSelect:"none",...o?w:k},children:e.label}):Si("foreignObject",{x:8,y:-12,width:60,height:24,style:{overflow:"visible"},children:Si("div",{style:{textAlign:"left",userSelect:"none",...k},children:e.label})})]},"ytick-r-"+t)}),i&&Si("text",{x:n+s.right-15,y:o/2,textAnchor:"middle",fill:g,transform:`rotate(90, ${n+s.right-15}, ${o/2})`,className:"semiotic-axis-label",style:{userSelect:"none",...A},children:i})]})})()]})})(),J,M&&a&&_&&P&&Ci(Ai,{children:[M.top&&Si("g",{transform:"translate(0, 0)",children:Si(qo,{orient:"top",config:Xo(M.top),values:_,scale:a.x,size:s.top,length:n})}),M.bottom&&Si("g",{transform:`translate(0, ${o})`,children:Si(qo,{orient:"bottom",config:Xo(M.bottom),values:_,scale:a.x,size:s.bottom,length:n})}),M.left&&Si("g",{transform:"translate(0, 0)",children:Si(qo,{orient:"left",config:Xo(M.left),values:P,scale:a.y,size:s.left,length:o})}),M.right&&Si("g",{transform:`translate(${n}, 0)`,children:Si(qo,{orient:"right",config:Xo(M.right),values:P,scale:a.y,size:s.right,length:o})})]}),C,ee&&ee.sourceId!==Y&&a?.x&&(()=>{const e=a.x(ee.xValue);if(null==e||0>e||e>n)return null;const t=ee.locked;return Si("line",{x1:e,y1:0,x2:e,y2:o,stroke:t?"white":"var(--semiotic-text-secondary, rgba(0,0,0,0.25))",strokeWidth:t?1.5:1,strokeDasharray:t?"6,3":"4,4",pointerEvents:"none"})})(),G]}),g&&"string"==typeof g?Si("text",{x:r/2,y:22,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)"},children:g}):g?Si("foreignObject",{x:0,y:0,width:r,height:s.top,children:g}):null,$o({legend:b,totalWidth:r,totalHeight:i,margin:s,legendPosition:A,title:g,legendLayout:S,legendHoverBehavior:v,legendClickBehavior:x,legendHighlightedCategory:k,legendIsolatedCategories:w})]}):null}import*as Ri from"react";import{arc as Ii}from"d3-shape";function Ti(e){return(e.tl??0)>0||(e.tr??0)>0||(e.br??0)>0||(e.bl??0)>0}import{jsx as Ni,jsxs as Fi}from"react/jsx-runtime";function Bi(e,t="#4e79a7"){return zn(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}var Oi="undefined"==typeof window||"undefined"==typeof document;import{useEffect as Wi,useLayoutEffect as Di,useRef as zi,useState as Hi,useSyncExternalStore as Ei}from"react";var $i="undefined"!=typeof window?Di:Wi,ji=()=>()=>{},Yi=()=>!1,Gi=()=>!0;import{useRef as Vi}from"react";function Xi(e,t){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const o of n){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;if(!Object.is(e[o],t[o]))return!1}return!0}function qi(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function Ui(e){if(null===e||"object"!=typeof e)return!1;if(Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}var Ki={axisStroke:"#ccc",tickText:"#666",crosshair:"rgba(0, 0, 0, 0.25)",hoverFill:"rgba(255, 255, 255, 0.3)",hoverStroke:"rgba(0, 0, 0, 0.4)",pointRing:"white",primary:"#007bff",background:""};function Qi(e,t){const n=e.trim();if(/^#[0-9a-f]{3}$/i.test(n)){const e=n[1],o=n[2],r=n[3];return`#${e}${e}${o}${o}${r}${r}${t}`}if(/^#[0-9a-f]{6}$/i.test(n))return`${n}${t}`;const o=n.match(/^rgb\s*\(\s*([^)]+?)\s*\)$/i);return o?`rgba(${o[1]}, ${(parseInt(t,16)/255).toFixed(3)})`:n}import*as Zi from"react";import*as Ji from"react";import{jsx as es}from"react/jsx-runtime";var ts=Ji.createContext(null);import{jsx as ns}from"react/jsx-runtime";var os={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function rs({hoverPoint:e}){let t="";if(e){const n=e.data||e;t="object"==typeof n?"Data point: "+Object.entries(n).filter(([,e])=>"object"!=typeof e&&"function"!=typeof e).map(([e,t])=>`${e}: ${t}`).join(", "):"Data point: "+n}return ns("div",{"aria-live":"polite","aria-atomic":"true",style:os,children:t})}function is(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[n,o]of Object.entries(e))n.startsWith("_")||null!=o&&""!==o&&("number"==typeof o?Number.isFinite(o)&&(t[n]=o):"string"==typeof o?t[n]=o:"boolean"==typeof o?t[n]=o+"":o instanceof Date&&(t[n]=o.toISOString().slice(0,10)));return t}function ss(e){return e&&"object"==typeof e?e:{}}function as(e){return ss(e.accessibility).tableFields??e.accessibleDatum??e.datum}import{jsx as ls,jsxs as cs}from"react/jsx-runtime";function us(e,t){if(!e||0===e.length)return t+", empty";const n={};for(const t of e){if(null===t?.datum)continue;const e=t.type+"";n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return t+", empty";const o=[],r={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},i=["point","line","area","rect","heatcell","circle","candlestick","wedge","arc","geoarea"],s=Object.keys(n).sort((e,t)=>{const n=i.indexOf(e),o=i.indexOf(t);return(-1===n?999:n)-(-1===o?999:o)});for(const e of s)o.push(`${n[e]} ${r[e]||e}`);return`${t}, ${o.join(", ")}`}var hs=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":t+""},ds="semiotic-accessible-data-table",fs=ds+" semiotic-accessible-data-table-hidden",ps=ds+" semiotic-accessible-data-table-visible",ys={position:"absolute",top:0,left:0,right:0,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",padding:"14px 16px 12px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontFamily:"var(--semiotic-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)",fontSize:13,lineHeight:1.5,color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",borderRadius:"var(--semiotic-border-radius, 0px) var(--semiotic-border-radius, 0px) 0 0"},ms={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},gs={position:"absolute",top:10,right:10,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",cursor:"pointer",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:13,lineHeight:1,padding:0,borderRadius:"var(--semiotic-border-radius, 4px)"},bs={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},vs={textAlign:"left",padding:"5px 10px",borderBottom:"2px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))"},xs={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},ks={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},ws={marginTop:8,padding:"4px 10px",fontSize:12,cursor:"pointer",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",borderRadius:"var(--semiotic-border-radius, 4px)",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",fontFamily:"inherit"};function As({scene:e,chartType:t,tableId:n,chartTitle:o}){const[r,i]=Zi.useState(!1),[s,a]=Zi.useState(5),l=Ji.useContext(ts),c=l?.visible??!1,u=r||c,h=Zi.useRef(null),d=o?"Data summary for "+o:n?`Data summary for ${t} ${n}`:"Data summary for "+t;Zi.useEffect(()=>{u||a(5)},[u]);const f=Zi.useCallback(e=>{e.target===e.currentTarget&&(r||c||i(!0))},[r,c]),p=Zi.useCallback(e=>{c||h.current?.contains(e.relatedTarget)||i(!1)},[c]);if(!e||0===e.length)return n?ls("span",{id:n,tabIndex:-1,style:os}):null;if(!u)return ls("div",{id:n,className:fs,tabIndex:-1,onFocus:f,style:os,role:"region","aria-label":d,children:cs("button",{type:"button",onClick:()=>i(!0),children:["View data summary (",e.length," elements)"]})});const y=function(e){const t=[];if(!Array.isArray(e))return t;const n=e.some(e=>e&&("line"===e.type||"area"===e.type));for(const o of e)if(o&&"object"==typeof o&&null!==o.datum)try{switch(o.type){case"point":if(n)break;t.push({label:"Point",values:is(as(o))});break;case"line":case"area":{const e=as(o),n=Array.isArray(e)?e:[],r="line"===o.type?"Line point":"Area point";for(const e of n)t.push({label:r,values:is(e)});break}case"rect":{const e=as(o),n=null!=e&&"object"==typeof e?e:{},r=n.category??o.group??"",i=n.value??n.__aggregateValue??n.total,s=is(n);null==s.category&&""!==r&&(s.category=r+""),null==s.value&&null!=i&&(s.value="number"==typeof i||"string"==typeof i?i:i+""),t.push({label:"Bar",values:s});break}case"heatcell":{const e=is(as(o));null==e.value&&"number"==typeof o.value&&Number.isFinite(o.value)&&(e.value=o.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=as(o),n=is(e);if(null==n.category){const t=ss(e),o=t.category??t.label;null!=o&&(n.category=o+"")}t.push({label:"Wedge",values:n});break}case"circle":t.push({label:"Node",values:is(as(o))});break;case"arc":t.push({label:"Arc",values:is(as(o))});break;case"candlestick":t.push({label:"Candlestick",values:is(as(o))});break;case"geoarea":{const e=ss(as(o)),n=is(e);if(null==n.name){const t=ss(e.properties).name??e.name;null!=t&&(n.name=t+"")}t.push({label:"Region",values:n});break}}}catch{}return t}(e),m=function(e){if(!e||0===e.length)return[];const t=new Set;for(const n of e)if(n&&n.values)for(const e of Object.keys(n.values))t.add(e);const n=[];for(const o of t){const t=[],r=new Set;for(const n of e){if(!n||!n.values)continue;const e=n.values[o];null!=e&&""!==e&&("number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)?t.push(e):"number"==typeof e||"object"!=typeof e&&"function"!=typeof e&&r.add(e+""))}if(t.length>0){let e=t[0],r=t[0],i=0;for(const n of t)e>n&&(e=n),n>r&&(r=n),i+=n;n.push({name:o,count:t.length,numeric:!0,min:e,max:r,mean:i/t.length})}else if(r.size>0){const e=Array.from(r);n.push({name:o,count:e.length,numeric:!1,uniqueValues:e.slice(0,5)})}}return n}(y),g=function(e,t){const n=[e+" data points."];for(const e of t)if(e.numeric)n.push(`${e.name}: ${hs(e.min)} to ${hs(e.max)}, mean ${hs(e.mean)}.`);else{const t=e.uniqueValues,o=t.length>3?`${t.slice(0,3).join(", ")}… (${e.count} unique)`:t.join(", ");n.push(`${e.name}: ${o}.`)}return n.join(" ")}(y.length,m),b=Math.min(s,y.length),v=y.slice(0,b),x=y.length-b,k=new Set;for(const e of v)for(const t of Object.keys(e.values))k.add(t);const w=Array.from(k);return cs("div",{ref:h,id:n,className:ps,tabIndex:-1,onBlur:p,style:ys,role:"region","aria-label":d,children:[ls("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{c&&l&&l.setVisible(!1),i(!1)},"aria-label":"Close data summary",style:gs,children:"×"}),ls("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:ms,children:g}),cs("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Sample data for "+t,style:bs,children:[ls("caption",{className:"semiotic-accessible-data-table-caption",style:ks,children:x>0?`First ${b} of ${y.length} data points`:`All ${y.length} data points`}),ls("thead",{children:cs("tr",{children:[ls("th",{style:vs,children:"type"}),w.map(e=>ls("th",{style:vs,children:e},e))]})}),ls("tbody",{children:v.map((e,t)=>cs("tr",{children:[ls("td",{style:xs,children:e.label}),w.map(t=>{return ls("td",{style:xs,children:(n=e.values[t],null==n||""===n?"—":"number"==typeof n?Number.isNaN(n)?"—":hs(n):"boolean"==typeof n?n?"true":"false":"object"==typeof n?"—":n+"")},t);var n})]},t))})]}),x>0&&cs("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>a(e=>e+25),style:ws,children:["Show ",Math.min(25,x)," more"," ",1===x?"row":"rows"," (",x," remaining)"]})]})}function Ss({summary:e}){return e?ls("div",{role:"note",style:os,children:e}):null}function Cs({tableId:e}){return ls("a",{href:"#"+e,style:os,onClick:t=>{t.preventDefault();const n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:e=>{Object.assign(e.currentTarget.style,{position:"absolute",width:"auto",height:"auto",overflow:"visible",clip:"auto",whiteSpace:"normal",padding:"4px 8px",background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:"4px",zIndex:"10",fontSize:"12px",top:"4px",left:"4px"})},onBlur:e=>{const t=e.currentTarget;t.removeAttribute("style"),Object.assign(t.style,os)},children:"Skip to data table"})}import{jsx as Ms}from"react/jsx-runtime";var _s="var(--semiotic-focus, #005fcc)";function Ps({active:e,hoverPoint:t,margin:n,size:o,shape:r="circle",width:i,height:s,pathData:a}){if(!e||!t)return null;const l=t.x+n.left,c=t.y+n.top;let u;if("geoarea"!==r&&"path"!==r||!a)if("rect"===r&&null!=i&&null!=s){const e=Math.max(i,4),t=Math.max(s,4);u=Ms("rect",{x:l-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:_s,strokeWidth:2,strokeDasharray:"4,2"})}else u=Ms("circle","wedge"===r?{cx:l,cy:c,r:12,fill:"none",stroke:_s,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:l,cy:c,r:8,fill:"none",stroke:_s,strokeWidth:2,strokeDasharray:"4,2"});else u=Ms("g",{transform:`translate(${n.left},${n.top})`,children:Ms("path",{d:a,fill:"none",stroke:_s,strokeWidth:2.5,strokeDasharray:"6,3"})});return Ms("svg",{style:{position:"absolute",left:0,top:0,width:o[0],height:o[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:u})}import*as Ls from"react";function Rs(e,t){return"touch"===t?Math.max(e,24):e}function Is(e){return Array.isArray(e)?e[0]:e}function Ts(e,t,n,o){return{data:Is(e),x:t,y:n,__semioticHoverData:!0,...o}}var Ns=["name","label","title"],Fs=["type","kind","category","group","class","status","role","shape"],Bs=["value","amount","total","count","weight","score"],Os=new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);function Ws(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}import{jsx as Ds,jsxs as zs}from"react/jsx-runtime";var Hs={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};function Es(e,t){return"function"==typeof t?t(e):e[t]}function $s(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}return e instanceof Date?e.toLocaleDateString():"object"==typeof e&&null!==e?void 0!==e.id?e.id+"":void 0!==e.name?e.name+"":JSON.stringify(e):e+""}function js(e={}){const{fields:t,title:n,format:o,style:r={},className:i=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let s;const a=[];if(n){const t=Es(e,n);s=$s(t,o)}if(t&&t.length>0)t.forEach(t=>{let n,r,i;"string"==typeof t?(n=t,r=t,i=o):(n=t.label,r=t.accessor||t.key||"",i=t.format||o);const s=Es(e,r);a.push({label:n,value:$s(s,i)})});else if(!n){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){s=$s(e[n],o);break}if(!s){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(s=$s(e[t[0]],o))}}const l={...Hs,...r};return zs("div",{className:("semiotic-tooltip "+i).trim(),style:l,children:[s&&Ds("div",{style:{fontWeight:a.length>0?"bold":"normal"},children:s}),a.map((e,t)=>zs("div",{style:{marginTop:0===t&&s?"4px":0},children:[e.label&&zs("span",{children:[e.label,": "]}),e.value]},t))]})}}function Ys(){return e=>{const t=e.allSeries;if(!t||0===t.length)return Ds("div",{className:"semiotic-tooltip",style:Hs,children:Ds("div",{children:$s(e.data?.value??e.data?.y)})});const n=e.xValue??e.data?.time??e.data?.x;return zs("div",{className:"semiotic-tooltip",style:Hs,children:[null!=n&&Ds("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:$s(n)}),t.map((e,t)=>zs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[Ds("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),Ds("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),Ds("span",{style:{fontWeight:500,fontSize:"0.85em"},children:$s(e.value)})]},t))]})}}function Gs(e){if(!0!==e){if("function"==typeof e){const t=e;return e=>{let n=Is(!0===e?.__semioticHoverData||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType)?e.data??{}:e);if(!n)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof n?.x0&&"number"==typeof n?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof n?.sankeyWidth)&&n.data&&"object"==typeof n.data&&(n=n.data),!n)return null;const o=t(n);return null==o?null:Ds("div",{className:"semiotic-tooltip",style:Hs,children:o})}}return!1!==e&&void 0!==e&&("object"==typeof e&&null!==e&&("fields"in e||"title"in e)?js(e):js())}}import{jsx as Vs}from"react/jsx-runtime";function Xs({x:e,y:t,containerWidth:n,containerHeight:o,margin:r,children:i,className:s="stream-frame-tooltip",zIndex:a=1}){const l=Number.isFinite(e)&&Number.isFinite(t),c=Ls.useRef(null),[u,h]=Ls.useState(null);Ls.useLayoutEffect(()=>{const e=c.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();Number.isFinite(t.width)&&Number.isFinite(t.height)&&h(e=>e&&.5>Math.abs(e.width-t.width)&&.5>Math.abs(e.height-t.height)?e:{width:t.width,height:t.height})};if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[s,n,o,l]);let d;d=u?`translate(${u.width+12>n-e?"calc(-100% - 12px)":"12px"}, ${u.height+12>o-t?"calc(-100% - 4px)":"4px"})`:`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${.3*o>t?"4px":"calc(-100% - 4px)"})`;const f=function(e){if(!Ls.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const n=e.props;if(!0===n["data-semiotic-tooltip-chrome"])return!0;if("true"===n["data-semiotic-tooltip-chrome"])return!0;const o=n.style;if(o&&"object"==typeof o){if(null!=o.background&&""!==o.background&&"transparent"!==o.background)return!0;if(null!=o.backgroundColor&&""!==o.backgroundColor&&"transparent"!==o.backgroundColor)return!0}return!1}(i),p=f?null:Hs;return l?Vs("div",{ref:c,className:f?s:(s+" semiotic-tooltip").trim(),style:{...p||{},position:"absolute",left:r.left+e,top:r.top+t,transform:d,pointerEvents:"none",zIndex:a,width:"max-content"},children:i}):null}import*as qs from"react";import{useCallback as Us,useEffect as Ks,useLayoutEffect as Qs,useMemo as Zs,useRef as Js}from"react";import{useState as ea,useEffect as ta}from"react";import{useRef as na,useState as oa,useEffect as ra}from"react";function ia(e,t,n){const o=na(null),[r,i]=oa(null);return ra(()=>{if(!t&&!n)return;const e=o.current;if(!e)return;const r=new ResizeObserver(e=>{for(const t of e){const{width:e,height:n}=t.contentRect;i(t=>t&&t.w===e&&t.h===n?t:{w:e,h:n})}});return r.observe(e),()=>r.disconnect()},[t,n]),[o,[t&&r?r.w:e[0],n&&r?r.h:e[1]]]}var sa=()=>"undefined"!=typeof performance?performance.now():Date.now();function aa(e,t){const n=e();return Number.isFinite(n)?n:t}var la=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??sa,this.lastWallTime=aa(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=aa(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??sa;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=aa(t,this.lastWallTime))}setRandomSource(e,t){const n=function(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:function(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}(n)))}},ca="undefined"==typeof window?Ks:Qs,ua={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)};function ha(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function da(e){const t=function(){const[e,t]=ea(()=>!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return ta(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),function(e,t){if("function"==typeof e.addEventListener)return e.addEventListener("change",t),()=>e.removeEventListener("change",t);const n=e;return n.addListener(t),()=>n.removeListener(t)}(e,e=>t(e.matches))},[]),e}(),n=Js(t);n.current=t;const[o,r]=ia(e.sizeProp,e.responsiveWidth,e.responsiveHeight),i=!!e.title,s=!!e.legend&&"top"===e.legendPosition,a=Zs(()=>function(e,t,n=!1){const o=n?t?58:34:t?36:0;return o>e.top?{...e,top:o}:e}({...e.marginDefault,...e.userMargin},i,s),[e.marginDefault,e.userMargin,i,s]),l=r[0]-a.left-a.right,c=r[1]-a.top-a.bottom,u=ha(e.foregroundGraphics,r,a),h=ha(e.backgroundGraphics,r,a),d=V(e=>e.theme),{transition:f,introEnabled:p}=function(e,t){if(!1===e)return{transition:void 0,introEnabled:!1};const n="undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;return{transition:e?!0===e?{duration:300}:{duration:e.duration??300,easing:"linear"===e.easing?"linear":"ease-out"}:t,introEnabled:!(n||!e||!0!==e&&!1===e.intro)}}(e.animate,e.transitionProp),y="semiotic-table-"+qs.useId(),m=Js(null);if(!m.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;m.current=new la({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const g=m.current;g.configure({clock:e.clock,random:e.random,seed:e.seed});const b=Js(null),v=Js(e.frameScheduler??ua);v.current=e.frameScheduler??ua;const x=Js(null),k=Js(!1),w=Js(()=>{}),A=Us(()=>{if(null!==b.current||k.current)return;const e=v.current;let t=!1,n=!1;const o=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(k.current=!0),b.current=null,x.current=null;try{w.current()}finally{e&&(k.current=!1)}});n=!0,t||(b.current=o,x.current=e)},[]),S=Us(()=>{null!==b.current&&((x.current??v.current).cancelAnimationFrame(b.current),b.current=null,x.current=null)},[]);ca(()=>{g.setPaused(!0===e.paused)},[g,e.paused]),Ks(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void g.setVisible(!0);const t=()=>g.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[g,e.suspendWhenHidden]),Ks(()=>()=>{S()},[S]);const C=Js(()=>{}),M=Js(()=>{}),_=Js(null),P=Js(null),L=Js(null),R=Us(()=>{const e=_.current;_.current=null,e&&C.current(e)},[]),I=Us(e=>{if(_.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===P.current){const e=v.current;let t=!1;const n=e.requestAnimationFrame(()=>{t=!0,P.current=null,L.current=null,R()});t||(P.current=n,L.current=e)}},[R]),T=Us(()=>{_.current=null,null!==P.current&&((L.current??v.current).cancelAnimationFrame(P.current),P.current=null,L.current=null),M.current()},[]);Ks(()=>()=>{_.current=null,null!==P.current&&((L.current??v.current).cancelAnimationFrame(P.current),P.current=null,L.current=null)},[]);const N=e.themeDirtyRef;return ca(()=>{N&&(In++,N.current=!0,A())},[d,A,N]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:o,size:r,margin:a,adjustedWidth:l,adjustedHeight:c,resolvedForeground:u,resolvedBackground:h,currentTheme:d,transition:f,introEnabled:p,tableId:y,frameRuntime:g,rafRef:b,renderFnRef:w,scheduleRender:A,cancelRender:S,hoverHandlerRef:C,hoverLeaveRef:M,onPointerMove:I,onPointerLeave:T}}import{useEffect as fa,useRef as pa}from"react";import{jsx as ya}from"react/jsx-runtime";function ma({children:e,size:t,margin:n,overflowVisible:o=!1}){return e?ya("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:o?"visible":void 0},children:ya("g",{transform:`translate(${n.left},${n.top})`,children:e})}):null}function ga(e,t,n,o){return"function"==typeof e?e({size:t,margin:n,scales:o}):e}function ba(e,t,n,o){const r=e.getContext("2d");if(!r)return null;const i=Math.round(t[0]*o),s=Math.round(t[1]*o),a=i/t[0],l=s/t[1],c=t[0]+"px",u=t[1]+"px";return e.style.width!==c&&(e.style.width=c),e.style.height!==u&&(e.style.height=u),e.width===i&&e.height===s||(e.width=i,e.height=s),r.setTransform(a,0,0,l,0,0),r.translate(n.left,n.top),r}import{useCallback as va,useRef as xa}from"react";function ka(e,t,n,o){return"string"==typeof e?{key:e,fn:null}:"function"==typeof e?{key:n,fn:e}:"string"==typeof t?{key:t,fn:null}:"function"==typeof t?{key:o,fn:t}:{key:void 0,fn:null}}var wa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Aa=3156e7;function Sa(e){const t=e[1]-e[0];return 864e5>t?e=>{const t=new Date(e);return`${(t.getUTCHours()+"").padStart(2,"0")}:${(t.getUTCMinutes()+"").padStart(2,"0")}`}:Aa>t?e=>{const t=new Date(e);return`${wa[t.getUTCMonth()]} ${t.getUTCDate()}`}:5*Aa>t?e=>{const t=new Date(e);return`${wa[t.getUTCMonth()]} ${t.getUTCFullYear()}`}:e=>new Date(e).getUTCFullYear()+""}function Ca(e){if(!e)return;const t=[];for(const n of e)if("point"===n.type)t.push(n);else if("symbol"===n.type)t.push({pointId:n.pointId,x:n.x,y:n.y,r:ht(n.size)});else if("glyph"===n.type){const e=_n(n.glyph,n.size);t.push({pointId:n.pointId,x:n.x+e.centerDx,y:n.y+e.centerDy,r:e.radius})}return t}import{line as Ma}from"d3-shape";function _a(e,t,n){let o=n;for(const n of t)"lesser"===n.thresholdType?n.value>e&&(o=n.color):e>n.value&&(o=n.color);return o}function Pa(e,t,n,o,r,i){if(2>t.length)return;const s=[0];for(let e=1;t.length>e;e++){const n=t[e][0]-t[e-1][0],o=t[e][1]-t[e-1][1];s.push(s[e-1]+Math.sqrt(n*n+o*o))}const a=s[s.length-1];if(0===a)return;const l=Math.min(.2*a,40);e.strokeStyle=n,e.lineWidth=o,e.lineCap=i;for(let n=0;t.length-1>n;n++){const o=(s[n]+s[n+1])/2;let i=r;l>o&&(i*=o/l),l>a-o&&(i*=(a-o)/l),e.globalAlpha=Math.max(0,i),e.beginPath(),e.moveTo(t[n][0],t[n][1]),e.lineTo(t[n+1][0],t[n+1][1]),e.stroke()}}var La=(e,t,n,o)=>{const r=t.filter(e=>"line"===e.type);for(const t of r){if(2>t.path.length)continue;const n=t._introClipFraction;void 0!==n&&1>n&&(e.save(),e.beginPath(),e.rect(0,0,o.width*n,o.height),e.clip());const r=t.style.stroke||"#007bff",i=Bn(e,r)||r,s=t.style.strokeWidth||2,a=t.colorThresholds,l=t.rawValues;if(e.setLineDash(t.style.strokeDasharray?t.style.strokeDasharray.split(/[\s,]+/).map(Number):[]),null!=t.style.opacity&&(e.globalAlpha=t.style.opacity),e.lineWidth=s,e.lineCap=t.style.strokeLinecap||"butt",t.style._edgeFade){Pa(e,t.path,i,s,t.style.opacity??1,t.style.strokeLinecap||"butt"),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt";continue}const c=eo(t.curve),u=a&&a.length>0&&l&&l.length===t.path.length,h=t._decayOpacities;if(h&&h.length===t.path.length&&!u){e.strokeStyle=i;const n=t.style.opacity??1;for(let o=0;t.path.length-1>o;o++)e.globalAlpha=.5*(h[o]+h[o+1])*n,e.beginPath(),e.moveTo(t.path[o][0],t.path[o][1]),e.lineTo(t.path[o+1][0],t.path[o+1][1]),e.stroke()}else if(u){let n=function(t,n,o){e.beginPath(),e.strokeStyle=t,e.moveTo(n,o),h=!0},o=function(){h&&(e.stroke(),h=!1)},r=null,s=null,c=null,u=null,h=!1;for(let h=0;t.path.length>h;h++){const[d,f]=t.path[h],p=l[h],y=_a(p,a,i);if(null!==r&&null!==u&&null!==c){if(y===u)e.lineTo(d,f);else{const t=[];for(const e of a){const n=e.value;(c>n||n>p)&&(n>c||p>n)||c===n||p===n||t.push({t:(n-c)/(p-c)})}t.sort((e,t)=>e.t-t.t);for(const l of t){const t=r+(d-r)*l.t,u=s+(f-s)*l.t,h=_a(c+(p-c)*Math.min(l.t+1e-4,1),a,i);e.lineTo(t,u),o(),n(h,t,u)}e.lineTo(d,f)}r=d,s=f,c=p,u=y}else n(y,d,f),r=d,s=f,c=p,u=y}o()}else{e.beginPath();const n=t.strokeGradient&&t.path.length>=2?oo(e,t.strokeGradient,t.path[0][0],0,t.path[t.path.length-1][0],0):null;if(e.strokeStyle=n||i,c)Ma().x(e=>e[0]).y(e=>e[1]).curve(c).context(e)(t.path);else{const[n,o]=t.path[0];e.moveTo(n,o);for(let n=1;t.path.length>n;n++)e.lineTo(t.path[n][0],t.path[n][1])}e.stroke()}if(t.style.fill&&t.style.fillOpacity&&t.style.fillOpacity>0){if(e.beginPath(),e.globalAlpha=t.style.fillOpacity,e.fillStyle=to(e,t.style.fill,t.style.fill),c&&!u)Ma().x(e=>e[0]).y(e=>e[1]).curve(c).context(e)(t.path);else{const[n,o]=t.path[0];e.moveTo(n,o);for(let n=1;t.path.length>n;n++)e.lineTo(t.path[n][0],t.path[n][1])}const n=t.path[0][0];e.lineTo(t.path[t.path.length-1][0],o.height),e.lineTo(n,o.height),e.closePath(),e.fill()}void 0!==n&&1>n&&e.restore(),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt"}};function Ra(e){return!(!e._pulseIntensity||0>=e._pulseIntensity)}function Ia(e,t,n=.3){Ra(t)&&(e.globalAlpha=t._pulseIntensity*n,e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.fillRect(t.x,t.y,t.w,t.h))}function Ta(e,t,n=.6){if(!Ra(t))return;const o=t.r+(t._pulseGlowRadius??4)*t._pulseIntensity,r=t.cx??t.x??0,i=t.cy??t.y??0;e.beginPath(),e.arc(r,i,o,0,2*Math.PI),e.strokeStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=2*t._pulseIntensity,e.globalAlpha=t._pulseIntensity*n,e.stroke()}function Na(e,t,n,o=.35){Ra(t)&&(e.globalAlpha=t._pulseIntensity*o,e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",n?e.fill(n):e.fill())}import{area as Fa,line as Ba}from"d3-shape";function Oa(e,t){const n=eo(t.curve);if(!n||2>t.topPath.length||2>t.bottomPath.length){e.beginPath(),e.moveTo(t.topPath[0][0],t.topPath[0][1]);for(let n=1;t.topPath.length>n;n++)e.lineTo(t.topPath[n][0],t.topPath[n][1]);for(let n=t.bottomPath.length-1;n>=0;n--)e.lineTo(t.bottomPath[n][0],t.bottomPath[n][1]);e.closePath()}else{const o=Fa().x(e=>e[0]).y0((e,n)=>t.bottomPath[n][1]).y1(e=>e[1]).curve(n).context(e);e.beginPath(),o(t.topPath)}}var Wa=(e,t,n,o)=>{const r=t.filter(e=>"area"===e.type);for(const t of r){if(2>t.topPath.length)continue;let n=!1;t.clipRect&&(e.save(),e.beginPath(),e.rect(t.clipRect.x,t.clipRect.y,t.clipRect.width,t.clipRect.height),e.clip(),n=!0);const r=t._introClipFraction;void 0!==r&&1>r&&(e.save(),e.beginPath(),e.rect(0,0,o.width*r,o.height),e.clip());const i=to(e,t.style.fill,"#4e79a7"),s=t._decayOpacities;if(s&&s.length===t.topPath.length){const n=t.style.fillOpacity??.7;e.fillStyle=i;for(let o=0;t.topPath.length-1>o;o++)e.globalAlpha=.5*(s[o]+s[o+1])*n,e.beginPath(),e.moveTo(t.topPath[o][0],t.topPath[o][1]),e.lineTo(t.topPath[o+1][0],t.topPath[o+1][1]),e.lineTo(t.bottomPath[o+1][0],t.bottomPath[o+1][1]),e.lineTo(t.bottomPath[o][0],t.bottomPath[o][1]),e.closePath(),e.fill();if(t.style.stroke&&"none"!==t.style.stroke){e.strokeStyle=Bn(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||2,e.setLineDash([]);for(let n=0;t.topPath.length-1>n;n++)e.globalAlpha=.5*(s[n]+s[n+1]),e.beginPath(),e.moveTo(t.topPath[n][0],t.topPath[n][1]),e.lineTo(t.topPath[n+1][0],t.topPath[n+1][1]),e.stroke()}e.globalAlpha=1;continue}const a=t.style.opacity??1;if(Oa(e,t),t.fillGradient&&("colorStops"in t.fillGradient&&t.fillGradient.colorStops.length>=2||"topOpacity"in t.fillGradient)&&t.fillGradient){let n=1/0;for(const e of t.topPath)n>e[1]&&(n=e[1]);let o=-1/0;for(const e of t.bottomPath)e[1]>o&&(o=e[1]);const r=no(e,t.fillGradient,"string"==typeof i?i:"#4e79a7",0,n,0,o);e.fillStyle=r||i,e.globalAlpha=a}else e.globalAlpha=(t.style.fillOpacity??.7)*a,e.fillStyle=i;if(e.fill(),t._pulseIntensity&&t._pulseIntensity>0&&(Oa(e,t),Na(e,t)),t.style.stroke&&"none"!==t.style.stroke){e.globalAlpha=a;const n=t.strokeGradient&&t.topPath.length>=2?oo(e,t.strokeGradient,t.topPath[0][0],0,t.topPath[t.topPath.length-1][0],0):null;e.strokeStyle=n||Bn(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||2,e.setLineDash([]);const o=eo(t.curve);if(e.beginPath(),o)Ba().x(e=>e[0]).y(e=>e[1]).curve(o).context(e)(t.topPath);else{e.moveTo(t.topPath[0][0],t.topPath[0][1]);for(let n=1;t.topPath.length>n;n++)e.lineTo(t.topPath[n][0],t.topPath[n][1])}e.stroke()}void 0!==r&&1>r&&e.restore(),n&&e.restore(),e.globalAlpha=1}},Da=(e,t,n,o)=>{const r=t.filter(e=>"point"===e.type);if(0!==r.length){e.save();try{const t=e.globalAlpha;for(const n of r)e.beginPath(),e.arc(n.x,n.y,n.r,0,2*Math.PI),e.globalAlpha=t*(n.style.opacity??n.style.fillOpacity??1),e.fillStyle=to(e,n.style.fill,"#4e79a7"),e.fill(),n.style.stroke&&(e.strokeStyle=to(e,n.style.stroke,n.style.stroke),e.lineWidth=n.style.strokeWidth||1,e.stroke()),Ta(e,n)}finally{e.restore()}}},za=new Map;function Ha(e){try{if(e.path)return new Path2D(e.path);const t=`${e.symbolType??"circle"}:${Math.round(e.size)}`;let n=za.get(t);return n||(n=new Path2D(ut(e.symbolType,e.size)),za.size>256&&za.clear(),za.set(t,n)),n}catch{return null}}var Ea=(e,t)=>{const n=e.globalAlpha;for(const o of t){if("symbol"!==o.type)continue;const t=o;if(0>=t.size)continue;const r=Ha(t);if(!r)continue;e.save(),e.translate(t.x,t.y),t.rotation&&e.rotate(t.rotation);const i=(t.style.opacity??1)*(t._decayOpacity??1);t.style.fill&&(e.globalAlpha=n*i*(t.style.fillOpacity??1),e.fillStyle=to(e,t.style.fill,"#4e79a7"),e.fill(r)),t.style.stroke&&"none"!==t.style.stroke&&(e.globalAlpha=n*i,e.strokeStyle=to(e,t.style.stroke,t.style.stroke),e.lineWidth=t.style.strokeWidth??1,e.stroke(r)),e.restore()}e.globalAlpha=n};function $a(e,t,n,o,r){if(0>=t.size)return;const i=t.glyph;if(!i||!i.parts?.length)return;const s=kn(i,t.size);if(0>=s.scale)return;const a=(t.style.opacity??1)*(t._decayOpacity??1);if(0>=a)return;const l=t=>{const n=to(e,t,t);return"string"==typeof n?n:t},c=t.color??("string"==typeof t.style.fill?t.style.fill:void 0);e.save(),e.translate(n,o),t.rotation&&e.rotate(t.rotation),e.translate(s.offsetX,s.offsetY),e.scale(s.scale,s.scale),e.globalAlpha=r*a*(t.style.fillOpacity??1);const u=Mn(i,t.fraction??1,t.fractionStart??0,t.fractionDirection??"horizontal");u&&t.ghostColor&&Pn(e,i,c,t.accent,t.ghostColor,l),u&&(e.beginPath(),e.rect(u.x,u.y,u.width,u.height),e.clip()),Pn(e,i,c,t.accent,void 0,l),e.restore()}function ja(e,t){const{x:n,y:o,w:r,h:i}=t,{tl:s,tr:a,br:l,bl:c}=function(e){const t=e.cornerRadii;if(!t)return{tl:0,tr:0,br:0,bl:0};const n=Math.min(e.w,e.h)/2,o=e=>Math.max(0,Math.min(e??0,n));return{tl:o(t.tl),tr:o(t.tr),br:o(t.br),bl:o(t.bl)}}(t);e.beginPath(),e.moveTo(n+s,o),e.lineTo(n+r-a,o),a>0&&e.arcTo(n+r,o,n+r,o+a,a),e.lineTo(n+r,o+i-l),l>0&&e.arcTo(n+r,o+i,n+r-l,o+i,l),e.lineTo(n+c,o+i),c>0&&e.arcTo(n,o+i,n,o+i-c,c),e.lineTo(n,o+s),s>0&&e.arcTo(n,o,n+s,o,s),e.closePath()}function Ya(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}}}var Ga=(e,t,n,o)=>{const r=t.filter(e=>"rect"===e.type);for(const t of r){if(null!=t.style.opacity&&(e.globalAlpha=t.style.opacity),t.style.icon)Va(e,t);else if(t.cornerRadii&&Ti(t.cornerRadii)){const n=to(e,t.style.fill,Bn(e,"var(--semiotic-primary, #007bff)")),o=Ya(t),r=t.fillGradient&&"string"==typeof n?no(e,t.fillGradient,n,o.x0,o.y0,o.x1,o.y1):null;e.fillStyle=r||n,ja(e,t),e.fill(),t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=Bn(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke())}else if(t.roundedTop&&t.roundedTop>0){const n=to(e,t.style.fill,Bn(e,"var(--semiotic-primary, #007bff)")),o=Ya(t),r=t.fillGradient&&"string"==typeof n?no(e,t.fillGradient,n,o.x0,o.y0,o.x1,o.y1):null;e.fillStyle=r||n;const i=Math.min(t.roundedTop,t.w/2,t.h/2);e.beginPath();const{x:s,y:a,w:l,h:c}=t;switch(t.roundedEdge){case"right":e.moveTo(s,a),e.lineTo(s+l-i,a),e.arcTo(s+l,a,s+l,a+i,i),e.lineTo(s+l,a+c-i),e.arcTo(s+l,a+c,s+l-i,a+c,i),e.lineTo(s,a+c);break;case"left":e.moveTo(s+l,a),e.lineTo(s+i,a),e.arcTo(s,a,s,a+i,i),e.lineTo(s,a+c-i),e.arcTo(s,a+c,s+i,a+c,i),e.lineTo(s+l,a+c);break;case"bottom":e.moveTo(s,a),e.lineTo(s+l,a),e.lineTo(s+l,a+c-i),e.arcTo(s+l,a+c,s+l-i,a+c,i),e.lineTo(s+i,a+c),e.arcTo(s,a+c,s,a+c-i,i);break;default:e.moveTo(s,a+c),e.lineTo(s,a+i),e.arcTo(s,a,s+i,a,i),e.lineTo(s+l-i,a),e.arcTo(s+l,a,s+l,a+i,i),e.lineTo(s+l,a+c)}e.closePath(),e.fill(),t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=Bn(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke())}else{const n=to(e,t.style.fill,Bn(e,"var(--semiotic-primary, #007bff)")),o=Ya(t),r=t.fillGradient&&"string"==typeof n?no(e,t.fillGradient,n,o.x0,o.y0,o.x1,o.y1):null;e.fillStyle=r||n,e.fillRect(t.x,t.y,t.w,t.h),t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=Bn(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.strokeRect(t.x,t.y,t.w,t.h))}Ia(e,t),e.globalAlpha=1}};function Va(e,t){const n=t.style.icon,o=t.style.iconPadding||2,r=Math.min(t.w,t.h)-o;if(0>=r)return;const i=t.h>t.w;if(e.save(),e.beginPath(),e.rect(t.x,t.y,t.w,t.h),e.clip(),i){const i=r+o,s=t.x+(t.w-r)/2;for(let o=t.y+t.h-r;o>=t.y-r;o-=i)e.drawImage(n,s,o,r,r)}else{const i=r+o,s=t.y+(t.h-r)/2;for(let o=t.x;t.x+t.w>o;o+=i)e.drawImage(n,o,s,r,r)}e.restore()}function Xa(e){const[t,n,o]=function(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}const t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}(e);return.299*t+.587*n+.114*o>128?"#000":"#fff"}function qa(e){return Number.isInteger(e)?e+"":100>Math.abs(e)?1>Math.abs(e)?e.toPrecision(3):e.toFixed(1):e.toFixed(0)}var Ua=(e,t,n,o)=>{const r=t.filter(e=>"heatcell"===e.type);e.save();try{for(const t of r){const n=t.style;if(null!=n?.opacity&&(e.globalAlpha=n.opacity),e.fillStyle=t.fill,e.fillRect(t.x,t.y,t.w,t.h),e.strokeStyle=Bn(e,"var(--semiotic-surface, #fff)"),e.lineWidth=1,e.strokeRect(t.x,t.y,t.w,t.h),Ia(e,t),e.globalAlpha=1,t.showValues&&null!=t.value){if(20>t.w||20>t.h)continue;const n=t.valueFormat?t.valueFormat(t.value):qa(t.value),o=Math.max(10,Math.min(16,.3*Math.min(t.w,t.h))),r=t.x+t.w/2,i=t.y+t.h/2;e.fillStyle=Xa(t.fill),e.font=o+"px sans-serif",e.textAlign="center",e.textBaseline="middle",e.fillText(n,r,i)}}}finally{e.restore()}},Ka=(e,t,n,o)=>{for(const n of t){if("candlestick"!==n.type)continue;const t=n;e.save();const r=(t._decayOpacity??1)*(t.style?.opacity??1);1!==r&&(e.globalAlpha=r);const i=Bn(e,t.wickColor)||t.wickColor,s=60>o.height,a=s?Math.max(t.wickWidth,2):t.wickWidth,l=()=>{e.beginPath(),e.moveTo(t.x,t.highY),e.lineTo(t.x,t.lowY),e.strokeStyle=i,e.lineWidth=a,e.stroke()};if(s||l(),t.isRange){const n=Math.max(2,Math.min(t.bodyWidth/2,.12*o.height));e.fillStyle=i,e.beginPath(),e.arc(t.x,t.highY,n,0,2*Math.PI),e.fill(),e.beginPath(),e.arc(t.x,t.lowY,n,0,2*Math.PI),e.fill()}else if(t.bodyWidth>0){const n=Math.min(t.openY,t.closeY),o=Math.abs(t.openY-t.closeY),r=t.isUp?t.upColor:t.downColor,i=Bn(e,r)||r;e.fillStyle=i,e.fillRect(t.x-t.bodyWidth/2,n,t.bodyWidth,Math.max(o,1)),e.strokeStyle=i,e.lineWidth=1,e.strokeRect(t.x-t.bodyWidth/2,n,t.bodyWidth,Math.max(o,1))}s&&l(),e.restore()}},Qa={line:[Wa,La,Da],area:[Wa,Da],stackedarea:[Wa,Da],scatter:[Da,Ea],bubble:[Da,Ea],heatmap:[Ua],bar:[Ga],swarm:[Da],waterfall:[(e,t,n,o)=>{Ga(e,t);const r=t.filter(e=>"rect"===e.type);if(2>r.length)return;const i=r[0].datum,s=i?._connectorStroke;if(s){e.save(),e.strokeStyle=Bn(e,s)||s,e.lineWidth=i?._connectorWidth??1,e.setLineDash([]);for(let t=0;r.length-1>t;t++){const o=r[t],i=r[t+1],s=o.datum,a=i.datum;if(null==s?.cumEnd||null==a?.baseline)continue;const l=n.y(s.cumEnd),c=o.x+o.w,u=i.x;e.beginPath(),e.moveTo(c,l),e.lineTo(u,l),e.stroke()}e.restore()}}],candlestick:[Ka],mixed:[Wa,La,Da],custom:[Wa,Ga,Ua,La,Da,Ea,(e,t)=>{const n=e.globalAlpha;for(const o of t)"glyph"===o.type&&$a(e,o,o.x,o.y,n);e.globalAlpha=n},Ka]},Za=new Set;function Ja(e,t){const n="function"==typeof e?e(t.datum??null,t):e;return(o=n)&&"object"==typeof o&&"string"==typeof o.id&&"function"==typeof o.cacheKey&&"function"==typeof o.drawCanvas&&"function"==typeof o.renderStaticSVG?n:void 0;var o}function el(e,t){if("undefined"!=typeof process&&"production"===process.env?.NODE_ENV)return;const n=`${e}:${t}`;Za.has(n)||(Za.add(n),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}import{jsx as tl,jsxs as nl}from"react/jsx-runtime";function ol(e){return"string"==typeof e?e:"value"}function rl(e){return null==e?"–":"number"==typeof e?Math.abs(e)>9999?e.toLocaleString():e+"":e instanceof Date?e.toLocaleDateString():e+""}function il(e,t){if(!t)return rl(e);try{const n=t(e);return null==n?rl(e):n}catch{return rl(e)}}function sl(e,t){return"function"==typeof t?t(e):e[t]}function al(e,t){if(!e)return[];const n=[];return(Array.isArray(e)?e:[e]).forEach((e,o)=>{const r="string"==typeof e?.y0Accessor?e.y0Accessor:"low",i="string"==typeof e?.y1Accessor?e.y1Accessor:"high";n.push({label:r,accessor:e=>e.bands?.[o]?.y0??(0===o?e.band?.y0:void 0),format:t}),n.push({label:i,accessor:e=>e.bands?.[o]?.y1??(0===o?e.band?.y1:void 0),format:t})}),n}function ll(e){const t=e.find(e=>"title"===e.role),n=e.filter(e=>"title"!==e.role);return e=>{const o=e.data;if(!o)return null;const r=t?il(sl(o,t.accessor),t.format):null;return nl("div",{className:"semiotic-tooltip",style:Hs,children:[null!=r&&tl("div",{style:{fontWeight:"bold",marginBottom:n.length>0?4:0},children:r}),n.map((e,t)=>{const n=il(sl(o,e.accessor),e.format);return nl("div",{style:t>0?{marginTop:2}:void 0,children:[nl("span",{style:{opacity:.7},children:[e.label,": "]}),tl("span",{children:n})]},t)})]})}}import{jsx as cl,jsxs as ul}from"react/jsx-runtime";function hl(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function dl({hover:e}){const t=e.data??{},n=t.y??t.value,o=t.x??t.time;if(void 0===n&&void 0===o){const e=function(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const n=t.maxEntries??6,o=!1!==t.skipPositional,r=[];for(const[t,n]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;if(o&&Os.has(t.toLowerCase()))continue;if(null==n)continue;const e=typeof n;("string"===e||"number"===e||"boolean"===e||n instanceof Date)&&r.push({key:t,lower:t.toLowerCase(),value:n})}if(0===r.length)return{entries:[]};let i=r.findIndex(e=>Ns.includes(e.lower));const s=i>=0;0>i&&(i=r.findIndex(e=>"id"===e.lower)),0>i&&(i=r.findIndex(e=>"string"==typeof e.value));const a=0>i?void 0:r[i];let l=r.filter((e,t)=>t!==i);s&&(l=l.filter(e=>"id"!==e.lower));const c=Ws(l,Fs),u=Ws(l,Bs),h=new Set(Fs),d=new Set(Bs),f=[];c&&f.push({key:c.key,value:c.value}),u&&f.push({key:u.key,value:u.value});for(const e of l){if(f.length>=n)break;e!==c&&e!==u&&(h.has(e.lower)||d.has(e.lower)||f.push({key:e.key,value:e.value}))}return{titleKey:a?.key,title:a?.value,entries:f}}(t);if(null!=e.title||e.entries.length>0)return ul("div",{className:"semiotic-tooltip",style:Hs,children:[null!=e.title&&cl("div",{style:{fontWeight:600,marginBottom:e.entries.length?2:0},children:e.title+""}),e.entries.map(e=>ul("div",{style:{opacity:.7,fontSize:11},children:[e.key,":"," ",cl("span",{style:{fontWeight:600},children:hl(e.value)})]},e.key))]})}return ul("div",{className:"semiotic-tooltip",style:Hs,children:[cl("div",{style:{fontWeight:600,marginBottom:2},children:hl(n)}),cl("div",{style:{opacity:.7,fontSize:11},children:hl(o)})]})}function fl(e){const{onObservation:t,datum:n,x:o=0,y:r=0,chartType:i,chartId:s,context:a,timestamp:l=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:o,y:r,timestamp:l,chartType:i,chartId:s}),"focus"===a?.type&&t({type:"focus",datum:n,inputType:"touch"===a.inputType?"pointer":a.inputType,timestamp:l,chartType:i,chartId:s})):t({type:"hover-end",timestamp:l,chartType:i,chartId:s}))}function pl(e){const{onObservation:t,datum:n,x:o=0,y:r=0,chartType:i,chartId:s,context:a,timestamp:l=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:o,y:r,timestamp:l,chartType:i,chartId:s}),"activate"===a?.type&&t({type:"activate",datum:n,inputType:a.inputType,timestamp:l,chartType:i,chartId:s})):t({type:"click-end",timestamp:l,chartType:i,chartId:s}))}dl.ownsChrome=!0;import{useCallback as yl}from"react";import{useCallback as ml,useRef as gl}from"react";function bl(e,t,n){const o=e.byGroup.get(t);let r=0,i=Math.abs(o[0].x-n.x);for(let e=1;o.length>e;e++){const t=Math.abs(o[e].x-n.x);i>t&&(i=t,r=e)}return o[r]._flatIndex}function vl(e){const t=[];for(const n of e)switch(n.type){case"point":t.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});break;case"symbol":if(0>=n.size)break;t.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});break;case"glyph":{if(0>=n.size||null==n.datum)break;const e=_n(n.glyph,n.size);t.push({x:n.x+e.centerDx,y:n.y+e.centerDy,datum:n.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"});break}case"line":{const e=n,o=Array.isArray(e.datum)?e.datum:[],r=e.group??"_default";for(let n=0;e.path.length>n&&o.length>n;n++)t.push({x:e.path[n][0],y:e.path[n][1],datum:o[n],shape:"circle",group:r});break}case"area":{const e=n,o=Array.isArray(e.datum)?e.datum:[],r=e.group??"_default";for(let n=0;e.topPath.length>n&&o.length>n;n++)t.push({x:e.topPath[n][0],y:e.topPath[n][1],datum:o[n],shape:"circle",group:r});break}case"rect":t.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:n.group??"_default"});break;case"heatcell":t.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}import{jsx as xl,jsxs as kl}from"react/jsx-runtime";var wl={top:20,right:20,bottom:30,left:40},Al=Ki;function Sl(e){if(e)return"x"===e.dimension?"pan-y":"y"===e.dimension?"pan-x":"none"}var Cl=h(u(function(e,t){const{chartType:u,runtimeMode:h,data:d,chunkThreshold:f,chunkSize:p,xAccessor:y,yAccessor:m,accessorRevision:g,colorAccessor:b,sizeAccessor:v,symbolAccessor:x,symbolMap:k,groupAccessor:w,lineDataAccessor:A,curve:S,normalize:M,baseline:L,stackOrder:R,binSize:I,valueAccessor:T,arrowOfTime:N="right",windowMode:F="sliding",windowSize:B=200,timeAccessor:O,xExtent:W,yExtent:z,extentPadding:H=.1,scalePadding:E,sizeRange:$,size:j=[500,300],responsiveWidth:Y,responsiveHeight:G,margin:V,className:X,background:q,renderMode:U,lineStyle:K,pointStyle:Q,areaStyle:Z,barStyle:J,waterfallStyle:ee,swarmStyle:te,barColors:ne,colorScheme:oe,boundsAccessor:re,boundsStyle:ie,y0Accessor:se,band:ae,gradientFill:le,lineGradient:ce,areaGroups:ue,openAccessor:he,highAccessor:de,lowAccessor:fe,closeAccessor:pe,candlestickStyle:ye,showAxes:me=!0,axes:ge,xLabel:be,yLabel:ve,yLabelRight:xe,xFormat:ke,yFormat:we,axisExtent:Ae,tickFormatTime:Se,tickFormatValue:Ce,hoverAnnotation:Me,tooltipContent:_e,customHoverBehavior:Pe,customClickBehavior:Le,onObservation:Re,annotationObservationCallback:Ie,chartId:Te,enableHover:Ne,hoverRadius:Fe=30,tooltipMode:Be,annotations:Oe,onAnnotationActivate:We,autoPlaceAnnotations:De,svgAnnotationRules:ze,showGrid:He,legend:Ee,legendHoverBehavior:$e,legendClickBehavior:je,legendHighlightedCategory:Ye,legendIsolatedCategories:Ge,legendPosition:Ve,legendLayout:Xe,legendCategoryAccessor:qe,onCategoriesChange:Ke,backgroundGraphics:Qe,foregroundGraphics:Ze,canvasPreRenderers:Je,svgPreRenderers:et,title:tt,categoryAccessor:nt,brush:ot,onBrush:rt,decay:it,pulse:st,transition:at,animate:lt,staleness:ct,frameScheduler:ht,clock:dt,random:ft,seed:pt,paused:yt=!1,suspendWhenHidden:mt=!0,heatmapAggregation:gt,heatmapXBins:bt,heatmapYBins:vt,showValues:xt,heatmapValueFormat:kt,marginalGraphics:wt,pointIdAccessor:At,xScaleType:St,yScaleType:Ct,accessibleTable:Mt=!0,description:_t,summary:Pt,linkedCrosshairName:Lt,linkedCrosshairSourceId:Rt,customLayout:It,onLayoutError:Tt,layoutConfig:Nt,layoutSelection:Ft}=e,{customHoverBehavior:Bt,customClickBehavior:Ot,hasClickBehavior:Wt}=function({customHoverBehavior:e,customClickBehavior:t,onObservation:n,chartId:o,chartType:r}){return{customHoverBehavior:yl((t,i)=>{e?.(t,i),fl({onObservation:n,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:r,chartId:o,context:i})},[o,r,e,n]),customClickBehavior:yl((e,i)=>{t?.(e,i),pl({onObservation:n,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:r,chartId:o,context:i})},[o,r,t,n]),hasClickBehavior:!(!t&&!n)}}({customHoverBehavior:Pe,customClickBehavior:Le,onObservation:Re,chartId:Te,chartType:"StreamXYFrame"}),Dt=c().replace(/:/g,""),zt=o(!1),Ht=o({w:-1,h:-1}),Et=o(!1),$t=da({sizeProp:j,responsiveWidth:Y,responsiveHeight:G,userMargin:V,marginDefault:wl,title:tt,legend:Ee,legendPosition:Ve,animate:lt,transitionProp:at,frameScheduler:ht,clock:dt,random:ft,seed:pt,paused:yt,suspendWhenHidden:mt,themeDirtyRef:zt}),jt=function(){const[e,t]=Hi(!1);return $i(()=>{t(!0)},[]),e}(),Yt=function(){const e=Ei(ji,Yi,Gi);return zi(e).current}(),{reducedMotionRef:Gt,responsiveRef:Xt,size:qt,currentTheme:Kt,transition:Qt,introEnabled:Zt,tableId:Jt,rafRef:en,renderFnRef:on,scheduleRender:sn,frameRuntime:an}=$t;let ln=$t.margin;if(wt){const e=60,t={...$t.margin};wt.top&&e>t.top&&(t.top=e),wt.bottom&&e>t.bottom&&(t.bottom=e),wt.left&&e>t.left&&(t.left=e),wt.right&&e>t.right&&(t.right=e),ln=t}const cn=qt[0]-ln.left-ln.right,un=qt[1]-ln.top-ln.bottom,hn=s(()=>_(d),[d]),yn=Me??Ne,[mn,gn]=r(0),bn=o(0),[vn,xn]=r(null),wn=ga(Ze,qt,ln,vn),Sn=ga(Qe,qt,ln,vn),Cn=o(null),_n=o(null),Pn=o(void 0),[Ln,Rn]=r(null),Tn=o(Al.primary),Nn=o(function(){let e=-1,t=Ki;return{resolve(n){if(!n)return Ki;const o=In;return o===e||(t=function(e){if(!e)return Ki;const t=getComputedStyle(e),n=t.getPropertyValue("--semiotic-border").trim(),o=t.getPropertyValue("--semiotic-text-secondary").trim(),r=t.getPropertyValue("--semiotic-bg").trim(),i=t.getPropertyValue("--semiotic-primary").trim(),s=o||t.getPropertyValue("--text-secondary").trim(),a=t.getPropertyValue("--text-primary").trim(),l=n||t.getPropertyValue("--surface-3").trim(),c=r||t.getPropertyValue("--surface-0").trim();return s||a||n||i?{axisStroke:l||Ki.axisStroke,tickText:s||Ki.tickText,crosshair:s?Qi(s,"66"):Ki.crosshair,hoverFill:c?Qi(c,"4D"):Ki.hoverFill,hoverStroke:s?Qi(s,"99"):Ki.hoverStroke,pointRing:c||Ki.pointRing,primary:i||Ki.primary,background:c||Ki.background}:Ki}(n),e=o),t},invalidate(){e=-1}}}()),Fn=o(!1),On=Ut(new tn("StreamXYFrame")),[Wn,Dn]=r(!1),[Hn,En]=r([]),[$n,Yn]=r([]),Gn="streaming"===h||["bar","swarm","waterfall"].includes(u),Vn=function(e){const t=Vi(e);return function(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return qi(e,t);if(!Ui(e)||!Ui(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const o of n){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;const n=e[o],r=t[o];if(!Object.is(n,r))if(Array.isArray(n)&&Array.isArray(r)){if(!qi(n,r))return!1}else{if(!Ui(n)||!Ui(r))return!1;if(!Xi(n,r))return!1}}return!0}(t.current,e)||(t.current=e),t.current}(s(()=>({chartType:u,runtimeMode:Gn?"streaming":"bounded",windowSize:B,windowMode:F,arrowOfTime:Gn?N:"right",extentPadding:H,scalePadding:E,axisExtent:Ae,xAccessor:y,yAccessor:m,accessorRevision:g,timeAccessor:Gn?O:void 0,valueAccessor:T,colorAccessor:b,sizeAccessor:v,symbolAccessor:x,symbolMap:k,groupAccessor:w||(A?"_lineGroup":void 0),categoryAccessor:nt,lineDataAccessor:A,xScaleType:St,yScaleType:Ct,xExtent:W,yExtent:z,sizeRange:$,binSize:I,normalize:M,baseline:L,stackOrder:R,boundsAccessor:re,boundsStyle:ie,y0Accessor:se,band:ae,gradientFill:!0===le?{topOpacity:.8,bottomOpacity:.05}:!1===le?void 0:le,areaGroups:ue?new Set(ue):void 0,lineGradient:ce,openAccessor:he,highAccessor:de,lowAccessor:fe,closeAccessor:pe,candlestickStyle:ye,lineStyle:K,pointStyle:Q,areaStyle:Z,swarmStyle:te,waterfallStyle:ee,colorScheme:oe,barColors:ne,barStyle:J,annotations:Oe,decay:it,pulse:st,transition:Qt,introAnimation:Zt,staleness:ct,clock:an.now,heatmapAggregation:gt,heatmapXBins:bt,heatmapYBins:vt,showValues:xt,heatmapValueFormat:kt,pointIdAccessor:At,curve:S,themeCategorical:Kt?.colors?.categorical,themeSemantic:D(Kt),themeSequential:Kt?.colors?.sequential,themeDiverging:Kt?.colors?.diverging,customLayout:It,onLayoutError:Tt,layoutConfig:Nt,layoutMargin:ln}),[u,Gn,B,F,N,H,E,Ae,y,m,g,O,T,b,v,x,k,w,A,nt,St,Ct,W,z,$,I,M,L,R,re,ie,se,ae,le,ue,ce,he,de,fe,pe,ye,K,Q,Z,te,ee,oe,ne,J,Oe,it,st,Qt,Zt,ct,an.now,gt,bt,vt,xt,kt,At,S,Kt,It,Tt,Nt,ln])),Xn=o(null);Xn.current||(Xn.current=new Vt(Vn));const qn=function(e,t,n,o){const r=xa({accessor:t,onChange:n,readData:o}),i=xa([]);return r.current={accessor:t,onChange:n,readData:o},va(()=>{const{accessor:t,onChange:n,readData:o}=r.current;if(!n||!t)return;const s=function(e,t){if(!t)return[];const n=new Set,o=[];for(const r of e){if(!r||"object"!=typeof r)continue;const e="function"==typeof t?t(r):r[t];if(null==e)continue;const i=e+"";n.has(i)||(n.add(i),o.push(i))}return o}(e.current?o(e.current):[],t);(function(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0})(s,i.current)||(i.current=s,n(s))},[e])}(Xn,qe,Ke,e=>e.getData());!function(e,t,n,o){fn(()=>{e.current?.updateConfig(t),n.current=!0,o()},[t,o,e,n])}(Xn,Vn,zt,sn),function(e,t,n,o){const r=pn(null);fn(()=>{const i=e.current;if(!i)return;const s=t??null;r.current!==s&&(r.current=s,i.setLayoutSelection(s),i.hasCustomRestyle?i.restyleScene(s):n.current=!0,o())},[t,o,e,n])}(Xn,Ft,zt,sn);const Un=o(null);Un.current||(Un.current=new P(e=>{const t=Xn.current;t&&t.ingest(e)&&(zt.current=!0,sn())},{chunkThreshold:f,chunkSize:p})),i(()=>{Un.current?.updateChunkOptions({chunkThreshold:f,chunkSize:p})},[f,p]);const Kn=a(e=>{Un.current?.push(e)},[]),Qn=a(e=>{Un.current?.pushMany(e)},[]),Zn=a(()=>{Un.current?.clear(),Xn.current?.clear(),zt.current=!0,sn()},[sn]);l(t,()=>({push:Kn,pushMany:Qn,remove:e=>{Un.current?.flush();const t=Xn.current?.remove(e)??[];return t.length>0&&(Cn.current&&t.some(e=>e===Cn.current?.data)&&(Cn.current=null,Rn(null)),zt.current=!0,sn()),t},update:(e,t)=>{Un.current?.flush();const n=Xn.current?.update(e,t)??[];return n.length>0&&(zt.current=!0,sn()),n},clear:Zn,getData:()=>(Un.current?.flush(),Xn.current?.getData()??[]),getScales:()=>Xn.current?.scales??null,getExtents:()=>Xn.current?.getExtents()??null,getCustomLayout:()=>Xn.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>Xn.current?.lastCustomLayoutFailure??null}),[Kn,Qn,Zn,sn]),i(()=>{if(d){if(A&&hn.length>0&&"object"==typeof hn[0]&&null!==hn[0]){const e="string"==typeof A?A:"coordinates";if(Array.isArray(hn[0][e])){const t=[];for(const n of hn){const o=n[e];if(Array.isArray(o)){const e=n.label||n.id||n.key;if(null!=e)for(const n of o)t.push({...n,_lineGroup:e});else for(const e of o)t.push(e)}}return void Un.current?.setBoundedData(t)}}Un.current?.setBoundedData(hn)}},[d,hn,A]);const{canvasRef:Jn,interactionCanvasRef:eo}=function(e,t){return function(e){const{cancelRender:t,dirtyRef:n,frameRuntime:o,manageFrameRuntime:r,scheduleRender:i}=e,s=pa(null),a=pa(null),l=pa(!1);return function(e){const{hydrated:t,wasHydratingFromSSR:n,storeRef:o,dirtyRef:r,renderFnRef:i,cancelRender:s,cleanup:a}=e;$i(()=>{t&&n&&o.current?.cancelIntroAnimation?.(),r.current=!0,s?.(),i.current()},[t,n]);const l=zi(a);l.current=a,Wi(()=>()=>l.current?.(),[])}({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),fa(()=>{if(!1!==r)return o.subscribe(()=>{o.isActive?(n.current=!0,i()):t()})},[t,n,o,r,i]),fa(()=>{!l.current&&(l.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),{canvasRef:s,interactionCanvasRef:a}}({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}($t,{storeRef:Xn,dirtyRef:zt,hydrated:jt,wasHydratingFromSSR:Yt,cleanup:()=>Un.current?.clear(),canvasPaintDependencies:[u,cn,un,me,q,Qe,K,U,Je,sn]}),{hoverHandlerRef:to,hoverLeaveRef:no,onPointerMove:oo,onPointerLeave:ro}=$t;to.current=e=>{if(!yn)return;const t=Jn.current;if(!t)return;const n=t.getBoundingClientRect(),o=e.clientX-n.left-ln.left,r=e.clientY-n.top-ln.top;if(0>o||o>cn||0>r||r>un)return void(Cn.current&&(Cn.current=null,_n.current=null,Rn(null),Bt&&(Bt(null),zt.current=!0),sn()));const i=Xn.current;if(!i||0===i.scene.length)return;const s=Rs(Fe,e.pointerType),a=ao(i.scene,o,r,s,i.quadtree,i.maxPointRadius),l="multi"===Be,c=()=>{Cn.current&&(Cn.current=null,_n.current=null,Rn(null),Bt&&Bt(null),sn())};if(!a&&!l)return void c();const h=l||!a?o:a.x,d=l||!a?r:a.y,f=a?.datum?Ue(a.datum,i.resolvedRibbons):{},p=i.scales?.x?.invert,m="function"==typeof p?p(h):void 0;let g=Ts(f,h,d,null!=m?{xValue:m,xPx:h}:void 0);if(l&&i.scene.length>0&&i.scales){const e=function(e,t,n=30){const o=[];for(const r of e)if("line"===r.type){const e=r;if(2>e.path.length)continue;const i=lo(so(e.path,e.curve),t,n);if(null===i)continue;const s=vo(e.path,t);o.push({node:r,datum:Array.isArray(e.datum)&&e.datum[s]?e.datum[s]:e.datum,x:e.path[s][0],y:i,group:e.group,color:e.style.stroke})}else if("area"===r.type){const e=r;if(!1===e.interactive)continue;if(2>e.topPath.length)continue;const i=so(e.topPath,e.curve),s=so(e.bottomPath,e.curve),a=lo(i,t,n);if(null===a)continue;const l=lo(s,t,n),c=vo(e.topPath,t);o.push({node:r,datum:Array.isArray(e.datum)&&e.datum[c]?e.datum[c]:e.datum,x:e.topPath[c][0],y:a,y0:l??void 0,group:e.group,color:"string"==typeof e.style.stroke?e.style.stroke:"string"==typeof e.style.fill?e.style.fill:void 0})}return o}(i.scene,h,Math.max(s,cn));if(e.length>0){const t=i.scales.y.invert,n=Tn.current,o=p?p(h):h;if(a)g.xValue=o,g.xPx=h;else{const e={xValue:o};"string"==typeof y&&(e[y]=o),g=Ts(e,h,d,{xValue:o,xPx:h})}g.allSeries=e.map(e=>{const o=t?t(e.y):e.y,r=null!=e.y0?t?t(e.y0):e.y0:void 0;return{group:e.group||"",value:"stackedarea"===u&&null!=r?o-r:o,valuePx:e.y,color:e.color||n,datum:Ue(e.datum,i.resolvedRibbons)}})}}a||g.allSeries?.length?(Cn.current=g,_n.current=a?.node??null,Rn(g),Bt&&(Bt(g),zt.current=!0),sn()):c()},no.current=()=>{Cn.current&&(Cn.current=null,_n.current=null,Rn(null),Bt&&(Bt(null),zt.current=!0),sn())};const io=o(()=>{});io.current=e=>{if((t=e.target)instanceof Element&&null!=t.closest("[data-semiotic-annotation-widget]"))return;var t;if(!Ot)return;const n=Jn.current;if(!n)return;const o=n.getBoundingClientRect(),r=e.clientX-o.left-ln.left,i=e.clientY-o.top-ln.top;if(0>r||r>cn||0>i||i>un)return void Ot(null);const s=Xn.current;if(!s||0===s.scene.length)return void Ot(null);const a=Rs(Fe,Pn.current),l=ao(s.scene,r,i,a,s.quadtree,s.maxPointRadius);if(!l)return void Ot(null);const c=l.datum||{},u=s.scales?.x?.invert,h="function"==typeof u?u(l.x):void 0;var d;Ot(Ts(c,l.x,l.y,null!=h?{xValue:h,xPx:l.x}:void 0),{type:"activate",inputType:(d=Pn.current,"touch"===d?"touch":"pointer")})};const co=a(e=>io.current(e),[]),{kbFocusIndexRef:uo,focusedNavPointRef:ho,onKeyDown:fo}=(po={storeRef:Xn,hoverRef:Cn,hoveredNodeRef:_n,setHoverPoint:Rn,customHoverBehavior:Bt,customClickBehavior:Ot,scheduleRender:sn},function({storeRef:e,hoverRef:t,hoveredNodeRef:n,setHoverPoint:o,customHoverBehavior:r,customClickBehavior:i,scheduleRender:s,extractPoints:a,toHover:l}){const c=gl(-1),u=gl(null),h=gl(null),d=ml(d=>{if(function(e){const t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}(d))return;const f=e.current;if(!f)return;const p=()=>{c.current=-1,u.current=null,t.current=null,n&&(n.current=null),o(null),r(null),s()};if(0===f.scene.length)return void(0>c.current||p());let y;if(h.current?.version===f.version)y=h.current.graph;else{const e=a(f.scene);if(0===e.length)return void(0>c.current||p());y=function(e){const t=new Map;for(const n of e){const e=n.group??"_default";let o=t.get(e);o||(o=[],t.set(e,o)),o.push(n)}for(const e of t.values()){e.sort((e,t)=>e.x-t.x||e.y-t.y);for(let t=0;e.length>t;t++)e[t]._groupIndex=t}const n=Array.from(t.keys()).sort((e,n)=>{const o=t.get(e),r=t.get(n);return(o.length>0?o[0].y:0)-(r.length>0?r[0].y:0)}),o=Array.from(t.values()).flat();o.sort((e,t)=>e.x-t.x||e.y-t.y);const r=new Map;for(let e=0;o.length>e;e++){o[e]._flatIndex=e;const t=o[e].datum?.id;null!=t&&r.set(t+"",e)}return{flat:o,groups:n,byGroup:t,idToIdx:r}}(e),h.current={version:f.version,graph:y}}let m=c.current;if(y.flat.length>m||(p(),m=-1),("Enter"===d.key||" "===d.key)&&m>=0)return d.preventDefault(),void i(l(y.flat[m],f),{type:"activate",inputType:"keyboard"});if(0>m){if("Escape"===d.key)return;if(!["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(d.key))return;d.preventDefault(),c.current=0;const e=y.flat[0];u.current=e;const n=l(e,f);return t.current=n,o(n),r(n,{type:"focus",inputType:"keyboard"}),void s()}const g=function(e,t,n){const{group:o,indexInGroup:r}=t,i=n.byGroup.get(o);switch(e){case"ArrowRight":return i.length-1>r?i[r+1]._flatIndex:t.flatIndex;case"ArrowLeft":return r>0?i[r-1]._flatIndex:t.flatIndex;case"ArrowDown":{const e=n.groups.indexOf(o);return n.groups.length-1>e?bl(n,n.groups[e+1],i[r]):t.flatIndex}case"ArrowUp":{const e=n.groups.indexOf(o);return e>0?bl(n,n.groups[e-1],i[r]):t.flatIndex}case"PageDown":return Math.min(t.flatIndex+Math.max(1,Math.floor(.1*n.flat.length)),n.flat.length-1);case"PageUp":return Math.max(t.flatIndex-Math.max(1,Math.floor(.1*n.flat.length)),0);case"Home":return 0;case"End":return n.flat.length-1;case"Escape":return-1;default:return null}}(d.key,function(e,t){if(0===e.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};const n=Math.max(0,Math.min(t,e.flat.length-1)),o=e.flat[n];return{flatIndex:n,group:o.group??"_default",indexInGroup:o._groupIndex??0}}(y,m),y);if(null===g)return;if(d.preventDefault(),0>g)return void p();c.current=g;const b=y.flat[g];u.current=b;const v=l(b,f);t.current=v,o(v),r(v,{type:"focus",inputType:"keyboard"}),s()},[i,r,a,t,n,s,o,e,l]);return{kbFocusIndexRef:c,focusedNavPointRef:u,onKeyDown:d}}({...po,extractPoints:vl,toHover:(e,t)=>function(e){return{data:e.datum||{},x:e.x,y:e.y,__semioticHoverData:!0}}({...e,datum:Ue(e.datum,t.resolvedRibbons)})}));var po;const yo=a(e=>{Pn.current=e.pointerType,uo.current=-1,ho.current=null,oo(e)},[ho,uo,oo]),mo=a(e=>{Pn.current="mouse",uo.current=-1,ho.current=null,oo({clientX:e.clientX,clientY:e.clientY,pointerType:"mouse"})},[ho,uo,oo]),go=a(e=>{Pn.current=e.pointerType},[]);on.current=()=>{if(en.current=null,!an.isActive)return;const e=Jn.current,t=eo.current;if(!e||!t)return;const n=Xn.current;if(!n)return;const o=an.now(),r=n.advanceTransition(Gt.current?o+1e6:o),i=!Gt.current&&r,s=Ht.current.w!==cn||Ht.current.h!==un,a=zt.current||r||s,l=n.consumeStylePaintPending();let c=!1;const h=n.getLastUpdateResult(),d=On.current.beforeCompute(h,i);!a||i&&!s||(n.computeScene({width:cn,height:un}),Ht.current={w:cn,h:un},c=!0,qn()),On.current.afterCompute(d,c,s);const f=function(e,t,n,o){const r=o.current,i=!0===e.lastCustomLayoutFailure?.preservedLastGoodScene,s=!i&&e.hasActivePulsesAt(t),a=!(n||i||!s&&!r)&&e.refreshPulse(t);return o.current=s,{changed:a,pending:s}}(n,o,c,Et),p=function(){if("undefined"==typeof window)return 1;const e=window.devicePixelRatio||1,t=function(){if("undefined"==typeof window)return!1;const e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t=768>Math.min(window.innerWidth||1/0,window.innerHeight||1/0);return e||t}()?2:3;return Math.max(1,Math.min(e,t))}(),g=Nn.current.resolve(e);Tn.current=g.primary;const b=So(ct,n.lastIngestTime>0?o-n.lastIngestTime:0),v=ct&&b.isStale;if(a||l||f.changed){const t=ba(e,qt,ln,p);if(t){if(t.clearRect(-ln.left,-ln.top,qt[0],qt[1]),ct&&1>b.alpha&&(t.globalAlpha=b.alpha),function(e,t){const{background:n,hasBackgroundGraphics:o=!1,themeBackground:r="",x:i=0,y:s=0,width:a,height:l}=t;if("transparent"===n)return!1;if(o)return!1;const c=n||(r&&"transparent"!==r?r:"")||null;if(!c)return!1;const u=Bn(e,c);u&&(e.fillStyle=u,e.fillRect(i,s,a,l))}(t,{background:q,hasBackgroundGraphics:!!Qe,themeBackground:g.background,x:-ln.left,y:-ln.top,width:qt[0],height:qt[1]}),t.save(),"function"==typeof t.rect&&(t.beginPath(),t.rect(0,0,cn,un),t.clip()),Je&&n.scales)for(const e of Je)t.save(),e(t,n.scene,n.scales,{width:cn,height:un}),t.restore();const e=It?Qa.custom:Qa[u];!function(e){const{context:t,nodes:n,renderMode:o,pixelRatio:r,paintBuiltIn:i}=e;if(!o||"sketchy"===o)return void i(n);let s=[];const a=()=>{s.length&&(i(s),s=[])};for(const e of n){const n=Ja(o,e);if(!n){s.push(e);continue}let l;a(),t.save();try{l=n.drawCanvas({context:t,node:e,style:e.style??{},pixelRatio:r})}finally{t.restore()}l||(el(n.id,e.type??"unknown"),i([e]))}a()}({context:t,nodes:n.scene,renderMode:U,pixelRatio:p,paintBuiltIn:o=>{if(e&&n.scales)for(const r of e)r(t,o,n.scales,{width:cn,height:un})}}),t.restore(),ct&&1>b.alpha&&(t.globalAlpha=1)}}const x=!!(yn&&Cn.current&&n.scales),k=!!(_n.current&&Array.isArray(Me)&&Me.some(e=>e&&"object"==typeof e&&"highlight"===e.type)),w=x||k;if(w||Fn.current){const e=ba(t,qt,ln,p);if(e&&(e.clearRect(-ln.left,-ln.top,qt[0],qt[1]),x&&Cn.current&&function(e,t,n,o,r,i,s){if(!1===r.crosshair)return;const a=t.allSeries,l=a&&a.length>0,c=t.xPx??t.x;e.save();const u="object"==typeof r.crosshair?r.crosshair:{};if(e.strokeStyle=u.stroke||s.crosshair,e.lineWidth=u.strokeWidth||1,e.setLineDash(u.strokeDasharray?u.strokeDasharray.split(/[\s,]+/).map(Number):[4,4]),e.beginPath(),e.moveTo(l?c:t.x,0),e.lineTo(l?c:t.x,o),e.stroke(),l||(e.beginPath(),e.moveTo(0,t.y),e.lineTo(n,t.y),e.stroke()),e.restore(),l){e.lineWidth=2,e.strokeStyle=s.pointRing;for(const t of a)null!=t.valuePx&&(e.beginPath(),e.arc(c,t.valuePx,4,0,2*Math.PI),e.fillStyle=t.color||s.primary,e.fill(),e.stroke())}else{const n=r.pointColor||function(e){if(!e)return null;if("heatcell"===e.type)return e.fill||null;if("candlestick"===e.type)return e.isUp?e.upColor:e.downColor;const{style:t}=e;if(!t)return null;const n="string"==typeof t.fill?t.fill:null;return"line"===e.type||"area"===e.type?t.stroke||n||null:n||t.stroke||null}(i)||s.primary;e.beginPath(),e.arc(t.x,t.y,4,0,2*Math.PI),e.fillStyle=n,e.fill(),e.strokeStyle=s.pointRing,e.lineWidth=2,e.stroke()}}(e,Cn.current,cn,un,"object"==typeof yn?yn:{},_n.current,g),k&&_n.current&&Array.isArray(Me))){const t=Me.find(e=>e&&"object"==typeof e&&"highlight"===e.type);t&&function(e,t,n,o,r){if(!n)return;const i="group"in n?n.group:void 0;if(void 0!==i)for(const n of t){if("line"!==n.type)continue;if(n.group!==i)continue;if(2>n.path.length)continue;const t="function"==typeof o.style?n.datum?o.style(n.datum):{}:o.style||{};e.save(),e.beginPath(),e.moveTo(n.path[0][0],n.path[0][1]);for(let t=1;n.path.length>t;t++)e.lineTo(n.path[t][0],n.path[t][1]);e.strokeStyle=t.stroke||n.style.stroke||r.primary,e.lineWidth=t.strokeWidth||(n.style.strokeWidth||2)+2,e.globalAlpha=t.opacity??1,e.stroke(),e.restore()}}(e,n.scene,_n.current,t,g)}Fn.current=w}a&&e&&e.setAttribute("aria-label",us(n.scene,u+" chart"));const A=zt.current;if(zt.current=A&&i&&!c,A&&n.scales){const e=e=>"object"==typeof e&&null!==e&&"function"==typeof e.valueOf?e.valueOf():e;if((!vn||e(vn.x.domain()[0])!==e(n.scales.x.domain()[0])||e(vn.x.domain()[1])!==e(n.scales.x.domain()[1])||e(vn.y.domain()[0])!==e(n.scales.y.domain()[0])||e(vn.y.domain()[1])!==e(n.scales.y.domain()[1])||vn.x.range()[0]!==n.scales.x.range()[0]||vn.x.range()[1]!==n.scales.x.range()[1]||vn.y.range()[0]!==n.scales.y.range()[0]||vn.y.range()[1]!==n.scales.y.range()[1])&&xn(n.scales),wt){const e=n.getData(),t="function"==typeof y?y:e=>e[y||"x"],o="function"==typeof m?m:e=>e[m||"y"];En(e.map(e=>t(e)).filter(e=>"number"==typeof e&&isFinite(e))),Yn(e.map(e=>o(e)).filter(e=>"number"==typeof e&&isFinite(e)))}}!((Oe&&Oe.length>0||It)&&(c||i))||!c&&33>o-bn.current||(gn(e=>e+1),bn.current=o),ct?.showBadge&&Dn(!!v),(i||null!=n.activeTransition||f.pending)&&sn()},function(e,t,n,o,r,i){const s=ko("fresh");xo(()=>{if(!e)return;const a=setInterval(()=>{const a=t.current;if(!a||0===a.lastIngestTime)return;const l="undefined"!=typeof performance?performance.now():Date.now(),c=So(e,l-a.lastIngestTime);c.band===s.current&&c.isStale===r||(s.current=c.band,c.isStale!==r&&i(c.isStale),n.current=!0,o())},1e3);return()=>clearInterval(a)},[e,r,o,t,i,n])}(ct,Xn,zt,sn,Wn,Dn);const bo=s(()=>{if(ke||Se)return;const e=Xn.current;return e?.xIsDate&&vn?Sa(vn.x.domain()):void 0},[ke,Se,vn]),wo=ke||Se||bo,Ao=yn&&Ln?_e?_e(Ln):xl(dl,{hover:Ln}):null,Co=Ao?xl(Xs,{x:Ln.x,y:Ln.y,containerWidth:cn,containerHeight:un,margin:ln,className:"stream-frame-tooltip",children:Ao}):null,_o=ho.current,Po=xl(Ps,{active:uo.current>=0,hoverPoint:Ln,margin:ln,size:qt,shape:_o?.shape,width:_o?.w,height:_o?.h}),Lo=ka(y,O,"__semiotic_resolvedX","__semiotic_resolvedTime"),Ro=ka(m,T,"__semiotic_resolvedY","__semiotic_resolvedValue"),Io=Lo.key,To=Ro.key,No=function(e,t,n){return o=>{if(!o||!n||!e.fn&&!t.fn)return o;let r=!1;const i=o.map(n=>{const o=e.fn&&e.key&&!(e.key in n),i=t.fn&&t.key&&!(t.key in n);if(!o&&!i)return n;r=!0;const s={...n};return o&&(s[e.key]=e.fn(n)),i&&(s[t.key]=t.fn(n)),s});return r?i:o}}(Lo,Ro,Oe&&Oe.length>0||!1);if(Oi||!jt&&Yt){const e=Xn.current;e&&d&&(e.ingest({inserts:hn,bounded:!0}),e.computeScene({width:cn,height:un}));const t=e?.scene??[],o=e?.scales??null,r=ga(Ze,qt,ln,o),i=ga(Qe,qt,ln,o),s=wo||(()=>{if(e?.xIsDate&&o)return Sa(o.x.domain())})();return kl("div",{ref:Xt,className:"stream-xy-frame"+(X?" "+X:""),role:"img","aria-label":_t||("string"==typeof tt?tt:"XY chart"),style:{position:"relative",width:Y?"100%":qt[0],height:G?"100%":qt[1]},children:[xl(Ss,{summary:Pt}),kl("svg",{xmlns:"http://www.w3.org/2000/svg",width:qt[0],height:qt[1],style:{position:"absolute",left:0,top:0},children:[xl("g",{transform:`translate(${ln.left},${ln.top})`,children:i}),kl("g",{transform:`translate(${ln.left},${ln.top})`,children:[q&&xl("rect",{x:0,y:0,width:cn,height:un,fill:q}),et&&o&&et.map((e,r)=>xl(n.Fragment,{children:e(t,o,{width:cn,height:un})},"svgpre-"+r)),t.map((e,t)=>function(e){const{node:t,index:n,renderMode:o,fallback:r}=e,i=Ja(o,t);if(!i)return r();const s=i.renderStaticSVG({node:t,style:t.style??{},key:`${i.id}-${n}`});return null!=s?s:(el(i.id,t.type??"unknown"),r())}({node:e,index:t,renderMode:U,fallback:()=>function(e,t,n){switch(e.type){case"line":{const n=e;if(0===n.path.length)return null;const o="M"+n.path.map(([e,t])=>`${e},${t}`).join("L");return Ni("path",{d:o,fill:"none",stroke:n.style.stroke||"#4e79a7",strokeWidth:n.style.strokeWidth||2,strokeDasharray:n.style.strokeDasharray,opacity:n.style.opacity},"line-"+t)}case"area":{const o=e;if(0===o.topPath.length)return null;const r=`M${o.topPath.map(([e,t])=>`${e},${t}`).join("L")}L${[...o.bottomPath].reverse().map(([e,t])=>`${e},${t}`).join("L")}Z`,i=`${n?n+"-":""}area-${t}-hatch`,s=zn(o.style.fill)?jn(o.style.fill,i):void 0,a=s?`url(#${i})`:Bi(o.style.fill);if(o.clipRect){const e=`${n?n+"-":""}area-clip-${t}`;return Fi("g",{children:[Fi("defs",{children:[s,Ni("clipPath",{id:e,children:Ni("rect",{x:o.clipRect.x,y:o.clipRect.y,width:o.clipRect.width,height:o.clipRect.height})})]}),Ni("path",{d:r,fill:a,fillOpacity:o.style.fillOpacity??o.style.opacity??.7,stroke:o.style.stroke,strokeWidth:o.style.strokeWidth,clipPath:`url(#${e})`})]},"area-"+t)}return Fi(Ri.Fragment,{children:[s&&Ni("defs",{children:s}),Ni("path",{d:r,fill:a,fillOpacity:o.style.fillOpacity??o.style.opacity??.7,stroke:o.style.stroke,strokeWidth:o.style.strokeWidth})]},"area-"+t)}case"point":{const o=e,r=`${n?n+"-":""}point-${t}-hatch`,i=zn(o.style.fill)?jn(o.style.fill,r):void 0;return Fi(Ri.Fragment,{children:[i&&Ni("defs",{children:i}),Ni("circle",{cx:o.x,cy:o.y,r:o.r,fill:i?`url(#${r})`:Bi(o.style.fill),opacity:o.style.opacity??.8,stroke:o.style.stroke,strokeWidth:o.style.strokeWidth})]},"point-"+t)}case"symbol":return function(e,t){const n=ut(e.symbolType,e.size,e.path);return Ni("path",{d:n,transform:e.rotation?`translate(${e.x},${e.y}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.x},${e.y})`,fill:e.style.fill?Bi(e.style.fill):"none",opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},"symbol-"+t)}(e,t);case"glyph":return function(e,t,n,o){const r=e.glyph;if(!r?.parts?.length||0>=e.size)return null;const i=kn(r,e.size);if(0>=i.scale)return null;const s=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${i.offsetX},${i.offsetY}) scale(${i.scale})`,a=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),l=Mn(r,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=l?function(e){const t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?"s_"+t:t}(o+"-clip"):void 0,u=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),h=t=>r.parts.map((n,o)=>{const r=t?"none"===n.fill?void 0:t:An(n.fill,a,e.accent),i=t?n.stroke&&"none"!==n.stroke?t:void 0:An(n.stroke??"none",a,e.accent);return r||i?Ni("path",{d:n.d,fill:r??"none",stroke:i,strokeWidth:i?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},o):null});return Fi("g",{transform:s,opacity:1===u?void 0:u,children:[l&&c&&Ni("clipPath",{id:c,children:Ni("rect",{x:l.x,y:l.y,width:l.width,height:l.height})}),l&&e.ghostColor?Ni("g",{children:h(e.ghostColor)}):null,l&&c?Ni("g",{clipPath:`url(#${c})`,children:h()}):h()]},o)}(e,e.x,e.y,`${n??""}glyph-${e.pointId??t}`);case"rect":{const o=e,r=`${n?n+"-":""}xyrect-${t}-hatch`,i=zn(o.style.fill)?jn(o.style.fill,r):void 0;return Fi(Ri.Fragment,{children:[i&&Ni("defs",{children:i}),Ni("rect",{x:o.x,y:o.y,width:o.w,height:o.h,fill:i?`url(#${r})`:Bi(o.style.fill),opacity:o.style.opacity,stroke:o.style.stroke,strokeWidth:o.style.strokeWidth})]},"rect-"+t)}case"heatcell":{const n=e;if(n.showValues&&null!=n.value&&n.w>=20&&n.h>=20){const e=n.valueFormat?n.valueFormat(n.value):Number.isInteger(n.value)?n.value+"":100>Math.abs(n.value)?1>Math.abs(n.value)?n.value.toPrecision(3):n.value.toFixed(1):n.value.toFixed(0),[o,r,i]=function(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}const t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}(n.fill),s=.299*o+.587*r+.114*i>128?"#000":"#fff",a=Math.max(10,Math.min(16,.3*Math.min(n.w,n.h)));return Fi("g",{children:[Ni("rect",{x:n.x,y:n.y,width:n.w,height:n.h,fill:n.fill}),Ni("text",{x:n.x+n.w/2,y:n.y+n.h/2,textAnchor:"middle",dominantBaseline:"middle",fill:s,fontSize:a+"px",children:e})]},"heatcell-"+t)}return Ni("rect",{x:n.x,y:n.y,width:n.w,height:n.h,fill:n.fill},"heatcell-"+t)}case"candlestick":{const n=e,o=Math.min(n.openY,n.closeY),r=Math.max(Math.abs(n.openY-n.closeY),1),i=n.isUp?n.upColor:n.downColor;return Fi("g",{children:[Ni("line",{x1:n.x,y1:n.highY,x2:n.x,y2:n.lowY,stroke:n.wickColor,strokeWidth:n.wickWidth}),Ni("rect",{x:n.x-n.bodyWidth/2,y:o,width:n.bodyWidth,height:r,fill:i,stroke:i,strokeWidth:1})]},"candle-"+t)}default:return null}}(e,t,Dt)})).filter(Boolean)]})]}),xl(Li,{width:cn,height:un,totalWidth:qt[0],totalHeight:qt[1],margin:ln,scales:o,showAxes:me,axes:ge,xLabel:be,yLabel:ve,yLabelRight:xe,xFormat:s,yFormat:we||Ce,axisExtent:Ae,showGrid:He,title:tt,legend:Ee,legendHoverBehavior:$e,legendClickBehavior:je,legendHighlightedCategory:Ye,legendIsolatedCategories:Ge,legendPosition:Ve,legendLayout:Xe,foregroundGraphics:rn(r,dn(Xn.current?.customLayoutOverlays,Ft??null)),marginalGraphics:wt,xValues:[],yValues:[],annotations:Oe,onAnnotationActivate:We,onObservation:Ie??Re,chartId:Te,chartType:"StreamXYFrame",autoPlaceAnnotations:De,svgAnnotationRules:ze,annotationFrame:0,xAccessor:Io,yAccessor:To,annotationData:No(Xn.current?.getData()),pointNodes:Ca(Xn.current?.scene),curve:"string"==typeof S?S:void 0,linkedCrosshairName:Lt,linkedCrosshairSourceId:Rt})]})}return kl("div",{ref:Xt,className:"stream-xy-frame"+(X?" "+X:""),role:"group","aria-label":_t||("string"==typeof tt?tt:"XY chart"),tabIndex:0,style:{position:"relative",width:Y?"100%":qt[0],height:G?"100%":qt[1],overflow:"visible",touchAction:Sl(ot)},onKeyDown:fo,children:["production"!==process.env.NODE_ENV&&Xn.current&&xl(nn,{store:Xn.current,diagnostics:On.current}),Mt&&xl(Cs,{tableId:Jt}),Mt&&xl(As,{scene:Xn.current?.scene??[],chartType:u+" chart",tableId:Jt,chartTitle:"string"==typeof tt?tt:void 0}),xl(Ss,{summary:Pt}),xl(rs,{hoverPoint:Ln}),kl("div",{role:"img","aria-label":_t||("string"==typeof tt?tt:"XY chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:yn?yo:void 0,onMouseMove:yn?mo:void 0,onPointerLeave:yn?ro:void 0,onMouseLeave:yn?ro:void 0,onPointerDown:yn||Wt?go:void 0,onClick:Wt?co:void 0,children:[xl(ma,{size:qt,margin:ln,children:Sn}),xl(Mi,{width:cn,height:un,totalWidth:qt[0],totalHeight:qt[1],margin:ln,scales:vn,showAxes:me,axes:ge,showGrid:He,xFormat:wo,yFormat:we||Ce,axisExtent:Ae}),xl("canvas",{ref:Jn,"aria-label":us(Xn.current?.scene??[],u+" chart"),style:{position:"absolute",left:0,top:0}}),xl("canvas",{ref:eo,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),xl(Li,{width:cn,height:un,totalWidth:qt[0],totalHeight:qt[1],margin:ln,scales:vn,showAxes:me,axes:ge,xLabel:be,yLabel:ve,yLabelRight:xe,xFormat:wo,yFormat:we||Ce,axisExtent:Ae,showGrid:He,title:tt,legend:Ee,legendHoverBehavior:$e,legendClickBehavior:je,legendHighlightedCategory:Ye,legendIsolatedCategories:Ge,legendPosition:Ve,legendLayout:Xe,foregroundGraphics:rn(wn,dn(Xn.current?.customLayoutOverlays,Ft??null)),marginalGraphics:wt,xValues:Hn,yValues:$n,annotations:Oe,onAnnotationActivate:We,onObservation:Ie??Re,chartId:Te,chartType:"StreamXYFrame",autoPlaceAnnotations:De,svgAnnotationRules:ze,annotationFrame:mn,xAccessor:Io,yAccessor:To,annotationData:No(Xn.current?.getData()),pointNodes:Ca(Xn.current?.scene),curve:"string"==typeof S?S:void 0,underlayRendered:!0,canvasObscuresUnderlay:"transparent"!==q&&!Qe,linkedCrosshairName:Lt,linkedCrosshairSourceId:Rt}),(ot||rt)&&xl(C,{width:cn,height:un,totalWidth:qt[0],totalHeight:qt[1],margin:ln,dimension:ot?.dimension??"xy",scales:vn,onBrush:rt??(()=>{}),binSize:I,snap:ot?.snap,binBoundaries:ot?.binBoundaries??("bar"===u?Xn.current?.getBinBoundaries():void 0),snapDuring:ot?.snapDuring,streaming:"streaming"===h}),ct?.showBadge&&xl(Mo,{isStale:Wn,position:ct.badgePosition}),Po,Co]})]})}));Cl.displayName="StreamXYFrame";var Ml=Cl;import{useMemo as _l,useCallback as Pl,useState as Ll,useEffect as Rl,forwardRef as Il,useRef as Tl}from"react";import{useMemo as Nl,useCallback as Fl,useState as Bl,useId as Ol,useEffect as Wl,useRef as Dl}from"react";import{createContext as zl,useContext as Hl,useMemo as El}from"react";import{jsx as $l}from"react/jsx-runtime";var jl=zl(null);function Yl({colors:e,categories:t,colorScheme:n="category10",children:o}){const r=El(()=>{if(e)return e;if(t){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n,o={};let r=0;for(const n of t)o[n]=_e(e,n)??Ae[r++%Ae.length];return o}const e=Array.isArray(n)?n:we[n]||Ae,o={};for(let n=0;t.length>n;n++)o[t[n]]=e[n%e.length];return o}return{}},[e,t,n]);return $l(jl.Provider,{value:r,children:o})}function Gl(){return Hl(jl)}Yl.displayName="CategoryColorProvider";import{createContext as Vl,useContext as Xl,useEffect as ql,useId as Ul,useLayoutEffect as Kl,useMemo as Ql,useRef as Zl,useState as Jl,useCallback as ec}from"react";function tc(e){const t=[];for(const[n,o]of Object.entries(e.fields))if("point"===o.type)t.push(e=>o.values.has(e[n]));else{const[e,r]=o.range;t.push(t=>{const o=t[n];return o>=e&&r>=o})}return e=>t.every(t=>t(e))}function nc(e,t){let n=e.get(t);return n||(n={name:t,resolution:"union",clauses:new Map},e.set(t,n)),n}function oc(e,t){if(e.type!==t.type)return!1;if("interval"===e.type&&"interval"===t.type)return e.range[0]===t.range[0]&&e.range[1]===t.range[1];if("point"===e.type&&"point"===t.type){if(e.values.size!==t.values.size)return!1;for(const n of e.values)if(!t.values.has(n))return!1;return!0}return!1}var[rc,ic]=O(e=>({selections:new Map,setClause(t,n){e(e=>{const o=e.selections.get(t),r=o?.clauses.get(n.clientId);if(r&&function(e,t){if(e.clientId!==t.clientId||e.type!==t.type)return!1;const n=Object.entries(e.fields);if(n.length!==function(e){let t=0;for(const n in e)t++;return t}(t.fields))return!1;for(const[e,o]of n){const n=t.fields[e];if(!n||!oc(o,n))return!1}return!0}(r,n))return{};const i=new Map(e.selections),s=nc(i,t),a=new Map(s.clauses);return a.set(n.clientId,n),i.set(t,{...s,clauses:a}),{selections:i}})},clearClause(t,n){e(e=>{const o=e.selections.get(t);if(!o||!o.clauses.has(n))return{};const r=new Map(e.selections),i=new Map(o.clauses);return i.delete(n),r.set(t,{...o,clauses:i}),{selections:r}})},setResolution(t,n){e(e=>{const o=e.selections.get(t);if(o?.resolution===n)return{};const r=new Map(e.selections),i=nc(r,t);return r.set(t,{...i,resolution:n}),{selections:r}})},clearSelection(t){e(e=>{const n=e.selections.get(t);if(!n||0===n.clauses.size)return{};const o=new Map(e.selections);return o.set(t,{...n,clauses:new Map}),{selections:o}})}}));import{useId as sc,useMemo as ac,useCallback as lc}from"react";function cc(e){const t=sc(),n=e.clientId||t,{name:o}=e,r=ic(e=>e.selections.get(o)),i=ic(e=>e.setClause),s=ic(e=>e.clearClause),a=ac(()=>!!r&&r.clauses.size>0,[r]);return{predicate:ac(()=>r&&0!==r.clauses.size?function(e,t){const n=[];for(const[o,r]of e.clauses)"crossfilter"===e.resolution&&o===t||n.push(tc(r));return 0===n.length?()=>!0:"intersect"===e.resolution?e=>n.every(t=>t(e)):e=>n.some(t=>t(e))}(r,n):()=>!0,[r,n]),isActive:a,selectPoints:lc(e=>{const t={};let r=!1;for(const[n,o]of Object.entries(e))t[n]={type:"point",values:new Set(o)},r=!0;r&&i(o,{clientId:n,type:"point",fields:t})},[n,o,i]),selectInterval:lc(e=>{const t={};let r=!1;for(const[n,o]of Object.entries(e))t[n]={type:"interval",range:o},r=!0;r&&i(o,{clientId:n,type:"interval",fields:t})},[n,o,i]),clear:lc(()=>{s(o,n)},[s,o,n]),clientId:n}}function uc(e){return 2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function hc(e){const{name:t,xField:n,yField:o}=e,{predicate:r,isActive:i,selectInterval:s,clear:a}=cc({name:t,fields:[n,o].filter(Boolean)}),l=n&&o?"xyBrush":n?"xBrush":"yBrush",c=lc(e=>{if(!e)return void a();const t={};"xyBrush"===l&&function(e){return 2===e.length&&Array.isArray(e[0])&&2===e[0].length&&Array.isArray(e[1])&&2===e[1].length}(e)?(n&&(t[n]=[Math.min(e[0][0],e[1][0]),Math.max(e[0][0],e[1][0])]),o&&(t[o]=[Math.min(e[0][1],e[1][1]),Math.max(e[0][1],e[1][1])])):"xBrush"===l&&uc(e)?n&&(t[n]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]):"yBrush"===l&&uc(e)&&o&&(t[o]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]),dc(t)&&s(t)},[l,n,o,s,a]);return{brushInteraction:ac(()=>({brush:l,during:c,end:c}),[l,c]),predicate:r,isActive:i,clear:a}}function dc(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}import{jsx as fc,jsxs as pc}from"react/jsx-runtime";var yc=Vl(!1),mc=Vl(!1),gc=Vl(null),bc="undefined"==typeof window?ql:Kl;function vc(e){const t=new Set,n=[];for(const o of e)t.has(o)||(t.add(o),n.push(o));return n}function xc(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}var kc="__linked-legend-isolate__",wc="__linked-legend-highlight__";function Ac({categoryColors:e,interaction:t,selectionName:n,field:o}){const r=Object.entries(e),i=r.map(([e])=>e),s=[{styleFn:e=>({fill:e.color||"#333",stroke:e.color||"#333"}),type:"fill",items:r.map(([e,t])=>({label:e,color:t})),label:""}],{selectPoints:a,clear:l}=cc({name:n,fields:[o],clientId:kc}),{selectPoints:c,clear:u}=cc({name:n,fields:[o],clientId:wc}),h=ic(e=>e.selections.get(n)),{isolatedCategories:d,highlightedCategory:f}=Ql(()=>{const e=new Set;let t=null;const n=h?.clauses.get(kc)?.fields[o];if("point"===n?.type)for(const t of n.values)e.add(t+"");const r=h?.clauses.get(wc)?.fields[o];if("point"===r?.type){const e=r.values.values().next().value;null!=e&&(t=e+"")}return{isolatedCategories:e,highlightedCategory:t}},[h,o]),p=ec(e=>{"highlight"===t&&(e?c({[o]:[e.label]}):u())},[t,o,c,u]),y=ec(e=>{if("isolate"!==t)return;const n=new Set(d);n.has(e.label)?n.delete(e.label):n.add(e.label),0===n.size||n.size===i.length?l():a({[o]:Array.from(n)})},[t,o,d,i.length,a,l]),[m,[g]]=ia([0,0],!0,!1),b=Ql(()=>function(e,t){if(!t||0===e.length)return 1;let n=0,o=1;for(const r of e){const e=26+7*r.length;n>0&&n+e>t&&(o++,n=0),n+=e}return o}(r.map(([e])=>e),g),[r,g]);return 0===r.length?null:fc("div",{ref:m,style:{width:"100%",display:"block"},children:fc("svg",{width:"100%",height:Math.max(30,22*b+8),style:{display:"block",overflow:"visible"},children:fc(zo,{legendGroups:s,title:!1,orientation:"horizontal",width:g,height:20,customHoverBehavior:"highlight"===t?p:void 0,customClickBehavior:"isolate"===t?y:void 0,highlightedCategory:f,isolatedCategories:d})})})}function Sc({children:e,selections:t,showLegend:n,legendPosition:o="top",legendInteraction:r="none",legendSelectionName:i="legend",legendField:s="category"}){const a=Ql(()=>{if(!t)return;const e=new Map;for(const[n,o]of Object.entries(t))o.resolution&&e.set(n,{name:n,resolution:o.resolution,clauses:new Map});return e.size>0?{selections:e}:void 0},[t]),l=Gl(),[c,u]=Jl({}),h=Zl({}),d=Ql(()=>({registerCategories:(e,t)=>{const n=vc(t);u(t=>xc(t[e]??[],n)?t:{...t,[e]:n})},unregisterCategories:e=>{u(t=>{if(!(e in t))return t;const n={...t};return delete n[e],n})}}),[]),f=Ql(()=>{const e=[];for(const t of Object.values(c))for(const n of t)e.push(n);return vc(e)},[c]),p=Ql(()=>{const e=l??{},t=h.current;let n=Object.keys(e).length+Object.keys(t).length;for(const o of f)e[o]||t[o]||(t[o]=Ae[n%Ae.length],n++);const o={...e};for(const n of f)o[n]=e[n]??t[n];return o},[l,f]),y=void 0===n||n,m=Object.keys(p).length>0;return fc(rc,{initialState:a,children:fc(Ir,{children:fc(mc.Provider,{value:!0,children:fc(gc.Provider,{value:d,children:fc(Yl,{colors:p,children:pc(yc.Provider,{value:y&&m,children:[y&&"top"===o&&fc(Ac,{categoryColors:p,interaction:r,selectionName:i,field:s}),e,y&&"bottom"===o&&fc(Ac,{categoryColors:p,interaction:r,selectionName:i,field:s})]})})})})})})}function Cc(e){return e?"string"==typeof e?{name:e}:e:null}function Mc(e,t,n){return t?(o,...r)=>{const i={...e(o,...r)};if(t.isActive)if(t.predicate(o))n?.selectedStyle&&Object.assign(i,n.selectedStyle);else{const e=n?.unselectedOpacity??.5;i.opacity=e,i.fillOpacity=e,i.strokeOpacity=e,n?.unselectedStyle&&Object.assign(i,n.unselectedStyle)}return i}:e}import*as _c from"react";import{jsx as Pc,jsxs as Lc}from"react/jsx-runtime";function Rc(){return V(e=>e.theme)}function Ic(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Tc(e,t){const{when:n}=e,o=t.width,r=t.height,i=function(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}(t),s=function(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}(t);return!("number"==typeof n.minWidth&&n.minWidth>o||"number"==typeof n.maxWidth&&o>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof r||n.minHeight>r)||"number"==typeof n.maxHeight&&("number"!=typeof r||r>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof i||n.minAspectRatio>i)||"number"==typeof n.maxAspectRatio&&("number"!=typeof i||i>n.maxAspectRatio)||n.orientation&&s!==n.orientation)}function Nc(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const o=n.map((e,t)=>({rule:e,index:t})).filter(e=>Tc(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:o.reduce((e,t)=>function(e,t){const n={...e,...t};for(const o of["margin","frameProps","mobileSemantics","style"])Ic(e[o])&&Ic(t[o])&&(n[o]={...e[o],...t[o]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}(e,t.rule.transform),e),matches:o}}function Fc(e,t,n){const o=e.xValue??t?.[n];if(null==o)return null;const r=Number(o);return Number.isFinite(r)?r:null}function Bc(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?{...t,xValue:e.xValue}:t||{}}function Oc(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}_c.createContext(void 0);var Wc="#007bff",Dc=[],zc={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1};function Hc(e,t={}){const n=t.mobileSemantics?.interaction,o="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,r="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,i=!!n||void 0!==o,s=e&&"object"==typeof e?e:void 0;if(!1===e||!1===s?.enabled||void 0===e&&!r&&!i)return zc;const a=s??{};return{enabled:!0,tapToSelect:a.tapToSelect??!0,tapToLockTooltip:a.tapToLockTooltip??!0,clearSelection:a.clearSelection??"backgroundTap",targetSize:a.targetSize??o??44,snap:a.snap??"nearestDatum",brushHandleSize:a.brushHandleSize??44,standardControls:a.standardControls??!1}}function Ec(){const e=Rc(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function $c(e,t,n){const o=Gl(),r=Ec();return Nl(()=>{if(!t)return;const i=o??void 0,s=n??(r&&r.length>0?r:void 0)??"category10";if(0!==e.length){if("function"==typeof t){const n=Array.from(new Set(e.map(e=>t(e)+"")));if(i&&Oc(i)){const e=Pe(n.map(e=>({_cat:e})),"_cat",s);return t=>i[t]||e(t)}return Pe(n.map(e=>({_cat:e})),"_cat",s)}if(i&&Oc(i)){const n=Pe(e,t,s);return e=>i[e]||n(e)}return Pe(e,t,s)}if(i&&Oc(i)){const e=Pe([{_:"a"}],"_",s);return t=>i[t]||e(t)}},[e,t,n,o,r])}function jc({selection:e,linkedHover:t,fallbackFields:n=Dc,unwrapData:o=!1,onObservation:r,chartType:i,chartId:s,onClick:a,hoverHighlight:l,colorByField:c,mobileInteraction:u}){const h=Ol(),d=Nl(()=>function(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}(t,n),[t,n]),f=Nl(()=>"series"===d?.mode?[d.seriesField||c||n[0]].filter(e=>!!e):d?.fields||n,[d,c,n]),p=cc({name:e?.name||"__unused__",fields:f}),y=function(e){const t=e.name||"hover",{fields:n}=e,{predicate:o,isActive:r,selectPoints:i,clear:s}=cc({name:t,fields:n});return{onHover:lc(e=>{if(!e)return void s();const t={};for(const o of n){const n=e[o];void 0!==n&&(t[o]=[n])}dc(t)&&i(t)},[n,i,s]),predicate:o,isActive:r}}({name:d?.name||"hover",fields:f}),m=Tr(e=>e.pushObservation),g=Fl(e=>{r?.(e),m?.(e)},[r,m]),b=e?{isActive:p.isActive,predicate:p.predicate}:null,[v,x]=Bl(null),k=Dl(!1),w=c||n[0],A=Nl(()=>{if(!l||null==v||!w)return null;const e=v,t=w;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[l,v,w]),S=Fl((e,n)=>{const o=!e&&k.current&&!!u?.enabled&&u.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===d?.mode&&d.xField){const n=Fc(e,t,d.xField);null!=n&&function(e,t,n){const o=ai.positions.get(e);o?.locked||o&&o.xValue===t&&o.sourceId===n||(ai={positions:new Map(ai.positions).set(e,{xValue:t,sourceId:n})},ci())}(d.name||"hover",n,h)}"x-position"!==d?.mode&&y.onHover(t)}else"x-position"!==d?.mode||o||ui(d.name||"hover",h),"x-position"===d?.mode||o||y.onHover(null);if(l&&w)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[w];x(null!=n?n+"":null)}else o||x(null);(r||m)&&fl({onObservation:g,datum:e?Bc(e):null,x:e?.x,y:e?.y,chartType:i||"unknown",chartId:s,context:n})},[t,y,d,h,r,i,s,m,g,l,w,u]),C=Fl((n=!0)=>{k.current=!1,t&&"x-position"!==d?.mode&&y.onHover(null),e&&u?.tapToSelect&&p.clear(),n&&l&&x(null),"x-position"===d?.mode&&(hi(d.name||"hover",h),ui(d.name||"hover",h))},[t,d,y,e,u,p,l,h]),M=Fl((n,o)=>{const c=!!u?.enabled&&(u.tapToLockTooltip||u.tapToSelect),b=!!u?.enabled&&"backgroundTap"===u.clearSelection;if("x-position"===d?.mode&&d.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=Fc(n,e,d.xField);null!=t&&function(e,t,n){const o=ai.positions.get(e);if(o?.locked){const t=new Map(ai.positions);return t.delete(e),ai={positions:t},ci(),!1}ai={positions:new Map(ai.positions).set(e,{xValue:t,sourceId:n,locked:!0})},ci()}(d.name||"hover",t,h)}if(c)if(n){k.current=!0;const o=Bc(n);if(t&&"x-position"!==d?.mode&&y.onHover(o),e&&u?.tapToSelect&&f.length>0){const e={};for(const t of f){const n=o[t];void 0!==n&&(e[t]=[n])}Oc(e)&&p.selectPoints(e)}if(l&&w){const e=o?.[w];x(null!=e?e+"":null)}}else b&&C();if(n||b){if(n&&a){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),a(e,{x:n.x??0,y:n.y??0})}(r||m)&&pl({onObservation:g,datum:n?Bc(n):null,x:n?.x,y:n?.y,chartType:i||"unknown",chartId:s,context:o})}},[a,r,m,g,i,s,d,h,u,t,y,e,p,f,l,w,C]);return Wl(()=>{if(!u?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&k.current&&C()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u?.enabled,C]),Wl(()=>()=>{k.current&&C(!1)},[C]),Wl(()=>{if("x-position"!==d?.mode)return;const e=d.name||"hover";return()=>{hi(e,h),ui(e,h)}},[d?.mode,d?.name,h]),{activeSelectionHook:b,hoverSelectionHook:A,customHoverBehavior:S,customClickBehavior:M,crosshairSourceId:h}}function Yc(e,t){const n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function Gc({data:e,colorBy:t,colorScale:n,showLegend:o,legendPosition:r="right",userMargin:i,defaults:s={top:50,bottom:60,left:70,right:40},categories:a}){const l=Xl(yc),c=null!==Xl(gc),u=void 0!==o?o:!l&&!!t,h=!!t&&(u||c),d=Nl(()=>{if(!h)return[];if(void 0!==a)return a;const n=new Set;for(const o of e){const e="function"==typeof t?t(o):o[t];null!=e&&n.add(e+"")}return Array.from(n)},[a,t,e,h]);!function(e){const t=Xl(gc),n=Ul(),o=vc(e),r=Zl([]);xc(r.current,o)||(r.current=o);const i=r.current;bc(()=>{if(t)return()=>t.unregisterCategories(n)},[t,n]),bc(()=>{t&&t.registerCategories(n,i)},[t,n,i])}(c&&t?d:[]);const f=Nl(()=>{if(!u||!t)return;const o=function({data:e,colorBy:t,colorScale:n,getColor:o,strokeColor:r,strokeWidth:i,categories:s}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==r&&(n.stroke=r),void 0!==i&&(n.strokeWidth=i),n},type:"fill",items:(s&&s.length>0?s:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((r,i)=>{const s=e.find("function"==typeof t?e=>t(e)===r:e=>e[t]===r),a=s?o(s,t,n):n?n(r):Se[i%Se.length];return{label:r+"",color:a}}),label:""}]}}({data:e,colorBy:t,colorScale:n,getColor:Me,categories:d});return 0!==o.legendGroups.reduce((e,t)=>e+t.items.length,0)?o:void 0},[u,t,e,n,d]),p=Nl(()=>{const e="number"==typeof i?{top:i,bottom:i,left:i,right:i}:i??{},t=t=>{const n=e[t];return"number"==typeof n?n:s[t]},n={top:t("top"),right:t("right"),bottom:t("bottom"),left:t("left")},o=t=>"number"==typeof e[t];return f&&("right"===r&&!o("right")&&110>n.right?n.right=110:"left"===r&&!o("left")&&110>n.left?n.left=110:"top"===r&&!o("top")&&50>n.top?n.top=50:"bottom"===r&&!o("bottom")&&80>n.bottom&&(n.bottom=80)),n},[s,i,f,r]);return{legend:f,margin:p,legendPosition:r}}function Vc(e,t,n){const[o,r]=Bl(null),[i,s]=Bl(new Set),a=Nl(()=>new Set,[]),l=Fl(t=>{"highlight"===e&&r(t?t.label:null)},[e]),c=Fl(t=>{"isolate"===e&&s(e=>{const o=new Set(e);return o.has(t.label)?o.delete(t.label):o.add(t.label),o.size===n.length?new Set:o})},[e,n.length]),u=Nl(()=>{if(!e||"none"===e||!t)return null;const n="string"==typeof t?t:null;return"highlight"===e&&null!=o?{isActive:!0,predicate:e=>(n?e[n]:"function"==typeof t?t(e):null)===o}:"isolate"===e&&i.size>0?{isActive:!0,predicate:e=>{const o=n?e[n]:"function"==typeof t?t(e):null;return i.has(o)}}:null},[e,t,o,i]);return{highlightedCategory:"highlight"===e?o:null,isolatedCategories:"isolate"===e?i:a,onLegendHover:l,onLegendClick:c,legendSelectionHook:u}}var Xc={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}};function qc(e,t,n){const o=Xc[e||"primary"],r=e&&"primary"!==e||!n?.width?o.width:n.width,i=e&&"primary"!==e||!n?.height?o.height:n.height,s=Nc({...t,mode:e},{width:t.width??r,height:t.height??i}).props,a=s.mode||e,l=Xc[a||"primary"],c="context"===a||"sparkline"===a,u=a&&"primary"!==a||!n?.width?l.width:n.width;return{width:s.width??u,height:s.height??(a&&"primary"!==a||!n?.height?l.height:n.height),showAxes:s.showAxes??l.showAxes,showGrid:s.showGrid??l.showGrid,enableHover:s.enableHover??(!!s.linkedHover||l.enableHover),showLegend:s.showLegend??l.showLegend,showLabels:s.showLabels??l.showLabels,title:c?void 0:s.title,description:s.description,summary:s.summary,accessibleTable:s.accessibleTable,xLabel:c?void 0:s.xLabel,yLabel:c?void 0:s.yLabel,categoryLabel:c?void 0:s.categoryLabel,valueLabel:c?void 0:s.valueLabel,marginDefaults:Uc(l.marginDefaults,s.showCategoryTicks,s.orientation),compactMode:c,mobileInteraction:Hc(s.mobileInteraction,{mode:a,width:s.width??u,mobileSemantics:s.mobileSemantics}),mobileSemantics:s.mobileSemantics}}function Uc(e,t,n){if(!1!==t)return e;const o={...e};return"horizontal"===n?o.left=Math.min(o.left,15):o.bottom=Math.min(o.bottom,15),o}import{jsx as Kc,jsxs as Qc}from"react/jsx-runtime";function Zc({componentName:e,message:t,diagnosticHint:n,width:o,height:r}){return Kc("div",{role:"alert",style:{width:o,height:Math.max(r,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:Qc("div",{style:{textAlign:"center",maxWidth:400},children:[Kc("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),Kc("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&Kc("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:n})]})})}import*as Jc from"react";import{jsx as eu}from"react/jsx-runtime";var tu=class extends Jc.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:eu(Zc,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}};import{jsx as nu}from"react/jsx-runtime";var ou="undefined"!=typeof process&&"production"!==process.env?.NODE_ENV;function ru({componentName:e,width:t,height:n,children:o}){return nu(tu,{fallback:o=>nu(Zc,{componentName:e,message:o.message,width:t,height:n}),children:o})}var iu={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--semiotic-text-secondary, #666)",fontSize:13,fontFamily:"inherit",border:"1px dashed var(--semiotic-border, #ddd)",borderRadius:4,boxSizing:"border-box"},su={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2};function au(e,t,n,o){return!1===o||null==e||Array.isArray(e)&&e.length>0?null:Array.isArray(e)?nu("div",{style:{...iu,width:t,height:n},children:o||"No data available"}):null}function lu(e,t,n,o){if(!e)return null;if(!1===o)return null;if(null!=o)return nu("div",{style:{width:t,height:n,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:o});const r=Math.min(5,Math.floor(n/40)),i=Math.max(8,Math.floor(n/(3*r))),s=Math.max(6,Math.floor(n/(2.5*r))),a=Math.floor((n-(r*(i+s)-s))/2);return nu("div",{style:{width:t,height:n,position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:Array.from({length:r},(e,n)=>nu("div",{className:"semiotic-loading-bar",style:{...su,position:"absolute",top:a+n*(i+s),left:Math.floor(.1*t),width:30+(37*n+13)%50+"%",height:i,opacity:.5+n%2*.2}},n))})}function cu(e,t,n,o){if(!ou)return;if(!t||0===t.length)return;if("string"!=typeof o)return;const r=t[0];if(!r||"object"!=typeof r)return;if(o in r)return;const i=Object.keys(r).join(", ");console.warn(`[semiotic] ${e}: ${n} "${o}" not found in data. Available keys: ${i}`)}function uu(e,t){const n=e.length,o=t.length,r=Array(o+1);for(let e=0;o>=e;e++)r[e]=e;for(let i=1;n>=i;i++){let n=r[0];r[0]=i;for(let s=1;o>=s;s++){const o=r[s];r[s]=e[i-1]===t[s-1]?n:1+Math.min(n,r[s],r[s-1]),n=o}}return r[o]}function hu(e,t){if(0===t.length)return null;const n=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(n)||n.includes(e.toLowerCase()))||(function(e,t,n=3){let o,r=n+1;for(const n of t){const t=uu(e.toLowerCase(),n.toLowerCase());r>t&&(r=t,o=n)}return r>n?void 0:o}(e,t,3)??null)}function du({componentName:e,data:t,accessors:n,requiredProps:o}){if(o)for(const[t,n]of Object.entries(o))if(null==n)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)&&"object"==typeof t)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(!Array.isArray(t)||0===t.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(n){const o=function(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:[...e]}(t).find(e=>e&&"object"==typeof e);if(o){const t=Object.keys(o);for(const[r,i]of Object.entries(n))if(i&&"string"==typeof i&&!(i in o)){const n=hu(i,t),o=n?` Try ${r}="${n}".`:"";return`${e}: ${r} "${i}" not found in data. Available fields: ${t.join(", ")}.${o}`}}}return null}import{useCallback as fu,useMemo as pu,useState as yu}from"react";import{useMemo as mu}from"react";function gu(e){const t=V(e=>e.theme.colors.selectionOpacity);return mu(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}function bu(e){const{data:t,rawData:n,colorBy:o,colorScheme:r,legendInteraction:i,legendPosition:s,selection:a,linkedHover:l,fallbackFields:c,unwrapData:u=!1,onObservation:h,chartType:d,chartId:f,showLegend:p,userMargin:y,marginDefaults:m,onClick:g,hoverHighlight:b,mobileInteraction:v,mobileSemantics:x,loading:k,loadingContent:w,emptyContent:A,width:S,height:C}=e,M=void 0===n,P=pu(()=>_(t),[t]),[L,R]=yu([]),I=fu(e=>{R(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[]),T="string"==typeof e.colorBy?e.colorBy:void 0,N=pu(()=>Hc(v,{width:S,mobileSemantics:x}),[v,S,x]),{activeSelectionHook:F,hoverSelectionHook:B,customHoverBehavior:O,customClickBehavior:W,crosshairSourceId:D}=jc({selection:a,linkedHover:l,fallbackFields:c,unwrapData:u,onObservation:h,chartType:d,chartId:f,onClick:g,hoverHighlight:b,colorByField:T,mobileInteraction:N}),z=Yc(l,D),H=$c(P,o,r),E=pu(()=>{if(!o)return[];const e=new Set;for(const t of P){const n="function"==typeof o?o(t):t[o];null!=n&&e.add(n+"")}return Array.from(e)},[P,o]),$=pu(()=>M&&L.length>0?L:E,[M,L,E]),j=Vc(i,o,$),Y=pu(()=>B||(j.legendSelectionHook?j.legendSelectionHook:F),[B,j.legendSelectionHook,F]),G=gu(a),V=Ec(),X=Gl(),q=pu(()=>{if(H)return H;if(!o||0===$.length)return;const e=Array.isArray(r)&&r.length>0||"string"==typeof r&&r.length>0?r:V&&V.length>0?V:Se,t="__streamCat",n=Pe($.map(e=>({[t]:e})),t,e);return e=>X?.[e]||n(e)||"#999"},[H,o,$,r,V,X]),{legend:U,margin:K,legendPosition:Q}=Gc({data:P,colorBy:o,colorScale:q,showLegend:p,legendPosition:s,userMargin:y,defaults:m,categories:$}),Z=pu(()=>{const e={};return U&&(e.legend=U,e.legendPosition=Q),i&&"none"!==i&&(e.legendHoverBehavior=j.onLegendHover,e.legendClickBehavior=j.onLegendClick,e.legendHighlightedCategory=j.highlightedCategory,e.legendIsolatedCategories=j.isolatedCategories),M&&o&&(e.legendCategoryAccessor=o,e.onCategoriesChange=I),e},[U,Q,i,j.onLegendHover,j.onLegendClick,j.highlightedCategory,j.isolatedCategories,M,o,I]),J=Array.isArray(n)?_(n):n,ee=lu(k,S,C,w),te=ee?null:au(J,S,C,A);return{data:P,colorScale:H,allCategories:$,legendState:j,effectiveSelectionHook:Y,activeSelectionHook:F,customHoverBehavior:O,customClickBehavior:W,mobileInteraction:N,legend:U,margin:K,legendPosition:Q,earlyReturn:ee||te||null,legendBehaviorProps:Z,crosshairProps:z,resolvedSelection:G}}import{useMemo as vu}from"react";function xu(e,t){if(!function(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}(t))return e??((...e)=>({}));const n={};return void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(n.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...n}):(...e)=>({...n})}function ku(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>Au(t(e))}function wu(e,t){const n=ku(e),o=ku(t);return(e,t)=>{const r=o(e);return{value:r,x:n(e),y:r,category:t}}}function Au(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function Su(e,t,n){const o=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&o!==e.eq)return!1;if(void 0!==e.ne&&o===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(o))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;const r=Au(o);if(void 0===r)return!1;if(void 0!==e.gt&&e.gt>=r)return!1;if(void 0!==e.gte&&e.gte>r)return!1;if(void 0!==e.lt&&r>=e.lt)return!1;if(void 0!==e.lte&&r>e.lte)return!1;if(void 0!==e.within){const[t,n]=e.within;if(t>r||r>n)return!1}if(void 0!==e.outside){const[t,n]=e.outside;if(r>=t&&n>=r)return!1}return!0}function Cu(e,t,n){const o=e.when;return void 0===o||!0===o||!1!==o&&("function"==typeof o?o(t,n):Su(o,t,n))}function Mu(e,t,n){if(!t||0===t.length)return{};let o={};for(const r of t){if(!Cu(r,e,n))continue;const t="function"==typeof r.style?r.style(e,n):r.style;t&&(o={...o,...t})}return o}function _u(e,t,n,o=e=>e){const r=e??(()=>({}));return t&&0!==t.length?(e,i)=>{const s=o(e),a={...r(e,i)};return Object.assign(a,Mu(s,t,n(s,i))),a}:r}function Pu(e){const{lineWidth:t=2,colorBy:n,colorScale:o,color:r,resolveStroke:i,fillArea:s,areaOpacity:a=.3,stroke:l,strokeWidth:c,opacity:u,effectiveSelectionHook:h,resolvedSelection:d,styleRules:f,ruleContext:p}=e,y=vu(()=>(e,l)=>{const c={strokeWidth:t},u=!0===s||Array.isArray(s)&&null!=l&&s.includes(l);let h;return i?h=i(e,l):n?o&&(h=Me(e,n,o)):h=r||Wc,void 0!==h&&(c.stroke=h,u&&(c.fill=h,c.fillOpacity=a)),f&&f.length>0&&Object.assign(c,Mu(e,f,p?p(e,l):{value:void 0,category:l})),c},[t,n,o,r,i,s,a,f,p]),m=vu(()=>xu(y,{stroke:l,strokeWidth:c,opacity:u}),[y,l,c,u]);return vu(()=>Mc(m,h??null,d),[m,h,d])}import{useImperativeHandle as Lu}from"react";function Ru(e,t){const{variant:n,frameRef:o,overrides:r}=t;Lu(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,n)=>e.current?.update(t,n)??[],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 n=Array.isArray(t)?t:[t],o=e.current?.getTopology()?.nodes??[],r=[];for(const t of n){const n=o.find(e=>e.id===t);n&&r.push({...n.data??{},id:t}),e.current?.removeNode(t)}return r},update:(t,n)=>(Array.isArray(t)?t:[t]).flatMap(t=>{const o=e.current?.updateNode(t,n);return o?[{...o,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,n)=>{const o=e.current?.removePoint(t)??[];for(const t of o)e.current?.push(n(t));return o},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const n=t;return{push:e=>n.current?.pushLine(e),pushMany:e=>n.current?.pushManyLines(e),remove:e=>n.current?.removeLine(e)??[],update:(e,t)=>{const o=n.current?.removeLine(e)??[];for(const e of o)n.current?.pushLine(t(e));return o},clear:()=>n.current?.clear(),getData:()=>n.current?.getLines()??[],getCustomLayout:()=>n.current?.getCustomLayout?.()??null,getLayoutFailure:()=>n.current?.getLayoutFailure?.()??null}}(n,o);return{...e,...r}},[o,r,n])}function Iu(e){const{title:t,description:n,summary:o,accessibleTable:r,className:i,animate:s,axisExtent:a,autoPlaceAnnotations:l}=e,c={};return t&&(c.title=t),n&&(c.description=n),o&&(c.summary=o),void 0!==r&&(c.accessibleTable=r),i&&(c.className=i),null!=s&&(c.animate=s),void 0!==a&&(c.axisExtent=a),void 0!==l&&(c.autoPlaceAnnotations=l),c}function Tu(e){const{linkedHover:t,selection:n,onObservation:o,onClick:r,hoverRadius:i,hoverHighlight:s,forceHoverBehavior:a,forceClickBehavior:l,mobileInteraction:c,customHoverBehavior:u,customClickBehavior:h,linkedHoverInClickPredicate:d=!0}=e,f={};o&&(f.annotationObservationCallback=o);const p=c?.enabled?Math.max(i??30,Math.ceil((c.targetSize||44)/2),24):i;return(a||t||o||r||s)&&(f.customHoverBehavior=u),h&&(l||(d?o||r||t:o||r)||c?.enabled&&(c.tapToSelect||c.tapToLockTooltip)&&(t||s||n))&&(f.customClickBehavior=h),null!=p&&(f.hoverRadius=p),f}function Nu(e){const{tooltip:t,defaultTooltipContent:n}=e;return{tooltipContent:!1===t?()=>null:Gs(t)||n}}var Fu="__forecastSegment",Bu=null;async function Ou(){return Bu||(Bu=await import("./xy-statisticalOverlays-7RWG6LJT.module.min.js")),Bu}import{useEffect as Wu,useMemo as Du,useRef as zu,useState as Hu}from"react";var Eu="__semiotic_resolvedX",$u="__semiotic_resolvedY";function ju(e){const{data:t,xAccessor:n,yAccessor:o,forecast:r,anomaly:i,groupBy:s}=e,a="string"==typeof n?n:Eu,l="string"==typeof o?o:$u,c=Du(()=>{if(!r&&!i)return t;const e="function"==typeof n,s="function"==typeof o;return e||s?t.map(t=>{const r={...t};return e&&(r[Eu]=n(t)),s&&(r[$u]=o(t)),r}):t},[t,r,i,n,o]),[u,h]=Hu(null),[d,f]=Hu([]),p=zu(r),y=zu(i);return Wu(()=>{if(!r&&!i)return void((p.current||y.current)&&(h(null),f([]),p.current=r,y.current=i));let e=!1;const t=r!==p.current||i!==y.current;if(p.current=r,y.current=i,t&&(h(null),f([])),r){const t=s&&"string"==typeof s&&"object"==typeof r?{...r,_groupBy:s}:r;(async function(...e){return(await Ou()).buildForecast(...e)})(c,a,l,t,i).then(t=>{e||(h(t),f(t.annotations))}).catch(()=>{e||(h(null),f([]))})}else i&&async function(...e){return(await Ou()).buildAnomalyAnnotations(...e)}(i).then(t=>{e||(h(null),f(t))}).catch(()=>{e||f([])});return()=>{e=!0}},[c,r,i,a,l,s]),{effectiveData:u?u.processedData:t,statisticalAnnotations:d,hasForecast:!!u,xAccessorKey:a,yAccessorKey:l}}import{jsx as Yu}from"react/jsx-runtime";var Gu="__lineObjectSeries",Vu=Il(function(e,t){const n=Tl(null);Ru(t,{variant:"xy",frameRef:n});const o=qc(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:i,className:s,xFormat:a,yFormat:l,axisExtent:c,xAccessor:u="x",yAccessor:h="y",lineBy:d,lineDataAccessor:f="coordinates",colorBy:p,colorScheme:y,styleRules:m,curve:g="linear",showPoints:b=!1,pointRadius:v=3,fillArea:x=!1,areaOpacity:k=.3,lineWidth:w=2,lineGradient:A,tooltip:S,pointIdAccessor:C,annotations:M,directLabel:P,gapStrategy:L="break",anomaly:R,forecast:I,band:T,xExtent:N,yExtent:F,frameProps:B={},selection:O,linkedHover:W,onObservation:D,onClick:z,hoverHighlight:H,hoverRadius:E,chartId:$,loading:j,loadingContent:Y,emptyContent:G,legendInteraction:V,legendPosition:X,xScaleType:q,yScaleType:U,color:K,stroke:Q,strokeWidth:Z,opacity:J}=e,{width:ee,height:te,enableHover:ne,showGrid:oe,showLegend:re,title:ie,description:se,summary:ae,accessibleTable:le,xLabel:ce,yLabel:ue}=o,he=_l(()=>_(r),[r]),de=Array.isArray(he[0]?.[f])?he[0][f]:he;cu("LineChart",de,"xAccessor",u),cu("LineChart",de,"yAccessor",h);const{effectiveData:fe,statisticalAnnotations:pe}=ju({data:he,xAccessor:u,yAccessor:h,forecast:I,anomaly:R,groupBy:d}),ye="__compoundGroup",me=!(!I||!d),ge=me?ye:I?Fu:d,be=_l(()=>{if(!me)return fe;const e="function"==typeof d?d:e=>e[d];return fe.map(t=>{const n={...t};return n[ye]=`${e(t)}__${t[Fu]||"observed"}`,n})},[fe,me,d]),ve=me?be:fe,xe=p||d,ke=_l(()=>{if(!I)return;const e=I.upperBounds,t=I.lowerBounds;if(!e&&!t)return;const n="function"==typeof e?e:"string"==typeof e?t=>t[e]:null,o="function"==typeof t?t:"string"==typeof t?e=>e[t]:null;let r=1/0,i=-1/0;const s=fe;for(const e of s){const t="function"==typeof h?h(e):+e[h];if(isFinite(t)&&(r>t&&(r=t),t>i&&(i=t)),n){const t=n(e);null!=t&&isFinite(t)&&(t>i&&(i=t),r>t&&(r=t))}if(o){const t=o(e);null!=t&&isFinite(t)&&(r>t&&(r=t),t>i&&(i=t))}}return isFinite(r)&&isFinite(i)?[r,i]:void 0},[I,fe,h]),we=Pl(e=>{const t="function"==typeof u?u(e):e[u],n="function"==typeof h?h(e):e[h];return null==t||null==n||Number.isNaN(t)||Number.isNaN(n)},[u,h]),Ae=void 0!==ve[0]?.[f],Se=Ae?Gu:ge,Ce=_l(()=>{if(Ae)return ve.map((e,t)=>{const n="function"==typeof d?d(e):"string"==typeof d?e[d]:void 0,o=null==n?"line-"+t:n+"",r=Array.isArray(e[f])?e[f]:[];return{...e,[Gu]:o,[f]:r.map(t=>({...t,[Gu]:o,parentLine:e,..."string"==typeof d&&void 0!==e[d]?{[d]:e[d]}:{}}))}});if(ge){const e=ve.reduce((e,t)=>{const n="function"==typeof ge?ge(t):t[ge];if(!e[n]){const o={[f]:[]};"string"==typeof ge&&(o[ge]=n),me&&(o[Fu]=t[Fu],"string"==typeof d&&(o[d]=t[d])),e[n]=o}return e[n][f].push(t),e},{});return Object.values(e)}return[{[f]:ve}]},[Ae,ge,f,ve,d,me]),{gapProcessedLineData:_e,hasGaps:Pe}=_l(()=>{if("interpolate"===L){let e=!1;const t=[];for(const n of Ce){const o=(n[f]||[]).filter(t=>!we(t)||(e=!0,!1));o.length>0&&t.push({...n,[f]:o})}return{gapProcessedLineData:t,hasGaps:e}}if("break"===L){let e=!1;const t=[];for(const n of Ce){const o=n[f]||[];let r=[],i=0;const s=Se&&"string"==typeof Se?n[Se]:void 0;for(const a of o)if(we(a))e=!0,r.length>0&&(t.push({...n,[f]:r}),r=[],i++);else{const e=null!=s?`${s}__seg${i}`:"__seg"+i;r.push({...a,_gapSegment:e})}r.length>0&&t.push({...n,[f]:r})}return{gapProcessedLineData:t,hasGaps:e}}if("zero"===L){let e=!1;const t="string"==typeof h?h:"y",n=[];for(const o of Ce){const r=o[f]||[],i=[];for(const n of r)we(n)?(e=!0,i.push({...n,[t]:0})):i.push(n);n.push({...o,[f]:i})}return{gapProcessedLineData:n,hasGaps:e}}return{gapProcessedLineData:Ce,hasGaps:!1}},[Ce,L,f,we,Se,h]),Le="object"==typeof P?P:{},Re=Le.position||"end",Ie=Le.fontSize||11,Te=_l(()=>{if(!P||!xe)return[];const e="function"==typeof xe?xe:e=>e[xe],t=new Set;for(const n of _e){const o=n[f]||[];if(0===o.length)continue;const r=e("end"===Re?o[o.length-1]:o[0])??e(n);if(null==r)continue;const i=r+"";""!==i&&t.add(i)}return Array.from(t)},[P,xe,_e,f,Re]),Ne=_l(()=>{if(!P)return o.marginDefaults;const e=Te.reduce((e,t)=>Math.max(e,t.length*(.6*Ie)),0)+10,t="end"===Re?"right":"left";return{...o.marginDefaults,[t]:Math.max(o.marginDefaults[t]||0,e)}},[P,Te,Ie,Re,o.marginDefaults]),Fe=bu({data:fe,rawData:r,colorBy:xe,colorScheme:y,legendInteraction:V,legendPosition:X,selection:O,linkedHover:W,fallbackFields:xe?["string"==typeof xe?xe:""]:[],unwrapData:!1,onObservation:D,onClick:z,hoverHighlight:H,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"LineChart",chartId:$,showLegend:(!P||void 0!==re)&&re,userMargin:i,marginDefaults:Ne,loading:j,loadingContent:Y,emptyContent:G,width:ee,height:te}),Be=Fe.colorScale,Oe=Fe.effectiveSelectionHook,We=Fe.resolvedSelection,De=Fe.customHoverBehavior,ze=Fe.customClickBehavior,He=Fe.crosshairProps,Ee=_l(()=>{if(xe)return Ae?e=>{const t=e.parentLine||e;return"function"==typeof xe?xe(t):t[xe]}:xe},[xe,Ae]),$e=_l(()=>wu(u,h),[u,h]),je=Pu({lineWidth:w,colorBy:Ee,colorScale:Be,color:K,fillArea:x,areaOpacity:k,stroke:Q,strokeWidth:Z,opacity:J,effectiveSelectionHook:Oe,resolvedSelection:We,styleRules:m,ruleContext:$e}),[Ye,Ge]=Ll(null);Rl(()=>{if(!I)return void Ge(null);let e=!1;return async function(...e){return(await Ou()).createSegmentLineStyle(...e)}(je,I).then(t=>{e||Ge(()=>t)}).catch(()=>{e||Ge(null)}),()=>{e=!0}},[je,I]);const Ve=Ye||je,Xe=_l(()=>{if(b)return e=>{const t={r:v,fillOpacity:1};return xe?Be&&(t.fill=Me(e.parentLine||e,xe,Be)):t.fill=K||Wc,t}},[b,v,xe,Be,K]),qe=Array.isArray(x)?"mixed":x?"area":"line",Ue=_l(()=>{if(!P||!xe)return[];const e="function"==typeof u?u:e=>e[u],t="function"==typeof h?h:e=>e[h],n="function"==typeof xe?xe:e=>e[xe],o=new Map;for(const e of _e){const t=e[f]||[];if(0===t.length)continue;const r="end"===Re?t[t.length-1]:t[0],i=n(r)??n(e);if(null==i)continue;const s=i+"";""===s||o.has(s)||o.set(s,r)}const r=Array.from(o.entries()).map(([n,o])=>({type:"text",label:n,["string"==typeof u?u:"x"]:e(o),["string"==typeof h?h:"y"]:t(o),dx:"end"===Re?6:-6,dy:0,color:Be?Be(n):Wc,fontSize:Ie}));r.sort((e,t)=>{const n="string"==typeof h?h:"y";return e[n]-t[n]});for(let e=1;r.length>e;e++){const t="string"==typeof h?h:"y",n=r[e-1],o=r[e];Ie+2>Math.abs(o[t]+o.dy-(n[t]+n.dy))&&(o.dy+=Ie+2)}return r},[P,xe,Be,_e,f,u,h,Re,Ie]),Ke=Fe.margin,Qe=d||p,Ze=_l(()=>ll([{label:ce||ol(u),accessor:u,role:"x",format:a},{label:ue||ol(h),accessor:h,role:"y",format:l},...Qe?[{label:ol(Qe),accessor:Qe,role:"group"}]:[],...al(T,l)]),[u,h,ce,ue,Qe,a,l,T]),Je=du({componentName:"LineChart",data:Ae?fe[0]?.[f]||[]:r,accessors:{xAccessor:u,yAccessor:h}}),et=_l(()=>Ae||Se||Pe?_e.flatMap(e=>{const t=e[f]||[];return Se&&"string"==typeof Se?t.map(t=>({...t,[Se]:t[Se]??e[Se]})):t}):ve,[_e,f,Ae,Se,ve,Pe]),tt={chartType:qe,...Array.isArray(x)&&{areaGroups:x},...A&&{lineGradient:A},...null!=r&&{data:et},xAccessor:u,yAccessor:h,xScaleType:q,yScaleType:U,...N&&{xExtent:N},...!F||null==F[0]&&null==F[1]?ke?{yExtent:ke}:{}:{yExtent:F},groupAccessor:"break"===L&&Pe?"_gapSegment":Se||void 0,...T&&{band:T},curve:g,lineStyle:Ve,...b&&{pointStyle:Xe},size:[ee,te],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Ke,showAxes:o.showAxes,xLabel:ce,yLabel:ue,xFormat:a,yFormat:l,...void 0!==c&&{axisExtent:c},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},enableHover:ne,showGrid:oe,...Fe.legendBehaviorProps,...ie&&{title:ie},...se&&{description:se},...ae&&{summary:ae},...void 0!==le&&{accessibleTable:le},...s&&{className:s},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===S?()=>null:"multi"===S?Ys():Gs(S)||Ze,..."multi"===S&&{tooltipMode:"multi"},...Tu({linkedHover:W,selection:O,onObservation:D,onClick:z,hoverRadius:E,hoverHighlight:H,mobileInteraction:Fe.mobileInteraction,customHoverBehavior:De,customClickBehavior:ze}),...C&&{pointIdAccessor:C},...(M?.length||pe.length||Ue.length)&&{annotations:[...M||[],...pe,...Ue]},...He,...B};return Fe.earlyReturn?Fe.earlyReturn:Je?Yu(Zc,{componentName:"LineChart",message:Je,width:ee,height:te}):Yu(ru,{componentName:"LineChart",width:ee,height:te,children:Yu(Ml,{ref:n,...tt})})});Vu.displayName="LineChart";import{useMemo as Xu,forwardRef as qu,useRef as Uu}from"react";import{useMemo as Ku}from"react";function Qu(e){const{safeData:t,data:n,areaBy:o,lineDataAccessor:r,colorBy:i,colorScale:s,color:a,stroke:l,strokeWidth:c,opacity:u,effectiveSelectionHook:h,resolvedSelection:d,areaOpacity:f,showLine:p,lineWidth:y,showPoints:m,pointRadius:g,xAccessor:b,yAccessor:v,xLabel:x,yLabel:k,xFormat:w,yFormat:A,groupField:S,styleRules:C,ruleContext:M}=e,_=void 0!==t[0]?.[r],P=Ku(()=>{if(null==n)return[];if(!_&&!o)return t;let e;if(_)e=t;else{const n=o,i=t.reduce((e,t)=>{const o="function"==typeof n?n(t):t[n];if(!e[o]){const t={[r]:[]};"string"==typeof n&&(t[n]=o),e[o]=t}return e[o][r].push(t),e},{});e=Object.values(i)}return e.flatMap(e=>{const t=e[r]||[];return o&&"string"==typeof o?t.map(t=>({...t,[o]:e[o]})):t})},[n,t,o,r,_]),L=Ku(()=>e=>{const t={};if(i){if(s){const n=Me(e,i,s);t.fill=n,p?(t.stroke=n,t.strokeWidth=y):t.stroke="none"}}else{const e=a||Wc;t.fill=e,p?(t.stroke=e,t.strokeWidth=y):t.stroke="none"}return t.fillOpacity=f,C&&C.length>0&&Object.assign(t,Mu(e,C,M?M(e):{value:void 0})),t},[i,s,a,f,p,y,C,M]),R=Ku(()=>xu(L,{stroke:l,strokeWidth:c,opacity:u}),[L,l,c,u]);return{flattenedData:P,lineStyle:Ku(()=>Mc(R,h??null,d),[R,h,d]),pointStyle:Ku(()=>{if(m)return e=>{const t={r:g,fillOpacity:1};return i?s&&(t.fill=Me(e.parentLine||e,i,s)):t.fill=a||Wc,t}},[m,g,i,s,a]),defaultTooltipContent:Ku(()=>ll([{label:x||ol(b),accessor:b,role:"x",format:w},{label:k||ol(v),accessor:v,role:"y",format:A},...S?[{label:ol(S),accessor:S,role:"group"}]:[],...al(e.band,A)]),[b,v,x,k,S,w,A,e.band])}}import{jsx as Zu}from"react/jsx-runtime";function Ju(e,t){if(null==t)return e;const n=e.trim(),o=n.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(o){const e=o[1],n=3===e.length?e.split("").map(e=>e+e).join(""):e;return`rgba(${parseInt(n.slice(0,2),16)}, ${parseInt(n.slice(2,4),16)}, ${parseInt(n.slice(4,6),16)}, ${t})`}if(n.startsWith("rgba(")){const e=n.lastIndexOf(","),o=n.lastIndexOf(")");if(-1!==e&&o>e)return`${n.slice(0,e+1)} ${t})`}return n.startsWith("rgb(")?n.replace(/^rgb\(/,"rgba(").replace(/\)$/,`, ${t})`):e}var eh=qu(function(e,t){const n=Uu(null);Ru(t,{variant:"xy",frameRef:n});const o=qc(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:i,className:s,xFormat:a,yFormat:l,xAccessor:c="x",yAccessor:u="y",areaBy:h,y0Accessor:d,gradientFill:f=!1,semanticGradient:p,lineDataAccessor:y="coordinates",colorBy:m,colorScheme:g,styleRules:b,curve:v="monotoneX",areaOpacity:x=.7,lineGradient:k,showLine:w=!0,lineWidth:A=2,showPoints:S=!1,pointRadius:C=3,tooltip:M,annotations:P,forecast:L,anomaly:R,band:I,xExtent:T,yExtent:N,frameProps:F={},selection:B,linkedHover:O,onObservation:W,onClick:D,hoverHighlight:z,chartId:H,loading:E,loadingContent:$,emptyContent:j,legendInteraction:Y,legendPosition:G,color:V,stroke:X,strokeWidth:q,opacity:U}=e,{width:K,height:Q,enableHover:Z,showGrid:J,showLegend:ee,title:te,description:ne,summary:oe,accessibleTable:re,xLabel:ie,yLabel:se}=o,ae=Xu(()=>_(r),[r]),le=m||h,ce=Xu(()=>{return p&&p.length>0?{colorStops:(e=p,e.filter(e=>Number.isFinite(e.at)).map(e=>({offset:1-Math.max(0,Math.min(100,e.at))/100,color:Ju(e.color,e.opacity)})).sort((e,t)=>e.offset-t.offset))}:f;var e},[p,f]);cu("AreaChart",ae,"xAccessor",c),cu("AreaChart",ae,"yAccessor",u);const ue=bu({data:ae,rawData:r,colorBy:le,colorScheme:g,legendInteraction:Y,legendPosition:G,selection:B,linkedHover:O,fallbackFields:le?["string"==typeof le?le:""]:[],unwrapData:!1,onObservation:W,onClick:D,hoverHighlight:z,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"AreaChart",chartId:H,showLegend:ee,userMargin:i,marginDefaults:o.marginDefaults,loading:E,loadingContent:$,emptyContent:j,width:K,height:Q}),{effectiveData:he,statisticalAnnotations:de}=ju({data:ae,xAccessor:c,yAccessor:u,forecast:L,anomaly:R,groupBy:h}),fe=Xu(()=>wu(c,u),[c,u]),{flattenedData:pe,lineStyle:ye,pointStyle:me,defaultTooltipContent:ge}=Qu({safeData:he,data:r,areaBy:h,lineDataAccessor:y,colorBy:le,colorScale:ue.colorScale,color:V,stroke:X,strokeWidth:q,opacity:U,effectiveSelectionHook:ue.effectiveSelectionHook,resolvedSelection:ue.resolvedSelection,areaOpacity:x,showLine:w,lineWidth:A,showPoints:S,pointRadius:C,xAccessor:c,yAccessor:u,xLabel:ie,yLabel:se,xFormat:a,yFormat:l,groupField:h||m,band:I,styleRules:b,ruleContext:fe}),be=du({componentName:"AreaChart",data:r,accessors:{xAccessor:c,yAccessor:u}}),ve={chartType:"area",...null!=r&&{data:pe},xAccessor:c,yAccessor:u,groupAccessor:h||void 0,...d&&{y0Accessor:d},...I&&{band:I},...ce&&{gradientFill:ce},...k&&{lineGradient:k},curve:v,lineStyle:ye,...S&&me&&{pointStyle:me},size:[K,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ue.margin,showAxes:o.showAxes,xLabel:ie,yLabel:se,xFormat:a,yFormat:l,enableHover:Z,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:J,...ue.legendBehaviorProps,...Iu({title:te,description:ne,summary:oe,accessibleTable:re,className:s,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),..."multi"===M?{tooltipContent:Ys(),tooltipMode:"multi"}:Nu({tooltip:M,defaultTooltipContent:ge}),...Tu({linkedHover:O,selection:B,onObservation:W,onClick:D,hoverHighlight:z,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior}),...(P&&P.length>0||de.length>0)&&{annotations:[...P||[],...de]},...T&&{xExtent:T},...N&&{yExtent:N},...ue.crosshairProps,...F};return ue.earlyReturn?ue.earlyReturn:be?Zu(Zc,{componentName:"AreaChart",message:be,width:K,height:Q}):Zu(ru,{componentName:"AreaChart",width:K,height:Q,children:Zu(Ml,{ref:n,...ve})})});eh.displayName="AreaChart";import{useMemo as th,forwardRef as nh,useRef as oh,useState as rh,useImperativeHandle as ih,useCallback as sh}from"react";import{jsx as ah,jsxs as lh}from"react/jsx-runtime";function ch(e){if(null==e)return NaN;if("number"==typeof e)return e;if(e instanceof Date)return e.getTime();if("string"==typeof e){if(""===e.trim())return NaN;const t=+e;return Number.isFinite(t)?t:NaN}return NaN}var uh=nh(function(e,t){const n=oh(null),o=qc(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:i,className:s,xFormat:a,yFormat:l,xAccessor:c="x",seriesAAccessor:u="a",seriesBAccessor:h="b",seriesALabel:d="A",seriesBLabel:f="B",seriesAColor:p="var(--semiotic-danger, #dc2626)",seriesBColor:y="var(--semiotic-info, #2563eb)",showLines:m=!0,lineWidth:g=1.5,showPoints:b=!1,pointRadius:v=3,curve:x="linear",areaOpacity:k=.6,gradientFill:w,tooltip:A,annotations:S,xExtent:C,yExtent:M,frameProps:P={},selection:L,linkedHover:R,onObservation:I,onClick:T,hoverHighlight:N,chartId:F,loading:B,loadingContent:O,emptyContent:W,legendInteraction:D,legendPosition:z,pointIdAccessor:H,windowSize:E}=e,{width:$,height:j,enableHover:Y,showGrid:G,showLegend:V,title:X,description:q,summary:U,accessibleTable:K,xLabel:Q,yLabel:Z}=o,J=th(()=>"function"==typeof c?e=>ch(c(e)):e=>ch(e[c]),[c]),ee=th(()=>"function"==typeof u?e=>ch(u(e)):e=>ch(e[u]),[u]),te=th(()=>"function"==typeof h?e=>ch(h(e)):e=>ch(e[h]),[h]),[ne,oe]=rh([]),re=oh([]),ie=null==r,se=th(()=>_(ie?ne:r),[ie,ne,r]),ae=th(()=>function(e,t,n,o){if(!e.length)return[];const r=e.filter(e=>Number.isFinite(t(e))).sort((e,n)=>t(e)-t(n)),i=[];let s=0,a=null,l=null,c=[];const u=(e,t)=>e>t?"A":t>e?"B":null,h=e=>`seg-${s}-${e}`,d=e=>i.push(e),f=(e,t)=>{d({__x:e.x,__y:e.y,__y0:e.y,__diffSegment:h(t),__diffWinner:t,__valA:e.y,__valB:e.y,__sourceDatum:e.datum})};for(let e=0;r.length>e;e++){const i=r[e],p=t(i),y=n(i),m=o(i);if(!Number.isFinite(p)||!Number.isFinite(y)||!Number.isFinite(m))continue;const g=u(y,m);if(null!==g)if(null!=a){if(l&&l.w!==g){let e,t;if(c.length>0)e=c[0].x,t=c[0].y;else{const n=y-l.a-(m-l.b);if(0!==n){const o=Math.max(0,Math.min(1,(l.b-l.a)/n));e=l.x+o*(p-l.x),t=l.a+o*(y-l.a)}else e=l.x,t=l.a}d({__x:e,__y:t,__y0:t,__diffSegment:h(a),__diffWinner:a,__valA:t,__valB:t}),s++,a=g,d({__x:e,__y:t,__y0:t,__diffSegment:h(a),__diffWinner:a,__valA:t,__valB:t});for(let e=1;c.length>e;e++)f(c[e],a)}else for(const e of c)f(e,a);c=[],d({__x:p,__y:m>y?m:y,__y0:m>y?y:m,__diffSegment:h(a),__diffWinner:a,__valA:y,__valB:m,__sourceDatum:i}),l={x:p,a:y,b:m,w:g}}else{a=g;for(const e of c)f(e,a);c=[],d({__x:p,__y:m>y?m:y,__y0:m>y?y:m,__diffSegment:h(a),__diffWinner:a,__valA:y,__valB:m,__sourceDatum:i}),l={x:p,a:y,b:m,w:g}}else c.push({x:p,y:y,datum:i})}for(const e of c)f(e,a??"A");return i}(se,J,ee,te),[se,J,ee,te]),le=th(()=>m?function(e,t,n,o){if(!e.length)return[];const r=e.filter(e=>Number.isFinite(t(e))).sort((e,n)=>t(e)-t(n)),i=[];for(const e of r){const r=t(e),s=n(e),a=o(e);Number.isFinite(s)&&i.push({__x:r,__y:s,__diffSegment:"line-A"}),Number.isFinite(a)&&i.push({__x:r,__y:a,__diffSegment:"line-B"})}return i}(se,J,ee,te):[],[m,se,J,ee,te]),ce=th(()=>[...ae,...le],[ae,le]),ue=th(()=>{const e=new Set;for(const t of ae)e.add(t.__diffSegment);return Array.from(e)},[ae]);ih(t,()=>{const e=e=>{const t=E&&e.length>E?e.slice(e.length-E):e;re.current=t,oe(t)},t=H?"function"==typeof H?H:e=>e[H]:null;return{push:t=>e([...re.current,t]),pushMany:t=>e([...re.current,...t]),remove:n=>{if(!t)return[];const o=Array.isArray(n)?n:[n],r=[],i=[];for(const e of re.current)o.includes(t(e))?r.push(e):i.push(e);return e(i),r},update:(n,o)=>{if(!t)return[];const r=Array.isArray(n)?n:[n],i=[],s=re.current.map(e=>{if(r.includes(t(e))){const t=o(e);return i.push(t),t}return e});return e(s),i},clear:()=>e([]),getData:()=>ie?re.current:se,getScales:()=>n.current?.getScales()??null}},[ie,se,H,E]);const he=bu({data:se,rawData:r,colorBy:"__diffWinner",colorScheme:[p,y],legendInteraction:D,legendPosition:z,selection:L,linkedHover:R,fallbackFields:["__diffWinner"],unwrapData:!1,onObservation:I,onClick:T,hoverHighlight:N,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DifferenceChart",chartId:F,showLegend:V,userMargin:i,marginDefaults:o.marginDefaults,loading:B,loadingContent:O,emptyContent:W,width:$,height:j}),de=th(()=>{if(!1!==V)return{legendGroups:[{label:"",type:"fill",styleFn:e=>({fill:e.color||"currentColor"}),items:[{label:d,color:p},{label:f,color:y}]}]}},[V,d,f,p,y]),fe=sh(e=>{const t=e.__diffSegment;return{fill:"A"==(t?.endsWith("-A")?"A":"B")?p:y,stroke:"none",fillOpacity:k}},[p,y,k]),pe=sh(e=>({stroke:"A"==("line-A"===e.__diffSegment?"A":"B")?p:y,strokeWidth:g,fill:"none"}),[p,y,g]),ye=sh(e=>({fill:"A"==("line-A"===e.__diffSegment?"A":"B")?p:y,r:v}),[p,y,v]),me=sh(e=>{const t=e.data,n=e.allSeries,o=e.xValue??t?.__x;let r=t?.__valA,i=t?.__valB;if(n&&n.length>0){const e=n.find(e=>"line-A"===e.group),t=n.find(e=>"line-B"===e.group);null!=e?.value&&Number.isFinite(e.value)&&(r=e.value),null!=t?.value&&Number.isFinite(t.value)&&(i=t.value)}if(null!=o&&(null==r||null==i)){const e=se.find(e=>J(e)===o);e&&(null==r&&(r=ee(e)),null==i&&(i=te(e)))}const s=e=>null!=e&&Number.isFinite(e)?""+Math.round(100*e)/100:"—",l=a&&null!=o?a(o):null!=o?o+"":"";return lh("div",{className:"semiotic-tooltip",style:Hs,children:[l&&ah("div",{style:{fontWeight:600,marginBottom:4},children:l}),lh("div",{style:{display:"flex",alignItems:"center",gap:6},children:[ah("span",{style:{width:10,height:10,background:p,display:"inline-block",borderRadius:2}}),lh("span",{children:[d,": ",s(r)]})]}),lh("div",{style:{display:"flex",alignItems:"center",gap:6},children:[ah("span",{style:{width:10,height:10,background:y,display:"inline-block",borderRadius:2}}),lh("span",{children:[f,": ",s(i)]})]}),null!=r&&null!=i&&Number.isFinite(r)&&Number.isFinite(i)&&lh("div",{style:{marginTop:4,opacity:.7},children:["Δ = ",s(r-i)]})]})},[se,J,ee,te,a,p,y,d,f]),ge="multi"===A,be=th(()=>!1===A?()=>null:ge?me:Gs(A)||me,[A,ge,me]);if(he.earlyReturn)return he.earlyReturn;const ve={chartType:"mixed",data:ce,xAccessor:"__x",yAccessor:"__y",y0Accessor:"__y0",groupAccessor:"__diffSegment",areaGroups:ue,curve:x,areaStyle:fe,lineStyle:pe,...b&&{pointStyle:ye},size:[$,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:he.margin,showAxes:o.showAxes,xLabel:Q,yLabel:Z,xFormat:a,yFormat:l,enableHover:Y,showGrid:G,...w&&{gradientFill:!0===w?{topOpacity:.85,bottomOpacity:.15}:w},...de&&{legend:de,legendPosition:he.legendPosition},...Iu({title:X,description:q,summary:U,accessibleTable:K,className:s,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),tooltipContent:be,...ge&&{tooltipMode:"multi"},...Tu({linkedHover:R,selection:L,onObservation:I,onClick:T,hoverHighlight:N,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...S&&S.length>0&&{annotations:S},...C&&{xExtent:C},...M&&{yExtent:M},...he.crosshairProps,...P};return ah(ru,{componentName:"DifferenceChart",width:$,height:j,children:ah(Ml,{ref:n,...ve})})});"function"==typeof uh&&(uh.displayName="DifferenceChart");import{useMemo as hh,forwardRef as dh,useRef as fh}from"react";import{jsx as ph}from"react/jsx-runtime";var yh=dh(function(e,t){const n=fh(null),o=qc(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:i,className:s,xFormat:a,yFormat:l,xAccessor:c="x",yAccessor:u="y",areaBy:h,lineDataAccessor:d="coordinates",colorBy:f,colorScheme:p,styleRules:y,curve:m="monotoneX",areaOpacity:g=.7,showLine:b=!0,lineWidth:v=2,showPoints:x=!1,pointRadius:k=3,normalize:w=!1,baseline:A="zero",stackOrder:S,tooltip:C,annotations:M,xExtent:P,yExtent:L,frameProps:R={},selection:I,linkedHover:T,onObservation:N,onClick:F,hoverHighlight:B,chartId:O,loading:W,loadingContent:D,emptyContent:z,legendInteraction:H,legendPosition:E,color:$,stroke:j,strokeWidth:Y,opacity:G}=e,{width:V,height:X,enableHover:q,showGrid:U,showLegend:K,title:Q,description:Z,summary:J,accessibleTable:ee,xLabel:te,yLabel:ne}=o,oe=hh(()=>_(r),[r]),re=f||h;Ru(t,{variant:"xy",frameRef:n});const ie=bu({data:oe,rawData:r,colorBy:re,colorScheme:p,legendInteraction:H,legendPosition:E,selection:I,linkedHover:T,fallbackFields:re?["string"==typeof re?re:""]:[],unwrapData:!1,onObservation:N,onClick:F,hoverHighlight:B,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"StackedAreaChart",chartId:O,showLegend:K,userMargin:i,marginDefaults:o.marginDefaults,loading:W,loadingContent:D,emptyContent:z,width:V,height:X}),se=hh(()=>wu(c,u),[c,u]),{flattenedData:ae,lineStyle:le,pointStyle:ce,defaultTooltipContent:ue}=Qu({safeData:oe,data:r,areaBy:h,lineDataAccessor:d,colorBy:re,colorScale:ie.colorScale,color:$,stroke:j,strokeWidth:Y,opacity:G,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,areaOpacity:g,showLine:b,lineWidth:v,showPoints:x,pointRadius:k,xAccessor:c,yAccessor:u,xLabel:te,yLabel:ne,xFormat:a,yFormat:l,groupField:h||f,styleRules:y,ruleContext:se}),he=du({componentName:"StackedAreaChart",data:r,accessors:{xAccessor:c,yAccessor:u}}),de={chartType:"stackedarea",...null!=r&&{data:ae},xAccessor:c,yAccessor:u,groupAccessor:h||void 0,curve:m,normalize:w,baseline:w?"zero":A,stackOrder:S,lineStyle:le,...x&&ce&&{pointStyle:ce},size:[V,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,showAxes:o.showAxes,xLabel:te,yLabel:ne,xFormat:a,yFormat:l,enableHover:q,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:U,...ie.legendBehaviorProps,...Iu({title:Q,description:Z,summary:J,accessibleTable:ee,className:s,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),..."multi"===C?{tooltipContent:Ys(),tooltipMode:"multi"}:Nu({tooltip:C,defaultTooltipContent:ue}),...Tu({linkedHover:T,selection:I,onObservation:N,onClick:F,hoverHighlight:B,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...M&&M.length>0&&{annotations:M},...P&&{xExtent:P},...L&&{yExtent:L},...ie.crosshairProps,...R};return ie.earlyReturn?ie.earlyReturn:he?ph(Zc,{componentName:"StackedAreaChart",message:he,width:V,height:X}):ph(ru,{componentName:"StackedAreaChart",width:V,height:X,children:ph(Ml,{ref:n,...de})})});yh.displayName="StackedAreaChart";import*as mh from"react";import{useMemo as gh,useCallback as bh,forwardRef as vh,useRef as xh}from"react";import{useMemo as kh}from"react";function wh(e){const{colorBy:t,colorScale:n,color:o,pointRadius:r=5,radiusFn:i,fillOpacity:s=1,fallbackFill:a,baseStyleExtras:l,stroke:c,strokeWidth:u,opacity:h,effectiveSelectionHook:d,resolvedSelection:f,colorDatumAccessor:p,styleRules:y,ruleContext:m}=e,g=kh(()=>e=>{const c="function"==typeof l?l(e):l,u=c?{...c}:{};if(void 0===u.fillOpacity&&(u.fillOpacity=s),void 0===u.fill)if(t){if(n){const o=p?p(e):e;u.fill=Me(o,t,n)}}else u.fill=a?a(e):o||Wc;return void 0===u.r&&(u.r=i?i(e):r),y&&y.length>0&&Object.assign(u,Mu(e,y,m?m(e):{value:void 0})),u},[t,n,o,r,i,s,a,l,p,y,m]),b=kh(()=>xu(g,{stroke:c,strokeWidth:u,opacity:h}),[g,c,u,h]);return kh(()=>Mc(b,d??null,f),[b,d,f])}import{useCallback as Ah,useMemo as Sh,useRef as Ch,useState as Mh}from"react";function _h(e){const{accessor:t,data:n,isPushMode:o}=e,r=Ch(null),[i,s]=Mh(0),a=Ah(e=>{if(!o||!t)return;let n=!1;for(const o of e){const e="function"==typeof t?t(o):o[t];if(null==e)continue;const i="number"==typeof e?e:Number(e);Number.isFinite(i)&&(r.current?(r.current[0]>i&&(r.current[0]=i,n=!0),i>r.current[1]&&(r.current[1]=i,n=!0)):(r.current=[i,i],n=!0))}n&&s(e=>e+1)},[o,t]),l=Ah(()=>{o&&(r.current=null,s(e=>e+1))},[o]);return{domain:Sh(()=>{if(o)return r.current??void 0;if(!t||0===n.length)return;const e="function"==typeof t?t:e=>e[t];let i=1/0,s=-1/0;for(const t of n){const n=e(t);if(null==n)continue;const o="number"==typeof n?n:Number(n);Number.isFinite(o)&&(i>o&&(i=o),o>s&&(s=o))}return Number.isFinite(i)&&Number.isFinite(s)?[i,s]:void 0},[n,t,o,i]),trackPushed:a,reset:l}}function Ph(e){if(!e)return;const t="boolean"==typeof e?{}:"string"==typeof e?{method:e}:e;return{type:"trend",method:t.method??"linear",...null!=t.bandwidth&&{bandwidth:t.bandwidth},...null!=t.order&&{order:t.order},...null!=t.color&&{color:t.color},...null!=t.strokeWidth&&{strokeWidth:t.strokeWidth},...null!=t.strokeDasharray&&{strokeDasharray:t.strokeDasharray},...null!=t.label&&{label:t.label}}}import{jsx as Lh}from"react/jsx-runtime";var Rh=vh(function(e,t){const n=xh(null),o=qc(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:i,className:s,xFormat:a,yFormat:l,xAccessor:c="x",yAccessor:u="y",xScaleType:h,yScaleType:d,colorBy:f,colorScheme:p,styleRules:y,sizeBy:m,sizeRange:g=[3,15],symbolBy:b,symbolMap:v,pointRadius:x=5,pointOpacity:k=.8,tooltip:w,marginalGraphics:A,pointIdAccessor:S,annotations:C,regression:M,forecast:P,anomaly:L,xExtent:R,yExtent:I,frameProps:T={},selection:N,linkedHover:F,linkedBrush:B,onObservation:O,onClick:W,hoverHighlight:D,chartId:z,loading:H,loadingContent:E,emptyContent:$,legendInteraction:j,legendPosition:Y,color:G,stroke:V,strokeWidth:X,opacity:q}=e,{width:U,height:K,enableHover:Q,showGrid:Z,showLegend:J,title:ee,description:te,summary:ne,accessibleTable:oe,xLabel:re,yLabel:ie}=o,se=gh(()=>_(r),[r]),ae=void 0===r,{domain:le,trackPushed:ce,reset:ue}=_h({accessor:m,data:se,isPushMode:ae}),he=bh(e=>{ce([e]),n.current?.push(e)},[ce]),de=bh(e=>{ce(e),n.current?.pushMany(e)},[ce]);Ru(t,{variant:"xy",frameRef:n,overrides:{push:he,pushMany:de,clear:()=>{ue(),n.current?.clear()}}});const fe=bu({data:se,rawData:r,colorBy:f,colorScheme:p,legendInteraction:j,legendPosition:Y,selection:N,linkedHover:F,fallbackFields:f?["string"==typeof f?f:""]:[],unwrapData:!1,onObservation:O,onClick:W,hoverHighlight:D,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"Scatterplot",chartId:z,showLegend:J,userMargin:i,marginDefaults:o.marginDefaults,loading:H,loadingContent:E,emptyContent:$,width:U,height:K}),pe=Cc(B),ye=hc({name:pe?.name||"__unused_brush__",xField:pe?.xField||("string"==typeof c?c:void 0),yField:pe?.yField||("string"==typeof u?u:void 0)}),me=pe?"xyBrush"===ye.brushInteraction.brush?"xy":"xBrush"===ye.brushInteraction.brush?"x":"y":void 0,ge=mh.useRef(ye.brushInteraction);ge.current=ye.brushInteraction;const be=bh(e=>{const t=ge.current;t.end(e?"xyBrush"===t.brush?[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:"xBrush"===t.brush?e.x:e.y:null)},[]);cu("Scatterplot",se,"xAccessor",c),cu("Scatterplot",se,"yAccessor",u);const ve=gh(()=>m?le??[0,1]:void 0,[m,le]),xe=gh(()=>m?e=>Le(e,m,g,ve):void 0,[m,g,ve]),ke=gh(()=>wu(c,u),[c,u]),we=wh({colorBy:f,colorScale:fe.colorScale,color:G,pointRadius:x,fillOpacity:k,radiusFn:xe,stroke:V,strokeWidth:X,opacity:q,styleRules:y,ruleContext:ke,effectiveSelectionHook:fe.effectiveSelectionHook,resolvedSelection:fe.resolvedSelection}),Ae=gh(()=>ll([{label:re||ol(c),accessor:c,role:"x",format:a},{label:ie||ol(u),accessor:u,role:"y",format:l},...f?[{label:ol(f),accessor:f,role:"color"}]:[],...m?[{label:ol(m),accessor:m,role:"size"}]:[]]),[c,u,re,ie,f,m,a,l]),{effectiveData:Se,statisticalAnnotations:Ce}=ju({data:se,xAccessor:c,yAccessor:u,forecast:P,anomaly:L}),Me=gh(()=>{const e=Ph(M);return e||0!==Ce.length?[...e?[e]:[],...C||[],...Ce]:C},[M,C,Ce]);if(fe.earlyReturn)return fe.earlyReturn;const _e=du({componentName:"Scatterplot",data:r,accessors:{xAccessor:c,yAccessor:u}});if(_e)return Lh(Zc,{componentName:"Scatterplot",message:_e,width:U,height:K});const Pe={chartType:"scatter",...null!=r&&{data:Se},xAccessor:c,yAccessor:u,xScaleType:h,yScaleType:d,colorAccessor:f||void 0,sizeAccessor:m||void 0,...b&&{symbolAccessor:b},...v&&{symbolMap:v},sizeRange:g,pointStyle:we,colorScheme:p,size:[U,K],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe.margin,showAxes:o.showAxes,xLabel:re,yLabel:ie,xFormat:a,yFormat:l,enableHover:Q,showGrid:Z,...fe.legendBehaviorProps,...Iu({title:ee,description:te,summary:ne,accessibleTable:oe,className:s,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Nu({tooltip:w,defaultTooltipContent:Ae}),...Tu({linkedHover:F,selection:N,onObservation:O,onClick:W,hoverHighlight:D,mobileInteraction:fe.mobileInteraction,customHoverBehavior:fe.customHoverBehavior,customClickBehavior:fe.customClickBehavior}),...A&&{marginalGraphics:A},...S&&{pointIdAccessor:S},...Me&&Me.length>0&&{annotations:Me},...R&&{xExtent:R},...I&&{yExtent:I},...pe&&{brush:{dimension:me},onBrush:be},...fe.crosshairProps,...T};return Lh(ru,{componentName:"Scatterplot",width:U,height:K,children:Lh(Ml,{ref:n,...Pe})})});Rh.displayName="Scatterplot";import{useMemo as Ih,forwardRef as Th,useRef as Nh}from"react";import{Fragment as Fh,jsx as Bh}from"react/jsx-runtime";function Oh(e,t){return pe(1===t?.5:e/(t-1))}var Wh=Th(function(e,t){const n=Nh(null);Ru(t,{variant:"xy",frameRef:n});const o=qc(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:i,className:s,xFormat:a,yFormat:l,xAccessor:c="x",yAccessor:u="y",orderAccessor:h,orderLabel:d,styleRules:f,pointRadius:p=4,tooltip:y,pointIdAccessor:m,annotations:g,regression:b,forecast:v,anomaly:x,xExtent:k,yExtent:w,frameProps:A={},selection:S,linkedHover:C,onObservation:M,onClick:_,hoverHighlight:P,chartId:L,loading:R,loadingContent:I,emptyContent:T,legendInteraction:N,stroke:F,strokeWidth:B,opacity:O}=e,{width:W,height:D,enableHover:z,showGrid:H,title:E,description:$,summary:j,accessibleTable:Y,xLabel:G,yLabel:V}=o,{safeData:X,orderMap:q}=Ih(()=>{const e=r||[],t="function"==typeof c?c:e=>e[c],n="function"==typeof u?u:e=>e[u];let o=e;if(h&&e.length>0){const t="function"==typeof h?h:e=>e[h];o=[...e].sort((e,n)=>{const o=t(e),r=t(n);return(o instanceof Date?o.getTime():+o)-(r instanceof Date?r.getTime():+r)})}const i=new WeakMap;let s=0;for(const e of o){const o=t(e),r=n(e);null!=o&&null!=r&&isFinite(o)&&isFinite(r)&&s++}let a=0;for(const e of o){const o=t(e),r=n(e);null!=o&&null!=r&&isFinite(o)&&isFinite(r)&&i.set(e,{idx:a++,total:s})}return{safeData:o,orderMap:i}},[r,h,c,u]);cu("ConnectedScatterplot",X,"xAccessor",c),cu("ConnectedScatterplot",X,"yAccessor",u);const U=bu({data:X,rawData:r,colorBy:void 0,colorScheme:void 0,legendInteraction:N,selection:S,linkedHover:C,fallbackFields:[],unwrapData:!1,onObservation:M,onClick:_,hoverHighlight:P,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ConnectedScatterplot",chartId:L,showLegend:void 0,userMargin:i,marginDefaults:{top:50,right:40,bottom:60,left:70},loading:R,loadingContent:I,emptyContent:T,width:W,height:D}),K=U.resolvedSelection?.unselectedOpacity??.5,Q=Ih(()=>(e,t)=>{const n=t.filter(e=>"point"===e.type);if(2>n.length)return;const o=U.effectiveSelectionHook?.isActive,r=U.effectiveSelectionHook?.predicate,i=100>n.length,s=n.length;e.lineCap="round";for(let t=0;s-1>t;t++){const a=n[t],l=n[t+1],c=Oh(t,s),u=!o||!r||r(a.datum??a)||r(l.datum??l),h=o?u?1:K:1;i&&(e.beginPath(),e.moveTo(a.x,a.y),e.lineTo(l.x,l.y),e.strokeStyle="white",e.lineWidth=p+2,e.globalAlpha=.5*h,e.stroke()),e.beginPath(),e.moveTo(a.x,a.y),e.lineTo(l.x,l.y),e.strokeStyle=c,e.lineWidth=p,e.globalAlpha=h,e.stroke()}e.globalAlpha=1},[p,U.effectiveSelectionHook,K]),Z=Ih(()=>[Q],[Q]),J=Ih(()=>(e,t,n)=>{const o=e.filter(e=>"point"===e.type);if(2>o.length)return null;const r=o.length,i=100>r,s=[];for(let e=0;r-1>e;e++){const t=o[e],n=o[e+1],a=Oh(e,r),l=Math.min("number"==typeof t.style?.opacity?t.style.opacity:1,"number"==typeof n.style?.opacity?n.style.opacity:1);i&&s.push(Bh("line",{x1:t.x,y1:t.y,x2:n.x,y2:n.y,stroke:"white",strokeWidth:p+2,strokeLinecap:"round",opacity:.5*l},"halo-"+e)),s.push(Bh("line",{x1:t.x,y1:t.y,x2:n.x,y2:n.y,stroke:a,strokeWidth:p,strokeLinecap:"round",opacity:l},"seg-"+e))}return Bh(Fh,{children:s})},[p]),ee=Ih(()=>[J],[J]),te=wh({colorScale:void 0,baseStyleExtras:Ih(()=>e=>{const t=q.get(e),n=t?.idx??0,o=t?.total??1;return{fill:o>0?Oh(n,o):"#6366f1",stroke:"white",strokeWidth:1,r:p,fillOpacity:1}},[p,q]),stroke:F,strokeWidth:B,opacity:O,styleRules:f,ruleContext:Ih(()=>wu(c,u),[c,u]),effectiveSelectionHook:U.effectiveSelectionHook,resolvedSelection:U.resolvedSelection}),ne=d||("string"==typeof h?h:"Order"),oe=Ih(()=>ll([{label:G||ol(c),accessor:c,role:"x",format:a},{label:V||ol(u),accessor:u,role:"y",format:l},...h?[{label:ne,accessor:h,role:"group"}]:[]]),[c,u,G,V,h,ne,a,l]),re=du({componentName:"ConnectedScatterplot",data:r,accessors:{xAccessor:c,yAccessor:u}}),{effectiveData:ie,statisticalAnnotations:se}=ju({data:X,xAccessor:c,yAccessor:u,forecast:v,anomaly:x});if(U.earlyReturn)return U.earlyReturn;const ae=Ph(b),le=ae||se.length>0?[...ae?[ae]:[],...g||[],...se]:g,ce={chartType:"scatter",...null!=r&&{data:ie},xAccessor:c,yAccessor:u,pointStyle:te,size:[W,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:U.margin,showAxes:o.showAxes,xLabel:G,yLabel:V,xFormat:a,yFormat:l,enableHover:z,showGrid:H,...Iu({title:E,description:$,summary:j,accessibleTable:Y,className:s,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Nu({tooltip:y,defaultTooltipContent:oe}),...Tu({linkedHover:C,selection:S,onObservation:M,onClick:_,hoverHighlight:P,mobileInteraction:U.mobileInteraction,customHoverBehavior:U.customHoverBehavior,customClickBehavior:U.customClickBehavior}),...m&&{pointIdAccessor:m},canvasPreRenderers:Z,svgPreRenderers:ee,...le&&le.length>0&&{annotations:le},...k&&{xExtent:k},...w&&{yExtent:w},...U.crosshairProps,...A};return re?Bh(Zc,{componentName:"ConnectedScatterplot",message:re,width:W,height:D}):Bh(ru,{componentName:"ConnectedScatterplot",width:W,height:D,children:Bh(Ml,{ref:n,...ce})})});Wh.displayName="ConnectedScatterplot";import{useMemo as Dh,useCallback as zh,forwardRef as Hh,useRef as Eh}from"react";import{jsx as $h}from"react/jsx-runtime";var jh=Hh(function(e,t){const n=Eh(null),o=qc(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:i,className:s,xFormat:a,yFormat:l,xAccessor:c="x",yAccessor:u="y",sizeBy:h,sizeRange:d=[5,40],colorBy:f,colorScheme:p,styleRules:y,bubbleOpacity:m=.6,bubbleStrokeWidth:g=1,bubbleStrokeColor:b="white",tooltip:v,marginalGraphics:x,pointIdAccessor:k,annotations:w,regression:A,xExtent:S,yExtent:C,frameProps:M={},selection:P,linkedHover:L,linkedBrush:R,onObservation:I,onClick:T,hoverHighlight:N,chartId:F,loading:B,loadingContent:O,emptyContent:W,legendInteraction:D,legendPosition:z,color:H,stroke:E,strokeWidth:$,opacity:j}=e,{width:Y,height:G,enableHover:V,showGrid:X,showLegend:q,title:U,description:K,summary:Q,accessibleTable:Z,xLabel:J,yLabel:ee}=o,te=Dh(()=>_(r),[r]),ne=void 0===r,oe=bu({data:te,rawData:r,colorBy:f,colorScheme:p,legendInteraction:D,legendPosition:z,selection:P,linkedHover:L,fallbackFields:f?["string"==typeof f?f:""]:[],unwrapData:!1,onObservation:I,onClick:T,hoverHighlight:N,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"BubbleChart",chartId:F,showLegend:q,userMargin:i,marginDefaults:o.marginDefaults,loading:B,loadingContent:O,emptyContent:W,width:Y,height:G}),{domain:re,trackPushed:ie,reset:se}=_h({accessor:h,data:te,isPushMode:ne}),ae=zh(e=>{ie([e]),n.current?.push(e)},[ie]),le=zh(e=>{ie(e),n.current?.pushMany(e)},[ie]);Ru(t,{variant:"xy",frameRef:n,overrides:{push:ae,pushMany:le,clear:()=>{se(),n.current?.clear()}}});const ce=Cc(R),ue=(hc({name:ce?.name||"__unused_brush__",xField:ce?.xField||("string"==typeof c?c:void 0),yField:ce?.yField||("string"==typeof u?u:void 0)}),Dh(()=>({stroke:b,strokeWidth:g}),[b,g])),he=Dh(()=>re??[0,1],[re]),de=zh(e=>Le(e,h,d,he),[h,d,he]),fe=Dh(()=>wu(c,u),[c,u]),pe=wh({colorBy:f,colorScale:oe.colorScale,color:H,fillOpacity:m,radiusFn:de,baseStyleExtras:ue,stroke:E,strokeWidth:$,opacity:j,styleRules:y,ruleContext:fe,effectiveSelectionHook:oe.effectiveSelectionHook,resolvedSelection:oe.resolvedSelection}),ye=Dh(()=>ll([{label:J||ol(c),accessor:c,role:"x",format:a},{label:ee||ol(u),accessor:u,role:"y",format:l},{label:ol(h),accessor:h,role:"size"},...f?[{label:ol(f),accessor:f,role:"color"}]:[]]),[c,u,J,ee,h,f,a,l]);if(oe.earlyReturn)return oe.earlyReturn;const me=du({componentName:"BubbleChart",data:r,accessors:{xAccessor:c,yAccessor:u},requiredProps:{sizeBy:h}});if(me)return $h(Zc,{componentName:"BubbleChart",message:me,width:Y,height:G});const ge=Ph(A),be=ge?[ge,...w||[]]:w,ve={chartType:"bubble",...null!=r&&{data:te},xAccessor:c,yAccessor:u,colorAccessor:f||void 0,sizeAccessor:h,sizeRange:d,pointStyle:pe,colorScheme:p,size:[Y,G],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:oe.margin,showAxes:o.showAxes,xLabel:J,yLabel:ee,xFormat:a,yFormat:l,enableHover:V,showGrid:X,...oe.legendBehaviorProps,...Iu({title:U,description:K,summary:Q,accessibleTable:Z,className:s,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Nu({tooltip:v,defaultTooltipContent:ye}),...Tu({linkedHover:L,selection:P,onObservation:I,onClick:T,hoverHighlight:N,mobileInteraction:oe.mobileInteraction,customHoverBehavior:oe.customHoverBehavior,customClickBehavior:oe.customClickBehavior}),...x&&{marginalGraphics:x},...k&&{pointIdAccessor:k},...be&&be.length>0&&{annotations:be},...S&&{xExtent:S},...C&&{yExtent:C},...oe.crosshairProps,...M};return $h(ru,{componentName:"BubbleChart",width:Y,height:G,children:$h(Ml,{ref:n,...ve})})});jh.displayName="BubbleChart";import{useMemo as Yh,forwardRef as Gh,useRef as Vh}from"react";import{scaleSequential as Xh}from"d3-scale";import{jsx as qh}from"react/jsx-runtime";var Uh=Gh(function(e,n){const o=Vh(null);Ru(n,{variant:"xy",frameRef:o});const r=qc(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:i,margin:s,className:a,xAccessor:l="x",yAccessor:c="y",valueAccessor:u="value",xFormat:h,yFormat:d,colorScheme:f,customColorScale:p,showValues:y=!1,valueFormat:m,cellBorderColor:g="#fff",cellBorderWidth:b=1,tooltip:v,annotations:x,xExtent:k,yExtent:w,frameProps:A={},selection:S,linkedHover:C,onObservation:M,onClick:P,hoverHighlight:L,chartId:R,loading:I,loadingContent:T,emptyContent:N,showLegend:F,legendPosition:B,legendInteraction:O}=e,{width:W,height:D,enableHover:z,title:H,description:E,summary:$,accessibleTable:j,xLabel:Y,yLabel:G}=r,V=lu(I,W,D,T),X=V?null:au(i,W,D,N),q=Yh(()=>_(i),[i]),U=function(){const e=Rc();return e?.colors?.sequential||void 0}(),K=f??U??"blues",Q=F??!1,Z=B??"right",{margin:J}=Gc({data:q,colorBy:Q?"value":void 0,colorScale:void 0,showLegend:Q,legendPosition:Z,userMargin:s,defaults:r.marginDefaults}),{customHoverBehavior:ee,customClickBehavior:te,crosshairSourceId:ne}=jc({selection:S,linkedHover:C,fallbackFields:[],onObservation:M,onClick:P,chartType:"Heatmap",chartId:R,hoverHighlight:L,colorByField:void 0,mobileInteraction:r.mobileInteraction});gu(S);const oe=Yc(C,ne);Vc(O,void 0,[]);const re=Yh(()=>"function"==typeof u?e=>u(e):e=>e[u],[u]),ie=Yh(()=>{const e=q.map(re);return t(e)},[q,re]),se=Yh(()=>{if("custom"===K&&p)return p;const e=ke(K);return Xh(e).domain(ie)},[K,p,ie]),ae=Yh(()=>ll([{label:Y||ol(l),accessor:l,role:"x",format:h},{label:G||ol(c),accessor:c,role:"y",format:d},{label:ol(u),accessor:u,role:"value",format:m}]),[l,c,Y,G,u,h,d,m]),le=du({componentName:"Heatmap",data:i,accessors:{xAccessor:l,yAccessor:c,valueAccessor:u}}),ce=Yh(()=>{if(Q)return{gradient:{colorFn:e=>se(e),domain:ie,label:"string"==typeof u?u:"value",format:m}}},[Q,se,ie,u,m]),ue={chartType:"heatmap",...null!=i&&{data:q},xAccessor:l,yAccessor:c,valueAccessor:u,colorScheme:"custom"!==K?K:void 0,showValues:y,heatmapValueFormat:m,size:[W,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:J,showAxes:r.showAxes,xLabel:Y,yLabel:G,xFormat:h,yFormat:d,enableHover:z,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ce&&{legend:ce,legendPosition:Z},...Iu({title:H,description:E,summary:$,accessibleTable:j,className:a,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Nu({tooltip:v,defaultTooltipContent:ae}),...Tu({linkedHover:C,selection:S,onObservation:M,onClick:P,hoverHighlight:L,mobileInteraction:r.mobileInteraction,customHoverBehavior:ee,customClickBehavior:te}),...x&&x.length>0&&{annotations:x},...k&&{xExtent:k},...w&&{yExtent:w},...oe,...A};return V||X||(le?qh(Zc,{componentName:"Heatmap",message:le,width:W,height:D}):qh(ru,{componentName:"Heatmap",width:W,height:D,children:qh(Ml,{ref:o,...ue})}))});Uh.displayName="Heatmap";import*as Kh from"react";import{useMemo as Qh,useCallback as Zh,useState as Jh,useRef as ed,useEffect as td}from"react";import{brush as nd}from"d3-brush";import{select as od}from"d3-selection";import{jsx as rd,jsxs as id}from"react/jsx-runtime";var sd="__splomIdx",ad={top:4,bottom:4,left:4,right:4};function ld({frameRef:e,cellSize:t,onBrush:n}){const o=ed(null),r=t-ad.left-ad.right,i=t-ad.top-ad.bottom;return td(()=>{if(!o.current)return;const t=od(o.current).select(".brush-g"),s=nd().extent([[0,0],[r,i]]).on("brush end",t=>{const o=e.current?.getScales();if(!o)return;if(!(r=t.selection)||!Array.isArray(r[0]))return void n(null);var r;const[[i,s],[a,l]]=t.selection,c=[[o.x.invert(i),o.y.invert(s)],[o.x.invert(a),o.y.invert(l)]];n(c)});return t.call(s),t.select(".selection").attr("fill","steelblue").attr("fill-opacity",.15).attr("stroke","steelblue").attr("stroke-width",1),()=>{s.on("brush end",null)}},[r,i,e,n]),rd("svg",{ref:o,width:t,height:t,style:{position:"absolute",top:0,left:0},children:rd("g",{className:"brush-g",transform:`translate(${ad.left},${ad.top})`})})}function cd({data:e,xField:t,yField:n,cellSize:o,pointRadius:r,pointOpacity:i,colorBy:s,colorScale:a,brushSelectionName:l,hoverSelectionName:c,unselectedOpacity:u,mobileInteraction:h,mode:d,onPointHover:f,onPointClick:p}){const y=ed(null),m=cc({name:l,clientId:`splom-${t}-${n}`,fields:[t,n]}),g=hc({name:l,xField:t,yField:n}),b=cc({name:c,clientId:"splom-hover-source",fields:[sd]}),v=b.selectPoints,x=Zh(e=>{e?g.brushInteraction.during(e):g.brushInteraction.end(null)},[g.brushInteraction]),k=Zh(e=>{if(!e)return void f?.(null);const t=e.data,n=t?.[sd];void 0!==n&&(v({[sd]:[n]}),f?.(t,e.x+ad.left,e.y+ad.top))},[v,f]),w=Zh(e=>{if(!e)return void p?.(null);const t=e.data;t&&p?.(t,e.x+ad.left,e.y+ad.top)},[p]),A=Zh(e=>{const t={opacity:i,r:r};return t.fill=s?Me(e,s,a):Wc,"hover"===d?b.isActive&&b.predicate(e)?(t.opacity=1,t.r=2.5*r,t.stroke="#333",t.strokeWidth=1.5):b.isActive&&(t.opacity=.6*i):m.isActive&&!m.predicate(e)&&(t.opacity=u),t},[i,r,s,d,a,b,m,u]);return id("div",{style:{position:"relative",width:o,height:o},children:[rd(Ml,{ref:y,chartType:"scatter",data:e,size:[o,o],xAccessor:t,yAccessor:n,pointStyle:A,margin:ad,showAxes:!1,enableHover:"hover"===d,...Tu({forceHoverBehavior:"hover"===d,forceClickBehavior:!!p,mobileInteraction:h,customHoverBehavior:k,customClickBehavior:w}),tooltipContent:"hover"===d?()=>null:void 0}),"brush"===d&&rd(ld,{frameRef:y,cellSize:o,xField:t,yField:n,onBrush:x})]})}function ud({data:n,field:o,label:r,cellSize:i,bins:s,colorBy:a,colorScale:l,brushSelectionName:c,hoverSelectionName:u,mode:h}){const d=cc({name:c,clientId:"splom-diag-"+o,fields:[o]}),f=cc({name:u,clientId:`splom-diag-${o}-hover`,fields:[sd]}),p="hover"===h?f:d,y=p.isActive,m=p.predicate,g=Qh(()=>{const r="string"==typeof a?a:null,l=[],c=new Set;for(const e of n){const t=e[o];if(null==t||isNaN(t)||l.push(Number(t)),r){const t=e[r];null!=t&&c.add(t+"")}}if(0===l.length)return{bars:[],selectedBars:[],categoryBars:[],selectedCategoryBars:[],max:0,categories:[]};const[u,h]=t(l),d=(h-u)/s||1,f=Array.from(c),p=new Map(f.map((e,t)=>[e,t])),g=Array(s).fill(0),b=Array(s).fill(0),v=Array.from({length:s},()=>Array(f.length).fill(0)),x=Array.from({length:s},()=>Array(f.length).fill(0));for(const e of n){const t=e[o];if(null==t||isNaN(t))continue;const n=Math.min(Math.floor((t-u)/d),s-1);if(g[n]++,y&&!m(e)||b[n]++,r){const t=p.get(e[r]+"");void 0!==t&&(v[n][t]++,y&&!m(e)||x[n][t]++)}}const k=e(g,1),w=v.map((e,t)=>{let n=0;return e.map((e,o)=>{const r=e/k*(i-24),a={x:t/s*i,w:i/s-1,h:r,y0:n,category:f[o]};return n+=r,a})}),A=x.map((e,t)=>{let n=0;return e.map((e,o)=>{const r=e/k*(i-24),a={x:t/s*i,w:i/s-1,h:r,y0:n,category:f[o]};return n+=r,a})});return{bars:g.map((e,t)=>({x:t/s*i,w:i/s-1,h:e/k*(i-24),count:e})),selectedBars:b.map((e,t)=>({x:t/s*i,w:i/s-1,h:e/k*(i-24),count:e})),categoryBars:w,selectedCategoryBars:A,max:k,categories:f}},[n,o,s,i,y,m,a]);return id("svg",{width:i,height:i,style:{overflow:"hidden"},children:[rd("text",{x:i/2,y:14,textAnchor:"middle",fontSize:11,fontWeight:"bold",fill:"#333",children:r}),g.categories.length>0?g.categoryBars.map((e,t)=>e.map((e,n)=>rd("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:l?l(e.category):Wc,opacity:y?.3:.6},`bg-${t}-${n}`))):g.bars.map((e,t)=>rd("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:Wc,opacity:y?.3:.6},"bg-"+t)),y&&(g.categories.length>0?g.selectedCategoryBars.map((e,t)=>e.map((e,n)=>rd("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:l?l(e.category):Wc,opacity:.7},`sel-${t}-${n}`))):g.selectedBars.map((e,t)=>rd("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:Wc,opacity:.7},"sel-"+t)))]})}function hd({label:e,cellSize:t}){return rd("svg",{width:t,height:t,children:rd("text",{x:t/2,y:t/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:12,fontWeight:"bold",fill:"#333",children:e})})}function dd(e){const{data:t,fields:n,fieldLabels:o={},colorBy:r,colorScheme:i,cellSize:s=150,cellGap:a=4,pointRadius:l=2,pointOpacity:c=.5,diagonal:u="histogram",histogramBins:h=20,brushMode:d="crossfilter",hoverMode:f=!0,unselectedOpacity:p=.1,showGrid:y=!1,tooltip:m,showLegend:g,idAccessor:b,width:v,className:x,onObservation:k,onClick:w,chartId:A}=e,S="splom",C="splom-hover",M=Hc(e.mobileInteraction,{mode:e.mode,width:v??n.length*s,mobileSemantics:e.mobileSemantics}),_=f?"hover":d?"brush":"hover",P=ic(e=>e.clearSelection),[L,R]=Jh(null),I=Zh(()=>{P(C),R(null)},[P,C]),T=Qh(()=>(t||[]).map((e,t)=>void 0!==e[sd]?e:{...e,[sd]:t}),[t]),N=$c(T,r,i),F=Zh((e,t,n,o)=>[40+e*(s+a)+(n??0),t*(s+a)+(o??0)],[40,s,a]),B=void 0!==g?g:!!r,O=Qh(()=>{if(!B||!r)return null;const e="string"==typeof r?r:null;return e?Array.from(new Set(T.map(t=>t[e]).filter(e=>null!=e))).map(e=>({label:e+"",color:N?N(e+""):Wc})):null},[B,r,T,N]),W=Qh(()=>({display:"grid",gridTemplateColumns:"40px "+n.map(()=>s+"px").join(" "),gridTemplateRows:n.map(()=>s+"px").join(" ")+" 40px",gap:a+"px",width:"fit-content"}),[n,s,a,40]);return id("div",{className:x,style:{position:"relative"},children:[O&&rd("div",{style:{display:"flex",gap:12,marginBottom:8,flexWrap:"wrap"},children:O.map(e=>id("div",{style:{display:"flex",alignItems:"center",gap:4},children:[rd("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",backgroundColor:e.color}}),rd("span",{style:{fontSize:11},children:e.label})]},e.label))}),id("div",{style:W,onMouseLeave:"hover"===_?I:void 0,children:[n.map((e,t)=>id(Kh.Fragment,{children:[rd("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:11,fontWeight:"bold",color:"#333"},children:o[e]||e}),n.map((n,i)=>t===i?"label"===u?rd(hd,{label:o[e]||e,cellSize:s},"diag-"+e):rd(ud,{data:T,field:e,label:o[e]||e,cellSize:s,bins:h,colorBy:r,colorScale:N,brushSelectionName:S,hoverSelectionName:C,unselectedOpacity:p,mode:_},"diag-"+e):rd(cd,{data:T,xField:n,yField:e,fieldLabels:o,cellSize:s,pointRadius:l,pointOpacity:c,colorBy:r,colorScale:N,brushSelectionName:S,hoverSelectionName:C,unselectedOpacity:p,showGrid:y,tooltip:m,mobileInteraction:M,mode:_,onPointHover:"hover"===_?(o,r,s)=>{if(o){if(R({datum:o,xField:n,yField:e,colIndex:i,rowIndex:t,px:r??0,py:s??0}),k){const[e,n]=F(i,t,r,s);k({type:"hover",datum:o,x:e,y:n,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:A})}}else R(null),k&&k({type:"hover-end",timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:A})}:void 0,onPointClick:w||k?(e,n,o)=>{if(!e)return;const[r,s]=F(i,t,n,o);w&&w(e,{x:r,y:s}),k&&k({type:"click",datum:e,x:r,y:s,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:A})}:void 0},`cell-${e}-${n}`))]},"row-"+e)),rd("div",{})," ",n.map(e=>rd("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:"bold",color:"#333"},children:o[e]||e},"col-label-"+e))]}),L&&"hover"===_&&(()=>{const e=L.datum,t=o[L.xField]||L.xField,n=o[L.yField]||L.yField,i=r?"function"==typeof r?r(e):e[r]:null,l=b?"function"==typeof b?b(e):e[b]:"Row "+e[sd];return id("div",{style:{position:"absolute",left:40+L.colIndex*(s+a)+L.px,top:L.rowIndex*(s+a)+L.py-8,transform:"translate(-50%, -100%)",color:"#333",background:"rgba(255,255,255,0.95)",border:"1px solid #ddd",borderRadius:3,padding:"4px 8px",fontSize:11,lineHeight:1.4,whiteSpace:"nowrap",pointerEvents:"none",zIndex:10},children:[rd("div",{style:{fontWeight:"bold",marginBottom:2},children:l+""}),id("div",{children:[t,": ",null!=e[L.xField]?Number(e[L.xField]).toFixed(1):"–"]}),id("div",{children:[n,": ",null!=e[L.yField]?Number(e[L.yField]).toFixed(1):"–"]}),null!=i&&id("div",{style:{opacity:.8},children:["string"==typeof r?r:"group",": ",i+""]})]})})()]})}function fd(e){const{brushMode:t="crossfilter",hoverMode:n=!0}=e,o={};return!n&&t&&(o.splom={resolution:t}),n&&(o["splom-hover"]={resolution:"union"}),rd(Sc,{selections:o,children:rd(dd,{...e})})}fd.displayName="ScatterplotMatrix";import{useState as pd,useRef as yd,useEffect as md,useMemo as gd,useCallback as bd}from"react";import{brushX as vd,brushY as xd}from"d3-brush";import{select as kd}from"d3-selection";import{jsx as wd,jsxs as Ad}from"react/jsx-runtime";function Sd({width:e,height:t,margin:n,scales:o,brushDirection:r,extent:i,onBrush:s}){const a=yd(null),l=yd(null),c=yd(!1),u=e+n.left+n.right,h=t+n.top+n.bottom;return md(()=>{if(!a.current||!o)return;const n=kd(a.current).select(".brush-group"),i="x"===r?vd().extent([[0,0],[e,t]]):xd().extent([[0,0],[e,t]]);return i.on("brush end",e=>{if(c.current)return;if(!e.sourceEvent)return;const t=e.selection;if(!t)return void s(null);const n=("x"===r?o.x:o.y).invert;if(!n)return;const i=[n(t[0]),n(t[1])];s(i)}),n.call(i),l.current=e=>{n.call(i.move,e)},n.select(".selection").attr("fill","steelblue").attr("fill-opacity",.2).attr("stroke","steelblue").attr("stroke-width",1),()=>{l.current=null,i.on("brush end",null)}},[o,e,t,r,s]),md(()=>{if(!l.current||!o||!a.current)return;const e="x"===r?o.x:o.y;if(c.current=!0,i){const t=[e(i[0]),e(i[1])];l.current(t)}else l.current(null);c.current=!1},[i,o,r]),wd("svg",{ref:a,width:u,height:h,style:{position:"absolute",top:0,left:0,pointerEvents:"all"},children:wd("g",{className:"brush-group",transform:`translate(${n.left},${n.top})`})})}function Cd(e){const{data:t,width:n=600,height:o=400,margin:r,className:i,title:s,description:a,summary:l,xLabel:c,yLabel:u,xFormat:h,yFormat:d,xAccessor:f="x",yAccessor:p="y",lineBy:y,lineDataAccessor:m="coordinates",colorBy:g,colorScheme:b,curve:v="linear",lineWidth:x=2,fillArea:k=!1,areaOpacity:w=.3,showPoints:A=!1,pointRadius:S=3,enableHover:C=!0,showGrid:M=!1,showLegend:P,legendPosition:L,tooltip:R,minimap:I={},renderBefore:T=!1,onBrush:N,brushExtent:F,yExtent:B,frameProps:O={},loading:W,loadingContent:D,emptyContent:z}=e,H=lu(W,n,o,D),E=H?null:au(t,n,o,z),$=gd(()=>_(t),[t]),[j,Y]=pd(null),G=F??j,V=bd(e=>{F||Y(e),N?.(e)},[F,N]),X=yd(null),[q,U]=pd(null);md(()=>{let e=0,t=!1;const n=()=>{if(t)return;const o=X.current?.getScales?.();o?U(o):e=requestAnimationFrame(n)};return e=requestAnimationFrame(n),()=>{t=!0,e&&cancelAnimationFrame(e)}},[t]);const K=void 0!==$[0]?.[m],Q=gd(()=>{if(K)return $;if(y){const e=$.reduce((e,t)=>{const n="function"==typeof y?y(t):t[y];if(!e[n]){const t={[m]:[]};"string"==typeof y&&(t[y]=n),e[n]=t}return e[n][m].push(t),e},{});return Object.values(e)}return[{[m]:$}]},[$,y,m,K]),Z=gd(()=>K||y?Q.flatMap(e=>{const t=e[m]||[];return y&&"string"==typeof y?t.map(t=>({...t,[y]:e[y]})):t}):$,[Q,m,K,y,$]),J=$c($,g,b),ee=Pu({lineWidth:x,colorBy:g,colorScale:J,fillArea:k,areaOpacity:w}),te=gd(()=>{if(I.lineStyle)return I.lineStyle},[I.lineStyle]),ne=Pu({lineWidth:1,colorBy:g,colorScale:J}),oe=te??ne,re=gd(()=>{if(A)return e=>{const t={r:S,fillOpacity:1};return t.fill=g?Me(e.parentLine||e,g,J):Wc,t}},[A,S,g,J]),{legend:ie,margin:se,legendPosition:ae}=Gc({data:Q,colorBy:g,colorScale:J,showLegend:P,legendPosition:L,userMargin:r}),le=I.height||60,ce=gd(()=>({top:I.margin?.top??0,bottom:I.margin?.bottom??20,left:I.margin?.left??se.left,right:I.margin?.right??se.right}),[I.margin,se]),ue=I.brushDirection||"x",he=gd(()=>ll([{label:c||ol(f),accessor:f,role:"x",format:h},{label:u||ol(p),accessor:p,role:"y",format:d}]),[f,p,c,u,h,d]),de=du({componentName:"MinimapChart",data:t,accessors:{xAccessor:f,yAccessor:p}});if(de)return wd(Zc,{componentName:"MinimapChart",message:de,width:n,height:o});const fe=k?"area":"line",pe={chartType:fe,data:Z,xAccessor:f,yAccessor:p,groupAccessor:y||void 0,curve:v,lineStyle:ee,...A&&{pointStyle:re},size:[n,o],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:se,showAxes:!0,xLabel:c,yLabel:u,xFormat:h,yFormat:d,enableHover:C,showGrid:M,...ie&&{legend:ie,legendPosition:ae},...s&&{title:s},...a&&{description:a},...l&&{summary:l},tooltipContent:!1===R?()=>null:Gs(R)||he,...G&&{xExtent:G},...B&&{yExtent:B},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...O},ye={chartType:fe,data:Z,xAccessor:f,yAccessor:p,groupAccessor:y||void 0,curve:v,lineStyle:oe,size:[n,le+ce.top+ce.bottom],margin:ce,showAxes:I.showAxes??!1,background:I.background,enableHover:!1,...B&&{yExtent:B}},me=Ad("div",{style:{position:"relative",width:n,overflow:"hidden"},children:[wd(Ml,{ref:X,...ye}),wd(Sd,{width:n-ce.left-ce.right,height:le,margin:ce,scales:q,brushDirection:ue,extent:G,onBrush:V})]},"minimap"),ge=wd("div",{style:{overflow:"hidden"},children:wd(Ml,{...pe})},"main");return H||E||wd(ru,{componentName:"MinimapChart",width:n,height:o,children:Ad("div",{className:"minimap-chart"+(i?" "+i:""),children:[T?me:ge,T?ge:me]})})}Cd.displayName="MinimapChart";import{useMemo as Md,forwardRef as _d,useRef as Pd}from"react";var Ld={label:"Low / High",color:"#E9C46A",opacity:.08},Rd={label:"High / High",color:"#2A9D8F",opacity:.08},Id={label:"Low / Low",color:"#E76F51",opacity:.08},Td={label:"High / Low",color:"#86BBD8",opacity:.08};import{Fragment as Nd,jsx as Fd,jsxs as Bd}from"react/jsx-runtime";function Od(e,t){return{label:t?.label??e.label,color:t?.color??e.color,opacity:t?.opacity??e.opacity}}var Wd=_d(function(e,n){const o=Pd(null);Ru(n,{variant:"xy",frameRef:o});const r=qc(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:i,margin:s,className:a,xFormat:l,yFormat:c,xAccessor:u="x",yAccessor:h="y",xCenter:d,yCenter:f,quadrants:p,centerlineStyle:y={},showQuadrantLabels:m=!0,quadrantLabelSize:g=12,colorBy:b,colorScheme:v,styleRules:x,sizeBy:k,sizeRange:w=[3,15],pointRadius:A=5,pointOpacity:S=.8,tooltip:C,pointIdAccessor:M,annotations:P,frameProps:L={},selection:R,linkedHover:I,onObservation:T,onClick:N,hoverHighlight:F,chartId:B,loading:O,loadingContent:W,emptyContent:D,legendInteraction:z,legendPosition:H,color:E,stroke:$,strokeWidth:j,opacity:Y}=e,{width:G,height:V,enableHover:X,showGrid:q,showLegend:U,title:K,description:Q,summary:Z,accessibleTable:J,xLabel:ee,yLabel:te}=r,ne=Md(()=>({topLeft:Od(Ld,p?.topLeft),topRight:Od(Rd,p?.topRight),bottomLeft:Od(Id,p?.bottomLeft),bottomRight:Od(Td,p?.bottomRight)}),[p]),oe=Md(()=>_(i),[i]),re=bu({data:oe,rawData:i,colorBy:b,colorScheme:v,legendInteraction:z,legendPosition:H,selection:R,linkedHover:I,fallbackFields:"string"==typeof b?[b]:[],unwrapData:!1,onObservation:T,onClick:N,hoverHighlight:F,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"QuadrantChart",chartId:B,showLegend:U,userMargin:s,marginDefaults:r.marginDefaults,loading:O,loadingContent:W,emptyContent:D,width:G,height:V});cu("QuadrantChart",oe,"xAccessor",u),cu("QuadrantChart",oe,"yAccessor",h);const ie=Md(()=>{if(!oe.length)return;const e="function"==typeof u?u:e=>+e[u],t="function"==typeof h?h:e=>+e[h];let n=1/0,o=-1/0,r=1/0,i=-1/0;for(const s of oe){const a=e(s),l=t(s);isFinite(a)&&(n>a&&(n=a),a>o&&(o=a)),isFinite(l)&&(r>l&&(r=l),l>i&&(i=l))}if(null!=d&&isFinite(d)&&(n>d&&(n=d),d>o&&(o=d)),null!=f&&isFinite(f)&&(r>f&&(r=f),f>i&&(i=f)),n===1/0)return;const s=.1*(o-n)||1,a=.1*(i-r)||1;return{xExtent:[n-s,o+s],yExtent:[r-a,i+a]}},[oe,u,h,d,f]),se=Md(()=>{if(!k||0===oe.length)return;const e=oe.map(e=>"function"==typeof k?k(e):e[k]).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0!==e.length?t(e):void 0},[oe,k]),ae=Md(()=>"function"==typeof u?u:e=>+e[u],[u]),le=Md(()=>"function"==typeof h?h:e=>+e[h],[h]),ce=Md(()=>e=>{const t=ae(e),n=le(e),o=null!=d?t>=d:void 0,r=null!=f?n>=f:void 0;return void 0===r||void 0===o?E||Wc:r&&o?ne.topRight.color:r&&!o?ne.topLeft.color:!r&&o?ne.bottomRight.color:ne.bottomLeft.color},[ae,le,d,f,ne,E]),ue=Md(()=>k?e=>Le(e,k,w,se):void 0,[k,w,se]),he=Md(()=>wu(u,h),[u,h]),de=wh({colorBy:b,colorScale:re.colorScale,color:E,pointRadius:A,fillOpacity:S,radiusFn:ue,fallbackFill:ce,stroke:$,strokeWidth:j,opacity:Y,styleRules:x,ruleContext:he,effectiveSelectionHook:re.effectiveSelectionHook,resolvedSelection:re.resolvedSelection}),fe=Md(()=>{if(!oe.length)return;const e=new Set;"string"==typeof u&&e.add(u),"string"==typeof h&&e.add(h),"string"==typeof b&&e.add(b),"string"==typeof k&&e.add(k);const t=oe[0];for(const n of Object.keys(t))if(!n.startsWith("_")&&!e.has(n)&&"string"==typeof t[n])return n},[oe,u,h,b,k]),pe=Md(()=>ll([...fe?[{label:fe,accessor:fe,role:"title"}]:[],{label:ee||ol(u),accessor:u,role:"x",format:l},{label:te||ol(h),accessor:h,role:"y",format:c},...b?[{label:ol(b),accessor:b,role:"color"}]:[],...k?[{label:ol(k),accessor:k,role:"size"}]:[]]),[fe,u,h,ee,te,b,k,l,c]),ye=du({componentName:"QuadrantChart",data:i,accessors:{xAccessor:u,yAccessor:h}}),me=Md(()=>{const e={stroke:y.stroke||"#999",strokeWidth:y.strokeWidth??1,dashArray:y.strokeDasharray||[]};return[(t,n,o,r)=>{if(!o?.x||!o?.y)return;const i=r.width,s=r.height,a=null!=d?o.x(d):i/2,l=null!=f?o.y(f):s/2;if(null!=d&&!isFinite(a))return;if(null!=f&&!isFinite(l))return;const c=Math.max(0,Math.min(i,a)),u=Math.max(0,Math.min(s,l)),h=[{config:ne.topLeft,x:0,y:0,w:c,h:u},{config:ne.topRight,x:c,y:0,w:i-c,h:u},{config:ne.bottomLeft,x:0,y:u,w:c,h:s-u},{config:ne.bottomRight,x:c,y:u,w:i-c,h:s-u}];for(const e of h)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,s),t.stroke(),t.beginPath(),t.moveTo(0,u),t.lineTo(i,u),t.stroke(),t.setLineDash([])}]},[d,f,ne,y]),ge=Md(()=>m?[...me,(e,t,n,o)=>{if(!n?.x||!n?.y)return;const r=o.width,i=o.height,s=null!=d?n.x(d):r/2,a=null!=f?n.y(f):i/2;(null==d||isFinite(s))&&(null==f||isFinite(a))&&(e.font=`600 ${g}px sans-serif`,e.globalAlpha=.5,e.fillStyle=ne.topLeft.color,e.textAlign="left",e.textBaseline="top",e.fillText(ne.topLeft.label,8,8),e.fillStyle=ne.topRight.color,e.textAlign="right",e.textBaseline="top",e.fillText(ne.topRight.label,r-8,8),e.fillStyle=ne.bottomLeft.color,e.textAlign="left",e.textBaseline="bottom",e.fillText(ne.bottomLeft.label,8,i-8),e.fillStyle=ne.bottomRight.color,e.textAlign="right",e.textBaseline="bottom",e.fillText(ne.bottomRight.label,r-8,i-8),e.globalAlpha=1)}]:me,[me,m,g,ne,d,f]),be=Md(()=>{const e=L.canvasPreRenderers||[];return[...ge,...e]},[ge,L.canvasPreRenderers]),ve=Md(()=>{const e={stroke:y.stroke||"#999",strokeWidth:y.strokeWidth??1,dashArray:y.strokeDasharray?Array.isArray(y.strokeDasharray)?y.strokeDasharray.join(","):y.strokeDasharray:void 0};return[(t,n,o)=>{if(!n?.x||!n?.y)return null;const r=o.width,i=o.height,s=null!=d?n.x(d):r/2,a=null!=f?n.y(f):i/2;if(null!=d&&!isFinite(s))return null;if(null!=f&&!isFinite(a))return null;const l=Math.max(0,Math.min(r,s)),c=Math.max(0,Math.min(i,a));return Bd(Nd,{children:[[{config:ne.topLeft,x:0,y:0,w:l,h:c},{config:ne.topRight,x:l,y:0,w:r-l,h:c},{config:ne.bottomLeft,x:0,y:c,w:l,h:i-c},{config:ne.bottomRight,x:l,y:c,w:r-l,h:i-c}].map((e,t)=>e.w>0&&e.h>0?Fd("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),Fd("line",{x1:l,y1:0,x2:l,y2:i,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),Fd("line",{x1:0,y1:c,x2:r,y2:c,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),m&&Bd(Nd,{children:[Fd("text",{x:8,y:8+g,fill:ne.topLeft.color,fontWeight:600,fontSize:g,opacity:.5,children:ne.topLeft.label}),Fd("text",{x:r-8,y:8+g,fill:ne.topRight.color,fontWeight:600,fontSize:g,opacity:.5,textAnchor:"end",children:ne.topRight.label}),Fd("text",{x:8,y:i-8,fill:ne.bottomLeft.color,fontWeight:600,fontSize:g,opacity:.5,children:ne.bottomLeft.label}),Fd("text",{x:r-8,y:i-8,fill:ne.bottomRight.color,fontWeight:600,fontSize:g,opacity:.5,textAnchor:"end",children:ne.bottomRight.label})]})]})}]},[d,f,ne,y,m,g]);if(re.earlyReturn)return re.earlyReturn;const xe={chartType:"scatter",...null!=i&&{data:oe},xAccessor:u,yAccessor:h,colorAccessor:b||void 0,sizeAccessor:k||void 0,sizeRange:w,pointStyle:de,colorScheme:v,size:[G,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:re.margin,showAxes:r.showAxes,xLabel:ee,yLabel:te,xFormat:l,yFormat:c,enableHover:X,showGrid:q,...ie&&{xExtent:ie.xExtent,yExtent:ie.yExtent},...re.legendBehaviorProps,...K&&{title:K},...Q&&{description:Q},...Z&&{summary:Z},...void 0!==J&&{accessibleTable:J},...a&&{className:a},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===C?()=>null:!0===C||void 0===C?pe:Gs(C)||pe,...Tu({linkedHover:I,selection:R,onObservation:T,onClick:N,hoverHighlight:F,mobileInteraction:re.mobileInteraction,customHoverBehavior:re.customHoverBehavior,customClickBehavior:re.customClickBehavior}),...M&&{pointIdAccessor:M},...P&&P.length>0&&{annotations:P},canvasPreRenderers:be,...re.crosshairProps,...L,...be.length>0&&{canvasPreRenderers:be},svgPreRenderers:ve};return ye?Fd(Zc,{componentName:"QuadrantChart",message:ye,width:G,height:V}):Fd(ru,{componentName:"QuadrantChart",width:G,height:V,children:Fd(Ml,{ref:o,...xe})})});Wd.displayName="QuadrantChart";import*as Dd from"react";import{useMemo as zd,useCallback as Hd,forwardRef as Ed,useRef as $d,useImperativeHandle as jd}from"react";import{jsx as Yd}from"react/jsx-runtime";var Gd="__ma_unitized",Vd="__ma_series";function Xd(e,t){const n=t[1]-t[0];return 0===n?.5:(e-t[0])/n}function qd(e,t){return t[0]+e*(t[1]-t[0])}var Ud=Ed(function(e,t){const n=$d(null),o=$d([]),r=$d(e.series);r.current=e.series,jd(t,()=>{const e=()=>(r.current??[]).filter(e=>null!=e&&"object"==typeof e);return{push:t=>{if(!n.current)return;const r=e(),i=t;for(let e=0;r.length>e&&2>e;e++){const t=r[e],s=t.extent||o.current[e];if(!s)continue;const a=("function"==typeof t.yAccessor?t.yAccessor:e=>e[t.yAccessor])(i);null!=a&&isFinite(a)&&n.current.push({...i,[Gd]:Xd(a,s),[Vd]:t.label||"Series "+(e+1)})}},pushMany:t=>{if(!n.current)return;const r=e(),i=[];for(const e of t)for(let t=0;r.length>t&&2>t;t++){const n=r[t],s=n.extent||o.current[t];if(!s)continue;const a=("function"==typeof n.yAccessor?n.yAccessor:e=>e[n.yAccessor])(e);null!=a&&isFinite(a)&&i.push({...e,[Gd]:Xd(a,s),[Vd]:n.label||"Series "+(t+1)})}n.current.pushMany(i)},remove:e=>n.current?.remove(e)??[],update:(e,t)=>n.current?.update(e,t)??[],clear:()=>n.current?.clear(),getData:()=>n.current?.getData()??[],getScales:()=>n.current?.getScales()??null}},[]);const i=qc(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:a,className:l,xFormat:c,xAccessor:u="x",series:h,colorScheme:d,curve:f="monotoneX",lineWidth:p=2,tooltip:y,annotations:m,frameProps:g={},selection:b,linkedHover:v,onObservation:x,onClick:k,hoverHighlight:w,chartId:A,loading:S,loadingContent:C,emptyContent:M,legendInteraction:P,legendPosition:L,stroke:R,strokeWidth:I,opacity:T}=e,{width:N,height:F,enableHover:B,showGrid:O,showLegend:W=!0,title:D,description:z,summary:H,accessibleTable:E,xLabel:$}=i,j=zd(()=>_(s),[s]),Y=zd(()=>_(h),[h]),G=Y,V=2===Y.length;"undefined"==typeof process||"production"===process.env?.NODE_ENV||V||console.warn(`[MultiAxisLineChart] Expected exactly 2 series for dual-axis mode, got ${Y.length}. Rendering as a standard multi-line chart.`);const X=lu(S,N,F,C),q=X?null:au(s,N,F,M),U=Ec(),K=zd(()=>{let e;if(Array.isArray(d))e=d;else if(U&&U.length>0)e=U;else{const t=we[d];e=Array.isArray(t)?t:Ae}return G.map((t,n)=>t.color||e[n%e.length])},[G,d,U]),Q=zd(()=>Y.map((e,t)=>e.label||"Series "+(t+1)),[Y]),{unitizedData:Z,extents:J}=zd(()=>{if(0===j.length){const e=Y.map(e=>e.extent||null).filter(Boolean);return e.length===Y.length&&(o.current=e),{unitizedData:[],extents:e.length===Y.length?e:[]}}const e=Y.map(e=>e.extent||function(e,t){let n=1/0,o=-1/0;const r="function"==typeof t?t:e=>e[t];for(const t of e){const e=r(t);null!=e&&isFinite(e)&&(n>e&&(n=e),e>o&&(o=e))}if(!isFinite(n)||!isFinite(o))return[0,1];if(n===o){const e=0===n?1:.1*Math.abs(n);return[n-e,o+e]}return[n,o]}(j,e.yAccessor));if(o.current=e,!V){const t=[];for(const e of j)for(let n=0;Y.length>n;n++){const o=Y[n],r=("function"==typeof o.yAccessor?o.yAccessor:e=>e[o.yAccessor])(e);null!=r&&t.push({...e,[Gd]:r,[Vd]:Q[n]})}return{unitizedData:t,extents:e}}const t=[];for(const n of j)for(let o=0;2>o;o++){const r=Y[o],i=("function"==typeof r.yAccessor?r.yAccessor:e=>e[r.yAccessor])(n);null!=i&&t.push({...n,[Gd]:Xd(i,e[o]),[Vd]:Q[o]})}return{unitizedData:t,extents:e}},[j,Y,V,Q]),ee=zd(()=>{if(V&&J.length>=2)return[{orient:"left",label:Q[0],tickFormat:Y[0].format||(e=>{const t=qd(e,J[0]);return Number.isInteger(t)?t+"":t.toFixed(1)})},{orient:"right",label:Q[1],tickFormat:Y[1].format||(e=>{const t=qd(e,J[1]);return Number.isInteger(t)?t+"":t.toFixed(1)})},{orient:"bottom"}]},[V,J,Y,Q]),te=bu({data:zd(()=>Z.length>0?Z:Q.map(e=>({[Vd]:e})),[Z,Q]),rawData:s,colorBy:Vd,colorScheme:K,legendInteraction:P,legendPosition:L,selection:b,linkedHover:v,fallbackFields:[Vd],unwrapData:!1,onObservation:x,onClick:k,hoverHighlight:w,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"MultiAxisLineChart",chartId:A,showLegend:W,userMargin:a,marginDefaults:V?{...i.marginDefaults,left:70,right:70}:i.marginDefaults,loading:S,loadingContent:C,emptyContent:M,width:N,height:F}),ne=zd(()=>{const e=new Map;return Q.forEach((t,n)=>e.set(t,K[n])),e},[Q,K]),oe=Pu({lineWidth:p,resolveStroke:Hd(e=>ne.get(e[Vd])||K[0],[ne,K]),stroke:R,strokeWidth:I,opacity:T,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection}),re=zd(()=>{if(!1===y)return()=>null;return Gs(y)||(e=>{const t=e.data||e,n=t[Vd],o=Q.indexOf(n),r=t[Gd],i=V&&o>=0&&J[o]?qd(r,J[o]):r,s=o>=0&&Y[o]?.format?Y[o].format:e=>Number.isInteger(e)?e+"":e.toFixed(2),a="function"==typeof u?u(t):t[u];return Dd.createElement("div",{style:{padding:"6px 10px",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-tooltip-font-size, 13px)"}},Dd.createElement("div",{style:{fontWeight:600,marginBottom:4,color:K[o]||"inherit"}},n),Dd.createElement("div",null,`${"string"==typeof u?u:"x"}: ${a}`),Dd.createElement("div",null,`${n}: ${s(i)}`))})},[y,Q,K,J,V,Y,u]);if(te.earlyReturn)return te.earlyReturn;const ie=du({componentName:"MultiAxisLineChart",data:s,accessors:{xAccessor:u}}),se=V?[0,1]:void 0,ae={chartType:"line",...null!=s&&{data:Z},xAccessor:u,yAccessor:Gd,groupAccessor:Vd,lineStyle:oe,colorScheme:K,size:[N,F],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,showAxes:i.showAxes,...ee&&{axes:ee},xLabel:$,...V?{}:{yLabel:Q[0]},xFormat:c,...V&&se&&{yExtent:se},enableHover:B,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:O,curve:f,...te.legendBehaviorProps,...D&&{title:D},...z&&{description:z},...H&&{summary:H},...void 0!==E&&{accessibleTable:E},...l&&{className:l},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:re,...m&&{annotations:m},...Tu({linkedHover:v,selection:b,onObservation:x,onClick:k,hoverHighlight:w,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...te.crosshairProps,...g};return X||q||(ie?Yd(Zc,{componentName:"MultiAxisLineChart",message:ie,width:N,height:F}):Yd(ru,{componentName:"MultiAxisLineChart",width:N,height:F,children:Yd(Ml,{ref:n,...ae})}))});Ud.displayName="MultiAxisLineChart";import{useMemo as Kd,forwardRef as Qd,useRef as Zd}from"react";function Jd(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}import{jsx as ef}from"react/jsx-runtime";var tf=Qd(function(e,t){const n=Zd(null);Ru(t,{variant:"xy",frameRef:n});const o=qc(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:r,margin:i,className:s,xFormat:a,yFormat:l,xAccessor:c="x",highAccessor:u="high",lowAccessor:h="low",openAccessor:d,closeAccessor:f,candlestickStyle:p,tooltip:y,annotations:m,xExtent:g,yExtent:b,frameProps:v={},selection:x,linkedHover:k,onObservation:w,onClick:A,chartId:S,loading:C,loadingContent:M,emptyContent:P}=e,{width:L,height:R,enableHover:I,showGrid:T,title:N,description:F,summary:B,accessibleTable:O,xLabel:W,yLabel:D}=o,z=lu(C,L,R,M),H=z?null:au(r,L,R,P),E=Kd(()=>_(r),[r]),$=null==d||null==f;cu("CandlestickChart",E,"xAccessor",c),cu("CandlestickChart",E,"highAccessor",u),cu("CandlestickChart",E,"lowAccessor",h),$||(cu("CandlestickChart",E,"openAccessor",d),cu("CandlestickChart",E,"closeAccessor",f));const{customHoverBehavior:j,customClickBehavior:Y,crosshairSourceId:G}=jc({selection:x,linkedHover:k,onObservation:w,onClick:A,chartType:"CandlestickChart",chartId:S,mobileInteraction:o.mobileInteraction}),V=Yc(k,G),X=Kd(()=>{const t=o.marginDefaults,n="sparkline"===e.mode?{...t,top:0,bottom:0}:t;return null==i?n:{...n,...Jd(i)}},[i,o.marginDefaults,e.mode]),q=Kd(()=>{const e=[{label:W||ol(c),accessor:c,role:"x",format:a}];return $?(e.push({label:"High",accessor:u,role:"y",format:l}),e.push({label:"Low",accessor:h,format:l})):(e.push({label:"Open",accessor:d,format:l}),e.push({label:"High",accessor:u,format:l}),e.push({label:"Low",accessor:h,format:l}),e.push({label:"Close",accessor:f,format:l})),ll(e)},[c,W,a,l,u,h,d,f,$]),U=du({componentName:"CandlestickChart",data:r,accessors:{xAccessor:c,highAccessor:u,lowAccessor:h,...!$&&{openAccessor:d,closeAccessor:f}}}),K={chartType:"candlestick",...null!=r&&{data:E},xAccessor:c,yAccessor:u,highAccessor:u,lowAccessor:h,...!$&&{openAccessor:d,closeAccessor:f},...p&&{candlestickStyle:p},scalePadding:Math.max(2,Math.min(12,Math.round(L/40))),extentPadding:L>200?.1:.02,size:[L,R],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:X,showAxes:o.showAxes,xLabel:W,yLabel:D,xFormat:a,yFormat:l,enableHover:I,showGrid:T,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Iu({title:N,description:F,summary:B,accessibleTable:O,className:s,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Nu({tooltip:y,defaultTooltipContent:q}),...Tu({linkedHover:k,selection:x,onObservation:w,onClick:A,mobileInteraction:o.mobileInteraction,customHoverBehavior:j,customClickBehavior:Y}),...m&&m.length>0&&{annotations:m},...g&&{xExtent:g},...b&&{yExtent:b},...V,...v};return z||H||(U?ef(Zc,{componentName:"CandlestickChart",message:U,width:L,height:R}):ef(ru,{componentName:"CandlestickChart",width:L,height:R,children:ef(Ml,{ref:n,...K})}))});tf.displayName="CandlestickChart";import{forwardRef as nf,useMemo as of}from"react";import{useMemo as rf,useRef as sf}from"react";import{jsx as af}from"react/jsx-runtime";var lf=nf(function(e,t){const{data:n,layout:o,layoutConfig:r,onLayoutError:i,xExtent:s,yExtent:a,showAxes:l=!1,margin:c,className:u,annotations:h,onObservation:d,onClick:f,selection:p,linkedHover:y,chartId:m,loading:g,loadingContent:b,emptyContent:v,colorBy:x,colorScheme:k,frameProps:w={}}=e,{frameRef:A,resolved:S,safeData:C,setup:M,earlyReturn:_}=function(e){const t=function(e){const t=sf(null);return Ru(e.imperativeRef,{variant:e.imperativeVariant,frameRef:t}),{frameRef:t,resolved:qc(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),normalizedMargin:rf(()=>Jd(e.margin),[e.margin])}}(e),{resolved:n,normalizedMargin:o}=t,r=bu({data:e.data??[],rawData:e.data,colorBy:e.colorBy,colorScheme:e.colorScheme,legendInteraction:void 0,selection:e.selection,linkedHover:e.linkedHover,fallbackFields:"string"==typeof e.colorBy?[e.colorBy]:[],unwrapData:e.unwrapData,onObservation:e.onObservation,onClick:e.onClick,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:e.chartTypeLabel,chartId:e.chartId,showLegend:n.showLegend,userMargin:o,marginDefaults:n.marginDefaults,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,width:n.width,height:n.height});return{...t,safeData:r.data,setup:r,earlyReturn:r.earlyReturn}}({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"XYCustomChart",unwrapData:!1,data:n,colorBy:x,colorScheme:k,selection:p,linkedHover:y,onObservation:d,onClick:f,chartId:m,loading:g,loadingContent:b,emptyContent:v,margin:c,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}),P=M.effectiveSelectionHook,L=of(()=>P?.isActive?{isActive:!0,predicate:P.predicate}:null,[P?.isActive,P?.predicate]);if(_)return _;const{width:R,height:I,enableHover:T,showGrid:N,title:F,description:B,summary:O,accessibleTable:W,xLabel:D,yLabel:z}=S,H={chartType:"custom",...null!=n&&{data:C},customLayout:o,layoutConfig:r,onLayoutError:i,...L&&{layoutSelection:L},xExtent:s,yExtent:a,colorAccessor:x,colorScheme:k,size:[R,I],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:M.margin,showAxes:l,xLabel:D,yLabel:z,enableHover:T,showGrid:N,...M.legendBehaviorProps,...Iu({title:F,description:B,summary:O,accessibleTable:W,className:u,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...null!=e.tooltip&&{tooltipContent:e.tooltip},...Tu({linkedHover:y,selection:p,onObservation:d,onClick:f,hoverHighlight:!1,mobileInteraction:M.mobileInteraction,customHoverBehavior:M.customHoverBehavior,customClickBehavior:M.customClickBehavior}),...h&&h.length>0&&{annotations:h},...M.crosshairProps,...w};return af(ru,{componentName:"XYCustomChart",width:R,height:I,children:af(Ml,{ref:A,...H})})});lf.displayName="XYCustomChart";var cf={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},uf=8;function hf(e){return null==e?void 0:e+""}function df(e){const t=hf(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??8,style:{...cf},datum:e.datum,pointId:t,_transitionKey:t}}function ff(e){return{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...cf},datum:e.datum,group:e.group,_transitionKey:hf(e.id)}}export{eh as AreaChart,jh as BubbleChart,tf as CandlestickChart,Wh as ConnectedScatterplot,uf as DEFAULT_HIT_RADIUS,uh as DifferenceChart,Uh as Heatmap,Vu as LineChart,Cd as MinimapChart,Ud as MultiAxisLineChart,Wd as QuadrantChart,Rh as Scatterplot,fd as ScatterplotMatrix,yh as StackedAreaChart,Ml as StreamXYFrame,lf as XYCustomChart,_u as composeStyleRules,wn as glyphExtent,kn as glyphPlacement,En as hatchFillId,jn as hatchPatternDef,df as hitTargetPoint,ff as hitTargetRect,zn as isHatchFill,ku as makeRuleValueResolver,wu as makeXYRuleContext,Su as matchesThreshold,Nc as resolveResponsiveRules,Mu as resolveStyleRules,Yn as resolveSvgFill,Tc as responsiveRuleMatches,Cu as ruleMatches,hn as useCustomLayoutSelection};