semiotic 3.9.1 → 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 (566) hide show
  1. package/README.md +137 -58
  2. package/agent-skill/semiotic-charts/SKILL.md +27 -17
  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/componentMetadata.cjs +13 -3
  8. package/ai/dist/mcp-server.js +140 -36407
  9. package/ai/examples.md +110 -7
  10. package/ai/reference.md +82 -28
  11. package/ai/schema.json +7675 -1471
  12. package/ai/surface-manifest.json +60 -9
  13. package/ai/system-prompt.md +18 -3
  14. package/ai/task-packets/compare-category-totals.json +301 -0
  15. package/ai/task-packets/compare-category-totals.md +188 -0
  16. package/ai/task-packets/correct-published-chart.json +271 -0
  17. package/ai/task-packets/correct-published-chart.md +597 -0
  18. package/ai/task-packets/index.json +40 -0
  19. package/ai/task-packets/update-live-chart.json +289 -0
  20. package/ai/task-packets/update-live-chart.md +424 -0
  21. package/dist/c-2N7IU2NY.min.js +1 -0
  22. package/dist/c-2WK7YJLL.min.js +1 -0
  23. package/dist/c-33QOXEUG.min.js +1 -0
  24. package/dist/c-42PLDTX7.min.js +1 -0
  25. package/dist/c-447VIMRO.min.js +1 -0
  26. package/dist/c-4FN7Q6VQ.min.js +1 -0
  27. package/dist/c-553QUDKA.min.js +1 -0
  28. package/dist/c-55BAJ333.min.js +1 -0
  29. package/dist/c-7242NXSG.min.js +1 -0
  30. package/dist/c-7EGHJU2F.min.js +1 -0
  31. package/dist/c-7HP7MB2I.min.js +1 -0
  32. package/dist/c-7NBU5ZKS.min.js +1 -0
  33. package/dist/c-AFBSWT77.min.js +1 -0
  34. package/dist/c-AJ7EC32V.min.js +1 -0
  35. package/dist/c-AQADQNY7.min.js +1 -0
  36. package/dist/c-ATM475SA.min.js +1 -0
  37. package/dist/c-AVO3Q7T7.min.js +1 -0
  38. package/dist/c-AZKPVBOC.min.js +1 -0
  39. package/dist/c-BNFJMDHN.min.js +1 -0
  40. package/dist/c-BNG5ECK5.min.js +1 -0
  41. package/dist/c-BOHCQILI.min.js +1 -0
  42. package/dist/c-CCTGN5CK.min.js +1 -0
  43. package/dist/c-CPSPZH6A.min.js +1 -0
  44. package/dist/c-CPV4N35K.min.js +1 -0
  45. package/dist/c-D6HAAPTX.min.js +1 -0
  46. package/dist/c-DE5Q3U2X.min.js +1 -0
  47. package/dist/c-DK662R77.min.js +1 -0
  48. package/dist/c-DY2676CR.min.js +1 -0
  49. package/dist/c-E32M6XW5.min.js +1 -0
  50. package/dist/c-E4JDJH4I.min.js +1 -0
  51. package/dist/c-E7I2L7CU.min.js +1 -0
  52. package/dist/c-EBOQ7ER7.min.js +1 -0
  53. package/dist/c-ELDWAO2V.min.js +1 -0
  54. package/dist/c-EUBTECGM.min.js +1 -0
  55. package/dist/c-GNTXRXRN.min.js +1 -0
  56. package/dist/c-GSZRZRD6.min.js +1 -0
  57. package/dist/c-GWX7JGMF.min.js +1 -0
  58. package/dist/c-GXV3C3MO.min.js +1 -0
  59. package/dist/c-HHTK2R75.min.js +1 -0
  60. package/dist/c-HLLFJYTY.min.js +1 -0
  61. package/dist/c-HPOYKCCG.min.js +1 -0
  62. package/dist/c-HXDKPIKR.min.js +1 -0
  63. package/dist/c-I4QJ6YLM.min.js +1 -0
  64. package/dist/c-IDJV3CZK.min.js +1 -0
  65. package/dist/c-ITKX3RC5.min.js +1 -0
  66. package/dist/c-JG2JCQLP.min.js +1 -0
  67. package/dist/c-JLGRHXGZ.min.js +1 -0
  68. package/dist/c-JO2UGTCP.min.js +1 -0
  69. package/dist/c-JUKIWTBJ.min.js +1 -0
  70. package/dist/c-KCRJGUHP.min.js +1 -0
  71. package/dist/c-LMGSSD2E.min.js +1 -0
  72. package/dist/c-LYQMZMZQ.min.js +1 -0
  73. package/dist/c-LYVKDBQJ.min.js +1 -0
  74. package/dist/c-MVR3RWF3.min.js +1 -0
  75. package/dist/c-MXCP7GNZ.min.js +1 -0
  76. package/dist/c-NG7BLZTR.min.js +1 -0
  77. package/dist/c-NYZ2QNAM.min.js +1 -0
  78. package/dist/c-OO5QLMJC.min.js +1 -0
  79. package/dist/c-OOVX2JPQ.min.js +1 -0
  80. package/dist/c-ORLEBW72.min.js +1 -0
  81. package/dist/c-P65V6HLO.min.js +1 -0
  82. package/dist/c-PP6VY3QU.min.js +1 -0
  83. package/dist/c-PRIKOLTE.min.js +1 -0
  84. package/dist/c-PSNI6KAZ.min.js +1 -0
  85. package/dist/c-PYNW54D2.min.js +1 -0
  86. package/dist/c-QA3HMQJP.min.js +1 -0
  87. package/dist/c-QAVFOEUY.min.js +1 -0
  88. package/dist/c-ROEHCIGV.min.js +1 -0
  89. package/dist/c-S3AZX5PP.min.js +1 -0
  90. package/dist/c-T2V7O2LO.min.js +1 -0
  91. package/dist/c-TIXX5CAU.min.js +1 -0
  92. package/dist/c-TKG2NP7G.min.js +1 -0
  93. package/dist/c-VJTDST2R.min.js +1 -0
  94. package/dist/c-VXLOLYTO.min.js +1 -0
  95. package/dist/c-W4ZUKSEQ.min.js +1 -0
  96. package/dist/c-WH2O53VI.min.js +1 -0
  97. package/dist/c-WNGH47HF.min.js +1 -0
  98. package/dist/c-WUWXGQYA.min.js +1 -0
  99. package/dist/c-XDQKXPX4.min.js +1 -0
  100. package/dist/c-XSB27XPS.min.js +1 -0
  101. package/dist/c-YDECTEUW.min.js +1 -0
  102. package/dist/c-YF3YKVQI.min.js +1 -0
  103. package/dist/c-YLZIV3VS.min.js +1 -0
  104. package/dist/c-ZYPXQF7B.min.js +1 -0
  105. package/dist/components/Annotation.d.ts +3 -2
  106. package/dist/components/access/chartAccessCapabilities.generated.d.ts +14 -0
  107. package/dist/components/access/chartAccessContract.d.ts +90 -0
  108. package/dist/components/access/chartAccessContractFixtures.d.ts +11 -0
  109. package/dist/components/ai/aestheticProfileTypes.d.ts +35 -0
  110. package/dist/components/ai/annotationProvenance.d.ts +2 -7
  111. package/dist/components/ai/auditVisualHierarchy.d.ts +49 -0
  112. package/dist/components/ai/builtInChartRecipeLayouts.d.ts +2 -0
  113. package/dist/components/ai/builtInChartRecipePublic.d.ts +4 -0
  114. package/dist/components/ai/builtInChartRecipes.d.ts +26 -0
  115. package/dist/components/ai/chartCapabilities.d.ts +3 -1
  116. package/dist/components/ai/chartRecipeRegistry.d.ts +7 -1
  117. package/dist/components/ai/chartRecipes.d.ts +10 -0
  118. package/dist/components/ai/colorEvidence.d.ts +12 -0
  119. package/dist/components/ai/describePhysicsProjection.d.ts +18 -0
  120. package/dist/components/ai/describePhysicsSource.d.ts +13 -0
  121. package/dist/components/ai/evaluateAesthetics.d.ts +47 -0
  122. package/dist/components/ai/geoNavigation.d.ts +4 -0
  123. package/dist/components/ai/hierarchyNavigation.d.ts +4 -0
  124. package/dist/components/ai/navigationTree.d.ts +7 -1
  125. package/dist/components/ai/qualityFixtures.d.ts +8 -0
  126. package/dist/components/ai/suggestionPropContracts.d.ts +1 -1
  127. package/dist/components/ai/useNavigationSync.d.ts +3 -3
  128. package/dist/components/artifact/ArtifactInspector.d.ts +26 -0
  129. package/dist/components/artifact/ArtifactInspectorContextSections.d.ts +18 -0
  130. package/dist/components/artifact/artifactContractDiff.d.ts +8 -0
  131. package/dist/components/artifact/artifactInspectorSummary.d.ts +53 -0
  132. package/dist/components/artifact/artifactRevision.d.ts +54 -0
  133. package/dist/components/artifact/artifactTestFixtures.d.ts +17 -0
  134. package/dist/components/artifact/attachmentAudit.d.ts +13 -0
  135. package/dist/components/artifact/claimCorrections.d.ts +3 -0
  136. package/dist/components/artifact/claimGraph.d.ts +5 -0
  137. package/dist/components/artifact/claimLifecycle.d.ts +32 -0
  138. package/dist/components/artifact/claims.d.ts +24 -0
  139. package/dist/components/artifact/collection.d.ts +10 -0
  140. package/dist/components/artifact/collectionCorrectionScope.d.ts +4 -0
  141. package/dist/components/artifact/collectionImpact.d.ts +11 -0
  142. package/dist/components/artifact/collectionLineage.d.ts +3 -0
  143. package/dist/components/artifact/collectionOperations.d.ts +8 -0
  144. package/dist/components/artifact/collectionPolicy.d.ts +22 -0
  145. package/dist/components/artifact/collectionTypes.d.ts +117 -0
  146. package/dist/components/artifact/configurationRepair.d.ts +8 -0
  147. package/dist/components/artifact/contract.d.ts +30 -0
  148. package/dist/components/artifact/evaluateArtifact.d.ts +12 -0
  149. package/dist/components/artifact/evaluateArtifactTypes.d.ts +78 -0
  150. package/dist/components/artifact/evaluationPresentation.d.ts +9 -0
  151. package/dist/components/artifact/evidenceSample.d.ts +8 -0
  152. package/dist/components/artifact/exportPaths.d.ts +8 -0
  153. package/dist/components/artifact/fieldPolicies.d.ts +12 -0
  154. package/dist/components/artifact/fingerprint.d.ts +36 -0
  155. package/dist/components/artifact/grounding.d.ts +51 -0
  156. package/dist/components/artifact/groundingBudget.d.ts +38 -0
  157. package/dist/components/artifact/hostTransfer.d.ts +13 -0
  158. package/dist/components/artifact/identity.d.ts +19 -0
  159. package/dist/components/artifact/inheritance.d.ts +48 -0
  160. package/dist/components/artifact/inheritanceIntegrity.d.ts +3 -0
  161. package/dist/components/artifact/jsonCompatibility.d.ts +2 -0
  162. package/dist/components/artifact/obligations.d.ts +3 -0
  163. package/dist/components/artifact/policies.d.ts +45 -0
  164. package/dist/components/artifact/policyRelations.d.ts +3 -0
  165. package/dist/components/artifact/recordProjection.d.ts +7 -0
  166. package/dist/components/artifact/representation.d.ts +50 -0
  167. package/dist/components/artifact/serialization.d.ts +40 -0
  168. package/dist/components/artifact/temporal.d.ts +32 -0
  169. package/dist/components/artifact/temporalAdapters.d.ts +75 -0
  170. package/dist/components/artifact/temporalAuditHelpers.d.ts +12 -0
  171. package/dist/components/artifact/temporalPresentation.d.ts +8 -0
  172. package/dist/components/artifact/types.d.ts +341 -0
  173. package/dist/components/artifact/validation.d.ts +13 -0
  174. package/dist/components/artifact/validationFieldStatus.d.ts +7 -0
  175. package/dist/components/artifact/validationPrimitives.d.ts +24 -0
  176. package/dist/components/artifact/validationSurfaces.d.ts +7 -0
  177. package/dist/components/artifact/validationTemporal.d.ts +3 -0
  178. package/dist/components/charts/geo/FlowMap.d.ts +7 -0
  179. package/dist/components/charts/geo/flowMapLineStyle.d.ts +18 -0
  180. package/dist/components/charts/index.d.ts +4 -0
  181. package/dist/components/charts/network/ChordDiagram.d.ts +5 -1
  182. package/dist/components/charts/network/CirclePack.d.ts +8 -1
  183. package/dist/components/charts/network/OrbitDiagram.d.ts +9 -0
  184. package/dist/components/charts/network/TreeDiagram.d.ts +8 -1
  185. package/dist/components/charts/network/Treemap.d.ts +8 -1
  186. package/dist/components/charts/ordinal/BarChart.d.ts +6 -0
  187. package/dist/components/charts/ordinal/BoxPlot.d.ts +3 -0
  188. package/dist/components/charts/ordinal/DonutChart.d.ts +5 -0
  189. package/dist/components/charts/ordinal/DotPlot.d.ts +3 -0
  190. package/dist/components/charts/ordinal/FunnelChart.d.ts +5 -0
  191. package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
  192. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -0
  193. package/dist/components/charts/ordinal/Histogram.d.ts +3 -0
  194. package/dist/components/charts/ordinal/LikertChart.d.ts +3 -0
  195. package/dist/components/charts/ordinal/PieChart.d.ts +5 -0
  196. package/dist/components/charts/ordinal/RadarChart.capability.d.ts +2 -0
  197. package/dist/components/charts/ordinal/RadarChart.d.ts +77 -0
  198. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +3 -0
  199. package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -0
  200. package/dist/components/charts/ordinal/SwarmPlot.d.ts +3 -0
  201. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +3 -0
  202. package/dist/components/charts/ordinal/ViolinPlot.d.ts +3 -0
  203. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
  204. package/dist/components/charts/physics/EventDropChart.d.ts +3 -1
  205. package/dist/components/charts/physics/GaltonBoardChart.d.ts +4 -2
  206. package/dist/components/charts/physics/GauntletChart.d.ts +1 -5
  207. package/dist/components/charts/physics/ProcessFlowChart.d.ts +6 -0
  208. package/dist/components/charts/physics/UnitPileChart.d.ts +2 -1
  209. package/dist/components/charts/physics/chainReactionTypes.d.ts +3 -0
  210. package/dist/components/charts/physics/collisionSwarmPacking.d.ts +14 -0
  211. package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +1 -0
  212. package/dist/components/charts/physics/eventDropAdmission.d.ts +32 -0
  213. package/dist/components/charts/physics/eventDropPhysics.d.ts +22 -1
  214. package/dist/components/charts/physics/galtonBoardPhysics.d.ts +2 -9
  215. package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
  216. package/dist/components/charts/physics/physicsChartReconcile.d.ts +4 -0
  217. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  218. package/dist/components/charts/physics/physicsGaltonData.d.ts +10 -0
  219. package/dist/components/charts/physics/physicsHocHandle.d.ts +2 -0
  220. package/dist/components/charts/physics/physicsHocUtils.d.ts +7 -1
  221. package/dist/components/charts/physics/physicsPileData.d.ts +11 -0
  222. package/dist/components/charts/physics/physicsPilePhysics.d.ts +5 -12
  223. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +1 -1
  224. package/dist/components/charts/physics/physicsSourceRows.d.ts +8 -0
  225. package/dist/components/charts/physics/usePhysicsChartData.d.ts +19 -0
  226. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +14 -1
  227. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +25 -7
  228. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +18 -5
  229. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +11 -1
  230. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +11 -1
  231. package/dist/components/charts/realtime/aggregate.d.ts +12 -1
  232. package/dist/components/charts/realtime/realtimeAccessors.d.ts +4 -0
  233. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +8 -5
  234. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +7 -0
  235. package/dist/components/charts/realtime/realtimeStyleRules.d.ts +4 -0
  236. package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +17 -11
  237. package/dist/components/charts/shared/GaugeReadout.d.ts +9 -0
  238. package/dist/components/charts/shared/ThresholdAnnotation.d.ts +18 -0
  239. package/dist/components/charts/shared/ThresholdEndCap.d.ts +7 -0
  240. package/dist/components/charts/shared/annotationStatusFilter.d.ts +18 -0
  241. package/dist/components/charts/shared/auditAccessibilityText.d.ts +4 -2
  242. package/dist/components/charts/shared/chartDefinitionPilot.d.ts +5 -4
  243. package/dist/components/charts/shared/chartSpecCore.d.ts +2 -2
  244. package/dist/components/charts/shared/heatmapStyleRules.d.ts +13 -0
  245. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  246. package/dist/components/charts/shared/networkUtils.d.ts +14 -0
  247. package/dist/components/charts/shared/numericTickFormatter.d.ts +2 -0
  248. package/dist/components/charts/shared/radialCenterContent.d.ts +10 -0
  249. package/dist/components/charts/shared/selectionUtils.d.ts +3 -1
  250. package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
  251. package/dist/components/charts/shared/types.d.ts +4 -2
  252. package/dist/components/charts/shared/useChartLegend.d.ts +6 -1
  253. package/dist/components/charts/shared/useLikertAggregation.d.ts +8 -2
  254. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +9 -5
  255. package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +1 -1
  256. package/dist/components/charts/shared/useXYBrush.d.ts +24 -0
  257. package/dist/components/charts/shared/useXYPointStyle.d.ts +2 -0
  258. package/dist/components/charts/xy/BubbleChart.d.ts +7 -0
  259. package/dist/components/charts/xy/CandlestickChart.d.ts +7 -0
  260. package/dist/components/charts/xy/DifferenceChart.d.ts +7 -0
  261. package/dist/components/charts/xy/Heatmap.d.ts +16 -0
  262. package/dist/components/charts/xy/LineChart.d.ts +9 -0
  263. package/dist/components/charts/xy/MinimapChart.d.ts +7 -0
  264. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +7 -0
  265. package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
  266. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +6 -0
  267. package/dist/components/charts/xy/WaterfallChart.capability.d.ts +2 -0
  268. package/dist/components/charts/xy/WaterfallChart.d.ts +76 -0
  269. package/dist/components/charts/xy/differenceMarkStyle.d.ts +28 -0
  270. package/dist/components/charts/xy/multiAxisFields.d.ts +23 -0
  271. package/dist/components/charts/xy/scatterplotMatrixCells.d.ts +50 -0
  272. package/dist/components/evidence/chartEvidenceEnvelope.d.ts +154 -0
  273. package/dist/components/evidence/evidenceEnvelopeInput.d.ts +8 -0
  274. package/dist/components/evidence/evidenceEnvelopeValidation.d.ts +11 -0
  275. package/dist/components/evidence/evidenceGate.d.ts +30 -0
  276. package/dist/components/evidence/renderedSceneHash.d.ts +23 -0
  277. package/dist/components/evidence/stableJsonHash.d.ts +4 -0
  278. package/dist/components/export/chartConfig.d.ts +40 -5
  279. package/dist/components/export/chartConfigArtifact.d.ts +6 -0
  280. package/dist/components/legendLayout.d.ts +18 -0
  281. package/dist/components/legendStyles.d.ts +4 -0
  282. package/dist/components/realtime/BinAccumulator.d.ts +5 -1
  283. package/dist/components/realtime/types.d.ts +16 -7
  284. package/dist/components/recipes/adjacencyFlow.d.ts +12 -0
  285. package/dist/components/recipes/adjacencyFlowAggregation.d.ts +72 -0
  286. package/dist/components/recipes/adjacencyFlowGeometry.d.ts +79 -0
  287. package/dist/components/recipes/firstAvailableTrack.d.ts +17 -0
  288. package/dist/components/recipes/intervals.d.ts +1 -1
  289. package/dist/components/recipes/lineageDag.d.ts +17 -0
  290. package/dist/components/recipes/lineageDagHulls.d.ts +22 -0
  291. package/dist/components/recipes/transitDiagram.d.ts +75 -0
  292. package/dist/components/recipes/transitDiagramGeometry.d.ts +47 -0
  293. package/dist/components/semiotic-access.d.ts +9 -0
  294. package/dist/components/semiotic-ai-audits.d.ts +17 -0
  295. package/dist/components/semiotic-ai-core.d.ts +38 -18
  296. package/dist/components/semiotic-ai.d.ts +20 -20
  297. package/dist/components/semiotic-artifact-react.d.ts +10 -0
  298. package/dist/components/semiotic-artifact.d.ts +23 -0
  299. package/dist/components/semiotic-evidence.d.ts +10 -0
  300. package/dist/components/semiotic-experimental.d.ts +1 -1
  301. package/dist/components/semiotic-line.d.ts +9 -0
  302. package/dist/components/semiotic-network.d.ts +3 -0
  303. package/dist/components/semiotic-ordinal.d.ts +2 -0
  304. package/dist/components/semiotic-physics.d.ts +4 -4
  305. package/dist/components/semiotic-realtime-core.d.ts +3 -2
  306. package/dist/components/semiotic-recipes-core.d.ts +6 -0
  307. package/dist/components/semiotic-text.d.ts +2 -0
  308. package/dist/components/semiotic-themes-core.d.ts +3 -0
  309. package/dist/components/semiotic-utils-core.d.ts +19 -14
  310. package/dist/components/semiotic-xy.d.ts +3 -0
  311. package/dist/components/semiotic.d.ts +11 -5
  312. package/dist/components/server/renderDashboard.d.ts +37 -0
  313. package/dist/components/server/renderEvidence.d.ts +39 -0
  314. package/dist/components/server/renderToStaticSVG.d.ts +5 -30
  315. package/dist/components/server/serverChartConfigShared.d.ts +13 -0
  316. package/dist/components/server/serverChartConfigs.d.ts +9 -0
  317. package/dist/components/server/serverChartConfigsComposite.d.ts +4 -0
  318. package/dist/components/server/serverChartConfigsCustom.d.ts +2 -0
  319. package/dist/components/server/serverChartConfigsGeo.d.ts +1 -0
  320. package/dist/components/server/serverChartConfigsOrdinal.d.ts +3 -2
  321. package/dist/components/server/serverChartConfigsXY.d.ts +1 -0
  322. package/dist/components/server/serverChartConfigsXYExtra.d.ts +3 -0
  323. package/dist/components/server/serverCompositeChainReaction.d.ts +3 -0
  324. package/dist/components/server/serverOrdinalGauge.d.ts +3 -0
  325. package/dist/components/server/serverOrdinalLikert.d.ts +2 -0
  326. package/dist/components/server/staticSVGChrome.d.ts +1 -4
  327. package/dist/components/server/staticXYAxisTicks.d.ts +2 -38
  328. package/dist/components/server/staticXYGrid.d.ts +1 -1
  329. package/dist/components/server/svgSizing.d.ts +6 -0
  330. package/dist/components/shared/svgRoot.d.ts +17 -0
  331. package/dist/components/store/selectionProvenance.d.ts +14 -0
  332. package/dist/components/store/themeCore.d.ts +5 -1
  333. package/dist/components/stream/GeoPipelineStore.d.ts +1 -1
  334. package/dist/components/stream/GeoSVGOverlay.d.ts +4 -0
  335. package/dist/components/stream/MarginalGraphics.d.ts +3 -3
  336. package/dist/components/stream/MarginalGraphicsLazy.d.ts +22 -0
  337. package/dist/components/stream/NetworkPipelineStore.d.ts +2 -0
  338. package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -0
  339. package/dist/components/stream/OrdinalPipelineStore.d.ts +1 -1
  340. package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -0
  341. package/dist/components/stream/PipelineStore.d.ts +1 -1
  342. package/dist/components/stream/SVGOverlay.d.ts +4 -0
  343. package/dist/components/stream/SceneToSVG.d.ts +4 -19
  344. package/dist/components/stream/SceneToSVGXY.d.ts +13 -0
  345. package/dist/components/stream/StreamGeoFrame.d.ts +1 -2
  346. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -2
  347. package/dist/components/stream/XYGrid.d.ts +11 -0
  348. package/dist/components/stream/axisTickUtils.d.ts +0 -1
  349. package/dist/components/stream/canvasSetup.d.ts +8 -2
  350. package/dist/components/stream/customLayoutAttempt.d.ts +21 -0
  351. package/dist/components/stream/geoTypes.d.ts +1 -1
  352. package/dist/components/stream/hitTestUtils.d.ts +2 -0
  353. package/dist/components/stream/isServerEnvironment.d.ts +6 -0
  354. package/dist/components/stream/layouts/forceLayoutNodeSize.d.ts +12 -0
  355. package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +2 -9
  356. package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +2 -21
  357. package/dist/components/stream/layouts/forceLayoutWorkerPolicy.d.ts +21 -0
  358. package/dist/components/stream/layouts/index.d.ts +6 -12
  359. package/dist/components/stream/layouts/missingPlugin.d.ts +7 -0
  360. package/dist/components/stream/layouts/registerBuiltIn.d.ts +1 -0
  361. package/dist/components/stream/layouts/registry.d.ts +12 -0
  362. package/dist/components/stream/marginalConfig.d.ts +3 -0
  363. package/dist/components/stream/networkCustomLayout.d.ts +7 -0
  364. package/dist/components/stream/networkCustomLayoutOutput.d.ts +13 -0
  365. package/dist/components/stream/networkCustomLayoutRunner.d.ts +1 -1
  366. package/dist/components/stream/networkTypes.d.ts +5 -1
  367. package/dist/components/stream/ordinalTypes.d.ts +1 -1
  368. package/dist/components/stream/overlayAccessibleText.d.ts +18 -0
  369. package/dist/components/stream/physics/PhysicsControllers.d.ts +1 -1
  370. package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
  371. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +5 -4
  372. package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +9 -0
  373. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +4 -1
  374. package/dist/components/stream/physics/physicsCanvasCoordinates.d.ts +5 -0
  375. package/dist/components/stream/physics/physicsFixedPosition.d.ts +16 -0
  376. package/dist/components/stream/physics/physicsKernelCloning.d.ts +6 -0
  377. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +2 -0
  378. package/dist/components/stream/physics/physicsPipelineSettle.d.ts +15 -9
  379. package/dist/components/stream/physics/physicsRegionRuntime.d.ts +8 -17
  380. package/dist/components/stream/physics/physicsSemanticUI.d.ts +9 -0
  381. package/dist/components/stream/pipelineConfig.d.ts +4 -0
  382. package/dist/components/stream/pipelineDomainResolution.d.ts +6 -0
  383. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +1 -1
  384. package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +4 -0
  385. package/dist/components/stream/renderers/resolveCSSColor.d.ts +4 -4
  386. package/dist/components/stream/resolveXYAxes.d.ts +13 -0
  387. package/dist/components/stream/sceneToSVGShared.d.ts +2 -1
  388. package/dist/components/stream/seriesGeometry.d.ts +13 -0
  389. package/dist/components/stream/streamEncodingTypes.d.ts +53 -0
  390. package/dist/components/stream/types.d.ts +12 -54
  391. package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +18 -0
  392. package/dist/components/stream/useGeoFrameHandle.d.ts +16 -0
  393. package/dist/components/stream/useMarginalValues.d.ts +13 -0
  394. package/dist/components/stream/useOrdinalFrameHandle.d.ts +15 -0
  395. package/dist/components/stream/useXYFrameHandle.d.ts +15 -0
  396. package/dist/components/stream/xyAxisTicks.d.ts +25 -0
  397. package/dist/components/stream/xyCanvasRenderers.d.ts +4 -4
  398. package/dist/components/stream/xyDateTicks.d.ts +3 -2
  399. package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
  400. package/dist/components/stream/xyPlugins/areaPlugin.d.ts +2 -0
  401. package/dist/components/stream/xyPlugins/barPlugin.d.ts +2 -0
  402. package/dist/components/stream/xyPlugins/candlestickPlugin.d.ts +2 -0
  403. package/dist/components/stream/xyPlugins/customPlugin.d.ts +6 -0
  404. package/dist/components/stream/xyPlugins/heatmapPlugin.d.ts +2 -0
  405. package/dist/components/stream/xyPlugins/lineFamily.d.ts +5 -0
  406. package/dist/components/stream/xyPlugins/linePlugin.d.ts +2 -0
  407. package/dist/components/stream/xyPlugins/missingPlugin.d.ts +7 -0
  408. package/dist/components/stream/xyPlugins/mixedPlugin.d.ts +2 -0
  409. package/dist/components/stream/xyPlugins/pointPlugin.d.ts +3 -0
  410. package/dist/components/stream/xyPlugins/registerBuiltIn.d.ts +1 -0
  411. package/dist/components/stream/xyPlugins/registry.d.ts +31 -0
  412. package/dist/components/stream/xyPlugins/stackedAreaPlugin.d.ts +2 -0
  413. package/dist/components/stream/xyPlugins/swarmPlugin.d.ts +2 -0
  414. package/dist/components/stream/xyPlugins/waterfallPlugin.d.ts +2 -0
  415. package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +1 -1
  416. package/dist/components/stream/xySceneBuilders/types.d.ts +1 -0
  417. package/dist/components/text/annotationTextLayout.d.ts +28 -0
  418. package/dist/components/text/pretextAnnotationLayout.d.ts +29 -0
  419. package/dist/components/text/usePretextAnnotations.d.ts +12 -0
  420. package/dist/controls.module.min.js +1 -1
  421. package/dist/forceLayoutWorker.js +1 -1
  422. package/dist/geo.min.js +1 -1
  423. package/dist/geo.module.min.js +1 -1
  424. package/dist/network.module.min.js +1 -1
  425. package/dist/ordinal.module.min.js +1 -1
  426. package/dist/physics-matter.min.js +1 -1
  427. package/dist/physics-matter.module.min.js +1 -1
  428. package/dist/physics-rapier.min.js +1 -1
  429. package/dist/physics-rapier.module.min.js +1 -1
  430. package/dist/physics.module.min.js +1 -1
  431. package/dist/physicsWorker.js +1 -1
  432. package/dist/processSankeyLayoutWorker.js +1 -1
  433. package/dist/rough.min.js +1 -1
  434. package/dist/rough.module.min.js +1 -1
  435. package/dist/semiotic-access.d.ts +9 -0
  436. package/dist/semiotic-access.min.js +2 -0
  437. package/dist/semiotic-access.module.min.js +2 -0
  438. package/dist/semiotic-ai-artifact-policy-constants.module.min.js +2 -0
  439. package/dist/semiotic-ai-core.d.ts +38 -18
  440. package/dist/semiotic-ai-core.min.js +1 -1
  441. package/dist/semiotic-ai-core.module.min.js +1 -1
  442. package/dist/semiotic-ai-hash-primitives.module.min.js +2 -0
  443. package/dist/semiotic-ai.d.ts +20 -20
  444. package/dist/semiotic-ai.module.min.js +1 -1
  445. package/dist/semiotic-artifact-react.d.ts +10 -0
  446. package/dist/semiotic-artifact-react.min.js +2 -0
  447. package/dist/semiotic-artifact-react.module.min.js +2 -0
  448. package/dist/semiotic-artifact.d.ts +23 -0
  449. package/dist/semiotic-artifact.min.js +1 -0
  450. package/dist/semiotic-artifact.module.min.js +1 -0
  451. package/dist/semiotic-client-cjs-shared.min.js +1 -1
  452. package/dist/semiotic-client-glyph.module.min.js +1 -1
  453. package/dist/semiotic-client-responsive.module.min.js +1 -1
  454. package/dist/semiotic-client-shared.module.min.js +1 -1
  455. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +1 -1
  456. package/dist/semiotic-data.min.js +1 -1
  457. package/dist/semiotic-data.module.min.js +1 -1
  458. package/dist/semiotic-evidence.d.ts +10 -0
  459. package/dist/semiotic-evidence.min.js +1 -0
  460. package/dist/semiotic-evidence.module.min.js +1 -0
  461. package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
  462. package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
  463. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  464. package/dist/semiotic-experimental-vacp.min.js +1 -1
  465. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  466. package/dist/semiotic-experimental.d.ts +1 -1
  467. package/dist/semiotic-line.d.ts +9 -0
  468. package/dist/semiotic-line.min.js +2 -0
  469. package/dist/semiotic-line.module.min.js +2 -0
  470. package/dist/semiotic-network.d.ts +3 -0
  471. package/dist/semiotic-ordinal.d.ts +2 -0
  472. package/dist/semiotic-physics.d.ts +4 -4
  473. package/dist/semiotic-realtime-core.d.ts +3 -2
  474. package/dist/semiotic-realtime-core.module.min.js +1 -1
  475. package/dist/semiotic-realtime-react.module.min.js +1 -1
  476. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  477. package/dist/semiotic-recipes-core.d.ts +6 -0
  478. package/dist/semiotic-recipes-core.module.min.js +1 -1
  479. package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
  480. package/dist/semiotic-recipes-react.min.js +1 -1
  481. package/dist/semiotic-server-edge-node.module.min.js +1 -1
  482. package/dist/semiotic-server-edge.min.js +1 -1
  483. package/dist/semiotic-server-edge.module.min.js +1 -1
  484. package/dist/semiotic-server-node.min.js +1 -1
  485. package/dist/semiotic-server-node.module.min.js +1 -1
  486. package/dist/semiotic-text.d.ts +2 -0
  487. package/dist/semiotic-text.min.js +2 -0
  488. package/dist/semiotic-text.module.min.js +2 -0
  489. package/dist/semiotic-themes-core.d.ts +3 -0
  490. package/dist/semiotic-themes-core.min.js +1 -1
  491. package/dist/semiotic-themes-core.module.min.js +1 -1
  492. package/dist/semiotic-themes.min.js +1 -1
  493. package/dist/semiotic-themes.module.min.js +1 -1
  494. package/dist/semiotic-utils-core.d.ts +19 -14
  495. package/dist/semiotic-utils-core.min.js +1 -1
  496. package/dist/semiotic-utils-core.module.min.js +1 -1
  497. package/dist/semiotic-value.module.min.js +1 -1
  498. package/dist/semiotic-xy.d.ts +3 -0
  499. package/dist/semiotic.d.ts +11 -5
  500. package/dist/semiotic.module.min.js +1 -1
  501. package/dist/server.min.js +1 -1
  502. package/dist/server.module.min.js +1 -1
  503. package/dist/xy.module.min.js +1 -1
  504. package/package.json +91 -71
  505. package/spec/README.md +8 -3
  506. package/spec/v0.1/artifact-contract.schema.json +2299 -0
  507. package/spec/v0.1/examples/artifact-contract-full.json +369 -0
  508. package/spec/v0.1/examples/artifact-contract-unknown-state.json +46 -0
  509. package/dist/c-3BLJEQNG.min.js +0 -1
  510. package/dist/c-3KZD6AXJ.min.js +0 -1
  511. package/dist/c-4TWEX5HG.min.js +0 -1
  512. package/dist/c-52TEGIUJ.min.js +0 -1
  513. package/dist/c-5YCIX3VZ.min.js +0 -1
  514. package/dist/c-6FEKTA3U.min.js +0 -1
  515. package/dist/c-6O5EVOPH.min.js +0 -1
  516. package/dist/c-74HEEZGK.min.js +0 -1
  517. package/dist/c-AKAF6JAD.min.js +0 -1
  518. package/dist/c-BBKITSXB.min.js +0 -1
  519. package/dist/c-BWNB6USU.min.js +0 -1
  520. package/dist/c-C25ENHIK.min.js +0 -1
  521. package/dist/c-CDR5AO3R.min.js +0 -1
  522. package/dist/c-COHXCW3Q.min.js +0 -1
  523. package/dist/c-DADXPJXV.min.js +0 -1
  524. package/dist/c-E3JFRRMI.min.js +0 -1
  525. package/dist/c-EBFPQHHO.min.js +0 -1
  526. package/dist/c-G36WS6LN.min.js +0 -1
  527. package/dist/c-GGISSW5E.min.js +0 -1
  528. package/dist/c-GIKRQI4X.min.js +0 -1
  529. package/dist/c-GPYOFETM.min.js +0 -1
  530. package/dist/c-IDUHYYSI.min.js +0 -1
  531. package/dist/c-IUHFPMHD.min.js +0 -1
  532. package/dist/c-J5G56TUH.min.js +0 -1
  533. package/dist/c-JAZ73J32.min.js +0 -1
  534. package/dist/c-KG3NXHAL.min.js +0 -1
  535. package/dist/c-KII3PLZE.min.js +0 -1
  536. package/dist/c-LIXGXMNS.min.js +0 -1
  537. package/dist/c-LVEY6D6B.min.js +0 -1
  538. package/dist/c-M4Y3BHFR.min.js +0 -1
  539. package/dist/c-MAIICR2Z.min.js +0 -1
  540. package/dist/c-MG5DM6VE.min.js +0 -1
  541. package/dist/c-MNF2S4AA.min.js +0 -1
  542. package/dist/c-MT3WBK7M.min.js +0 -1
  543. package/dist/c-NY3JWV2K.min.js +0 -1
  544. package/dist/c-O6U6K4CW.min.js +0 -1
  545. package/dist/c-OQ7M4AGV.min.js +0 -1
  546. package/dist/c-OXYMVK7Q.min.js +0 -1
  547. package/dist/c-PPWDL5ZI.min.js +0 -1
  548. package/dist/c-QHF5YON3.min.js +0 -1
  549. package/dist/c-RR3GO5SW.min.js +0 -1
  550. package/dist/c-RSVIHIQ4.min.js +0 -1
  551. package/dist/c-S2BXNNJN.min.js +0 -1
  552. package/dist/c-S6U5CGT5.min.js +0 -1
  553. package/dist/c-SLGMUBUL.min.js +0 -1
  554. package/dist/c-SUILCHWU.min.js +0 -1
  555. package/dist/c-TZW3JGJ5.min.js +0 -1
  556. package/dist/c-US5ZFT6E.min.js +0 -1
  557. package/dist/c-USFMFKIH.min.js +0 -1
  558. package/dist/c-UUKVD4WB.min.js +0 -1
  559. package/dist/c-VGW3VG3I.min.js +0 -1
  560. package/dist/c-W3CE4A4S.min.js +0 -1
  561. package/dist/c-WJCD5EUY.min.js +0 -1
  562. package/dist/c-X5UBGU2V.min.js +0 -1
  563. package/dist/c-YDAY2WFR.min.js +0 -1
  564. package/dist/c-ZOWWU34K.min.js +0 -1
  565. /package/dist/{c-N4G2L7ID.min.js → c-HYW2XA4Q.min.js} +0 -0
  566. /package/dist/{c-OCI56QF2.min.js → c-V4XMSLC3.min.js} +0 -0
