semiotic 3.8.8 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (501) hide show
  1. package/README.md +82 -66
  2. package/agent-skill/semiotic-charts/SKILL.md +11 -2
  3. package/ai/behaviorContracts.cjs +33 -3
  4. package/ai/cli.js +53 -2
  5. package/ai/componentMetadata.cjs +15 -0
  6. package/ai/dist/mcp-server.js +1530 -611
  7. package/ai/examples.md +48 -42
  8. package/{CLAUDE.md → ai/reference.md} +46 -24
  9. package/ai/schema.json +10704 -825
  10. package/ai/surface-manifest.json +643 -2
  11. package/ai/system-prompt.md +83 -130
  12. package/dist/c-3BLJEQNG.min.js +1 -0
  13. package/dist/c-3KZD6AXJ.min.js +1 -0
  14. package/dist/c-4TWEX5HG.min.js +1 -0
  15. package/dist/c-52TEGIUJ.min.js +1 -0
  16. package/dist/c-5YCIX3VZ.min.js +1 -0
  17. package/dist/c-6FEKTA3U.min.js +1 -0
  18. package/dist/c-6O5EVOPH.min.js +1 -0
  19. package/dist/c-74HEEZGK.min.js +1 -0
  20. package/dist/c-AKAF6JAD.min.js +1 -0
  21. package/dist/c-BBKITSXB.min.js +1 -0
  22. package/dist/c-BWNB6USU.min.js +1 -0
  23. package/dist/c-C25ENHIK.min.js +1 -0
  24. package/dist/c-CDR5AO3R.min.js +1 -0
  25. package/dist/c-COHXCW3Q.min.js +1 -0
  26. package/dist/{chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js → c-DADXPJXV.min.js} +0 -1
  27. package/dist/c-E3JFRRMI.min.js +1 -0
  28. package/dist/c-EBFPQHHO.min.js +1 -0
  29. package/dist/c-G36WS6LN.min.js +1 -0
  30. package/dist/c-GIKRQI4X.min.js +1 -0
  31. package/dist/c-GPYOFETM.min.js +1 -0
  32. package/dist/c-IDUHYYSI.min.js +1 -0
  33. package/dist/{chunk-chunk-FQPKOAIH.module.min.js → c-IUHFPMHD.min.js} +0 -1
  34. package/dist/c-J5G56TUH.min.js +1 -0
  35. package/dist/c-JAZ73J32.min.js +1 -0
  36. package/dist/c-KG3NXHAL.min.js +1 -0
  37. package/dist/c-KII3PLZE.min.js +1 -0
  38. package/dist/c-LIXGXMNS.min.js +1 -0
  39. package/dist/c-LVEY6D6B.min.js +1 -0
  40. package/dist/c-M4Y3BHFR.min.js +1 -0
  41. package/dist/c-MAIICR2Z.min.js +1 -0
  42. package/dist/c-MG5DM6VE.min.js +1 -0
  43. package/dist/{chunk-minimapBrushOverlay-JU57U7NM.module.min.js → c-MNF2S4AA.min.js} +0 -1
  44. package/dist/c-MT3WBK7M.min.js +1 -0
  45. package/dist/c-NY3JWV2K.min.js +1 -0
  46. package/dist/c-O6U6K4CW.min.js +1 -0
  47. package/dist/c-OCI56QF2.min.js +1 -0
  48. package/dist/c-OQ7M4AGV.min.js +1 -0
  49. package/dist/c-OXYMVK7Q.min.js +1 -0
  50. package/dist/c-PPWDL5ZI.min.js +1 -0
  51. package/dist/c-QHF5YON3.min.js +1 -0
  52. package/dist/c-RR3GO5SW.min.js +1 -0
  53. package/dist/{chunk-chunk-J5QD4RAM.module.min.js → c-RSVIHIQ4.min.js} +0 -1
  54. package/dist/{chunk-chunk-EMO5NUGE.module.min.js → c-S2BXNNJN.min.js} +0 -1
  55. package/dist/{chunk-chunk-YCQYG6J5.module.min.js → c-SLGMUBUL.min.js} +0 -1
  56. package/dist/c-SUILCHWU.min.js +1 -0
  57. package/dist/c-TZW3JGJ5.min.js +1 -0
  58. package/dist/c-US5ZFT6E.min.js +1 -0
  59. package/dist/{chunk-chunk-RZH7VZYS.module.min.js → c-USFMFKIH.min.js} +0 -1
  60. package/dist/c-UUKVD4WB.min.js +1 -0
  61. package/dist/{chunk-chunk-SV4XAZ3Q.module.min.js → c-VGW3VG3I.min.js} +0 -1
  62. package/dist/c-W3CE4A4S.min.js +1 -0
  63. package/dist/{chunk-chunk-2NVFEB7P.module.min.js → c-WJCD5EUY.min.js} +0 -1
  64. package/dist/{chunk-chunk-2JGJ5GUG.module.min.js → c-X5UBGU2V.min.js} +0 -1
  65. package/dist/c-YDAY2WFR.min.js +1 -0
  66. package/dist/c-ZOWWU34K.min.js +1 -0
  67. package/dist/components/AccessibleNavTree.d.ts +1 -1
  68. package/dist/components/CategoryColors.d.ts +1 -1
  69. package/dist/components/GradientLegend.d.ts +14 -0
  70. package/dist/components/Legend.d.ts +2 -7
  71. package/dist/components/LinkedCharts.d.ts +1 -1
  72. package/dist/components/MobileAnnotationCalloutList.d.ts +1 -1
  73. package/dist/components/ObservationReadout.d.ts +45 -0
  74. package/dist/components/ThemeProvider.d.ts +4 -4
  75. package/dist/components/Tooltip/FlippingTooltip.d.ts +5 -7
  76. package/dist/components/Tooltip/Tooltip.d.ts +83 -5
  77. package/dist/components/Tooltip/tooltipChrome.d.ts +43 -0
  78. package/dist/components/ai/chartCapabilityTypes.d.ts +86 -2
  79. package/dist/components/ai/chartClinic.d.ts +2 -0
  80. package/dist/components/ai/deriveProfileFields.d.ts +40 -0
  81. package/dist/components/ai/evaluateChart.d.ts +85 -0
  82. package/dist/components/ai/fieldPolicy.d.ts +7 -0
  83. package/dist/components/ai/fieldRoles.d.ts +24 -0
  84. package/dist/components/ai/generativeChart.d.ts +18 -2
  85. package/dist/components/ai/inferIntent.d.ts +26 -2
  86. package/dist/components/ai/intents.d.ts +35 -0
  87. package/dist/components/ai/navigationTree.d.ts +2 -2
  88. package/dist/components/ai/observedSceneAudit.d.ts +2 -1
  89. package/dist/components/ai/profileData.d.ts +11 -0
  90. package/dist/components/ai/repairChartConfig.d.ts +2 -3
  91. package/dist/components/ai/semanticEvidence.d.ts +4 -0
  92. package/dist/components/ai/semanticViability.d.ts +11 -0
  93. package/dist/components/ai/semanticViabilityRegistry.d.ts +5 -0
  94. package/dist/components/ai/streamingTypes.d.ts +4 -0
  95. package/dist/components/ai/suggestCharts.d.ts +5 -6
  96. package/dist/components/ai/suggestDashboard.d.ts +2 -3
  97. package/dist/components/ai/suggestStreamCharts.d.ts +1 -1
  98. package/dist/components/ai/suggestStretchCharts.d.ts +2 -3
  99. package/dist/components/ai/suggestionPropContracts.d.ts +20 -0
  100. package/dist/components/ai/variantDiscovery.d.ts +3 -1
  101. package/dist/components/charts/custom/NetworkCustomChart.d.ts +3 -0
  102. package/dist/components/charts/custom/OrdinalCustomChart.d.ts +3 -0
  103. package/dist/components/charts/custom/XYCustomChart.d.ts +1 -1
  104. package/dist/components/charts/geo/ChoroplethMap.d.ts +3 -1
  105. package/dist/components/charts/geo/DistanceCartogram.d.ts +2 -7
  106. package/dist/components/charts/geo/cartogramOverlay.d.ts +28 -0
  107. package/dist/components/charts/index.d.ts +4 -3
  108. package/dist/components/charts/network/ProcessSankey.d.ts +2 -136
  109. package/dist/components/charts/network/ProcessSankeyProps.d.ts +139 -0
  110. package/dist/components/charts/network/Treemap.d.ts +2 -1
  111. package/dist/components/charts/network/processSankey/boundaryHubOrdering.d.ts +23 -0
  112. package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +2 -0
  113. package/dist/components/charts/network/processSankey/ordering.d.ts +3 -41
  114. package/dist/components/charts/network/processSankey/orderingTypes.d.ts +32 -0
  115. package/dist/components/charts/network/processSankey/packing.d.ts +1 -1
  116. package/dist/components/charts/network/processSankey/packingCache.d.ts +1 -1
  117. package/dist/components/charts/network/processSankey/packingOptimization.d.ts +72 -0
  118. package/dist/components/charts/ordinal/BarChart.d.ts +4 -3
  119. package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
  120. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -2
  121. package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
  122. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +2 -2
  123. package/dist/components/charts/physics/GaltonBoardChart.d.ts +2 -9
  124. package/dist/components/charts/physics/GauntletChart.d.ts +10 -41
  125. package/dist/components/charts/physics/ProcessFlowChart.d.ts +1 -1
  126. package/dist/components/charts/physics/chainReactionAccessibleTable.d.ts +9 -0
  127. package/dist/components/charts/physics/chainReactionRuntime.d.ts +2 -1
  128. package/dist/components/charts/physics/chainReactionTypes.d.ts +6 -1
  129. package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +2 -2
  130. package/dist/components/charts/physics/crucibleClone.d.ts +6 -0
  131. package/dist/components/charts/physics/crucibleEffects.d.ts +1 -2
  132. package/dist/components/charts/physics/crucibleRecord.d.ts +7 -0
  133. package/dist/components/charts/physics/gauntletChrome.d.ts +4 -4
  134. package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
  135. package/dist/components/charts/physics/gauntletPublic.d.ts +4 -0
  136. package/dist/components/charts/physics/packetFlowOverlay.d.ts +7 -0
  137. package/dist/components/charts/physics/physicsChartLayout.d.ts +8 -0
  138. package/dist/components/charts/physics/physicsChartShared.d.ts +3 -1
  139. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  140. package/dist/components/charts/physics/physicsHocUtils.d.ts +26 -13
  141. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +24 -0
  142. package/dist/components/charts/physics/processFlowOverlays.d.ts +9 -0
  143. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +17 -12
  144. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +12 -7
  145. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +37 -14
  146. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +23 -14
  147. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +22 -13
  148. package/dist/components/charts/realtime/aggregate.d.ts +4 -1
  149. package/dist/components/charts/realtime/eventTime.d.ts +4 -0
  150. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +27 -0
  151. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +30 -0
  152. package/dist/components/charts/realtime/useRealtimeCategoryColors.d.ts +30 -0
  153. package/dist/components/charts/shared/FrameTextAnnotationSVG.d.ts +10 -0
  154. package/dist/components/charts/shared/annotationActivation.d.ts +3 -7
  155. package/dist/components/charts/shared/annotationBandFill.d.ts +6 -0
  156. package/dist/components/charts/shared/annotationDispatch.d.ts +31 -0
  157. package/dist/components/charts/shared/annotationIdentity.d.ts +8 -0
  158. package/dist/components/charts/shared/annotationRules.d.ts +1 -15
  159. package/dist/components/charts/shared/boundedCategoryRegistry.d.ts +8 -0
  160. package/dist/components/charts/shared/chainReactionChartSpec.d.ts +3 -0
  161. package/dist/components/charts/shared/chartMode.d.ts +3 -2
  162. package/dist/components/charts/shared/chartSpecCore.d.ts +1 -0
  163. package/dist/components/charts/shared/formatUtils.d.ts +40 -9
  164. package/dist/components/charts/shared/frameTextAnnotation.d.ts +63 -0
  165. package/dist/components/charts/shared/gradient.d.ts +16 -0
  166. package/dist/components/charts/shared/hatchFill.d.ts +15 -0
  167. package/dist/components/charts/shared/hooks.d.ts +4 -4
  168. package/dist/components/charts/shared/legendUtils.d.ts +1 -0
  169. package/dist/components/charts/shared/streamPropsHelpers.d.ts +3 -1
  170. package/dist/components/charts/shared/styleRules.d.ts +9 -2
  171. package/dist/components/charts/shared/styleRulesWireSchema.d.ts +353 -0
  172. package/dist/components/charts/shared/types.d.ts +26 -10
  173. package/dist/components/charts/shared/useChartLegend.d.ts +43 -9
  174. package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
  175. package/dist/components/charts/shared/useCustomChartSetup.d.ts +5 -2
  176. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +5 -1
  177. package/dist/components/charts/shared/useOrdinalBrush.d.ts +3 -3
  178. package/dist/components/charts/shared/useStreamingLegend.d.ts +6 -1
  179. package/dist/components/charts/value/types.d.ts +1 -1
  180. package/dist/components/charts/xy/BubbleChart.d.ts +1 -1
  181. package/dist/components/charts/xy/BumpChart.capability.d.ts +14 -1
  182. package/dist/components/charts/xy/BumpChart.d.ts +13 -73
  183. package/dist/components/charts/xy/BumpChart.semanticViability.d.ts +5 -0
  184. package/dist/components/charts/xy/CandlestickChart.d.ts +2 -2
  185. package/dist/components/charts/xy/LineChart.d.ts +2 -2
  186. package/dist/components/charts/xy/Scatterplot.d.ts +1 -1
  187. package/dist/components/charts/xy/bumpData.d.ts +44 -0
  188. package/dist/components/charts/xy/bumpIdentity.d.ts +2 -0
  189. package/dist/components/charts/xy/bumpLayout.d.ts +45 -0
  190. package/dist/components/charts/xy/bumpTooltip.d.ts +20 -0
  191. package/dist/components/legendLayout.d.ts +131 -4
  192. package/dist/components/realtime/ReorderBuffer.d.ts +2 -0
  193. package/dist/components/realtime/types.d.ts +10 -1
  194. package/dist/components/recipes/balanceSnapshotsToFlows.d.ts +42 -0
  195. package/dist/components/recipes/directedReachability.d.ts +14 -0
  196. package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +6 -6
  197. package/dist/components/recipes/gridObservatory.d.ts +1 -1
  198. package/dist/components/recipes/networkAnalysis.d.ts +1 -18
  199. package/dist/components/recipes/physics.d.ts +7 -4
  200. package/dist/components/recipes/processPhysics.d.ts +0 -1
  201. package/dist/components/recipes/waffle.d.ts +7 -4
  202. package/dist/components/semiotic-ai-core.d.ts +13 -4
  203. package/dist/components/semiotic-ai-observations.d.ts +3 -0
  204. package/dist/components/semiotic-ai.d.ts +16 -9
  205. package/dist/components/semiotic-client-shared.d.ts +10 -0
  206. package/dist/components/semiotic-experimental.d.ts +1 -1
  207. package/dist/components/semiotic-geo.d.ts +4 -1
  208. package/dist/components/semiotic-network.d.ts +7 -4
  209. package/dist/components/semiotic-ordinal.d.ts +4 -1
  210. package/dist/components/semiotic-physics.d.ts +11 -4
  211. package/dist/components/semiotic-realtime-core.d.ts +11 -4
  212. package/dist/components/semiotic-realtime-react.d.ts +4 -3
  213. package/dist/components/semiotic-realtime.d.ts +3 -1
  214. package/dist/components/semiotic-recipes-core.d.ts +7 -5
  215. package/dist/components/semiotic-server-edge.d.ts +3 -2
  216. package/dist/components/semiotic-server.d.ts +3 -2
  217. package/dist/components/semiotic-themes-core.d.ts +5 -48
  218. package/dist/components/semiotic-utils-core.d.ts +11 -5
  219. package/dist/components/semiotic-utils-react.d.ts +2 -0
  220. package/dist/components/semiotic-xy.d.ts +4 -1
  221. package/dist/components/semiotic.d.ts +68 -25
  222. package/dist/components/server/animatedGif.d.ts +1 -1
  223. package/dist/components/server/renderEvidence.d.ts +25 -2
  224. package/dist/components/server/renderToStaticSVG.d.ts +15 -7
  225. package/dist/components/server/serverChartConfigShared.d.ts +8 -1
  226. package/dist/components/server/serverChartConfigs.d.ts +1 -0
  227. package/dist/components/server/serverChartConfigsNetwork.d.ts +3 -3
  228. package/dist/components/server/serverChartConfigsNetworkChord.d.ts +2 -0
  229. package/dist/components/server/serverChartConfigsNetworkForce.d.ts +2 -0
  230. package/dist/components/server/serverChartConfigsNetworkHierarchy.d.ts +3 -0
  231. package/dist/components/server/serverChartConfigsXY.d.ts +3 -3
  232. package/dist/components/server/serverChartConfigsXYBubble.d.ts +5 -0
  233. package/dist/components/server/serverChartConfigsXYBump.d.ts +7 -0
  234. package/dist/components/server/serverChartConfigsXYScatter.d.ts +5 -0
  235. package/dist/components/server/staticAnnotationFallbacks.d.ts +10 -0
  236. package/dist/components/server/staticAnnotations.d.ts +28 -1
  237. package/dist/components/server/staticAxisTickLabel.d.ts +13 -0
  238. package/dist/components/server/staticLegend.d.ts +1 -1
  239. package/dist/components/server/staticLegendMargin.d.ts +41 -0
  240. package/dist/components/server/staticOrdinal.d.ts +8 -2
  241. package/dist/components/server/staticPhysics.d.ts +13 -1
  242. package/dist/components/server/staticPhysicsChrome.d.ts +20 -0
  243. package/dist/components/server/staticRawLegend.d.ts +15 -0
  244. package/dist/components/server/staticSVGChrome.d.ts +16 -55
  245. package/dist/components/server/staticXYAxes.d.ts +27 -0
  246. package/dist/components/server/staticXYAxisTicks.d.ts +39 -0
  247. package/dist/components/server/staticXYGrid.d.ts +11 -0
  248. package/dist/components/server/themeResolver.d.ts +5 -1
  249. package/dist/components/store/ThemeStore.d.ts +2 -98
  250. package/dist/components/store/designTokens.d.ts +1 -1
  251. package/dist/components/store/themeCSSVariables.d.ts +10 -0
  252. package/dist/components/store/themeCore.d.ts +91 -0
  253. package/dist/components/store/themePresets.d.ts +81 -0
  254. package/dist/components/store/themeSerialization.d.ts +2 -1
  255. package/dist/components/stream/AccessibleDataTable.d.ts +12 -14
  256. package/dist/components/stream/AccessibleTablePortalImpl.d.ts +6 -0
  257. package/dist/components/stream/GeoTileRenderer.d.ts +3 -0
  258. package/dist/components/stream/NetworkCanvasHitTester.d.ts +3 -1
  259. package/dist/components/stream/NetworkSSRFrame.d.ts +2 -1
  260. package/dist/components/stream/NetworkSVGOverlay.d.ts +3 -31
  261. package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -0
  262. package/dist/components/stream/SVGChartTitle.d.ts +9 -0
  263. package/dist/components/stream/SVGOverlay.d.ts +1 -21
  264. package/dist/components/stream/SVGUnderlay.d.ts +24 -0
  265. package/dist/components/stream/SceneToSVG.d.ts +1 -1
  266. package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
  267. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
  268. package/dist/components/stream/StreamXYFrame.d.ts +1 -1
  269. package/dist/components/stream/accessibleDataRows.d.ts +11 -0
  270. package/dist/components/stream/accessibleDataTableModel.d.ts +40 -0
  271. package/dist/components/stream/accessibleTableTypes.d.ts +11 -0
  272. package/dist/components/stream/axisTickUtils.d.ts +19 -0
  273. package/dist/components/stream/canvasBackground.d.ts +10 -0
  274. package/dist/components/stream/canvasSetup.d.ts +24 -4
  275. package/dist/components/stream/frameCursorInteraction.d.ts +25 -0
  276. package/dist/components/stream/frameDefaultMargins.d.ts +37 -0
  277. package/dist/components/stream/frameGraphics.d.ts +18 -0
  278. package/dist/components/stream/frameGraphicsSubscription.d.ts +26 -0
  279. package/dist/components/stream/frameLegendOptions.d.ts +18 -0
  280. package/dist/components/stream/geoFrameCursorInteraction.d.ts +9 -0
  281. package/dist/components/stream/geoFrameHelpers.d.ts +29 -1
  282. package/dist/components/stream/geoTypes.d.ts +12 -11
  283. package/dist/components/stream/hitTarget.d.ts +61 -2
  284. package/dist/components/stream/moduleWorkerSession.d.ts +6 -0
  285. package/dist/components/stream/networkAnnotationAnchors.d.ts +37 -0
  286. package/dist/components/stream/networkCustomLayout.d.ts +2 -2
  287. package/dist/components/stream/networkFrameCursorInteraction.d.ts +12 -0
  288. package/dist/components/stream/networkFrameInteraction.d.ts +2 -0
  289. package/dist/components/stream/networkFramePaint.d.ts +15 -0
  290. package/dist/components/stream/networkPipelineConfig.d.ts +1 -1
  291. package/dist/components/stream/networkTypes.d.ts +32 -32
  292. package/dist/components/stream/normalizeXYData.d.ts +7 -0
  293. package/dist/components/stream/ordinalFrameCursorInteraction.d.ts +7 -0
  294. package/dist/components/stream/ordinalFrameInteraction.d.ts +29 -0
  295. package/dist/components/stream/ordinalSceneSVG.d.ts +10 -0
  296. package/dist/components/stream/ordinalTypes.d.ts +12 -4
  297. package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +9 -1
  298. package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +25 -0
  299. package/dist/components/stream/physics/PhysicsControllers.d.ts +0 -3
  300. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +4 -1
  301. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +3 -24
  302. package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +9 -21
  303. package/dist/components/stream/physics/PhysicsSettledSVGElement.d.ts +37 -0
  304. package/dist/components/stream/physics/PhysicsSettledScene.d.ts +7 -3
  305. package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +1 -1
  306. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +25 -4
  307. package/dist/components/stream/physics/physicsAnnotationContext.d.ts +19 -0
  308. package/dist/components/stream/physics/physicsBodyCanvas.d.ts +4 -0
  309. package/dist/components/stream/physics/physicsSettledChrome.d.ts +7 -0
  310. package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +32 -0
  311. package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +36 -0
  312. package/dist/components/stream/pipelineConfig.d.ts +8 -17
  313. package/dist/components/stream/pipelineDomainResolution.d.ts +2 -2
  314. package/dist/components/stream/renderBackend.d.ts +2 -0
  315. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +13 -2
  316. package/dist/components/stream/renderers/resolveCSSColor.d.ts +7 -0
  317. package/dist/components/stream/responsiveSize.d.ts +17 -0
  318. package/dist/components/stream/sceneCursor.d.ts +41 -0
  319. package/dist/components/stream/sceneRevisionDiagnostics.d.ts +1 -1
  320. package/dist/components/stream/svgOverlayUtils.d.ts +22 -1
  321. package/dist/components/stream/types.d.ts +33 -13
  322. package/dist/components/stream/useCanvasFrameHost.d.ts +12 -1
  323. package/dist/components/stream/useFrame.d.ts +24 -1
  324. package/dist/components/stream/useResponsiveSize.d.ts +6 -1
  325. package/dist/components/stream/useStalenessCheck.d.ts +1 -1
  326. package/dist/components/stream/xyFrameAxisTypes.d.ts +20 -4
  327. package/dist/components/stream/xyFrameCursorInteraction.d.ts +6 -0
  328. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +1 -1
  329. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -26
  330. package/dist/components/types/legendTypes.d.ts +6 -0
  331. package/dist/components/types/marginType.d.ts +7 -8
  332. package/dist/controls.min.js +1 -1
  333. package/dist/controls.module.min.js +1 -1
  334. package/dist/forceLayoutWorker.js +1 -1
  335. package/dist/geo.min.js +1 -1
  336. package/dist/geo.module.min.js +1 -1
  337. package/dist/network.min.js +1 -1
  338. package/dist/network.module.min.js +1 -1
  339. package/dist/ordinal.min.js +1 -1
  340. package/dist/ordinal.module.min.js +1 -1
  341. package/dist/physics-matter.module.min.js +1 -1
  342. package/dist/physics-rapier.module.min.js +1 -1
  343. package/dist/physics.min.js +1 -1
  344. package/dist/physics.module.min.js +1 -1
  345. package/dist/physicsWorker.js +1 -1
  346. package/dist/processSankeyLayoutWorker.js +1 -1
  347. package/dist/realtime.min.js +1 -1
  348. package/dist/realtime.module.min.js +1 -1
  349. package/dist/rough.min.js +1 -1
  350. package/dist/rough.module.min.js +1 -1
  351. package/dist/semiotic-ai-core.d.ts +13 -4
  352. package/dist/semiotic-ai-core.min.js +1 -1
  353. package/dist/semiotic-ai-core.module.min.js +1 -1
  354. package/dist/semiotic-ai.d.ts +16 -9
  355. package/dist/semiotic-ai.min.js +1 -1
  356. package/dist/semiotic-ai.module.min.js +1 -1
  357. package/dist/semiotic-client-cjs-shared.min.js +1 -0
  358. package/dist/semiotic-client-glyph.module.min.js +2 -0
  359. package/dist/semiotic-client-responsive.module.min.js +2 -0
  360. package/dist/semiotic-client-shared.module.min.js +2 -0
  361. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -0
  362. package/dist/semiotic-data.min.js +1 -1
  363. package/dist/semiotic-data.module.min.js +1 -1
  364. package/dist/semiotic-experimental-auxiliary.module.min.js +2 -0
  365. package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -0
  366. package/dist/semiotic-experimental-node.module.min.js +2 -0
  367. package/dist/semiotic-experimental-react-shared.module.min.js +2 -0
  368. package/dist/semiotic-experimental-vacp.min.js +1 -1
  369. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  370. package/dist/semiotic-experimental.d.ts +1 -1
  371. package/dist/semiotic-experimental.min.js +1 -1
  372. package/dist/semiotic-experimental.module.min.js +1 -1
  373. package/dist/semiotic-geo.d.ts +4 -1
  374. package/dist/semiotic-network.d.ts +7 -4
  375. package/dist/semiotic-ordinal.d.ts +4 -1
  376. package/dist/semiotic-physics.d.ts +11 -4
  377. package/dist/semiotic-realtime-core.d.ts +11 -4
  378. package/dist/semiotic-realtime-core.min.js +2 -1
  379. package/dist/semiotic-realtime-core.module.min.js +2 -1
  380. package/dist/semiotic-realtime-react.d.ts +4 -3
  381. package/dist/semiotic-realtime-react.min.js +1 -1
  382. package/dist/semiotic-realtime-react.module.min.js +1 -1
  383. package/dist/semiotic-realtime.d.ts +3 -1
  384. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -0
  385. package/dist/semiotic-recipes-core.d.ts +7 -5
  386. package/dist/semiotic-recipes-core.min.js +9 -1
  387. package/dist/semiotic-recipes-core.module.min.js +1 -1
  388. package/dist/semiotic-recipes-geo-cjs.min.js +1 -0
  389. package/dist/semiotic-recipes-react.min.js +1 -1
  390. package/dist/semiotic-recipes-react.module.min.js +1 -1
  391. package/dist/semiotic-recipes.min.js +7 -1
  392. package/dist/semiotic-recipes.module.min.js +2 -1
  393. package/dist/semiotic-server-edge-node.module.min.js +1 -0
  394. package/dist/semiotic-server-edge.d.ts +3 -2
  395. package/dist/semiotic-server-edge.min.js +1 -1
  396. package/dist/semiotic-server-edge.module.min.js +1 -1
  397. package/dist/semiotic-server-node.min.js +1 -1
  398. package/dist/semiotic-server-node.module.min.js +1 -1
  399. package/dist/semiotic-server.d.ts +3 -2
  400. package/dist/semiotic-themes-core.d.ts +5 -48
  401. package/dist/semiotic-themes-core.min.js +1 -1
  402. package/dist/semiotic-themes-core.module.min.js +1 -1
  403. package/dist/semiotic-themes-react.min.js +1 -1
  404. package/dist/semiotic-themes-react.module.min.js +1 -1
  405. package/dist/semiotic-themes.min.js +1 -1
  406. package/dist/semiotic-themes.module.min.js +1 -1
  407. package/dist/semiotic-utils-core.d.ts +11 -5
  408. package/dist/semiotic-utils-core.min.js +1 -1
  409. package/dist/semiotic-utils-core.module.min.js +1 -1
  410. package/dist/semiotic-utils-react.d.ts +2 -0
  411. package/dist/semiotic-utils-react.min.js +1 -1
  412. package/dist/semiotic-utils-react.module.min.js +1 -1
  413. package/dist/semiotic-utils.min.js +2 -1
  414. package/dist/semiotic-utils.module.min.js +2 -1
  415. package/dist/semiotic-value.min.js +1 -1
  416. package/dist/semiotic-value.module.min.js +1 -1
  417. package/dist/semiotic-xy.d.ts +4 -1
  418. package/dist/semiotic.d.ts +68 -25
  419. package/dist/semiotic.min.js +1 -1
  420. package/dist/semiotic.module.min.js +1 -1
  421. package/dist/server.min.js +1 -1
  422. package/dist/server.module.min.js +1 -1
  423. package/dist/xy.min.js +1 -1
  424. package/dist/xy.module.min.js +1 -1
  425. package/package.json +53 -19
  426. package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +0 -20
  427. package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +0 -2
  428. package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +0 -1
  429. package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +0 -2
  430. package/dist/chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js +0 -2
  431. package/dist/chunk-chunk-2B3AIKUZ.module.min.js +0 -2
  432. package/dist/chunk-chunk-2CXCXRB4.module.min.js +0 -1
  433. package/dist/chunk-chunk-3GCILWPB.module.min.js +0 -2
  434. package/dist/chunk-chunk-46KRGJQP.module.min.js +0 -1
  435. package/dist/chunk-chunk-4ITOQRXM.module.min.js +0 -2
  436. package/dist/chunk-chunk-4MLLQUGW.module.min.js +0 -2
  437. package/dist/chunk-chunk-57RBPDBQ.module.min.js +0 -2
  438. package/dist/chunk-chunk-5UKL5W76.module.min.js +0 -2
  439. package/dist/chunk-chunk-5VVNW5AZ.module.min.js +0 -1
  440. package/dist/chunk-chunk-66PCWJUG.module.min.js +0 -1
  441. package/dist/chunk-chunk-6V5VQVCT.module.min.js +0 -2
  442. package/dist/chunk-chunk-7LE56WAE.module.min.js +0 -2
  443. package/dist/chunk-chunk-7T25U75Z.module.min.js +0 -2
  444. package/dist/chunk-chunk-ACLDBMRH.module.min.js +0 -2
  445. package/dist/chunk-chunk-AF53TBSN.module.min.js +0 -2
  446. package/dist/chunk-chunk-BTZYH2IE.module.min.js +0 -1
  447. package/dist/chunk-chunk-BWV55BZK.module.min.js +0 -2
  448. package/dist/chunk-chunk-BZNOAHJV.module.min.js +0 -2
  449. package/dist/chunk-chunk-CD6PVVS3.module.min.js +0 -2
  450. package/dist/chunk-chunk-DTSNLGRK.module.min.js +0 -2
  451. package/dist/chunk-chunk-FC3NZWYR.module.min.js +0 -2
  452. package/dist/chunk-chunk-FEPXDKJP.module.min.js +0 -1
  453. package/dist/chunk-chunk-FJ76HWQZ.module.min.js +0 -1
  454. package/dist/chunk-chunk-FRGBMTZR.module.min.js +0 -1
  455. package/dist/chunk-chunk-G75OPF5N.module.min.js +0 -2
  456. package/dist/chunk-chunk-H5IFO6CU.module.min.js +0 -2
  457. package/dist/chunk-chunk-HADHLMY5.module.min.js +0 -1
  458. package/dist/chunk-chunk-HBFA4NN6.module.min.js +0 -1
  459. package/dist/chunk-chunk-HCNDE26Q.module.min.js +0 -2
  460. package/dist/chunk-chunk-IY7RYD4S.module.min.js +0 -1
  461. package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
  462. package/dist/chunk-chunk-J3XWETBJ.module.min.js +0 -2
  463. package/dist/chunk-chunk-JJ4BSUYL.module.min.js +0 -2
  464. package/dist/chunk-chunk-JRHXQGEV.module.min.js +0 -2
  465. package/dist/chunk-chunk-KTWEBFMX.module.min.js +0 -2
  466. package/dist/chunk-chunk-L6FFYGYS.module.min.js +0 -1
  467. package/dist/chunk-chunk-LJDH3WV3.module.min.js +0 -2
  468. package/dist/chunk-chunk-LSJUXBMF.module.min.js +0 -1
  469. package/dist/chunk-chunk-N3Q33XCB.module.min.js +0 -2
  470. package/dist/chunk-chunk-NWIGA3UK.module.min.js +0 -1
  471. package/dist/chunk-chunk-OG3TTJGJ.module.min.js +0 -2
  472. package/dist/chunk-chunk-OZK46A5U.module.min.js +0 -1
  473. package/dist/chunk-chunk-PMR47KRY.module.min.js +0 -2
  474. package/dist/chunk-chunk-Q2YADC2V.module.min.js +0 -2
  475. package/dist/chunk-chunk-QQJNG23C.module.min.js +0 -2
  476. package/dist/chunk-chunk-RGJ6TKAH.module.min.js +0 -2
  477. package/dist/chunk-chunk-ROP4HI7H.module.min.js +0 -2
  478. package/dist/chunk-chunk-SFLUSZ73.module.min.js +0 -2
  479. package/dist/chunk-chunk-TCMHJWFJ.module.min.js +0 -1
  480. package/dist/chunk-chunk-TSCFL235.module.min.js +0 -1
  481. package/dist/chunk-chunk-U66USBWU.module.min.js +0 -1
  482. package/dist/chunk-chunk-UEZ6SHW5.module.min.js +0 -2
  483. package/dist/chunk-chunk-UOQRPGPK.module.min.js +0 -2
  484. package/dist/chunk-chunk-VUWYT7DY.module.min.js +0 -2
  485. package/dist/chunk-chunk-W5HWGQMD.module.min.js +0 -2
  486. package/dist/chunk-chunk-WFHZHWT7.module.min.js +0 -1
  487. package/dist/chunk-chunk-WGROBM3I.module.min.js +0 -2
  488. package/dist/chunk-chunk-WSDJFBKX.module.min.js +0 -2
  489. package/dist/chunk-chunk-YHNZCPOZ.module.min.js +0 -2
  490. package/dist/chunk-chunk-YWZB3KPI.module.min.js +0 -2
  491. package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +0 -2
  492. package/dist/components/stream/test-utils/frameScheduler.d.ts +0 -12
  493. package/dist/components/stream/test-utils/revisionConsumption.d.ts +0 -13
  494. package/dist/test-utils/canvasMock.d.ts +0 -86
  495. package/dist/test-utils/capturedFrameProps.d.ts +0 -67
  496. package/dist/test-utils/frameMock.d.ts +0 -81
  497. package/dist/test-utils/ordinalFixtures.d.ts +0 -48
  498. /package/dist/{chunk-chunk-JJ2OOIET.module.min.js → c-GGISSW5E.min.js} +0 -0
  499. /package/dist/{chunk-chunk-SIRIJ3DY.module.min.js → c-N4G2L7ID.min.js} +0 -0
  500. /package/dist/{chunk-chunk-CA3YDW6F.module.min.js → c-S6U5CGT5.min.js} +0 -0
  501. /package/dist/components/recipes/{mobileAnnotationStrategy.d.ts → mobileAnnotationBehavior.d.ts} +0 -0
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{mulberry32 as e}from"./chunk-chunk-SIRIJ3DY.module.min.js";function t(e){if(!e?.layoutQuality)return[];const t=[],r=e.layoutQuality,s=e.layoutQualityBefore;e.compressedPadding&&t.push({severity:"warning",code:"PROCESS_SANKEY_COMPRESSED_PADDING",message:"Lane gaps were compressed to fit peaks into the plot height.",fix:'Increase height, lower maxValueScale, use packing="reuse", or reduce concurrent peaks.'}),8>r.transitOcclusion||t.push({severity:"warning",code:"PROCESS_SANKEY_HIGH_TRANSIT",message:`High transit occlusion (${r.transitOcclusion.toFixed(1)}) — ribbons cross dense intermediate lanes.`,fix:'Try laneOrder="crossing-min+inside-out", packing="reuse", or lanePlacement="hug" with a modest maxValueScale.'}),.92>r.verticalUtilization||t.push({severity:"warning",code:"PROCESS_SANKEY_HIGH_UTILIZATION",message:`Lane utilization is ${Math.round(100*r.verticalUtilization)}% of plot height.`,fix:"Increase chart height or cap band scale with maxValueScale."});const o=e.crossingsAfter??r.crossings;return null==o||3>o||t.push({severity:"warning",code:"PROCESS_SANKEY_RESIDUAL_CROSSINGS",message:`Ordering left ${o} edge-pair crossings`+(s?` (from ${s.crossings})`:"")+".",fix:'Prefer laneOrder="crossing-min" or "crossing-min+inside-out"; check for unavoidable fan-outs.'}),t}function r(e){if(!e?.layoutQuality)return null;const t=e.layoutQuality,r=e.layoutQualityBefore,s=e.crossingsAfter??t.crossings;return[`ProcessSankey layout uses ${e.slots?.length??"?"} packed lane(s).`,null!=s?`Edge-pair crossings ${r?r.crossings+" → ":""}${s}.`:null,`Pixel path length ${r?Math.round(r.pixelLength)+" → ":""}${Math.round(t.pixelLength)}.`,`Transit occlusion ${r?r.transitOcclusion.toFixed(1)+" → ":""}${t.transitOcclusion.toFixed(1)}.`,`Lane utilization ${Math.round(100*t.verticalUtilization)}%.`,e.compressedPadding?"Lane gaps were compressed to fit the plot.":null].filter(Boolean).join(" ")}function s(e){const t=[],r=e.domain;null==r?t.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} as numbers or Date-compatible values."}):Array.isArray(r)&&2===r.length&&Number.isFinite(Number(r[0]))&&Number.isFinite(Number(r[1]))||t.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times.",fix:"Use domain={[t0, t1]} with t0 <= t1."});const s=e.edges;if(Array.isArray(s)&&s.length>0){const e=s[0];null!=e.startTime&&null!=e.endTime||t.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}const o=e.nodes,i=Array.isArray(o)?o.length:0;return!0!==e.showLabels||24>i||t.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${i} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),80>(Array.isArray(s)?s.length:0)||null!=e.layoutExecution||"off"===e.packing||t.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),t}import{forceCenter as o,forceCollide as i,forceLink as n,forceManyBody as a,forceSimulation as c,forceX as l,forceY as u}from"d3-force";function d(t,r,s={}){const d=s.iterations??260,g=s.repulsion??5200,h=s.linkDistance??165,m=s.linkStrength??.045,f=s.centerStrength??.018,y=s.damping??.84,p=s.nodeRadius??12,S=s.nodePadding??3,E=s.inset??.06,A=e(s.seed??1),x=new Map;for(const e of t)x.set(e.id,0);for(const e of r)x.set(e.source,(x.get(e.source)??0)+1),x.set(e.target,(x.get(e.target)??0)+1);const _=500,w=t.map(e=>({id:e.id,data:e,x:200+600*A(),y:200+600*A()})),N=new Set(t.map(e=>e.id)),O=r.filter(e=>N.has(e.source)&&N.has(e.target)).map(e=>({source:e.source,target:e.target}));if(d>0){const e=c(w).randomSource(A).alphaDecay(1-Math.pow(.001,1/d)).velocityDecay(Math.max(0,Math.min(1,1-y))).force("charge",a().strength(e=>{const t=x.get(e.id)??0;return 2.5*-Math.sqrt(g)*Math.sqrt(t+1)})).force("collide",i(e=>(e=>"function"==typeof p?p(e.data):p)(e)+S).strength(.9).iterations(2)).force("center",o(_,_).strength(.8)).force("x",l(_).strength(f)).force("y",u(_).strength(f));O.length>0&&e.force("link",n(O).id(e=>e.id).distance(h).strength(e=>{const t="string"==typeof e.target?e.target:e.target.id,r=Math.max(1,Math.min(x.get("string"==typeof e.source?e.source:e.source.id)??1,x.get(t)??1));return m/.045/r})),e.stop();for(let t=0;d>t;t+=1)e.tick()}let P=1/0,k=1/0,I=-1/0,b=-1/0;for(const e of w){const t=e.x??_,r=e.y??_;P>t&&(P=t),k>r&&(k=r),t>I&&(I=t),r>b&&(b=r)}const T=I-P,M=b-k,R={};for(const e of w)R[e.id]={x:0===T?.5:E+((e.x??_)-P)/T*(1-2*E),y:0===M?.5:E+((e.y??_)-k)/M*(1-2*E)};return R}export{t as diagnoseProcessSankeyLayout,r as explainProcessSankeyLayout,s as diagnoseProcessSankeyProps,d as forceLayout};
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{opacityFromAge as t}from"./chunk-chunk-4MLLQUGW.module.min.js";import{bandFromAge as e,defaultTooltipStyle as n,normalizeTooltip as r,resolveCanvasFill as o}from"./chunk-chunk-HCNDE26Q.module.min.js";import{drawGlyphParts as a,glyphFractionClipRect as s,glyphHitGeometry as l,glyphPlacement as i}from"./chunk-chunk-KTWEBFMX.module.min.js";import{jsx as c,jsxs as u}from"react/jsx-runtime";function f(t){return"string"==typeof t?t:"value"}function h(t){return null==t?"–":"number"==typeof t?Math.abs(t)>9999?t.toLocaleString():t+"":t instanceof Date?t.toLocaleDateString():t+""}function d(t,e){if(!e)return h(t);try{const n=e(t);return null==n?h(t):n}catch{return h(t)}}function p(t,e){return"function"==typeof e?e(t):t[e]}function y(t,e){if(!t)return[];const n=[];return(Array.isArray(t)?t:[t]).forEach((t,r)=>{const o="string"==typeof t?.y0Accessor?t.y0Accessor:"low",a="string"==typeof t?.y1Accessor?t.y1Accessor:"high";n.push({label:o,accessor:t=>t.bands?.[r]?.y0??(0===r?t.band?.y0:void 0),format:e}),n.push({label:a,accessor:t=>t.bands?.[r]?.y1??(0===r?t.band?.y1:void 0),format:e})}),n}function g(t){const e=t.find(t=>"title"===t.role),r=t.filter(t=>"title"!==t.role);return t=>{const o=t.data;if(!o)return null;const a=e?d(p(o,e.accessor),e.format):null;return u("div",{className:"semiotic-tooltip",style:n,children:[null!=a&&c("div",{style:{fontWeight:"bold",marginBottom:r.length>0?4:0},children:a}),r.map((t,e)=>{const n=d(p(o,t.accessor),t.format);return u("div",{style:e>0?{marginTop:2}:void 0,children:[u("span",{style:{opacity:.7},children:[t.label,": "]}),c("span",{children:n})]},e)})]})}}function m({categoryAccessor:t,valueAccessor:e,groupAccessor:r,groupLabel:o,pieData:a=!1,valueFormat:s}){return l=>{const i=a?l.data?.[0]||l.data||l:l.data||l,y=p(i,t),g=p(i,e),m=r?p(i,r):void 0;return u("div",{className:"semiotic-tooltip",style:n,children:[c("div",{style:{fontWeight:"bold"},children:h(y)}),c("div",{style:{marginTop:4},children:d(g,s)}),null!=m&&u("div",{style:{marginTop:2,opacity:.8},children:[o||f(r),": ",h(m)]})]})}}import*as x from"react";function b(...t){const e=t.filter(t=>null!=t);return 0===e.length?null:1===e.length?e[0]:x.createElement(x.Fragment,null,...e)}import{useEffect as v,useRef as w}from"react";function A(t,e,n,r){v(()=>{t.current?.updateConfig(e),n.current=!0,r()},[e,r,t,n])}function k(t,e,n,r){const o=w(null);v(()=>{const a=t.current;if(!a)return;const s=e??null;o.current!==s&&(o.current=s,a.setLayoutSelection(s),a.hasCustomRestyle?a.restyleScene(s):n.current=!0,r())},[e,r,t,n])}var _={fresh:1,aging:.7,stale:.45,expired:.25},M={alpha:1,band:"fresh",isStale:!1};function I(t,n){if(!t||0>=n)return M;const r=null!=t.threshold&&t.threshold>0?t.threshold:5e3,o=t.graded;if(o){const t="object"==typeof o?o:{},a=e(n,r,t.thresholds);return{alpha:{..._,...t.opacities??{}}[a],band:a,isStale:"fresh"!==a}}return n>r?{alpha:t.dimOpacity??.5,band:"stale",isStale:!0}:M}import{useEffect as O,useRef as S}from"react";function D(t,e,n,r,o,a){const s=S("fresh");O(()=>{if(!t)return;const l=setInterval(()=>{const l=e.current;if(!l||0===l.lastIngestTime)return;const i="undefined"!=typeof performance?performance.now():Date.now(),c=I(t,i-l.lastIngestTime);c.band===s.current&&c.isStale===o||(s.current=c.band,c.isStale!==o&&a(c.isStale),n.current=!0,r())},1e3);return()=>clearInterval(l)},[t,o,r,e,a,n])}import{jsx as E}from"react/jsx-runtime";function R({isStale:t,position:e}){return E("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===e?{top:4,left:4}:"bottom-left"===e?{bottom:4,left:4}:"bottom-right"===e?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:t?"#dc3545":"#28a745",color:"white"},children:t?"STALE":"LIVE"})}import{useRef as P}from"react";function j(t){const e=P(t);return function(t,e){if(Object.is(t,e))return!0;if(Array.isArray(t)&&Array.isArray(e))return L(t,e);if(!T(t)||!T(e))return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;const n=t[r],o=e[r];if(!Object.is(n,o))if(Array.isArray(n)&&Array.isArray(o)){if(!L(n,o))return!1}else{if(!T(n)||!T(o))return!1;if(!C(n,o))return!1}}return!0}(e.current,t)||(e.current=t),e.current}function C(t,e){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;if(!Object.is(t[r],e[r]))return!1}return!0}function L(t,e){if(t.length!==e.length)return!1;for(let n=0;t.length>n;n++)if(!Object.is(t[n],e[n]))return!1;return!0}function T(t){if(null===t||"object"!=typeof t)return!1;if(Array.isArray(t))return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function z(t,e,n,r,l){if(0>=e.size)return;const c=e.glyph;if(!c||!c.parts?.length)return;const u=i(c,e.size);if(0>=u.scale)return;const f=(e.style.opacity??1)*(e._decayOpacity??1);if(0>=f)return;const h=e=>{const n=o(t,e,e);return"string"==typeof n?n:e},d=e.color??("string"==typeof e.style.fill?e.style.fill:void 0);t.save(),t.translate(n,r),e.rotation&&t.rotate(e.rotation),t.translate(u.offsetX,u.offsetY),t.scale(u.scale,u.scale),t.globalAlpha=l*f*(e.style.fillOpacity??1);const p=s(c,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal");p&&e.ghostColor&&a(t,c,d,e.accent,e.ghostColor,h),p&&(t.beginPath(),t.rect(p.x,p.y,p.width,p.height),t.clip()),a(t,c,d,e.accent,void 0,h),t.restore()}var H=(t,e)=>{const n=t.globalAlpha;for(const r of e)"glyph"===r.type&&z(t,r,r.x,r.y,n);t.globalAlpha=n};function G(t,e){const n=t.globalAlpha;for(const r of e)"glyph"===r.type&&z(t,r,r.cx,r.cy,n);t.globalAlpha=n}var N=new Set;function U(t,e){const n="function"==typeof t?t(e.datum??null,e):t;return(r=n)&&"object"==typeof r&&"string"==typeof r.id&&"function"==typeof r.cacheKey&&"function"==typeof r.drawCanvas&&"function"==typeof r.renderStaticSVG?n:void 0;var r}function W(t,e){if("undefined"!=typeof process&&"production"===process.env?.NODE_ENV)return;const n=`${t}:${e}`;N.has(n)||(N.add(n),console.warn(`[Semiotic] Render backend "${t}" does not support scene node "${e}"; using the built-in renderer.`))}function $(t){const{context:e,nodes:n,renderMode:r,pixelRatio:o,paintBuiltIn:a}=t;if(!r||"sketchy"===r)return void a(n);let s=[];const l=()=>{s.length&&(a(s),s=[])};for(const t of n){const n=U(r,t);if(!n){s.push(t);continue}let i;l(),e.save();try{i=n.drawCanvas({context:e,node:t,style:t.style??{},pixelRatio:o})}finally{e.restore()}i||(W(n.id,t.type??"unknown"),a([t]))}l()}function B(t){const{node:e,index:n,renderMode:r,fallback:o}=t,a=U(r,e);if(!a)return o();const s=a.renderStaticSVG({node:e,style:e.style??{},key:`${a.id}-${n}`});return null!=s?s:(W(a.id,e.type??"unknown"),o())}function F(t){const e=new Map;for(const n of t){const t=n.group??"_default";let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}for(const t of e.values()){t.sort((t,e)=>t.x-e.x||t.y-e.y);for(let e=0;t.length>e;e++)t[e]._groupIndex=e}const n=Array.from(e.keys()).sort((t,n)=>{const r=e.get(t),o=e.get(n);return(r.length>0?r[0].y:0)-(o.length>0?o[0].y:0)}),r=Array.from(e.values()).flat();r.sort((t,e)=>t.x-e.x||t.y-e.y);const o=new Map;for(let t=0;r.length>t;t++){r[t]._flatIndex=t;const e=r[t].datum?.id;null!=e&&o.set(e+"",t)}return{flat:r,groups:n,byGroup:e,idToIdx:o}}function V(t,e){if(0===t.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};const n=Math.max(0,Math.min(e,t.flat.length-1)),r=t.flat[n];return{flatIndex:n,group:r.group??"_default",indexInGroup:r._groupIndex??0}}function Y(t,e,n){const{group:r,indexInGroup:o}=e,a=n.byGroup.get(r);switch(t){case"ArrowRight":return a.length-1>o?a[o+1]._flatIndex:e.flatIndex;case"ArrowLeft":return o>0?a[o-1]._flatIndex:e.flatIndex;case"ArrowDown":{const t=n.groups.indexOf(r);return n.groups.length-1>t?K(n,n.groups[t+1],a[o]):e.flatIndex}case"ArrowUp":{const t=n.groups.indexOf(r);return t>0?K(n,n.groups[t-1],a[o]):e.flatIndex}case"PageDown":return Math.min(e.flatIndex+Math.max(1,Math.floor(.1*n.flat.length)),n.flat.length-1);case"PageUp":return Math.max(e.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}}function K(t,e,n){const r=t.byGroup.get(e);let o=0,a=Math.abs(r[0].x-n.x);for(let t=1;r.length>t;t++){const e=Math.abs(r[t].x-n.x);a>e&&(a=e,o=t)}return r[o]._flatIndex}function Q(t){const e=[];for(const n of t)switch(n.type){case"point":e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});break;case"symbol":if(0>=n.size)break;e.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 t=l(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:"_default"});break}case"line":{const t=n,r=Array.isArray(t.datum)?t.datum:[],o=t.group??"_default";for(let n=0;t.path.length>n&&r.length>n;n++)e.push({x:t.path[n][0],y:t.path[n][1],datum:r[n],shape:"circle",group:o});break}case"area":{const t=n,r=Array.isArray(t.datum)?t.datum:[],o=t.group??"_default";for(let n=0;t.topPath.length>n&&r.length>n;n++)e.push({x:t.topPath[n][0],y:t.topPath[n][1],datum:r[n],shape:"circle",group:o});break}case"rect":e.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":e.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 e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function X(t){const e=[];for(const n of t)if("rect"===n.type&&null!=n.x){if(null==n.datum)continue;e.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??n.datum?.category??""})}else if("point"===n.type)e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});else if("symbol"===n.type){if(0>=n.size)continue;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"})}else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const t=l(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:"_default"})}else if("wedge"===n.type&&null!=n.cx){if(null===n.datum)continue;const t=((n.startAngle||0)+(n.endAngle||0))/2,r=((n.innerRadius||0)+(n.outerRadius||50))/2;e.push({x:n.cx+Math.cos(t)*r,y:n.cy+Math.sin(t)*r,datum:n.datum,shape:"wedge",group:"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function q(t){const e=[];for(const n of t)if("circle"===n.type&&null!=n.cx){if(0>=n.r)continue;e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum?.id??"_default"})}else if("rect"===n.type&&null!=n.x){if(0>=n.w||0>=n.h)continue;e.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.datum?.id??"_default"})}else if("arc"===n.type&&null!=n.cx)e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum?.id??"_default"});else if("symbol"===n.type&&null!=n.cx){if(0>=n.size)continue;e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum?.id??"_default"})}else if("glyph"===n.type&&null!=n.cx){if(0>=n.size||null==n.datum)continue;const t=l(n.glyph,n.size);e.push({x:n.cx+t.centerDx,y:n.cy+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:n.datum?.id??"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function J(t,e,n,r,o){const a=n.flat[e.flatIndex];if(!a)return Y(t,e,n);const s=a.datum?.id;switch(t){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":{const r=function(t,e,n){let r=null,o=1/0;for(let a=0;t.flat.length>a;a++){const s=t.flat[a];if(s===e)continue;const l=s.x-e.x,i=s.y-e.y;let c=!1;switch(n){case"right":c=l>0&&Math.abs(l)>=Math.abs(i);break;case"left":c=0>l&&Math.abs(l)>=Math.abs(i);break;case"down":c=i>0&&Math.abs(i)>=Math.abs(l);break;case"up":c=0>i&&Math.abs(i)>=Math.abs(l)}if(!c)continue;const u=l*l+i*i;o>u&&(o=u,r=a)}return r}(n,a,"ArrowRight"===t?"right":"ArrowLeft"===t?"left":"ArrowDown"===t?"down":"up")??e.flatIndex;return r!==e.flatIndex&&(o.current=-1),r}case"Enter":{if(null==s)return e.flatIndex;const t=function(t,e){const n=t+"",r=[];for(const t of e){const e=t.datum??t,o=Z(e.source),a=Z(e.target),s=null!=o,l=null!=a;s&&o+""===n&&l?r.push(a+""):l&&a+""===n&&s&&r.push(o+"")}return r}(s,r);if(0===t.length)return e.flatIndex;const a=n.idToIdx.get(t[(o.current+1)%t.length])??-1;return 0>a?e.flatIndex:(o.current=-1,a)}default:{const r=Y(t,e,n);return null!==r&&r!==e.flatIndex&&(o.current=-1),r}}}function Z(t){return"object"==typeof t&&null!==t&&"id"in t?t.id:t}function tt(t){const e=[];for(const n of t)if("point"===n.type&&null!=n.x)e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle"});else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const t=l(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight})}else"geoarea"===n.type&&n.centroid&&!1!==n.interactive&&e.push({x:n.centroid[0],y:n.centroid[1],datum:n.datum,shape:"geoarea",pathData:n.pathData});return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function et(t,e,n){switch(t){case"ArrowRight":case"ArrowDown":return n-1>e?e+1:e;case"ArrowLeft":case"ArrowUp":return e>0?e-1:e;case"PageDown":return Math.min(e+Math.max(1,Math.floor(.1*n)),n-1);case"PageUp":return Math.max(e-Math.max(1,Math.floor(.1*n)),0);case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function nt(t){return{data:t.datum||{},x:t.x,y:t.y,__semioticHoverData:!0}}function rt(t){const{title:e,description:n,summary:r,accessibleTable:o,className:a,animate:s,axisExtent:l,autoPlaceAnnotations:i}=t,c={};return e&&(c.title=e),n&&(c.description=n),r&&(c.summary=r),void 0!==o&&(c.accessibleTable=o),a&&(c.className=a),null!=s&&(c.animate=s),void 0!==l&&(c.axisExtent=l),void 0!==i&&(c.autoPlaceAnnotations=i),c}function ot(t){const{linkedHover:e,selection:n,onObservation:r,onClick:o,hoverRadius:a,hoverHighlight:s,forceHoverBehavior:l,forceClickBehavior:i,mobileInteraction:c,customHoverBehavior:u,customClickBehavior:f,linkedHoverInClickPredicate:h=!0}=t,d={};r&&(d.annotationObservationCallback=r);const p=c?.enabled?Math.max(a??30,Math.ceil((c.targetSize||44)/2),24):a;return(l||e||r||o||s)&&(d.customHoverBehavior=u),f&&(i||(h?r||o||e:r||o)||c?.enabled&&(c.tapToSelect||c.tapToLockTooltip)&&(e||s||n))&&(d.customClickBehavior=f),null!=p&&(d.hoverRadius=p),d}function at(t){const{tooltip:e,defaultTooltipContent:n}=t;return{tooltipContent:!1===e?()=>null:r(e)||n}}function st(e,n,r){if(1>=r)return 1;const o=r-1;return t({age:o-n,extent:o,type:e.type,halfLife:e.halfLife??r/2,threshold:e.stepThreshold??.5*r,minOpacity:e.minOpacity??.1})}function lt(t){const e=new Map;for(let n=0;t.length>n;n++)e.set(t[n],n);return e}function it(t,e,n,r=lt(n)){const o=n.length;if(o>1)for(const n of e){if("line"===n.type){const e=Array.isArray(n.datum)?n.datum:[];if(2>e.length)continue;const a=Array(e.length);let s=!1;for(let n=0;e.length>n;n++){const l=r.get(e[n]);null!=l?(a[n]=st(t,l,o),1>a[n]&&(s=!0)):a[n]=1}s&&(n._decayOpacities=a);continue}if("area"===n.type){const e=Array.isArray(n.datum)?n.datum:[],a=n.topPath?n.topPath.length:e.length;if(2>a)continue;if(e.length===a){const s=Array(a);let l=!1;for(let n=0;e.length>n;n++){const a=r.get(e[n]);null!=a?(s[n]=st(t,a,o),1>s[n]&&(l=!0)):s[n]=1}l&&(n._decayOpacities=s)}else{let s=1;for(const n of e){const e=r.get(n);if(null!=e){const n=st(t,e,o);s>n&&(s=n)}}if(1>s){const t=Array(a);t.fill(s),n._decayOpacities=t}}continue}const e=r.get(n.datum);if(null==e)continue;const a=st(t,e,o);"heatcell"===n.type?n.style={opacity:a}:"candlestick"===n.type?n._decayOpacity=a:n.style={...n.style,opacity:(n.style?.opacity??1)*a}}}function ct(t){if("production"===process.env.NODE_ENV)return;const{label:e,nodes:n,overlays:r,warned:o}=t;ut(r)&&0===n.length&&ft(o,"overlay-only",`[semiotic] ${e} 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(t=>null==t.datum)&&ft(o,"null-datums",`[semiotic] ${e} 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.`)}function ut(t){return null!=t&&!1!==t&&""!==t&&(!Array.isArray(t)||t.some(ut))}function ft(t,e,n){t.has(e)||(t.add(e),console.warn(n))}function ht(t,e,n,r){const o=function(t){if(t instanceof Error)return{name:t.name||"Error",message:t.message||"Custom layout threw."};if("string"==typeof t)return{name:"Error",message:t};if(null==t)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:t+""}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}(e),a="network"===t?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:t,source:a,message:`Semiotic ${t} ${a} failed: ${o.message}`,error:o,recovery:n?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:n,affectedRevision:r}}var dt=new WeakMap;function pt(){return this.updateResults.last}function yt(){return this.updateResults.last}function gt(t){return this.updateResults.subscribe(t)}function mt(t){this.config.layoutSelection=t}function xt(){dt.set(this,!0)}function bt(){const t=!0===dt.get(this);return dt.delete(this),t}function vt(t){Object.assign(t.prototype,{getLastUpdateResult:pt,getUpdateSnapshot:yt,subscribeUpdateResult:gt,setLayoutSelection:mt,markStylePaintPending:xt,consumeStylePaintPending:bt})}function wt(t,e,n){return n.x>t||t>n.x+n.w||n.y>e||e>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 At(t,e=30){return Math.max((t??4)+5,12,e)}function kt(t){return t instanceof Date?t:"number"==typeof t&&t>1e9?new Date(t):null}function _t(t,e){const n=kt(t);if(!n)return!1;const r=kt(e);return!r||n.getFullYear()!==r.getFullYear()||n.getMonth()!==r.getMonth()}function Mt(t){let e=t%(2*Math.PI);return 0>e&&(e+=2*Math.PI),e}function It(t,e,n,r,o,a=t=>t.x,s=t=>t.y,l=t=>t.r){const i=Math.max(r,o+5,12),c=e-i,u=e+i,f=n-i,h=n+i;let d=null,p=1/0;return t.visit((t,o,i,y,g)=>{if(o>u||c>y||i>h||f>g)return!0;if(!t.length){let o=t;do{const t=o.data,i=a(t)-e,c=s(t)-n,u=Math.sqrt(i*i+c*c);At(l(t),r)>=u&&p>u&&(d=t,p=u),o=o.next}while(o)}return!1}),d?{node:d,distance:p}:null}function Ot(t){return!(!t._pulseIntensity||0>=t._pulseIntensity)}function St(t,e,n=.3){Ot(e)&&(t.globalAlpha=e._pulseIntensity*n,t.fillStyle=e._pulseColor||"rgba(255,255,255,0.6)",t.fillRect(e.x,e.y,e.w,e.h))}function Dt(t,e,n=.6){if(!Ot(e))return;const r=e.r+(e._pulseGlowRadius??4)*e._pulseIntensity,o=e.cx??e.x??0,a=e.cy??e.y??0;t.beginPath(),t.arc(o,a,r,0,2*Math.PI),t.strokeStyle=e._pulseColor||"rgba(255,255,255,0.6)",t.lineWidth=2*e._pulseIntensity,t.globalAlpha=e._pulseIntensity*n,t.stroke()}function Et(t,e,n,r=.35){Ot(e)&&(t.globalAlpha=e._pulseIntensity*r,t.fillStyle=e._pulseColor||"rgba(255,255,255,0.6)",n?t.fill(n):t.fill())}export{st as computeDecayOpacity,lt as buildDatumIndexMap,it as applyDecay,ct as warnCustomLayoutDiagnostics,ht as createCustomLayoutFailureDiagnostic,vt as attachUpdateResultStore,b as composeOverlays,A as useConfigSync,k as useLayoutSelectionSync,wt as hitTestRect,At as getHitRadius,_t as isTimeLandmark,Mt as normalizeAngle,It as findHitPointInQuadtree,I as resolveStaleness,D as useStalenessCheck,R as StalenessBadge,j as useStableShallow,St as renderRectPulse,Dt as renderCirclePulse,Et as renderPathPulse,H as glyphCanvasRenderer,G as networkGlyphRenderer,$ as paintSceneWithBackend,B as renderSceneWithBackend,f as accessorName,h as formatVal,y as bandTooltipFields,g as buildDefaultTooltip,m as buildOrdinalTooltip,F as buildNavGraph,V as resolvePosition,Y as nextGraphIndex,Q as extractXYNavPoints,X as extractOrdinalNavPoints,q as extractNetworkNavPoints,J as nextNetworkIndex,tt as extractGeoNavPoints,et as nextIndex,nt as navPointToHover,rt as buildBaseMetadataProps,ot as buildCustomBehaviorProps,at as buildTooltipProps};
@@ -1 +0,0 @@
1
- import{createContext as e,useCallback as o,useContext as r,useMemo as a,useRef as t,useSyncExternalStore as i}from"react";import{jsx as c}from"react/jsx-runtime";function n(n){let l=null;const f=()=>(l||(l=e(null)),l),d=s(n);return[function({children:e,initialState:o}){const r=t(o),i=a(()=>s(n,r.current),[]),l=f();return c(l.Provider,{value:i,children:e})},(e,a)=>{const c=f(),n=r(c)??d,s=t(e);s.current=e;const l=t({hasValue:!1,value:void 0}),u=o(()=>{const e=s.current(n.getState()),o=l.current;return o.hasValue&&a&&a(o.value,e)?o.value:(l.current={hasValue:!0,value:e},e)},[n,a]),p=o(()=>s.current(n.getState()),[n]);return i(n.subscribe,u,p)}]}function s(e,o){const r=new Set;let a={...e(function(e){const o=e(a);if(l(o)){a={...a,...o};for(const e of r)e()}}),...o??{}};return{getState:()=>a,subscribe:function(e){return r.add(e),()=>{r.delete(e)}}}}function l(e){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o))return!0;return!1}function f(e){if(!e?.colors)return;const o=e.colors;return{primary:o.primary,secondary:o.secondary||o.primary,surface:o.surface||o.background,success:o.success,danger:o.danger,warning:o.warning,error:o.error,info:o.info,text:o.text,textSecondary:o.textSecondary,border:o.border,grid:o.grid}}function d(e){if(!e.accessibility)return e;let o=e;if(e.accessibility.colorBlindSafe&&(o={...o,colors:{...o.colors,categorical:u}}),e.accessibility.highContrast){const e="dark"===o.mode;o={...o,colors:{...o.colors,text:e?"#ffffff":"#000000",textSecondary:e?"#cccccc":"#333333",grid:e?"#666666":"#999999",border:e?"#888888":"#000000"}}}return o}var u=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],p={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}},g={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}},y={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:u,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 b(e,o){if("light"===o)return p;if("dark"===o)return g;if("high-contrast"===o)return y;if("string"==typeof o)return void 0!==console&&console.warn(`[ThemeStore] Unknown theme preset "${o}". Keeping current theme.`),e;if(o.mode&&"auto"!==o.mode){const e="dark"===o.mode?g:p;return d({...e,...o,colors:{...e.colors,...o.colors||{}},typography:{...e.typography,...o.typography||{}}})}return d({...e,...o,colors:{...e.colors,...o.colors||{}},typography:{...e.typography,...o.typography||{}}})}var[m,h]=n(e=>({theme:p,setTheme(o){e(e=>({theme:b(e.theme,o)}))}}));function x(e,o=":root"){const r=[];return r.push(` --semiotic-bg: ${e.colors.background};`),r.push(` --semiotic-text: ${e.colors.text};`),r.push(` --semiotic-text-secondary: ${e.colors.textSecondary};`),r.push(` --semiotic-grid: ${e.colors.grid};`),r.push(` --semiotic-border: ${e.colors.border};`),r.push(` --semiotic-primary: ${e.colors.primary};`),r.push(` --semiotic-font-family: ${e.typography.fontFamily};`),e.colors.focus&&r.push(` --semiotic-focus: ${e.colors.focus};`),e.colors.selection&&r.push(` --semiotic-selection-color: ${e.colors.selection};`),null!=e.colors.selectionOpacity&&r.push(` --semiotic-selection-opacity: ${e.colors.selectionOpacity};`),e.colors.diverging&&r.push(` --semiotic-diverging: ${e.colors.diverging};`),e.tooltip?.background&&r.push(` --semiotic-tooltip-bg: ${e.tooltip.background};`),e.tooltip?.text&&r.push(` --semiotic-tooltip-text: ${e.tooltip.text};`),e.tooltip?.borderRadius&&r.push(` --semiotic-tooltip-radius: ${e.tooltip.borderRadius};`),e.tooltip?.fontSize&&r.push(` --semiotic-tooltip-font-size: ${e.tooltip.fontSize};`),e.tooltip?.shadow&&r.push(` --semiotic-tooltip-shadow: ${e.tooltip.shadow};`),e.borderRadius&&r.push(` --semiotic-border-radius: ${e.borderRadius};`),e.colors.annotation&&r.push(` --semiotic-annotation-color: ${e.colors.annotation};`),null!=e.typography.legendSize&&r.push(` --semiotic-legend-font-size: ${e.typography.legendSize}px;`),null!=e.typography.titleFontSize&&r.push(` --semiotic-title-font-size: ${e.typography.titleFontSize}px;`),null!=e.typography.tickFontFamily&&r.push(` --semiotic-tick-font-family: ${e.typography.tickFontFamily};`),null!=e.typography.tickSize&&r.push(` --semiotic-tick-font-size: ${e.typography.tickSize}px;`),null!=e.typography.labelSize&&r.push(` --semiotic-axis-label-font-size: ${e.typography.labelSize}px;`),r.push(` --semiotic-secondary: ${e.colors.secondary||e.colors.primary};`),r.push(` --semiotic-surface: ${e.colors.surface||e.colors.background};`),e.colors.success&&r.push(` --semiotic-success: ${e.colors.success};`),e.colors.danger&&r.push(` --semiotic-danger: ${e.colors.danger};`),e.colors.warning&&r.push(` --semiotic-warning: ${e.colors.warning};`),e.colors.error&&r.push(` --semiotic-error: ${e.colors.error};`),e.colors.info&&r.push(` --semiotic-info: ${e.colors.info};`),`${o} {\n${r.join("\n")}\n}`}function $(e){return{semiotic:{bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:e.tooltip?.background||e.colors.background,$type:"color"},text:{$value:e.tooltip?.text||e.colors.text,$type:"color"},radius:{$value:e.tooltip?.borderRadius||"6px",$type:"dimension"},"font-size":{$value:e.tooltip?.fontSize||"14px",$type:"dimension"},shadow:{$value:e.tooltip?.shadow||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:e.colors.selectionOpacity??.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:e.typography.legendSize+"px",$type:"dimension"}}:{},...null!=e.typography.titleFontSize?{"title-font-size":{$value:e.typography.titleFontSize+"px",$type:"dimension"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:e.typography.tickSize+"px",$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:e.typography.labelSize+"px",$type:"dimension"}}:{},secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}var S=/^\{([^}]+)\}$/,k={bg:"background",text:"text","text-secondary":"textSecondary",grid:"grid",border:"border",primary:"primary",focus:"focus",secondary:"secondary",surface:"surface",annotation:"annotation",success:"success",danger:"danger",warning:"warning",error:"error",info:"info"},v=[["textSecondary",/^(text-?secondary|secondary-?text|muted|subtle|text-?muted|fg-?muted)$/],["text",/^(text|foreground|fg|ink|on-?background|on-?surface|text-?default|fg-?default)$/],["background",/^(background|bg|canvas|base|page|backdrop|bg-?default)$/],["surface",/^(surface|card|elevated|panel|sheet)$/],["border",/^(border|divider|outline|stroke|hairline)$/],["grid",/^(grid|gridline|gridlines)$/],["primary",/^(primary|brand|accent|brand-?primary)$/],["secondary",/^(secondary|brand-?secondary)$/],["focus",/^(focus|ring|focus-?ring)$/],["error",/^(error|critical)$/],["danger",/^(danger|negative|destructive|fail|alert)$/],["success",/^(success|positive|ok|good|pass)$/],["warning",/^(warning|warn|caution)$/],["info",/^(info|information|note)$/],["annotation",/^(annotation|callout)$/]],z=/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*[\d.]+)?\s*\)$/i;function w(e){return"string"==typeof e.value&&("color"===e.type||function(e){const o=e.trim();return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(o)||z.test(o)||/^hsla?\(/i.test(o)}(e.value))}function F(e,o={}){const r=function(e){const o=new Map(e.map(e=>[e.path,e])),r=(e,a)=>{if(a>8||"string"!=typeof e)return e;const t=e.match(S);if(!t)return e;const i=o.get(t[1]);return i?r(i.value,a+1):e};return e.map(e=>({...e,value:r(e.value,0)}))}(function(e){const o=[],r=(e,a,t)=>{if(!e||"object"!=typeof e)return;const i=e,c=i.$type??t;if(function(e){return!!e&&"object"==typeof e&&"$value"in e}(i))o.push({path:a.join("."),leaf:a[a.length-1]??"",value:i.$value,type:i.$type??t});else for(const[e,o]of Object.entries(i))e.startsWith("$")||r(o,[...a,e],c)};return r(e,[]),o}(e)),a=new Map(r.map(e=>[e.path,e])),t=new Set,i={};for(const[e,r]of Object.entries(o.mapping??{})){if("fontFamily"===e||"categorical"===e)continue;const o=r?a.get(r):void 0;o&&"string"==typeof o.value&&(i[e]=o.value,t.add(o.path))}for(const e of r){const o=e.path.match(/^semiotic\.([^.]+)$/),r=o?k[o[1]]:void 0;r&&!(r in i)&&"string"==typeof e.value&&(i[r]=e.value,t.add(e.path))}for(const[e,o]of v){if(e in i)continue;const a=r.find(e=>!t.has(e.path)&&w(e)&&o.test(e.leaf.toLowerCase()));a&&"string"==typeof a.value&&(i[e]=a.value,t.add(a.path))}let c;const n=o.mapping?.categorical,s=(n?a.get(n):void 0)??a.get("semiotic.categorical")??r.find(e=>Array.isArray(e.value)&&/categor|chart|palette|qualitative|series/i.test(e.path));if(s&&Array.isArray(s.value))c=s.value.filter(e=>"string"==typeof e);else{const e=r.filter(e=>w(e)&&/(^|\.)(categorical|chart|palette|qualitative|series)\b/i.test(e.path));2>e.length||(c=e.map(e=>e.value))}const l=(o.mapping?.fontFamily?a.get(o.mapping.fontFamily):void 0)??a.get("semiotic.font-family")??r.find(e=>("fontFamily"===e.type||/font-?family|typeface/i.test(e.leaf))&&("string"==typeof e.value||Array.isArray(e.value))),f=l?Array.isArray(l.value)?l.value.join(", "):"string"==typeof l.value?l.value:void 0:void 0,d=function(e){if("string"!=typeof e)return null;const o=e.trim();let r=o.replace(/^#/,"");if(3===r.length&&(r=r.split("").map(e=>e+e).join("")),/^[0-9a-f]{6}$/i.test(r))return parseInt(r.slice(0,2),16)/255*.2126+parseInt(r.slice(2,4),16)/255*.7152+parseInt(r.slice(4,6),16)/255*.0722;const a=o.match(z);if(a){const e=Number(a[1])/255,o=Number(a[2])/255,r=Number(a[3])/255;return[e,o,r].some(e=>Number.isNaN(e)||0>e||e>1)?null:.2126*e+.7152*o+.0722*r}return null}(i.background),u=o.base?.mode??(null!=d?.5>d?"dark":"light":p.mode),y=o.base??("dark"===u?g:p);return{...y,mode:u,colors:{...y.colors,...i,...c&&c.length>0?{categorical:c}:{}},typography:{...y.typography,...f?{fontFamily:f}:{}}}}var R={mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},q={mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},N={mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},A={mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},j={mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},B={mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},O={mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},C={mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},I={mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},M={mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},H={mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},P={mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},E=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],G={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},T={mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},L={mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"},U={light:p,dark:g,"high-contrast":y,pastels:R,"pastels-dark":q,"bi-tool":N,"bi-tool-dark":A,italian:j,"italian-dark":B,tufte:O,"tufte-dark":C,journalist:I,"journalist-dark":M,playful:H,"playful-dark":P,carbon:T,"carbon-dark":L};function V(e){return U[e]}export{n as createStore,l as hasOwnEnumerableKey,f as resolveThemeSemanticColors,d as applyThemeAccessibility,u as COLOR_BLIND_SAFE_CATEGORICAL,p as LIGHT_THEME,g as DARK_THEME,y as HIGH_CONTRAST_THEME,b as resolveThemeUpdate,m as ThemeProvider,h as useThemeSelector,x as themeToCSS,$ as themeToTokens,F as designTokensToTheme,R as PASTELS_LIGHT,q as PASTELS_DARK,N as BI_TOOL_LIGHT,A as BI_TOOL_DARK,j as ITALIAN_LIGHT,B as ITALIAN_DARK,O as TUFTE_LIGHT,C as TUFTE_DARK,I as JOURNALIST_LIGHT,M as JOURNALIST_DARK,H as PLAYFUL_LIGHT,P as PLAYFUL_DARK,E as CARBON_CATEGORICAL_14,G as CARBON_ALERT,T as CARBON_LIGHT,L as CARBON_DARK,U as THEME_PRESETS,V as resolveThemePreset};
@@ -1 +0,0 @@
1
- import{getMinMax as t}from"./chunk-chunk-JJ2OOIET.module.min.js";function e(t){if(null==t)return()=>{};const e="function"==typeof t?t:e=>e[t];return t=>i(e(t))}function n(t,n){const r=e(t),i=e(n);return(t,e)=>{const n=i(t);return{value:n,x:r(t),y:n,category:e}}}function r(t,n){const r=e(n??"value"),i=null==t?void 0:"function"==typeof t?t:e=>e[t];return t=>{const e=i?i(t):void 0;return{value:r(t),category:null==e?void 0:e+""}}}function i(t){if("number"==typeof t)return Number.isFinite(t)?t:void 0;if("string"==typeof t&&""!==t.trim()){const e=Number(t);return Number.isFinite(e)?e:void 0}}function o(t,e,n){const r=null!=t.axis?n[t.axis]:null!=t.field?e[t.field]:n.value;if(void 0!==t.eq&&r!==t.eq)return!1;if(void 0!==t.ne&&r===t.ne)return!1;if(void 0!==t.in&&!t.in.includes(r))return!1;if(void 0===t.gt&&void 0===t.gte&&void 0===t.lt&&void 0===t.lte&&void 0===t.within&&void 0===t.outside)return!0;const o=i(r);if(void 0===o)return!1;if(void 0!==t.gt&&t.gt>=o)return!1;if(void 0!==t.gte&&t.gte>o)return!1;if(void 0!==t.lt&&o>=t.lt)return!1;if(void 0!==t.lte&&o>t.lte)return!1;if(void 0!==t.within){const[e,n]=t.within;if(e>o||o>n)return!1}if(void 0!==t.outside){const[e,n]=t.outside;if(o>=e&&n>=o)return!1}return!0}function s(t,e,n){const r=t.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(e,n):o(r,e,n))}function a(t,e,n){if(!e||0===e.length)return{};let r={};for(const i of e){if(!s(i,t,n))continue;const e="function"==typeof i.style?i.style(t,n):i.style;e&&(r={...r,...e})}return r}function u(t,e,n,r=t=>t){const i=t??(()=>({}));return e&&0!==e.length?(t,o)=>{const s=r(t),u={...i(t,o)};return Object.assign(u,a(s,e,n(s,o))),u}:i}function c(t,e,n){return t&&0!==t.length?(r,i)=>{const o=a(r,t,e(r,i)),s=n?n(r,i):void 0;return s?{...o,...s}:o}:n}function d(t,e,n,i){if(!t||0===t.length)return i;const o=r(e,n);return(e,n)=>{const r=e&&e.data||e,s=a(r,t,o(r)),u=i?i(e,n):void 0;return u?{...s,...u}:s}}function f(t,e,r,i){return c(t,n(e,r),i)}function l(t,e=.5){const n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!n)return t;const r=Math.round(parseInt(n[1],16)*(1-e)),i=Math.round(parseInt(n[2],16)*(1-e)),o=Math.round(parseInt(n[3],16)*(1-e));return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function h(t,e=.5){const n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!n)return t;const r=Math.round(parseInt(n[1],16)+(255-parseInt(n[1],16))*e),i=Math.round(parseInt(n[2],16)+(255-parseInt(n[2],16))*e),o=Math.round(parseInt(n[3],16)+(255-parseInt(n[3],16))*e);return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function m(t=240){const e=360-t,n=180+e/2,r=n*Math.PI/180;return{sweepRad:t*Math.PI/180,gapDeg:e,startAngleDeg:n,startAngleRad:r,offsetRad:-Math.PI/2+r}}function g(t,e,n,r,i){const o=n-e||1;return i+(Math.max(e,Math.min(n,t))-e)/o*r}function p(e=240){const{sweepRad:n,offsetRad:r}=m(e),i=[[Math.cos(r),Math.sin(r)],[Math.cos(r+n),Math.sin(r+n)],[0,0]];for(let t=0;2*Math.PI>t;t+=Math.PI/2)((t-r)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>n+.001||i.push([Math.cos(t),Math.sin(t)]);const o=i.map(t=>t[0]),s=i.map(t=>t[1]),[a,u]=t(o),[c,d]=t(s);return{minX:a,maxX:u,minY:c,maxY:d,width:u-a,height:d-c,cx:(a+u)/2,cy:(c+d)/2}}function y(t){const e=[],n=t.domain;null==n?e.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} as numbers or Date-compatible values."}):Array.isArray(n)&&2===n.length&&Number.isFinite(Number(n[0]))&&Number.isFinite(Number(n[1]))||e.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times.",fix:"Use domain={[t0, t1]} with t0 <= t1."});const r=t.edges;if(Array.isArray(r)&&r.length>0){const t=r[0];null!=t.startTime&&null!=t.endTime||e.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}const i=t.nodes,o=Array.isArray(i)?i.length:0;return!0!==t.showLabels||24>o||e.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${o} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),80>(Array.isArray(r)?r.length:0)||null!=t.layoutExecution||"off"===t.packing||e.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),e}export{e as makeRuleValueResolver,n as makeXYRuleContext,r as makeNodeRuleContext,o as matchesThreshold,s as ruleMatches,a as resolveStyleRules,u as composeStyleRules,c as makeStyleRuleStyleFn,d as styleRulesToNodeStyle,f as styleRulesToXYStyle,l as darkenColor,h as lightenColor,m as sweepToAngles,g as valueToAngle,p as computeArcBoundingBox,y as diagnoseProcessSankeyProps};
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{confidenceZScore as e,fitLinearForForecast as t,forecastIntervalStats as n,getMinMax as r,linearRegression as o,polynomialRegression as i}from"./chunk-chunk-2NVFEB7P.module.min.js";import{createStore as a,hasOwnEnumerableKey as l,useTheme as s,useThemeSelector as c}from"./chunk-chunk-PMR47KRY.module.min.js";import{glyphFractionClipRect as u,glyphPlacement as d,resolveGlyphPaint as h}from"./chunk-chunk-KTWEBFMX.module.min.js";import{useHydrationLifecycle as f}from"./chunk-chunk-ACLDBMRH.module.min.js";import{useReducedMotion as y}from"./chunk-chunk-YHNZCPOZ.module.min.js";var p={fresh:1,aging:1.5,stale:3};function m(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"}function g(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle}}var b=null;function x(e={},t){const{background:n="transparent",stroke:r="#000",lineWidth:o=1.5,spacing:i=6,angle:a=45}=e,l={background:n,stroke:r,lineWidth:o,spacing:i,angle:a},s=Math.max(8,Math.ceil(2*i));let c;try{c=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(b||(b=document.createElement("canvas")),b.width=e,b.height=e,b)}(s)}catch{return g(l)}const u=c.getContext("2d");if(!u)return g(l);n&&"transparent"!==n?(u.fillStyle=n,u.fillRect(0,0,s,s)):u.clearRect(0,0,s,s),u.strokeStyle=r,u.lineWidth=o,u.lineCap="square";const d=a*Math.PI/180;if(45===a||-45===a){const e=a>0?1:-1;for(let t=-s;2*s>=t;t+=i)u.beginPath(),u.moveTo(t,0),u.lineTo(t+e*s,s),u.stroke()}else{u.save(),u.translate(s/2,s/2),u.rotate(d);const e=2*s;for(let t=-e;e>=t;t+=i)u.beginPath(),u.moveTo(-e,t),u.lineTo(e,t),u.stroke();u.restore()}return(t||u).createPattern(c,"repeat")}var v=new WeakMap,k=0,w=!1,$=null,M=null;function A(e,t){if(!t)return t;const n=function(e){const t=e.trim();if(!t.startsWith("var(")||!t.endsWith(")"))return null;const n=t.slice(4,-1),r=n.indexOf(",");if(-1===r){const e=n.trim();return e.startsWith("--")?{name:e}:null}const o=n.slice(0,r).trim(),i=n.slice(r+1).trim();return o.startsWith("--")?{name:o,fallback:i||void 0}:null}(t);if(!n)return t;const r=()=>n.fallback?A(e,n.fallback):t,o=e.canvas;if(!o)return r();!function(){if(w)return;if("undefined"==typeof window||"undefined"==typeof document)return;w=!0;const e=()=>{k++};if("undefined"!=typeof MutationObserver&&document.documentElement&&new MutationObserver(e).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme"],subtree:!0}),"function"==typeof window.matchMedia)try{$=window.matchMedia("(prefers-color-scheme: dark)"),M=e,"function"==typeof $.addEventListener?$.addEventListener("change",M):"function"==typeof $.addListener&&$.addListener(M)}catch{}}();let i=v.get(o);i&&i.version===k||(i={version:k,map:new Map},v.set(o,i));const a=i.map.get(t);if(void 0!==a)return a;const l=getComputedStyle(o).getPropertyValue(n.name).trim()||r()||t;return i.map.set(t,l),l}function S(){return k}import{jsx as W,jsxs as C}from"react/jsx-runtime";function j(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function O(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function I(e,t){let n=2166136261;const r=O(t);for(let e=0;r.length>e;e++)n^=r.charCodeAt(e),n=Math.imul(n,16777619);return`${e}-hatch-${(n>>>0).toString(36)}`}var N=new Map;function L(e,t){const{background:n="transparent",stroke:r="#000",lineWidth:o=1.5,spacing:i=6,angle:a=45,lineOpacity:l=1}=e,s=Math.max(8,Math.ceil(2*i));return C("pattern",{id:t,width:s,height:s,patternUnits:"userSpaceOnUse",patternTransform:0!==a?`rotate(${a})`:void 0,children:[n&&"transparent"!==n&&W("rect",{width:s,height:s,fill:n}),W("line",{x1:0,y1:0,x2:0,y2:s,stroke:r,strokeWidth:o,strokeOpacity:l}),W("line",{x1:i,y1:0,x2:i,y2:s,stroke:r,strokeWidth:o,strokeOpacity:l})]},t)}function R(e,t,n="#4e79a7"){if(j(e)){const n=I(t,e);return{fill:`url(#${n})`,def:L(e,n)}}return e&&"string"==typeof e?{fill:e}:{fill:n}}import*as P from"react";var[z,F]=a(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 T(e){const t=F(e=>e.pushObservation),n=P.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return P.useMemo(()=>({...e,onObservation:n}),[n,e])}function D(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:n+""}function B(e,t={}){const n=D(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(r){const o=function(e){const t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}(r);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:o}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:o,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function E(e){return e instanceof Element&&null!=e.closest("[data-semiotic-annotation-widget]")}import{jsx as G,jsxs as H}from"react/jsx-runtime";var _="var(--semiotic-bg, #ffffff)";function V(e,t){return(e+"").length*t*.6}function q(e){const{x:t,y:n,text:r,fill:o,fontSize:i=12,fontWeight:a,fontFamily:l,textAnchor:s="start",dominantBaseline:c,background:u,className:d}=e,h=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=>G("text",{x:t,y:n,textAnchor:s,dominantBaseline:c,fill:o,fontSize:i,fontWeight:a,fontFamily:l,className:d,...e?{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}:{},children:r});if(!h)return f();if("halo"===h.type)return f({stroke:h.fill??_,strokeWidth:h.haloWidth??3});const y=h.padding??{x:6,y:3},p="number"==typeof y?y:y.x,m="number"==typeof y?y:y.y,g=V(r,i),b=i+2*m;let x,v;return x="middle"===s?t-g/2-p:"end"===s?t-g-p:t-p,v="middle"===c||"central"===c?n-b/2:"hanging"===c||"text-before-edge"===c?n-m:n-.8*i-m,H("g",{className:d,children:[G("rect",{x:x,y:v,width:g+2*p,height:b,rx:h.radius??3,ry:h.radius??3,fill:h.fill??_,fillOpacity:h.opacity??.85,stroke:h.stroke,strokeWidth:h.strokeWidth}),f()]})}var Y=["name","label","title"],U=["type","kind","category","group","class","status","role","shape"],Z=["value","amount","total","count","weight","score"],X=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 K(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}function J(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const n=t.maxEntries??6,r=!1!==t.skipPositional,o=[];for(const[t,n]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;if(r&&X.has(t.toLowerCase()))continue;if(null==n)continue;const e=typeof n;("string"===e||"number"===e||"boolean"===e||n instanceof Date)&&o.push({key:t,lower:t.toLowerCase(),value:n})}if(0===o.length)return{entries:[]};let i=o.findIndex(e=>Y.includes(e.lower));const a=i>=0;0>i&&(i=o.findIndex(e=>"id"===e.lower)),0>i&&(i=o.findIndex(e=>"string"==typeof e.value));const l=0>i?void 0:o[i];let s=o.filter((e,t)=>t!==i);a&&(s=s.filter(e=>"id"!==e.lower));const c=K(s,U),u=K(s,Z),d=new Set(U),h=new Set(Z),f=[];c&&f.push({key:c.key,value:c.value}),u&&f.push({key:u.key,value:u.value});for(const e of s){if(f.length>=n)break;e!==c&&e!==u&&(d.has(e.lower)||h.has(e.lower)||f.push({key:e.key,value:e.value}))}return{titleKey:l?.key,title:l?.value,entries:f}}function Q(e,t){return"touch"===t?Math.max(e,24):e}function ee(e){return Array.isArray(e)?e[0]:e}function te(e,t,n,r){return{data:ee(e),x:t,y:n,__semioticHoverData:!0,...r}}import{jsx as ne,jsxs as re}from"react/jsx-runtime";var oe={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 ie(e,t){return"function"==typeof t?t(e):e[t]}function ae(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 le(e={}){const{fields:t,title:n,format:r,style:o={},className:i=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let a;const l=[];if(n){const t=ie(e,n);a=ae(t,r)}if(t&&t.length>0)t.forEach(t=>{let n,o,i;"string"==typeof t?(n=t,o=t,i=r):(n=t.label,o=t.accessor||t.key||"",i=t.format||r);const a=ie(e,o);l.push({label:n,value:ae(a,i)})});else if(!n){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){a=ae(e[n],r);break}if(!a){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(a=ae(e[t[0]],r))}}const s={...oe,...o};return re("div",{className:("semiotic-tooltip "+i).trim(),style:s,children:[a&&ne("div",{style:{fontWeight:l.length>0?"bold":"normal"},children:a}),l.map((e,t)=>re("div",{style:{marginTop:0===t&&a?"4px":0},children:[e.label&&re("span",{children:[e.label,": "]}),e.value]},t))]})}}function se(e={}){const{fields:t=[],title:n,format:r,style:o={},className:i="",showLabels:a=!0,separator:l=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const s=[];if(n){const t=ie(e,n);s.push({value:ae(t,r)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let n,o,i;"string"==typeof t?(n=t,o=t,i=r):(n=t.label,o=t.accessor||t.key||"",i=t.format||r);const l=ae(ie(e,o),i);s.push({label:a?n:void 0,value:l})});else{const t=J(e,{skipPositional:!1});null!=t.title&&s.push({label:void 0,value:ae(t.title,r),bold:!0}),t.entries.forEach(e=>{s.push({label:a?e.key:void 0,value:ae(e.value,r)})})}const c={...oe,...o};return Array.isArray(s)&&0!==s.length?ne("div",{className:("semiotic-tooltip semiotic-tooltip-multiline "+i).trim(),style:c,children:s.map((e,t)=>re("div",{style:{marginBottom:s.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&re("strong",{children:[e.label,l]}),e.value]},t))}):null}}function ce(){return e=>{const t=e.allSeries;if(!t||0===t.length)return ne("div",{className:"semiotic-tooltip",style:oe,children:ne("div",{children:ae(e.data?.value??e.data?.y)})});const n=e.xValue??e.data?.time??e.data?.x;return re("div",{className:"semiotic-tooltip",style:oe,children:[null!=n&&ne("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:ae(n)}),t.map((e,t)=>re("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[ne("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),ne("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),ne("span",{style:{fontWeight:500,fontSize:"0.85em"},children:ae(e.value)})]},t))]})}}function ue(e){if(!0!==e){if("function"==typeof e){const t=e;return e=>{const n=!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);let r=ee(n?e.data??{}:e);if(!r)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof r?.x0&&"number"==typeof r?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof r?.sankeyWidth)&&r.data&&"object"==typeof r.data&&(r=r.data),!r)return null;if(n&&(void 0!==e.allSeries||void 0!==e.xValue)){const t={...r};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),r=t}const o=t(r);return null==o?null:ne("div",{className:"semiotic-tooltip",style:oe,children:o})}}return!1!==e&&void 0!==e&&("object"==typeof e&&null!==e&&("fields"in e||"title"in e)?le(e):"multi"===e?("undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip — prefer charts that set tooltipMode (LineChart, AreaChart, StackedAreaChart, DifferenceChart). Rendering MultiLineTooltip content as a fallback.'),se()):le())}}import{createContext as de,useContext as he,useMemo as fe}from"react";import{scaleOrdinal as ye}from"d3-scale";function pe(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function me(e,t,n){const r=e=>e.toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function ge(e){const t=e.map(pe),n=t.length-1;return e=>{if(0>=e){const[e,n,r]=t[0];return me(e,n,r)}if(e>=1){const[e,r,o]=t[n];return me(e,r,o)}const r=e*n,o=Math.floor(r),i=r-o,[a,l,s]=t[o],[c,u,d]=t[o+1];return me(Math.round(a+(c-a)*i),Math.round(l+(u-l)*i),Math.round(s+(d-s)*i))}}var be=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],xe=ge(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),ve=ge(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),ke=ge(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),we=ge(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),$e=ge(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),Me=ge(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),Ae=ge(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),Se=ge(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),We=ge(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),Ce=ge(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),je=ge(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),Oe=ge(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),Ie={blues:xe,reds:ve,greens:ke,viridis:Ae,oranges:we,purples:$e,greys:Me,plasma:Se,inferno:We,magma:Ce,cividis:je,turbo:Oe};function Ne(e){return e&&Ie[e]||xe}var Le=ge(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),Re=ge(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),Pe=ge(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),ze=ge(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),Fe=ge(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),Te=ge(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),De=ge(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]),Be={category10:be,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],...Ie},Ee=be,Ge="#007bff";function He(e,t,n=Ee){if(e&&"object"==typeof e&&!Array.isArray(e)){const t=Object.values(e).filter(e=>"string"==typeof e&&e.length>0);if(t.length>0)return t}if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e){const t=Be[e];if(Array.isArray(t)&&t.length>0)return t}return t&&t.length>0?t:n}var _e=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],Ve=["#f0f0f0","#b5d4ea","#f4c2a1","#b8dab2","#d4b5e0","#f9e0a2","#a8d8d8"],qe=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 Ye(e,t,n){if("function"==typeof t){const r=t(e);return n&&r&&"string"==typeof r&&!function(e){const t=e.toLowerCase();return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||qe.has(t)}(r)?n(r):r}const r=e?.[t]+"";return n?n(r):Ee[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)}(r))%Ee.length]}function Ue(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 Ze(e,t,n="category10"){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;return t=>Ue(e,t)??"#999"}const r=Array.from(new Set(e.map(e=>e?.[t]).filter(e=>null!=e).map(e=>e+""))),o=r.every(e=>!isNaN(Number(e)));if(Array.isArray(n))return ye().domain(r).range(n).unknown("#999");const i=Be[n]||Be.category10;if(o&&"function"==typeof i){let e=-1/0;for(const t of r){const n=Number(t);n>e&&(e=n)}return t=>i(Number(t)/e)}{const e=Array.isArray(i)?i:Ee;return ye().domain(r).range(e).unknown("#999")}}function Xe(e,t,n=[3,20],r){let o;if(o="function"==typeof t?t(e):e?.[t],!r)return o;const[i,a]=r,[l,s]=n;if(a===i)return(l+s)/2;let c=(o-i)/(a-i);return 0>c?c=0:c>1&&(c=1),l+c*(s-l)}import{jsx as Ke}from"react/jsx-runtime";var Je=de(null);function Qe({colors:e,categories:t,colorScheme:n="category10",children:r}){const o=fe(()=>{if(e)return e;if(t){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n,r={};let o=0;for(const n of t)r[n]=Ue(e,n)??Ee[o++%Ee.length];return r}const e=Array.isArray(n)?n:Be[n]||Ee,r={};for(let n=0;t.length>n;n++)r[t[n]]=e[n%e.length];return r}return{}},[e,t,n]);return Ke(Je.Provider,{value:o,children:r})}function et(){return he(Je)}Qe.displayName="CategoryColorProvider";import{useId as tt,useMemo as nt,useCallback as rt}from"react";function ot(e){const t=[];for(const[n,r]of Object.entries(e.fields))if("point"===r.type)t.push(e=>r.values.has(e[n]));else{const[e,o]=r.range;t.push(t=>{const r=t[n];return r>=e&&o>=r})}return e=>t.every(t=>t(e))}function it(e,t){const n=[];for(const[r,o]of e.clauses)"crossfilter"===e.resolution&&r===t||n.push(ot(o));return 0===n.length?()=>!0:"intersect"===e.resolution?e=>n.every(t=>t(e)):e=>n.some(t=>t(e))}function at(e,t){let n=e.get(t);return n||(n={name:t,resolution:"union",clauses:new Map},e.set(t,n)),n}function lt(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[st,ct]=a(e=>({selections:new Map,setClause(t,n){e(e=>{const r=e.selections.get(t),o=r?.clauses.get(n.clientId);if(o&&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,r]of n){const n=t.fields[e];if(!n||!lt(r,n))return!1}return!0}(o,n))return{};const i=new Map(e.selections),a=at(i,t),l=new Map(a.clauses);return l.set(n.clientId,n),i.set(t,{...a,clauses:l}),{selections:i}})},clearClause(t,n){e(e=>{const r=e.selections.get(t);if(!r||!r.clauses.has(n))return{};const o=new Map(e.selections),i=new Map(r.clauses);return i.delete(n),o.set(t,{...r,clauses:i}),{selections:o}})},setResolution(t,n){e(e=>{const r=e.selections.get(t);if(r?.resolution===n)return{};const o=new Map(e.selections),i=at(o,t);return o.set(t,{...i,resolution:n}),{selections:o}})},clearSelection(t){e(e=>{const n=e.selections.get(t);if(!n||0===n.clauses.size)return{};const r=new Map(e.selections);return r.set(t,{...n,clauses:new Map}),{selections:r}})}}));import{useSyncExternalStore as ut}from"react";var dt={positions:new Map},ht=new Set;function ft(){for(const e of ht)e()}function yt(e,t){const n=dt.positions.get(e);if(n?.locked)return;if(!n||n.sourceId!==t)return;const r=new Map(dt.positions);r.delete(e),dt={positions:r},ft()}function pt(e,t){const n=dt.positions.get(e);if(!n?.locked)return;if(t&&n.sourceId!==t)return;const r=new Map(dt.positions);r.delete(e),dt={positions:r},ft()}function mt(){return dt}function gt(e){return ht.add(e),()=>ht.delete(e)}var bt={positions:new Map};function xt(){return()=>{}}function vt(){return bt}function kt(e){const t=ut(e?gt:xt,e?mt:vt,e?mt:vt);return e?t.positions.get(e)??null:null}function wt(e){const t=tt(),n=e.clientId||t,{name:r}=e,o=ct(e=>e.selections.get(r)),i=ct(e=>e.setClause),a=ct(e=>e.clearClause),l=nt(()=>!!o&&o.clauses.size>0,[o]);return{predicate:nt(()=>o&&0!==o.clauses.size?it(o,n):()=>!0,[o,n]),isActive:l,selectPoints:rt(e=>{const t={};let o=!1;for(const[n,r]of Object.entries(e))t[n]={type:"point",values:new Set(r)},o=!0;o&&i(r,{clientId:n,type:"point",fields:t})},[n,r,i]),selectInterval:rt(e=>{const t={};let o=!1;for(const[n,r]of Object.entries(e))t[n]={type:"interval",range:r},o=!0;o&&i(r,{clientId:n,type:"interval",fields:t})},[n,r,i]),clear:rt(()=>{a(r,n)},[a,r,n]),clientId:n}}function $t(e,t){const n=tt(),r=t||n,o=ct(e=>e.setClause),i=ct(e=>e.clearClause);return{selectPoints:rt(t=>{const n={};let i=!1;for(const[e,r]of Object.entries(t))n[e]={type:"point",values:new Set(r)},i=!0;i&&o(e,{clientId:r,type:"point",fields:n})},[e,r,o]),clear:rt(()=>i(e,r),[e,r,i]),clientId:r}}function Mt(e){const t=e.name||"hover",{fields:n}=e,{predicate:r,isActive:o,selectPoints:i,clear:a}=wt({name:t,fields:n});return{onHover:rt(e=>{if(!e)return void a();const t={};for(const r of n){const n=e[r];void 0!==n&&(t[r]=[n])}l(t)&&i(t)},[n,i,a]),predicate:r,isActive:o}}function At(e){return 2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function St(e){const{name:t,xField:n,yField:r}=e,{predicate:o,isActive:i,selectInterval:a,clear:s}=wt({name:t,fields:[n,r].filter(Boolean)}),c=n&&r?"xyBrush":n?"xBrush":"yBrush",u=rt(e=>{if(!e)return void s();const t={};"xyBrush"===c&&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])]),r&&(t[r]=[Math.min(e[0][1],e[1][1]),Math.max(e[0][1],e[1][1])])):"xBrush"===c&&At(e)?n&&(t[n]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]):"yBrush"===c&&At(e)&&r&&(t[r]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]),l(t)&&a(t)},[c,n,r,a,s]);return{brushInteraction:nt(()=>({brush:c,during:u,end:u}),[c,u]),predicate:o,isActive:i,clear:s}}function Wt(e,t,n){const r=ct(e=>e.selections.get(t));return nt(()=>{if(!r||0===r.clauses.size)return e;const t=it(r,n);return e.filter(t)},[e,r,n])}function Ct(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function jt(e,t){const{when:n}=e,r=t.width,o=t.height,i=function(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}(t),a=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>r||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof o||n.minHeight>o)||"number"==typeof n.maxHeight&&("number"!=typeof o||o>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof i||n.minAspectRatio>i)||"number"==typeof n.maxAspectRatio&&("number"!=typeof i||i>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function Ot(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const r=n.map((e,t)=>({rule:e,index:t})).filter(e=>jt(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:r.reduce((e,t)=>function(e,t){const n={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])Ct(e[r])&&Ct(t[r])&&(n[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}(e,t.rule.transform),e),matches:r}}import{useMemo as It}from"react";function Nt(e={}){const{limit:t=50,types:n,chartId:r}=e,o=F(e=>e.version),i=F(e=>e.observations),a=F(e=>e.clearObservations),l=It(()=>{let e=i;if(n&&n.length>0){const t=new Set(n);e=e.filter(e=>t.has(e.type))}return r&&(e=e.filter(e=>e.chartId===r)),e.length>t&&(e=e.slice(e.length-t)),e},[i,n,r,t,o]);return{observations:l,latest:l.length>0?l[l.length-1]:null,clear:a}}import{createContext as Lt,useContext as Rt,useEffect as Pt,useId as zt,useLayoutEffect as Ft,useMemo as Tt,useRef as Dt,useState as Bt,useCallback as Et}from"react";import*as Gt from"react";function Ht(...e){let t;for(const n of e)n&&(t=_t(t)&&_t(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function _t(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function Vt(e){return"object"==typeof e&&null!==e&&"gradient"in e}function qt(e){return Math.ceil(7*e.length)}function Yt(e,t){if(_t(e)){const n=en(t),r=e.legendGroups.flatMap(e=>[e.label?qt(e.label):0,...e.items.map(e=>n.swatchSize+n.labelGap+qt(e.label))]);return Math.max(100,...r)}if(Vt(e)){const{gradient:t}=e,n=t.format||(e=>Math.round(100*e)/100+""),r=Math.max(qt(n(t.domain[0])),qt(n(t.domain[1]))),o=t.label?qt(t.label):0;return Math.max(100,19+r,o)}return 100}function Ut(e){return(_t(e)||Vt(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function Zt(e){return Math.max(0,e?.sideGutter??0)}function Xt(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?64:46:22:0}function Kt(e){return{hasAxis:!1!==e.showAxes,hasAxisLabel:!!e.xLabel}}function Jt(e){const t=e.projection??"vertical";return{hasAxis:!1!==e.showAxes&&"radial"!==t,hasAxisLabel:"horizontal"===t?e.hasValueLabel:e.hasCategoryLabel}}function Qt(e,t,n){if(Vt(e))return e.gradient.label?34:26;if(!_t(e))return 20;const r=en(n),o=Math.max(1,n?.maxWidth??t);let i=r.rowHeight;for(const t of e.legendGroups){let e=0,n=0;for(const i of t.items){const t=r.swatchSize+r.labelGap+qt(i.label),a=0===n?t:n+r.itemGap+t;n>0&&a>o?(e+=1,n=t):n=a}t.items.length>0&&(e+=1),i=Math.max(i,e*r.rowHeight,t.label?qt(t.label):0)}return i+(e.legendGroups.length>1?16:0)}function en(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}}import{jsx as tn,jsxs as nn}from"react/jsx-runtime";var rn={fill:(e,t)=>tn("rect",{style:e,width:t,height:t}),line:(e,t)=>tn("line",{style:e,x1:0,y1:0,x2:t,y2:t})};function on(e,t,n,r,o){let i;return i="function"==typeof n?n(e):(0,rn[n])(r(e,t),o),i}function an({swatchSize:e}){return tn("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 ln(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}var sn=(e,t,n,r,o,i,a,l,s,c,u)=>{const{type:d="fill",styleFn:h,items:f}=e,y=[];let p=0;const m=!(!t&&!n),g="isolate"===c||void 0===c&&null!=o,{swatchSize:b,labelGap:x,rowHeight:v}=u;return f.forEach((e,c)=>{const u=on(e,c,d,h,b),k=ln(e,r,o),w=o&&o.size>0&&o.has(e.label);y.push(nn("g",{transform:`translate(0,${p})`,onClick:t?()=>t(e):void 0,onMouseEnter:n?()=>n(e):void 0,onMouseLeave:n?()=>n(null):void 0,tabIndex:m?l===i&&c===a?0:-1:void 0,role:m?"option":void 0,"aria-selected":m&&g?w||!1:void 0,"aria-current":m&&!g&&null!=r&&e.label===r||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;s(l,e);const t=n.currentTarget.parentElement?.children[e];t instanceof SVGElement&&t.focus()}}:void 0,onFocus:m?t=>{s(l,c),n&&n(e);const r=t.currentTarget.querySelector(".semiotic-legend-focus-ring");r&&r.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&&tn("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:b+x+2+7*e.label.length,height:b+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),u,w&&tn(an,{swatchSize:b}),tn("text",{y:b/2,x:b+x,dominantBaseline:"central",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label})]},"legend-item-"+c)),p+=v}),y};function cn({config:e,orientation:t="vertical",width:n=100}){const{colorFn:r,domain:o,label:i,format:a}=e,l=a||(e=>Math.round(100*e)/100+""),s="grad-legend-"+Gt.useId();if("horizontal"===t){const e=12,t=Math.min(n,200),a=Math.max(0,(n-t)/2),c=[];for(let e=0;64>=e;e++){const t=e/64;c.push(tn("stop",{offset:100*t+"%",stopColor:r(o[0]+t*(o[1]-o[0]))},e))}return nn("g",{"aria-label":i||"Gradient legend",children:[tn("defs",{children:tn("linearGradient",{id:s,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:c})}),i&&tn("text",{x:a+t/2,y:-4,textAnchor:"middle",fontSize:11,fill:"var(--semiotic-text, #333)",children:i}),tn("rect",{x:a,y:0,width:t,height:e,fill:`url(#${s})`,rx:2}),tn("text",{x:a,y:e+12,textAnchor:"start",fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:l(o[0])}),tn("text",{x:a+t,y:e+12,textAnchor:"end",fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:l(o[1])})]})}const c=[];for(let e=0;64>=e;e++){const t=e/64;c.push(tn("stop",{offset:100*t+"%",stopColor:r(o[1]-t*(o[1]-o[0]))},e))}return nn("g",{"aria-label":i||"Gradient legend",children:[i&&tn("text",{x:0,y:-6,textAnchor:"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:i}),tn("defs",{children:tn("linearGradient",{id:s,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:c})}),tn("rect",{x:0,y:0,width:14,height:100,fill:`url(#${s})`,rx:2}),tn("text",{x:19,y:10,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:l(o[1])}),tn("text",{x:19,y:100,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:l(o[0])})]})}function un(e){const{legendGroups:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:o,isolatedCategories:i,legendInteraction:a,title:l="Legend",width:s=100,height:c=20,orientation:u="vertical",legendLayout:d}=e,h=en(d),[f,y]=Gt.useState(0),[p,m]=Gt.useState(0),g=Gt.useCallback((e,t)=>{y(e),m(t)},[]),b="vertical"===u?(({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:o,isolatedCategories:i,focusedGroupIndex:a,focusedItemIndex:l,onFocusedIndexChange:s,legendInteraction:c,metrics:u})=>{const d=[],h=function(e,t){let n=24;return e.map(({hasLabel:e,itemCount:r})=>{n+=5;const o=n;let i;n+=8,e&&(n+=16,i=n,n+=8);const a=n;return n+=r*t+8,{lineY:o,labelY:i,itemsY:a,endY:n}})}(e.map(e=>({hasLabel:!!e.label,itemCount:e.items.length})),u.rowHeight);return e.forEach((e,f)=>{const y=h[f];d.push(tn("line",{stroke:"gray",x1:0,y1:y.lineY,x2:t,y2:y.lineY},"legend-top-line legend-symbol-"+f)),e.label&&null!=y.labelY&&d.push(tn("text",{y:y.labelY,className:"legend-group-label",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label},"legend-text-"+f)),d.push(tn("g",{className:"legend-item",transform:`translate(0,${y.itemsY})`,children:sn(e,n,r,o,i,a,l,f,s,c,u)},"legend-group-"+f))}),d})({legendGroups:t||[],width:s,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:o,isolatedCategories:i,focusedGroupIndex:f,focusedItemIndex:p,onFocusedIndexChange:g,legendInteraction:a,metrics:h}):(({legendGroups:e,height:t,width:n,customClickBehavior:r,customHoverBehavior:o,highlightedCategory:i,isolatedCategories:a,focusedGroupIndex:l,focusedItemIndex:s,onFocusedIndexChange:c,legendInteraction:u,metrics:d})=>{let h=0;const f=[];e.forEach((e,t)=>{let y=0;e.label&&(y+=16);const p=((e,t,n,r,o,i,a,l,s,c,u,d)=>{const{type:h="fill",styleFn:f,items:y}=e,p=[],{swatchSize:m,labelGap:g,itemGap:b,rowHeight:x,align:v}=u,k=!(!t&&!n),w="isolate"===c||void 0===c&&null!=o,$=y.map(e=>m+g+7*e.label.length),M=[];let A=0,S=0;$.forEach((e,t)=>{const n=0===S?e:S+b+e;d&&d>0&&S>0&&n>d?(M.push({start:A,end:t,width:S}),A=t,S=e):S=n}),y.length>0&&M.push({start:A,end:y.length,width:S}),M.forEach((e,c)=>{let u="center"===v?Math.max(0,((d??e.width)-e.width)/2):"end"===v?Math.max(0,(d??e.width)-e.width):0;for(let d=e.start;e.end>d;d++){const e=y[d],v=on(e,d,h,f,m),M=ln(e,r,o),A=o&&o.size>0&&o.has(e.label);p.push(nn("g",{transform:`translate(${u},${c*x})`,onClick:t?()=>t(e):void 0,onMouseEnter:n?()=>n(e):void 0,onMouseLeave:n?()=>n(null):void 0,tabIndex:k?l===i&&d===a?0:-1:void 0,role:k?"option":void 0,"aria-selected":k&&w?A||!1:void 0,"aria-current":k&&!w&&null!=r&&e.label===r||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=(d+("ArrowRight"===n.key?1:-1)+y.length)%y.length;s(l,e);const t=n.currentTarget.parentElement?.children[e];t instanceof SVGElement&&t.focus()}}:void 0,onFocus:k?t=>{s(l,d),n&&n(e);const r=t.currentTarget.querySelector(".semiotic-legend-focus-ring");r&&r.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:M,transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[k&&tn("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"}),v,A&&tn(an,{swatchSize:m}),tn("text",{y:m/2,x:m+g,dominantBaseline:"central",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label})]},"legend-item-"+d)),u+=$[d]+b}});const W=Math.max(0,...M.map(e=>e.width)),C=M.length;return{items:p,offset:W,totalRows:C,totalHeight:C*x}})(e,r,o,i,a,l,s,t,c,u,d,d.maxWidth??n);y+=p.offset+5,f.push({label:e.label,...p,offset:y,totalRows:p.totalRows,totalHeight:p.totalHeight}),h+=y+12});const y=d.maxWidth??n;let p=h>y?0:"center"===d.align?Math.max(0,(y-h)/2):"end"===d.align?Math.max(0,y-h):0;const m=[];return f.forEach((n,r)=>{const o=e[r];o.label&&(m.push(tn("text",{transform:`translate(${p},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:o.label},"legend-text-"+r)),p+=16),m.push(tn("g",{className:"legend-item",transform:`translate(${p},0)`,children:n.items},"legend-group-"+r)),p+=n.offset+5,e[r+1]&&m.push(tn("line",{stroke:"gray",x1:p,y1:-8,x2:p,y2:(n.totalHeight||t)+0+8},"legend-top-line legend-symbol-"+r)),p+=12}),tn("g",{children:m})})({legendGroups:t||[],title:l,height:c,width:s,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:o,isolatedCategories:i,focusedGroupIndex:f,focusedItemIndex:p,onFocusedIndexChange:g,legendInteraction:a,metrics:h}),x=!(!n&&!r);return nn("g",{role:x?"listbox":void 0,"aria-multiselectable":!(!x||"isolate"!==a&&(void 0!==a||null==i))||void 0,"aria-label":"Chart legend",style:{fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[void 0!==l&&""!==l&&"vertical"===u&&tn("text",{className:"legend-title",y:16,x:s/2,textAnchor:"middle",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:l}),b]})}import{useRef as dn,useState as hn,useEffect as fn}from"react";function yn(e,t,n){const r=dn(null),[o,i]=hn(null);return fn(()=>{if(!t&&!n)return;const e=r.current;if(!e)return;const o=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 o.observe(e),()=>o.disconnect()},[t,n]),[r,[t&&o?o.w:e[0],n&&o?o.h:e[1]]]}import{jsx as pn,jsxs as mn}from"react/jsx-runtime";var gn=Lt(!1),bn=Lt(!1);function xn(){return Rt(bn)}var vn=Lt(null),kn="undefined"==typeof window?Pt:Ft;function wn(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function $n(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}function Mn(e){const t=Rt(vn),n=zt(),r=wn(e),o=Dt([]);$n(o.current,r)||(o.current=r);const i=o.current;kn(()=>{if(t)return()=>t.unregisterCategories(n)},[t,n]),kn(()=>{t&&t.registerCategories(n,i)},[t,n,i])}var An="__linked-legend-isolate__",Sn="__linked-legend-highlight__";function Wn({categoryColors:e,interaction:t,selectionName:n,field:r}){const o=Object.entries(e),i=o.map(([e])=>e),a=[{styleFn:e=>({fill:e.color||"#333",stroke:e.color||"#333"}),type:"fill",items:o.map(([e,t])=>({label:e,color:t})),label:""}],{selectPoints:l,clear:s}=wt({name:n,fields:[r],clientId:An}),{selectPoints:c,clear:u}=wt({name:n,fields:[r],clientId:Sn}),d=ct(e=>e.selections.get(n)),{isolatedCategories:h,highlightedCategory:f}=Tt(()=>{const e=new Set;let t=null;const n=d?.clauses.get(An)?.fields[r];if("point"===n?.type)for(const t of n.values)e.add(t+"");const o=d?.clauses.get(Sn)?.fields[r];if("point"===o?.type){const e=o.values.values().next().value;null!=e&&(t=e+"")}return{isolatedCategories:e,highlightedCategory:t}},[d,r]),y=Et(e=>{"highlight"===t&&(e?c({[r]:[e.label]}):u())},[t,r,c,u]),p=Et(e=>{if("isolate"!==t)return;const n=new Set(h);n.has(e.label)?n.delete(e.label):n.add(e.label),0===n.size||n.size===i.length?s():l({[r]:Array.from(n)})},[t,r,h,i.length,l,s]),[m,[g]]=yn([0,0],!0,!1),b=Tt(()=>function(e,t){if(!t||0===e.length)return 1;let n=0,r=1;for(const o of e){const e=26+7*o.length;n>0&&n+e>t&&(r++,n=0),n+=e}return r}(o.map(([e])=>e),g),[o,g]);return 0===o.length?null:pn("div",{ref:m,style:{width:"100%",display:"block"},children:pn("svg",{width:"100%",height:Math.max(30,22*b+8),style:{display:"block",overflow:"visible"},children:pn(un,{legendGroups:a,title:!1,orientation:"horizontal",width:g,height:20,customHoverBehavior:"highlight"===t?y:void 0,customClickBehavior:"isolate"===t?p:void 0,highlightedCategory:f,isolatedCategories:h})})})}function Cn({children:e,selections:t,showLegend:n,legendPosition:r="top",legendInteraction:o="none",legendSelectionName:i="legend",legendField:a="category"}){const l=Tt(()=>{if(!t)return;const e=new Map;for(const[n,r]of Object.entries(t))r.resolution&&e.set(n,{name:n,resolution:r.resolution,clauses:new Map});return e.size>0?{selections:e}:void 0},[t]),s=et(),[c,u]=Bt({}),d=Dt({}),h=Tt(()=>({registerCategories:(e,t)=>{const n=wn(t);u(t=>$n(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=Tt(()=>{const e=[];for(const t of Object.values(c))for(const n of t)e.push(n);return wn(e)},[c]),y=Tt(()=>{const e=s??{},t=d.current;let n=Object.keys(e).length+Object.keys(t).length;for(const r of f)e[r]||t[r]||(t[r]=Ee[n%Ee.length],n++);const r={...e};for(const n of f)r[n]=e[n]??t[n];return r},[s,f]),p=void 0===n||n,m=Object.keys(y).length>0;return pn(st,{initialState:l,children:pn(z,{children:pn(bn.Provider,{value:!0,children:pn(vn.Provider,{value:h,children:pn(Qe,{colors:y,children:mn(gn.Provider,{value:p&&m,children:[p&&"top"===r&&pn(Wn,{categoryColors:y,interaction:o,selectionName:i,field:a}),e,p&&"bottom"===r&&pn(Wn,{categoryColors:y,interaction:o,selectionName:i,field:a})]})})})})})})}var jn=Object.freeze([]);function On(e){if(!e)return jn;let t=!1;for(let n=0;e.length>n;n++){const r=e[n];if(null==r||"object"!=typeof r){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 In={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 Nn(e,t){const n={...e};for(const e of t)n[In[e]]++;return n}function Ln(e,t,n){const r=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:r,revisions:Nn(n,r)}}var Rn=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=Ln({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=Ln(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}};import{memo as Pn,useEffect as zn,useRef as Fn}from"react";var Tn={sceneGeometry:0,layout:0,domain:0};function Dn(e){const{domain:t,layout:n,sceneGeometry:r}=e.revisions;return{domain:t,layout:n,sceneGeometry:r}}function Bn(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 En="production"!==process.env.NODE_ENV,Gn={revisions:Tn,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},Hn=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=Tn,this.lastObserved=Tn,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){En&&(this.lastObserved=Bn(this.lastObserved,Dn(e)))}beforeCompute(e,t){if(!En)return Gn;const n=Bn(Dn(e),this.lastObserved),r=function(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}(n),o=!((i=n).sceneGeometry===(a=this.lastConsumed).sceneGeometry&&i.layout===a.layout&&i.domain===a.domain);var i,a;return{revisions:n,signature:r,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:o,warnUnconsumed:!t&&o&&this.lastUnconsumedWarning!==r}}afterCompute(e,t,n){if(En){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="")}}};function _n(e){return Fn(new Hn(e))}function Vn(e,t,n,r=!1,o=!1){const i=e.beforeCompute(t.getLastUpdateResult(),r);n(),e.afterCompute(i,!0,o)}var qn=Pn(function({store:e,diagnostics:t}){return zn(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null});import{jsx as Yn}from"react/jsx-runtime";function Un(e){const{legend:t,totalWidth:n,totalHeight:r,margin:o,legendPosition:i="right",legendLayout:a,legendHoverBehavior:l,legendClickBehavior:s,legendHighlightedCategory:c,legendIsolatedCategories:u,legendInteraction:d}=e;if(!t)return null;const h="top"===i||"bottom"===i,f=Math.max(0,n-o.left-o.right),y=Math.max(1,h?a?.maxWidth??f:Yt(t,a)),p=Ut(t),m=Zt(a),g=Xt(e.axisChrome,a),b=Xt(void 0,a),x=Qt(t,f,a);let v,k;if("left"===i)v=o.left-m-y-p,k=o.top;else if("top"===i)v=o.left,k=o.top-b-p-x;else if("bottom"===i){v=o.left;const e=r-o.bottom;k=Math.max(e+p,Math.min(e+g+p,r-x))}else v=n-o.right+m+p,k=o.top;return Yn("g",{transform:`translate(${v}, ${k})`,children:Vt(t)?Yn(cn,{config:t.gradient,orientation:h?"horizontal":"vertical",width:y}):_t(t)?Yn(un,{legendGroups:t.legendGroups,title:"",width:y,orientation:h?"horizontal":"vertical",legendLayout:a,customHoverBehavior:l,customClickBehavior:s,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}import{jsx as Zn}from"react/jsx-runtime";var Xn={secondary:0,primary:3},Kn=".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}}";function Jn(e){return!0===e?._annotationDeferred}function Qn(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function er(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function tr(e){return Math.max(.72,.95-.06*e)}import*as nr from"react";import{jsx as rr,jsxs as or}from"react/jsx-runtime";function ir(e,t=120,n=8){if(!e)return[];const r=Math.max(1,Math.floor(t/n)),o=e.split(/\s+/),i=[];let a="";for(const e of o)a&&a.length+1+e.length>r?(i.push(a),a=e):a=a?`${a} ${e}`:e;return a&&i.push(a),i}function ar(e,t,n,r){return"curly"===e?r?`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`:r?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function lr(e,t,n,r){if(!e)return rr("g",{className:"annotation-note"});const{label:o,title:i,orientation:a,align:l,wrap:s=120,noWrap:c}=e;if(!o&&!i)return rr("g",{className:"annotation-note"});let u=a;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");let d=l;d&&"dynamic"!==d||(d="topBottom"===u?0>t?"right":"left":0>n?"bottom":"top");let h="start";"topBottom"===u?"right"===d?h="end":"middle"===d&&(h="middle"):h=0>t?"end":"start";const f=16,y=i?c?[i]:ir(i,s):[],p=o?c?[o]:ir(o,s):[],m="leftRight"===u?"end"===h?-4:4:0;let g=0;const b=[],x=r||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";e.useHTML||e.html?b.push(rr("foreignObject",{className:"annotation-note-html",x:"end"===h?m-s:"middle"===h?m-s/2:m,y:-16,width:s,height:Math.max(f,(y.length+p.length)*f+(i&&o?2:0))+f,style:{overflow:"visible"},children:or("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:x,fontSize:"12px",lineHeight:"16px",overflow:"visible",textAlign:"end"===h?"right":"middle"===h?"center":"left",whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[i&&rr("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:i}),o&&rr("div",{className:"annotation-note-label",children:o})]})},"annotation-note-html")):(y.length>0&&(b.push(rr("text",{className:"annotation-note-title",fill:x,textAnchor:h,fontWeight:"bold",children:y.map((e,t)=>rr("tspan",{x:m,dy:0===t?0:f,children:e},t))},"annotation-note-title")),g=y.length*f),p.length>0&&b.push(rr("text",{className:"annotation-note-label",fill:x,textAnchor:h,y:g,children:p.map((e,t)=>rr("tspan",{x:m,dy:0===t?0:f,children:e},t))},"annotation-note-label")));let v=null;if((i||o)&&(0!==t||0!==n))if("topBottom"===u){const e=Math.min(s,120);let t=0,n=e;"end"===h?(t=-e,n=0):"middle"===h&&(t=-e/2,n=e/2),v=rr("line",{className:"note-line",x1:t,x2:n,y1:0,y2:0,stroke:r||"var(--semiotic-text-secondary, currentColor)"})}else{const e=(y.length+p.length)*f+(p.length>0?f:0);let t=0,n=e;"bottom"===d?(t=-e,n=0):"middle"===d&&(t=-e/2,n=e/2),v=rr("line",{className:"note-line",x1:0,x2:0,y1:t,y2:n,stroke:r||"var(--semiotic-text-secondary, currentColor)"})}const k=Math.max(0,y.length+p.length-1)*f;let w=0;return"topBottom"===u?w=0>n?-(k+2):18:"leftRight"===u&&(w="middle"===d?-(k+f+(p.length>0&&y.length>0?2:0))/2+8:"bottom"===d||0>n?-(k+2):18),or("g",{className:"annotation-note",transform:`translate(${t},${n})`,children:[rr("g",{className:"annotation-note-content",transform:0!==w?`translate(0,${w})`:void 0,children:b}),v]})}function sr(e,t,n,r,o){const i=[];switch(e){case"callout-circle":{const e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&i.push(rr("circle",{r:e,fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"subject-circle"));break}case"callout-rect":{const e=t?.width||0,r=t?.height||0;(e>0||r>0)&&i.push(rr("rect",{width:e,height:r,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=r||0,a=o||0;if(void 0!==t?.x){const r=(t.x||0)-e;i.push(rr("line",{x1:r,y1:(t.y1||0)-a,x2:r,y2:(t.y2||0)-a,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"))}else if(void 0!==t?.y){const r=(t.y||0)-a;i.push(rr("line",{x1:(t.x1||0)-e,y1:r,x2:(t.x2||0)-e,y2:r,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"))}else void 0!==t?.x1||void 0!==t?.x2?i.push(rr("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(rr("line",{x1:0,y1:(t.y1||0)-a,x2:0,y2:(t.y2||0)-a,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"));break}case"bracket":{const e=t?.type||"curly",r=t?.width??t?.height;void 0!==r&&i.push(rr("path",{d:ar(e,r,t?.depth||30,void 0===t?.width),fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"bracket-path"));break}}return rr("g",{className:"annotation-subject",children:i})}function cr(e,t,n,r,o,i){const a=[];let l=0,s=0;if("callout-circle"!==o&&"label"!==o||!i?.radius){if("callout-rect"===o&&i){const n=i.width||0,r=i.height||0;if(n>0||r>0){const o=n/2,i=r/2,a=e-o,c=t-i;if(0!==a||0!==c){const e=Math.abs(a),t=Math.abs(c),u=n/2,d=r/2,h=e*d>t*u?u/e:d/t;l=o+a*h,s=i+c*h}}}else if("bracket"===o&&i){const e=i.width,t=i.height,n=i.depth||30;void 0!==e?(l=e/2,s=n):void 0!==t&&(l=n,s=t/2)}}else{const n=(i.radius||0)+(i.radiusPadding||0);if(n>0&&(0!==e||0!==t)){const r=Math.atan2(t,e);l=Math.cos(r)*n,s=Math.sin(r)*n}}const c=Math.sqrt((e-l)**2+(t-s)**2);if(c>.5){const o=r||"var(--semiotic-text-secondary, currentColor)",i="curve"===n?.type;let u=Math.atan2(t-s,e-l);if(i){const r=(l+e)/2,i=(s+t)/2,d=-(t-s)/c,h=(e-l)/c,f=(n?.curve??.25)*c,y=r+d*f,p=i+h*f;a.push(rr("path",{className:"connector-curve",d:`M${l},${s}Q${y},${p} ${e},${t}`,fill:"none",stroke:o},"connector-line")),u=Math.atan2(p-s,y-l)}else a.push(rr("line",{x1:l,y1:s,x2:e,y2:t,stroke:o},"connector-line"));if("arrow"===n?.end){const e=10,t=16/180*Math.PI;a.push(rr("path",{d:`M${l},${s}L${l+e*Math.cos(u+t)},${s+e*Math.sin(u+t)}L${l+e*Math.cos(u-t)},${s+e*Math.sin(u-t)}Z`,fill:o,stroke:"none"},"connector-arrow"))}}return rr("g",{className:"annotation-connector",children:a})}function ur(e){const{x:t=0,y:n=0,dx:r,dy:o,nx:i,ny:a,note:l,connector:s,subject:c,type:u,color:d,className:h,disable:f,opacity:y,strokeDasharray:p,events:m={},"data-testid":g}=e,b=Array.isArray(t)?t[0]??0:t,x=Array.isArray(n)?n[0]??0:n,v=new Set(Array.isArray(f)?f:[]);let k=r||0,w=o||0;null!=i&&(k=i-b),null!=a&&(w=a-x);const $="string"==typeof u?u:"label";if("bracket"===$&&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 or("g",{className:("annotation "+(h||"")).trim(),transform:`translate(${b},${x})`,"data-testid":g,...null!=y&&{opacity:y},...p&&{strokeDasharray:p},...m,children:[!v.has("connector")&&cr(k,w,s,d,$,c),!v.has("subject")&&sr($,c,d,b,x),!v.has("note")&&lr(l,k,w,d)]})}function dr(e){const{noteData:t}=e,{screenCoordinates:n}=t,r="string"==typeof t.type?t.type:"label",o=t.eventListeners||t.events||{};if(t.coordinates&&n){const e=t.nx||n[0][0]+(t.dx??0),o=t.ny||n[0][1]+(t.dy??0),i=n.map((n,i)=>{const a=Object.assign({},t,{note:0===i?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:o});return rr(ur,{"data-testid":"semiotic-annotation",...a,type:r},"multi-annotation-"+i)});return rr("g",{children:i})}const i=t.note||{title:"none",label:t.label},a=`${i.label}-${i.title}-${t.i}`;return rr(ur,{"data-testid":"semiotic-annotation",events:o,...t,type:r},a)}import{packEnclose as hr}from"d3-hierarchy";import{area as fr,curveLinear as yr,curveMonotoneX as pr,curveMonotoneY as mr,curveStep as gr,curveStepAfter as br,curveStepBefore as xr,curveBasis as vr,curveCardinal as kr,curveCatmullRom as wr}from"d3-shape";function $r(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 Mr(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 Ar(e){return null==e?null:e+""}function Sr(e,t,n){return t.stickyPositionCache?.set(e,n),n}function Wr(e,t,n){const r=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===r){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let r=n.pointNodes.length-1;r>=0;r--){const o=n.pointNodes[r];if(o.pointId===e.pointId)return Sr(t,n,{x:o.x,y:o.y})}const r=function(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],r=e.scales?.x??e.scales?.time,o=e.scales?.y??e.scales?.value;if(!r||!o)return null;const i=n[e.xAccessor||"x"],a=n[e.yAccessor||"y"];return null==i||null==a?null:{x:r(i),y:o(a)}}(n);return r?Sr(t,n,r):null}if("semantic"===r){const r=function(e,t,n){const r=function(e){return Ar(e.provenance?.stableId??e.stableId)}(e);if(!r)return null;const o=n.pointNodes?.find(e=>Ar(e.pointId)===r);if(o)return Sr(t,n,{x:o.x,y:o.y});const i=n.data?.find(e=>function(e){return Ar(e.stableId??e.id??e.provenance?.stableId)}(e)===r);if(!i)return null;const a=$r(i,n),l=Mr(i,n);return null==a||null==l?null:Sr(t,n,{x:a,y:l})}(e,t,n);if(r)return r}let o=null,i=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(o=t.x,i=t.y)}if(null!=o&&null!=i||(o=$r(e,n),i=Mr(e,n)),null!=o&&null!=i)return Sr(t,n,{x:o,y:i});if("sticky"===r){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function Cr(e,t,n,r=50){return!(-r>e||e>(n.width||0)+r||-r>t||t>(n.height||0)+r)}import{jsx as jr,jsxs as Or}from"react/jsx-runtime";var Ir={linear:yr,monotoneX:pr,monotoneY:mr,step:gr,stepAfter:br,stepBefore:xr,basis:vr,cardinal:kr,catmullRom:wr};function Nr(e,t,n,r){const o=[];return e.forEach((e,i)=>{let a;if(n){const o=n(e,i,r);a=null!=o?o:t(e,i,r)}else a=t(e,i,r);a&&o.push({node:a,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:er(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),r=e.some(e=>Jn(e.annotation)),o=e.some(e=>null!=Qn(e.annotation)),i=e.some(e=>"layer"===Qn(e.annotation));if(!n&&!r&&!o)return e.map(e=>e.node);const a=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);a.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,a.length)});for(const e of t)e.emphasis&&(e.rank=Xn[e.emphasis]);const l=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{const{p:t,i:n,emphasis:r,readingOrder:o}=e,i=Jn(t.annotation);let a=t.node;if("primary"===r||"secondary"===r||null!=o){const e=null==r&&null!=o;a=Zn("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":"annotation-emphasis annotation-emphasis--"+r,..."secondary"===r?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:tr(o),"data-annotation-reading-order":o}:{},children:t.node},"annotation-emphasis-"+n)}const l=Qn(t.annotation);return l&&(a=Zn("g",{className:"annotation-cohesion--"+l,children:a},"annotation-cohesion-"+n)),i&&(a=Zn("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:a},"annotation-deferred-"+n)),a});return r&&l.unshift(Zn("style",{children:Kn},"annotation-disclosure-style")),i&&l.unshift(Zn("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")),l}(o)}function Lr(a,l={}){return function(a,s,c){switch(a.type){case"label":case"callout":case"callout-circle":case"callout-rect":{const e=Wr(a,s,c);if(!e)return null;const{x:t,y:n}=e;if(!Cr(t,n,c))return null;const r="callout"===a.type?"callout-circle":a.type,o="callout-circle"===r?{radius:a.radius??12,radiusPadding:a.radiusPadding}:"callout-rect"===r?{width:a.width,height:a.height}:void 0;return jr(dr,{noteData:{x:t,y:n,dx:a.dx??30,dy:a.dy??-30,note:{label:a.label,title:a.title,wrap:a.wrap||120},type:r,...o?{subject:o}:{},connector:a.connector||{end:"arrow"},color:a.color,disable:a.disable,opacity:a.opacity,strokeDasharray:a.strokeDasharray,className:a.className}},"ann-"+s)}case"x-threshold":{const e=$r(null!=a.value?{...a,x:a.value}:a,c);if(null==e)return null;const t=a.color||"#f97316",n=a.labelPosition||"top";let r;r="bottom"===n?(c.height||0)-4:"center"===n?(c.height||0)/2:16;const o=e>.6*(c.width||0),i=o?e-4:e+4,l=o?"end":"start";return Or("g",{opacity:a.opacity,children:[jr("line",{x1:e,y1:0,x2:e,y2:c.height||0,stroke:t,strokeWidth:a.strokeWidth||1.5,strokeDasharray:a.strokeDasharray||"6,3"}),a.label&&jr(q,{x:i,y:r,text:a.label,textAnchor:l,fill:t,fontSize:12,fontWeight:"bold",background:a.labelBackground??"halo"})]},"ann-"+s)}case"y-threshold":{const e=Mr(null!=a.value?{...a,y:a.value}:a,c);if(null==e)return null;const t=a.color||"#f97316",n=a.labelPosition||"right";let r,o;"left"===n?(r=4,o="start"):"center"===n?(r=(c.width||0)/2,o="middle"):(r=(c.width||0)-4,o="end");const i=20>(h=e)?Math.min((c.height||0)-4,h+16):h-4;return Or("g",{opacity:a.opacity,children:[jr("line",{x1:0,y1:e,x2:c.width||0,y2:e,stroke:t,strokeWidth:a.strokeWidth||1.5,strokeDasharray:a.strokeDasharray||"6,3"}),a.label&&jr(q,{x:r,y:i,text:a.label,textAnchor:o,fill:t,fontSize:12,fontWeight:"bold",background:a.labelBackground??"halo"})]},"ann-"+s)}case"enclose":{const e=(a.coordinates||[]).map(e=>({x:$r({...e,type:"point"},c),y:Mr({...e,type:"point"},c),r:1})).filter(e=>null!=e.x&&null!=e.y);if(2>e.length)return null;const t=hr(e),n=a.padding||10;return Or("g",{children:[jr("circle",{cx:t.x,cy:t.y,r:t.r+n,fill:a.fill||"none",fillOpacity:a.fillOpacity||.1,stroke:a.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),a.label&&jr(q,{x:t.x,y:t.y-t.r-n-4,textAnchor:"middle",fill:a.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:a.label,background:a.labelBackground??"none"})]},"ann-"+s)}case"rect-enclose":{const e=(a.coordinates||[]).map(e=>({x:$r({...e,type:"point"},c),y:Mr({...e,type:"point"},c)})).filter(e=>null!=e.x&&null!=e.y);if(2>e.length)return null;const t=a.padding||10,n=e.map(e=>e.x),o=e.map(e=>e.y),[i,l]=r(n),[u,d]=r(o),h=i-t,f=l+t,y=u-t;return Or("g",{children:[jr("rect",{x:h,y:y,width:f-h,height:d+t-y,fill:a.fill||"none",fillOpacity:a.fillOpacity||.1,stroke:a.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),a.label&&jr(q,{x:(h+f)/2,y:y-4,textAnchor:"middle",fill:a.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:a.label,background:a.labelBackground??"none"})]},"ann-"+s)}case"highlight":{const e=c.data||[],t="function"==typeof a.filter?e.filter(a.filter):a.field&&null!=a.value?e.filter(e=>e[a.field]===a.value):[],n={stroke:a.color||"#f97316",strokeWidth:2,fill:"none"};return jr("g",{children:t.map((e,t)=>{const r=$r(e,c),o=Mr(e,c);if(null==r||null==o)return null;const i="function"==typeof a.r?a.r(e):a.r||6,l="function"==typeof a.style?a.style(e):a.style||n;return jr("circle",{cx:r,cy:o,r:i,...l},"hl-"+t)})},"ann-"+s)}case"bracket":{const e=$r(a,c),t=Mr(a,c);return jr(dr,{noteData:{x:e??0,y:t??0,dx:a.dx||0,dy:a.dy||0,note:{label:a.label,title:a.title,wrap:a.wrap||120},type:"bracket",subject:{type:a.bracketType||"curly",width:a.width,height:a.height,depth:a.depth||30},color:a.color}},"ann-"+s)}case"trend":{const e=c.data||[];if(2>e.length)return null;const t=c.xAccessor||"x",n=c.yAccessor||"y",r="ordinal"===c.frameType,l="horizontal"===c.projection,u=r?t:null,d=r?n:null;let h;const f=[],y=new Map;if(r&&u&&d){for(const t of e){const e=t[u];if(null==e)continue;const n=e+"";y.has(n)||(y.set(n,f.length),f.push(n))}h=e.map(e=>{const t=e[u],n=e[d];if(null==t||null==n)return null;const r=y.get(t+"");return null!=r?[r,+n]:null}).filter(e=>null!==e)}else h=e.map(e=>[e[t],e[n]]).filter(e=>null!=e[0]&&null!=e[1]);if(2>h.length)return null;const p=c.scales?.x??c.scales?.time,m=c.scales?.y??c.scales?.value;if(!p||!m)return null;const g=e=>t=>{const n=Math.max(0,Math.floor(t)),r=Math.min(f.length-1,n+1),o=t-n,i=e(f[n]);return i+(e(f[r])-i)*o},b=p,x=m;let v;if(r)if(l){const e=g(x);v=(t,n)=>[b(n),e(t)]}else{const e=g(b);v=(t,n)=>[e(t),x(n)]}else v=(e,t)=>[b(e),x(t)];const k=a.method||"linear";let w;w="loess"===k?function(e,t=.3){const n=e.length;if(2>n)return e.slice();const r=e.slice().sort((e,t)=>e[0]-t[0]),o=r.map(e=>e[0]),i=r.map(e=>e[1]),a=Math.max(2,Math.ceil(t*n)),l=[];for(let e=0;n>e;e++){const t=o[e],r=o.map(e=>Math.abs(e-t)),s=r.slice().sort((e,t)=>e-t)[Math.min(a-1,n-1)]||1,c=[];for(let e=0;n>e;e++){const t=0===s?0:r[e]/s;c[e]=1>t?Math.pow(1-Math.pow(t,3),3):0}let u=0,d=0,h=0,f=0,y=0;for(let e=0;n>e;e++){const t=c[e];0!==t&&(u+=t,d+=t*o[e],h+=t*i[e],f+=t*o[e]*o[e],y+=t*o[e]*i[e])}if(0===u){l.push([t,i[e]]);continue}const p=u*f-d*d;if(1e-12>Math.abs(p))l.push([t,h/u]);else{const e=(u*y-d*h)/p;l.push([t,(h-e*d)/u+e*t])}}return l}(h,a.bandwidth??.3):("polynomial"===k?i(h,a.order||2):o(h)).points;const $=w.map(([e,t])=>{const[n,r]=v(e,t);return`${n},${r}`}).join(" "),M=a.color||"#6366f1",A=w[w.length-1],[S,W]=v(A[0],A[1]);return Or("g",{children:[jr("polyline",{points:$,fill:"none",stroke:M,strokeWidth:a.strokeWidth||2,strokeDasharray:a.strokeDasharray||"6,3"}),a.label&&jr("text",{x:S+4,y:W-4,fill:M,fontSize:11,children:a.label})]},"ann-"+s)}case"band":{const e=c.scales?.y??c.scales?.value,t=e?.domain?.(),n=a.y0??t?.[0],r=a.y1??t?.[1],o=null!=n&&e?e(n):0,i=null!=r&&e?e(r):c.height||0,l=R(a.fill,"ann-"+s,"var(--semiotic-primary, #6366f1)");return Or("g",{opacity:a.opacity,children:[l.def&&jr("defs",{children:l.def}),jr("rect",{x:0,y:Math.min(o,i),width:c.width||0,height:Math.abs(i-o),fill:l.fill,fillOpacity:a.fillOpacity||.1}),a.label&&jr(q,{x:(c.width||0)-4,y:(u=o,d=i,Math.max(Math.min(u,d),0)+16),textAnchor:"end",fill:a.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:a.label,background:a.labelBackground??"halo"})]},"ann-"+s)}case"x-band":{const e=c.scales?.x??c.scales?.time,t=e?.domain?.(),n=a.x0??t?.[0],r=a.x1??t?.[1],o=null!=n&&e?e(n):null,i=null!=r&&e?e(r):null;if(null==o||null==i)return null;const l=R(a.fill||a.color,"ann-"+s,"var(--semiotic-primary, #6366f1)");return Or("g",{opacity:a.opacity,children:[l.def&&jr("defs",{children:l.def}),jr("rect",{x:Math.min(o,i),y:0,width:Math.abs(i-o),height:c.height||0,fill:l.fill,fillOpacity:a.fillOpacity??.1}),a.label&&jr(q,{x:Math.min(o,i)+4,y:16,textAnchor:"start",fill:a.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:a.label,background:a.labelBackground??"halo"})]},"ann-"+s)}case"envelope":{const e=c.data||[];if(2>e.length)return null;const t=c.xAccessor||"x",n=c.scales?.x??c.scales?.time,r=c.scales?.y??c.scales?.value;if(!n||!r)return null;const o=a.upperAccessor||"upperBounds",i=a.lowerAccessor||"lowerBounds",l=a.filter,u=e.filter(e=>null!=e[o]&&null!=e[i]&&!(l&&!l(e))).sort((e,n)=>e[t]-n[t]);if(2>u.length)return null;const d=Ir[c.curve||"linear"]||yr,h=fr().x(e=>n(e[t])).y0(e=>r(e[i])).y1(e=>r(e[o])).curve(d)(u);if(!h)return null;const f=a.fill||"#6366f1";return Or("g",{children:[jr("path",{d:h,fill:f,fillOpacity:a.fillOpacity??.15,stroke:"none"}),a.label&&u.length>0&&jr("text",{x:n(u[u.length-1][t])+4,y:r(u[u.length-1][o])-4,fill:f,fontSize:11,children:a.label})]},"ann-"+s)}case"anomaly-band":{const e=c.data||[];if(2>e.length)return null;const t=c.yAccessor||"y",n=c.scales?.x??c.scales?.time,r=c.scales?.y??c.scales?.value;if(!n||!r)return null;const o=e.map(e=>e[t]).filter(e=>null!=e&&isFinite(e));if(2>o.length)return null;const i=o.reduce((e,t)=>e+t,0)/o.length,l=o.reduce((e,t)=>e+(t-i)**2,0)/o.length,u=Math.sqrt(l),d=a.threshold??2,h=i-d*u,f=!1!==a.showBand,y=a.fill||"#6366f1",p=a.fillOpacity??.1,m=a.anomalyColor||"#ef4444",g=a.anomalyRadius??6,b=r(i+d*u),x=r(h),v=e.filter(e=>{const n=e[t];return null!=n&&Math.abs(n-i)>d*u});return Or("g",{children:[f&&jr("rect",{x:0,y:Math.min(b,x),width:c.width||0,height:Math.abs(x-b),fill:y,fillOpacity:p}),v.map((e,t)=>{const n=$r(e,c),r=Mr(e,c);return null==n||null==r?null:jr("circle",{cx:n,cy:r,r:g,fill:m,fillOpacity:.7,stroke:m,strokeWidth:1.5},"anomaly-"+t)}),a.label&&jr("text",{x:(c.width||0)-4,y:Math.min(b,x)-4,textAnchor:"end",fill:y,fontSize:11,children:a.label})]},"ann-"+s)}case"forecast":{const r=c.data||[];if(3>r.length)return null;const o=c.xAccessor||"x",l=c.yAccessor||"y",u=c.scales?.x??c.scales?.time,d=c.scales?.y??c.scales?.value;if(!u||!d)return null;const h=r.map(e=>[e[o],e[l]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]);if(3>h.length)return null;let f;if("polynomial"===(a.method||"linear")){const e=i(h,a.order||2).equation;f=t=>e.reduce((e,n,r)=>e+n*Math.pow(t,r),0)}else{const e=t(h);if(!e)return null;f=e}const y=h.length,{se:p,meanX:m,ssX:g}=n(h,f),b=e(a.confidence??.95),x=a.steps??5,v=h[y-1][0],k=(v-h[0][0])/Math.max(y-1,1),w=[];for(let e=1;x>=e;e++)w.push(v+e*k);const $=[];for(const e of w){const t=f(e),n=p*Math.sqrt(1+1/y+(g>0?(e-m)**2/g:0))*b;$.push({x:e,yCenter:t,yUpper:t+n,yLower:t-n})}const M=`M${$.map(e=>`${u(e.x)},${d(e.yUpper)}`).join(" L")} L${$.slice().reverse().map(e=>`${u(e.x)},${d(e.yLower)}`).join(" L")} Z`,A=$.map(e=>`${u(e.x)},${d(e.yCenter)}`).join(" "),S=`${u(v)},${d(f(v))}`,W=a.strokeColor||"#6366f1";return Or("g",{children:[jr("path",{d:M,fill:a.fill||"#6366f1",fillOpacity:a.fillOpacity??.15,stroke:"none"}),jr("polyline",{points:`${S} ${A}`,fill:"none",stroke:W,strokeWidth:a.strokeWidth??2,strokeDasharray:a.strokeDasharray??"6,3"}),a.label&&$.length>0&&jr("text",{x:u($[$.length-1].x)+4,y:d($[$.length-1].yCenter)-4,fill:W,fontSize:11,children:a.label})]},"ann-"+s)}case"widget":{let e,t;if(null!=a.px&&null!=a.py)e=a.px,t=a.py;else{const n=Wr(a,s,c);if(!n)return null;e=n.x,t=n.y}if(!Cr(e,t,c))return null;const n=a.dx??0,r=a.dy??0,o=a.width??32,i=a.height??32,u=a.content??jr("span",{style:{fontSize:18,cursor:"default"},title:a.label||"Info",children:"ℹ️"});return jr("foreignObject",{x:e+n-o/2,y:t+r-i/2,width:o,height:i,style:{overflow:"visible",pointerEvents:"auto"},children:jr("div",{...B(a,l),style:{width:o,height:i,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},"ann-"+s)}case"text":{const e=Wr(a,s,c);if(!e)return null;const{x:t,y:n}=e,r=t+(a.dx||0),o=n+(a.dy||0),i=a.color||"var(--semiotic-text, #333)",l=jr("text",{x:r,y:o,fill:i,fontSize:a.fontSize||11,opacity:a.opacity,strokeDasharray:a.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:a.label});return!0!==a._redundantConnector?nr.cloneElement(l,{key:"ann-text-"+s}):Or("g",{opacity:a.opacity,strokeDasharray:a.strokeDasharray,children:[jr("line",{x1:t,y1:n,x2:r,y2:o,stroke:i,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),nr.cloneElement(l,{opacity:void 0,strokeDasharray:void 0})]},"ann-text-"+s)}case"category-highlight":{const e=a.category;if(null==e)return null;const t=e=>"function"==typeof e&&"function"==typeof e.bandwidth,n=c.scales?.o,r=c.scales?.x,o=c.scales?.y,i=t(n)?n:t(r)?r:t(o)?o:null;if(!i)return null;const l=i(e+"");if(null==l)return null;const u=i.bandwidth(),d=a.color||"var(--semiotic-primary, #4589ff)",h=a.opacity??.15,f=a.label;return Or("g",(c.projection?"vertical"===c.projection:i===r)?{children:[jr("rect",{x:l,y:0,width:u,height:c.height||0,fill:d,fillOpacity:h}),f&&jr(q,{x:l+u/2,y:16,textAnchor:"middle",fill:d,fontSize:12,fontWeight:"bold",text:f,background:a.labelBackground??"none"})]}:{children:[jr("rect",{x:0,y:l,width:c.width||0,height:u,fill:d,fillOpacity:h}),f&&jr(q,{x:12,y:l+u/2,dominantBaseline:"middle",fill:d,fontSize:12,fontWeight:"bold",text:f,background:a.labelBackground??"none"})]},"ann-"+s)}default:return null}var u,d,h}}var Rr=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),Pr=new Set(["label","callout","callout-circle","callout-rect"]);function zr(e){return"string"==typeof e?.type?e.type:""}function Fr(e){return!!e&&"object"==typeof e&&Rr.has(zr(e))}function Tr(e){return Pr.has(zr(e))&&!function(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}(e)}function Dr(e){return"primary"===e?.emphasis||!0===e?.defensive}function Br(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 Er(e){let t;const n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;const r=e?.provenance?.confidence;switch("number"==typeof r&&Number.isFinite(r)&&(t+=15*Math.max(0,Math.min(1,r))),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}var Gr=32,Hr=6,_r=4,Vr=8,qr=72;var Yr={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};function Ur(e){if(!Zr(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 Zr(e){return Fr(e)}function Xr(e,t){if(!e)return[];const n=Math.max(1,Math.floor(t/7)),r=e.split(/\s+/).filter(Boolean),o=[];let i="";for(const e of r)i&&i.length+e.length+1>n?(o.push(i),i=e):i=i?`${i} ${e}`:e;return i&&o.push(i),o}function Kr(e,t,n,r,o){const i=e+n,a=t+r;return Math.abs(n)>Math.abs(r)?{x:0>n?i-o.width-4:i+4,y:0>r?a-o.height:a,width:o.width,height:o.height}:{x:0>n?i-o.width:i,y:0>r?a-o.height-4:a+4,width:o.width,height:o.height}}function Jr(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function Qr(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 eo(e,t,n,r,o,i,a,l){const s=Jr(e,a);let c=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,n,r){const o=Math.max(0,r-e.x),i=Math.max(0,r-e.y);return(o+Math.max(0,e.x+e.width-(t-r)))*e.height+(i+Math.max(0,e.y+e.height-(n-r)))*e.width}(s,o,i,l);for(const e of n)c+=12*Qr(s,e);for(const e of r)c+=4*Qr(s,e);return c}function to(e){const{annotations:t,context:n,defaultOffset:r=Gr,notePadding:o=Hr,markPadding:i=_r,edgePadding:a=Vr,preserveManualOffsets:l=!0,routeLongConnectors:s=!0,connectorThreshold:c=qr,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:y,cohesion:p,audience:m}=e,g=n.width||0,b=n.height||0,x="object"==typeof y?y:{},v=x.breakpoint??480,k=!!y&&v>=g,w=k&&!1!==x.preferShortText?t.map(Ur):t,$=k&&!u?{maxAnnotations:x.maxAnnotations??("callout-list"===x.strategy?1:2),minVisible:x.minVisible??1}:u,M=d||k&&(!1!==x.progressiveDisclosure||"callout-list"===x.strategy),A=k&&!f?x.responsive??{minWidth:v}:f,S=k&&!p?x.cohesion:p;if(0===w.length||0>=g||0>=b)return w.slice();const W=[],C=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 j=!1;const O=w.map((e,t)=>{if(!Zr(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 r=e.pointId??e.nodeId;if(null!=r&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===r);if(e)return{x:e.x,y:e.y}}const o=e.coordinates,i=n.scales?.geoProjection;if(Array.isArray(o)&&o.length>=2&&i){const e=o[0],t=o[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=[...Xr("string"==typeof e.title?e.title:void 0,t),...Xr("string"==typeof e.label?e.label:void 0,t)],r=n.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(t,7*r)+10),height:Math.max(18,16*n.length+6)}}(e);if(l&&("number"==typeof(d=e).dx||"number"==typeof d.dy)){const t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e);return W.push(Jr(Kr(i.x,i.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,u),o)),e}var d;let h=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}]}(r)){const t=eo(Kr(i.x,i.y,e.dx,e.dy,u),e,W,C,g,b,o,a);f>t&&(h=e,f=t)}if(!h)return e;const y=Jr(Kr(i.x,i.y,h.dx,h.dy,u),o);W.push(y);const p=Math.hypot(h.dx,h.dy),m=s&&p>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return j=!0,{...e,dx:h.dx,dy:h.dy,...m?{connector:m}:{}}}),I=j?O:w.slice();let N=I;if(h){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});N=e?t:I}{let e=!1;const t=N.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?Yr[t.source]??t.source:null,r="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!r)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const o=[n,r].filter(Boolean).join(" · "),i="string"==typeof e.label?e.label:"";return i.includes(`(${o})`)?e:{...e,label:i?`${i} (${o})`:`(${o})`}}(t);return n!==t&&(e=!0),n});N=e?t:N}const L=new Set;if($){const e="object"==typeof $?$:{},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??Br(g,b,e))*t))},{deferred:r}=function(e){const{annotations:t,width:n,height:r}=e,o=Math.max(0,e.minVisible??1),i=Br(n,r,e),a=t.map((e,t)=>{return{annotation:e,index:t,note:(n=e,Fr(n))};var n}),l=a.filter(e=>e.note);if(0===l.length||i>=l.length)return{visible:t.slice(),deferred:[],budget:i};const s=l.filter(e=>Dr(e.annotation)),c=l.filter(e=>!Dr(e.annotation)).sort((e,t)=>Er(t.annotation)-Er(e.annotation)||e.index-t.index),u=Math.min(c.length,Math.max(Math.max(0,i-s.length),Math.max(0,o-s.length))),d=new Set([...s.map(e=>e.index),...c.slice(0,u).map(e=>e.index)]),h=[],f=[];for(const{annotation:e,index:t,note:n}of a)!n||d.has(t)?h.push(e):f.push(e);return{visible:h,deferred:f,budget:i}}({annotations:N,width:g,height:b,...n});for(const e of r)L.add(e)}if(A&&("object"==typeof A&&"number"==typeof A.minWidth?A.minWidth:480)>=g)for(const e of N)Zr(e)&&"secondary"===e.emphasis&&L.add(e);if(L.size>0)for(const e of N)!0===e?.defensive&&L.delete(e);let R;return R=0===L.size?N:M?N.map(e=>L.has(e)?{...e,_annotationDeferred:!0}:e):N.filter(e=>!L.has(e)),S?function(e,t){let n=!1;const r=e.map(e=>Zr(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?r:e}(R,S):R}import*as no from"react";function ro(e){return(e.tl??0)>0||(e.tr??0)>0||(e.br??0)>0||(e.bl??0)>0}function oo(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,r=e=>Math.max(0,Math.min(e??0,n));return{tl:r(t.tl),tr:r(t.tr),br:r(t.br),bl:r(t.bl)}}import{symbol as io,symbolCircle as ao,symbolCross as lo,symbolDiamond as so,symbolSquare as co,symbolStar as uo,symbolTriangle as ho,symbolWye as fo}from"d3-shape";var yo={circle:ao,square:co,triangle:ho,diamond:so,star:uo,cross:lo,wye:fo},po=["circle","triangle","diamond","star","square","chevron","cross","wye"];function mo(e,t,n){if(n)return n;const r=e??"circle";return"chevron"===r?function(e){const t=1.5*go(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):io(yo[r]??ao,Math.max(1,t))()??""}function go(e){return Math.sqrt(Math.max(1,e)/Math.PI)}function bo(e,t){const n=new Map;let r=0;return o=>{const i=e(o)+"",a=t?.[i];if(a)return a;let l=n.get(i);return l||(l=po[r%po.length],r++,n.set(i,l)),l}}import{jsx as xo,jsxs as vo}from"react/jsx-runtime";var ko={innerRadius:0,outerRadius:0,startAngle:0,endAngle:0};function wo(e,t="#4e79a7"){return j(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function $o(e){const t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?"s_"+t:t}function Mo(e,t,n,r){const o=e.glyph;if(!o?.parts?.length||0>=e.size)return null;const i=d(o,e.size);if(0>=i.scale)return null;const a=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${i.offsetX},${i.offsetY}) scale(${i.scale})`,l=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),s=u(o,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=s?$o(r+"-clip"):void 0,f=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),y=t=>o.parts.map((n,r)=>{const o=t?"none"===n.fill?void 0:t:h(n.fill,l,e.accent),i=t?n.stroke&&"none"!==n.stroke?t:void 0:h(n.stroke??"none",l,e.accent);return o||i?xo("path",{d:n.d,fill:o??"none",stroke:i,strokeWidth:i?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},r):null});return vo("g",{transform:a,opacity:1===f?void 0:f,children:[s&&c&&xo("clipPath",{id:c,children:xo("rect",{x:s.x,y:s.y,width:s.width,height:s.height})}),s&&e.ghostColor?xo("g",{children:y(e.ghostColor)}):null,s&&c?xo("g",{clipPath:`url(#${c})`,children:y()}):y()]},r)}function Ao(e,t){const n=e.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity))).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color??t,opacity:null==e.opacity?void 0:Math.max(0,Math.min(1,e.opacity))}));return 2>n.length?null:n.map((e,t)=>xo("stop",{offset:e.offset,stopColor:e.color,stopOpacity:e.opacity},t))}function So(e,t,n){const r=mo(e.symbolType,e.size,e.path);return xo("path",{d:r,transform:e.rotation?`translate(${e.x},${e.y}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.x},${e.y})`,fill:e.style.fill?wo(e.style.fill):"none",fillOpacity:e.style.fillOpacity,opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},`${n??""}symbol-${t}`)}import{jsx as Wo,jsxs as Co}from"react/jsx-runtime";function jo(e,t){switch(e.type){case"geoarea":{const n=e;if(!n.pathData)return null;const r=j(n.style.fill)?L(n.style.fill,`geoarea-${t}-hatch`):void 0;return Co(no.Fragment,{children:[r&&Wo("defs",{children:r}),Wo("path",{d:n.pathData,fill:r?`url(#geoarea-${t}-hatch)`:wo(n.style.fill,"#e0e0e0"),fillOpacity:n.style.fillOpacity??1,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth||.5,strokeDasharray:n.style.strokeDasharray,opacity:n._decayOpacity??1})]},"geoarea-"+t)}case"point":{const n=e,r=j(n.style.fill)?L(n.style.fill,`geopoint-${t}-hatch`):void 0;return Co(no.Fragment,{children:[r&&Wo("defs",{children:r}),Wo("circle",{cx:n.x,cy:n.y,r:n.r,fill:r?`url(#geopoint-${t}-hatch)`:wo(n.style.fill),fillOpacity:n.style.fillOpacity??.8,stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,opacity:n._decayOpacity??n.style.opacity??1})]},"point-"+t)}case"line":{const n=e;if(2>n.path.length)return null;const r="M"+n.path.map(e=>`${e[0]},${e[1]}`).join("L");return Wo("path",{d:r,fill:"none",stroke:n.style.stroke||"#4e79a7",strokeWidth:n.style.strokeWidth||1.5,strokeDasharray:n.style.strokeDasharray,opacity:n.style.opacity??1},"line-"+t)}case"glyph":return Mo(e,e.x,e.y,"geo-glyph-"+(e.pointId??t));default:return null}}import*as Oo from"react";import{arc as Io}from"d3-shape";var No=(e,t)=>({x:e*Math.cos(t),y:e*Math.sin(t)});function Lo(e){const{innerRadius:t,outerRadius:n,startAngle:r,endAngle:o}=e,i=0>=t;if(0>=(e.cornerRadius??0)||!e.roundStart&&!e.roundEnd){if(i){const e=No(n,r),t=No(n,o);return`M0,0 L${e.x},${e.y} A${n},${n} 0 ${o-r>Math.PI?1:0} 1 ${t.x},${t.y} Z`}const e=No(n,r),a=No(n,o),l=No(t,o),s=No(t,r),c=o-r>Math.PI?1:0;return`M${e.x},${e.y} A${n},${n} 0 ${c} 1 ${a.x},${a.y} L${l.x},${l.y} A${t},${t} 0 ${c} 0 ${s.x},${s.y} Z`}const a=Math.max(0,Math.min(e.cornerRadius??0,(n-t)/2));if(0===a)return Lo({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});const l=Math.asin(Math.min(1,a/Math.max(1e-9,n-a))),s=i?0:Math.asin(Math.min(1,a/Math.max(1e-9,t+a))),c=o-r,u=e.roundStart&&e.roundEnd?c/2:c,d=!!e.roundStart&&u>l,h=!!e.roundEnd&&u>l;if(!d&&!h)return Lo({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});const f=r+(d?l:0),y=o-(h?l:0),p=r+(d?s:0),m=o-(h?s:0),g=No(n,f),b=No(n,y),x=(n-a)*Math.cos(l),v=No(x,r),k=No(x,o),w=i?null:No(t,m),$=i?null:No(t,p),M=i?0:(t+a)*Math.cos(s),A=i?null:No(M,r),S=i?null:No(M,o),W=y-f>Math.PI?1:0,C=i?0:m-p>Math.PI?1:0;let j="";if(d)j+=`M${v.x},${v.y}`,j+=` A${a},${a} 0 0 1 ${g.x},${g.y}`;else{const e=No(n,r);j+=`M${e.x},${e.y}`}if(h)j+=` A${n},${n} 0 ${W} 1 ${b.x},${b.y}`,j+=` A${a},${a} 0 0 1 ${k.x},${k.y}`;else{const e=No(n,o);j+=` A${n},${n} 0 ${W} 1 ${e.x},${e.y}`}if(i)j+=" L0,0";else{if(h)j+=` L${S.x},${S.y}`,j+=` A${a},${a} 0 0 1 ${w.x},${w.y}`;else{const e=No(t,o);j+=` L${e.x},${e.y}`}if(d)j+=` A${t},${t} 0 ${C} 0 ${$.x},${$.y}`,j+=` A${a},${a} 0 0 1 ${A.x},${A.y}`;else{const e=No(t,r);j+=` A${t},${t} 0 ${C} 0 ${e.x},${e.y}`}}return j+=" Z",j}function Ro(e){const t=Lo({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,cornerRadius:e.cornerRadius,roundStart:e.roundStart,roundEnd:e.roundEnd}),n=[],r=e.colors;if(r.length>0){const t=(e.endAngle-e.startAngle)/r.length;for(let o=0;r.length>o;o++)n.push({d:Lo({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle+o*t,endAngle:e.endAngle}),color:r[o]})}return{clipPath:t,slices:n}}import{jsx as Po,jsxs as zo}from"react/jsx-runtime";function Fo(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function To(e,t){const n=e.datum;if(!n)return null;const r=[],o=n.__funnelStepLabel,i=Number(n.__funnelStepLabelX),a=Number(n.__funnelStepLabelY),l=Number(n.__funnelRowWidth);"string"!=typeof o||!Number.isFinite(i)||!Number.isFinite(a)||Number.isFinite(l)&&8.4*o.length+16>l||r.push(Po("text",{x:i,y:a+3,textAnchor:"middle",dominantBaseline:"hanging",fontSize:14,fontWeight:"bold",fill:"#fff",stroke:"rgba(0,0,0,0.6)",strokeWidth:3,paintOrder:"stroke",children:o},t+"-funnel-step"));const s=Number(n.__funnelValue),c=Number(n.__funnelValueLabelX),u=Number(n.__funnelValueLabelY),d=Number(n.__funnelBarW);if(Number.isFinite(s)&&0!==s&&Number.isFinite(c)&&Number.isFinite(u)&&d>=60){const e=Number(n.__funnelPercent);let o=!0!==n.__funnelIsFirstStep&&Number.isFinite(e)?`${Fo(s)} (${.05>Math.abs(e-Math.round(e))?Math.round(e):e.toFixed(1)}%)`:Fo(s);7.8*o.length+16>d&&(o=Fo(s)),7.8*o.length+16>d||r.push(Po("text",{x:c,y:u+22,textAnchor:"middle",dominantBaseline:"hanging",fontSize:13,fontWeight:"bold",fill:"#fff",stroke:"rgba(0,0,0,0.5)",strokeWidth:3,paintOrder:"stroke",children:o},t+"-funnel-value"))}return r.length?Po("g",{children:r},t+"-funnel-labels"):null}function Do(e,t,n){const r=("category"in e?e.category:void 0)||("group"in e?e.group:void 0)||"",o=n=>`ord-${e.type}-${r}-${t}-${n}`,i=`ord-${e.type}-${r}-${t}`;switch(e.type){case"rect":{const t=e,n=$o(i)+"-grad",r=function(e,t){const n=e.fillGradient;if(!n||"object"!=typeof n)return null;let r=e.x,o=e.y,i=e.x,a=e.y+e.h;"bottom"===e.roundedEdge?(o=e.y+e.h,a=e.y):"right"===e.roundedEdge?(r=e.x+e.w,o=e.y,i=e.x,a=e.y):"left"===e.roundedEdge&&(r=e.x,o=e.y,i=e.x+e.w,a=e.y);const l=Ao(n.stops,wo(e.style.fill));return l?xo("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:r,y1:o,x2:i,y2:a,children:l}):null}(t,n);let o,a;if(r)a=`url(#${n})`;else if(j(t.style.fill)){const e=$o(i)+"-hatch";o=L(t.style.fill,e),a=`url(#${e})`}else a=wo(t.style.fill);const l=r||o?zo("defs",{children:[r,o]}):null;if(t.cornerRadii&&ro(t.cornerRadii)){const e=function(e){const{x:t,y:n,w:r,h:o}=e,{tl:i,tr:a,br:l,bl:s}=oo(e);let c=`M${t+i},${n}`;return c+=` L${t+r-a},${n}`,a>0&&(c+=` A${a},${a} 0 0 1 ${t+r},${n+a}`),c+=` L${t+r},${n+o-l}`,l>0&&(c+=` A${l},${l} 0 0 1 ${t+r-l},${n+o}`),c+=` L${t+s},${n+o}`,s>0&&(c+=` A${s},${s} 0 0 1 ${t},${n+o-s}`),c+=` L${t},${n+i}`,i>0&&(c+=` A${i},${i} 0 0 1 ${t+i},${n}`),c+=" Z",c}(t);return zo(Oo.Fragment,{children:[l,Po("path",{d:e,fill:a,opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth})]},i)}if(t.roundedTop&&t.roundedTop>0){const e=Math.min(t.roundedTop,t.w/2,t.h/2),{x:n,y:r,w:o,h:s}=t;let c;switch(t.roundedEdge){case"right":c=`M${n},${r} L${n+o-e},${r} A${e},${e} 0 0 1 ${n+o},${r+e} L${n+o},${r+s-e} A${e},${e} 0 0 1 ${n+o-e},${r+s} L${n},${r+s} Z`;break;case"left":c=`M${n+o},${r} L${n+e},${r} A${e},${e} 0 0 0 ${n},${r+e} L${n},${r+s-e} A${e},${e} 0 0 0 ${n+e},${r+s} L${n+o},${r+s} Z`;break;case"bottom":c=`M${n},${r} L${n+o},${r} L${n+o},${r+s-e} A${e},${e} 0 0 1 ${n+o-e},${r+s} L${n+e},${r+s} A${e},${e} 0 0 1 ${n},${r+s-e} Z`;break;default:c=`M${n},${r+s} L${n},${r+e} A${e},${e} 0 0 1 ${n+e},${r} L${n+o-e},${r} A${e},${e} 0 0 1 ${n+o},${r+e} L${n+o},${r+s} Z`}return zo(Oo.Fragment,{children:[l,Po("path",{d:c,fill:a,opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth})]},i)}return zo(Oo.Fragment,{children:[l,Po("rect",{x:t.x,y:t.y,width:t.w,height:t.h,fill:a,opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth}),To(t,i)]},i)}case"point":{const t=e;return Po("circle",{cx:t.x,cy:t.y,r:t.r,fill:wo(t.style.fill),opacity:t.style.opacity??t.style.fillOpacity??.8,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},i)}case"symbol":return So(e,t,n);case"glyph":return Mo(e,e.x,e.y,`${n??""}ord-glyph-${e.pointId??t}`);case"wedge":{const r=e;if(r._gradientBand&&r._gradientBand.colors.length>0){const e=$o(`${n?n+"-":""}gauge-grad-${r.category||i}-${t}`),{clipPath:o,slices:a}=Ro({innerRadius:r.innerRadius,outerRadius:r.outerRadius,startAngle:r.startAngle,endAngle:r.endAngle,cornerRadius:r.cornerRadius,roundStart:r.roundedEnds?.start??!0,roundEnd:r.roundedEnds?.end??!0,colors:r._gradientBand.colors});return zo("g",{transform:`translate(${r.cx},${r.cy})`,opacity:r.style.opacity,fillOpacity:r.style.fillOpacity,children:[Po("defs",{children:Po("clipPath",{id:e,children:Po("path",{d:o})})}),Po("g",{clipPath:`url(#${e})`,children:a.map((e,t)=>Po("path",{d:e.d,fill:wo(e.color)},t))}),r.style.stroke&&"none"!==r.style.stroke&&Po("path",{d:o,fill:"none",stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},i)}let o;if(r.roundedEnds)o=Lo({innerRadius:r.innerRadius,outerRadius:r.outerRadius,startAngle:r.startAngle,endAngle:r.endAngle,cornerRadius:r.cornerRadius,roundStart:r.roundedEnds.start,roundEnd:r.roundedEnds.end});else{const e=Io().innerRadius(r.innerRadius).outerRadius(r.outerRadius).startAngle(r.startAngle+Math.PI/2).endAngle(r.endAngle+Math.PI/2);r.cornerRadius&&e.cornerRadius(r.cornerRadius),o=e(ko)||""}return Po("path",{d:o,transform:`translate(${r.cx},${r.cy})`,fill:wo(r.style.fill),stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,opacity:r.style.opacity},i)}case"boxplot":{const t=e,n=t.columnWidth/2;return zo("g","vertical"===t.projection?{children:[Po("line",{x1:t.x,y1:t.minPos,x2:t.x,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:1}),Po("rect",{x:t.x-n,y:Math.min(t.q1Pos,t.q3Pos),width:t.columnWidth,height:Math.abs(t.q3Pos-t.q1Pos),fill:wo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:1}),Po("line",{x1:t.x-n,y1:t.medianPos,x2:t.x+n,y2:t.medianPos,stroke:t.style.stroke||"#333",strokeWidth:2}),Po("line",{x1:t.x-.5*n,y1:t.minPos,x2:t.x+.5*n,y2:t.minPos,stroke:t.style.stroke||"#333",strokeWidth:1}),Po("line",{x1:t.x-.5*n,y1:t.maxPos,x2:t.x+.5*n,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:1})]}:{children:[Po("line",{x1:t.minPos,y1:t.y,x2:t.maxPos,y2:t.y,stroke:t.style.stroke||"#333",strokeWidth:1}),Po("rect",{x:Math.min(t.q1Pos,t.q3Pos),y:t.y-n,width:Math.abs(t.q3Pos-t.q1Pos),height:t.columnWidth,fill:wo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:1}),Po("line",{x1:t.medianPos,y1:t.y-n,x2:t.medianPos,y2:t.y+n,stroke:t.style.stroke||"#333",strokeWidth:2}),Po("line",{x1:t.minPos,y1:t.y-.5*n,x2:t.minPos,y2:t.y+.5*n,stroke:t.style.stroke||"#333",strokeWidth:1}),Po("line",{x1:t.maxPos,y1:t.y-.5*n,x2:t.maxPos,y2:t.y+.5*n,stroke:t.style.stroke||"#333",strokeWidth:1})]},i)}case"violin":{const t=e,n=[Po("path",{d:t.pathString,transform:t.translateX||t.translateY?`translate(${t.translateX},${t.translateY})`:void 0,fill:wo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:t.style.strokeWidth||1},o("path"))];if(t.iqrLine&&t.bounds){const e=t.bounds,r=e.x+e.width/2,i=e.y+e.height/2;t.iqrLine.isVertical?n.push(Po("line",{x1:r,y1:t.iqrLine.q1Pos,x2:r,y2:t.iqrLine.q3Pos,stroke:t.style.stroke||"#333",strokeWidth:2},o("iqr")),Po("circle",{cx:r,cy:t.iqrLine.medianPos,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},o("med"))):n.push(Po("line",{x1:t.iqrLine.q1Pos,y1:i,x2:t.iqrLine.q3Pos,y2:i,stroke:t.style.stroke||"#333",strokeWidth:2},o("iqr")),Po("circle",{cx:t.iqrLine.medianPos,cy:i,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},o("med")))}return Po("g",{children:n},i)}case"connector":return Po("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.style.stroke||"#999",strokeWidth:e.style.strokeWidth||1,opacity:e.style.opacity??.5},i);case"trapezoid":{const t=e,n=t.points.map(e=>`${e[0]},${e[1]}`).join(" ");return Po("polygon",{points:n,fill:wo(t.style.fill,"#999"),opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},i)}default:return null}}import*as Bo from"react";import{area as Eo,line as Go}from"d3-shape";function Ho(e,t){const n=e.fillStyle,r="#010203";try{e.fillStyle=r,e.fillStyle=t}catch{return e.fillStyle=n,[78,121,167]}const o=e.fillStyle;if(e.fillStyle=n,"string"!=typeof o)return[78,121,167];if(o.toLowerCase()===r&&t.trim().toLowerCase()!==r)return[78,121,167];if(o.startsWith("#"))return[parseInt(o.slice(1,3),16),parseInt(o.slice(3,5),16),parseInt(o.slice(5,7),16)];const i=o.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return i?[+i[1],+i[2],+i[3]]:[78,121,167]}import{curveMonotoneX as _o,curveMonotoneY as Vo,curveCardinal as qo,curveCatmullRom as Yo,curveStep as Uo,curveStepBefore as Zo,curveStepAfter as Xo,curveBasis as Ko,curveNatural as Jo}from"d3-shape";function Qo(e){switch(e){case"monotoneX":return _o;case"monotoneY":return Vo;case"cardinal":return qo;case"catmullRom":return Yo;case"step":return Uo;case"stepBefore":return Zo;case"stepAfter":return Xo;case"basis":return Ko;case"natural":return Jo;default:return null}}function ei(e,t,n){if(null==t)return n;if(j(t)){const r=function(e,t){const n=e.background??"transparent",r=e.stroke??"#000",o="transparent"===n||"none"===n?n:A(t,n)||n,i=A(t,r)||r||"#000",a="undefined"!=typeof window&&window.devicePixelRatio||1,l=`${O(e)}|${o}|${i}@${a}`,s=N.get(l);if(void 0!==s)return s;const c=x({background:o,stroke:i,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle},t),u=j(c)?null:c;return N.set(l,u),u}(t,e);return r||t.background&&A(e,t.background)||n}return"string"!=typeof t?t:A(e,t)||n}function ti(e,t){if(null==t)return;const n=ei(e,t,"");return""===n?void 0:n}function ni(e,t,n,r,o,i,a){const l=t.stops.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity)));if(2>l.length)return null;const s=e.createLinearGradient(r,o,i,a);for(const t of l)s.addColorStop(Math.max(0,Math.min(1,t.offset)),ri(e,t,n));return s}function ri(e,t,n){const r=t.color??n,o=A(e,r)||r;if(null==t.opacity)return o;const i=Math.max(0,Math.min(1,t.opacity)),[a,l,s]=Ho(e,o);return`rgba(${a},${l},${s},${i})`}function oi(e,t,n,r){t.fill&&(e.fillStyle=ei(e,t.fill,n),void 0!==t.fillOpacity&&(e.globalAlpha=(t.opacity??1)*t.fillOpacity),r())}function ii(e,t,n){t.stroke&&"none"!==t.stroke&&(e.strokeStyle=A(e,t.stroke)||t.stroke,e.lineWidth=t.strokeWidth??1,e.globalAlpha=(t.opacity??1)*(t.strokeOpacity??1),n())}function ai(e,t,n){let r=n;for(const n of t)"lesser"===n.thresholdType?n.value>e&&(r=n.color):e>n.value&&(r=n.color);return r}function li(e,t,n,r){if(2>e.length||t.length!==e.length||0===n.length)return[];const o=[],i=(e,t,n)=>{const r=o[o.length-1];r?.color===e?r.path.push(n):o.push({color:e,path:[t,n]})};for(let o=1;e.length>o;o++){const[a,l]=e[o-1],[s,c]=e[o],u=t[o-1],d=t[o]-u,h=[0,...0===d?[]:n.map(({value:e})=>(e-u)/d).filter(e=>e>0&&1>e&&Number.isFinite(e)).sort((e,t)=>e-t).filter((e,t,n)=>0===t||e!==n[t-1]),1];for(let e=1;h.length>e;e++){const t=h[e-1],o=h[e];i(ai(u+d*((t+o)/2),n,r),[a+(s-a)*t,l+(c-l)*t],[a+(s-a)*o,l+(c-l)*o])}}return o}import*as si from"react";import{arc as ci}from"d3-shape";import{jsx as ui,jsxs as di}from"react/jsx-runtime";function hi(e,t){switch(e.type){case"circle":{const n=e,r=j(n.style.fill)?L(n.style.fill,`net-circle-${t}-hatch`):void 0;return di(si.Fragment,{children:[r&&ui("defs",{children:r}),ui("circle",{cx:n.cx,cy:n.cy,r:n.r,fill:r?`url(#net-circle-${t}-hatch)`:wo(n.style.fill),stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,fillOpacity:n.style.fillOpacity,strokeOpacity:n.style.strokeOpacity,opacity:n.style.opacity})]},"net-circle-"+t)}case"rect":{const n=e,r=j(n.style.fill)?L(n.style.fill,`net-rect-${t}-hatch`):void 0;return di(si.Fragment,{children:[r&&ui("defs",{children:r}),ui("rect",{x:n.x,y:n.y,width:n.w,height:n.h,fill:r?`url(#net-rect-${t}-hatch)`:wo(n.style.fill),stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,fillOpacity:n.style.fillOpacity,strokeOpacity:n.style.strokeOpacity,opacity:n.style.opacity})]},"net-rect-"+t)}case"arc":{const n=e,r=ci().innerRadius(n.innerR).outerRadius(n.outerR).startAngle(n.startAngle+Math.PI/2).endAngle(n.endAngle+Math.PI/2)(ko)||"",o=j(n.style.fill)?L(n.style.fill,`net-arc-${t}-hatch`):void 0;return di(si.Fragment,{children:[o&&ui("defs",{children:o}),ui("path",{d:r,transform:`translate(${n.cx},${n.cy})`,fill:o?`url(#net-arc-${t}-hatch)`:wo(n.style.fill),stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,fillOpacity:n.style.fillOpacity,strokeOpacity:n.style.strokeOpacity,opacity:n.style.opacity})]},"net-arc-"+t)}case"symbol":{const n=e,r=mo(n.symbolType,n.size,n.path);return ui("path",{d:r,transform:n.rotation?`translate(${n.cx},${n.cy}) rotate(${180*n.rotation/Math.PI})`:`translate(${n.cx},${n.cy})`,fill:n.style.fill?wo(n.style.fill):"none",stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,fillOpacity:n.style.fillOpacity,strokeOpacity:n.style.strokeOpacity,opacity:n.style.opacity},"net-symbol-"+t)}case"glyph":return Mo(e,e.cx,e.cy,"net-glyph-"+(e.id??t));default:return null}}function fi(e,t){switch(e.type){case"line":return ui("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.style.stroke||"#999",strokeWidth:e.style.strokeWidth||1,opacity:e.style.opacity},"net-edge-"+t);case"bezier":{const n=e,r=`net-bezier-${t}-hatch`,o=j(n.style.fill)?L(n.style.fill,r):void 0;return di(si.Fragment,{children:[o&&ui("defs",{children:o}),ui("path",{d:n.pathD,fill:o?`url(#${r})`:wo(n.style.fill,"#999"),fillOpacity:n.style.fillOpacity,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth,opacity:n.style.opacity})]},"net-edge-"+t)}case"ribbon":{const n=e,r=`net-ribbon-${t}-hatch`,o=j(n.style.fill)?L(n.style.fill,r):void 0;return di(si.Fragment,{children:[o&&ui("defs",{children:o}),ui("path",{d:n.pathD,fill:o?`url(#${r})`:wo(n.style.fill,"#999"),fillOpacity:n.style.fillOpacity,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth,opacity:n.style.opacity})]},"net-edge-"+t)}case"curved":{const n=e;return ui("path",{d:n.pathD,fill:wo(n.style.fill,"none"),stroke:n.style.stroke||"#999",strokeWidth:n.style.strokeWidth||1,opacity:n.style.opacity},"net-edge-"+t)}default:return null}}function yi(e,t){return ui("text",{x:e.x,y:e.y,textAnchor:e.anchor||"middle",dominantBaseline:e.baseline||"auto",fontSize:e.fontSize||11,fontWeight:e.fontWeight,fill:e.fill||"var(--semiotic-text, #333)",stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:e.paintOrder,children:e.text},"net-label-"+t)}import{jsx as pi,jsxs as mi}from"react/jsx-runtime";function gi(e,t,n,r){if(!e||2>t.length)return null;const o=Ao(e.stops,r);return o?pi("linearGradient",{id:n,gradientUnits:"userSpaceOnUse",x1:t[0][0],y1:0,x2:t[t.length-1][0],y2:0,children:o}):null}function bi(e,t,n){switch(e.type){case"line":{const r=e;if(0===r.path.length)return null;const o=Qo(r.curve),i=o?Go().x(([e])=>e).y(([,e])=>e).curve(o)(r.path)??"":"M"+r.path.map(([e,t])=>`${e},${t}`).join("L"),a=$o(`${n?n+"-":""}line-${t}-stroke-gradient`),l=gi(r.strokeGradient,r.path,a,r.style.stroke||"#4e79a7");return mi(Bo.Fragment,{children:[l&&pi("defs",{children:l}),pi("path",{d:i,fill:"none",stroke:l?`url(#${a})`:r.style.stroke||"#4e79a7",strokeWidth:r.style.strokeWidth||2,strokeDasharray:r.style.strokeDasharray,opacity:r.style.opacity})]},"line-"+t)}case"area":{const r=e;if(0===r.topPath.length)return null;const o=Qo(r.curve),i=!o||2>r.topPath.length||2>r.bottomPath.length?`M${r.topPath.map(([e,t])=>`${e},${t}`).join("L")}L${[...r.bottomPath].reverse().map(([e,t])=>`${e},${t}`).join("L")}Z`:Eo().x(([e])=>e).y0((e,t)=>r.bottomPath[t][1]).y1(([,e])=>e).curve(o)(r.topPath)??"",a=`${n?n+"-":""}area-${t}-hatch`,l=j(r.style.fill)?L(r.style.fill,a):void 0,s=$o(`${n?n+"-":""}area-${t}-gradient`),c=function(e,t){const n=e.fillGradient;if(!n||"object"!=typeof n)return null;let r=1/0;for(const[,t]of e.topPath)r=Math.min(r,t);let o=-1/0;for(const[,t]of e.bottomPath)o=Math.max(o,t);if(!Number.isFinite(r)||!Number.isFinite(o))return null;const i=Ao(n.stops,wo(e.style.fill));return i?pi("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:0,y1:r,x2:0,y2:o,children:i}):null}(r,s),u=c?`url(#${s})`:l?`url(#${a})`:wo(r.style.fill),d=c?void 0:r.style.fillOpacity??r.style.opacity??.7,h=o?Go().x(([e])=>e).y(([,e])=>e).curve(o)(r.topPath)??"":"M"+r.topPath.map(([e,t])=>`${e},${t}`).join("L"),f=$o(`${n?n+"-":""}area-${t}-stroke-gradient`),y=!(!r.colorThresholds?.length||!r.rawValues||r.rawValues.length!==r.topPath.length),p=!!r.strokeColorBands?.length,m=y||p?null:gi(r.strokeGradient,r.topPath,f,r.style.stroke||"#4e79a7"),g=r.style.strokeWidth||2;let b=1/0,x=-1/0;for(const[e]of r.topPath)b>e&&(b=e),e>x&&(x=e);const v=p?r.strokeColorBands.map((e,r)=>$o(`${n?n+"-":""}area-${t}-stroke-band-${r}`)):[],k=p?r.strokeColorBands.map((e,t)=>pi("clipPath",{id:v[t],children:pi("rect",{x:b-g,y:e.y,width:x-b+2*g,height:e.height})},v[t])):null,w=r.style.stroke&&"none"!==r.style.stroke?p?r.strokeColorBands.map((e,n)=>pi("path",{d:h,fill:"none",stroke:e.color??wo(r.style.stroke),strokeWidth:g,opacity:r.style.opacity,clipPath:`url(#${v[n]})`},`area-${t}-stroke-band-${n}`)):y?li(r.topPath,r.rawValues,r.colorThresholds,wo(r.style.stroke)).map((e,n)=>pi("path",{d:"M"+e.path.map(([e,t])=>`${e},${t}`).join("L"),fill:"none",stroke:e.color,strokeWidth:g,opacity:r.style.opacity},`area-${t}-threshold-${n}`)):pi("path",{d:h,fill:"none",stroke:m?`url(#${f})`:wo(r.style.stroke),strokeWidth:g,opacity:r.style.opacity}):null;if(r.clipRect){const e=`${n?n+"-":""}area-clip-${t}`;return mi("g",{children:[mi("defs",{children:[c,!c&&l,m,k,pi("clipPath",{id:e,children:pi("rect",{x:r.clipRect.x,y:r.clipRect.y,width:r.clipRect.width,height:r.clipRect.height})})]}),mi("g",{clipPath:`url(#${e})`,children:[pi("path",{d:i,fill:u,fillOpacity:d,opacity:c?r.style.opacity:void 0,stroke:"none"}),w]})]},"area-"+t)}return mi(Bo.Fragment,{children:[(c||l||m||k)&&mi("defs",{children:[c,!c&&l,m,k]}),pi("path",{d:i,fill:u,fillOpacity:d,opacity:c?r.style.opacity:void 0,stroke:"none"}),w]},"area-"+t)}case"point":{const r=e,o=`${n?n+"-":""}point-${t}-hatch`,i=j(r.style.fill)?L(r.style.fill,o):void 0;return mi(Bo.Fragment,{children:[i&&pi("defs",{children:i}),pi("circle",{cx:r.x,cy:r.y,r:r.r,fill:i?`url(#${o})`:wo(r.style.fill),opacity:r.style.opacity??r.style.fillOpacity??.8,stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},"point-"+t)}case"symbol":return So(e,t);case"glyph":return Mo(e,e.x,e.y,`${n??""}glyph-${e.pointId??t}`);case"rect":{const r=e,o=`${n?n+"-":""}xyrect-${t}-hatch`,i=j(r.style.fill)?L(r.style.fill,o):void 0;return mi(Bo.Fragment,{children:[i&&pi("defs",{children:i}),pi("rect",{x:r.x,y:r.y,width:r.w,height:r.h,fill:i?`url(#${o})`:wo(r.style.fill),opacity:r.style.opacity,stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},"rect-"+t)}case"heatcell":{const n=e,r={x:n.x,y:n.y,width:n.w,height:n.h,fill:n.fill,stroke:n.style?.stroke,strokeWidth:n.style?.strokeWidth,...null!=n.style?.opacity&&{opacity:n.style.opacity}};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,i,a]=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),l=.299*o+.587*i+.114*a>128?"#000":"#fff",s=Math.max(10,Math.min(16,.3*Math.min(n.w,n.h)));return mi("g",{children:[pi("rect",{...r}),pi("text",{x:n.x+n.w/2,y:n.y+n.h/2,textAnchor:"middle",dominantBaseline:"middle",fill:l,fontSize:s+"px",children:e})]},"heatcell-"+t)}return pi("rect",{...r},"heatcell-"+t)}case"candlestick":{const n=e;if(n.isRange){const e=n.dotRadius??Math.max(2,n.bodyWidth/2);return mi("g",{children:[pi("line",{x1:n.x,y1:n.highY,x2:n.x,y2:n.lowY,stroke:n.wickColor,strokeWidth:n.wickWidth}),pi("circle",{cx:n.x,cy:n.highY,r:e,fill:n.wickColor}),pi("circle",{cx:n.x,cy:n.lowY,r:e,fill:n.wickColor})]},"candle-"+t)}const r=Math.min(n.openY,n.closeY),o=Math.max(Math.abs(n.openY-n.closeY),1),i=n.isUp?n.upColor:n.downColor;return mi("g",{children:[pi("line",{x1:n.x,y1:n.highY,x2:n.x,y2:n.lowY,stroke:n.wickColor,strokeWidth:n.wickWidth}),pi("rect",{x:n.x-n.bodyWidth/2,y:r,width:n.bodyWidth,height:o,fill:i,stroke:i,strokeWidth:1})]},"candle-"+t)}default:return null}}var xi="undefined"==typeof window||"undefined"==typeof document;import*as vi from"react";import{jsx as ki}from"react/jsx-runtime";var wi=vi.createContext(null);function $i({children:e}){const[t,n]=vi.useState(!1),r=vi.useCallback(()=>n(e=>!e),[]),o=vi.useMemo(()=>({visible:t,setVisible:n,toggle:r}),[t,r]);return ki(wi.Provider,{value:o,children:e})}function Mi(){return vi.useContext(wi)}function Ai(){const e=vi.useContext(wi);return e?e.toggle:null}import{jsx as Si}from"react/jsx-runtime";var Wi={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function Ci({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 Si("div",{"aria-live":"polite","aria-atomic":"true",style:Wi,children:t})}function ji(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[n,r]of Object.entries(e))n.startsWith("_")||null!=r&&""!==r&&("number"==typeof r?Number.isFinite(r)&&(t[n]=r):"string"==typeof r?t[n]=r:"boolean"==typeof r?t[n]=r+"":r instanceof Date&&(t[n]=r.toISOString().slice(0,10)));return t}function Oi(e){return e&&"object"==typeof e?e:{}}function Ii(e){return Oi(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Ni(e){const t=[];if(!Array.isArray(e))return t;const n=e.some(e=>e&&("line"===e.type||"area"===e.type));for(const r of e)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":if(n)break;t.push({label:"Point",values:ji(Ii(r))});break;case"line":case"area":{const e=Ii(r),n=Array.isArray(e)?e:[],o="line"===r.type?"Line point":"Area point";for(const e of n)t.push({label:o,values:ji(e)});break}case"rect":{const e=Ii(r),n=null!=e&&"object"==typeof e?e:{},o=n.category??r.group??"",i=n.value??n.__aggregateValue??n.total,a=ji(n);null==a.category&&""!==o&&(a.category=o+""),null==a.value&&null!=i&&(a.value="number"==typeof i||"string"==typeof i?i:i+""),t.push({label:"Bar",values:a});break}case"heatcell":{const e=ji(Ii(r));null==e.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(e.value=r.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=Ii(r),n=ji(e);if(null==n.category){const t=Oi(e),r=t.category??t.label;null!=r&&(n.category=r+"")}t.push({label:"Wedge",values:n});break}case"circle":t.push({label:"Node",values:ji(Ii(r))});break;case"arc":t.push({label:"Arc",values:ji(Ii(r))});break;case"candlestick":t.push({label:"Candlestick",values:ji(Ii(r))});break;case"geoarea":{const e=Oi(Ii(r)),n=ji(e);if(null==n.name){const t=Oi(e.properties).name??e.name;null!=t&&(n.name=t+"")}t.push({label:"Region",values:n});break}}}catch{}return t}import*as Li from"react";import{jsx as Ri,jsxs as Pi}from"react/jsx-runtime";function zi(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 r=[],o={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"],a=Object.keys(n).sort((e,t)=>{const n=i.indexOf(e),r=i.indexOf(t);return(-1===n?999:n)-(-1===r?999:r)});for(const e of a)r.push(`${n[e]} ${o[e]||e}`);return`${t}, ${r.join(", ")}`}function Fi(e,t,n){const r=[];return e>0&&r.push(e+" nodes"),t>0&&r.push(t+" edges"),0===r.length?n+", empty":`${n}, ${r.join(", ")}`}var Ti=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":t+""},Di="semiotic-accessible-data-table",Bi=Di+" semiotic-accessible-data-table-hidden",Ei=Di+" semiotic-accessible-data-table-visible",Gi=Ei+" semiotic-accessible-data-table-network",Hi={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"},_i={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},Vi={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)"},qi={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},Yi={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))"},Ui={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},Zi={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},Xi={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 Ki({scene:e,chartType:t,tableId:n,chartTitle:r}){const[o,i]=Li.useState(!1),[a,l]=Li.useState(5),s=Mi(),c=s?.visible??!1,u=o||c,d=Li.useRef(null),h=r?"Data summary for "+r:n?`Data summary for ${t} ${n}`:"Data summary for "+t;Li.useEffect(()=>{u||l(5)},[u]);const f=Li.useCallback(e=>{e.target===e.currentTarget&&(o||c||i(!0))},[o,c]),y=Li.useCallback(e=>{c||d.current?.contains(e.relatedTarget)||i(!1)},[c]);if(!e||0===e.length)return n?Ri("span",{id:n,tabIndex:-1,style:Wi}):null;if(!u)return Ri("div",{id:n,className:Bi,tabIndex:-1,onFocus:f,style:Wi,role:"region","aria-label":h,children:Pi("button",{type:"button",onClick:()=>i(!0),children:["View data summary (",e.length," elements)"]})});const p=Ni(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 r of t){const t=[],o=new Set;for(const n of e){if(!n||!n.values)continue;const e=n.values[r];null!=e&&""!==e&&("number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)?t.push(e):"number"==typeof e||"object"!=typeof e&&"function"!=typeof e&&o.add(e+""))}if(t.length>0){let e=t[0],o=t[0],i=0;for(const n of t)e>n&&(e=n),n>o&&(o=n),i+=n;n.push({name:r,count:t.length,numeric:!0,min:e,max:o,mean:i/t.length})}else if(o.size>0){const e=Array.from(o);n.push({name:r,count:e.length,numeric:!1,uniqueValues:e.slice(0,5)})}}return n}(p),g=function(e,t){const n=[e+" data points."];for(const e of t)if(e.numeric)n.push(`${e.name}: ${Ti(e.min)} to ${Ti(e.max)}, mean ${Ti(e.mean)}.`);else{const t=e.uniqueValues,r=t.length>3?`${t.slice(0,3).join(", ")}… (${e.count} unique)`:t.join(", ");n.push(`${e.name}: ${r}.`)}return n.join(" ")}(p.length,m),b=Math.min(a,p.length),x=p.slice(0,b),v=p.length-b,k=new Set;for(const e of x)for(const t of Object.keys(e.values))k.add(t);const w=Array.from(k);return Pi("div",{ref:d,id:n,className:Ei,tabIndex:-1,onBlur:y,style:Hi,role:"region","aria-label":h,children:[Ri("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{c&&s&&s.setVisible(!1),i(!1)},"aria-label":"Close data summary",style:Vi,children:"×"}),Ri("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:_i,children:g}),Pi("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Sample data for "+t,style:qi,children:[Ri("caption",{className:"semiotic-accessible-data-table-caption",style:Zi,children:v>0?`First ${b} of ${p.length} data points`:`All ${p.length} data points`}),Ri("thead",{children:Pi("tr",{children:[Ri("th",{style:Yi,children:"type"}),w.map(e=>Ri("th",{style:Yi,children:e},e))]})}),Ri("tbody",{children:x.map((e,t)=>Pi("tr",{children:[Ri("td",{style:Ui,children:e.label}),w.map(t=>{return Ri("td",{style:Ui,children:(n=e.values[t],null==n||""===n?"—":"number"==typeof n?Number.isNaN(n)?"—":Ti(n):"boolean"==typeof n?n?"true":"false":"object"==typeof n?"—":n+"")},t);var n})]},t))})]}),v>0&&Pi("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>l(e=>e+25),style:Xi,children:["Show ",Math.min(25,v)," more"," ",1===v?"row":"rows"," (",v," remaining)"]})]})}function Ji({nodes:e,edges:t,chartType:n,tableId:r,chartTitle:o}){const[i,a]=Li.useState(!1),[l,s]=Li.useState(5),c=Mi(),u=c?.visible??!1,d=i||u,h=o?"Data summary for "+o:r?`Data summary for ${n} ${r}`:"Data summary for "+n,f=Li.useRef(null);Li.useEffect(()=>{d||s(5)},[d]);const y=Li.useCallback(e=>{e.target===e.currentTarget&&(i||u||a(!0))},[i,u]),p=Li.useCallback(e=>{u||f.current?.contains(e.relatedTarget)||a(!1)},[u]);if(!e||0===e.length)return r?Ri("span",{id:r,tabIndex:-1,style:Wi}):null;if(!d)return Ri("div",{id:r,className:Bi,tabIndex:-1,onFocus:y,style:Wi,role:"region","aria-label":h,children:Pi("button",{type:"button",onClick:()=>a(!0),children:["View data summary (",e.length," nodes, ",t.length," edges)"]})});const m=Array.isArray(e)?e:[],g=Array.isArray(t)?t:[],b=new Map,x=new Map,v=new Map,k=new Map;for(const e of g){if(!e||"object"!=typeof e)continue;const t=e.datum??{source:e.source,target:e.target},n="object"==typeof t.source?t.source?.id:t.source,r="object"==typeof t.target?t.target?.id:t.target,o="number"==typeof t.value&&Number.isFinite(t.value)?t.value:0;if(null!=n&&""!==n){const e=n+"";x.set(e,(x.get(e)??0)+1),k.set(e,(k.get(e)??0)+o)}if(null!=r&&""!==r){const e=r+"";b.set(e,(b.get(e)??0)+1),v.set(e,(v.get(e)??0)+o)}}const w=[];for(let e=0;m.length>e;e++){const t=m[e];if(!t||"object"!=typeof t)continue;const n=t.datum?.id??t.id,r=null!=n?n+"":"node-"+e,o=b.get(r)??0,i=x.get(r)??0,a=v.get(r)??0,l=k.get(r)??0;w.push({id:r,degree:o+i,inDeg:o,outDeg:i,wDegree:a+l,wInDeg:a,wOutDeg:l})}w.sort((e,t)=>t.degree-e.degree);let $=0,M=0;if(w.length>0){let e=0;for(const t of w)e+=t.degree,t.degree>M&&(M=t.degree);$=e/w.length}const A=g.some(e=>{const t=e?.datum??{source:e?.source,target:e?.target};return"number"==typeof t?.value&&Number.isFinite(t.value)}),S=[`${w.length} nodes, ${g.length} edges.`];w.length>0&&S.push(`Mean degree: ${Ti($)}, max degree: ${M}.`);const W=Math.min(l,w.length),C=w.slice(0,W),j=w.length-W;return Pi("div",{ref:f,id:r,className:Gi,tabIndex:-1,onBlur:p,style:Hi,role:"region","aria-label":h,children:[Ri("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{u&&c&&c.setVisible(!1),a(!1)},"aria-label":"Close data summary",style:Vi,children:"×"}),Ri("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:_i,children:S.join(" ")}),Pi("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Node degree summary for "+n,style:qi,children:[Ri("caption",{className:"semiotic-accessible-data-table-caption",style:Zi,children:j>0?`Top ${W} of ${w.length} nodes by degree`:`All ${w.length} nodes by degree`}),Ri("thead",{children:Pi("tr",{children:[Ri("th",{style:Yi,children:"id"}),Ri("th",{style:Yi,children:"degree"}),Ri("th",{style:Yi,children:"in"}),Ri("th",{style:Yi,children:"out"}),A&&Ri("th",{style:Yi,children:"w. degree"}),A&&Ri("th",{style:Yi,children:"w. in"}),A&&Ri("th",{style:Yi,children:"w. out"})]})}),Ri("tbody",{children:C.map((e,t)=>Pi("tr",{children:[Ri("td",{style:Ui,children:e.id}),Ri("td",{style:Ui,children:e.degree}),Ri("td",{style:Ui,children:e.inDeg}),Ri("td",{style:Ui,children:e.outDeg}),A&&Ri("td",{style:Ui,children:Ti(e.wDegree)}),A&&Ri("td",{style:Ui,children:Ti(e.wInDeg)}),A&&Ri("td",{style:Ui,children:Ti(e.wOutDeg)})]},t))})]}),j>0&&Pi("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>s(e=>e+25),style:Xi,children:["Show ",Math.min(25,j)," more"," ",1===j?"node":"nodes"," (",j," remaining)"]})]})}function Qi({summary:e}){return e?Ri("div",{role:"note",style:Wi,children:e}):null}function ea({tableId:e}){return Ri("a",{href:"#"+e,style:Wi,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,Wi)},children:"Skip to data table"})}import{jsx as ta}from"react/jsx-runtime";var na="var(--semiotic-focus, #005fcc)";function ra({active:e,hoverPoint:t,margin:n,size:r,shape:o="circle",width:i,height:a,pathData:l}){if(!e||!t)return null;const s=t.x+n.left,c=t.y+n.top;let u;if("geoarea"!==o&&"path"!==o||!l)if("rect"===o&&null!=i&&null!=a){const e=Math.max(i,4),t=Math.max(a,4);u=ta("rect",{x:s-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:na,strokeWidth:2,strokeDasharray:"4,2"})}else u=ta("circle","wedge"===o?{cx:s,cy:c,r:12,fill:"none",stroke:na,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:s,cy:c,r:8,fill:"none",stroke:na,strokeWidth:2,strokeDasharray:"4,2"});else u=ta("g",{transform:`translate(${n.left},${n.top})`,children:ta("path",{d:l,fill:"none",stroke:na,strokeWidth:2.5,strokeDasharray:"6,3"})});return ta("svg",{style:{position:"absolute",left:0,top:0,width:r[0],height:r[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:u})}import*as oa from"react";import{jsx as ia}from"react/jsx-runtime";function aa({x:e,y:t,containerWidth:n,containerHeight:r,margin:o,children:i,className:a="stream-frame-tooltip",zIndex:l=1}){const s=Number.isFinite(e)&&Number.isFinite(t),c=oa.useRef(null),[u,d]=oa.useState(null);oa.useLayoutEffect(()=>{const e=c.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();Number.isFinite(t.width)&&Number.isFinite(t.height)&&d(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()},[a,n,r,s]);let h;h=u?`translate(${u.width+12>n-e?"calc(-100% - 12px)":"12px"}, ${u.height+12>r-t?"calc(-100% - 4px)":"4px"})`:`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${.3*r>t?"4px":"calc(-100% - 4px)"})`;const f=function(e){if(!oa.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 r=n.style;if(r&&"object"==typeof r){if(null!=r.background&&""!==r.background&&"transparent"!==r.background)return!0;if(null!=r.backgroundColor&&""!==r.backgroundColor&&"transparent"!==r.backgroundColor)return!0}return!1}(i),y=f?null:oe;return s?ia("div",{ref:c,className:f?a:(a+" semiotic-tooltip").trim(),style:{...y||{},position:"absolute",left:o.left+e,top:o.top+t,transform:h,pointerEvents:"none",zIndex:l,width:"max-content"},children:i}):null}import*as la from"react";import{useCallback as sa,useEffect as ca,useLayoutEffect as ua,useMemo as da,useRef as ha}from"react";function fa(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}function ya(e,t){return Math.min((e-t.startTime)/t.duration,1)}function pa(e,t,n){return e+(t-e)*n}function ma(){return"undefined"!=typeof performance?performance.now():Date.now()}var ga=()=>"undefined"!=typeof performance?performance.now():Date.now();function ba(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}}function xa(e,t){const n=e();return Number.isFinite(n)?n:t}var va=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??ga,this.lastWallTime=xa(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=xa(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??ga;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=xa(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:ba(n)))}},ka=22,wa="undefined"==typeof window?ca:ua,$a={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)};function Ma(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function Aa(e){const t=y(),n=ha(t);n.current=t;const[r,o]=yn(e.sizeProp,e.responsiveWidth,e.responsiveHeight),i=!!e.title,a=!!e.legend&&"top"===e.legendPosition,l=da(()=>function(e,t,n=!1){const r=n?t?58:34:t?36:0;return r>e.top?{...e,top:r}:e}({...e.marginDefault,...e.userMargin},i,a),[e.marginDefault,e.userMargin,i,a]),s=o[0]-l.left-l.right,u=o[1]-l.top-l.bottom,d=Ma(e.foregroundGraphics,o,l),h=Ma(e.backgroundGraphics,o,l),f=c(e=>e.theme),{transition:p,introEnabled:m}=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),g="semiotic-table-"+la.useId(),b=ha(null);if(!b.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;b.current=new va({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const x=b.current;x.configure({clock:e.clock,random:e.random,seed:e.seed});const v=ha(null),w=ha(e.frameScheduler??$a);w.current=e.frameScheduler??$a;const $=ha(null),M=ha(!1),A=ha(()=>{}),S=sa(()=>{if(null!==v.current||M.current)return;const e=w.current;let t=!1,n=!1;const r=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(M.current=!0),v.current=null,$.current=null;try{A.current()}finally{e&&(M.current=!1)}});n=!0,t||(v.current=r,$.current=e)},[]),W=sa(()=>{null!==v.current&&(($.current??w.current).cancelAnimationFrame(v.current),v.current=null,$.current=null)},[]);wa(()=>{x.setPaused(!0===e.paused)},[x,e.paused]),ca(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void x.setVisible(!0);const t=()=>x.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[x,e.suspendWhenHidden]),ca(()=>()=>{W()},[W]);const C=ha(()=>{}),j=ha(()=>{}),O=ha(null),I=ha(null),N=ha(null),L=sa(()=>{const e=O.current;O.current=null,e&&C.current(e)},[]),R=sa(e=>{if(O.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===I.current){const e=w.current;let t=!1;const n=e.requestAnimationFrame(()=>{t=!0,I.current=null,N.current=null,L()});t||(I.current=n,N.current=e)}},[L]),P=sa(()=>{O.current=null,null!==I.current&&((N.current??w.current).cancelAnimationFrame(I.current),I.current=null,N.current=null),j.current()},[]);ca(()=>()=>{O.current=null,null!==I.current&&((N.current??w.current).cancelAnimationFrame(I.current),I.current=null,N.current=null)},[]);const z=e.themeDirtyRef;return wa(()=>{z&&(k++,z.current=!0,S())},[f,S,z]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:r,size:o,margin:l,adjustedWidth:s,adjustedHeight:u,resolvedForeground:d,resolvedBackground:h,currentTheme:f,transition:p,introEnabled:m,tableId:g,frameRuntime:x,rafRef:v,renderFnRef:A,scheduleRender:S,cancelRender:W,hoverHandlerRef:C,hoverLeaveRef:j,onPointerMove:R,onPointerLeave:P}}import{useEffect as Sa,useRef as Wa}from"react";import{jsx as Ca}from"react/jsx-runtime";function ja(e,t){return function(e){const{cancelRender:t,dirtyRef:n,frameRuntime:r,manageFrameRuntime:o,scheduleRender:i}=e,a=Wa(null),l=Wa(null),s=Wa(!1);return f({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),Sa(()=>{if(!1!==o)return r.subscribe(()=>{r.isActive?(n.current=!0,i()):t()})},[t,n,r,o,i]),Sa(()=>{!s.current&&(s.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),{canvasRef:a,interactionCanvasRef:l}}({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}function Oa({children:e,size:t,margin:n,overflowVisible:r=!1}){return e?Ca("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:r?"visible":void 0},children:Ca("g",{transform:`translate(${n.left},${n.top})`,children:e})}):null}function Ia(e,t,n,r){const o=e.getContext("2d");if(!o)return null;const i=Math.round(t[0]*r),a=Math.round(t[1]*r),l=i/t[0],s=a/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===a||(e.width=i,e.height=a),o.setTransform(l,0,0,s,0,0),o.translate(n.left,n.top),o}function Na(){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))}function La(e){return"touch"===e?"touch":"pointer"}function Ra(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']")}function Pa(e){const{onObservation:t,datum:n,x:r=0,y:o=0,chartType:i,chartId:a,context:l,timestamp:s=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:r,y:o,timestamp:s,chartType:i,chartId:a}),"focus"===l?.type&&t({type:"focus",datum:n,inputType:"touch"===l.inputType?"pointer":l.inputType,timestamp:s,chartType:i,chartId:a})):t({type:"hover-end",timestamp:s,chartType:i,chartId:a}))}function za(e){const{onObservation:t,datum:n,x:r=0,y:o=0,chartType:i,chartId:a,context:l,timestamp:s=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:r,y:o,timestamp:s,chartType:i,chartId:a}),"activate"===l?.type&&t({type:"activate",datum:n,inputType:l.inputType,timestamp:s,chartType:i,chartId:a})):t({type:"click-end",timestamp:s,chartType:i,chartId:a}))}function Fa(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}function Ta(e){return e?"string"==typeof e?{name:e}:e:null}var Da=.5;function Ba(e,t,n){return t?(r,...o)=>{const i={...e(r,...o)};if(t.isActive)if(t.predicate(r))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}var Ea={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1};function Ga(e,t={}){const n=t.mobileSemantics?.interaction,r="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,o="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,i=!!n||void 0!==r,a=e&&"object"==typeof e?e:void 0;if(!1===e||!1===a?.enabled||void 0===e&&!o&&!i)return Ea;const l=a??{};return{enabled:!0,tapToSelect:l.tapToSelect??!0,tapToLockTooltip:l.tapToLockTooltip??!0,clearSelection:l.clearSelection??"backgroundTap",targetSize:l.targetSize??r??44,snap:l.snap??"nearestDatum",brushHandleSize:l.brushHandleSize??44,standardControls:l.standardControls??!1}}var Ha={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}}},_a={top:10,bottom:10,left:10,right:10};function Va(e){return e.compactMode?e.marginDefaults:_a}function qa(e,t,n){if(!1!==t)return e;const r={...e};return"horizontal"===n?r.left=Math.min(r.left,15):r.bottom=Math.min(r.bottom,15),r}import{useMemo as Ya,useCallback as Ua,useState as Za}from"react";function Xa({data:e,colorBy:t,colorScale:n,getColor:r,strokeColor:o,strokeWidth:i,categories:a}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==o&&(n.stroke=o),void 0!==i&&(n.strokeWidth=i),n},type:"fill",items:(a&&a.length>0?a:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((o,i)=>{const a=e.find("function"==typeof t?e=>t(e)===o:e=>e[t]===o),l=a?r(a,t,n):n?n(o):_e[i%_e.length];return{label:o+"",color:l}}),label:""}]}}function Ka(e,t){if(!t)return[];const n=new Set;for(const r of e){const e="function"==typeof t?t(r):r[t];null!=e&&n.add(e+"")}return Array.from(n)}function Ja({data:e,colorBy:t,colorScale:n,showLegend:r,legendPosition:o="right",userMargin:i,defaults:a={top:50,bottom:60,left:70,right:40},categories:l,additionalLegend:s,chartWidth:c,legendLayout:u,hasTitle:d=!1,axisChrome:h}){const f=Rt(gn),y=null!==Rt(vn),p=void 0!==r?r:!f&&!!t,m=!!t&&(p||y),g=Ya(()=>m?void 0!==l?l:Ka(e,t):[],[l,t,e,m]);Mn(y&&t?g:[]);const b=Ya(()=>{if(!p||!t)return;const r=Xa({data:e,colorBy:t,colorScale:n,getColor:Ye,categories:g});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[p,t,e,n,g]),x=Ya(()=>Ht(b,s),[b,s]),{hasAxis:v,hasAxisLabel:k,rotatedTicks:w}=h??{},$=Ya(()=>{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:a[t]},n={top:t("top"),right:t("right"),bottom:t("bottom"),left:t("left")},r=t=>"number"==typeof e[t];if(x){const e=function(e,t){return Yt(e,t)+Ut(e)+Zt(t)}(x,u),t=void 0===v?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:v,hasAxisLabel:k,rotatedTicks:w},i=Qt(x,Math.max(1,(c??600)-n.left-n.right),u)+Ut(x)+Xt("bottom"===o?t:void 0,u)+("top"===o&&d?24:0);"right"===o&&!r("right")&&e>n.right?n.right=e:"left"===o&&!r("left")&&e>n.left?n.left=e:"top"!==o||r("top")?"bottom"!==o||r("bottom")||(n.bottom=Math.max(n.bottom,80,i)):n.top=Math.max(n.top,50,i)}return n},[a,i,x,o,c,u,d,v,k,w]);return{legend:x,margin:$,legendPosition:o}}function Qa(e,t,n){const[r,o]=Za(null),[i,a]=Za(new Set),l=Ya(()=>new Set,[]),s=Ua(t=>{"highlight"===e&&o(t?t.label:null)},[e]),c=Ua(t=>{"isolate"===e&&a(e=>{const r=new Set(e);return r.has(t.label)?r.delete(t.label):r.add(t.label),r.size===n.length?new Set:r})},[e,n.length]),u=Ya(()=>{if(!e||"none"===e||!t)return null;const n="string"==typeof t?t:null;return"highlight"===e&&null!=r?{isActive:!0,predicate:e=>{const o=n?e[n]:"function"==typeof t?t(e):null;return("string"==typeof o?o:(o??"")+"")===r}}:"isolate"===e&&i.size>0?{isActive:!0,predicate:e=>{const r=n?e[n]:"function"==typeof t?t(e):null;return i.has("string"==typeof r?r:(r??"")+"")}}:null},[e,t,r,i]);return{highlightedCategory:"highlight"===e?r:null,isolatedCategories:"isolate"===e?i:l,onLegendHover:s,onLegendClick:c,legendSelectionHook:u}}import{useMemo as el,useCallback as tl,useState as nl,useId as rl,useEffect as ol,useRef as il}from"react";function al(e,t,n){const r=e.xValue??t?.[n];if(null==r)return null;const o=Number(r);return Number.isFinite(o)?o:null}function ll(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 sl(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}var cl=[];function ul(){const e=s(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function dl(){const e=s();return e?.colors?.sequential||void 0}function hl(){const e=s();return e?.colors?.diverging||void 0}function fl(e,t,n,r,o){if(e)return e;if(n&&"object"==typeof n&&!Array.isArray(n)){const e=Ue(n,r);if(e)return e}let i;if(Array.isArray(n))i=n;else if(t&&t.length>0)i=t;else if("string"==typeof n){const e=Be[n];Array.isArray(e)&&(i=e)}return i&&0!==i.length?null!=r?(o.has(r)||o.set(r,o.size),i[o.get(r)%i.length]):i[0]:Ge}function yl(e,t,n){const r=et(),o=ul();return el(()=>{if(!t)return;const i=r??void 0,a=n??(o&&o.length>0?o:void 0)??"category10";if(0!==e.length){if("function"==typeof t){const n=Array.from(new Set(e.map(e=>t(e)+"")));if(i&&sl(i)){const e=Ze(n.map(e=>({_cat:e})),"_cat",a);return t=>i[t]||e(t)}return Ze(n.map(e=>({_cat:e})),"_cat",a)}if(i&&sl(i)){const n=Ze(e,t,a);return e=>i[e]||n(e)}return Ze(e,t,a)}if(i&&sl(i)){const e=Ze([{_:"a"}],"_",a);return t=>i[t]||e(t)}},[e,t,n,r,o])}function pl(e,t,n){return el(()=>{if(!t||"auto"===t||"function"==typeof t)return e;const r=[...e],o="function"==typeof(i=n)?i:e=>e[i];var i;return r.sort("asc"===t?(e,t)=>o(e)-o(t):(e,t)=>o(t)-o(e))},[e,t,n])}function ml({selection:e,linkedHover:t,fallbackFields:n=cl,unwrapData:r=!1,onObservation:o,chartType:i,chartId:a,onClick:l,hoverHighlight:s,colorByField:c,mobileInteraction:u}){const d=rl(),h=el(()=>Fa(t,n),[t,n]),f=el(()=>"series"===h?.mode?[h.seriesField||c||n[0]].filter(e=>!!e):h?.fields||n,[h,c,n]),y=wt({name:e?.name||"__unused__",fields:f}),p=Mt({name:h?.name||"hover",fields:f}),m=F(e=>e.pushObservation),g=tl(e=>{o?.(e),m?.(e)},[o,m]),b=e?{isActive:y.isActive,predicate:y.predicate}:null,[x,v]=nl(null),k=il(!1),w=c||n[0],$=el(()=>{if(!s||null==x||!w)return null;const e=x,t=w;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[s,x,w]),M=tl((e,n)=>{const r=!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"===h?.mode&&h.xField){const n=al(e,t,h.xField);null!=n&&function(e,t,n){const r=dt.positions.get(e);r?.locked||r&&r.xValue===t&&r.sourceId===n||(dt={positions:new Map(dt.positions).set(e,{xValue:t,sourceId:n})},ft())}(h.name||"hover",n,d)}"x-position"!==h?.mode&&p.onHover(t)}else"x-position"!==h?.mode||r||yt(h.name||"hover",d),"x-position"===h?.mode||r||p.onHover(null);if(s&&w)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[w];v(null!=n?n+"":null)}else r||v(null);(o||m)&&Pa({onObservation:g,datum:e?ll(e):null,x:e?.x,y:e?.y,chartType:i||"unknown",chartId:a,context:n})},[t,p,h,d,o,i,a,m,g,s,w,u]),A=tl((n=!0)=>{k.current=!1,t&&"x-position"!==h?.mode&&p.onHover(null),e&&u?.tapToSelect&&y.clear(),n&&s&&v(null),"x-position"===h?.mode&&(pt(h.name||"hover",d),yt(h.name||"hover",d))},[t,h,p,e,u,y,s,d]),S=tl((n,r)=>{const c=!!u?.enabled&&(u.tapToLockTooltip||u.tapToSelect),b=!!u?.enabled&&"backgroundTap"===u.clearSelection;if("x-position"===h?.mode&&h.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=al(n,e,h.xField);null!=t&&function(e,t,n){const r=dt.positions.get(e);if(r?.locked){const t=new Map(dt.positions);return t.delete(e),dt={positions:t},ft(),!1}dt={positions:new Map(dt.positions).set(e,{xValue:t,sourceId:n,locked:!0})},ft()}(h.name||"hover",t,d)}if(c)if(n){k.current=!0;const r=ll(n);if(t&&"x-position"!==h?.mode&&p.onHover(r),e&&u?.tapToSelect&&f.length>0){const e={};for(const t of f){const n=r[t];void 0!==n&&(e[t]=[n])}sl(e)&&y.selectPoints(e)}if(s&&w){const e=r?.[w];v(null!=e?e+"":null)}}else b&&A();if(n||b){if(n&&l){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),l(e,{x:n.x??0,y:n.y??0})}(o||m)&&za({onObservation:g,datum:n?ll(n):null,x:n?.x,y:n?.y,chartType:i||"unknown",chartId:a,context:r})}},[l,o,m,g,i,a,h,d,u,t,p,e,y,f,s,w,A]);return ol(()=>{if(!u?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&k.current&&A()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u?.enabled,A]),ol(()=>()=>{k.current&&A(!1)},[A]),ol(()=>{if("x-position"!==h?.mode)return;const e=h.name||"hover";return()=>{pt(e,d),yt(e,d)}},[h?.mode,h?.name,d]),{activeSelectionHook:b,hoverSelectionHook:$,customHoverBehavior:M,customClickBehavior:S,crosshairSourceId:d}}function gl(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 bl(e,t,n){return function(e,t,n){const r=Ha[e||"primary"],o=e&&"primary"!==e||!n?.width?r.width:n.width,i=e&&"primary"!==e||!n?.height?r.height:n.height,a=Ot({...t,mode:e},{width:t.width??o,height:t.height??i}).props,l=a.mode||e||"primary",s=Ha[l],c="context"===l||"sparkline"===l,u="primary"===l&&n?.width?n.width:s.width;return{mode:l,width:a.width??u,height:a.height??("primary"===l&&n?.height?n.height:s.height),showAxes:a.showAxes??s.showAxes,showGrid:a.showGrid??s.showGrid,enableHover:a.enableHover??(!!a.linkedHover||s.enableHover),showLegend:a.showLegend??s.showLegend,showLabels:a.showLabels??s.showLabels,title:c?void 0:a.title,description:a.description,summary:a.summary,accessibleTable:a.accessibleTable,xLabel:c?void 0:a.xLabel,yLabel:c?void 0:a.yLabel,categoryLabel:c?void 0:a.categoryLabel,valueLabel:c?void 0:a.valueLabel,marginDefaults:qa(s.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:Ga(a.mobileInteraction,{mode:l,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}(e,t,n)}export{jn as EMPTY_ARRAY,On as filterSparseArray,be as schemeCategory10,Ae as interpolateViridis,Ie as SEQUENTIAL_INTERPOLATORS,Ne as getSequentialInterpolator,Le as interpolateRdBu,Re as interpolatePiYG,Pe as interpolatePRGn,ze as interpolateBrBG,Fe as interpolateRdYlBu,Te as interpolateRdYlGn,De as interpolateSpectral,Be as COLOR_SCHEMES,Ee as DEFAULT_COLORS,Ge as DEFAULT_COLOR,He as resolveCategoricalPalette,_e as STREAMING_PALETTE,Ve as DEPTH_PALETTE_COLORS,Ye as getColor,Ue as resolveExplicitColor,Ze as createColorScale,Xe as getSize,fa as computeEasing,ya as computeRawProgress,pa as lerp,ma as now,p as DEFAULT_LIFECYCLE_THRESHOLDS,m as bandFromAge,mo as symbolPathString,go as symbolRadius,bo as makeSymbolResolver,Rn as UpdateResultTracker,_n as useSceneRevisionDiagnostics,Vn as runSceneBuild,qn as SceneRevisionDiagnosticsObserver,A as resolveCSSColor,S as getCSSColorCacheVersion,Ho as parseCanvasColor,x as createHatchPattern,j as isHatchFill,I as hatchFillId,L as hatchPatternDef,R as resolveSvgFill,Qo as resolveCurveFactory,ei as resolveCanvasFill,ti as coerceCanvasFill,ni as buildLinearFillGradient,oi as paintNetworkFill,ii as paintNetworkStroke,Ht as composeLegendConfigs,Zt as resolveLegendSideGutter,Kt as resolveXYAxisChrome,Jt as resolveOrdinalAxisChrome,Un as renderLegendFromConfig,Kn as ANNOTATION_DISCLOSURE_REVEAL_CSS,F as useObservationSelector,T as useAnnotationActivationOptions,D as annotationStableId,B as annotationActivationProps,E as isAnnotationActivationTarget,V as estimateLabelWidth,q as AnnotationLabel,Nr as renderAnnotationPass,Lr as createDefaultAnnotationRules,zr as annotationType,Fr as isNoteAnnotation,Tr as annotationDrawsConnector,Br as annotationBudget,to as annotationLayout,pt as unlockCrosshair,kt as useCrosshairPosition,ka as TITLE_BASELINE,li as buildThresholdLineSegments,ro as hasAnyCornerRadius,oo as clampCornerRadii,hi as networkSceneNodeToSVG,fi as networkSceneEdgeToSVG,yi as networkLabelToSVG,jo as geoSceneNodeToSVG,Lo as annularSectorPath,Ro as buildGaugeGradientGeometry,Do as ordinalSceneNodeToSVG,bi as xySceneNodeToSVG,xi as isServerEnvironment,$i as DataSummaryProvider,Mi as useDataSummary,Ai as useDataSummaryToggle,Ci as AriaLiveTooltip,Ni as extractAllRows,zi as computeCanvasAriaLabel,Fi as computeNetworkAriaLabel,Ki as AccessibleDataTable,Ji as NetworkAccessibleDataTable,Qi as ScreenReaderSummary,ea as SkipToTableLink,ra as FocusRing,Q as getPointerHitRadius,te as buildHoverData,J as smartTooltipEntries,oe as defaultTooltipStyle,le as Tooltip,se as MultiLineTooltip,ce as MultiPointTooltip,ue as normalizeTooltip,aa as FlippingTooltip,yn as useResponsiveSize,ba as createSeededFrameRandom,Aa as useFrame,ja as useFrameCanvasHost,Oa as CanvasFrameBackground,Ia as prepareCanvas,Na as getDevicePixelRatio,La as observationInputType,Ra as isInteractiveKeyboardTarget,Pa as emitHoverObservations,za as emitClickObservations,Qe as CategoryColorProvider,et as useCategoryColors,Fa as normalizeLinkedHover,Ta as normalizeLinkedBrush,Da as DEFAULT_SELECTION_OPACITY,Ba as wrapStyleWithSelection,ct as useSelectionSelector,wt as useSelection,$t as useSelectionActions,Mt as useLinkedHover,St as useBrushSelection,Wt as useFilteredData,jt as responsiveRuleMatches,Ot as resolveResponsiveRules,Ga as resolveMobileInteraction,Va as resolveAxisFreeMarginDefaults,Nt as useChartObserver,xn as useLinkedChartsActive,Mn as useLinkedChartCategories,Cn as LinkedCharts,Xa as createLegend,Ka as distinctCategories,Ja as useChartLegendAndMargin,Qa as useLegendInteraction,ul as useThemeCategorical,dl as useThemeSequential,hl as useThemeDiverging,fl as resolveDefaultFill,yl as useColorScale,pl as useSortedData,ml as useChartSelection,gl as getCrosshairProps,bl as useChartMode};
@@ -1 +0,0 @@
1
- var t=new WeakMap,e=0,n=!1,r=null,i=null;function o(a,s){if(!s)return s;const u=function(t){const e=t.trim();if(!e.startsWith("var(")||!e.endsWith(")"))return null;const n=e.slice(4,-1),r=n.indexOf(",");if(-1===r){const t=n.trim();return t.startsWith("--")?{name:t}:null}const i=n.slice(0,r).trim(),o=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:o||void 0}:null}(s);if(!u)return s;const c=()=>u.fallback?o(a,u.fallback):s,d=a.canvas;if(!d)return c();!function(){if(n)return;if("undefined"==typeof window||"undefined"==typeof document)return;n=!0;const t=()=>{e++};if("undefined"!=typeof MutationObserver&&document.documentElement&&new MutationObserver(t).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme"],subtree:!0}),"function"==typeof window.matchMedia)try{r=window.matchMedia("(prefers-color-scheme: dark)"),i=t,"function"==typeof r.addEventListener?r.addEventListener("change",i):"function"==typeof r.addListener&&r.addListener(i)}catch{}}();let f=t.get(d);f&&f.version===e||(f={version:e,map:new Map},t.set(d,f));const l=f.map.get(s);if(void 0!==l)return l;const m=getComputedStyle(d).getPropertyValue(u.name).trim()||c()||s;return f.map.set(s,m),m}function a(t){e++}function s(){return e}export{o as resolveCSSColor,a as clearCSSColorCache,s as getCSSColorCacheVersion};
File without changes
@@ -1,2 +0,0 @@
1
- "use client";
2
- var t={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},e=8;function n(t){return null==t?void 0:t+""}function r(e){const r=n(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??8,style:{...t},datum:e.datum,pointId:r,_transitionKey:r}}function a(t){return r(t)}function i(e){const[[n,r],[a,i]]=e.bounds;return{type:"geoarea",pathData:e.pathData,centroid:e.centroid,bounds:e.bounds,screenArea:e.screenArea??Math.abs((a-n)*(i-r)),style:{...t},datum:e.datum,group:e.group,interactive:!0}}function u(e){return{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...t},datum:e.datum,group:e.group,_transitionKey:n(e.id)}}function o(e){const r=n(e.id);return"width"in e&&"height"in e?{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...t},datum:e.datum,id:r,label:e.label}:{type:"circle",cx:e.x,cy:e.y,r:e.r??8,style:{...t},datum:e.datum,id:r,label:e.label}}export{e as DEFAULT_HIT_RADIUS,r as hitTargetPoint,a as geoHitTarget,i as geoAreaHitTarget,u as hitTargetRect,o as networkHitTarget};