semiotic 3.9.2 → 3.10.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 (452) hide show
  1. package/README.md +99 -74
  2. package/agent-skill/semiotic-charts/SKILL.md +13 -7
  3. package/ai/artifact-contract-reference.md +408 -0
  4. package/ai/artifact-surface-inventory.json +5586 -0
  5. package/ai/behaviorContracts.cjs +24 -2
  6. package/ai/cli.js +480 -56
  7. package/ai/dist/mcp-server.js +68 -68
  8. package/ai/examples.md +1 -1
  9. package/ai/reference.md +31 -14
  10. package/ai/schema.json +1868 -438
  11. package/ai/surface-manifest.json +11 -4
  12. package/ai/system-prompt.md +2 -0
  13. package/ai/task-packets/compare-category-totals.json +301 -0
  14. package/ai/task-packets/compare-category-totals.md +188 -0
  15. package/ai/task-packets/correct-published-chart.json +271 -0
  16. package/ai/task-packets/correct-published-chart.md +597 -0
  17. package/ai/task-packets/index.json +40 -0
  18. package/ai/task-packets/update-live-chart.json +289 -0
  19. package/ai/task-packets/update-live-chart.md +424 -0
  20. package/dist/c-2N7IU2NY.min.js +1 -0
  21. package/dist/c-2WK7YJLL.min.js +1 -0
  22. package/dist/c-33QOXEUG.min.js +1 -0
  23. package/dist/c-42PLDTX7.min.js +1 -0
  24. package/dist/c-447VIMRO.min.js +1 -0
  25. package/dist/c-4FN7Q6VQ.min.js +1 -0
  26. package/dist/c-553QUDKA.min.js +1 -0
  27. package/dist/c-55BAJ333.min.js +1 -0
  28. package/dist/c-7242NXSG.min.js +1 -0
  29. package/dist/c-7EGHJU2F.min.js +1 -0
  30. package/dist/c-7HP7MB2I.min.js +1 -0
  31. package/dist/c-7NBU5ZKS.min.js +1 -0
  32. package/dist/c-AFBSWT77.min.js +1 -0
  33. package/dist/c-AJ7EC32V.min.js +1 -0
  34. package/dist/c-AQADQNY7.min.js +1 -0
  35. package/dist/c-ATM475SA.min.js +1 -0
  36. package/dist/c-AVO3Q7T7.min.js +1 -0
  37. package/dist/c-AZKPVBOC.min.js +1 -0
  38. package/dist/c-BNFJMDHN.min.js +1 -0
  39. package/dist/c-BNG5ECK5.min.js +1 -0
  40. package/dist/c-BOHCQILI.min.js +1 -0
  41. package/dist/c-CCTGN5CK.min.js +1 -0
  42. package/dist/c-CPSPZH6A.min.js +1 -0
  43. package/dist/c-CPV4N35K.min.js +1 -0
  44. package/dist/c-D6HAAPTX.min.js +1 -0
  45. package/dist/c-DE5Q3U2X.min.js +1 -0
  46. package/dist/c-DK662R77.min.js +1 -0
  47. package/dist/c-DY2676CR.min.js +1 -0
  48. package/dist/c-E32M6XW5.min.js +1 -0
  49. package/dist/c-E4JDJH4I.min.js +1 -0
  50. package/dist/c-E7I2L7CU.min.js +1 -0
  51. package/dist/c-EBOQ7ER7.min.js +1 -0
  52. package/dist/c-ELDWAO2V.min.js +1 -0
  53. package/dist/c-EUBTECGM.min.js +1 -0
  54. package/dist/c-GNTXRXRN.min.js +1 -0
  55. package/dist/c-GSZRZRD6.min.js +1 -0
  56. package/dist/c-GWX7JGMF.min.js +1 -0
  57. package/dist/c-GXV3C3MO.min.js +1 -0
  58. package/dist/c-HHTK2R75.min.js +1 -0
  59. package/dist/c-HLLFJYTY.min.js +1 -0
  60. package/dist/c-HPOYKCCG.min.js +1 -0
  61. package/dist/c-HXDKPIKR.min.js +1 -0
  62. package/dist/c-I4QJ6YLM.min.js +1 -0
  63. package/dist/c-IDJV3CZK.min.js +1 -0
  64. package/dist/c-ITKX3RC5.min.js +1 -0
  65. package/dist/c-JG2JCQLP.min.js +1 -0
  66. package/dist/c-JLGRHXGZ.min.js +1 -0
  67. package/dist/c-JO2UGTCP.min.js +1 -0
  68. package/dist/c-JUKIWTBJ.min.js +1 -0
  69. package/dist/c-KCRJGUHP.min.js +1 -0
  70. package/dist/c-LMGSSD2E.min.js +1 -0
  71. package/dist/c-LYQMZMZQ.min.js +1 -0
  72. package/dist/c-LYVKDBQJ.min.js +1 -0
  73. package/dist/c-MVR3RWF3.min.js +1 -0
  74. package/dist/c-MXCP7GNZ.min.js +1 -0
  75. package/dist/c-NG7BLZTR.min.js +1 -0
  76. package/dist/c-NYZ2QNAM.min.js +1 -0
  77. package/dist/c-OO5QLMJC.min.js +1 -0
  78. package/dist/c-OOVX2JPQ.min.js +1 -0
  79. package/dist/c-ORLEBW72.min.js +1 -0
  80. package/dist/c-P65V6HLO.min.js +1 -0
  81. package/dist/c-PP6VY3QU.min.js +1 -0
  82. package/dist/c-PRIKOLTE.min.js +1 -0
  83. package/dist/c-PSNI6KAZ.min.js +1 -0
  84. package/dist/c-PYNW54D2.min.js +1 -0
  85. package/dist/c-QA3HMQJP.min.js +1 -0
  86. package/dist/c-ROEHCIGV.min.js +1 -0
  87. package/dist/c-S3AZX5PP.min.js +1 -0
  88. package/dist/c-T2V7O2LO.min.js +1 -0
  89. package/dist/c-TIXX5CAU.min.js +1 -0
  90. package/dist/c-TKG2NP7G.min.js +1 -0
  91. package/dist/c-VJTDST2R.min.js +1 -0
  92. package/dist/c-VXLOLYTO.min.js +1 -0
  93. package/dist/c-W4ZUKSEQ.min.js +1 -0
  94. package/dist/c-WH2O53VI.min.js +1 -0
  95. package/dist/c-WNGH47HF.min.js +1 -0
  96. package/dist/c-WUWXGQYA.min.js +1 -0
  97. package/dist/c-XDQKXPX4.min.js +1 -0
  98. package/dist/{c-CKLIFCGN.min.js → c-XSB27XPS.min.js} +1 -1
  99. package/dist/c-YDECTEUW.min.js +1 -0
  100. package/dist/c-YF3YKVQI.min.js +1 -0
  101. package/dist/c-YLZIV3VS.min.js +1 -0
  102. package/dist/c-ZYPXQF7B.min.js +1 -0
  103. package/dist/components/Annotation.d.ts +2 -1
  104. package/dist/components/ai/chartRecipeRegistry.d.ts +6 -1
  105. package/dist/components/ai/chartRecipes.d.ts +4 -0
  106. package/dist/components/ai/describePhysicsProjection.d.ts +18 -0
  107. package/dist/components/ai/describePhysicsSource.d.ts +13 -0
  108. package/dist/components/artifact/ArtifactInspector.d.ts +26 -0
  109. package/dist/components/artifact/ArtifactInspectorContextSections.d.ts +18 -0
  110. package/dist/components/artifact/artifactContractDiff.d.ts +8 -0
  111. package/dist/components/artifact/artifactInspectorSummary.d.ts +53 -0
  112. package/dist/components/artifact/artifactRevision.d.ts +54 -0
  113. package/dist/components/artifact/artifactTestFixtures.d.ts +17 -0
  114. package/dist/components/artifact/attachmentAudit.d.ts +13 -0
  115. package/dist/components/artifact/claimCorrections.d.ts +3 -0
  116. package/dist/components/artifact/claimGraph.d.ts +5 -0
  117. package/dist/components/artifact/claimLifecycle.d.ts +32 -0
  118. package/dist/components/artifact/claims.d.ts +24 -0
  119. package/dist/components/artifact/collection.d.ts +10 -0
  120. package/dist/components/artifact/collectionCorrectionScope.d.ts +4 -0
  121. package/dist/components/artifact/collectionImpact.d.ts +11 -0
  122. package/dist/components/artifact/collectionLineage.d.ts +3 -0
  123. package/dist/components/artifact/collectionOperations.d.ts +8 -0
  124. package/dist/components/artifact/collectionPolicy.d.ts +22 -0
  125. package/dist/components/artifact/collectionTypes.d.ts +117 -0
  126. package/dist/components/artifact/configurationRepair.d.ts +8 -0
  127. package/dist/components/artifact/contract.d.ts +30 -0
  128. package/dist/components/artifact/evaluateArtifact.d.ts +12 -0
  129. package/dist/components/artifact/evaluateArtifactTypes.d.ts +78 -0
  130. package/dist/components/artifact/evaluationPresentation.d.ts +9 -0
  131. package/dist/components/artifact/evidenceSample.d.ts +8 -0
  132. package/dist/components/artifact/exportPaths.d.ts +8 -0
  133. package/dist/components/artifact/fieldPolicies.d.ts +12 -0
  134. package/dist/components/artifact/fingerprint.d.ts +36 -0
  135. package/dist/components/artifact/grounding.d.ts +51 -0
  136. package/dist/components/artifact/groundingBudget.d.ts +38 -0
  137. package/dist/components/artifact/hostTransfer.d.ts +13 -0
  138. package/dist/components/artifact/identity.d.ts +19 -0
  139. package/dist/components/artifact/inheritance.d.ts +48 -0
  140. package/dist/components/artifact/inheritanceIntegrity.d.ts +3 -0
  141. package/dist/components/artifact/jsonCompatibility.d.ts +2 -0
  142. package/dist/components/artifact/obligations.d.ts +3 -0
  143. package/dist/components/artifact/policies.d.ts +45 -0
  144. package/dist/components/artifact/policyRelations.d.ts +3 -0
  145. package/dist/components/artifact/recordProjection.d.ts +7 -0
  146. package/dist/components/artifact/representation.d.ts +50 -0
  147. package/dist/components/artifact/serialization.d.ts +40 -0
  148. package/dist/components/artifact/temporal.d.ts +32 -0
  149. package/dist/components/artifact/temporalAdapters.d.ts +75 -0
  150. package/dist/components/artifact/temporalAuditHelpers.d.ts +12 -0
  151. package/dist/components/artifact/temporalPresentation.d.ts +8 -0
  152. package/dist/components/artifact/types.d.ts +341 -0
  153. package/dist/components/artifact/validation.d.ts +13 -0
  154. package/dist/components/artifact/validationFieldStatus.d.ts +7 -0
  155. package/dist/components/artifact/validationPrimitives.d.ts +24 -0
  156. package/dist/components/artifact/validationSurfaces.d.ts +7 -0
  157. package/dist/components/artifact/validationTemporal.d.ts +3 -0
  158. package/dist/components/charts/geo/FlowMap.d.ts +7 -0
  159. package/dist/components/charts/geo/flowMapLineStyle.d.ts +18 -0
  160. package/dist/components/charts/ordinal/DonutChart.d.ts +2 -0
  161. package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
  162. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -0
  163. package/dist/components/charts/ordinal/PieChart.d.ts +2 -0
  164. package/dist/components/charts/ordinal/RadarChart.d.ts +2 -0
  165. package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -0
  166. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
  167. package/dist/components/charts/physics/EventDropChart.d.ts +3 -1
  168. package/dist/components/charts/physics/GaltonBoardChart.d.ts +4 -2
  169. package/dist/components/charts/physics/ProcessFlowChart.d.ts +6 -0
  170. package/dist/components/charts/physics/UnitPileChart.d.ts +2 -1
  171. package/dist/components/charts/physics/collisionSwarmPacking.d.ts +14 -0
  172. package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +1 -0
  173. package/dist/components/charts/physics/eventDropAdmission.d.ts +32 -0
  174. package/dist/components/charts/physics/eventDropPhysics.d.ts +22 -1
  175. package/dist/components/charts/physics/galtonBoardPhysics.d.ts +2 -9
  176. package/dist/components/charts/physics/physicsChartReconcile.d.ts +4 -0
  177. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  178. package/dist/components/charts/physics/physicsGaltonData.d.ts +10 -0
  179. package/dist/components/charts/physics/physicsHocHandle.d.ts +2 -0
  180. package/dist/components/charts/physics/physicsPileData.d.ts +11 -0
  181. package/dist/components/charts/physics/physicsPilePhysics.d.ts +5 -12
  182. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +1 -1
  183. package/dist/components/charts/physics/physicsSourceRows.d.ts +8 -0
  184. package/dist/components/charts/physics/usePhysicsChartData.d.ts +19 -0
  185. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +4 -0
  186. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +14 -6
  187. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +4 -0
  188. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +4 -0
  189. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +4 -0
  190. package/dist/components/charts/realtime/realtimeAccessors.d.ts +4 -0
  191. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +8 -7
  192. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +7 -0
  193. package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +17 -11
  194. package/dist/components/charts/shared/GaugeReadout.d.ts +9 -0
  195. package/dist/components/charts/shared/ThresholdAnnotation.d.ts +18 -0
  196. package/dist/components/charts/shared/ThresholdEndCap.d.ts +7 -0
  197. package/dist/components/charts/shared/auditAccessibilityText.d.ts +4 -2
  198. package/dist/components/charts/shared/numericTickFormatter.d.ts +2 -0
  199. package/dist/components/charts/shared/radialCenterContent.d.ts +10 -0
  200. package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
  201. package/dist/components/charts/shared/useChartLegend.d.ts +4 -0
  202. package/dist/components/charts/shared/useXYPointStyle.d.ts +2 -0
  203. package/dist/components/charts/xy/BubbleChart.d.ts +7 -0
  204. package/dist/components/charts/xy/CandlestickChart.d.ts +7 -0
  205. package/dist/components/charts/xy/DifferenceChart.d.ts +7 -0
  206. package/dist/components/charts/xy/MinimapChart.d.ts +7 -0
  207. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +7 -0
  208. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +6 -0
  209. package/dist/components/charts/xy/WaterfallChart.d.ts +8 -0
  210. package/dist/components/charts/xy/differenceMarkStyle.d.ts +28 -0
  211. package/dist/components/charts/xy/multiAxisFields.d.ts +23 -0
  212. package/dist/components/charts/xy/scatterplotMatrixCells.d.ts +50 -0
  213. package/dist/components/evidence/chartEvidenceEnvelope.d.ts +16 -8
  214. package/dist/components/evidence/evidenceEnvelopeInput.d.ts +8 -0
  215. package/dist/components/evidence/evidenceEnvelopeValidation.d.ts +11 -0
  216. package/dist/components/evidence/evidenceGate.d.ts +3 -1
  217. package/dist/components/evidence/renderedSceneHash.d.ts +23 -0
  218. package/dist/components/evidence/stableJsonHash.d.ts +4 -0
  219. package/dist/components/export/chartConfig.d.ts +40 -5
  220. package/dist/components/export/chartConfigArtifact.d.ts +6 -0
  221. package/dist/components/legendLayout.d.ts +18 -0
  222. package/dist/components/legendStyles.d.ts +4 -0
  223. package/dist/components/recipes/firstAvailableTrack.d.ts +17 -0
  224. package/dist/components/recipes/intervals.d.ts +1 -1
  225. package/dist/components/semiotic-ai-core.d.ts +33 -22
  226. package/dist/components/semiotic-ai.d.ts +15 -3
  227. package/dist/components/semiotic-artifact-react.d.ts +10 -0
  228. package/dist/components/semiotic-artifact.d.ts +23 -0
  229. package/dist/components/semiotic-experimental.d.ts +1 -1
  230. package/dist/components/semiotic-physics.d.ts +4 -4
  231. package/dist/components/semiotic-text.d.ts +2 -0
  232. package/dist/components/semiotic-utils-core.d.ts +18 -18
  233. package/dist/components/semiotic.d.ts +3 -3
  234. package/dist/components/server/renderEvidence.d.ts +12 -0
  235. package/dist/components/server/renderToStaticSVG.d.ts +3 -0
  236. package/dist/components/server/staticSVGChrome.d.ts +1 -4
  237. package/dist/components/server/staticXYAxisTicks.d.ts +2 -38
  238. package/dist/components/server/staticXYGrid.d.ts +1 -1
  239. package/dist/components/server/svgSizing.d.ts +6 -0
  240. package/dist/components/shared/svgRoot.d.ts +17 -0
  241. package/dist/components/store/selectionProvenance.d.ts +6 -0
  242. package/dist/components/stream/GeoSVGOverlay.d.ts +4 -0
  243. package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -0
  244. package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -0
  245. package/dist/components/stream/SVGOverlay.d.ts +4 -0
  246. package/dist/components/stream/SceneToSVG.d.ts +4 -19
  247. package/dist/components/stream/SceneToSVGXY.d.ts +13 -0
  248. package/dist/components/stream/StreamGeoFrame.d.ts +1 -2
  249. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -2
  250. package/dist/components/stream/XYGrid.d.ts +11 -0
  251. package/dist/components/stream/axisTickUtils.d.ts +0 -1
  252. package/dist/components/stream/hitTestUtils.d.ts +2 -0
  253. package/dist/components/stream/overlayAccessibleText.d.ts +18 -0
  254. package/dist/components/stream/physics/PhysicsControllers.d.ts +1 -1
  255. package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
  256. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +5 -4
  257. package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +9 -0
  258. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +3 -0
  259. package/dist/components/stream/physics/physicsCanvasCoordinates.d.ts +5 -0
  260. package/dist/components/stream/physics/physicsFixedPosition.d.ts +16 -0
  261. package/dist/components/stream/physics/physicsKernelCloning.d.ts +6 -0
  262. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +2 -0
  263. package/dist/components/stream/physics/physicsPipelineSettle.d.ts +15 -9
  264. package/dist/components/stream/physics/physicsRegionRuntime.d.ts +8 -17
  265. package/dist/components/stream/physics/physicsSemanticUI.d.ts +9 -0
  266. package/dist/components/stream/pipelineConfig.d.ts +4 -0
  267. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +1 -1
  268. package/dist/components/stream/resolveXYAxes.d.ts +13 -0
  269. package/dist/components/stream/sceneToSVGShared.d.ts +2 -1
  270. package/dist/components/stream/seriesGeometry.d.ts +13 -0
  271. package/dist/components/stream/streamEncodingTypes.d.ts +53 -0
  272. package/dist/components/stream/types.d.ts +4 -53
  273. package/dist/components/stream/useGeoFrameHandle.d.ts +16 -0
  274. package/dist/components/stream/useOrdinalFrameHandle.d.ts +15 -0
  275. package/dist/components/stream/useXYFrameHandle.d.ts +15 -0
  276. package/dist/components/stream/xyAxisTicks.d.ts +25 -0
  277. package/dist/components/stream/xyDateTicks.d.ts +3 -2
  278. package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
  279. package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +1 -1
  280. package/dist/components/stream/xySceneBuilders/types.d.ts +1 -0
  281. package/dist/components/text/annotationTextLayout.d.ts +28 -0
  282. package/dist/components/text/pretextAnnotationLayout.d.ts +29 -0
  283. package/dist/components/text/usePretextAnnotations.d.ts +12 -0
  284. package/dist/controls.module.min.js +1 -1
  285. package/dist/geo.min.js +1 -1
  286. package/dist/geo.module.min.js +1 -1
  287. package/dist/network.module.min.js +1 -1
  288. package/dist/ordinal.module.min.js +1 -1
  289. package/dist/physics-matter.min.js +1 -1
  290. package/dist/physics-matter.module.min.js +1 -1
  291. package/dist/physics-rapier.min.js +1 -1
  292. package/dist/physics-rapier.module.min.js +1 -1
  293. package/dist/physics.module.min.js +1 -1
  294. package/dist/physicsWorker.js +1 -1
  295. package/dist/processSankeyLayoutWorker.js +1 -1
  296. package/dist/rough.min.js +1 -1
  297. package/dist/rough.module.min.js +1 -1
  298. package/dist/semiotic-access.module.min.js +1 -1
  299. package/dist/semiotic-ai-artifact-policy-constants.module.min.js +2 -0
  300. package/dist/semiotic-ai-core.d.ts +33 -22
  301. package/dist/semiotic-ai-core.min.js +1 -1
  302. package/dist/semiotic-ai-core.module.min.js +1 -1
  303. package/dist/semiotic-ai-hash-primitives.module.min.js +2 -0
  304. package/dist/semiotic-ai.d.ts +15 -3
  305. package/dist/semiotic-ai.module.min.js +1 -1
  306. package/dist/semiotic-artifact-react.d.ts +10 -0
  307. package/dist/semiotic-artifact-react.min.js +2 -0
  308. package/dist/semiotic-artifact-react.module.min.js +2 -0
  309. package/dist/semiotic-artifact.d.ts +23 -0
  310. package/dist/semiotic-artifact.min.js +1 -0
  311. package/dist/semiotic-artifact.module.min.js +1 -0
  312. package/dist/semiotic-client-cjs-shared.min.js +1 -1
  313. package/dist/semiotic-client-glyph.module.min.js +1 -1
  314. package/dist/semiotic-client-responsive.module.min.js +1 -1
  315. package/dist/semiotic-client-shared.module.min.js +1 -1
  316. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +1 -1
  317. package/dist/semiotic-data.min.js +1 -1
  318. package/dist/semiotic-data.module.min.js +1 -1
  319. package/dist/semiotic-evidence.min.js +1 -1
  320. package/dist/semiotic-evidence.module.min.js +1 -1
  321. package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
  322. package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
  323. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  324. package/dist/semiotic-experimental-vacp.min.js +1 -1
  325. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  326. package/dist/semiotic-experimental.d.ts +1 -1
  327. package/dist/semiotic-line.module.min.js +1 -1
  328. package/dist/semiotic-physics.d.ts +4 -4
  329. package/dist/semiotic-realtime-core.module.min.js +1 -1
  330. package/dist/semiotic-realtime-react.module.min.js +1 -1
  331. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  332. package/dist/semiotic-recipes-core.module.min.js +1 -1
  333. package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
  334. package/dist/semiotic-recipes-react.min.js +1 -1
  335. package/dist/semiotic-server-edge-node.module.min.js +1 -1
  336. package/dist/semiotic-server-edge.min.js +1 -1
  337. package/dist/semiotic-server-edge.module.min.js +1 -1
  338. package/dist/semiotic-server-node.min.js +1 -1
  339. package/dist/semiotic-server-node.module.min.js +1 -1
  340. package/dist/semiotic-text.d.ts +2 -0
  341. package/dist/semiotic-text.min.js +2 -0
  342. package/dist/semiotic-text.module.min.js +2 -0
  343. package/dist/semiotic-themes-core.min.js +1 -1
  344. package/dist/semiotic-themes-core.module.min.js +1 -1
  345. package/dist/semiotic-themes.min.js +1 -1
  346. package/dist/semiotic-themes.module.min.js +1 -1
  347. package/dist/semiotic-utils-core.d.ts +18 -18
  348. package/dist/semiotic-utils-core.min.js +1 -1
  349. package/dist/semiotic-utils-core.module.min.js +1 -1
  350. package/dist/semiotic-value.module.min.js +1 -1
  351. package/dist/semiotic.d.ts +3 -3
  352. package/dist/semiotic.module.min.js +1 -1
  353. package/dist/server.min.js +1 -1
  354. package/dist/server.module.min.js +1 -1
  355. package/dist/xy.module.min.js +1 -1
  356. package/package.json +55 -14
  357. package/spec/README.md +8 -3
  358. package/spec/v0.1/artifact-contract.schema.json +2299 -0
  359. package/spec/v0.1/examples/artifact-contract-full.json +369 -0
  360. package/spec/v0.1/examples/artifact-contract-unknown-state.json +46 -0
  361. package/dist/c-3BLJEQNG.min.js +0 -1
  362. package/dist/c-3SCUN5HI.min.js +0 -1
  363. package/dist/c-3VVKFA4M.min.js +0 -1
  364. package/dist/c-43TJZS3F.min.js +0 -1
  365. package/dist/c-4DTZPSUD.min.js +0 -1
  366. package/dist/c-4ES5367Y.min.js +0 -1
  367. package/dist/c-52TEGIUJ.min.js +0 -1
  368. package/dist/c-54IRWOGM.min.js +0 -1
  369. package/dist/c-5D2S4RMI.min.js +0 -1
  370. package/dist/c-5JWCTX3G.min.js +0 -1
  371. package/dist/c-6CMMSN6N.min.js +0 -1
  372. package/dist/c-6HRB2L7H.min.js +0 -1
  373. package/dist/c-6O5EVOPH.min.js +0 -1
  374. package/dist/c-7W4SV36A.min.js +0 -1
  375. package/dist/c-A4WRGZFX.min.js +0 -1
  376. package/dist/c-AG7WWVIH.min.js +0 -1
  377. package/dist/c-AH6J4MTN.min.js +0 -1
  378. package/dist/c-AKAF6JAD.min.js +0 -1
  379. package/dist/c-ALYR5LKK.min.js +0 -1
  380. package/dist/c-BBKITSXB.min.js +0 -1
  381. package/dist/c-BYDPC44I.min.js +0 -1
  382. package/dist/c-CFFIU2MW.min.js +0 -1
  383. package/dist/c-CGNHBHCE.min.js +0 -1
  384. package/dist/c-CJYSXIFV.min.js +0 -1
  385. package/dist/c-CZF7MV67.min.js +0 -1
  386. package/dist/c-D53OKBSY.min.js +0 -1
  387. package/dist/c-DADXPJXV.min.js +0 -1
  388. package/dist/c-DBQ2V7CH.min.js +0 -1
  389. package/dist/c-DPMVAUAW.min.js +0 -1
  390. package/dist/c-ECJCKLYY.min.js +0 -1
  391. package/dist/c-EGATGOWJ.min.js +0 -1
  392. package/dist/c-EGR6VYBW.min.js +0 -1
  393. package/dist/c-ESNR43AN.min.js +0 -1
  394. package/dist/c-F3LIKINL.min.js +0 -1
  395. package/dist/c-F5ZB5GJ6.min.js +0 -1
  396. package/dist/c-G36WS6LN.min.js +0 -1
  397. package/dist/c-G3VYMHKE.min.js +0 -1
  398. package/dist/c-GGISSW5E.min.js +0 -1
  399. package/dist/c-GR6MOEQC.min.js +0 -1
  400. package/dist/c-GSVCN34B.min.js +0 -1
  401. package/dist/c-GYOQCEFP.min.js +0 -1
  402. package/dist/c-H3DNMTCC.min.js +0 -1
  403. package/dist/c-I6J3FEZE.min.js +0 -1
  404. package/dist/c-IGH6MGJ5.min.js +0 -1
  405. package/dist/c-II2EEAJN.min.js +0 -1
  406. package/dist/c-IUHFPMHD.min.js +0 -1
  407. package/dist/c-J6M4JHRS.min.js +0 -1
  408. package/dist/c-JM3MGLQV.min.js +0 -1
  409. package/dist/c-KM3N7F7R.min.js +0 -1
  410. package/dist/c-LF5BZFNC.min.js +0 -1
  411. package/dist/c-LKBSGFQC.min.js +0 -1
  412. package/dist/c-MNF2S4AA.min.js +0 -1
  413. package/dist/c-MT3WBK7M.min.js +0 -1
  414. package/dist/c-NDJADPIF.min.js +0 -1
  415. package/dist/c-NVPQCIL5.min.js +0 -1
  416. package/dist/c-NY3JWV2K.min.js +0 -1
  417. package/dist/c-OFWJBEE5.min.js +0 -1
  418. package/dist/c-OYFHP5F5.min.js +0 -1
  419. package/dist/c-PGKQGGQ2.min.js +0 -1
  420. package/dist/c-PPWDL5ZI.min.js +0 -1
  421. package/dist/c-Q2IPZ3MU.min.js +0 -1
  422. package/dist/c-QKHMBE2E.min.js +0 -1
  423. package/dist/c-QMVM3AY6.min.js +0 -1
  424. package/dist/c-QSGWX53A.min.js +0 -1
  425. package/dist/c-RJKEKZOO.min.js +0 -1
  426. package/dist/c-RSVIHIQ4.min.js +0 -1
  427. package/dist/c-S6U5CGT5.min.js +0 -1
  428. package/dist/c-SFDIIU5G.min.js +0 -1
  429. package/dist/c-SLGMUBUL.min.js +0 -1
  430. package/dist/c-SRTBCRVE.min.js +0 -1
  431. package/dist/c-T6UAIKBH.min.js +0 -1
  432. package/dist/c-TMCTEVVW.min.js +0 -1
  433. package/dist/c-TMOSJLT3.min.js +0 -1
  434. package/dist/c-TZW3JGJ5.min.js +0 -1
  435. package/dist/c-U6ESPM7V.min.js +0 -1
  436. package/dist/c-UC5PTTFI.min.js +0 -1
  437. package/dist/c-USFMFKIH.min.js +0 -1
  438. package/dist/c-VGKUEZBC.min.js +0 -1
  439. package/dist/c-VGW3VG3I.min.js +0 -1
  440. package/dist/c-VN2HG5BS.min.js +0 -1
  441. package/dist/c-VPZDY5Q4.min.js +0 -1
  442. package/dist/c-VRXUB2F2.min.js +0 -1
  443. package/dist/c-VUBQNQJH.min.js +0 -1
  444. package/dist/c-VUH4PGZY.min.js +0 -1
  445. package/dist/c-W3CE4A4S.min.js +0 -1
  446. package/dist/c-X5UBGU2V.min.js +0 -1
  447. package/dist/c-XDRV7RKW.min.js +0 -1
  448. package/dist/c-YGZHURXZ.min.js +0 -1
  449. package/dist/c-YZVRZGX2.min.js +0 -1
  450. /package/dist/{c-N4G2L7ID.min.js → c-HYW2XA4Q.min.js} +0 -0
  451. /package/dist/{c-ENF72HU5.min.js → c-QAVFOEUY.min.js} +0 -0
  452. /package/dist/{c-OCI56QF2.min.js → c-V4XMSLC3.min.js} +0 -0
