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
@@ -1 +1 @@
1
- var e,t=Object.create,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,s=(e,t,n,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))i.call(e,l)||l===n||a(e,l,{get:()=>t[l],enumerable:!(s=r(t,l))||s.enumerable});return e},l=(e,r,o)=>(o=null!=e?t(n(e)):{},s(!r&&e&&e.__esModule?o:a(o,"default",{value:e,enumerable:!0}),e)),c={};((e,t)=>{for(var r in t)a(e,r,{get:t[r],enumerable:!0})})(c,{AESTHETICS_OFF_PROFILE:()=>D,CARBON_ALERT:()=>f,CARBON_CATEGORICAL_14:()=>m,COLOR_BLIND_SAFE_CATEGORICAL:()=>u,DARK_THEME:()=>h,DEFAULT_AESTHETIC_PROFILE:()=>B,DEFAULT_AESTHETIC_THRESHOLDS:()=>j,DEFAULT_AESTHETIC_WEIGHTS:()=>F,HIGH_CONTRAST_THEME:()=>p,IncrementalExtent:()=>An,LIGHT_THEME:()=>d,MultiLineTooltip:()=>_n,MultiPointTooltip:()=>Un,RingBuffer:()=>vn,THEME_PRESETS:()=>g,Tooltip:()=>zn,TooltipRoot:()=>Nn,accessibilityCaveats:()=>va,adaptiveTimeTicks:()=>ce,auditAccessibility:()=>ba,auditData:()=>Qt,auditMobileVisualization:()=>Wa,auditObservedScene:()=>cn,auditVisualHierarchy:()=>_,buildNavigationTree:()=>mo,buildReaderGrounding:()=>To,communicativeActForIntent:()=>Sr,composeStyleRules:()=>P,computeArcBoundingBox:()=>Wn,configToJSX:()=>Wo,copyConfig:()=>Vo,countNodes:()=>go,createHatchPattern:()=>fe,darkenColor:()=>de,describeChart:()=>zr,deserializeSelections:()=>Yo,diagnoseConfig:()=>ia,evaluateAesthetics:()=>te,evaluateChart:()=>Ta,exportChart:()=>Ko,flattenVisible:()=>fo,formatAccessibilityAudit:()=>wa,formatDataAudit:()=>Ft,formatEvaluateChart:()=>Na,formatMobileVisualizationAudit:()=>Ka,fromConfig:()=>Uo,fromURL:()=>Ho,fromVegaLite:()=>gn,getHitRadius:()=>Io,hasOwnTooltipChrome:()=>En,hatchFillId:()=>be,hatchFillKey:()=>ye,isHatchFill:()=>ge,isMultiTooltip:()=>Fn,lightenColor:()=>he,makeNodeRuleContext:()=>C,makeRuleValueResolver:()=>x,makeStyleRuleStyleFn:()=>N,makeXYRuleContext:()=>w,markTooltipChrome:()=>Tn,matchesThreshold:()=>S,mobileVisualizationCaveats:()=>Xa,normalizeTooltip:()=>Gn,profileNumericFields:()=>_t,resolveCommunicativeAct:()=>kr,resolveMultiCapableTooltip:()=>Bn,resolveResponsiveDimension:()=>ue,resolveResponsiveRules:()=>La,resolveStyleRules:()=>R,resolveThemePreset:()=>y,resolveTooltipContent:()=>Dn,responsiveRuleMatches:()=>Ma,ruleMatches:()=>k,serializeSelections:()=>qo,smartTickFormat:()=>ae,sweepToAngles:()=>Hn,themeToCSS:()=>v,themeToCSSVariables:()=>b,themeToTokens:()=>A,toConfig:()=>Do,toDataAuditNotifications:()=>Bt,toEvaluateChartNotifications:()=>Ia,toURL:()=>Go,unwrapDatum:()=>Me,validateProps:()=>Ee,valueToAngle:()=>Vn}),module.exports=(e=c,s(a({},"__esModule",{value:!0}),e));var u=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],d={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},h={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},p={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:u,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},m=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],f={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},g={light:d,dark:h,"high-contrast":p,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}};function y(e){return Object.prototype.hasOwnProperty.call(g,e)?g[e]:void 0}function b(e){const t={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,a)=>{t["--semiotic-category-"+(a+1)]=e}),e.colors.focus&&(t["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(t["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(t["--semiotic-selection-opacity"]=e.colors.selectionOpacity+""),e.colors.diverging&&(t["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(t["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(t["--semiotic-success"]=e.colors.success),e.colors.danger&&(t["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(t["--semiotic-warning"]=e.colors.warning),e.colors.error&&(t["--semiotic-error"]=e.colors.error),e.colors.info&&(t["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(t["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(t["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(t["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(t["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(t["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(t["--semiotic-border-radius"]=e.borderRadius);const a=e.typography.legendSize??e.typography.labelSize;null!=a&&(t["--semiotic-legend-font-size"]=a+"px"),null!=e.typography.legendFontFamily&&(t["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(t["--semiotic-legend-font-weight"]=e.typography.legendFontWeight+"");const r=e.typography.titleFontSize??e.typography.titleSize;return null!=r&&(t["--semiotic-title-font-size"]=r+"px"),null!=e.typography.titleFontFamily&&(t["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(t["--semiotic-title-font-weight"]=e.typography.titleFontWeight+""),null!=e.typography.tickFontFamily&&(t["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(t["--semiotic-tick-font-size"]=e.typography.tickSize+"px"),null!=e.typography.labelSize&&(t["--semiotic-axis-label-font-size"]=e.typography.labelSize+"px"),t}function v(e,t=":root"){return`${t} {\n${Object.entries(b(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function A(e){return{semiotic:{bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:e.tooltip?.background||e.colors.background,$type:"color"},text:{$value:e.tooltip?.text||e.colors.text,$type:"color"},radius:{$value:e.tooltip?.borderRadius||"6px",$type:"dimension"},"font-size":{$value:e.tooltip?.fontSize||"14px",$type:"dimension"},shadow:{$value:e.tooltip?.shadow||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:e.colors.selectionOpacity??.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:e.typography.legendSize+"px",$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},"title-font-size":{$value:(e.typography.titleFontSize??e.typography.titleSize)+"px",$type:"dimension"},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:e.typography.tickSize+"px",$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:e.typography.labelSize+"px",$type:"dimension"}}:{},secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}function x(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>$(t(e))}function w(e,t){const a=x(e),r=x(t);return(e,t)=>{const o=r(e);return{value:o,x:a(e),y:o,category:t}}}function C(e,t){const a=x(t??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=r?r(e):void 0;return{value:a(e),category:null==t?void 0:t+""}}}function $(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function S(e,t,a){const r=null!=e.axis?a[e.axis]:null!=e.field?t[e.field]:a.value;if(void 0!==e.eq&&r!==e.eq)return!1;if(void 0!==e.ne&&r===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(r))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;const o=$(r);if(void 0===o)return!1;if(void 0!==e.gt&&e.gt>=o)return!1;if(void 0!==e.gte&&e.gte>o)return!1;if(void 0!==e.lt&&o>=e.lt)return!1;if(void 0!==e.lte&&o>e.lte)return!1;if(void 0!==e.within){const[t,a]=e.within;if(t>o||o>a)return!1}if(void 0!==e.outside){const[t,a]=e.outside;if(o>=t&&a>=o)return!1}return!0}function k(e,t,a){const r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,a):S(r,t,a))}function R(e,t,a){if(!t||0===t.length)return{};let r={};for(const o of t){if(!k(o,e,a))continue;const t="function"==typeof o.style?o.style(e,a):o.style;t&&(r={...r,...t})}return r}function P(e,t,a,r=e=>e){const o=e??(()=>({}));return t&&0!==t.length?(e,n)=>{const i=r(e),s={...o(e,n)};return Object.assign(s,R(i,t,a(i,n))),s}:o}function N(e,t,a){return e&&0!==e.length?(r,o)=>{const n=R(r,e,t(r,o)),i=a?a(r,o):void 0;return i?{...n,...i}:n}:a}function T(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));const a=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!a)return null;const[r,o,n]=[parseInt(a[1],16)/255,parseInt(a[2],16)/255,parseInt(a[3],16)/255],i=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*i(r)+.7152*i(o)+.0722*i(n)}function I(e,t){const a=T(e),r=T(t);return null===a||null===r?null:(Math.max(a,r)+.05)/(Math.min(a,r)+.05)}function E(e){return Math.min(255,Math.max(0,Math.round(e)))}function M(e){if("string"!=typeof e)return null;const t=e.trim().toLowerCase(),a=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(a){const e=a.length>4?a:a.split("").map(e=>`${e}${e}`).join("");return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}const r=t.match(/^rgba?\(\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))(?:\s*,\s*(-?(?:\d+|\d*\.\d+)))?\s*\)$/);if(!r)return null;const o=[Number(r[1]),Number(r[2]),Number(r[3])],n=void 0===r[4]?1:Number(r[4]);return o.some(e=>!Number.isFinite(e)||0>e||e>255)||!Number.isFinite(n)||0>n||n>1?null:{r:o[0],g:o[1],b:o[2],a:n}}function L(e,t){return 1>t.a?null:{r:E(e.r*e.a+t.r*(1-e.a)),g:E(e.g*e.a+t.g*(1-e.a)),b:E(e.b*e.a+t.b*(1-e.a)),a:1}}function O(e){return 1>e.a?null:"#"+[e.r,e.g,e.b].map(e=>E(e).toString(16).padStart(2,"0")).join("")}function z(e,t,a){const r=M(e),o=M(t);if(!r||!o)return null;const n=L({...r,a:r.a*Math.min(1,Math.max(0,a))},o);return n?O(n):null}function _(e){const t=M(e.backgroundColor),a=t?O(t):null,r=z(e.scaffoldColor,e.backgroundColor,e.scaffoldOpacity??1),o=r&&a?I(r,a):null,n=e.dataColors.map(t=>z(t,e.backgroundColor,1)).map(e=>e&&a?I(e,a):null).filter(e=>null!==e);if(null===o||n.length!==e.dataColors.length||0===n.length)return{ok:!0,status:"manual",method:"mark-to-scaffold-contrast",finding:{code:"VISUAL_HIERARCHY_MANUAL",status:"manual",message:"Visual hierarchy could not be computed from the supplied colors.",fix:"Resolve CSS variables, gradients, or named colors to solid colors and run the audit again."}};const i=Math.min(...n),s=i/o,l={weakestDataContrast:i,scaffoldContrast:o,hierarchyRatio:s},c=Math.max(1,e.minimumScaffoldContrast??1.1);return c>o?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_VISIBILITY",status:"warn",message:"Reference scaffolding may be too faint to remain useful.",fix:"Increase grid or guide contrast while keeping it below the primary data marks."}}:3>i||o>Math.max(c,e.maximumScaffoldContrast??2)||Math.max(1,e.minimumHierarchyRatio??2)>s?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"warn",message:"Reference scaffolding competes with the primary data marks.",fix:"Increase mark contrast or lighten grid and guide colors until marks have at least twice the scaffold contrast."}}:{ok:!0,status:"pass",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"pass",message:"Primary data marks lead while reference scaffolding remains visible and subordinate."}}}var F=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),j=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),B=Object.freeze({name:"Semiotic balanced",weights:F,thresholds:j,minimumScore:70}),D=Object.freeze({name:"Aesthetics off",weights:Object.freeze(Object.fromEntries(Object.keys(F).map(e=>[e,0]))),minimumScore:0}),U=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],G=new Set(["category10","tableau10"]),H=new Set(["DonutChart","PieChart","SwimlaneChart"]),V={"mark-scaffold-hierarchy":"Mark–scaffold hierarchy","palette-authorship":"Palette authorship","palette-economy":"Palette economy","typographic-hierarchy":"Typographic hierarchy","theme-coherence":"Theme coherence","editorial-emphasis":"Editorial emphasis"};function W(e){return Math.min(1,Math.max(0,e))}function q(e,t){return Number.isFinite(e)?e:t}function Y(e){return function(e){if("string"!=typeof e||""===e.trim())return;const t=M(e);return t?O(t)??`rgba(${E(t.r)},${E(t.g)},${E(t.b)},${t.a})`:e.trim().toLowerCase()}(e)}function K(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map(Y).filter(e=>!!e)}function X(e){return Array.isArray(e)||e&&"object"==typeof e?K(e):[]}function J(e){return e.length>=4&&U.some(t=>e.length===t.length&&e.every((e,a)=>e===t[a]))}function Z(e,t){const a=Array.isArray(e.data)?e.data:[];return"string"==typeof t?Array.from(new Set(a.map(e=>e[t]+""))):"function"==typeof t?Array.from(new Set(a.map((e,a)=>t(e,a)+""))):[]}function Q(e,t){if(!e.evidence)return.5;const{weakestDataContrast:a,scaffoldContrast:r,hierarchyRatio:o}=e.evidence;return Math.min(W(a/3),W(r/t.scaffoldContrastMin),W(t.scaffoldContrastMax/r),W(o/t.hierarchyRatio))}function ee(e,t,a,r,o,n,i){const s=a[e];return{id:e,label:V[e],status:0===s?"disabled":i??(.8>t?"warn":"pass"),score:t,weight:s,contribution:t*s,message:r,...n?.[e]?{rationale:n[e]}:{},evidence:o}}function te(e,t,a={}){const r=a.theme??d,o=a.profile??r.aesthetics??B,n={...F,...o.weights??{}};for(const e of Object.keys(n)){const t=n[e];n[e]=Number.isFinite(t)?Math.max(0,t):0}const i=function(e){const t=e.thresholds??{},a=Math.max(1,q(t.scaffoldContrastMin,j.scaffoldContrastMin)),r=W(q(t.emphasisRatioMin,j.emphasisRatioMin));return{hierarchyRatio:Math.max(1,q(t.hierarchyRatio,j.hierarchyRatio)),scaffoldContrastMin:a,scaffoldContrastMax:Math.max(a,q(t.scaffoldContrastMax,j.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,q(t.titleScaleRatio,j.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round(q(t.categoricalColorMax,j.categoricalColorMax))),emphasisRatioMin:r,emphasisRatioMax:Math.max(r,W(q(t.emphasisRatioMax,j.emphasisRatioMax)))}}(o),s=function(e,t,a){const r=X(t.colorScheme),o=K(t.color),n=Z(t,t.colorBy),i=H.has(e)?Z(t,t.categoryAccessor??"category"):[],s=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,l=(e,t)=>e.map((e,r)=>Y(s?.[e])??("gray"===t?"#999999":a.colors.categorical.length>0?a.colors.categorical[r%a.colors.categorical.length]:"#007bff")),c=n.length>0?s?l(n,"gray"):r.length>0?r:a.colors.categorical:o.length>0?o:i.length>0&&s?l(i,"theme"):r.length>0&&!s?r:a.colors.categorical,u=c.slice(0,n.length>0||i.length>0?Math.min(c.length,Math.max(1,n.length||i.length||1)):1),d=function(e){const t=Array.isArray(e.data)?e.data:[],a=Array.isArray(e.styleRules)?e.styleRules:[],r="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",o="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",n=[];for(const e of a)e.style&&"function"!=typeof e.style&&t.some((t,a)=>k(e,t,{value:Number(t[r]),category:(t[o]??"")+"",index:a}))&&n.push(...K(e.style.fill));return Array.from(new Set(n))}(t).filter(e=>!u.includes(e));return Array.from(new Set([...u,...d]))}(e,t,r),l=function(e){const t=e.colors.surface??e.colors.background,a=M(t),r=M(e.colors.background);if(!a)return t;if(1===a.a)return O(a)??t;if(!r)return t;const o=L(a,r);return o?O(o)??t:t}(r),c=_({backgroundColor:l,dataColors:s,scaffoldColor:r.colors.grid,minimumHierarchyRatio:i.hierarchyRatio,minimumScaffoldContrast:i.scaffoldContrastMin,maximumScaffoldContrast:i.scaffoldContrastMax}),u=function(e){const t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,a=[...X(e.colorScheme),...K(e.color),...K(e.fill),...K(e.stroke),...K(t?.fill),...K(t?.stroke)],r=Array.isArray(e.styleRules)?e.styleRules:[];for(const e of r)e.style&&"function"!=typeof e.style&&a.push(...K(e.style.fill),...K(e.style.stroke));return Array.from(new Set(a))}(t),h=J(r.colors.categorical.map(Y).filter(e=>!!e)),p=function(e){const t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,a=[...X(e.colorScheme),...K(e.color),...K(e.fill),...K(t?.fill)],r=Array.isArray(e.styleRules)?e.styleRules:[];for(const e of r)e.style&&"function"!=typeof e.style&&a.push(...K(e.style.fill));return Array.from(new Set(a))}(t),m="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,f=p.length>0||m?"chart":"theme",g="chart"===f?J(p)||!!m&&G.has(m):h,y=g?.2:"chart"===f?1:.8,b=function(e){return Math.max(1,e.length)}(s),v=b>i.categoricalColorMax?W(1-(b-i.categoricalColorMax)/i.categoricalColorMax):1,A=r.typography.titleFontSize??r.typography.titleSize,x=Math.max(r.typography.tickSize,r.typography.labelSize),w=x>0?A/x:1,C=W((w-1)/(i.titleScaleRatio-1)),$=new Set([...r.colors.categorical,r.colors.primary,r.colors.secondary,r.colors.background,r.colors.surface,r.colors.text,r.colors.textSecondary,r.colors.grid,r.colors.border,r.colors.annotation].map(Y).filter(e=>!!e)),S=u.filter(e=>!$.has(e)).length,R=0===u.length?1:W(1-S/u.length),P=function(e){const t=Array.isArray(e.data)?e.data:[],a=Array.isArray(e.styleRules)?e.styleRules:[];if(0===t.length||0===a.length)return{ratio:0,authored:!1};const r="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",o="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>a.some(a=>k(a,e,{value:Number(e[r]),category:(e[o]??"")+"",index:t}))).length/t.length,authored:!0}}(t),N=P.authored?i.emphasisRatioMin>P.ratio?W(P.ratio/i.emphasisRatioMin):P.ratio>i.emphasisRatioMax?W(i.emphasisRatioMax/P.ratio):1:.35,T=[ee("mark-scaffold-hierarchy",Q(c,i),n,c.finding.message,{hierarchyRatio:c.evidence?.hierarchyRatio??0,markContrast:c.evidence?.weakestDataContrast??0,scaffoldContrast:c.evidence?.scaffoldContrast??0},o.rationales,c.status),ee("palette-authorship",y,n,g?"theme"===f?"The chart inherits a ubiquitous categorical default without an organizational palette decision.":"The chart explicitly selects a ubiquitous categorical palette.":"The effective palette records an authored choice beyond the ubiquitous defaults.",{paletteSource:f,ubiquitousDefault:g,colorCount:s.length},o.rationales),ee("palette-economy",v,n,`${b} color role(s) are used against a policy ceiling of ${i.categoricalColorMax}.`,{colorRoles:b,maximum:i.categoricalColorMax},o.rationales),ee("typographic-hierarchy",C,n,`Title-to-supporting-type scale is ${w.toFixed(2)}×.`,{titleSize:A,supportingSize:x,ratio:w},o.rationales),ee("theme-coherence",R,n,`${S} of ${u.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:u.length,outsideTheme:S},o.rationales),ee("editorial-emphasis",N,n,P.authored?Math.round(100*P.ratio)+"% of marks receive authored emphasis.":"No machine-visible editorial emphasis rule is declared.",{authored:P.authored,emphasizedRatio:P.ratio},o.rationales)],I=T.reduce((e,t)=>e+t.weight,0),E=T.reduce((e,t)=>e+t.contribution,0),z=0===I?null:E/I*100,D=100*W(q(o.minimumScore,B.minimumScore??70)/100);return{component:e,profile:o.name??"Unnamed aesthetic profile",ok:null===z||z>=D,score:z,minimumScore:D,weightedPoints:E,totalWeight:I,features:T,method:"weighted-machine-visible-features"}}function ae(e){if(null==e)return"";if("number"!=typeof e)return e+"";if(!isFinite(e))return e+"";if(0===e)return"0";const t=parseFloat(e.toPrecision(12)),a=Math.abs(t);return 1e9>a?1e6>a?1e4>a?Number.isInteger(t)?t+"":parseFloat(t.toPrecision(6))+"":parseFloat((t/1e3).toPrecision(3))+"K":parseFloat((t/1e6).toPrecision(3))+"M":parseFloat((t/1e9).toPrecision(3))+"B"}l(require("react"));var re=6e4,oe=60*re,ne=24*oe;function ie(e){return 10>e?"0"+e:e+""}var se=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function le(e,t){return t?{month:e.getUTCMonth(),day:e.getUTCDate(),year:e.getUTCFullYear(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{month:e.getMonth(),day:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function ce(e,t={}){let a,r=e;const o=(n=function(e={}){const t=e.timeZone;return"UTC"===t?{kind:"utc"}:"local"===t?{kind:"local"}:"string"==typeof t&&t.length>0?{kind:"iana",id:t}:!1===e.utc?{kind:"local"}:{kind:"utc"}}(t),"utc"===n.kind?e=>le(e,!0):"local"===n.kind?e=>le(e,!1):function(e){let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hourCycle:"h23"})}catch{return e=>le(e,!0)}return e=>{const a={};for(const r of t.formatToParts(e))"literal"!==r.type&&(a[r.type]=r.value);return{month:Math.max(0,(Number(a.month)||1)-1),day:Number(a.day)||1,year:Number(a.year)||1970,hours:Number(a.hour)||0,minutes:Number(a.minute)||0,seconds:Number(a.second)||0}}}(n.id));var n;return(t,n,i)=>{const s=t instanceof Date?t:new Date(t);e||!i||2>i.length||i===a||(a=i,r=function(e){if(2>e.length)return"days";const t=[];for(let a=1;e.length>a;a++)t.push(e[a]-e[a-1]);t.sort((e,t)=>e-t);const a=t[Math.floor(t.length/2)];return 2*re>a?"seconds":2*oe>a?"minutes":2*ne>a?"hours":60*ne>a?"days":400*ne>a?"months":"years"}(i));const l=r||"days";return null!=n&&0!==n&&i&&0!==i.length?function(e,t,a,r){const o=r(e),n=r(t),i=o.year!==n.year,s=i||o.month!==n.month,l=s||o.day!==n.day,c=l||o.hours!==n.hours,u=c||o.minutes!==n.minutes,d=se[o.month],{day:h,year:p}=o,m=ie(o.hours),f=ie(o.minutes),g=ie(o.seconds);switch(a){case"seconds":return i?`${d} ${h}, ${p} ${m}:${f}:${g}`:l?`${d} ${h} ${m}:${f}:${g}`:c?`${m}:${f}:${g}`:u?`${f}:${g}`:":"+g;case"minutes":return i?`${d} ${h}, ${p} ${m}:${f}`:l?`${d} ${h} ${m}:${f}`:c?`${m}:${f}`:":"+f;case"hours":return i?`${d} ${h}, ${p} ${m}:00`:s?`${d} ${h} ${m}:${f}`:l?`${d} ${h} ${m}:00`:m+":00";case"days":return i?`${d} ${h}, ${p}`:s?`${d} ${h}`:""+h;case"months":return i?`${d} ${p}`:""+d;case"years":return""+p}}(s,new Date(i[n-1]),l,o):function(e,t,a){const{month:r,day:o,year:n,hours:i,minutes:s,seconds:l}=a(e),c=se[r],u=ie(i),d=ie(s),h=ie(l);switch(t){case"seconds":return`${c} ${o}, ${n} ${u}:${d}:${h}`;case"minutes":case"hours":return`${c} ${o}, ${n} ${u}:${d}`;case"days":return`${c} ${o}, ${n}`;case"months":return`${c} ${n}`;case"years":return""+n}}(s,l,o)}}function ue(e,t=0,a=1/0,r=0){const o=Number.isFinite(t)?t:0,n=Number.isFinite(a)?Math.max(o,a):1/0,i=Number.isFinite(e)?Math.floor(e):o,s=Math.max(o,Math.min(n,i));return r>0&&Number.isFinite(r)?Math.max(o,Math.min(n,Math.round(s/r)*r)):s}function de(e,t=.5){const a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;const r=Math.round(parseInt(a[1],16)*(1-t)),o=Math.round(parseInt(a[2],16)*(1-t)),n=Math.round(parseInt(a[3],16)*(1-t));return`#${r.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function he(e,t=.5){const a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;const r=Math.round(parseInt(a[1],16)+(255-parseInt(a[1],16))*t),o=Math.round(parseInt(a[2],16)+(255-parseInt(a[2],16))*t),n=Math.round(parseInt(a[3],16)+(255-parseInt(a[3],16))*t);return`#${r.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function pe(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle}}var me=null;function fe(e={},t){const{background:a="transparent",stroke:r="#000",lineWidth:o=1.5,spacing:n=6,angle:i=45}=e,s={background:a,stroke:r,lineWidth:o,spacing:n,angle:i},l=Math.max(8,Math.ceil(2*n));let c;try{c=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(me||(me=document.createElement("canvas")),me.width=e,me.height=e,me)}(l)}catch{return pe(s)}const u=c.getContext("2d");if(!u)return pe(s);a&&"transparent"!==a?(u.fillStyle=a,u.fillRect(0,0,l,l)):u.clearRect(0,0,l,l),u.strokeStyle=r,u.lineWidth=o,u.lineCap="square";const d=i*Math.PI/180;if(45===i||-45===i){const e=i>0?1:-1;for(let t=-l;2*l>=t;t+=n)u.beginPath(),u.moveTo(t,0),u.lineTo(t+e*l,l),u.stroke()}else{u.save(),u.translate(l/2,l/2),u.rotate(d);const e=2*l;for(let t=-e;e>=t;t+=n)u.beginPath(),u.moveTo(-e,t),u.lineTo(e,t),u.stroke();u.restore()}return(t||u).createPattern(c,"repeat")}function ge(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function ye(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function be(e,t){let a=2166136261;const r=ye(t);for(let e=0;r.length>e;e++)a^=r.charCodeAt(e),a=Math.imul(a,16777619);return`${e}-hatch-${(a>>>0).toString(36)}`}function ve(e,t){const a=e.length,r=t.length,o=Array(r+1);for(let e=0;r>=e;e++)o[e]=e;for(let n=1;a>=n;n++){let a=o[0];o[0]=n;for(let i=1;r>=i;i++){const r=o[i];o[i]=e[n-1]===t[i-1]?a:1+Math.min(a,o[i],o[i-1]),a=r}}return o[r]}function Ae(e,t,a=3){let r,o=a+1;for(const a of t){const t=ve(e.toLowerCase(),a.toLowerCase());o>t&&(o=t,r=a)}return o>a?void 0:r}function xe(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:[...e]}function we(e,t){if(0===t.length)return null;const a=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(a)||a.includes(e.toLowerCase()))||(Ae(e,t,3)??null)}function Ce(e){return` Or use a function: ${e}={d => d.myValue}.`}require("react/jsx-runtime");var $e=["string","number",["number","object"],["boolean","object"],"boolean",["array","object"],["string","function"],["string","array","object"],["boolean","function","object","string"],"array","object",["boolean","string"],"function",["boolean","string","function","object"],["boolean","string","object"],["boolean","string","function"],["number","function"],["string","object"],["boolean","object","string","number"],["object","string","number","function"],["boolean","array"],["object","array"],["object","function"],["string","boolean"],["number","string","function"],["number","string"],["boolean","string","number","object"],["string","array"],["array","string"],["string","object","function"],["boolean","number","array"],["number","null"],["array","function"],["string","number","array","object","function"]],Se=[["primary","context","sparkline","mobile"],["highlight","isolate","none"],["right","left","top","bottom"],["nice","exact"],["primary","secondary"],["linear","log","time"],["linear","log","symlog"],["sliding","growing"],["left","right"],["vertical","horizontal"],["horizontal","vertical"],["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],["break","interpolate","zero"],["descending","ascending"],["smooth","linear"],["start","end","both","auto"],["series"],["zero","wiggle","silhouette","diverging"],["key","input","insideOut","asc","desc"],["blues","reds","greens","viridis","oranges","purples","greys","plasma","inferno","magma","cividis","turbo","custom"],["count","sum","mean"],["histogram","density","label"],["crossfilter","intersect"],["auto","worker","sync"],["source","target","gradient"],["justify","left","right","center"],["value","temporal"],["off","reuse"],["insertion","crossing-min","inside-out","crossing-min+inside-out"],["stack","hug"],["temporal","max"],["auto"],["raw","scene"],["source","target","both"],["full","half"],["source","target"],["tree","cluster","partition","treemap","circlepack"],["vertical","horizontal","radial"],["line","curve"],["leaf","parent","all"],["locked","decay","alternate"],["geo","line"],["basic","offset","arc"],["butt","round","square"],["straight","fractional"],["radial","strip"],["up","down"],["primary","context","sparkline","mobile","sample","mechanical"],["sample","mechanical"],["route","net"],["outcome","hold-last"],["replay","snapshot"],["horizontal"],["allAbsorbed","none"],["circle","halo","faceted","pill","diamond","square"],["auto","normalized","pixels"],["path","none"],["snapshot","replay","mechanical"],["none","blocker-amplification"],["domino-ball"],["vertical"],["settle"],["number","currency","percent","compact","duration"],["higher-is-better","lower-is-better","neutral"],["auto","positive","negative","neutral"],["tile","presentation","inline","thumbnail"],["start","center","end"]],ke={common:{mode:[0,0],width:1,height:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,enableHover:4,showLegend:4,legendInteraction:[0,1],legendPosition:[0,2],legend:5,showGrid:4,colorBy:6,colorScheme:7,tooltip:8,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,maxDevicePixelRatio:1,axisExtent:[0,3],animate:3,loading:4,loadingContent:3,emptyContent:3,hoverHighlight:11,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,color:0,stroke:0,strokeWidth:1,opacity:1,onObservation:12,frameProps:10,onClick:12},xyAxis:{xLabel:0,yLabel:0,xFormat:12,yFormat:12,xScaleType:[0,5],yScaleType:[0,6]},ordinalAxis:{categoryLabel:0,valueLabel:0,showCategoryTicks:4,valueFormat:12,categoryFormat:12,dataIdAccessor:6},realtime:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,windowSize:1,windowMode:[0,7],arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:14,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},realtimeStatic:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:14,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},physics:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,colorBy:6,color:0,stroke:0,strokeWidth:1,opacity:1,seed:1,ballRadius:1,hoverRadius:1,paused:4,tooltip:13,annotations:9,autoPlaceAnnotations:3,background:0,legend:5,legendPosition:[0,2],legendLayout:10,selection:10,linkedHover:14,onSimulationStateChange:12,loading:4,loadingContent:3,emptyContent:3,frameProps:10}};function Re(e){const[t,a]=Array.isArray(e)?e:[e,void 0],r=$e[t],o=Array.isArray(r)?[...r]:r;return void 0===a?{type:o}:{type:o,enum:[...Se[a]]}}var Pe=Object.fromEntries(Object.entries({BarChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,brush:4,linkedBrush:17,onBrush:12,regression:14}],StackedBarChart:[["data","stackBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stackBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,9],normalize:4,sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4}],GroupedBarChart:[["data","groupBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,groupBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4}],SwarmPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],BoxPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],showOutliers:4,outlierRadius:1,categoryPadding:1,valueExtent:9,styleRules:9}],Histogram:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,bins:1,relative:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],ViolinPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],bins:1,curve:0,showIQR:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],RidgelinePlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,orientation:[0,9],categoryAccessor:6,valueAccessor:6,bins:1,amplitude:1,categoryPadding:1,valueExtent:9,styleRules:9}],DotPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,dotRadius:1,categoryPadding:1,valueExtent:9,styleRules:9,showGrid:4,regression:14}],PieChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],DonutChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,innerRadius:1,centerContent:18,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],GaugeChart:[["value"],"none",[],["common"],{value:1,min:1,max:1,thresholds:9,gradientFill:10,arcWidth:1,cornerRadius:1,sweep:1,fillZones:4,showNeedle:4,needleColor:0,color:0,valueFormat:12,centerContent:19,showScaleLabels:4,backgroundColor:0,styleRules:9}],FunnelChart:[["data"],"array",["stepAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stepAccessor:6,valueAccessor:6,categoryAccessor:6,orientation:[0,10],connectorOpacity:1,showLabels:4,showAxes:4,showCategoryTicks:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],RadarChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,seriesAccessor:6,pointRadius:1,valueExtent:9,styleRules:9}],SwimlaneChart:[["subcategoryAccessor"],"array",["categoryAccessor","subcategoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,subcategoryAccessor:6,valueAccessor:6,orientation:[0,10],barPadding:1,roundedTop:16,valueExtent:9,trackFill:17,gradientFill:3,brush:4,onBrush:12,linkedBrush:17,showCategoryTicks:4,rTickValues:9,tickLabelEdgeAlign:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],LikertChart:[[],"array",["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],["common","ordinalAxis"],{data:9,levels:9,categoryAccessor:6,valueAccessor:6,levelAccessor:6,countAccessor:6,orientation:[0,9],barPadding:1,valueExtent:9,styleRules:9}],LineChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{frameProps:10,styleRules:9,data:9,xAccessor:6,yAccessor:6,lineBy:6,lineDataAccessor:0,curve:[0,11],lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,fillArea:20,areaOpacity:1,lineGradient:10,directLabel:3,gapStrategy:[0,12],forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9,brush:4,linkedBrush:17,onBrush:12}],BumpChart:[["data"],"array",["xAccessor","yAccessor"],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,rankDirection:[0,13],ribbon:4,curve:[0,14],ribbonSizeRange:9,samplesPerSegment:1,lineWidth:1,highlightTop:1,neutralColor:0,ribbonOpacity:1,lineOpacity:1,showPoints:4,pointRadius:1,showLabels:[11,15],labelPriorityAccessor:0,maxLabels:1,showAxes:4,styleRules:9,labelStyle:22,legend:5,legendInteraction:[0,1],legendPosition:[0,2],hoverHighlight:[11,16]}],AreaChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,areaBy:6,lineDataAccessor:0,curve:[0,11],y0Accessor:6,gradientFill:3,semanticGradient:21,semanticLine:4,lineGradient:10,areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],DifferenceChart:[[],"array",["xAccessor","seriesAAccessor","seriesBAccessor"],["common","xyAxis"],{data:9,xAccessor:6,seriesAAccessor:6,seriesBAccessor:6,seriesALabel:0,seriesBLabel:0,seriesAColor:0,seriesBColor:0,showLines:4,lineWidth:1,showPoints:4,pointRadius:1,curve:[0,11],areaOpacity:1,gradientFill:3,xExtent:9,yExtent:9,pointIdAccessor:6,windowSize:1}],StackedAreaChart:[["data","areaBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,areaBy:6,lineDataAccessor:0,curve:[0,11],areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,normalize:4,baseline:[0,17],stackOrder:[0,18],pointIdAccessor:6,xExtent:9,yExtent:9}],Scatterplot:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,pointIdAccessor:6,marginalGraphics:22,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10,brush:4,linkedBrush:17,onBrush:12}],BubbleChart:[["data","sizeBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,sizeBy:6,xAccessor:6,yAccessor:6,sizeRange:9,bubbleOpacity:1,bubbleStrokeWidth:1,bubbleStrokeColor:0,pointIdAccessor:6,marginalGraphics:22,xExtent:9,yExtent:9,regression:14}],Heatmap:[["data"],"array",["xAccessor","yAccessor","valueAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,valueAccessor:6,colorScheme:[0,19],customColorScale:12,showValues:4,valueFormat:12,cellBorderColor:0,cellBorderWidth:1,pointIdAccessor:6,xExtent:9,yExtent:9,legendPosition:[0,2],heatmapAggregation:[0,20],heatmapXBins:1,heatmapYBins:1}],QuadrantChart:[[],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xCenter:1,yCenter:1,quadrants:10,centerlineStyle:10,showQuadrantLabels:4,quadrantLabelSize:1,sizeBy:6,sizeRange:9,pointRadius:1,pointOpacity:1,pointIdAccessor:6}],MultiAxisLineChart:[["series"],"array",["xAccessor"],["common","xyAxis"],{data:9,xAccessor:6,series:9,colorScheme:7,pointIdAccessor:6,curve:0,lineWidth:1}],WaterfallChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{data:9,xAccessor:6,yAccessor:6,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,xExtent:9,yExtent:9,pointIdAccessor:6}],CandlestickChart:[[],"array",["xAccessor","highAccessor","lowAccessor"],["common","xyAxis"],{data:9,xAccessor:6,highAccessor:6,lowAccessor:6,openAccessor:6,closeAccessor:6,candlestickStyle:10,pointIdAccessor:6,xExtent:9,yExtent:9,mode:[0,0]}],ConnectedScatterplot:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,orderAccessor:6,orderLabel:0,pointRadius:1,pointIdAccessor:6,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10}],ScatterplotMatrix:[["data","fields"],"array",[],["common"],{frameProps:10,data:9,fields:9,fieldLabels:10,cellSize:1,cellGap:1,pointRadius:1,pointOpacity:1,diagonal:[0,21],histogramBins:1,brushMode:[23,22],hoverMode:4,unselectedOpacity:1,idAccessor:6}],MinimapChart:[["data"],"array",[],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,lineDataAccessor:0,curve:[0,11],lineWidth:1,fillArea:4,areaOpacity:1,showPoints:4,pointRadius:1,minimap:10,renderBefore:4,onBrush:12,brushExtent:9,yExtent:9}],ForceDirectedGraph:[["nodes","edges"],"network",["nodeIdAccessor","sourceAccessor","targetAccessor"],["common"],{styleRules:9,nodes:9,edges:9,nodeIdAccessor:6,nodeIDAccessor:6,sourceAccessor:6,targetAccessor:6,nodeLabel:6,nodeSize:24,nodeSizeRange:9,edgeWidth:24,edgeColor:0,edgeOpacity:1,nodeStroke:0,nodeStrokeWidth:1,iterations:1,forceStrength:1,layoutExecution:[0,23],layoutLoadingContent:3,onLayoutStateChange:12,showLabels:4}],SankeyDiagram:[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,24],orientation:[0,9],nodeAlign:[0,25],nodePaddingRatio:1,nodeWidth:1,nodeLabel:6,showLabels:4,edgeOpacity:1,edgeSort:12}],ProcessSankey:[["domain"],"network",["sourceAccessor","targetAccessor"],["common"],{edges:9,nodes:9,domain:9,axisTicks:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,nodeLabel:6,startTimeAccessor:6,endTimeAccessor:6,systemInTimeAccessor:6,systemOutTimeAccessor:6,xExtentAccessor:6,groupBy:6,edgeIdAccessor:6,orientation:[0,10],legendPosition:[0,2],pairing:[0,26],packing:[0,27],laneOrder:[0,28],maxValueScale:1,lanePlacement:[0,29],nodeSizing:[0,30],showLabels:[11,31],labelPriorityAccessor:0,maxLabels:1,selectionDatum:[0,32],groupPadding:1,ribbonLane:[0,33],ribbonMinRun:25,lifetimeMode:[0,34],showLaneRails:4,showQualityReadout:4,edgeOpacity:1,styleRules:9,layoutExecution:[0,23],layoutWorkerThreshold:1,layoutLoadingContent:26,onLayoutStateChange:12,timeFormat:12,valueFormat:12,showParticles:4,particleStyle:10}],ChordDiagram:[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,35],padAngle:1,groupWidth:1,sortGroups:12,nodeLabel:6,showLabels:4,edgeOpacity:1}],TreeDiagram:[["data"],"object",[],["common"],{styleRules:9,data:10,layout:[0,36],orientation:[0,37],childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,edgeStyle:[0,38],nodeLabel:6,showLabels:4,nodeSize:1}],Treemap:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,labelMode:[0,39],padding:1,paddingTop:1,nodeLabel:6,nodeStyle:12}],CirclePack:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,nodeLabel:6,circleOpacity:1,padding:1}],OrbitDiagram:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,nodeIdAccessor:6,colorByDepth:4,orbitMode:27,orbitSize:16,speed:1,eccentricity:16,showRings:4,nodeRadius:16,showLabels:4,animated:4,revolution:12,revolutionStyle:[0,40],foregroundGraphics:10}],ChoroplethMap:[["areas","valueAccessor"],"array",["valueAccessor"],["common"],{styleRules:9,areas:28,valueAccessor:6,colorScheme:27,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1,areaOpacity:1}],ProportionalSymbolMap:[["points","sizeBy"],"array",["xAccessor","yAccessor"],["common"],{styleRules:9,points:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,areas:28,pointIdAccessor:6,areaStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],FlowMap:[["flows"],"array",[],["common"],{flows:9,nodes:9,nodeIdAccessor:0,xAccessor:6,yAccessor:6,valueAccessor:6,lineIdAccessor:6,lineType:[0,41],flowStyle:[0,42],areas:28,areaStyle:10,edgeColorBy:6,edgeOpacity:1,edgeWidthRange:9,pointRadius:1,edgeLinecap:[0,43],showParticles:4,particleStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],DistanceCartogram:[["points","center","costAccessor"],"array",[],["common"],{styleRules:9,points:9,lines:9,xAccessor:6,yAccessor:6,nodeIdAccessor:0,center:0,costAccessor:6,strength:1,lineMode:[0,44],transition:1,pointRadius:1,showRings:30,showRingLabels:4,ringStyle:10,showNorth:4,costLabel:0,cartogramLayout:[0,45],projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],RealtimeLineChart:[[],"realtime",[],["realtime"],{styleRules:9,stroke:0,strokeWidth:1,strokeDasharray:0,opacity:1,aggregate:10,eventTime:10,transition:10}],RealtimeHistogram:[["binSize"],"realtime",[],["realtime"],{styleRules:9,binSize:1,direction:[0,46],categoryAccessor:6,colors:10,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,brush:14,onBrush:12,linkedBrush:17,transition:10}],TemporalHistogram:[["data","binSize"],"array",["timeAccessor","valueAccessor","categoryAccessor"],["realtimeStatic"],{styleRules:9,data:9,binSize:1,size:9,width:1,height:1,margin:2,className:0,timeAccessor:6,valueAccessor:6,direction:[0,46],categoryAccessor:6,colors:10,timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,transition:10,linkedHover:14,linkedBrush:17,brush:14,onBrush:12}],RealtimeSwarmChart:[[],"realtime",[],["realtime"],{styleRules:9,categoryAccessor:6,colors:10,radius:1,fill:0,opacity:1,stroke:0,strokeWidth:1,pointStyle:12,yScaleType:[0,6],transition:10}],RealtimeWaterfallChart:[[],"realtime",[],["realtime"],{styleRules:9,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,stroke:0,strokeWidth:1,opacity:1,transition:10}],RealtimeHeatmap:[[],"realtime",[],["realtime"],{styleRules:9,heatmapXBins:1,heatmapYBins:1,aggregation:[0,20],categoryAccessor:6,colorScheme:[0,19],customColorScale:12}],GaltonBoardChart:[[],"array",["valueAccessor"],["physics"],{styleRules:9,valueAccessor:6,valueExtent:9,bins:1,mode:[0,47],simulationMode:[0,48],pegRows:1,mechanicalCount:1,branchProbability:1,referenceLines:21,rerunMS:31,showProjection:4}],EventDropChart:[["data"],"array",["timeAccessor","arrivalAccessor"],["physics"],{styleRules:9,timeAccessor:6,arrivalAccessor:6,windows:10,watermark:22,timeExtent:9,timeScale:1,rerunMS:31,showProjection:4}],UnitPileChart:[[],"array",["categoryAccessor","valueAccessor"],["physics"],{styleRules:9,categoryAccessor:6,valueAccessor:6,mode:[0,47],simulationMode:[0,48],mechanicalCount:1,mechanicalCategories:9,unitValue:1,showProjection:4,sediment:4,rerunMS:31}],CollisionSwarmChart:[[],"array",["xAccessor","groupAccessor","radiusAccessor"],["physics"],{styleRules:9,xAccessor:6,groupAccessor:6,radiusAccessor:6,pointRadius:1,xExtent:9,collisionIterations:1,settle:4,rerunMS:31,showProjection:4}],GauntletChart:[["negativeProperties"],"array",["idAccessor","positiveAccessor","negativeAccessor","metricsAccessor","startTimeAccessor"],["physics"],{idAccessor:6,labelAccessor:6,positiveAccessor:6,negativeAccessor:6,metricsAccessor:6,initialViability:6,positiveProperties:9,negativeProperties:9,gates:9,events:32,bodyGroups:32,crashOffset:1,initialSpawnPacing:10,startTimeAccessor:6,onCapacityChange:12,crashDetection:4,rerunMS:31,showChrome:4,showProjection:4,showTethers:4,coreForceMode:[0,49],terminalBehavior:[0,50]}],CrucibleChart:[["data","phases"],"array",["idAccessor","labelAccessor","categoryAccessor","amountAccessor","metricsAccessor","initialStateAccessor"],["physics"],{description:0,summary:0,phases:9,products:9,events:9,outlets:9,idAccessor:6,labelAccessor:6,categoryAccessor:6,amountAccessor:6,metricsAccessor:6,initialStateAccessor:6,metrics:10,amountLabel:0,conservation:3,projection:10,playback:[0,51],snapshotAt:2,controls:3,paused:4,playbackRate:1,rerunMS:31,seed:25,bodyRadius:1,radiusRange:9,colorBy:6,showBonds:4,showChrome:4,showProjection:4,initialSpawnPacing:10,loading:4,loadingContent:3,emptyContent:3,onStateChange:12,onCrucibleObservation:12,onDiagnostic:12,onConservation:12,onClick:12}],ProcessFlowChart:[["stages"],"array",["idAccessor","stageAccessor","groupBy","workAccessor","radiusAccessor"],["physics"],{stages:9,stageAccessor:6,idAccessor:6,groupBy:6,groupLabelAccessor:6,workAccessor:6,radiusAccessor:6,ballRadius:1,route:[0,52],groupCompletion:[0,53],groupAnchorAlong:1,showProjection:4,showChrome:4,chromeOptions:10,settle:4,gravityX:1,gravityY:1,springStiffness:1,springDamping:1,rerunMS:31,initialSpawnPacing:10,liveCapacity:4,bodyLimit:1,bodyMark:[0,54],seed:1}],PacketFlowChart:[[],"network",["nodeIdAccessor","nodeXAccessor","nodeYAccessor","sourceAccessor","targetAccessor","throughputAccessor","pathAccessor"],["common"],{size:9,background:0,legendLayout:10,nodes:9,links:9,edges:9,data:9,nodeIdAccessor:6,nodeXAccessor:6,nodeYAccessor:6,sourceAccessor:6,targetAccessor:6,throughputAccessor:6,pathAccessor:6,styleRules:9,coordinateMode:[0,55],particleRate:1,maxParticles:1,particleRadius:1,flowSpeed:1,pathConstraint:[0,56],reducedMotion:4,showStaticFlow:4,showNodeLabels:4,showSensors:4,paused:4,rerunMS:31,seed:1}],ChainReactionChart:[["data","taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor"],"array",["taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor","startAccessor","endAccessor","progressAccessor","statusAccessor","completionTimeAccessor","blockerAccessor","milestoneAccessor"],["physics"],{taskIDAccessor:6,labelAccessor:6,laneAccessor:6,dependencyAccessor:6,startAccessor:6,endAccessor:6,progressAccessor:6,statusAccessor:6,completionTimeAccessor:6,blockerAccessor:6,milestoneAccessor:6,mode:[0,57],insight:[0,58],currentTime:2,controls:20,mechanism:[0,59],orientation:[0,60],reducedMotion:[0,61],enableHover:4,seed:1,selectedTaskIDs:9,onSelectionChange:12,onObservation:12}],BigNumber:[[],"none",[],[],{width:25,height:25,className:0,chartId:0,description:0,summary:0,loading:4,loadingContent:3,emptyContent:3,value:1,label:0,caption:0,format:[6,62],locale:0,currency:0,precision:1,prefix:0,suffix:0,unit:0,comparison:10,target:10,delta:1,deltaFormat:[6,62],showDeltaPercent:4,direction:[0,63],sentiment:[0,64],thresholds:9,chartSlot:33,chartSize:1,windowSize:1,mode:[0,65],align:[0,66],padding:2,emphasis:[0,4],color:0,background:0,borderColor:0,borderRadius:25,animate:3,stalenessThreshold:1,staleLabel:0,headerSlot:33,valueSlot:33,deltaSlot:33,trendSlot:33,footerSlot:33,onClick:12,onObservation:12}]}).map(([e,[t,a,r,o,n]])=>[e,{required:[...t],dataShape:a,dataAccessors:[...r],props:Object.fromEntries(Object.entries(Object.assign({},...o.map(e=>ke[e]),n)).map(([e,t])=>[e,Re(t)]))}]));function Ne(e,t){return(Array.isArray(t)?t:[t]).includes(Array.isArray(e)?"array":typeof e)}var Te=new Set(["start","center","end","left","right"]),Ie={swatchSize:{minimum:1,label:"a positive number"},labelGap:{minimum:0,label:"a non-negative number"},itemGap:{minimum:0,label:"a non-negative number"},rowHeight:{minimum:1,label:"a positive number"},maxWidth:{minimum:1,label:"a positive number"},edgeGutter:{minimum:0,label:"a non-negative number"},sideGutter:{minimum:0,label:"a non-negative number"},axisGutter:{minimum:0,label:"a non-negative number"}};function Ee(e,t){const a=[];null!=t&&"object"==typeof t||(t={});const r=Pe[e];if(!r)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(Pe).join(", ")}`]};for(const o of r.required)null==t[o]&&a.push(`"${o}" is required for ${e}.`);"array"!==r.dataShape||!Object.prototype.hasOwnProperty.call(r.props,"data")||r.required.includes("data")||function(e,t){return"mechanical"===t.mode&&("GaltonBoardChart"===e||"UnitPileChart"===e)}(e,t)||null!=t.data||a.push(`"data" is required for ${e}.`);for(const[e,o]of Object.entries(t)){if(null==o)continue;const t=r.props[e];if(t){if(!Ne(o,t.type)){const r=Array.isArray(t.type)?t.type.join(" | "):t.type;a.push(`"${e}" should be ${r}, got ${Array.isArray(o)?"array":typeof o}.`);continue}t.enum&&"string"==typeof o&&!t.enum.includes(o)&&a.push(`"${e}" value "${o}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}const o=Object.keys(r.props),n=new Set(o);for(const r of Object.keys(t))if(void 0!==t[r]&&!n.has(r)){const t=Ae(r,o),n=t?`Unknown prop "${r}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${r}" for ${e}. Valid props: ${o.join(", ")}.`;a.push(n)}if("array"===r.dataShape){const o=t.data,n={};for(const e of r.dataAccessors){const a=t[e];"string"==typeof a&&(n[e]=a)}const i=function({componentName:e,data:t,accessors:a,requiredProps:r}){if(r)for(const[t,a]of Object.entries(r))if(null==a)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)&&"object"==typeof t)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(!Array.isArray(t)||0===t.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(a){const r=xe(t).find(e=>e&&"object"==typeof e);if(r){const t=Object.keys(r);for(const[o,n]of Object.entries(a))if(n&&"string"==typeof n&&!(n in r)){const a=we(n,t),r=a?` Try ${o}="${a}".`:"";return`${e}: ${o} "${n}" not found in data. Available fields: ${t.join(", ")}.${r}`+Ce(o)}}}return null}({componentName:e,data:o,accessors:Object.keys(n).length>0?n:void 0});i&&a.push(i)}else if("object"===r.dataShape){const r=function({componentName:e,data:t,dataLabel:a="data"}){return null==t?`${e}: No ${a} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${a} 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}({componentName:e,data:t.data});r&&a.push(r)}else if("network"===r.dataShape){const o=t.nodeIdAccessor??t.nodeIDAccessor??"id",n="string"==typeof o?{nodeIdAccessor:o}:void 0,i=function({componentName:e,nodes:t,edges:a,nodesRequired:r=!1,edgesRequired:o=!0,accessors:n}){if(null==t&&null==a)return null;if(o&&(!a||!Array.isArray(a)||0===a.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(r&&(!t||!Array.isArray(t)||0===t.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(n&&t&&t.length>0){const a=xe(t).find(e=>e&&"object"==typeof e);if(a){const t=Object.keys(a);for(const[r,o]of Object.entries(n))if(o&&"string"==typeof o&&!(o in a)){const a=we(o,t),n=a?` Try ${r}="${a}".`:"";return`${e}: ${r} "${o}" not found in node data. Available fields: ${t.join(", ")}.${n}`+Ce(r)}}}return null}({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:r.required.includes("nodes"),edgesRequired:r.required.includes("edges"),accessors:n});i&&a.push(i)}return"GaugeChart"===e&&a.push(...function(e){if(!Array.isArray(e.thresholds))return[];const t=[];return 0===e.thresholds.length&&t.push('"thresholds" for GaugeChart must contain at least one { value, color, label? } object.'),e.thresholds.forEach((e,a)=>{if(!e||"object"!=typeof e||Array.isArray(e))return void t.push(`"thresholds[${a}]" for GaugeChart should be an object with numeric "value" and string "color".`);const r=e;"number"==typeof r.value&&Number.isFinite(r.value)||t.push(`"thresholds[${a}].value" is required for GaugeChart and must be a finite number. BigNumber's "at" threshold key is not supported here.`),"string"==typeof r.color&&0!==r.color.length||t.push(`"thresholds[${a}].color" is required for GaugeChart and must be a non-empty string.`),void 0!==r.label&&"string"!=typeof r.label&&t.push(`"thresholds[${a}].label" for GaugeChart should be a string.`);const o=Object.keys(r).filter(e=>"value"!==e&&"color"!==e&&"label"!==e);o.length>0&&t.push(`"thresholds[${a}]" has unsupported GaugeChart key(s): ${o.join(", ")}. Use { value, color, label? }; { at, level } belongs to BigNumber.`)}),t}(t)),"ScatterplotMatrix"===e&&null!=t.frameProps&&a.push('"frameProps" is not supported for ScatterplotMatrix; configure its matrix props directly.'),a.push(...function(e){const t=e.frameProps;if(null==t||"object"!=typeof t||Array.isArray(t))return[];const a=t.legendLayout;if(null==a||"object"!=typeof a||Array.isArray(a))return null==a?[]:['"frameProps.legendLayout" should be object, got '+(Array.isArray(a)?"array":typeof a)+"."];const r=[],o=a,n=new Set(["align",...Object.keys(Ie)]);for(const e of Object.keys(o))n.has(e)||r.push(`Unknown "frameProps.legendLayout" key "${e}". Valid keys: ${[...n].join(", ")}.`);void 0!==o.align&&"string"!=typeof o.align?r.push(`"frameProps.legendLayout.align" should be string, got ${Array.isArray(o.align)?"array":typeof o.align}.`):"string"!=typeof o.align||Te.has(o.align)||r.push(`"frameProps.legendLayout.align" value "${o.align}" is not valid. Expected one of: ${[...Te].join(", ")}.`);for(const[e,t]of Object.entries(Ie)){const a=o[e];void 0!==a&&("number"==typeof a&&Number.isFinite(a)?t.minimum>a&&r.push(`"frameProps.legendLayout.${e}" should be ${t.label} (minimum ${t.minimum}), got ${a}.`):r.push(`"frameProps.legendLayout.${e}" should be ${t.label}, got ${Array.isArray(a)?"array":typeof a}.`))}return r}(t)),{valid:0===a.length,errors:a}}function Me(e){return null==e?null:e.data??e.datum??e}require("d3-interpolate");var Le=80,Oe=100;function ze(e,t={}){const a=[],r=e.tokenSemantics,o=e.countStrategy,n=t.maxRecommendedTokens??("fixed-denominator"!==o||function(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}(e.denominator)>Oe?Le:Oe);return r||a.push({code:"TOKEN_SEMANTICS_UNCLEAR",severity:"warning",message:"Every tokenized encoding should state what one token represents."}),o||a.push({code:"MISSING_COUNT_STRATEGY",severity:"warning",message:"Every tokenized encoding should state how token counts are produced."}),"icon"!==e.tokenType&&"glyph"!==e.tokenType||"icon-only"!==e.labelPolicy&&"token-only"!==e.labelPolicy||a.push({code:"ICON_ONLY_LABELS",severity:"warning",message:"Icons should supplement text labels, not replace them."}),null!=t.visibleTokens&&t.visibleTokens>n&&a.push({code:"TOO_MANY_VISIBLE_TOKENS",severity:"warning",message:`This encoding renders ${t.visibleTokens} visible tokens. Consider unitizing, sampling, or a hybrid bar/token view.`}),"decorative"!==r||"icon"!==e.tokenType&&"glyph"!==e.tokenType||a.push({code:"DECORATIVE_PICTOGRAPHS",severity:"warning",message:"Decorative pictographs can harm recall and speed when they do not clarify the data."}),"unitized-measure"===r&&o&&"unitized"!==o&&a.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Unitized measures should use the unitized count strategy so each token has a stable value."}),"risk-case"===r&&o&&"fixed-denominator"!==o&&a.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Risk cases are usually clearest as a fixed-denominator natural frequency."}),"possible-outcome"!==r&&"posterior-sample"!==r&&"hypothetical-case"!==r||!o||"quantile"===o||"sample"===o||"posterior-sample"===o||"random-sample"===o||a.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Outcome/sample tokens should come from quantiles or samples, not from a unitized magnitude."}),"unitized-measure"===r&&"unitized"===o&&null==e.unitValue&&null==e.unit&&a.push({code:"MISSING_UNIT_VALUE",severity:"warning",message:"Unitized measures should set unitValue so each token has a declared value."}),"unitized-measure"!==r||"unitized"!==o||e.unitMeaning||a.push({code:"MISSING_UNIT_MEANING",severity:"info",message:"Add unitMeaning so readers know what one full token represents."}),a}var _e=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Fe=new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),je=new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),Be=new Set(["LineChart","AreaChart","StackedAreaChart"]),De=new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]),Ue=new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),Ge=new Set(["PieChart","DonutChart"]),He={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},Ve=new Set(Object.keys(He)),We={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},qe=new Set(["BigNumber"]),Ye=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),Ke=new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),Xe=new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),Je=new Set(["OrbitDiagram",...Xe]),Ze=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),Qe=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),et=new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),tt=new Set(["MultiAxisLineChart"]),at=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),rt={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},ot=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),nt=new Set(["label","callout","callout-circle","callout-rect"]);function it(e){return"string"==typeof e?.type?e.type:""}function st(e){return!!e&&"object"==typeof e&&ot.has(it(e))}function lt(e){return nt.has(it(e))&&!function(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}(e)}var ct=2e4;function ut(e){const t=e.provenance,a=e.id??e.stableId??t?.stableId;return null==a||""===a?void 0:a+""}var dt=120,ht=250;var pt=["xExtent","yExtent","rExtent"],mt=8;function ft(e){const t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:null}function gt(e,t,a){if("function"==typeof t)return t(e);const r="string"==typeof t?t:a;return e?.[r]}var yt=/^\d{4}-\d{1,2}$/;function bt(e,t){const a=e.nestedDataAccessorProp?t[e.nestedDataAccessorProp]:void 0;return"string"==typeof a?a:e.defaultNestedDataAccessor}function vt(e,t,a){const r=e.dataProp??"data",o=t[r],n=a??(Array.isArray(o)?o:[]),i=bt(e,t);if(!i)return{dataProp:r,rows:n};const s=[];let l=!1;for(const e of n){const t=e?.[i];if(Array.isArray(t)){l=!0;for(const e of t)e&&"object"==typeof e&&s.push(e)}}return{dataProp:r,rows:l?s:n}}var At=[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"y",accessor:"yAccessor",defaultAccessor:"y",domain:!0}],xt={fields:At},wt=[{...At[0],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates"},{...At[1],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates",allowMissing:!0}],Ct={fields:wt},$t={role:"value",accessor:"valueAccessor",defaultAccessor:"value"},St={...$t,domain:!0},kt={fields:[{...$t,requirements:["finite","non-negative"]}],aggregates:[{kind:"positive-total",role:"value"}]},Rt={fields:[$t],aggregates:[{kind:"normalized-total",role:"value",groupAccessor:"categoryAccessor",defaultGroupAccessor:"category",whenProp:"normalize"}]},Pt={fields:wt,aggregates:[{kind:"normalized-total",role:"y",groupAccessor:"xAccessor",defaultGroupAccessor:"x",whenProp:"normalize"}]},Nt={fields:[...At,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Tt={fields:[...At,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},It={fields:[$t]},Et={fields:[{...$t,dataProp:"edges",requirements:["finite","non-negative"],missingValue:1}]},Mt={LineChart:Ct,AreaChart:Ct,BumpChart:Ct,Scatterplot:Tt,ConnectedScatterplot:xt,QuadrantChart:Tt,MinimapChart:Ct,BubbleChart:Nt,StackedAreaChart:Pt,DifferenceChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date",domain:!0},{role:"value",accessor:"seriesAAccessor",defaultAccessor:"a"},{role:"value",accessor:"seriesBAccessor",defaultAccessor:"b"}]},CandlestickChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"high",accessor:"highAccessor",defaultAccessor:"high",requirements:["finite"]},{role:"low",accessor:"lowAccessor",defaultAccessor:"low",requirements:["finite"]},{role:"open",accessor:"openAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]},{role:"close",accessor:"closeAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]}]},Heatmap:It,BarChart:{fields:[$t]},GroupedBarChart:{fields:[$t]},StackedBarChart:Rt,DotPlot:{fields:[St]},Histogram:{fields:[St]},BoxPlot:{fields:[St]},SwarmPlot:{fields:[St,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ViolinPlot:{fields:[St]},RidgelinePlot:{fields:[St]},PieChart:kt,DonutChart:kt,FunnelChart:kt,SankeyDiagram:Et,ChordDiagram:Et,ProportionalSymbolMap:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"lon",dataProp:"points",requirements:["finite"]},{role:"y",accessor:"yAccessor",defaultAccessor:"lat",dataProp:"points",requirements:["finite"]},{role:"size",accessor:"sizeBy",dataProp:"points",requirements:["finite","non-negative"]}]}},Lt=Symbol.for("semiotic.numericContractRegistry");function Ot(e,t){const a={numbers:[],missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(const r of e){const e=r?.[t];if(null==e||""===e){a.missing++;continue}let o;if("number"==typeof e)o=e;else if("string"==typeof e){const t=e.trim();if(""===t){a.missing++;continue}const r=Number(t);Number.isNaN(r)?/^[+-]?nan$/i.test(t)&&(o=r):o=r}void 0!==o?Number.isFinite(o)?(a.numbers.push(o),0===o&&a.zero++,0>o&&a.negative++,Number.isInteger(o)||a.fractional++):a.nonFinite++:a.nonNumeric++}return a}function zt(e,t){if(0===e.length)return;const a=(e.length-1)*t,r=Math.floor(a),o=Math.ceil(a);if(r===o)return e[r];const n=a-r;return e[r]*(1-n)+e[o]*n}function _t(e,t={}){if(!Array.isArray(e)||0===e.length)return{};const a=new Set;for(const t of e)if(t&&"object"==typeof t)for(const e of Object.keys(t))a.add(e);const r={};for(const o of a){const a=Ot(e,o);let n=1/0,i=-1/0;for(const e of a.numbers)n>e&&(n=e),e>i&&(i=e);const s=!1===t.quantiles?void 0:[...a.numbers].sort((e,t)=>e-t);r[o]={field:o,observedCount:e.length-a.missing,finiteCount:a.numbers.length,missingCount:a.missing,nonFiniteCount:a.nonFinite,nonNumericCount:a.nonNumeric,zeroCount:a.zero,negativeCount:a.negative,fractionalCount:a.fractional,...a.numbers.length>0?{min:n,...s?{q1:zt(s,.25),median:zt(s,.5),q3:zt(s,.75)}:{},max:i}:{}}}return r}function Ft(e){const t=[`${e.component}: ${e.ok?"✓ numerically safe":"✗ numeric hazards found"}`,`${e.rowCount} rows · ${e.summary.fieldsChecked} numeric fields · ${e.summary.errors} errors · ${e.summary.warnings} warnings`];for(const a of e.diagnoses)t.push(`${"error"===a.severity?"ERROR":"WARN"} ${a.code}${a.field?` [${a.field}]`:""}: ${a.message}`),a.fix&&t.push(" Fix: "+a.fix);return t.join("\n")}function jt(e){return e.code.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Bt(e,t={}){const a=Number.isFinite(t.max)?Math.max(0,Math.floor(t.max)):6,r=e.diagnoses.map((e,t)=>({item:e,diagnosisIndex:t})).filter(({item:e})=>!t.errorsOnly||"error"===e.severity),o=r.slice(0,a).map(({item:e,diagnosisIndex:t})=>({id:`data-audit:${e.code}:${e.role??"chart"}:${e.field??"chart"}:${t}`,level:e.severity,title:e.field?`${jt(e)} · ${e.field}`:jt(e),message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic data audit",dismissible:!0}));return r.length>a&&o.push({id:"data-audit:overflow:chart",level:r.slice(a).some(({item:e})=>"error"===e.severity)?"error":"warning",title:`${r.length-a} more numeric finding${r.length-a===1?"":"s"}`,message:"Run auditData() or diagnoseConfig() to inspect the complete report.",source:"Semiotic data audit",dismissible:!0}),o}var Dt=5,Ut={xAccessor:"x",yAccessor:"y",valueAccessor:"value",sizeBy:"size",sizeAccessor:"size",radiusAccessor:"size",countAccessor:"count",amountAccessor:"value",highAccessor:"high",lowAccessor:"low",openAccessor:"open",closeAccessor:"close",lowerAccessor:"lower",upperAccessor:"upper",positiveAccessor:"value",negativeAccessor:"value",progressAccessor:"value",confidenceAccessor:"value",costAccessor:"value",throughputAccessor:"value"};function Gt(e,t,a){return"function"==typeof e?e(t,a):t[e]}function Ht(e,t){if("number"==typeof e)return Number.isFinite(e)?e:null;if(e instanceof Date){const a=e.getTime();return t&&Number.isFinite(a)?a:null}if("string"==typeof e){const a=e.trim(),r=Number(a);if(a&&Number.isFinite(r))return r;if("date-like"===t){const e=function(e){const t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;const a=yt.test(t)?t+"-01":t;if(a===t&&10>t.length)return NaN;const r=Date.parse(a);return Number.isFinite(r)?r:NaN}(a);return Number.isFinite(e)?e:null}}return null}function Vt(e){return"number"==typeof e&&!Number.isFinite(e)}function Wt(e,t,a,r,o){const n={field:a,numbers:[],finiteRows:[],missingRows:[],nonFiniteRows:[],nonNumericRows:[],accessorErrorRows:[],zeroRows:[],negativeRows:[],fractionalRows:[]};for(let a=0;e.length>a;a++){let i;try{i=Gt(t,e[a],a)}catch{n.accessorErrorRows.push(a);continue}if(null==i||""===i){if(void 0!==o){n.numbers.push(o),n.finiteRows.push(a),0===o&&n.zeroRows.push(a),0>o&&n.negativeRows.push(a),Number.isInteger(o)||n.fractionalRows.push(a);continue}n.missingRows.push(a);continue}const s=Ht(i,r);null!=s?(n.numbers.push(s),n.finiteRows.push(a),0===s&&n.zeroRows.push(a),0>s&&n.negativeRows.push(a),Number.isInteger(s)||n.fractionalRows.push(a)):Vt(i)?n.nonFiniteRows.push(a):n.nonNumericRows.push(a)}return n}function qt(e,t){const a=new Set(e.requirements??["finite"]);return a.add("finite"),("x"===e.role&&"log"===t.xScaleType||"y"===e.role&&"log"===t.yScaleType)&&a.add("positive"),[...a]}function Yt(e){return e.slice(0,Dt)}function Kt(e){return{domain:"data",...e}}function Xt(e,t){const a=[],{observation:r,contract:o,accessorLabel:n,requirements:i}=e,s={field:n,role:o.role},l=[...r.nonFiniteRows,...r.nonNumericRows,...r.accessorErrorRows].sort((e,t)=>e-t);if(0===r.numbers.length)return a.push(Kt({severity:"error",code:"DEGENERATE_EXTENT",message:`${o.accessor}="${n}" produces no finite numeric values; the chart cannot resolve its ${o.role} input.`,fix:`Ensure ${n} contains finite numbers${"x"===o.role?" (or valid dates for a time scale)":""}.`,...s,...l.length>0?{rows:Yt(l),count:l.length}:{}})),a;r.nonFiniteRows.length>0&&a.push(Kt({severity:"error",code:"NON_FINITE_VALUE",message:`${n} contains ${r.nonFiniteRows.length} NaN or infinite value${1===r.nonFiniteRows.length?"":"s"}; scale and layout math require finite numbers.`,fix:`Filter or replace NaN/Infinity in ${n} before rendering.`,...s,rows:Yt(r.nonFiniteRows),count:r.nonFiniteRows.length})),!o.allowMissing&&r.missingRows.length>0&&a.push(Kt({severity:"error",code:"MISSING_NUMERIC_VALUE",message:`${n} is missing for ${r.missingRows.length} row${1===r.missingRows.length?"":"s"}; the ${o.role} role requires an explicit numeric value.`,fix:`Fill or filter missing ${n} values before rendering.`,...s,rows:Yt(r.missingRows),count:r.missingRows.length}));const c=[...r.nonNumericRows,...r.accessorErrorRows].sort((e,t)=>e-t);if(c.length>0&&a.push(Kt({severity:"error",code:"NON_NUMERIC_VALUE",message:`${n} produces ${c.length} non-numeric value${1===c.length?"":"s"} for the ${o.role} role.`,fix:`Bind ${o.accessor} to a numeric field or return finite numbers from the accessor.`,...s,rows:Yt(c),count:c.length})),o.domain&&r.numbers.length>=2){const[e,t]=function(e){let t=1/0,a=-1/0;for(const r of e)t>r&&(t=r),r>a&&(a=r);return[t,a]}(r.numbers);e===t&&a.push(Kt({severity:"warning",code:"ZERO_SPAN_DOMAIN",message:`${n} is constant at ${e}; its ${o.role} scale has a zero-span data domain.`,fix:`Provide varying ${o.role} values, set an explicit extent around ${e}, or use a single-value display.`,...s,rows:Yt(r.finiteRows),count:r.finiteRows.length}))}if(i.includes("positive")){const t=r.numbers.map((e,t)=>({number:e,row:r.finiteRows[t]})).filter(({number:e})=>0>=e).map(({row:e})=>e);if(t.length>0){const r=e.logScale;a.push(Kt({severity:"error",code:r?"LOG_NON_POSITIVE":"NON_POSITIVE_VALUE",message:`${n} contains ${t.length} non-positive value${1===t.length?"":"s"}, which ${r?"cannot be represented on a log scale":"violate the positive-value contract"}.`,fix:r?"Remove or transform values ≤ 0, or use a linear/symlog scale.":"Provide values greater than zero.",...s,rows:Yt(t),count:t.length}))}}if(i.includes("non-negative")&&r.negativeRows.length>0&&a.push(Kt({severity:"error",code:"size"===o.role?"NEGATIVE_SIZE":"NEGATIVE_VALUE",message:`${n} contains ${r.negativeRows.length} negative ${o.role} value${1===r.negativeRows.length?"":"s"}; the chart maps this role to non-negative geometry.`,fix:"Use a non-negative measure, clamp intentionally, or encode sign with position/color instead.",...s,rows:Yt(r.negativeRows),count:r.negativeRows.length})),i.includes("integer")){const e=[...new Set([...r.negativeRows,...r.zeroRows,...r.fractionalRows])].sort((e,t)=>e-t);e.length>0&&a.push(Kt({severity:"error",code:"INVALID_COUNT",message:`${n} contains ${e.length} value${1===e.length?"":"s"} that are not positive integers.`,fix:"Counts must be integers ≥ 1; aggregate, round intentionally, or use a continuous-value encoding.",...s,rows:Yt(e),count:e.length}))}if(i.includes("unit-interval")){const e=r.numbers.map((e,t)=>({number:e,row:r.finiteRows[t]})).filter(({number:e})=>0>e||e>1).map(({row:e})=>e);e.length>0&&a.push(Kt({severity:"error",code:"OUTSIDE_UNIT_INTERVAL",message:`${n} contains ${e.length} value${1===e.length?"":"s"} outside [0, 1].`,fix:`Normalize ${n} to [0, 1] before using it as ${o.role}.`,...s,rows:Yt(e),count:e.length}))}if(t&&o.domain){const t=function(e){const t=e.observation.numbers.map((t,a)=>({value:t,row:e.observation.finiteRows[a]})).sort((e,t)=>e.value-t.value);if(8>t.length)return[];const a=t.map(e=>e.value),r=zt(a,.25),o=zt(a,.75),n=zt(a,.5),i=o-r;if(i>0){const e=r-10*i,a=o+10*i;return t.filter(t=>e>t.value||t.value>a).map(e=>e.row)}const s=100*Math.max(1,Math.abs(n));return t.filter(e=>Math.abs(e.value-n)>s).map(e=>e.row)}(e);t.length>0&&a.push(Kt({severity:"warning",code:"OUTLIER_DOMINATED_DOMAIN",message:`${n} has ${t.length} extreme value${1===t.length?"":"s"} beyond the 10×IQR guardrail; the main distribution may collapse visually.`,fix:"Verify the extreme values, then consider a log scale, robust extent, inset, or explicit annotation rather than silently clipping them.",...s,rows:Yt(t),count:t.length}))}return a}function Jt(e,t,a){if(!e)return"__all__";try{return Gt(e,t,a)+""}catch{return"__accessor_error__"}}function Zt(e,t,a){if(e.whenProp&&!0!==a[e.whenProp])return[];const r=t.find(t=>t.contract.role===e.role);if(!r||0===r.observation.numbers.length)return[];const o=e.groupAccessor?a[e.groupAccessor]:void 0,n="string"==typeof o||"function"==typeof o?o:e.defaultGroupAccessor,i=new Map;for(let e=0;r.rows.length>e;e++){let t;try{t=Gt(r.accessor,r.rows[e],e)}catch{continue}const a=Ht(t,void 0);if(null==a)continue;const o=Jt(n,r.rows[e],e),s=i.get(o)??{sum:0,magnitude:0,positive:!1,negative:!1,rows:[],negativeRows:[]};s.sum+=a,s.magnitude+=Math.abs(a),s.positive||(s.positive=a>0),s.negative||(s.negative=0>a),s.rows.push(e),0>a&&s.negativeRows.push(e),i.set(o,s)}const s=[],l=[],c=[],u=[],d=[],h=[];for(const[t,a]of i)("positive-total"===e.kind&&0>=a.sum||"normalized-total"===e.kind&&Number.EPSILON*Math.max(1,a.magnitude)*10>=Math.abs(a.sum))&&(s.push(t),u.push(...a.rows)),"normalized-total"===e.kind&&a.positive&&a.negative&&(l.push(t),d.push(...a.rows)),"normalized-total"===e.kind&&a.negative&&(c.push(t),h.push(...a.negativeRows));const p=[];return s.length>0&&p.push(Kt({severity:"error",code:"normalized-total"===e.kind?"ZERO_NORMALIZED_TOTAL":"NON_POSITIVE_TOTAL",message:"normalized-total"===e.kind?`${s.length} normalization group${1===s.length?" has":"s have"} a zero total, so division would be undefined.`:"The part-to-whole total is not positive, so meaningful shares cannot be computed.",fix:"normalized-total"===e.kind?"Remove empty/zero-sum groups or disable normalization.":"Provide at least one positive value and ensure the total is greater than zero.",field:r.accessorLabel,role:e.role,rows:Yt([...new Set(u)].sort((e,t)=>e-t)),count:s.length})),c.length>0&&p.push(Kt({severity:"error",code:"NEGATIVE_NORMALIZED_VALUE",message:`${c.length} normalization group${1===c.length?" contains":"s contain"} negative contributions, so conventional percentage shares are not defined.`,fix:"Use non-negative contributions, a diverging stack, or disable normalization.",field:r.accessorLabel,role:e.role,rows:Yt([...new Set(h)].sort((e,t)=>e-t)),count:h.length})),l.length>0&&p.push(Kt({severity:"warning",code:"MIXED_SIGN_NORMALIZATION",message:`${l.length} normalization group${1===l.length?" mixes":"s mix"} positive and negative contributions; percentage shares may be unstable or misleading.`,fix:"Separate positive and negative contributions, use diverging stacks, or disable normalization.",field:r.accessorLabel,role:e.role,rows:Yt([...new Set(d)].sort((e,t)=>e-t)),count:l.length})),p}function Qt(e,t,a,r={}){const o=r.contracts??function(e){return function(){const e=globalThis;return e[Lt]??(e[Lt]={contracts:new Map}),e[Lt]}().contracts.get(e)??Mt[e]}(e)??function(e){const t=[];for(const[a,r]of Object.entries(Ut))"string"!=typeof e[a]&&"function"!=typeof e[a]||t.push({role:r,accessor:a,..."size"===r?{requirements:["finite","non-negative"]}:{},..."x"===r||"y"===r?{domain:!0}:{}});return t.length>0?{fields:t}:void 0}(t);if(!o)return{component:e,ok:!0,rowCount:a?.length??(Array.isArray(t.data)?t.data.length:0),summary:{fieldsChecked:0,errors:0,warnings:0},contracts:[],diagnoses:[]};const n=function(e,t,a){const r=[],o=new Set;for(const n of e.fields){if(n.whenProps?.some(e=>null==t[e]))continue;const e=t[n.accessor],i="string"==typeof e||"function"==typeof e?e:n.defaultAccessor;if("string"!=typeof i&&"function"!=typeof i)continue;const{dataProp:s,rows:l}=vt(n,t,a);if(0===l.length)continue;const c="string"==typeof i?i:n.accessor+"()",u=`${s}:${n.role}:${c}`;if(o.has(u))continue;o.add(u);const d=n.temporalValues??("time"===n.role||"x"===n.role&&"time"===t.xScaleType?"date-like":void 0),h="x"===n.role&&"log"===t.xScaleType||"y"===n.role&&"log"===t.yScaleType,p=qt(n,t);r.push({contract:n,accessor:i,accessorLabel:c,dataProp:s,rows:l,requirements:p,logScale:h,observation:Wt(l,i,c,d,n.missingValue)})}return r}(o,t,a),i=[],s=!1!==r.checkOutliers;for(const e of function(e,t,a){const r=new Set;for(const o of e.fields){const e=o.dataProp??"data",n=a??t[e];if(!Array.isArray(n))continue;if(0===n.length){r.add(e);continue}const i=bt(o,t);if(!i)continue;const s=n.map(e=>e?.[i]).filter(Array.isArray);s.length>0&&s.every(e=>0===e.length)&&r.add(`${e}.${i}`)}return[...r]}(o,t,a))i.push(Kt({severity:"error",code:"EMPTY_DATA",message:e+" is an explicitly empty array; there are no numeric inputs to render.",fix:`Provide at least one valid row, render an intentional empty state, or omit ${e} when using the ref push API.`,count:0,rows:[]}));const l=new Set(n.filter(e=>e.contract.domain&&1===e.rows.length).map(e=>e.dataProp));for(const e of l)i.push(Kt({severity:"warning",code:"SINGLE_ROW_DOMAIN",message:e+" has one row; a quantitative scale cannot establish variation from a single observation.",fix:"Provide at least two observations or use a single-value display such as BigNumber.",count:1,rows:[0]}));for(const e of n)i.push(...Xt(e,s));for(const e of o.aggregates??[])i.push(...Zt(e,n,t));const c=i.filter(e=>"error"===e.severity).length,u=i.length-c;return{component:e,ok:0===c,rowCount:n.reduce((e,t)=>Math.max(e,t.rows.length),a?.length??(Array.isArray(t.data)?t.data.length:0)),summary:{fieldsChecked:n.length,errors:c,warnings:u},contracts:n.map(e=>({role:e.contract.role,accessor:e.accessorLabel,dataProp:e.dataProp,requirements:e.requirements,allowMissing:!0===e.contract.allowMissing,...void 0!==e.contract.missingValue?{missingValue:e.contract.missingValue}:{},domain:!0===e.contract.domain})),diagnoses:i}}var ea=new Set(["category10","tableau10","set3","blues","reds","greens","oranges","purples","greys","viridis","plasma","inferno","magma","cividis","turbo"]),ta=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIdAccessor","nodeIDAccessor","childrenAccessor","costAccessor"];function aa(e){return"object"==typeof e&&null!==e&&("tokenType"in e||"tokenSemantics"in e||"countStrategy"in e||"unitValue"in e||"unit"in e)}function ra(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function oa(e,t){const a=ra(e.visibleTokens);if(null!=a)return a;const r=ra(t.denominator);if("fixed-denominator"===t.countStrategy&&null!=r)return r;const o=ra(t.tokenCount),n=ra(t.maxTokens);return null!=o&&null!=n?Math.min(o,n):o??r??n}function na(e,t){const a=t.match(/^Unknown prop "([^"]+)"/);if(a)return`Remove \`${a[1]}\` or replace it with a documented ${e} prop.`;const r=t.match(/^"([^"]+)" is required for .+\.$/i)??t.match(/(?:Missing|required) prop "?([^". ]+)/i);return r?`Add the required \`${r[1]}\` prop using the ${e} schema and example.`:t.startsWith("Unknown component")?"Choose a component returned by getSchema() or check the component name for a typo.":`Correct this ${e} prop configuration to match its schema: ${t}`}function ia(e,t){const a=[],r=Ee(e,function(e){const t={...e};return delete t.tokenEncoding,delete t.visibleTokens,aa(t.encoding)&&delete t.encoding,t}(t));for(const o of r.errors)"BigNumber"===e&&void 0!==t.accessibleTable&&o.startsWith('Unknown prop "accessibleTable"')||a.push({severity:"error",code:"VALIDATION",message:o,fix:na(e,o)});if("BigNumber"===e&&function(e,t){void 0!==e.accessibleTable&&t.push({severity:"error",code:"BIGNUMBER_ACCESSIBLE_TABLE",message:"BigNumber is a value component and does not support accessibleTable.",fix:"Remove accessibleTable. Use label, description, and summary to provide BigNumber's accessible text."})}(t,a),!Pe[e])return{ok:0===a.length,diagnoses:a};!function(e,t,a){const r=Pe[e];if(r){if("array"===r.dataShape){const e=t.data;e&&Array.isArray(e)&&0===e.length&&a.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===r.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&a.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}}(e,t,a),function(e,t,a){const r=t.width,o=t.height;if(void 0===r||"number"==typeof r&&r>0||a.push({severity:"error",code:"BAD_WIDTH",message:`width=${JSON.stringify(r)} — chart needs a positive number.`,fix:"Set width={600} or use responsiveWidth={true}."}),void 0===o||"number"==typeof o&&o>0||a.push({severity:"error",code:"BAD_HEIGHT",message:`height=${JSON.stringify(o)} — chart needs a positive number.`,fix:"Set height={400} or use responsiveHeight={true}."}),t.size&&Array.isArray(t.size)){const[e,r]=t.size;(null!=e&&0>=e||null!=r&&0>=r)&&a.push({severity:"error",code:"BAD_SIZE",message:`size=[${e}, ${r}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}(0,t,a),function(e,t,a){const r=Pe[e];if(!r||"array"!==r.dataShape)return;const o=t.data;if(!o||!Array.isArray(o)||0===o.length)return;const n=o[0];if(!n||"object"!=typeof n)return;const i=Object.keys(n);for(const e of r.dataAccessors){const r=t[e];"string"==typeof r&&(r in n||a.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${r}" not found in data. Available fields: ${i.join(", ")}.`,fix:`Change ${e} to one of: ${i.map(e=>`"${e}"`).join(", ")}, or use a function: ${e}={d => d.myValue}.`}))}}(e,t,a),function(e,t,a){_e.has(e)&&Array.isArray(t.data)&&a.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:e+" expects hierarchical data but received a flat array.",fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}(e,t,a),function(e,t,a){Fe.has(e)&&(t.edges||t.data||a.push({severity:"error",code:"NETWORK_NO_EDGES",message:e+" requires an edges prop.",fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'}))}(e,t,a),function(e,t,a){const r=Pe[e];if(!r||"array"!==r.dataShape)return;const o=t.data;if(!o||!Array.isArray(o)||0===o.length)return;const n=o[0];if(!n||"object"!=typeof n)return;const i=t.xAccessor;"string"==typeof i&&n[i]instanceof Date&&!t.xFormat&&a.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${i}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}(e,t,a),function(e,t,a){t.linkedHover&&!t.selection&&a.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}(0,t,a),function(e,t,a){if(!je.has(e))return;const r=t.rExtent||t.yExtent||t.valueExtent;r&&Array.isArray(r)&&r.length>=1&&null!=r[0]&&0!==r[0]&&a.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${r[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${r[1]??"auto"}]}. For trend-focused charts, use LineChart instead.`})}(e,t,a),function(e,t,a){if(!Be.has(e))return;if(t.gapStrategy)return;const r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;const o=t.yAccessor||"y";"string"==typeof o&&r.some(e=>{const t=e[o];return null==t||Number.isNaN(t)})&&a.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${o}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}(e,t,a),function(e,t,a){const r=t.width??600,o=t.height??400,n=t.margin;if(!n||"object"!=typeof n)return;const i=(n.left||0)+(n.right||0),s=(n.top||0)+(n.bottom||0);r>i||a.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${i}px) >= width (${r}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),o>s||a.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${s}px) >= height (${o}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}(0,t,a);const o=Qt(e,t,void 0,{checkOutliers:!1}).diagnoses;for(const e of o)"EMPTY_DATA"===e.code&&a.some(e=>"EMPTY_DATA"===e.code||"EMPTY_EDGES"===e.code)||a.push(e);if(function(e,t,a){if(!De.has(e))return;const r=t.barPadding;"number"==typeof r&&10>r&&a.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${r} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}(e,t,a),function(e,t,a){if("Heatmap"!==e)return;const r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;const o=r[0];if(o&&"object"==typeof o)for(const e of["xAccessor","yAccessor"]){const r=t[e];if("string"!=typeof r)continue;const n=o[r];"string"==typeof n&&a.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${r}" resolves to string values (e.g. "${n}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}(e,t,a),function(e,t,a){const r=t.colorScheme;if(!r||!Array.isArray(r))return;const o="string"==typeof t.background?t.background:"#ffffff";if(!o.startsWith("#"))return;const n=[];for(const e of r){if("string"!=typeof e||!e.startsWith("#"))continue;const t=I(e,o);null!==t&&3>t&&n.push(`${e} (${t.toFixed(1)}:1)`)}n.length>0&&a.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${n.length} color(s) in colorScheme have < 3:1 contrast against background "${o}": ${n.join(", ")}. Data marks may be hard to see.`,fix:'Use darker colors on light backgrounds or lighter colors on dark backgrounds. Import COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for an accessible preset.'})}(0,t,a),function(e,t,a){const r=t.colorScheme;if(!r||!Array.isArray(r)||2>r.length)return;const o=r.filter(e=>"string"==typeof e&&e.startsWith("#"));if(2>o.length)return;const n=[];for(let e=0;o.length-1>e;e++){const t=I(o[e],o[e+1]);null!==t&&1.5>t&&n.push(`${o[e]} / ${o[e+1]} (${t.toFixed(1)}:1)`)}n.length>0&&a.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${n.length} adjacent color pair(s) in colorScheme have very similar luminance: ${n.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}(0,t,a),function(e,t,a){const r=t.colorScheme;if("string"!=typeof r)return;const o=Pe[e];o?.props?.colorScheme?.enum||ea.has(r)||a.push({severity:"warning",code:"UNKNOWN_COLOR_SCHEME",message:`colorScheme "${r}" is not a recognized named scheme — the chart will fall back to the default palette.`,fix:`Use a known scheme name (${[...ea].join(", ")}) or pass an explicit color array, e.g. colorScheme={["#1f77b4", "#ff7f0e"]}.`})}(e,t,a),function(e,t,a){const r=Pe[e]?.props,o=e=>!!r?.[e]&&"string"==typeof t[e]&&t[e].trim().length>0,n=o("title"),i=o("description"),s=o("summary");n||i||s||a.push({severity:"warning",code:"MISSING_DESCRIPTION",message:"No title, description, or summary provided. Screen readers will fall back to a generic chart-type label.",fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}(e,t,a),function(e,t,a){const r=[];for(const e of ta)"function"==typeof t[e]&&r.push(e);r.length>0&&a.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${r.length>1?"s":""} detected: ${r.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference; closures over changing values can force unnecessary scene rebuilds on resize/rotation.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}(0,t,a),function(e,t,a){const r=t.hoverRadius;"number"==typeof r&&r>0&&24>r&&!1!==t.enableHover&&(!1!==t.hoverAnnotation||t.tooltip||t.customHoverBehavior||t.customClickBehavior||t.onClick)&&a.push({severity:"warning",code:"TOUCH_TARGET_SMALL",message:`hoverRadius=${r}px is below the ~24px radius needed for reliable 48px touch targets on mobile screens.`,fix:"Use hoverRadius={24} or larger for touch-heavy views. Semiotic floors touch pointer hit testing to 24px, but explicit desktop-only radii should be documented."})}(0,t,a),function(e,t,a){!0===t.responsiveWidth&&!0===t.responsiveHeight&&a.push({severity:"warning",code:"RESPONSIVE_BOTH_AXES",message:"responsiveWidth and responsiveHeight are both true. On mobile this can create resize feedback loops when the parent height depends on chart content.",fix:"Prefer responsiveWidth={true} with a fixed parent height or size={[width, fixedHeight]}; use a ResizeObserver outside the chart if the height must follow aspect ratio."})}(0,t,a),function(e,t,a){if(!0!==t.showParticles)return;const r=t.particleStyle&&"object"==typeof t.particleStyle?t.particleStyle:{},o="number"==typeof r.maxPerLine?r.maxPerLine:void 0,n="number"==typeof r.spawnRate?r.spawnRate:void 0;("number"==typeof o&&o>20||"number"==typeof n&&n>.08)&&a.push({severity:"warning",code:"GEO_PARTICLE_MOBILE_COST",message:"Animated geo particles run a continuous canvas loop that can drain battery and trigger thermal throttling on mobile GPUs.",fix:"Set particleStyle={{ maxPerLine: 12, spawnRate: 0.06 }} for mobile-heavy views, or disable showParticles when reduced-motion or low-power modes are active."})}(0,t,a),function(e,t,a){const r=[];aa(t.tokenEncoding)&&r.push({source:"tokenEncoding",encoding:t.tokenEncoding}),aa(t.encoding)&&r.push({source:"encoding",encoding:t.encoding});for(const{source:e,encoding:o}of r){const r=oa(t,o);for(const t of ze(o,{visibleTokens:r}))a.push({severity:"warning",code:"TOKEN_"+t.code,message:t.message,fix:"MISSING_UNIT_VALUE"===t.code?`Set ${e}.unitValue to the value represented by one full token.`:"MISSING_UNIT_MEANING"===t.code?`Set ${e}.unitMeaning so readers know what one full token represents.`:"MISSING_COUNT_STRATEGY"===t.code?`Set ${e}.countStrategy to actual, unitized, fixed-denominator, quantile, sample, posterior-sample, or random-sample.`:"TOKEN_SEMANTICS_UNCLEAR"===t.code?`Set ${e}.tokenSemantics to observed-unit, unitized-measure, risk-case, possible-outcome, posterior-sample, hypothetical-case, topic-anchor, or decorative.`:`Adjust ${e} so its semantics, strategy, labels, and visible token count match the task.`})}}(0,t,a),function(e,t,a){const r=Array.isArray(t.annotations)?t.annotations:null;if(r)for(const e of r){if(!e||"object"!=typeof e)continue;const t=it(e);if(!st(e)||"widget"===t)continue;const r=Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0),o="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,n=lt(e);!n&&r>dt?a.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${o}" sits ~${Math.round(r)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):n&&r>ht&&a.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${o}" uses a very long connector (~${Math.round(r)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}(0,t,a),function(e,t,a){const r=Array.isArray(t.annotations)?t.annotations:null;if(!r)return;const o=r.filter(st).length;if(0===o)return;const n="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400,s=function(e,t,a={}){return"number"==typeof a.maxAnnotations&&Number.isFinite(a.maxAnnotations)?Math.max(0,Math.floor(a.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(a.areaPerAnnotation&&a.areaPerAnnotation>0?a.areaPerAnnotation:ct))):1/0}(n,i);Number.isFinite(s)&&o>s&&a.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${o} note annotations on a ${n}×${i} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}(0,t,a),function(e,t,a){const r=Array.isArray(t.annotations)?t.annotations:null;if(r)for(const e of r)e&&"object"==typeof e&&"widget"===it(e)&&null!=e.content&&!ut(e)&&a.push({severity:"warning",code:"ANNOTATION_INTERACTIVE_ID",message:"An interactive widget annotation has no stable id, so its activation cannot be normalized or replayed reliably.",fix:"Add id, stableId, or provenance.stableId to the widget annotation. Do not identify interactive annotations by array index."})}(0,t,a),function(e,t,a){for(const e of pt){const r=t[e];if(!Array.isArray(r)||2>r.length)continue;const[o,n]=r;"number"==typeof o&&"number"==typeof n&&o>n&&a.push({severity:"warning",code:"INVERTED_AXIS",message:`${e}=[${o}, ${n}] is descending — the axis renders inverted, so "up" reads as less. Inverted axes are a classic misleading-design pattern unless the inversion is the point.`,fix:`Order the extent ascending (${e}={[${n}, ${o}]}). If the inversion is deliberate (e.g. rank #1 at top), say so in the title or an annotation so readers aren't misled.`})}}(0,t,a),function(e,t,a){if("MultiAxisLineChart"!==e)return;const r=t.series;if(!Array.isArray(r)||2!==r.length)return;const o=r.filter(e=>!e||"object"!=typeof e||"string"!=typeof e.label||0===e.label.trim().length);o.length>0&&a.push({severity:"warning",code:"DUAL_AXIS_UNLABELED",message:`Dual-axis chart with ${o.length} unlabeled series. Two y-scales invite false equivalence between the lines; without per-series labels a reader can't tell which scale is whose.`,fix:'Give every series a label: series={[{ yAccessor: "a", label: "Revenue ($)" }, { yAccessor: "b", label: "Users" }]} — and consider whether two separate charts read more honestly.'})}(e,t,a),function(e,t,a){if(!Be.has(e))return;const r=t.xExtent;if(!Array.isArray(r)||2>r.length)return;const[o,n]=r;if("number"!=typeof o||"number"!=typeof n||o>=n)return;const i=t.data;if(!i||!Array.isArray(i)||4>i.length)return;const s=t.xAccessor??"x";if("string"!=typeof s)return;let l=1/0,c=-1/0;for(const e of i){const t=e?.[s];"number"==typeof t&&Number.isFinite(t)&&(l>t&&(l=t),t>c&&(c=t))}if(!Number.isFinite(l)||!Number.isFinite(c)||l>=c)return;const u=c-l,d=Math.max(0,Math.min(n,c)-Math.max(o,l))/u;.7>d&&a.push({severity:"warning",code:"CHERRY_PICKED_WINDOW",message:`xExtent=[${o}, ${n}] shows only ~${Math.round(100*d)}% of the data's x range [${l}, ${c}] — a trend cropped to a favorable window is a classic misleading-design pattern.`,fix:'Widen xExtent to cover the data, filter the data itself so the chart shows what it has, or annotate the visible window ("Q4 only") so the cropping is explicit.'})}(e,t,a),a.some(e=>"NEGATIVE_VALUE"===e.code||"NEGATIVE_NORMALIZED_VALUE"===e.code)||function(e,t,a){const r=He[e],o=We[e];if(!r&&!o)return;if(o&&!t.normalize)return;const n=r??o,i=t[n],s="string"==typeof i?i:"yAccessor"===n?"y":"value",l=t.data;if(!l||!Array.isArray(l)||0===l.length)return;const c=l.filter(e=>{const t=e?.[s];return"number"==typeof t&&0>t});c.length>0&&a.push({severity:r?"error":"warning",code:"PART_TO_WHOLE_NEGATIVE",message:`${c.length} negative value(s) in "${s}" — a part-to-whole encoding cannot represent negative parts${r?"; slice angles/areas for negatives are meaningless":"; normalized shares distort when parts are negative"}.`,fix:r?"Filter or transform negative values first, or switch to a BarChart/WaterfallChart, which encode signed values honestly.":"Drop normalize for signed data, or use a diverging BarChart so negative contributions read as negative."})}(e,t,a),function(e,t,a){Ue.has(e)&&"basis"===t.curve&&a.push({severity:"warning",code:"NON_PASSING_CURVE",message:'curve="basis" draws a B-spline that does NOT pass through your data points — rendered values differ from actual values everywhere except the endpoints.',fix:'Use curve="monotoneX" or curve="catmullRom" (both interpolate through every point), or keep "basis" only for deliberately schematic, clearly-labeled smoothing.'})}(e,t,a),function(e,t,a){if("LineChart"!==e&&"AreaChart"!==e)return;if("sparkline"===t.mode)return;if(t.responsiveWidth||t.responsiveHeight)return;const r="number"==typeof t.width?t.width:600,o="number"==typeof t.height?t.height:400;if(0>=r||0>=o)return;const n=r/o;if(n>8||.25>n){const e=n>8?"flattens":"exaggerates";a.push({severity:"warning",code:"EXTREME_ASPECT_RATIO",message:`${r}×${o} (${n.toFixed(1)}:1) is an extreme aspect ratio that ${e} the slopes a reader perceives — aspect-ratio distortion is a documented misleading-design pattern.`,fix:n>8?'Use a more balanced aspect (e.g. width/height between 1 and 3), or set mode="sparkline" if this is genuinely a sparkline strip.':"Use a more balanced aspect (e.g. width/height between 1 and 3); very tall trend charts overstate every change."})}}(e,t,a),function(e,t,a){if(!Ge.has(e))return;const r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;const o=t.categoryAccessor,n="string"==typeof o?o:"category",i=new Set;for(const e of r){const t=e?.[n];null!=t&&i.add(t)}i.size>mt&&a.push({severity:"warning",code:"PIE_TOO_MANY_SLICES",message:`${i.size} slices — angle judgments degrade rapidly past ~${mt} categories (Cleveland & McGill), and thin slices become unreadable and unlabelable.`,fix:`Use a BarChart or DotPlot for ${i.size} categories, or group the long tail into an "Other" slice before charting.`})}(e,t,a),function(e,t,a){if(Qe.has(e)){if("GaltonBoardChart"===e){const e=t.bins;"number"==typeof e&&2>e&&a.push({severity:"error",code:"PHYSICS_BAD_BINS",message:`bins=${e} leaves no meaningful settled projection for a Galton board.`,fix:"Use at least two bins; 8-24 bins is a practical range for physics distributions."});const r=ft(t.branchProbability);null!=t.branchProbability&&(null==r||0>r||r>1)&&a.push({severity:"error",code:"PHYSICS_BAD_BRANCH_PROBABILITY",message:`branchProbability=${t.branchProbability+""} must be between 0 and 1.`,fix:"Use branchProbability={0.5} for a balanced Galton board, or bias it within the [0, 1] range."});const o=ft(t.mechanicalCount);null==t.mechanicalCount||null!=o&&o>0||a.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${t.mechanicalCount+""} cannot generate a mechanical Galton board.`,fix:"Use a positive mechanicalCount, for example 96."})}if("EventDropChart"===e){const e=t.windows,r=e&&"object"==typeof e?ft(e.size):null;null==r||r>0||a.push({severity:"error",code:"PHYSICS_BAD_WINDOW_SIZE",message:`windows.size=${r} cannot form event-time barriers.`,fix:"Set windows={{ size: positiveNumber }} so each event can settle into a real time window."}),"number"!=typeof t.timeScale||t.timeScale>0||a.push({severity:"error",code:"PHYSICS_BAD_TIME_SCALE",message:`timeScale=${t.timeScale} prevents arrival replay from advancing.`,fix:"Use a positive timeScale, or omit it for the default pace."});const o=Array.isArray(t.data)?t.data:[];if(o.length>0){const e=t.timeAccessor||"time",r=t.arrivalAccessor||"arrivalTime";o.some(t=>{const a=ft(gt(t,e,"time")),o=ft(gt(t,r,"arrivalTime"));return null!=a&&null!=o&&a!==o})||a.push({severity:"warning",code:"PHYSICS_EVENTDROP_NO_ARRIVAL_SPREAD",message:"EventDropChart data does not show distinct arrival times, so the physics replay collapses to event order.",fix:"Provide an arrivalAccessor field with event-arrival times when demonstrating lateness, watermarks, or out-of-order streams."})}}if("UnitPileChart"===e){const e=ft(t.mechanicalCount);null==t.mechanicalCount||null!=e&&e>0||a.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${t.mechanicalCount+""} cannot generate a mechanical pile chart.`,fix:"Use a positive mechanicalCount, for example 80."}),"mechanical"===t.mode&&Array.isArray(t.mechanicalCategories)&&0===t.mechanicalCategories.length&&a.push({severity:"error",code:"PHYSICS_EMPTY_MECHANICAL_CATEGORIES",message:"mechanicalCategories=[] leaves no containers for the generated unit pile.",fix:"Provide at least one category label, or omit mechanicalCategories for the default set."});const r=ft(t.unitValue??1)??1;if(0>=r)return void a.push({severity:"error",code:"PHYSICS_BAD_UNIT_VALUE",message:`unitValue=${t.unitValue} cannot unitize values into physical bodies.`,fix:"Set unitValue to a positive number represented by one body."});const o=t.valueAccessor||"value",n=(Array.isArray(t.data)?t.data:[]).reduce((e,t)=>{const a=ft(gt(t,o,"value"))??0;return e+Math.max(0,Math.round(a/r))},0);n>1500&&a.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`UnitPileChart would create about ${n} live bodies; motion may dominate the chart and stress the frame budget.`,fix:"Increase unitValue, cap visible units, or aggregate before rendering so the settled projection remains readable."})}if("CollisionSwarmChart"===e){if((ft(t.pointRadius??5)??5)>0||a.push({severity:"error",code:"PHYSICS_BAD_POINT_RADIUS",message:`pointRadius=${t.pointRadius} cannot produce collision bodies.`,fix:"Use a positive pointRadius, for example 5."}),(ft(t.collisionIterations??6)??6)>0||a.push({severity:"error",code:"PHYSICS_BAD_COLLISION_ITERATIONS",message:`collisionIterations=${t.collisionIterations} disables collision relaxation.`,fix:"Use at least one collision iteration; 4-8 is a practical range for swarms."}),null!=t.xExtent){const e=Array.isArray(t.xExtent)?t.xExtent:[],r=ft(e[0]),o=ft(e[1]);(2>e.length||null==r||null==o)&&a.push({severity:"error",code:"PHYSICS_BAD_X_EXTENT",message:"xExtent must be a numeric [min, max] pair for CollisionSwarmChart.",fix:"Pass xExtent={[min, max]} or omit it so the chart infers the domain from data."})}const e=Array.isArray(t.data)?t.data:[];e.length>1200&&a.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`CollisionSwarmChart would create ${e.length} live bodies; collision relaxation may dominate the frame budget.`,fix:"Sample, aggregate, reduce point radius, or move to a static SwarmPlot when every row does not need a physical body."});const r=t.groupAccessor;if(e.length>0&&r){const t=new Set;for(const a of e){const e=gt(a,r,"group");null!=e&&t.add(e)}t.size>12&&a.push({severity:"warning",code:"PHYSICS_TOO_MANY_SWARM_LANES",message:`CollisionSwarmChart has ${t.size} group lanes, which leaves little vertical room for collision separation.`,fix:"Facet or filter groups, or use an ordinary SwarmPlot/BoxPlot for dense grouped comparison."})}}if("GaltonBoardChart"!==e&&"UnitPileChart"!==e&&"CollisionSwarmChart"!==e&&"ProcessFlowChart"!==e&&"EventDropChart"!==e||(null!=t.massBy||null!=t.massAccessor||t.frameProps&&"object"==typeof t.frameProps&&null!=t.frameProps.bodyMassBy)&&a.push({severity:"warning",code:"PHYSICS_DATA_IN_DYNAMICS",message:e+" appears to map a data field to mass/dynamics. Mass is not a readable quantitative channel.",fix:"Encode quantities in spawn position, bin, size, color, or glyph — keep mass/friction/restitution as process texture. Use showProjection for the truth layer."}),"UnitPileChart"!==e&&"GaltonBoardChart"!==e&&"CollisionSwarmChart"!==e&&"ProcessFlowChart"!==e&&"CrucibleChart"!==e||!1!==t.showProjection||a.push({severity:"warning",code:"PHYSICS_NO_PROJECTION",message:e+" has showProjection={false}. Without a settled projection, motion is easy to over-read as data.",fix:"Keep showProjection enabled (default) so the chart collapses to a legible static reading, or document why the process alone is the claim."}),"ProcessFlowChart"===e){const e=Array.isArray(t.stages)?t.stages:[];if(0===e.length)a.push({severity:"error",code:"PROCESS_FLOW_MISSING_STAGES",message:"ProcessFlowChart requires a non-empty stages array.",fix:'Provide stages={[{ id: "coding", force: 12 }, { id: "merged", absorb: true }]}.'});else{e.some(e=>!e||null==e.id||""===(e.id+"").trim())&&a.push({severity:"error",code:"PROCESS_FLOW_BAD_STAGE",message:"Every ProcessFlowChart stage needs a stable id.",fix:'Use stages like { id: "review", label: "Review", capacity: { unitsPerSecond: 4 } }.'});const r=e.filter(e=>e?.absorb).length;t.groupBy&&0===r&&a.push({severity:"warning",code:"PROCESS_FLOW_GROUP_NO_ABSORB",message:"groupBy is set but no stage has absorb: true, so all-members completion cannot resolve.",fix:'Mark a terminal stage with absorb: true (e.g. merged), or set groupCompletion="none".'})}}if("GauntletChart"===e&&(Array.isArray(t.negativeProperties)||a.push({severity:"warning",code:"GAUNTLET_MISSING_NEGATIVE_PROPERTIES",message:"GauntletChart usually needs negativeProperties for drag/cost bodies (empty array is ok if intentional).",fix:'Provide negativeProperties={[{ id: "cost", label: "Cost", load: 1 }]} or explicitly pass [].'})),"CrucibleChart"===e){const e=Array.isArray(t.phases)?t.phases:[],r=Array.isArray(t.products)?t.products:[],o=Array.isArray(t.events)?t.events:[],n=Array.isArray(t.outlets)?t.outlets:[];0===e.length?a.push({severity:"error",code:"CRUCIBLE_MISSING_PHASES",message:"CrucibleChart requires an authored, non-empty phases array; a treatment program cannot be inferred from flat data.",fix:'Provide phases={[{ id: "charge", label: "Charge", duration: 1, motion: "charge" }]}.'}):e.some(e=>!e||null==e.id||""===(e.id+"").trim()||null==ft(e.duration)||0>=Number(e.duration))&&a.push({severity:"error",code:"CRUCIBLE_BAD_PHASE",message:"Every CrucibleChart phase needs a stable id and a positive finite duration.",fix:'Use phases like { id: "assay", label: "Assay", duration: 2, motion: "mix" }.'}),0===r.length&&a.push({severity:"warning",code:"CRUCIBLE_NO_PRODUCTS",message:"CrucibleChart has no declared product molds. Products are never discovered from collisions or source fields.",fix:'Declare products={[{ id: "accepted", label: "Accepted", outletId: "product" }]} when the treatment forms an output.'}),0===o.length&&a.push({severity:"warning",code:"CRUCIBLE_NO_EVENTS",message:"CrucibleChart has no authored events, so its phases cannot transform, combine, split, or route the charge.",fix:"Supply an explicit events array; do not ask the chart or an AI layer to infer a treatment from the rows."}),Array.isArray(t.outlets)||a.push({severity:"warning",code:"CRUCIBLE_IMPLICIT_OUTLETS",message:"CrucibleChart is using generic default outlets rather than domain-specific destinations.",fix:"Provide reason-labelled outlets and reference their ids from products, complete-product, and eject effects."});const i=new Set(r.map(e=>e?.id).filter(e=>null!=e).map(String)),s=new Set(["product","retained","residue","failed","recovered",...n.map(e=>e?.id).filter(e=>null!=e).map(String)]),l=new Set,c=new Set;for(const e of o)if(e&&Array.isArray(e.effects))for(const t of e.effects){if(!t||"object"!=typeof t)continue;const e=t.type;if("combine"!==e&&"contribute"!==e&&"complete-product"!==e||null==t.productId||i.has(t.productId+"")||l.add(t.productId+""),"split"===e&&Array.isArray(t.products))for(const e of t.products)null==e?.productId||i.has(e.productId+"")||l.add(e.productId+"");null==t.outletId||s.has(t.outletId+"")||c.add(t.outletId+"")}l.size>0&&a.push({severity:"error",code:"CRUCIBLE_UNKNOWN_PRODUCT",message:`CrucibleChart events reference undeclared product molds: ${[...l].sort().join(", ")}.`,fix:"Declare every referenced product id in products; do not create product definitions implicitly inside events."}),c.size>0&&a.push({severity:"error",code:"CRUCIBLE_UNKNOWN_OUTLET",message:`CrucibleChart events reference undeclared outlets: ${[...c].sort().join(", ")}.`,fix:"Declare every domain outlet in outlets and reuse its stable id in authored effects."});const u=ft(t.playbackRate);null==t.playbackRate||null!=u&&u>0||a.push({severity:"error",code:"CRUCIBLE_BAD_PLAYBACK_RATE",message:`playbackRate=${t.playbackRate+""} cannot advance the authored CrucibleChart tape.`,fix:"Use a positive playbackRate such as 0.5 for half speed or 2 for double speed."});const d=ft(t.rerunMS);null==t.rerunMS||null!=d&&d>=0||a.push({severity:"error",code:"CRUCIBLE_BAD_RERUN_MS",message:`rerunMS=${t.rerunMS+""} must be a finite non-negative delay or null.`,fix:"Use rerunMS={3000}, rerunMS={0}, or omit the prop for a single run."})}if("GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e||"CrucibleChart"===e){const r=Array.isArray(t.data)?t.data:[],o=ft(t.mechanicalCount)??0,n=r.length>0?r.length:o;n>2500&&a.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`${e} may spawn ~${Math.round(n)} live bodies, which can overwhelm the simulation loop.`,fix:"Lower mechanicalCount / unitize with a larger unitValue, enable sediment/windowSize, or sample the data before spawn."})}}}(e,t,a),"ProcessSankey"===e)for(const e of function(e){const t=[],a=e.domain;null==a?t.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} as numbers or Date-compatible values."}):Array.isArray(a)&&2===a.length&&Number.isFinite(Number(a[0]))&&Number.isFinite(Number(a[1]))||t.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times.",fix:"Use domain={[t0, t1]} with t0 <= t1."});const r=e.edges;if(Array.isArray(r)&&r.length>0){const e=r[0];null!=e.startTime&&null!=e.endTime||t.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}const o=e.nodes,n=Array.isArray(o)?o.length:0;return!0!==e.showLabels||24>n||t.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${n} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),80>(Array.isArray(r)?r.length:0)||null!=e.layoutExecution||"off"===e.packing||t.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),t}(t))a.push(e);return{ok:a.every(e=>"warning"===e.severity),diagnoses:a}}var sa=["title","description","summary"];function la(e){return"string"==typeof e&&e.trim().length>0}var ca=new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]);function ua(e,t=new Set){if(null===e)return!0;const a=typeof e;if("string"===a||"boolean"===a)return!0;if("number"===a)return Number.isFinite(e);if("object"!==a)return!1;if(t.has(e))return!1;t.add(e);const r=Array.isArray(e)?e.every(e=>ua(e,t)):Object.entries(e).every(([,e])=>ua(e,t));return t.delete(e),r}var da=Symbol.for("semiotic.chartRecipeRegistry");function ha(e){return function(){const e=globalThis;return e[da]||(e[da]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[da]}().recipes.get(e)}function pa(e){return"string"==typeof e?ha(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}var ma="Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari).";function fa(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=function(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}(e)}function ga(e){const t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;const a=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return a?a.length:1}function ya(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function ba(e,t,a={}){const r=[],o=ha(e),n=Xe.has(e),i=!!Pe[e]||!!o||n,s=!0===a.inChartContainer,l=!0===a.describe,c=!0===a.navigable,u=qe.has(e),d=_e.has(e),{hasTitle:h,hasDescription:p,hasSummary:m,unsupportedFinding:f}=function(e,t){const a=Pe[e]?.props,r=e=>!!a?.[e],o=sa.filter(e=>la(t[e])&&!r(e));return{hasTitle:r("title")&&la(t.title),hasDescription:r("description")&&la(t.description),hasSummary:r("summary")&&la(t.summary),unsupportedFinding:o.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${o.join(" and ")} text was supplied, but ${1===o.length?"that prop is":"those props are"} not supported by ${e}'s declared chart API and cannot be credited as rendered accessibility text.`,fix:"Use the component's declared title, description, and summary props when available; for richer generated description or navigation, use ChartContainer with chartConfig plus describe and/or navigable."}:void 0}}(e,t),g=!1!==t.accessibleTable&&!u,y=h||p||m,b=function(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}(t),v=function(e){const t=ya(e),a=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===a.pause||"function"==typeof a.pause}(t),A=n,x=function(e){const t=ya(e);return!0===e.settledProjection||!0===t.settledProjection}(t)||Ze.has(e)&&g,w=function(e){const t=ya(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}(t)||A,C=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],$=i?"pass":"manual",S=i?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(f&&r.push(f),r.push(function(e){const t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},a=e.colorScheme,r="string"==typeof e.background?e.background:null;if(r&&!r.startsWith("#"))return{...t,status:"manual",message:`Background "${r}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};const o=r??"#ffffff";if(!Array.isArray(a))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};const n=[];let i=0;for(const e of a){if("string"!=typeof e||!e.startsWith("#"))continue;const t=I(e,o);null!=t&&(i++,3>t&&n.push(`${e} (${t.toFixed(1)}:1)`))}return 0===i?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:n.length>0?{...t,status:"fail",message:`${n.length} color(s) fall below 3:1 contrast vs ${o}: ${n.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${i} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${o}.`}}(t)),r.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...u?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:g?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:p&&m?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}}),r.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),r.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||Je.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."}}),null!=t.colorBy){const e=!0===t.directLabel||!0===t.showLabels,a=function(e){return!!Array.isArray(e.styleRules)&&e.styleRules.some(e=>{if("object"!=typeof e||null===e)return!1;const t=e.style;if("object"!=typeof t||null===t||Array.isArray(t))return!1;const a=t.fill;return"object"==typeof a&&null!==a&&"hatch"===a.type})}(t);r.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...e?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:a?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:a?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}});const o=function(e){if(!Array.isArray(e))return!1;const t=e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase());return t.length>0&&t.every(e=>ca.has(e))}(t.colorScheme);r.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...o?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),r.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:a?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:a?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{const e=C.filter(st);if(e.length>0){const a=t.autoPlaceAnnotations,o="object"==typeof a&&null!==a&&!0===a.redundantCues,n=e.filter(e=>{if("string"!=typeof e.color)return!1;const t=it(e),a=o&&"text"===t;return!(lt(e)||a)});r.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===n.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${n.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}r.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...i?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}});{const e=[];null==t.brush&&null==t.onBrush||e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||e.push("legend filtering"),e.length>0&&r.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{const a=rt[e];if(a&&b){const e=t[a];"number"==typeof e&&e>0&&24>2*e&&r.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${a}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}r.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:$,message:`The chart takes a single tab stop and navigates data with arrow keys${S} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),r.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...b?m||p?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),r.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:$,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${S}.`}),r.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:$,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${S}.`,fix:i?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),r.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...y?{status:"pass",message:`Provided: ${[h&&"title",p&&"description",m&&"summary"].filter(Boolean).join(", ")}.`}:s?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),r.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...p||m?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:l?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:h?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}});{const e=[t.description,t.summary].filter(la).join(". "),a=e?function(e){const t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),a=e.trim().split(/\s+/).filter(Boolean);if(0===a.length||0===t.length)return null;let r=0;for(const e of a)r+=ga(e);return a.length/t.length*.39+r/a.length*11.8-15.59}(e):null;r.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==a?{status:"not-applicable",message:"No description/summary text to grade."}:a>9?{status:"warn",message:`Description/summary reads at ~grade ${a.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(a))} (≤ 9).`}})}if(Ye.has(e)){const e=la(t.xLabel),a=la(t.yLabel);r.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&a?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!a&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(tt.has(e)&&r.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),C.length>1){const e=C.filter(fa).length;r.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===C.length?{status:"pass",message:`All ${C.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:C.length+" annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.",fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${C.length-e} of ${C.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&r.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&r.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:$,message:`Transitions animate with object constancy and data changes are mirrored to the live region${S}.`,fix:i?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),r.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),r.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),r.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:$,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${S}.`,fix:i?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),r.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...u?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:g?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}}),u||r.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...s?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),r.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:i?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${i?"":S}.`,fix:i?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),r.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...c?d?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:d?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:$,message:`Keyboard navigation steps through points and switches series/groups${S}.`,fix:i?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}});{const a=Array.isArray(t.data)?t.data:null,o=Array.isArray(t.nodes)?t.nodes:null,n={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};let i;i=Ve.has(e)&&a&&a.length>7?{...n,status:"warn",message:a.length+" slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.",fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}:o&&o.length>200?{...n,status:"warn",message:o.length+" nodes. A network this size is hard to navigate non-visually node by node.",fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:a&&a.length>5e3?{...n,status:"warn",message:a.length+" data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.",fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:a?{...n,status:"pass",message:a.length+" data points — a reasonable density for non-visual consumption."}:o?{...n,status:"pass",message:o.length+" nodes — a reasonable density for non-visual consumption."}:{...n,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},r.push(i)}{const e=Array.isArray(t.data)?t.data:null,a=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]);let o=!1;if(e&&!a)for(const t of e.slice(0,50))if(t&&"object"==typeof t){for(const e of Object.values(t))if("number"==typeof e&&Number.isFinite(e)&&Math.abs(e)>=1e5){o=!0;break}if(o)break}o&&r.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}r.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...l?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:m?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),r.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...u?{status:"not-applicable",message:"Single value — nothing to skip."}:g?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}}),r.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:$,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${S}.`,fix:i?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),r.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...Je.has(e)||et.has(e)?v?{status:"pass",message:e+" animates continuously and declares an in-chart pause/stop control."}:{status:"warn",message:e+" animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.",fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:$,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${S}.`}}),n&&(r.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...v?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),r.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...x?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),r.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...w?{status:"pass",message:"Reduced-motion mode settles the simulation to a static chart state instead of freezing bodies mid-flight."}:{status:"warn",message:"Physics chart does not declare reduced-motion synchronous settle behavior.",fix:"In reduced motion, run the world to its settled projection and paint once; set physics.reducedMotionSettle=true."}}));{const a=!0===t.responsiveWidth||!0===t.responsiveHeight,o=at.has(e)&&!0===t.zoomable;r.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...a?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:o?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}})}if(o){const e=o.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length));e&&r.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:o.name+" declares a color encoding without a redundant cue.",fix:"Add shape, label, position, texture, or a textual category summary to the recipe encoding."}),"required"!==o.accessibility.description||la(t.description)||r.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:o.name+" requires a recipe-aware description, but none is attached.",fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),o.accessibility.fallbackTable&&!1===t.accessibleTable&&r.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:o.name+" requires a fallback table, but accessibleTable is disabled.",fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."})}const k=r.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),R={criticalsPassed:k.filter(e=>"pass"===e.status).length,criticalsEvaluated:k.length,fails:r.filter(e=>"fail"===e.status).length,warnings:r.filter(e=>"warn"===e.status).length,manual:r.filter(e=>"manual"===e.status).length,passes:r.filter(e=>"pass"===e.status).length};return{component:e,ok:!k.some(e=>"fail"===e.status),summary:R,findings:r,reference:ma}}function va(e,{onlyCritical:t=!1}={}){const a=[];for(const r of e.findings)"fail"!==r.status&&"warn"!==r.status||t&&!r.critical||a.push(r.message);return a}var Aa={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},xa=["perceivable","operable","understandable","robust","compromising","assistive","flexible"];function wa(e){const t=[],a=e.summary,r=e.ok?`${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`:`${a.fails} blocking failure(s) — ${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${r} · ${a.warnings} warning(s) · ${a.manual} to verify manually`);for(const a of xa){const r=e.findings.filter(e=>e.principle===a&&"not-applicable"!==e.status);if(0!==r.length){t.push(""),t.push(" "+a.toUpperCase());for(const e of r)t.push(` ${Aa[e.status]} ${e.id}${e.critical?" [critical]":""}: ${e.message}`),!e.fix||"fail"!==e.status&&"warn"!==e.status&&"manual"!==e.status||t.push(" → "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}var Ca={code:"SEMANTIC_DEGENERATE",severity:"error",message:"Marks painted, but the capability reported a semantically degenerate encoding.",fix:"Choose fields that support the chart's intended encoding."},$a={error:0,warning:1,manual:2},Sa={data:0,deception:1,accessibility:2,render:3};function ka(e){return e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ra(e,t,a){return{id:`${t}.${e.code.toLowerCase()}.${a+1}`,stage:t,severity:e.severity,code:e.code,message:e.message,...e.fix?{fix:e.fix}:{},source:"data"===t?"auditData":"diagnoseConfig",...e.field?{field:e.field}:{},...e.role?{role:e.role}:{},...e.rows?{rows:e.rows}:{},...void 0!==e.count?{count:e.count}:{}}}function Pa(e,t){const a=e.filter(e=>"manual"!==e.severity),r=a.slice(0,t).map(e=>({id:"chart-evaluation-"+e.id,level:"error"===e.severity?"error":"warning",title:`${e.stage}: ${ka(e.code)}`,message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic chart evaluation",dismissible:!0}));return a.length>t&&r.push({id:"chart-evaluation-overflow",level:"warning",title:"Additional chart evaluation findings",message:a.length-t+" additional finding(s) are available in the ranked evaluation result.",source:"Semiotic chart evaluation",dismissible:!0}),r}function Na(e){const t=[`${e.component}: ${e.ok?"PASS":"ISSUES FOUND"}`,`${e.summary.errors} error(s) · ${e.summary.warnings} warning(s) · ${e.summary.manual} manual check(s)`];for(const a of e.findings)t.push(`${a.rank}. [${a.stage}/${a.code}] ${a.message}`),a.fix&&t.push(" Fix: "+a.fix);return t.join("\n")}function Ta(e,t={},a,r={}){const o=void 0===a?t:{...t,data:a},n=Ee(e,o),i=Qt(e,o,a,r.dataAudit),s=ia(e,o).diagnoses.filter(e=>"data"!==e.domain&&"VALIDATION"!==e.code),l=ba(e,o,{inChartContainer:r.inChartContainer,describe:r.describe,navigable:r.navigable}),c=[];for(const[e,t]of n.errors.entries())c.push({id:"validation."+(e+1),stage:"deception",severity:"error",code:"VALIDATION",message:t,fix:"Correct the component name, required props, prop types, and data shape.",source:"validateProps"});let u;i.diagnoses.forEach((e,t)=>{c.push(Ra(e,"data",t))}),s.forEach((e,t)=>{c.push(Ra(e,"deception",t))}),l.findings.filter(e=>"pass"!==e.status&&"not-applicable"!==e.status).forEach((e,t)=>{c.push(function(e,t){return{id:e.id||"accessibility."+(t+1),stage:"accessibility",severity:"fail"===e.status?"error":"warn"===e.status?"warning":"manual",code:e.id,message:e.message,...e.fix?{fix:e.fix}:{},source:"auditAccessibility",critical:e.critical,principle:e.principle,heuristic:e.heuristic}}(e,t))});const d=c.some(e=>"error"===e.severity&&"accessibility"!==e.stage);if(r.render&&n.valid&&!d)try{u=r.render(e,o).evidence,c.push(...function(e){const t=[];e.empty&&t.push({id:"render.empty-scene",stage:"render",severity:"error",code:"EMPTY_SCENE",message:"The renderer produced no data marks.",fix:"Check the data shape, accessors, scales, and filters against the rendered evidence.",source:"renderChartWithEvidence"});const a=new Set;for(const r of function(e){return e.semanticDiagnostics?.length?e.semanticDiagnostics:"degenerate"===e.semanticStatus?[Ca]:[]}(e))a.add(r.code),t.push({id:"render."+r.code.toLowerCase(),stage:"render",severity:r.severity,code:r.code,message:r.message,...r.fix?{fix:r.fix}:{},source:"capability.semanticViability"});for(const r of e.warnings)a.has(r)||t.push({id:"render."+r.toLowerCase(),stage:"render",severity:"warning",code:r,message:`The renderer reported ${ka(r).toLowerCase()}.`,fix:"Inspect the render evidence and resolve the warning before relying on the chart.",source:"renderChartWithEvidence"});return t}(u))}catch{c.push({id:"render.failed",stage:"render",severity:"error",code:"RENDER_FAILED",message:"The injected renderer failed before producing render evidence.",fix:"Check the chart configuration and renderer-specific requirements.",source:"renderChartWithEvidence"})}const h=function(e){return e.map((e,t)=>({finding:e,index:t})).sort((e,t)=>{const a=$a[e.finding.severity]-$a[t.finding.severity];if(0!==a)return a;const r=!0===e.finding.critical;if(r!==(!0===t.finding.critical))return r?-1:1;const o=Sa[e.finding.stage]-Sa[t.finding.stage];return 0!==o?o:e.index-t.index}).map(({finding:e},t)=>({...e,rank:t+1}))}(c),p=h.filter(e=>"error"===e.severity).length,m=h.filter(e=>"warning"===e.severity).length,f=h.filter(e=>"manual"===e.severity).length,g=Pa(h,Math.max(0,Math.floor(r.notificationMax??8)));return{component:e,validation:n,data:i,deception:s,accessibility:l,...u?{evidence:u}:{},ok:0===p,summary:{errors:p,warnings:m,manual:f,findings:h.length,notifications:g.length},findings:h,notifications:g}}function Ia(e,t=8){return Pa(e,Math.max(0,Math.floor(t)))}function Ea(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Ma(e,t){const{when:a}=e,r=t.width,o=t.height,n=function(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}(t),i=function(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}(t);return!("number"==typeof a.minWidth&&a.minWidth>r||"number"==typeof a.maxWidth&&r>a.maxWidth||"number"==typeof a.minHeight&&("number"!=typeof o||a.minHeight>o)||"number"==typeof a.maxHeight&&("number"!=typeof o||o>a.maxHeight)||"number"==typeof a.minAspectRatio&&("number"!=typeof n||a.minAspectRatio>n)||"number"==typeof a.maxAspectRatio&&("number"!=typeof n||n>a.maxAspectRatio)||a.orientation&&i!==a.orientation)}function La(e,t,a=e.responsiveRules){if(!Array.isArray(a)||0===a.length)return{props:e,matches:[]};const r=a.map((e,t)=>({rule:e,index:t})).filter(e=>Ma(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:r.reduce((e,t)=>function(e,t){const a={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])Ea(e[r])&&Ea(t[r])&&(a[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(a.className=`${e.className} ${t.className}`),a}(e,t.rule.transform),e),matches:r}}var Oa="Mobile visualization audit: informed by MobileVisFixer, mobile exploratory interaction research, small-multiple mobile studies, responsive visualization grammars, constraint-based breakpoints, and WCAG 2.2 input modalities.",za=new Set([...Ye,"RealtimeLineChart","RealtimeHeatmap"]),_a=Object.fromEntries(Object.entries(rt).map(([e,t])=>[e,[t,"hoverRadius"]]));function Fa(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ja(e){return"string"==typeof e&&e.trim().length>0}function Ba(e){const t=Fa(e.capability)?e.capability:null,a=Fa(e.recipe)?e.recipe:null,r=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,a?.mobile];for(const e of r)if(Fa(e))return e;return null}function Da(e){return Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1]&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[e[0],e[1]]:null}function Ua(e){return Da(e.size)||Da(Fa(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function Ga(e,t){e.push({...t,status:"pass"})}function Ha(e,t){e.push({...t,status:"warn"})}function Va(e,t){e.push({...t,status:"manual"})}function Wa(e,t={},a={}){const r=a.viewportWidth??390,o=a.targetSize??44,n=Ua(t),i=La(t,{width:r,height:n?.[1]}),s=[],l=Ua(t=i.props),c=Ba(t),u=function(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}(e,t),d=function(e){const t=Ba(e);return!0===e.responsive||!0===e.mobile||!0===t?.responsive||!0===t?.supportsResponsiveLayout||Array.isArray(t?.breakpoints)||"number"==typeof t?.minViewportWidth||"responsive"===t?.strategy||"small-multiples"===t?.strategy||"summary-cards"===t?.strategy||null!=e.mobileLayout||null!=e.responsiveRules||"mobile-readable"===e.density}(t),h=!0===a.inChartContainer,p=ja(t.title)||ja(t.summary)||ja(t.description)||!0===c?.summary||ja(c?.summary);if(i.matches.length>0&&Ga(s,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${i.matches.length} responsive rule(s) applied for the ${r}px mobile audit.`}),l){const[t,a]=l;t>r&&!d?Ha(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${r}px mobile viewport with no responsive/mobile transform hint.`,fix:"Use responsive sizing, responsiveRules/mobileLayout, or an explicit mobile variant that preserves the task instead of clipping the desktop chart."}):Ga(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof c?.minViewportWidth&&c.minViewportWidth>r&&Ha(s,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${c.minViewportWidth}px minimum, wider than the audited ${r}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});const o=t/Math.max(1,a);430>=r&&o>2.4&&"BigNumber"!==e&&Ha(s,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${o.toFixed(1)}:1, which tends to compress phone charts vertically.`,fix:"Prefer stacked sections, small multiples, cards plus a sparkline, or a taller mobile-specific chart ratio."}),160>a&&"BigNumber"!==e&&Ha(s,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${a}px; most phone charts need enough vertical room for marks plus readable labels.`,fix:"Reserve more vertical space, remove nonessential axes, or switch to a card/sparkline pattern with external labels."})}else Va(s,{id:"layout.unknown-size",category:"layout",impact:"medium",message:"No explicit size is available to audit. This may be responsive, but static mobile overflow cannot be checked.",fix:"Audit rendered widths at 320, 360, 390, and 430px, or pass size/responsiveRules metadata into the config."});const m=function(e){const t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,Fa(e.frameProps)?e.frameProps.data:void 0];let a=0;for(const e of t)Array.isArray(e)&&(a+=e.length);return a}(t);m>0&&(m>("number"==typeof c?.maxMarks?c.maxMarks:za.has(e)?1.25*r:Ke.has(e)?Math.max(8,Math.floor(r/34)):r)?Ha(s,{id:"density.mark-budget",category:"density",impact:za.has(e)?"medium":"high",message:`${m} data item(s) exceed the rough mobile density budget for ${e} at ${r}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):Ga(s,{id:"density.mark-budget",category:"density",impact:"medium",message:m+" data item(s) are within the rough mobile density budget for this component."}));const f=function(e){const t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues];let a=0;for(const e of t)Array.isArray(e)&&(a+=e.length);return a>0?a:null}(t),g=!1!==t.showAxes&&!1!==t.axis;if(g&&null!=f){const e=Math.max(3,Math.floor(r/58));f>e&&Ha(s,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${f} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${r}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else g&&(za.has(e)||Ke.has(e))&&Va(s,{id:"density.axis-label-collision",category:"density",impact:"medium",message:"Axes are enabled, but label collision depends on rendered tick text and cannot be checked statically.",fix:"Verify tick labels at phone widths or provide explicit mobile tick density."});!function(e){const t=Fa(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!function(e){const t=Ba(e),a=Fa(e.mobileInteraction)?e.mobileInteraction:null;return null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||null!=e.selection||null!=e.onClick||null!=e.onSelect||!0===e.mobileInteraction||!0===a?.tapToSelect||!0===a?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||ja(t?.interaction?.hoverFallback)}(e)}(t)?Ga(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."}):Ha(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"The chart exposes tooltip/hover detail without an obvious tap, selection, or control alternative.",fix:"Enable tap-to-select, a persistent details panel, visible segment buttons, or another non-hover path for the same information."});const y=function(e,t){const a=_a[e];if(!a)return null;let r=a.includes("hoverRadius")?30:null;for(const e of a){const a=t[e];"number"==typeof a&&Number.isFinite(a)&&a>0&&(r=null==r?a:Math.max(r,a))}return null==r?null:2*r}(e,t),b=Fa(t.mobileInteraction)?t.mobileInteraction:null,v=y??("number"==typeof b?.targetSize?b.targetSize:!0===t.mobileInteraction?44:"number"==typeof c?.minimumHitTarget?c.minimumHitTarget:"number"==typeof c?.interaction?.targetSize?c.interaction.targetSize:null);null!=v&&(24>v?Ha(s,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${v}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):o>v?Ha(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${v}px, above 24px but below the ${o}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):Ga(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${v}px, meeting the configured ${o}px target.`}));const A=[];null==t.brush&&null==t.onBrush||A.push("brush"),!0===t.zoomable&&A.push("pan/zoom"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||A.push("legend filtering"),A.length>0&&!function(e,t){const a=Ba(e),r=Fa(e.mobileInteraction)?e.mobileInteraction:null,o=r?.standardControls;return!!(null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||Array.isArray(a?.interaction?.alternatives)&&a.interaction.alternatives.length>0)||!0===o||"all"===o||t.every(e=>"brush"===e?Array.isArray(o)?o.includes("brush"):"brush"===o:"pan/zoom"===e?Array.isArray(o)?o.includes("zoom"):"zoom"===o:"legend filtering"===e&&(Array.isArray(o)?o.includes("legend"):"legend"===o))}(t,A)&&Ha(s,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${A.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."}),!1===t.showLegend||!1===t.legend||!0!==t.showLegend&&!0!==t.legend&&null==t.colorBy&&null==t.groupBy&&null==t.lineBy&&null==t.areaBy&&null==t.stackBy||!0===t.directLabel||!0===t.showLabels||"direct"===t.labelStrategy||"direct-end"===t.labelStrategy||"direct"===c?.labels?.strategy||"inline"===c?.labels?.strategy||"external"===c?.labels?.strategy||r>430||Ha(s,{id:"semantics.legend-over-direct-labels",category:"semantics",impact:"medium",message:"The chart appears to rely on a legend instead of direct labels at phone width.",fix:"Prefer direct end labels, inline labels, or a compact chip selector so readers do not bounce between plot and legend."});const x=Array.isArray(t.annotations)?t.annotations.filter(e=>Fa(e)):[];if(x.length>("number"==typeof c?.maxAnnotations?c.maxAnnotations:3)&&430>=r&&Ha(s,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:x.length+" annotation(s) compete for phone plot space.",fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),x.length>0){const e=x.filter(e=>!ja(e.mobileText)&&!ja(e.shortText)&&!ja(e.label));e.length>0&&Va(s,{id:"annotation.mobile-copy",category:"annotation",impact:"low",message:e.length+" annotation(s) lack explicit short/mobile copy.",fix:"Add mobileText or shortText for notes that need to survive narrow layouts."})}d||"BigNumber"===e||Va(s,{id:"layout.no-responsive-transform",category:"layout",impact:"low",message:"No explicit responsive transformation hint is present.",fix:"Declare responsiveRules/mobileLayout or a density/label strategy so the mobile version is a designed transformation, not an accidental resize."}),u&&(c?(Ga(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart/recipe provides a mobileSemantics/mobile contract, so the audit can inspect its authored phone behavior."}),!1===c.custom?.dataBearingSceneNodes?Ha(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"medium",message:"Custom mobile contract says emitted scene nodes are not data-bearing.",fix:"Preserve datum references, semantic roles, or accessible-table fields so intelligence, navigation, and tap details can recover the chart's meaning."}):!0!==c.custom?.dataBearingSceneNodes&&Va(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"low",message:"Custom chart mobile contract does not state whether scene nodes are data-bearing.",fix:"Set mobile.custom.dataBearingSceneNodes and mobile.custom.navigationGranularity for custom layouts and interoperability adapters."})):Va(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart layout is opaque to static mobile analysis because no mobileSemantics/mobile contract is present.",fix:"Declare mobileSemantics with strategy, breakpoints, mark budgets, touch target size, interaction alternatives, and custom scene semantics."})),p||h||Ha(s,{id:"semantics.no-mobile-summary",category:"semantics",impact:"medium",message:"No title, summary, description, or ChartContainer context is visible from the config.",fix:"Add title/summary text or wrap in ChartContainer so the small-screen reader gets the task before the chart."});const w=s.filter(e=>"warn"===e.status),C={highRisk:w.filter(e=>"high"===e.impact).length,warnings:w.length,manual:s.filter(e=>"manual"===e.status).length,passes:s.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:r,ok:0===C.highRisk,summary:C,findings:s,reference:Oa}}var qa={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},Ya=["layout","density","interaction","annotation","semantics"];function Ka(e){const t=[],a=e.summary,r=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${a.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${r} - ${a.warnings} warning(s) - ${a.manual} manual check(s)`);for(const a of Ya){const r=e.findings.filter(e=>e.category===a&&"not-applicable"!==e.status);if(0!==r.length){t.push(""),t.push(" "+a.toUpperCase());for(const e of r)t.push(` ${qa[e.status]} [${e.impact}] ${e.id}: ${e.message}`),!e.fix||"warn"!==e.status&&"manual"!==e.status||t.push(" -> "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function Xa(){return["Static audit only: rendered label collision, CSS-resolved type size, and actual touch behavior still require viewport testing.","Use multiple widths, usually 320, 360, 390, 430, and 768 CSS pixels.","A mobile pass means no high-risk static warnings, not that the chart is perceptually or ergonomically optimal."]}function Ja(e,t){if("function"==typeof e)return t=>+e(t);const a=e||t;return e=>+e[a]}function Za(e,t){if("function"==typeof e)return e;const a=e||t;return e=>e[a]}var Qa=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),er=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),tr=new Set(["PieChart","DonutChart","FunnelChart"]),ar=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]);function rr(e,t){return er.has(e)||tr.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function or(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const a=e[t];if("string"==typeof a&&a)return a}}function nr(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function ir(e,t={}){const a=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,o=new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&o.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!a)return!1;const t=e?.provenance?.stableId;return!(t&&o.has(t)&&!r)})}function sr(e){return"string"==typeof e?e:e.id??e.name}function lr(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function cr(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function ur(e,t,a){return a??pa(t.recipe)??pa(t.recipeId)??ha(e)}function dr(e,t,a=[]){const r=e.accessor?t[e.accessor]:void 0;if("string"==typeof r&&r)return r;if(e.field)return e.field;const o=a.find(e=>e&&"object"==typeof e);if(!o)return;const n=Object.entries(o).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?n.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in o):n.find(([,e])=>"string"==typeof e)?.[0]}function hr(e,t){return e.dataRoles.find(e=>e.role===t)}function pr(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function mr(e,t,a,r,o,n={}){const i={...n};if(t)for(const[e,a]of Object.entries(t))i[e]=a;for(const e of a.dataRoles){const a=dr(e,r,o),n=t&&a?t[a]:a;void 0!==n&&(i[e.role]=n)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{const a=i[t];return null==a?`{${t}}`:a+""})}var fr={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",BumpChart:"bump chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},gr=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),yr=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]);function br(e){return fr[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function vr(e){const t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}var Ar=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),xr={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},wr={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},Cr=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],$r={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"};function Sr(e){return xr[e]}function kr(e,t){const a=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,a={};for(const[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(a[e]=r);return{family:t.family,intentScores:Object.keys(a).length?a:void 0}}return e}}(t);if(a?.act)return a.act;if(a?.intentScores){const e=function(e){let t,a=0;for(const[r,o]of Object.entries(e))if("number"==typeof o&&o>0)if(o>a)t=r,a=o;else if(o===a&&void 0!==t){const e=Cr.indexOf(r),a=Cr.indexOf(t);-1===e||-1!==a&&e>=a||(t=r)}return t}(a.intentScores);if(e&&xr[e]&&(a.intentScores[e]??0)>=3)return xr[e]}return a?.family?wr[a.family]:function(e){return"BumpChart"===e?"ranking":tr.has(e)||"StackedAreaChart"===e?"apportioning":Ar.has(e)?"relating":er.has(e)?"comparing":ar.has(e)?"characterizing":Qa.has(e)?"tracking":gr.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}var Rr=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),Pr=new Set(["system","agent","watcher"]),Nr=new Set(["ai","agent","system","computed","dbt","great-expectations"]),Tr=new Set(["rule","statistical-test","llm-inference","computed"]);function Ir(e){const t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;const t=e;if("string"!=typeof t.type||!Rr.has(t.type))return!1;const a=t.provenance;return!(!a||"object"!=typeof a)&&(Pr.has(a.authorKind)||Nr.has(a.source)||Tr.has(a.basis))})}function Er(e="en"){let t,a;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?a.format(e):t.format(e):e+""}var Mr={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"};function Lr(e){const t=Mr["string"==typeof e.type?e.type:"annotation"]||"an annotation",a=function(e){const t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,a=t?.authorKind??t?.source??t?.basis;return"watcher"===a?"a watcher-flagged ":"agent"===a||"ai"===a||"llm-inference"===a?"an AI-suggested ":""}(e),r=a?a+t.replace(/^an? /,""):t,o="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return o?`${r} labeled "${o}"`:r}function Or(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const a=ir(t.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return;const r=a.map(Lr),o=r.slice(0,5),n=r.length-o.length,i=function(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}(o)+(n>0?`, and ${n} more`:""),s=a.length;return`The author has marked ${1===s?"one feature":s+" features"} on this chart: ${i}.`}function zr(e,t,a={}){const r=void 0!==a.levels,o=new Set(a.levels??["l1","l2","l3"]);r||!a.capability&&!Ir(t)||o.add("l4");const n=ur(e,t,a.recipe);if(n){const e=["l1","l2","l3","l4"].filter(e=>o.has(e));r||e.includes("l4")||e.push("l4");const i=function(e,t,a={}){const r=cr(t),o=lr(t),n=a.locale??"en",i="function"==typeof e.description?e.description({data:r,config:o,locale:n}):void 0,s=i?.levels??function(e,t,a,r){const o=pr(e,["nominal","ordinal"]),n=pr(e,["quantitative"]),i=o?dr(o,a,t):void 0,s=n?dr(n,a,t):void 0,l=o?.role??i??"category",c=n?.role??s??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${l} and ${c} are mapped through the recipe's declared visual semantics`,{number:h,percent:p}=function(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}(r),m=new Map;if(i&&s)for(const e of t){const t=(e[i]??"Uncategorized")+"",a=Number(e[s]);Number.isFinite(a)&&m.set(t,(m.get(t)??0)+a)}const f=[...m].sort((e,t)=>t[1]-e[1]),g=f.reduce((e,[,t])=>e+t,0),y=f[0],b=f[1],v=g>0?((y?.[1]??0)+(b?.[1]??0))/g:0,A=e.intents.map(e=>({id:sr(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,x=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${l} and ${c}. ${w=d,w?w.charAt(0).toUpperCase()+w.slice(1):w}.`,l2:f.length>0?`${f.length} categories total ${h.format(g)}. ${y[0]} accounts for ${h.format(y[1])}${g>0?` (${p.format(y[1]/g)})`:""}${b?`, followed by ${b[0]} at ${h.format(b[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>f.length?y?y[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>v?`The total is distributed across ${f.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${y[0]} and ${b[0]}, which together account for ${p.format(v)}.`,l4:`The chart is intended for ${A??"explanation"}${x?` with a ${x} audience`:""}: ${e.designContract.whyCustom}`};var w}(e,r,o,n),l=a.levels??["l1","l2","l3","l4"],c={};for(const e of l)s[e]&&(c[e]=s[e]);const u=["l1","l2","l3","l4"].map(e=>c[e]).filter(e=>!!e).join(" "),d=a.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:u,levels:c,...d?.length?{caveats:d}:{}}}(n,t,{levels:e,locale:a.locale,audience:a.audience,includeCaveats:a.includeCaveats}),s=Or(t);return{...i,text:s?`${s} ${i.text}`.trim():i.text,...s?{annotations:s}:{}}}const i=Er(a.locale??"en"),s=br(e),l=Array.isArray(t.data)?t.data:null,c=or(t),u=yr.has(e)?function(e,t){const a=e.physics&&"object"==typeof e.physics?e.physics:null,r=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,o=[e.settledProjectionRows,e.projectionRows,r?.rows,a?.settledProjectionRows,a?.projectionRows,a?.settledProjection&&"object"==typeof a.settledProjection?a.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(o)?o.map((e,a)=>{if(!e||"object"!=typeof e)return null;const r=e,o=vr(r.count??r.value??r.total??r.bodies??r.events);if(null==o)return null;const n=r.label??r.id??r.name??"container "+(a+1),i=vr(r.secondary??r.secondaryCount),s=vr(r.observed??r.observedCount);return{label:nr(n,t),count:o,...null!=i?{secondary:i}:{},..."string"==typeof r.secondaryLabel&&r.secondaryLabel?{secondaryLabel:r.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}(t,i):null,{measure:d,measureFallback:h,dimension:p,dimensionFallback:m}=rr(e,t),f="string"==typeof d&&d?d:h,g="string"==typeof p&&p?p:m,y={};if(yr.has(e)&&function(e,t,a,r,o,n){const i=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),s=function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"body"}(e);if(o.has("l1")&&(r.l1=function(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}(e,t)),!o.has("l2")&&!o.has("l3"))return;if(!a||0===a.length)return void(o.has("l2")&&(r.l2="No settled projection is loaded yet."));const l=a.reduce((e,t)=>e+t.count,0),c=a.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),u=c[0]??a.slice().sort((e,t)=>t.count-e.count)[0];if(!u)return;const d=a.reduce((e,t)=>e+(t.secondary??0),0),h=a.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(o.has("l2"))if(0===c.length)r.l2=`The settled projection contains ${n(l)} ${Fr(l,s)} across ${a.length} ${Fr(a.length,i)}; no ${Fr(2,i)} are non-empty yet.`;else{const e=d>0?` ${n(d)} ${Fr(d,s)} ${1===d?"is":"are"} marked ${h}.`:"";r.l2=`The settled projection contains ${n(l)} ${Fr(l,s)} across ${a.length} ${Fr(a.length,i)}; ${c.length} ${Fr(c.length,i)} ${1===c.length?"is":"are"} non-empty. The largest ${i} is ${u.label} with ${n(u.count)} ${Fr(u.count,s)}.${e}`}if(o.has("l3")&&l>0&&c.length>0){const e=c.find(e=>e!==u),t=function(e,t){if(0>=t)return"0%";const a=e/t*100;return(10>a?Math.round(10*a)/10:Math.round(a))+"%"}(u.count,l);r.l3=e?`The settled projection is most concentrated in ${u.label}, which holds ${n(u.count)} ${Fr(u.count,s)} (${t}); ${e.label} follows with ${n(e.count)} ${Fr(e.count,s)}.`:`The settled projection is concentrated in ${u.label}, which holds all ${n(u.count)} ${Fr(u.count,s)}.`}}(e,s,u,y,o,i),o.has("l1")&&!yr.has(e))if("BumpChart"===e)y.l1=`A ${s} ranking ${c??"series"} by ${f} across ${g}.`;else if(Qa.has(e)||er.has(e))y.l1=`A ${s} of ${f} by ${g}`+(c?`, split by ${c}.`:".");else if(tr.has(e))y.l1=`A ${s} showing ${f} across ${g} categories.`;else if(ar.has(e))y.l1=`A ${s} of the distribution of ${f}`+(c?` by ${c}.`:".");else if(gr.has(e)){const e=Array.isArray(t.nodes)?t.nodes.length:void 0,a=Array.isArray(t.edges)?t.edges.length:void 0,r=[null!=e?`${e} ${Fr(e,"node")}`:null,null!=a?`${a} ${Fr(a,"edge")}`:null].filter(Boolean);y.l1=`A ${s}${r.length?" with "+r.join(" and "):""}.`}else if("BigNumber"===e){const e="string"==typeof t.label?t.label:f;y.l1=`A single value${e?" for "+e:""}.`}else y.l1=`A ${s}.`;const b=Qa.has(e)||"BumpChart"===e||er.has(e)||tr.has(e)||ar.has(e);let v=null;if((o.has("l2")||o.has("l3")||o.has("l4"))&&b&&l&&l.length>0&&(v=function(e,t,a,r){let o=0,n=0,i=1/0,s=-1/0,l=null,c=null,u=0,d=0,h=null,p=null,m=NaN,f=NaN;for(const a of e){const e=t(a);Number.isFinite(e)&&(0===o&&(m=e,h=a),f=e,p=a,i>e&&(i=e,l=a,u=o),e>s&&(s=e,c=a,d=o),o++,n+=e)}return 0===o?null:{count:o,min:i,max:s,mean:n/o,minLabel:nr(null!=l?a(l):null,r),maxLabel:nr(null!=c?a(c):null,r),first:m,last:f,firstLabel:nr(null!=h?a(h):null,r),lastLabel:nr(null!=p?a(p):null,r),minIndex:u,maxIndex:d}}(l,Ja(d,h),Za(p,m),i)),o.has("l2")&&b&&(l&&0!==l.length?v&&(y.l2=tr.has(e)?`${v.count} segments totaling ${i(function(e){return e.mean*e.count}(v))}. Largest is ${v.maxLabel} at ${i(v.max)}; smallest is ${v.minLabel} at ${i(v.min)}.`:`${f} ranges from ${i(v.min)} (${v.minLabel}) to ${i(v.max)} (${v.maxLabel}), with a mean of ${i(v.mean)} across ${v.count} points.`):y.l2="No data is loaded yet."),o.has("l3")&&v&&!c&&Qa.has(e)?y.l3=function(e,t,a){const{first:r,last:o,min:n,max:i,maxLabel:s,minLabel:l,firstLabel:c,lastLabel:u,minIndex:d,maxIndex:h,count:p}=e,m=i-n,f=o-r;if(0===m)return`${_r(t)} is constant at ${a(r)} across the series.`;if(.04>m/(Math.abs(e.mean)||1))return`${_r(t)} ends roughly where it started (${a(r)} at ${c} to ${a(o)} at ${u}), ranging between ${a(n)} and ${a(i)}.`;const g=h>0&&p-1>h,y=d>0&&p-1>d,b=(i-Math.max(r,o))/m,v=(Math.min(r,o)-n)/m;return g&&b>.15?`Overall ${t} climbs to a peak of ${a(i)} (${s}), then falls to ${a(o)} (${u}).`:y&&v>.15?`Overall ${t} drops to a low of ${a(n)} (${l}), then recovers to ${a(o)} (${u}).`:.05>Math.abs(f)/m?`${_r(t)} ends roughly where it started (${a(r)} at ${c} to ${a(o)} at ${u}), ranging between ${a(n)} and ${a(i)}.`:f>0?h===p-1?`Overall ${t} rises from ${a(r)} (${c}) to a peak of ${a(o)} (${u}).`:`Overall ${t} rises from ${a(r)} (${c}) to ${a(o)} (${u}), after peaking at ${a(i)} (${s}).`:d===p-1?`Overall ${t} falls from ${a(r)} (${c}) to a low of ${a(o)} (${u}).`:`Overall ${t} falls from ${a(r)} (${c}) to ${a(o)} (${u}), after dipping to ${a(n)} (${l}).`}(v,f,i):o.has("l3")&&v&&!c&&er.has(e)&&(y.l3=`The highest ${g} is ${v.maxLabel} and the lowest is ${v.minLabel}.`),o.has("l4")){const r=Ir(t)?"alerting":kr(e,a.capability);r&&(y.l4=function(e,t,a,r,o,n,i,s){const l=$r[e],c=/^[aeiou]/i.test(l)?"an":"a";let u,d;switch(e){case"locating":u="This is a map",d="read values by location";break;case"presenting":u="This is a single-value display",d=`read ${"string"==typeof a.label&&a.label?a.label:o} as the headline number`;break;case"tracing":u=`This is ${c} ${l} chart`,d="follow the movement between states";break;case"nesting":u=`This is ${c} ${l} chart`,d="read it for nested structure and how children sum into their parents";break;case"relating":u=`This is ${c} ${l} chart`,d=`read it for whether ${n} and ${o} move together`;break;default:u=`This is ${c} ${l} chart`,d=function(e,t,a,r,o,n){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+a;case"comparing":return`compare ${a} across ${r}`;case"ranking":return"read it top to bottom by "+a;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+a;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,a){if(er.has(a)||tr.has(a))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:r,last:o,min:n,max:i,minLabel:s,maxLabel:l,lastLabel:c,minIndex:u,maxIndex:d,count:h}=e,p=i-n;if(p>0){const e=d>0&&h-1>d,a=u>0&&h-1>u,m=(i-Math.max(r,o))/p,f=(Math.min(r,o)-n)/p;if(e&&m>.15)return`the peak of ${t(i)} at ${l} is the point to investigate`;if(a&&f>.15)return`the dip to ${t(n)} at ${s} is the point to investigate`;if(o>=i)return`the climb to ${t(o)} at ${c} warrants a closer look`;if(n>=o)return`the drop to ${t(o)} at ${c} warrants a closer look`}return`the extremes — ${l} (${t(i)}) and ${s} (${t(n)}) — are the points to check`}(t,o,n);case"tracking":return`read it for the trajectory of ${a}, which ${function(e){const t=e.max-e.min,a=e.last-e.first;return 0===t||.05>Math.abs(a)/t?"holds roughly steady":a>0?"rises":"falls"}(t)} from ${o(t.first)} (${t.firstLabel}) to ${o(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${a} across ${r}; ${t.maxLabel} leads at ${o(t.max)}`;case"ranking":return`read it top to bottom by ${a}; ${t.maxLabel} ranks highest at ${o(t.max)}`;case"apportioning":{const e=t.mean*t.count,a=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${o(e)} total; ${t.maxLabel} is the largest at ${o(t.max)}${null!=a?` (${a}%)`:""}`}case"characterizing":return`read it for the spread of ${a}, from ${o(t.min)} to ${o(t.max)}`;default:return"read the highlighted features"}}(e,r,o,n,i,t)}return`${u}; ${d}.${function(e,t){if(!t)return"";const a=t.familiarity?.[e];return"number"!=typeof a||a>2?"":` This ${br(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,s)}`}(r,e,t,c?null:v,f,g,i,a.audience))}const A=["l1","l2","l3","l4"].filter(e=>o.has(e)&&y[e]).map(e=>y[e]).join(" "),x=Or(t);return{text:x?`${x} ${A}`.trim():A,levels:y,...x?{annotations:x}:{}}}function _r(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Fr(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function jr(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Br(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function Dr(e,t="—"){return null==e||""===e?t:"object"==typeof e?Dr(e.id??e.name??e.label,t):e+""}function Ur(e){if(null==e||""===e)return;const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Gr(e){return Dr(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Hr(e,t){const a=Br(e,t,"children");return Array.isArray(a)?a:[]}function Vr(e,t,a){return`${e} ${1===e?t:a}`}function Wr(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?", leaf total "+t(e.leafTotal):`, known leaf total ${t(e.leafTotal)} across ${Vr(e.numericLeaves,"valued leaf","valued leaves")}`}function qr(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function Yr(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function Kr(e,t="—"){return null==e||""===e?t:"object"==typeof e?Kr(e.id??e.name??e.label,t):e+""}function Xr(e){if(null==e||""===e)return;const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Jr(e){return Kr(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Zr(e){const t=[];return(e.linkedHover||e.selection||e.linkedBrush)&&t.push("Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&t.push("Hover or focus a mark for its details."),t.length>0?" "+t.join(" "):""}function Qr(e,t,a){const r=Yr(e,t,a);if(void 0!==r)return r;const o=e.properties;return o&&"object"==typeof o?Yr(o,t,a):void 0}function eo(e,t,a){return Kr(Qr(e,t,"id")??Qr(e,"name","name")??Qr(e,"NAME","NAME")??Qr(e,"label","label"),a)}function to(e){let t=0,a=1/0,r=-1/0,o=0;for(const n of e)null!=n.value&&(t+=1,a=Math.min(a,n.value),r=Math.max(r,n.value),o+=n.value);return 0===t?null:{count:t,min:a,max:r,total:o,average:o/t}}function ao(e,t){const a=to(e);return a?`range ${t(a.min)} to ${t(a.max)}, average ${t(a.average)}, total ${t(a.total)}`:"no numeric values"}function ro(e,t,a,r){const o=function(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];const t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}(t.areas),n="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],i=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],l=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?o:n).map((a,r)=>({datum:a,index:r,label:eo(a,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${r+1}`),value:Xr(Qr(a,l,"value"))})),d=u.filter(e=>null!=e.value),h={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${o.length} regions.${d.length>0?` Values are available for ${d.length} of ${o.length} regions; ${ao(d,r)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${i.length} flows and ${n.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${n.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${n.length} locations.`}${Zr(t)}`,children:[]};if("ChoroplethMap"===e)h.children=function(e,t,a){const r=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),o=new Map;let n,i=0;for(const[e,t]of r.entries())n!==t.value&&(i=e+1,n=t.value),o.set(t.index,i);let s=0;return function(e){const t=e.filter(e=>null!=e.value),a=e.filter(e=>null==e.value),r=[],o=to(t);if(o)if(o.min===o.max)r.push({id:"equal",label:"Equal values",rows:t});else{const e=o.min+(o.max-o.min)/3,a=o.min+2*(o.max-o.min)/3,n=t.filter(e=>e.value>=a),i=t.filter(t=>t.value>=e&&a>t.value),s=t.filter(t=>e>t.value);n.length>0&&r.push({id:"highest",label:"Highest values",rows:n}),i.length>0&&r.push({id:"middle",label:"Middle values",rows:i}),s.length>0&&r.push({id:"lowest",label:"Lowest values",rows:s})}return a.length>0&&r.push({id:"missing",label:"No numeric value",rows:a}),r}(e).map(e=>{const n=e.rows.slice(0,Math.max(0,t-s));s+=n.length;const i=n.map(e=>{const t=o.get(e.index),n=null==t||2>r.length?"":`, rank ${t} of ${r.length}`;return{id:`geo-${Jr(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?e.label+": no numeric value.":`${e.label}: ${a(e.value)}${n}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),l=e.rows.length-n.length;return l>0&&i.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${l} more ${1===l?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:"regions-"+e.id,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${ao(e.rows,a)}.`,children:i}})}(u,a,r);else if(u.length>0){const e=u.slice(0,a).map(e=>({id:`geo-${Jr(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":": "+r(e.value)}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>a&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-a} more locations.`}),h.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}const p="FlowMap"===e?i:s;if(p.length>0){const e=p.slice(0,a).map((e,t)=>{const a=Kr(e.source,"unknown"),o=Kr(e.target,"unknown"),n=Xr(Yr(e,l,"value"));return{id:`route-${Jr(a)}-${Jr(o)}-${t}`,role:"datum",level:3,label:`${a} to ${o}${null==n?"":": "+r(n)}.`,...null==n?{}:{value:n},datum:e}});h.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${p.length} ${1===p.length?"route":"routes"}.`,children:e})}return h}var oo=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),no=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),io=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]);function so(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function lo(e,t="—"){return null==e||""===e?t:"object"==typeof e?lo(e.id??e.name??e.label,t):e+""}function co(e){if(null==e||""===e)return;const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function uo(e){return lo(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function ho(e,t){const a=[];return(e.linkedHover||e.selection||e.linkedBrush)&&a.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&a.push("Hover or focus a mark for its details."),a.length>0?" "+a.join(" "):""}function po(e,t){t&&e.children?.push(t)}function mo(e,t,a={}){const r=a.locale??"en",o=Math.max(1,a.maxLeaves??200),n=Er(r),i=ur(e,t,a.recipe);if(i)return function(e,t,a={}){const r=cr(t),o=lr(t),n=Math.max(1,a.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:r,config:o,locale:a.locale??"en"});const i=(s=e.navigation)&&"object"==typeof s?e.navigation:void 0;var s;const l=(i?.groupByRole?hr(e,i.groupByRole):void 0)??(i?.groupBy?.[0]?hr(e,i.groupBy[0])??e.dataRoles.find(e=>e.field===i.groupBy?.[0]):void 0)??pr(e,["nominal","ordinal"]),c=l?dr(l,o,r):void 0,u=(i?.idRole?hr(e,i.idRole):void 0)??pr(e,["identifier"]),d=u?dr(u,o,r):void 0,h={id:"root",role:"chart",label:i?.summaryTemplate?mr(i.summaryTemplate,void 0,e,o,r,{count:r.length}):`${e.name}: ${r.length} ${1===r.length?"item":"items"} represented.`,level:1,children:[]};let p=0;const m=(t,a,n)=>{const s=d?t[d]:void 0,l=i?.itemLabelTemplate?mr(i.itemLabelTemplate,t,e,o,r,{count:r.length}):function(e,t,a,r){const o=pr(t,["nominal","ordinal"]),n=t.dataRoles.filter(e=>"quantitative"===e.semanticType),i=o?dr(o,a,r):void 0,s=[];i&&null!=e[i]&&s.push(e[i]+"");for(const t of n){const o=dr(t,a,r);o&&null!=e[o]&&s.push(`${t.role}: ${e[o]+""}`)}return s.length>0?s.join(", "):"Data item"}(t,e,o,r);return{id:"datum-"+jr(s??a),role:"datum",label:l,level:n,datum:t}};if(c){const e=new Map;for(const t of r){const a=(t[c]??"Uncategorized")+"",r=e.get(a);r?r.push(t):e.set(a,[t])}h.children=[...e].map(([e,t],a)=>{const r=t.slice(0,Math.max(0,n-p));p+=r.length;const o=r.map((e,t)=>m(e,1e5*a+t,3));return t.length>r.length&&o.push({id:"more-"+jr(e),role:"datum",label:`…and ${t.length-r.length} more items`,level:3}),{id:"group-"+jr(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:o}})}else{const e=r.slice(0,n);h.children=e.map((e,t)=>m(e,t,2)),r.length>e.length&&h.children.push({id:"more",role:"datum",label:`…and ${r.length-e.length} more items`,level:2})}return h}(i,t,{maxLeaves:o,locale:r});const s={id:"root",role:"chart",label:zr(e,t,{locale:r}).text||"Chart.",level:1,children:[]},l=function(e,t){const a=Array.isArray(e.annotations)?e.annotations:null;if(!a)return null;const r=ir(a.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let o=0;const n=r.slice(0,t).map(e=>{const t=e.lifecycle?.status,a=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+o++,role:"annotation",level:3,label:`${r=Lr(e),r?r.charAt(0).toUpperCase()+r.slice(1):r}${a}.`,datum:e};var r});r.length>t&&n.push({id:"annotation-"+o++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});const i=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===i?"one marked feature":i+" marked features"}.`,children:n}}(t,o);if(oo.has(e)){const a=function(e,t,a,r){const o=Array.isArray(t.nodes)?t.nodes:[],n=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],i=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",l=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>lo(so(e,i,"id"),"unknown"),d=(e,t)=>lo(so(e,t,""),"unknown"),h=new Set;for(const e of n)h.add(d(e,s)),h.add(d(e,l));const p=o.length>0?o:[...h].map(e=>({id:e})),m=new Map;for(const e of p)m.set(u(e),{links:0,value:0});for(const e of n){const t=d(e,s),a=d(e,l),r=co(so(e,c,"value"))??0;for(const e of[t,a]){const t=m.get(e)??{links:0,value:0};t.links+=1,t.value+=r,m.set(e,t)}}const f={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${p.length} nodes and ${n.length} links.${ho(t,"network")}`,children:[]};let g=0;const y=new Map,b=t.colorBy??"group";for(const e of p){const t=lo(so(e,b,"group"),"Ungrouped"),a=y.get(t);a?a.push(e):y.set(t,[e])}const v=[...y].map(([e,t],o)=>{const n=[];for(const[e,i]of t.entries()){if(g>=a)break;g+=1;const t=u(i),s=m.get(t)??{links:0,value:0},l=s.value>0?`, ${r(s.value)} total flow`:"";n.push({id:`node-${o}-${e}-${uo(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${l}.`,value:s.value>0?s.value:void 0,datum:i})}return{id:`nodes-${o}-${uo(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:n}});v.length>0&&f.children?.push(...v);const A=n.slice(0,a).map((e,t)=>{const a=d(e,s),o=d(e,l),n=co(so(e,c,"value"));return{id:`link-${uo(a)}-${uo(o)}-${t}`,role:"datum",level:3,label:`${a} to ${o}${null==n?"":": "+r(n)}.`,value:n,datum:e}});return n.length>a&&A.push({id:"links-more",role:"datum",level:3,label:`…and ${n.length-a} more links.`,value:void 0}),A.length>0&&f.children?.push({id:"links",role:"series",level:2,label:`Links: ${n.length} ${1===n.length?"connection":"connections"}.`,children:A}),f}(e,t,o,n);return po(a,l),a}if(no.has(e)){const a=function(e,t,a,r){const o=t.data&&"object"==typeof t.data?t.data:null,n=t.childrenAccessor??"children",i=t.valueAccessor??"value",s=t.nodeLabel??t.nodeIdAccessor,l=new WeakMap,c=new WeakSet,u=e=>{const t=l.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);const a=Hr(e,n);let r;if(0===a.length){const t=Ur(Br(e,i,"value"));r={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else r=a.reduce((e,t)=>{const a=u(t);return{descendants:e.descendants+1+a.descendants,depth:Math.max(e.depth,a.depth+1),leaves:e.leaves+a.leaves,numericLeaves:e.numericLeaves+a.numericLeaves,leafTotal:e.leafTotal+a.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),l.set(e,r),r};let d=0;const h=(e,t,o,l)=>{const c=Dr(Br(e,s,"name"),"item "+o);if(l.has(e))return{id:`hierarchy-${Gr(o)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};const p=Hr(e,n),m=u(e);if(0===p.length){if(d>=a)return null;d+=1;const n=Ur(Br(e,i,"value"));return{id:`hierarchy-${Gr(o)}-${Gr(c)}`,role:"datum",level:t,label:`${c}${null==n?"":": "+r(n)}.`,...null==n?{}:{value:n},datum:e}}const f=new Set(l);f.add(e);const g=[];let y=0;for(const[e,r]of p.entries()){if(d>=a){y+=u(r).leaves;continue}const n=h(r,t+1,`${o}-${e}`,f);n&&g.push(n)}return y>0&&g.push({id:`hierarchy-${Gr(o)}-more`,role:"datum",level:t+1,label:`${Vr(y,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${a}.`}),{id:`hierarchy-${Gr(o)}-${Gr(c)}`,role:"series",level:t,label:`${c}: ${Vr(p.length,"direct child","direct children")}, ${Vr(m.descendants,"total descendant","total descendants")}, ${Vr(m.leaves,"leaf","leaves")}${Wr(m,r)}.`,datum:e,children:g}},p=o?u(o):null,m={id:"root",role:"chart",level:1,label:o?`A ${qr(e)} chart with ${Vr(p.leaves,"leaf","leaves")} and ${Vr(p.descendants,"total descendant","total descendants")} across ${Vr(p.depth,"hierarchy level","hierarchy levels")}${Wr(p,r)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(o){const e=h(o,2,"root",new Set);if(e){const t=Dr(Br(o,s,"name"),"");m.children="series"===e.role&&""===t?e.children:[e]}}return m}(e,t,o,n);return po(a,l),a}if(io.has(e)){const a=ro(e,t,o,n);return po(a,l),a}const c=Array.isArray(t.data)?t.data:null,u=function(e,t={},a={}){return!!ur(e,t,a.recipe)||oo.has(e)||no.has(e)||io.has(e)||Qa.has(e)||er.has(e)||tr.has(e)||ar.has(e)}(e,t,a);if(!c||0===c.length||!u)return l&&(s.children=[l]),s;const{measure:d,measureFallback:h,dimension:p,dimensionFallback:m}=rr(e,t),f=Ja(d,h),g=Za(p,m),y="string"==typeof d&&d?d:h,b="string"==typeof p&&p?p:m,v=or(t);let A=0;const x=e=>`${e}-${A++}`,w=(e,t)=>{const a=e.slice(0,o).map(e=>((e,t)=>{const a=f(e),r=nr(g(e),n);return{id:x("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(a)?n(a):"—"}`,value:Number.isFinite(a)?a:void 0,datum:e}})(e,t));return e.length>o&&a.push({id:x("more"),role:"datum",level:t,label:`…and ${e.length-o} more points`}),a},C=[];if(Qa.has(e)||er.has(e)){let t=1/0,a=-1/0,r=1/0,o=-1/0;const i=[];let s=!0;for(const e of c){const n=f(e);Number.isFinite(n)&&(t>n&&(t=n),n>a&&(a=n));const l=g(e);i.push(l),"number"==typeof l&&Number.isFinite(l)?(r>l&&(r=l),l>o&&(o=l)):s=!1}const l=new Set,u=[];for(const e of i){const t=e+"";l.has(t)||(l.add(t),u.push(e))}const d=s?`${n(r)} to ${n(o)}`:`${nr(u[0],n)} to ${nr(u[u.length-1],n)} (${er.has(e)?u.length+" categories":c.length+" points"})`;C.push({id:x("axis"),role:"axis",level:2,label:`${er.has(e)?"Category axis":"X axis"}: ${b}, ${d}.`}),t>a||C.push({id:x("axis"),role:"axis",level:2,label:`Value axis: ${y}, ${n(t)} to ${n(a)}.`})}if(v){const a=Za(v,v),o=new Map;for(const e of c){const t=(a(e)??"—")+"",r=o.get(t);r?r.push(e):o.set(t,[e])}const n=[];for(const[a,i]of o){const o=zr(e,{...t,data:i},{levels:["l2","l3"],locale:r}).text;n.push({id:x("series"),role:"series",level:2,label:`Series ${a}: ${o}`,children:w(i,3)})}s.children=[...C,...n]}else s.children=[...C,...w(c,2)];return l&&s.children.push(l),s}function fo(e,t){const a=[],r=e=>{if(a.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)r(t)};return r(e),a}function go(e){let t=1;if(e.children)for(const a of e.children)t+=go(a);return t}var yo=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]);function bo(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function vo(e){return bo(e)?e:void 0}function Ao(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function xo(e){const t=Ao(e);return null==t?void 0:Math.max(0,Math.floor(t))}function wo(...e){return e.map(vo).find(Boolean)}function Co(...e){return e.find(Array.isArray)}function $o(e){const t={};for(const[a,r]of Object.entries(e))void 0!==r&&(t[a]=r);return t}function So(e,t,a){return e["string"==typeof t&&t?t:a]}function ko(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function Ro(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Po(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function No(e,t,a){const r=e?.filter(e=>!0===vo(e)?.sensor).length,o=vo(t?.observation),n=vo(o?.sensors),i=Co(a?.activeSensors);return Math.max(r??0,n?Object.keys(n).length:0,i?.length??0)||void 0}function To(e,t,a={}){const{capability:r,audience:o,locale:n}=a,i=a.levels??["l1","l2","l3"],s=!1!==a.includeStructure,l=kr(e,r),c=zr(e,t,{levels:l?[...i,"l4"]:i,locale:n,capability:r,audience:o}),{l4:u,...d}=c.levels,h=["l1","l2","l3"].map(e=>c.levels[e]).filter(Boolean).join(" "),p={levels:d,text:c.annotations?`${c.annotations} ${h}`.trim():h,...c.annotations?{annotations:c.annotations}:{}};let m;if(l&&u){const e=(f=r)?"fits"in f||"buildProps"in f?{family:f.family}:{family:f.family,intentScores:f.intentScores}:{};m={act:l,sentence:u,family:e.family,intentScores:e.intentScores}}var f;const g=s?mo(e,t,{maxLeaves:a.maxLeaves,locale:n}):void 0,y=function(e,t,a){if(!1===a)return;const r=bo(a)?a:void 0,o=vo(t.physics),n=wo(r?.snapshot,o?.snapshot,t.physicsSnapshot,function(e){const t=vo(e);return!!t&&(bo(t.world)||"simulationState"in t||"liveBodyOrder"in t)}(t.snapshot)?t.snapshot:void 0),i=wo(r?.evidence,o?.evidence,t.physicsEvidence,t.settledEvidence),s=wo(r?.config,o?.config,n?.config,t.config),l=wo(vo(n?.world),vo(o?.world)),c=wo(vo(s?.kernel),vo(l?.options)),u=Co(l?.bodies),d=Co(l?.colliders,s?.colliders),h=Co(n?.queue,o?.queue),p=Co(n?.liveBodyOrder),m=Co(l?.springs),f=Co(n?.activeSensorPairs),g=function(e){if(!e||0===e.length)return;const t=e.map((e,t)=>{const a=vo(e);if(!a)return;const r=Ao(a.count??a.value??a.total??a.bodies??a.events);if(null==r)return;const o=(a.label??a.id??a.name??"container "+(t+1))+"",n=null==a.id?void 0:a.id+"",i=Ao(a.secondary??a.secondaryCount),s=Ao(a.observed??a.observedCount);return $o({id:n,label:o,count:r,secondary:i,secondaryLabel:"string"==typeof a.secondaryLabel?a.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;const a=t.reduce((e,t)=>e+t.count,0),r=t.filter(e=>e.count>0).length,o=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:a,populatedCount:r,...o?{leader:o}:{}}}(function(e,t,a,r){const o=vo(e.settledProjection),n=vo(t?.settledProjection);return Co(a?.projectionRows,a?.aggregates,e.settledProjectionRows,e.projectionRows,o?.rows,t?.settledProjectionRows,t?.projectionRows,n?.rows,r?.binCounts)}(t,o,r,i)),y=function(e,t){const a=e?.map((e,t)=>{const a=vo(e);if(!a)return;const r=Ao(a.count)??0,o=Ao(a.total),n={label:(a.label??a.id??"sediment "+(t+1))+"",count:r};return null!=a.id&&(n.id=a.id+""),null!=o&&(n.total=o),n}).filter(e=>null!=e),r=xo(t?.bins)??a?.length??0,o=Ao(t?.count)??a?.reduce((e,t)=>e+t.count,0)??0,n=Ao(t?.total)??a?.reduce((e,t)=>e+(t.total??0),0),i=a?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==r||0!==o||n)return{bins:r,count:o,...null!=n&&n>0?{total:n}:{},...i?{leader:i}:{}}}(Co(r?.sediment,o?.sediment,n?.sediment),wo(r?.sedimentTotals,o?.sedimentTotals)),b=p?.length??u?.length??xo(i?.bodyCount),v=function(e){if(e)return e.filter(e=>!0===vo(e)?.sleeping).length}(u)??xo(i?.sleepingCount),A=h?.length,x="string"==typeof n?.simulationState?n.simulationState:void 0,w="boolean"==typeof i?.settled?i.settled:x?"settled"===x:null!=b||null!=v||null!=A?null!=b&&v===b&&0===(A??0):void 0,C=vo(c?.gravity),$=Ao(C?.x),S=Ao(C?.y),k=$o({state:x,settled:w,elapsedSeconds:Ao(n?.elapsedSeconds),paused:"boolean"==typeof n?.paused?n.paused:void 0,visible:"boolean"==typeof n?.visible?n.visible:void 0,seed:Ao(c?.seed),gravity:null!=$&&null!=S?{x:$,y:S}:void 0,fixedDt:Ao(s?.fixedDt??c?.fixedDt),timeScale:Ao(s?.timeScale),maxSubsteps:xo(s?.maxSubsteps),liveBodies:b,sleepingBodies:v,queued:A,bodyLimit:Ao(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),R=$o({colliders:d?.length,sensors:No(d,s,l),springs:m?.length,activeSensorPairs:f?.length}),P=Object.keys(R).length>0,N=yo.has(e);if(!(Object.keys(k).length>0||P||g||y)||!N&&null==a)return;const T={simulation:k,...P?{geometry:R}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},I=function(e){const t=[],a=e.simulation,r=[a.state??(a.settled?"settled":void 0),null!=a.liveBodies?`${a.liveBodies} live ${Ro(a.liveBodies,"body")}`:void 0,null!=a.sleepingBodies?a.sleepingBodies+" sleeping":void 0,null!=a.queued?a.queued+" queued":void 0,null!=a.seed?"seed "+Po(a.seed):void 0,a.gravity?`gravity (${Po(a.gravity.x)}, ${Po(a.gravity.y)})`:void 0,null!=a.fixedDt?`fixed step ${Po(a.fixedDt)}s`:void 0,null!=a.timeScale?Po(a.timeScale)+"x time":void 0].filter(Boolean);r.length>0&&t.push(`Physics simulation: ${r.join("; ")}.`);const o=e.geometry;if(o){const e=[null!=o.colliders?`${o.colliders} ${Ro(o.colliders,"collider")}`:void 0,null!=o.sensors?`${o.sensors} ${Ro(o.sensors,"sensor")}`:void 0,null!=o.springs?`${o.springs} ${Ro(o.springs,"spring")}`:void 0,null!=o.activeSensorPairs?`${o.activeSensorPairs} active sensor ${Ro(o.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}const n=e.aggregates;if(n){const e=n.leader,a=e?` Largest is ${e.label} with ${Po(e.count)}.`:"";t.push(`Physics aggregates: ${Po(n.totalCount)} settled ${Ro(n.totalCount,"body")} across ${n.rows.length} ${Ro(n.rows.length,"container")}; ${n.populatedCount} populated.${a}`)}const i=e.sediment;if(i){const e=null!=i.total?", value total "+Po(i.total):"",a=i.leader?`; largest sediment bin is ${i.leader.label} with ${Po(i.leader.count)}`:"";t.push(`Physics sediment: ${i.count} retained ${Ro(i.count,"body")} in ${i.bins} ${Ro(i.bins,"bin")}${e}${a}.`)}return t.join(" ")}(T);return{...T,text:I}}(e,t,a.physics),b=function(e,t,a){const r=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&r.push(`Current value is ${ko(t.value)}.`);const e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,a="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;r.push(`The gauge scale runs from ${ko(e)} to ${ko(a)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){const o=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&r.push(`The ProcessSankey time domain runs from ${ko(t.domain[0])} to ${ko(t.domain[1])}.`),o.length>0){r.push(`${o.length} source flow${1===o.length?"":"s"} are supplied.`);for(const n of o.slice(0,a)){const a=So(n,t.sourceAccessor,"source"),o=So(n,t.targetAccessor,"target"),i=So(n,t.valueAccessor,"value");r.push("ProcessSankey"!==e||null==n.startTime&&null==n.endTime?`${ko(a)} to ${ko(o)} has value ${ko(i)}.`:`${ko(a)} to ${ko(o)} has value ${ko(i)} over ${ko(n.startTime)}–${ko(n.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){const e=vo(t.data),o="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",n="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",i="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",s=[],l=e=>{const t=Array.isArray(e[o])?e[o]:[];if(0!==t.length)for(const e of t){const t=vo(e);t&&l(t)}else s.push(e)};if(e&&l(e),s.length>0){r.push(s.length+" hierarchy leaves are supplied.");for(const e of s.slice(0,a))r.push(`${ko(e[i])} has value ${ko(e[n])}.`)}}if(yo.has(e)&&Array.isArray(t.data)){const a=t.data;r.push(`${a.length} observed source row${1===a.length?"":"s"} are supplied.`);const o="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,n="CollisionSwarmChart"===e?"x":"value",i=a.map(e=>Ao(So(e,o,n))).filter(e=>null!=e);i.length>0&&r.push(`Observed ${"string"==typeof o?o:n} ranges from ${ko(Math.min(...i))} to ${ko(Math.max(...i))}.`)}if(0!==r.length)return{source:"chart-props",statements:r,text:"Exact chart-prop facts: "+r.join(" ")}}(e,t,Math.max(1,a.maxLeaves??200)),v=[p.text,m?.sentence,y?.text,b?.text].filter(Boolean).join(" ");return{component:e,description:p,intent:m,structure:g,physics:y,facts:b,text:v}}function Io(e,t=30){return Math.max((e??4)+5,12,t)}var Eo=["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"],Mo=new Set(Eo);function Lo(e){return Mo.has(e)}var Oo="1",zo=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend","recipe","layout"]),_o=new Set(["data","nodes","edges","points","areas","lines","flows"]);function Fo(e){if(null==e)return e;if("function"==typeof e)return;if("object"!=typeof e)return e;if(e.$$typeof)return;if(Array.isArray(e))return e.map(Fo).filter(e=>void 0!==e);if(e instanceof Date)return e;const t={};for(const[a,r]of Object.entries(e)){if("function"==typeof r)continue;if(r&&"object"==typeof r&&r.$$typeof)continue;const e=Fo(r);void 0!==e&&(t[a]=e)}return t}function jo(e,t){return!!_o.has(e)&&("areas"!==e||"string"!=typeof t)}var Bo="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function Do(e,t,a){const r=ha(e)??pa(t.recipe)??pa(t.recipeId);if(r)return function(e,t,a){const r=function(e,t,a){const r={};for(const[o,n]of Object.entries(e))if(null!=n&&!zo.has(o)&&"recipeId"!==o&&(t||!jo(o,n)))if("function"==typeof n||n?.$$typeof){if(a)throw Error(`Portable recipe prop "${o}" is not JSON-safe.`)}else if(ua(n))r[o]=Bo(n);else if(a)throw Error(`Portable recipe prop "${o}" is not JSON-safe.`);return r}(t,!1!==a?.includeData,"portable"===e.portability),o=e.intents.map(sr).filter(e=>!!e),n={name:e.name,intents:o,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily};if("portable"===e.portability){if(!ua(r))throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:r,manifest:n,version:Oo,createdAt:(new Date).toISOString(),...a?.selections?{selections:a.selections}:{}}}return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:"Recipe contains or may depend on non-serializable local layout callbacks.",warnings:["This config is inspectable but cannot be rendered remotely by CLI or MCP."],props:r,manifest:n,version:Oo,createdAt:(new Date).toISOString(),...a?.selections?{selections:a.selections}:{}}}(r,t,a);if(!Lo(e))throw Error(`Unknown component "${e}". Known components: ${Eo.join(", ")}`);const o=!1!==a?.includeData,n={};for(const[e,a]of Object.entries(t))if(null!=a&&!zo.has(e)&&(o||!jo(e,a))&&"function"!=typeof a&&!a?.$$typeof)try{n[e]=Bo(Fo(a))}catch{}return{component:e,props:n,version:Oo,createdAt:(new Date).toISOString(),...a?.selections?{selections:a.selections}:{}}}function Uo(e){if(!e.component||!e.props)throw Error("Invalid chart config: missing component or props");if("ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw Error("Invalid chart recipe config: missing recipeId");const t=ha(e.recipeId);if(!t)throw Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...Bo(e.props),recipeId:e.recipeId}}}if(!Lo(e.component))throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:Bo(e.props)}}function Go(e){const t=JSON.stringify(e);return"sc="+btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ho(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");const a=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(escape(atob(a)));return JSON.parse(r)}async function Vo(e,t="json"){const a="jsx"===t?Wo(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(a)}function Wo(e){const{props:t}=e,a=["<"+("LocalChartRecipe"===e.component?"ChartRecipe":e.component)];e.recipeId&&a.push(` recipeId="${e.recipeId}"`);for(const[e,r]of Object.entries(t))if("string"==typeof r)a.push(` ${e}="${r}"`);else if("boolean"==typeof r&&!0===r)a.push(" "+e);else if("boolean"==typeof r&&!1===r)a.push(` ${e}={false}`);else if("number"==typeof r)a.push(` ${e}={${r}}`);else{const t=JSON.stringify(r);a.push(80>t.length?` ${e}={${t}}`:` ${e}={${JSON.stringify(r,null,2)}}`)}return a.push("/>"),a.join("\n")}function qo(e){const t=Object.create(null);for(const[a,r]of e){const e=[];for(const[,t]of r.clauses){const a=Object.create(null);for(const[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:Array.from(r.values)}:{type:"interval",range:r.range};e.push({clientId:t.clientId,type:t.type,fields:a})}t[a]={name:r.name,resolution:r.resolution,clauses:e}}return t}function Yo(e){const t=new Map;for(const[a,r]of Object.entries(e)){const e=new Map;for(const t of r.clauses){const a=Object.create(null);for(const[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:new Set(r.values)}:{type:"interval",range:r.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:a})}t.set(a,{name:r.name,resolution:r.resolution,clauses:e})}return t}async function Ko(e,t){const{format:a="png",filename:r="chart",scale:o=2,background:n="white"}=t||{},i=e.querySelector("svg");if(!i)throw Error("No SVG element found in the container");const s=i.cloneNode(!0),l=i.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",l.width+""),s.getAttribute("height")||s.setAttribute("height",l.height+""),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),Xo(i,s),"svg"===a){const e=(new XMLSerializer).serializeToString(s);Jo(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),r+".svg")}else{const t=l.width*o,a=l.height*o,i=document.createElement("canvas");i.width=t,i.height=a;const c=i.getContext("2d");c.fillStyle=n,c.fillRect(0,0,t,a),c.scale(o,o);const u=e.querySelector("canvas");u&&c.drawImage(u,0,0,l.width,l.height);const d=(new XMLSerializer).serializeToString(s),h=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),p=URL.createObjectURL(h),m=new Image;m.width=l.width,m.height=l.height,await new Promise((e,t)=>{m.onload=()=>{c.drawImage(m,0,0),i.toBlob(a=>{a?(Jo(a,r+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(p)},m.onerror=()=>{URL.revokeObjectURL(p),t(Error("Failed to load SVG image"))},m.src=p})}}function Xo(e,t){const a=e.children,r=t.children,o=window.getComputedStyle(e),n=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(const e of n){const a=o.getPropertyValue(e);a&&"none"!==a&&""!==a&&t.style?.setProperty(e,a)}for(let e=0;Math.min(a.length,r.length)>e;e++)Xo(a[e],r[e])}function Jo(e,t){const a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}function Zo(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[a,r]of Object.entries(e))a.startsWith("_")||null!=r&&""!==r&&("number"==typeof r?Number.isFinite(r)&&(t[a]=r):"string"==typeof r?t[a]=r:"boolean"==typeof r?t[a]=r+"":r instanceof Date&&(t[a]=r.toISOString().slice(0,10)));return t}function Qo(e){return e&&"object"==typeof e?e:{}}function en(e){return Qo(e.accessibility).tableFields??e.accessibleDatum??e.datum}function tn(e){const t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:t+""}function an(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function rn(e){return"number"==typeof e&&Number.isFinite(e)}function on(e){if(rn(e.x)&&rn(e.y)&&rn(e.w)&&rn(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(rn(e.x)&&rn(e.y)&&rn(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(rn(e.cx)&&rn(e.cy)&&rn(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(rn(e.cx)&&rn(e.cy)&&rn(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};const t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&rn(e[0])&&rn(e[1]));return t.length>0?{x0:Math.min(...t.map(e=>e[0])),y0:Math.min(...t.map(e=>e[1])),x1:Math.max(...t.map(e=>e[0])),y1:Math.max(...t.map(e=>e[1]))}:null}function nn(e,t){const a=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),r=Math.min(Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0));return r>0?a/r:0}function sn(e,t,a,r,o){if(e===t)return!0;const n=a.dataRoles.map(e=>dr(e,r,o)).filter(e=>!!e).filter(a=>null!=e[a]&&null!=t[a]);return n.length>0&&n.every(a=>e[a]+""==t[a]+"")}function ln(e,t,a,r,o,n="warn",i){return{id:e,category:t,status:a?"pass":n,message:a?r:o,...i?{evidence:i}:{}}}function cn(e){const{recipe:t}=e,a=function(e){return Array.isArray(e)?e:e&&"object"==typeof e?[...e.nodes??e.sceneNodes??[],...e.sceneEdges??[]]:[]}(e.scene),r=e.layoutConfig??lr({layoutConfig:e.layoutConfig}),o=e.dimensions.plot??{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},n=o.x??0,i=o.y??0,s=[],l=a.filter(e=>null!=an(e)),c=a.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||function(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));s.push(ln("geometry.finite","geometry",0===c.length,"All emitted geometry is finite.",c.length+" marks contain non-finite geometry.","fail",{count:c.length}));const u=a.map(on),d=u.filter(e=>e&&(e.x0>=e.x1||e.y0>=e.y1)).length;s.push(ln("geometry.nonzero-area","geometry",0===d,"All bounded marks have positive area.",d+" marks have zero or negative area.","warn",{count:d}));const h=u.filter(e=>e&&(n>e.x0||i>e.y0||e.x1>n+o.width||e.y1>i+o.height)).length;s.push(ln("geometry.bounds","geometry",0===h,"All bounded marks stay inside the plot.",h+" marks extend outside the plot bounds.","warn",{count:h}));const p=t.audit?.minimumHitTargetSize??t.accessibility.minimumHitTarget??24,m=u.filter(e=>!!e&&(p>e.x1-e.x0||p>e.y1-e.y0)).length;s.push(ln("interaction.target-size","interaction",0===m,`All bounded targets meet the declared ${p}px minimum.`,`${m} targets are smaller than ${p}px in at least one dimension.`,"warn",{count:m,minimumTarget:p}));const f=l.map(tn),g=f.filter(e=>!e).length,y=new Set,b=f.filter(e=>!(!e||!y.has(e)&&(y.add(e),1)));s.push(ln("identity.stable-ids","identity",0===g,"Every data-bearing mark exposes a stable id.",g+" data-bearing marks have no pointId, id, or transition key.",t.audit?.requireStableIds?"fail":"warn",{missing:g})),s.push(ln("identity.unique-ids","identity",0===b.length,"Stable mark ids are unique.",b.length+" duplicate stable ids were observed.","fail",{duplicates:[...new Set(b)].slice(0,10)}));const v=f.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;v>0&&s.push({id:"identity.index-pattern",category:"identity",status:"warn",message:v+" ids look index-derived and may change when data is reordered.",remediation:"Derive ids from a declared identifier role or stable domain key."});const A=new Set;let x=0;const w=e.inputData;for(const e of l){const a=an(e),o=Array.isArray(a)?a:[a];let n=!1;for(const e of o)if(e&&"object"==typeof e)for(let a=0;w.length>a;a+=1)sn(e,w[a],t,r,w)&&(A.add(a),n=!0);n||(x+=1)}const C=Math.max(0,w.length-A.size);s.push(ln("coverage.input-data","coverage",0===C,"Every input datum is represented by the observed scene.",C+" input data items have no matching scene mark.",t.audit?.requireDatumCoverage?"fail":"warn",{represented:A.size,input:w.length})),s.push(ln("coverage.scene-data","coverage",0===x,"Every data-bearing scene mark maps back to input data.",x+" scene marks do not map back to an input datum.","warn",{count:x}));const $=t.encodings?.some(e=>"count"===e.channel);!$&&l.length>A.size&&A.size>0&&s.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});const S=l.filter(e=>!1===e.interactive).length;s.push(ln("interaction.hit-targets","interaction",0===S&&l.length>0,"Every observed data-bearing scene node participates in hit testing.",0===l.length?"No data-bearing scene nodes were emitted for interaction.":S+" data-bearing marks explicitly disable interaction.","fail"));const k=(e.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),R=k.filter(e=>!y.has(e));s.push(ln("coverage.annotation-anchors","coverage",0===R.length,k.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",R.length+" annotations point to missing scene ids.","fail",{unresolved:R}));const P=(e.chart?.selectedIds??[]).filter(e=>!y.has(e));e.chart?.selectedIds&&s.push(ln("interaction.selection-reachability","interaction",0===P.length,"Selected/highlighted states resolve to observed marks.",P.length+" selected ids are not reachable in the scene.","fail",{missing:P}));const N=function(e){const t=[];if(!Array.isArray(e))return t;const a=e.some(e=>e&&("line"===e.type||"area"===e.type));for(const r of e)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":if(a)break;t.push({label:"Point",values:Zo(en(r))});break;case"line":case"area":{const e=en(r),a=Array.isArray(e)?e:[],o="line"===r.type?"Line point":"Area point";for(const e of a)t.push({label:o,values:Zo(e)});break}case"rect":{const e=en(r),a=null!=e&&"object"==typeof e?e:{},o=a.category??r.group??"",n=a.value??a.__aggregateValue??a.total,i=Zo(a);null==i.category&&""!==o&&(i.category=o+""),null==i.value&&null!=n&&(i.value="number"==typeof n||"string"==typeof n?n:n+""),t.push({label:"Bar",values:i});break}case"heatcell":{const e=Zo(en(r));null==e.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(e.value=r.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=en(r),a=Zo(e);if(null==a.category){const t=Qo(e),r=t.category??t.label;null!=r&&(a.category=r+"")}t.push({label:"Wedge",values:a});break}case"circle":t.push({label:"Node",values:Zo(en(r))});break;case"arc":t.push({label:"Arc",values:Zo(en(r))});break;case"candlestick":t.push({label:"Candlestick",values:Zo(en(r))});break;case"geoarea":{const e=Qo(en(r)),a=Zo(e);if(null==a.name){const t=Qo(e.properties).name??e.name;null!=t&&(a.name=t+"")}t.push({label:"Region",values:a});break}}}catch{}return t}(a),T=(t.accessibility.tableFields??t.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;const a=e.role?t.dataRoles.find(t=>t.role===e.role):void 0;return a?dr(a,r,w):void 0}).filter(e=>!!e),E=new Set(N.flatMap(e=>Object.keys(e.values))),M=T.filter(e=>!E.has(e));s.push(ln("accessibility.table-fields","accessibility",0===M.length,T.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${M.join(", ")}.`,"fail",{expectedFields:T,observedFields:[...E]})),new Set(w.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&2>=E.size&&[...E].every(e=>"category"===e||"value"===e)&&s.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});const L=(t.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);s.push(ln("accessibility.color-only","accessibility",0===L.length,"Every declared color encoding names a redundant cue.",L.length+" color encodings have no declared redundant cue.","warn"));const O=e.chart;if(O){for(const[e,a]of[["title",t.accessibility.requiresTitle],["summary",t.accessibility.requiresSummary],["description","required"===t.accessibility.description]])a&&s.push(ln("accessibility."+e,"accessibility","string"==typeof O[e]&&O[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(t.accessibility.requiresAccessibleTable||"required"===t.accessibility.accessibleTable||t.accessibility.fallbackTable)&&s.push(ln("accessibility.fallback-table","accessibility",!1!==O.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),O.navigationTree&&s.push(ln("accessibility.navigation-depth","accessibility",(O.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}const z=e.theme?.background??"#ffffff",_=a.filter(e=>{const t=e.style?.fill??e.fill;if("string"!=typeof t||!t.startsWith("#")||!z.startsWith("#"))return!1;const a=I(t,z);return null!=a&&3>a}).length;s.push(ln("visual.contrast","visual",0===_,"All statically checkable mark fills meet 3:1 contrast.",_+" marks have fill contrast below 3:1.","warn",{background:z}));let F=0;const j=u.filter(e=>!!e).slice(0,500);for(let e=0;j.length>e;e+=1)for(let t=e+1;j.length>t;t+=1).8>nn(j[e],j[t])||(F+=1);F>j.length&&s.push({id:"visual.overlap-density",category:"visual",status:"warn",message:F+" near-total mark overlaps suggest occlusion or excessive density.",remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});const B=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),D={dataRoles:t.dataRoles.map(e=>e.role),intents:t.intents.map(sr).filter(e=>!!e),accessibilityExpectations:[...t.accessibility.requirements??[],...t.accessibility.tableFields?.map(e=>"table field: "+e.label)??[]],fallbackDeclared:!0===t.accessibility.fallbackTable||"required"===t.accessibility.accessibleTable||!0===t.accessibility.requiresAccessibleTable,designContractDeclared:!!t.designContract?.whyCustom},U=[...s,...B],G=s.filter(e=>"fail"===e.status).length;return{recipeId:t.id,ok:0===G,summary:{marks:a.length,passes:U.filter(e=>"pass"===e.status).length,warnings:U.filter(e=>"warn"===e.status).length,failures:G,manual:U.filter(e=>"manual"===e.status).length},declaredSemantics:D,observedSceneEvidence:s,manualATChecks:B}}function un(e){let t=1/0,a=-1/0;for(const r of e)t>r&&(t=r),r>a&&(a=r);return[t,a]}function dn(e){return"nominal"===e||"ordinal"===e}function hn(e){return"quantitative"===e||"temporal"===e}var pn={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},mn={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},fn={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function gn(e){e=function(e){if(!function(e){return e.usermeta?.idid}(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!function(e){return"annotation-layer"===e.usermeta?.idid?.role}(e));if(1!==t.length)return e;const{layer:a,...r}=e,{usermeta:o,...n}=t[0];return{...r,...n}}(e);const t=[],{type:a,markProps:r}=function(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...a}=e;return{type:t,markProps:a}}(e.mark),o=e.encoding||{},n=o.x,i=o.y,s=o.color,l=o.size,c=o.theta,u=o.opacity;let d;e.data?.values?d=e.data.values:e.data?.url&&t.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&t.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&t.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&t.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||o.facet||o.row||o.column)&&t.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&t.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&t.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const h={};e.width&&(h.width=e.width),e.height&&(h.height=e.height);const p=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(p&&(h.title=p),s?.field&&(h.colorBy=s.field,s.scale?.scheme)){const e=pn[s.scale.scheme];e&&(h.colorScheme=e)}void 0!==u?.value&&(h.pointOpacity=u.value);const m=n?.aggregate,f=i?.aggregate;if(d&&(m||f)){const e=f?i:n,t=f?n:i,a=fn[e.aggregate];if(a&&t?.field&&e.field)d=function(e,t){const{groupBy:a,value:r,agg:o="sum"}=t,n=new Map;for(const t of e){const e=t[a]+"";n.has(e)||n.set(e,[]),n.get(e).push(Number(t[r]))}const i=[];for(const[e,t]of n){let r;switch(o){case"count":r=t.length;break;case"mean":r=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":r=un(t)[0];break;case"max":r=un(t)[1];break;default:r=t.reduce((e,t)=>e+t,0)}i.push({[a]:e,value:r})}return i}(d,{groupBy:t.field,value:e.field,agg:a});else if(("count"===a||"count"===e.aggregate)&&t?.field&&d){const e=new Map;for(const a of d){const r=a[t.field]+"";e.set(r,(e.get(r)||0)+1)}d=Array.from(e,([e,a])=>({[t.field]:e,value:a}))}}if(n?.bin||i?.bin){const e="Histogram";d&&(h.data=d),n?.bin?(h.valueAccessor=n.field,i?.field&&(h.categoryAccessor=i.field),n.axis?.title&&(h.valueLabel=n.axis.title)):i?.bin&&(h.valueAccessor=i.field,n?.field&&(h.categoryAccessor=n.field),i.axis?.title&&(h.valueLabel=i.axis.title));const a=n?.bin||i?.bin,r="object"==typeof a?a.maxbins:void 0;return r&&(h.bins=r),bn(e,h,t)}let g;switch(a){case"bar":g=function(e,t,a,r,o,n,i){let s;return a?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(s="StackedBarChart",r.stackBy=a.field):s="BarChart",dn(e?.type)&&hn(t?.type)?(r.categoryAccessor=e.field,r.valueAccessor=i?"value":t.field,e?.axis?.title&&(r.categoryLabel=e.axis.title),t?.axis?.title&&(r.valueLabel=t.axis.title)):hn(e?.type)&&dn(t?.type)?(r.categoryAccessor=t.field,r.valueAccessor=n?"value":e.field,r.orientation="horizontal",t?.axis?.title&&(r.categoryLabel=t.axis.title),e?.axis?.title&&(r.valueLabel=e.axis.title)):(e?.field&&(r.categoryAccessor=e.field),t?.field&&(r.valueAccessor=i?"value":t.field),e?.axis?.title&&(r.categoryLabel=e.axis.title),t?.axis?.title&&(r.valueLabel=t.axis.title)),o&&(r.data=o),s}(n,i,s,h,d,m,f);break;case"line":if(g="LineChart",yn(n,i,h,m,f),s?.field&&(h.lineBy=s.field),r.interpolate){const e=mn[r.interpolate];e&&(h.curve=e)}!0===r.point&&(h.showPoints=!0),d&&(h.data=d);break;case"area":if(s?.field?(g="StackedAreaChart",h.areaBy=s.field):g="AreaChart",yn(n,i,h,m,f),r.interpolate){const e=mn[r.interpolate];e&&(h.curve=e)}void 0!==r.opacity&&(h.areaOpacity=r.opacity),d&&(h.data=d);break;case"point":case"circle":case"square":l?.field?(g="BubbleChart",h.sizeBy=l.field,l.scale?.range&&(h.sizeRange=l.scale.range)):g="Scatterplot",yn(n,i,h,m,f),d&&(h.data=d);break;case"rect":g="Heatmap",n?.field&&(h.xAccessor=n.field),i?.field&&(h.yAccessor=i.field),s?.field&&(h.valueAccessor=s.field,delete h.colorBy),n?.axis?.title&&(h.xLabel=n.axis.title),i?.axis?.title&&(h.yLabel=i.axis.title),d&&(h.data=d);break;case"arc":r.innerRadius&&r.innerRadius>0?(g="DonutChart",h.innerRadius=r.innerRadius):g="PieChart",c?.field?h.valueAccessor=c.field:i?.field&&(h.valueAccessor=f?"value":i.field),s?.field&&(h.categoryAccessor=s.field),n?.field&&!c?.field&&(h.categoryAccessor=n.field),d&&(h.data=d);break;case"tick":g="DotPlot",dn(n?.type)?(h.categoryAccessor=n.field,i?.field&&(h.valueAccessor=f?"value":i.field),n?.axis?.title&&(h.categoryLabel=n.axis.title),i?.axis?.title&&(h.valueLabel=i.axis.title)):dn(i?.type)?(h.categoryAccessor=i.field,n?.field&&(h.valueAccessor=m?"value":n.field),h.orientation="horizontal",i?.axis?.title&&(h.categoryLabel=i.axis.title),n?.axis?.title&&(h.valueLabel=n.axis.title)):(n?.field&&(h.categoryAccessor=n.field),i?.field&&(h.valueAccessor=f?"value":i.field)),d&&(h.data=d);break;default:t.push(`Unsupported mark type "${a}". Defaulting to Scatterplot.`),g="Scatterplot",yn(n,i,h,m,f),d&&(h.data=d)}return bn(g,h,t)}function yn(e,t,a,r,o){e?.field&&(a.xAccessor=r?"value":e.field),t?.field&&(a.yAccessor=o?"value":t.field),e?.axis?.title&&(a.xLabel=e.axis.title),t?.axis?.title&&(a.yLabel=t.axis.title)}function bn(e,t,a){const r={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(a.length>0){r.warnings=a;for(const e of a)console.warn("[semiotic/fromVegaLite] "+e)}return r}var vn=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const a of e){const e=this.push(a);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e(this.buffer[(t+a)%this._capacity],a)}toArray(){const e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e[a]=this.buffer[(t+a)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");const t=this.toArray();let a=0,r=[];t.length>e&&(a=t.length-e,r=t.slice(0,a)),this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(let e=a;t.length>e;e++)this.push(t[e]);return r}update(e,t){const a=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let o=0;this._size>o;o++){const n=(r+o)%this._capacity,i=this.buffer[n];if(e(i)){let e;e="object"!=typeof i||null===i?i:Array.isArray(i)?[...i]:{...i},a.push(e),this.buffer[n]=t(i)}}return a}remove(e){const t=[],a=[];if(this.forEach(r=>{e(r)?a.push(r):t.push(r)}),0===a.length)return a;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return a}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},An=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}evict(e){e!==this._min&&e!==this._max||(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(const a of e){const e=t?t(a):a;Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},xn=["name","label","title"],wn=["type","kind","category","group","class","status","role","shape"],Cn=["value","amount","total","count","weight","score"],$n=new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);function Sn(e,t){for(const a of t){const t=e.find(e=>e.lower===a);if(t)return t}}var kn=l(require("react")),Rn=require("react/jsx-runtime"),Pn={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};function Nn({chrome:e="default",className:t="",style:a,children:r,...o}){const n="default"===e?{...Pn,...a}:a;return(0,Rn.jsx)("div",{...o,"data-semiotic-tooltip-chrome":!0,className:("semiotic-tooltip "+t).trim(),style:n,children:r})}function Tn(e){return e.ownsChrome=!0,e}function In(e){if("string"!=typeof e)return null!=e;const t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function En(e){if(!kn.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const a=e.props,r=a["data-semiotic-tooltip-chrome"];if(null!=r&&!1!==r&&"false"!==r)return!0;const o=a.style;if(o&&"object"==typeof o){if(In(o.background))return!0;if(In(o.backgroundColor))return!0}return!1}Tn(Nn);var Mn=require("react/jsx-runtime");function Ln(e,t){return"function"==typeof t?t(e):e[t]}function On(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}if(e instanceof Date)return e.toLocaleDateString();if("object"==typeof e&&null!==e){if(void 0!==e.id)return e.id+"";if(void 0!==e.name)return e.name+"";try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return e+""}function zn(e={}){const{fields:t,title:a,format:r,style:o={},className:n=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let i;const s=[];if(a){const t=Ln(e,a);i=On(t,r)}if(t&&t.length>0)t.forEach(t=>{let a,o,n;"string"==typeof t?(a=t,o=t,n=r):(a=t.label,o=t.accessor||t.key||"",n=t.format||r);const i=Ln(e,o);s.push({label:a,value:On(i,n)})});else if(!a){const t=["value","y","name","id","label"];for(const a of t)if(void 0!==e[a]){i=On(e[a],r);break}if(!i){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(i=On(e[t[0]],r))}}return(0,Mn.jsxs)(Nn,{className:n,style:o,children:[i&&(0,Mn.jsx)("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:i}),s.map((e,t)=>(0,Mn.jsxs)("div",{style:{marginTop:0===t&&i?"4px":0},children:[e.label&&(0,Mn.jsxs)("span",{children:[e.label,": "]}),e.value]},t))]})}}function _n(e={}){const{fields:t=[],title:a,format:r,style:o={},className:n="",showLabels:i=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const l=[];if(a){const t=Ln(e,a);l.push({value:On(t,r)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let a,o,n;"string"==typeof t?(a=t,o=t,n=r):(a=t.label,o=t.accessor||t.key||"",n=t.format||r);const s=On(Ln(e,o),n);l.push({label:i?a:void 0,value:s})});else{const t=function(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const a=t.maxEntries??6,r=!1!==t.skipPositional,o=[];for(const[t,a]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;if(r&&$n.has(t.toLowerCase()))continue;if(null==a)continue;const e=typeof a;("string"===e||"number"===e||"boolean"===e||a instanceof Date)&&o.push({key:t,lower:t.toLowerCase(),value:a})}if(0===o.length)return{entries:[]};let n=o.findIndex(e=>xn.includes(e.lower));const i=n>=0;0>n&&(n=o.findIndex(e=>"id"===e.lower)),0>n&&(n=o.findIndex(e=>"string"==typeof e.value));const s=0>n?void 0:o[n];let l=o.filter((e,t)=>t!==n);i&&(l=l.filter(e=>"id"!==e.lower));const c=Sn(l,wn),u=Sn(l,Cn),d=new Set(wn),h=new Set(Cn),p=[];c&&p.push({key:c.key,value:c.value}),u&&p.push({key:u.key,value:u.value});for(const e of l){if(p.length>=a)break;e!==c&&e!==u&&(d.has(e.lower)||h.has(e.lower)||p.push({key:e.key,value:e.value}))}return{titleKey:s?.key,title:s?.value,entries:p}}(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:On(t.title,r),bold:!0}),t.entries.forEach(e=>{l.push({label:i?e.key:void 0,value:On(e.value,r)})})}return Array.isArray(l)&&0!==l.length?(0,Mn.jsx)(Nn,{className:("semiotic-tooltip-multiline "+n).trim(),style:o,children:l.map((e,t)=>(0,Mn.jsxs)("div",{style:{marginBottom:l.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&(0,Mn.jsxs)("strong",{children:[e.label,s]}),e.value]},t))}):null}}function Fn(e){return"multi"===e||jn(e)}function jn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function Bn(e){const{tooltip:t,defaultTooltipContent:a,multiDefaultContent:r=Un(),customFunctionContext:o="datum"}=e,n=t;return!1===t?{tooltipContent:()=>null}:Fn(n)?{tooltipContent:(jn(n)&&"function"==typeof n.content?Gn(n.content):void 0)||r,tooltipMode:"multi"}:"hover"===o&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:Gn(n)||a}}function Dn(e){const{tooltip:t,defaultTooltipContent:a,customFunctionContext:r="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===r&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:Gn(t)||a}}function Un(){return e=>{const t=e.allSeries;if(!t||0===t.length)return(0,Mn.jsx)(Nn,{children:(0,Mn.jsx)("div",{children:On(e.data?.value??e.data?.y)})});const a=e.xValue??e.data?.time??e.data?.x;return(0,Mn.jsxs)(Nn,{children:[null!=a&&(0,Mn.jsx)("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:On(a)}),t.map((e,t)=>(0,Mn.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[(0,Mn.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),(0,Mn.jsx)("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),(0,Mn.jsx)("span",{style:{fontWeight:500,fontSize:"0.85em"},children:On(e.value)})]},t))]})}}function Gn(e){if(!0!==e){if("function"==typeof e){const t=e;return e=>{const a=!0===e?.__semioticHoverData||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType);let r=Array.isArray(o=a?e.data??{}:e)?o[0]:o;var o;if(!r)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof r?.x0&&"number"==typeof r?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof r?.sankeyWidth)&&r.data&&"object"==typeof r.data&&(r=r.data),!r)return null;if(a&&(void 0!==e.allSeries||void 0!==e.xValue)){const t={...r};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),r=t}const n=t(r);return null==n?null:En(n)?n:(0,Mn.jsx)(Nn,{children:n})}}if(!1===e||void 0===e)return!1;if(jn(e)){if("function"==typeof e.content)return Gn(e.content);"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');const t=_n();return Gn(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){const t=zn(e);return Gn(e=>t(e))}if("multi"===e){"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');const e=_n();return Gn(t=>e(t))}return zn()}}function Hn(e=240){const t=360-e,a=180+t/2,r=a*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:a,startAngleRad:r,offsetRad:-Math.PI/2+r}}function Vn(e,t,a,r,o){const n=a-t||1;return o+(Math.max(t,Math.min(a,e))-t)/n*r}function Wn(e=240){const{sweepRad:t,offsetRad:a}=Hn(e),r=[[Math.cos(a),Math.sin(a)],[Math.cos(a+t),Math.sin(a+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-a)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||r.push([Math.cos(e),Math.sin(e)]);const o=r.map(e=>e[0]),n=r.map(e=>e[1]),[i,s]=un(o),[l,c]=un(n);return{minX:i,maxX:s,minY:l,maxY:c,width:s-i,height:c-l,cx:(i+s)/2,cy:(l+c)/2}}
1
+ function e(e){return Object.prototype.hasOwnProperty.call(Mo,e)?Mo[e]:void 0}function t(e){const t={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,r)=>{t["--semiotic-category-"+(r+1)]=e}),e.colors.focus&&(t["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(t["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(t["--semiotic-selection-opacity"]=e.colors.selectionOpacity+""),e.colors.diverging&&(t["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(t["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(t["--semiotic-success"]=e.colors.success),e.colors.danger&&(t["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(t["--semiotic-warning"]=e.colors.warning),e.colors.error&&(t["--semiotic-error"]=e.colors.error),e.colors.info&&(t["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(t["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(t["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(t["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(t["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(t["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(t["--semiotic-border-radius"]=e.borderRadius);const r=e.typography.legendSize??e.typography.labelSize;null!=r&&(t["--semiotic-legend-font-size"]=r+"px"),null!=e.typography.legendFontFamily&&(t["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(t["--semiotic-legend-font-weight"]=e.typography.legendFontWeight+"");const a=e.typography.titleFontSize??e.typography.titleSize;return null!=a&&(t["--semiotic-title-font-size"]=a+"px"),null!=e.typography.titleFontFamily&&(t["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(t["--semiotic-title-font-weight"]=e.typography.titleFontWeight+""),null!=e.typography.tickFontFamily&&(t["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(t["--semiotic-tick-font-size"]=e.typography.tickSize+"px"),null!=e.typography.labelSize&&(t["--semiotic-axis-label-font-size"]=e.typography.labelSize+"px"),t}function r(e,r=":root"){return`${r} {\n${Object.entries(t(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function a(e){return{semiotic:{bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:e.tooltip?.background||e.colors.background,$type:"color"},text:{$value:e.tooltip?.text||e.colors.text,$type:"color"},radius:{$value:e.tooltip?.borderRadius||"6px",$type:"dimension"},"font-size":{$value:e.tooltip?.fontSize||"14px",$type:"dimension"},shadow:{$value:e.tooltip?.shadow||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:e.colors.selectionOpacity??.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:e.typography.legendSize+"px",$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},"title-font-size":{$value:(e.typography.titleFontSize??e.typography.titleSize)+"px",$type:"dimension"},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:e.typography.tickSize+"px",$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:e.typography.labelSize+"px",$type:"dimension"}}:{},secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}function o(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>s(t(e))}function n(e,t){const r=o(e),a=o(t);return(e,t)=>{const o=a(e);return{value:o,x:r(e),y:o,category:t}}}function i(e,t){const r=o(t??"value"),a=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=a?a(e):void 0;return{value:r(e),category:null==t?void 0:t+""}}}function s(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function c(e,t,r){const a=null!=e.axis?r[e.axis]:null!=e.field?t[e.field]:r.value;if(void 0!==e.eq&&a!==e.eq)return!1;if(void 0!==e.ne&&a===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(a))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;const o=s(a);if(void 0===o)return!1;if(void 0!==e.gt&&e.gt>=o)return!1;if(void 0!==e.gte&&e.gte>o)return!1;if(void 0!==e.lt&&o>=e.lt)return!1;if(void 0!==e.lte&&o>e.lte)return!1;if(void 0!==e.within){const[t,r]=e.within;if(t>o||o>r)return!1}if(void 0!==e.outside){const[t,r]=e.outside;if(o>=t&&r>=o)return!1}return!0}function l(e,t,r){const a=e.when;return void 0===a||!0===a||!1!==a&&("function"==typeof a?a(t,r):c(a,t,r))}function u(e,t,r){if(!t||0===t.length)return{};let a={};for(const o of t){if(!l(o,e,r))continue;const t="function"==typeof o.style?o.style(e,r):o.style;t&&(a={...a,...t})}return a}function d(e,t,r,a=e=>e){const o=e??(()=>({}));return t&&0!==t.length?(e,n)=>{const i=a(e),s={...o(e,n)};return Object.assign(s,u(i,t,r(i,n))),s}:o}function h(e,t,r){return e&&0!==e.length?(a,o)=>{const n=u(a,e,t(a,o)),i=r?r(a,o):void 0;return i?{...n,...i}:n}:r}function p(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));const r=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!r)return null;const[a,o,n]=[parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255],i=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*i(a)+.7152*i(o)+.0722*i(n)}function f(e,t){const r=p(e),a=p(t);return null===r||null===a?null:(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}function m(e){return Math.min(255,Math.max(0,Math.round(e)))}function g(e){if("string"!=typeof e)return null;const t=e.trim().toLowerCase(),r=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(r){const e=r.length>4?r:r.split("").map(e=>`${e}${e}`).join("");return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}const a=t.match(/^rgba?\(\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))(?:\s*,\s*(-?(?:\d+|\d*\.\d+)))?\s*\)$/);if(!a)return null;const o=[Number(a[1]),Number(a[2]),Number(a[3])],n=void 0===a[4]?1:Number(a[4]);return o.some(e=>!Number.isFinite(e)||0>e||e>255)||!Number.isFinite(n)||0>n||n>1?null:{r:o[0],g:o[1],b:o[2],a:n}}function y(e,t){return 1>t.a?null:{r:m(e.r*e.a+t.r*(1-e.a)),g:m(e.g*e.a+t.g*(1-e.a)),b:m(e.b*e.a+t.b*(1-e.a)),a:1}}function b(e){return 1>e.a?null:"#"+[e.r,e.g,e.b].map(e=>m(e).toString(16).padStart(2,"0")).join("")}function v(e,t,r){const a=g(e),o=g(t);if(!a||!o)return null;const n=y({...a,a:a.a*Math.min(1,Math.max(0,r))},o);return n?b(n):null}function w(e){const t=g(e.backgroundColor),r=t?b(t):null,a=v(e.scaffoldColor,e.backgroundColor,e.scaffoldOpacity??1),o=a&&r?f(a,r):null,n=e.dataColors.map(t=>v(t,e.backgroundColor,1)).map(e=>e&&r?f(e,r):null).filter(e=>null!==e);if(null===o||n.length!==e.dataColors.length||0===n.length)return{ok:!0,status:"manual",method:"mark-to-scaffold-contrast",finding:{code:"VISUAL_HIERARCHY_MANUAL",status:"manual",message:"Visual hierarchy could not be computed from the supplied colors.",fix:"Resolve CSS variables, gradients, or named colors to solid colors and run the audit again."}};const i=Math.min(...n),s=i/o,c={weakestDataContrast:i,scaffoldContrast:o,hierarchyRatio:s},l=Math.max(1,e.minimumScaffoldContrast??1.1);return l>o?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:c,finding:{code:"SCAFFOLD_VISIBILITY",status:"warn",message:"Reference scaffolding may be too faint to remain useful.",fix:"Increase grid or guide contrast while keeping it below the primary data marks."}}:3>i||o>Math.max(l,e.maximumScaffoldContrast??2)||Math.max(1,e.minimumHierarchyRatio??2)>s?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:c,finding:{code:"SCAFFOLD_DOMINANCE",status:"warn",message:"Reference scaffolding competes with the primary data marks.",fix:"Increase mark contrast or lighten grid and guide colors until marks have at least twice the scaffold contrast."}}:{ok:!0,status:"pass",method:"mark-to-scaffold-contrast",evidence:c,finding:{code:"SCAFFOLD_DOMINANCE",status:"pass",message:"Primary data marks lead while reference scaffolding remains visible and subordinate."}}}function A(e){return Math.min(1,Math.max(0,e))}function x(e,t){return Number.isFinite(e)?e:t}function $(e){return function(e){if("string"!=typeof e||""===e.trim())return;const t=g(e);return t?b(t)??`rgba(${m(t.r)},${m(t.g)},${m(t.b)},${t.a})`:e.trim().toLowerCase()}(e)}function C(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map($).filter(e=>!!e)}function S(e){return Array.isArray(e)||e&&"object"==typeof e?C(e):[]}function k(e){return e.length>=4&&Bo.some(t=>e.length===t.length&&e.every((e,r)=>e===t[r]))}function R(e,t){const r=Array.isArray(e.data)?e.data:[];return"string"==typeof t?Array.from(new Set(r.map(e=>e[t]+""))):"function"==typeof t?Array.from(new Set(r.map((e,r)=>t(e,r)+""))):[]}function P(e,t){if(!e.evidence)return.5;const{weakestDataContrast:r,scaffoldContrast:a,hierarchyRatio:o}=e.evidence;return Math.min(A(r/3),A(a/t.scaffoldContrastMin),A(t.scaffoldContrastMax/a),A(o/t.hierarchyRatio))}function I(e,t,r,a,o,n,i){const s=r[e];return{id:e,label:Do[e],status:0===s?"disabled":i??(.8>t?"warn":"pass"),score:t,weight:s,contribution:t*s,message:a,...n?.[e]?{rationale:n[e]}:{},evidence:o}}function E(e,t,r={}){const a=r.theme??Po,o=r.profile??a.aesthetics??jo,n={...Oo,...o.weights??{}};for(const e of Object.keys(n)){const t=n[e];n[e]=Number.isFinite(t)?Math.max(0,t):0}const i=function(e){const t=e.thresholds??{},r=Math.max(1,x(t.scaffoldContrastMin,Fo.scaffoldContrastMin)),a=A(x(t.emphasisRatioMin,Fo.emphasisRatioMin));return{hierarchyRatio:Math.max(1,x(t.hierarchyRatio,Fo.hierarchyRatio)),scaffoldContrastMin:r,scaffoldContrastMax:Math.max(r,x(t.scaffoldContrastMax,Fo.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,x(t.titleScaleRatio,Fo.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round(x(t.categoricalColorMax,Fo.categoricalColorMax))),emphasisRatioMin:a,emphasisRatioMax:Math.max(a,A(x(t.emphasisRatioMax,Fo.emphasisRatioMax)))}}(o),s=function(e,t,r){const a=S(t.colorScheme),o=C(t.color),n=R(t,t.colorBy),i=_o.has(e)?R(t,t.categoryAccessor??"category"):[],s=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,c=(e,t)=>e.map((e,a)=>$(s?.[e])??("gray"===t?"#999999":r.colors.categorical.length>0?r.colors.categorical[a%r.colors.categorical.length]:"#007bff")),u=n.length>0?s?c(n,"gray"):a.length>0?a:r.colors.categorical:o.length>0?o:i.length>0&&s?c(i,"theme"):a.length>0&&!s?a:r.colors.categorical,d=u.slice(0,n.length>0||i.length>0?Math.min(u.length,Math.max(1,n.length||i.length||1)):1),h=function(e){const t=Array.isArray(e.data)?e.data:[],r=Array.isArray(e.styleRules)?e.styleRules:[],a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",o="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",n=[];for(const e of r)e.style&&"function"!=typeof e.style&&t.some((t,r)=>l(e,t,{value:Number(t[a]),category:(t[o]??"")+"",index:r}))&&n.push(...C(e.style.fill));return Array.from(new Set(n))}(t).filter(e=>!d.includes(e));return Array.from(new Set([...d,...h]))}(e,t,a),c=function(e){const t=e.colors.surface??e.colors.background,r=g(t),a=g(e.colors.background);if(!r)return t;if(1===r.a)return b(r)??t;if(!a)return t;const o=y(r,a);return o?b(o)??t:t}(a),u=w({backgroundColor:c,dataColors:s,scaffoldColor:a.colors.grid,minimumHierarchyRatio:i.hierarchyRatio,minimumScaffoldContrast:i.scaffoldContrastMin,maximumScaffoldContrast:i.scaffoldContrastMax}),d=function(e){const t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,r=[...S(e.colorScheme),...C(e.color),...C(e.fill),...C(e.stroke),...C(t?.fill),...C(t?.stroke)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(const e of a)e.style&&"function"!=typeof e.style&&r.push(...C(e.style.fill),...C(e.style.stroke));return Array.from(new Set(r))}(t),h=k(a.colors.categorical.map($).filter(e=>!!e)),p=function(e){const t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,r=[...S(e.colorScheme),...C(e.color),...C(e.fill),...C(t?.fill)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(const e of a)e.style&&"function"!=typeof e.style&&r.push(...C(e.style.fill));return Array.from(new Set(r))}(t),f="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,m=p.length>0||f?"chart":"theme",v="chart"===m?k(p)||!!f&&Lo.has(f):h,E=v?.2:"chart"===m?1:.8,N=function(e){return Math.max(1,e.length)}(s),T=N>i.categoricalColorMax?A(1-(N-i.categoricalColorMax)/i.categoricalColorMax):1,M=a.typography.titleFontSize??a.typography.titleSize,O=Math.max(a.typography.tickSize,a.typography.labelSize),F=O>0?M/O:1,j=A((F-1)/(i.titleScaleRatio-1)),z=new Set([...a.colors.categorical,a.colors.primary,a.colors.secondary,a.colors.background,a.colors.surface,a.colors.text,a.colors.textSecondary,a.colors.grid,a.colors.border,a.colors.annotation].map($).filter(e=>!!e)),B=d.filter(e=>!z.has(e)).length,L=0===d.length?1:A(1-B/d.length),_=function(e){const t=Array.isArray(e.data)?e.data:[],r=Array.isArray(e.styleRules)?e.styleRules:[];if(0===t.length||0===r.length)return{ratio:0,authored:!1};const a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",o="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>r.some(r=>l(r,e,{value:Number(e[a]),category:(e[o]??"")+"",index:t}))).length/t.length,authored:!0}}(t),D=_.authored?i.emphasisRatioMin>_.ratio?A(_.ratio/i.emphasisRatioMin):_.ratio>i.emphasisRatioMax?A(i.emphasisRatioMax/_.ratio):1:.35,U=[I("mark-scaffold-hierarchy",P(u,i),n,u.finding.message,{hierarchyRatio:u.evidence?.hierarchyRatio??0,markContrast:u.evidence?.weakestDataContrast??0,scaffoldContrast:u.evidence?.scaffoldContrast??0},o.rationales,u.status),I("palette-authorship",E,n,v?"theme"===m?"The chart inherits a ubiquitous categorical default without an organizational palette decision.":"The chart explicitly selects a ubiquitous categorical palette.":"The effective palette records an authored choice beyond the ubiquitous defaults.",{paletteSource:m,ubiquitousDefault:v,colorCount:s.length},o.rationales),I("palette-economy",T,n,`${N} color role(s) are used against a policy ceiling of ${i.categoricalColorMax}.`,{colorRoles:N,maximum:i.categoricalColorMax},o.rationales),I("typographic-hierarchy",j,n,`Title-to-supporting-type scale is ${F.toFixed(2)}×.`,{titleSize:M,supportingSize:O,ratio:F},o.rationales),I("theme-coherence",L,n,`${B} of ${d.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:d.length,outsideTheme:B},o.rationales),I("editorial-emphasis",D,n,_.authored?Math.round(100*_.ratio)+"% of marks receive authored emphasis.":"No machine-visible editorial emphasis rule is declared.",{authored:_.authored,emphasizedRatio:_.ratio},o.rationales)],V=U.reduce((e,t)=>e+t.weight,0),G=U.reduce((e,t)=>e+t.contribution,0),H=0===V?null:G/V*100,q=100*A(x(o.minimumScore,jo.minimumScore??70)/100);return{component:e,profile:o.name??"Unnamed aesthetic profile",ok:null===H||H>=q,score:H,minimumScore:q,weightedPoints:G,totalWeight:V,features:U,method:"weighted-machine-visible-features"}}function N(e){if(null==e)return"";if("number"!=typeof e)return e+"";if(!isFinite(e))return e+"";if(0===e)return"0";const t=parseFloat(e.toPrecision(12)),r=Math.abs(t);return 1e9>r?1e6>r?1e4>r?Number.isInteger(t)?t+"":parseFloat(t.toPrecision(6))+"":parseFloat((t/1e3).toPrecision(3))+"K":parseFloat((t/1e6).toPrecision(3))+"M":parseFloat((t/1e9).toPrecision(3))+"B"}function T(e){return 10>e?"0"+e:e+""}function M(e,t){return t?{month:e.getUTCMonth(),day:e.getUTCDate(),year:e.getUTCFullYear(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{month:e.getMonth(),day:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function O(e,t={}){let r,a=e;const o=(n=function(e={}){const t=e.timeZone;return"UTC"===t?{kind:"utc"}:"local"===t?{kind:"local"}:"string"==typeof t&&t.length>0?{kind:"iana",id:t}:!1===e.utc?{kind:"local"}:{kind:"utc"}}(t),"utc"===n.kind?e=>M(e,!0):"local"===n.kind?e=>M(e,!1):function(e){let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hourCycle:"h23"})}catch{return e=>M(e,!0)}return e=>{const r={};for(const a of t.formatToParts(e))"literal"!==a.type&&(r[a.type]=a.value);return{month:Math.max(0,(Number(r.month)||1)-1),day:Number(r.day)||1,year:Number(r.year)||1970,hours:Number(r.hour)||0,minutes:Number(r.minute)||0,seconds:Number(r.second)||0}}}(n.id));var n;return(t,n,i)=>{const s=t instanceof Date?t:new Date(t);e||!i||2>i.length||i===r||(r=i,a=function(e){if(2>e.length)return"days";const t=[];for(let r=1;e.length>r;r++)t.push(e[r]-e[r-1]);t.sort((e,t)=>e-t);const r=t[Math.floor(t.length/2)];return 2*Uo>r?"seconds":2*Vo>r?"minutes":2*Go>r?"hours":60*Go>r?"days":400*Go>r?"months":"years"}(i));const c=a||"days";return null!=n&&0!==n&&i&&0!==i.length?function(e,t,r,a){const o=a(e),n=a(t),i=o.year!==n.year,s=i||o.month!==n.month,c=s||o.day!==n.day,l=c||o.hours!==n.hours,u=l||o.minutes!==n.minutes,d=Ho[o.month],{day:h,year:p}=o,f=T(o.hours),m=T(o.minutes),g=T(o.seconds);switch(r){case"seconds":return i?`${d} ${h}, ${p} ${f}:${m}:${g}`:c?`${d} ${h} ${f}:${m}:${g}`:l?`${f}:${m}:${g}`:u?`${m}:${g}`:":"+g;case"minutes":return i?`${d} ${h}, ${p} ${f}:${m}`:c?`${d} ${h} ${f}:${m}`:l?`${f}:${m}`:":"+m;case"hours":return i?`${d} ${h}, ${p} ${f}:00`:s?`${d} ${h} ${f}:${m}`:c?`${d} ${h} ${f}:00`:f+":00";case"days":return i?`${d} ${h}, ${p}`:s?`${d} ${h}`:""+h;case"months":return i?`${d} ${p}`:""+d;case"years":return""+p}}(s,new Date(i[n-1]),c,o):function(e,t,r){const{month:a,day:o,year:n,hours:i,minutes:s,seconds:c}=r(e),l=Ho[a],u=T(i),d=T(s),h=T(c);switch(t){case"seconds":return`${l} ${o}, ${n} ${u}:${d}:${h}`;case"minutes":case"hours":return`${l} ${o}, ${n} ${u}:${d}`;case"days":return`${l} ${o}, ${n}`;case"months":return`${l} ${n}`;case"years":return""+n}}(s,c,o)}}function F(e,t=0,r=1/0,a=0){const o=Number.isFinite(t)?t:0,n=Number.isFinite(r)?Math.max(o,r):1/0,i=Number.isFinite(e)?Math.floor(e):o,s=Math.max(o,Math.min(n,i));return a>0&&Number.isFinite(a)?Math.max(o,Math.min(n,Math.round(s/a)*a)):s}function j(e,t=.5){const r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;const a=Math.round(parseInt(r[1],16)*(1-t)),o=Math.round(parseInt(r[2],16)*(1-t)),n=Math.round(parseInt(r[3],16)*(1-t));return`#${a.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function z(e,t=.5){const r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;const a=Math.round(parseInt(r[1],16)+(255-parseInt(r[1],16))*t),o=Math.round(parseInt(r[2],16)+(255-parseInt(r[2],16))*t),n=Math.round(parseInt(r[3],16)+(255-parseInt(r[3],16))*t);return`#${a.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function B(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle}}function L(e={},t){const{background:r="transparent",stroke:a="#000",lineWidth:o=1.5,spacing:n=6,angle:i=45}=e,s={background:r,stroke:a,lineWidth:o,spacing:n,angle:i},c=Math.max(8,Math.ceil(2*n));let l;try{l=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(qo||(qo=document.createElement("canvas")),qo.width=e,qo.height=e,qo)}(c)}catch{return B(s)}const u=l.getContext("2d");if(!u)return B(s);r&&"transparent"!==r?(u.fillStyle=r,u.fillRect(0,0,c,c)):u.clearRect(0,0,c,c),u.strokeStyle=a,u.lineWidth=o,u.lineCap="square";const d=i*Math.PI/180;if(45===i||-45===i){const e=i>0?1:-1;for(let t=-c;2*c>=t;t+=n)u.beginPath(),u.moveTo(t,0),u.lineTo(t+e*c,c),u.stroke()}else{u.save(),u.translate(c/2,c/2),u.rotate(d);const e=2*c;for(let t=-e;e>=t;t+=n)u.beginPath(),u.moveTo(-e,t),u.lineTo(e,t),u.stroke();u.restore()}return(t||u).createPattern(l,"repeat")}function _(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function D(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function U(e,t){let r=2166136261;const a=D(t);for(let e=0;a.length>e;e++)r^=a.charCodeAt(e),r=Math.imul(r,16777619);return`${e}-hatch-${(r>>>0).toString(36)}`}function V(e,t){const r=e.length,a=t.length,o=Array(a+1);for(let e=0;a>=e;e++)o[e]=e;for(let n=1;r>=n;n++){let r=o[0];o[0]=n;for(let i=1;a>=i;i++){const a=o[i];o[i]=e[n-1]===t[i-1]?r:1+Math.min(r,o[i],o[i-1]),r=a}}return o[a]}function G(e,t,r=3){let a,o=r+1;for(const r of t){const t=V(e.toLowerCase(),r.toLowerCase());o>t&&(o=t,a=r)}return o>r?void 0:a}function H(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:[...e]}function q(e,t){if(0===t.length)return null;const r=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(r)||r.includes(e.toLowerCase()))||(G(e,t,3)??null)}function W(e){return` Or use a function: ${e}={d => d.myValue}.`}function Y(e){const[t,r]=Array.isArray(e)?e:[e,void 0],a=Wo[t],o=Array.isArray(a)?[...a]:a;return void 0===r?{type:o}:{type:o,enum:[...Yo[r]]}}function K(e,t){return(Array.isArray(t)?t:[t]).includes(Array.isArray(e)?"array":typeof e)}function J(e,t){const r=[];null!=t&&"object"==typeof t||(t={});const a=Jo[e];if(!a)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(Jo).join(", ")}`]};for(const o of a.required)null==t[o]&&r.push(`"${o}" is required for ${e}.`);"array"!==a.dataShape||!Object.prototype.hasOwnProperty.call(a.props,"data")||a.required.includes("data")||function(e,t){return"mechanical"===t.mode&&("GaltonBoardChart"===e||"UnitPileChart"===e)}(e,t)||null!=t.data||r.push(`"data" is required for ${e}.`);for(const[e,o]of Object.entries(t)){if(null==o)continue;const t=a.props[e];if(t){if(!K(o,t.type)){const a=Array.isArray(t.type)?t.type.join(" | "):t.type;r.push(`"${e}" should be ${a}, got ${Array.isArray(o)?"array":typeof o}.`);continue}t.enum&&"string"==typeof o&&!t.enum.includes(o)&&r.push(`"${e}" value "${o}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}const o=Object.keys(a.props),n=new Set(o);for(const a of Object.keys(t))if(void 0!==t[a]&&!n.has(a)){const t=G(a,o),n=t?`Unknown prop "${a}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${a}" for ${e}. Valid props: ${o.join(", ")}.`;r.push(n)}if("array"===a.dataShape){const o=t.data,n={};for(const e of a.dataAccessors){const r=t[e];"string"==typeof r&&(n[e]=r)}const i=function({componentName:e,data:t,accessors:r,requiredProps:a}){if(a)for(const[t,r]of Object.entries(a))if(null==r)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)&&"object"==typeof t)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(!Array.isArray(t)||0===t.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(r){const a=H(t).find(e=>e&&"object"==typeof e);if(a){const t=Object.keys(a);for(const[o,n]of Object.entries(r))if(n&&"string"==typeof n&&!(n in a)){const r=q(n,t),a=r?` Try ${o}="${r}".`:"";return`${e}: ${o} "${n}" not found in data. Available fields: ${t.join(", ")}.${a}`+W(o)}}}return null}({componentName:e,data:o,accessors:Object.keys(n).length>0?n:void 0});i&&r.push(i)}else if("object"===a.dataShape){const a=function({componentName:e,data:t,dataLabel:r="data"}){return null==t?`${e}: No ${r} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${r} 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}({componentName:e,data:t.data});a&&r.push(a)}else if("network"===a.dataShape){const o=t.nodeIdAccessor??t.nodeIDAccessor??"id",n="string"==typeof o?{nodeIdAccessor:o}:void 0,i=function({componentName:e,nodes:t,edges:r,nodesRequired:a=!1,edgesRequired:o=!0,accessors:n}){if(null==t&&null==r)return null;if(o&&(!r||!Array.isArray(r)||0===r.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(a&&(!t||!Array.isArray(t)||0===t.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(n&&t&&t.length>0){const r=H(t).find(e=>e&&"object"==typeof e);if(r){const t=Object.keys(r);for(const[a,o]of Object.entries(n))if(o&&"string"==typeof o&&!(o in r)){const r=q(o,t),n=r?` Try ${a}="${r}".`:"";return`${e}: ${a} "${o}" not found in node data. Available fields: ${t.join(", ")}.${n}`+W(a)}}}return null}({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:a.required.includes("nodes"),edgesRequired:a.required.includes("edges"),accessors:n});i&&r.push(i)}return"GaugeChart"===e&&r.push(...function(e){if(!Array.isArray(e.thresholds))return[];const t=[];return 0===e.thresholds.length&&t.push('"thresholds" for GaugeChart must contain at least one { value, color, label? } object.'),e.thresholds.forEach((e,r)=>{if(!e||"object"!=typeof e||Array.isArray(e))return void t.push(`"thresholds[${r}]" for GaugeChart should be an object with numeric "value" and string "color".`);const a=e;"number"==typeof a.value&&Number.isFinite(a.value)||t.push(`"thresholds[${r}].value" is required for GaugeChart and must be a finite number. BigNumber's "at" threshold key is not supported here.`),"string"==typeof a.color&&0!==a.color.length||t.push(`"thresholds[${r}].color" is required for GaugeChart and must be a non-empty string.`),void 0!==a.label&&"string"!=typeof a.label&&t.push(`"thresholds[${r}].label" for GaugeChart should be a string.`);const o=Object.keys(a).filter(e=>"value"!==e&&"color"!==e&&"label"!==e);o.length>0&&t.push(`"thresholds[${r}]" has unsupported GaugeChart key(s): ${o.join(", ")}. Use { value, color, label? }; { at, level } belongs to BigNumber.`)}),t}(t)),"ScatterplotMatrix"===e&&null!=t.frameProps&&r.push('"frameProps" is not supported for ScatterplotMatrix; configure its matrix props directly.'),r.push(...function(e){const t=e.frameProps;if(null==t||"object"!=typeof t||Array.isArray(t))return[];const r=t.legendLayout;if(null==r||"object"!=typeof r||Array.isArray(r))return null==r?[]:['"frameProps.legendLayout" should be object, got '+(Array.isArray(r)?"array":typeof r)+"."];const a=[],o=r,n=new Set(["align",...Object.keys(Zo)]);for(const e of Object.keys(o))n.has(e)||a.push(`Unknown "frameProps.legendLayout" key "${e}". Valid keys: ${[...n].join(", ")}.`);void 0!==o.align&&"string"!=typeof o.align?a.push(`"frameProps.legendLayout.align" should be string, got ${Array.isArray(o.align)?"array":typeof o.align}.`):"string"!=typeof o.align||Xo.has(o.align)||a.push(`"frameProps.legendLayout.align" value "${o.align}" is not valid. Expected one of: ${[...Xo].join(", ")}.`);for(const[e,t]of Object.entries(Zo)){const r=o[e];void 0!==r&&("number"==typeof r&&Number.isFinite(r)?t.minimum>r&&a.push(`"frameProps.legendLayout.${e}" should be ${t.label} (minimum ${t.minimum}), got ${r}.`):a.push(`"frameProps.legendLayout.${e}" should be ${t.label}, got ${Array.isArray(r)?"array":typeof r}.`))}return a}(t)),{valid:0===r.length,errors:r}}function X(e){return null==e?null:e.data??e.datum??e}function Z(e,t={}){const r=[],a=e.tokenSemantics,o=e.countStrategy,n=t.maxRecommendedTokens??("fixed-denominator"!==o||function(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}(e.denominator)>en?Qo:en);return a||r.push({code:"TOKEN_SEMANTICS_UNCLEAR",severity:"warning",message:"Every tokenized encoding should state what one token represents."}),o||r.push({code:"MISSING_COUNT_STRATEGY",severity:"warning",message:"Every tokenized encoding should state how token counts are produced."}),"icon"!==e.tokenType&&"glyph"!==e.tokenType||"icon-only"!==e.labelPolicy&&"token-only"!==e.labelPolicy||r.push({code:"ICON_ONLY_LABELS",severity:"warning",message:"Icons should supplement text labels, not replace them."}),null!=t.visibleTokens&&t.visibleTokens>n&&r.push({code:"TOO_MANY_VISIBLE_TOKENS",severity:"warning",message:`This encoding renders ${t.visibleTokens} visible tokens. Consider unitizing, sampling, or a hybrid bar/token view.`}),"decorative"!==a||"icon"!==e.tokenType&&"glyph"!==e.tokenType||r.push({code:"DECORATIVE_PICTOGRAPHS",severity:"warning",message:"Decorative pictographs can harm recall and speed when they do not clarify the data."}),"unitized-measure"===a&&o&&"unitized"!==o&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Unitized measures should use the unitized count strategy so each token has a stable value."}),"risk-case"===a&&o&&"fixed-denominator"!==o&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Risk cases are usually clearest as a fixed-denominator natural frequency."}),"possible-outcome"!==a&&"posterior-sample"!==a&&"hypothetical-case"!==a||!o||"quantile"===o||"sample"===o||"posterior-sample"===o||"random-sample"===o||r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Outcome/sample tokens should come from quantiles or samples, not from a unitized magnitude."}),"unitized-measure"===a&&"unitized"===o&&null==e.unitValue&&null==e.unit&&r.push({code:"MISSING_UNIT_VALUE",severity:"warning",message:"Unitized measures should set unitValue so each token has a declared value."}),"unitized-measure"!==a||"unitized"!==o||e.unitMeaning||r.push({code:"MISSING_UNIT_MEANING",severity:"info",message:"Add unitMeaning so readers know what one full token represents."}),r}function Q(e){return"string"==typeof e?.type?e.type:""}function ee(e){return!!e&&"object"==typeof e&&$n.has(Q(e))}function te(e){return Cn.has(Q(e))&&!function(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}(e)}function re(e){const t=e.provenance,r=e.id??e.stableId??t?.stableId;return null==r||""===r?void 0:r+""}function ae(e,t,r){return"function"==typeof r?r(e,t):e[r]}function oe(e){if(e instanceof Date){const t=e.getTime();return Number.isFinite(t)?t:null}const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function ne(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function ie(e={}){const t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>(e+"").trim()).filter(Boolean),r=t.length?t:["Intake"],a=Math.max(r.length,Math.round(e.count??Math.max(48,12*r.length))),o=function(e){const t=oe(e);return null!=t&&t>0?t:1}(e.unitValue),n=ne(e.seed??1),i=e.idPrefix??"mechanical-pile",s=r.map(()=>.65+.9*n()),c=s.reduce((e,t)=>e+t,0)||1,l=a-r.length,u=s.map(e=>e/c*l),d=u.map(e=>1+Math.floor(e));let h=a-d.reduce((e,t)=>e+t,0);const p=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;h>0;e=(e+1)%p.length)d[p[e].index]+=1,h-=1;return r.map((e,t)=>({id:`${i}-${t}`,category:e,value:d[t]*o,mechanical:!0,unitCount:d[t],unitValue:o,share:d[t]/a}))}function se(e,t,r=0){const a=new Set(e.filter(e=>null!=e.id).map(e=>e.id+"")),o=new Map;for(const n of e){let e=null==n.id?`${t}-${r++}`:n.id+"";for(;null==n.id&&a.has(e);)e=`${t}-${r++}`;a.add(e),o.set(e,null==n.id?{...n,id:e}:n)}return{seed:e,rows:Array.from(o.values()),nextId:r}}function ce(e){const t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:null}function le(e,t,r){if("function"==typeof t)return t(e);const a="string"==typeof t?t:r;return e?.[a]}function ue(e,t){const r=e.nestedDataAccessorProp?t[e.nestedDataAccessorProp]:void 0;return"string"==typeof r?r:e.defaultNestedDataAccessor}function de(e,t,r){const a=e.dataProp??"data",o=t[a],n=r??(Array.isArray(o)?o:[]),i=ue(e,t);if(!i)return{dataProp:a,rows:n};const s=[];let c=!1;for(const e of n){const t=e?.[i];if(Array.isArray(t)){c=!0;for(const e of t)e&&"object"==typeof e&&s.push(e)}}return{dataProp:a,rows:c?s:n}}function he(e,t,r){const a={numbers:r?[]:void 0,finite:0,min:1/0,max:-1/0,missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(const r of e){const e=r?.[t];if(null==e||""===e){a.missing++;continue}let o;if("number"==typeof e)o=e;else if("string"==typeof e){const t=e.trim();if(""===t){a.missing++;continue}const r=Number(t);Number.isNaN(r)?/^[+-]?nan$/i.test(t)&&(o=r):o=r}void 0!==o?Number.isFinite(o)?(a.numbers?.push(o),a.finite++,a.min>o&&(a.min=o),o>a.max&&(a.max=o),0===o&&a.zero++,0>o&&a.negative++,Number.isInteger(o)||a.fractional++):a.nonFinite++:a.nonNumeric++}return a}function pe(e,t){if(0===e.length)return;const r=(e.length-1)*t,a=Math.floor(r),o=Math.ceil(r);if(a===o)return e[a];const n=r-a;return e[a]*(1-n)+e[o]*n}function fe(e,t={}){if(!Array.isArray(e)||0===e.length)return{};const r=new Set;for(const t of e)if(t&&"object"==typeof t)for(const e of Object.keys(t))r.add(e);const a={};for(const o of r){const r=he(e,o,!1!==t.quantiles),n=r.numbers?.sort((e,t)=>e-t);a[o]={field:o,observedCount:e.length-r.missing,finiteCount:r.finite,missingCount:r.missing,nonFiniteCount:r.nonFinite,nonNumericCount:r.nonNumeric,zeroCount:r.zero,negativeCount:r.negative,fractionalCount:r.fractional,...r.finite>0?{min:r.min,...n?{q1:pe(n,.25),median:pe(n,.5),q3:pe(n,.75)}:{},max:r.max}:{}}}return a}function me(e){const t=[`${e.component}: ${e.ok?"✓ numerically safe":"✗ numeric hazards found"}`,`${e.rowCount} rows · ${e.summary.fieldsChecked} numeric fields · ${e.summary.errors} errors · ${e.summary.warnings} warnings`];for(const r of e.diagnoses)t.push(`${"error"===r.severity?"ERROR":"WARN"} ${r.code}${r.field?` [${r.field}]`:""}: ${r.message}`),r.fix&&t.push(" Fix: "+r.fix);return t.join("\n")}function ge(e){return e.code.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function ye(e,t={}){const r=Number.isFinite(t.max)?Math.max(0,Math.floor(t.max)):6,a=e.diagnoses.map((e,t)=>({item:e,diagnosisIndex:t})).filter(({item:e})=>!t.errorsOnly||"error"===e.severity),o=a.slice(0,r).map(({item:e,diagnosisIndex:t})=>({id:`data-audit:${e.code}:${e.role??"chart"}:${e.field??"chart"}:${t}`,level:e.severity,title:e.field?`${ge(e)} · ${e.field}`:ge(e),message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic data audit",dismissible:!0}));return a.length>r&&o.push({id:"data-audit:overflow:chart",level:a.slice(r).some(({item:e})=>"error"===e.severity)?"error":"warning",title:`${a.length-r} more numeric finding${a.length-r===1?"":"s"}`,message:"Run auditData() or diagnoseConfig() to inspect the complete report.",source:"Semiotic data audit",dismissible:!0}),o}function be(e,t,r){return"function"==typeof e?e(t,r):t[e]}function ve(e,t){if("number"==typeof e)return Number.isFinite(e)?e:null;if(e instanceof Date){const r=e.getTime();return t&&Number.isFinite(r)?r:null}if("string"==typeof e){const r=e.trim(),a=Number(r);if(r&&Number.isFinite(a))return a;if("date-like"===t){const e=function(e){const t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;const r=En.test(t)?t+"-01":t;if(r===t&&10>t.length)return NaN;const a=Date.parse(r);return Number.isFinite(a)?a:NaN}(r);return Number.isFinite(e)?e:null}}return null}function we(e){return"number"==typeof e&&!Number.isFinite(e)}function Ae(e,t,r,a,o){const n={field:r,numbers:[],finiteRows:[],missingRows:[],nonFiniteRows:[],nonNumericRows:[],accessorErrorRows:[],zeroRows:[],negativeRows:[],fractionalRows:[]};for(let r=0;e.length>r;r++){let i;try{i=be(t,e[r],r)}catch{n.accessorErrorRows.push(r);continue}if(null==i||""===i){if(void 0!==o){n.numbers.push(o),n.finiteRows.push(r),0===o&&n.zeroRows.push(r),0>o&&n.negativeRows.push(r),Number.isInteger(o)||n.fractionalRows.push(r);continue}n.missingRows.push(r);continue}const s=ve(i,a);null!=s?(n.numbers.push(s),n.finiteRows.push(r),0===s&&n.zeroRows.push(r),0>s&&n.negativeRows.push(r),Number.isInteger(s)||n.fractionalRows.push(r)):we(i)?n.nonFiniteRows.push(r):n.nonNumericRows.push(r)}return n}function xe(e,t){const r=new Set(e.requirements??["finite"]);return r.add("finite"),("x"===e.role&&"log"===t.xScaleType||"y"===e.role&&"log"===t.yScaleType)&&r.add("positive"),[...r]}function $e(e){return e.slice(0,qn)}function Ce(e){return{domain:"data",...e}}function Se(e,t){const r=[],{observation:a,contract:o,accessorLabel:n,requirements:i}=e,s={field:n,role:o.role},c=[...a.nonFiniteRows,...a.nonNumericRows,...a.accessorErrorRows].sort((e,t)=>e-t);if(0===a.numbers.length)return r.push(Ce({severity:"error",code:"DEGENERATE_EXTENT",message:`${o.accessor}="${n}" produces no finite numeric values; the chart cannot resolve its ${o.role} input.`,fix:`Ensure ${n} contains finite numbers${"x"===o.role?" (or valid dates for a time scale)":""}.`,...s,...c.length>0?{rows:$e(c),count:c.length}:{}})),r;a.nonFiniteRows.length>0&&r.push(Ce({severity:"error",code:"NON_FINITE_VALUE",message:`${n} contains ${a.nonFiniteRows.length} NaN or infinite value${1===a.nonFiniteRows.length?"":"s"}; scale and layout math require finite numbers.`,fix:`Filter or replace NaN/Infinity in ${n} before rendering.`,...s,rows:$e(a.nonFiniteRows),count:a.nonFiniteRows.length})),!o.allowMissing&&a.missingRows.length>0&&r.push(Ce({severity:"error",code:"MISSING_NUMERIC_VALUE",message:`${n} is missing for ${a.missingRows.length} row${1===a.missingRows.length?"":"s"}; the ${o.role} role requires an explicit numeric value.`,fix:`Fill or filter missing ${n} values before rendering.`,...s,rows:$e(a.missingRows),count:a.missingRows.length}));const l=[...a.nonNumericRows,...a.accessorErrorRows].sort((e,t)=>e-t);if(l.length>0&&r.push(Ce({severity:"error",code:"NON_NUMERIC_VALUE",message:`${n} produces ${l.length} non-numeric value${1===l.length?"":"s"} for the ${o.role} role.`,fix:`Bind ${o.accessor} to a numeric field or return finite numbers from the accessor.`,...s,rows:$e(l),count:l.length})),o.domain&&a.numbers.length>=2){const[e,t]=function(e){let t=1/0,r=-1/0;for(const a of e)t>a&&(t=a),a>r&&(r=a);return[t,r]}(a.numbers);e===t&&r.push(Ce({severity:"warning",code:"ZERO_SPAN_DOMAIN",message:`${n} is constant at ${e}; its ${o.role} scale has a zero-span data domain.`,fix:`Provide varying ${o.role} values, set an explicit extent around ${e}, or use a single-value display.`,...s,rows:$e(a.finiteRows),count:a.finiteRows.length}))}if(i.includes("positive")){const t=a.numbers.map((e,t)=>({number:e,row:a.finiteRows[t]})).filter(({number:e})=>0>=e).map(({row:e})=>e);if(t.length>0){const a=e.logScale;r.push(Ce({severity:"error",code:a?"LOG_NON_POSITIVE":"NON_POSITIVE_VALUE",message:`${n} contains ${t.length} non-positive value${1===t.length?"":"s"}, which ${a?"cannot be represented on a log scale":"violate the positive-value contract"}.`,fix:a?"Remove or transform values ≤ 0, or use a linear/symlog scale.":"Provide values greater than zero.",...s,rows:$e(t),count:t.length}))}}if(i.includes("non-negative")&&a.negativeRows.length>0&&r.push(Ce({severity:"error",code:"size"===o.role?"NEGATIVE_SIZE":"NEGATIVE_VALUE",message:`${n} contains ${a.negativeRows.length} negative ${o.role} value${1===a.negativeRows.length?"":"s"}; the chart maps this role to non-negative geometry.`,fix:"Use a non-negative measure, clamp intentionally, or encode sign with position/color instead.",...s,rows:$e(a.negativeRows),count:a.negativeRows.length})),i.includes("integer")){const e=[...new Set([...a.negativeRows,...a.zeroRows,...a.fractionalRows])].sort((e,t)=>e-t);e.length>0&&r.push(Ce({severity:"error",code:"INVALID_COUNT",message:`${n} contains ${e.length} value${1===e.length?"":"s"} that are not positive integers.`,fix:"Counts must be integers ≥ 1; aggregate, round intentionally, or use a continuous-value encoding.",...s,rows:$e(e),count:e.length}))}if(i.includes("unit-interval")){const e=a.numbers.map((e,t)=>({number:e,row:a.finiteRows[t]})).filter(({number:e})=>0>e||e>1).map(({row:e})=>e);e.length>0&&r.push(Ce({severity:"error",code:"OUTSIDE_UNIT_INTERVAL",message:`${n} contains ${e.length} value${1===e.length?"":"s"} outside [0, 1].`,fix:`Normalize ${n} to [0, 1] before using it as ${o.role}.`,...s,rows:$e(e),count:e.length}))}if(t&&o.domain){const t=function(e){const t=e.observation.numbers.map((t,r)=>({value:t,row:e.observation.finiteRows[r]})).sort((e,t)=>e.value-t.value);if(8>t.length)return[];const r=t.map(e=>e.value),a=pe(r,.25),o=pe(r,.75),n=pe(r,.5),i=o-a;if(i>0){const e=a-10*i,r=o+10*i;return t.filter(t=>e>t.value||t.value>r).map(e=>e.row)}const s=100*Math.max(1,Math.abs(n));return t.filter(e=>Math.abs(e.value-n)>s).map(e=>e.row)}(e);t.length>0&&r.push(Ce({severity:"warning",code:"OUTLIER_DOMINATED_DOMAIN",message:`${n} has ${t.length} extreme value${1===t.length?"":"s"} beyond the 10×IQR guardrail; the main distribution may collapse visually.`,fix:"Verify the extreme values, then consider a log scale, robust extent, inset, or explicit annotation rather than silently clipping them.",...s,rows:$e(t),count:t.length}))}return r}function ke(e,t,r){if(!e)return"__all__";try{return be(e,t,r)+""}catch{return"__accessor_error__"}}function Re(e,t,r){if(e.whenProp&&!0!==r[e.whenProp])return[];const a=t.find(t=>t.contract.role===e.role);if(!a||0===a.observation.numbers.length)return[];const o=e.groupAccessor?r[e.groupAccessor]:void 0,n="string"==typeof o||"function"==typeof o?o:e.defaultGroupAccessor,i=new Map;for(let e=0;a.rows.length>e;e++){let t;try{t=be(a.accessor,a.rows[e],e)}catch{continue}const r=ve(t,void 0);if(null==r)continue;const o=ke(n,a.rows[e],e),s=i.get(o)??{sum:0,magnitude:0,positive:!1,negative:!1,rows:[],negativeRows:[]};s.sum+=r,s.magnitude+=Math.abs(r),s.positive||(s.positive=r>0),s.negative||(s.negative=0>r),s.rows.push(e),0>r&&s.negativeRows.push(e),i.set(o,s)}const s=[],c=[],l=[],u=[],d=[],h=[];for(const[t,r]of i)("positive-total"===e.kind&&0>=r.sum||"normalized-total"===e.kind&&Number.EPSILON*Math.max(1,r.magnitude)*10>=Math.abs(r.sum))&&(s.push(t),u.push(...r.rows)),"normalized-total"===e.kind&&r.positive&&r.negative&&(c.push(t),d.push(...r.rows)),"normalized-total"===e.kind&&r.negative&&(l.push(t),h.push(...r.negativeRows));const p=[];return s.length>0&&p.push(Ce({severity:"error",code:"normalized-total"===e.kind?"ZERO_NORMALIZED_TOTAL":"NON_POSITIVE_TOTAL",message:"normalized-total"===e.kind?`${s.length} normalization group${1===s.length?" has":"s have"} a zero total, so division would be undefined.`:"The part-to-whole total is not positive, so meaningful shares cannot be computed.",fix:"normalized-total"===e.kind?"Remove empty/zero-sum groups or disable normalization.":"Provide at least one positive value and ensure the total is greater than zero.",field:a.accessorLabel,role:e.role,rows:$e([...new Set(u)].sort((e,t)=>e-t)),count:s.length})),l.length>0&&p.push(Ce({severity:"error",code:"NEGATIVE_NORMALIZED_VALUE",message:`${l.length} normalization group${1===l.length?" contains":"s contain"} negative contributions, so conventional percentage shares are not defined.`,fix:"Use non-negative contributions, a diverging stack, or disable normalization.",field:a.accessorLabel,role:e.role,rows:$e([...new Set(h)].sort((e,t)=>e-t)),count:h.length})),c.length>0&&p.push(Ce({severity:"warning",code:"MIXED_SIGN_NORMALIZATION",message:`${c.length} normalization group${1===c.length?" mixes":"s mix"} positive and negative contributions; percentage shares may be unstable or misleading.`,fix:"Separate positive and negative contributions, use diverging stacks, or disable normalization.",field:a.accessorLabel,role:e.role,rows:$e([...new Set(d)].sort((e,t)=>e-t)),count:c.length})),p}function Pe(e,t,r,a={}){const o=a.contracts??function(e){return function(){const e=globalThis;return e[Hn]??(e[Hn]={contracts:new Map}),e[Hn]}().contracts.get(e)??Gn[e]}(e)??function(e){const t=[];for(const[r,a]of Object.entries(Wn))"string"!=typeof e[r]&&"function"!=typeof e[r]||t.push({role:a,accessor:r,..."size"===a?{requirements:["finite","non-negative"]}:{},..."x"===a||"y"===a?{domain:!0}:{}});return t.length>0?{fields:t}:void 0}(t);if(!o)return{component:e,ok:!0,rowCount:r?.length??(Array.isArray(t.data)?t.data.length:0),summary:{fieldsChecked:0,errors:0,warnings:0},contracts:[],diagnoses:[]};const n=function(e,t,r){const a=[],o=new Set;for(const n of e.fields){if(n.whenProps?.some(e=>null==t[e]))continue;const e=t[n.accessor],i="string"==typeof e||"function"==typeof e?e:n.defaultAccessor;if("string"!=typeof i&&"function"!=typeof i)continue;const{dataProp:s,rows:c}=de(n,t,r);if(0===c.length)continue;const l="string"==typeof i?i:n.accessor+"()",u=`${s}:${n.role}:${l}`;if(o.has(u))continue;o.add(u);const d=n.temporalValues??("time"===n.role||"x"===n.role&&"time"===t.xScaleType?"date-like":void 0),h="x"===n.role&&"log"===t.xScaleType||"y"===n.role&&"log"===t.yScaleType,p=xe(n,t);a.push({contract:n,accessor:i,accessorLabel:l,dataProp:s,rows:c,requirements:p,logScale:h,observation:Ae(c,i,l,d,n.missingValue)})}return a}(o,t,r),i=[],s=!1!==a.checkOutliers;for(const e of function(e,t,r){const a=new Set;for(const o of e.fields){const e=o.dataProp??"data",n=r??t[e];if(!Array.isArray(n))continue;if(0===n.length){a.add(e);continue}const i=ue(o,t);if(!i)continue;const s=n.map(e=>e?.[i]).filter(Array.isArray);s.length>0&&s.every(e=>0===e.length)&&a.add(`${e}.${i}`)}return[...a]}(o,t,r))i.push(Ce({severity:"error",code:"EMPTY_DATA",message:e+" is an explicitly empty array; there are no numeric inputs to render.",fix:`Provide at least one valid row, render an intentional empty state, or omit ${e} when using the ref push API.`,count:0,rows:[]}));const c=new Set(n.filter(e=>e.contract.domain&&1===e.rows.length).map(e=>e.dataProp));for(const e of c)i.push(Ce({severity:"warning",code:"SINGLE_ROW_DOMAIN",message:e+" has one row; a quantitative scale cannot establish variation from a single observation.",fix:"Provide at least two observations or use a single-value display such as BigNumber.",count:1,rows:[0]}));for(const e of n)i.push(...Se(e,s));for(const e of o.aggregates??[])i.push(...Re(e,n,t));const l=i.filter(e=>"error"===e.severity).length,u=i.length-l;return{component:e,ok:0===l,rowCount:n.reduce((e,t)=>Math.max(e,t.rows.length),r?.length??(Array.isArray(t.data)?t.data.length:0)),summary:{fieldsChecked:n.length,errors:l,warnings:u},contracts:n.map(e=>({role:e.contract.role,accessor:e.accessorLabel,dataProp:e.dataProp,requirements:e.requirements,allowMissing:!0===e.contract.allowMissing,...void 0!==e.contract.missingValue?{missingValue:e.contract.missingValue}:{},domain:!0===e.contract.domain})),diagnoses:i}}function Ie(e){return"object"==typeof e&&null!==e&&("tokenType"in e||"tokenSemantics"in e||"countStrategy"in e||"unitValue"in e||"unit"in e)}function Ee(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function Ne(e,t){const r=Ee(e.visibleTokens);if(null!=r)return r;const a=Ee(t.denominator);if("fixed-denominator"===t.countStrategy&&null!=a)return a;const o=Ee(t.tokenCount),n=Ee(t.maxTokens);return null!=o&&null!=n?Math.min(o,n):o??a??n}function Te(e,t){const r=t.match(/^Unknown prop "([^"]+)"/);if(r)return`Remove \`${r[1]}\` or replace it with a documented ${e} prop.`;const a=t.match(/^"([^"]+)" is required for .+\.$/i)??t.match(/(?:Missing|required) prop "?([^". ]+)/i);return a?`Add the required \`${a[1]}\` prop using the ${e} schema and example.`:t.startsWith("Unknown component")?"Choose a component returned by getSchema() or check the component name for a typo.":`Correct this ${e} prop configuration to match its schema: ${t}`}function Me(e,t){const r=[],a=J(e,function(e){const t={...e};return delete t.tokenEncoding,delete t.visibleTokens,Ie(t.encoding)&&delete t.encoding,t}(t));for(const o of a.errors)"BigNumber"===e&&void 0!==t.accessibleTable&&o.startsWith('Unknown prop "accessibleTable"')||r.push({severity:"error",code:"VALIDATION",message:o,fix:Te(e,o)});if("BigNumber"===e&&function(e,t){void 0!==e.accessibleTable&&t.push({severity:"error",code:"BIGNUMBER_ACCESSIBLE_TABLE",message:"BigNumber is a value component and does not support accessibleTable.",fix:"Remove accessibleTable. Use label, description, and summary to provide BigNumber's accessible text."})}(t,r),!Jo[e])return{ok:0===r.length,diagnoses:r};!function(e,t,r){const a=Jo[e];if(a){if("array"===a.dataShape){const e=t.data;e&&Array.isArray(e)&&0===e.length&&r.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===a.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&r.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}}(e,t,r),function(e,t,r){const a=t.width,o=t.height;if(void 0===a||"number"==typeof a&&a>0||r.push({severity:"error",code:"BAD_WIDTH",message:`width=${JSON.stringify(a)} — chart needs a positive number.`,fix:"Set width={600} or use responsiveWidth={true}."}),void 0===o||"number"==typeof o&&o>0||r.push({severity:"error",code:"BAD_HEIGHT",message:`height=${JSON.stringify(o)} — chart needs a positive number.`,fix:"Set height={400} or use responsiveHeight={true}."}),t.size&&Array.isArray(t.size)){const[e,a]=t.size;(null!=e&&0>=e||null!=a&&0>=a)&&r.push({severity:"error",code:"BAD_SIZE",message:`size=[${e}, ${a}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}(0,t,r),function(e,t,r){const a=Jo[e];if(!a||"array"!==a.dataShape)return;const o=t.data;if(!o||!Array.isArray(o)||0===o.length)return;const n=o[0];if(!n||"object"!=typeof n)return;const i=Object.keys(n);for(const e of a.dataAccessors){const a=t[e];"string"==typeof a&&(a in n||r.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${a}" not found in data. Available fields: ${i.join(", ")}.`,fix:`Change ${e} to one of: ${i.map(e=>`"${e}"`).join(", ")}, or use a function: ${e}={d => d.myValue}.`}))}}(e,t,r),function(e,t,r){tn.has(e)&&Array.isArray(t.data)&&r.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:e+" expects hierarchical data but received a flat array.",fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}(e,t,r),function(e,t,r){rn.has(e)&&(t.edges||t.data||r.push({severity:"error",code:"NETWORK_NO_EDGES",message:e+" requires an edges prop.",fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'}))}(e,t,r),function(e,t,r){const a=Jo[e];if(!a||"array"!==a.dataShape)return;const o=t.data;if(!o||!Array.isArray(o)||0===o.length)return;const n=o[0];if(!n||"object"!=typeof n)return;const i=t.xAccessor;"string"==typeof i&&n[i]instanceof Date&&!t.xFormat&&r.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${i}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}(e,t,r),function(e,t,r){t.linkedHover&&!t.selection&&r.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}(0,t,r),function(e,t,r){if(!an.has(e))return;const a=t.rExtent||t.yExtent||t.valueExtent;a&&Array.isArray(a)&&a.length>=1&&null!=a[0]&&0!==a[0]&&r.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${a[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${a[1]??"auto"}]}. For trend-focused charts, use LineChart instead.`})}(e,t,r),function(e,t,r){if(!on.has(e))return;if(t.gapStrategy)return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const o=t.yAccessor||"y";"string"==typeof o&&a.some(e=>{const t=e[o];return null==t||Number.isNaN(t)})&&r.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${o}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}(e,t,r),function(e,t,r){const a=t.width??600,o=t.height??400,n=t.margin;if(!n||"object"!=typeof n)return;const i=(n.left||0)+(n.right||0),s=(n.top||0)+(n.bottom||0);a>i||r.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${i}px) >= width (${a}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),o>s||r.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${s}px) >= height (${o}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}(0,t,r);const o=Pe(e,t,void 0,{checkOutliers:!1}).diagnoses;for(const e of o)"EMPTY_DATA"===e.code&&r.some(e=>"EMPTY_DATA"===e.code||"EMPTY_EDGES"===e.code)||r.push(e);if(function(e,t,r){if(!nn.has(e))return;const a=t.barPadding;"number"==typeof a&&10>a&&r.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${a} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}(e,t,r),function(e,t,r){if("Heatmap"!==e)return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const o=a[0];if(o&&"object"==typeof o)for(const e of["xAccessor","yAccessor"]){const a=t[e];if("string"!=typeof a)continue;const n=o[a];"string"==typeof n&&r.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${a}" resolves to string values (e.g. "${n}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}(e,t,r),function(e,t,r){const a=t.colorScheme;if(!a||!Array.isArray(a))return;const o="string"==typeof t.background?t.background:"#ffffff";if(!o.startsWith("#"))return;const n=[];for(const e of a){if("string"!=typeof e||!e.startsWith("#"))continue;const t=f(e,o);null!==t&&3>t&&n.push(`${e} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${n.length} color(s) in colorScheme have < 3:1 contrast against background "${o}": ${n.join(", ")}. Data marks may be hard to see.`,fix:'Use darker colors on light backgrounds or lighter colors on dark backgrounds. Import COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for an accessible preset.'})}(0,t,r),function(e,t,r){const a=t.colorScheme;if(!a||!Array.isArray(a)||2>a.length)return;const o=a.filter(e=>"string"==typeof e&&e.startsWith("#"));if(2>o.length)return;const n=[];for(let e=0;o.length-1>e;e++){const t=f(o[e],o[e+1]);null!==t&&1.5>t&&n.push(`${o[e]} / ${o[e+1]} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${n.length} adjacent color pair(s) in colorScheme have very similar luminance: ${n.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}(0,t,r),function(e,t,r){const a=t.colorScheme;if("string"!=typeof a)return;const o=Jo[e];o?.props?.colorScheme?.enum||Yn.has(a)||r.push({severity:"warning",code:"UNKNOWN_COLOR_SCHEME",message:`colorScheme "${a}" is not a recognized named scheme — the chart will fall back to the default palette.`,fix:`Use a known scheme name (${[...Yn].join(", ")}) or pass an explicit color array, e.g. colorScheme={["#1f77b4", "#ff7f0e"]}.`})}(e,t,r),function(e,t,r){const a=Jo[e]?.props,o=e=>!!a?.[e]&&"string"==typeof t[e]&&t[e].trim().length>0,n=o("title"),i=o("description"),s=o("summary");n||i||s||r.push({severity:"warning",code:"MISSING_DESCRIPTION",message:"No title, description, or summary provided. Screen readers will fall back to a generic chart-type label.",fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}(e,t,r),function(e,t,r){const a=[];for(const e of Kn)"function"==typeof t[e]&&a.push(e);a.length>0&&r.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${a.length>1?"s":""} detected: ${a.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference; closures over changing values can force unnecessary scene rebuilds on resize/rotation.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}(0,t,r),function(e,t,r){const a=t.hoverRadius;"number"==typeof a&&a>0&&24>a&&!1!==t.enableHover&&(!1!==t.hoverAnnotation||t.tooltip||t.customHoverBehavior||t.customClickBehavior||t.onClick)&&r.push({severity:"warning",code:"TOUCH_TARGET_SMALL",message:`hoverRadius=${a}px is below the ~24px radius needed for reliable 48px touch targets on mobile screens.`,fix:"Use hoverRadius={24} or larger for touch-heavy views. Semiotic floors touch pointer hit testing to 24px, but explicit desktop-only radii should be documented."})}(0,t,r),function(e,t,r){!0===t.responsiveWidth&&!0===t.responsiveHeight&&r.push({severity:"warning",code:"RESPONSIVE_BOTH_AXES",message:"responsiveWidth and responsiveHeight are both true. On mobile this can create resize feedback loops when the parent height depends on chart content.",fix:"Prefer responsiveWidth={true} with a fixed parent height or size={[width, fixedHeight]}; use a ResizeObserver outside the chart if the height must follow aspect ratio."})}(0,t,r),function(e,t,r){if(!0!==t.showParticles)return;const a=t.particleStyle&&"object"==typeof t.particleStyle?t.particleStyle:{},o="number"==typeof a.maxPerLine?a.maxPerLine:void 0,n="number"==typeof a.spawnRate?a.spawnRate:void 0;("number"==typeof o&&o>20||"number"==typeof n&&n>.08)&&r.push({severity:"warning",code:"GEO_PARTICLE_MOBILE_COST",message:"Animated geo particles run a continuous canvas loop that can drain battery and trigger thermal throttling on mobile GPUs.",fix:"Set particleStyle={{ maxPerLine: 12, spawnRate: 0.06 }} for mobile-heavy views, or disable showParticles when reduced-motion or low-power modes are active."})}(0,t,r),function(e,t,r){const a=[];Ie(t.tokenEncoding)&&a.push({source:"tokenEncoding",encoding:t.tokenEncoding}),Ie(t.encoding)&&a.push({source:"encoding",encoding:t.encoding});for(const{source:e,encoding:o}of a){const a=Ne(t,o);for(const t of Z(o,{visibleTokens:a}))r.push({severity:"warning",code:"TOKEN_"+t.code,message:t.message,fix:"MISSING_UNIT_VALUE"===t.code?`Set ${e}.unitValue to the value represented by one full token.`:"MISSING_UNIT_MEANING"===t.code?`Set ${e}.unitMeaning so readers know what one full token represents.`:"MISSING_COUNT_STRATEGY"===t.code?`Set ${e}.countStrategy to actual, unitized, fixed-denominator, quantile, sample, posterior-sample, or random-sample.`:"TOKEN_SEMANTICS_UNCLEAR"===t.code?`Set ${e}.tokenSemantics to observed-unit, unitized-measure, risk-case, possible-outcome, posterior-sample, hypothetical-case, topic-anchor, or decorative.`:`Adjust ${e} so its semantics, strategy, labels, and visible token count match the task.`})}}(0,t,r),function(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(const e of a){if(!e||"object"!=typeof e)continue;const t=Q(e);if(!ee(e)||"widget"===t)continue;const a=Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0),o="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,n=te(e);!n&&a>kn?r.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${o}" sits ~${Math.round(a)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):n&&a>Rn&&r.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${o}" uses a very long connector (~${Math.round(a)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}(0,t,r),function(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(!a)return;const o=a.filter(ee).length;if(0===o)return;const n="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400,s=function(e,t,r={}){return"number"==typeof r.maxAnnotations&&Number.isFinite(r.maxAnnotations)?Math.max(0,Math.floor(r.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(r.areaPerAnnotation&&r.areaPerAnnotation>0?r.areaPerAnnotation:Sn))):1/0}(n,i);Number.isFinite(s)&&o>s&&r.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${o} note annotations on a ${n}×${i} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}(0,t,r),function(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(const e of a)e&&"object"==typeof e&&"widget"===Q(e)&&null!=e.content&&!re(e)&&r.push({severity:"warning",code:"ANNOTATION_INTERACTIVE_ID",message:"An interactive widget annotation has no stable id, so its activation cannot be normalized or replayed reliably.",fix:"Add id, stableId, or provenance.stableId to the widget annotation. Do not identify interactive annotations by array index."})}(0,t,r),function(e,t,r){for(const e of Pn){const a=t[e];if(!Array.isArray(a)||2>a.length)continue;const[o,n]=a;"number"==typeof o&&"number"==typeof n&&o>n&&r.push({severity:"warning",code:"INVERTED_AXIS",message:`${e}=[${o}, ${n}] is descending — the axis renders inverted, so "up" reads as less. Inverted axes are a classic misleading-design pattern unless the inversion is the point.`,fix:`Order the extent ascending (${e}={[${n}, ${o}]}). If the inversion is deliberate (e.g. rank #1 at top), say so in the title or an annotation so readers aren't misled.`})}}(0,t,r),function(e,t,r){if("MultiAxisLineChart"!==e)return;const a=t.series;if(!Array.isArray(a)||2!==a.length)return;const o=a.filter(e=>!e||"object"!=typeof e||"string"!=typeof e.label||0===e.label.trim().length);o.length>0&&r.push({severity:"warning",code:"DUAL_AXIS_UNLABELED",message:`Dual-axis chart with ${o.length} unlabeled series. Two y-scales invite false equivalence between the lines; without per-series labels a reader can't tell which scale is whose.`,fix:'Give every series a label: series={[{ yAccessor: "a", label: "Revenue ($)" }, { yAccessor: "b", label: "Users" }]} — and consider whether two separate charts read more honestly.'})}(e,t,r),function(e,t,r){if(!on.has(e))return;const a=t.xExtent;if(!Array.isArray(a)||2>a.length)return;const[o,n]=a;if("number"!=typeof o||"number"!=typeof n||o>=n)return;const i=t.data;if(!i||!Array.isArray(i)||4>i.length)return;const s=t.xAccessor??"x";if("string"!=typeof s)return;let c=1/0,l=-1/0;for(const e of i){const t=e?.[s];"number"==typeof t&&Number.isFinite(t)&&(c>t&&(c=t),t>l&&(l=t))}if(!Number.isFinite(c)||!Number.isFinite(l)||c>=l)return;const u=l-c,d=Math.max(0,Math.min(n,l)-Math.max(o,c))/u;.7>d&&r.push({severity:"warning",code:"CHERRY_PICKED_WINDOW",message:`xExtent=[${o}, ${n}] shows only ~${Math.round(100*d)}% of the data's x range [${c}, ${l}] — a trend cropped to a favorable window is a classic misleading-design pattern.`,fix:'Widen xExtent to cover the data, filter the data itself so the chart shows what it has, or annotate the visible window ("Q4 only") so the cropping is explicit.'})}(e,t,r),r.some(e=>"NEGATIVE_VALUE"===e.code||"NEGATIVE_NORMALIZED_VALUE"===e.code)||function(e,t,r){const a=ln[e],o=dn[e];if(!a&&!o)return;if(o&&!t.normalize)return;const n=a??o,i=t[n],s="string"==typeof i?i:"yAccessor"===n?"y":"value",c=t.data;if(!c||!Array.isArray(c)||0===c.length)return;const l=c.filter(e=>{const t=e?.[s];return"number"==typeof t&&0>t});l.length>0&&r.push({severity:a?"error":"warning",code:"PART_TO_WHOLE_NEGATIVE",message:`${l.length} negative value(s) in "${s}" — a part-to-whole encoding cannot represent negative parts${a?"; slice angles/areas for negatives are meaningless":"; normalized shares distort when parts are negative"}.`,fix:a?"Filter or transform negative values first, or switch to a BarChart/WaterfallChart, which encode signed values honestly.":"Drop normalize for signed data, or use a diverging BarChart so negative contributions read as negative."})}(e,t,r),function(e,t,r){sn.has(e)&&"basis"===t.curve&&r.push({severity:"warning",code:"NON_PASSING_CURVE",message:'curve="basis" draws a B-spline that does NOT pass through your data points — rendered values differ from actual values everywhere except the endpoints.',fix:'Use curve="monotoneX" or curve="catmullRom" (both interpolate through every point), or keep "basis" only for deliberately schematic, clearly-labeled smoothing.'})}(e,t,r),function(e,t,r){if("LineChart"!==e&&"AreaChart"!==e)return;if("sparkline"===t.mode)return;if(t.responsiveWidth||t.responsiveHeight)return;const a="number"==typeof t.width?t.width:600,o="number"==typeof t.height?t.height:400;if(0>=a||0>=o)return;const n=a/o;if(n>8||.25>n){const e=n>8?"flattens":"exaggerates";r.push({severity:"warning",code:"EXTREME_ASPECT_RATIO",message:`${a}×${o} (${n.toFixed(1)}:1) is an extreme aspect ratio that ${e} the slopes a reader perceives — aspect-ratio distortion is a documented misleading-design pattern.`,fix:n>8?'Use a more balanced aspect (e.g. width/height between 1 and 3), or set mode="sparkline" if this is genuinely a sparkline strip.':"Use a more balanced aspect (e.g. width/height between 1 and 3); very tall trend charts overstate every change."})}}(e,t,r),function(e,t,r){if(!cn.has(e))return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const o=t.categoryAccessor,n="string"==typeof o?o:"category",i=new Set;for(const e of a){const t=e?.[n];null!=t&&i.add(t)}i.size>In&&r.push({severity:"warning",code:"PIE_TOO_MANY_SLICES",message:`${i.size} slices — angle judgments degrade rapidly past ~${In} categories (Cleveland & McGill), and thin slices become unreadable and unlabelable.`,fix:`Use a BarChart or DotPlot for ${i.size} categories, or group the long tail into an "Other" slice before charting.`})}(e,t,r),function(e,t,r){if(bn.has(e)){if("GaltonBoardChart"===e){const e=t.bins;"number"==typeof e&&2>e&&r.push({severity:"error",code:"PHYSICS_BAD_BINS",message:`bins=${e} leaves no meaningful settled projection for a Galton board.`,fix:"Use at least two bins; 8-24 bins is a practical range for physics distributions."});const a=ce(t.branchProbability);null!=t.branchProbability&&(null==a||0>a||a>1)&&r.push({severity:"error",code:"PHYSICS_BAD_BRANCH_PROBABILITY",message:`branchProbability=${t.branchProbability+""} must be between 0 and 1.`,fix:"Use branchProbability={0.5} for a balanced Galton board, or bias it within the [0, 1] range."});const o=ce(t.mechanicalCount);null==t.mechanicalCount||null!=o&&o>0||r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${t.mechanicalCount+""} cannot generate a mechanical Galton board.`,fix:"Use a positive mechanicalCount, for example 96."})}if("EventDropChart"===e){const e=t.windows,a=e&&"object"==typeof e?ce(e.size):null;null==a||a>0||r.push({severity:"error",code:"PHYSICS_BAD_WINDOW_SIZE",message:`windows.size=${a} cannot form event-time barriers.`,fix:"Set windows={{ size: positiveNumber }} so each event can settle into a real time window."}),"number"!=typeof t.timeScale||t.timeScale>0||r.push({severity:"error",code:"PHYSICS_BAD_TIME_SCALE",message:`timeScale=${t.timeScale} prevents arrival replay from advancing.`,fix:"Use a positive timeScale, or omit it for the default pace."});const o=Array.isArray(t.data)?t.data:[];if(o.length>0){const e=t.timeAccessor||"time",a=t.arrivalAccessor||"arrivalTime";o.some(t=>{const r=ce(le(t,e,"time")),o=ce(le(t,a,"arrivalTime"));return null!=r&&null!=o&&r!==o})||r.push({severity:"warning",code:"PHYSICS_EVENTDROP_NO_ARRIVAL_SPREAD",message:"EventDropChart data does not show distinct arrival times, so the physics replay collapses to event order.",fix:"Provide an arrivalAccessor field with event-arrival times when demonstrating lateness, watermarks, or out-of-order streams."})}}if("UnitPileChart"===e){const e="mechanical"===(t.simulationMode??t.mode),a=ce(t.mechanicalCount);null==t.mechanicalCount||null!=a&&a>0||r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${t.mechanicalCount+""} cannot generate a mechanical pile chart.`,fix:"Use a positive mechanicalCount, for example 80."}),e&&Array.isArray(t.mechanicalCategories)&&0===t.mechanicalCategories.length&&r.push({severity:"error",code:"PHYSICS_EMPTY_MECHANICAL_CATEGORIES",message:"mechanicalCategories=[] leaves no containers for the generated unit pile.",fix:"Provide at least one category label, or omit mechanicalCategories for the default set."});const o=oe(t.unitValue??1);if(null==o||0>=o)return void r.push({severity:"error",code:"PHYSICS_BAD_UNIT_VALUE",message:`unitValue=${t.unitValue} cannot unitize values into physical bodies.`,fix:"Set unitValue to a positive number represented by one body."});const n=e?ie({count:a??void 0,categories:Array.isArray(t.mechanicalCategories)?t.mechanicalCategories:void 0,seed:oe(t.seed)??1,unitValue:o}):Array.isArray(t.data)?t.data:[],{rows:i}=se(n,"pile"),s=t.valueAccessor??(e?"value":void 0),c=i.reduce((e,t,r)=>{const a="function"==typeof s?s(t,r):"string"==typeof s&&s?t[s]:1;return e+function(e,t){const r=e/t,a=Math.round(r);return Math.ceil(a>0&&Number.EPSILON*r*4>=Math.abs(r-a)?a:r)}(Math.max(0,oe(a)??0),o)},0);c>1500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`UnitPileChart would create about ${c} live bodies; motion may dominate the chart and stress the frame budget.`,fix:"Sample or aggregate source records, or use a bounded window with sediment. A larger unitValue reduces full circles but still leaves at least one body per positive source record."})}if("CollisionSwarmChart"===e){if((ce(t.pointRadius??5)??5)>0||r.push({severity:"error",code:"PHYSICS_BAD_POINT_RADIUS",message:`pointRadius=${t.pointRadius} cannot produce collision bodies.`,fix:"Use a positive pointRadius, for example 5."}),(ce(t.collisionIterations??6)??6)>0||r.push({severity:"error",code:"PHYSICS_BAD_COLLISION_ITERATIONS",message:`collisionIterations=${t.collisionIterations} disables collision relaxation.`,fix:"Use at least one collision iteration; 4-8 is a practical range for swarms."}),null!=t.xExtent){const e=Array.isArray(t.xExtent)?t.xExtent:[],a=ce(e[0]),o=ce(e[1]);(2>e.length||null==a||null==o)&&r.push({severity:"error",code:"PHYSICS_BAD_X_EXTENT",message:"xExtent must be a numeric [min, max] pair for CollisionSwarmChart.",fix:"Pass xExtent={[min, max]} or omit it so the chart infers the domain from data."})}const e=Array.isArray(t.data)?t.data:[];e.length>1200&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`CollisionSwarmChart would create ${e.length} live bodies; collision relaxation may dominate the frame budget.`,fix:"Sample, aggregate, reduce point radius, or move to a static SwarmPlot when every row does not need a physical body."});const a=t.groupAccessor;if(e.length>0&&a){const t=new Set;for(const r of e){const e=le(r,a,"group");null!=e&&t.add(e)}t.size>12&&r.push({severity:"warning",code:"PHYSICS_TOO_MANY_SWARM_LANES",message:`CollisionSwarmChart has ${t.size} group lanes, which leaves little vertical room for collision separation.`,fix:"Facet or filter groups, or use an ordinary SwarmPlot/BoxPlot for dense grouped comparison."})}}if("GaltonBoardChart"!==e&&"UnitPileChart"!==e&&"CollisionSwarmChart"!==e&&"ProcessFlowChart"!==e&&"EventDropChart"!==e||(null!=t.massBy||null!=t.massAccessor||t.frameProps&&"object"==typeof t.frameProps&&null!=t.frameProps.bodyMassBy)&&r.push({severity:"warning",code:"PHYSICS_DATA_IN_DYNAMICS",message:e+" appears to map a data field to mass/dynamics. Mass is not a readable quantitative channel.",fix:"Encode quantities in spawn position, bin, size, color, or glyph — keep mass/friction/restitution as process texture. Use showProjection for the truth layer."}),"UnitPileChart"!==e&&"GaltonBoardChart"!==e&&"CollisionSwarmChart"!==e&&"ProcessFlowChart"!==e&&"CrucibleChart"!==e||!1!==t.showProjection||r.push({severity:"warning",code:"PHYSICS_NO_PROJECTION",message:e+" has showProjection={false}. Without a settled projection, motion is easy to over-read as data.",fix:"Keep showProjection enabled (default) so the chart collapses to a legible static reading, or document why the process alone is the claim."}),"ProcessFlowChart"===e){const e=Array.isArray(t.stages)?t.stages:[];if(0===e.length)r.push({severity:"error",code:"PROCESS_FLOW_MISSING_STAGES",message:"ProcessFlowChart requires a non-empty stages array.",fix:'Provide stages={[{ id: "coding", force: 12 }, { id: "merged", absorb: true }]}.'});else{e.some(e=>!e||null==e.id||""===(e.id+"").trim())&&r.push({severity:"error",code:"PROCESS_FLOW_BAD_STAGE",message:"Every ProcessFlowChart stage needs a stable id.",fix:'Use stages like { id: "review", label: "Review", capacity: { unitsPerSecond: 4 } }.'});const a=e.filter(e=>e?.absorb).length;t.groupBy&&0===a&&r.push({severity:"warning",code:"PROCESS_FLOW_GROUP_NO_ABSORB",message:"groupBy is set but no stage has absorb: true, so all-members completion cannot resolve.",fix:'Mark a terminal stage with absorb: true (e.g. merged), or set groupCompletion="none".'})}}if("GauntletChart"===e&&(Array.isArray(t.negativeProperties)||r.push({severity:"warning",code:"GAUNTLET_MISSING_NEGATIVE_PROPERTIES",message:"GauntletChart usually needs negativeProperties for drag/cost bodies (empty array is ok if intentional).",fix:'Provide negativeProperties={[{ id: "cost", label: "Cost", load: 1 }]} or explicitly pass [].'})),"CrucibleChart"===e){const e=Array.isArray(t.phases)?t.phases:[],a=Array.isArray(t.products)?t.products:[],o=Array.isArray(t.events)?t.events:[],n=Array.isArray(t.outlets)?t.outlets:[];0===e.length?r.push({severity:"error",code:"CRUCIBLE_MISSING_PHASES",message:"CrucibleChart requires an authored, non-empty phases array; a treatment program cannot be inferred from flat data.",fix:'Provide phases={[{ id: "charge", label: "Charge", duration: 1, motion: "charge" }]}.'}):e.some(e=>!e||null==e.id||""===(e.id+"").trim()||null==ce(e.duration)||0>=Number(e.duration))&&r.push({severity:"error",code:"CRUCIBLE_BAD_PHASE",message:"Every CrucibleChart phase needs a stable id and a positive finite duration.",fix:'Use phases like { id: "assay", label: "Assay", duration: 2, motion: "mix" }.'}),0===a.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_PRODUCTS",message:"CrucibleChart has no declared product molds. Products are never discovered from collisions or source fields.",fix:'Declare products={[{ id: "accepted", label: "Accepted", outletId: "product" }]} when the treatment forms an output.'}),0===o.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_EVENTS",message:"CrucibleChart has no authored events, so its phases cannot transform, combine, split, or route the charge.",fix:"Supply an explicit events array; do not ask the chart or an AI layer to infer a treatment from the rows."}),Array.isArray(t.outlets)||r.push({severity:"warning",code:"CRUCIBLE_IMPLICIT_OUTLETS",message:"CrucibleChart is using generic default outlets rather than domain-specific destinations.",fix:"Provide reason-labelled outlets and reference their ids from products, complete-product, and eject effects."});const i=new Set(a.map(e=>e?.id).filter(e=>null!=e).map(String)),s=new Set(["product","retained","residue","failed","recovered",...n.map(e=>e?.id).filter(e=>null!=e).map(String)]),c=new Set,l=new Set;for(const e of o)if(e&&Array.isArray(e.effects))for(const t of e.effects){if(!t||"object"!=typeof t)continue;const e=t.type;if("combine"!==e&&"contribute"!==e&&"complete-product"!==e||null==t.productId||i.has(t.productId+"")||c.add(t.productId+""),"split"===e&&Array.isArray(t.products))for(const e of t.products)null==e?.productId||i.has(e.productId+"")||c.add(e.productId+"");null==t.outletId||s.has(t.outletId+"")||l.add(t.outletId+"")}c.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_PRODUCT",message:`CrucibleChart events reference undeclared product molds: ${[...c].sort().join(", ")}.`,fix:"Declare every referenced product id in products; do not create product definitions implicitly inside events."}),l.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_OUTLET",message:`CrucibleChart events reference undeclared outlets: ${[...l].sort().join(", ")}.`,fix:"Declare every domain outlet in outlets and reuse its stable id in authored effects."});const u=ce(t.playbackRate);null==t.playbackRate||null!=u&&u>0||r.push({severity:"error",code:"CRUCIBLE_BAD_PLAYBACK_RATE",message:`playbackRate=${t.playbackRate+""} cannot advance the authored CrucibleChart tape.`,fix:"Use a positive playbackRate such as 0.5 for half speed or 2 for double speed."});const d=ce(t.rerunMS);null==t.rerunMS||null!=d&&d>=0||r.push({severity:"error",code:"CRUCIBLE_BAD_RERUN_MS",message:`rerunMS=${t.rerunMS+""} must be a finite non-negative delay or null.`,fix:"Use rerunMS={3000}, rerunMS={0}, or omit the prop for a single run."})}if("GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e||"CrucibleChart"===e){const a=Array.isArray(t.data)?t.data:[],o=ce(t.mechanicalCount)??0,n=a.length>0?a.length:o;n>2500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`${e} may spawn ~${Math.round(n)} live bodies, which can overwhelm the simulation loop.`,fix:"Lower mechanicalCount / unitize with a larger unitValue, enable sediment/windowSize, or sample the data before spawn."})}}}(e,t,r),"ProcessSankey"===e)for(const e of function(e){const t=[],r=e.domain;null==r?t.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} as numbers or Date-compatible values."}):Array.isArray(r)&&2===r.length&&Number.isFinite(Number(r[0]))&&Number.isFinite(Number(r[1]))||t.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times.",fix:"Use domain={[t0, t1]} with t0 <= t1."});const a=e.edges;if(Array.isArray(a)&&a.length>0){const e=a[0];null!=e.startTime&&null!=e.endTime||t.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}const o=e.nodes,n=Array.isArray(o)?o.length:0;return!0!==e.showLabels||24>n||t.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${n} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),80>(Array.isArray(a)?a.length:0)||null!=e.layoutExecution||"off"===e.packing||t.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),t}(t))r.push(e);return{ok:r.every(e=>"warning"===e.severity),diagnoses:r}}function Oe(e){return"string"==typeof e&&e.trim().length>0}function Fe(e,t){return"number"==typeof t?`${e}[${t}]`:`${e}.${t}`}function je(e,t){return`${e}[Symbol(${t.description??""})]`}function ze(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;const r=Number(e);return Number.isSafeInteger(r)&&r>=0&&t>r}function Be(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return}}function Le(e,t,r,a){const o=Be(e,t);return o&&"value"in o&&o.enumerable?_e(o.value,r,a):[r]}function _e(e,t="$",r=new Set){if(null===e||"string"==typeof e||"boolean"==typeof e)return[];if("number"==typeof e)return Number.isFinite(e)&&!Object.is(e,-0)?[]:[t];if("object"!=typeof e)return[t];if(r.has(e))return[t];let a,o,n;try{n=Array.isArray(e),a=Object.getPrototypeOf(e),o=Reflect.ownKeys(e)}catch{return[t]}if(a!==(n?Array.prototype:Object.prototype)&&null!==a)return[t];r.add(e);const i=[];try{if(n){const a=Be(e,"length")?.value;if(!Number.isSafeInteger(a)||0>a)return[Fe(t,"length")];for(const e of o)"length"===e||"string"==typeof e&&ze(e,a)||i.push("symbol"==typeof e?je(t,e):Fe(t,e));for(let o=0;a>o;o+=1)i.push(...Le(e,o+"",Fe(t,o),r))}else for(const a of o)"symbol"!=typeof a?i.push(...Le(e,a,Fe(t,a),r)):i.push(je(t,a));return i}catch{return[t]}finally{r.delete(e)}}function De(){const e=globalThis;return e[ei]||(e[ei]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[ei]}function Ue(e){return De().recipes.get(e)}function Ve(e){const t=De().layouts.get(e)?.identity;return t?{...t}:void 0}function Ge(e){return"string"==typeof e?Ue(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function He(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=function(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}(e)}function qe(e){const t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;const r=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return r?r.length:1}function We(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function Ye(e,t,r={}){const a=[],o=Ue(e),n=mn.has(e),i=!!Jo[e]||!!o||n,s=!0===r.inChartContainer,c=!0===r.describe,l=!0===r.navigable,u=hn.has(e),d=tn.has(e),{hasTitle:h,hasDescription:p,hasSummary:m,unsupportedFinding:g}=function(e,t,r){const a=Jo[e]?.props,o=Xn.has(e)||void 0!==r&&Zn.has(r),n=e=>!!a?.[e]||o,i=Jn.filter(e=>Oe(t[e])&&!n(e));return{hasTitle:n("title")&&Oe(t.title),hasDescription:n("description")&&Oe(t.description),hasSummary:n("summary")&&Oe(t.summary),unsupportedFinding:i.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${i.join(" and ")} text was supplied, but ${1===i.length?"that prop is":"those props are"} not supported by ${e}'s declared chart API and cannot be credited as rendered accessibility text.`,fix:"Use the component's declared title, description, and summary props when available; for richer generated description or navigation, use ChartContainer with chartConfig plus describe and/or navigable."}:void 0}}(e,t,o?.frameFamily),y=!1!==t.accessibleTable&&!u,b=h||p||m,v=function(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}(t),w=function(e){const t=We(e),r=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===r.pause||"function"==typeof r.pause}(t),A=n,x=function(e){const t=We(e);return!0===e.settledProjection||!0===t.settledProjection}(t)||yn.has(e)&&y,$=function(e){const t=We(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}(t)||A,C=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],S=i?"pass":"manual",k=i?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(g&&a.push(g),a.push(function(e){const t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},r=e.colorScheme,a="string"==typeof e.background?e.background:null;if(a&&!a.startsWith("#"))return{...t,status:"manual",message:`Background "${a}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};const o=a??"#ffffff";if(!Array.isArray(r))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};const n=[];let i=0;for(const e of r){if("string"!=typeof e||!e.startsWith("#"))continue;const t=f(e,o);null!=t&&(i++,3>t&&n.push(`${e} (${t.toFixed(1)}:1)`))}return 0===i?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:n.length>0?{...t,status:"fail",message:`${n.length} color(s) fall below 3:1 contrast vs ${o}: ${n.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${i} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${o}.`}}(t)),a.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...u?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:y?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:p&&m?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}}),a.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),a.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||gn.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."}}),null!=t.colorBy){const e=!0===t.directLabel||!0===t.showLabels,r=function(e){return!!Array.isArray(e.styleRules)&&e.styleRules.some(e=>{if("object"!=typeof e||null===e)return!1;const t=e.style;if("object"!=typeof t||null===t||Array.isArray(t))return!1;const r=t.fill;return"object"==typeof r&&null!==r&&"hatch"===r.type})}(t);a.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...e?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:r?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:r?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}});const o=function(e){if(!Array.isArray(e))return!1;const t=e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase());return t.length>0&&t.every(e=>Qn.has(e))}(t.colorScheme);a.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...o?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),a.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:r?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:r?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{const e=C.filter(ee);if(e.length>0){const r=t.autoPlaceAnnotations,o="object"==typeof r&&null!==r&&!0===r.redundantCues,n=e.filter(e=>{if("string"!=typeof e.color)return!1;const t=Q(e),r=o&&"text"===t;return!(te(e)||r)});a.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===n.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${n.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}a.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...i?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}});{const e=[];null==t.brush&&null==t.onBrush||e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||e.push("legend filtering"),e.length>0&&a.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{const r=xn[e];if(r&&v){const e=t[r];"number"==typeof e&&e>0&&24>2*e&&a.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${r}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}a.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:S,message:`The chart takes a single tab stop and navigates data with arrow keys${k} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),a.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...v?m||p?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),a.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:S,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${k}.`}),a.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:S,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${k}.`,fix:i?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),a.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...b?{status:"pass",message:`Provided: ${[h&&"title",p&&"description",m&&"summary"].filter(Boolean).join(", ")}.`}:s?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),a.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...p||m?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:c?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:h?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}});{const e=[t.description,t.summary].filter(Oe).join(". "),r=e?function(e){const t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),r=e.trim().split(/\s+/).filter(Boolean);if(0===r.length||0===t.length)return null;let a=0;for(const e of r)a+=qe(e);return r.length/t.length*.39+a/r.length*11.8-15.59}(e):null;a.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==r?{status:"not-applicable",message:"No description/summary text to grade."}:r>9?{status:"warn",message:`Description/summary reads at ~grade ${r.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(r))} (≤ 9).`}})}if(pn.has(e)){const e=Oe(t.xLabel),r=Oe(t.yLabel);a.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&r?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!r&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(wn.has(e)&&a.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),C.length>1){const e=C.filter(He).length;a.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===C.length?{status:"pass",message:`All ${C.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:C.length+" annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.",fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${C.length-e} of ${C.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&a.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&a.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:S,message:`Transitions animate with object constancy and data changes are mirrored to the live region${k}.`,fix:i?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),a.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),a.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),a.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:S,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${k}.`,fix:i?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),a.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...u?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:y?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}}),u||a.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...s?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),a.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:i?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${i?"":k}.`,fix:i?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),a.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...l?d?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:d?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:S,message:`Keyboard navigation steps through points and switches series/groups${k}.`,fix:i?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}});{const r=Array.isArray(t.data)?t.data:null,o=Array.isArray(t.nodes)?t.nodes:null,n={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};let i;i=un.has(e)&&r&&r.length>7?{...n,status:"warn",message:r.length+" slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.",fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}:o&&o.length>200?{...n,status:"warn",message:o.length+" nodes. A network this size is hard to navigate non-visually node by node.",fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:r&&r.length>5e3?{...n,status:"warn",message:r.length+" data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.",fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:r?{...n,status:"pass",message:r.length+" data points — a reasonable density for non-visual consumption."}:o?{...n,status:"pass",message:o.length+" nodes — a reasonable density for non-visual consumption."}:{...n,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},a.push(i)}{const e=Array.isArray(t.data)?t.data:null,r=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]);let o=!1;if(e&&!r)for(const t of e.slice(0,50))if(t&&"object"==typeof t){for(const e of Object.values(t))if("number"==typeof e&&Number.isFinite(e)&&Math.abs(e)>=1e5){o=!0;break}if(o)break}o&&a.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}a.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...c?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:m?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),a.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...u?{status:"not-applicable",message:"Single value — nothing to skip."}:y?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}}),a.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:S,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${k}.`,fix:i?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),a.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...gn.has(e)||vn.has(e)?w?{status:"pass",message:e+" animates continuously and declares an in-chart pause/stop control."}:{status:"warn",message:e+" animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.",fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:S,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${k}.`}}),n&&(a.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...w?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),a.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...x?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),a.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...$?{status:"pass",message:"Reduced-motion mode settles the simulation to a static chart state instead of freezing bodies mid-flight."}:{status:"warn",message:"Physics chart does not declare reduced-motion synchronous settle behavior.",fix:"In reduced motion, run the world to its settled projection and paint once; set physics.reducedMotionSettle=true."}}));{const r=!0===t.responsiveWidth||!0===t.responsiveHeight,o=An.has(e)&&!0===t.zoomable;a.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...r?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:o?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}})}if(o){const e=o.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length));e&&a.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:o.name+" declares a color encoding without a redundant cue.",fix:"Add shape, label, position, texture, or a textual category summary to the recipe encoding."}),"required"!==o.accessibility.description||p||a.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:o.name+" requires a recipe-aware description, but none is attached.",fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),o.accessibility.fallbackTable&&!1===t.accessibleTable&&a.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:o.name+" requires a fallback table, but accessibleTable is disabled.",fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."})}const R=a.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),P={criticalsPassed:R.filter(e=>"pass"===e.status).length,criticalsEvaluated:R.length,fails:a.filter(e=>"fail"===e.status).length,warnings:a.filter(e=>"warn"===e.status).length,manual:a.filter(e=>"manual"===e.status).length,passes:a.filter(e=>"pass"===e.status).length};return{component:e,ok:!R.some(e=>"fail"===e.status),summary:P,findings:a,reference:ti}}function Ke(e,{onlyCritical:t=!1}={}){const r=[];for(const a of e.findings)"fail"!==a.status&&"warn"!==a.status||t&&!a.critical||r.push(a.message);return r}function Je(e){const t=[],r=e.summary,a=e.ok?`${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`:`${r.fails} blocking failure(s) — ${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${a} · ${r.warnings} warning(s) · ${r.manual} to verify manually`);for(const r of ai){const a=e.findings.filter(e=>e.principle===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(" "+r.toUpperCase());for(const e of a)t.push(` ${ri[e.status]} ${e.id}${e.critical?" [critical]":""}: ${e.message}`),!e.fix||"fail"!==e.status&&"warn"!==e.status&&"manual"!==e.status||t.push(" → "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function Xe(e){return e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ze(e,t,r){return{id:`${t}.${e.code.toLowerCase()}.${r+1}`,stage:t,severity:e.severity,code:e.code,message:e.message,...e.fix?{fix:e.fix}:{},source:"data"===t?"auditData":"diagnoseConfig",...e.field?{field:e.field}:{},...e.role?{role:e.role}:{},...e.rows?{rows:e.rows}:{},...void 0!==e.count?{count:e.count}:{}}}function Qe(e,t){const r=e.filter(e=>"manual"!==e.severity),a=r.slice(0,t).map(e=>({id:"chart-evaluation-"+e.id,level:"error"===e.severity?"error":"warning",title:`${e.stage}: ${Xe(e.code)}`,message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic chart evaluation",dismissible:!0}));return r.length>t&&a.push({id:"chart-evaluation-overflow",level:"warning",title:"Additional chart evaluation findings",message:r.length-t+" additional finding(s) are available in the ranked evaluation result.",source:"Semiotic chart evaluation",dismissible:!0}),a}function et(e){const t=[`${e.component}: ${e.ok?"PASS":"ISSUES FOUND"}`,`${e.summary.errors} error(s) · ${e.summary.warnings} warning(s) · ${e.summary.manual} manual check(s)`];for(const r of e.findings)t.push(`${r.rank}. [${r.stage}/${r.code}] ${r.message}`),r.fix&&t.push(" Fix: "+r.fix);return t.join("\n")}function tt(e,t={},r,a={}){const o=void 0===r?t:{...t,data:r},n=J(e,o),i=Pe(e,o,r,a.dataAudit),s=Me(e,o).diagnoses.filter(e=>"data"!==e.domain&&"VALIDATION"!==e.code),c=Ye(e,o,{inChartContainer:a.inChartContainer,describe:a.describe,navigable:a.navigable}),l=[];for(const[e,t]of n.errors.entries())l.push({id:"validation."+(e+1),stage:"deception",severity:"error",code:"VALIDATION",message:t,fix:"Correct the component name, required props, prop types, and data shape.",source:"validateProps"});let u;i.diagnoses.forEach((e,t)=>{l.push(Ze(e,"data",t))}),s.forEach((e,t)=>{l.push(Ze(e,"deception",t))}),c.findings.filter(e=>"pass"!==e.status&&"not-applicable"!==e.status).forEach((e,t)=>{l.push(function(e,t){return{id:e.id||"accessibility."+(t+1),stage:"accessibility",severity:"fail"===e.status?"error":"warn"===e.status?"warning":"manual",code:e.id,message:e.message,...e.fix?{fix:e.fix}:{},source:"auditAccessibility",critical:e.critical,principle:e.principle,heuristic:e.heuristic}}(e,t))});const d=l.some(e=>"error"===e.severity&&"accessibility"!==e.stage);if(a.render&&n.valid&&!d)try{u=a.render(e,o).evidence,l.push(...function(e,t){const r=[];e.component!==t&&r.push({id:"render.component-mismatch",stage:"render",severity:"error",code:"RENDER_COMPONENT_MISMATCH",message:"The render evidence names a different chart component.",source:"renderChartWithEvidence"});for(const t of function(e){const{contract:t,transfer:r,binding:a}=e;if(void 0===t&&void 0===r&&void 0===a)return[];const o=[],n=Array.isArray(a?.mismatchPaths)?a.mismatchPaths.filter(e=>"string"==typeof e):[];return r&&"preserved"!==r.status&&"excluded"!==r.status?o.push({id:"artifact.transfer-invalid",status:"fail",message:`The attached artifact transfer is ${r.status}; its contract cannot be relied on for publication.`}):r&&void 0!==t||o.push({id:"artifact.transfer-unknown",status:"unknown",message:"The attached artifact lacks a contract or a transfer report."}),"mismatch"===a?.status||n.length>0?o.push({id:"artifact.identity-mismatch",status:"fail",message:"The attached artifact does not identify this chart input"+(n.length?": "+n.join(", "):".")}):"match"===a?.status&&Array.isArray(a.mismatchPaths)&&Array.isArray(a.unknownPaths)&&0>=a.mismatchPaths.length&&0>=a.unknownPaths.length||o.push({id:"artifact.identity-unknown",status:"unknown",message:"The attached artifact identity has not been fully verified."}),o}({contract:e.artifactContract,transfer:e.artifactTransfer,binding:e.artifactBinding}))r.push({id:"render."+t.id,stage:"render",severity:"fail"===t.status?"error":"manual",code:t.id.toUpperCase().replace(/[.-]/g,"_"),message:t.message,source:"artifactAttachmentIssues"});e.empty&&r.push({id:"render.empty-scene",stage:"render",severity:"error",code:"EMPTY_SCENE",message:"The renderer produced no data marks.",fix:"Check the data shape, accessors, scales, and filters against the rendered evidence.",source:"renderChartWithEvidence"});const a=new Set;for(const t of function(e){return e.semanticDiagnostics?.length?e.semanticDiagnostics:"degenerate"===e.semanticStatus?[oi]:[]}(e))a.add(t.code),r.push({id:"render."+t.code.toLowerCase(),stage:"render",severity:t.severity,code:t.code,message:t.message,...t.fix?{fix:t.fix}:{},source:"capability.semanticViability"});for(const t of e.warnings)a.has(t)||r.push({id:"render."+t.toLowerCase(),stage:"render",severity:"warning",code:t,message:`The renderer reported ${Xe(t).toLowerCase()}.`,fix:"Inspect the render evidence and resolve the warning before relying on the chart.",source:"renderChartWithEvidence"});return r}(u,e))}catch{l.push({id:"render.failed",stage:"render",severity:"error",code:"RENDER_FAILED",message:"The injected renderer failed before producing render evidence.",fix:"Check the chart configuration and renderer-specific requirements.",source:"renderChartWithEvidence"})}const h=function(e){return e.map((e,t)=>({finding:e,index:t})).sort((e,t)=>{const r=ni[e.finding.severity]-ni[t.finding.severity];if(0!==r)return r;const a=!0===e.finding.critical;if(a!==(!0===t.finding.critical))return a?-1:1;const o=ii[e.finding.stage]-ii[t.finding.stage];return 0!==o?o:e.index-t.index}).map(({finding:e},t)=>({...e,rank:t+1}))}(l),p=h.filter(e=>"error"===e.severity).length,f=h.filter(e=>"warning"===e.severity).length,m=h.filter(e=>"manual"===e.severity).length,g=Qe(h,Math.max(0,Math.floor(a.notificationMax??8)));return{component:e,validation:n,data:i,deception:s,accessibility:c,...u?{evidence:u}:{},ok:0===p,summary:{errors:p,warnings:f,manual:m,findings:h.length,notifications:g.length},findings:h,notifications:g}}function rt(e,t=8){return Qe(e,Math.max(0,Math.floor(t)))}function at(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ot(e,t){const{when:r}=e,a=t.width,o=t.height,n=function(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}(t),i=function(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}(t);return!("number"==typeof r.minWidth&&r.minWidth>a||"number"==typeof r.maxWidth&&a>r.maxWidth||"number"==typeof r.minHeight&&("number"!=typeof o||r.minHeight>o)||"number"==typeof r.maxHeight&&("number"!=typeof o||o>r.maxHeight)||"number"==typeof r.minAspectRatio&&("number"!=typeof n||r.minAspectRatio>n)||"number"==typeof r.maxAspectRatio&&("number"!=typeof n||n>r.maxAspectRatio)||r.orientation&&i!==r.orientation)}function nt(e,t,r=e.responsiveRules){if(!Array.isArray(r)||0===r.length)return{props:e,matches:[]};const a=r.map((e,t)=>({rule:e,index:t})).filter(e=>ot(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:a.reduce((e,t)=>function(e,t){const r={...e,...t};for(const a of["margin","frameProps","mobileSemantics","style"])at(e[a])&&at(t[a])&&(r[a]={...e[a],...t[a]});return"string"==typeof e.className&&"string"==typeof t.className&&(r.className=`${e.className} ${t.className}`),r}(e,t.rule.transform),e),matches:a}}function it(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function st(e){return"string"==typeof e&&e.trim().length>0}function ct(e){const t=it(e.capability)?e.capability:null,r=it(e.recipe)?e.recipe:null,a=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,r?.mobile];for(const e of a)if(it(e))return e;return null}function lt(e){return Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1]&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[e[0],e[1]]:null}function ut(e){return lt(e.size)||lt(it(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function dt(e,t){e.push({...t,status:"pass"})}function ht(e,t){e.push({...t,status:"warn"})}function pt(e,t){e.push({...t,status:"manual"})}function ft(e,t={},r={}){const a=r.viewportWidth??390,o=r.targetSize??44,n=ut(t),i=nt(t,{width:a,height:n?.[1]}),s=[],c=ut(t=i.props),l=ct(t),u=function(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}(e,t),d=function(e){const t=ct(e);return!0===e.responsive||!0===e.mobile||!0===t?.responsive||!0===t?.supportsResponsiveLayout||Array.isArray(t?.breakpoints)||"number"==typeof t?.minViewportWidth||"responsive"===t?.strategy||"small-multiples"===t?.strategy||"summary-cards"===t?.strategy||null!=e.mobileLayout||null!=e.responsiveRules||"mobile-readable"===e.density}(t),h=!0===r.inChartContainer,p=st(t.title)||st(t.summary)||st(t.description)||!0===l?.summary||st(l?.summary);if(i.matches.length>0&&dt(s,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${i.matches.length} responsive rule(s) applied for the ${a}px mobile audit.`}),c){const[t,r]=c;t>a&&!d?ht(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${a}px mobile viewport with no responsive/mobile transform hint.`,fix:"Use responsive sizing, responsiveRules/mobileLayout, or an explicit mobile variant that preserves the task instead of clipping the desktop chart."}):dt(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof l?.minViewportWidth&&l.minViewportWidth>a&&ht(s,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${l.minViewportWidth}px minimum, wider than the audited ${a}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});const o=t/Math.max(1,r);430>=a&&o>2.4&&"BigNumber"!==e&&ht(s,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${o.toFixed(1)}:1, which tends to compress phone charts vertically.`,fix:"Prefer stacked sections, small multiples, cards plus a sparkline, or a taller mobile-specific chart ratio."}),160>r&&"BigNumber"!==e&&ht(s,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${r}px; most phone charts need enough vertical room for marks plus readable labels.`,fix:"Reserve more vertical space, remove nonessential axes, or switch to a card/sparkline pattern with external labels."})}else pt(s,{id:"layout.unknown-size",category:"layout",impact:"medium",message:"No explicit size is available to audit. This may be responsive, but static mobile overflow cannot be checked.",fix:"Audit rendered widths at 320, 360, 390, and 430px, or pass size/responsiveRules metadata into the config."});const f=function(e){const t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,it(e.frameProps)?e.frameProps.data:void 0];let r=0;for(const e of t)Array.isArray(e)&&(r+=e.length);return r}(t);f>0&&(f>("number"==typeof l?.maxMarks?l.maxMarks:ci.has(e)?1.25*a:fn.has(e)?Math.max(8,Math.floor(a/34)):a)?ht(s,{id:"density.mark-budget",category:"density",impact:ci.has(e)?"medium":"high",message:`${f} data item(s) exceed the rough mobile density budget for ${e} at ${a}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):dt(s,{id:"density.mark-budget",category:"density",impact:"medium",message:f+" data item(s) are within the rough mobile density budget for this component."}));const m=function(e){const t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues];let r=0;for(const e of t)Array.isArray(e)&&(r+=e.length);return r>0?r:null}(t),g=!1!==t.showAxes&&!1!==t.axis;if(g&&null!=m){const e=Math.max(3,Math.floor(a/58));m>e&&ht(s,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${m} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${a}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else g&&(ci.has(e)||fn.has(e))&&pt(s,{id:"density.axis-label-collision",category:"density",impact:"medium",message:"Axes are enabled, but label collision depends on rendered tick text and cannot be checked statically.",fix:"Verify tick labels at phone widths or provide explicit mobile tick density."});!function(e){const t=it(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!function(e){const t=ct(e),r=it(e.mobileInteraction)?e.mobileInteraction:null;return null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||null!=e.selection||null!=e.onClick||null!=e.onSelect||!0===e.mobileInteraction||!0===r?.tapToSelect||!0===r?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||st(t?.interaction?.hoverFallback)}(e)}(t)?dt(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."}):ht(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"The chart exposes tooltip/hover detail without an obvious tap, selection, or control alternative.",fix:"Enable tap-to-select, a persistent details panel, visible segment buttons, or another non-hover path for the same information."});const y=function(e,t){const r=li[e];if(!r)return null;let a=r.includes("hoverRadius")?30:null;for(const e of r){const r=t[e];"number"==typeof r&&Number.isFinite(r)&&r>0&&(a=null==a?r:Math.max(a,r))}return null==a?null:2*a}(e,t),b=it(t.mobileInteraction)?t.mobileInteraction:null,v=y??("number"==typeof b?.targetSize?b.targetSize:!0===t.mobileInteraction?44:"number"==typeof l?.minimumHitTarget?l.minimumHitTarget:"number"==typeof l?.interaction?.targetSize?l.interaction.targetSize:null);null!=v&&(24>v?ht(s,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${v}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):o>v?ht(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${v}px, above 24px but below the ${o}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):dt(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${v}px, meeting the configured ${o}px target.`}));const w=[];null==t.brush&&null==t.onBrush||w.push("brush"),!0===t.zoomable&&w.push("pan/zoom"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||w.push("legend filtering"),w.length>0&&!function(e,t){const r=ct(e),a=it(e.mobileInteraction)?e.mobileInteraction:null,o=a?.standardControls;return!!(null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||Array.isArray(r?.interaction?.alternatives)&&r.interaction.alternatives.length>0)||!0===o||"all"===o||t.every(e=>"brush"===e?Array.isArray(o)?o.includes("brush"):"brush"===o:"pan/zoom"===e?Array.isArray(o)?o.includes("zoom"):"zoom"===o:"legend filtering"===e&&(Array.isArray(o)?o.includes("legend"):"legend"===o))}(t,w)&&ht(s,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${w.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."}),!1===t.showLegend||!1===t.legend||!0!==t.showLegend&&!0!==t.legend&&null==t.colorBy&&null==t.groupBy&&null==t.lineBy&&null==t.areaBy&&null==t.stackBy||!0===t.directLabel||!0===t.showLabels||"direct"===t.labelStrategy||"direct-end"===t.labelStrategy||"direct"===l?.labels?.strategy||"inline"===l?.labels?.strategy||"external"===l?.labels?.strategy||a>430||ht(s,{id:"semantics.legend-over-direct-labels",category:"semantics",impact:"medium",message:"The chart appears to rely on a legend instead of direct labels at phone width.",fix:"Prefer direct end labels, inline labels, or a compact chip selector so readers do not bounce between plot and legend."});const A=Array.isArray(t.annotations)?t.annotations.filter(e=>it(e)):[];if(A.length>("number"==typeof l?.maxAnnotations?l.maxAnnotations:3)&&430>=a&&ht(s,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:A.length+" annotation(s) compete for phone plot space.",fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),A.length>0){const e=A.filter(e=>!st(e.mobileText)&&!st(e.shortText)&&!st(e.label));e.length>0&&pt(s,{id:"annotation.mobile-copy",category:"annotation",impact:"low",message:e.length+" annotation(s) lack explicit short/mobile copy.",fix:"Add mobileText or shortText for notes that need to survive narrow layouts."})}d||"BigNumber"===e||pt(s,{id:"layout.no-responsive-transform",category:"layout",impact:"low",message:"No explicit responsive transformation hint is present.",fix:"Declare responsiveRules/mobileLayout or a density/label strategy so the mobile version is a designed transformation, not an accidental resize."}),u&&(l?(dt(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart/recipe provides a mobileSemantics/mobile contract, so the audit can inspect its authored phone behavior."}),!1===l.custom?.dataBearingSceneNodes?ht(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"medium",message:"Custom mobile contract says emitted scene nodes are not data-bearing.",fix:"Preserve datum references, semantic roles, or accessible-table fields so intelligence, navigation, and tap details can recover the chart's meaning."}):!0!==l.custom?.dataBearingSceneNodes&&pt(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"low",message:"Custom chart mobile contract does not state whether scene nodes are data-bearing.",fix:"Set mobile.custom.dataBearingSceneNodes and mobile.custom.navigationGranularity for custom layouts and interoperability adapters."})):pt(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart layout is opaque to static mobile analysis because no mobileSemantics/mobile contract is present.",fix:"Declare mobileSemantics with strategy, breakpoints, mark budgets, touch target size, interaction alternatives, and custom scene semantics."})),p||h||ht(s,{id:"semantics.no-mobile-summary",category:"semantics",impact:"medium",message:"No title, summary, description, or ChartContainer context is visible from the config.",fix:"Add title/summary text or wrap in ChartContainer so the small-screen reader gets the task before the chart."});const x=s.filter(e=>"warn"===e.status),$={highRisk:x.filter(e=>"high"===e.impact).length,warnings:x.length,manual:s.filter(e=>"manual"===e.status).length,passes:s.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:a,ok:0===$.highRisk,summary:$,findings:s,reference:si}}function mt(e){const t=[],r=e.summary,a=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${r.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${a} - ${r.warnings} warning(s) - ${r.manual} manual check(s)`);for(const r of di){const a=e.findings.filter(e=>e.category===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(" "+r.toUpperCase());for(const e of a)t.push(` ${ui[e.status]} [${e.impact}] ${e.id}: ${e.message}`),!e.fix||"warn"!==e.status&&"manual"!==e.status||t.push(" -> "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function gt(){return["Static audit only: rendered label collision, CSS-resolved type size, and actual touch behavior still require viewport testing.","Use multiple widths, usually 320, 360, 390, 430, and 768 CSS pixels.","A mobile pass means no high-risk static warnings, not that the chart is perceptually or ergonomically optimal."]}function yt(e,t){if("function"==typeof e)return t=>+e(t);const r=e||t;return e=>+e[r]}function bt(e,t){if("function"==typeof e)return e;const r=e||t;return e=>e[r]}function vt(e,t){return pi.has(e)||fi.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function wt(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const r=e[t];if("string"==typeof r&&r)return r}}function At(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function xt(e,t={}){const r=!0===t.showRetractedAnnotations,a=!0===t.showSupersededAnnotations,o=new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&o.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;const t=e?.provenance?.stableId;return!(t&&o.has(t)&&!a)})}function $t(e){return"string"==typeof e?e:e.id??e.name}function Ct(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function St(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function kt(e,t,r){return r??Ge(t.recipe)??Ge(t.recipeId)??Ue(e)}function Rt(e,t,r=[]){const a=e.accessor?t[e.accessor]:void 0;if("string"==typeof a&&a)return a;if(e.field)return e.field;const o=r.find(e=>e&&"object"==typeof e);if(!o)return;const n=Object.entries(o).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?n.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in o):n.find(([,e])=>"string"==typeof e)?.[0]}function Pt(e,t){return e.dataRoles.find(e=>e.role===t)}function It(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function Et(e,t,r,a,o,n={}){const i={...n};if(t)for(const[e,r]of Object.entries(t))i[e]=r;for(const e of r.dataRoles){const r=Rt(e,a,o),n=t&&r?t[r]:r;void 0!==n&&(i[e.role]=n)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{const r=i[t];return null==r?`{${t}}`:r+""})}function Nt(e,t){const r="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!r)return null;let a=Array.isArray(t.data)?t.data:[];const o=Math.max(2,Math.round(oe(t.bins)??21)),n=Math.max(1,Math.round(oe(t.pegRows)??o-1));if(r&&(a="GaltonBoardChart"===e?function(e){const t=Math.max(2,Math.round(e.bins)),r=Math.max(1,Math.round(e.pegRows??t-1)),a=Math.max(1,Math.round(e.count??Math.max(64,4*t))),o=(n=Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,Math.max(0,Math.min(1,n)));var n;const i=ne(e.seed??1),s=e.idPrefix??"mechanical";return Array.from({length:a},(e,t)=>{let a=0;for(let e=0;r>e;e+=1)i()<o&&(a+=1);const n=r/2;return{id:`${s}-${t}`,value:a,mechanical:!0,pegRows:r,branchProbability:o,pathRights:a,side:n>a?"left":a>n?"right":"center"}})}({bins:o,count:t.mechanicalCount,pegRows:n,branchProbability:t.branchProbability,seed:t.seed}):ie({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),a=se(a,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){const e=new Map,o=t.valueAccessor??(r?"value":void 0);return a.forEach((r,a)=>{const n=(ae(r,a,t.categoryAccessor??"category")??"unknown")+"",i=o?oe(ae(r,a,o)):1;e.set(n,(e.get(n)??0)+Math.max(0,i??0))}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){const e=a.map((e,r)=>oe(ae(e,r,t.valueAccessor??"value"))).filter(e=>null!=e),i=r?[0,n]:function(e){if(!e)return;const t=oe(e[0]),r=oe(e[1]);return null!=t&&null!=r?t>r?[r,t]:[t,r]:void 0}(t.valueExtent),s=i?.[0]??(e.length?Math.min(...e):0),c=i?.[1]??(e.length?Math.max(...e):1),l=s===c?1:c-s,u=Array.from({length:o},(e,t)=>({label:t+1+"",value:0}));for(const t of e)u[Math.max(0,Math.min(o-1,Math.floor((t-s)/l*o)))].value+=1;return{generated:r,rows:u}}if("CollisionSwarmChart"===e){const e=new Map;return a.forEach((r,a)=>{if(null==oe(ae(r,a,t.xAccessor??"x")))return;const o=t.groupAccessor?(ae(r,a,t.groupAccessor)??"All")+"":"All";e.set(o,(e.get(o)??0)+1)}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){const e=oe(t.windows?.size??10);if(null==e||0>=e)return null;const{events:o}=function(e){const{windowSize:t,watermark:r,watermarkAtArrivalAccessor:a}=e;if(!Number.isFinite(t)||0>=t)throw new RangeError("EventDrop windows.size must be a finite positive number");const{rows:o}=se(e.data,"event"),n=o.flatMap((t,r)=>{const a=oe(ae(t,r,e.timeAccessor));return null==a?[]:[{datum:t,index:r,eventTime:a,arrivalTime:oe(ae(t,r,e.arrivalAccessor))??a,watermarkAtArrival:0,late:!1}]}),i="function"==typeof r?null:oe(r?.value),s="function"==typeof r?t:oe(r?.delay)??t;let c=-1/0,l=-1/0;for(const e of n.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){c=Math.max(c,e.eventTime);const o="function"==typeof r?oe(r(c)):c-s;l=i??Math.max(l,o??c-t);const n=a?oe(ae(e.datum,e.index,a)):null;e.watermarkAtArrival=n??l,e.late=e.watermarkAtArrival>=(Math.floor(e.eventTime/t)+1)*t}return{events:n,watermarkValue:n.length?l:i??-s}}({data:a,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),n=o.map(e=>e.eventTime),i=n.length?Math.min(...n):0,s=n.length?Math.max(...n):i+e,c=Math.min(oe(t.timeExtent?.[0])??i,i),l=Math.max(oe(t.timeExtent?.[1])??s,s),u=Math.floor(c/e)*e,d=Math.max(1,Math.ceil((l-u+e)/e)),h=Array.from({length:d},(t,r)=>({label:`${u+r*e}-${u+(r+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(const t of o){const r=h[Math.max(0,Math.min(d-1,Math.floor((t.eventTime-u)/e)))];t.late?r.secondary+=1:r.value+=1}return{generated:r,rows:h}}return null}function Tt(e){const t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function Mt(e,t){const r=e.physics&&"object"==typeof e.physics?e.physics:null,a=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,o=[e.settledProjectionRows,e.projectionRows,a?.rows,r?.settledProjectionRows,r?.projectionRows,r?.settledProjection&&"object"==typeof r.settledProjection?r.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(o)?o.map((e,r)=>{if(!e||"object"!=typeof e)return null;const a=e,o=Tt(a.count??a.value??a.total??a.bodies??a.events);if(null==o)return null;const n=a.label??a.id??a.name??"container "+(r+1),i=Tt(a.secondary??a.secondaryCount),s=Tt(a.observed??a.observedCount);return{label:At(n,t),count:o,...null!=i?{secondary:i}:{},..."string"==typeof a.secondaryLabel&&a.secondaryLabel?{secondaryLabel:a.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}function Ot(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Ft(e){return gi[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function jt(e){return wi[e]}function zt(e,t){const r=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,r={};for(const[e,a]of Object.entries(t.intentScores))"number"==typeof a&&Number.isFinite(a)&&(r[e]=a);return{family:t.family,intentScores:Object.keys(r).length?r:void 0}}return e}}(t);if(r?.act)return r.act;if(r?.intentScores){const e=function(e){let t,r=0;for(const[a,o]of Object.entries(e))if("number"==typeof o&&o>0)if(o>r)t=a,r=o;else if(o===r&&void 0!==t){const e=xi.indexOf(a),r=xi.indexOf(t);-1===e||-1!==r&&e>=r||(t=a)}return t}(r.intentScores);if(e&&wi[e]&&(r.intentScores[e]??0)>=3)return wi[e]}return r?.family?Ai[r.family]:function(e){return"BumpChart"===e?"ranking":fi.has(e)||"StackedAreaChart"===e?"apportioning":vi.has(e)?"relating":pi.has(e)?"comparing":mi.has(e)?"characterizing":hi.has(e)?"tracking":yi.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}function Bt(e){const t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;const t=e;if("string"!=typeof t.type||!Ci.has(t.type))return!1;const r=t.provenance;return!(!r||"object"!=typeof r)&&(Si.has(r.authorKind)||ki.has(r.source)||Ri.has(r.basis))})}function Lt(e="en"){let t,r;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?r.format(e):t.format(e):e+""}function _t(e){const t=Pi["string"==typeof e.type?e.type:"annotation"]||"an annotation",r=function(e){const t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,r=t?.authorKind??t?.source??t?.basis;return"watcher"===r?"a watcher-flagged ":"agent"===r||"ai"===r||"llm-inference"===r?"an AI-suggested ":""}(e),a=r?r+t.replace(/^an? /,""):t,o="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return o?`${a} labeled "${o}"`:a}function Dt(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const r=xt(t.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return;const a=r.map(_t),o=a.slice(0,5),n=a.length-o.length,i=function(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}(o)+(n>0?`, and ${n} more`:""),s=r.length;return`The author has marked ${1===s?"one feature":s+" features"} on this chart: ${i}.`}function Ut(e,t,r={}){const a=void 0!==r.levels,o=new Set(r.levels??["l1","l2","l3"]);a||!r.capability&&!Bt(t)||o.add("l4");const n=kt(e,t,r.recipe);if(n){const e=["l1","l2","l3","l4"].filter(e=>o.has(e));a||e.includes("l4")||e.push("l4");const i=function(e,t,r={}){const a=St(t),o=Ct(t),n=r.locale??"en",i="function"==typeof e.description?e.description({data:a,config:o,locale:n}):void 0,s=i?.levels??function(e,t,r,a){const o=It(e,["nominal","ordinal"]),n=It(e,["quantitative"]),i=o?Rt(o,r,t):void 0,s=n?Rt(n,r,t):void 0,c=o?.role??i??"category",l=n?.role??s??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${c} and ${l} are mapped through the recipe's declared visual semantics`,{number:h,percent:p}=function(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}(a),f=new Map;if(i&&s)for(const e of t){const t=(e[i]??"Uncategorized")+"",r=Number(e[s]);Number.isFinite(r)&&f.set(t,(f.get(t)??0)+r)}const m=[...f].sort((e,t)=>t[1]-e[1]),g=m.reduce((e,[,t])=>e+t,0),y=m[0],b=m[1],v=g>0?((y?.[1]??0)+(b?.[1]??0))/g:0,w=e.intents.map(e=>({id:$t(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,A=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${c} and ${l}. ${x=d,x?x.charAt(0).toUpperCase()+x.slice(1):x}.`,l2:m.length>0?`${m.length} categories total ${h.format(g)}. ${y[0]} accounts for ${h.format(y[1])}${g>0?` (${p.format(y[1]/g)})`:""}${b?`, followed by ${b[0]} at ${h.format(b[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>m.length?y?y[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>v?`The total is distributed across ${m.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${y[0]} and ${b[0]}, which together account for ${p.format(v)}.`,l4:`The chart is intended for ${w??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`};var x}(e,a,o,n),c=r.levels??["l1","l2","l3","l4"],l={};for(const e of c)s[e]&&(l[e]=s[e]);const u=["l1","l2","l3","l4"].map(e=>l[e]).filter(e=>!!e).join(" "),d=r.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:u,levels:l,...d?.length?{caveats:d}:{}}}(n,t,{levels:e,locale:r.locale,audience:r.audience,includeCaveats:r.includeCaveats}),s=Dt(t);return{...i,text:s?`${s} ${i.text}`.trim():i.text,...s?{annotations:s}:{}}}const i=Lt(r.locale??"en"),s=Ft(e),c=Array.isArray(t.data)?t.data:null,l=wt(t),u=bi.has(e)?Mt(t,i):null,d=bi.has(e)&&null===u?Nt(e,t):null,{measure:h,measureFallback:p,dimension:f,dimensionFallback:m}=vt(e,t),g="string"==typeof h&&h?h:p,y="string"==typeof f&&f?f:m,b={};if(bi.has(e)&&function(e,t,r,a,o,n,i=null){const s=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),c=i&&"EventDropChart"===e?"accepted event":function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}(e),l=i?i.generated?"The generated sample projection":"The source projection":"The settled projection";if(o.has("l1")&&(a.l1=function(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}(e,t)),!o.has("l2")&&!o.has("l3"))return;if(!r||0===r.length)return void(o.has("l2")&&(a.l2=i?"No valid source records are available.":"No settled projection is loaded yet."));const u=r.reduce((e,t)=>e+t.count,0),d=r.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),h=d[0]??r.slice().sort((e,t)=>t.count-e.count)[0];if(!h)return;const p=r.reduce((e,t)=>e+(t.secondary??0),0),f=r.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(o.has("l2"))if(i&&"EventDropChart"===e)a.l2=`${l} classifies ${n(u+p)} ${Ot(u+p,"event")} across ${r.length} ${Ot(r.length,s)}: ${n(u)} accepted and ${n(p)} late.`;else if(0===d.length)a.l2=`${l} contains ${n(u)} ${Ot(u,c)} across ${r.length} ${Ot(r.length,s)}; no ${Ot(2,s)} are non-empty yet.`;else{const e=p>0?` ${n(p)} ${Ot(p,c)} ${1===p?"is":"are"} marked ${f}.`:"";a.l2=`${l} contains ${n(u)} ${Ot(u,c)} across ${r.length} ${Ot(r.length,s)}; ${d.length} ${Ot(d.length,s)} ${1===d.length?"is":"are"} non-empty. The largest ${s} is ${h.label} with ${n(h.count)} ${Ot(h.count,c)}.${e}`}if(o.has("l3")&&u>0&&d.length>0){const e=d.find(e=>e!==h),t=function(e,t){if(0>=t)return"0%";const r=e/t*100;return(10>r?Math.round(10*r)/10:Math.round(r))+"%"}(h.count,u);a.l3=e?`${l} is most concentrated in ${h.label}, which holds ${n(h.count)} ${Ot(h.count,c)} (${t}); ${e.label} follows with ${n(e.count)} ${Ot(e.count,c)}.`:`${l} is concentrated in ${h.label}, which holds all ${n(h.count)} ${Ot(h.count,c)}.`}}(e,s,u??(d?Mt({projectionRows:d.rows},i):null),b,o,i,d),o.has("l1")&&!bi.has(e))if("BumpChart"===e)b.l1=`A ${s} ranking ${l??"series"} by ${g} across ${y}.`;else if(hi.has(e)||pi.has(e))b.l1=`A ${s} of ${g} by ${y}`+(l?`, split by ${l}.`:".");else if(fi.has(e))b.l1=`A ${s} showing ${g} across ${y} categories.`;else if(mi.has(e))b.l1=`A ${s} of the distribution of ${g}`+(l?` by ${l}.`:".");else if(yi.has(e)){const e=Array.isArray(t.nodes)?t.nodes.length:void 0,r=Array.isArray(t.edges)?t.edges.length:void 0,a=[null!=e?`${e} ${Gt(e,"node")}`:null,null!=r?`${r} ${Gt(r,"edge")}`:null].filter(Boolean);b.l1=`A ${s}${a.length?" with "+a.join(" and "):""}.`}else if("BigNumber"===e){const e="string"==typeof t.label?t.label:g;b.l1=`A single value${e?" for "+e:""}.`}else b.l1=`A ${s}.`;const v=hi.has(e)||"BumpChart"===e||pi.has(e)||fi.has(e)||mi.has(e);let w=null;if((o.has("l2")||o.has("l3")||o.has("l4"))&&v&&c&&c.length>0&&(w=function(e,t,r,a){let o=0,n=0,i=1/0,s=-1/0,c=null,l=null,u=0,d=0,h=null,p=null,f=NaN,m=NaN;for(const r of e){const e=t(r);Number.isFinite(e)&&(0===o&&(f=e,h=r),m=e,p=r,i>e&&(i=e,c=r,u=o),e>s&&(s=e,l=r,d=o),o++,n+=e)}return 0===o?null:{count:o,min:i,max:s,mean:n/o,minLabel:At(null!=c?r(c):null,a),maxLabel:At(null!=l?r(l):null,a),first:f,last:m,firstLabel:At(null!=h?r(h):null,a),lastLabel:At(null!=p?r(p):null,a),minIndex:u,maxIndex:d}}(c,yt(h,p),bt(f,m),i)),o.has("l2")&&v&&(c&&0!==c.length?w&&(b.l2=fi.has(e)?`${w.count} segments totaling ${i(function(e){return e.mean*e.count}(w))}. Largest is ${w.maxLabel} at ${i(w.max)}; smallest is ${w.minLabel} at ${i(w.min)}.`:`${g} ranges from ${i(w.min)} (${w.minLabel}) to ${i(w.max)} (${w.maxLabel}), with a mean of ${i(w.mean)} across ${w.count} points.`):b.l2="No data is loaded yet."),o.has("l3")&&w&&!l&&hi.has(e)?b.l3=function(e,t,r){const{first:a,last:o,min:n,max:i,maxLabel:s,minLabel:c,firstLabel:l,lastLabel:u,minIndex:d,maxIndex:h,count:p}=e,f=i-n,m=o-a;if(0===f)return`${Vt(t)} is constant at ${r(a)} across the series.`;if(.04>f/(Math.abs(e.mean)||1))return`${Vt(t)} ends roughly where it started (${r(a)} at ${l} to ${r(o)} at ${u}), ranging between ${r(n)} and ${r(i)}.`;const g=h>0&&p-1>h,y=d>0&&p-1>d,b=(i-Math.max(a,o))/f,v=(Math.min(a,o)-n)/f;return g&&b>.15?`Overall ${t} climbs to a peak of ${r(i)} (${s}), then falls to ${r(o)} (${u}).`:y&&v>.15?`Overall ${t} drops to a low of ${r(n)} (${c}), then recovers to ${r(o)} (${u}).`:.05>Math.abs(m)/f?`${Vt(t)} ends roughly where it started (${r(a)} at ${l} to ${r(o)} at ${u}), ranging between ${r(n)} and ${r(i)}.`:m>0?h===p-1?`Overall ${t} rises from ${r(a)} (${l}) to a peak of ${r(o)} (${u}).`:`Overall ${t} rises from ${r(a)} (${l}) to ${r(o)} (${u}), after peaking at ${r(i)} (${s}).`:d===p-1?`Overall ${t} falls from ${r(a)} (${l}) to a low of ${r(o)} (${u}).`:`Overall ${t} falls from ${r(a)} (${l}) to ${r(o)} (${u}), after dipping to ${r(n)} (${c}).`}(w,g,i):o.has("l3")&&w&&!l&&pi.has(e)&&(b.l3=`The highest ${y} is ${w.maxLabel} and the lowest is ${w.minLabel}.`),o.has("l4")){const a=Bt(t)?"alerting":zt(e,r.capability);a&&(b.l4=function(e,t,r,a,o,n,i,s){const c=$i[e],l=/^[aeiou]/i.test(c)?"an":"a";let u,d;switch(e){case"locating":u="This is a map",d="read values by location";break;case"presenting":u="This is a single-value display",d=`read ${"string"==typeof r.label&&r.label?r.label:o} as the headline number`;break;case"tracing":u=`This is ${l} ${c} chart`,d="follow the movement between states";break;case"nesting":u=`This is ${l} ${c} chart`,d="read it for nested structure and how children sum into their parents";break;case"relating":u=`This is ${l} ${c} chart`,d=`read it for whether ${n} and ${o} move together`;break;default:u=`This is ${l} ${c} chart`,d=function(e,t,r,a,o,n){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+r;case"comparing":return`compare ${r} across ${a}`;case"ranking":return"read it top to bottom by "+r;case"apportioning":return`read each ${a}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+r;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,r){if(pi.has(r)||fi.has(r))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:a,last:o,min:n,max:i,minLabel:s,maxLabel:c,lastLabel:l,minIndex:u,maxIndex:d,count:h}=e,p=i-n;if(p>0){const e=d>0&&h-1>d,r=u>0&&h-1>u,f=(i-Math.max(a,o))/p,m=(Math.min(a,o)-n)/p;if(e&&f>.15)return`the peak of ${t(i)} at ${c} is the point to investigate`;if(r&&m>.15)return`the dip to ${t(n)} at ${s} is the point to investigate`;if(o>=i)return`the climb to ${t(o)} at ${l} warrants a closer look`;if(n>=o)return`the drop to ${t(o)} at ${l} warrants a closer look`}return`the extremes — ${c} (${t(i)}) and ${s} (${t(n)}) — are the points to check`}(t,o,n);case"tracking":return`read it for the trajectory of ${r}, which ${function(e){const t=e.max-e.min,r=e.last-e.first;return 0===t||.05>Math.abs(r)/t?"holds roughly steady":r>0?"rises":"falls"}(t)} from ${o(t.first)} (${t.firstLabel}) to ${o(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${r} across ${a}; ${t.maxLabel} leads at ${o(t.max)}`;case"ranking":return`read it top to bottom by ${r}; ${t.maxLabel} ranks highest at ${o(t.max)}`;case"apportioning":{const e=t.mean*t.count,r=e>0?Math.round(t.max/e*100):null;return`read each ${a}'s share of the ${o(e)} total; ${t.maxLabel} is the largest at ${o(t.max)}${null!=r?` (${r}%)`:""}`}case"characterizing":return`read it for the spread of ${r}, from ${o(t.min)} to ${o(t.max)}`;default:return"read the highlighted features"}}(e,a,o,n,i,t)}return`${u}; ${d}.${function(e,t){if(!t)return"";const r=t.familiarity?.[e];return"number"!=typeof r||r>2?"":` This ${Ft(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,s)}`}(a,e,t,l?null:w,g,y,i,r.audience))}const A=["l1","l2","l3","l4"].filter(e=>o.has(e)&&b[e]).map(e=>b[e]).join(" "),x=Dt(t);return{text:x?`${x} ${A}`.trim():A,levels:b,...x?{annotations:x}:{}}}function Vt(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Gt(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Ht(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function qt(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function Wt(e,t="—"){return null==e||""===e?t:"object"==typeof e?Wt(e.id??e.name??e.label,t):e+""}function Yt(e){if(null==e||""===e)return;const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Kt(e){return Wt(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Jt(e,t){const r=qt(e,t,"children");return Array.isArray(r)?r:[]}function Xt(e,t,r){return`${e} ${1===e?t:r}`}function Zt(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?", leaf total "+t(e.leafTotal):`, known leaf total ${t(e.leafTotal)} across ${Xt(e.numericLeaves,"valued leaf","valued leaves")}`}function Qt(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function er(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function tr(e,t="—"){return null==e||""===e?t:"object"==typeof e?tr(e.id??e.name??e.label,t):e+""}function rr(e){if(null==e||""===e)return;const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function ar(e){return tr(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function or(e){const t=[];return(e.linkedHover||e.selection||e.linkedBrush)&&t.push("Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&t.push("Hover or focus a mark for its details."),t.length>0?" "+t.join(" "):""}function nr(e,t,r){const a=er(e,t,r);if(void 0!==a)return a;const o=e.properties;return o&&"object"==typeof o?er(o,t,r):void 0}function ir(e,t,r){return tr(nr(e,t,"id")??nr(e,"name","name")??nr(e,"NAME","NAME")??nr(e,"label","label"),r)}function sr(e){let t=0,r=1/0,a=-1/0,o=0;for(const n of e)null!=n.value&&(t+=1,r=Math.min(r,n.value),a=Math.max(a,n.value),o+=n.value);return 0===t?null:{count:t,min:r,max:a,total:o,average:o/t}}function cr(e,t){const r=sr(e);return r?`range ${t(r.min)} to ${t(r.max)}, average ${t(r.average)}, total ${t(r.total)}`:"no numeric values"}function lr(e,t,r,a){const o=function(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];const t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}(t.areas),n="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],i=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],c=t.valueAccessor??t.sizeBy??t.costAccessor??"value",l=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?o:n).map((r,a)=>({datum:r,index:a,label:ir(r,"ChoroplethMap"===e?t.idAccessor:l,`${"ChoroplethMap"===e?"region":"location"} ${a+1}`),value:rr(nr(r,c,"value"))})),d=u.filter(e=>null!=e.value),h={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${o.length} regions.${d.length>0?` Values are available for ${d.length} of ${o.length} regions; ${cr(d,a)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${i.length} flows and ${n.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${n.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${n.length} locations.`}${or(t)}`,children:[]};if("ChoroplethMap"===e)h.children=function(e,t,r){const a=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),o=new Map;let n,i=0;for(const[e,t]of a.entries())n!==t.value&&(i=e+1,n=t.value),o.set(t.index,i);let s=0;return function(e){const t=e.filter(e=>null!=e.value),r=e.filter(e=>null==e.value),a=[],o=sr(t);if(o)if(o.min===o.max)a.push({id:"equal",label:"Equal values",rows:t});else{const e=o.min+(o.max-o.min)/3,r=o.min+2*(o.max-o.min)/3,n=t.filter(e=>e.value>=r),i=t.filter(t=>t.value>=e&&r>t.value),s=t.filter(t=>e>t.value);n.length>0&&a.push({id:"highest",label:"Highest values",rows:n}),i.length>0&&a.push({id:"middle",label:"Middle values",rows:i}),s.length>0&&a.push({id:"lowest",label:"Lowest values",rows:s})}return r.length>0&&a.push({id:"missing",label:"No numeric value",rows:r}),a}(e).map(e=>{const n=e.rows.slice(0,Math.max(0,t-s));s+=n.length;const i=n.map(e=>{const t=o.get(e.index),n=null==t||2>a.length?"":`, rank ${t} of ${a.length}`;return{id:`geo-${ar(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?e.label+": no numeric value.":`${e.label}: ${r(e.value)}${n}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),c=e.rows.length-n.length;return c>0&&i.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${c} more ${1===c?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:"regions-"+e.id,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${cr(e.rows,r)}.`,children:i}})}(u,r,a);else if(u.length>0){const e=u.slice(0,r).map(e=>({id:`geo-${ar(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":": "+a(e.value)}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>r&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-r} more locations.`}),h.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}const p="FlowMap"===e?i:s;if(p.length>0){const e=p.slice(0,r).map((e,t)=>{const r=tr(e.source,"unknown"),o=tr(e.target,"unknown"),n=rr(er(e,c,"value"));return{id:`route-${ar(r)}-${ar(o)}-${t}`,role:"datum",level:3,label:`${r} to ${o}${null==n?"":": "+a(n)}.`,...null==n?{}:{value:n},datum:e}});h.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${p.length} ${1===p.length?"route":"routes"}.`,children:e})}return h}function ur(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function dr(e,t="—"){return null==e||""===e?t:"object"==typeof e?dr(e.id??e.name??e.label,t):e+""}function hr(e){if(null==e||""===e)return;const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function pr(e){return dr(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function fr(e,t){const r=[];return(e.linkedHover||e.selection||e.linkedBrush)&&r.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&r.push("Hover or focus a mark for its details."),r.length>0?" "+r.join(" "):""}function mr(e,t){t&&e.children?.push(t)}function gr(e,t,r={}){const a=r.locale??"en",o=Math.max(1,r.maxLeaves??200),n=Lt(a),i=kt(e,t,r.recipe);if(i)return function(e,t,r={}){const a=St(t),o=Ct(t),n=Math.max(1,r.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:a,config:o,locale:r.locale??"en"});const i=(s=e.navigation)&&"object"==typeof s?e.navigation:void 0;var s;const c=(i?.groupByRole?Pt(e,i.groupByRole):void 0)??(i?.groupBy?.[0]?Pt(e,i.groupBy[0])??e.dataRoles.find(e=>e.field===i.groupBy?.[0]):void 0)??It(e,["nominal","ordinal"]),l=c?Rt(c,o,a):void 0,u=(i?.idRole?Pt(e,i.idRole):void 0)??It(e,["identifier"]),d=u?Rt(u,o,a):void 0,h={id:"root",role:"chart",label:i?.summaryTemplate?Et(i.summaryTemplate,void 0,e,o,a,{count:a.length}):`${e.name}: ${a.length} ${1===a.length?"item":"items"} represented.`,level:1,children:[]};let p=0;const f=(t,r,n)=>{const s=d?t[d]:void 0,c=i?.itemLabelTemplate?Et(i.itemLabelTemplate,t,e,o,a,{count:a.length}):function(e,t,r,a){const o=It(t,["nominal","ordinal"]),n=t.dataRoles.filter(e=>"quantitative"===e.semanticType),i=o?Rt(o,r,a):void 0,s=[];i&&null!=e[i]&&s.push(e[i]+"");for(const t of n){const o=Rt(t,r,a);o&&null!=e[o]&&s.push(`${t.role}: ${e[o]+""}`)}return s.length>0?s.join(", "):"Data item"}(t,e,o,a);return{id:"datum-"+Ht(s??r),role:"datum",label:c,level:n,datum:t}};if(l){const e=new Map;for(const t of a){const r=(t[l]??"Uncategorized")+"",a=e.get(r);a?a.push(t):e.set(r,[t])}h.children=[...e].map(([e,t],r)=>{const a=t.slice(0,Math.max(0,n-p));p+=a.length;const o=a.map((e,t)=>f(e,1e5*r+t,3));return t.length>a.length&&o.push({id:"more-"+Ht(e),role:"datum",label:`…and ${t.length-a.length} more items`,level:3}),{id:"group-"+Ht(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:o}})}else{const e=a.slice(0,n);h.children=e.map((e,t)=>f(e,t,2)),a.length>e.length&&h.children.push({id:"more",role:"datum",label:`…and ${a.length-e.length} more items`,level:2})}return h}(i,t,{maxLeaves:o,locale:a});const s={id:"root",role:"chart",label:Ut(e,t,{locale:a}).text||"Chart.",level:1,children:[]},c=function(e,t){const r=Array.isArray(e.annotations)?e.annotations:null;if(!r)return null;const a=xt(r.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return null;let o=0;const n=a.slice(0,t).map(e=>{const t=e.lifecycle?.status,r=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+o++,role:"annotation",level:3,label:`${a=_t(e),a?a.charAt(0).toUpperCase()+a.slice(1):a}${r}.`,datum:e};var a});a.length>t&&n.push({id:"annotation-"+o++,role:"annotation",level:3,label:`…and ${a.length-t} more annotations.`});const i=a.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===i?"one marked feature":i+" marked features"}.`,children:n}}(t,o);if(Ii.has(e)){const r=function(e,t,r,a){const o=Array.isArray(t.nodes)?t.nodes:[],n=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],i=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",c=t.targetAccessor??"target",l=t.valueAccessor??"value",u=e=>dr(ur(e,i,"id"),"unknown"),d=(e,t)=>dr(ur(e,t,""),"unknown"),h=new Set;for(const e of n)h.add(d(e,s)),h.add(d(e,c));const p=o.length>0?o:[...h].map(e=>({id:e})),f=new Map;for(const e of p)f.set(u(e),{links:0,value:0});for(const e of n){const t=d(e,s),r=d(e,c),a=hr(ur(e,l,"value"))??0;for(const e of[t,r]){const t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=a,f.set(e,t)}}const m={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${p.length} nodes and ${n.length} links.${fr(t,"network")}`,children:[]};let g=0;const y=new Map,b=t.colorBy??"group";for(const e of p){const t=dr(ur(e,b,"group"),"Ungrouped"),r=y.get(t);r?r.push(e):y.set(t,[e])}const v=[...y].map(([e,t],o)=>{const n=[];for(const[e,i]of t.entries()){if(g>=r)break;g+=1;const t=u(i),s=f.get(t)??{links:0,value:0},c=s.value>0?`, ${a(s.value)} total flow`:"";n.push({id:`node-${o}-${e}-${pr(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${c}.`,value:s.value>0?s.value:void 0,datum:i})}return{id:`nodes-${o}-${pr(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:n}});v.length>0&&m.children?.push(...v);const w=n.slice(0,r).map((e,t)=>{const r=d(e,s),o=d(e,c),n=hr(ur(e,l,"value"));return{id:`link-${pr(r)}-${pr(o)}-${t}`,role:"datum",level:3,label:`${r} to ${o}${null==n?"":": "+a(n)}.`,value:n,datum:e}});return n.length>r&&w.push({id:"links-more",role:"datum",level:3,label:`…and ${n.length-r} more links.`,value:void 0}),w.length>0&&m.children?.push({id:"links",role:"series",level:2,label:`Links: ${n.length} ${1===n.length?"connection":"connections"}.`,children:w}),m}(e,t,o,n);return mr(r,c),r}if(Ei.has(e)){const r=function(e,t,r,a){const o=t.data&&"object"==typeof t.data?t.data:null,n=t.childrenAccessor??"children",i=t.valueAccessor??"value",s=t.nodeLabel??t.nodeIdAccessor,c=new WeakMap,l=new WeakSet,u=e=>{const t=c.get(e);if(t)return t;if(l.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};l.add(e);const r=Jt(e,n);let a;if(0===r.length){const t=Yt(qt(e,i,"value"));a={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else a=r.reduce((e,t)=>{const r=u(t);return{descendants:e.descendants+1+r.descendants,depth:Math.max(e.depth,r.depth+1),leaves:e.leaves+r.leaves,numericLeaves:e.numericLeaves+r.numericLeaves,leafTotal:e.leafTotal+r.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return l.delete(e),c.set(e,a),a};let d=0;const h=(e,t,o,c)=>{const l=Wt(qt(e,s,"name"),"item "+o);if(c.has(e))return{id:`hierarchy-${Kt(o)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${l}; branch omitted.`};const p=Jt(e,n),f=u(e);if(0===p.length){if(d>=r)return null;d+=1;const n=Yt(qt(e,i,"value"));return{id:`hierarchy-${Kt(o)}-${Kt(l)}`,role:"datum",level:t,label:`${l}${null==n?"":": "+a(n)}.`,...null==n?{}:{value:n},datum:e}}const m=new Set(c);m.add(e);const g=[];let y=0;for(const[e,a]of p.entries()){if(d>=r){y+=u(a).leaves;continue}const n=h(a,t+1,`${o}-${e}`,m);n&&g.push(n)}return y>0&&g.push({id:`hierarchy-${Kt(o)}-more`,role:"datum",level:t+1,label:`${Xt(y,"more leaf","more leaves")} in ${l} not shown; navigation is capped at ${r}.`}),{id:`hierarchy-${Kt(o)}-${Kt(l)}`,role:"series",level:t,label:`${l}: ${Xt(p.length,"direct child","direct children")}, ${Xt(f.descendants,"total descendant","total descendants")}, ${Xt(f.leaves,"leaf","leaves")}${Zt(f,a)}.`,datum:e,children:g}},p=o?u(o):null,f={id:"root",role:"chart",level:1,label:o?`A ${Qt(e)} chart with ${Xt(p.leaves,"leaf","leaves")} and ${Xt(p.descendants,"total descendant","total descendants")} across ${Xt(p.depth,"hierarchy level","hierarchy levels")}${Zt(p,a)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(o){const e=h(o,2,"root",new Set);if(e){const t=Wt(qt(o,s,"name"),"");f.children="series"===e.role&&""===t?e.children:[e]}}return f}(e,t,o,n);return mr(r,c),r}if(Ni.has(e)){const r=lr(e,t,o,n);return mr(r,c),r}const l=Array.isArray(t.data)?t.data:null,u=function(e,t={},r={}){return!!kt(e,t,r.recipe)||Ii.has(e)||Ei.has(e)||Ni.has(e)||hi.has(e)||pi.has(e)||fi.has(e)||mi.has(e)}(e,t,r);if(!l||0===l.length||!u)return c&&(s.children=[c]),s;const{measure:d,measureFallback:h,dimension:p,dimensionFallback:f}=vt(e,t),m=yt(d,h),g=bt(p,f),y="string"==typeof d&&d?d:h,b="string"==typeof p&&p?p:f,v=wt(t);let w=0;const A=e=>`${e}-${w++}`,x=(e,t)=>{const r=e.slice(0,o).map(e=>((e,t)=>{const r=m(e),a=At(g(e),n);return{id:A("datum"),role:"datum",level:t,label:`${a}: ${Number.isFinite(r)?n(r):"—"}`,value:Number.isFinite(r)?r:void 0,datum:e}})(e,t));return e.length>o&&r.push({id:A("more"),role:"datum",level:t,label:`…and ${e.length-o} more points`}),r},$=[];if(hi.has(e)||pi.has(e)){let t=1/0,r=-1/0,a=1/0,o=-1/0;const i=[];let s=!0;for(const e of l){const n=m(e);Number.isFinite(n)&&(t>n&&(t=n),n>r&&(r=n));const c=g(e);i.push(c),"number"==typeof c&&Number.isFinite(c)?(a>c&&(a=c),c>o&&(o=c)):s=!1}const c=new Set,u=[];for(const e of i){const t=e+"";c.has(t)||(c.add(t),u.push(e))}const d=s?`${n(a)} to ${n(o)}`:`${At(u[0],n)} to ${At(u[u.length-1],n)} (${pi.has(e)?u.length+" categories":l.length+" points"})`;$.push({id:A("axis"),role:"axis",level:2,label:`${pi.has(e)?"Category axis":"X axis"}: ${b}, ${d}.`}),t>r||$.push({id:A("axis"),role:"axis",level:2,label:`Value axis: ${y}, ${n(t)} to ${n(r)}.`})}if(v){const r=bt(v,v),o=new Map;for(const e of l){const t=(r(e)??"—")+"",a=o.get(t);a?a.push(e):o.set(t,[e])}const n=[];for(const[r,i]of o){const o=Ut(e,{...t,data:i},{levels:["l2","l3"],locale:a}).text;n.push({id:A("series"),role:"series",level:2,label:`Series ${r}: ${o}`,children:x(i,3)})}s.children=[...$,...n]}else s.children=[...$,...x(l,2)];return c&&s.children.push(c),s}function yr(e,t){const r=[],a=e=>{if(r.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)a(t)};return a(e),r}function br(e){let t=1;if(e.children)for(const r of e.children)t+=br(r);return t}function vr(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function wr(e){return vr(e)?e:void 0}function Ar(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function xr(e){const t=Ar(e);return null==t?void 0:Math.max(0,Math.floor(t))}function $r(...e){return e.map(wr).find(Boolean)}function Cr(...e){return e.find(Array.isArray)}function Sr(e){const t={};for(const[r,a]of Object.entries(e))void 0!==a&&(t[r]=a);return t}function kr(e,t,r){return e["string"==typeof t&&t?t:r]}function Rr(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function Pr(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Ir(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function Er(e,t,r){const a=e?.filter(e=>!0===wr(e)?.sensor).length,o=wr(t?.observation),n=wr(o?.sensors),i=Cr(r?.activeSensors);return Math.max(a??0,n?Object.keys(n).length:0,i?.length??0)||void 0}function Nr(e,t,r={}){const{capability:a,audience:o,locale:n}=r,i=r.levels??["l1","l2","l3"],s=!1!==r.includeStructure,c=zt(e,a),l=Ut(e,t,{levels:c?[...i,"l4"]:i,locale:n,capability:a,audience:o}),{l4:u,...d}=l.levels,h=["l1","l2","l3"].map(e=>l.levels[e]).filter(Boolean).join(" "),p={levels:d,text:l.annotations?`${l.annotations} ${h}`.trim():h,...l.annotations?{annotations:l.annotations}:{}};let f;if(c&&u){const e=(m=a)?"fits"in m||"buildProps"in m?{family:m.family}:{family:m.family,intentScores:m.intentScores}:{};f={act:c,sentence:u,family:e.family,intentScores:e.intentScores}}var m;const g=s?gr(e,t,{maxLeaves:r.maxLeaves,locale:n}):void 0,y=function(e,t,r){if(!1===r)return;const a=vr(r)?r:void 0,o=wr(t.physics),n=$r(a?.snapshot,o?.snapshot,t.physicsSnapshot,function(e){const t=wr(e);return!!t&&(vr(t.world)||"simulationState"in t||"liveBodyOrder"in t)}(t.snapshot)?t.snapshot:void 0),i=$r(a?.evidence,o?.evidence,t.physicsEvidence,t.settledEvidence),s=$r(a?.config,o?.config,n?.config,t.config),c=$r(wr(n?.world),wr(o?.world)),l=$r(wr(s?.kernel),wr(c?.options)),u=Cr(c?.bodies),d=Cr(c?.colliders,s?.colliders),h=Cr(n?.queue,o?.queue),p=Cr(n?.liveBodyOrder),f=Cr(c?.springs),m=Cr(n?.activeSensorPairs),g=function(e){if(!e||0===e.length)return;const t=e.map((e,t)=>{const r=wr(e);if(!r)return;const a=Ar(r.count??r.value??r.total??r.bodies??r.events);if(null==a)return;const o=(r.label??r.id??r.name??"container "+(t+1))+"",n=null==r.id?void 0:r.id+"",i=Ar(r.secondary??r.secondaryCount),s=Ar(r.observed??r.observedCount);return Sr({id:n,label:o,count:a,secondary:i,secondaryLabel:"string"==typeof r.secondaryLabel?r.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;const r=t.reduce((e,t)=>e+t.count,0),a=t.filter(e=>e.count>0).length,o=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:r,populatedCount:a,...o?{leader:o}:{}}}(function(e,t,r,a){const o=wr(e.settledProjection),n=wr(t?.settledProjection);return Cr(r?.projectionRows,r?.aggregates,e.settledProjectionRows,e.projectionRows,o?.rows,t?.settledProjectionRows,t?.projectionRows,n?.rows,a?.binCounts)}(t,o,a,i)),y=function(e,t){const r=e?.map((e,t)=>{const r=wr(e);if(!r)return;const a=Ar(r.count)??0,o=Ar(r.total),n={label:(r.label??r.id??"sediment "+(t+1))+"",count:a};return null!=r.id&&(n.id=r.id+""),null!=o&&(n.total=o),n}).filter(e=>null!=e),a=xr(t?.bins)??r?.length??0,o=Ar(t?.count)??r?.reduce((e,t)=>e+t.count,0)??0,n=Ar(t?.total)??r?.reduce((e,t)=>e+(t.total??0),0),i=r?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==a||0!==o||n)return{bins:a,count:o,...null!=n&&n>0?{total:n}:{},...i?{leader:i}:{}}}(Cr(a?.sediment,o?.sediment,n?.sediment),$r(a?.sedimentTotals,o?.sedimentTotals)),b=p?.length??u?.length??xr(i?.bodyCount),v=function(e){if(e)return e.filter(e=>!0===wr(e)?.sleeping).length}(u)??xr(i?.sleepingCount),w=h?.length,A="string"==typeof n?.simulationState?n.simulationState:void 0,x="boolean"==typeof i?.settled?i.settled:A?"settled"===A:null!=b||null!=v||null!=w?null!=b&&v===b&&0===(w??0):void 0,$=wr(l?.gravity),C=Ar($?.x),S=Ar($?.y),k=Sr({state:A,settled:x,elapsedSeconds:Ar(n?.elapsedSeconds),paused:"boolean"==typeof n?.paused?n.paused:void 0,visible:"boolean"==typeof n?.visible?n.visible:void 0,seed:Ar(l?.seed),gravity:null!=C&&null!=S?{x:C,y:S}:void 0,fixedDt:Ar(s?.fixedDt??l?.fixedDt),timeScale:Ar(s?.timeScale),maxSubsteps:xr(s?.maxSubsteps),liveBodies:b,sleepingBodies:v,queued:w,bodyLimit:Ar(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),R=Sr({colliders:d?.length,sensors:Er(d,s,c),springs:f?.length,activeSensorPairs:m?.length}),P=Object.keys(R).length>0,I=Ti.has(e);if(!(Object.keys(k).length>0||P||g||y)||!I&&null==r)return;const E={simulation:k,...P?{geometry:R}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},N=function(e){const t=[],r=e.simulation,a=[r.state??(r.settled?"settled":void 0),null!=r.liveBodies?`${r.liveBodies} live ${Pr(r.liveBodies,"body")}`:void 0,null!=r.sleepingBodies?r.sleepingBodies+" sleeping":void 0,null!=r.queued?r.queued+" queued":void 0,null!=r.seed?"seed "+Ir(r.seed):void 0,r.gravity?`gravity (${Ir(r.gravity.x)}, ${Ir(r.gravity.y)})`:void 0,null!=r.fixedDt?`fixed step ${Ir(r.fixedDt)}s`:void 0,null!=r.timeScale?Ir(r.timeScale)+"x time":void 0].filter(Boolean);a.length>0&&t.push(`Physics simulation: ${a.join("; ")}.`);const o=e.geometry;if(o){const e=[null!=o.colliders?`${o.colliders} ${Pr(o.colliders,"collider")}`:void 0,null!=o.sensors?`${o.sensors} ${Pr(o.sensors,"sensor")}`:void 0,null!=o.springs?`${o.springs} ${Pr(o.springs,"spring")}`:void 0,null!=o.activeSensorPairs?`${o.activeSensorPairs} active sensor ${Pr(o.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}const n=e.aggregates;if(n){const e=n.leader,r=e?` Largest is ${e.label} with ${Ir(e.count)}.`:"";t.push(`Physics aggregates: ${Ir(n.totalCount)} settled ${Pr(n.totalCount,"body")} across ${n.rows.length} ${Pr(n.rows.length,"container")}; ${n.populatedCount} populated.${r}`)}const i=e.sediment;if(i){const e=null!=i.total?", value total "+Ir(i.total):"",r=i.leader?`; largest sediment bin is ${i.leader.label} with ${Ir(i.leader.count)}`:"";t.push(`Physics sediment: ${i.count} retained ${Pr(i.count,"body")} in ${i.bins} ${Pr(i.bins,"bin")}${e}${r}.`)}return t.join(" ")}(E);return{...E,text:N}}(e,t,r.physics),b=function(e,t,r){const a=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&a.push(`Current value is ${Rr(t.value)}.`);const e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,r="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;a.push(`The gauge scale runs from ${Rr(e)} to ${Rr(r)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){const o=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&a.push(`The ProcessSankey time domain runs from ${Rr(t.domain[0])} to ${Rr(t.domain[1])}.`),o.length>0){a.push(`${o.length} source flow${1===o.length?"":"s"} are supplied.`);for(const n of o.slice(0,r)){const r=kr(n,t.sourceAccessor,"source"),o=kr(n,t.targetAccessor,"target"),i=kr(n,t.valueAccessor,"value");a.push("ProcessSankey"!==e||null==n.startTime&&null==n.endTime?`${Rr(r)} to ${Rr(o)} has value ${Rr(i)}.`:`${Rr(r)} to ${Rr(o)} has value ${Rr(i)} over ${Rr(n.startTime)}–${Rr(n.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){const e=wr(t.data),o="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",n="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",i="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",s=[],c=e=>{const t=Array.isArray(e[o])?e[o]:[];if(0!==t.length)for(const e of t){const t=wr(e);t&&c(t)}else s.push(e)};if(e&&c(e),s.length>0){a.push(s.length+" hierarchy leaves are supplied.");for(const e of s.slice(0,r))a.push(`${Rr(e[i])} has value ${Rr(e[n])}.`)}}if(Ti.has(e)&&Array.isArray(t.data)){const r=t.data;a.push(`${r.length} observed source row${1===r.length?"":"s"} are supplied.`);const o="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,n="CollisionSwarmChart"===e?"x":"value",i=r.map(e=>Ar(kr(e,o,n))).filter(e=>null!=e);i.length>0&&a.push(`Observed ${"string"==typeof o?o:n} ranges from ${Rr(Math.min(...i))} to ${Rr(Math.max(...i))}.`)}if(0!==a.length)return{source:"chart-props",statements:a,text:"Exact chart-prop facts: "+a.join(" ")}}(e,t,Math.max(1,r.maxLeaves??200)),v=[p.text,f?.sentence,y?.text,b?.text].filter(Boolean).join(" ");return{component:e,description:p,intent:f,structure:g,physics:y,facts:b,text:v}}function Tr(e,t=30){return Math.max((e??4)+5,12,t)}function Mr(e){return Oi.has(e)}function Or(e,t){return`${e}[Symbol(${t.description??""})]`}function Fr(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;const r=Number(e);return Number.isSafeInteger(r)&&r>=0&&t>r}function jr(e,t){return"number"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t}function zr(e){return e.sort((e,t)=>{const r=JSON.stringify(e),a=JSON.stringify(t);return a>r?-1:r>a?1:0})}function Br(e,t,r){if(null===e)return null;if(e instanceof Date){const a=e.getTime();return Number.isFinite(a)?{$type:"date",value:e.toISOString()}:void r.excluded.push(t)}switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isNaN(e)?{$type:"number",value:"NaN"}:e===1/0?{$type:"number",value:"Infinity"}:e===-1/0?{$type:"number",value:"-Infinity"}:Object.is(e,-0)?{$type:"number",value:"-0"}:e;case"bigint":return{$type:"bigint",value:""+e};case"undefined":case"function":case"symbol":return void r.excluded.push(t);case"object":{const a=e;if(r.ancestors.has(a))return void r.excluded.push(t);r.ancestors.add(a);try{if(Array.isArray(e)){for(const a of Reflect.ownKeys(e))"length"===a||"string"==typeof a&&Fr(a,e.length)||r.excluded.push("symbol"==typeof a?Or(t,a):jr(t,a));return Array.from({length:e.length},(a,o)=>{const n=jr(t,o),i=Object.getOwnPropertyDescriptor(e,o+"");if(!i||!("value"in i)||!i.enumerable)return r.excluded.push(n),null;const s=Br(i.value,n,r);return void 0===s?null:s})}const a={},o=Object.getPrototypeOf(e);if(o!==Object.prototype&&null!==o)return void r.excluded.push(t);const n=[];for(const a of Reflect.ownKeys(e)){if("symbol"==typeof a){r.excluded.push(Or(t,a));continue}const o=Object.getOwnPropertyDescriptor(e,a);o&&"value"in o&&o.enumerable?n.push(a):r.excluded.push(jr(t,a))}for(const o of n.sort()){const n=Object.getOwnPropertyDescriptor(e,o),i=Br(n&&"value"in n?n.value:void 0,jr(t,o),r);void 0!==i&&Object.defineProperty(a,o,{value:i,enumerable:!0,configurable:!0,writable:!0})}return a}finally{r.ancestors.delete(a)}}default:return void r.excluded.push(t)}}function Lr(e,t=new Set){if(null===e)return["null"];if(e instanceof Date)return Number.isFinite(e.getTime())?["date",e.toISOString()]:["excluded"];switch(typeof e){case"string":return["string",e];case"boolean":return["boolean",e];case"number":return["number",Number.isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":Object.is(e,-0)?"-0":e+""];case"bigint":return["bigint",""+e];case"undefined":case"function":case"symbol":return["excluded"];case"object":if(t.has(e))return["excluded"];t.add(e);try{const r=r=>{const a="symbol"==typeof r?["symbol-key",r.description??""]:["string-key",r],o=Object.getOwnPropertyDescriptor(e,r);return o?"value"in o?[a,"data",!!o.enumerable,Lr(o.value,t)]:[a,"accessor",!!o.enumerable,!!o.get,!!o.set]:[a,"missing"]};if(Array.isArray(e)){return["array",Array.from({length:e.length},(t,a)=>{const o=a+"";return Object.prototype.hasOwnProperty.call(e,o)?r(o):["hole"]}),zr(Reflect.ownKeys(e).filter(t=>"length"!==t&&!("string"==typeof t&&Fr(t,e.length))).map(r))]}const a=Object.getPrototypeOf(e);return[a!==Object.prototype&&null!==a?"non-json-object":"object",zr(Reflect.ownKeys(e).map(r))]}finally{t.delete(e)}default:return["excluded"]}}function _r(e){const t={excluded:[],ancestors:new Set},r=Br(e,"$",t)??null;return{value:r,text:JSON.stringify(r),excludedPaths:t.excluded}}function Dr(e){const t=_r(e),r=function(e){const t=[...zi],r=Array.from((new TextEncoder).encode(e)),a=8*r.length;for(r.push(128);r.length%64!=56;)r.push(0);const o=Math.floor(a/4294967296),n=a>>>0;r.push(o>>>24&255,o>>>16&255,o>>>8&255,255&o,n>>>24&255,n>>>16&255,n>>>8&255,255&n);const i=[];for(let e=0;r.length>e;e+=4)i.push((r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0);for(let e=0;i.length>e;e+=16){const r=[...i.slice(e,e+16)];for(let e=16;64>e;e+=1){const t=Fi(r[e-15],7)^Fi(r[e-15],18)^r[e-15]>>>3,a=Fi(r[e-2],17)^Fi(r[e-2],19)^r[e-2]>>>10;r[e]=r[e-16]+t+r[e-7]+a>>>0}let[a,o,n,s,c,l,u,d]=t;for(let e=0;64>e;e+=1){const t=d+(Fi(c,6)^Fi(c,11)^Fi(c,25))+(c&l^~c&u)+Bi[e]+r[e]>>>0,i=a&o^a&n^o&n;d=u,u=l,l=c,c=s+t>>>0,s=n,n=o,o=a,a=t+((Fi(a,2)^Fi(a,13)^Fi(a,22))+i>>>0)>>>0}const h=[a,o,n,s,c,l,u,d];for(let e=0;8>e;e+=1)t[e]=t[e]+h[e]>>>0}return t.map(e=>e.toString(16).padStart(8,"0")).join("")}(JSON.stringify(["semiotic-value-fingerprint","v2",Lr(e)]));return{...t,algorithm:"sha256",digest:r,fingerprint:"sha256:"+r}}function Ur(e,t,r,a){Yr(e,Object.keys(t),r,a);for(const[o,n]of Object.entries(t))n.values?(n.required||void 0!==e[o])&&Jr(e,o,r,n.values,a):n.required?Kr(e,o,r,a):ta(e,o,r,a)}function Vr(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Gr(e,t,r,a){void 0===e[t]||"number"==typeof e[t]&&Number.isFinite(e[t])||a.push({path:`${r}.${t}`,message:"Expected a finite number."})}function Hr(e,t,r,a){void 0!==e[t]&&"boolean"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a boolean."})}function qr(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(qr):Vr(e)&&Object.values(e).every(qr))}function Wr(e,t,r,a){void 0===e[t]||Vr(e[t])&&qr(e[t])||a.push({path:`${r}.${t}`,message:"Expected a JSON object."})}function Yr(e,t,r,a){const o=new Set(t);for(const t of Object.keys(e))o.has(t)||a.push({path:`${r}.${t}`,message:"Unexpected property."})}function Kr(e,t,r,a){"string"==typeof e[t]&&e[t]||a.push({path:`${r}.${t}`,message:"Expected a non-empty string."})}function Jr(e,t,r,a,o){"string"==typeof e[t]&&a.includes(e[t])||o.push({path:`${r}.${t}`,message:`Expected one of: ${a.join(", ")}.`})}function Xr(e,t,r,a){const o=e[t];if(void 0!==o){if(Vr(o))return o;a.push({path:`${r}.${t}`,message:"Expected an object."})}}function Zr(e,t,r,a){const o=e[t];if(void 0!==o){if(Array.isArray(o))return o;a.push({path:`${r}.${t}`,message:"Expected an array."})}}function Qr(e,t,r){e?.some(e=>"string"!=typeof e||!e)&&r.push({path:t,message:"Expected non-empty string values."})}function ea(e,t,r,a,o){void 0!==e[t]&&Jr(e,t,r,a,o)}function ta(e,t,r,a){void 0!==e[t]&&"string"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a string."})}function ra(e,t,r){Vr(e)?(Yr(e,["id","name","kind"],t,r),Kr(e,"kind",t,r),ta(e,"id",t,r),ta(e,"name",t,r)):r.push({path:t,message:"Expected an actor object."})}function aa(e){for(const t of Object.values(e))Object.freeze(t.suppliedBy),Object.freeze(t);return Object.freeze(e)}function oa(e){try{return function(e){const t=[],r=[];if(!Vr(e))return{valid:!1,errors:[{path:"$",message:"Expected an object."}],warnings:r};const a=_e(e);if(a.length>0)return{valid:!1,errors:a.map(e=>({path:e,message:"Expected a JSON-compatible value that survives serialization unchanged."})),warnings:r};if(Yr(e,["contractVersion","artifact","purpose","claims","evidence","time","reception","form","contestability","accountability","inheritance","fieldStatus","extensions"],"$",t),e.contractVersion!==Li&&t.push({path:"$.contractVersion",message:`Expected contract version ${Li}.`}),Vr(e.artifact)){Yr(e.artifact,["id","kind","component","title","createdAt","configFingerprint","dataFingerprint","revision"],"$.artifact",t),Kr(e.artifact,"id","$.artifact",t),Jr(e.artifact,"kind","$.artifact",["chart","dashboard","story","alert","agent-answer"],t);for(const r of["component","title","createdAt","configFingerprint","dataFingerprint","revision"])ta(e.artifact,r,"$.artifact",t)}else t.push({path:"$.artifact",message:"Expected an artifact identity object."});if(Vr(e.purpose))if(Array.isArray(e.purpose.intents)){Yr(e.purpose,["intents","communicativeAct","decisionContext","stakes","allowedUses","prohibitedUses"],"$.purpose",t),e.purpose.intents.forEach((e,r)=>{Vr(e)&&"string"==typeof e.id&&e.id||t.push({path:`$.purpose.intents[${r}].id`,message:"Expected a non-empty intent identifier."}),Vr(e)&&Yr(e,["id","strength","source","rationale"],`$.purpose.intents[${r}]`,t),Vr(e)&&void 0!==e.strength&&Jr(e,"strength",`$.purpose.intents[${r}]`,["primary","secondary"],t),Vr(e)&&(ea(e,"source",`$.purpose.intents[${r}]`,["author","derived","model-proposal","import"],t),ta(e,"rationale",`$.purpose.intents[${r}]`,t))});for(const r of["allowedUses","prohibitedUses"])Qr(Zr(e.purpose,r,"$.purpose",t),"$.purpose."+r,t);ea(e.purpose,"stakes","$.purpose",["exploratory","informational","operational","high"],t),ta(e.purpose,"communicativeAct","$.purpose",t),ta(e.purpose,"decisionContext","$.purpose",t)}else t.push({path:"$.purpose.intents",message:"Expected an intent array."});else t.push({path:"$.purpose",message:"Expected a purpose object."});Array.isArray(e.claims)?e.claims.forEach((e,r)=>{if(!Vr(e))return void t.push({path:`$.claims[${r}]`,message:"Expected a claim object."});Yr(e,["id","text","kind","status","evidenceIds","scope","uncertainty","asOf","supersedes","authoredBy","review","tags"],`$.claims[${r}]`,t),Kr(e,"id",`$.claims[${r}]`,t),Jr(e,"kind",`$.claims[${r}]`,["description","observation","aggregation","inference","forecast","simulation","alert","recommendation","normative"],t),Jr(e,"status",`$.claims[${r}]`,["supported","provisional","disputed","superseded","retracted","unsupported","unknown"],t),Array.isArray(e.evidenceIds)?e.evidenceIds.some(e=>"string"!=typeof e||!e)&&t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected non-empty string evidence identifiers."}):t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected an evidence identifier array."}),Qr(Zr(e,"supersedes",`$.claims[${r}]`,t),`$.claims[${r}].supersedes`,t),ta(e,"text",`$.claims[${r}]`,t),ta(e,"asOf",`$.claims[${r}]`,t),Wr(e,"scope",`$.claims[${r}]`,t),Qr(Zr(e,"tags",`$.claims[${r}]`,t),`$.claims[${r}].tags`,t),void 0!==e.authoredBy&&ra(e.authoredBy,`$.claims[${r}].authoredBy`,t);const a=Xr(e,"review",`$.claims[${r}]`,t);a&&(Yr(a,["status","reviewer","reviewedAt","rationale"],`$.claims[${r}].review`,t),Jr(a,"status",`$.claims[${r}].review`,["proposed","reviewed","approved","rejected"],t),void 0!==a.reviewer&&ra(a.reviewer,`$.claims[${r}].review.reviewer`,t),ta(a,"reviewedAt",`$.claims[${r}].review`,t),ta(a,"rationale",`$.claims[${r}].review`,t));const o=Xr(e,"uncertainty",`$.claims[${r}]`,t);if(o){Yr(o,["kind","lower","upper","confidence","unit","description"],`$.claims[${r}].uncertainty`,t),Jr(o,"kind",`$.claims[${r}].uncertainty`,["interval","distribution","qualitative","unknown"],t);for(const e of["lower","upper","confidence"])Gr(o,e,`$.claims[${r}].uncertainty`,t);ta(o,"unit",`$.claims[${r}].uncertainty`,t),ta(o,"description",`$.claims[${r}].uncertainty`,t)}}):t.push({path:"$.claims",message:"Expected a claim array."}),Array.isArray(e.evidence)?e.evidence.forEach((e,r)=>{if(!Vr(e))return void t.push({path:`$.evidence[${r}]`,message:"Expected an evidence object."});Yr(e,["id","role","label","source","fingerprint","dataVersion","observedAt","scope","sample","transformation","generatedClaimId","relationship"],`$.evidence[${r}]`,t),Kr(e,"id",`$.evidence[${r}]`,t),Jr(e,"role",`$.evidence[${r}]`,["source-data","external-source","transformation","statistical-test","model-output","human-observation","policy-rule","quality-check"],t);for(const a of["label","fingerprint","dataVersion","observedAt","generatedClaimId"])ta(e,a,`$.evidence[${r}]`,t);Wr(e,"scope",`$.evidence[${r}]`,t);const a=Xr(e,"source",`$.evidence[${r}]`,t);if(a){Yr(a,["name","uri","version","retrievedAt","publisher"],`$.evidence[${r}].source`,t);for(const e of["name","uri","version","retrievedAt","publisher"])ta(a,e,`$.evidence[${r}].source`,t)}const o=Xr(e,"transformation",`$.evidence[${r}]`,t);if(o){Yr(o,["id","kind","description","inputEvidenceIds","parameters","assumptions","implementation","performedAt","performedBy"],`$.evidence[${r}].transformation`,t),Kr(o,"id",`$.evidence[${r}].transformation`,t),Jr(o,"kind",`$.evidence[${r}].transformation`,["aggregation","filter","normalization","binning","join","smoothing","forecasting","simulation","other"],t);const e=Zr(o,"inputEvidenceIds",`$.evidence[${r}].transformation`,t);e?Qr(e,`$.evidence[${r}].transformation.inputEvidenceIds`,t):t.push({path:`$.evidence[${r}].transformation.inputEvidenceIds`,message:"Expected an evidence identifier array."}),Qr(Zr(o,"assumptions",`$.evidence[${r}].transformation`,t),`$.evidence[${r}].transformation.assumptions`,t),ta(o,"description",`$.evidence[${r}].transformation`,t),ta(o,"implementation",`$.evidence[${r}].transformation`,t),ta(o,"performedAt",`$.evidence[${r}].transformation`,t),Wr(o,"parameters",`$.evidence[${r}].transformation`,t),void 0!==o.performedBy&&ra(o.performedBy,`$.evidence[${r}].transformation.performedBy`,t)}const n=Xr(e,"sample",`$.evidence[${r}]`,t);if(n){Yr(n,["rowCount","fields","values","truncated"],`$.evidence[${r}].sample`,t),Qr(Zr(n,"fields",`$.evidence[${r}].sample`,t),`$.evidence[${r}].sample.fields`,t);const e=Zr(n,"values",`$.evidence[${r}].sample`,t);e&&!function(e){return e.every(qr)}(e)&&t.push({path:`$.evidence[${r}].sample.values`,message:"Expected JSON values."}),Gr(n,"rowCount",`$.evidence[${r}].sample`,t),Hr(n,"truncated",`$.evidence[${r}].sample`,t)}ea(e,"relationship",`$.evidence[${r}]`,["descriptive","correlational","causal","unknown"],t)}):t.push({path:"$.evidence",message:"Expected an evidence array."}),function(e,t){if(void 0===e||Vr(e)){if(Vr(e))for(const[r,a]of Object.entries(e)){const e="$.fieldStatus."+r;if(!Vr(a)||"string"!=typeof a.status){t.push({path:e,message:"Expected a field state with a status."});continue}Yr(a,["status","reason","suppliedBy","derived","reviewedBy"],e,t),["known","unknown","manual","not-applicable"].includes(a.status)||t.push({path:e+".status",message:"Expected one of: known, unknown, manual, not-applicable."}),void 0===a.suppliedBy||"string"==typeof a.suppliedBy&&["author","system","model-proposal","import"].includes(a.suppliedBy)||t.push({path:e+".suppliedBy",message:"Expected one of: author, system, model-proposal, import."}),ta(a,"reason",e,t),ta(a,"reviewedBy",e,t),Hr(a,"derived",e,t);const o=Object.prototype.hasOwnProperty.call(_i,r)?_i[r]:void 0,n="model-proposal"===a.suppliedBy,i=n&&!0===o?.modelMayPropose&&"known"!==a.status;o&&"known"===a.status&&"string"!=typeof a.suppliedBy&&t.push({path:e+".suppliedBy",message:`Known field "${r}" must identify an allowed supplier.`}),!o||"string"!=typeof a.suppliedBy||i||o.suppliedBy.includes(a.suppliedBy)||t.push({path:e+".suppliedBy",message:`Field "${r}" cannot be supplied by ${a.suppliedBy}.`}),o&&!0===a.derived&&!o.derivable&&t.push({path:e+".derived",message:`Field "${r}" cannot be marked as derived.`}),!o||!n||o.modelMayPropose&&"known"!==a.status||t.push({path:e+".suppliedBy",message:"known"===a.status?`A model proposal cannot finalize field "${r}" as known.`:`Field "${r}" does not accept model proposals.`}),"required"!==o?.humanReview||"known"!==a.status||"string"==typeof a.reviewedBy&&a.reviewedBy.trim()||t.push({path:e+".reviewedBy",message:`Known field "${r}" requires an attributable human review.`})}}else t.push({path:"$.fieldStatus",message:"Expected a field-state object."})}(e.fieldStatus,t);const o=Xr(e,"time","$",t);return o&&function(e,t){const r="$.time";Yr(e,[...Vi,...Object.keys(Gi),"sources"],r,t);for(const a of Vi)ta(e,a,r,t);for(const[a,o]of Object.entries(Gi)){const n=Xr(e,a,r,t);n&&Ur(n,o,`${r}.${a}`,t)}Zr(e,"sources",r,t)?.forEach((e,a)=>{const o=`${r}.sources[${a}]`;Vr(e)?Ur(e,Hi,o,t):t.push({path:o,message:"Expected a source object."})})}(o,t),function(e,t){!function(e,t){const r=Xr(e,"reception","$",t);if(!r)return;Yr(r,["channels","audience","strengths","risks","scaffolds","description","dataFallback","manualChecks"],"$.reception",t);const a=Zr(r,"channels","$.reception",t);a||t.push({path:"$.reception.channels",message:"Expected a reception-channel array."}),a?.forEach((e,r)=>{const a=`$.reception.channels[${r}]`;Vr(e)?(Yr(e,["channel","disclosure","navigation","interactionInstructions","rawData","tokenBudget","privacyNotes"],a,t),Jr(e,"channel",a,["visual","screen-reader","sonified","agent","print","low-bandwidth"],t),ea(e,"disclosure",a,["summary","standard","detailed"],t),ea(e,"rawData",a,["deny","bounded","allow"],t),Hr(e,"navigation",a,t),Hr(e,"interactionInstructions",a,t),Gr(e,"tokenBudget",a,t),Qr(Zr(e,"privacyNotes",a,t),a+".privacyNotes",t)):t.push({path:a,message:"Expected a channel object."})});for(const e of["strengths","risks","scaffolds","manualChecks"])Qr(Zr(r,e,"$.reception",t),"$.reception."+e,t);ta(r,"audience","$.reception",t),ta(r,"description","$.reception",t),Hr(r,"dataFallback","$.reception",t)}(e,t),function(e,t){const r=Xr(e,"form","$",t);r&&(Yr(r,["chartFamily","whyThisForm","rejectedAlternatives","risks","misuse"],"$.form",t),ta(r,"chartFamily","$.form",t),ta(r,"whyThisForm","$.form",t),Qr(Zr(r,"risks","$.form",t),"$.form.risks",t),Qr(Zr(r,"misuse","$.form",t),"$.form.misuse",t),Zr(r,"rejectedAlternatives","$.form",t)?.forEach((e,r)=>{const a=`$.form.rejectedAlternatives[${r}]`;Vr(e)?(Yr(e,["representation","reason"],a,t),Kr(e,"representation",a,t),Kr(e,"reason",a,t)):t.push({path:a,message:"Expected an alternative object."})}))}(e,t),function(e,t){const r=Xr(e,"contestability","$",t);r&&(Yr(r,["sourceRequestsAllowed","alternativeViews","challenges","corrections","editorialExceptions"],"$.contestability",t),Hr(r,"sourceRequestsAllowed","$.contestability",t),Zr(r,"challenges","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.challenges[${r}]`;if(Vr(e)){Yr(e,["id","claimId","status","reason","raisedBy","raisedAt","counterclaimId","resolution"],a,t),Kr(e,"id",a,t),Kr(e,"claimId",a,t),Kr(e,"reason",a,t),Jr(e,"status",a,["open","accepted","declined","resolved"],t),void 0!==e.raisedBy&&ra(e.raisedBy,a+".raisedBy",t);for(const r of["raisedAt","counterclaimId","resolution"])ta(e,r,a,t)}else t.push({path:a,message:"Expected a challenge object."})}),Zr(r,"corrections","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.corrections[${r}]`;if(!Vr(e))return void t.push({path:a,message:"Expected a correction object."});Yr(e,["id","affectedClaimIds","replacementClaimIds","reason","createdAt","createdBy"],a,t),Kr(e,"id",a,t),Kr(e,"reason",a,t);const o=Zr(e,"affectedClaimIds",a,t);o||t.push({path:a+".affectedClaimIds",message:"Expected an affected-claim array."}),Qr(o,a+".affectedClaimIds",t),Qr(Zr(e,"replacementClaimIds",a,t),a+".replacementClaimIds",t),ta(e,"createdAt",a,t),void 0!==e.createdBy&&ra(e.createdBy,a+".createdBy",t)}),Zr(r,"alternativeViews","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.alternativeViews[${r}]`;Vr(e)?(Yr(e,["id","label","rationale"],a,t),Kr(e,"id",a,t),Kr(e,"label",a,t),ta(e,"rationale",a,t)):t.push({path:a,message:"Expected an alternative-view object."})}),Zr(r,"editorialExceptions","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.editorialExceptions[${r}]`;Vr(e)?(Yr(e,["ruleId","rationale","owner","reviewAt"],a,t),Kr(e,"ruleId",a,t),Kr(e,"rationale",a,t),ta(e,"owner",a,t),ta(e,"reviewAt",a,t)):t.push({path:a,message:"Expected an editorial-exception object."})}))}(e,t),function(e,t){const r=Xr(e,"accountability","$",t);r&&(Yr(r,["authors","generatedBy","dataSources","codeRef","reviews","actions"],"$.accountability",t),Zr(r,"authors","$.accountability",t)?.forEach((e,r)=>ra(e,`$.accountability.authors[${r}]`,t)),Qr(Zr(r,"dataSources","$.accountability",t),"$.accountability.dataSources",t),ta(r,"generatedBy","$.accountability",t),ta(r,"codeRef","$.accountability",t),Zr(r,"reviews","$.accountability",t)?.forEach((e,r)=>{const a=`$.accountability.reviews[${r}]`;if(Vr(e)){Yr(e,["id","status","reviewer","reviewedAt","rationale","policyId"],a,t),Kr(e,"id",a,t),Jr(e,"status",a,["pending","approved","changes-requested","rejected"],t),void 0!==e.reviewer&&ra(e.reviewer,a+".reviewer",t);for(const r of["reviewedAt","rationale","policyId"])ta(e,r,a,t)}else t.push({path:a,message:"Expected a review object."})}),Zr(r,"actions","$.accountability",t)?.forEach((e,r)=>{const a=`$.accountability.actions[${r}]`;if(!Vr(e))return void t.push({path:a,message:"Expected an action object."});Yr(e,["id","action","actor","actedAt","claimIds","artifactId","artifactRevision","policyId","status","invalidatedByClaimId"],a,t),Kr(e,"id",a,t),Kr(e,"action",a,t);const o=Zr(e,"claimIds",a,t);o||t.push({path:a+".claimIds",message:"Expected a claim identifier array."}),Qr(o,a+".claimIds",t),void 0!==e.actor&&ra(e.actor,a+".actor",t);for(const r of["actedAt","artifactId","artifactRevision","policyId","invalidatedByClaimId"])ta(e,r,a,t);ea(e,"status",a,["proposed","taken","reversed","invalidated"],t)}))}(e,t),function(e,t){const r=Xr(e,"inheritance","$",t);if(r){Yr(r,["requiredPaths","prohibitedExports","privacy","rawDataDefault","preservation","sourceArtifactIds"],"$.inheritance",t);for(const e of["requiredPaths","prohibitedExports","sourceArtifactIds"])Qr(Zr(r,e,"$.inheritance",t),"$.inheritance."+e,t);ea(r,"privacy","$.inheritance",["public","restricted","confidential","unknown"],t),ea(r,"rawDataDefault","$.inheritance",["exclude","bounded","include"],t),ea(r,"preservation","$.inheritance",["full-fidelity","claim-evidence-preserved","visual-only","lossy","unknown"],t)}}(e,t)}(e,t),Wr(e,"extensions","$",t),Array.isArray(e.claims)&&0===e.claims.length&&r.push({path:"$.claims",message:"The contract declares no claims."}),Array.isArray(e.evidence)&&0===e.evidence.length&&r.push({path:"$.evidence",message:"The contract declares no evidence."}),{valid:0===t.length,errors:t,warnings:r}}(e)}catch{return{valid:!1,errors:[{path:"$",message:"Artifact contract could not be inspected safely."}],warnings:[]}}}function na(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ia(e,t={}){try{return function(e,t){if(!na(e))return{transfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["Artifact contract must be a JSON object."]}};const r=_r(e),a=[...new Set([...r.excludedPaths,..._e(e)])].sort(),o=r.value,n=function(e,t){if(!t||!na(e)||!Array.isArray(e.evidence))return[];const r=[];return e.evidence.forEach((e,t)=>{na(e)&&Object.prototype.hasOwnProperty.call(e,"sample")&&(delete e.sample,r.push(`$.evidence[${t}].sample`))}),r}(o,t.excludeEvidenceSamples),i=n.length?["Bounded evidence samples were excluded by the transfer policy."]:[],s=o?.contractVersion;if("string"!=typeof s||!s)return{contract:o,transfer:{status:"invalid",omittedPaths:[...a,...n],warnings:["Artifact contract is missing a string contractVersion.",...i]}};if(s!==Li)return{contract:o,transfer:{status:a.length>0?"invalid":"unsupported-version",omittedPaths:[...a,...n],warnings:[`Contract version ${s} is not interpreted by this runtime.`,...a.length>0?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...i]}};const c=oa(o),l=[...c.errors.map(({path:e,message:t})=>`${e}: ${t}`),...c.warnings.map(({path:e,message:t})=>`${e}: ${t}`),...a.length?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...i];return{contract:o,transfer:{status:!c.valid||a.length>0?"invalid":n.length>0?"excluded":"preserved",omittedPaths:[...a,...n],warnings:l}}}(e,t)}catch{const t=_e(e);return{transfer:{status:"invalid",omittedPaths:t.length?t:["$"],warnings:["Artifact contract could not be inspected safely."]}}}}function sa(e){const t=Object.entries(e).filter(([e,t])=>qi.includes(e)&&void 0!==t);if(0!==t.length)return 1===t.length&&"data"===t[0][0]?t[0][1]:Object.fromEntries(t)}function ca(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!qi.includes(e)&&"recipeId"!==e))}function la(e,t,r){const a=function(e,t,r,a=sa(t)){const o=ca(t),n=0===_e(o).length?Dr(o).fingerprint:void 0,i=void 0!==a&&0===_e(a).length?function(e,t=[]){if(void 0===e)return;const r=t.filter(e=>!!e.transformation).map(({id:e,transformation:t})=>({evidenceId:e,transformation:t})).sort(({evidenceId:e},{evidenceId:t})=>t>e?-1:e>t?1:0);return Dr(r.length>0?{data:e,transformations:r}:e).fingerprint}(a,e.evidence):void 0,s="ChartRecipe"===r&&"string"==typeof t.recipeId?t.recipeId:r,c=[],l=[];return void 0!==s&&(void 0===e.artifact.component?l.push("artifact.component"):e.artifact.component!==s&&c.push("artifact.component")),void 0===e.artifact.configFingerprint||void 0===n?l.push("artifact.configFingerprint"):e.artifact.configFingerprint!==n&&c.push("artifact.configFingerprint"),void 0!==e.artifact.dataFingerprint&&i?e.artifact.dataFingerprint!==i&&c.push("artifact.dataFingerprint"):l.push("artifact.dataFingerprint"),{status:c.length>0?"mismatch":l.length>0?"unknown":"match",mismatchPaths:c,unknownPaths:l}}(e,t,r);return{mismatchPaths:[...a.mismatchPaths,...void 0!==r&&a.unknownPaths.includes("artifact.component")?["artifact.component"]:[]]}}function ua(e){if(e.startsWith("props."))return e.slice(6).split(/[.[\]]/,1)[0]}function da(e){if(!e||"object"!=typeof e)return!1;const t=e,r=t.serializedDataFingerprint;return"string"==typeof t.status&&Yi.has(t.status)&&Array.isArray(t.omittedPaths)&&t.omittedPaths.every(e=>"string"==typeof e)&&Array.isArray(t.warnings)&&t.warnings.every(e=>"string"==typeof e)&&(void 0===t.serializedConfigFingerprint||"string"==typeof t.serializedConfigFingerprint)&&(null==r||"string"==typeof r)&&(void 0===t.transferFingerprint||"string"==typeof t.transferFingerprint)}function ha(e,t,r,a){return Dr({component:t,version:a.version,createdAt:a.createdAt,...void 0!==a.recipeId?{recipeId:a.recipeId}:{},...void 0!==a.portable?{portable:a.portable}:{},...void 0!==a.manifest?{manifest:a.manifest}:{},...void 0!==a.reason?{reason:a.reason}:{},...void 0!==a.warnings?{warnings:a.warnings}:{},...void 0!==a.selections?{selections:a.selections}:{},artifactContract:r,status:e.status,omittedPaths:e.omittedPaths,warnings:e.warnings,...void 0!==e.serializedConfigFingerprint?{serializedConfigFingerprint:e.serializedConfigFingerprint}:{},...Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")?{serializedDataFingerprint:e.serializedDataFingerprint}:{}}).fingerprint}function pa(e,t,r,a,o){const n=sa(r),i={...e,serializedConfigFingerprint:Dr(ca(r)).fingerprint,serializedDataFingerprint:void 0===n?null:Dr(n).fingerprint};return{...i,transferFingerprint:ha(i,t,a,o)}}function fa(e,t){if("artifactContract"===t||"$.artifactContract"===t)return void 0!==e.artifactContract;let r,a;if("props"===t||t.startsWith("props.")?(r=e,a=t):(r=e.artifactContract,a=t.startsWith("$.")?t.slice(2):t),"$"===a||""===a)return void 0!==r;const o=[...a.matchAll(/(?:^|\.)([^.[\]]+)|\[(\d+)\]/g)].map(e=>e[1]??Number(e[2]));if(0===o.length)return!1;for(const e of o){if(null===r||"object"!=typeof r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function ma(e,t,r,a,o){if(!t)return{};const n=function(e){const t=ia(e);if(!t.contract||"preserved"!==t.transfer.status)throw new TypeError(t.transfer.warnings.join(" ")||"Artifact contract could not be serialized without loss.");return t}(t),i=o.recipeId??e,s=la(t,r,i),c=function(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].filter(r=>{if(Object.prototype.hasOwnProperty.call(e,r)!==Object.prototype.hasOwnProperty.call(t,r))return!0;const a=Dr(e[r]),o=Dr(t[r]);return a.excludedPaths.length>0||a.fingerprint!==o.fingerprint}).map(e=>"props."+e).sort()}(r,a),l=la(t,a,i);return s.mismatchPaths.length>0?{artifactContract:n.contract,artifactTransfer:pa({status:"invalid",omittedPaths:s.mismatchPaths,warnings:["The artifact contract fingerprints do not match the supplied chart props or data."]},e,a,n.contract,o)}:c.length>0?{artifactContract:n.contract,artifactTransfer:pa({status:"excluded",omittedPaths:c,warnings:["Chart props or data were excluded from the serialized configuration."]},e,a,n.contract,o)}:l.mismatchPaths.length>0?{artifactContract:n.contract,artifactTransfer:pa({status:"invalid",omittedPaths:l.mismatchPaths,warnings:["Serialized chart props or data differ from the values bound to the artifact contract."]},e,a,n.contract,o)}:{artifactContract:n.contract,artifactTransfer:pa(n.transfer,e,a,n.contract,o)}}function ga(e){if(!e.artifactContract){if(!e.artifactTransfer)return{};if(da(e.artifactTransfer)&&"excluded"===e.artifactTransfer.status&&e.artifactTransfer.omittedPaths.includes("artifactContract")){const t=e.artifactTransfer.omittedPaths.filter(t=>"artifactContract"!==t&&fa(e,t));return 0===t.length?{artifactTransfer:Ki(e.artifactTransfer)}:{artifactTransfer:{status:"invalid",omittedPaths:[...e.artifactTransfer.omittedPaths],warnings:[`The declared omitted path is still present: ${t.join(", ")}.`]}}}return{artifactTransfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["An artifact transfer report cannot claim preservation without an artifact contract."]}}}const t=ia(e.artifactContract),r=e.artifactTransfer,a=t.transfer;let o=(()=>{if(!r)return{status:"invalid",omittedPaths:[...new Set([...a.omittedPaths,"artifactTransfer"])],warnings:[...a.warnings,"The artifact contract has no transfer report, so its transport history cannot be verified."]};if(!da(r))return{status:"invalid",omittedPaths:a.omittedPaths,warnings:[...a.warnings,"The declared artifact transfer report is malformed."]};const t="excluded"===r.status||"unsupported-version"===r.status?r.omittedPaths.filter(t=>fa(e,t)):[];return t.length>0?{status:"invalid",omittedPaths:[...new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...a.warnings,`The declared omitted path is still present: ${t.join(", ")}.`]}:"preserved"===r.status&&r.omittedPaths.length>0||"excluded"===r.status&&0===r.omittedPaths.length?{status:"invalid",omittedPaths:[...new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...a.warnings,"The declared artifact transfer status contradicts its omitted paths."]}:r.status===a.status?Ki(r):"preserved"!==a.status||"excluded"!==r.status&&"invalid"!==r.status||0>=r.omittedPaths.length?{status:"invalid",omittedPaths:[...new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...new Set([...r.warnings,...a.warnings,`Declared artifact transfer status ${r.status} does not match the restored contract status ${a.status}.`])]}:Ki(r)})();if(r&&da(r)){const t=function(e,t){const r=[],a=Dr(ca(t.props)).fingerprint,o=sa(t.props),n=void 0===o?null:Dr(o).fingerprint;return void 0!==e.transferFingerprint&&e.transferFingerprint!==ha(e,t.component,t.artifactContract,t)&&r.push("artifactTransfer.transferFingerprint"),void 0!==e.serializedConfigFingerprint&&e.serializedConfigFingerprint!==a&&r.push("artifactTransfer.serializedConfigFingerprint"),Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")&&e.serializedDataFingerprint!==n&&r.push("artifactTransfer.serializedDataFingerprint"),r}(r,e),a="invalid"!==r.status,n=[...a&&void 0===r.serializedConfigFingerprint?["artifactTransfer.serializedConfigFingerprint"]:[],...a&&!Object.prototype.hasOwnProperty.call(r,"serializedDataFingerprint")?["artifactTransfer.serializedDataFingerprint"]:[],...a&&void 0===r.transferFingerprint?["artifactTransfer.transferFingerprint"]:[]];(t.length>0||n.length>0)&&(o={status:"invalid",omittedPaths:[...new Set([...o.omittedPaths,...t,...n])],warnings:[...new Set([...o.warnings,t.length>0?"The serialized chart payload no longer matches its transfer fingerprints.":"The declared chart transfer cannot be verified without serialized transfer fingerprints."])]})}if("preserved"===t.transfer.status&&t.contract?.contractVersion===Li){const r=la(t.contract,e.props,e.recipeId??e.component).mismatchPaths.filter(e=>!function(e,t){const r=t.map(ua).filter(e=>void 0!==e);return"artifact.dataFingerprint"===e?r.some(e=>Wi.has(e)):"artifact.configFingerprint"===e&&r.some(e=>!Wi.has(e))}(e,o.omittedPaths));r.length>0&&(o={status:"invalid",omittedPaths:[...new Set([...o.omittedPaths,...r])],warnings:[...new Set([...o.warnings,"Restored chart props or data do not match the artifact contract fingerprints."])]})}return{...t.contract?{artifactContract:t.contract}:{},artifactTransfer:o}}function ya(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}function ba(e,t){return!!Zi.has(e)&&("areas"!==e||"string"!=typeof t)}function va(e,t,r){if(r?.selections&&_e(r.selections).length>0)throw new TypeError("Serialized selection state must contain only values that survive JSON serialization unchanged.");const a=Ue(e)??Ge(t.recipe)??Ge(t.recipeId);if(a)return function(e,t,r){const a=!1!==r?.includeData,o=_e(e);if("portable"===e.portability&&o.length>0)throw Error(`Portable recipe "${e.id}" has non-JSON definition values at: ${o.join(", ")}.`);const n=function(e,t,r){const a={};for(const[o,n]of Object.entries(e))if(null!=n&&!Xi.has(o)&&"recipeId"!==o&&(t||!ba(o,n)))if("function"!=typeof n)if(_e(n).length>0){if(r)throw Error(`Portable recipe prop "${o}" is not JSON-safe.`)}else ya(a,o,Qi(n));else if(r)throw Error(`Portable recipe prop "${o}" is not JSON-safe.`);return a}(t,a,"portable"===e.portability),i=e.intents.map($t).filter(e=>!!e),s=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.id?e.layout.id:void 0,c=s?Ve(s):void 0,l=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.version&&e.layout.version?{version:e.layout.version,...e.layout.fingerprint?{fingerprint:e.layout.fingerprint}:{}}:void 0;if(c&&l&&(c.version!==l.version||c.fingerprint!==l.fingerprint))throw Error(`Recipe layout "${s}" registry identity does not match its portable declaration.`);const u=c??l;if("portable"===e.portability&&s&&!u)throw Error(`Portable recipe layout "${s}" must be registered with an explicit version identity.`);const d={name:e.name,intents:i,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily,...e.version?{recipeVersion:e.version}:{},...0===o.length?{definitionFingerprint:Dr(e).fingerprint}:{},...s?{layoutId:s}:{},...u?{layoutVersion:u.version}:{},...u?.fingerprint?{layoutFingerprint:u.fingerprint}:{}},h=(new Date).toISOString();if("portable"===e.portability){if(_e(n).length>0)throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);const a={version:Ji,createdAt:h,recipeId:e.id,portable:!0,manifest:d,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:n,manifest:d,version:Ji,createdAt:h,...ma("ChartRecipe",r?.artifactContract,t,n,a),...r?.selections?{selections:r.selections}:{}}}const p="Recipe contains or may depend on non-serializable local layout callbacks.",f=["This config is inspectable but cannot be rendered remotely by CLI or MCP."],m={version:Ji,createdAt:h,recipeId:e.id,portable:!1,manifest:d,reason:p,warnings:f,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:p,warnings:f,props:n,manifest:d,version:Ji,createdAt:h,...ma("ChartRecipe",r?.artifactContract,t,n,m),...r?.selections?{selections:r.selections}:{}}}(a,t,r);if(!Mr(e))throw Error(`Unknown component "${e}". Known components: ${Mi.join(", ")}`);const o=!1!==r?.includeData,n={};for(const[e,r]of Object.entries(t))if(null!=r&&!Xi.has(e)&&(o||!ba(e,r))&&"function"!=typeof r&&0>=_e(r).length)try{ya(n,e,Qi(r))}catch{}const i=(new Date).toISOString(),s={version:Ji,createdAt:i,...r?.selections?{selections:r.selections}:{}};return{component:e,props:n,version:Ji,createdAt:i,...ma(e,r?.artifactContract,t,n,s),...r?.selections?{selections:r.selections}:{}}}function wa(e){try{if(!e||"object"!=typeof e||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}catch{return!1}}function Aa(e){if(!wa(e))throw Error("Invalid chart config: expected a plain object");const t=_e(e);if(t.length>0)throw new TypeError(`Chart config contains values that cannot survive JSON serialization at: ${t.join(", ")}.`);if(e.version!==Ji)throw Error(`Unsupported chart config version ${e.version+""}; expected ${Ji}.`);if("string"!=typeof e.component||!e.component.trim())throw Error("Invalid chart config: missing component");if(!wa(e.props))throw Error("Invalid chart config: props must be a plain object");if("string"!=typeof e.createdAt||!Number.isFinite(Date.parse(e.createdAt)))throw Error("Invalid chart config: createdAt must be a valid timestamp");if(void 0!==e.recipeId&&("string"!=typeof e.recipeId||!e.recipeId.trim()))throw Error("Invalid chart config: recipeId must be a non-empty string");if(void 0!==e.portable&&"boolean"!=typeof e.portable)throw Error("Invalid chart config: portable must be a boolean");if(void 0!==e.selections&&!wa(e.selections))throw Error("Invalid chart config: selections must be a plain object");if(void 0!==e.manifest){if(!wa(e.manifest))throw Error("Invalid chart config: manifest must be a plain object");if("string"!=typeof e.manifest.name||!e.manifest.name.trim()||"string"!=typeof e.manifest.frameFamily||!e.manifest.frameFamily.trim()||!Array.isArray(e.manifest.intents)||e.manifest.intents.some(e=>"string"!=typeof e||!e.trim())||void 0!==e.manifest.audience&&(!Array.isArray(e.manifest.audience)||e.manifest.audience.some(e=>"string"!=typeof e||!e.trim()))||void 0!==e.manifest.recipeVersion&&("string"!=typeof e.manifest.recipeVersion||!e.manifest.recipeVersion.trim())||void 0!==e.manifest.definitionFingerprint&&("string"!=typeof e.manifest.definitionFingerprint||!e.manifest.definitionFingerprint.trim())||void 0!==e.manifest.layoutId&&("string"!=typeof e.manifest.layoutId||!e.manifest.layoutId.trim())||void 0!==e.manifest.layoutVersion&&("string"!=typeof e.manifest.layoutVersion||!e.manifest.layoutVersion.trim())||void 0!==e.manifest.layoutFingerprint&&("string"!=typeof e.manifest.layoutFingerprint||!e.manifest.layoutFingerprint.trim())||void 0!==e.manifest.layoutVersion&&void 0===e.manifest.layoutId||void 0!==e.manifest.layoutFingerprint&&void 0===e.manifest.layoutVersion)throw Error("Invalid chart config: malformed recipe manifest")}}function xa(e){if(Aa(e),"ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw Error("Invalid chart recipe config: missing recipeId");const t=Ue(e.recipeId);if(!t)throw Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if(e.manifest?.definitionFingerprint&&e.manifest.definitionFingerprint!==Dr(t).fingerprint)throw Error(`Chart recipe "${e.recipeId}" no longer matches the serialized definition.`);if(void 0!==e.manifest?.recipeVersion&&e.manifest.recipeVersion!==t.version)throw Error(`Chart recipe "${e.recipeId}" version does not match the serialized config.`);if(e.manifest?.layoutVersion){const r=e.manifest.layoutId,a=r?function(e){return De().layouts.get(e)?.layout}(r):void 0,o=r?Ve(r):void 0,n=a?o:o??(t.layout&&"object"==typeof t.layout&&t.layout.id===r&&t.layout.version?{version:t.layout.version,fingerprint:t.layout.fingerprint}:void 0);if(!n||n.version!==e.manifest.layoutVersion||n.fingerprint!==e.manifest.layoutFingerprint)throw Error(`Chart recipe "${e.recipeId}" layout implementation no longer matches the serialized config.`)}if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...Qi(e.props),recipeId:e.recipeId},...ga(e)}}if(!Mr(e.component))throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:Qi(e.props),...ga(e)}}function $a(e,t={}){Aa(e);const r=JSON.stringify(e),a="sc="+btoa(unescape(encodeURIComponent(r))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");if(void 0!==t.maxLength&&a.length>Math.max(0,Math.floor(t.maxLength)))throw new RangeError(`Serialized chart config is ${a.length} characters; the declared URL limit is ${t.maxLength}. Use a file or sidecar export instead.`);return a}function Ca(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");const r=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(escape(atob(r))),o=JSON.parse(a);return Aa(o),o}async function Sa(e,t="json"){const r="jsx"===t?ka(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(r)}function ka(e){Aa(e);const{props:t}=e,r="LocalChartRecipe"===e.component?"ChartRecipe":e.component;if("ChartRecipe"!==r&&!Mr(r))throw Error(`Cannot project unknown component "${r}" to JSX.`);const a=["<"+r];e.recipeId&&a.push(` recipeId={${Pa(e.recipeId)}}`);for(const[e,r]of Object.entries(t)){if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)){const t={};Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),a.push(` {...${Pa(t)}}`);continue}if("string"==typeof r)a.push(Ra(r)?` ${e}="${r}"`:` ${e}={${Pa(r)}}`);else if("boolean"==typeof r&&!0===r)a.push(" "+e);else if("boolean"==typeof r&&!1===r)a.push(` ${e}={false}`);else if("number"==typeof r)a.push(` ${e}={${r}}`);else{const t=Pa(r);a.push(80>t.length?` ${e}={${t}}`:` ${e}={${Pa(r,2)}}`)}}return a.push("/>"),a.join("\n")}function Ra(e){return!/["&<>{}\r\n\u2028\u2029]/.test(e)}function Pa(e,t){return JSON.stringify(e,null,t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Ia(e){const t=[...e.artifactContract?["artifactContract"]:[],...e.artifactTransfer?["artifactTransfer"]:[],...e.selections?["selections"]:[]];return{jsx:ka(e),omittedPaths:t,warnings:t.length?["JSX represents the chart props only. Preserve the reported top-level fields as a separate artifact packet."]:[]}}function Ea(e){const t=Object.create(null);for(const[r,a]of e){const e=[];for(const[,t]of a.clauses){const r=Object.create(null);for(const[e,a]of Object.entries(t.fields))r[e]="point"===a.type?{type:"point",values:Array.from(a.values)}:{type:"interval",range:a.range};e.push({clientId:t.clientId,type:t.type,fields:r})}t[r]={name:a.name,resolution:a.resolution,clauses:e}}return t}function Na(e){const t=new Map;for(const[r,a]of Object.entries(e)){const e=new Map;for(const t of a.clauses){const r=Object.create(null);for(const[e,a]of Object.entries(t.fields))r[e]="point"===a.type?{type:"point",values:new Set(a.values)}:{type:"interval",range:a.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:r})}t.set(r,{name:a.name,resolution:a.resolution,clauses:e})}return t}async function Ta(e,t){const{format:r="png",filename:a="chart",scale:o=2,background:n="white"}=t||{},i=e.querySelector("svg");if(!i)throw Error("No SVG element found in the container");const s=i.cloneNode(!0),c=i.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",c.width+""),s.getAttribute("height")||s.setAttribute("height",c.height+""),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ma(i,s),"svg"===r){const e=(new XMLSerializer).serializeToString(s);Oa(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),a+".svg")}else{const t=c.width*o,r=c.height*o,i=document.createElement("canvas");i.width=t,i.height=r;const l=i.getContext("2d");l.fillStyle=n,l.fillRect(0,0,t,r),l.scale(o,o);const u=e.querySelector("canvas");u&&l.drawImage(u,0,0,c.width,c.height);const d=(new XMLSerializer).serializeToString(s),h=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),p=URL.createObjectURL(h),f=new Image;f.width=c.width,f.height=c.height,await new Promise((e,t)=>{f.onload=()=>{l.drawImage(f,0,0),i.toBlob(r=>{r?(Oa(r,a+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(p)},f.onerror=()=>{URL.revokeObjectURL(p),t(Error("Failed to load SVG image"))},f.src=p})}}function Ma(e,t){const r=e.children,a=t.children,o=window.getComputedStyle(e),n=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(const e of n){const r=o.getPropertyValue(e);r&&"none"!==r&&""!==r&&t.style?.setProperty(e,r)}for(let e=0;Math.min(r.length,a.length)>e;e++)Ma(r[e],a[e])}function Oa(e,t){const r=URL.createObjectURL(e),a=document.createElement("a");a.href=r,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)}function Fa(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[r,a]of Object.entries(e))r.startsWith("_")||null!=a&&""!==a&&("number"==typeof a?Number.isFinite(a)&&(t[r]=a):"string"==typeof a?t[r]=a:"boolean"==typeof a?t[r]=a+"":a instanceof Date&&(t[r]=a.toISOString().slice(0,10)));return t}function ja(e){return e&&"object"==typeof e?e:{}}function za(e){return ja(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Ba(e){const t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:t+""}function La(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function _a(e){return"number"==typeof e&&Number.isFinite(e)}function Da(e){if(_a(e.x)&&_a(e.y)&&_a(e.w)&&_a(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(_a(e.x)&&_a(e.y)&&_a(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(_a(e.cx)&&_a(e.cy)&&_a(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(_a(e.cx)&&_a(e.cy)&&_a(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};const t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&_a(e[0])&&_a(e[1]));return t.length>0?{x0:Math.min(...t.map(e=>e[0])),y0:Math.min(...t.map(e=>e[1])),x1:Math.max(...t.map(e=>e[0])),y1:Math.max(...t.map(e=>e[1]))}:null}function Ua(e,t){const r=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),a=Math.min(Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0));return a>0?r/a:0}function Va(e,t,r,a,o){if(e===t)return!0;const n=r.dataRoles.map(e=>Rt(e,a,o)).filter(e=>!!e).filter(r=>null!=e[r]&&null!=t[r]);return n.length>0&&n.every(r=>e[r]+""==t[r]+"")}function Ga(e,t,r,a,o,n="warn",i){return{id:e,category:t,status:r?"pass":n,message:r?a:o,...i?{evidence:i}:{}}}function Ha(e){const{recipe:t}=e,r=function(e){return Array.isArray(e)?e:e&&"object"==typeof e?[...e.nodes??e.sceneNodes??[],...e.sceneEdges??[]]:[]}(e.scene),a=e.layoutConfig??Ct({layoutConfig:e.layoutConfig}),o=e.dimensions.plot??{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},n=o.x??0,i=o.y??0,s=[],c=r.filter(e=>null!=La(e)),l=r.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||function(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));s.push(Ga("geometry.finite","geometry",0===l.length,"All emitted geometry is finite.",l.length+" marks contain non-finite geometry.","fail",{count:l.length}));const u=r.map(Da),d=u.filter(e=>e&&(e.x0>=e.x1||e.y0>=e.y1)).length;s.push(Ga("geometry.nonzero-area","geometry",0===d,"All bounded marks have positive area.",d+" marks have zero or negative area.","warn",{count:d}));const h=u.filter(e=>e&&(n>e.x0||i>e.y0||e.x1>n+o.width||e.y1>i+o.height)).length;s.push(Ga("geometry.bounds","geometry",0===h,"All bounded marks stay inside the plot.",h+" marks extend outside the plot bounds.","warn",{count:h}));const p=t.audit?.minimumHitTargetSize??t.accessibility.minimumHitTarget??24,m=u.filter(e=>!!e&&(p>e.x1-e.x0||p>e.y1-e.y0)).length;s.push(Ga("interaction.target-size","interaction",0===m,`All bounded targets meet the declared ${p}px minimum.`,`${m} targets are smaller than ${p}px in at least one dimension.`,"warn",{count:m,minimumTarget:p}));const g=c.map(Ba),y=g.filter(e=>!e).length,b=new Set,v=g.filter(e=>!(!e||!b.has(e)&&(b.add(e),1)));s.push(Ga("identity.stable-ids","identity",0===y,"Every data-bearing mark exposes a stable id.",y+" data-bearing marks have no pointId, id, or transition key.",t.audit?.requireStableIds?"fail":"warn",{missing:y})),s.push(Ga("identity.unique-ids","identity",0===v.length,"Stable mark ids are unique.",v.length+" duplicate stable ids were observed.","fail",{duplicates:[...new Set(v)].slice(0,10)}));const w=g.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;w>0&&s.push({id:"identity.index-pattern",category:"identity",status:"warn",message:w+" ids look index-derived and may change when data is reordered.",remediation:"Derive ids from a declared identifier role or stable domain key."});const A=new Set;let x=0;const $=e.inputData;for(const e of c){const r=La(e),o=Array.isArray(r)?r:[r];let n=!1;for(const e of o)if(e&&"object"==typeof e)for(let r=0;$.length>r;r+=1)Va(e,$[r],t,a,$)&&(A.add(r),n=!0);n||(x+=1)}const C=Math.max(0,$.length-A.size);s.push(Ga("coverage.input-data","coverage",0===C,"Every input datum is represented by the observed scene.",C+" input data items have no matching scene mark.",t.audit?.requireDatumCoverage?"fail":"warn",{represented:A.size,input:$.length})),s.push(Ga("coverage.scene-data","coverage",0===x,"Every data-bearing scene mark maps back to input data.",x+" scene marks do not map back to an input datum.","warn",{count:x}));const S=t.encodings?.some(e=>"count"===e.channel);!S&&c.length>A.size&&A.size>0&&s.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});const k=c.filter(e=>!1===e.interactive).length;s.push(Ga("interaction.hit-targets","interaction",0===k&&c.length>0,"Every observed data-bearing scene node participates in hit testing.",0===c.length?"No data-bearing scene nodes were emitted for interaction.":k+" data-bearing marks explicitly disable interaction.","fail"));const R=(e.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),P=R.filter(e=>!b.has(e));s.push(Ga("coverage.annotation-anchors","coverage",0===P.length,R.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",P.length+" annotations point to missing scene ids.","fail",{unresolved:P}));const I=(e.chart?.selectedIds??[]).filter(e=>!b.has(e));e.chart?.selectedIds&&s.push(Ga("interaction.selection-reachability","interaction",0===I.length,"Selected/highlighted states resolve to observed marks.",I.length+" selected ids are not reachable in the scene.","fail",{missing:I}));const E=function(e){const t=[];if(!Array.isArray(e))return t;const r=e.some(e=>e&&("line"===e.type||"area"===e.type));for(const a of e)if(a&&"object"==typeof a&&null!==a.datum)try{switch(a.type){case"point":if(r)break;t.push({label:"Point",values:Fa(za(a))});break;case"line":case"area":{const e=za(a),r=Array.isArray(e)?e:[],o="line"===a.type?"Line point":"Area point";for(const e of r)t.push({label:o,values:Fa(e)});break}case"rect":{const e=za(a),r=null!=e&&"object"==typeof e?e:{},o=r.category??a.group??"",n=r.value??r.__aggregateValue??r.total,i=Fa(r);null==i.category&&""!==o&&(i.category=o+""),null==i.value&&null!=n&&(i.value="number"==typeof n||"string"==typeof n?n:n+""),t.push({label:"Bar",values:i});break}case"heatcell":{const e=Fa(za(a));null==e.value&&"number"==typeof a.value&&Number.isFinite(a.value)&&(e.value=a.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=za(a),r=Fa(e);if(null==r.category){const t=ja(e),a=t.category??t.label;null!=a&&(r.category=a+"")}t.push({label:"Wedge",values:r});break}case"circle":t.push({label:"Node",values:Fa(za(a))});break;case"arc":t.push({label:"Arc",values:Fa(za(a))});break;case"candlestick":t.push({label:"Candlestick",values:Fa(za(a))});break;case"geoarea":{const e=ja(za(a)),r=Fa(e);if(null==r.name){const t=ja(e.properties).name??e.name;null!=t&&(r.name=t+"")}t.push({label:"Region",values:r});break}}}catch{}return t}(r),N=(t.accessibility.tableFields??t.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;const r=e.role?t.dataRoles.find(t=>t.role===e.role):void 0;return r?Rt(r,a,$):void 0}).filter(e=>!!e),T=new Set(E.flatMap(e=>Object.keys(e.values))),M=N.filter(e=>!T.has(e));s.push(Ga("accessibility.table-fields","accessibility",0===M.length,N.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${M.join(", ")}.`,"fail",{expectedFields:N,observedFields:[...T]})),new Set($.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&2>=T.size&&[...T].every(e=>"category"===e||"value"===e)&&s.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});const O=(t.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);s.push(Ga("accessibility.color-only","accessibility",0===O.length,"Every declared color encoding names a redundant cue.",O.length+" color encodings have no declared redundant cue.","warn"));const F=e.chart;if(F){for(const[e,r]of[["title",t.accessibility.requiresTitle],["summary",t.accessibility.requiresSummary],["description","required"===t.accessibility.description]])r&&s.push(Ga("accessibility."+e,"accessibility","string"==typeof F[e]&&F[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(t.accessibility.requiresAccessibleTable||"required"===t.accessibility.accessibleTable||t.accessibility.fallbackTable)&&s.push(Ga("accessibility.fallback-table","accessibility",!1!==F.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),F.navigationTree&&s.push(Ga("accessibility.navigation-depth","accessibility",(F.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}const j=e.theme?.background??"#ffffff",z=r.filter(e=>{const t=e.style?.fill??e.fill;if("string"!=typeof t||!t.startsWith("#")||!j.startsWith("#"))return!1;const r=f(t,j);return null!=r&&3>r}).length;s.push(Ga("visual.contrast","visual",0===z,"All statically checkable mark fills meet 3:1 contrast.",z+" marks have fill contrast below 3:1.","warn",{background:j}));let B=0;const L=u.filter(e=>!!e).slice(0,500);for(let e=0;L.length>e;e+=1)for(let t=e+1;L.length>t;t+=1).8>Ua(L[e],L[t])||(B+=1);B>L.length&&s.push({id:"visual.overlap-density",category:"visual",status:"warn",message:B+" near-total mark overlaps suggest occlusion or excessive density.",remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});const _=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),D={dataRoles:t.dataRoles.map(e=>e.role),intents:t.intents.map($t).filter(e=>!!e),accessibilityExpectations:[...t.accessibility.requirements??[],...t.accessibility.tableFields?.map(e=>"table field: "+e.label)??[]],fallbackDeclared:!0===t.accessibility.fallbackTable||"required"===t.accessibility.accessibleTable||!0===t.accessibility.requiresAccessibleTable,designContractDeclared:!!t.designContract?.whyCustom},U=[...s,..._],V=s.filter(e=>"fail"===e.status).length;return{recipeId:t.id,ok:0===V,summary:{marks:r.length,passes:U.filter(e=>"pass"===e.status).length,warnings:U.filter(e=>"warn"===e.status).length,failures:V,manual:U.filter(e=>"manual"===e.status).length},declaredSemantics:D,observedSceneEvidence:s,manualATChecks:_}}function qa(e){let t=1/0,r=-1/0;for(const a of e)t>a&&(t=a),a>r&&(r=a);return[t,r]}function Wa(e){return"nominal"===e||"ordinal"===e}function Ya(e){return"quantitative"===e||"temporal"===e}function Ka(e){e=function(e){if(!function(e){return e.usermeta?.idid}(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!function(e){return"annotation-layer"===e.usermeta?.idid?.role}(e));if(1!==t.length)return e;const{layer:r,...a}=e,{usermeta:o,...n}=t[0];return{...a,...n}}(e);const t=[],{type:r,markProps:a}=function(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...r}=e;return{type:t,markProps:r}}(e.mark),o=e.encoding||{},n=o.x,i=o.y,s=o.color,c=o.size,l=o.theta,u=o.opacity;let d;e.data?.values?d=e.data.values:e.data?.url&&t.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&t.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&t.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&t.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||o.facet||o.row||o.column)&&t.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&t.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&t.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const h={};e.width&&(h.width=e.width),e.height&&(h.height=e.height);const p=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(p&&(h.title=p),s?.field&&(h.colorBy=s.field,s.scale?.scheme)){const e=es[s.scale.scheme];e&&(h.colorScheme=e)}void 0!==u?.value&&(h.pointOpacity=u.value);const f=n?.aggregate,m=i?.aggregate;if(d&&(f||m)){const e=m?i:n,t=m?n:i,r=rs[e.aggregate];if(r&&t?.field&&e.field)d=function(e,t){const{groupBy:r,value:a,agg:o="sum"}=t,n=new Map,i="min"===o?1/0:"max"===o?-1/0:0;for(const t of e){const e=t[r]+"";let s=n.get(e);s||(s={total:i,count:0},n.set(e,s));const c=Number(t[a]);switch(s.count++,o){case"count":break;case"min":s.total>c&&(s.total=c);break;case"max":c>s.total&&(s.total=c);break;default:s.total+=c}}const s=[];for(const[e,t]of n){const a="count"===o?t.count:"mean"===o?t.total/t.count:t.total;s.push({[r]:e,value:a})}return s}(d,{groupBy:t.field,value:e.field,agg:r});else if(("count"===r||"count"===e.aggregate)&&t?.field&&d){const e=new Map;for(const r of d){const a=r[t.field]+"";e.set(a,(e.get(a)||0)+1)}d=Array.from(e,([e,r])=>({[t.field]:e,value:r}))}}if(n?.bin||i?.bin){const e="Histogram";d&&(h.data=d),n?.bin?(h.valueAccessor=n.field,i?.field&&(h.categoryAccessor=i.field),n.axis?.title&&(h.valueLabel=n.axis.title)):i?.bin&&(h.valueAccessor=i.field,n?.field&&(h.categoryAccessor=n.field),i.axis?.title&&(h.valueLabel=i.axis.title));const r=n?.bin||i?.bin,a="object"==typeof r?r.maxbins:void 0;return a&&(h.bins=a),Xa(e,h,t)}let g;switch(r){case"bar":g=function(e,t,r,a,o,n,i){let s;return r?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(s="StackedBarChart",a.stackBy=r.field):s="BarChart",Wa(e?.type)&&Ya(t?.type)?(a.categoryAccessor=e.field,a.valueAccessor=i?"value":t.field,e?.axis?.title&&(a.categoryLabel=e.axis.title),t?.axis?.title&&(a.valueLabel=t.axis.title)):Ya(e?.type)&&Wa(t?.type)?(a.categoryAccessor=t.field,a.valueAccessor=n?"value":e.field,a.orientation="horizontal",t?.axis?.title&&(a.categoryLabel=t.axis.title),e?.axis?.title&&(a.valueLabel=e.axis.title)):(e?.field&&(a.categoryAccessor=e.field),t?.field&&(a.valueAccessor=i?"value":t.field),e?.axis?.title&&(a.categoryLabel=e.axis.title),t?.axis?.title&&(a.valueLabel=t.axis.title)),o&&(a.data=o),s}(n,i,s,h,d,f,m);break;case"line":if(g="LineChart",Ja(n,i,h,f,m),s?.field&&(h.lineBy=s.field),a.interpolate){const e=ts[a.interpolate];e&&(h.curve=e)}!0===a.point&&(h.showPoints=!0),d&&(h.data=d);break;case"area":if(s?.field?(g="StackedAreaChart",h.areaBy=s.field):g="AreaChart",Ja(n,i,h,f,m),a.interpolate){const e=ts[a.interpolate];e&&(h.curve=e)}void 0!==a.opacity&&(h.areaOpacity=a.opacity),d&&(h.data=d);break;case"point":case"circle":case"square":c?.field?(g="BubbleChart",h.sizeBy=c.field,c.scale?.range&&(h.sizeRange=c.scale.range)):g="Scatterplot",Ja(n,i,h,f,m),d&&(h.data=d);break;case"rect":g="Heatmap",n?.field&&(h.xAccessor=n.field),i?.field&&(h.yAccessor=i.field),s?.field&&(h.valueAccessor=s.field,delete h.colorBy),n?.axis?.title&&(h.xLabel=n.axis.title),i?.axis?.title&&(h.yLabel=i.axis.title),d&&(h.data=d);break;case"arc":a.innerRadius&&a.innerRadius>0?(g="DonutChart",h.innerRadius=a.innerRadius):g="PieChart",l?.field?h.valueAccessor=l.field:i?.field&&(h.valueAccessor=m?"value":i.field),s?.field&&(h.categoryAccessor=s.field),n?.field&&!l?.field&&(h.categoryAccessor=n.field),d&&(h.data=d);break;case"tick":g="DotPlot",Wa(n?.type)?(h.categoryAccessor=n.field,i?.field&&(h.valueAccessor=m?"value":i.field),n?.axis?.title&&(h.categoryLabel=n.axis.title),i?.axis?.title&&(h.valueLabel=i.axis.title)):Wa(i?.type)?(h.categoryAccessor=i.field,n?.field&&(h.valueAccessor=f?"value":n.field),h.orientation="horizontal",i?.axis?.title&&(h.categoryLabel=i.axis.title),n?.axis?.title&&(h.valueLabel=n.axis.title)):(n?.field&&(h.categoryAccessor=n.field),i?.field&&(h.valueAccessor=m?"value":i.field)),d&&(h.data=d);break;default:t.push(`Unsupported mark type "${r}". Defaulting to Scatterplot.`),g="Scatterplot",Ja(n,i,h,f,m),d&&(h.data=d)}return Xa(g,h,t)}function Ja(e,t,r,a,o){e?.field&&(r.xAccessor=a?"value":e.field),t?.field&&(r.yAccessor=o?"value":t.field),e?.axis?.title&&(r.xLabel=e.axis.title),t?.axis?.title&&(r.yLabel=t.axis.title)}function Xa(e,t,r){const a={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(r.length>0){a.warnings=r;for(const e of r)console.warn("[semiotic/fromVegaLite] "+e)}return a}function Za(e,t){for(const r of t){const t=e.find(e=>e.lower===r);if(t)return t}}function Qa({chrome:e="default",className:t="",style:r,children:a,...o}){const n="default"===e?{...ds,...r}:r;return(0,us.jsx)("div",{...o,"data-semiotic-tooltip-chrome":!0,className:("semiotic-tooltip "+t).trim(),style:n,children:a})}function eo(e){return e.ownsChrome=!0,e}function to(e){if("string"!=typeof e)return null!=e;const t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function ro(e){if(!ls.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const r=e.props,a=r["data-semiotic-tooltip-chrome"];if(null!=a&&!1!==a&&"false"!==a)return!0;const o=r.style;if(o&&"object"==typeof o){if(to(o.background))return!0;if(to(o.backgroundColor))return!0}return!1}function ao(e,t){return"function"==typeof t?t(e):e[t]}function oo(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}if(e instanceof Date)return e.toLocaleDateString();if("object"==typeof e&&null!==e){if(void 0!==e.id)return e.id+"";if(void 0!==e.name)return e.name+"";try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return e+""}function no(e={}){const{fields:t,title:r,format:a,style:o={},className:n=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let i;const s=[];if(r){const t=ao(e,r);i=oo(t,a)}if(t&&t.length>0)t.forEach(t=>{let r,o,n;"string"==typeof t?(r=t,o=t,n=a):(r=t.label,o=t.accessor||t.key||"",n=t.format||a);const i=ao(e,o);s.push({label:r,value:oo(i,n)})});else if(!r){const t=["value","y","name","id","label"];for(const r of t)if(void 0!==e[r]){i=oo(e[r],a);break}if(!i){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(i=oo(e[t[0]],a))}}return(0,hs.jsxs)(Qa,{className:n,style:o,children:[i&&(0,hs.jsx)("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:i}),s.map((e,t)=>(0,hs.jsxs)("div",{style:{marginTop:0===t&&i?"4px":0},children:[e.label&&(0,hs.jsxs)("span",{children:[e.label,": "]}),e.value]},t))]})}}function io(e={}){const{fields:t=[],title:r,format:a,style:o={},className:n="",showLabels:i=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const c=[];if(r){const t=ao(e,r);c.push({value:oo(t,a)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let r,o,n;"string"==typeof t?(r=t,o=t,n=a):(r=t.label,o=t.accessor||t.key||"",n=t.format||a);const s=oo(ao(e,o),n);c.push({label:i?r:void 0,value:s})});else{const t=function(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const r=t.maxEntries??6,a=!1!==t.skipPositional,o=[];for(const[t,r]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;const e=t.toLowerCase();if(a&&cs.has(e))continue;if(null==r)continue;const n=typeof r;("string"===n||"number"===n||"boolean"===n||r instanceof Date)&&o.push({key:t,lower:e,value:r})}if(0===o.length)return{entries:[]};let n=o.findIndex(e=>ns.includes(e.lower));const i=n>=0;0>n&&(n=o.findIndex(e=>"id"===e.lower)),0>n&&(n=o.findIndex(e=>"string"==typeof e.value));const s=0>n?void 0:o[n],c=o.filter((e,t)=>t!==n&&(!i||"id"!==e.lower)),l=Za(c,is),u=Za(c,ss),d=[];l&&d.push({key:l.key,value:l.value}),u&&d.push({key:u.key,value:u.value});for(const e of c){if(d.length>=r)break;is.includes(e.lower)||ss.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}(e,{skipPositional:!1});null!=t.title&&c.push({label:void 0,value:oo(t.title,a),bold:!0}),t.entries.forEach(e=>{c.push({label:i?e.key:void 0,value:oo(e.value,a)})})}return Array.isArray(c)&&0!==c.length?(0,hs.jsx)(Qa,{className:("semiotic-tooltip-multiline "+n).trim(),style:o,children:c.map((e,t)=>(0,hs.jsxs)("div",{style:{marginBottom:c.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&(0,hs.jsxs)("strong",{children:[e.label,s]}),e.value]},t))}):null}}function so(e){return"multi"===e||co(e)}function co(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function lo(e){const{tooltip:t,defaultTooltipContent:r,multiDefaultContent:a=ho(),customFunctionContext:o="datum"}=e,n=t;return!1===t?{tooltipContent:()=>null}:so(n)?{tooltipContent:(co(n)&&"function"==typeof n.content?po(n.content):void 0)||a,tooltipMode:"multi"}:"hover"===o&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:po(n)||r}}function uo(e){const{tooltip:t,defaultTooltipContent:r,customFunctionContext:a="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===a&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:po(t)||r}}function ho(){return e=>{const t=e.allSeries;if(!t||0===t.length)return(0,hs.jsx)(Qa,{children:(0,hs.jsx)("div",{children:oo(e.data?.value??e.data?.y)})});const r=e.xValue??e.data?.time??e.data?.x;return(0,hs.jsxs)(Qa,{children:[null!=r&&(0,hs.jsx)("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:oo(r)}),t.map((e,t)=>(0,hs.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[(0,hs.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),(0,hs.jsx)("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),(0,hs.jsx)("span",{style:{fontWeight:500,fontSize:"0.85em"},children:oo(e.value)})]},t))]})}}function po(e){if(!0!==e){if("function"==typeof e){const t=e;return e=>{const r=!0===e?.__semioticHoverData||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType);let a=Array.isArray(o=r?e.data??{}:e)?o[0]:o;var o;if(!a)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof a?.x0&&"number"==typeof a?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof a?.sankeyWidth)&&a.data&&"object"==typeof a.data&&(a=a.data),!a)return null;if(r&&(void 0!==e.allSeries||void 0!==e.xValue)){const t={...a};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),a=t}const n=t(a);return null==n?null:ro(n)?n:(0,hs.jsx)(Qa,{children:n})}}if(!1===e||void 0===e)return!1;if(co(e)){if("function"==typeof e.content)return po(e.content);"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');const t=io();return po(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){const t=no(e);return po(e=>t(e))}if("multi"===e){"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');const e=io();return po(t=>e(t))}return no()}}function fo(e=240){const t=360-e,r=180+t/2,a=r*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:r,startAngleRad:a,offsetRad:-Math.PI/2+a}}function mo(e,t,r,a,o){const n=r-t||1;return o+(Math.max(t,Math.min(r,e))-t)/n*a}function go(e=240){const{sweepRad:t,offsetRad:r}=fo(e),a=[[Math.cos(r),Math.sin(r)],[Math.cos(r+t),Math.sin(r+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-r)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||a.push([Math.cos(e),Math.sin(e)]);const o=a.map(e=>e[0]),n=a.map(e=>e[1]),[i,s]=qa(o),[c,l]=qa(n);return{minX:i,maxX:s,minY:c,maxY:l,width:s-i,height:l-c,cx:(i+s)/2,cy:(c+l)/2}}var yo,bo=Object.create,vo=Object.defineProperty,wo=Object.getOwnPropertyDescriptor,Ao=Object.getOwnPropertyNames,xo=Object.getPrototypeOf,$o=Object.prototype.hasOwnProperty,Co=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of Ao(t))$o.call(e,o)||o===r||vo(e,o,{get:()=>t[o],enumerable:!(a=wo(t,o))||a.enumerable});return e},So=(e,t,r)=>(r=null!=e?bo(xo(e)):{},Co(!t&&e&&e.__esModule?r:vo(r,"default",{value:e,enumerable:!0}),e)),ko={};((e,t)=>{for(var r in t)vo(e,r,{get:t[r],enumerable:!0})})(ko,{AESTHETICS_OFF_PROFILE:()=>zo,CARBON_ALERT:()=>To,CARBON_CATEGORICAL_14:()=>No,COLOR_BLIND_SAFE_CATEGORICAL:()=>Ro,DARK_THEME:()=>Io,DEFAULT_AESTHETIC_PROFILE:()=>jo,DEFAULT_AESTHETIC_THRESHOLDS:()=>Fo,DEFAULT_AESTHETIC_WEIGHTS:()=>Oo,HIGH_CONTRAST_THEME:()=>Eo,IncrementalExtent:()=>os,LIGHT_THEME:()=>Po,MultiLineTooltip:()=>io,MultiPointTooltip:()=>ho,RingBuffer:()=>as,THEME_PRESETS:()=>Mo,Tooltip:()=>no,TooltipRoot:()=>Qa,accessibilityCaveats:()=>Ke,adaptiveTimeTicks:()=>O,auditAccessibility:()=>Ye,auditData:()=>Pe,auditMobileVisualization:()=>ft,auditObservedScene:()=>Ha,auditVisualHierarchy:()=>w,buildNavigationTree:()=>gr,buildReaderGrounding:()=>Nr,communicativeActForIntent:()=>jt,composeStyleRules:()=>d,computeArcBoundingBox:()=>go,configToJSX:()=>ka,configToJSXWithReport:()=>Ia,copyConfig:()=>Sa,countNodes:()=>br,createHatchPattern:()=>L,darkenColor:()=>j,describeChart:()=>Ut,deserializeSelections:()=>Na,diagnoseConfig:()=>Me,evaluateAesthetics:()=>E,evaluateChart:()=>tt,exportChart:()=>Ta,flattenVisible:()=>yr,formatAccessibilityAudit:()=>Je,formatDataAudit:()=>me,formatEvaluateChart:()=>et,formatMobileVisualizationAudit:()=>mt,fromConfig:()=>xa,fromURL:()=>Ca,fromVegaLite:()=>Ka,getHitRadius:()=>Tr,hasOwnTooltipChrome:()=>ro,hatchFillId:()=>U,hatchFillKey:()=>D,isHatchFill:()=>_,isMultiTooltip:()=>so,lightenColor:()=>z,makeNodeRuleContext:()=>i,makeRuleValueResolver:()=>o,makeStyleRuleStyleFn:()=>h,makeXYRuleContext:()=>n,markTooltipChrome:()=>eo,matchesThreshold:()=>c,mobileVisualizationCaveats:()=>gt,normalizeTooltip:()=>po,profileNumericFields:()=>fe,resolveCommunicativeAct:()=>zt,resolveMultiCapableTooltip:()=>lo,resolveResponsiveDimension:()=>F,resolveResponsiveRules:()=>nt,resolveStyleRules:()=>u,resolveThemePreset:()=>e,resolveTooltipContent:()=>uo,responsiveRuleMatches:()=>ot,ruleMatches:()=>l,serializeSelections:()=>Ea,smartTickFormat:()=>N,sweepToAngles:()=>fo,themeToCSS:()=>r,themeToCSSVariables:()=>t,themeToTokens:()=>a,toConfig:()=>va,toDataAuditNotifications:()=>ye,toEvaluateChartNotifications:()=>rt,toURL:()=>$a,unwrapDatum:()=>X,validateProps:()=>J,valueToAngle:()=>mo}),module.exports=(yo=ko,Co(vo({},"__esModule",{value:!0}),yo));var Ro=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],Po={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},Io={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},Eo={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:Ro,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},No=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],To={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},Mo={light:Po,dark:Io,"high-contrast":Eo,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}},Oo=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),Fo=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),jo=Object.freeze({name:"Semiotic balanced",weights:Oo,thresholds:Fo,minimumScore:70}),zo=Object.freeze({name:"Aesthetics off",weights:Object.freeze(Object.fromEntries(Object.keys(Oo).map(e=>[e,0]))),minimumScore:0}),Bo=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],Lo=new Set(["category10","tableau10"]),_o=new Set(["DonutChart","PieChart","SwimlaneChart"]),Do={"mark-scaffold-hierarchy":"Mark–scaffold hierarchy","palette-authorship":"Palette authorship","palette-economy":"Palette economy","typographic-hierarchy":"Typographic hierarchy","theme-coherence":"Theme coherence","editorial-emphasis":"Editorial emphasis"},Uo=(So(require("react")),6e4),Vo=60*Uo,Go=24*Vo,Ho=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],qo=null,Wo=(require("react/jsx-runtime"),["string","number",["number","object"],["boolean","object"],"boolean",["array","object"],["string","function"],["string","array","object"],["boolean","function","object","string"],"array","object",["boolean","string"],"function",["boolean","string","function","object"],["boolean","string","object"],["boolean","string","function"],["number","function"],["string","object"],["boolean","object","string","number"],["object","string","number","function"],["boolean","array"],["object","array"],["object","function"],["string","boolean"],["number","string","function"],["number","string"],["boolean","string","number","object"],["string","array"],["array","string"],["string","object","function"],["boolean","number","array"],["number","null"],["array","function"],["string","number","array","object","function"]]),Yo=[["primary","context","sparkline","mobile"],["highlight","isolate","none"],["right","left","top","bottom"],["nice","exact"],["primary","secondary"],["linear","log","time"],["linear","log","symlog"],["sliding","growing"],["left","right"],["vertical","horizontal"],["horizontal","vertical"],["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],["break","interpolate","zero"],["descending","ascending"],["smooth","linear"],["start","end","both","auto"],["series"],["zero","wiggle","silhouette","diverging"],["key","input","insideOut","asc","desc"],["blues","reds","greens","viridis","oranges","purples","greys","plasma","inferno","magma","cividis","turbo","custom"],["count","sum","mean"],["histogram","density","label"],["crossfilter","intersect"],["auto","worker","sync"],["source","target","gradient"],["justify","left","right","center"],["value","temporal"],["off","reuse"],["insertion","crossing-min","inside-out","crossing-min+inside-out"],["stack","hug"],["temporal","max"],["auto"],["raw","scene"],["source","target","both"],["full","half"],["source","target"],["tree","cluster","partition","treemap","circlepack"],["vertical","horizontal","radial"],["line","curve"],["leaf","parent","all"],["locked","decay","alternate"],["geo","line"],["basic","offset","arc"],["butt","round","square"],["straight","fractional"],["radial","strip"],["up","down"],["primary","context","sparkline","mobile","sample","mechanical"],["sample","mechanical"],["route","net"],["outcome","hold-last"],["replay","snapshot"],["horizontal"],["allAbsorbed","none"],["circle","halo","faceted","pill","diamond","square"],["auto","normalized","pixels"],["path","none"],["snapshot","replay","mechanical"],["none","blocker-amplification"],["domino-ball"],["vertical"],["settle"],["number","currency","percent","compact","duration"],["higher-is-better","lower-is-better","neutral"],["auto","positive","negative","neutral"],["tile","presentation","inline","thumbnail"],["start","center","end"]],Ko={common:{mode:[0,0],width:1,height:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,enableHover:4,showLegend:4,legendInteraction:[0,1],legendPosition:[0,2],legend:5,showGrid:4,colorBy:6,colorScheme:7,tooltip:8,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,maxDevicePixelRatio:1,axisExtent:[0,3],animate:3,loading:4,loadingContent:3,emptyContent:3,hoverHighlight:11,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,color:0,stroke:0,strokeWidth:1,opacity:1,onObservation:12,frameProps:10,onClick:12},xyAxis:{xLabel:0,yLabel:0,xFormat:12,yFormat:12,xScaleType:[0,5],yScaleType:[0,6]},ordinalAxis:{categoryLabel:0,valueLabel:0,showCategoryTicks:4,valueFormat:12,categoryFormat:12,dataIdAccessor:6},realtime:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,windowSize:1,windowMode:[0,7],arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:14,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},realtimeStatic:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:14,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},physics:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,colorBy:6,color:0,stroke:0,strokeWidth:1,opacity:1,seed:1,ballRadius:1,hoverRadius:1,paused:4,tooltip:13,annotations:9,autoPlaceAnnotations:3,background:0,legend:5,legendPosition:[0,2],legendLayout:10,selection:10,linkedHover:14,onSimulationStateChange:12,loading:4,loadingContent:3,emptyContent:3,frameProps:10}},Jo=Object.fromEntries(Object.entries({BarChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,brush:4,linkedBrush:17,onBrush:12,regression:14}],StackedBarChart:[["data","stackBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stackBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,9],normalize:4,sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:17,onBrush:12}],GroupedBarChart:[["data","groupBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,groupBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:17,onBrush:12}],SwarmPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],BoxPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],showOutliers:4,outlierRadius:1,categoryPadding:1,valueExtent:9,styleRules:9}],Histogram:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,bins:1,relative:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],ViolinPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],bins:1,curve:0,showIQR:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],RidgelinePlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,orientation:[0,9],categoryAccessor:6,valueAccessor:6,bins:1,amplitude:1,categoryPadding:1,valueExtent:9,styleRules:9}],DotPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,dotRadius:1,categoryPadding:1,valueExtent:9,styleRules:9,showGrid:4,regression:14}],PieChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,startAngle:1,valueFormat:12,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],DonutChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,innerRadius:1,centerContent:18,valueFormat:12,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],GaugeChart:[["value"],"none",[],["common"],{value:1,min:1,max:1,thresholds:9,gradientFill:10,arcWidth:1,cornerRadius:1,sweep:1,fillZones:4,showNeedle:4,needleColor:0,color:0,valueFormat:12,centerContent:19,showScaleLabels:4,backgroundColor:0,styleRules:9}],FunnelChart:[["data"],"array",["stepAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stepAccessor:6,valueAccessor:6,categoryAccessor:6,orientation:[0,10],connectorOpacity:1,showLabels:4,showAxes:4,showCategoryTicks:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],RadarChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,seriesAccessor:6,pointRadius:1,valueExtent:9,styleRules:9}],SwimlaneChart:[["subcategoryAccessor"],"array",["categoryAccessor","subcategoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,subcategoryAccessor:6,valueAccessor:6,orientation:[0,10],barPadding:1,roundedTop:16,valueExtent:9,trackFill:17,gradientFill:3,brush:4,onBrush:12,linkedBrush:17,showCategoryTicks:4,rTickValues:9,tickLabelEdgeAlign:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],LikertChart:[[],"array",["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],["common","ordinalAxis"],{data:9,levels:9,categoryAccessor:6,valueAccessor:6,levelAccessor:6,countAccessor:6,orientation:[0,9],barPadding:1,valueExtent:9,styleRules:9}],LineChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{frameProps:10,styleRules:9,data:9,xAccessor:6,yAccessor:6,lineBy:6,lineDataAccessor:0,curve:[0,11],lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,fillArea:20,areaOpacity:1,lineGradient:10,directLabel:3,gapStrategy:[0,12],forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9,brush:4,linkedBrush:17,onBrush:12}],BumpChart:[["data"],"array",["xAccessor","yAccessor"],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,rankDirection:[0,13],ribbon:4,curve:[0,14],ribbonSizeRange:9,samplesPerSegment:1,lineWidth:1,highlightTop:1,neutralColor:0,ribbonOpacity:1,lineOpacity:1,showPoints:4,pointRadius:1,showLabels:[11,15],labelPriorityAccessor:0,maxLabels:1,showAxes:4,styleRules:9,labelStyle:22,legend:5,legendInteraction:[0,1],legendPosition:[0,2],hoverHighlight:[11,16]}],AreaChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,areaBy:6,lineDataAccessor:0,curve:[0,11],y0Accessor:6,gradientFill:3,semanticGradient:21,semanticLine:4,lineGradient:10,areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],DifferenceChart:[[],"array",["xAccessor","seriesAAccessor","seriesBAccessor"],["common","xyAxis"],{data:9,xAccessor:6,seriesAAccessor:6,seriesBAccessor:6,seriesALabel:0,seriesBLabel:0,seriesAColor:0,seriesBColor:0,showLines:4,lineWidth:1,showPoints:4,pointRadius:1,curve:[0,11],areaOpacity:1,gradientFill:3,xExtent:9,yExtent:9,pointIdAccessor:6,windowSize:1,styleRules:9}],StackedAreaChart:[["data","areaBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,areaBy:6,lineDataAccessor:0,curve:[0,11],areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,normalize:4,baseline:[0,17],stackOrder:[0,18],pointIdAccessor:6,xExtent:9,yExtent:9}],Scatterplot:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,pointIdAccessor:6,marginalGraphics:22,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10,brush:4,linkedBrush:17,onBrush:12}],BubbleChart:[["data","sizeBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,sizeBy:6,xAccessor:6,yAccessor:6,sizeRange:9,bubbleOpacity:1,bubbleStrokeWidth:1,bubbleStrokeColor:0,pointIdAccessor:6,marginalGraphics:22,xExtent:9,yExtent:9,regression:14,brush:4,linkedBrush:17,onBrush:12}],Heatmap:[["data"],"array",["xAccessor","yAccessor","valueAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,valueAccessor:6,colorScheme:[0,19],customColorScale:12,showValues:4,valueFormat:12,cellBorderColor:0,cellBorderWidth:1,pointIdAccessor:6,xExtent:9,yExtent:9,legendPosition:[0,2],heatmapAggregation:[0,20],heatmapXBins:1,heatmapYBins:1}],QuadrantChart:[[],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xCenter:1,yCenter:1,quadrants:10,centerlineStyle:10,showQuadrantLabels:4,quadrantLabelSize:1,sizeBy:6,sizeRange:9,pointRadius:1,pointOpacity:1,pointIdAccessor:6}],MultiAxisLineChart:[["series"],"array",["xAccessor"],["common","xyAxis"],{data:9,xAccessor:6,series:9,colorScheme:7,pointIdAccessor:6,curve:0,lineWidth:1,styleRules:9}],WaterfallChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{data:9,xAccessor:6,yAccessor:6,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,styleRules:9,xExtent:9,yExtent:9,pointIdAccessor:6}],CandlestickChart:[[],"array",["xAccessor","highAccessor","lowAccessor"],["common","xyAxis"],{data:9,xAccessor:6,highAccessor:6,lowAccessor:6,openAccessor:6,closeAccessor:6,candlestickStyle:10,styleRules:9,pointIdAccessor:6,xExtent:9,yExtent:9,mode:[0,0]}],ConnectedScatterplot:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,orderAccessor:6,orderLabel:0,pointRadius:1,pointIdAccessor:6,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10}],ScatterplotMatrix:[["data","fields"],"array",[],["common"],{frameProps:10,data:9,fields:9,fieldLabels:10,cellSize:1,cellGap:1,pointRadius:1,pointOpacity:1,diagonal:[0,21],histogramBins:1,brushMode:[23,22],hoverMode:4,unselectedOpacity:1,idAccessor:6,styleRules:9}],MinimapChart:[["data"],"array",[],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,lineDataAccessor:0,curve:[0,11],lineWidth:1,styleRules:9,fillArea:4,areaOpacity:1,showPoints:4,pointRadius:1,minimap:10,renderBefore:4,onBrush:12,brushExtent:9,yExtent:9}],ForceDirectedGraph:[["nodes","edges"],"network",["nodeIdAccessor","sourceAccessor","targetAccessor"],["common"],{styleRules:9,nodes:9,edges:9,nodeIdAccessor:6,nodeIDAccessor:6,sourceAccessor:6,targetAccessor:6,nodeLabel:6,nodeSize:24,nodeSizeRange:9,edgeWidth:24,edgeColor:0,edgeOpacity:1,nodeStroke:0,nodeStrokeWidth:1,iterations:1,forceStrength:1,layoutExecution:[0,23],layoutLoadingContent:3,onLayoutStateChange:12,showLabels:4}],SankeyDiagram:[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,24],orientation:[0,9],nodeAlign:[0,25],nodePaddingRatio:1,nodeWidth:1,nodeLabel:6,showLabels:4,edgeOpacity:1,edgeSort:12}],ProcessSankey:[["domain"],"network",["sourceAccessor","targetAccessor"],["common"],{edges:9,nodes:9,domain:9,axisTicks:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,nodeLabel:6,startTimeAccessor:6,endTimeAccessor:6,systemInTimeAccessor:6,systemOutTimeAccessor:6,xExtentAccessor:6,groupBy:6,edgeIdAccessor:6,orientation:[0,10],legendPosition:[0,2],pairing:[0,26],packing:[0,27],laneOrder:[0,28],maxValueScale:1,lanePlacement:[0,29],nodeSizing:[0,30],showLabels:[11,31],labelPriorityAccessor:0,maxLabels:1,selectionDatum:[0,32],groupPadding:1,ribbonLane:[0,33],ribbonMinRun:25,lifetimeMode:[0,34],showLaneRails:4,showQualityReadout:4,edgeOpacity:1,styleRules:9,layoutExecution:[0,23],layoutWorkerThreshold:1,layoutLoadingContent:26,onLayoutStateChange:12,timeFormat:12,valueFormat:12,showParticles:4,particleStyle:10}],ChordDiagram:[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,35],padAngle:1,groupWidth:1,sortGroups:12,nodeLabel:6,showLabels:4,edgeOpacity:1}],TreeDiagram:[["data"],"object",[],["common"],{styleRules:9,data:10,layout:[0,36],orientation:[0,37],childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,edgeStyle:[0,38],nodeLabel:6,showLabels:4,nodeSize:1}],Treemap:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,labelMode:[0,39],padding:1,paddingTop:1,nodeLabel:6,nodeStyle:12}],CirclePack:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,nodeLabel:6,circleOpacity:1,padding:1}],OrbitDiagram:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,nodeIdAccessor:6,colorByDepth:4,orbitMode:27,orbitSize:16,speed:1,eccentricity:16,showRings:4,nodeRadius:16,showLabels:4,animated:4,revolution:12,revolutionStyle:[0,40],foregroundGraphics:10}],ChoroplethMap:[["areas","valueAccessor"],"array",["valueAccessor"],["common"],{styleRules:9,areas:28,valueAccessor:6,colorScheme:27,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1,areaOpacity:1}],ProportionalSymbolMap:[["points","sizeBy"],"array",["xAccessor","yAccessor"],["common"],{styleRules:9,points:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,areas:28,pointIdAccessor:6,areaStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],FlowMap:[["flows"],"array",[],["common"],{flows:9,nodes:9,nodeIdAccessor:0,xAccessor:6,yAccessor:6,valueAccessor:6,lineIdAccessor:6,lineType:[0,41],flowStyle:[0,42],areas:28,areaStyle:10,edgeColorBy:6,styleRules:9,edgeOpacity:1,edgeWidthRange:9,pointRadius:1,edgeLinecap:[0,43],showParticles:4,particleStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],DistanceCartogram:[["points","center","costAccessor"],"array",[],["common"],{styleRules:9,points:9,lines:9,xAccessor:6,yAccessor:6,nodeIdAccessor:0,center:0,costAccessor:6,strength:1,lineMode:[0,44],transition:1,pointRadius:1,showRings:30,showRingLabels:4,ringStyle:10,showNorth:4,costLabel:0,cartogramLayout:[0,45],projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],RealtimeLineChart:[[],"realtime",[],["realtime"],{styleRules:9,stroke:0,strokeWidth:1,strokeDasharray:0,opacity:1,aggregate:10,eventTime:10,transition:10}],RealtimeHistogram:[["binSize"],"realtime",[],["realtime"],{showTimeAxis:4,showValueAxis:4,axes:9,styleRules:9,binSize:1,direction:[0,46],categoryAccessor:6,colors:10,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,brush:14,onBrush:12,linkedBrush:17,transition:10}],TemporalHistogram:[["data","binSize"],"array",["timeAccessor","valueAccessor","categoryAccessor"],["realtimeStatic"],{showTimeAxis:4,showValueAxis:4,axes:9,styleRules:9,data:9,binSize:1,size:9,width:1,height:1,margin:2,className:0,timeAccessor:6,valueAccessor:6,direction:[0,46],categoryAccessor:6,colors:10,timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,transition:10,linkedHover:14,linkedBrush:17,brush:14,onBrush:12}],RealtimeSwarmChart:[[],"realtime",[],["realtime"],{styleRules:9,categoryAccessor:6,colors:10,radius:1,fill:0,opacity:1,stroke:0,strokeWidth:1,pointStyle:12,yScaleType:[0,6],transition:10}],RealtimeWaterfallChart:[[],"realtime",[],["realtime"],{styleRules:9,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,stroke:0,strokeWidth:1,opacity:1,transition:10}],RealtimeHeatmap:[[],"realtime",[],["realtime"],{styleRules:9,heatmapXBins:1,heatmapYBins:1,aggregation:[0,20],categoryAccessor:6,colorScheme:[0,19],customColorScale:12}],GaltonBoardChart:[[],"array",["valueAccessor"],["physics"],{styleRules:9,valueAccessor:6,valueExtent:9,bins:1,mode:[0,47],simulationMode:[0,48],pegRows:1,mechanicalCount:1,branchProbability:1,referenceLines:21,rerunMS:31,showProjection:4}],EventDropChart:[["data"],"array",["timeAccessor","arrivalAccessor","watermarkAtArrivalAccessor"],["physics"],{styleRules:9,timeAccessor:6,arrivalAccessor:6,watermarkAtArrivalAccessor:6,windows:10,watermark:22,timeExtent:9,timeScale:1,rerunMS:31,showProjection:4}],UnitPileChart:[[],"array",["categoryAccessor","valueAccessor"],["physics"],{styleRules:9,categoryAccessor:6,valueAccessor:6,mode:[0,47],simulationMode:[0,48],mechanicalCount:1,mechanicalCategories:9,unitValue:1,showProjection:4,sediment:4,rerunMS:31}],CollisionSwarmChart:[[],"array",["xAccessor","groupAccessor","radiusAccessor"],["physics"],{styleRules:9,xAccessor:6,groupAccessor:6,radiusAccessor:6,pointRadius:1,xExtent:9,collisionIterations:1,settle:4,rerunMS:31,showProjection:4}],GauntletChart:[["negativeProperties"],"array",["idAccessor","positiveAccessor","negativeAccessor","metricsAccessor","startTimeAccessor"],["physics"],{idAccessor:6,labelAccessor:6,positiveAccessor:6,negativeAccessor:6,metricsAccessor:6,initialViability:6,positiveProperties:9,negativeProperties:9,gates:9,events:32,bodyGroups:32,crashOffset:1,initialSpawnPacing:10,startTimeAccessor:6,onCapacityChange:12,crashDetection:4,rerunMS:31,showChrome:4,showProjection:4,showTethers:4,coreForceMode:[0,49],terminalBehavior:[0,50]}],CrucibleChart:[["data","phases"],"array",["idAccessor","labelAccessor","categoryAccessor","amountAccessor","metricsAccessor","initialStateAccessor"],["physics"],{description:0,summary:0,phases:9,products:9,events:9,outlets:9,idAccessor:6,labelAccessor:6,categoryAccessor:6,amountAccessor:6,metricsAccessor:6,initialStateAccessor:6,metrics:10,amountLabel:0,conservation:3,projection:10,playback:[0,51],snapshotAt:2,controls:3,paused:4,playbackRate:1,rerunMS:31,seed:25,bodyRadius:1,radiusRange:9,colorBy:6,showBonds:4,showChrome:4,showProjection:4,initialSpawnPacing:10,loading:4,loadingContent:3,emptyContent:3,onStateChange:12,onCrucibleObservation:12,onDiagnostic:12,onConservation:12,onClick:12}],ProcessFlowChart:[["stages"],"array",["idAccessor","stageAccessor","groupBy","workAccessor","radiusAccessor"],["physics"],{stages:9,stageAccessor:6,idAccessor:6,groupBy:6,groupLabelAccessor:6,workAccessor:6,styleRules:9,radiusAccessor:6,ballRadius:1,route:[0,52],groupCompletion:[0,53],groupAnchorAlong:1,showProjection:4,showChrome:4,chromeOptions:10,settle:4,gravityX:1,gravityY:1,springStiffness:1,springDamping:1,rerunMS:31,initialSpawnPacing:10,liveCapacity:4,bodyLimit:1,bodyMark:[0,54],seed:1}],PacketFlowChart:[[],"network",["nodeIdAccessor","nodeXAccessor","nodeYAccessor","sourceAccessor","targetAccessor","throughputAccessor","pathAccessor"],["common"],{size:9,background:0,legendLayout:10,nodes:9,links:9,edges:9,data:9,nodeIdAccessor:6,nodeXAccessor:6,nodeYAccessor:6,sourceAccessor:6,targetAccessor:6,throughputAccessor:6,pathAccessor:6,styleRules:9,coordinateMode:[0,55],particleRate:1,maxParticles:1,particleRadius:1,flowSpeed:1,pathConstraint:[0,56],reducedMotion:4,showStaticFlow:4,showNodeLabels:4,showSensors:4,paused:4,rerunMS:31,seed:1}],ChainReactionChart:[["data","taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor"],"array",["taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor","startAccessor","endAccessor","progressAccessor","statusAccessor","completionTimeAccessor","blockerAccessor","milestoneAccessor"],["physics"],{taskIDAccessor:6,labelAccessor:6,laneAccessor:6,dependencyAccessor:6,startAccessor:6,endAccessor:6,progressAccessor:6,statusAccessor:6,completionTimeAccessor:6,blockerAccessor:6,milestoneAccessor:6,mode:[0,57],insight:[0,58],currentTime:2,controls:20,mechanism:[0,59],orientation:[0,60],reducedMotion:[0,61],enableHover:4,seed:1,selectedTaskIDs:9,onSelectionChange:12,onObservation:12}],BigNumber:[[],"none",[],[],{width:25,height:25,className:0,chartId:0,description:0,summary:0,loading:4,loadingContent:3,emptyContent:3,value:1,label:0,caption:0,format:[6,62],locale:0,currency:0,precision:1,prefix:0,suffix:0,unit:0,comparison:10,target:10,delta:1,deltaFormat:[6,62],showDeltaPercent:4,direction:[0,63],sentiment:[0,64],thresholds:9,chartSlot:33,chartSize:1,windowSize:1,mode:[0,65],align:[0,66],padding:2,emphasis:[0,4],color:0,background:0,borderColor:0,borderRadius:25,animate:3,stalenessThreshold:1,staleLabel:0,headerSlot:33,valueSlot:33,deltaSlot:33,trendSlot:33,footerSlot:33,onClick:12,onObservation:12}]}).map(([e,[t,r,a,o,n]])=>[e,{required:[...t],dataShape:r,dataAccessors:[...a],props:Object.fromEntries(Object.entries(Object.assign({},...o.map(e=>Ko[e]),n)).map(([e,t])=>[e,Y(t)]))}])),Xo=new Set(["start","center","end","left","right"]),Zo={swatchSize:{minimum:1,label:"a positive number"},labelGap:{minimum:0,label:"a non-negative number"},itemGap:{minimum:0,label:"a non-negative number"},rowHeight:{minimum:1,label:"a positive number"},maxWidth:{minimum:1,label:"a positive number"},edgeGutter:{minimum:0,label:"a non-negative number"},sideGutter:{minimum:0,label:"a non-negative number"},axisGutter:{minimum:0,label:"a non-negative number"}},Qo=(require("d3-interpolate"),80),en=100,tn=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),rn=new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),an=new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),on=new Set(["LineChart","AreaChart","StackedAreaChart"]),nn=new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]),sn=new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),cn=new Set(["PieChart","DonutChart"]),ln={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},un=new Set(Object.keys(ln)),dn={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},hn=new Set(["BigNumber"]),pn=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),fn=new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),mn=new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),gn=new Set(["OrbitDiagram",...mn]),yn=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),bn=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),vn=new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),wn=new Set(["MultiAxisLineChart"]),An=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),xn={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},$n=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),Cn=new Set(["label","callout","callout-circle","callout-rect"]),Sn=2e4,kn=120,Rn=250,Pn=["xExtent","yExtent","rExtent"],In=8,En=/^\d{4}-\d{1,2}$/,Nn=[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"y",accessor:"yAccessor",defaultAccessor:"y",domain:!0}],Tn={fields:Nn},Mn=[{...Nn[0],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates"},{...Nn[1],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates",allowMissing:!0}],On={fields:Mn},Fn={role:"value",accessor:"valueAccessor",defaultAccessor:"value"},jn={...Fn,domain:!0},zn={fields:[{...Fn,requirements:["finite","non-negative"]}],aggregates:[{kind:"positive-total",role:"value"}]},Bn={fields:[Fn],aggregates:[{kind:"normalized-total",role:"value",groupAccessor:"categoryAccessor",defaultGroupAccessor:"category",whenProp:"normalize"}]},Ln={fields:Mn,aggregates:[{kind:"normalized-total",role:"y",groupAccessor:"xAccessor",defaultGroupAccessor:"x",whenProp:"normalize"}]},_n={fields:[...Nn,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Dn={fields:[...Nn,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Un={fields:[Fn]},Vn={fields:[{...Fn,dataProp:"edges",requirements:["finite","non-negative"],missingValue:1}]},Gn={LineChart:On,AreaChart:On,BumpChart:On,Scatterplot:Dn,ConnectedScatterplot:Tn,QuadrantChart:Dn,MinimapChart:On,BubbleChart:_n,StackedAreaChart:Ln,DifferenceChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date",domain:!0},{role:"value",accessor:"seriesAAccessor",defaultAccessor:"a"},{role:"value",accessor:"seriesBAccessor",defaultAccessor:"b"}]},WaterfallChart:{fields:[{role:"y",accessor:"yAccessor",defaultAccessor:"y"}]},CandlestickChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"high",accessor:"highAccessor",defaultAccessor:"high",requirements:["finite"]},{role:"low",accessor:"lowAccessor",defaultAccessor:"low",requirements:["finite"]},{role:"open",accessor:"openAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]},{role:"close",accessor:"closeAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]}]},Heatmap:Un,BarChart:{fields:[Fn]},GroupedBarChart:{fields:[Fn]},StackedBarChart:Bn,DotPlot:{fields:[jn]},Histogram:{fields:[jn]},BoxPlot:{fields:[jn]},SwarmPlot:{fields:[jn,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ViolinPlot:{fields:[jn]},RidgelinePlot:{fields:[jn]},PieChart:zn,DonutChart:zn,FunnelChart:zn,SankeyDiagram:Vn,ChordDiagram:Vn,ProportionalSymbolMap:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"lon",dataProp:"points",requirements:["finite"]},{role:"y",accessor:"yAccessor",defaultAccessor:"lat",dataProp:"points",requirements:["finite"]},{role:"size",accessor:"sizeBy",dataProp:"points",requirements:["finite","non-negative"]}]}},Hn=Symbol.for("semiotic.numericContractRegistry"),qn=5,Wn={xAccessor:"x",yAccessor:"y",valueAccessor:"value",sizeBy:"size",sizeAccessor:"size",radiusAccessor:"size",countAccessor:"count",amountAccessor:"value",highAccessor:"high",lowAccessor:"low",openAccessor:"open",closeAccessor:"close",lowerAccessor:"lower",upperAccessor:"upper",positiveAccessor:"value",negativeAccessor:"value",progressAccessor:"value",confidenceAccessor:"value",costAccessor:"value",throughputAccessor:"value"},Yn=new Set(["category10","tableau10","set3","blues","reds","greens","oranges","purples","greys","viridis","plasma","inferno","magma","cividis","turbo"]),Kn=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIdAccessor","nodeIDAccessor","childrenAccessor","costAccessor"],Jn=["title","description","summary"],Xn=new Set(["XYCustomChart","OrdinalCustomChart","NetworkCustomChart","GeoCustomChart"]),Zn=new Set([...Xn,"XYFrame","OrdinalFrame","NetworkFrame","GeoFrame"]),Qn=new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]),ei=Symbol.for("semiotic.chartRecipeRegistry"),ti="Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari).",ri={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},ai=["perceivable","operable","understandable","robust","compromising","assistive","flexible"],oi={code:"SEMANTIC_DEGENERATE",severity:"error",message:"Marks painted, but the capability reported a semantically degenerate encoding.",fix:"Choose fields that support the chart's intended encoding."},ni={error:0,warning:1,manual:2},ii={data:0,deception:1,accessibility:2,render:3},si="Mobile visualization audit: informed by MobileVisFixer, mobile exploratory interaction research, small-multiple mobile studies, responsive visualization grammars, constraint-based breakpoints, and WCAG 2.2 input modalities.",ci=new Set([...pn,"RealtimeLineChart","RealtimeHeatmap"]),li=Object.fromEntries(Object.entries(xn).map(([e,t])=>[e,[t,"hoverRadius"]])),ui={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},di=["layout","density","interaction","annotation","semantics"],hi=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),pi=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),fi=new Set(["PieChart","DonutChart","FunnelChart"]),mi=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),gi={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",BumpChart:"bump chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},yi=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),bi=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),vi=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),wi={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},Ai={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},xi=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],$i={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},Ci=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),Si=new Set(["system","agent","watcher"]),ki=new Set(["ai","agent","system","computed","dbt","great-expectations"]),Ri=new Set(["rule","statistical-test","llm-inference","computed"]),Pi={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"},Ii=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Ei=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Ni=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),Ti=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),Mi=["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"],Oi=new Set(Mi),Fi=(e,t)=>(e>>>t|e<<32-t)>>>0,ji=e=>Math.floor(4294967296*(e-Math.floor(e)))>>>0,[zi,Bi]=(()=>{const e=[],t=[];for(let r=2;64>t.length;r+=1){let a=!0;for(let e=2;r>=e*e;e+=1)if(r%e===0){a=!1;break}a&&(8>e.length&&e.push(ji(Math.sqrt(r))),t.push(ji(Math.cbrt(r))))}return[e,t]})(),Li="0.1",_i=aa({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}}),Di=["fresh","stale","unknown"],Ui=["partial","provisional","settled","unknown"],Vi=["observedAt","ingestedAt","processedAt","publishedAt","snapshotAt"],Gi={eventTime:{field:{},value:{},timezone:{},granularity:{}},presentation:{state:{values:["live","historical","mixed"]},label:{}},freshness:{status:{required:!0,values:Di},checkedAt:{},heartbeatAt:{},expiresAt:{},basis:{}},watermark:{value:{required:!0},policy:{},allowedLateness:{}},window:{start:{required:!0},end:{required:!0},status:{required:!0,values:["open","provisional","settled","reopened","corrected"]}},completeness:{status:{required:!0,values:Ui},basis:{}},revision:{status:{required:!0,values:["original","backfilled","corrected","superseded"]},previousArtifactId:{},correctionId:{},reason:{}},snapshot:{id:{},format:{values:["iceberg","delta","other"]},schemaVersion:{},catalogRef:{}}},Hi={id:{required:!0},kind:{required:!0,values:["stream","processing-job","quality-check","snapshot","publication"]},label:{},observedAt:{},version:{},timezone:{},granularity:{},freshness:{values:Di},completeness:{values:Ui}},qi=["data","nodes","edges","points","areas","lines","flows"],Wi=new Set(["data","nodes","edges","points","areas","lines","flows"]),Yi=new Set(["preserved","unsupported-version","invalid","excluded"]),Ki="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),Ji="1",Xi=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend","recipe","layout"]),Zi=new Set(["data","nodes","edges","points","areas","lines","flows"]),Qi="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),es={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},ts={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},rs={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"},as=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const r of e){const e=this.push(r);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++)e(this.buffer[(t+r)%this._capacity],r)}toArray(){const e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++)e[r]=this.buffer[(t+r)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");const t=this.toArray();let r=0,a=[];t.length>e&&(r=t.length-e,a=t.slice(0,r)),this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(let e=r;t.length>e;e++)this.push(t[e]);return a}update(e,t){const r=[],a=(this.head-this._size+this._capacity)%this._capacity;for(let o=0;this._size>o;o++){const n=(a+o)%this._capacity,i=this.buffer[n];if(e(i)){let e;e="object"!=typeof i||null===i?i:Array.isArray(i)?[...i]:{...i},r.push(e),this.buffer[n]=t(i)}}return r}remove(e){const t=[],r=[];if(this.forEach(a=>{e(a)?r.push(a):t.push(a)}),0===r.length)return r;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return r}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},os=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}evict(e){e!==this._min&&e!==this._max||(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(const r of e){const e=t?t(r):r;Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},ns=["name","label","title"],is=["type","kind","category","group","class","status","role","shape"],ss=["value","amount","total","count","weight","score"],cs=new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]),ls=So(require("react")),us=require("react/jsx-runtime"),ds={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};eo(Qa);var hs=require("react/jsx-runtime");