@@ -0,0 +1 @@
1
+ function e(e,t=":root"){return`${t} {\n${Object.entries(w(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function t(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 a(e){return"string"==typeof e.value&&("color"===e.type||function(e){let t=e.trim();return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(t)||z.test(t)||/^hsla?\(/i.test(t)}(e.value))}function o(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)?e.join(", "):"string"==typeof e?e:void 0}function r(e){if("number"==typeof e&&Number.isFinite(e))return e;if("string"!=typeof e)return;let t=e.trim().match(/^(-?(?:\d+|\d*\.\d+))px$/);return t?Number(t[1]):void 0}function i(e){return"string"==typeof e||"number"==typeof e&&Number.isFinite(e)?e:void 0}function l(e,t={}){let l=function(e){let t=new Map(e.map(e=>[e.path,e])),a=(e,o)=>{if(o>8||"string"!=typeof e)return e;let r=e.match(F);if(!r)return e;let i=t.get(r[1]);return i?a(i.value,o+1):e};return e.map(e=>({...e,value:a(e.value,0)}))}(function(e){let t=[],a=(e,o,r)=>{if(!e||"object"!=typeof e)return;let i=e,l=i.$type??r;if(function(e){return!!e&&"object"==typeof e&&"$value"in e}(i))t.push({path:o.join("."),leaf:o[o.length-1]??"",value:i.$value,type:i.$type??r});else for(let[e,t]of Object.entries(i))e.startsWith("$")||a(t,[...o,e],l)};return a(e,[]),t}(e)),n=new Map(l.map(e=>[e.path,e])),s=new Set,c={};for(let[e,a]of Object.entries(t.mapping??{})){if("fontFamily"===e||"categorical"===e)continue;let t=a?n.get(a):void 0;t&&"string"==typeof t.value&&(c[e]=t.value,s.add(t.path))}for(let e of l){let t=e.path.match(/^semiotic\.([^.]+)$/),a=t?R[t[1]]:void 0;a&&!(a in c)&&"string"==typeof e.value&&(c[a]=e.value,s.add(e.path))}for(let[e,t]of j){if(e in c)continue;let o=l.find(e=>!s.has(e.path)&&a(e)&&t.test(e.leaf.toLowerCase()));o&&"string"==typeof o.value&&(c[e]=o.value,s.add(o.path))}let u,f=t.mapping?.categorical,m=(f?n.get(f):void 0)??n.get("semiotic.categorical")??l.find(e=>Array.isArray(e.value)&&/categor|chart|palette|qualitative|series/i.test(e.path));if(m&&Array.isArray(m.value))u=m.value.filter(e=>"string"==typeof e);else{let e=l.filter(e=>a(e)&&/(^|\.)(categorical|chart|palette|qualitative|series)\b/i.test(e.path));e.length>=2&&(u=e.map(e=>e.value))}let p=(t.mapping?.fontFamily?n.get(t.mapping.fontFamily):void 0)??n.get("semiotic.font-family")??l.find(e=>("fontFamily"===e.type||/font-?family|typeface/i.test(e.leaf))&&("string"==typeof e.value||Array.isArray(e.value))),h=p?o(p.value):void 0,y=r(n.get("semiotic.legend-font-size")?.value),d=o(n.get("semiotic.legend-font-family")?.value),g=i(n.get("semiotic.legend-font-weight")?.value),b=r(n.get("semiotic.title-font-size")?.value),v=o(n.get("semiotic.title-font-family")?.value),$=i(n.get("semiotic.title-font-weight")?.value),x=o(n.get("semiotic.tick-font-family")?.value),S=r(n.get("semiotic.tick-font-size")?.value),k=r(n.get("semiotic.axis-label-font-size")?.value),w={},A={},N={};for(let e of l){let t=e.path.match(/^semiotic\.aesthetics\.weights\.(.+)$/);t&&"number"==typeof e.value&&Number.isFinite(e.value)&&(w[t[1]]=e.value);let a=e.path.match(/^semiotic\.aesthetics\.thresholds\.(.+)$/);a&&"number"==typeof e.value&&Number.isFinite(e.value)&&(A[a[1]]=e.value);let o=e.path.match(/^semiotic\.aesthetics\.rationales\.(.+)$/);o&&"string"==typeof e.value&&(N[o[1]]=e.value)}let O=n.get("semiotic.aesthetics.profile")?.value,I=n.get("semiotic.aesthetics.minimum-score")?.value,P="string"==typeof O||"number"==typeof I||Object.keys(w).length>0||Object.keys(A).length>0||Object.keys(N).length>0?{..."string"==typeof O?{name:O}:{},..."number"==typeof I?{minimumScore:I}:{},...Object.keys(w).length>0?{weights:w}:{},...Object.keys(A).length>0?{thresholds:A}:{},...Object.keys(N).length>0?{rationales:N}:{}}:void 0,L=function(e){if("string"!=typeof e)return null;let t=e.trim(),a=t.replace(/^#/,"");if(3===a.length&&(a=a.split("").map(e=>e+e).join("")),/^[0-9a-f]{6}$/i.test(a))return parseInt(a.slice(0,2),16)/255*.2126+parseInt(a.slice(2,4),16)/255*.7152+parseInt(a.slice(4,6),16)/255*.0722;let o=t.match(z);if(o){let e=Number(o[1])/255,t=Number(o[2])/255,a=Number(o[3])/255;return[e,t,a].some(e=>Number.isNaN(e)||0>e||e>1)?null:.2126*e+.7152*t+.0722*a}return null}(c.background),D=t.base?.mode??(null!=L?.5>L?"dark":"light":C.mode),W=t.base??("dark"===D?M:C);return{...W,mode:D,colors:{...W.colors,...c,...u&&u.length>0?{categorical:u}:{}},typography:{...W.typography,...h?{fontFamily:h}:{},...null!=y?{legendSize:y}:{},...null!=d?{legendFontFamily:d}:{},...null!=g?{legendFontWeight:g}:{},...null!=b?{titleFontSize:b}:{},...null!=v?{titleFontFamily:v}:{},...null!=$?{titleFontWeight:$}:{},...null!=x?{tickFontFamily:x}:{},...null!=S?{tickSize:S}:{},...null!=k?{labelSize:k}:{}},...P?{aesthetics:P}:{}}}function n(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));let a=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!a)return null;let[o,r,i]=[parseInt(a[1],16)/255,parseInt(a[2],16)/255,parseInt(a[3],16)/255],l=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*l(o)+.7152*l(r)+.0722*l(i)}function s(e,t){let a=n(e),o=n(t);return null===a||null===o?null:(Math.max(a,o)+.05)/(Math.min(a,o)+.05)}function c(e){return Math.min(255,Math.max(0,Math.round(e)))}function u(e){if("string"!=typeof e)return null;let t=e.trim().toLowerCase(),a=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(a){let 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}}let o=t.match(/^rgba?\(\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))(?:\s*,\s*(-?(?:\d+|\d*\.\d+)))?\s*\)$/);if(!o)return null;let r=[Number(o[1]),Number(o[2]),Number(o[3])],i=void 0===o[4]?1:Number(o[4]);return r.some(e=>!Number.isFinite(e)||0>e||e>255)||!Number.isFinite(i)||0>i||i>1?null:{r:r[0],g:r[1],b:r[2],a:i}}function f(e,t){return 1>t.a?null:{r:c(e.r*e.a+t.r*(1-e.a)),g:c(e.g*e.a+t.g*(1-e.a)),b:c(e.b*e.a+t.b*(1-e.a)),a:1}}function m(e){return 1>e.a?null:"#"+[e.r,e.g,e.b].map(e=>c(e).toString(16).padStart(2,"0")).join("")}function p(e,t,a){let o=u(e),r=u(t);if(!o||!r)return null;let i=f({...o,a:o.a*Math.min(1,Math.max(0,a))},r);return i?m(i):null}function h(e){return Math.min(1,Math.max(0,e))}function y(e,t){return Number.isFinite(e)?e:t}function d(e){return function(e){if("string"!=typeof e||""===e.trim())return;let t=u(e);return t?m(t)??`rgba(${c(t.r)},${c(t.g)},${c(t.b)},${t.a})`:e.trim().toLowerCase()}(e)}function g(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map(d).filter(e=>!!e)}function b(e){return Array.isArray(e)||e&&"object"==typeof e?g(e):[]}function v(e){return e.length>=4&&L.some(t=>e.length===t.length&&e.every((e,a)=>e===t[a]))}function $(e,t){let 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 x(e,t){if(!e.evidence)return.5;let{weakestDataContrast:a,scaffoldContrast:o,hierarchyRatio:r}=e.evidence;return Math.min(h(a/3),h(o/t.scaffoldContrastMin),h(t.scaffoldContrastMax/o),h(r/t.hierarchyRatio))}function S(e,t,a,o,r,i,l){let n=a[e];return{id:e,label:q[e],status:0===n?"disabled":l??(.8>t?"warn":"pass"),score:t,weight:n,contribution:t*n,message:o,...i?.[e]?{rationale:i[e]}:{},evidence:r}}function k(e,t,a={}){let o=a.theme??C,r=a.profile??o.aesthetics??I,i={...N,...r.weights??{}};for(let e of Object.keys(i)){let t=i[e];i[e]=Number.isFinite(t)?Math.max(0,t):0}let l=function(e){let t=e.thresholds??{},a=Math.max(1,y(t.scaffoldContrastMin,O.scaffoldContrastMin)),o=h(y(t.emphasisRatioMin,O.emphasisRatioMin));return{hierarchyRatio:Math.max(1,y(t.hierarchyRatio,O.hierarchyRatio)),scaffoldContrastMin:a,scaffoldContrastMax:Math.max(a,y(t.scaffoldContrastMax,O.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,y(t.titleScaleRatio,O.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round(y(t.categoricalColorMax,O.categoricalColorMax))),emphasisRatioMin:o,emphasisRatioMax:Math.max(o,h(y(t.emphasisRatioMax,O.emphasisRatioMax)))}}(r),n=function(e,t,a){let o=b(t.colorScheme),r=g(t.color),i=$(t,t.colorBy),l=W.has(e)?$(t,t.categoryAccessor??"category"):[],n=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,s=(e,t)=>e.map((e,o)=>d(n?.[e])??("gray"===t?"#999999":a.colors.categorical.length>0?a.colors.categorical[o%a.colors.categorical.length]:"#007bff")),c=i.length>0?n?s(i,"gray"):o.length>0?o:a.colors.categorical:r.length>0?r:l.length>0&&n?s(l,"theme"):o.length>0&&!n?o:a.colors.categorical,u=c.slice(0,i.length>0||l.length>0?Math.min(c.length,Math.max(1,i.length||l.length||1)):1),f=function(e){let t=Array.isArray(e.data)?e.data:[],a=Array.isArray(e.styleRules)?e.styleRules:[],o="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",r="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",i=[];for(let e of a)!e.style||"function"==typeof e.style||t.some((t,a)=>A(e,t,{value:Number(t[o]),category:(t[r]??"")+"",index:a}))&&i.push(...g(e.style.fill));return Array.from(new Set(i))}(t).filter(e=>!u.includes(e));return Array.from(new Set([...u,...f]))}(e,t,o),c=function(e){let t=e.colors.surface??e.colors.background,a=u(t),o=u(e.colors.background);if(!a)return t;if(1===a.a)return m(a)??t;if(!o)return t;let r=f(a,o);return r?m(r)??t:t}(o),k=function(e){let t=u(e.backgroundColor),a=t?m(t):null,o=p(e.scaffoldColor,e.backgroundColor,e.scaffoldOpacity??1),r=o&&a?s(o,a):null,i=e.dataColors.map(t=>p(t,e.backgroundColor,1)).map(e=>e&&a?s(e,a):null).filter(e=>null!==e);if(null===r||i.length!==e.dataColors.length||0===i.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."}};let l=Math.min(...i),n=l/r,c={weakestDataContrast:l,scaffoldContrast:r,hierarchyRatio:n},f=Math.max(1,e.minimumScaffoldContrast??1.1);return f>r?{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>l||r>Math.max(f,e.maximumScaffoldContrast??2)||Math.max(1,e.minimumHierarchyRatio??2)>n?{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."}}}({backgroundColor:c,dataColors:n,scaffoldColor:o.colors.grid,minimumHierarchyRatio:l.hierarchyRatio,minimumScaffoldContrast:l.scaffoldContrastMin,maximumScaffoldContrast:l.scaffoldContrastMax}),M=function(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,a=[...b(e.colorScheme),...g(e.color),...g(e.fill),...g(e.stroke),...g(t?.fill),...g(t?.stroke)],o=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of o)!e.style||"function"==typeof e.style||a.push(...g(e.style.fill),...g(e.style.stroke));return Array.from(new Set(a))}(t),w=v(o.colors.categorical.map(d).filter(e=>!!e)),F=function(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,a=[...b(e.colorScheme),...g(e.color),...g(e.fill),...g(t?.fill)],o=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of o)!e.style||"function"==typeof e.style||a.push(...g(e.style.fill));return Array.from(new Set(a))}(t),R="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,j=F.length>0||R?"chart":"theme",z="chart"===j?v(F)||!!R&&D.has(R):w,P=z?.2:"chart"===j?1:.8,L=function(e){return Math.max(1,e.length)}(n),q=L>l.categoricalColorMax?h(1-(L-l.categoricalColorMax)/l.categoricalColorMax):1,T=o.typography.titleFontSize??o.typography.titleSize,E=Math.max(o.typography.tickSize,o.typography.labelSize),_=E>0?T/E:1,H=h((_-1)/(l.titleScaleRatio-1)),U=new Set([...o.colors.categorical,o.colors.primary,o.colors.secondary,o.colors.background,o.colors.surface,o.colors.text,o.colors.textSecondary,o.colors.grid,o.colors.border,o.colors.annotation].map(d).filter(e=>!!e)),V=M.filter(e=>!U.has(e)).length,Y=0===M.length?1:h(1-V/M.length),B=function(e){let 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};let o="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",r="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>a.some(a=>A(a,e,{value:Number(e[o]),category:(e[r]??"")+"",index:t}))).length/t.length,authored:!0}}(t),J=B.authored?l.emphasisRatioMin>B.ratio?h(B.ratio/l.emphasisRatioMin):B.ratio>l.emphasisRatioMax?h(l.emphasisRatioMax/B.ratio):1:.35,Q=[S("mark-scaffold-hierarchy",x(k,l),i,k.finding.message,{hierarchyRatio:k.evidence?.hierarchyRatio??0,markContrast:k.evidence?.weakestDataContrast??0,scaffoldContrast:k.evidence?.scaffoldContrast??0},r.rationales,k.status),S("palette-authorship",P,i,z?"theme"===j?"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:j,ubiquitousDefault:z,colorCount:n.length},r.rationales),S("palette-economy",q,i,`${L} color role(s) are used against a policy ceiling of ${l.categoricalColorMax}.`,{colorRoles:L,maximum:l.categoricalColorMax},r.rationales),S("typographic-hierarchy",H,i,`Title-to-supporting-type scale is ${_.toFixed(2)}×.`,{titleSize:T,supportingSize:E,ratio:_},r.rationales),S("theme-coherence",Y,i,`${V} of ${M.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:M.length,outsideTheme:V},r.rationales),S("editorial-emphasis",J,i,B.authored?Math.round(100*B.ratio)+"% of marks receive authored emphasis.":"No machine-visible editorial emphasis rule is declared.",{authored:B.authored,emphasizedRatio:B.ratio},r.rationales)],X=Q.reduce((e,t)=>e+t.weight,0),G=Q.reduce((e,t)=>e+t.contribution,0),K=0===X?null:G/X*100,Z=100*h(y(r.minimumScore,I.minimumScore??70)/100);return{component:e,profile:r.name??"Unnamed aesthetic profile",ok:null===K||K>=Z,score:K,minimumScore:Z,weightedPoints:G,totalWeight:X,features:Q,method:"weighted-machine-visible-features"}}import{DARK_THEME as M,LIGHT_THEME as C,themeToCSSVariables as w}from"./c-42PLDTX7.min.js";import{ruleMatches as A}from"./c-I4QJ6YLM.min.js";var F=/^\{([^}]+)\}$/,R={bg:"background",text:"text","text-secondary":"textSecondary",grid:"grid",border:"border",primary:"primary",focus:"focus",secondary:"secondary",surface:"surface",annotation:"annotation",success:"success",danger:"danger",warning:"warning",error:"error",info:"info"},j=[["textSecondary",/^(text-?secondary|secondary-?text|muted|subtle|text-?muted|fg-?muted)$/],["text",/^(text|foreground|fg|ink|on-?background|on-?surface|text-?default|fg-?default)$/],["background",/^(background|bg|canvas|base|page|backdrop|bg-?default)$/],["surface",/^(surface|card|elevated|panel|sheet)$/],["border",/^(border|divider|outline|stroke|hairline)$/],["grid",/^(grid|gridline|gridlines)$/],["primary",/^(primary|brand|accent|brand-?primary)$/],["secondary",/^(secondary|brand-?secondary)$/],["focus",/^(focus|ring|focus-?ring)$/],["error",/^(error|critical)$/],["danger",/^(danger|negative|destructive|fail|alert)$/],["success",/^(success|positive|ok|good|pass)$/],["warning",/^(warning|warn|caution)$/],["info",/^(info|information|note)$/],["annotation",/^(annotation|callout)$/]],z=/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*[\d.]+)?\s*\)$/i,N=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),O=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),I=Object.freeze({name:"Semiotic balanced",weights:N,thresholds:O,minimumScore:70}),P=Object.freeze({name:"Aesthetics off",weights:Object.freeze(Object.fromEntries(Object.keys(N).map(e=>[e,0]))),minimumScore:0}),L=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],D=new Set(["category10","tableau10"]),W=new Set(["DonutChart","PieChart","SwimlaneChart"]),q={"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"};export{e as themeToCSS,t as themeToTokens,l as designTokensToTheme,N as DEFAULT_AESTHETIC_WEIGHTS,O as DEFAULT_AESTHETIC_THRESHOLDS,I as DEFAULT_AESTHETIC_PROFILE,P as AESTHETICS_OFF_PROFILE,k as evaluateAesthetics};
@@ -0,0 +1 @@
1
+ function t(t){return null==t?void 0:t+""}function e(e){let r=t(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??8,style:{...s,cursor:e.cursor},datum:e.datum,pointId:r,_transitionKey:r}}function r(t){return e(t)}function i(t){let[[e,r],[i,a]]=t.bounds;return{type:"geoarea",pathData:t.pathData,centroid:t.centroid,bounds:t.bounds,screenArea:t.screenArea??Math.abs((i-e)*(a-r)),style:{...s,cursor:t.cursor},datum:t.datum,group:t.group,interactive:!0}}function a(e){return{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...s,cursor:e.cursor},datum:e.datum,group:e.group,_transitionKey:t(e.id)}}function c(e){let r=t(e.id);return"width"in e&&"height"in e?{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...s,cursor:e.cursor},datum:e.datum,id:r,label:e.label,accessibleDatum:e.accessibleDatum,accessibility:e.accessibility}:{type:"circle",cx:e.x,cy:e.y,r:e.r??8,style:{...s,cursor:e.cursor},datum:e.datum,id:r,label:e.label,accessibleDatum:e.accessibleDatum,accessibility:e.accessibility}}function u(e){let r={style:{...s,cursor:e.cursor},datum:e.datum,id:t(e.id),label:e.label,accessibleDatum:e.accessibleDatum,accessibility:e.accessibility,interactive:e.interactive??!0};return"pathD"in e?{type:e.type??"curved",pathD:e.pathD,...r}:{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,...r}}var s={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},n=8;export{n as DEFAULT_HIT_RADIUS,e as hitTargetPoint,r as geoHitTarget,i as geoAreaHitTarget,a as hitTargetRect,c as networkHitTarget,u as networkEdgeHitTarget};
@@ -0,0 +1 @@
1
+ function t({width:t,height:i,margin:s,scales:c,brushDirection:a,extent:f,onBrush:h}){let m=e(null),p=e(null),b=e(!1),x=t+s.left+s.right,d=i+s.top+s.bottom;return r(()=>{if(!m.current||!c)return;let e=u(m.current).select(".brush-group"),r="x"===a?l().extent([[0,0],[t,i]]):n().extent([[0,0],[t,i]]);return r.on("brush end",t=>{if(b.current||!t.sourceEvent)return;let e=t.selection;if(!e)return void h(null);let r=("x"===a?c.x:c.y).invert;if(!r)return;let l=[r(e[0]),r(e[1])];h(l)}),e.call(r),p.current=t=>{e.call(r.move,t)},e.select(".selection").attr("fill","steelblue").attr("fill-opacity",.2).attr("stroke","steelblue").attr("stroke-width",1),()=>{p.current=null,r.on("brush end",null)}},[c,t,i,a,h]),r(()=>{if(!p.current||!c||!m.current)return;let t="x"===a?c.x:c.y;if(b.current=!0,f){let e=[t(f[0]),t(f[1])];p.current(e)}else p.current(null);b.current=!1},[f,c,a]),o("svg",{ref:m,width:x,height:d,style:{position:"absolute",top:0,left:0,pointerEvents:"all"},children:o("g",{className:"brush-group",transform:`translate(${s.left},${s.top})`})})}import{useRef as e,useEffect as r}from"react";import{brushX as l,brushY as n}from"d3-brush";import{select as u}from"d3-selection";import{jsx as o}from"react/jsx-runtime";export{t as MinimapBrushOverlay};
@@ -0,0 +1 @@
1
+ function t(t,l,i,y,n,f){if(0>=l.size)return;let p=function(t,l,o){try{if(o)return e(o);let r=`${t??"circle"}:${l}`,i=s.get(r);return i||(i=new Path2D(a(t,l)),s.size>256&&s.clear(),s.set(r,i)),i}catch{return null}}(l.symbolType,l.size,l.path);if(!p)return;t.save(),t.translate(i,y),l.rotation&&t.rotate(l.rotation);let c=(l.style.opacity??1)*(l._decayOpacity??1);l.style.fill&&(t.globalAlpha=n*c*(l.style.fillOpacity??1),t.fillStyle=r(t,l.style.fill,f),t.fill(p)),l.style.stroke&&"none"!==l.style.stroke&&(t.globalAlpha=n*c,t.strokeStyle=o(t,l.style.stroke)||l.style.stroke,t.lineWidth=l.style.strokeWidth??1,t.stroke(p)),t.restore()}function l(l,e){let o=l.globalAlpha;for(let r of e)"symbol"===r.type&&t(l,r,r.cx,r.cy,o,"#007bff");l.globalAlpha=o}import{getGlyphPath2D as e,resolveCSSColor as o,resolveCanvasFill as r,symbolPathString as a}from"./c-553QUDKA.min.js";var s=new Map,i=(l,e)=>{let o=l.globalAlpha;for(let r of e)"symbol"===r.type&&t(l,r,r.x,r.y,o,"#4e79a7");l.globalAlpha=o};export{i as symbolCanvasRenderer,l as networkSymbolRenderer};
@@ -0,0 +1 @@
1
+ function t(t){if(null==t)return()=>{};let e="function"==typeof t?t:e=>e[t];return t=>n(e(t))}function e(e,i){let n=t(e),r=t(i);return(t,e)=>{let i=r(t);return{value:i,x:n(t),y:i,category:e}}}function i(e,i){let n=t(i??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return t=>{let e=r?r(t):void 0;return{value:n(t),category:null==e?void 0:e+""}}}function n(t){if("number"==typeof t)return Number.isFinite(t)?t:void 0;if("string"==typeof t&&""!==t.trim()){let e=Number(t);return Number.isFinite(e)?e:void 0}}function r(t,e,i){let r=t.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(e,i):function(t,e,i){let r=null!=t.axis?i[t.axis]:null!=t.field?e[t.field]:i.value;if(void 0!==t.eq&&r!==t.eq||void 0!==t.ne&&r===t.ne||void 0!==t.in&&!t.in.includes(r))return!1;if(void 0===t.gt&&void 0===t.gte&&void 0===t.lt&&void 0===t.lte&&void 0===t.within&&void 0===t.outside)return!0;let u=n(r);if(void 0===u||void 0!==t.gt&&t.gt>=u||void 0!==t.gte&&t.gte>u||void 0!==t.lt&&u>=t.lt||void 0!==t.lte&&u>t.lte)return!1;if(void 0!==t.within){let[e,i]=t.within;if(e>u||u>i)return!1}if(void 0!==t.outside){let[e,i]=t.outside;if(u>=e&&i>=u)return!1}return!0}(r,e,i))}function u(t,e,i){if(!e||0===e.length)return{};let n={};for(let u of e){if(!r(u,t,i))continue;let e="function"==typeof u.style?u.style(t,i):u.style;e&&(n={...n,...e})}return n}function o(t,e,i,n=t=>t){let r=t??(()=>({}));return e&&0!==e.length?(t,o)=>{let l=n(t),f={...r(t,o)};return Object.assign(f,u(l,e,i(l,o))),f}:r}function l(t,e,n,r){if(!t||0===t.length)return r;let o=i(e,n);return(e,i)=>{let n=e&&e.data||e,l=u(n,t,o(n)),f=r?r(e,i):void 0;return f?{...l,...f}:l}}export{t as makeRuleValueResolver,e as makeXYRuleContext,i as makeNodeRuleContext,r as ruleMatches,u as resolveStyleRules,o as composeStyleRules,l as styleRulesToNodeStyle};
@@ -0,0 +1 @@
1
+ function e(e,t){let a=e.length,s=t.length,r=Array(s+1);for(let e=0;s>=e;e++)r[e]=e;for(let o=1;a>=o;o++){let a=r[0];r[0]=o;for(let i=1;s>=i;i++){let s=r[i];r[i]=e[o-1]===t[i-1]?a:1+Math.min(a,r[i],r[i-1]),a=s}}return r[s]}function t(t,a,s=3){let r,o=s+1;for(let s of a){let a=e(t.toLowerCase(),s.toLowerCase());o>a&&(o=a,r=s)}return o>s?void 0:r}function a(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:[...e]}function s(e,a){if(0===a.length)return null;let s=e.toLowerCase();return a.find(e=>e.toLowerCase().includes(s)||s.includes(e.toLowerCase()))||(t(e,a,3)??null)}function r(e){return` Or use a function: ${e}={d => d.myValue}.`}function o(e){let[t,a]=Array.isArray(e)?e:[e,void 0],s=v[t],r=Array.isArray(s)?[...s]:s;return void 0===a?{type:r}:{type:r,enum:[...x[a]]}}function i(e,t){return(Array.isArray(t)?t:[t]).includes(Array.isArray(e)?"array":typeof e)}function n(e,o){let n=[];(null==o||"object"!=typeof o)&&(o={});let c=w[e];if(!c)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(w).join(", ")}`]};for(let t of c.required)null==o[t]&&n.push(`"${t}" is required for ${e}.`);"array"===c.dataShape&&Object.prototype.hasOwnProperty.call(c.props,"data")&&!c.required.includes("data")&&!function(e,t){return"mechanical"===t.mode&&("GaltonBoardChart"===e||"UnitPileChart"===e)}(e,o)&&null==o.data&&n.push(`"data" is required for ${e}.`);for(let[e,t]of Object.entries(o)){if(null==t)continue;let a=c.props[e];if(a){if(!i(t,a.type)){let s=Array.isArray(a.type)?a.type.join(" | "):a.type;n.push(`"${e}" should be ${s}, got ${Array.isArray(t)?"array":typeof t}.`);continue}a.enum&&"string"==typeof t&&!a.enum.includes(t)&&n.push(`"${e}" value "${t}" is not valid. Expected one of: ${a.enum.join(", ")}.`)}}let l=Object.keys(c.props),d=new Set(l);for(let a of Object.keys(o))if(void 0!==o[a]&&!d.has(a)){let s=t(a,l),r=s?`Unknown prop "${a}" for ${e}. Did you mean "${s}"?`:`Unknown prop "${a}" for ${e}. Valid props: ${l.join(", ")}.`;n.push(r)}if("array"===c.dataShape){let t=o.data,i={};for(let e of c.dataAccessors){let t=o[e];"string"==typeof t&&(i[e]=t)}let l=function({componentName:e,data:t,accessors:o,requiredProps:i}){if(i)for(let[t,a]of Object.entries(i))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(o){let i=a(t).find(e=>e&&"object"==typeof e);if(i){let t=Object.keys(i);for(let[a,n]of Object.entries(o))if(n&&"string"==typeof n&&!(n in i)){let o=s(n,t),i=o?` Try ${a}="${o}".`:"";return`${e}: ${a} "${n}" not found in data. Available fields: ${t.join(", ")}.${i}`+r(a)}}}return null}({componentName:e,data:t,accessors:Object.keys(i).length>0?i:void 0});l&&n.push(l)}else if("object"===c.dataShape){let t=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:o.data});t&&n.push(t)}else if("network"===c.dataShape){let t=o.nodeIdAccessor??o.nodeIDAccessor??"id",i="string"==typeof t?{nodeIdAccessor:t}:void 0,l=function({componentName:e,nodes:t,edges:o,nodesRequired:i=!1,edgesRequired:n=!0,accessors:c}){if(null==t&&null==o)return null;if(n&&(!o||!Array.isArray(o)||0===o.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(i&&(!t||!Array.isArray(t)||0===t.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(c&&t&&t.length>0){let o=a(t).find(e=>e&&"object"==typeof e);if(o){let t=Object.keys(o);for(let[a,i]of Object.entries(c))if(i&&"string"==typeof i&&!(i in o)){let o=s(i,t),n=o?` Try ${a}="${o}".`:"";return`${e}: ${a} "${i}" not found in node data. Available fields: ${t.join(", ")}.${n}`+r(a)}}}return null}({componentName:e,nodes:o.nodes,edges:o.edges,nodesRequired:c.required.includes("nodes"),edgesRequired:c.required.includes("edges"),accessors:i});l&&n.push(l)}return"GaugeChart"===e&&n.push(...function(e){if(!Array.isArray(e.thresholds))return[];let 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".`);let s=e;("number"!=typeof s.value||!Number.isFinite(s.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 s.color||0===s.color.length)&&t.push(`"thresholds[${a}].color" is required for GaugeChart and must be a non-empty string.`),void 0!==s.label&&"string"!=typeof s.label&&t.push(`"thresholds[${a}].label" for GaugeChart should be a string.`);let r=Object.keys(s).filter(e=>"value"!==e&&"color"!==e&&"label"!==e);r.length>0&&t.push(`"thresholds[${a}]" has unsupported GaugeChart key(s): ${r.join(", ")}. Use { value, color, label? }; { at, level } belongs to BigNumber.`)}),t}(o)),"ScatterplotMatrix"===e&&null!=o.frameProps&&n.push('"frameProps" is not supported for ScatterplotMatrix; configure its matrix props directly.'),n.push(...function(e){let t=e.frameProps;if(null==t||"object"!=typeof t||Array.isArray(t))return[];let 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)+"."];let s=[],r=a,o=new Set(["align",...Object.keys(S)]);for(let e of Object.keys(r))o.has(e)||s.push(`Unknown "frameProps.legendLayout" key "${e}". Valid keys: ${[...o].join(", ")}.`);void 0!==r.align&&"string"!=typeof r.align?s.push(`"frameProps.legendLayout.align" should be string, got ${Array.isArray(r.align)?"array":typeof r.align}.`):"string"==typeof r.align&&!k.has(r.align)&&s.push(`"frameProps.legendLayout.align" value "${r.align}" is not valid. Expected one of: ${[...k].join(", ")}.`);for(let[e,t]of Object.entries(S)){let a=r[e];void 0!==a&&("number"==typeof a&&Number.isFinite(a)?t.minimum>a&&s.push(`"frameProps.legendLayout.${e}" should be ${t.label} (minimum ${t.minimum}), got ${a}.`):s.push(`"frameProps.legendLayout.${e}" should be ${t.label}, got ${Array.isArray(a)?"array":typeof a}.`))}return s}(o)),{valid:0===n.length,errors:n}}function c(e){return"string"==typeof e&&e.trim().length>0}function l(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));let a=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!a)return null;let[s,r,o]=[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(s)+.7152*i(r)+.0722*i(o)}function d(e,t){let a=l(e),s=l(t);return null===a||null===s?null:(Math.max(a,s)+.05)/(Math.min(a,s)+.05)}function u(e){return"string"==typeof e?.type?e.type:""}function h(e){return!!e&&"object"==typeof e&&j.has(u(e))}function p(e){return $.has(u(e))&&!function(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}(e)}function m(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=function(e){let t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}(e)}function g(e){let t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;let a=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return a?a.length:1}function y(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function b(e,t,a={}){let s=[],r=A(e),o=V.has(e),i=!!w[e]||!!r||o,n=!0===a.inChartContainer,l=!0===a.describe,b=!0===a.navigable,f=G.has(e),v=F.has(e),{hasTitle:x,hasDescription:C,hasSummary:k,unsupportedFinding:S}=function(e,t,a){let s=w[e]?.props,r=P.has(e)||void 0!==a&&L.has(a),o=e=>!!s?.[e]||r,i=R.filter(e=>c(t[e])&&!o(e));return{hasTitle:o("title")&&c(t.title),hasDescription:o("description")&&c(t.description),hasSummary:o("summary")&&c(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,r?.frameFamily),j=!1!==t.accessibleTable&&!f,$=x||C||k,I=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),T=function(e){let t=y(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),O=o,E=function(e){let t=y(e);return!0===e.settledProjection||!0===t.settledProjection}(t)||q.has(e)&&j,z=function(e){let t=y(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}(t)||O,D=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],M=i?"pass":"manual",N=i?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(S&&s.push(S),s.push(function(e){let t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},a=e.colorScheme,s="string"==typeof e.background?e.background:null;if(s&&!s.startsWith("#"))return{...t,status:"manual",message:`Background "${s}" 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.'};let r=s??"#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."};let o=[],i=0;for(let e of a){if("string"!=typeof e||!e.startsWith("#"))continue;let t=d(e,r);null!=t&&(i++,3>t&&o.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."}:o.length>0?{...t,status:"fail",message:`${o.length} color(s) fall below 3:1 contrast vs ${r}: ${o.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 ${r}.`}}(t)),s.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...f?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:j?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:C&&k?{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."}}),s.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."}),s.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||U.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){let 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;let t=e.style;if("object"!=typeof t||null===t||Array.isArray(t))return!1;let a=t.fill;return"object"==typeof a&&null!==a&&"hatch"===a.type})}(t);s.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."}});let r=function(e){if(!Array.isArray(e))return!1;let t=e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase());return t.length>0&&t.every(e=>B.has(e))}(t.colorScheme);s.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...r?{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.'}}),s.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."})}{let e=D.filter(h);if(e.length>0){let a=t.autoPlaceAnnotations,r="object"==typeof a&&null!==a&&!0===a.redundantCues,o=e.filter(e=>{if("string"!=typeof e.color)return!1;let t=u(e),a=r&&"text"===t;return!(p(e)||a)});s.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===o.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:`${o.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."}})}}s.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."}});{let 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&&s.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."})}{let a=Z[e];if(a&&I){let e=t[a];"number"==typeof e&&e>0&&24>2*e&&s.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."})}}s.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:M,message:`The chart takes a single tab stop and navigates data with arrow keys${N} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),s.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...I?k||C?{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."}}),s.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:M,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${N}.`}),s.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:M,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${N}.`,fix:i?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),s.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...$?{status:"pass",message:`Provided: ${[x&&"title",C&&"description",k&&"summary"].filter(Boolean).join(", ")}.`}:n?{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)."}}),s.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...C||k?{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."}:x?{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)."}});{let e=[t.description,t.summary].filter(c).join(". "),a=e?function(e){let 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 s=0;for(let e of a)s+=g(e);return a.length/t.length*.39+s/a.length*11.8-15.59}(e):null;s.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(H.has(e)){let e=c(t.xLabel),a=c(t.yLabel);s.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(K.has(e)&&s.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."}),D.length>1){let e=D.filter(m).length;s.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===D.length?{status:"pass",message:`All ${D.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:D.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:`${D.length-e} of ${D.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)&&s.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&&s.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:M,message:`Transitions animate with object constancy and data changes are mirrored to the live region${N}.`,fix:i?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),s.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."}),s.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."}),s.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:M,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${N}.`,fix:i?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),s.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...f?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:j?{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)."}}),f||s.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...n?{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)."}}),s.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?"":N}.`,fix:i?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),s.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...b?v?{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."}:v?{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:M,message:`Keyboard navigation steps through points and switches series/groups${N}.`,fix:i?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}});{let a,r=Array.isArray(t.data)?t.data:null,o=Array.isArray(t.nodes)?t.nodes:null,i={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};a=W.has(e)&&r&&r.length>7?{...i,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?{...i,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?{...i,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?{...i,status:"pass",message:r.length+" data points — a reasonable density for non-visual consumption."}:o?{...i,status:"pass",message:o.length+" nodes — a reasonable density for non-visual consumption."}:{...i,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},s.push(a)}{let e=Array.isArray(t.data)?t.data:null,a=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]),r=!1;if(e&&!a)for(let t of e.slice(0,50))if(t&&"object"==typeof t){for(let e of Object.values(t))if("number"==typeof e&&Number.isFinite(e)&&Math.abs(e)>=1e5){r=!0;break}if(r)break}r&&s.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.'})}s.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()."}:k?{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."}}),s.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...f?{status:"not-applicable",message:"Single value — nothing to skip."}:j?{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."}}),s.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:M,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${N}.`,fix:i?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),s.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...U.has(e)||X.has(e)?T?{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:M,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${N}.`}}),o&&(s.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...T?{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."}}),s.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...E?{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."}}),s.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...z?{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."}}));{let a=!0===t.responsiveWidth||!0===t.responsiveHeight,r=Q.has(e)&&!0===t.zoomable;s.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.`}:r?{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."}})}r&&(r.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length))&&s.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:r.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"===r.accessibility.description&&!C&&s.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:r.name+" requires a recipe-aware description, but none is attached.",fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),r.accessibility.fallbackTable&&!1===t.accessibleTable&&s.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:r.name+" requires a fallback table, but accessibleTable is disabled.",fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."}));let Y=s.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),_={criticalsPassed:Y.filter(e=>"pass"===e.status).length,criticalsEvaluated:Y.length,fails:s.filter(e=>"fail"===e.status).length,warnings:s.filter(e=>"warn"===e.status).length,manual:s.filter(e=>"manual"===e.status).length,passes:s.filter(e=>"pass"===e.status).length};return{component:e,ok:!Y.some(e=>"fail"===e.status),summary:_,findings:s,reference:"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 f(e){let t=[],a=e.summary,s=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(` ${s} · ${a.warnings} warning(s) · ${a.manual} to verify manually`);for(let a of J){let s=e.findings.filter(e=>e.principle===a&&"not-applicable"!==e.status);if(0!==s.length){t.push(""),t.push(" "+a.toUpperCase());for(let e of s)t.push(` ${_[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")}import{getChartRecipe as A}from"./c-2WK7YJLL.min.js";var v=["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"]],x=[["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"]],C={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}},w=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,a,s,r,i]])=>[e,{required:[...t],dataShape:a,dataAccessors:[...s],props:Object.fromEntries(Object.entries(Object.assign({},...r.map(e=>C[e]),i)).map(([e,t])=>[e,o(t)]))}])),k=new Set(["start","center","end","left","right"]),S={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"}},R=["title","description","summary"],P=new Set(["XYCustomChart","OrdinalCustomChart","NetworkCustomChart","GeoCustomChart"]),L=new Set([...P,"XYFrame","OrdinalFrame","NetworkFrame","GeoFrame"]),B=new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]),j=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),$=new Set(["label","callout","callout-circle","callout-rect"]),F=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),I=new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),T=new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),O=new Set(["LineChart","AreaChart","StackedAreaChart"]),E=new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]),z=new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),D=new Set(["PieChart","DonutChart"]),M={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},W=new Set(Object.keys(M)),N={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},G=new Set(["BigNumber"]),H=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),V=new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),U=new Set(["OrbitDiagram",...V]),q=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),Y=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),X=new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),K=new Set(["MultiAxisLineChart"]),Q=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),Z={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},_={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},J=["perceivable","operable","understandable","robust","compromising","assistive","flexible"];export{w as VALIDATION_MAP,n as validateProps,d as contrastRatio,u as annotationType,h as isNoteAnnotation,p as annotationDrawsConnector,F as HIERARCHY_CHARTS,I as NETWORK_CHARTS,T as BAR_AREA_CHARTS,O as TREND_SERIES_CHARTS,E as ORDINAL_BAR_CHARTS,z as CURVE_CHARTS,D as PIE_CHARTS,M as PART_TO_WHOLE_ACCESSORS,N as NORMALIZED_STACK_ACCESSORS,Y as PHYSICS_DIAGNOSTIC_CHARTS,b as auditAccessibility,f as formatAccessibilityAudit};
@@ -0,0 +1 @@
1
+ function e(e,t={}){let r=!0===t.showRetractedAnnotations,n=!0===t.showSupersededAnnotations,a=new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&a.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;let t=e?.provenance?.stableId;return!(t&&a.has(t)&&!n)})}function t(e){return"string"==typeof e?e:"value"}function r(e){return null==e?"–":"number"==typeof e?Math.abs(e)>9999?e.toLocaleString():e+"":e instanceof Date?e.toLocaleDateString():e+""}function n(e,t){if(!t)return r(e);try{return t(e)??r(e)}catch{return r(e)}}function a(e,t){return"function"==typeof t?t(e):e[t]}function o(e,t){if(!e)return[];let r=[];return(Array.isArray(e)?e:[e]).forEach((e,n)=>{let a="string"==typeof e?.y0Accessor?e.y0Accessor:"low",o="string"==typeof e?.y1Accessor?e.y1Accessor:"high";r.push({label:a,accessor:e=>e.bands?.[n]?.y0??(0===n?e.band?.y0:void 0),format:t}),r.push({label:o,accessor:e=>e.bands?.[n]?.y1??(0===n?e.band?.y1:void 0),format:t})}),r}function l(e){let t=e.find(e=>"title"===e.role),r=e.filter(e=>"title"!==e.role);return e=>{let o=e.data;if(!o)return null;let l=t?n(a(o,t.accessor),t.format):null;return Se("div",{className:"semiotic-tooltip",style:be,children:[null!=l&&Ie("div",{style:{fontWeight:"bold",marginBottom:r.length>0?4:0},children:l}),r.map((e,t)=>{let r=n("y"===e.role&&null!=o.__aggregateValue?o.__aggregateValue:a(o,e.accessor),e.format);return Se("div",{style:t>0?{marginTop:2}:void 0,children:[Se("span",{style:{opacity:.7},children:[e.label,": "]}),Ie("span",{children:r})]},t)})]})}}function i({categoryAccessor:e,valueAccessor:o,groupAccessor:l,groupLabel:i,pieData:u=!1,valueFormat:c}){return s=>{let f=u?s.data?.[0]||s.data||s:s.data||s,d=a(f,e),h=a(f,o),p=l?a(f,l):void 0;return Se("div",{className:"semiotic-tooltip",style:be,children:[Ie("div",{style:{fontWeight:"bold"},children:r(d)}),Ie("div",{style:{marginTop:4},children:n(h,c)}),null!=p&&Se("div",{style:{marginTop:2,opacity:.8},children:[i||t(l),": ",r(p)]})]})}}function u(...e){let t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:Oe.createElement(Oe.Fragment,null,...t)}function c(e,t,r,n){Ee(()=>{e.current?.updateConfig(t),r.current=!0,n()},[t,n,e,r])}function s(e,t,r,n){let a=De(null);Ee(()=>{let o=e.current;if(!o)return;let l=t??null;a.current!==l&&(a.current=l,o.setLayoutSelection(l),o.hasCustomRestyle?o.restyleScene(l):r.current=!0,n())},[t,n,e,r])}function f(e,t){if(!e||0>=t)return Be;let r=null!=e.threshold&&e.threshold>0?e.threshold:5e3,n=e.graded;if(n){let e="object"==typeof n?n:{},a=xe(t,r,e.thresholds);return{alpha:{...Re,...e.opacities??{}}[a],band:a,isStale:"fresh"!==a}}return t>r?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:Be}function d(e,t,r,n,a,o,l){let i=Pe("fresh");Le(()=>{if(!e)return void(i.current="fresh");let u=setInterval(()=>{let u=t.current;if(!u||0===u.lastIngestTime)return;let c=f(e,a()-u.lastIngestTime);(c.band!==i.current||c.isStale!==o)&&(i.current=c.band,c.isStale!==o&&l(c.isStale),r.current=!0,n())},1e3);return()=>clearInterval(u)},[e,o,n,a,t,l,r])}function h({isStale:e,position:t}){return je("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===t?{top:4,left:4}:"bottom-left"===t?{bottom:4,left:4}:"bottom-right"===t?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:e?"#dc3545":"#28a745",color:"white"},children:e?"STALE":"LIVE"})}function p(e){let t=Ce(e);return function(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return g(e,t);if(!m(e)||!m(t))return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;let r=e[n],a=t[n];if(!Object.is(r,a)){if(Array.isArray(r)&&Array.isArray(a)){if(!g(r,a))return!1;continue}if(!m(r)||!m(a)||!y(r,a))return!1}}return!0}(t.current,e)||(t.current=e),t.current}function y(e,t){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}function g(e,t){if(e.length!==t.length)return!1;for(let r=0;e.length>r;r++)if(!Object.is(e[r],t[r]))return!1;return!0}function m(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function x(e){let{background:t,hasBackgroundGraphics:r=!1,themeBackground:n=""}=e;return"transparent"===t?null:r?t||null:t||(n&&"transparent"!==n?n:"")||null}function b(e){let{background:t,hasBackgroundGraphics:r=!1,themeBackground:n=""}=e;return"transparent"===t||r?null:t||(n&&"transparent"!==n?n:"")||null}function v(e,t){let{background:r,hasBackgroundGraphics:n=!1,themeBackground:a="",x:o=0,y:l=0,width:i,height:u}=t,c=b({background:r,hasBackgroundGraphics:n,themeBackground:a});if(!c)return!1;let s=_e(e,c);return!(!s||"transparent"===s.trim().toLowerCase()||(e.fillStyle=s,e.fillRect(o,l,i,u),0))}function w(e,t,r,n){return"function"==typeof e?e({size:t,margin:r,scales:n}):e}function k({foregroundGraphics:e,backgroundGraphics:t,size:r,margin:n,scales:a,background:o,themeBackgroundColor:l,resolveScaleAwareGraphics:i=!0}){let u=`var(--semiotic-bg, ${l})`;return{resolvedForeground:i||"function"!=typeof e?w(e,r,n,a):null,resolvedBackground:i||"function"!=typeof t?w(t,r,n,a):null,themeBackground:u,surfaceBackground:x({background:o,hasBackgroundGraphics:!!t,themeBackground:u})}}function A(e,t){if(!t)return[];let r=new Set,n=[];for(let a of e){if(!a||"object"!=typeof a)continue;let e=("function"==typeof t?t(a):a[t])+"";r.has(e)||(r.add(e),n.push(e))}return n}function M(e,t,r,n){let a=$e({accessor:t,onChange:r,readData:n}),o=$e([]);a.current={accessor:t,onChange:r,readData:n};let l=Te(()=>{let{accessor:t,onChange:r,readData:n}=a.current;if(!r||!t)return;let l=A(e.current?n(e.current):[],t);(function(e,t){if(e.length!==t.length)return!1;for(let r=0;e.length>r;r++)if(e[r]!==t[r])return!1;return!0})(l,o.current)||(o.current=l,r(l))},[e]);return Ge(()=>{o.current=[],l()},[t,l,r]),l}function _(e,t){let r="function"==typeof e?e(t.datum??null,t):e;return(n=r)&&"object"==typeof n&&"string"==typeof n.id&&"function"==typeof n.cacheKey&&"function"==typeof n.drawCanvas&&"function"==typeof n.renderStaticSVG?r:void 0;var n}function I(e,t){if("u">typeof process&&"production"===process.env?.NODE_ENV)return;let r=`${e}:${t}`;ze.has(r)||(ze.add(r),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function S(e){let{context:t,nodes:r,renderMode:n,pixelRatio:a,paintBuiltIn:o}=e;if(!n||"sketchy"===n)return void o(r);let l=[],i=()=>{l.length&&(o(l),l=[])};for(let e of r){let r,u=_(n,e);if(u){i(),t.save();try{r=u.drawCanvas({context:t,node:e,style:e.style??{},pixelRatio:a})}finally{t.restore()}r||(I(u.id,e.type??"unknown"),o([e]))}else l.push(e)}i()}function O(e){let{node:t,index:r,renderMode:n,fallback:a}=e,o=_(n,t);if(!o)return{element:a(),renderedByBackend:!1};let l=o.renderStaticSVG({node:t,style:t.style??{},key:`${o.id}-${r}`});return null!=l?{element:Ae(l,t,`${o.id}-${r}-cursor`),renderedByBackend:!0}:(I(o.id,t.type??"unknown"),{element:a(),renderedByBackend:!1})}function E(e){return O(e).element}function D(e){let t=[];return e.nodes.forEach((r,n)=>{let a=O({node:r,index:n,renderMode:e.renderMode,fallback:()=>e.fallback(r,n)});null!=a.element&&!1!==a.element&&t.push({node:r,index:n,...a})}),t}function R(e){let t=new Map;for(let r of e){let e=r.group??"_default",n=t.get(e);n||(n=[],t.set(e,n)),n.push(r)}for(let e of t.values()){e.sort((e,t)=>e.x-t.x||e.y-t.y);for(let t=0;e.length>t;t++)e[t]._groupIndex=t}let r=Array.from(t.keys()).sort((e,r)=>{let n=t.get(e),a=t.get(r);return(n.length>0?n[0].y:0)-(a.length>0?a[0].y:0)}),n=Array.from(t.values()).flat();n.sort((e,t)=>e.x-t.x||e.y-t.y);let a=new Map;for(let e=0;n.length>e;e++){n[e]._flatIndex=e;let t=n[e].datum?.id;null!=t&&a.set(t+"",e)}return{flat:n,groups:r,byGroup:t,idToIdx:a}}function B(e,t){if(0===e.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};let r=Math.max(0,Math.min(t,e.flat.length-1)),n=e.flat[r];return{flatIndex:r,group:n.group??"_default",indexInGroup:n._groupIndex??0}}function L(e,t,r){let{group:n,indexInGroup:a}=t,o=r.byGroup.get(n);switch(e){case"ArrowRight":return o.length-1>a?o[a+1]._flatIndex:t.flatIndex;case"ArrowLeft":return a>0?o[a-1]._flatIndex:t.flatIndex;case"ArrowDown":{let e=r.groups.indexOf(n);return r.groups.length-1>e?P(r,r.groups[e+1],o[a]):t.flatIndex}case"ArrowUp":{let e=r.groups.indexOf(n);return e>0?P(r,r.groups[e-1],o[a]):t.flatIndex}case"PageDown":return Math.min(t.flatIndex+Math.max(1,Math.floor(.1*r.flat.length)),r.flat.length-1);case"PageUp":return Math.max(t.flatIndex-Math.max(1,Math.floor(.1*r.flat.length)),0);case"Home":return 0;case"End":return r.flat.length-1;case"Escape":return-1;default:return null}}function P(e,t,r){let n=e.byGroup.get(t),a=0,o=Math.abs(n[0].x-r.x);for(let e=1;n.length>e;e++){let t=Math.abs(n[e].x-r.x);o>t&&(o=t,a=e)}return n[a]._flatIndex}function j(e){let t=[];for(let r of e)switch(r.type){case"point":if(!1===r.interactive)break;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"});break;case"symbol":if(0>=r.size)break;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"});break;case"glyph":{if(0>=r.size||null==r.datum)break;let e=Me(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"});break}case"line":{let e=r,n=Array.isArray(e.datum)?e.datum:[],a=e.group??"_default";for(let r=0;e.path.length>r&&n.length>r;r++)t.push({x:e.path[r][0],y:e.path[r][1],datum:n[r],shape:"circle",group:a});break}case"area":{if(!1===r.interactive)break;let e=r,n=Array.isArray(e.datum)?e.datum:[],a=e.group??"_default";for(let r=0;e.topPath.length>r&&n.length>r;r++)t.push({x:e.topPath[r][0],y:e.topPath[r][1],datum:n[r],shape:"circle",group:a});break}case"rect":t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.group??"_default"});break;case"heatcell":t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function C(e){let t=[];for(let r of e)if("rect"===r.type&&null!=r.x){if(null==r.datum)continue;t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.group??r.datum?.category??""})}else if("point"===r.type){if(!1===r.interactive)continue;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"})}else if("symbol"===r.type){if(0>=r.size)continue;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"})}else if("glyph"===r.type){if(0>=r.size||null==r.datum)continue;let e=Me(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"})}else if("wedge"===r.type&&null!=r.cx){if(null===r.datum)continue;let e=((r.startAngle||0)+(r.endAngle||0))/2,n=((r.innerRadius||0)+(r.outerRadius||50))/2;t.push({x:r.cx+Math.cos(e)*n,y:r.cy+Math.sin(e)*n,datum:r.datum,shape:"wedge",group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function T(e){let t=[];for(let r of e)if(r.datum)if("circle"===r.type&&null!=r.cx){if(0>=r.r)continue;t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"})}else if("rect"===r.type&&null!=r.x){if(0>=r.w||0>=r.h)continue;t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.datum.id??"_default"})}else if("arc"===r.type&&null!=r.cx)t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"});else if("symbol"===r.type&&null!=r.cx){if(0>=r.size)continue;t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"})}else if("glyph"===r.type&&null!=r.cx){if(0>=r.size)continue;let e=Me(r.glyph,r.size);t.push({x:r.cx+e.centerDx,y:r.cy+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:r.datum.id??"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function G(e,t,r,n,a){let o=r.flat[t.flatIndex];if(!o)return L(e,t,r);let l=o.datum?.id;switch(e){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":{let n=function(e,t,r){let n=null,a=1/0;for(let o=0;e.flat.length>o;o++){let l=e.flat[o];if(l===t)continue;let i=l.x-t.x,u=l.y-t.y,c=!1;switch(r){case"right":c=i>0&&Math.abs(i)>=Math.abs(u);break;case"left":c=0>i&&Math.abs(i)>=Math.abs(u);break;case"down":c=u>0&&Math.abs(u)>=Math.abs(i);break;case"up":c=0>u&&Math.abs(u)>=Math.abs(i)}if(!c)continue;let s=i*i+u*u;a>s&&(a=s,n=o)}return n}(r,o,"ArrowRight"===e?"right":"ArrowLeft"===e?"left":"ArrowDown"===e?"down":"up")??t.flatIndex;return n!==t.flatIndex&&(a.current=-1),n}case"Enter":{if(null==l)return t.flatIndex;let e=function(e,t){let r=e+"",n=[];for(let e of t){let t=e.datum??e,a=$(t.source),o=$(t.target),l=null!=a,i=null!=o;l&&a+""===r&&i?n.push(o+""):i&&o+""===r&&l&&n.push(a+"")}return n}(l,n);if(0===e.length)return t.flatIndex;let o=r.idToIdx.get(e[(a.current+1)%e.length])??-1;return 0>o?t.flatIndex:(a.current=-1,o)}default:{let n=L(e,t,r);return null!==n&&n!==t.flatIndex&&(a.current=-1),n}}}function $(e){return"object"==typeof e&&null!==e&&"id"in e?e.id:e}function z(e){let t=[];for(let r of e)if("point"===r.type&&null!=r.x&&!1!==r.interactive)t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle"});else if("glyph"===r.type){if(0>=r.size||null==r.datum)continue;let e=Me(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else"geoarea"===r.type&&r.centroid&&!1!==r.interactive&&t.push({x:r.centroid[0],y:r.centroid[1],datum:r.datum,shape:"geoarea",pathData:r.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function H(e,t,r){switch(e){case"ArrowRight":case"ArrowDown":return r-1>t?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":return Math.min(t+Math.max(1,Math.floor(.1*r)),r-1);case"PageUp":return Math.max(t-Math.max(1,Math.floor(.1*r)),0);case"Home":return 0;case"End":return r-1;case"Escape":return-1;default:return null}}function N(e){return{data:e.datum||{},x:e.x,y:e.y,__semioticHoverData:!0}}function W(e,t,r,n,a,o){return function(e,t,r){let n=e.current;n.inside=!0,n.clientX=t.clientX,n.clientY=t.clientY,n.pointerType=t.pointerType??r}(e,t,o),!(!r&&!n||!r&&"touch"===e.current.pointerType&&(ke(a),1))}function U(e){let{title:t,description:r,summary:n,accessibleTable:a,className:o,animate:l,maxDevicePixelRatio:i,axisExtent:u,autoPlaceAnnotations:c}=e,s={};return t&&(s.title=t),r&&(s.description=r),n&&(s.summary=n),void 0!==a&&(s.accessibleTable=a),o&&(s.className=o),null!=l&&(s.animate=l),void 0!==i&&(s.maxDevicePixelRatio=i),void 0!==u&&(s.axisExtent=u),void 0!==c&&(s.autoPlaceAnnotations=c),s}function V(e){let{linkedHover:t,selection:r,onObservation:n,onClick:a,hoverRadius:o,hoverHighlight:l,forceHoverBehavior:i,forceClickBehavior:u,mobileInteraction:c,customHoverBehavior:s,customClickBehavior:f,linkedHoverInClickPredicate:d=!0}=e,h={};n&&(h.annotationObservationCallback=n);let p=c?.enabled?Math.max(o??30,Math.ceil((c.targetSize||44)/2),24):o;return(i||t||n||a||l)&&(h.customHoverBehavior=s),f&&(u||(d?n||a||t:n||a)||c?.enabled&&(c.tapToSelect||c.tapToLockTooltip)&&(t||l||r))&&(h.customClickBehavior=f),null!=p&&(h.hoverRadius=p),h}function F(e){let{tooltip:t,defaultTooltipContent:r}=e;return{tooltipContent:!1===t?()=>null:ve(t)||r}}function Y(e,t){if(!function(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}(t))return e??((...e)=>({}));let r={};return void 0!==t.stroke&&(r.stroke=t.stroke),void 0!==t.strokeWidth&&(r.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(r.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...r}):(...e)=>({...r})}function q(e,t,r){if(1>=r)return 1;let n=r-1;return we({age:n-t,extent:n,type:e.type,halfLife:e.halfLife??r/2,threshold:e.stepThreshold??.5*r,minOpacity:e.minOpacity??.1})}function K(e){let t=new Map;for(let r=0;e.length>r;r++)t.set(e[r],r);return t}function X(e,t,r,n=K(r)){let a=r.length;if(a>1)for(let r of t){if("line"===r.type){let t=Array.isArray(r.datum)?r.datum:[];if(2>t.length)continue;let o=Array(t.length),l=!1;for(let r=0;t.length>r;r++){let i=n.get(t[r]);null!=i?(o[r]=q(e,i,a),1>o[r]&&(l=!0)):o[r]=1}l&&(r._decayOpacities=o);continue}if("area"===r.type){let t=Array.isArray(r.datum)?r.datum:[],o=r.topPath?r.topPath.length:t.length;if(2>o)continue;if(t.length===o){let l=Array(o),i=!1;for(let r=0;t.length>r;r++){let o=n.get(t[r]);null!=o?(l[r]=q(e,o,a),1>l[r]&&(i=!0)):l[r]=1}i&&(r._decayOpacities=l)}else{let l=1;for(let r of t){let t=n.get(r);if(null!=t){let r=q(e,t,a);l>r&&(l=r)}}if(1>l){let e=Array(o);e.fill(l),r._decayOpacities=e}}continue}let t=n.get(r.datum);if(null==t)continue;let o=q(e,t,a);"candlestick"===r.type?r._decayOpacity=o:r.style={...r.style,opacity:(r.style?.opacity??1)*o}}}function Z(e){if("production"===process.env.NODE_ENV)return;let{label:t,nodes:r,overlays:n,warned:a}=e;Q(n)&&0===r.length&&J(a,"overlay-only",`[semiotic] ${t} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),r.length>0&&r.every(e=>null==e.datum)&&J(a,"null-datums",`[semiotic] ${t} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function Q(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(Q))}function J(e,t,r){e.has(t)||(e.add(t),console.warn(r))}function ee(e){try{return{kind:"success",result:e.run()}}catch(t){let r=e.hasPreviousResult,n=function(e,t,r,n){let a=function(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message||"Custom layout threw."};if("string"==typeof e)return{name:"Error",message:e};if(null==e)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:e+""}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}(t),o="network"===e?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:e,source:o,message:`Semiotic ${e} ${o} failed: ${a.message}`,error:a,recovery:r?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:r,affectedRevision:n}}(e.family,t,r,e.revision);"production"!==process.env.NODE_ENV&&console.error(`[semiotic] ${e.logLabel} threw:`,t);try{e.onLayoutError?.(n)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:n,preservedLastGoodScene:r}}}function te(){return this.updateResults.last}function re(){return this.updateResults.last}function ne(e){return this.updateResults.subscribe(e)}function ae(e){this.config.layoutSelection=e}function oe(){He.set(this,!0)}function le(){let e=!0===He.get(this);return He.delete(this),e}function ie(e){Object.assign(e.prototype,{getLastUpdateResult:te,getUpdateSnapshot:re,subscribeUpdateResult:ne,setLayoutSelection:ae,markStylePaintPending:oe,consumeStylePaintPending:le})}function ue(e,t,r,n,a,o){let l=a-r,i=o-n,u=l*l+i*i;if(0===u)return Math.sqrt((e-r)**2+(t-n)**2);let c=((e-r)*l+(t-n)*i)/u;return c=Math.max(0,Math.min(1,c)),Math.sqrt((e-(r+c*l))**2+(t-(n+c*i))**2)}function ce(e,t,r){return r.x>e||e>r.x+r.w||r.y>t||t>r.y+r.h?{hit:!1,cx:0,cy:0}:{hit:!0,cx:r.x+r.w/2,cy:r.y+r.h/2}}function se(e,t=30){return Math.max((e??4)+5,12,t)}function fe(e){return e instanceof Date?e:"number"==typeof e&&e>1e9?new Date(e):null}function de(e,t){let r=fe(e);if(!r)return!1;let n=fe(t);return!n||r.getFullYear()!==n.getFullYear()||r.getMonth()!==n.getMonth()}function he(e){let t=e%(2*Math.PI);return 0>t&&(t+=2*Math.PI),t}function pe(e,t,r,n,a,o=e=>e.x,l=e=>e.y,i=e=>e.r){let u=Math.max(n,a+5,12),c=t-u,s=t+u,f=r-u,d=r+u,h=null,p=1/0;return e.visit((e,a,u,y,g)=>{if(a>s||c>y||u>d||f>g)return!0;if(!e.length){let a=e;do{let e=a.data,u=o(e)-t,c=l(e)-r,s=Math.sqrt(u*u+c*c);se(i(e),n)>=s&&p>s&&(h=e,p=s),a=a.next}while(a)}return!1}),h?{node:h,distance:p}:null}function ye(e,t){return"string"==typeof e&&e.length>0?e:t}function ge(e,t,r){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${r.familyPhrase})`:r.fallback}function me(e){let t=(e+"").replace(/[^a-zA-Z0-9_-]/g,"_"),r=/^[A-Za-z_]/.test(t)?t:"c"+t,n=r+"-semiotic-title",a=r+"-semiotic-desc";return{titleId:n,descId:a,labelledBy:`${n} ${a}`}}import{bandFromAge as xe,defaultTooltipStyle as be,normalizeTooltip as ve,opacityFromAge as we,setCanvasMarkCursor as ke,withSceneMarkCursor as Ae}from"./c-LMGSSD2E.min.js";import{glyphHitGeometry as Me,resolveCSSColor as _e}from"./c-553QUDKA.min.js";import{jsx as Ie,jsxs as Se}from"react/jsx-runtime";import*as Oe from"react";import{useEffect as Ee,useRef as De}from"react";var Re={fresh:1,aging:.7,stale:.45,expired:.25},Be={alpha:1,band:"fresh",isStale:!1};import{useEffect as Le,useRef as Pe}from"react";import{jsx as je}from"react/jsx-runtime";import{useRef as Ce}from"react";import{useCallback as Te,useEffect as Ge,useRef as $e}from"react";var ze=new Set,He=new WeakMap;export{q as computeDecayOpacity,K as buildDatumIndexMap,X as applyDecay,Z as warnCustomLayoutDiagnostics,ee as runCustomLayoutAttempt,ie as attachUpdateResultStore,u as composeOverlays,c as useConfigSync,s as useLayoutSelectionSync,ue as pointToSegmentDistance,ce as hitTestRect,se as getHitRadius,de as isTimeLandmark,he as normalizeAngle,pe as findHitPointInQuadtree,f as resolveStaleness,d as useStalenessCheck,h as StalenessBadge,e as filterAnnotationsByStatus,ye as overlayAccessibleTitle,ge as overlayAccessibleDescription,me as overlayAccessibleIds,p as useStableShallow,b as resolveCanvasBackground,v as paintCanvasBackground,w as resolveFrameGraphics,k as resolveFrameLayers,A as extractCategoryDomain,M as useLegendCategoryEmission,S as paintSceneWithBackend,E as renderSceneWithBackend,D as renderSceneListWithBackend,t as accessorName,r as formatVal,o as bandTooltipFields,l as buildDefaultTooltip,i as buildOrdinalTooltip,R as buildNavGraph,B as resolvePosition,L as nextGraphIndex,j as extractXYNavPoints,C as extractOrdinalNavPoints,T as extractNetworkNavPoints,G as nextNetworkIndex,z as extractGeoNavPoints,H as nextIndex,N as navPointToHover,W as shouldHandleFramePointer,U as buildBaseMetadataProps,V as buildCustomBehaviorProps,F as buildTooltipProps,Y as mergeShapeStyle};
@@ -0,0 +1 @@
1
+ function e(e){let{desired:t,minGaps:i,weights:n}=e,s=t.length;if(0===s)return[];if(i.length!==Math.max(0,s-1))throw Error("placeWithMinGap: minGaps must have desired.length - 1 entries");let r=Array(s).fill(0);for(let e=1;s>e;e++)r[e]=r[e-1]+Math.max(0,Number.isFinite(i[e-1])?i[e-1]:0);let o=[];for(let e=0;s>e;e++){let i=Math.max(Number.EPSILON,Number.isFinite(n?.[e])?n[e]:1),s=(Number.isFinite(t[e])?t[e]:0)-r[e];for(o.push({start:e,end:e,weight:i,mean:s});o.length>1;){let e=o[o.length-1],t=o[o.length-2];if(e.mean>=t.mean)break;let i=t.weight+e.weight;o.splice(o.length-2,2,{start:t.start,end:e.end,weight:i,mean:(t.mean*t.weight+e.mean*e.weight)/i})}}let a=Number.isFinite(e.min)?e.min:-1/0,l=Number.isFinite(e.max)?e.max-r[s-1]:1/0,d=a>l?a:l,h=Array(s);for(let e of o){let t=Math.max(a,Math.min(d,e.mean));for(let i=e.start;e.end>=i;i++)h[i]=t+r[i]}return h}function t(e,t){let i=0,n=e.length-1,s=-1;for(;n>=i;){let r=i+n>>>1;e[r].at>t?n=r-1:(s=r,i=r+1)}return 0>s?{at:t,before:0,after:0}:e[s]}function i(e,i=0){if(0===e.length)return{adjacentClearance:[],positions:[]};let n=[],s=[0];for(let r=0;e.length-1>r;r++){let o=e[r],a=e[r+1],l=[...new Set([...o.map(e=>e.at),...a.map(e=>e.at)])].sort((e,t)=>e-t),d=0;for(let e of l){let i=t(o,e),n=t(a,e);d=Math.max(d,i.after+n.before)}n.push(d),s.push(s[s.length-1]+d+i)}return{adjacentClearance:n,positions:s}}function n(e,t,i,n={}){let s=[...e];if(1>=s.length)return s;let r=[...s],o=i(s),a=1,l=Math.max(0,n.passes??6),d=Math.max(1,n.maxEvaluations??1/0);for(let e=0;l>e&&d>a;e++){let e=new Map(s.map((e,t)=>[e,t])),l=new Map,d=new Map;for(let i of t){let t=e.get(i.source),n=e.get(i.target);if(null==t||null==n)continue;let s=Number.isFinite(i.weight)&&i.weight>0?i.weight:1;l.set(i.source,(l.get(i.source)??0)+n*s),d.set(i.source,(d.get(i.source)??0)+s),l.set(i.target,(l.get(i.target)??0)+t*s),d.set(i.target,(d.get(i.target)??0)+s)}s=s.map((e,t)=>({item:e,index:t,barycenter:(l.get(e)??t)/(d.get(e)??1)})).sort((e,t)=>e.barycenter-t.barycenter||(n.compare?.(e.item,t.item)??e.index-t.index)).map(e=>e.item);let h=i(s);if(a++,o>h)o=h,r=[...s];else if(h===o)break}return r}function s(e,t,i={}){let n=[...e];if(1>=n.length)return n;let s=t(n),r=1,o=Math.max(0,i.passes??6),a=Math.max(1,i.maxEvaluations??1/0);for(let e=0;o>e&&a>r;e++){let e=!1;for(let i=0;n.length-1>i&&a>r;i++){[n[i],n[i+1]]=[n[i+1],n[i]];let o=t(n);r++,s>o?(s=o,e=!0):[n[i],n[i+1]]=[n[i+1],n[i]]}if(!e)break}return n}function r(e,t,i={}){let n=[...e],s=n.length;if(1>=s||s>(i.maxItems??8))return n;let r=Math.max(1,i.maxEvaluations??1/0),o=0,a=[...n],l=1/0,d=()=>{if(o>=r)return;let e=t(n);o++,l>e&&(l=e,a=[...n])};d();let h=Array(s).fill(0),u=0;for(;s>u&&r>o;)if(u>h[u]){let e=u%2==0?0:h[u];[n[e],n[u]]=[n[u],n[e]],d(),h[u]++,u=0}else h[u]=0,u++;return a}function o(e,t,i=()=>!0){let n=0;for(let s=0;e.length>s;s++){let[r,o]=t(e[s]);for(let a=s+1;e.length>a;a++){if(!i(e[s],e[a]))continue;let[l,d]=t(e[a]);0>(r-l)*(o-d)&&n++}}return n}function a(e){return`${e.getUTCFullYear()}-${l(e.getUTCMonth()+1)}-${l(e.getUTCDate())}`}function l(e){return 10>e?"0"+e:e+""}function d(e){return"function"==typeof e?e:t=>t[e]}function h(e,t,i){let n=e?.data,s=n?n[t]:void 0;if(null!=s)return s;let r=e?.[t];return r??i}function u(e){return null==e?null:e.data??e.datum??e}function c(e,t){let i=new Map;for(let n of e){let e=t(n),s=i.get(e);s?s.push(n):i.set(e,[n])}return i}function p(e){let t=Object.create(null);return e((e,i)=>{t[e]=i}),t}function f(e,t){if(!t)return!0;let i=Array.isArray(t)?t:[t],n=e;for(let e of i)if(null!=e.value&&n[e.field]+""!=e.value+"")return!1;return!0}function m(e,t={}){let i=t.baseOpacity??1;return t.highlight||t.predicate?!f(e,t.highlight)||t.predicate&&!t.predicate(e)?t.dimOpacity??.16:Math.min(1,i+(t.brighten??0)):i}function y(e){return e.join("|")}function x(e,t=.72){let i=zt(e,"#ffffff"),n=zt(e,"#000000"),s=zt(e,e)(0);return e=>{let r=0>e?0:e>1?1:e;return.5===r?s:.5>r?i(2*(.5-r)*t):n(2*(r-.5)*t)}}function g(e,t,i=.72){return x(e,i)(t)}function b(e){return p(t=>{for(let[i,n]of Object.entries(e))t(i,n)})}function v(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}function w(e,t,i){return Math.max(t,Math.min(i,e))}function S(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}function M(e){if(0===e.length)return 0;let t=0;for(let i of e)t+=i;return t/e.length}function k(e,t){let i=w(t,0,1),n=e.trim().replace(/^#/,""),s=3===n.length?n.split("").map(e=>e+e).join(""):n;return/^[0-9a-fA-F]{6}$/.test(s)?`rgba(${parseInt(s.slice(0,2),16)}, ${parseInt(s.slice(2,4),16)}, ${parseInt(s.slice(4,6),16)}, ${i})`:e}function I(e){return Ht("rect",{className:e.className,x:e.x,y:e.y,width:Math.max(0,e.width),height:Math.max(0,e.height),rx:e.radius??10,ry:e.radius??10,fill:e.fill??"none",stroke:e.stroke,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray,opacity:e.opacity??.6,style:{pointerEvents:"none"}},e.keyId)}function B(e,t=0){let i=1/0,n=1/0,s=-1/0,r=-1/0;for(let t of e){let e=t.r??0;i>t.x-e&&(i=t.x-e),t.x+e>s&&(s=t.x+e),n>t.y-e&&(n=t.y-e),t.y+e>r&&(r=t.y+e)}return Number.isFinite(i)?{x:i-t,y:n-t,width:s-i+2*t,height:r-n+2*t}:null}function O(e,t=0){if(!e.length)return null;let i="number"==typeof t?t:t.x??0,n="number"==typeof t?t:t.y??0,s=1/0,r=1/0,o=-1/0,a=-1/0;for(let t of e){if(!(Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.width)&&Number.isFinite(t.height)))continue;let e=Math.max(0,t.width),i=Math.max(0,t.height);s>t.x&&(s=t.x),r>t.y&&(r=t.y),t.x+e>o&&(o=t.x+e),t.y+i>a&&(a=t.y+i)}return Number.isFinite(s)?{x:s-i,y:r-n,width:o-s+2*i,height:a-r+2*n}:null}function A(e){let t=e.fontSize??12;return null!=e.maxWidth&&e.text.length*t*.56>e.maxWidth?null:Ht("text",{className:e.className,x:e.x,y:e.y,textAnchor:e.anchor??"middle",dominantBaseline:e.baseline??"middle",fontSize:t,fontWeight:e.fontWeight,fill:e.color,style:{pointerEvents:"none"},children:e.text},e.keyId)}function q(e){let t=e.spacing??8;return{def:Ht("pattern",{id:e.id,width:t,height:t,patternUnits:"userSpaceOnUse",patternTransform:`rotate(${e.angle??45})`,children:Ht("line",{x1:0,y1:0,x2:0,y2:t,stroke:e.color??"currentColor",strokeWidth:e.strokeWidth??1,opacity:e.opacity??.5})},e.id),fill:`url(#${e.id})`}}function C(e){let t=e.orient??"bottom",i="bottom"===t||"top"===t,n=e.offset??0,s=e.tickLength??6,r=e.gridLength??0,o=e.labelGap??4,a=e.fontSize??11,l=e.color??"var(--semiotic-text-secondary, #888)",d=e.gridColor??l,h=e.format??(e=>e+""),u="top"===t||"left"===t?-1:1,c=e.ticks.length-1,p=e.ticks.map((p,f)=>{let m,y=e.scale(p),x=n+u*s,g=n-u*r,b=x+u*o;m=e.labelAnchor?e.labelAnchor:i?e.edgeAnchor&&0===f?"start":e.edgeAnchor&&f===c?"end":"middle":"left"===t?"end":"start";let v=i?"top"===t?"auto":"hanging":"middle",w=i?{x:y,y:b}:{x:b,y:y};return Kt("g",{children:[(s>0||r>0)&&Ht("line",{...i?{x1:y,x2:y,y1:x,y2:g}:{x1:x,x2:g,y1:y,y2:y},stroke:r>0?d:l,strokeWidth:1,strokeDasharray:r>0?e.gridDasharray:void 0,opacity:r>0?.7:1}),Ht("text",{x:w.x,y:w.y,textAnchor:m,dominantBaseline:v,fontSize:a,fontWeight:e.fontWeight,fill:l,children:h(p)})]},`tick-${p}-${f}`)});return Ht("g",{className:e.className,style:{pointerEvents:"none"},children:p},e.keyId)}function P(e){let t,i=e.stroke??"var(--semiotic-text, #f4f4f8)",n=e.strokeWidth??1,s=e.markRadius??0,r=e.labelX-e.markX,o=e.labelY-e.markY,a=Math.hypot(r,o)||1,l=e.markX+r/a*s,d=e.markY+o/a*s;return t="elbow"===e.connector?`M${l},${d} L${l},${e.labelY} L${e.labelX},${e.labelY}`:"curve"===e.connector?`M${l},${d} Q${(l+e.labelX)/2},${d} ${e.labelX},${e.labelY}`:`M${l},${d} L${e.labelX},${e.labelY}`,Kt("g",{className:e.className,style:{pointerEvents:"none"},children:[s>0&&Ht("circle",{cx:e.markX,cy:e.markY,r:s,fill:"none",stroke:i,strokeWidth:n}),Ht("path",{d:t,fill:"none",stroke:i,strokeWidth:n}),Ht("text",{x:e.labelX,y:e.labelY,textAnchor:e.labelAnchor??"middle",dominantBaseline:e.labelBaseline??"hanging",fontSize:e.fontSize??11,fontWeight:e.fontWeight,fill:e.color??i,children:e.label})]},e.keyId)}function F(e){let t=e>>>0;return function(){t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function $(e){if(!e||"object"!=typeof e)return!1;let t=e;return"string"==typeof t.id&&(null==t.label||"string"==typeof t.label)&&"number"==typeof t.count&&Number.isFinite(t.count)&&Array.isArray(t.bodyIds)&&t.bodyIds.every(e=>"string"==typeof e)}function D(e,t){if("region-enter"!==t.type)return e;let i=t.region.id,n=N(e,i),s=$(n)?n:{id:i,label:t.region.label??i,count:0,bodyIds:[]};if(s.bodyIds.includes(t.bodyId))return e;let r=[...s.bodyIds,t.bodyId];return{...e,[i]:{...s,count:r.length,bodyIds:r}}}function T(e,t){return(t??Object.keys(e)).map(t=>N(e,t)).filter($).map(e=>({label:e.label??e.id,value:e.count}))}function L(e,t){let i=t instanceof Set?t:new Set(t);return e.map(e=>{let t=e.bodyIds??[],n=t.filter(e=>!i.has(e)),s=t.length-n.length,r=e.completion?.mode??"allMembersAbsorbed",o=e.completion?.valueByBodyId,a=e=>{let t=o?N(o,e):void 0;return"number"==typeof t&&Number.isFinite(t)&&t>=0?t:1},l=t.reduce((e,t)=>e+a(t),0),d=t.reduce((e,t)=>e+(i.has(t)?a(t):0),0),h=e.completion?.threshold,u="threshold"===r?Number.isFinite(h)&&Number(h)>=0?Number(h):l:void 0;return{id:e.id,label:e.label??e.id,mode:r,complete:t.length>0&&("anyAbsorbed"===r?s>0:"threshold"===r?d>=(u??l):0===n.length),absorbed:s,total:t.length,absorbedValue:d,totalValue:l,threshold:u,missing:n}})}function j(e,t,i){return Math.max(t,Math.min(i,e))}function R(e,t,i,n,s,r={}){return{id:e,friction:r.friction,restitution:r.restitution,bodyFilter:r.bodyFilter,shape:{type:"segment",x1:t,y1:i,x2:n,y2:s,thickness:r.thickness??8}}}function W(e){let t=e.shape??"lane",i=Math.max(1,Math.round(e.width)),n=Math.max(1,Math.round(e.height)),s=e.padX??46,r=e.padY??72,o=s,a=i-s,l=r,d=n-Math.max(24,Math.round(.45*r)),h=(l+d)/2,u=Math.max(1,d-l),c=j(e.pinchRatio??.18,.06,.5),p=Number(e.pinchHeightOffset??0),f=Number.isFinite(p)?p:0,m=j(u*c+f,.06*u,.5*u),y=m/2,x=h-y,g=h+y,b=e.idPrefix??"process",v=e.friction??.58,w=e.restitution??.18,S=e.wallThickness??8,M=e.stages;if(!M.length)throw Error("processStageLayout requires at least one stage");let k=j(e.centerStageIndex??Math.floor(M.length/2),0,M.length-1),I=function(e){let t=e.reduce((e,t)=>e+(t.share??1),0);return t>0?t:e.length}(M),B=a-o,O=o,A=M.map((e,t)=>{let i=O,n=t===M.length-1?a:O+(e.share??1)/I*B;return O=n,{id:e.id,label:e.label,description:e.description,kind:e.kind??"stage",index:t,x0:i,x1:n,x:(i+n)/2,width:n-i,y:h,height:u}}),q=A[k],C=q.x0,P=q.x1,F=(e,i)=>{if("lane"===t)return"top"===i?l:d;if("funnel"===t){let t=j((e-o)/Math.max(1,a-o),0,1);return"top"===i?l+(x-l)*t:d+(g-d)*t}if(C>=e){let t=j((e-o)/Math.max(1,C-o),0,1);return"top"===i?l+(x-l)*t:d+(g-d)*t}if(P>=e)return"top"===i?x:g;let n=j((e-P)/Math.max(1,a-P),0,1);return"top"===i?x+(l-x)*n:g+(d-g)*n},N=A.map(e=>{let t=Math.min(F(e.x0,"top"),F(e.x1,"top")),i=Math.max(F(e.x0,"bottom"),F(e.x1,"bottom"));return{...e,y:(t+i)/2,height:Math.max(1,i-t)}}),$={thickness:S,friction:v,restitution:w},D=[];"lane"===t?D.push(R(b+"-top",o,l,a,l,$),R(b+"-bottom",o,d,a,d,$),R(b+"-left",o,l,o,d,{...$,thickness:Math.max(6,S-2)}),R(b+"-right",a,l,a,d,{...$,thickness:Math.max(6,S)})):"funnel"===t?D.push(R(b+"-top",o,l,a,x,$),R(b+"-bottom",o,d,a,g,$),R(b+"-left",o,l,o,d,{...$,thickness:Math.max(6,S-2)}),R(b+"-right",a,x,a,g,{...$,thickness:Math.max(6,S)})):D.push(R(b+"-left-top",o,l,C,x,$),R(b+"-left-bottom",o,d,C,g,$),R(b+"-center-top",C,x,P,x,$),R(b+"-center-bottom",C,g,P,g,$),R(b+"-right-top",P,x,a,l,$),R(b+"-right-bottom",P,g,a,d,$),R(b+"-left",o,l,o,d,{...$,thickness:Math.max(6,S-2)}),R(b+"-right",a,l,a,d,{...$,thickness:Math.max(6,S)}));let T=e.membraneDampingScale??.5,L=o,W=Math.max(1,("bowtie"===t?C:a)-L),Y=(e.membranes??[]).map(e=>{let t=L+j(e.offset,0,1)*W,i=e.width??18+18*e.cost,n=u-16,s=h+.25*(e.wobble??0);return{...e,x:t,y:s,width:i,height:n}}),E=!1===e.includeMembraneRegions?[]:Y.map(e=>X({id:e.id,label:e.label??e.id,description:e.description??(e.label??e.id)+" is a permeable region. It taxes energy and damps velocity while bodies overlap it.",x:e.x,y:e.y,width:e.width,height:e.height,cost:e.cost,dampingScale:e.dampingScale??T,bodyStyle:e.bodyStyle,metadata:e.metadata,semanticItem:e.semanticItem,color:e.color}));return{shape:t,width:i,height:n,padX:s,padY:r,left:o,right:a,topY:l,bottomY:d,midY:h,centerLeft:C,centerRight:P,pinchHeight:m,pinchTop:x,pinchBottom:g,stages:N,membranes:Y,colliders:D,regionEffects:E,boundaryY:F}}function Y(e){return{id:e.id,label:e.label,description:e.description,kind:e.kind,shape:(t=e.x,i=e.y,n=e.width,s=e.height,{type:"aabb",x:t,y:i,width:n,height:s}),bodyFilter:e.bodyFilter,collider:e.collider,colliderThickness:e.colliderThickness,friction:e.friction,restitution:e.restitution,semanticItem:e.semanticItem,metadata:e.metadata,bodyStyle:e.bodyStyle,attributes:e.attributes,onEnter:e.onEnter,onExit:e.onExit};var t,i,n,s}function E(e,t={}){let i=t.idPrefix??"stage",n=Math.max(0,t.insetX??0),s=Math.max(0,t.insetY??1);return e.stages.map(e=>{let r="function"==typeof t.metadata?t.metadata(e):t.metadata??{};return{...Y({id:i?`${i}:${e.id}`:e.id,label:e.label??e.id,description:e.description,kind:"region",x:e.x,y:e.y,width:Math.max(1,e.width-2*n),height:Math.max(1,e.height-2*s),bodyFilter:t.bodyFilter,semanticItem:t.semanticItem,attributes:{primitive:"processStage",stageId:e.id,stageIndex:e.index},metadata:{...r,primitive:"processStage",stageId:e.id,stageIndex:e.index}})}})}function X(e){let t=e.dampingScale??.5,i=e.energyScale??1,n=j(e.cost,0,2);return{...Y({...e,kind:e.kind??"membrane",attributes:{primitive:"membrane",membraneCost:n,..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),damping:n*t,energyDelta:-n*i}}function z(e){return{...Y({...e,kind:e.kind??"charge-gate",attributes:{primitive:"chargeGate",..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),charge:e.charge??!0,energyDelta:e.energyDelta,impulseOnEnter:e.impulseOnEnter}}function G(e){let t="number"==typeof e.force?{x:e.force,y:0}:e.force??{x:12,y:0};return{...Y({...e,kind:e.kind??"force-field",attributes:{primitive:"routeSurface",..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),force:t,damping:e.damping??.015}}function H(e){let t=e.pressure??e.occupancy??0,i=e.baseDamping??.08,n=e.dampingPerUnit??.12,s=e.energyPerUnit??0;return{...Y({...e,kind:e.kind??"membrane",attributes:{primitive:"pressureField",pressure:t,..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),damping:i+t*n,energyDelta:s?-t*s:void 0,force:e.force}}function K(e){let t="number"==typeof e.force?{x:e.force,y:0}:e.force;return{...Y({...e,kind:e.kind??"force-field",attributes:{primitive:"capacitatedSensor",capacity:e.capacity,unitsPerSecond:e.unitsPerSecond??e.capacity,..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),force:t,damping:e.damping,charge:e.charge??e.capacity}}function U(e){return{...Y({...e,kind:e.kind??"force-field",attributes:{primitive:"portal",targetStage:e.targetStage,..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),force:e.force,impulseOnEnter:e.impulseOnEnter,damping:e.damping??.08}}function _(e){let t="number"==typeof e.force?{x:e.force,y:0}:e.force??{x:24,y:0};return{...Y({...e,kind:e.kind??"sink",attributes:{primitive:"absorb",..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),force:t,damping:e.damping??.02,charge:e.charge??"absorbed"}}function V(e){return{...Y({...e,kind:e.kind??"force-field",attributes:{primitive:"forceField",..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),force:e.force,damping:e.damping,energyDelta:e.energyDelta}}function Q(e){let t=e.x??e.anchor?.x??0,i=e.y??e.anchor?.y??0;return{id:e.id,label:e.label,description:e.description,group:e.group,bodyIds:e.bodyIds,datum:e.datum,state:e.state,x:t,y:i,width:e.width,height:e.height,anchor:e.anchor??{x:t,y:i},completion:e.completion,tether:e.tether,semanticItem:e.semanticItem}}function J(e){let t=e.idPrefix??"lane",i={thickness:e.thickness??8,friction:e.friction??.5,restitution:e.restitution??.16},n=[R(t+"-top",e.left,e.top,e.right,e.top,i),R(t+"-bottom",e.left,e.bottom,e.right,e.bottom,i)];return e.openEnds||n.push(R(t+"-left",e.left,e.top,e.left,e.bottom,i),R(t+"-right",e.right,e.top,e.right,e.bottom,i)),n}function Z(e,t,i){return Math.max(t,Math.min(i,e))}function ee(e){return 6.2*e.length}function te(e,t,i="auto"){let n=Math.max(1,Math.floor(t/6.2)),s="compact"===i||"full"!==i&&ee(e)>t?function(e,t){let i=e.trim();if(t>=i.length)return i;if(1>=t)return i.slice(0,1);let n=i.split(/\s+/).filter(Boolean).map(e=>e[0]).join("").toUpperCase();return n.length>1&&t>=n.length?n:t>3?i.slice(0,Math.max(1,t-2))+"..":i.slice(0,t).toUpperCase()}(e,n):e;return{text:s,textLength:ee(s)>t?Math.max(4,t):void 0}}function ie(e,t={}){let{showFlowSpine:i=!0,showStageCounts:n=!0,showCapacityBadges:s=!0,showGroupSockets:r=!0,stageLabelMode:o="auto",outlineStages:a=!1,testId:l="process-flow-chrome"}=t,{width:d,height:h,left:u,right:c,topY:p,bottomY:f,midY:m,stages:y,groups:x=[]}=e,g=f-p;return Zt("svg",{"aria-hidden":"true","data-testid":l,"data-outline-stages":a?"true":void 0,width:d,height:h,viewBox:`0 0 ${d} ${h}`,style:{position:"absolute",inset:0,pointerEvents:"none"},className:["semiotic-process-chrome",a?"semiotic-process-chrome--outline-stages":null].filter(Boolean).join(" "),children:[Jt("defs",{children:Zt("linearGradient",{id:"semiotic-process-floor",x1:"0",x2:"0",y1:"0",y2:"1",children:[Jt("stop",{offset:"0%",stopColor:"var(--semiotic-process-floor, var(--semiotic-bg, #0f172a))",stopOpacity:"0.2"}),Jt("stop",{offset:"100%",stopColor:"var(--semiotic-process-lane, var(--semiotic-surface, #1e293b))",stopOpacity:"0.55"})]})}),Jt("rect",{x:0,y:0,width:d,height:h,fill:"url(#semiotic-process-floor)"}),Jt("rect",{x:u-6,y:p-8,width:c-u+12,height:g+16,rx:14,fill:"var(--semiotic-process-lane, var(--semiotic-surface, #111827))",fillOpacity:.45,stroke:"var(--semiotic-process-border, var(--semiotic-border, #334155))",strokeOpacity:.95}),i?Jt("line",{x1:u+8,x2:c-8,y1:m,y2:m,stroke:"var(--semiotic-process-border, var(--semiotic-border, #475569))",strokeWidth:2,strokeDasharray:"6 8",opacity:.55}):null,y.map((e,t)=>{let i=function(e){return e.absorb?"absorb":e.portalTarget?"portal":null!=e.capacity?"capacity":"flow"}(e),r=ei[i],l=Math.max(12,e.width-8),d=Z(l-8,22,88),u=te(e.label,Math.max(8,d-10),o),c="none"!==o&&l-8>=22,x=function(e){if(null!=e.capacity){let t=null!=e.queueDepth?" · q "+e.queueDepth:"";return e.capacityLabel?`${e.capacityLabel}${t}`:`cap ${Number.isInteger(e.capacity)?e.capacity+"":e.capacity.toFixed(1)}${t}`}return e.absorb?"absorb":e.portalTarget?"portal":"flow"}(e),b=te(x,Math.max(16,l-10),"auto"),v=s&&!1!==e.showBadge&&l>=32,w=null!=e.count?`n=${e.count}${null!=e.processed?" done "+e.processed:""}`:"",S=te(w,Math.max(16,l-8),"auto"),M=Math.max(30,p-15),k=M-13;return Zt("g",{"data-stage":e.id,"data-role":i,children:[Jt("rect",{className:"semiotic-process-chrome__stage-bay",x:e.x0+4,y:p+6,width:l,height:g-12,rx:10,fill:a?"none":r.fill,stroke:r.stroke,strokeWidth:a?1.85:"flow"===i?1:1.6}),y.length-1>t?Jt("polygon",{points:`${e.x1-2},${m-7} ${e.x1+8},${m} ${e.x1-2},${m+7}`,fill:r.accent,opacity:.85}):null,c?Zt(Qt,{children:[Jt("rect",{className:"semiotic-process-chrome__stage-label-bg",x:e.x-d/2,y:k,width:d,height:18,rx:9,fill:"var(--semiotic-bg, #0f172a)",fillOpacity:.75,stroke:r.stroke}),Zt("text",{x:e.x,y:M,textAnchor:"middle",fill:r.accent,fontSize:10,fontWeight:800,className:"semiotic-process-chrome__stage-label",textLength:u.textLength,lengthAdjust:u.textLength?"spacingAndGlyphs":void 0,children:[Jt("title",{children:e.label}),u.text]})]}):null,v?Zt("text",{x:e.x,y:p+22,textAnchor:"middle",fill:"var(--semiotic-process-muted, var(--semiotic-text-secondary, #94a3b8))",fontSize:9,fontWeight:700,textLength:b.textLength,lengthAdjust:b.textLength?"spacingAndGlyphs":void 0,children:[Jt("title",{children:x}),b.text]}):null,n&&null!=e.count?Zt("text",{x:e.x,y:Math.min(h-8,f+16),textAnchor:"middle",fill:"var(--semiotic-process-text, var(--semiotic-text, #e2e8f0))",fontSize:11,fontWeight:800,textLength:S.textLength,lengthAdjust:S.textLength?"spacingAndGlyphs":void 0,children:[Jt("title",{children:w}),S.text]}):null]},e.id)}),r?x.map((e,t)=>{let i=e.total??0,n=e.absorbed??0,s=e.complete??(i>0&&n>=i),r=!s&&i>0&&n/i>=.75,o=s?"rgba(52, 211, 153, 0.35)":r?"rgba(251, 191, 36, 0.28)":"rgba(15, 23, 42, 0.75)",a=s?"#34d399":r?"#fbbf24":"var(--semiotic-border, #64748b)",l=i>0?`${n}/${i}${s?" shipped":r?" almost":""}`:"feature "+(t+1),d=Z(Math.max(54,ee(e.label)+18,ee(l)+16),54,104),h=te(e.label,d-12,"auto"),u=te(l,d-12,"auto");return Zt("g",{"data-group":e.id,children:[Jt("rect",{x:e.x-d/2,y:e.y-22,width:d,height:44,rx:10,fill:o,stroke:a,strokeWidth:1.5}),Zt("text",{x:e.x,y:e.y-4,textAnchor:"middle",fill:"var(--semiotic-process-text, var(--semiotic-text, #f8fafc))",fontSize:10,fontWeight:800,textLength:h.textLength,lengthAdjust:h.textLength?"spacingAndGlyphs":void 0,children:[Jt("title",{children:e.label}),h.text]}),Zt("text",{x:e.x,y:e.y+12,textAnchor:"middle",fill:a,fontSize:9,fontWeight:700,textLength:u.textLength,lengthAdjust:u.textLength?"spacingAndGlyphs":void 0,children:[Jt("title",{children:l}),u.text]})]},e.id)}):null]})}function ne(e,t,i){if(i)return i;let n=e??"circle";if("chevron"===n)return function(e){let t=1.5*se(e),i=.92*t;return`M0,${-t}L${i},${(.78*t).toFixed(3)}L0,${(.28*t).toFixed(3)}L${-i},${(.78*t).toFixed(3)}Z`}(t);let s=Object.prototype.hasOwnProperty.call(di,n)?di[n]:ii;return ti(s,Math.max(1,t))()??""}function se(e){return Math.sqrt(Math.max(1,e)/Math.PI)}function re(e,t,i){if(!i&&"circle"===(e??"circle"))return se(t);let n=i?"p:"+i:`s:${e??"circle"}:${t}`,s=ci.get(n);if(null!=s)return s;let r=ne(e,t,i).match(/-?\d*\.?\d+(?:e-?\d+)?/gi),o=0;if(r)for(let e=0;r.length>e+1;e+=2){let t=+r[e],i=+r[e+1],n=Math.sqrt(t*t+i*i);n>o&&(o=n)}return o>0?(ci.size>512&&ci.clear(),ci.set(n,o),o):se(t)}function oe(e,t){let i=new Map,n=0;return s=>{let r=e(s)+"",o=t&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(o&&hi.has(o))return o;let a=i.get(r);return a||(a=ui[n%ui.length],n++,i.set(r,a)),a}}function ae(e,t){let[i,n]=e.viewBox??pi,[s,r]=e.anchor??fi,o=n>0?n:1,a=Math.max(0,t)/o,l=(i>0?i:o)*a,d=o*a;return{width:l,height:d,scale:a,offsetX:-s*l,offsetY:-r*d}}function le(e,t){let i=ae(e,t),n=[[i.offsetX,i.offsetY],[i.offsetX+i.width,i.offsetY],[i.offsetX,i.offsetY+i.height],[i.offsetX+i.width,i.offsetY+i.height]],s=0;for(let[e,t]of n){let i=Math.sqrt(e*e+t*t);i>s&&(s=i)}return s}function de(e,t,i,n){if("none"!==e)return"color"===e||null==e?t??n:"accent"===e?i:e}function he(e){if(typeof Path2D>"u")return null;mi||(mi=new Map);let t=mi.get(e);if(t)return t;let i=new Path2D(e);return mi.size>1024&&mi.clear(),mi.set(e,i),i}function ue(e,t,i=0,n="horizontal"){let[s,r]=e.viewBox??pi,o=Math.min(1,Math.max(0,i)),a=Math.min(1,Math.max(0,t));return a>o?o>0||1>a?"vertical"===n?{x:0,y:r*(1-a),width:s,height:r*(a-o)}:{x:s*o,y:0,width:s*(a-o),height:r}:null:{x:0,y:0,width:0,height:0}}function ce(e,t){let i=ae(e,t);return{centerDx:i.offsetX+i.width/2,centerDy:i.offsetY+i.height/2,halfWidth:i.width/2,halfHeight:i.height/2,radius:Math.hypot(i.width,i.height)/2}}function pe(e,t,i,n,s,r=e=>e){for(let o of t.parts){let t=he(o.d);if(!t)continue;let a=o.opacity??1,l=e.globalAlpha;1!==a&&(e.globalAlpha=l*a);let d=s?"none"===o.fill?void 0:s:de(o.fill,i,n);d&&(e.fillStyle=r(d),e.fill(t));let h=s?o.stroke&&"none"!==o.stroke?s:void 0:de(o.stroke??"none",i,n);h&&(e.strokeStyle=r(h),e.lineWidth=o.strokeWidth??1,e.lineCap=o.strokeLinecap??"butt",e.lineJoin=o.strokeLinejoin??"miter",e.stroke(t)),1!==a&&(e.globalAlpha=l)}}function fe(e){return!!e&&"object"==typeof e&&yi.has(function(e){return"string"==typeof e?.type?e.type:""}(e))}function me(e){return"primary"===e?.emphasis||!0===e?.defensive}function ye(e,t,i={}){return"number"==typeof i.maxAnnotations&&Number.isFinite(i.maxAnnotations)?Math.max(0,Math.floor(i.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(i.areaPerAnnotation&&i.areaPerAnnotation>0?i.areaPerAnnotation:2e4))):1/0}function xe(e){let t,i=e?.emphasis;t="primary"===i?100:"secondary"===i?10:50;let n=e?.provenance?.confidence;switch("number"==typeof n&&Number.isFinite(n)&&(t+=15*Math.max(0,Math.min(1,n))),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}function ge(e){let{annotations:t,width:i,height:n}=e,s=Math.max(0,e.minVisible??1),r=ye(i,n,e),o=t.map((e,t)=>{return{annotation:e,index:t,note:(i=e,fe(i))};var i}),a=o.filter(e=>e.note);if(0===a.length||r>=a.length)return{visible:t.slice(),deferred:[],budget:r};let l=a.filter(e=>me(e.annotation)),d=a.filter(e=>!me(e.annotation)).sort((e,t)=>xe(t.annotation)-xe(e.annotation)||e.index-t.index),h=Math.min(d.length,Math.max(Math.max(0,r-l.length),Math.max(0,s-l.length))),u=new Set([...l.map(e=>e.index),...d.slice(0,h).map(e=>e.index)]),c=[],p=[];for(let{annotation:e,index:t,note:i}of o)!i||u.has(t)?c.push(e):p.push(e);return{visible:c,deferred:p,budget:r}}function be(e,t){let i=t.scales?.x??t.scales?.time;return i?null!=e.x?i(e.x):t.xAccessor&&null!=e[t.xAccessor]?i(e[t.xAccessor]):null:null}function ve(e,t){let i=t.scales?.y??t.scales?.value;return i?null!=e.y?i(e.y):t.yAccessor&&null!=e[t.yAccessor]?i(e[t.yAccessor]):null:null}function we(e){return null==e?null:e+""}function Se(e,t,i){return t.stickyPositionCache?.set(e,i),i}function Me(e,t,i){let n=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===n){if(null!=e.pointId&&i.pointNodes&&i.pointNodes.length>0)for(let n=i.pointNodes.length-1;n>=0;n--){let s=i.pointNodes[n];if(s.pointId===e.pointId)return Se(t,i,{x:s.x,y:s.y})}let n=function(e){let t=e.data;if(!t||0===t.length)return null;let i=t[t.length-1],n=e.scales?.x??e.scales?.time,s=e.scales?.y??e.scales?.value;if(!n||!s)return null;let r=i[e.xAccessor||"x"],o=i[e.yAccessor||"y"];return null==r||null==o?null:{x:n(r),y:s(o)}}(i);return n?Se(t,i,n):null}if("semantic"===n){let n=function(e,t,i){let n=function(e){return we(e.provenance?.stableId??e.stableId)}(e);if(!n)return null;let s=i.pointNodes?.find(e=>we(e.pointId)===n);if(s)return Se(t,i,{x:s.x,y:s.y});let r=i.data?.find(e=>function(e){return we(e.stableId??e.id??e.provenance?.stableId)}(e)===n);if(!r)return null;let o=be(r,i),a=ve(r,i);return null==o||null==a?null:Se(t,i,{x:o,y:a})}(e,t,i);if(n)return n}let s=null,r=null;if(null!=e.pointId&&i.pointNodes){let t=i.pointNodes.find(t=>t.pointId===e.pointId);t&&(s=t.x,r=t.y)}if((null==s||null==r)&&(s=be(e,i),r=ve(e,i)),null!=s&&null!=r)return Se(t,i,{x:s,y:r});if("sticky"===n){let e=i.stickyPositionCache?.get(t);if(e)return e}return null}function ke(e,t,i,n=50){return!(-n>e||e>(i.width||0)+n||-n>t||t>(i.height||0)+n)}function Ie(e){return{label:e.label,title:e.title,wrap:e.wrap||120,noWrap:"function"==typeof e._noteLayout?e.noWrap:void 0,_noteLayout:e._noteLayout}}function Be(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function Oe(e,t,i){if(!e)return[];let n=Math.max(1,Math.floor(t/i)),s=[],r="";for(let t of e.split(/\s+/))t&&(r&&r.length+1+t.length>n?(s.push(r),r=t):r=r?`${r} ${t}`:t);return r&&s.push(r),s}function Ae(e){let t=e?.provenance;if(!t||"object"!=typeof t)return e;let i="string"==typeof t.source?Object.prototype.hasOwnProperty.call(Mi,t.source)?Mi[t.source]:t.source:null,n="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!i&&!n||null!=e.label&&"string"!=typeof e.label)return e;let s=[i,n].filter(Boolean).join(" · "),r="string"==typeof e.label?e.label:"";return r.includes(`(${s})`)?e:{...e,label:r?`${r} (${s})`:`(${s})`}}function qe(e){if(!Ce(e))return e;let t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function Ce(e){return fe(e)}function Pe(e,t,i,n,s){let r=e+i,o=t+n;return Math.abs(i)>Math.abs(n)?{x:0>i?r-s.width-4:r+4,y:0>n?o-s.height:o,width:s.width,height:s.height}:{x:0>i?r-s.width:r,y:0>n?o-s.height-4:o+4,width:s.width,height:s.height}}function Fe(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function Ne(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function $e(e,t,i,n,s,r,o,a){let l=Fe(e,o),d=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,i,n){let s=Math.max(0,n-e.x),r=Math.max(0,n-e.y);return(s+Math.max(0,e.x+e.width-(t-n)))*e.height+(r+Math.max(0,e.y+e.height-(i-n)))*e.width}(l,s,r,a);for(let e of i)d+=12*Ne(l,e);for(let e of n)d+=4*Ne(l,e);return d}function De(e){let{annotations:t,context:i,defaultOffset:n=gi,notePadding:s=bi,markPadding:r=vi,edgePadding:o=wi,preserveManualOffsets:a=!0,routeLongConnectors:l=!0,connectorThreshold:d=Si,density:h,progressiveDisclosure:u=!1,redundantCues:c=!1,responsive:p,mobile:f,cohesion:m,audience:y}=e,x=i.width||0,g=i.height||0,b="object"==typeof f?f:{},v=b.breakpoint??480,w=!!f&&v>=x,S=w&&!1!==b.preferShortText?t.map(qe):t,M=w&&!h?{maxAnnotations:b.maxAnnotations??("callout-list"===b.strategy?1:2),minVisible:b.minVisible??1}:h,k=u||w&&(!1!==b.progressiveDisclosure||"callout-list"===b.strategy),I=w&&!p?b.responsive??{minWidth:v}:p,B=w&&!m?b.cohesion:m;if(0===S.length||0>=x||0>=g)return S.slice();let O=[],A=function(e,t){return(e.pointNodes||[]).map(e=>{let i=Math.max(1,e.r||1)+t;return{x:e.x-i,y:e.y-i,width:2*i,height:2*i}})}(i,r),q=!1,C=S.map((e,t)=>{if(!Ce(e))return e;let r=function(e,t,i){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};let n=e.pointId??e.nodeId;if(null!=n&&i.pointNodes){let e=i.pointNodes.find(e=>e.pointId===n);if(e)return{x:e.x,y:e.y}}let s=e.coordinates,r=i.scales?.geoProjection;if(Array.isArray(s)&&s.length>=2&&r){let e=s[0],t=s[1];if("number"==typeof e&&"number"==typeof t){let i=r([e,t]);if(i&&"number"==typeof i[0]&&"number"==typeof i[1])return{x:i[0],y:i[1]}}}return i.scales||"number"!=typeof e.x||"number"!=typeof e.y?Me(e,t,i):{x:e.x,y:e.y}}(e,t,i);if(!r)return e;let h=function(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};let t=Be(e);if(t)return{width:Math.max(24,t.width+10),height:Math.max(18,t.height+6)};let i="number"==typeof e.wrap?e.wrap:120,n=[...Oe("string"==typeof e.title?e.title:void 0,i,7),...Oe("string"==typeof e.label?e.label:void 0,i,7)],s=n.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(i,7*s)+10),height:Math.max(18,16*n.length+6)}}(!0===e.defensive?Ae(e):e);if(a&&("number"==typeof(u=e).dx||"number"==typeof u.dy)){let t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e);return O.push(Fe(Pe(r.x,r.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,h),s)),e}var u;let c=null,p=1/0;for(let e of function(e){let t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}(n)){let t=$e(Pe(r.x,r.y,e.dx,e.dy,h),e,O,A,x,g,s,o);p>t&&(c=e,p=t)}if(!c)return e;let f=Fe(Pe(r.x,r.y,c.dx,c.dy,h),s);O.push(f);let m=Math.hypot(c.dx,c.dy),y=l&&m>=d&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return q=!0,{...e,dx:c.dx,dy:c.dy,...y?{connector:y}:{}}}),P=q?C:S.slice(),F=P;if(c){let e=!1,t=P.map(t=>{let i=function(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}(t);return i!==t&&(e=!0),i});F=e?t:P}{let e=!1,t=F.map(t=>{if(!0!==t?.defensive)return t;let i=Ae(t);return i!==t&&(e=!0),i});F=e?t:F}let N,$=new Set;if(M){let e="object"==typeof M?M:{},t=function(e){if(!e)return 1;let t=function(e){let t=e?.familiarity;if(!t)return 3;let i=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===i.length?3:i.reduce((e,t)=>e+t,0)/i.length}(e);return t>2?4>t?1:.6:1.5}(y),i=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??ye(x,g,e))*t))},{deferred:n}=ge({annotations:F,width:x,height:g,...i});for(let e of n)$.add(e)}if(I&&("object"==typeof I&&"number"==typeof I.minWidth?I.minWidth:480)>=x)for(let e of F)Ce(e)&&"secondary"===e.emphasis&&$.add(e);if($.size>0)for(let e of F)!0===e?.defensive&&$.delete(e);return N=0===$.size?F:k?F.map(e=>$.has(e)?{...e,_annotationDeferred:!0}:e):F.filter(e=>!$.has(e)),B?function(e,t){let i=!1,n=e.map(e=>Ce(e)&&"blended"!==e.cohesion&&"layer"!==e.cohesion?(i=!0,{...e,cohesion:t}):e);return i?n:e}(N,B):N}function Te(){let e=(Bi??(Bi=ki.createContext(null)),Bi);return ki.useContext(e)??Oi}function Le(e){let t=e.fixedPosition;Number.isFinite(t?.x)&&(e.x=e.prevX=t.x,e.vx=0),Number.isFinite(t?.y)&&(e.y=e.prevY=t.y,e.vy=0)}function je(e){if(!e)return;let t=Number.isFinite(e.x)?e.x:void 0,i=Number.isFinite(e.y)?e.y:void 0;return null==t&&null==i?void 0:{x:t,y:i}}function Re(e,t,i){let n,s="x"===i?"y":"x",r=Math.abs(t[i]-e[i]),o=t[s]-e[s],a=(e,t)=>"circle"===e.shape.type?e.shape.radius:("x"===t?e.shape.width:e.shape.height)/2;if("circle"===e.shape.type&&"circle"===t.shape.type){let i=e.shape.radius+t.shape.radius;n=Math.sqrt(Math.max(0,i*i-r*r))}else if("aabb"===e.shape.type&&"aabb"===t.shape.type)n=a(e,s)+a(t,s);else{let o="aabb"===e.shape.type?e:t,l=a("circle"===e.shape.type?e:t,i),d=Math.max(0,r-a(o,i));n=a(o,s)+Math.sqrt(Math.max(0,l*l-d*d))}let l=0>o?-1:1;return{nx:"x"===s?l:0,ny:"y"===s?l:0,penetration:Math.max(0,n-Math.abs(o))}}function We(e){return"circle"===e.type?{type:"circle",radius:e.radius}:{type:"aabb",width:e.width,height:e.height}}function Ye(e){return"aabb"===e.type?{type:"aabb",x:e.x,y:e.y,width:e.width,height:e.height}:{type:"segment",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,thickness:e.thickness}}function Ee(e){return{id:e.id,x:e.x,y:e.y,prevX:e.prevX,prevY:e.prevY,vx:e.vx,vy:e.vy,angle:e.angle,mass:e.mass,bodyCollisions:e.bodyCollisions,...e.fixedPosition?{fixedPosition:je(e.fixedPosition)}:{},shape:We(e.shape),sleeping:e.sleeping,datum:e.datum,index:e.index,sleepTime:e.sleepTime,restitution:e.restitution,friction:e.friction}}function Xe(e){return e&&"function"!=typeof e?{property:e.property,equals:e.equals,notEquals:e.notEquals,oneOf:e.oneOf?.slice(),notOneOf:e.notOneOf?.slice()}:e}function ze(e){return{id:e.id,shape:Ye(e.shape),sensor:e.sensor,restitution:e.restitution,friction:e.friction,bodyFilter:Xe(e.bodyFilter),index:e.index}}function Ge(e,t,i){return Math.max(t,Math.min(i,e))}function He(e,t,i){return Math.min(e??i,t??i)}function Ke(e,t,i){return Ge(Math.max(e??i,t??i),0,1)}function Ue(e){return 0>e?-1:1}function _e(e){if("circle"===e.shape.type){let t=e.shape.radius;return{minX:e.x-t,minY:e.y-t,maxX:e.x+t,maxY:e.y+t}}let t=e.shape.width/2,i=e.shape.height/2;return{minX:e.x-t,minY:e.y-i,maxX:e.x+t,maxY:e.y+i}}function Ve(e){let t=e.shape;if("aabb"===t.type){let e=t.width/2,i=t.height/2;return{minX:t.x-e,minY:t.y-i,maxX:t.x+e,maxY:t.y+i}}let i=(t.thickness??0)/2;return{minX:Math.min(t.x1,t.x2)-i,minY:Math.min(t.y1,t.y2)-i,maxX:Math.max(t.x1,t.x2)+i,maxY:Math.max(t.y1,t.y2)+i}}function Qe(e,t){return!(e.minX>t.maxX||t.minX>e.maxX||e.minY>t.maxY||t.minY>e.maxY)}function Je(e,t,i,n,s,r,o,a){let l=s-e,d=(i+o)/2-Math.abs(l);if(0>=d)return null;let h=r-t,u=(n+a)/2-Math.abs(h);return u>0?u>d?{nx:Ue(l),ny:0,penetration:d}:{nx:0,ny:Ue(h),penetration:u}:null}function Ze(e,t,i,n,s,r,o){let a=r/2,l=o/2,d=e-Ge(e,n-a,n+a),h=t-Ge(t,s-l,s+l),u=d*d+h*h;if(u>i*i)return null;if(qi>=u){let r=Math.abs(e-(n-a)),o=Math.abs(e-(n+a)),d=Math.abs(t-(s-l)),h=Math.abs(t-(s+l)),u=Math.min(r,o,d,h);return u===r?{nx:-1,ny:0,penetration:i+r}:u===o?{nx:1,ny:0,penetration:i+o}:u===d?{nx:0,ny:-1,penetration:i+d}:{nx:0,ny:1,penetration:i+h}}let c=Math.sqrt(u);return{nx:d/c,ny:h/c,penetration:i-c}}function et(e,t){if("circle"===e.shape.type&&"circle"===t.shape.type)return function(e,t,i,n,s,r){let o=n-e,a=s-t,l=i+r,d=o*o+a*a;if(d>=l*l)return null;if(qi>=d)return{nx:1,ny:0,penetration:l};let h=Math.sqrt(d);return{nx:o/h,ny:a/h,penetration:l-h}}(e.x,e.y,e.shape.radius,t.x,t.y,t.shape.radius);if("aabb"===e.shape.type&&"aabb"===t.shape.type)return Je(e.x,e.y,e.shape.width,e.shape.height,t.x,t.y,t.shape.width,t.shape.height);if("circle"===e.shape.type&&"aabb"===t.shape.type){let i=Ze(e.x,e.y,e.shape.radius,t.x,t.y,t.shape.width,t.shape.height);return i?{nx:-i.nx,ny:-i.ny,penetration:i.penetration}:null}return"aabb"===e.shape.type&&"circle"===t.shape.type?Ze(t.x,t.y,t.shape.radius,e.x,e.y,e.shape.width,e.shape.height):null}function tt(e,t){let i=t.shape;return"aabb"===i.type?"circle"===e.shape.type?Ze(e.x,e.y,e.shape.radius,i.x,i.y,i.width,i.height):Je(i.x,i.y,i.width,i.height,e.x,e.y,e.shape.width,e.shape.height):function(e,t,i,n,s,r,o,a=0){let l=r-n,d=o-s,h=l*l+d*d,u=h>qi?Ge(((e-n)*l+(t-s)*d)/h,0,1):0,c=i+a/2,p=e-(n+l*u),f=t-(s+d*u),m=p*p+f*f;if(m>=c*c)return null;if(qi>=m){let e=Math.sqrt(h);return e>qi?{nx:-d/e,ny:l/e,penetration:c}:{nx:1,ny:0,penetration:c}}let y=Math.sqrt(m);return{nx:p/y,ny:f/y,penetration:c-y}}(e.x,e.y,"circle"===e.shape.type?e.shape.radius:Math.sqrt(e.shape.width*e.shape.width+e.shape.height*e.shape.height)/2,i.x1,i.y1,i.x2,i.y2,i.thickness??0)}function it(e,t){return`${e}\0${t}`}function nt(e){let t=e.indexOf("\0");return{sensorId:e.slice(0,t),bodyId:e.slice(t+1)}}function st(e,t){if(!t)return;let i=e;for(let e of t.split(".")){if(null==i||"object"!=typeof i||!Object.prototype.hasOwnProperty.call(i,e))return;i=i[e]}return i}function rt(e,t){return!!t?.some(t=>Object.is(e,t))}function ot(e,t){if(!t)return!0;if("function"==typeof t)return t(e);let i=st(e,t.property);return!("equals"in t&&!Object.is(i,t.equals)||"notEquals"in t&&Object.is(i,t.notEquals)||t.oneOf&&!rt(i,t.oneOf)||t.notOneOf&&rt(i,t.notOneOf))}function at(e,t){return ot(t,e.bodyFilter)}function lt(e,t){if(!Number.isFinite(t))return;e.count+=1,e.total+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t);let i=t-e.mean;e.mean+=i/e.count,e.m2+=i*(t-e.mean)}function dt(e){return{count:e.count,total:e.total,mean:e.count>0?e.mean:0,min:e.count>0?e.min:0,max:e.count>0?e.max:0,variance:e.count>1?e.m2/(e.count-1):0}}function ht(e){return{count:e.count,total:e.total,mean:e.mean,m2:e.variance*Math.max(0,e.count-1),min:e.count>0?e.min:1/0,max:e.count>0?e.max:-1/0}}function ut(e,t){if(null!=e[t])return e[t];let i=e.datum;return i&&"object"==typeof i?i[t]:void 0}function ct(e,t,i){return"function"==typeof e?e(t,i):"string"==typeof e?ut(t,e):void 0}function pt(e){if(null==e)return;let t=e+"";return t.trim()?t:void 0}function ft(e){let t=dt(e.value);return{id:e.id,label:e.label,count:t.count,total:t.total,bodyIds:e.bodyIds.slice(),lastBodyId:e.lastBodyId,lastDatum:e.lastDatum,x:dt(e.x),y:dt(e.y),value:t}}function mt(e,t={}){let{baselineY:i=0,binWidth:n=24,gap:s=2,maxHeight:r=80,value:o="count",x:a}=t,l=Math.max(1,...e.map(e=>e[o]));return e.map((e,t)=>{let d=Math.max(0,e[o]/l*r),h=a?.(e,t)??t*(n+s);return{binId:e.id,label:e.label,index:t,count:e.count,total:e.total,x:h,y:i-d,width:n,height:d,meanX:e.x.mean,meanY:e.y.mean}})}function yt(e={},t=Di){return{chartId:e.chartId??t.chartId,chartType:e.chartType??t.chartType,sensors:e.sensors??t.sensors,onObservation:e.onObservation??t.onObservation,onSimulationStateChange:e.onSimulationStateChange??t.onSimulationStateChange}}function xt(e){return{...e,shape:{...e.shape},...e.fixedPosition?{fixedPosition:{...e.fixedPosition}}:{},datum:e.datum,springs:e.springs?.map(e=>({...e,target:{...e.target}}))}}function gt(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:void 0}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function bt(e,t){if(null!=e[t])return e[t];let i=e.datum;return i&&"object"==typeof i?i[t]:void 0}function vt(e){return{...xt(e),sequence:e.sequence,spawnAt:e.spawnAt}}function wt(e){return e.map(e=>({...e,shape:{...e.shape},bodyFilter:e.bodyFilter&&"function"!=typeof e.bodyFilter?{...e.bodyFilter,oneOf:e.bodyFilter.oneOf?.slice(),notOneOf:e.bodyFilter.notOneOf?.slice()}:e.bodyFilter}))}function St(e){return!1!==e&&{...e}}function Mt(e,t){return e.spawnAt===t.spawnAt?e.sequence-t.sequence:e.spawnAt-t.spawnAt}function kt(e){return{...e,gravity:{...e.gravity}}}function It(e,t,i,n){if("circle"===e.shape.type){let s=e.x-t,r=e.y-i,o=e.shape.radius+n,a=s*s+r*r;return a>o*o?null:a}let s=Math.max(Math.abs(t-e.x)-e.shape.width/2,0),r=Math.max(Math.abs(i-e.y)-e.shape.height/2,0),o=s*s+r*r;return o>n*n?null:o}function Bt(e){let t=e.indexOf("\0");return{sensorId:e.slice(0,t),bodyId:e.slice(t+1)}}function Ot(e,t={}){let{idPrefix:i="plot",includeFloor:n=!0,includeCeiling:s=!1,includeLeftWall:r=!0,includeRightWall:o=!0,wallThickness:a=20,floorThickness:l=a}=t,d=[],h=e.x+e.width/2,u=e.y+e.height/2;return n&&d.push({id:i+"-floor",shape:{type:"aabb",x:h,y:e.y+e.height+l/2,width:e.width+2*a,height:l}}),s&&d.push({id:i+"-ceiling",shape:{type:"aabb",x:h,y:e.y-l/2,width:e.width+2*a,height:l}}),r&&d.push({id:i+"-left-wall",shape:{type:"aabb",x:e.x-a/2,y:u,width:a,height:e.height+2*l}}),o&&d.push({id:i+"-right-wall",shape:{type:"aabb",x:e.x+e.width+a/2,y:u,width:a,height:e.height+2*l}}),d}function At(e){let{idPrefix:t="bin",count:i,domainStart:n,domainStep:s,xScale:r,yTop:o,yBottom:a,wallThickness:l=4,includeBoundaryWalls:d=!0,includeInteriorWalls:h=!0,closedBefore:u,lidY:c=o,lidThickness:p=Math.max(2,l)}=e,f=[],m=o+(a-o)/2,y=Math.abs(a-o),x=d?i:i-1;if(h||d)for(let e=d?0:1;x>=e;e+=1){if(!h&&e>0&&i>e)continue;let o=r(n+e*s);f.push({id:`${t}-wall-${e}`,shape:{type:"aabb",x:o,y:m,width:l,height:y}})}if(null!=u)for(let e=0;i>e;e+=1){let i=n+e*s,o=i+s;if(o>=u)continue;let a=r(i),d=r(o);f.push({id:`${t}-lid-${e}`,shape:{type:"segment",x1:Math.min(a,d)+l/2,y1:c,x2:Math.max(a,d)-l/2,y2:c,thickness:p}})}return f}function qt(e,t={}){return e?"function"==typeof e?e(t):(e.init(t),e):function(e={}){return new Ti(e)}(t)}function Ct(e){let t=Number(e);if(Number.isFinite(t)&&t>0)return Math.floor(t)}function Pt(e,t){let i={...e};for(let e of t)i[Li[e]]++;return i}function Ft(e,t,i){let n=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:n,revisions:Pt(i,n)}}function Nt(e){let t="preserve",i=new Set;for(let n of e){let e=Ui[n]??_i;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}function $t(e,t){return e===t||!(!e||!t||e.gravity?.x!==t.gravity?.x||e.gravity?.y!==t.gravity?.y)&&Vi.every(i=>e[i]===t[i])}function Dt(e,t,i,n){return e||!t?"paused":i||!n?"running":"settled"}function Tt(e,t,i,n={}){let s,r=0;for(;t>r&&!n.shouldStop?.()&&(!1===n.stopAtRest||e.queueSize()>0||!e.atRest()||n.continueWhile?.());){e.step(e.fixedDt),e.advanceTime(e.fixedDt);let t=e.drainEvents();i.events&&(i.events.push(...t),e.observeKernelEvents(t,i.observations),e.observeSensorTransitions(i.observations));let o=[];if(e.spawnDue(o,i.observations),o.length>0){i.spawned.push(...o),s=e.observeBodyBudget(i.observations);let t=e.evictOverflow(i.observations);i.evicted?.push(...t.evicted),i.sedimented?.push(...t.sedimented)}r+=1,e.refreshQuiescence(e.fixedDt,o.length),n.afterStep?.()}return{steps:r,budget:s}}function Lt(e,t){let i=new Map;for(let t of e)i.set(t.id,new Set);for(let e of t)i.has(e.source)||i.set(e.source,new Set),i.has(e.target)||i.set(e.target,new Set),i.get(e.source).add(e.target);return i}function jt(e,t,i={}){let n=new Set,s=[...e.get(t)??[]];for(let t=0;s.length>t;t++){let i=s[t];n.has(i)||(n.add(i),s.push(...e.get(i)??[]))}return i.includeStart&&n.add(t),n}function Rt(e,t,i){if(i.some(e=>null!=e.__forceRadius))return e=>e.__forceRadius??8;if(null==e)return()=>8;if("number"==typeof e)return()=>e;if("function"==typeof e)return t=>e(t)||8;let n=t||[5,20],s=[];for(let t of i){let i=t.data?.[e];"number"==typeof i&&s.push(i)}if(0===s.length)return()=>n[0];let[r,o]=Wt(s);if(r===o)return()=>(n[0]+n[1])/2;let a=Zi().domain([r,o]).range(n).clamp(!0);return t=>{let i=t.data?.[e];return null==i||"number"!=typeof i?n[0]:a(i)}}import{getMinMax as Wt}from"./c-QA3HMQJP.min.js";import{interpolateRgb as Yt}from"d3-interpolate";var Et=864e5,Xt=e=>{let t=e.config,{plot:i}=e.dimensions;if(0>=i.width||0>=i.height)return{nodes:[]};let n=e=>{let i="function"==typeof t.dateAccessor?t.dateAccessor(e):e[t.dateAccessor];return i instanceof Date?i:new Date(i)},s=e=>{let i="function"==typeof t.valueAccessor?t.valueAccessor(e):e[t.valueAccessor];return Number(i)},r=new Map,o=null;for(let t of e.data){let e=n(t);if(!isFinite(e.getTime()))continue;null==o&&(o=e.getUTCFullYear());let i=a(e),l=s(t);r.set(i,(r.get(i)??0)+(Number.isFinite(l)?l:0))}let l=t.year??o??(new Date).getUTCFullYear(),d=1/0,h=-1/0;for(let e of r.values())d>e&&(d=e),e>h&&(h=e);d===1/0&&(d=0,h=0);let[u,c]=t.colorRamp??[e.theme.semantic.surface??"#ebedf0",e.theme.semantic.primary??"#216e39"],p=e=>{if(h===d)return u;let t=(e-d)/(h-d);return Yt(u,c)(t)},f=t.gutter??2,m=t.labelInset??0,y=Math.min((i.width-m-53*f)/54,(i.height-6*f)/7);if(0>=y)return{nodes:[]};let x=new Date(Date.UTC(l,0,1)),g=x.getUTCDay(),b=new Date(x.getTime()-g*Et),v=[];for(let e=0;54>e;e++)for(let t=0;7>t;t++){let n=new Date(b.getTime()+(7*e+t)*Et);if(n.getUTCFullYear()!==l)continue;let s=a(n),o=r.get(s),d=null==o?u:p(o);v.push({type:"rect",x:i.x+m+e*(y+f),y:i.y+t*(y+f),w:y,h:y,style:{fill:d,stroke:"none"},datum:{date:n,value:o??0}})}return{nodes:v}};import{interpolateLab as zt}from"d3-interpolate";var Gt=class{constructor(e=12){this.maxSize=e,this.store=new Map}get(e){return this.store.get(e)}set(e,t){this.store.size>=this.maxSize&&this.store.clear(),this.store.set(e,t)}getOrCompute(e,t){let i=this.store.get(e);if(void 0!==i)return i;let n=t();return this.set(e,n),n}clear(){this.store.clear()}get size(){return this.store.size}};import{jsx as Ht,jsxs as Kt}from"react/jsx-runtime";import*as Ut from"react";import{scaleLinear as _t}from"d3-scale";var Vt=e=>{let t=e.config,{plot:i}=e.dimensions,n=t.fields??[];if(2>n.length||0>=i.width||0>=i.height)return{nodes:[]};if(0===e.data.length)return{nodes:[]};let s=Object.create(null);for(let i of n){let n=t.domains&&Object.prototype.hasOwnProperty.call(t.domains,i)?t.domains[i]:void 0;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&Number.isFinite(n[0])&&"number"==typeof n[1]&&Number.isFinite(n[1])){s[i]=[n[0],n[1]];continue}let r=1/0,o=-1/0;for(let t of e.data){let e=Number(t[i]);Number.isFinite(e)&&(r>e&&(r=e),e>o&&(o=e))}if(Number.isFinite(r)&&Number.isFinite(o))if(r===o){let e=Math.max(.01*Math.abs(r),.5);s[i]=[r-e,o+e]}else s[i]=[r,o];else s[i]=[0,1]}let r=!1!==t.showAxes,o=r?t.axisLabelPadding??24:8,a=r?18:8,l=n.map(e=>_t().domain(s[e]).range([i.y+i.height-a,i.y+o])),d=n.map((e,t)=>1===n.length?i.x+i.width/2:i.x+t/(n.length-1)*i.width),h=t.colorBy?"function"==typeof t.colorBy?t.colorBy:e=>(e[t.colorBy]??"")+"":null,u=t.opacity??.45,c=t.strokeWidth??1.25,p=e.theme.semantic.primary??"#3b6cb1",f=t.dimmedOpacity??.08,y=t.highlightFn,x=[],g=[];for(let i of e.data){let s=h?e.resolveColor(h(i)+""):p,r=!y||y(i),o=m(i,{predicate:y,baseOpacity:u,dimOpacity:f,brighten:.4}),a=r?g:x;for(let e=0;n.length-1>e;e++){let t=Number(i[n[e]]),h=Number(i[n[e+1]]);if(!Number.isFinite(t)||!Number.isFinite(h))continue;let u={type:"connector",x1:d[e],y1:l[e](t),x2:d[e+1],y2:l[e+1](h),style:{stroke:s,strokeWidth:y&&r?c+.75:c,opacity:o,fill:"none"},datum:i};a.push(u)}if(t.showPoints)for(let e=0;n.length>e;e++){let t=Number(i[n[e]]);if(!Number.isFinite(t))continue;let r={type:"point",x:d[e],y:l[e](t),r:2.5,style:{fill:s,stroke:"none",opacity:Math.min(1,o+.3)},datum:i};a.push(r)}}let b=null;if(r){let r=`var(--semiotic-border, ${e.theme.semantic.border??"#aaa"})`,h=`var(--semiotic-text, ${e.theme.semantic.text??"currentColor"})`,u=`var(--semiotic-text-secondary, ${e.theme.semantic.textSecondary??"#888"})`,c=i.y+o,p=i.y+i.height-a,f=[];for(let e=0;n.length>e;e++){let a=n[e],m=d[e],y=t.tickFormat&&Object.prototype.hasOwnProperty.call(t.tickFormat,a)?t.tickFormat[a]:void 0,x="function"==typeof y?y:e=>e.toLocaleString();f.push(Ut.createElement("line",{key:"pc-axis-line-"+e,x1:m,x2:m,y1:c,y2:p,stroke:r,strokeWidth:1})),f.push(A({keyId:"pc-axis-label-"+e,text:a,x:m,y:i.y+o-8,anchor:"middle",baseline:"auto",fontSize:12,fontWeight:600,color:h}));let[g,b]=s[a],v=5;for(let t=0;v>t;t++){let i=g+(b-g)*t/(v-1),n=l[e](i);f.push(Ut.createElement("line",{key:`pc-tick-${e}-${t}`,x1:m-3,x2:m+3,y1:n,y2:n,stroke:r,strokeWidth:1}),A({keyId:`pc-ticktext-${e}-${t}`,text:x(i),x:m+6,y:n+3,anchor:"start",baseline:"auto",fontSize:10,color:u}))}}b=Ut.createElement(Ut.Fragment,null,...f)}return{nodes:x.concat(g),overlays:b}};import{Fragment as Qt,jsx as Jt,jsxs as Zt}from"react/jsx-runtime";var ei={flow:{fill:"rgba(59, 130, 246, 0.14)",stroke:"rgba(96, 165, 250, 0.7)",accent:"#60a5fa"},capacity:{fill:"rgba(251, 146, 60, 0.18)",stroke:"rgba(251, 146, 60, 0.85)",accent:"#fb923c"},portal:{fill:"rgba(244, 114, 182, 0.14)",stroke:"rgba(244, 114, 182, 0.7)",accent:"#f472b6"},absorb:{fill:"rgba(52, 211, 153, 0.18)",stroke:"rgba(52, 211, 153, 0.8)",accent:"#34d399"}};import{symbol as ti,symbolCircle as ii,symbolCross as ni,symbolDiamond as si,symbolSquare as ri,symbolStar as oi,symbolTriangle as ai,symbolWye as li}from"d3-shape";var di={circle:ii,square:ri,triangle:ai,diamond:si,star:oi,cross:ni,wye:li},hi=new Set(["circle","square","triangle","diamond","star","cross","wye","chevron"]),ui=["circle","triangle","diamond","star","square","chevron","cross","wye"],ci=new Map,pi=[40,40],fi=[.5,.5],mi=null,yi=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),xi=(new Set(["label","callout","callout-circle","callout-rect"]),2e4),gi=32,bi=6,vi=4,wi=8,Si=72,Mi={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};import*as ki from"react";import{jsx as Ii}from"react/jsx-runtime";var Bi,Oi={isActive:!1,predicate:()=>!0},Ai={seed:1,gravity:{x:0,y:980},fixedDt:1/120,cellSize:64,collisionIterations:6,velocityDamping:.995,sleepSpeed:8,sleepAfter:.35,restitution:.1,friction:.35,maxVelocity:1600,contactWakeSpeed:200},qi=1e-9,Ci=.005,Pi=class{constructor(e={}){this.capabilities={determinism:"strict",sensors:!0,joints:!1,ccd:!1,maxBodiesHint:5e3,worker:!1},this.bodies=new Map,this.colliders=new Map,this.springs=new Map,this.activeSensors=new Set,this.supportedThisStep=new Set,this.lastEvents=[],this.nextBodyIndex=0,this.nextColliderIndex=0,this.nextSpringIndex=0,this.options={...Ai,...e},this.random=F(this.options.seed)}init(e={}){this.options={...Ai,...e},this.random=F(this.options.seed),this.bodies.clear(),this.colliders.clear(),this.springs.clear(),this.activeSensors.clear(),this.lastEvents=[],this.nextBodyIndex=0,this.nextColliderIndex=0,this.nextSpringIndex=0}spawn(e){let t={id:e.id,x:e.x,y:e.y,prevX:e.x,prevY:e.y,vx:e.vx??0,vy:e.vy??0,angle:e.angle??0,mass:Math.max(qi,e.mass??1),bodyCollisions:e.bodyCollisions??!0,...e.fixedPosition?{fixedPosition:je(e.fixedPosition)}:{},shape:We(e.shape),sleeping:!1,datum:e.datum,restitution:e.restitution,friction:e.friction,index:this.nextBodyIndex,sleepTime:0};Le(t),this.nextBodyIndex+=1,this.bodies.set(e.id,t)}remove(e){for(let t of e){this.bodies.delete(t);for(let e of Array.from(this.activeSensors))nt(e).bodyId===t&&this.activeSensors.delete(e)}}setColliders(e){this.colliders.clear(),this.activeSensors.clear(),this.nextColliderIndex=0;for(let t of e)this.colliders.set(t.id,{...t,shape:Ye(t.shape),bodyFilter:Xe(t.bodyFilter),index:this.nextColliderIndex}),this.nextColliderIndex+=1}setConstraint(e){let t=e.id??"spring-"+this.nextSpringIndex;return this.springs.set(t,{id:t,bodyId:e.bodyId,target:e.target,restLength:e.restLength??0,stiffness:e.stiffness??40,damping:e.damping??3}),this.nextSpringIndex+=1,t}removeConstraint(e){this.springs.delete(e)}applyImpulse(e,t,i){let n=this.bodies.get(e);n&&(n.vx+=t/n.mass,n.vy+=i/n.mass,Le(n),this.wake(n))}step(e=this.options.fixedDt){let t=Math.max(0,e);if(this.lastEvents=[],0===t)return;let i=this.sortedBodies();for(let e of i)e.prevX=e.x,e.prevY=e.y;this.applySprings(t);let n=this.options.maxVelocity;for(let e of i)if(!e.sleeping){if(e.vx+=this.options.gravity.x*t,e.vy+=this.options.gravity.y*t,e.vx*=this.options.velocityDamping,e.vy*=this.options.velocityDamping,Le(e),n>0){let t=Math.sqrt(e.vx*e.vx+e.vy*e.vy);if(t>n){let i=n/t;e.vx*=i,e.vy*=i}}e.x+=e.vx*t,e.y+=e.vy*t}this.supportedThisStep.clear();let s=this.bodyPairKeys(i),r=this.sortedColliders().filter(e=>!e.sensor);for(let e=0;this.options.collisionIterations>e;e+=1)this.resolveBodyPairs(i,s,0===e),this.resolveColliders(i,r,0===e);this.updateSensors(i),this.updateSleeping(i,t)}settle(e=1200,t=this.options.fixedDt){let i=0;for(;e>i&&!this.allSleeping();)this.step(t),i+=1;return i}readState(e=[]){e.length=0;for(let t of this.sortedBodies())e.push({id:t.id,x:t.x,y:t.y,prevX:t.prevX,prevY:t.prevY,vx:t.vx,vy:t.vy,angle:t.angle,mass:t.mass,...t.fixedPosition?{fixedPosition:je(t.fixedPosition)}:{},shape:We(t.shape),sleeping:t.sleeping,datum:t.datum});return e}events(){return this.lastEvents.slice()}activeSensorPairs(){return Array.from(this.activeSensors).sort().map(nt)}allSleeping(){for(let e of this.bodies.values())if(!e.sleeping)return!1;return!0}snapshot(){return{options:{...this.options,gravity:{...this.options.gravity}},bodies:this.sortedBodies().map(Ee),colliders:this.sortedColliders().map(ze),springs:Array.from(this.springs.values()).map(e=>({...e,target:{...e.target}})),activeSensors:Array.from(this.activeSensors).sort()}}restore(e){this.options={...e.options,gravity:{...e.options.gravity}},this.random=F(this.options.seed),this.bodies.clear(),this.colliders.clear(),this.springs.clear(),this.activeSensors=new Set(e.activeSensors),this.lastEvents=[],this.nextBodyIndex=0;for(let t of e.bodies){let e=Ee(t);Le(e),this.bodies.set(e.id,e),this.nextBodyIndex=Math.max(this.nextBodyIndex,e.index+1)}this.nextColliderIndex=0;for(let t of e.colliders){let e=ze(t);this.colliders.set(e.id,e),this.nextColliderIndex=Math.max(this.nextColliderIndex,e.index+1)}this.nextSpringIndex=0;for(let t of e.springs){this.springs.set(t.id,{...t,target:{...t.target}});let e=/^spring-(\d+)$/.exec(t.id);e&&(this.nextSpringIndex=Math.max(this.nextSpringIndex,Number(e[1])+1))}}dispose(){this.bodies.clear(),this.colliders.clear(),this.springs.clear(),this.activeSensors.clear(),this.lastEvents=[]}sortedBodies(){return Array.from(this.bodies.values()).sort((e,t)=>e.index-t.index)}sortedColliders(){return Array.from(this.colliders.values()).sort((e,t)=>e.index-t.index)}applySprings(e){for(let t of Array.from(this.springs.values()).sort((e,t)=>e.id.localeCompare(t.id))){let i=this.bodies.get(t.bodyId);if(!i||i.sleeping)continue;let n="point"===t.target.type?t.target:this.bodies.get(t.target.bodyId);if(!n)continue;let s=n.x-i.x,r=n.y-i.y,o=Math.sqrt(s*s+r*r);if(qi>=o)continue;let a=s/o,l=r/o,d=(o-t.restLength)*t.stiffness+((("vx"in n?n.vx:0)-i.vx)*a+(("vy"in n?n.vy:0)-i.vy)*l)*t.damping;i.vx+=d*a*e/i.mass,i.vy+=d*l*e/i.mass}}resolveBodyPairs(e,t,i){for(let n of t){let[t,s]=n.split(":").map(Number),r=e[t],o=e[s];if(!r||!o)continue;let a=et(r,o);a&&(this.resolveDynamicCollision(r,o,a),i&&this.lastEvents.push({type:"contact",bodyId:r.id,otherId:o.id,sensor:!1}))}}bodyPairKeys(e){let t=Math.max(1,this.options.cellSize),i=new Map;for(let n=0;e.length>n;n+=1){if(!1===e[n].bodyCollisions)continue;let s=_e(e[n]),r=Math.floor(s.minX/t),o=Math.floor(s.maxX/t),a=Math.floor(s.minY/t),l=Math.floor(s.maxY/t);for(let e=r;o>=e;e+=1)for(let t=a;l>=t;t+=1){let s=`${e}:${t}`,r=i.get(s);r?r.push(n):i.set(s,[n])}}let n=new Set;for(let t of Array.from(i.keys()).sort()){let s=i.get(t)??[];s.sort((e,t)=>e-t);for(let t=0;s.length>t;t+=1)for(let i=t+1;s.length>i;i+=1){let r=s[t],o=s[i];!1===e[r].bodyCollisions||!1===e[o].bodyCollisions||Qe(_e(e[r]),_e(e[o]))&&n.add(`${r}:${o}`)}}return Array.from(n).sort((e,t)=>{let[i,n]=e.split(":").map(Number),[s,r]=t.split(":").map(Number);return i===s?n-r:i-s})}resolveDynamicCollision(e,t,i){(e.fixedPosition||t.fixedPosition)&&(!e.sleeping&&null==e.fixedPosition?.x||!t.sleeping&&null==t.fixedPosition?.x?(e.sleeping||null!=e.fixedPosition?.y)&&(t.sleeping||null!=t.fixedPosition?.y)&&(i=Re(e,t,"y")):i=Re(e,t,"x")),e.sleeping&&this.contactOpposesGravity(i.nx,i.ny)&&this.supportedThisStep.add(t.id),t.sleeping&&this.contactOpposesGravity(-i.nx,-i.ny)&&this.supportedThisStep.add(e.id);let n=e.sleeping?0:1/e.mass,s=t.sleeping?0:1/t.mass,r=null==e.fixedPosition?.x?n:0,o=null==e.fixedPosition?.y?n:0,a=null==t.fixedPosition?.x?s:0,l=null==t.fixedPosition?.y?s:0,d=e.fixedPosition||t.fixedPosition?i.nx**2*(r+a)+i.ny**2*(o+l):n+s;if(qi>=d)return;let h=Math.max(0,i.penetration-Ci)/d;e.x-=i.nx*h*r,e.y-=i.ny*h*o,t.x+=i.nx*h*a,t.y+=i.ny*h*l;let u=(t.vx-e.vx)*i.nx+(t.vy-e.vy)*i.ny;if(u>0)return;let c=Math.abs(u),p=-(1+He(e.restitution,t.restitution,this.options.restitution))*u/d,f=p*i.nx,m=p*i.ny;e.vx-=f*r,e.vy-=m*o,t.vx+=f*a,t.vy+=m*l,this.applyFriction(e,t,i,p,n,s),c>this.options.contactWakeSpeed&&(this.wake(e),this.wake(t))}applyFriction(e,t,i,n,s,r){let o=-i.ny,a=i.nx,l=(t.vx-e.vx)*o+(t.vy-e.vy)*a,d=null==e.fixedPosition?.x?s:0,h=null==e.fixedPosition?.y?s:0,u=null==t.fixedPosition?.x?r:0,c=null==t.fixedPosition?.y?r:0,p=e.fixedPosition||t.fixedPosition?o**2*(d+u)+a**2*(h+c):s+r;if(qi>=Math.abs(l)||qi>=p)return;let f=Ke(e.friction,t.friction,this.options.friction),m=Ge(-l/p,-n*f,n*f),y=m*o,x=m*a;e.vx-=y*d,e.vy-=x*h,t.vx+=y*u,t.vy+=x*c}resolveColliders(e,t,i){for(let n of e)for(let e of t){if(!at(e,n)||!Qe(_e(n),Ve(e)))continue;let t=tt(n,e);t&&(this.resolveStaticCollision(n,e,t),this.contactOpposesGravity(t.nx,t.ny)&&this.supportedThisStep.add(n.id),i&&this.lastEvents.push({type:"contact",bodyId:n.id,otherId:e.id,sensor:!1}))}}resolveStaticCollision(e,t,i){e.x+=i.nx*Math.max(0,i.penetration-Ci),e.y+=i.ny*Math.max(0,i.penetration-Ci);let n=e.vx*i.nx+e.vy*i.ny;if(0>n){let s=He(e.restitution,t.restitution,this.options.restitution);e.vx-=(1+s)*n*i.nx,e.vy-=(1+s)*n*i.ny;let r=-i.ny,o=i.nx,a=e.vx*r+e.vy*o,l=Ke(e.friction,t.friction,this.options.friction);e.vx-=a*r*l,e.vy-=a*o*l}Le(e)}updateSensors(e){let t=new Set,i=this.sortedColliders().filter(e=>e.sensor);for(let n of e){let e=_e(n);for(let s of i){if(!at(s,n)||!Qe(e,Ve(s))||!tt(n,s))continue;let i=it(s.id,n.id);t.add(i),this.activeSensors.has(i)||this.lastEvents.push({type:"sensor-enter",bodyId:n.id,sensorId:s.id})}}for(let e of Array.from(this.activeSensors).sort()){if(t.has(e))continue;let{sensorId:i,bodyId:n}=nt(e);this.lastEvents.push({type:"sensor-exit",bodyId:n,sensorId:i})}this.activeSensors=t}updateSleeping(e,t){let i=Math.hypot(this.options.gravity.x,this.options.gravity.y)>1;for(let n of e)this.options.sleepSpeed>Math.sqrt(n.vx*n.vx+n.vy*n.vy)&&this.options.sleepSpeed*t>Math.sqrt((n.x-n.prevX)*(n.x-n.prevX)+(n.y-n.prevY)*(n.y-n.prevY))&&(!i||this.supportedThisStep.has(n.id))?(n.sleepTime+=t,!n.sleeping&&n.sleepTime>=this.options.sleepAfter&&(n.sleeping=!0,n.vx=0,n.vy=0,this.lastEvents.push({type:"sleep",bodyId:n.id}))):n.sleeping?this.wake(n):n.sleepTime=0}contactOpposesGravity(e,t){let{x:i,y:n}=this.options.gravity,s=Math.hypot(i,n);return 1e-9>=s||-.2>(e*i+t*n)/s}wake(e){e.sleeping&&this.lastEvents.push({type:"wake",bodyId:e.id}),e.sleeping=!1,e.sleepTime=0}nextRandom(){return this.random()}},Fi=["binId","targetBin","category","windowIndex","lane","group"],Ni=class{constructor(e=!1){this.bins=new Map,this.nextIndex=0,this.config=e}updateConfig(e){void 0!==e&&(this.config=e,!1===e&&this.clear())}isEnabled(){return!1!==this.config}add(e){if(!1===this.config)return null;let t=this.nextIndex;this.nextIndex+=1;let i=pt(ct(this.config.binAccessor,e,t))??function(e){for(let t of Fi){let i=pt(ut(e,t));if(i)return i}return"sediment"}(e),n=pt(ct(this.config.labelAccessor,e,t))??i,s=function(e,t,i){if("number"==typeof e)return e;let n="function"==typeof e?e(t,i):"string"==typeof e?ut(t,e):1,s="number"==typeof n?n:Number(n);return Number.isFinite(s)?s:1}(this.config.valueAccessor,e,t),r=Math.max(0,Math.floor(this.config.retainBodyIds??12)),o=this.bins.get(i);return o||(o={id:i,label:n,bodyIds:[],x:{count:0,total:0,mean:0,m2:0,min:1/0,max:-1/0},y:{count:0,total:0,mean:0,m2:0,min:1/0,max:-1/0},value:{count:0,total:0,mean:0,m2:0,min:1/0,max:-1/0}},this.bins.set(i,o)),o.label=n,o.lastBodyId=e.id,o.lastDatum=e.datum,lt(o.x,e.x),lt(o.y,e.y),lt(o.value,s),r>0&&(o.bodyIds.push(e.id),o.bodyIds.length>r&&(o.bodyIds=o.bodyIds.slice(o.bodyIds.length-r))),ft(o)}clear(){this.bins.clear(),this.nextIndex=0}snapshot(){return Array.from(this.bins.values()).map(ft)}restore(e=[]){this.bins.clear();for(let t of e)this.bins.set(t.id,{id:t.id,label:t.label,bodyIds:t.bodyIds.slice(),lastBodyId:t.lastBodyId,lastDatum:t.lastDatum,x:ht(t.x),y:ht(t.y),value:ht(t.value)});this.nextIndex=e.reduce((e,t)=>e+t.count,0)}totals(){let e=this.snapshot();return{bins:e.length,count:e.reduce((e,t)=>e+t.count,0),total:e.reduce((e,t)=>e+t.total,0)}}},$i={bodyLimit:1/0,eviction:"oldest",fixedDt:1/120,maxDeltaSeconds:.1,maxSubsteps:8,settleStepLimit:1200,timeScale:1},Di={chartId:"physics",chartType:"physics",sensors:{},onObservation:void 0,onSimulationStateChange:void 0},Ti=class{constructor(e={}){this.id="builtin",this.capabilities={...(new Pi).capabilities,engine:"builtin"},this.world=new Pi(e)}init(e={}){this.world.init(e)}spawn(e){this.world.spawn(e)}remove(e){this.world.remove(e)}setColliders(e){this.world.setColliders(e)}setConstraint(e){return this.world.setConstraint(e)}removeConstraint(e){this.world.removeConstraint(e)}applyImpulse(e,t,i){this.world.applyImpulse(e,t,i)}step(e){this.world.step(e)}settle(e,t){return this.world.settle(e,t)}readState(e){return this.world.readState(e)}events(){return this.world.events()}activeSensorPairs(){return this.world.activeSensorPairs()}allSleeping(){return this.world.allSleeping()}snapshot(){return this.world.snapshot()}restore(e){this.world.restore(e)}nextRandom(){return this.world.nextRandom()}dispose(){this.world.dispose()}},Li={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},ji=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=Ft({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){let i=Ft(e,t,this.revisions);this.revisions=i.revisions,this.latest=i;for(let e of[...this.listeners])e();return i}};import{quadtree as Ri}from"d3-quadtree";var Wi=class{constructor(){this.maxSearchRadius=0,this.revision=-1,this.tree=null}hitTest(e,t,i,n,s,r=0,o){let a=this.ensure(e,t);if(!a)return null;let l=null,d=1/0,h=Math.max(0,o?.searchRadius??Math.max(0,r)+this.maxSearchRadius),u=n-h,c=n+h,p=s-h,f=s+h;return a.visit((e,t,a,h,m)=>{if(u>h||t>c||p>m||a>f)return!0;if(e.length)return!1;let y=e;for(;y;){let e=y.data;if(e&&(!o?.include||o.include(e))){let t=o?.distanceSquared?o.distanceSquared(e,n,s):It(e,n,s,Math.max(0,r));null!=t&&(d>t||t===d&&i.indexOf(e.id)>i.indexOf(l?.id??""))&&(l=e,d=t)}y=y.next}return!1}),l}ensure(e,t){if(this.tree&&this.revision===t)return this.tree;let i=e.readState();return 0===i.length?(this.tree=null,this.maxSearchRadius=0,this.revision=t,null):(this.maxSearchRadius=i.reduce((e,t)=>Math.max(e,function(e){return"circle"===e.shape.type?e.shape.radius:Math.hypot(e.shape.width,e.shape.height)/2}(t)),0),this.tree=Ri().x(e=>e.x).y(e=>e.y).addAll(i),this.revision=t,this.tree)}},Yi=["data","scene-geometry","data-paint","accessibility","evidence"],Ei=["scene-geometry","data-paint","accessibility","evidence"],Xi=["overlay","accessibility","evidence"],zi=(e,t)=>({retainedData:e,invalidations:t}),Gi=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Hi=["scene-geometry","data-paint","accessibility","evidence"],Ki=[],Ui={engine:zi("rebuild",["scene-geometry","data-paint","accessibility","evidence"]),kernel:zi("preserve",Hi),colliders:zi("preserve",Hi),sediment:zi("preserve",Hi),bodyBudget:zi("preserve",Gi),bodyLimit:zi("preserve",Gi),eviction:zi("preserve",Gi),fixedDt:zi("preserve",Ki),maxDeltaSeconds:zi("preserve",Ki),maxSubsteps:zi("preserve",Ki),settleStepLimit:zi("preserve",Ki),timeScale:zi("preserve",Ki),observation:zi("preserve",Ki)},_i=zi("preserve",Gi),Vi=["seed","fixedDt","cellSize","collisionIterations","velocityDamping","sleepSpeed","sleepAfter","restitution","friction","maxVelocity","contactWakeSpeed"],Qi=class{constructor(){this.seconds=0,this.speed=8,this.scratch=[]}setKernelOptions(e){this.speed=function(e){let t=e?.sleepSpeed;return"number"==typeof t&&Number.isFinite(t)&&t>0?t:8}(e)}reset(){this.seconds=0}isAtRest(){return this.seconds>=.6}refresh(e,t,i){if(i>0)return void(this.seconds=0);let n=e.readState(this.scratch),s=this.speed*this.speed,r=!0;for(let e of n)if(!e.sleeping&&e.vx*e.vx+e.vy*e.vy>=s){r=!1;break}this.seconds=r?this.seconds+Math.max(0,t):0}},Ji=class{constructor(e={}){this.activeSensorPairs=new Set,this.accumulator=0,this.bodyBudgetObservationKey="ok",this.bodySpatialIndex=new Wi,this.elapsedSeconds=0,this.liveBodyOrder=[],this.nextSequence=0,this.paused=!1,this.queue=[],this.revision=0,this.updateResults=new ji,this.simulationState="settled",this.visible=!0,this.quiescence=new Qi;let{bodyBudget:t,colliders:i,engine:n,kernel:s,observation:r,sediment:o,...a}=e;this.config={...$i,...a},this.configInput={...e},this.bodyBudget=t??{},this.engineInput=n,this.observation=yt(r),this.sediment=new Ni(o??!1),this.world=qt(n,{fixedDt:this.config.fixedDt,...s}),this.quiescence.setKernelOptions(s),i&&this.world.setColliders(wt(i))}updateConfig(e){let t=function(e,t){return Object.keys(e).filter(i=>"kernel"===i?!$t(e.kernel,t.kernel):e[i]!==t[i])}(e,this.configInput),{colliders:i,bodyBudget:n,engine:s,kernel:r,observation:o,sediment:a,...l}=e;if(this.config={...this.config,...l},void 0!==n&&(this.bodyBudget=n,!1===n&&(this.bodyBudgetObservationKey="ok")),s&&s!==this.engineInput){let e=this.world.snapshot();this.world.dispose(),this.engineInput=s,this.world=qt(s,e.options),this.world.restore(e),this.revision+=1}if(r&&!$t(r,this.configInput.kernel)){let e=this.world.snapshot(),t={...e.options,...r,gravity:{...e.options.gravity,...r.gravity}};this.world.restore({...e,options:t}),this.quiescence.setKernelOptions(t),this.revision+=1}o&&(this.observation=yt(o,this.observation)),this.sediment.updateConfig(a),i&&(this.world.setColliders(wt(i)),this.revision+=1),this.configInput={...this.configInput,...e};let d=Nt(t);this.updateResults.record({kind:"config",keys:t},d.invalidations)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}setColliders(e){this.world.setColliders(wt(e)),this.revision+=1,this.updateResults.record({kind:"config",keys:["colliders"]},Nt(["colliders"]).invalidations)}enqueue(e,t){let i=Array.isArray(e)?e:[e],n=t?function(e,t={}){let i=gt(t.startAt)??0,n=t.pacing??"immediate";if("arrival"===n){let n=e.map((e,i)=>function(e,t,i){return"function"==typeof i?gt(i(e,t)):"string"==typeof i?gt(bt(e,i)):gt(e.spawnAt)??gt(bt(e,"arrivalTime"))??gt(bt(e,"timestamp"))??gt(bt(e,"time"))??gt(bt(e,"eventTime"))}(e,i,t.timeAccessor)),s=n.filter(e=>null!=e),r=s.length>0?Math.min(...s):0,o=gt(t.timeScale)??1,a=o>0?o:1;return e.map((e,t)=>{let s=n[t],o=null==s?0:Math.max(0,s-r);return{...xt(e),spawnAt:i+o/a}})}if("object"==typeof n){let t=gt(n.ratePerSec);if(t&&t>0)return e.map((e,n)=>({...xt(e),spawnAt:i+n/t}))}return e.map(e=>({...xt(e),spawnAt:i}))}(i,{...t,startAt:t.startAt??this.elapsedSeconds}):i;for(let e of n)this.queue.push({...xt(e),sequence:this.nextSequence,spawnAt:e.spawnAt??this.elapsedSeconds}),this.nextSequence+=1;this.queue.sort(Mt),n.length>0&&(this.revision+=1),this.updateResults.record({kind:"enqueue",count:n.length},n.length?Yi:[])}enqueueWithResult(e,t){return this.enqueue(e,t),this.updateResults.last}spawnNow(e){this.spawnOne(xt(e)),this.nextSequence+=1,this.observeBodyBudget(),this.evictOverflow(),this.revision+=1,this.updateResults.record({kind:"enqueue",count:1},Yi)}materializeDueSpawns(){let e=this.revision,t=[],i=[];return this.spawnDue(t,i),0===t.length||(this.observeBodyBudget(i),this.evictOverflow(i),this.syncSimulationState(i),this.revision+=1,this.updateResults.record({kind:"enqueue",count:t.length},this.revision!==e?Yi:[])),t}clear(){let e=this.world.snapshot().options;this.world.init({...e,fixedDt:this.config.fixedDt}),this.activeSensorPairs.clear(),this.liveBodyOrder=[],this.queue=[],this.accumulator=0,this.elapsedSeconds=0,this.nextSequence=0,this.quiescence.reset(),this.sediment.clear(),this.bodyBudgetObservationKey="ok",this.revision+=1,this.syncSimulationState(),this.updateResults.record({kind:"clear"},Yi)}tick(e,t){let i=this.revision,n=[],s=[],r=[],o=[],a=[];if(this.paused||!this.visible){let e=this.result(0,n,s,r,o,a,!1);return this.updateResults.record({kind:"tick",count:0},[]),e}let l=Math.max(0,Math.min(Number.isFinite(e)?e:0,this.config.maxDeltaSeconds))*this.config.timeScale;this.spawnDue(n,a);let d=this.observeBodyBudget(a),h=this.evictOverflow(a);s.push(...h.evicted),r.push(...h.sedimented),this.syncSimulationState(a),n.length>0&&this.quiescence.reset(),this.accumulator+=l;let u=this.stepObserver(t,{spawned:n,evicted:s,sedimented:r,events:o,observations:a}),c=l>0?Math.floor((this.accumulator+1e-9*this.config.fixedDt)/this.config.fixedDt):0,{steps:p,budget:f}=Tt(this.settleHost(),Math.min(c,this.config.maxSubsteps),{spawned:n,evicted:s,sedimented:r,events:o,observations:a},{stopAtRest:!1,shouldStop:()=>this.paused||!this.visible,afterStep:u});this.accumulator=Math.max(0,this.accumulator-p*this.config.fixedDt),p===this.config.maxSubsteps&&(this.accumulator=Math.min(this.accumulator,this.config.fixedDt)),(p>0||n.length>0||s.length>0||r.length>0||o.length>0)&&(this.revision+=1);let m=this.result(p,n,s,r,o,a,void 0,f??d);return this.updateResults.record({kind:"tick",count:p},this.revision!==i?n.length||s.length||r.length?Yi:Ei:[]),m}settle(e=this.config.settleStepLimit){return this.runSettle(e,!1).steps}settleWithObservations(e=this.config.settleStepLimit,t){return this.runSettle(e,!0,t)}stepObserver(e,t){return function(e,t){if(!e)return;let i=["spawned","evicted","sedimented","events","observations"],n={spawned:0,evicted:0,sedimented:0,events:0,observations:0},s=s=>{let r=t(s),o={...r,spawned:r.spawned.slice(n.spawned),evicted:r.evicted.slice(n.evicted),sedimented:r.sedimented.slice(n.sedimented),events:r.events.slice(n.events),observations:r.observations.slice(n.observations)};for(let e of i)n[e]=r[e].length;e.onStep(o)};return s(0),()=>s(1)}(e,e=>(e&&(this.revision+=1),this.result(e,t.spawned,t.evicted,t.sedimented,t.events,t.observations)))}settleHost(){return{fixedDt:this.config.fixedDt,queueSize:()=>this.queue.length,atRest:()=>this.atRest(),advanceTime:e=>{this.elapsedSeconds+=e},spawnDue:(e,t)=>this.spawnDue(e,t),observeBodyBudget:e=>this.observeBodyBudget(e),evictOverflow:e=>this.evictOverflow(e),step:e=>this.world.step(e),drainEvents:()=>this.world.events(),observeKernelEvents:(e,t)=>this.observeKernelEvents(e,t),observeSensorTransitions:e=>this.observeSensorTransitions(e),refreshQuiescence:(e,t)=>this.quiescence.refresh(this.world,e,t)}}runSettle(e,t,i){let n=this.revision,s=[],r=[],o=[],a=[],l=t?[]:void 0;if(t&&(this.paused||!this.visible)){let e=this.result(0,s,r,o,a,l??[],!1);return this.updateResults.record({kind:"settle",count:0},[]),e}this.spawnDue(s,l);let d=this.observeBodyBudget(l),h=this.evictOverflow(l);r.push(...h.evicted),o.push(...h.sedimented),this.syncSimulationState(l),s.length>0&&this.quiescence.reset();let u=t?{spawned:s,evicted:r,sedimented:o,events:a,observations:l}:{spawned:s},c=this.stepObserver(i,{spawned:s,evicted:r,sedimented:o,events:a,observations:l??[]}),{steps:p,budget:f}=Tt(this.settleHost(),e,u,{afterStep:c,continueWhile:i?.continueWhile,shouldStop:t?()=>this.paused||!this.visible:void 0}),m=s.length+r.length+o.length>0;(p>0||m||a.length>0)&&(this.revision+=1);let y=this.result(p,s,r,o,a,l??[],void 0,f??d);return this.updateResults.record({kind:"settle",count:p},this.revision===n?[]:m?Yi:Ei),y}readBodies(e=[]){return this.world.readState(e)}readSediment(){return this.sediment.snapshot()}bodyBudgetStatus(){return this.evaluateBodyBudget()}sedimentTotals(){return this.sediment.totals()}sedimentHeightfield(e={}){return mt(this.readSediment(),e)}hitTest(e,t,i=0,n){return this.bodySpatialIndex.hitTest(this.world,this.revision,this.liveBodyOrder,e,t,i,n)}events(){return this.world.events()}allSleeping(){return this.world.allSleeping()}atRest(){return this.world.allSleeping()||this.quiescence.isAtRest()}hasPendingWork(){return this.queue.length>0||!this.atRest()}queueSize(){return this.queue.length}liveBodyCount(){return this.liveBodyOrder.length}elapsed(){return this.elapsedSeconds}recordObservation(e){let{timestamp:t,chartType:i,chartId:n,...s}=e,r={...s,timestamp:t??this.elapsedSeconds,chartType:i??this.observation.chartType,chartId:n??this.observation.chartId};return this.emitObservation(r),this.updateResults.record({kind:"update",count:1},["evidence"]),r}getLastUpdateResult(){return this.updateResults.last}getUpdateSnapshot(){return this.updateResults.last}subscribeUpdateResult(e){return this.updateResults.subscribe(e)}version(){return this.revision}setPaused(e){let t=this.paused!==e;this.paused=e,this.syncSimulationState(),this.updateResults.record({kind:"pause"},t?Xi:[])}setVisible(e){let t=this.visible!==e;this.visible=e,this.syncSimulationState(),this.updateResults.record({kind:"visibility"},t?Xi:[])}remove(e){let t=new Set(e),i=new Set(this.liveBodyOrder),n=new Set(this.queue.map(e=>e.id));this.queue=this.queue.filter(e=>!t.has(e.id)),this.liveBodyOrder=this.liveBodyOrder.filter(e=>!t.has(e)),this.world.remove(e),this.removeActiveSensorPairsForBodies(t);let s=e.filter(e=>i.has(e)||n.has(e));return s.length>0&&(this.revision+=1,this.syncSimulationState()),this.updateResults.record({kind:"remove",keys:s,count:s.length},s.length?Yi:[]),s}setConstraint(e){let t=this.world.setConstraint(e);return this.revision+=1,this.updateResults.record({kind:"constraint",keys:[t]},Ei),t}removeConstraint(e){this.world.removeConstraint(e),this.revision+=1,this.updateResults.record({kind:"constraint",keys:[e]},Ei)}applyImpulse(e,t,i){this.world.applyImpulse(e,t,i),this.revision+=1,this.updateResults.record({kind:"impulse",keys:[e]},Ei)}nextRandom(){return this.world.nextRandom()}controls(){return e=this,{applyImpulse:(t,i,n)=>e.applyImpulse(t,i,n),clear:()=>e.clear(),hitTest:(t,i,n)=>e.hitTest(t,i,n),pause:()=>e.setPaused(!0),push:(t,i)=>e.enqueue(t,i),pushMany:(t,i)=>e.enqueue(t,i),bodyBudgetStatus:()=>e.bodyBudgetStatus(),readBodies:t=>e.readBodies(t),readSediment:()=>e.readSediment(),recordObservation:t=>e.recordObservation(t),remove:t=>e.remove(t),restore:t=>e.restore(t),resume:()=>e.setPaused(!1),settle:t=>e.settle(t),settleWithObservations:t=>e.settleWithObservations(t),snapshot:()=>e.snapshot(),sedimentHeightfield:t=>e.sedimentHeightfield(t),sedimentTotals:()=>e.sedimentTotals(),step:t=>e.tick(t)};var e}snapshot(){let e=this.world.snapshot();return{accumulator:this.accumulator,activeSensorPairs:Array.from(this.activeSensorPairs).sort(),bodyBudget:St(this.bodyBudget),config:{...this.config,kernel:kt(e.options)},elapsedSeconds:this.elapsedSeconds,paused:this.paused,queue:this.queue.map(vt),revision:this.revision,sediment:this.readSediment(),simulationState:this.simulationState,liveBodyOrder:this.liveBodyOrder.slice(),visible:this.visible,world:e}}restore(e){let t=this.simulationState;this.config={bodyLimit:e.config.bodyLimit,eviction:e.config.eviction,fixedDt:e.config.fixedDt,maxDeltaSeconds:e.config.maxDeltaSeconds,maxSubsteps:e.config.maxSubsteps,settleStepLimit:e.config.settleStepLimit,timeScale:e.config.timeScale},this.configInput={...e.config,bodyBudget:St(e.bodyBudget??{}),kernel:kt(e.world.options)},this.bodyBudget=St(e.bodyBudget??{}),this.bodyBudgetObservationKey="ok",this.quiescence.setKernelOptions(e.world.options),this.quiescence.reset(),this.activeSensorPairs=new Set(e.activeSensorPairs),this.accumulator=e.accumulator,this.elapsedSeconds=e.elapsedSeconds,this.paused=e.paused,this.queue=e.queue.map(vt).sort(Mt),this.revision=e.revision,this.sediment.restore(e.sediment??[]),this.simulationState=e.simulationState??Dt(e.paused,e.visible,e.queue.length>0,e.world.bodies.every(e=>e.sleeping)),this.liveBodyOrder=e.liveBodyOrder.slice(),this.visible=e.visible,this.nextSequence=this.queue.reduce((e,t)=>Math.max(e,t.sequence),-1)+1,this.world.restore(e.world),this.updateResults.record({kind:"restore"},Yi),this.simulationState!==t&&this.observation.onSimulationStateChange?.(this.simulationState,t)}spawnDue(e,t){for(;this.queue.length>0&&this.elapsedSeconds+1e-9*this.config.fixedDt>=this.queue[0].spawnAt;){let i=this.queue.shift();if(!i)return;this.spawnOne(i,t),e.push(i.id)}}spawnOne(e,t){this.liveBodyOrder=this.liveBodyOrder.filter(t=>t!==e.id),this.removeActiveSensorPairsForBodies(new Set([e.id])),this.world.spawn(e),this.liveBodyOrder.push(e.id);for(let t of e.springs??[])this.world.setConstraint({...t,bodyId:e.id});let i=this.world.readState().find(t=>t.id===e.id);this.emitObservation({type:"physics-spawn",timestamp:this.elapsedSeconds,chartType:this.observation.chartType,chartId:this.observation.chartId,bodyId:e.id,datum:i?.datum??e.datum,x:i?.x??e.x,y:i?.y??e.y},t)}result(e,t,i,n,s,r,o,a=this.evaluateBodyBudget()){this.syncSimulationState(r);let l=this.world.allSleeping();return{budget:a,elapsedSeconds:this.elapsedSeconds,evicted:i,events:s,observations:r,queueSize:this.queue.length,revision:this.revision,shouldContinue:o??(!this.paused&&this.visible&&(this.queue.length>0||!this.atRest())),sleeping:l,sedimented:n,spawned:t,steps:e}}observeKernelEvents(e,t){!function(e,t,i){if(0===t.length)return;let n=new Map(e.readState().map(e=>[e.id,e]));for(let e of t){if("sleep"!==e.type)continue;let t=n.get(e.bodyId);i.emit({type:"physics-settle",timestamp:i.elapsedSeconds,chartType:i.observation.chartType,chartId:i.observation.chartId,bodyId:e.bodyId,datum:t?.datum,x:t?.x,y:t?.y})}}(this.world,e,this.observationContext(t))}observeSensorTransitions(e){this.activeSensorPairs=function(e,t,i){let n=new Set(e.activeSensorPairs().map(e=>`${e.sensorId}\0${e.bodyId}`));if(0===n.size&&0===t.size)return n;let s=new Map(e.readState().map(e=>[e.id,e])),r=(e,t)=>{let{sensorId:n,bodyId:r}=Bt(t),o=i.observation.sensors[n],a=s.get(r);i.emit({type:"enter"===e?o?.enterType??"physics-bin-enter":o?.exitType??"physics-bin-exit",timestamp:i.elapsedSeconds,chartType:i.observation.chartType,chartId:i.observation.chartId,bodyId:r,datum:a?.datum,x:a?.x,y:a?.y,sensorId:n,binId:o?.binId??n})};for(let e of Array.from(n).sort())t.has(e)||r("enter",e);for(let e of Array.from(t).sort())n.has(e)||r("exit",e);return n}(this.world,this.activeSensorPairs,this.observationContext(e))}removeActiveSensorPairsForBodies(e){!function(e,t){for(let i of e)t.has(Bt(i).bodyId)&&e.delete(i)}(this.activeSensorPairs,e)}observationContext(e){return{elapsedSeconds:this.elapsedSeconds,observation:this.observation,emit:t=>this.emitObservation(t,e)}}emitObservation(e,t){t?.push(e),this.observation.onObservation?.(e)}evaluateBodyBudget(){return function(e){let t=Math.max(0,Math.floor(e.liveBodies)),i=Math.max(0,Math.floor(e.queuedBodies??0)),n=t+i,s=Ct(e.bodyLimit),r=Ct(e.engineMaxBodiesHint),o=function(e,t,i){if(!1===i)return;let n=Ct(i?.warnAt);return null!=n?n:null!=e?Math.max(1,Math.floor(.8*e)):null!=t?Math.max(1,Math.floor(.8*t)):void 0}(s,r,e.options),a=null==s?0:Math.max(0,t-s),l=a>0?"overflow":null==o||o>n?"ok":"warning";return{action:"overflow"!==l?"continue":e.sedimentEnabled?"sediment":e.evictionEnabled?"evict":"retain",bodyLimit:s,engineMaxBodiesHint:r,liveBodies:t,overflow:a,projectedBodies:n,queuedBodies:i,state:l,warnAt:o}}({bodyLimit:this.config.bodyLimit,engineMaxBodiesHint:this.world.capabilities.maxBodiesHint,evictionEnabled:!1!==this.config.eviction,liveBodies:this.liveBodyOrder.length,queuedBodies:this.queue.length,sedimentEnabled:this.sediment.isEnabled(),options:this.bodyBudget})}observeBodyBudget(e){let t=this.evaluateBodyBudget();if("ok"===t.state||!1===this.bodyBudget)return this.bodyBudgetObservationKey="ok",t;let i=`${t.state}:${t.action}`;return i===this.bodyBudgetObservationKey||(this.bodyBudgetObservationKey=i,function(e,t){t.emit({type:"overflow"===e.state?"physics-budget-overflow":"physics-budget-warning",timestamp:t.elapsedSeconds,chartType:t.observation.chartType,chartId:t.observation.chartId,budgetAction:e.action,bodyLimit:e.bodyLimit,engineMaxBodiesHint:e.engineMaxBodiesHint,liveBodies:e.liveBodies,overflow:e.overflow,projectedBodies:e.projectedBodies,queuedBodies:e.queuedBodies,warnAt:e.warnAt})}(t,this.observationContext(e))),t}syncSimulationState(e){let t=Dt(this.paused,this.visible,this.queue.length>0,this.atRest());if(t===this.simulationState)return;let i=this.simulationState;this.simulationState=t,function(e,t,i){i.observation.onSimulationStateChange?.(t,e),("running"===t||"settled"===t)&&i.emit({type:"running"===t?"sim-active":"sim-idle",timestamp:i.elapsedSeconds,chartType:i.observation.chartType,chartId:i.observation.chartId,simulationState:t,previousSimulationState:e})}(i,t,this.observationContext(e))}evictOverflow(e){let{evicted:t,sedimented:i,liveBodyOrder:n}=function(e,t,i,n,s,r){let o={evicted:[],sedimented:[],liveBodyOrder:s};if(!1===i)return o;let a=Math.max(0,Math.floor(n));if(!Number.isFinite(a))return o;let l=s.length-a;if(0>=l)return o;let d=function(e,t,i){if("sleeping-first"!==t)return i.slice();let n=new Map(e.readState().map(e=>[e.id,e.sleeping])),s=[],r=[];for(let e of i)n.get(e)?s.push(e):r.push(e);return[...s,...r]}(e,i,s).slice(0,l);if(0===d.length)return o;let h=function(e,t,i,n){let s=new Map(e.readState().map(e=>[e.id,e])),r=[];for(let e of i){let i=s.get(e);if(!i)continue;let o=t.add(i);o&&(r.push(e),n.emit({type:"physics-sediment",timestamp:n.elapsedSeconds,chartType:n.observation.chartType,chartId:n.observation.chartId,bodyId:e,datum:i.datum,x:i.x,y:i.y,binId:o.id,count:o.count,total:o.total}))}return r}(e,t,d,r);e.remove(d);let u=new Set(d);return{evicted:d,sedimented:h,liveBodyOrder:s.filter(e=>!u.has(e))}}(this.world,this.sediment,this.config.eviction,this.config.bodyLimit,this.liveBodyOrder,this.observationContext(e));return t.length>0&&(this.liveBodyOrder=n,this.removeActiveSensorPairsForBodies(new Set(t))),{evicted:t,sedimented:i}}};import{scaleLinear as Zi}from"d3-scale";export{Te as useCustomLayoutSelection,e as placeWithMinGap,i as packBandsBySilhouette,n as orderByBarycenter,s as refineByAdjacentSwaps,r as orderExactSmall,o as countPairwiseCrossings,Xt as calendarLayout,d as resolveAccessor,h as readField,u as unwrapDatum,c as groupBy,p as createSafeDatum,f as matchesHighlight,m as dimFor,y as signatureKey,Gt as LayoutCache,x as makeShade,g as shade,b as datumFromFields,v as stableGlyphId,w as clamp,S as nonNegativeFinite,M as mean,k as withAlpha,I as roundedEnclosure,B as boundsOf,O as hullFromBoxes,A as bandLabel,q as hatchFill,C as linearAxis,P as markCallout,Vt as parallelCoordinatesLayout,F as mulberry32,st as valueAtPath,ot as matchesPhysicsBodyFilter,mt as sedimentHeightfield,Ot as collidersFromPlotBounds,At as collidersFromXScaleBins,ji as UpdateResultTracker,Ji as PhysicsPipelineStore,D as aggregateRegionCounts,T as regionCountsToProjectionRows,L as groupCompletionRows,W as processStageLayout,E as processStageRegions,X as membraneRegion,z as chargeGateRegion,G as routeSurfaceRegion,H as pressureFieldRegion,K as capacitatedRegion,U as portalRegion,_ as absorbRegion,V as forceFieldRegion,Q as bodyGroupSpec,J as processLaneWalls,ie as processChrome,ui as SYMBOL_SEQUENCE,ne as symbolPathString,se as symbolRadius,re as symbolExtent,oe as makeSymbolResolver,pi as DEFAULT_GLYPH_VIEWBOX,fi as DEFAULT_GLYPH_ANCHOR,ae as glyphPlacement,le as glyphExtent,de as resolveGlyphPaint,he as getGlyphPath2D,ue as glyphFractionClipRect,ce as glyphHitGeometry,pe as drawGlyphParts,Ie as annotationNote,Be as measureAnnotationNote,Oe as wrapAnnotationText,be as resolveX,ve as resolveY,Me as resolveAnchoredPosition,ke as isInBounds,fe as isNoteAnnotation,xi as DEFAULT_AREA_PER_ANNOTATION,ye as annotationBudget,ge as annotationDensity,De as annotationLayout,Lt as buildDirectedAdjacency,jt as reachableFrom,Rt as resolveNodeSizeFn};