@@ -0,0 +1 @@
1
+ function e(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function a(e,a,r){let f=e=>e.toString(16).padStart(2,"0");return`#${f(e)}${f(a)}${f(r)}`}function r(r){let f=r.map(e),t=f.length-1;return e=>{if(Number.isNaN(e)&&(e=0),0>=e){let[e,r,t]=f[0];return a(e,r,t)}if(e>=1){let[e,r,d]=f[t];return a(e,r,d)}let r=e*t,d=Math.floor(r),n=r-d,[l,b,i]=f[d],[o,c,u]=f[d+1];return a(Math.round(l+(o-l)*n),Math.round(b+(c-b)*n),Math.round(i+(u-i)*n))}}function f(e){return e&&Object.prototype.hasOwnProperty.call(A,e)?A[e]:o}function t(e,a,r=$){if(e&&"object"==typeof e&&!Array.isArray(e)){let a=Object.values(e).filter(e=>"string"==typeof e&&e.length>0);if(a.length>0)return a}if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e){let a=Object.prototype.hasOwnProperty.call(W,e)?W[e]:void 0;if(Array.isArray(a)&&a.length>0)return a}return a&&a.length>0?a:r}function d(e,a,r){if("function"==typeof a){let f=a(e);return r&&f&&"string"==typeof f&&!function(e){let a=e.toLowerCase();return a.startsWith("#")||a.startsWith("rgb")||a.startsWith("hsl")||L.has(a)}(f)?r(f):f}let f=e?.[a]+"";return r?r(f):$[Math.abs(function(e){let a=0;for(let r=0;e.length>r;r++)a=(a<<5)-a+e.charCodeAt(r),a&=a;return Math.abs(a)}(f))%$.length]}function n(e,a){if(null==a||!Object.prototype.hasOwnProperty.call(e,a))return;let r=e[a];return"string"==typeof r&&r.length>0?r:void 0}function l(e,a,r="category10"){if(r&&"object"==typeof r&&!Array.isArray(r)){let e=r;return a=>n(e,a)??"#999"}let f=Array.from(new Set(e.map(e=>e?.[a]).filter(e=>null!=e).map(e=>e+""))),t=f.every(e=>!isNaN(Number(e)));if(Array.isArray(r))return I().domain(f).range(r).unknown("#999");let d=Object.prototype.hasOwnProperty.call(W,r)?W[r]:W.category10;if(t&&"function"==typeof d){let e=-1/0;for(let a of f){let r=Number(a);r>e&&(e=r)}return a=>d(0===e?0:Number(a)/e)}{let e=Array.isArray(d)?d:$;return I().domain(f).range(e).unknown("#999")}}function b(e,a,r=[3,20],f){let t;if(t="function"==typeof a?a(e):e?.[a],!f)return t;let[d,n]=f,[l,b]=r;if(n===d)return(l+b)/2;let i=(t-d)/(n-d);return 0>i?i=0:i>1&&(i=1),l+i*(b-l)}var i=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],o=r(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),c=r(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),u=r(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),s=r(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),g=r(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),y=r(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),h=r(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),p=r(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),m=r(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),k=r(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),w=r(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),v=r(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),A={blues:o,reds:c,greens:u,viridis:h,oranges:s,purples:g,greys:y,plasma:p,inferno:m,magma:k,cividis:w,turbo:v},q=r(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),O=r(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),j=r(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),N=r(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),M=r(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),P=r(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),S=r(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]);import{scaleOrdinal as I}from"d3-scale";var W={category10:i,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],...A},$=i,C="#007bff",x=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],z=["#f0f0f0","#b5d4ea","#f4c2a1","#b8dab2","#d4b5e0","#f9e0a2","#a8d8d8"],L=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"]);export{i as schemeCategory10,h as interpolateViridis,A as SEQUENTIAL_INTERPOLATORS,f as getSequentialInterpolator,q as interpolateRdBu,O as interpolatePiYG,j as interpolatePRGn,N as interpolateBrBG,M as interpolateRdYlBu,P as interpolateRdYlGn,S as interpolateSpectral,W as COLOR_SCHEMES,$ as DEFAULT_COLORS,C as DEFAULT_COLOR,t as resolveCategoricalPalette,x as STREAMING_PALETTE,z as DEPTH_PALETTE_COLORS,d as getColor,n as resolveExplicitColor,l as createColorScale,b as getSize};
@@ -0,0 +1 @@
1
+ function e(e,r){let t=e.length,n=r.length,a=Array(n+1);for(let e=0;n>=e;e++)a[e]=e;for(let o=1;t>=o;o++){let t=a[0];a[0]=o;for(let i=1;n>=i;i++){let n=a[i];a[i]=e[o-1]===r[i-1]?t:1+Math.min(t,a[i],a[i-1]),t=n}}return a[n]}function r(r,t,n=3){let a,o=n+1;for(let n of t){let t=e(r.toLowerCase(),n.toLowerCase());o>t&&(o=t,a=n)}return o>n?void 0:a}function t(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:[...e]}function n(e,t){if(0===t.length)return null;let n=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(n)||n.includes(e.toLowerCase()))||(r(e,t,3)??null)}function a(e){return` Or use a function: ${e}={d => d.myValue}.`}function o({componentName:e,data:r,accessors:o,requiredProps:i}){if(i)for(let[r,t]of Object.entries(i))if(null==t)return`${e}: ${r} is required. Provide a field name or function.`;if(null==r)return null;if(!Array.isArray(r)&&"object"==typeof r)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(!Array.isArray(r)||0===r.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(o){let i=t(r).find(e=>e&&"object"==typeof e);if(i){let r=Object.keys(i);for(let[t,l]of Object.entries(o))if(l&&"string"==typeof l&&!(l in i)){let o=n(l,r),i=o?` Try ${t}="${o}".`:"";return`${e}: ${t} "${l}" not found in data. Available fields: ${r.join(", ")}.${i}`+a(t)}}}return null}function i({componentName:e,data:r,dataLabel:t="data"}){return null==r?`${e}: No ${t} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(r)?`${e}: ${t} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}function l({componentName:e,nodes:r,edges:o,nodesRequired:i=!1,edgesRequired:l=!0,accessors:u}){if(null==r&&null==o)return null;if(l&&(!o||!Array.isArray(o)||0===o.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(i&&(!r||!Array.isArray(r)||0===r.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(u&&r&&r.length>0){let o=t(r).find(e=>e&&"object"==typeof e);if(o){let r=Object.keys(o);for(let[t,i]of Object.entries(u))if(i&&"string"==typeof i&&!(i in o)){let o=n(i,r),l=o?` Try ${t}="${o}".`:"";return`${e}: ${t} "${i}" not found in node data. Available fields: ${r.join(", ")}.${l}`+a(t)}}}return null}export{r as closestMatch,o as validateArrayData,i as validateObjectData,l as validateNetworkData};
@@ -0,0 +1 @@
1
+ function e({isPushMode:e,colorBy:y,colorScheme:u,showLegend:h,legendPosition:p="right",trackCategoryDomain:C=!0,registerLinkedCategories:S=!0}){let[w,A]=c(0),P=t(),b=n(),j=i(),v=e&&!!y&&(C||j),D="function"==typeof y?m:y,M=f(()=>({lifecycle:{colorByDomainKey:D,isPushMode:e,shouldTrackCategoryDomain:v},categories:new Set,ordered:[]}),[D,e,v]),L=d(e=>y?("function"==typeof y?y(e):e[y])+"":null,[y]),k=d(e=>{if(!v)return;let r=!1;for(let t of e){if(!t||"object"!=typeof t)continue;let e=L(t);null!=e&&!M.categories.has(e)&&(M.categories.add(e),M.ordered.push(e),r=!0)}r&&A(e=>e+1)},[M,L,v]),B=d(e=>{if(!v)return;let r=Array.from(new Set(e.map(String))),t=M.ordered;t.length===r.length&&t.every((e,t)=>e===r[t])||(M.categories=new Set(r),M.ordered=r,A(e=>e+1))},[M,v]),K=d(e=>r=>{k([r]),e(r)},[k]),_=d(e=>r=>{k(r),e(r)},[k]),x=d(()=>{M.categories=new Set,M.ordered=[],A(e=>e+1)},[M]),E=f(()=>v?[...M.ordered]:[],[M,v,w]);o(S&&e&&y?E:[]);let G=f(()=>{if(!e||!y||!1===h)return;let t=M.ordered;if(0===t.length)return;let o=Array.isArray(u)&&u.length>0||"string"==typeof u&&u.length>0?u:b&&b.length>0?b:a,i="string"==typeof y?y:"__streamCat",n=t.map(e=>({[i]:e})),c=g(n,i,o),d=u&&"object"==typeof u&&!Array.isArray(u)?u:void 0;return r({data:n,colorBy:i,colorScale:e=>(P?l(P,e):void 0)??(d?l(d,e):void 0)??c(e)??"#999",getColor:s})},[e,y,h,u,P,b,w,M]),N=f(()=>{if(G)return"right"===p?{right:110}:"left"===p?{left:110}:"top"===p?{top:50}:"bottom"===p?{bottom:80}:{right:110}},[G,p]);return{wrapPush:K,wrapPushMany:_,resetCategories:x,categories:E,categoryDomainProps:v?{legendCategoryAccessor:y,onCategoriesChange:B}:{},streamingLegend:G,streamingMarginAdjust:N}}import{createLegend as r,useCategoryColors as t,useLinkedChartCategories as o,useLinkedChartCategoryRegistryActive as i,useThemeCategorical as n}from"./c-LMGSSD2E.min.js";import{STREAMING_PALETTE as a,createColorScale as g,getColor as s,resolveExplicitColor as l}from"./c-CPV4N35K.min.js";import{useState as c,useCallback as d,useMemo as f}from"react";var m=Symbol("streaming-function-color-domain");export{e as useStreamingLegend};
@@ -0,0 +1 @@
1
+ function e(e,t){let{x:o,y:l,w:r,h:i}=t,{tl:a,tr:y,br:c,bl:s}=n(t);e.beginPath(),e.moveTo(o+a,l),e.lineTo(o+r-y,l),y>0&&e.arcTo(o+r,l,o+r,l+y,y),e.lineTo(o+r,l+i-c),c>0&&e.arcTo(o+r,l+i,o+r-c,l+i,c),e.lineTo(o+s,l+i),s>0&&e.arcTo(o,l+i,o,l+i-s,s),e.lineTo(o,l+a),a>0&&e.arcTo(o,l,o+a,l,a),e.closePath()}function t(e,t){let o=c(e,t.style.fill,y(e,"var(--semiotic-primary, #007bff)")),l=function(e){switch(e.roundedEdge){case"bottom":return{x0:e.x,y0:e.y+e.h,x1:e.x,y1:e.y};case"right":return{x0:e.x+e.w,y0:e.y,x1:e.x,y1:e.y};case"left":return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y};default:return{x0:e.x,y0:e.y,x1:e.x,y1:e.y+e.h}}}(t);return(t.fillGradient&&"string"==typeof o?i(e,t.fillGradient,o,l.x0,l.y0,l.x1,l.y1):null)||o}function o(e,t){if(!t.style.stroke||"none"===t.style.stroke)return!1;let o=t.style.strokeWidth??1;return o>0&&(e.strokeStyle=y(e,t.style.stroke)||t.style.stroke,e.lineWidth=o,!0)}function l(e,t){let o=t.style.icon,l=t.style.iconPadding||2,r=Math.min(t.w,t.h)-l;if(0>=r)return;let i=t.h>t.w;if(e.save(),e.beginPath(),e.rect(t.x,t.y,t.w,t.h),e.clip(),i){let i=r+l,n=t.x+(t.w-r)/2;for(let l=t.y+t.h-r;l>=t.y-r;l-=i)e.drawImage(o,n,l,r,r)}else{let i=r+l,n=t.y+(t.h-r)/2;for(let l=t.x;t.x+t.w>l;l+=i)e.drawImage(o,l,n,r,r)}e.restore()}import{renderRectPulse as r}from"./c-W4ZUKSEQ.min.js";import{buildLinearFillGradient as i,clampCornerRadii as n,hasAnyCornerRadius as a,resolveCSSColor as y,resolveCanvasFill as c}from"./c-553QUDKA.min.js";var s=(i,n,y,c)=>{let s=n.filter(e=>"rect"===e.type);for(let n of s){if(null!=n.style.opacity&&(i.globalAlpha=n.style.opacity),n.style.icon)l(i,n);else if(n.cornerRadii&&a(n.cornerRadii))i.fillStyle=t(i,n),e(i,n),i.fill(),o(i,n)&&i.stroke();else if(n.roundedTop&&n.roundedTop>0){i.fillStyle=t(i,n);let e=Math.min(n.roundedTop,n.w/2,n.h/2);i.beginPath();let{x:l,y:r,w:a,h:y}=n;switch(n.roundedEdge){case"right":i.moveTo(l,r),i.lineTo(l+a-e,r),i.arcTo(l+a,r,l+a,r+e,e),i.lineTo(l+a,r+y-e),i.arcTo(l+a,r+y,l+a-e,r+y,e),i.lineTo(l,r+y);break;case"left":i.moveTo(l+a,r),i.lineTo(l+e,r),i.arcTo(l,r,l,r+e,e),i.lineTo(l,r+y-e),i.arcTo(l,r+y,l+e,r+y,e),i.lineTo(l+a,r+y);break;case"bottom":i.moveTo(l,r),i.lineTo(l+a,r),i.lineTo(l+a,r+y-e),i.arcTo(l+a,r+y,l+a-e,r+y,e),i.lineTo(l+e,r+y),i.arcTo(l,r+y,l,r+y-e,e);break;default:i.moveTo(l,r+y),i.lineTo(l,r+e),i.arcTo(l,r,l+e,r,e),i.lineTo(l+a-e,r),i.arcTo(l+a,r,l+a,r+e,e),i.lineTo(l+a,r+y)}i.closePath(),i.fill(),o(i,n)&&i.stroke()}else i.fillStyle=t(i,n),i.fillRect(n.x,n.y,n.w,n.h),o(i,n)&&i.strokeRect(n.x,n.y,n.w,n.h);r(i,n),i.globalAlpha=1}};export{s as barCanvasRenderer};
@@ -0,0 +1 @@
1
+ function e({content:e,centerX:t,centerY:o,width:i,height:r}){let a=function(e,t,o){if(!ui.isValidElement(e)||!gi.has(e.type))return null;let i=e,r="text"===i.type?ui.cloneElement(i,{x:i.props.x??0,y:i.props.y??0,textAnchor:i.props.textAnchor??"middle",dominantBaseline:i.props.dominantBaseline??"middle"}):i;return mi("g",{className:"semiotic-radial-center-content",transform:`translate(${t},${o})`,pointerEvents:"none",children:r})}(e,t,o);return a?mi("svg",{width:i,height:r,style:{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},children:a}):mi("div",{style:{position:"absolute",left:t,top:o,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:e})}function t(e,t,o){let{scales:i,config:r,getConnector:a,getO:n}=e;if(!a||!i)return[];let l=[],{projection:s}=i,c=new Map;for(let e of t){if("point"!==e.type&&"rect"!==e.type)continue;let t=e.datum;if(!t)continue;let o,i,r=a(t);r&&("point"===e.type?(o=e.x,i=e.y):(o=e.x+e.w/2,i=e.y+("vertical"===s?0:e.h/2)),c.has(r)||c.set(r,[]),c.get(r).push({x:o,y:i,datum:t,category:n(t)}))}let h=new Map(i.o.domain().map((e,t)=>[e,t])),d=r.connectorStyle,u={stroke:e.config.themeSemantic?.border||e.config.themeSemantic?.secondary||"#999",strokeWidth:1,opacity:.5},m=(e,t,o)=>{var i;l.push({type:"connector",x1:e.x,y1:e.y,x2:t.x,y2:t.y,style:(i=e.datum,"function"==typeof d?d(i):d||u),datum:e.datum,group:o})};for(let[e,t]of c)if(t.length>=2){t.sort((e,t)=>(h.get(e.category)??-1)-(h.get(t.category)??-1));for(let o=0;t.length-1>o;o++)m(t[o],t[o+1],e);"radial"===s&&t.length>=3&&m(t[t.length-1],t[0],e)}return l}function o(e,t,o){let i="function"==typeof e?e(o?t.w:t.h):e;return"number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0}function i(e){let t=e.getSymbol;return t?li(t,e.config.symbolMap):null}function r(e,t,o,i,r,a,n){e.push(t?{type:"symbol",x:i,y:r,size:Math.PI*a*a,symbolType:t(o),style:n,datum:o}:{type:"point",x:i,y:r,r:a,style:n,datum:o})}function a(e,t){let{columns:o,config:i,resolvePieceStyle:r}=e,a=[],n=Math.min(t.width,t.height)/2-4,l="donut"===i.chartType?i.innerRadius||60:0,s=-Math.PI/2+(i.startAngle||0)*Math.PI/180,c=null!=i.sweepAngle?i.sweepAngle*Math.PI/180:2*Math.PI,h=null!=i.sweepAngle&&360>i.sweepAngle,d=Object.values(o),u=d.some(e=>{let t=e.pieceData[0];return t&&("number"==typeof t._pct||"number"==typeof t._pctStart||null!=t._roundedEnds)}),m=h&&!u&&d.length>1&&(i.cornerRadius??0)>0;for(let e=0;d.length>e;e++){let t=d[e],o=t.pieceData[0],h="number"==typeof o?._pctStart?o._pctStart:t.pctStart,u=s+h*c,g=s+(h+("number"==typeof o?._pct?o._pct:t.pct))*c,p=r(t.pieceData[0],t.name),f=0===e,y=e===d.length-1,v={type:"wedge",cx:0,cy:0,innerRadius:l,outerRadius:n,startAngle:u,endAngle:g,...i.cornerRadius&&{cornerRadius:i.cornerRadius},style:p,datum:o?._nonInteractive?null:t.pieceData,category:t.name};o?._roundedEnds?v.roundedEnds=o._roundedEnds:m&&(v.roundedEnds={start:f,end:y}),o?._gradientBand&&(v._gradientBand=o._gradientBand),a.push(v)}return a}function n(e,t,o){return{...e[0],...o,category:t,data:e}}function l(e){let t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:Ri(e,.25)??o,median:Ri(e,.5)??(o+i)/2,q3:Ri(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}function s(e,t,o,i,r){let a=Array(r).fill(0);for(let n of e)t>n||n>o||a[Math.min(Math.floor((n-t)/i),r-1)]++;return a}function c(e,t,o){let i=rt(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function h(e,t,o,i=30){let r=t-e.x,a=o-e.y,n=Math.sqrt(r*r+a*a);return n>it(e.r,i)?null:{datum:e.datum,x:e.x,y:e.y,distance:n}}function d(e,t,o,i=30){let r=t-e.x,a=o-e.y,n=Math.sqrt(r*r+a*a);return n>it(di(e.size),i)?null:{datum:e.datum,x:e.x,y:e.y,distance:n}}function u(e,t,o,i=30){if(null==e.datum)return null;let r=ii(e.glyph,e.size),a=e.x+r.centerDx,n=e.y+r.centerDy,l=t-a,s=o-n,c=Math.sqrt(l*l+s*s);return c>it(r.radius,i)?null:{datum:e.datum,x:a,y:n,distance:c}}function m(e,t,o){let i=t-e.cx,r=o-e.cy,a=Math.sqrt(i*i+r*r);if(e.innerRadius>a||a>e.outerRadius)return null;let n=nt(Math.atan2(r,i)),l=nt(e.startAngle),s=nt(e.endAngle);if(!(l>s?n>=l||s>=n:n>=l&&s>=n))return null;let c=(e.startAngle+e.endAngle)/2,h=(e.innerRadius+e.outerRadius)/2;return{datum:e.datum,x:e.cx+Math.cos(c)*h,y:e.cy+Math.sin(c)*h,distance:0,category:e.category}}function g(e,t,o){let i=e.columnWidth/2;if("vertical"===e.projection){if(!(e.x-i>t||t>e.x+i||Math.min(e.minPos,e.maxPos)>o||o>Math.max(e.minPos,e.maxPos)))return{datum:e.datum,x:e.x,y:e.medianPos,distance:0,category:e.category,stats:e.stats}}else{let r=e.y-i,a=e.y+i;if(!(Math.min(e.minPos,e.maxPos)>t||t>Math.max(e.minPos,e.maxPos)||r>o||o>a))return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function p(e,t,o){if(!e.bounds)return null;let{x:i,y:r,width:a,height:n}=e.bounds;return i>t||t>i+a||r>o||o>r+n?null:{datum:e.datum,x:i+a/2,y:r+n/2,distance:0,category:e.category,stats:e.stats}}function f(e,t,o,i){let r=e.style.strokeWidth??1;if(0>=r||"none"===e.style.stroke)return null;let a=b(t,o,e.x1,e.y1,e.x2,e.y2);return!a||a.distance>Math.max(i,r/2)?null:{datum:e.datum,x:a.x,y:a.y,distance:a.distance,category:e.group}}function y(e,t,o){if(3>e.points.length)return null;let i=x(e.points,t,o),r=w(e.points,t,o),a=e.style.strokeWidth??1;if(!(r||e.style.stroke&&"none"!==e.style.stroke&&a>0&&a/2>=i))return null;let n=v(e.points);return{datum:e.datum,x:n.x,y:n.y,distance:r?0:i,category:e.category}}function v(e){let t=e.reduce((e,t)=>({x:e.x+t[0],y:e.y+t[1]}),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function b(e,t,o,i,r,a){let n=r-o,l=a-i,s=n*n+l*l;if(0===s)return null;let c=Math.max(0,Math.min(1,((e-o)*n+(t-i)*l)/s)),h=o+c*n,d=i+c*l;return{x:h,y:d,distance:Math.hypot(e-h,t-d)}}function x(e,t,o){let i=1/0;for(let r=0;e.length>r;r++){let a=e[r],n=e[(r+1)%e.length],l=b(t,o,a[0],a[1],n[0],n[1]);l&&i>l.distance&&(i=l.distance)}return i}function w(e,t,o){if(x(e,t,o)<=16*Number.EPSILON)return!0;let i=!1;for(let r=0,a=e.length-1;e.length>r;a=r++){let[n,l]=e[r],[s,c]=e[a];l>o!=c>o&&(s-n)*(o-l)/(c-l)+n>t&&(i=!i)}return i}function k(e){let t=e.pointer.clientX-e.canvasRect.left-e.margin.left,o=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>o||o>e.height)return{kind:"outside"};if(0===e.scene.length)return{kind:"miss"};let i="radial"===e.projection,r=function(e,t,o,i=30,r,a=0){let n=null,l=null;if(r){let e=ot(r,t,o,i,a);e&&!1!==e.node.interactive&&(n={node:e.node,datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(let a of e){let e=null;switch(a.type){case"rect":if(null==a.datum)break;e=c(a,t,o);break;case"point":if(!1===a.interactive||r)break;e=h(a,t,o,i);break;case"symbol":e=d(a,t,o,i);break;case"glyph":e=u(a,t,o,i);break;case"wedge":if(null===a.datum)break;e=m(a,t,o);break;case"boxplot":e=g(a,t,o);break;case"violin":e=p(a,t,o);break;case"connector":e=f(a,t,o,i);break;case"trapezoid":e=y(a,t,o)}e&&(e.node=a,"connector"===a.type?(!l||l.distance>e.distance)&&(l=e):(!n||n.distance>e.distance)&&(n=e))}return n??l??function(e,t,o){let i=new Map;for(let t of e){if("connector"!==t.type)continue;let e=t.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}for(let e of i.values()){let i=e[0];if(2>e.length||!i.style.fill||"none"===i.style.fill)continue;let r=[[i.x1,i.y1],...e.map(e=>[e.x2,e.y2])];if(!w(r,t,o))continue;let a=v(r);return{node:i,datum:i.datum,x:a.x,y:a.y,distance:0,category:i.group}}return null}(e,t,o)}(e.scene,i?t-e.width/2:t,i?o-e.height/2:o,e.hoverRadius,e.pointQuadtree,e.maxPointRadius);return r?{kind:"hit",hit:r}:{kind:"miss"}}function A(e,t){return Wt(e.datum||{},e.x,e.y,{...e.stats&&{stats:e.stats},...e.category&&{category:e.category},__oAccessor:"string"==typeof t.oAccessor?t.oAccessor:void 0,__rAccessor:"string"==typeof t.rAccessor?t.rAccessor:void 0,__chartType:t.chartType})}function S(e){let{width:t,height:o,totalWidth:i,totalHeight:r,margin:a,scales:n,showAxes:l,showGrid:s}=e,{rTickValues:c,axisExtent:h}=e,d="radial"===n?.projection,u="horizontal"===n?.projection,m=Vi(()=>n&&!d&&s?(c||Ae(n.r,5,h)).map(e=>({value:e,pixel:n.r(e)})):[],[n,d,c,h,s]),g=s&&n&&!d,p=l&&n&&!d;return g||p?Yi("svg",{width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:Qi("g",{transform:`translate(${a.left},${a.top})`,children:[g&&Yi("g",{className:"ordinal-grid",children:m.map((e,i)=>Yi("line",{x1:u?e.pixel:0,y1:u?0:e.pixel,x2:u?e.pixel:t,y2:u?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),p&&Yi(Xi,{children:Qi(Xi,u?{children:[Yi("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yi("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[Yi("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yi("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function R(e){let{width:t,height:o,totalWidth:i,totalHeight:r,margin:a,scales:n,showAxes:l,showCategoryTicks:s,oLabel:c,rLabel:h,oFormat:d,rFormat:u,showGrid:m,title:g,description:p,idPrefix:f,legend:y,legendHoverBehavior:v,legendClickBehavior:b,legendHighlightedCategory:x,legendIsolatedCategories:w,legendPosition:k="right",legendLayout:A,foregroundGraphics:S,annotations:R,onAnnotationActivate:P,onObservation:C,chartId:_,chartType:L,autoPlaceAnnotations:M,svgAnnotationRules:I,xAccessor:T,yAccessor:H,annotationData:B,underlayRendered:F,canvasObscuresUnderlay:$=!0,children:O}=e,D=Ro({onAnnotationActivate:P,onObservation:C,chartId:_,chartType:L}),E="radial"===n?.projection,W="horizontal"===n?.projection,N=!1!==s,j=!F||$,z=po({showAxes:l,projection:E?"radial":W?"horizontal":"vertical",hasCategoryLabel:!!c,hasValueLabel:!!h}),V=go(A,z.leftAxis),G=y&&"left"===k&&V>0?V:a.left,q=Vi(()=>{if(!l||!N||!n||E)return[];let e=n.o.bandwidth(),t=n.o.domain().map((t,o)=>({value:t,pixel:(n.o(t)??0)+e/2,label:d?d(t,o):t}));if(2>=t.length)return t;let o=Math.abs(t[1].pixel-t[0].pixel)||e,i=t.map(e=>{return t=e.label,W?"string"==typeof t||"number"==typeof t?16:24:"string"==typeof t||"number"==typeof t?6.5*(t+"").length:60;var t}),r=W?0:6;if(i.every((e,t)=>0===t||o>=(i[t-1]+e)/2+r))return t;let a=Math.max(...i)+r,s=Math.max(1,Math.ceil(a/o));return 1===s?t:t.filter((e,t)=>t%s===0)},[l,N,n,d,E,W]),X=e.rTickValues,Y=e.tickLabelEdgeAlign,Q=e.axisExtent,K=Vi(()=>{if(!l&&!m||!n||E)return[];let e=X||Ae(n.r,5,Q),t=u||ro(e);return e.map(e=>({value:e,pixel:n.r(e),label:t(e)}))},[l,m,n,u,E,X,Q]),Z=Gi(new Map),U=Gi(R?.length??0),J=R?.length??0;U.current!==J&&(U.current=J,Z.current=new Map);let ee=Vi(()=>{if(!R||0===R.length)return null;let e=tt(R),i=qt("ordinal",D),r="horizontal"===n?.projection,a=n?.o?e=>(n.o(e)??0)+n.o.bandwidth()/2:null,l={scales:n?{x:r?n.r:a||n.r,y:r&&a||n.r,time:n.r,value:n.r,o:n.o}:null,timeAxis:"x",xAccessor:T,yAccessor:H,width:t,height:o,data:B,frameType:"ordinal",projection:r?"horizontal":"vertical",stickyPositionCache:Z.current},s=M?Et({annotations:e,context:l,..."object"==typeof M?M:{}}):e;return so(s,i,I,l)},[R,M,I,t,o,n,T,H,B,D]),te=l||g||p||y||S||ee&&ee.length>0||m||O,oe=qi(),{titleId:ie,descId:re,labelledBy:ae}=st(f||_||oe);return te?Qi("svg",{role:"img","aria-labelledby":ae,width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[Yi("title",{id:ie,children:ct(g,"Ordinal Chart")}),Yi("desc",{id:re,children:lt(g,p,{familyPhrase:"ordinal data visualization",fallback:"Ordinal data visualization"})}),Qi("g",{transform:`translate(${a.left},${a.top})`,children:[m&&n&&!E&&j&&Yi("g",{className:"ordinal-grid",children:K.map((e,i)=>Yi("line",{x1:W?e.pixel:0,y1:W?0:e.pixel,x2:W?e.pixel:t,y2:W?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),l&&n&&!E&&(()=>{let e={fontSize:"var(--semiotic-tick-font-size, 12px)"},i={fontSize:"var(--semiotic-axis-label-font-size, 12px)"};return Yi("g",{className:"ordinal-axes",children:Qi(Xi,W?{children:[Qi("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[j&&Yi("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),q.map((t,o)=>Qi("g",{transform:`translate(0,${t.pixel})`,children:[Yi("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Yi("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):Yi("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:Yi("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},"cat-"+o)),c&&Yi("text",{x:15-G,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-G}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),Qi("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[j&&Yi("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),j&&n?.r&&(()=>{let e=n.r(0);return e>1&&t-1>e?Yi("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),K.map((t,i)=>{let r=Y?0===i?"start":i===K.length-1?"end":"middle":"middle";return Qi("g",{transform:`translate(${t.pixel},${o})`,children:[Yi("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yi("text",{y:18,textAnchor:r,fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+i)}),h&&Yi("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]}:{children:[Qi("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[j&&(()=>{let e=n?.r?n.r(0):o,i=0>e||e>o?o:e;return Yi("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),q.map((t,i)=>Qi("g",{transform:`translate(${t.pixel},${o})`,children:[Yi("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Yi("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):Yi("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:Yi("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},"cat-"+i)),c&&Yi("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),Qi("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[j&&Yi("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),K.map((t,o)=>Qi("g",{transform:`translate(0,${t.pixel})`,children:[Yi("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yi("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+o)),h&&Yi("text",{x:15-G,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-G}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]})})})(),ee,S,O]}),Yi(Ht,{title:g,totalWidth:i,marginTop:a.top}),ho({legend:y,totalWidth:i,totalHeight:r,margin:a,legendPosition:k,title:g,legendLayout:A,axisChrome:z,legendHoverBehavior:v,legendClickBehavior:b,legendHighlightedCategory:x,legendIsolatedCategories:w})]}):null}function P(e){let[t,o]=Ki.useState(()=>Ui);return Ki.useEffect(()=>{if(t)return;let e=!1;return(Ui?Promise.resolve(Ui):(Ji||(Ji=import("./c-7242NXSG.min.js").then(e=>Ui=e.OrdinalBrushOverlay).catch(e=>{throw Ji=null,e})),Ji)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?Zi(t,{...e}):null}function C(e){let{innerRadius:t,outerRadius:o,startAngle:i,endAngle:r}=e,a=0>=t;if(0>=(e.cornerRadius??0)||!e.roundStart&&!e.roundEnd){if(a){let e=tr(o,i),t=tr(o,r);return`M0,0 L${e.x},${e.y} A${o},${o} 0 ${r-i>Math.PI?1:0} 1 ${t.x},${t.y} Z`}let e=tr(o,i),n=tr(o,r),l=tr(t,r),s=tr(t,i),c=r-i>Math.PI?1:0;return`M${e.x},${e.y} A${o},${o} 0 ${c} 1 ${n.x},${n.y} L${l.x},${l.y} A${t},${t} 0 ${c} 0 ${s.x},${s.y} Z`}let n=Math.max(0,Math.min(e.cornerRadius??0,(o-t)/2));if(0===n)return C({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});let l=Math.asin(Math.min(1,n/Math.max(1e-9,o-n))),s=a?0:Math.asin(Math.min(1,n/Math.max(1e-9,t+n))),c=r-i,h=e.roundStart&&e.roundEnd?c/2:c,d=!!e.roundStart&&h>l,u=!!e.roundEnd&&h>l;if(!d&&!u)return C({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});let m=i+(d?l:0),g=r-(u?l:0),p=i+(d?s:0),f=r-(u?s:0),y=tr(o,m),v=tr(o,g),b=(o-n)*Math.cos(l),x=tr(b,i),w=tr(b,r),k=a?null:tr(t,f),A=a?null:tr(t,p),S=a?0:(t+n)*Math.cos(s),R=a?null:tr(S,i),P=a?null:tr(S,r),_=g-m>Math.PI?1:0,L=a?0:f-p>Math.PI?1:0,M="";if(d)M+=`M${x.x},${x.y}`,M+=` A${n},${n} 0 0 1 ${y.x},${y.y}`;else{let e=tr(o,i);M+=`M${e.x},${e.y}`}if(u)M+=` A${o},${o} 0 ${_} 1 ${v.x},${v.y}`,M+=` A${n},${n} 0 0 1 ${w.x},${w.y}`;else{let e=tr(o,r);M+=` A${o},${o} 0 ${_} 1 ${e.x},${e.y}`}if(a)M+=" L0,0";else{if(u)M+=` L${P.x},${P.y}`,M+=` A${n},${n} 0 0 1 ${k.x},${k.y}`;else{let e=tr(t,r);M+=` L${e.x},${e.y}`}if(d)M+=` A${t},${t} 0 ${L} 0 ${A.x},${A.y}`,M+=` A${n},${n} 0 0 1 ${R.x},${R.y}`;else{let e=tr(t,i);M+=` A${t},${t} 0 ${L} 0 ${e.x},${e.y}`}}return M+=" Z",M}function _(e){let t=C({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,cornerRadius:e.cornerRadius,roundStart:e.roundStart,roundEnd:e.roundEnd}),o=[],i=e.colors;if(i.length>0){let t=(e.endAngle-e.startAngle)/i.length;for(let r=0;i.length>r;r++)o.push({d:C({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle+r*t,endAngle:e.endAngle}),color:i[r]})}return{clipPath:t,slices:o}}function L(e,t){let o=t._gradientBand.colors;if(0===o.length)return;let{clipPath:i,slices:r}=_({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds?.start??!0,roundEnd:t.roundedEnds?.end??!0,colors:o}),a=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(a);for(let t of r)e.fillStyle=ci(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore();let n=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&n>0&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=ci(e,t.style.stroke)||t.style.stroke,e.lineWidth=n,e.stroke(a),e.restore())}function M(e,t){e.beginPath(),t.innerRadius>0?(e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerRadius,t.endAngle,t.startAngle,!0)):(e.moveTo(t.cx,t.cy),e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle)),e.closePath()}function I(e,t){let o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=er().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);let r=new Path2D(i);e.fill(r);let a=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&a>0&&(e.lineWidth=a,e.stroke(r)),e.restore()}function T(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 H(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function B(e,t){let o=`${e}@${"u">typeof window&&window.devicePixelRatio||1}`,i=sr.get(o);if(void 0!==i)return i;let r=oi({background:e,stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45},t),a=ni(r)?null:r;return sr.set(o,a),a}function F(e,t,o,i,r,a){e.moveTo(t+a,o),e.lineTo(t+i-a,o),e.quadraticCurveTo(t+i,o,t+i,o+a),e.lineTo(t+i,o+r-a),e.quadraticCurveTo(t+i,o+r,t+i-a,o+r),e.lineTo(t+a,o+r),e.quadraticCurveTo(t,o+r,t,o+r-a),e.lineTo(t,o+a),e.quadraticCurveTo(t,o,t+a,o),e.closePath()}function $(e){return 1e6>e?1e4>e?1e3>e?Math.round(e)+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function O(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function D(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function E(e){return(t,o,i,r)=>{e(t,o.filter(D),{x:i.r,y:i.r},r)}}function W(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 N(e,t){let o=e.datum;if(!o)return null;let i=[],r=o.__funnelStepLabel,a=Number(o.__funnelStepLabelX),n=Number(o.__funnelStepLabelY),l=Number(o.__funnelRowWidth);"string"==typeof r&&Number.isFinite(a)&&Number.isFinite(n)&&(!Number.isFinite(l)||l>=8.4*r.length+16)&&i.push(vr("text",{x:a,y:n+3,textAnchor:"middle",dominantBaseline:"hanging",fontSize:14,fontWeight:"bold",fill:"#fff",fontFamily:"var(--semiotic-font-family, sans-serif)",stroke:"rgba(0,0,0,0.6)",strokeWidth:3,paintOrder:"stroke",children:r},t+"-funnel-step"));let s=Number(o.__funnelValue),c=Number(o.__funnelValueLabelX),h=Number(o.__funnelValueLabelY),d=Number(o.__funnelBarW);if(Number.isFinite(s)&&0!==s&&Number.isFinite(c)&&Number.isFinite(h)&&d>=60){let e=Number(o.__funnelPercent),r=!0!==o.__funnelIsFirstStep&&Number.isFinite(e)?`${W(s)} (${.05>Math.abs(e-Math.round(e))?Math.round(e):e.toFixed(1)}%)`:W(s);7.8*r.length+16>d&&(r=W(s)),d>=7.8*r.length+16&&i.push(vr("text",{x:c,y:h+22,textAnchor:"middle",dominantBaseline:"hanging",fontSize:13,fontWeight:"bold",fill:"#fff",fontFamily:"var(--semiotic-font-family, sans-serif)",stroke:"rgba(0,0,0,0.5)",strokeWidth:3,paintOrder:"stroke",children:r},t+"-funnel-value"))}return i.length?vr("g",{children:i},t+"-funnel-labels"):null}function j(e){return"connector"===e.node.type}function z(e,t,o,i){if(2>e.length)return null;let r=e[0].node,a=r.style.fill;if(!a||"none"===a)return null;let n=yo(`${t?t+"-":""}connector-${o}-${i}-hatch`),l=ni(a)?ai(a,n):null,s=[`${r.x1},${r.y1}`,...e.map(({node:e})=>`${e.x2},${e.y2}`)].join(" "),c=wr(pr.Fragment,{children:[l&&xr("defs",{children:l}),xr("polygon",{points:s,fill:l?`url(#${n})`:ko(a,"#999"),opacity:r.style.fillOpacity??r.style.opacity??.3,"data-semiotic-connector-fill":r.group||"_default"})]});return Eo(c,r,`ordinal-connector-fill-${o}-${i}`)}function V(e,t,o){let i=new Map;for(let t of e){if(!j(t))continue;let e=t.node.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}if(0===i.size)return;let r=Array.from(i.values()).map((e,i)=>wr("g",{children:[z(e,t,o,i),e.map(e=>e.element)]},`ordinal-connectors-${o}-${i}`)),a=e[0],n=j(a)?null:a.element;for(let e of i.values())for(let t of e)t.element=null;a.element=wr(pr.Fragment,{children:[r,n]},"ordinal-connector-run-"+o)}function G(e){let t=dt({nodes:e.nodes,renderMode:e.renderMode,fallback:(t,o)=>function(e,t,o){return Eo(function(e,t,o){let i=("category"in e?e.category:void 0)||("group"in e?e.group:void 0)||"",r=o=>`ord-${e.type}-${i}-${t}-${o}`,a=`ord-${e.type}-${i}-${t}`;switch(e.type){case"rect":{let t,o,i=e,r=yo(a)+"-grad",n=Nt(i,r);if(n)o=`url(#${r})`;else if(ni(i.style.fill)){let e=yo(a)+"-hatch";t=ai(i.style.fill,e),o=`url(#${e})`}else o=ko(i.style.fill);let l=n||t?br("defs",{children:[n,t]}):null;if(i.cornerRadii&&ri(i.cornerRadii)){let e=no(i);return br(fr.Fragment,{children:[l,vr("path",{d:e,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},a)}if(i.roundedTop&&i.roundedTop>0){let e,t=Math.min(i.roundedTop,i.w/2,i.h/2),{x:r,y:n,w:s,h:c}=i;switch(i.roundedEdge){case"right":e=`M${r},${n} L${r+s-t},${n} A${t},${t} 0 0 1 ${r+s},${n+t} L${r+s},${n+c-t} A${t},${t} 0 0 1 ${r+s-t},${n+c} L${r},${n+c} Z`;break;case"left":e=`M${r+s},${n} L${r+t},${n} A${t},${t} 0 0 0 ${r},${n+t} L${r},${n+c-t} A${t},${t} 0 0 0 ${r+t},${n+c} L${r+s},${n+c} Z`;break;case"bottom":e=`M${r},${n} L${r+s},${n} L${r+s},${n+c-t} A${t},${t} 0 0 1 ${r+s-t},${n+c} L${r+t},${n+c} A${t},${t} 0 0 1 ${r},${n+c-t} Z`;break;default:e=`M${r},${n+c} L${r},${n+t} A${t},${t} 0 0 1 ${r+t},${n} L${r+s-t},${n} A${t},${t} 0 0 1 ${r+s},${n+t} L${r+s},${n+c} Z`}return br(fr.Fragment,{children:[l,vr("path",{d:e,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},a)}return br(fr.Fragment,{children:[l,vr("rect",{x:i.x,y:i.y,width:i.w,height:i.h,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth}),N(i,a)]},a)}case"point":{let t=e;return vr("circle",{cx:t.x,cy:t.y,r:t.r,fill:ko(t.style.fill),opacity:t.style.opacity??t.style.fillOpacity??.8,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},a)}case"symbol":return Ao(e,t,o);case"glyph":return Kt(e,e.x,e.y,`${o??""}ord-glyph-${e.pointId??t}`);case"wedge":{let i,r=e;if(r._gradientBand&&r._gradientBand.colors.length>0){let e=yo(`${o?o+"-":""}gauge-grad-${r.category||a}-${t}`),{clipPath:i,slices:n}=_({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 br("g",{transform:`translate(${r.cx},${r.cy})`,opacity:r.style.opacity,fillOpacity:r.style.fillOpacity,children:[vr("defs",{children:vr("clipPath",{id:e,children:vr("path",{d:i})})}),vr("g",{clipPath:`url(#${e})`,children:n.map((e,t)=>vr("path",{d:e.d,fill:ko(e.color)},t))}),r.style.stroke&&"none"!==r.style.stroke&&vr("path",{d:i,fill:"none",stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},a)}if(r.roundedEnds)i=C({innerRadius:r.innerRadius,outerRadius:r.outerRadius,startAngle:r.startAngle,endAngle:r.endAngle,cornerRadius:r.cornerRadius,roundStart:r.roundedEnds.start,roundEnd:r.roundedEnds.end});else{let e=yr().innerRadius(r.innerRadius).outerRadius(r.outerRadius).startAngle(r.startAngle+Math.PI/2).endAngle(r.endAngle+Math.PI/2);r.cornerRadius&&e.cornerRadius(r.cornerRadius),i=e(Rt)||""}return vr("path",{d:i,transform:`translate(${r.cx},${r.cy})`,fill:ko(r.style.fill),stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,opacity:r.style.opacity},a)}case"boxplot":{let t=e,o=t.columnWidth/2,i=t.style.strokeWidth??1;return br("g","vertical"===t.projection?{children:[vr("line",{x1:t.x,y1:t.minPos,x2:t.x,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("rect",{x:t.x-o,y:Math.min(t.q1Pos,t.q3Pos),width:t.columnWidth,height:Math.abs(t.q3Pos-t.q1Pos),fill:ko(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("line",{x1:t.x-o,y1:t.medianPos,x2:t.x+o,y2:t.medianPos,stroke:t.style.stroke||"#333",strokeWidth:2*i}),vr("line",{x1:t.x-.5*o,y1:t.minPos,x2:t.x+.5*o,y2:t.minPos,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("line",{x1:t.x-.5*o,y1:t.maxPos,x2:t.x+.5*o,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:i})]}:{children:[vr("line",{x1:t.minPos,y1:t.y,x2:t.maxPos,y2:t.y,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("rect",{x:Math.min(t.q1Pos,t.q3Pos),y:t.y-o,width:Math.abs(t.q3Pos-t.q1Pos),height:t.columnWidth,fill:ko(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("line",{x1:t.medianPos,y1:t.y-o,x2:t.medianPos,y2:t.y+o,stroke:t.style.stroke||"#333",strokeWidth:2*i}),vr("line",{x1:t.minPos,y1:t.y-.5*o,x2:t.minPos,y2:t.y+.5*o,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("line",{x1:t.maxPos,y1:t.y-.5*o,x2:t.maxPos,y2:t.y+.5*o,stroke:t.style.stroke||"#333",strokeWidth:i})]},a)}case"violin":{let t=e,o=[vr("path",{d:t.pathString,transform:t.translateX||t.translateY?`translate(${t.translateX},${t.translateY})`:void 0,fill:ko(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:t.style.strokeWidth??1},r("path"))];if(t.iqrLine&&t.bounds){let e=t.bounds,i=e.x+e.width/2,a=e.y+e.height/2;t.iqrLine.isVertical?o.push(vr("line",{x1:i,y1:t.iqrLine.q1Pos,x2:i,y2:t.iqrLine.q3Pos,stroke:t.style.stroke||"#333",strokeWidth:2},r("iqr")),vr("circle",{cx:i,cy:t.iqrLine.medianPos,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},r("med"))):o.push(vr("line",{x1:t.iqrLine.q1Pos,y1:a,x2:t.iqrLine.q3Pos,y2:a,stroke:t.style.stroke||"#333",strokeWidth:2},r("iqr")),vr("circle",{cx:t.iqrLine.medianPos,cy:a,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},r("med")))}return vr("g",{children:o},a)}case"connector":{let t=e,o=t.style.fill&&"none"!==t.style.fill?ko(t.style.fill,"var(--semiotic-border, #999)"):"var(--semiotic-border, #999)";return vr("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.stroke||o,strokeWidth:t.style.strokeWidth??1,opacity:t.style.opacity??.5},a)}case"trapezoid":{let t=e,o=t.points.map(e=>`${e[0]},${e[1]}`).join(" ");return vr("polygon",{points:o,fill:ko(t.style.fill,"#999"),opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},a)}default:return null}}(e,t,o),e,"ordinal-cursor-"+t)}(t,o,e.idPrefix)}),o=0;for(let i=0;t.length>i;){if(t[i].renderedByBackend){i++;continue}let r=i+1;for(;t.length>r&&!t[r].renderedByBackend;)r++;V(t.slice(i,r),e.idPrefix,o++),i=r}return t}function q(e){let t=xo(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:Ar("div",{className:"semiotic-tooltip",style:Xt,children:[null!=t.title&&kr("div",{style:{fontWeight:"bold"},children:t.title+""}),t.entries.map(e=>Ar("div",{children:[Ar("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():e.value+""]},e.key))]})}function X({hover:e}){let t=e.data||{},o=e.stats,i=e.category;if(Array.isArray(t)){let e=i||t[0]?.category||"";if(o)return Ar("div",{className:"semiotic-tooltip",style:Xt,children:[e&&kr("div",{style:{fontWeight:"bold"},children:e+""}),Ar("div",{children:["n = ",o.n]}),Ar("div",{children:["Min: ",o.min.toLocaleString()]}),Ar("div",{children:["Q1: ",o.q1.toLocaleString()]}),Ar("div",{children:["Median: ",o.median.toLocaleString()]}),Ar("div",{children:["Q3: ",o.q3.toLocaleString()]}),Ar("div",{children:["Max: ",o.max.toLocaleString()]}),Ar("div",{style:{opacity:.8},children:["Mean: ",o.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});let r=t.length;return Ar("div",{className:"semiotic-tooltip",style:Xt,children:[e&&kr("div",{style:{fontWeight:"bold"},children:e+""}),Ar("div",{children:[r," items"]})]})}if(null!=t.bin&&null!=t.count){let e=t.range||[];return Ar("div",{className:"semiotic-tooltip",style:Xt,children:[t.category&&kr("div",{style:{fontWeight:"bold"},children:t.category+""}),Ar("div",{children:["Count: ",t.count]}),2===e.length&&Ar("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}let r=e.__oAccessor,a=e.__rAccessor,n=e.__chartType;if("swarm"===n||"point"===n)return q(t);let l=(r&&null!=t[r]?t[r]:null)||t.category||t.name||t.group||t.__rName||"",s=t.__aggregateValue??(a&&null!=t[a]?t[a]:null)??t.value??t.__rValue??t.pct??"";return l||""!==s?Ar("div",{className:"semiotic-tooltip",style:Xt,children:[l&&kr("div",{style:{fontWeight:"bold"},children:l+""}),""!==s&&kr("div",{children:"number"==typeof s?s.toLocaleString():s+""})]}):q(t)}function Y({ref:e,frameRef:t,setup:o}){return Tr(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,o)=>t.current?.update(e,o)??[],replace:e=>t.current?.replace(e),clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t]),{effectiveLegendProps:o.legendBehaviorProps,effectiveMargin:o.margin}}function Q(e){let{colorBy:t,colorScale:o,color:i,themeCategorical:r,colorScheme:a,categoryIndexMap:n,userPieceStyle:l,stroke:s,strokeWidth:c,opacity:h,effectiveSelectionHook:d,resolvedSelection:u,cycleByCategory:m=!1,baseStyleExtras:g,linkStrokeToFill:p=!1,styleRules:f,resolveRuleValue:y}=e,v=Hr(()=>(e,l)=>{let s="function"==typeof g?g(e,l):g,c=s?{...s}:{};if(void 0===c.fill)if(t){if(!o)return c;c.fill=jo(e,t,o)}else c.fill=mo(i,r,a,m?l:void 0,n);if(f&&f.length>0){let t=fo(e,f,{value:y?y(e,l):void 0,category:l});Object.assign(c,t)}return p&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[t,o,i,r,a,n,m,g,p,f,y]),b=Hr(()=>at(l?"function"==typeof l?(e,t)=>({...v(e,t),...l(e,t)||{}}):(e,t)=>({...v(e,t),...l}):v,{stroke:s,strokeWidth:c,opacity:h}),[v,l,s,c,h]);return Hr(()=>Wo(b,d??null,u),[b,d,u])}function K({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){let r=Fr(()=>to("string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0),[o]),a="string"==typeof i?i:"value",n=Po({name:r?.name||"__unused_ordinal_brush__",xField:r?.xField||a}),l=$r(n.brushInteraction);l.current=n.brushInteraction;let s=Br(e=>{if(r){l.current.end(e?e.r:null)}t?.(e)},[t,r]),c=!!(e||o||t);return{hasBrush:c,handleBrush:s,brushStreamProps:c?{brush:{dimension:"r"},onBrush:s}:{}}}function Z(e,t){if("function"==typeof e)return e;let o=e||t;return e=>e[o]}function U(e,t,o,i,r,a,n={}){let l=new Map,s=new Set(t);for(let n of e){let e=o(n);l.has(e)||l.set(e,new Map);let c=l.get(e);if(i){let e=i(n);if(null==e||!Number.isFinite(e))continue;if(!Number.isInteger(e)){"production"!==process.env.NODE_ENV&&console.warn("[LikertChart] Ignoring non-integer Likert score:",e);continue}let o=e-1;if(0>o||o>=t.length)continue;let r=t[o];c.set(r,(c.get(r)||0)+1)}else if(r&&a){let e=r(n),t=a(n);if(!s.has(e))continue;c.set(e,(c.get(e)||0)+(Number.isFinite(t)?t:0))}}let c=[];for(let[e,o]of l){let i=0;for(let e of t)i+=o.get(e)||0;if(0!==i)for(let r=0;t.length>r;r++){let a=t[r],l=o.get(a)||0,s={};n.category&&(s[n.category]=e),n.level&&(s[n.level]=a),n.count&&(s[n.count]=l),n.score&&(s[n.score]=r+1),c.push({...s,__likertCategory:e,__likertLevel:a,__likertLevelLabel:a,__likertCount:l,__likertPct:l/i*100,__likertLevelIndex:r})}}return c}function J(e,t){let o=t.length,i=o%2!=0,r=Math.floor(o/2),a=[];for(let t of e){let e=t.__likertLevelIndex;if(i&&e===r){let e=t.__likertPct/2;a.push({...t,__likertLevel:ea,__likertPct:-e}),a.push({...t,__likertLevel:ta,__likertPct:e})}else a.push(r>e?{...t,__likertPct:-t.__likertPct}:t)}return a}function ee(e,t){let o=t.length,i=o%2!=0,r=Math.floor(o/2),a=new Map;for(let t of e){let e=a.get(t.__likertCategory)||[];e.push(t),a.set(t.__likertCategory,e)}let n=[];for(let[,e]of a){let t,a,l=new Map;for(let o of e)o.__likertLevel===ea?t=o:o.__likertLevel===ta?a=o:l.set(o.__likertLevelIndex,o);i&&t&&n.push(t);for(let e=r-1;e>=0;e--){let t=l.get(e);t&&n.push(t)}i&&a&&n.push(a);for(let e=i?r+1:r;o>e;e++){let t=l.get(e);t&&n.push(t)}}return n}function te(e){let t=e.__likertPct??e.data?.__likertPct;return"number"==typeof t&&Number.isFinite(t)?t:void 0}function oe(e){return t=>{let o=t.category||t.data&&t.data[0]?.category||"",i=t.stats||(t.data||t).stats;if(i&&null!=i.median)return pa("div",{className:"semiotic-tooltip",style:Xt,children:[o&&ga("div",{style:{fontWeight:"bold"},children:o+""}),null!=i.n&&pa("div",{children:["n = ",i.n]}),null!=i.min&&pa("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&pa("div",{children:["Q1: ",i.q1.toLocaleString()]}),pa("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&pa("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&pa("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&pa("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){let i=e.valueAccessor,r=(Array.isArray(t.data)?t.data:[]).map(e=>Number("function"==typeof i?i(e):e[i])).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t),a=r.length,n=a>0?a%2!=0?r[Math.floor(a/2)]:(r[a/2-1]+r[a/2])/2:null;return pa("div",{className:"semiotic-tooltip",style:Xt,children:[o&&ga("div",{style:{fontWeight:"bold"},children:o+""}),a>0&&pa("div",{children:["n = ",a]}),null!=n&&pa("div",{children:["Median: ",n.toLocaleString()]})]})}return ga("div",{className:"semiotic-tooltip",style:Xt,children:ga("div",{style:{fontWeight:"bold"},children:o+""})})}}function ie(e=240){let t=360-e,o=180+t/2,i=o*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:o,startAngleRad:i,offsetRad:-Math.PI/2+i}}function re(e){return Math.max(0,Math.min(1,e))}function ae(e){let t=e.trim();if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e.split("").map(e=>e+e).join("")),6===e.length&&/^[0-9a-f]{6}$/i.test(e))return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}let o=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(o){let e=[Number(o[1]),Number(o[2]),Number(o[3])];if(e.every(Number.isFinite))return e}return null}function ne(e,t,o){let i=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(o)}`}function le(e,t,o){let i=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:re(e.offset),color:e.color??o,opacity:null==e.opacity?1:re(e.opacity)})).sort((e,t)=>e.offset-t.offset);if(0===i.length)return"#999999";let r=e=>{if(1===e.opacity)return e.color;let t=ae(e.color);return t?`rgba(${t[0]},${t[1]},${t[2]},${e.opacity})`:e.color};if(1===i.length)return r(i[0]);let a=re(t);if(i[0].offset>=a)return r(i[0]);if(a>=i[i.length-1].offset)return r(i[i.length-1]);for(let e=0;i.length-1>e;e++){let t=i[e],o=i[e+1];if(t.offset>a||a>o.offset)continue;let n=o.offset-t.offset,l=n>0?(a-t.offset)/n:0,s=ae(t.color),c=ae(o.color);if(!s||!c)return r(.5>l?t:o);let[h,d,u]=s,[m,g,p]=c,f=h+(m-h)*l,y=d+(g-d)*l,v=u+(p-u)*l,b=t.opacity+(o.opacity-t.opacity)*l;return 1===b?ne(f,y,v):`rgba(${Math.round(f)},${Math.round(y)},${Math.round(v)},${b})`}return r(i[i.length-1])}function se(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}import{buildRegressionAnnotation as ce}from"./c-GNTXRXRN.min.js";import{useCustomChartSetup as he}from"./c-55BAJ333.min.js";import{validateArrayData as de}from"./c-D6HAAPTX.min.js";import{useChartSetup as ue,useFrameImperativeHandle as me,useResolvedSelection as ge}from"./c-KCRJGUHP.min.js";import{useStreamingLegend as pe}from"./c-DE5Q3U2X.min.js";import{barCanvasRenderer as fe}from"./c-DK662R77.min.js";import{DataSourceAdapter as ye,IncrementalExtent as ve,buildEnrichAnnotationData as be,ordinalFrameLegendOptions as xe,resolveAnnotationAccessor as we,snapOrdinalIntroTargets as ke,ticksForMode as Ae,toIdSet as Se}from"./c-ROEHCIGV.min.js";import{buildRectNode as Re,normalizeColorGradient as Pe,normalizeGradient as Ce}from"./c-AVO3Q7T7.min.js";import{RingBuffer as _e,compactTimestampBufferForRemoval as Le,computePulseIntensity as Me,createTimestampBufferForData as Ie,ensureRingBufferCapacity as Te,hasActivePulses as He,pushWithTimestamp as Be,refreshIdlePulse as Fe,setPulseState as $e,useOrdinalKeyboardNavigation as Oe,useSemanticFrameInteractions as De}from"./c-BNG5ECK5.min.js";import{pointCanvasRenderer as Ee}from"./c-OO5QLMJC.min.js";import{symbolCanvasRenderer as We}from"./c-HXDKPIKR.min.js";import{glyphCanvasRenderer as Ne}from"./c-4FN7Q6VQ.min.js";import{AXIS_FRAME_DEFAULT_MARGIN as je}from"./c-2N7IU2NY.min.js";import{accessorsEquivalent as ze,resolveAccessor as Ve,resolveStringAccessor as Ge}from"./c-YLZIV3VS.min.js";import{StalenessBadge as qe,attachUpdateResultStore as Xe,buildBaseMetadataProps as Ye,buildCustomBehaviorProps as Qe,buildDatumIndexMap as Ke,buildOrdinalTooltip as Ze,buildTooltipProps as Ue,composeOverlays as Je,computeDecayOpacity as et,filterAnnotationsByStatus as tt,findHitPointInQuadtree as ot,getHitRadius as it,hitTestRect as rt,mergeShapeStyle as at,normalizeAngle as nt,overlayAccessibleDescription as lt,overlayAccessibleIds as st,overlayAccessibleTitle as ct,paintSceneWithBackend as ht,renderSceneListWithBackend as dt,resolveFrameGraphics as ut,runCustomLayoutAttempt as mt,shouldHandleFramePointer as gt,useConfigSync as pt,useLayoutSelectionSync as ft,useLegendCategoryEmission as yt,useStableShallow as vt,useStalenessCheck as bt,warnCustomLayoutDiagnostics as xt}from"./c-ITKX3RC5.min.js";import{wrapWithCustomLayoutSelection as wt}from"./c-YDECTEUW.min.js";import{renderPathPulse as kt}from"./c-W4ZUKSEQ.min.js";import{buildResolveColor as At,resolveCustomLayoutPalette as St}from"./c-EUBTECGM.min.js";import{ARC_NOOP as Rt,AccessibleDataTable as Pt,AccessibleTablePortal as Ct,AriaLiveTooltip as _t,CanvasFrameBackground as Lt,ChartError as Mt,FlippingTooltip as It,FocusRing as Tt,SVGChartTitle as Ht,SafeRender as Bt,SceneRevisionDiagnosticsObserver as Ft,ScreenReaderSummary as $t,SkipToTableLink as Ot,UpdateResultTracker as Dt,annotationLayout as Et,buildHoverData as Wt,buildRectSVGGradient as Nt,composeStyleRules as jt,computeCanvasAriaLabel as zt,computeEasing as Vt,computeRawProgress as Gt,createDefaultAnnotationRules as qt,defaultTooltipStyle as Xt,filterSparseArray as Yt,getDevicePixelRatio as Qt,glyphNodeToSVG as Kt,isAnnotationActivationTarget as Zt,isServerEnvironment as Ut,lerp as Jt,makeRuleValueResolver as eo,normalizeLinkedBrush as to,normalizeTooltip as oo,now as io,numericTickFormatter as ro,observationInputType as ao,perCornerSvgPath as no,rehitCanvasMarkCursor as lo,renderAnnotationPass as so,renderEmptyState as co,renderLegendFromConfig as ho,renderLoadingState as uo,resolveDefaultFill as mo,resolveLegendSideGutter as go,resolveOrdinalAxisChrome as po,resolveStyleRules as fo,safeSvgId as yo,sceneMarkCursor as vo,setCanvasMarkCursor as bo,smartTooltipEntries as xo,subscribeToCanvasFontInvalidation as wo,svgFill as ko,symbolSceneNodeToSVG as Ao,syncCanvasMarkCursor as So,useAnnotationActivationOptions as Ro,useBrushSelection as Po,useCanvasMarkCursorCleanup as Co,useChartMode as _o,useChartSelection as Lo,useFrame as Mo,useFrameCanvasHost as Io,useHydration as To,useSceneRevisionDiagnostics as Ho,useSortedData as Bo,useThemeCategorical as Fo,useThemeDiverging as $o,useWasHydratingFromSSR as Oo,warnMissingField as Do,withSceneMarkCursor as Eo,wrapStyleWithSelection as Wo}from"./c-LMGSSD2E.min.js";import{STREAMING_PALETTE as No,getColor as jo,getSize as zo,interpolateBrBG as Vo,interpolatePRGn as Go,interpolatePiYG as qo,interpolateRdBu as Xo,interpolateRdYlBu as Yo,interpolateRdYlGn as Qo,interpolateSpectral as Ko,resolveExplicitColor as Zo}from"./c-CPV4N35K.min.js";import{resolveThemeSemanticColors as Uo}from"./c-JUKIWTBJ.min.js";import{getMax as Jo,getMinMax as ei}from"./c-QA3HMQJP.min.js";import{coerceCanvasFill as ti,createHatchPattern as oi,glyphHitGeometry as ii,hasAnyCornerRadius as ri,hatchPatternDef as ai,isHatchFill as ni,makeSymbolResolver as li,parseCanvasColor as si,resolveCSSColor as ci,resolveCanvasFill as hi,symbolRadius as di}from"./c-553QUDKA.min.js";import*as ui from"react";import{jsx as mi}from"react/jsx-runtime";var gi=new Set(["svg","g","text","tspan","path","circle","ellipse","rect","line","polyline","polygon","use","image","defs","symbol"]);import{forwardRef as pi,memo as fi,useCallback as yi,useEffect as vi,useMemo as bi,useRef as xi,useState as wi}from"react";import{scaleBand as ki,scaleLinear as Ai}from"d3-scale";var Si=class{constructor(){this.colorSchemeMap=new Map,this.colorSchemeIndex=0}resetColors(){this.colorSchemeMap.clear(),this.colorSchemeIndex=0}resolvePieceStyle(e,t,o){if(t&&"function"==typeof e.pieceStyle){let i=e.pieceStyle(t,o);return i&&!i.fill&&o?{...i,fill:this.getColorFromScheme(e,o)}:i}return e.pieceStyle&&"object"==typeof e.pieceStyle?e.pieceStyle:e.barColors&&o?{fill:Zo(e.barColors,o)??"#007bff"}:{fill:o?this.getColorFromScheme(e,o):"#007bff"}}resolveSummaryStyle(e,t,o){return t&&"function"==typeof e.summaryStyle?e.summaryStyle(t,o):e.summaryStyle&&"object"==typeof e.summaryStyle?e.summaryStyle:{fill:"#007bff",fillOpacity:.6,stroke:"#007bff",strokeWidth:1}}getColorFromScheme(e,t){let o=this.colorSchemeMap.get(t);if(o)return o;let i=Array.isArray(e.colorScheme)?e.colorScheme:e.themeCategorical||No,r=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,r),r}};import{quantileSorted as Ri}from"d3-array";import{scaleLinear as Pi}from"d3-scale";var Ci={bar:function(e,t){let{scales:i,columns:r,config:a,getR:n,getStack:l,resolvePieceStyle:s}=e,{r:c,projection:h}=i,d=[],u="vertical"===h,m="horizontal"===h,g=a.normalize,p=[];if(l){let e=new Set;for(let t of Object.values(r))for(let o of t.pieceData){let t=l(o);e.has(t)||(e.add(t),p.push(t))}}else p.push("_default");for(let e of Object.values(r)){let t=new Map;for(let o of e.pieceData){let e=l?l(o):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});let i=t.get(e);i.total+=n(o),i.pieces.push(o)}let o=0;if(g)for(let e of t.values())o+=Math.abs(e.total);let i=0,r=0;for(let a of p){let n=t.get(a);if(!n)continue;let h=n.total;g&&o>0&&(h/=o);let p=s(n.pieces[0],l?a:e.name),f={...n.pieces[0],__aggregateValue:n.total,__pieceCount:n.pieces.length,category:e.name};if(u){let t=c(0>h?r:i+h),o=0>h?c(r+h)-c(r):c(i)-c(i+h);d.push(Re(e.x,t,e.width,Math.abs(o),p,f,a)),0>h?r+=h:i+=h}else if(m){let t=c(0>h?r+h:i),o=0>h?c(r)-c(r+h):c(i+h)-c(i);d.push(Re(t,e.x,Math.abs(o),e.width,p,f,a)),0>h?r+=h:i+=h}}}let f="vertical"===h;for(let e of d){if("rect"!==e.type)continue;let t=e.datum?.__aggregateValue??0;e.roundedEdge=f?0>t?"bottom":"top":0>t?"left":"right",a.gradientFill&&(e.fillGradient=a.gradientFill)}if(void 0!==a.roundedTop){let e=new Map;for(let t of d){if("rect"!==t.type)continue;let o=t.datum?.category||"";e.has(o)||e.set(o,[]),e.get(o).push(t)}for(let t of e.values()){if(0===t.length)continue;let e=t.filter(e=>(e.datum?.__aggregateValue??0)>=0),i=t.filter(e=>0>(e.datum?.__aggregateValue??0));if(e.length>0){let t=e.reduce(f?(e,t)=>t.y>e.y?e:t:(e,t)=>e.x+e.w>t.x+t.w?e:t),i=o(a.roundedTop,t,f);i>0&&(t.roundedTop=i)}if(i.length>0){let e=i.reduce(f?(e,t)=>e.y+e.h>t.y+t.h?e:t:(e,t)=>t.x>e.x?e:t),t=o(a.roundedTop,e,f);t>0&&(e.roundedTop=t)}}}return d},clusterbar:function(e,t){let{scales:i,columns:r,config:a,getR:n,getGroup:l,resolvePieceStyle:s}=e,{r:c,projection:h}=i,d=[],u="vertical"===h,m=[],g=new Set;for(let e of Object.values(r))for(let t of e.pieceData){let e=l?l(t):"_default";g.has(e)||(g.add(e),m.push(e))}let p=m.length||1;for(let e of Object.values(r)){let t=e.width/p,o=.2*t,i=t-o,r=new Map;for(let t of e.pieceData){let e=l?l(t):"_default";r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let a=0;m.length>a;a++){let l=r.get(m[a])||[];for(let r of l){let l=n(r),h=s(r,m[a]);if(u){let n=e.x+a*t+o/2,s=c(0),u=c(l);d.push(Re(n,Math.min(s,u),i,Math.abs(s-u),h,r,m[a]))}else{let n=e.x+a*t+o/2,s=c(0),u=c(l);d.push(Re(Math.min(s,u),n,Math.abs(u-s),i,h,r,m[a]))}}}}for(let e of d){if("rect"!==e.type||null==e.datum)continue;let t=n(e.datum),i=o(a.roundedTop,e,u);i>0&&(e.roundedTop=i),e.roundedEdge=u?0>t?"bottom":"top":0>t?"left":"right",a.gradientFill&&(e.fillGradient=a.gradientFill)}return d},point:function(e,t){let{scales:o,columns:a,getR:n,multiScales:l,resolvePieceStyle:s}=e,{r:c,projection:h}=o,d=[],u="vertical"===h,m="radial"===h,g=l.length>0,p=i(e),f=2*Math.PI,y=-Math.PI/2;for(let e of Object.values(a))for(let t of e.pieceData){let o,i,a=t.__rIndex??0,h=t.__rValue??n(t),v=g&&l[a]||c,b=s(t,e.name),x=b.r||5;if(m){let t=y+(e.pctStart+e.pct/2)*f,r=v(h);o=Math.cos(t)*r,i=Math.sin(t)*r}else u?(o=e.middle,i=v(h)):(o=v(h),i=e.middle);r(d,p,t,o,i,x,b)}return d},swarm:function(e,t){let{scales:o,columns:a,getR:n,resolvePieceStyle:l}=e,{r:s,projection:c}=o,h=[],d="vertical"===c,u=i(e);for(let e of Object.values(a)){let t=e.width/2;for(let o=0;e.pieceData.length>o;o++){let i=e.pieceData[o],a=n(i),c=l(i,e.name),m=c.r||4,g=(7919*o%100/100-.5)*t*.8;r(h,u,i,d?e.middle+g:s(a),d?s(a):e.middle+g,m,c)}}return h},pie:a,donut:a,boxplot:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:s}=e,{r:c,projection:h}=o,d=[],u="vertical"===h,m=!1!==r.showOutliers;for(let t of Object.values(i)){let o=t.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(0===o.length)continue;let i=l(o),{min:r,max:h,q1:g,median:p,q3:f}=i,y=f-g,v=g-1.5*y,b=f+1.5*y,x=o.find(e=>e>=v)??r,w=h;for(let e=o.length-1;e>=0;e--)if(b>=o[e]){w=o[e];break}i.min=x,i.max=w;let k=s(n(t.pieceData,t.name,i),t.name),A=[];if(m)for(let e of t.pieceData){let o=a(e);if(v>o||o>b){let i=u?t.middle:c(o),r=u?c(o):t.middle;A.push({px:i,py:r,value:o,datum:e})}}if(d.push({type:"boxplot",x:u?t.middle:0,y:u?0:t.middle,projection:u?"vertical":"horizontal",columnWidth:.6*t.width,minPos:c(x),q1Pos:c(g),medianPos:c(p),q3Pos:c(f),maxPos:c(w),stats:i,style:k,datum:t.pieceData,category:t.name,outliers:A}),m)for(let t of A)d.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:k.fill||e.config.themeSemantic?.secondary||"#999",opacity:.6,cursor:k.cursor},datum:t.datum})}return d},violin:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:c}=e,{r:h,projection:d}=o,u=[],m="vertical"===d,g=r.bins||20,p=!1!==r.showIQR;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;let o,i=t[0],r=t[t.length-1],d=(r-i)/g||1,f=s(t,i,r,d,g),y=Jo(f,1),v=e.width/2*.9;if(m){o=`M ${e.middle} ${h(i)}`;for(let t=0;g>t;t++){let r=h(i+(t+.5)*d);o+=` L ${e.middle+f[t]/y*v} ${r}`}o+=` L ${e.middle} ${h(r)}`;for(let t=g-1;t>=0;t--){let r=h(i+(t+.5)*d);o+=` L ${e.middle-f[t]/y*v} ${r}`}o+=" Z"}else{o=`M ${h(i)} ${e.middle}`;for(let t=0;g>t;t++)o+=` L ${h(i+(t+.5)*d)} ${e.middle-f[t]/y*v}`;o+=` L ${h(r)} ${e.middle}`;for(let t=g-1;t>=0;t--)o+=` L ${h(i+(t+.5)*d)} ${e.middle+f[t]/y*v}`;o+=" Z"}let b,x=l(t),w=c(n(e.pieceData,e.name,x),e.name);p&&t.length>=4&&(b={q1Pos:h(x.q1),medianPos:h(x.median),q3Pos:h(x.q3),centerPos:e.middle,isVertical:m});let k=m?{x:e.x,y:Math.min(h(r),h(i)),width:e.width,height:Math.abs(h(r)-h(i))}:{x:Math.min(h(i),h(r)),y:e.x,width:Math.abs(h(r)-h(i)),height:e.width};u.push({type:"violin",pathString:o,translateX:0,translateY:0,bounds:k,iqrLine:b,stats:x,style:w,datum:e.pieceData,category:e.name})}return u},histogram:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:n}=e,{r:l}=o,c=[],h=r.bins||25,d=r.normalize,u=l.domain?.(),m=u?+u[0]:void 0,g=u?+u[1]:void 0;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;let[o,i]=ei(t),r=null!=m&&isFinite(m)?m:o,u=null!=g&&isFinite(g)?g:i,p=(u-r)/h||1,f=s(t,r,u,p,h),y=t.length,v=Jo(f,1);for(let t=0;h>t;t++){if(0===f[t])continue;let o=(d?f[t]/y:f[t]/v)*e.width*.9,i=l(r+t*p),a=l(r+(t+1)*p),s=Math.min(i,a),h=Math.abs(a-i),u=e.x+e.width-o,m={...e.pieceData[0],bin:t,count:f[t],range:[r+t*p,r+(t+1)*p],category:e.name,data:e.pieceData},g=n(m,e.name);c.push(Re(s,u,h,o,g,m,e.name))}}return c},ridgeline:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:c}=e,{r:h,projection:d}=o,u=[],m=r.bins||20,g="horizontal"===d,p=r.amplitude||1.5;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;let o,i=t[0],r=t[t.length-1],d=(r-i)/m||1,f=s(t,i,r,d,m),y=Jo(f,1),v=l(t),b=c(n(e.pieceData,e.name,v),e.name),x=e.width*p;if(g){let t=e.x+e.width;o=`M ${h(i)} ${t}`;for(let e=0;m>e;e++)o+=` L ${h(i+(e+.5)*d)} ${t-f[e]/y*x}`;o+=` L ${h(r)} ${t} Z`}else{let t=e.x;o=`M ${t} ${h(i)}`;for(let e=0;m>e;e++){let r=h(i+(e+.5)*d);o+=` L ${t+f[e]/y*x} ${r}`}o+=` L ${t} ${h(r)} Z`}let w=g?{x:Math.min(h(i),h(r)),y:e.x,width:Math.abs(h(r)-h(i)),height:e.width}:{x:e.x,y:Math.min(h(r),h(i)),width:e.width,height:Math.abs(h(r)-h(i))};u.push({type:"violin",pathString:o,translateX:0,translateY:0,bounds:w,stats:v,style:{...b,fillOpacity:b.fillOpacity??.5},datum:e.pieceData,category:e.name})}return u},timeline:function(e,t){let{scales:o,columns:i,getRawRange:r,resolvePieceStyle:a}=e,{r:n,projection:l}=o,s=[],c="horizontal"===l;for(let e of Object.values(i))for(let t of e.pieceData){let o=r(t);if(!o)continue;let[i,l]=o,h=a(t,e.name);if(c){let o=n(Math.min(i,l)),r=n(Math.max(i,l));s.push(Re(o,e.x,r-o,e.width,h,t,e.name))}else{let o=n(Math.max(i,l)),r=n(Math.min(i,l));s.push(Re(e.x,o,e.width,r-o,h,t,e.name))}}return s},funnel:function(e,t){let{columns:o,getR:i,getStack:r,resolvePieceStyle:a}=e,n=[],l=t.width/2,s=!1!==e.config.showLabels,c=e.scales.o.domain().map(e=>o[e]).filter(Boolean);if(0===c.length)return n;let h=[],d=new Set;for(let e of c)for(let t of e.pieceData){let e=r?r(t):"_default";d.has(e)||(d.add(e),h.push(e))}let u=h.length>1&&"_default"!==h[0],m=[],g=0;for(let e of c){let t=new Map,o=0;for(let a of e.pieceData){let e=r?r(a):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});let n=t.get(e),l=i(a);n.total+=l,n.pieces.push(a),o+=l}m.push({col:e,groups:t,stepTotal:o}),u||o>g&&(g=o)}if(u)for(let e of m){let t=0,o=0;for(let i=0;h.length>i;i++){let r=e.groups.get(h[i]);r&&(i%2==0?t+=r.total:o+=r.total)}let i=Math.max(t,o);i>g&&(g=i)}if(0===g)return n;let p=new Map;for(let e of h){let t=m[0].groups.get(e);p.set(e,t?.total??0)}let f=m[0].stepTotal,y=u?.95*l:.9*t.width,v=Pi().domain([0,g]).range([0,y]),b=e.config.connectorOpacity??.3,x=new Map;for(let t=0;m.length>t;t++){let o=m[t],i=o.col,r=0===t,c=i.width,d=.55*c,g=i.x+(c-d)/2,y=new Map;if(u){let e=0;for(let t of h){let i=o.groups.get(t);i&&(e+=v(i.total))}let t=l,c=l;for(let u=0;h.length>u;u++){let m=h[u],f=o.groups.get(m);if(!f)continue;let b=v(f.total),x=u%2==0,w=x?t:c-b;x?t+=b:c-=b;let k=a(f.pieces[0],m),A=p.get(m)??f.total,S={...f.pieces[0],__funnelValue:f.total,__funnelPercent:A>0?f.total/A*100:0,__funnelStep:i.name,__funnelIsFirstStep:r,__aggregateValue:f.total,__pieceCount:f.pieces.length,category:m};s&&(0===u&&(S.__funnelStepLabel=i.name,S.__funnelStepLabelX=l,S.__funnelStepLabelY=g,S.__funnelRowWidth=e),S.__funnelValueLabelX=w+b/2,S.__funnelValueLabelY=g,S.__funnelBarW=b),n.push(Re(w,g,b,d,k,S,m)),y.set(m,{x:w,y:g,w:b,h:d})}}else{let e=o.stepTotal,t=v(e),c=l-t/2,u=h[0],m="_default"!==u,p=o.groups.get(u)?.pieces[0]??i.pieceData[0],b=m?u:i.name,x=a(p,b),w=f>0?e/f*100:0,k={...p,__funnelValue:e,__funnelPercent:w,__funnelStep:i.name,__funnelIsFirstStep:r,category:m?u:i.name};s&&(k.__funnelStepLabel=i.name,k.__funnelStepLabelX=l,k.__funnelStepLabelY=g,k.__funnelRowWidth=t,k.__funnelValueLabelX=l,k.__funnelValueLabelY=g,k.__funnelBarW=t),n.push(Re(c,g,t,d,x,k,b)),y.set(u,{x:c,y:g,w:t,h:d})}if(t>0&&x.size>0){let t=u?h:[h[0]];for(let r of t){let t=x.get(r),l=y.get(r);if(!t||!l)continue;let s=(()=>{let e=o.groups.get(r);return a(e?e.pieces[0]:i.pieceData[0],"_default"===r?i.name:r)})(),c={type:"trapezoid",points:[[t.x,t.y+t.h],[t.x+t.w,t.y+t.h],[l.x+l.w,l.y],[l.x,l.y]],style:{fill:s.fill||e.config.themeSemantic?.secondary||"#999",opacity:b,cursor:s.cursor},datum:o.groups.get(r)?.pieces[0]??i.pieceData[0],category:"_default"===r?i.name:r};n.push(c)}}x=y}return n},"bar-funnel":function(e,t){let{columns:o,getR:i,getStack:r,resolvePieceStyle:a,scales:n}=e,l=[],s=n.o.domain().map(e=>o[e]).filter(Boolean);if(0===s.length)return l;let c=[],h=new Set;for(let e of s)for(let t of e.pieceData){let e=r?r(t):"_default";h.has(e)||(h.add(e),c.push(e))}let d=c.length>1&&"_default"!==c[0],u=[];for(let e of s){let t=new Map,o=0;for(let a of e.pieceData){let e=r?r(a):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});let n=t.get(e),l=i(a);n.total+=l,n.pieces.push(a),o+=l}u.push({col:e,groups:t,stepTotal:o})}let m=new Map;for(let e of c){let t=u[0]?.groups.get(e);m.set(e,t?.total??0)}let g=n.r,p=d?c.length:1,f=d?.15:0;for(let e=0;u.length>e;e++){let t=u[e],o=t.col,i=0===e,r=e>0?u[e-1]:null,n=o.width/p,s=n*f,h=n-s;for(let e=0;c.length>e;e++){let u=c[e],p=t.groups.get(u);if(!p)continue;let f=p.total,y=m.get(u)??f,v=y>0?f/y*100:0,b=r?.groups.get(u)?.total??f,x=i?0:Math.max(0,b-f),w=o.x+e*n+s/2,k=g(f),A=g(0)-k,S=a(p.pieces[0],d?u:o.name),R={...p.pieces[0],__barFunnelValue:f,__barFunnelPercent:v,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:x,__barFunnelCategory:"_default"===u?void 0:u,category:d?u:o.name,__barFunnelLabelX:w+h/2,__barFunnelLabelY:g(f+x)};if(l.push(Re(w,k,h,A,S,R,d?u:o.name)),x>0){let e=g(f+x),t=k-e,i={...S},r={...p.pieces[0],__barFunnelValue:x,__barFunnelPercent:y>0?x/y*100:0,__barFunnelIsFirstStep:!1,__barFunnelIsDropoff:!0,__barFunnelStep:o.name,__barFunnelCategory:"_default"===u?void 0:u,category:d?u:o.name};l.push(Re(w,e,h,t,i,r,d?u:o.name))}}}return l},swimlane:function(e,t){let{scales:o,columns:i,getR:r,getStack:a,resolvePieceStyle:n}=e,{r:l,projection:s}=o,c=[],h="horizontal"===s,d=e.config.gradientFill,u=h?"left":"bottom",m=new Map,g=t=>{let o=m.get(t);if(void 0!==o)return o;let i="function"==typeof e.config.roundedTop?e.config.roundedTop(t.width):e.config.roundedTop,r="number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0;return m.set(t,r),r},p=e.config.trackFill;if(p){let e="string"==typeof p?p:p.color,t="string"==typeof p?1:p.opacity??1,[o,r]=l.range(),a=Math.min(o,r),n=Math.abs(r-o);for(let o of Object.values(i)){let i={fill:e,opacity:t},r=h?Re(a,o.x,n,o.width,i,null,"__track__"):Re(o.x,a,o.width,n,i,null,"__track__"),l=g(o);l>0&&(r.cornerRadii={tl:l,tr:l,br:l,bl:l}),c.push(r)}}for(let e of Object.values(i)){let t=0,o=c.length,i=g(e);for(let o of e.pieceData){let i=Math.abs(r(o));if(0===i)continue;let s,m=a?a(o):e.name,g=n(o,m);if(h){let r=l(t),a=l(t+i);s=Re(r,e.x,a-r,e.width,g,o,m)}else{let r=l(t+i),a=l(t);s=Re(e.x,r,e.width,a-r,g,o,m)}d&&(s.fillGradient=d,s.roundedEdge=u),c.push(s),t+=i}if(i>0&&c.length>o){let e=c.slice(o),t=e[0],r=e[e.length-1];1===e.length?t.cornerRadii={tl:i,tr:i,br:i,bl:i}:h?(t.cornerRadii={tl:i,bl:i},r.cornerRadii={tr:i,br:i}):(t.cornerRadii={bl:i,br:i},r.cornerRadii={tl:i,tr:i})}}return c}},_i=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Li=["scene-style","data-paint","accessibility","evidence"],Mi=(e,t)=>({retainedData:e,invalidations:t}),Ii=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ti=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Hi=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Bi=["scene-geometry","data-paint","accessibility","evidence"],Fi=["scene-style","data-paint","accessibility","evidence"],$i=[],Oi={chartType:Mi("rebuild",Ii),runtimeMode:Mi("rebuild",Ii),categoryAccessor:Mi("rebuild",Ii),valueAccessor:Mi("rebuild",Ii),oAccessor:Mi("rebuild",Ii),rAccessor:Mi("rebuild",Ii),stackBy:Mi("rebuild",Ii),groupBy:Mi("rebuild",Ii),timeAccessor:Mi("rebuild",Ii),accessorRevision:Mi("rebuild",Ii),colorAccessor:Mi("rebuild",Fi),symbolAccessor:Mi("rebuild",Bi),connectorAccessor:Mi("rebuild",Bi),dataIdAccessor:Mi("rebuild",Bi),projection:Mi("preserve",Ti),extentPadding:Mi("preserve",Ti),axisExtent:Mi("preserve",Ti),rExtent:Mi("preserve",Ti),oExtent:Mi("preserve",Ti),multiAxis:Mi("preserve",Ti),normalize:Mi("preserve",Ti),bins:Mi("preserve",Ti),oSort:Mi("preserve",Hi),barPadding:Mi("preserve",Hi),roundedTop:Mi("preserve",Hi),baselinePadding:Mi("preserve",Hi),innerRadius:Mi("preserve",Hi),cornerRadius:Mi("preserve",Hi),startAngle:Mi("preserve",Hi),sweepAngle:Mi("preserve",Hi),trackFill:Mi("preserve",Hi),showOutliers:Mi("preserve",Hi),showIQR:Mi("preserve",Hi),amplitude:Mi("preserve",Hi),connectorOpacity:Mi("preserve",Hi),showLabels:Mi("preserve",Hi),dynamicColumnWidth:Mi("rebuild",Hi),customLayout:Mi("preserve",Hi),layoutConfig:Mi("preserve",Hi),layoutMargin:Mi("preserve",Hi),symbolMap:Mi("preserve",Bi),pieceStyle:Mi("preserve",Fi),summaryStyle:Mi("preserve",Fi),connectorStyle:Mi("preserve",Fi),gradientFill:Mi("preserve",Fi),colorScheme:Mi("preserve",Fi),themeCategorical:Mi("preserve",Fi),themeSemantic:Mi("preserve",Fi),themeSequential:Mi("preserve",Fi),themeDiverging:Mi("preserve",Fi),barColors:Mi("preserve",Fi),decay:Mi("preserve",Fi),pulse:Mi("preserve",Fi),staleness:Mi("preserve",Fi),layoutSelection:Mi("preserve",Fi),windowSize:Mi("preserve",$i),windowMode:Mi("preserve",$i),clock:Mi("preserve",$i),transition:Mi("preserve",$i),introAnimation:Mi("preserve",$i),onLayoutError:Mi("preserve",$i)},Di=Mi("preserve",Hi),Ei=class{constructor(){this.tracker=new Dt}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},_i)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Li):this.recordNoop("restyle")}recordConfig(e){let t=function(e){let t="preserve",o=new Set;for(let i of e){let e=Oi[i]??Di;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)o.add(t)}return{retainedData:t,invalidations:o}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};import{quadtree as Wi}from"d3-quadtree";var Ni=class{constructor(e){this.rExtent=new ve,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new Ei,this.rAccessors=[],this.categories=new Set,this._hasStreamingData=!1,this.styleResolver=new Si,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.version=0,this._dataVersion=0,this._bufferArrayCache=null,this._pointQuadtree=null,this._maxPointRadius=0,this._datumIndexCache=null,this._categoryIndexCache=null,this._hasRenderedOnce=!1,this.config=e,this.buffer=new _e(e.windowSize),this.getO=Ge(e.categoryAccessor||e.oAccessor,"category");let t=e.valueAccessor||e.rAccessor;Array.isArray(t)?(this.rAccessors=t.map(e=>Ve(e,"value")),this.getR=this.rAccessors[0],this.rExtents=t.map(()=>new ve)):(this.getR=Ve(t,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=Ge(e.stackBy),this.getGroup=Ge(e.groupBy),this.getColor=Ge(e.colorAccessor),this.getSymbol=Ge(e.symbolAccessor),this.getConnector=Ge(e.connectorAccessor),this.getDataId=Ge(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new _e(e.windowSize))}syncPulseTimestampBuffer(){var e,t,o,i;this.timestampBuffer=(e=!!this.config.pulse,t=this.buffer,o=this.timestampBuffer,i=this.currentTime(),e?null!=o&&o.capacity===t.capacity&&o.size===t.size?o:Ie(t,i):null)}currentTime(){return this.config.clock?.()??io()}ingest(e){let t=this.currentTime();if(this.lastIngestTime=t,this._dataVersion++,e.bounded){this.buffer.clear(),this.rExtent.clear();for(let e of this.rExtents)e.clear();e.preserveCategoryOrder?this._hasStreamingData=!0:this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),Te(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(let o of e.inserts)Be(this.buffer,o,this.timestampBuffer,t),this.categories.add(this.getO(o)),this.pushValueExtent(o)}else{this._hasStreamingData=!0;for(let o of e.inserts){let e=Be(this.buffer,o,this.timestampBuffer,t);this.categories.add(this.getO(o)),this.pushValueExtent(o),null!=e&&this.evictValueExtent(e)}}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}pushValueExtent(e){if("timeline"===this.config.chartType){let t=this.getRawRange(e);t&&(this.rExtent.push(t[0]),this.rExtent.push(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].push(this.rAccessors[t](e));this.rExtent.push(this.getR(e))}else this.rExtent.push(this.getR(e))}evictValueExtent(e){if("timeline"===this.config.chartType){let t=this.getRawRange(e);t&&(this.rExtent.evict(t[0]),this.rExtent.evict(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].evict(this.rAccessors[t](e));this.rExtent.evict(this.getR(e))}else this.rExtent.evict(this.getR(e))}getRawRange(e){let t=this.config.valueAccessor||this.config.rAccessor;if(!t)return null;let o="function"==typeof t?t(e):e[t];return Array.isArray(o)&&o.length>=2?[+o[0],+o[1]]:null}computeScene(e){let{config:t,buffer:o}=this,i=this.scales,r=this.multiScales,a=this.columns;if(0===o.size)return this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,void this.version++;this.rExtent.dirty&&this.rExtent.recalculate(o,this.getR);let n,l,s=this.getBufferArray(),c=t.projection||"vertical",h=t.oExtent||this.resolveCategories(s),d=this.computeValueDomain(s,h),u="horizontal"===c,m="radial"===c,g=Math.min(.9,Math.max(0,null!=t.barPadding?t.barPadding/("vertical"===c?e.width:e.height):.1));if(m){n=ki().domain(h).range([0,1]).padding(0);let o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;l=Ai().domain(d).range([i,o])}else u?(n=ki().domain(h).range([0,e.height]).padding(g),l=Ai().domain(d).range([0,e.width])):(n=ki().domain(h).range([0,e.width]).padding(g),l=Ai().domain(d).range([e.height,0]));this.scales={o:n,r:l,projection:c},this.multiScales=this.rAccessors.length>1&&t.multiAxis?this.rAccessors.map((i,r)=>{let a=this.rExtents[r];a.dirty&&a.recalculate(o,i);let[n,l]=a.extent;n===1/0&&(n=0,l=1);let s=l-n,c=s>0?s*(t.extentPadding??.05):1;return n-=c,l+=c,n>0&&(n=0),u?Ai().domain([n,l]).range([0,e.width]):Ai().domain([n,l]).range([e.height,0])}):[];let p=s;this.rAccessors.length>1&&(p=s.flatMap(e=>this.rAccessors.map((t,o)=>({...e,__rIndex:o,__rValue:t(e),__rName:this.resolveRAccessorName(o)})))),this.columns=this.buildColumns(p,h,n,c,e),this._customLayoutFailedThisBuild=!1;let f=this.buildSceneNodes(p,e);this._customLayoutFailedThisBuild?!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=i,this.multiScales=r,this.columns=a):(this.scene=[],this.rebuildPointQuadtree()):(this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=f,this.rebuildPointQuadtree(),this.config.decay&&this.applyDecay(this.scene,s),this.config.pulse&&this.applyPulse(this.scene,s),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&this.prevPositionMap.size>0&&this.startTransition(),this.version++)}resolveRAccessorName(e){let t=this.config.valueAccessor||this.config.rAccessor,o=Array.isArray(t)?t[e]:t;return"string"==typeof o?o:"value"+e}resolveCategories(e){let t=this.config.oSort,o="streaming"===this.config.runtimeMode||this._hasStreamingData,i="auto"===t?void 0:t,r=null;if(o){r=new Set;for(let t of e)r.add(this.getO(t))}let a=r?Array.from(this.categories).filter(e=>r.has(e)):Array.from(this.categories);if(o&&void 0===i){let e=Math.max(50,3*r.size);if(this.categories.size>e){let t=this.categories.size-e;for(let e of this.categories){if(0>=t)break;r.has(e)||(this.categories.delete(e),t--)}}return a}if(!1===i)return a;if("function"==typeof i)return a.sort(i);let n=new Map;for(let t of e){let e=this.getO(t);n.set(e,(n.get(e)||0)+Math.abs(this.getR(t)))}return a.sort("asc"===i?(e,t)=>(n.get(e)||0)-(n.get(t)||0):(e,t)=>(n.get(t)||0)-(n.get(e)||0))}computeValueDomain(e,t){return function(e){let{data:t,chartType:o,projection:i,normalize:r,rExtent:a,extentPadding:n=.05,baselinePadding:l,axisExtent:s,getO:c,getR:h,getStack:d,rawRExtent:u}=e,m=n;if("radial"===i&&("pie"===o||"donut"===o))return[0,1];let g=0,p=0;if("bar"===o&&d&&r)g=0,p=1;else if("bar"===o&&d){let e=new Map,o=new Map;for(let i of t){let t=c(i),r=h(i);0>r?o.set(t,(o.get(t)||0)+r):e.set(t,(e.get(t)||0)+r)}for(let t of e.values())t>p&&(p=t);for(let e of o.values())g>e&&(g=e)}else if("bar"===o){let e=new Map;for(let o of t){let t=c(o),i=h(o);e.set(t,(e.get(t)||0)+i)}for(let t of e.values())t>p&&(p=t),g>t&&(g=t)}else if("swimlane"===o){let e=new Map;for(let o of t){let t=c(o),i=Math.abs(h(o));e.set(t,(e.get(t)||0)+i)}for(let t of e.values())t>p&&(p=t)}else if("clusterbar"===o||"bar-funnel"===o)for(let e of t){let t=h(e);t>p&&(p=t),g>t&&(g=t)}else{let e=u[0],t=u[1];e!==1/0&&(g=e),t!==-1/0&&(p=t)}a&&(null!=a[0]&&(g=a[0]),null!=a[1]&&(p=a[1]));let f="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(f&&(null!=a?.[0]||null!=a?.[1]||(g>0&&(g=0),0>p&&(p=0))),"bar-funnel"!==o&&"exact"!==s){let e=p-g,t=e>0?e*m:1,i=f&&!l&&0===g,r=f&&!l&&0===p||"swimlane"===o;null==a?.[0]&&!i&&(g-=t),null==a?.[1]&&!r&&(p+=t)}return[g,p]}({data:e,chartType:this.config.chartType,projection:this.config.projection,normalize:this.config.normalize,rExtent:this.config.rExtent,extentPadding:this.config.extentPadding,baselinePadding:this.config.baselinePadding,axisExtent:this.config.axisExtent,getO:this.getO,getR:this.getR,getStack:this.getStack,rawRExtent:this.rExtent.extent})}buildColumns(e,t,o,i,r){return function(e){let{data:t,oExtent:o,oScale:i,projection:r,layout:a,dynamicColumnWidth:n,getO:l,getR:s}=e,c=Object.create(null),h=new Map;for(let e of t){let t=l(e);h.has(t)||h.set(t,[]),h.get(t).push(e)}let d=0;if("radial"===r)for(let e of t)d+=Math.abs(s(e));let u=null;if(n&&"radial"!==r){u=new Map;let e=0;for(let t of o){let o,i=h.get(t)||[];o="string"==typeof n?i.reduce((e,t)=>e+(Number(t[n])||0),0):n(i),u.set(t,o),e+=o}let t=("horizontal"===r?a.height:a.width)-i.padding()*i.step()*o.length;if(e>0)for(let[o,i]of u)u.set(o,i/e*t)}let m=0,g=0;for(let e of o){let t,o,r=h.get(e)||[],a=r.reduce((e,t)=>e+Math.abs(s(t)),0),n=d>0?a/d:0;u?(t=g,o=u.get(e)||i.bandwidth(),g+=o+i.padding()*i.step()):(t=i(e)??0,o=i.bandwidth()),c[e]={name:e,x:t,y:0,width:o,middle:t+o/2,padding:i.padding()*i.step(),pieceData:r,pct:n,pctStart:m},m+=n}return c}({data:e,oExtent:t,oScale:o,projection:i,layout:r,dynamicColumnWidth:this.config.dynamicColumnWidth,getO:this.getO,getR:this.getR})}getSceneContext(){return{scales:this.scales,columns:this.columns,config:this.config,getR:this.getR,getStack:this.getStack,getGroup:this.getGroup,getColor:this.getColor,getSymbol:this.getSymbol,getConnector:this.getConnector,getO:this.getO,multiScales:this.multiScales,rAccessors:this.rAccessors,resolvePieceStyle:(e,t)=>this.styleResolver.resolvePieceStyle(this.config,e,t),resolveSummaryStyle:(e,t)=>this.styleResolver.resolveSummaryStyle(this.config,e,t),getRawRange:e=>this.getRawRange(e)}}buildSceneNodes(e,o){if(!this.scales)return[];if(this.config.customLayout){let t=this.buildLayoutContext(e,o),i=mt({family:"ordinal",logLabel:"ordinal customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:this.config.onLayoutError,run:()=>this.config.customLayout(t)});if("failure"===i.kind)return this.lastCustomLayoutFailure=i.diagnostic,this._customLayoutFailedThisBuild=!0,i.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);let r=i.result;this.customLayoutOverlays=r.overlays??null,this.lastCustomLayoutResult=r,this.lastCustomLayoutFailure=null;let a=r.nodes??[];if(this._customRestyle=r.restyle,this.hasCustomRestyle=!!r.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(let e of a)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(a,this.config.layoutSelection??null)}return xt({label:"ordinal customLayout",nodes:a,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),a}this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1;let i=this.getSceneContext(),r=Ci[this.config.chartType],a=r?r(i,o):[];return this.getConnector&&this.scales&&(a=[...t(i,a),...a]),a}buildLayoutContext(e,t){let o=this.config,i=o.layoutMargin??{top:0,right:0,bottom:0,left:0},r=St(o.colorScheme,o.themeCategorical,No),a=this.scales;return{data:e,scales:{o:a.o,r:a.r,projection:a.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:"radial"===a.projection?{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height}:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:o.themeSemantic??{},categorical:[...r]},resolveColor:At(r,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){let o=this.config.decay;return o&&t>1?et(o,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;let t=Ke(e);return this._datumIndexCache={version:this._dataVersion,map:t},t}getCategoryIndexMap(e){if(this._categoryIndexCache&&this._categoryIndexCache.version===this._dataVersion)return this._categoryIndexCache.map;let t=function(e,t){let o="function"==typeof t,i=o?null:t||"category",r=new Map;for(let a=0;e.length>a;a++){let n=e[a],l=o?t(n):n[i],s=r.get(l);s?s.push(a):r.set(l,[a])}return r}(e,this.config.categoryAccessor||this.config.oAccessor);return this._categoryIndexCache={version:this._dataVersion,map:t},t}rebuildPointQuadtree(){let e=function(e){let t=0,o=0;for(let i of e)"point"===i.type&&!1!==i.interactive&&(t++,i.r>o&&(o=i.r));if(500>=t)return{quadtree:null,maxRadius:o};let i=Array(t),r=0;for(let t of e)"point"===t.type&&!1!==t.interactive&&(i[r++]=t);return{maxRadius:o,quadtree:Wi().x(e=>e.x).y(e=>e.y).addAll(i)}}(this.scene);this._pointQuadtree=e.quadtree,this._maxPointRadius=e.maxRadius}get pointQuadtree(){return this._pointQuadtree}get maxPointRadius(){return this._maxPointRadius}applyDecay(e,t){if(!this.config.decay)return;let o=t.length;if(1>=o)return;let i=this.getDatumIndexMap(t);for(let t of e){if("connector"===t.type||"violin"===t.type||"boxplot"===t.type||"wedge"===t.type||!t.datum)continue;let e=i.get(t.datum);if(null==e)continue;let r=this.computeDecayOpacity(e,o);t.style={...t.style,opacity:(t.style?.opacity??1)*r}}}applyPulse(e,t,o=this.currentTime()){return!(!this.config.pulse||!this.timestampBuffer)&&function(e,t,o,i,r,a){let n=e.color??"rgba(255,255,255,0.6)",l=e.glowRadius??4,s=!1;for(let c of t){if("connector"===c.type||"violin"===c.type||"boxplot"===c.type)continue;if("wedge"===c.type){let t=c.category;if(!t)continue;let i=0;for(let n of r(t)??[]){let t=o.get(n);null!=t&&(i=Math.max(i,Me(e,t,a)))}s=$e(c,i,n)||s;continue}if(null==c.datum)continue;let t=i.get(c.datum);if(null==t)continue;let h=o.get(t),d=null==h?0:Me(e,h,a);s=$e(c,d,n,l)||s}return s}(this.config.pulse,e,this.timestampBuffer,this.getDatumIndexMap(t),e=>this.getCategoryIndexMap(t).get(e),o)}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&He(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}synthesizeIntroPositions(){this.prevPositionMap.clear();let e,t=new Map,o=this.scales?.r(0)??0,i="horizontal"!==this.scales?.projection;for(let r=0;this.scene.length>r;r++){let a=this.scene[r],n=this.getNodeKey(a,t);n&&("rect"===a.type?this.prevPositionMap.set(n,i?{x:a.x,y:o,w:a.w,h:0,opacity:a.style.opacity??1}:{x:o,y:a.y,w:0,h:a.h,opacity:a.style.opacity??1}):"point"===a.type?this.prevPositionMap.set(n,{x:a.x,y:a.y,r:0,opacity:0}):"wedge"===a.type&&(void 0===e&&(e=a.startAngle),this.prevPositionMap.set(n,{x:a.cx,y:a.cy,startAngle:e,endAngle:e,innerRadius:a.innerRadius,outerRadius:a.outerRadius,opacity:0})))}}getNodeKey(e,t){if("point"===e.type){let o=`p:${e.datum?this.getO(e.datum):""}:${e.datum?this.getR(e.datum):0}`,i=t.get(o)||0;return t.set(o,i+1),`${o}:${i}`}if("rect"===e.type){let o=e.datum?null!=e.datum.category&&""!==e.datum.category?e.datum.category+"":(this.getO(e.datum)??"")+"":"",i=`r:${e.group||""}:${o}`,r=t.get(i)||0;return t.set(i,r+1),0===r?i:`${i}:${r}`}return"wedge"===e.type?"w:"+(e.category??""):null}snapshotPositions(){this.prevPositionMap.clear();let e=new Map;for(let t=0;this.scene.length>t;t++){let o=this.scene[t],i=this.getNodeKey(o,e);i&&("point"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,r:o.r,opacity:o.style.opacity??o.style.fillOpacity}):"rect"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,w:o.w,h:o.h,opacity:o.style.opacity??o.style.fillOpacity}):"wedge"===o.type&&this.prevPositionMap.set(i,{x:o.cx,y:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius,opacity:o.style.opacity??1}))}}startTransition(){if(!this.config.transition||0===this.prevPositionMap.size)return;let e=this.config.transition.duration??300;if(this.exitNodes.length>0){let e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}let t=!1,o=new Set,i=new Map;for(let e=0;this.scene.length>e;e++){let r=this.scene[e],a=this.getNodeKey(r,i);if(!a)continue;r._transitionKey=a;let n=this.prevPositionMap.get(a);if("point"===r.type)n?(o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.x!==r.x||n.y!==r.y||void 0!==n.r&&n.r!==r.r)&&(r._targetX=r.x,r._targetY=r.y,r._targetR=r.r,r.x=n.x,r.y=n.y,void 0!==n.r&&(r.r=n.r),t=!0)):(r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r._targetR=r.r,r.r=0,r.style={...r.style,opacity:0},t=!0);else if("rect"===r.type)n?(o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.x!==r.x||n.y!==r.y||n.w!==r.w||n.h!==r.h)&&(r._targetX=r.x,r._targetY=r.y,r._targetW=r.w,r._targetH=r.h,r.x=n.x,r.y=n.y,r.w=n.w??r.w,r.h=n.h??r.h,t=!0)):(r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r.style={...r.style,opacity:0},t=!0);else if("wedge"===r.type)if(n)o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.startAngle!==r.startAngle||n.endAngle!==r.endAngle)&&(r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle,r.startAngle=n.startAngle,r.endAngle=n.endAngle,t=!0);else{r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle;let e=r.startAngle;r.startAngle=e,r.endAngle=e,r.style={...r.style,opacity:0},this.prevPositionMap.set(a,{x:r.cx,y:r.cy,startAngle:e,endAngle:e,innerRadius:r.innerRadius,outerRadius:r.outerRadius,opacity:0}),t=!0}}this.exitNodes=[];for(let[e,i]of this.prevPositionMap)if(!o.has(e)){if(e.startsWith("p:"))this.exitNodes.push({type:"point",x:i.x,y:i.y,r:i.r??3,style:{opacity:i.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))this.exitNodes.push({type:"rect",x:i.x,y:i.y,w:i.w??0,h:i.h??0,style:{opacity:i.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("w:")){let t=((i.startAngle??0)+(i.endAngle??0))/2,o={type:"wedge",cx:i.x,cy:i.y,innerRadius:i.innerRadius??0,outerRadius:i.outerRadius??100,startAngle:i.startAngle??0,endAngle:i.endAngle??0,style:{opacity:i.opacity??1},datum:null,category:e.slice(2),_targetStartAngle:t,_targetEndAngle:t,_targetOpacity:0,_transitionKey:e};this.exitNodes.push(o)}t=!0}this.exitNodes.length>0&&(this.scene=[...this.scene,...this.exitNodes]),t&&(this.activeTransition={startTime:this.currentTime(),duration:e})}advanceTransition(e){if(!this.activeTransition)return!1;let t=Gt(e,this.activeTransition),o=Vt(t,"linear"===this.config.transition?.easing?"linear":"ease-out-cubic");for(let e of this.scene){let t=e._transitionKey;if(t)if("point"===e.type){if(void 0!==e._targetOpacity){let i=this.prevPositionMap.get(t);e.style.opacity=Jt(i?i.opacity??1:0,e._targetOpacity,o)}let i=this.prevPositionMap.get(t);void 0!==e._targetX&&i&&(e.x=Jt(i.x,e._targetX,o),e.y=Jt(i.y,e._targetY,o)),void 0!==e._targetR&&void 0!==i?.r&&(e.r=Jt(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){let i=this.prevPositionMap.get(t);e.style.opacity=Jt(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX)continue;let i=this.prevPositionMap.get(t);if(!i)continue;e.x=Jt(i.x,e._targetX,o),e.y=Jt(i.y,e._targetY,o),void 0!==i.w&&(e.w=Jt(i.w,e._targetW,o),e.h=Jt(i.h,e._targetH,o))}else if("wedge"===e.type){if(void 0!==e._targetOpacity){let i=this.prevPositionMap.get(t);e.style={...e.style,opacity:Jt(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0!==e._targetStartAngle&&void 0!==e._targetEndAngle){let i=this.prevPositionMap.get(t);i&&void 0!==i.startAngle&&(e.startAngle=Jt(i.startAngle,e._targetStartAngle,o),e.endAngle=Jt(i.endAngle,e._targetEndAngle,o))}}}if(t>=1){for(let e of this.scene)if(void 0!==e._targetOpacity&&(e.style={...e.style||{},opacity:0===e._targetOpacity?0:e._targetOpacity},e._targetOpacity=void 0),"point"===e.type){if(void 0===e._targetX&&void 0===e._targetR)continue;void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY),void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0);if(this.exitNodes.length>0){let e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}return this.activeTransition=null,!1}return!0}cancelIntroAnimation(){this.prevPositionMap.clear(),this.activeTransition=null,ke(this.scene),this.exitNodes=[]}getBufferArray(){return this._bufferArrayCache?.version!==this._dataVersion&&(this._bufferArrayCache={version:this._dataVersion,data:this.buffer.toArray()}),this._bufferArrayCache.data}getData(){return this.buffer.toArray()}remove(e){if(!this.getDataId)throw Error("remove() requires dataIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();let t=Se(e),o=this.getDataId,i=e=>t.has(o(e));Le(this.buffer,this.timestampBuffer,i);let r=this.buffer.remove(i);if(0===r.length)return this.updateResults.recordNoop("remove"),r;for(let e of r)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach(e=>this.categories.add(this.getO(e))),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length),r}update(e,t){if(!this.getDataId)throw Error("update() requires dataIdAccessor to be configured");let o=Se(e),i=this.getDataId,r=new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&r.add(t)});let a=this.buffer.update(e=>o.has(i(e)),t);if(0===a.length)return this.updateResults.recordNoop("update"),a;for(let e of a)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),r.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",a.length),a}clear(){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this._hasStreamingData=!1,this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.columns={},this.multiScales=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._pointQuadtree=null,this._maxPointRadius=0,this.styleResolver.resetColors(),this._dataVersion++,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getOAccessor(){return this.getO}getRAccessor(){return this.getR}applyCustomRestyle(e,t){let o=this._customRestyle;if(o)for(let i of e){let e=this._baseStyles.get(i)??i.style??{},r=o(i,t);i.style=r?{...e,...r}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}rebuildAccessorDerivedState(){this.categories.clear(),this.rExtent.clear();for(let e of this.rExtents)e.clear();this._categoryIndexCache=null,this.buffer.forEach(e=>{this.categories.add(this.getO(e)),this.pushValueExtent(e)})}updateConfig(e){let t={...this.config},o=Object.keys(e).filter(o=>e[o]!==t[o]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e&&e.colorScheme!==t.colorScheme||"themeCategorical"in e&&e.themeCategorical!==t.themeCategorical||"colorAccessor"in e&&!ze(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!ze(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!ze(e.oAccessor,t.oAccessor))&&(this._categoryIndexCache=null),Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let i=!1;("categoryAccessor"in e||"oAccessor"in e)&&(ze(this.config.categoryAccessor||this.config.oAccessor,t.categoryAccessor||t.oAccessor)||(this.getO=Ge(this.config.categoryAccessor||this.config.oAccessor,"category"),i=!0));let r=!1;if("valueAccessor"in e||"rAccessor"in e){let e=this.config.valueAccessor||this.config.rAccessor,o=t.valueAccessor||t.rAccessor,i=Array.isArray(e)?e:[e],a=Array.isArray(o)?o:[o];if(r=i.length!==a.length||i.some((e,t)=>!ze(e,a[t])),r){let e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>Ve(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new ve)):(this.getR=Ve(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!ze(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?Ge(this.config.stackBy):void 0),"groupBy"in e&&!ze(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?Ge(this.config.groupBy):void 0),"colorAccessor"in e&&!ze(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?Ge(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!ze(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?Ge(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!ze(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?Ge(this.config.connectorAccessor):void 0),(i||r||"accessorRevision"in e&&e.accessorRevision!==t.accessorRevision)&&this.rebuildAccessorDerivedState(),this.updateResults.recordConfig(o)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};Xe(Ni);import{useCallback as ji,useImperativeHandle as zi}from"react";import{useMemo as Vi,useRef as Gi,useId as qi}from"react";import{Fragment as Xi,jsx as Yi,jsxs as Qi}from"react/jsx-runtime";import*as Ki from"react";import{jsx as Zi}from"react/jsx-runtime";var Ui=null,Ji=null;import{arc as er}from"d3-shape";var tr=(e,t)=>({x:e*Math.cos(t),y:e*Math.sin(t)}),or=(e,t,o,i)=>{let r=t.filter(e=>"wedge"===e.type);for(let t of r){let o=t.style.strokeWidth??1,i=t.style.stroke,r=!(!i||"none"===i||0>=o);if(e.globalAlpha=(t.style.fillOpacity??1)*(t.style.opacity??1),t._gradientBand&&t._gradientBand.colors.length>0)L(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(M(e,t),kt(e,t)),e.globalAlpha=1;else{if(e.fillStyle=hi(e,t.style.fill,"#007bff"),t.roundedEnds){r&&(e.strokeStyle=ci(e,i)||i,e.lineWidth=o);let a=C({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds.start,roundEnd:t.roundedEnds.end});e.save(),e.translate(t.cx,t.cy);let n=new Path2D(a);e.fill(n),r&&e.stroke(n),e.restore()}else t.cornerRadius?(r&&(e.strokeStyle=ci(e,i)||i,e.lineWidth=o),I(e,t)):(M(e,t),e.fill(),r&&(e.strokeStyle=ci(e,i)||i,e.lineWidth=o,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(M(e,t),kt(e,t)),e.globalAlpha=1}}},ir=(e,t,o,i)=>{let r=t.filter(e=>"boxplot"===e.type);for(let t of r){let o=t.columnWidth/2,i="vertical"===t.projection,r=ci(e,"var(--semiotic-primary, #007bff)"),a=ci(e,"var(--semiotic-text, #333)"),n=hi(e,t.style.fill,r),l=t.style.stroke,s="string"==typeof l?ci(e,l)||l:a,c=t.style.strokeWidth??1,h=c>0&&!("string"==typeof l&&"none"===l.trim().toLowerCase()),d=t.style.fillOpacity??t.style.opacity??.6;if(e.save(),h&&(e.strokeStyle=s,e.lineWidth=c,e.beginPath(),i?(e.moveTo(t.x,t.minPos),e.lineTo(t.x,t.maxPos)):(e.moveTo(t.minPos,t.y),e.lineTo(t.maxPos,t.y)),e.stroke(),e.beginPath(),i?(e.moveTo(t.x-.4*o,t.minPos),e.lineTo(t.x+.4*o,t.minPos),e.moveTo(t.x-.4*o,t.maxPos),e.lineTo(t.x+.4*o,t.maxPos)):(e.moveTo(t.minPos,t.y-.4*o),e.lineTo(t.minPos,t.y+.4*o),e.moveTo(t.maxPos,t.y-.4*o),e.lineTo(t.maxPos,t.y+.4*o)),e.stroke()),e.globalAlpha=d,e.fillStyle=n,i){let i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(t.x-o,i,t.columnWidth,r),e.globalAlpha=1,h&&e.strokeRect(t.x-o,i,t.columnWidth,r)}else{let i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(i,t.y-o,r,t.columnWidth),e.globalAlpha=1,h&&e.strokeRect(i,t.y-o,r,t.columnWidth)}h&&(e.strokeStyle=s,e.lineWidth=2*c,e.beginPath(),i?(e.moveTo(t.x-o,t.medianPos),e.lineTo(t.x+o,t.medianPos)):(e.moveTo(t.medianPos,t.y-o),e.lineTo(t.medianPos,t.y+o)),e.stroke()),e.restore()}},rr=new WeakMap,ar=(e,t,o,i)=>{for(let o of t){if("violin"!==o.type)continue;e.save(),(o.translateX||o.translateY)&&e.translate(o.translateX,o.translateY);let t=rr.get(o);(!t||t.source!==o.pathString)&&(t={source:o.pathString,path:new Path2D(o.pathString)},rr.set(o,t));let i=t.path;e.globalAlpha=o.style.fillOpacity??o.style.opacity??.6,e.fillStyle=hi(e,o.style.fill,"#007bff"),e.fill(i),e.globalAlpha=1;let r=o.style.strokeWidth??1;if(o.style.stroke&&"none"!==o.style.stroke&&r>0&&(e.strokeStyle=ci(e,o.style.stroke)||o.style.stroke,e.lineWidth=r,e.stroke(i)),o.iqrLine){e.strokeStyle="#333",e.lineWidth=2,e.globalAlpha=.8;let t=o.iqrLine.centerPos,i=!1!==o.iqrLine.isVertical;e.beginPath(),i?(e.moveTo(t,o.iqrLine.q1Pos),e.lineTo(t,o.iqrLine.q3Pos)):(e.moveTo(o.iqrLine.q1Pos,t),e.lineTo(o.iqrLine.q3Pos,t)),e.stroke(),e.beginPath(),i?e.arc(t,o.iqrLine.medianPos,3,0,2*Math.PI):e.arc(o.iqrLine.medianPos,t,3,0,2*Math.PI),e.fillStyle="#fff",e.fill(),e.strokeStyle="#333",e.lineWidth=1,e.stroke(),e.globalAlpha=1}e.restore()}},nr=(e,t,o,i)=>{let r=t.filter(e=>"connector"===e.type);if(0===r.length)return;let a=new Map;for(let e of r){let t=e.group||"_default";a.has(t)||a.set(t,[]),a.get(t).push(e)}for(let[,t]of a){if(0===t.length)continue;let o=t[0].style;if(o.fill&&"none"!==o.fill){e.beginPath(),e.moveTo(t[0].x1,t[0].y1);for(let o of t)e.lineTo(o.x2,o.y2);e.closePath(),e.globalAlpha=o.fillOpacity??o.opacity??.3,e.fillStyle=ti(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(let o of t){let t=o.style.strokeWidth??1;0>=t||"none"===o.style.stroke||(e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=ci(e,o.style.stroke)||hi(e,o.style.fill,"")||ci(e,"var(--semiotic-border, #999)"),e.lineWidth=t,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1)}}},lr=(e,t,o,i)=>{let r=t.filter(e=>"trapezoid"===e.type);for(let t of r){let o=t.points;if(4>o.length)continue;e.globalAlpha=t.style?.opacity??1,e.beginPath(),e.moveTo(o[0][0],o[0][1]);for(let t=1;o.length>t;t++)e.lineTo(o[t][0],o[t][1]);e.closePath(),e.fillStyle=ti(e,t.style?.fill)||"#999",e.fill();let i=t.style?.strokeWidth??1;t.style?.stroke&&"none"!==t.style.stroke&&i>0&&(e.strokeStyle=ci(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.stroke()),e.globalAlpha=1}},sr=new Map,cr=E(fe),hr=E(Ee),dr=E(We),ur=E(Ne),mr=e=>[nr,...e],gr={bar:mr([cr]),clusterbar:mr([cr]),point:mr([hr,dr]),swarm:mr([hr,dr]),pie:[or],donut:[or],boxplot:mr([ir,hr]),violin:mr([ar]),histogram:mr([cr]),ridgeline:mr([ar]),timeline:mr([cr]),funnel:[cr,lr,(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&null!=e.datum);if(0===r.length||!r.some(e=>null!=e.datum?.__funnelStepLabel||null!=e.datum?.__funnelValueLabelX))return;let a=ci(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif";e.textBaseline="top",e.lineJoin="round",e.textAlign="center",e.font="bold 14px "+a;for(let t of r){let o=t.datum;if(!o||!o.__funnelStepLabel)continue;let i=o.__funnelStepLabel;if(e.measureText(i).width+16>(o.__funnelRowWidth??o.__funnelBarW??0))continue;let r=o.__funnelStepLabelX,a=o.__funnelStepLabelY+3;e.strokeStyle="rgba(0,0,0,0.6)",e.lineWidth=3,e.strokeText(i,r,a),e.fillStyle="#fff",e.fillText(i,r,a)}e.font="bold 13px "+a;for(let t of r){let o=t.datum;if(!o||null==o.__funnelValueLabelX)continue;let i=o.__funnelBarW??0;if(60>i)continue;let r=o.__funnelValue;if(null==r||0===r)continue;let a,n=o.__funnelPercent,l=!0===o.__funnelIsFirstStep;if(a=l?T(r):null!=n?`${T(r)} (${H(n)})`:T(r),e.measureText(a).width+16>i){if(l||null==n)continue;if(a=T(r),e.measureText(a).width+16>i)continue}let s=o.__funnelValueLabelX,c=(o.__funnelValueLabelY??t.y)+14+5;e.textAlign="center",e.strokeStyle="rgba(0,0,0,0.5)",e.lineWidth=3,e.strokeText(a,s,c),e.fillStyle="#fff",e.fillText(a,s,c)}e.lineWidth=1,e.lineJoin="miter"}],"bar-funnel":[cr,(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(let t of r){let o=("string"==typeof t.style.fill?t.style.fill:null)||ci(e,"var(--semiotic-border, #999)"),i=B(o,e);e.globalAlpha=t.style.opacity??1,e.beginPath(),e.rect(t.x,t.y,t.w,t.h),i?e.fillStyle=i:(e.fillStyle=o,e.globalAlpha=.4*(t.style.opacity??1)),e.fill(),e.globalAlpha=1}},(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===r.length)return;let a=ci(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif",n=function(e,t){let[o,i,r]=si(e,t);return(.2126*o+.7152*i+.0722*r)/255>.6}(e,ci(e,"var(--semiotic-text, #333)")),l=n?"#1f2937":"#ffffff",s=n?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)",c=n?"#f3f4f6":"#1a1a1a",h=c;for(let t of r){let o=t.datum;if(!o)continue;let i=o.__barFunnelValue;if(null==i||25>t.w)continue;let r=o.__barFunnelPercent,n=!(!0===o.__barFunnelIsFirstStep)&&null!=r,d=n?O(r):"",u=$(i);e.font="bold 13px "+a;let m=n?e.measureText(d).width:0;e.font="11px "+a;let g=e.measureText(u).width,p=Math.max(m,g)+12,f=n?32:17,y=o.__barFunnelLabelX,v=y-p/2,b=o.__barFunnelLabelY-f-4;e.save(),e.shadowColor="rgba(0,0,0,0.15)",e.shadowBlur=4,e.shadowOffsetY=1,e.fillStyle=l,e.beginPath(),F(e,v,b,p,f,4),e.fill(),e.restore(),e.strokeStyle=s,e.lineWidth=.5,e.beginPath(),F(e,v,b,p,f,4),e.stroke(),e.textAlign="center",e.textBaseline="top",n?(e.font="bold 13px "+a,e.fillStyle=c,e.fillText(d,y,b+3),e.font="11px "+a,e.fillStyle=h,e.fillText(u,y,b+3+13+2)):(e.font="bold 11px "+a,e.fillStyle=c,e.fillText(u,y,b+3))}e.lineWidth=1}],swimlane:mr([cr]),custom:mr([cr,hr,dr,ur,or,ir,ar,lr])};import*as pr from"react";import*as fr from"react";import{arc as yr}from"d3-shape";import{jsx as vr,jsxs as br}from"react/jsx-runtime";import{jsx as xr,jsxs as wr}from"react/jsx-runtime";import{jsx as kr,jsxs as Ar}from"react/jsx-runtime";X.ownsChrome=!0;import{jsx as Sr,jsxs as Rr}from"react/jsx-runtime";var Pr=je,Cr=fi(pi(function(t,o){let{chartType:i,runtimeMode:r,data:a,oAccessor:n="category",rAccessor:l="value",colorAccessor:s,symbolAccessor:c,symbolMap:h,stackBy:d,groupBy:u,multiAxis:m,timeAccessor:g,valueAccessor:p,categoryAccessor:f,accessorRevision:y,projection:v="vertical",size:b=[600,400],responsiveWidth:x,responsiveHeight:w,margin:C,maxDevicePixelRatio:_,barPadding:L,roundedTop:M,gradientFill:I,trackFill:T,baselinePadding:H,innerRadius:B,cornerRadius:F,normalize:$,startAngle:O,sweepAngle:D,dynamicColumnWidth:E,bins:W,showOutliers:N,showIQR:j,amplitude:z,connectorOpacity:V,showLabels:q,connectorAccessor:Y,connectorStyle:Q,dataIdAccessor:K,rExtent:Z,oExtent:U,extentPadding:J=.05,oSort:ee,windowMode:te="sliding",windowSize:oe=200,pieceStyle:ie,summaryStyle:re,renderMode:ae,colorScheme:ne,barColors:le,showAxes:se=!0,showCategoryTicks:ce,categoryLabel:he,valueLabel:de,categoryFormat:ue,valueFormat:me,oLabel:ge,rLabel:pe,oFormat:fe,rFormat:ve,rTickValues:ke,tickLabelEdgeAlign:Ae,axisExtent:Se,enableHover:Re=!0,hoverRadius:Pe=30,hoverAnnotation:_e,tooltipContent:Le,customHoverBehavior:Me,customClickBehavior:Ie,onObservation:Te,annotationObservationCallback:He,chartId:Be,annotations:$e,onAnnotationActivate:Ee,autoPlaceAnnotations:We,svgAnnotationRules:Ne,showGrid:je=!1,legend:ze,legendHoverBehavior:Ve,legendClickBehavior:Ge,legendHighlightedCategory:Xe,legendIsolatedCategories:Ye,legendPosition:Qe,legendLayout:Ke,legendCategoryAccessor:Ze,onCategoriesChange:Ue,backgroundGraphics:et,foregroundGraphics:tt,title:ot,className:it,background:rt,centerContent:at,decay:nt,pulse:lt,transition:st,animate:ct,staleness:dt,frameScheduler:mt,clock:xt,random:kt,seed:At,paused:St=!1,suspendWhenHidden:Rt=!0,brush:Mt,onBrush:Ht,accessibleTable:Bt=!0,description:Dt,summary:Et,customLayout:Wt,onLayoutError:Nt,layoutConfig:jt,layoutSelection:Vt}=t,{customHoverBehavior:Gt,customClickBehavior:qt,hasClickBehavior:Xt}=De({customHoverBehavior:Me,customClickBehavior:Ie,onObservation:Te,chartId:Be,chartType:"StreamOrdinalFrame"}),Kt=f??n,Jt=p??l,eo=he??ge,to=de??pe,oo=ue??fe,io=me??ve,ro=xi(!0),no=Mo({sizeProp:b,responsiveWidth:x,responsiveHeight:w,userMargin:C,marginDefault:Pr,title:ot,legend:ze,legendPosition:Qe,...xe(t,ze),animate:ct,transitionProp:st,frameScheduler:mt,clock:xt,random:kt,seed:At,paused:St,suspendWhenHidden:Rt,themeDirtyRef:ro}),{reducedMotionRef:so,responsiveRef:co,size:ho,margin:uo,adjustedWidth:mo,adjustedHeight:go,currentTheme:po,transition:fo,introEnabled:yo,tableId:xo,rafRef:ko,renderFnRef:Ao,scheduleRender:Ro,frameRuntime:Po}=no;vi(()=>wo(()=>{ro.current=!0,Ro()}),[Ro]);let _o=To(),Lo=Oo(),Bo=bi(()=>Yt(a),[a]),Fo=xi(null),$o=xi(!1),[Do,Eo]=wi(null),[Wo,No]=wi(null),jo=ut(tt,ho,uo,Wo),zo=ut(et,ho,uo,Wo),Vo=et||"transparent"===rt?null:Sr("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-uo.left,y:-uo.top,width:ho[0],height:ho[1],fill:rt||"var(--semiotic-bg, transparent)"}),Go=et&&rt&&"transparent"!==rt?Sr("rect",{className:"semiotic-canvas-background semiotic-canvas-background--combined","data-semiotic-layer":"canvas-background",x:-uo.left,y:-uo.top,width:ho[0],height:ho[1],fill:rt}):null,[qo,Xo]=wi(0),Yo=xi(0),[Qo,Ko]=wi(!1),Zo=xi({w:-1,h:-1}),Jo=xi(!1),ei=Ho("StreamOrdinalFrame"),ti=Re||_e,oi="streaming"===r,ii=bi(()=>({chartType:i,runtimeMode:oi?"streaming":"bounded",windowSize:oe,windowMode:te,extentPadding:J,projection:v,oAccessor:oi?void 0:Kt,rAccessor:oi?void 0:Jt,accessorRevision:y,colorAccessor:s,symbolAccessor:c,symbolMap:h,stackBy:d,groupBy:u,multiAxis:m,timeAccessor:oi?g:void 0,valueAccessor:oi?p||("string"==typeof Jt||"function"==typeof Jt?Jt:void 0):void 0,categoryAccessor:oi?Kt:void 0,rExtent:Z,oExtent:U,axisExtent:Se,barPadding:L,roundedTop:M,gradientFill:Ce(I),trackFill:T,baselinePadding:H,innerRadius:B,cornerRadius:F,normalize:$,startAngle:O,sweepAngle:D,dynamicColumnWidth:E,bins:W,showOutliers:N,showIQR:j,amplitude:z,connectorOpacity:V,showLabels:q,connectorAccessor:Y,connectorStyle:Q,dataIdAccessor:K,oSort:ee,pieceStyle:ie,summaryStyle:re,colorScheme:ne,themeCategorical:po?.colors?.categorical,themeSemantic:Uo(po),themeSequential:po?.colors?.sequential,themeDiverging:po?.colors?.diverging,barColors:le,decay:nt,pulse:lt,transition:fo,introAnimation:yo,staleness:dt,clock:Po.now,customLayout:Wt,onLayoutError:Nt,layoutConfig:jt,layoutMargin:uo}),[i,oi,oe,te,J,v,Kt,Jt,y,s,c,h,d,u,m,g,p,Z,U,Se,L,M,I,T,H,B,F,$,O,D,E,W,N,j,z,V,q,Y,Q,K,ee,ie,re,ne,po,le,nt,lt,fo,yo,dt,Po.now,Wt,Nt,jt,uo]),ri=vt(ii),ai=xi(null);ai.current||(ai.current=new Ni(ri));let ni=yt(ai,Ze,Ue,e=>e.getData());pt(ai,ri,ro,Ro),ft(ai,Vt,ro,Ro);let li=xi(null);li.current||(li.current=new ye(e=>{let t=ai.current;t&&t.ingest(e)&&(ro.current=!0,Ro())})),function(e,{storeRef:t,adapterRef:o,dirtyRef:i,scheduleRender:r,hoverRef:a,setHoverPoint:n}){let l=ji(e=>{o.current?.push(e)},[o]),s=ji(e=>{o.current?.pushMany(e)},[o]),c=ji(()=>{o.current?.clear(),t.current?.clear(),i.current=!0,r()},[o,t,i,r]),h=ji(e=>{o.current?.clearLastData(),o.current?.setReplacementData(e)},[o]);zi(e,()=>({push:l,pushMany:s,replace:h,remove:e=>{o.current?.flush();let l=t.current?.remove(e)??[];if(l.length>0){let e=a.current?.data;a.current&&l.some(Array.isArray(e)?t=>e.includes(t):t=>t===e)&&(a.current=null,n(null)),i.current=!0,r()}return l},update:(e,a)=>{o.current?.flush();let n=t.current?.update(e,a)??[];return n.length>0&&(i.current=!0,r()),n},clear:c,getData:()=>(o.current?.flush(),t.current?.getData()??[]),getScales:()=>t.current?.scales??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null}),[l,s,h,c,r,o,t,i,a,n])}(o,{storeRef:ai,adapterRef:li,dirtyRef:ro,scheduleRender:Ro,hoverRef:Fo,setHoverPoint:Eo}),vi(()=>{a&&li.current?.setBoundedData(Bo)},[a,Bo]);let{canvasRef:si,resolutionDirtyRef:ci}=Io(no,{storeRef:ai,dirtyRef:ro,hydrated:_o,wasHydratingFromSSR:Lo,cleanup:()=>li.current?.clear(),maxDevicePixelRatio:_,canvasPaintDependencies:[i,mo,go,se,rt,et,ae,Ro]}),{hoverHandlerRef:hi,hoverLeaveRef:di,onPointerMove:ui,onPointerLeave:mi,pointerStateRef:gi}=no;hi.current=e=>{let t=si.current;if(!t)return;let o=ai.current;if(!o)return void bo(t);let r=k({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:uo.left,top:uo.top},width:mo,height:go,projection:v,hoverRadius:Pe,scene:o.scene,pointQuadtree:o.pointQuadtree,maxPointRadius:o.maxPointRadius});if(bo(t,"hit"===r.kind?vo(r.hit.node):void 0),!ti)return;if("hit"!==r.kind)return void(Fo.current&&(Fo.current=null,Eo(null),Gt&&Gt(null),Ro()));let a=A(r.hit,{oAccessor:Kt,rAccessor:Jt,chartType:i});Fo.current=a,Eo(a),Gt?.(a),Ro()},di.current=()=>{bo(si.current),Fo.current&&(Fo.current=null,Eo(null),Gt?.(null),Ro())},Co(si);let pi=yi(e=>{if(Zt(e.target)||!qt)return;let t=si.current;if(!t)return qt(null),void Ro();let o=ai.current;if(!o)return qt(null),void Ro();let r=k({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:uo.left,top:uo.top},width:mo,height:go,projection:v,hoverRadius:Pe,scene:o.scene,pointQuadtree:o.pointQuadtree,maxPointRadius:o.maxPointRadius});if("hit"!==r.kind)return qt(null),void Ro();qt(A(r.hit,{oAccessor:Kt,rAccessor:Jt,chartType:i}),{type:"activate",inputType:ao(e.nativeEvent.pointerType)}),Ro()},[qt,si,uo.left,uo.top,mo,go,v,Pe,Kt,Jt,i,Ro]),{kbFocusIndexRef:fi,focusedNavPointRef:ki,onKeyDown:Ai}=Oe({storeRef:ai,hoverRef:Fo,setHoverPoint:Eo,customHoverBehavior:Gt,customClickBehavior:qt,scheduleRender:Ro,chartType:i,oAccessor:Kt,rAccessor:Jt}),Si=yi(e=>{gt(gi,e,!!ti,$o.current,si.current,"mouse")&&(fi.current=-1,ki.current=null,ui(e))},[si,ti,ki,fi,ui,gi]);Ao.current=()=>{if(ko.current=null,!Po.isActive)return;let e=si.current;if(!e)return;let t=e.getContext("2d");if(!t)return;let o=ai.current;if(!o)return;let r=Po.now(),a=null!=o.activeTransition,n=o.advanceTransition(so.current?r+1e6:r),l=!so.current&&n,s=Zo.current.w!==mo||Zo.current.h!==go,c=ro.current,h=o.consumeStylePaintPending(),d=!1,u=ei.current.beforeCompute(o.getLastUpdateResult(),l);var m;(c||s)&&(!l||s)&&(o.computeScene({width:mo,height:go}),Zo.current={w:mo,h:go},d=!0,ni()),(d||h)&&($o.current=So(e,o.scene)),$o.current&&(a||d||h)&&lo((m={canvas:e,pointer:gi.current,store:o,margin:{left:uo.left,top:uo.top},width:mo,height:go,projection:v,hoverRadius:Pe,geometryMoved:a||d}).canvas,m.pointer,e=>{let t=k({pointer:e,canvasRect:m.canvas.getBoundingClientRect(),margin:m.margin,width:m.width,height:m.height,projection:m.projection,hoverRadius:m.hoverRadius,scene:m.store.scene,pointQuadtree:m.geometryMoved?null:m.store.pointQuadtree,maxPointRadius:m.store.maxPointRadius});return"hit"===t.kind?vo(t.hit.node):void 0}),ei.current.afterCompute(u,d,s),ro.current=c&&l&&!d,ci.current=!1;let g=Fe(o,r,d,Jo);(d||l)&&e.setAttribute("aria-label",zt(o.scene,i+" chart"));let p=Qt(_,ho),f=ho[0]*p,y=ho[1]*p;(e.width!==f||e.height!==y)&&(e.width=f,e.height=y,e.style.width=ho[0]+"px",e.style.height=ho[1]+"px"),t.setTransform(p,0,0,p,0,0),t.clearRect(0,0,ho[0],ho[1]);let b=dt&&o.lastIngestTime>0&&r-o.lastIngestTime>(dt?.threshold??5e3);b&&(t.globalAlpha=dt?.dimOpacity??.5);let x="radial"===v;t.save(),t.beginPath(),t.rect(uo.left,uo.top,mo,go),t.clip(),x?(t.save(),t.translate(uo.left+mo/2,uo.top+go/2)):t.translate(uo.left,uo.top);let w=Wt?gr.custom:gr[i]||[],A={width:mo,height:go},S=o.scales;S&&ht({context:t,nodes:o.scene,renderMode:ae,pixelRatio:p,paintBuiltIn:e=>{for(let o of w)o(t,e,S,A)}}),x&&t.restore(),t.restore(),b&&(t.globalAlpha=1),d&&o.scales?(No(o.scales),Xo(e=>e+1),Yo.current=r):l&&o.scales&&r-Yo.current>=33&&(Xo(e=>e+1),Yo.current=r),dt?.showBadge&&Ko(!!b),(l||null!=o.activeTransition||g.pending)&&Ro()},bt(dt,ai,ro,Ro,Po.now,Qo,Ko);let Ri=ti&&Do?Le?Le(Do):Sr(X,{hover:Do}):null,Pi="radial"===v,Ci=Ri?Sr(It,{x:Do?Pi?Do.x+mo/2:Do.x:0,y:Do?Pi?Do.y+go/2:Do.y:0,containerWidth:mo,containerHeight:go,margin:uo,className:"stream-ordinal-tooltip",children:Ri}):null,_i="horizontal"===v?Kt:Jt,Li=we("horizontal"===v?Jt:Kt,void 0,"__semiotic_resolvedO",""),Mi=we(_i,void 0,"__semiotic_resolvedR",""),Ii=Li.key,Ti=Mi.key,Hi=be(Li,Mi,$e&&$e.length>0||!1);if(Ut||!_o&&Lo){let t=ai.current;t&&a&&(t.ingest({inserts:Bo,bounded:!0}),t.computeScene({width:mo,height:go}));let o=t?.scene??[],i=t?.scales??null,r=ut(tt,ho,uo,i),n=ut(et,ho,uo,i),l="radial"===v,s=l?uo.left+mo/2:uo.left,c=l?uo.top+go/2:uo.top;return Rr("div",{ref:co,className:"stream-ordinal-frame"+(it?" "+it:""),role:"img","aria-label":Dt||("string"==typeof ot?ot:"Ordinal chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:x?"100%":ho[0],height:w?"100%":ho[1]},children:[Sr($t,{summary:Et}),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",width:ho[0],height:ho[1],style:{position:"absolute",left:0,top:0},children:[Rr("g",{transform:`translate(${uo.left},${uo.top})`,children:[rt&&Sr("rect",{x:0,y:0,width:mo,height:go,fill:rt}),n]}),Sr("g",{transform:`translate(${s},${c})`,children:G({nodes:o,renderMode:ae,idPrefix:xo}).map(e=>e.element)})]}),Sr(R,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:i,showAxes:se,showCategoryTicks:ce,oLabel:eo,rLabel:to,oFormat:oo,rFormat:io,rTickValues:ke,tickLabelEdgeAlign:Ae,axisExtent:Se,showGrid:je,title:ot,description:Dt,legend:ze,legendHoverBehavior:Ve,legendClickBehavior:Ge,legendHighlightedCategory:Xe,legendIsolatedCategories:Ye,legendPosition:Qe,legendLayout:Ke,foregroundGraphics:Je(r,wt(ai.current?.customLayoutOverlays,Vt??null)),annotations:$e,onAnnotationActivate:Ee,onObservation:He??Te,chartId:Be,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:We,svgAnnotationRules:Ne,annotationFrame:0,xAccessor:Ii,yAccessor:Ti,annotationData:Hi(t?.getData())}),at&&"radial"===v&&Sr(e,{content:at,centerX:uo.left+mo/2,centerY:uo.top+go/2,width:ho[0],height:ho[1]})]})}return Rr("div",{ref:co,className:"stream-ordinal-frame"+(it?" "+it:""),role:"group","aria-label":Dt||("string"==typeof ot?ot:"Ordinal chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:x?"100%":ho[0],height:w?"100%":ho[1],overflow:"visible"},onKeyDown:Ai,children:["production"!==process.env.NODE_ENV&&ai.current&&Sr(Ft,{store:ai.current,diagnostics:ei.current}),Bt&&Rr(Ct,{accessibleTable:Bt,children:[Sr(Ot,{tableId:xo}),Sr(Pt,{scene:ai.current?.scene??[],chartType:i+" chart",tableId:xo,chartTitle:"string"==typeof ot?ot:void 0})]}),Sr($t,{summary:Et}),Sr(_t,{hoverPoint:Do}),Rr("div",{role:"img","aria-label":Dt||("string"==typeof ot?ot:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Si,onMouseLeave:mi,onClick:Xt?pi:void 0,children:[Rr(Lt,{size:ho,margin:uo,children:[Go,Vo,zo]}),Sr(S,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:Wo,showAxes:se,showGrid:je,rFormat:io,rTickValues:ke,axisExtent:Se}),Sr("canvas",{ref:si,"aria-label":zt(ai.current?.scene??[],i+" chart"),style:{position:"absolute",top:0,left:0,width:ho[0],height:ho[1]}}),Sr(R,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:Wo,showAxes:se,showCategoryTicks:ce,oLabel:eo,rLabel:to,oFormat:oo,rFormat:io,rTickValues:ke,axisExtent:Se,showGrid:je,title:ot,description:Dt,legend:ze,legendHoverBehavior:Ve,legendClickBehavior:Ge,legendHighlightedCategory:Xe,legendIsolatedCategories:Ye,legendPosition:Qe,legendLayout:Ke,foregroundGraphics:Je(jo,wt(ai.current?.customLayoutOverlays,Vt??null)),annotations:$e,onAnnotationActivate:Ee,onObservation:He??Te,chartId:Be,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:We,svgAnnotationRules:Ne,annotationFrame:qo,xAccessor:Ii,yAccessor:Ti,annotationData:Hi(ai.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),(Mt||Ht)&&"radial"!==v&&Sr(P,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:Wo,onBrush:Ht||(()=>{})}),at&&"radial"===v&&Sr(e,{content:at,centerX:uo.left+mo/2,centerY:uo.top+go/2,width:ho[0],height:ho[1]}),dt?.showBadge&&Sr(qe,{isStale:Qo,position:dt.badgePosition}),Sr(Tt,{active:fi.current>=0,hoverPoint:Do,margin:uo,size:ho,shape:ki.current?.shape,width:ki.current?.w,height:ki.current?.h}),Ci]})]})}));Cr.displayName="StreamOrdinalFrame";var _r=Cr;import{useMemo as Lr,forwardRef as Mr,useRef as Ir}from"react";import{useImperativeHandle as Tr}from"react";import{useMemo as Hr}from"react";import{useCallback as Br,useMemo as Fr,useRef as $r}from"react";import{jsx as Or}from"react/jsx-runtime";var Dr=Mr(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ir(null),{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="vertical",valueFormat:h,colorBy:d,colorScheme:u,sort:m=!1,barPadding:g=40,roundedTop:p,gradientFill:f=!1,styleRules:y,baselinePadding:v=!1,tooltip:b,annotations:x,regression:w,valueExtent:k,frameProps:A={},selection:S,linkedHover:R,linkedBrush:P,brush:C,onBrush:_,onObservation:L,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:F,legendInteraction:$,legendPosition:O,color:D,stroke:E,strokeWidth:W,opacity:N,showCategoryTicks:j,categoryFormat:z,dataIdAccessor:V}=e,{width:G,height:q,enableHover:X,showGrid:Z,showLegend:U,title:J,description:ee,summary:te,accessibleTable:oe,categoryLabel:ie,valueLabel:re}=o,ae=Lr(()=>Yt(r),[r]),ne=ue({data:ae,rawData:r,colorBy:d,colorScheme:u,legendInteraction:$,legendPosition:O,frameLegend:A,selection:S,linkedHover:R,fallbackFields:d?["string"==typeof d?d:""]:[],unwrapData:!0,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"BarChart",chartId:T,showLegend:U,userMargin:a,marginDefaults:o.marginDefaults,loading:H,loadingContent:B,emptyContent:F,width:G,height:q,hasTitle:!!J,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!ie,hasValueLabel:!!re})}),{effectiveLegendProps:le,effectiveMargin:se}=Y({ref:t,frameRef:i,setup:ne});Do("BarChart",ae,"categoryAccessor",l),Do("BarChart",ae,"valueAccessor",s);let he=Bo(ae,m,s),me=Fo(),ge=Lr(()=>new Map,[]),pe=Lr(()=>eo(s),[s]),fe=K({brushProp:C,onBrushProp:_,linkedBrush:P,valueAccessor:s}),ye=Q({colorBy:d,colorScale:ne.colorScale,color:D,themeCategorical:me,colorScheme:u,categoryIndexMap:ge,userPieceStyle:A?.pieceStyle,stroke:E,strokeWidth:W,opacity:N,styleRules:y,resolveRuleValue:pe,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection}),ve=Lr(()=>Ze({categoryAccessor:l,valueAccessor:s,groupAccessor:d&&d!==l?d:void 0,groupLabel:"string"==typeof d?d:"group",valueFormat:h}),[l,s,d,h]),be=Lr(()=>Ce(f),[f]);if(ne.earlyReturn)return ne.earlyReturn;let xe=de({componentName:"BarChart",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(xe)return Or(Mt,{componentName:"BarChart",message:xe,width:G,height:q});let we=ce(w),ke=we?[we,...x||[]]:x,Ae={chartType:"bar",...null!=r&&{data:he},oAccessor:l,rAccessor:s,projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:ye,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:se,barPadding:g,...null!=p&&{roundedTop:p},...be&&{gradientFill:be},...V&&{dataIdAccessor:V},baselinePadding:v,enableHover:X,showAxes:o.showAxes,oLabel:ie,rLabel:re,rFormat:h,...z&&{oFormat:z},showGrid:Z,showCategoryTicks:j,oSort:m,...le,...Ye({title:J,description:ee,summary:te,accessibleTable:oe,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:b,defaultTooltipContent:ve}),...Qe({linkedHover:R,selection:S,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...ke&&ke.length>0&&{annotations:ke},...k&&{rExtent:k},...fe.brushStreamProps,...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return Or(Bt,{componentName:"BarChart",width:G,height:q,children:Or(_r,{ref:i,...Ae})})});Dr.displayName="BarChart";import{useMemo as Er,forwardRef as Wr,useRef as Nr}from"react";import{jsx as jr}from"react/jsx-runtime";var zr=Wr(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Nr(null),{data:r,margin:a,className:n,categoryAccessor:l="category",stackBy:s,valueAccessor:c="value",orientation:h="vertical",valueFormat:d,colorBy:u,colorScheme:m,normalize:g=!1,sort:p=!1,barPadding:f=40,roundedTop:y,gradientFill:v,styleRules:b,baselinePadding:x=!1,tooltip:w,annotations:k,valueExtent:A,frameProps:S={},selection:R,linkedHover:P,linkedBrush:C,brush:_,onBrush:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:F,emptyContent:$,legendInteraction:O,legendPosition:D,color:E,stroke:W,strokeWidth:N,opacity:j,categoryFormat:z}=e,{width:V,height:G,enableHover:q,showGrid:X,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=o,re=Er(()=>Yt(r),[r]),ae=u||s,ne=ue({data:re,rawData:r,colorBy:ae,colorScheme:m,legendInteraction:O,legendPosition:D,frameLegend:S,selection:R,linkedHover:P,fallbackFields:ae?["string"==typeof ae?ae:""]:[],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"StackedBarChart",chartId:H,showLegend:Z,userMargin:a,marginDefaults:o.marginDefaults,loading:B,loadingContent:F,emptyContent:$,width:V,height:G,hasTitle:!!U,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),le=Fo(),se=Er(()=>new Map,[]),ce=Er(()=>eo(c),[c]),he=K({brushProp:_,onBrushProp:L,linkedBrush:C,valueAccessor:c}),me=Q({colorBy:ae,colorScale:ne.colorScale,color:E,themeCategorical:le,colorScheme:m,categoryIndexMap:se,userPieceStyle:S?.pieceStyle,stroke:W,strokeWidth:N,opacity:j,styleRules:b,resolveRuleValue:ce,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection}),ge=Er(()=>Ze({categoryAccessor:s,valueAccessor:c,groupAccessor:l,valueFormat:d}),[s,l,c,d]),pe=de({componentName:"StackedBarChart",data:r,accessors:{categoryAccessor:l,valueAccessor:c},requiredProps:{stackBy:s}}),{effectiveLegendProps:fe,effectiveMargin:ye}=Y({ref:t,frameRef:i,setup:ne}),ve=Er(()=>Ce(v),[v]);if(ne.earlyReturn)return ne.earlyReturn;let be={chartType:"bar",...null!=r&&{data:re},oAccessor:l,rAccessor:c,stackBy:s,normalize:g,oSort:p,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:me,size:[V,G],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ye,barPadding:f,...null!=y&&{roundedTop:y},...ve&&{gradientFill:ve},baselinePadding:x,enableHover:q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:oe,rLabel:ie,rFormat:d,...z&&{oFormat:z},showGrid:X,...fe,...Ye({title:U,description:J,summary:ee,accessibleTable:te,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:w,defaultTooltipContent:ge}),...Qe({linkedHover:P,selection:R,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...k&&k.length>0&&{annotations:k},...A&&{rExtent:A},...he.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return pe?jr(Mt,{componentName:"StackedBarChart",message:pe,width:V,height:G}):jr(Bt,{componentName:"StackedBarChart",width:V,height:G,children:jr(_r,{ref:i,...be})})});zr.displayName="StackedBarChart";import*as Vr from"react";import{useMemo as Gr,useCallback as qr,forwardRef as Xr,useRef as Yr,useImperativeHandle as Qr}from"react";import{useMemo as Kr,useCallback as Zr,useRef as Ur}from"react";var Jr={RdBu:Xo,PiYG:qo,PRGn:Go,BrBG:Vo,RdYlBu:Yo,RdYlGn:Qo,Spectral:Ko},ea="__likert_neutral_neg",ta="__likert_neutral_pos",oa=["Very Low","Low","Neutral","High","Very High"];import{jsx as ia}from"react/jsx-runtime";var ra=new Map,aa=Xr(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Yr(null),{data:r,margin:a,className:n,categoryAccessor:l="question",valueAccessor:s,levelAccessor:c,countAccessor:h="count",levels:d=oa,orientation:u="horizontal",colorScheme:m,barPadding:g=20,styleRules:p,tooltip:f,annotations:y,valueExtent:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,valueFormat:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,categoryFormat:T,stroke:H,strokeWidth:B,opacity:F}=e,{width:$,height:O,enableHover:D,showGrid:E,showLegend:W,title:N,description:j,summary:z,accessibleTable:V,categoryLabel:G,valueLabel:q}=o,X="horizontal"===u,Y=void 0===r,K=!c,oe=$o(),ie=Gr(()=>m&&Array.isArray(m)&&m.length>=d.length?m:function(e,t){if(0>=e)return[];if(t&&Object.prototype.hasOwnProperty.call(Jr,t)){let o=Jr[t];if(1===e)return[o(.5)];let i=[];for(let t=0;e>t;t++)i.push(o(t/(e-1)));return i}let o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],r="#a8a8a8";if(1===e)return[r];let a=e%2!=0,n=Math.floor(e/2),l=[];for(let e=0;n>e;e++)l.push(o[Math.min(Math.floor(e*o.length/n),o.length-1)]);a&&l.push(r);for(let e=0;n>e;e++)l.push(i[Math.min(Math.floor(e*i.length/n),i.length-1)]);return l}(d.length,oe),[m,d.length,oe]),re=Gr(()=>{let e=new Map;for(let t=0;d.length>t;t++)e.set(d[t],ie[t]||"#888");return e},[d,ie]),ae=Gr(()=>{if(!1!==W)return{legendGroups:[{styleFn:e=>({fill:re.get(e.label)||"#888"}),items:d.map(e=>({label:e})),label:""}]}},[W,d,re]),ne=Gr(()=>Object.hasOwn(b,"legend")?b:{...b,legend:ae},[b,ae]),{processedData:le,reAggregate:se,accumulatorRef:ce}=function({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:r,countAccessor:a,isDiverging:n,frameRef:l}){let s=!r,c=Kr(()=>Z(o,"question"),[o]),h=Kr(()=>s?Z(i,"score"):null,[s,i]),d=Kr(()=>s?null:Z(r,"level"),[s,r]),u=Kr(()=>s?null:Z(a,"count"),[s,a]),m=Ur([]),g=Kr(()=>({category:"string"==typeof o?o:void 0,level:"string"==typeof r?r:void 0,count:"string"==typeof a?a:void 0,score:r||"string"!=typeof i?void 0:i}),[o,a,r,i]);return{processedData:Kr(()=>{let o=e||[];if(0===o.length)return[];let i=U(o,t,c,h,d,u,g);return n&&(i=J(i,t),i=ee(i,t)),i},[e,t,c,h,d,u,g,n]),reAggregate:Zr(e=>{let o=U(e,t,c,h,d,u,g);n&&(o=J(o,t),o=ee(o,t)),l.current?.replace(o)},[t,c,h,d,u,g,n,l]),accumulatorRef:m}}({data:r,levels:d,categoryAccessor:l,valueAccessor:s,levelAccessor:c,countAccessor:h,isDiverging:X,frameRef:i}),he="__likertLevelLabel",me=pe({isPushMode:Y,colorBy:he,colorScheme:ie,showLegend:W,legendPosition:I}),{wrapPush:ge,wrapPushMany:fe}=me,ye=qr(e=>ge(e=>{ce.current.push(e),se(ce.current)})(e),[ge,se,ce]),ve=qr(e=>fe(e=>{ce.current.push(...e),se(ce.current)})(e),[fe,se,ce]);Qr(t,()=>({push:ye,pushMany:ve,remove:e=>i.current?.remove(e)??[],update:(e,t)=>i.current?.update(e,t)??[],replace:e=>i.current?.replace(e),clear:()=>{ce.current=[],me.resetCategories(),i.current?.clear()},getData:()=>i.current?.getData()??[],getScales:()=>i.current?.getScales()??null}),[ye,ve,ce,me]);let be=ue({data:le,rawData:r,colorBy:he,colorScheme:ie,legendInteraction:M,legendPosition:I,frameLegend:ne,selection:x,linkedHover:w,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"LikertChart",chartId:R,showLegend:W,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:$,height:O,hasTitle:!!N,axisChrome:{hasAxis:!1!==o.showAxes,hasAxisLabel:X?!!q:!!G}}),xe=Gr(()=>{let e=d.length;return e%2!=0&&re.get(d[Math.floor(e/2)])||"#888"},[d,re]),we=Q({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:ra,userPieceStyle:b?.pieceStyle,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:be.effectiveSelectionHook,resolvedSelection:be.resolvedSelection,styleRules:p,resolveRuleValue:te,baseStyleExtras:e=>{let t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===ea||o===ta)return{fill:xe};let i=t||o;return i&&re.has(i)?{fill:re.get(i)}:{fill:"#888"}}}),ke=Gr(()=>{let e=d.length;return e%2!=0?d[Math.floor(e/2)]:""},[d]),Ae=Gr(()=>e=>{let t=e.data||e,o=t.__likertLevel||"Unknown",i=o===ea||o===ta?ke:o,r=t.__likertCategory||"",a=Math.abs(t.__likertPct||0),n=o===ea||o===ta?2*a:a,l=t.__likertCount||0;return Vr.createElement("div",{className:"semiotic-tooltip",style:Xt},Vr.createElement("div",{style:{fontWeight:"bold"}},r),Vr.createElement("div",{style:{marginTop:4}},`${i}: ${n.toFixed(1)}% (n=${l})`))},[ke]),Se=Gr(()=>{if(!d||2>d.length)return"LikertChart requires `levels` with at least 2 entries.";if(s&&c)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(c&&!h)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==r&&0===r.length)return null;let e={categoryAccessor:l};return K?s&&(e.valueAccessor=s):(c&&(e.levelAccessor=c),h&&(e.countAccessor=h)),de({componentName:"LikertChart",data:r,accessors:e,requiredProps:{levels:d}})},[r,l,s,c,h,d,K]),Re=be.legendBehaviorProps,Pe=Gr(()=>{let e={...be.margin};if(Y&&be.legend){let t=be.legendPosition;"bottom"===t&&80>e.bottom?e.bottom=80:"top"===t&&50>e.top?e.top=50:"right"===t&&110>e.right?e.right=110:"left"===t&&110>e.left&&(e.left=110)}else if(me.streamingMarginAdjust)for(let[t,o]of Object.entries(me.streamingMarginAdjust))o>e[t]&&(e[t]=o);return X&&100>e.left&&(e.left=100),e},[be.margin,be.legend,be.legendPosition,me.streamingMarginAdjust,X,Y]),Ce=Gr(()=>P||(X?e=>Math.abs(Number(e)).toFixed(0)+"%":e=>Number(e).toFixed(0)+"%"),[X,P]);if(be.earlyReturn)return be.earlyReturn;let _e={chartType:"bar",...null!=r&&{data:le},oAccessor:"__likertCategory",rAccessor:"__likertPct",stackBy:"__likertLevel",normalize:!1,projection:X?"horizontal":"vertical",pieceStyle:we,size:[$,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Pe,barPadding:g,enableHover:D,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:G,rLabel:q||(X?void 0:"Percentage"),rFormat:Ce,...T&&{oFormat:T},showGrid:E,...Re,...N&&{title:N},...j&&{description:j},...z&&{summary:z},...void 0!==V&&{accessibleTable:V},...n&&{className:n},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===f?()=>null:!0===f?Ae:oo(f)||Ae,...Qe({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:be.mobileInteraction,customHoverBehavior:be.customHoverBehavior,customClickBehavior:be.customClickBehavior}),...y&&y.length>0&&{annotations:y},...v&&{rExtent:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return Se?ia(Mt,{componentName:"LikertChart",message:Se,width:$,height:O}):ia(Bt,{componentName:"LikertChart",width:$,height:O,children:ia(_r,{ref:i,..._e})})});aa.displayName="LikertChart";import{useMemo as na,forwardRef as la,useRef as sa}from"react";import{jsx as ca}from"react/jsx-runtime";var ha=la(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=sa(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="vertical",valueFormat:h,colorBy:d,colorScheme:u,styleRules:m,sizeBy:g,sizeRange:p=[3,8],symbolBy:f,symbolMap:y,pointRadius:v=4,pointOpacity:b=.7,categoryPadding:x=20,tooltip:w,annotations:k,valueExtent:A,brush:S,onBrush:R,linkedBrush:P,frameProps:C={},selection:_,linkedHover:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:F,emptyContent:$,legendInteraction:O,legendPosition:D,color:E,stroke:W,strokeWidth:N,opacity:j,showCategoryTicks:z,categoryFormat:V}=e,{width:G,height:q,enableHover:X,showGrid:Y,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=o,re=na(()=>Yt(r),[r]),ae=ue({data:re,rawData:r,colorBy:d,colorScheme:u,legendInteraction:O,legendPosition:D,frameLegend:C,selection:_,linkedHover:L,fallbackFields:d?["string"==typeof d?d:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"SwarmPlot",chartId:H,showLegend:Z,userMargin:a,marginDefaults:o.marginDefaults,loading:B,loadingContent:F,emptyContent:$,width:G,height:q,hasTitle:!!U,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),ne=K({brushProp:S,onBrushProp:R,linkedBrush:P,valueAccessor:s}),le=na(()=>{if(!g)return;let e=re.map(e=>"function"==typeof g?g(e):e[g]);return ei(e)},[re,g]),se=Fo(),ce=na(()=>new Map,[]),he=na(()=>eo(s),[s]),ge=Q({colorBy:d,colorScale:ae.colorScale,color:E,themeCategorical:se,colorScheme:u,categoryIndexMap:ce,userPieceStyle:C?.pieceStyle,stroke:W,strokeWidth:N,opacity:j,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection,baseStyleExtras:e=>({fillOpacity:b,r:g?zo(e,g,p,le):v}),styleRules:m,resolveRuleValue:he}),pe=na(()=>Ze({categoryAccessor:l,valueAccessor:s,groupAccessor:d||void 0,valueFormat:h}),[l,s,d,h]);if(ae.earlyReturn)return ae.earlyReturn;let fe=de({componentName:"SwarmPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(fe)return ca(Mt,{componentName:"SwarmPlot",message:fe,width:G,height:q});let ye={chartType:"swarm",...null!=r&&{data:re},oAccessor:l,rAccessor:s,...f&&{symbolAccessor:f},...y&&{symbolMap:y},projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:ge,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ae.margin,barPadding:x,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:oe,rLabel:ie,rFormat:h,...V&&{oFormat:V},showGrid:Y,showCategoryTicks:z,...ae.legendBehaviorProps,...Ye({title:U,description:J,summary:ee,accessibleTable:te,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:w,defaultTooltipContent:pe}),...Qe({linkedHover:L,selection:_,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...k&&k.length>0&&{annotations:k},...A&&{rExtent:A},...ne.brushStreamProps,...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return ca(Bt,{componentName:"SwarmPlot",width:G,height:q,children:ca(_r,{ref:i,...ye})})});ha.displayName="SwarmPlot";import{useMemo as da,forwardRef as ua,useRef as ma}from"react";import{jsx as ga,jsxs as pa}from"react/jsx-runtime";import{jsx as fa}from"react/jsx-runtime";var ya=ua(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ma(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="vertical",valueFormat:h,colorBy:d,colorScheme:u,styleRules:m,showOutliers:g=!0,outlierRadius:p=3,categoryPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:k,onObservation:A,onClick:S,hoverHighlight:R,chartId:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:F,showCategoryTicks:$,categoryFormat:O}=e,{width:D,height:E,enableHover:W,showGrid:N,showLegend:j,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,K=da(()=>Yt(r),[r]),Z=ue({data:K,rawData:r,colorBy:d,colorScheme:u,legendInteraction:M,legendPosition:I,frameLegend:x,selection:w,linkedHover:k,fallbackFields:d?["string"==typeof d?d:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"BoxPlot",chartId:P,showLegend:j,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:D,height:E,hasTitle:!!z,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),U=Fo(),J=da(()=>new Map,[]),ee=da(()=>{let e=eo(s);return t=>"number"==typeof t.median?t.median:e(t)},[s]),te=Q({colorBy:d,colorScale:Z.colorScale,color:T,themeCategorical:U,colorScheme:u,categoryIndexMap:J,userPieceStyle:void 0,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0,styleRules:m,resolveRuleValue:ee}),ie=da(()=>oe(),[]);if(Z.earlyReturn)return Z.earlyReturn;let re=de({componentName:"BoxPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(re)return fa(Mt,{componentName:"BoxPlot",message:re,width:D,height:E});let ae={chartType:"boxplot",...null!=r&&{data:K},oAccessor:l,rAccessor:s,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:te,showOutliers:g,size:[D,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,barPadding:f,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:h,...O&&{oFormat:O},showGrid:N,showCategoryTicks:$,...Z.legendBehaviorProps,...Ye({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:y,defaultTooltipContent:ie}),...Qe({linkedHover:k,selection:w,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return fa(Bt,{componentName:"BoxPlot",width:D,height:E,children:fa(_r,{ref:i,...ae})})});ya.displayName="BoxPlot";import{useMemo as va,forwardRef as ba,useRef as xa}from"react";import{jsx as wa,jsxs as ka}from"react/jsx-runtime";var Aa=e=>{let t=e?.category;return null==t?"All":t+""},Sa=ba(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:"horizontal",mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=xa(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l=Aa,valueAccessor:s="value",bins:c=25,relative:h=!1,valueFormat:d,colorBy:u,colorScheme:m,styleRules:g,categoryPadding:p=("sparkline"===o.mode?0:20),tooltip:f,annotations:y,valueExtent:v,brush:b,onBrush:x,linkedBrush:w,frameProps:k={},selection:A,linkedHover:S,onObservation:R,onClick:P,hoverHighlight:C,chartId:_,loading:L,loadingContent:M,emptyContent:I,legendInteraction:T,legendPosition:H,color:B,stroke:F,strokeWidth:$,opacity:O,showCategoryTicks:D,categoryFormat:E}=e,{width:W,height:N,enableHover:j,showGrid:z,showLegend:V,title:G,description:q,summary:X,accessibleTable:Y,categoryLabel:Z,valueLabel:U}=o,J=va(()=>Yt(r),[r]),ee=ue({data:J,rawData:r,colorBy:u,colorScheme:m,legendInteraction:T,legendPosition:H,frameLegend:k,selection:A,linkedHover:S,fallbackFields:u?["string"==typeof u?u:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:R,onClick:P,hoverHighlight:C,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"Histogram",chartId:_,showLegend:V,userMargin:a,marginDefaults:o.marginDefaults,loading:L,loadingContent:M,emptyContent:I,width:W,height:N,hasTitle:!!G,axisChrome:po({showAxes:o.showAxes,projection:"horizontal",hasCategoryLabel:!!Z,hasValueLabel:!!U})}),te=K({brushProp:b,onBrushProp:x,linkedBrush:w,valueAccessor:s}),oe=va(()=>{if(0===J.length)return;let e="function"==typeof s?s:e=>e[s],t=1/0,o=-1/0;for(let i of J){let r=e(i);null!=r&&isFinite(r)&&(t>r&&(t=r),r>o&&(o=r))}return t>o?void 0:[t,o]},[J,s]),ie=Fo(),re=va(()=>new Map,[]),ae=va(()=>{let e=eo(s);return t=>"number"==typeof t.count?t.count:e(t)},[s]),ne=Q({colorBy:u,colorScale:ee.colorScale,color:B,themeCategorical:ie,colorScheme:m,categoryIndexMap:re,userPieceStyle:void 0,stroke:F,strokeWidth:$,opacity:O,effectiveSelectionHook:ee.effectiveSelectionHook,resolvedSelection:ee.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0,styleRules:g,resolveRuleValue:ae}),le=va(()=>e=>{let t=e.data||e,o=t.category||e.category||"",i=t.count,r=t.range;return ka("div",{className:"semiotic-tooltip",style:Xt,children:[o&&wa("div",{style:{fontWeight:"bold"},children:o+""}),null!=i&&ka("div",{children:["Count: ",i]}),r&&2===r.length&&ka("div",{style:{opacity:.8},children:[Number(r[0]).toFixed(1)," – ",Number(r[1]).toFixed(1)]})]})},[]);if(ee.earlyReturn)return ee.earlyReturn;let se=de({componentName:"Histogram",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(se)return wa(Mt,{componentName:"Histogram",message:se,width:W,height:N});let ce={chartType:"histogram",...null!=r&&{data:J},oAccessor:l,rAccessor:s,projection:"horizontal",summaryStyle:ne,bins:c,normalize:h,...v?{rExtent:v}:oe&&{rExtent:oe},size:[W,N],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee.margin,barPadding:p,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:Z,rLabel:U,rFormat:d,...E&&{oFormat:E},showGrid:z,showCategoryTicks:D,...ee.legendBehaviorProps,...Ye({title:G,description:q,summary:X,accessibleTable:Y,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:f,defaultTooltipContent:le}),...Qe({linkedHover:S,selection:A,onObservation:R,onClick:P,hoverHighlight:C,mobileInteraction:ee.mobileInteraction,customHoverBehavior:ee.customHoverBehavior,customClickBehavior:ee.customClickBehavior}),...y&&y.length>0&&{annotations:y},...te.brushStreamProps,...Object.fromEntries(Object.entries(k).filter(([e])=>"pieceStyle"!==e))};return wa(Bt,{componentName:"Histogram",width:W,height:N,children:wa(_r,{ref:i,...ce})})});Sa.displayName="Histogram";import{useMemo as Ra,forwardRef as Pa,useRef as Ca}from"react";import{jsx as _a}from"react/jsx-runtime";var La=Pa(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ca(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="vertical",bins:h=25,curve:d="catmullRom",showIQR:u=!0,valueFormat:m,colorBy:g,colorScheme:p,styleRules:f,categoryPadding:y=20,tooltip:v,annotations:b,valueExtent:x,brush:w,onBrush:k,linkedBrush:A,frameProps:S={},selection:R,linkedHover:P,onObservation:C,onClick:_,hoverHighlight:L,chartId:M,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:F,color:$,stroke:O,strokeWidth:D,opacity:E,showCategoryTicks:W,categoryFormat:N}=e,{width:j,height:z,enableHover:V,showGrid:G,showLegend:q,title:X,description:Y,summary:Z,accessibleTable:U,categoryLabel:J,valueLabel:ee}=o,te=Ra(()=>Yt(r),[r]),ie=ue({data:te,rawData:r,colorBy:g,colorScheme:p,legendInteraction:B,legendPosition:F,frameLegend:S,selection:R,linkedHover:P,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:C,onClick:_,hoverHighlight:L,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ViolinPlot",chartId:M,showLegend:q,userMargin:a,marginDefaults:o.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:j,height:z,hasTitle:!!X,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!J,hasValueLabel:!!ee})}),re=K({brushProp:w,onBrushProp:k,linkedBrush:A,valueAccessor:s}),ae=Fo(),ne=Ra(()=>new Map,[]),le=Ra(()=>{let e=eo(s);return t=>"number"==typeof t.median?t.median:e(t)},[s]),se=Q({colorBy:g,colorScale:ie.colorScale,color:$,themeCategorical:ae,colorScheme:p,categoryIndexMap:ne,userPieceStyle:void 0,stroke:O,strokeWidth:D,opacity:E,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0,styleRules:f,resolveRuleValue:le}),ce=Ra(()=>oe({valueAccessor:s}),[s]);if(ie.earlyReturn)return ie.earlyReturn;let he=de({componentName:"ViolinPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(he)return _a(Mt,{componentName:"ViolinPlot",message:he,width:j,height:z});let ge={chartType:"violin",...null!=r&&{data:te},oAccessor:l,rAccessor:s,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:se,bins:h,showIQR:u,size:[j,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,barPadding:y,enableHover:V,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:J,rLabel:ee,rFormat:m,...N&&{oFormat:N},showGrid:G,showCategoryTicks:W,...ie.legendBehaviorProps,...Ye({title:X,description:Y,summary:Z,accessibleTable:U,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:v,defaultTooltipContent:ce}),...Qe({linkedHover:P,selection:R,onObservation:C,onClick:_,hoverHighlight:L,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...b&&b.length>0&&{annotations:b},...x&&{rExtent:x},...re.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return _a(Bt,{componentName:"ViolinPlot",width:j,height:z,children:_a(_r,{ref:i,...ge})})});La.displayName="ViolinPlot";import{useMemo as Ma,forwardRef as Ia,useRef as Ta}from"react";import{jsx as Ha}from"react/jsx-runtime";var Ba=Ia(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ta(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="horizontal",bins:h=20,amplitude:d=1.5,valueFormat:u,colorBy:m,colorScheme:g,styleRules:p,categoryPadding:f=5,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:k,onObservation:A,onClick:S,hoverHighlight:R,chartId:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:F,showCategoryTicks:$,categoryFormat:O}=e,{width:D,height:E,enableHover:W,showGrid:N,showLegend:j,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,K=Ma(()=>Yt(r),[r]),Z=ue({data:K,rawData:r,colorBy:m,colorScheme:g,legendInteraction:M,legendPosition:I,frameLegend:x,selection:w,linkedHover:k,fallbackFields:m?["string"==typeof m?m:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"RidgelinePlot",chartId:P,showLegend:j,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:D,height:E,hasTitle:!!z,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),U=Fo(),J=Ma(()=>new Map,[]),ee=Ma(()=>{let e=eo(s);return t=>"number"==typeof t.median?t.median:e(t)},[s]),te=Q({colorBy:m,colorScale:Z.colorScale,color:T,themeCategorical:U,colorScheme:g,categoryIndexMap:J,userPieceStyle:void 0,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0,styleRules:p,resolveRuleValue:ee}),ie=Ma(()=>oe(),[]);if(Z.earlyReturn)return Z.earlyReturn;let re=de({componentName:"RidgelinePlot",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(re)return Ha(Mt,{componentName:"RidgelinePlot",message:re,width:D,height:E});let ae={chartType:"ridgeline",...null!=r&&{data:K},oAccessor:l,rAccessor:s,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:te,bins:h,size:[D,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,barPadding:f,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:u,...O&&{oFormat:O},showGrid:N,showCategoryTicks:$,oSort:!1,amplitude:d,...Z.legendBehaviorProps,...Ye({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:y,defaultTooltipContent:ie}),...Qe({linkedHover:k,selection:w,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return Ha(Bt,{componentName:"RidgelinePlot",width:D,height:E,children:Ha(_r,{ref:i,...ae})})});Ba.displayName="RidgelinePlot";import{useMemo as Fa,forwardRef as $a,useRef as Oa}from"react";import{jsx as Da}from"react/jsx-runtime";var Ea=$a(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid??!0,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Oa(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="horizontal",valueFormat:h,colorBy:d,colorScheme:u,styleRules:m,sort:g="auto",dotRadius:p=5,categoryPadding:f=10,tooltip:y,annotations:v,regression:b,valueExtent:x,frameProps:w={},selection:k,linkedHover:A,onObservation:S,onClick:R,hoverHighlight:P,chartId:C,loading:_,loadingContent:L,emptyContent:M,legendInteraction:I,legendPosition:T,color:H,stroke:B,strokeWidth:F,opacity:$,categoryFormat:O}=e,{width:D,height:E,enableHover:W,showGrid:N,showLegend:j,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,K=Fa(()=>Yt(r),[r]),Z=ue({data:K,rawData:r,colorBy:d,colorScheme:u,legendInteraction:I,legendPosition:T,frameLegend:w,selection:k,linkedHover:A,fallbackFields:d?["string"==typeof d?d:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DotPlot",chartId:C,showLegend:j,userMargin:a,marginDefaults:o.marginDefaults,loading:_,loadingContent:L,emptyContent:M,width:D,height:E,hasTitle:!!z,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),U=Bo(K,g,s),J=Fo(),ee=Fa(()=>new Map,[]),te=Fa(()=>eo(s),[s]),oe=Q({colorBy:d,colorScale:Z.colorScale,color:H,themeCategorical:J,colorScheme:u,categoryIndexMap:ee,userPieceStyle:w?.pieceStyle,stroke:B,strokeWidth:F,opacity:$,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection,baseStyleExtras:{r:p,fillOpacity:.8},styleRules:m,resolveRuleValue:te}),ie=Fa(()=>Ze({categoryAccessor:l,valueAccessor:s,valueFormat:h}),[l,s,h]);if(Z.earlyReturn)return Z.earlyReturn;let re=de({componentName:"DotPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(re)return Da(Mt,{componentName:"DotPlot",message:re,width:D,height:E});let ae=ce(b),ne=ae?[ae,...v||[]]:v,le={chartType:"point",...null!=r&&{data:U},oAccessor:l,rAccessor:s,projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:oe,size:[D,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,barPadding:f,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:h,...O&&{oFormat:O},showGrid:N,oSort:g,...Z.legendBehaviorProps,...Ye({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:y,defaultTooltipContent:ie}),...Qe({linkedHover:A,selection:k,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...ne&&ne.length>0&&{annotations:ne},...x&&{rExtent:x},...Object.fromEntries(Object.entries(w).filter(([e])=>"pieceStyle"!==e))};return Da(Bt,{componentName:"DotPlot",width:D,height:E,children:Da(_r,{ref:i,...le})})});Ea.displayName="DotPlot";import{useMemo as Wa,forwardRef as Na,useRef as ja}from"react";import{jsx as za}from"react/jsx-runtime";var Va=Na(function(e,t){let o=_o(e.mode,{width:e.width??400,height:e.height??400,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ja(null),{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",colorBy:c,colorScheme:h,styleRules:d,startAngle:u=0,cornerRadius:m,valueFormat:g,tooltip:p,annotations:f,frameProps:y={},selection:v,linkedHover:b,onObservation:x,onClick:w,hoverHighlight:k,chartId:A,loading:S,loadingContent:R,emptyContent:P,legendInteraction:C,legendPosition:_,color:L,stroke:M,strokeWidth:I,opacity:T}=e,{width:H,height:B,enableHover:F,showLegend:$,title:O,description:D,summary:E,accessibleTable:W}=o,N=Wa(()=>Yt(r),[r]),j=c||l,z=ue({data:N,rawData:r,colorBy:j,colorScheme:h,legendInteraction:C,legendPosition:_,frameLegend:y,selection:v,linkedHover:b,fallbackFields:j?["string"==typeof j?j:""]:[],unwrapData:!0,onObservation:x,onClick:w,hoverHighlight:k,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"PieChart",chartId:A,showLegend:$,userMargin:a,marginDefaults:o.marginDefaults,loading:S,loadingContent:R,emptyContent:P,width:H,height:B,hasTitle:!!O,axisChrome:{hasAxis:!1}}),V=Fo(),G=Wa(()=>new Map,[]),q=Wa(()=>{let e=eo(s);return t=>{let o=e(t);return null==o?void 0:Math.abs(o)}},[s]),X=Q({colorBy:j,colorScale:z.colorScale,color:L,themeCategorical:V,colorScheme:h,categoryIndexMap:G,userPieceStyle:y?.pieceStyle,stroke:M,strokeWidth:I,opacity:T,effectiveSelectionHook:z.effectiveSelectionHook,resolvedSelection:z.resolvedSelection,cycleByCategory:!0,styleRules:d,resolveRuleValue:q}),K=Wa(()=>Ze({categoryAccessor:l,valueAccessor:s,groupAccessor:c&&c!==l?c:void 0,groupLabel:"string"==typeof c?c:"group",pieData:!0,valueFormat:g}),[l,s,c,g]),Z=de({componentName:"PieChart",data:r,accessors:{categoryAccessor:l,valueAccessor:s}}),{effectiveLegendProps:U,effectiveMargin:J}=Y({ref:t,frameRef:i,setup:z});if(z.earlyReturn)return z.earlyReturn;let ee={chartType:"pie",...null!=r&&{data:N},oAccessor:l,rAccessor:s,projection:"radial",pieceStyle:X,startAngle:u,...null!=m&&{cornerRadius:m},size:[H,B],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:J,enableHover:F,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...U,...Ye({title:O,description:D,summary:E,accessibleTable:W,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:p,defaultTooltipContent:K}),...Qe({linkedHover:b,selection:v,onObservation:x,onClick:w,hoverHighlight:k,mobileInteraction:z.mobileInteraction,customHoverBehavior:z.customHoverBehavior,customClickBehavior:z.customClickBehavior}),...f&&f.length>0&&{annotations:f},...Object.fromEntries(Object.entries(y).filter(([e])=>"pieceStyle"!==e))};return Z?za(Mt,{componentName:"PieChart",message:Z,width:H,height:B}):za(Bt,{componentName:"PieChart",width:H,height:B,children:za(_r,{ref:i,...ee})})});Va.displayName="PieChart";import{useMemo as Ga,forwardRef as qa,useRef as Xa}from"react";import{jsx as Ya}from"react/jsx-runtime";var Qa=qa(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:400,height:400}),i=Xa(null),{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",innerRadius:c,centerContent:h,colorBy:d,colorScheme:u,styleRules:m,startAngle:g=0,cornerRadius:p,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:F,height:$,enableHover:O,showLegend:D,title:E,description:W,summary:N,accessibleTable:j}=o,z=Ga(()=>Yt(r),[r]),V=d||l,G=ue({data:z,rawData:r,colorBy:V,colorScheme:u,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:V?["string"==typeof V?V:""]:[],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DonutChart",chartId:R,showLegend:D,userMargin:a,marginDefaults:o.marginDefaults,loading:P,loadingContent:C,emptyContent:_,width:F,height:$,hasTitle:!!E,axisChrome:{hasAxis:!1}}),q=c??Math.max(2,.15*Math.min(F,$)),X=Fo(),K=Ga(()=>new Map,[]),Z=Ga(()=>{let e=eo(s);return t=>{let o=e(t);return null==o?void 0:Math.abs(o)}},[s]),U=Q({colorBy:V,colorScale:G.colorScale,color:I,themeCategorical:X,colorScheme:u,categoryIndexMap:K,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:G.effectiveSelectionHook,resolvedSelection:G.resolvedSelection,cycleByCategory:!0,styleRules:m,resolveRuleValue:Z}),J=Ga(()=>Ze({categoryAccessor:l,valueAccessor:s,groupAccessor:d&&d!==l?d:void 0,groupLabel:"string"==typeof d?d:"group",pieData:!0,valueFormat:f}),[l,s,d,f]),ee=de({componentName:"DonutChart",data:r,accessors:{categoryAccessor:l,valueAccessor:s}}),{effectiveLegendProps:te,effectiveMargin:oe}=Y({ref:t,frameRef:i,setup:G});if(G.earlyReturn)return G.earlyReturn;let ie={chartType:"donut",...null!=r&&{data:z},oAccessor:l,rAccessor:s,projection:"radial",pieceStyle:U,innerRadius:q,startAngle:g,...null!=p&&{cornerRadius:p},centerContent:h,size:[F,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:oe,enableHover:O,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...te,...Ye({title:E,description:W,summary:N,accessibleTable:j,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:y,defaultTooltipContent:J}),...Qe({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:G.mobileInteraction,customHoverBehavior:G.customHoverBehavior,customClickBehavior:G.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return ee?Ya(Mt,{componentName:"DonutChart",message:ee,width:F,height:$}):Ya(Bt,{componentName:"DonutChart",width:F,height:$,children:Ya(_r,{ref:i,...ie})})});Qa.displayName="DonutChart";import{jsx as Ka,jsxs as Za}from"react/jsx-runtime";import{useMemo as Ua,forwardRef as Ja,useRef as en}from"react";import{jsx as tn,jsxs as on}from"react/jsx-runtime";var rn=Ja(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:!1,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:300,height:250}),i=en(null),r="context"===o.mode,{compactMode:a}=o,{value:n,min:l=0,max:s=100,thresholds:c,gradientFill:h,color:d,backgroundColor:u="var(--semiotic-grid, #e0e0e0)",arcWidth:m=.3,cornerRadius:g,showNeedle:p=!0,needleColor:f="var(--semiotic-text, #333)",centerContent:y,valueFormat:v,showScaleLabels:b=!a,sweep:x=240,fillZones:w=!0,tooltip:k,styleRules:A,annotations:S,frameProps:R={},className:P,stroke:C,strokeWidth:_,opacity:L}=e,{width:M,height:I,title:T,description:H,summary:B,accessibleTable:F}=o,$=Pe(h),O=Math.max(l,Math.min(s,n)),D=s-l||1,E=(O-l)/D,{gaugeData:W,pieceStyle:N,gaugeAnnotations:j}=Ua(()=>function(e){let{min:t,max:o,value:i,thresholds:r,fillColor:a,backgroundColor:n,fillZones:l,showScaleLabels:s,gradientFill:c,gradientSteps:h=240}=e,d=o-t||1,u=(Math.max(t,Math.min(o,i))-t)/d,m=r&&r.length>0?[...r].sort((e,t)=>e.value-t.value):[{value:o,color:a||"#007bff"}];m=m.map(e=>({...e,value:Math.max(t,Math.min(o,e.value))})),o>m[m.length-1].value&&m.push({value:o,color:m[m.length-1].color});let g=!!c&&c.stops.length>=2,p=[],f=new Map,y=[];if(g){let e=l?u:1,t=se("bg",0);if(p.push({category:t,value:1,_zone:"Track",_isFill:!1,_pctStart:0,_pct:1,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0}),f.set(t,{fill:n,opacity:.4}),e>0){let t=Math.max(1,Math.floor(h)),o=Math.max(1,Math.min(t,Math.round(e*t))),i=[];for(let t=0;o>t;t++)i.push(le(c.stops,e*(t+.5)/o,a||m[0]?.color||"#007bff"));let r=se("fill",0);p.push({category:r,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),f.set(r,{fill:i[0]||n})}}else{let e=t;for(let o=0;m.length>o;o++){let i=m[o],r=(i.value-e)/d,a=(e-t)/d,s=(i.value-t)/d,c=Math.max(0,(l?Math.min(u,s):s)-a),h=l?Math.max(0,r-c):0;if(c>0){let e=se("fill",o);p.push({category:e,value:c,_zone:i.label||"Zone "+(o+1),_isFill:!0}),f.set(e,{fill:i.color})}if(h>0){let e=se("bg",o);p.push({category:e,value:h,_zone:i.label||"Zone "+(o+1),_isFill:!1}),f.set(e,{fill:n,opacity:.4})}e=i.value}}if(s&&r&&r.length>0)for(let e of r)e.value>t&&o>e.value&&y.push({type:"gauge-label",value:e.value,label:e.label||e.value+""});return{gaugeData:p,pieceStyle:(e,t)=>f.get(t||e.category)||{fill:n},gaugeAnnotations:y}}({min:l,max:s,value:n,thresholds:c,fillColor:d,backgroundColor:u,fillZones:w,showScaleLabels:b,gradientFill:$}),[n,l,s,c,d,u,b,w,$]),z=Ua(()=>jt(N,A,(e,t)=>({value:"number"==typeof e.value?e.value:void 0,category:t??(null==e.category?void 0:e.category+"")})),[N,A]),V=Ua(()=>at(z,{stroke:C,strokeWidth:_,opacity:L}),[z,C,_,L]),{activeSelectionHook:G,customHoverBehavior:q,customClickBehavior:X}=Lo({selection:e.selection,linkedHover:e.linkedHover,fallbackFields:["category"],onObservation:e.onObservation,chartType:"GaugeChart",chartId:e.chartId,onClick:e.onClick,hoverHighlight:e.hoverHighlight,colorByField:"category",mobileInteraction:o.mobileInteraction}),Y=ge(e.selection),Q=Ua(()=>Wo(V,G,Y),[V,G,Y]),{sweepRad:K,startAngleDeg:Z}=ie(x),U=function(e=240){let{sweepRad:t,offsetRad:o}=ie(e),i=[[Math.cos(o),Math.sin(o)],[Math.cos(o+t),Math.sin(o+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)t+.001>=((e-o)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)&&i.push([Math.cos(e),Math.sin(e)]);let r=i.map(e=>e[0]),a=i.map(e=>e[1]),[n,l]=ei(r),[s,c]=ei(a);return{minX:n,maxX:l,minY:s,maxY:c,width:l-n,height:c-s,cx:(n+l)/2,cy:(s+c)/2}}(x),J=Math.min(10,Math.max(1,Math.min(M,I)/12)),ee=U.cx,te=U.cy,oe=Math.max(4,Math.min((M-2*J)/U.width,(I-2*J)/U.height)-2),re=Math.max(0,Math.min(oe-1.5,oe*(1-m))),ae=M/2-ee*oe,ne=I/2-te*oe,ce=2*(oe+4),he=Ua(()=>a&&null==y?null:null!=y?"function"==typeof y?y(O,l,s):y:function({value:e,min:t,max:o,radius:i,showScaleLabels:r}){let a=Math.max(16,.3*i);return Za("g",{textAnchor:"middle",children:[Ka("text",{y:0,dominantBaseline:"central",fontSize:a,fontWeight:700,fill:"var(--semiotic-text, #333)",children:e}),r&&Za("text",{y:.7*a+11,fontSize:11,fill:"var(--semiotic-text-secondary, #666)",children:[t," – ",o]})]})}({value:v?v(O):Math.round(O)+"",min:l,max:s,radius:oe,showScaleLabels:b}),[y,O,l,s,v,b,oe,a]),de=Ua(()=>r&&null==y?{type:"gauge-value",text:v?v(O):Math.round(O)+""}:null,[r,y,O,v]),ue=Ua(()=>{if(!p)return null;let e=-Math.PI/2+Z*Math.PI/180+E*K,t=re>20?re-8:oe-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:f}},[p,Z,E,K,re,oe,f]),me=Ua(()=>(e,t,o)=>{if("gauge-needle"===e.type){let i=(o.width||M)/2,r=(o.height||I)/2,a=Math.max(1,oe-re),n=Math.max(1,Math.min(2.5,.4*a)),l=Math.max(1,Math.min(5,.6*a));return on("g",{transform:`translate(${i},${r})`,children:[tn("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:n,strokeLinecap:"round"}),tn("circle",{cx:0,cy:0,r:l,fill:e.color})]},"gauge-needle-"+t)}if("gauge-label"===e.type){let i,r,a=-Math.PI/2+Z*Math.PI/180+(e.value-l)/D*K,n=(o.width||M)/2,s=(o.height||I)/2,c=re-1,h=oe+1,d=Math.cos(a)*c,u=Math.sin(a)*c,m=Math.cos(a)*h,g=Math.sin(a)*h,p=oe+10,f=Math.cos(a)*p,y=Math.sin(a)*p,v=((a+Math.PI/2)/(2*Math.PI)*12+12)%12;return v>=11||1>v?(i="middle",r="auto"):v>=1&&5>v?(i="start",r="middle"):v>=5&&7>v?(i="middle",r="hanging"):(i="end",r="middle"),on("g",{transform:`translate(${n},${s})`,children:[tn("line",{x1:d,y1:u,x2:m,y2:g,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),tn("text",{x:f,y:y,textAnchor:i,dominantBaseline:r,fill:"var(--semiotic-text-secondary, #666)",fontSize:10,style:{userSelect:"none",fontSize:"var(--semiotic-gauge-label-font-size, 10px)"},children:e.label})]},"gauge-label-"+t)}return"gauge-value"===e.type?tn("text",{x:(o.width||M)/2,y:(o.height||I)/2-.2*re,textAnchor:"middle",dominantBaseline:"middle",fontSize:Math.max(12,Math.min(22,.28*oe)),fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},"gauge-value-"+t):null},[M,I,l,D,Z,K,re,oe]),pe=Ua(()=>{let e=[...j,...S||[]];return ue&&e.push(ue),de&&e.push(de),e},[j,S,ue,de]),fe=Ua(()=>e=>{let t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;return on("div",{className:"semiotic-tooltip",style:{padding:"6px 10px",background:"var(--semiotic-tooltip-bg, white)",borderRadius:"var(--semiotic-tooltip-radius, 6px)",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0,0,0,0.15))"},children:[tn("div",{style:{fontWeight:600},children:o}),tn("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:i?"Current: "+Math.round(O):"Remaining"})]})},[O]),ye=uo(e.loading,M,I,e.loadingContent),ve=ye?null:co(Number.isFinite(n)?[{value:n}]:[],M,I,e.emptyContent);if(ye)return ye;if(ve)return ve;if(0===W.length)return tn(Mt,{componentName:"GaugeChart",message:"No data to display",width:M,height:I});let be={chartType:"donut",data:W,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:Q,innerRadius:re,startAngle:Z,sweepAngle:x,...null!=g&&{cornerRadius:g},centerContent:he,size:[M,I],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:{top:ne-ce/2,bottom:I-ne-ce/2,left:ae-ce/2,right:M-ae-ce/2},enableHover:o.enableHover,showAxes:!1,showCategoryTicks:!1,tooltipContent:!1===k?()=>null:oo(k)||fe,...Qe({linkedHover:e.linkedHover,selection:e.selection,onObservation:e.onObservation,onClick:e.onClick,hoverRadius:e.hoverRadius,hoverHighlight:e.hoverHighlight,mobileInteraction:o.mobileInteraction,customHoverBehavior:q,customClickBehavior:X}),svgAnnotationRules:me,...pe.length>0&&{annotations:pe},...T&&{title:T},...H&&{description:H},...B&&{summary:B},...void 0!==F&&{accessibleTable:F},...P&&{className:P},...null!=e.animate&&{animate:e.animate},...R};return tn(Bt,{componentName:"GaugeChart",width:M,height:I,children:tn(_r,{ref:i,...be})})});rn.displayName="GaugeChart";import{useMemo as an,forwardRef as nn,useRef as ln}from"react";import{jsx as sn}from"react/jsx-runtime";var cn=nn(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ln(null),{data:r,margin:a,className:n,categoryAccessor:l="category",groupBy:s,valueAccessor:c="value",orientation:h="vertical",valueFormat:d,colorBy:u,colorScheme:m,sort:g=!1,barPadding:p=60,roundedTop:f,gradientFill:y,styleRules:v,baselinePadding:b=!1,tooltip:x,annotations:w,valueExtent:k,frameProps:A={},selection:S,linkedHover:R,linkedBrush:P,brush:C,onBrush:_,onObservation:L,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:F,legendInteraction:$,legendPosition:O,color:D,stroke:E,strokeWidth:W,opacity:N,categoryFormat:j}=e,{width:z,height:V,enableHover:G,showGrid:q,showLegend:X,title:Z,description:U,summary:J,accessibleTable:ee,categoryLabel:te,valueLabel:oe}=o,ie=an(()=>Yt(r),[r]),re=u||s,ae=ue({data:ie,rawData:r,colorBy:re,colorScheme:m,legendInteraction:$,legendPosition:O,frameLegend:A,selection:S,linkedHover:R,fallbackFields:re?["string"==typeof re?re:""]:[],unwrapData:!0,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"GroupedBarChart",chartId:T,showLegend:X,userMargin:a,marginDefaults:o.marginDefaults,loading:H,loadingContent:B,emptyContent:F,width:z,height:V,hasTitle:!!Z,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!te,hasValueLabel:!!oe})}),ne=Fo(),le=an(()=>new Map,[]),se=an(()=>eo(c),[c]),ce=K({brushProp:C,onBrushProp:_,linkedBrush:P,valueAccessor:c}),he=Q({colorBy:re,colorScale:ae.colorScale,color:D,themeCategorical:ne,colorScheme:m,categoryIndexMap:le,userPieceStyle:A.pieceStyle,stroke:E,strokeWidth:W,opacity:N,styleRules:v,resolveRuleValue:se,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection}),me=an(()=>Ze({categoryAccessor:s,valueAccessor:c,groupAccessor:l,valueFormat:d}),[s,l,c,d]),ge=de({componentName:"GroupedBarChart",data:r,accessors:{categoryAccessor:l,valueAccessor:c},requiredProps:{groupBy:s}}),{effectiveLegendProps:pe,effectiveMargin:fe}=Y({ref:t,frameRef:i,setup:ae}),ye=an(()=>Ce(y),[y]);if(ae.earlyReturn)return ae.earlyReturn;let ve={chartType:"clusterbar",...null!=r&&{data:ie},oAccessor:l,rAccessor:c,groupBy:s,oSort:g,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:he,size:[z,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe,barPadding:p,...null!=f&&{roundedTop:f},...ye&&{gradientFill:ye},baselinePadding:b,enableHover:G,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:te,rLabel:oe,rFormat:d,...j&&{oFormat:j},showGrid:q,...pe,...Ye({title:Z,description:U,summary:J,accessibleTable:ee,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:x,defaultTooltipContent:me}),...Qe({linkedHover:R,selection:S,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...w&&w.length>0&&{annotations:w},...k&&{rExtent:k},...ce.brushStreamProps,...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return ge?sn(Mt,{componentName:"GroupedBarChart",message:ge,width:z,height:V}):sn(Bt,{componentName:"GroupedBarChart",width:z,height:V,children:sn(_r,{ref:i,...ve})})});cn.displayName="GroupedBarChart";import{useMemo as hn,forwardRef as dn,useRef as un}from"react";import{jsx as mn,jsxs as gn}from"react/jsx-runtime";var pn=dn(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:!1,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:!1,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=un(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,stepAccessor:l="step",valueAccessor:s="value",categoryAccessor:c,colorBy:h,colorScheme:d,styleRules:u,orientation:m="horizontal",connectorOpacity:g=.3,showLabels:p=!0,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B,categoryFormat:F}=e,$="vertical"===m,{width:O,height:D,enableHover:E,showLegend:W,title:N,description:j,summary:z,accessibleTable:V}=o,G=$?{top:N?60:40,right:20,bottom:60,left:60}:{top:N?40:10,right:10,bottom:10,left:10},q=hn(()=>Yt(r),[r]),X=h||c,Y=!X,K=ue({data:q,rawData:r,colorBy:X,colorScheme:d,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:X?["string"==typeof X?X:""]:[],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FunnelChart",chartId:R,showLegend:W,userMargin:a,marginDefaults:G,loading:P,loadingContent:C,emptyContent:_,width:O,height:D,hasTitle:!!N,axisChrome:po({showAxes:$&&o.showAxes,projection:$?"vertical":"horizontal",hasCategoryLabel:!1,hasValueLabel:!1})});Do("FunnelChart",q,"stepAccessor",l),Do("FunnelChart",q,"valueAccessor",s);let Z=Fo(),U=hn(()=>new Map,[]),J=hn(()=>eo(s),[s]),ee=hn(()=>{if(Y)return I||(Z?.[0]?Z[0]:Array.isArray(d)&&d[0]?d[0]:"#4e79a7")},[Y,I,Z,d]),te=Q({colorBy:ee?void 0:X,colorScale:K.colorScale,color:ee??I,themeCategorical:Z,colorScheme:d,categoryIndexMap:U,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:K.effectiveSelectionHook,resolvedSelection:K.resolvedSelection,styleRules:u,resolveRuleValue:J}),oe=hn(()=>e=>{let t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",r=t?.__funnelPercent??t?.__barFunnelPercent,a=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,n=t?.__barFunnelIsDropoff,l=t?.__barFunnelCategory??t?.category,s=null==r||a?"":` (${.05>Math.abs(r-Math.round(r))?Math.round(r)+"%":r.toFixed(1)+"%"})`;return gn("div",{className:"semiotic-tooltip",style:Xt,children:[o&&mn("div",{style:{fontWeight:"bold"},children:o+""}),l&&l!==o&&mn("div",{style:{marginTop:2,opacity:.8},children:l+""}),n&&mn("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),gn("div",{style:{marginTop:4},children:[!f||"number"!=typeof i&&"string"!=typeof i?i+"":f(i),s]})]})},[f]);if(K.earlyReturn)return K.earlyReturn;let ie=de({componentName:"FunnelChart",data:r,accessors:{stepAccessor:l,valueAccessor:s}});if(ie)return mn(Mt,{componentName:"FunnelChart",message:ie,width:O,height:D});let re={chartType:$?"bar-funnel":"funnel",...null!=r&&{data:q},oAccessor:l,rAccessor:s,...c&&{stackBy:c},projection:$?"vertical":"horizontal",barPadding:$?40:0,pieceStyle:te,size:[O,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:K.margin,enableHover:E,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:$&&o.showAxes,showCategoryTicks:$&&o.showAxes,...F&&{oFormat:F},...f&&{rFormat:f},showGrid:$,...!$&&{connectorOpacity:g},showLabels:p,...K.legendBehaviorProps,...N&&{title:N},...j&&{description:j},...z&&{summary:z},...void 0!==V&&{accessibleTable:V},...n&&{className:n},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===y?()=>null:!0===y||null==y?oe:oo(y)||oe,...Qe({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return mn(Bt,{componentName:"FunnelChart",width:O,height:D,children:mn(_r,{ref:i,...re})})});pn.displayName="FunnelChart";import{useMemo as fn,forwardRef as yn,useRef as vn}from"react";import{jsx as bn}from"react/jsx-runtime";var xn=yn(function(e,t){let o=vn(null);me(t,{variant:"xy",frameRef:o});let i=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:a,className:n,categoryAccessor:l="attribute",valueAccessor:s="value",seriesAccessor:c,colorBy:h,categoryFormat:d,colorScheme:u,styleRules:m,pointRadius:g=4,valueExtent:p,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:F,height:$,enableHover:O,showGrid:D,showLegend:E,title:W,description:N,summary:j,accessibleTable:z}=i,V=fn(()=>Yt(r),[r]),G=c||("string"==typeof h?h:void 0)||("function"==typeof h?h:void 0),q=G??"__radar",X=h||G,Y=ue({data:V,rawData:r,colorBy:X,colorScheme:u,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:["string"==typeof X?X:"","string"==typeof l?l:""].filter(Boolean),unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"RadarChart",chartId:R,showLegend:E,userMargin:a,marginDefaults:i.marginDefaults,loading:P,loadingContent:C,emptyContent:_,width:F,height:$,hasTitle:!!W,axisChrome:po({showAxes:!0,projection:"radial",hasCategoryLabel:!1,hasValueLabel:!1})}),K=Fo(),Z=fn(()=>new Map,[]),U=fn(()=>eo(s),[s]),J=Q({colorBy:X,colorScale:Y.colorScale,color:I,themeCategorical:K,colorScheme:u,categoryIndexMap:Z,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:Y.effectiveSelectionHook,resolvedSelection:Y.resolvedSelection,baseStyleExtras:{r:g,fillOpacity:.85},styleRules:m,resolveRuleValue:U}),ee=fn(()=>Ze({categoryAccessor:l,valueAccessor:s,groupAccessor:G,groupLabel:"string"==typeof G?G:"series",valueFormat:f}),[l,s,G,f]);if(Y.earlyReturn)return Y.earlyReturn;let te=de({componentName:"RadarChart",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(te)return bn(Mt,{componentName:"RadarChart",message:te,width:F,height:$});let oe={chartType:"point",projection:"radial",...null!=r&&{data:V},oAccessor:l,rAccessor:s,connectorAccessor:q,connectorStyle:e=>{let t="function"==typeof J?J(e):{},o="string"==typeof t.fill?t.fill:void 0;return{fill:o,fillOpacity:.15,stroke:o,strokeWidth:2,opacity:.7}},pieceStyle:J,...d&&{oFormat:d},rExtent:p??[0],rFormat:f,oLabel:"",size:[F,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Y.margin,enableHover:O,showAxes:!0,showGrid:D,...Y.legendBehaviorProps,...Ye({title:W,description:N,summary:j,accessibleTable:z,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:y,defaultTooltipContent:ee}),...Qe({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:Y.mobileInteraction,customHoverBehavior:Y.customHoverBehavior,customClickBehavior:Y.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e&&"connectorStyle"!==e))};return bn(Bt,{componentName:"RadarChart",width:F,height:$,children:bn(_r,{ref:o,...oe})})});xn.displayName="RadarChart";import{useMemo as wn,forwardRef as kn,useRef as An}from"react";import{jsx as Sn}from"react/jsx-runtime";var Rn=kn(function(e,t){let o=_o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=An(null),{data:r,margin:a,className:n,categoryAccessor:l="category",subcategoryAccessor:s,valueAccessor:c="value",orientation:h="horizontal",valueFormat:d,colorBy:u,colorScheme:m,styleRules:g,barPadding:p,tooltip:f,annotations:y,brush:v,onBrush:b,linkedBrush:x,frameProps:w={},selection:k,linkedHover:A,onObservation:S,onClick:R,hoverHighlight:P,chartId:C,loading:_,loadingContent:L,emptyContent:M,legendInteraction:I,legendPosition:T,color:H,stroke:B,strokeWidth:F,opacity:$,categoryFormat:O,rTickValues:D,tickLabelEdgeAlign:E,showCategoryTicks:W,gradientFill:N,trackFill:j,roundedTop:z,valueExtent:V}=e,{width:G,height:q,enableHover:X,showGrid:Z,showLegend:U,title:J,description:ee,summary:te,accessibleTable:oe,categoryLabel:ie,valueLabel:re}=o,ae=wn(()=>Yt(r),[r]),ne=u||s,le=wn(()=>{if(null!=p)return p;if("sparkline"!==o.mode)return 40;let e=new Set(ae.map(e=>"function"==typeof l?l(e):e[l])),t=Math.max(1,e.size);return t>1?Math.max(0,Math.min(1,(("horizontal"===h?q:G)-2*t)/(t-1))):1},[p,o.mode,ae,l,h,G,q]),se=ue({data:ae,rawData:r,colorBy:ne,colorScheme:m,legendInteraction:I,legendPosition:T,frameLegend:w,selection:k,linkedHover:A,fallbackFields:ne?["string"==typeof ne?ne:""]:[],unwrapData:!0,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"SwimlaneChart",chartId:C,showLegend:U,userMargin:a,marginDefaults:o.marginDefaults,loading:_,loadingContent:L,emptyContent:M,width:G,height:q,hasTitle:!!J,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!1!==W&&!!ie,hasValueLabel:!!re})}),ce=K({brushProp:v,onBrushProp:b,linkedBrush:x,valueAccessor:c}),he=Fo(),me=wn(()=>new Map,[]),ge=wn(()=>eo(c),[c]),pe=Q({colorBy:ne,colorScale:se.colorScale,color:H,themeCategorical:he,colorScheme:m,categoryIndexMap:me,userPieceStyle:w?.pieceStyle,stroke:B,strokeWidth:F,opacity:$,effectiveSelectionHook:se.effectiveSelectionHook,resolvedSelection:se.resolvedSelection,cycleByCategory:!0,styleRules:g,resolveRuleValue:ge}),fe=wn(()=>Ze({categoryAccessor:s,valueAccessor:c,groupAccessor:l,valueFormat:d}),[s,l,c,d]),ye=de({componentName:"SwimlaneChart",data:r,accessors:{categoryAccessor:l,valueAccessor:c,subcategoryAccessor:s},requiredProps:{subcategoryAccessor:s}}),{effectiveLegendProps:ve,effectiveMargin:be}=Y({ref:t,frameRef:i,setup:se}),xe=wn(()=>Ce(N),[N]);if(se.earlyReturn)return se.earlyReturn;let we={chartType:"swimlane",...null!=r&&{data:ae},oAccessor:l,rAccessor:c,stackBy:s,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:pe,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be,barPadding:le,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:!1===W?void 0:ie,rLabel:re,rFormat:d,...D&&{rTickValues:D},...null!=E&&{tickLabelEdgeAlign:E},...O&&{oFormat:O},...void 0!==W&&{showCategoryTicks:W},showGrid:Z,...ve,...Ye({title:J,description:ee,summary:te,accessibleTable:oe,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:f,defaultTooltipContent:fe}),...Qe({linkedHover:A,selection:k,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:se.mobileInteraction,customHoverBehavior:se.customHoverBehavior,customClickBehavior:se.customClickBehavior}),...y&&y.length>0&&{annotations:y},...xe&&{gradientFill:xe},...null!=j&&{trackFill:j},...null!=z&&{roundedTop:z},...V&&{rExtent:V},...ce.brushStreamProps,...Object.fromEntries(Object.entries(w).filter(([e])=>"pieceStyle"!==e))};return ye?Sn(Mt,{componentName:"SwimlaneChart",message:ye,width:G,height:q}):Sn(Bt,{componentName:"SwimlaneChart",width:G,height:q,children:Sn(_r,{ref:i,...we})})});Rn.displayName="SwimlaneChart";import{forwardRef as Pn,useMemo as Cn}from"react";import{jsx as _n}from"react/jsx-runtime";var Ln=Pn(function(e,t){let{data:o,layout:i,layoutConfig:r,onLayoutError:a,categoryAccessor:n="category",valueAccessor:l="value",oExtent:s,rExtent:c,projection:h="vertical",margin:d,className:u,colorBy:m,colorScheme:g,tooltip:p,showAxes:f=!1,annotations:y,onObservation:v,onClick:b,selection:x,linkedHover:w,chartId:k,loading:A,loadingContent:S,emptyContent:R,frameProps:P={}}=e,{frameRef:C,resolved:_,safeData:L,setup:M,earlyReturn:I}=he({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:o,colorBy:m,colorScheme:g,frameLegend:P,selection:x,linkedHover:w,onObservation:v,onClick:b,chartId:k,loading:A,loadingContent:S,emptyContent:R,margin:d,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),T=M.effectiveSelectionHook,H=Cn(()=>T?.isActive?{isActive:!0,predicate:T.predicate}:null,[T?.isActive,T?.predicate]),B=Cn(()=>oo(p),[p]);if(I)return I;let{width:F,height:$,enableHover:O,showGrid:D,title:E,description:W,summary:N,accessibleTable:j}=_,z={chartType:"custom",...null!=o&&{data:L},customLayout:i,layoutConfig:r,onLayoutError:a,...H&&{layoutSelection:H},oAccessor:n,rAccessor:l,oExtent:s,rExtent:c,projection:h,colorAccessor:m,colorScheme:g,size:[F,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:M.margin,enableHover:O,showAxes:f,showGrid:D,annotations:y,...Ye({title:E,description:W,summary:N,accessibleTable:j,className:u,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===p?{tooltipContent:()=>null}:B?{tooltipContent:B}:{},...M.legendBehaviorProps,...Qe({linkedHover:w,selection:x,onObservation:v,onClick:b,hoverHighlight:!1,mobileInteraction:M.mobileInteraction,customHoverBehavior:M.customHoverBehavior,customClickBehavior:M.customClickBehavior}),...P};return _n(Bt,{componentName:"OrdinalCustomChart",width:F,height:$,children:_n(_r,{ref:C,...z})})});Ln.displayName="OrdinalCustomChart";export{_r as StreamOrdinalFrame_default,Dr as BarChart,zr as StackedBarChart,aa as LikertChart,ha as SwarmPlot,ya as BoxPlot,Sa as Histogram,La as ViolinPlot,Ba as RidgelinePlot,Ea as DotPlot,Va as PieChart,Qa as DonutChart,rn as GaugeChart,cn as GroupedBarChart,pn as FunnelChart,xn as RadarChart,Rn as SwimlaneChart,Ln as OrdinalCustomChart};