semiotic 3.10.0 → 3.10.2
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.
- package/README.md +73 -72
- package/ai/artifact-surface-inventory.json +4 -1
- package/ai/componentMetadata.cjs +3 -1
- package/ai/dist/mcp-server.js +47 -46
- package/ai/examples.md +95 -0
- package/ai/reference.md +80 -1
- package/ai/schema.json +7304 -1990
- package/ai/surface-manifest.json +26 -4
- package/ai/task-packets/compare-category-totals.json +7 -53
- package/ai/task-packets/compare-category-totals.md +4 -4
- package/ai/task-packets/correct-published-chart.json +7 -53
- package/ai/task-packets/correct-published-chart.md +4 -4
- package/ai/task-packets/index.json +9 -9
- package/ai/task-packets/update-live-chart.json +8 -54
- package/ai/task-packets/update-live-chart.md +4 -4
- package/dist/c-27DCB5T6.min.js +18 -0
- package/dist/c-2MONF2P6.min.js +1 -0
- package/dist/c-2TW5H5PD.min.js +1 -0
- package/dist/c-3AGX252H.min.js +1 -0
- package/dist/c-3B6JZEZT.min.js +1 -0
- package/dist/c-3BYZXCX3.min.js +4 -0
- package/dist/c-3DIPZJDO.min.js +1 -0
- package/dist/c-3FOUMWLR.min.js +1 -0
- package/dist/c-3NA6I656.min.js +2 -0
- package/dist/c-3OFVBWQY.min.js +1 -0
- package/dist/{c-QA3HMQJP.min.js → c-3PFVJFBK.min.js} +1 -1
- package/dist/c-3PPO7ZJF.min.js +4 -0
- package/dist/c-3YEW2PK6.min.js +1 -0
- package/dist/c-4JKDJUYD.min.js +1 -0
- package/dist/c-4LKK5YWB.min.js +1 -0
- package/dist/c-4MD53L2J.min.js +33 -0
- package/dist/c-4V3CD337.min.js +1 -0
- package/dist/c-4XLHPQTP.min.js +1 -0
- package/dist/c-5NYONM6V.min.js +5 -0
- package/dist/c-6IVBV5NO.min.js +1 -0
- package/dist/c-6ZU3QVLB.min.js +100 -0
- package/dist/c-72CBVNYX.min.js +209 -0
- package/dist/c-7APWCEPL.min.js +1 -0
- package/dist/c-7ASK4WBF.min.js +1 -0
- package/dist/{c-ORLEBW72.min.js → c-7FKPPCGN.min.js} +1 -1
- package/dist/c-7LY46QUI.min.js +41 -0
- package/dist/c-ABMGCCLT.min.js +1 -0
- package/dist/c-AINGQGUN.min.js +1 -0
- package/dist/c-AKLBQMQF.min.js +391 -0
- package/dist/c-AXJ2QI3F.min.js +1 -0
- package/dist/c-BQYD7T4E.min.js +1 -0
- package/dist/{c-V4XMSLC3.min.js → c-BYJJ7EMG.min.js} +1 -1
- package/dist/{c-JO2UGTCP.min.js → c-C4KIXUWU.min.js} +1 -1
- package/dist/c-C4SXYFXL.min.js +1 -0
- package/dist/c-CLDCKFBE.min.js +1 -0
- package/dist/c-CLJCJSFU.min.js +1 -0
- package/dist/c-CLLCX3PT.min.js +2 -0
- package/dist/c-ECHBKW7U.min.js +1 -0
- package/dist/c-EPJWM2UT.min.js +1 -0
- package/dist/c-F2GGJB2S.min.js +31 -0
- package/dist/c-FD2BXSRG.min.js +1 -0
- package/dist/c-FDUQDCBC.min.js +51 -0
- package/dist/c-FOTTQHOO.min.js +1 -0
- package/dist/c-FU7A5KSY.min.js +1 -0
- package/dist/c-G53AVC42.min.js +113 -0
- package/dist/c-GHN6IR4Y.min.js +1 -0
- package/dist/c-GSCO3FWL.min.js +1 -0
- package/dist/c-GYLOSK7M.min.js +1 -0
- package/dist/c-HK4OSLZA.min.js +1 -0
- package/dist/c-HLGTD5SJ.min.js +1 -0
- package/dist/c-HQ27AHMC.min.js +1 -0
- package/dist/{c-D6HAAPTX.min.js → c-IBRLFKWA.min.js} +1 -1
- package/dist/c-IHWZ2C6D.min.js +26 -0
- package/dist/c-IIV73MUW.min.js +1 -0
- package/dist/c-IPYGNVN6.min.js +116 -0
- package/dist/c-JJKRER47.min.js +1 -0
- package/dist/c-JO6AYCU4.min.js +1 -0
- package/dist/c-JWHPG6S2.min.js +1 -0
- package/dist/c-JXVYIXTV.min.js +1 -0
- package/dist/c-K2ZIYDI3.min.js +1 -0
- package/dist/c-K37JAIWA.min.js +4 -0
- package/dist/c-KGROWFT2.min.js +9 -0
- package/dist/c-MOP2NGLH.min.js +1 -0
- package/dist/c-MTX2AO5S.min.js +1 -0
- package/dist/c-N5WT7TXG.min.js +1 -0
- package/dist/c-NATWERHZ.min.js +1 -0
- package/dist/{c-42PLDTX7.min.js → c-O53GOO7H.min.js} +1 -1
- package/dist/c-OVQB75PE.min.js +1 -0
- package/dist/c-P3SKRNZN.min.js +1 -0
- package/dist/c-P5NXQWIM.min.js +1 -0
- package/dist/c-P7BQMVQQ.min.js +1 -0
- package/dist/{c-GNTXRXRN.min.js → c-PDQHLOKU.min.js} +1 -1
- package/dist/c-PKY4JFY5.min.js +1 -0
- package/dist/c-PQOZPM4G.min.js +1 -0
- package/dist/c-PZ3NEGNG.min.js +1 -0
- package/dist/c-QXLDCATV.min.js +1 -0
- package/dist/c-R2HUSWKB.min.js +1 -0
- package/dist/{c-HYW2XA4Q.min.js → c-RHDOOQ4X.min.js} +1 -1
- package/dist/c-RZPP5ERV.min.js +1 -0
- package/dist/c-SG2Y7EBY.min.js +46 -0
- package/dist/{c-WUWXGQYA.min.js → c-SJIB5RNI.min.js} +1 -1
- package/dist/c-SQNEVNWT.min.js +1 -0
- package/dist/c-STHZWF3D.min.js +1 -0
- package/dist/c-TIDKVMMZ.min.js +1 -0
- package/dist/c-TIMGODBG.min.js +1 -0
- package/dist/c-TR7OHUAO.min.js +2 -0
- package/dist/c-TTKWXGAI.min.js +61 -0
- package/dist/c-TVKZC4BY.min.js +1 -0
- package/dist/c-U5XVLSHN.min.js +1 -0
- package/dist/c-U6NLVFN4.min.js +1 -0
- package/dist/{c-VJTDST2R.min.js → c-UBHICVSC.min.js} +1 -1
- package/dist/c-UOPPO26M.min.js +1 -0
- package/dist/c-UUDAON4Z.min.js +1 -0
- package/dist/c-V32TPPY2.min.js +1 -0
- package/dist/c-V5KFJWQQ.min.js +1 -0
- package/dist/{c-P65V6HLO.min.js → c-VN557BQE.min.js} +1 -1
- package/dist/c-VXIYF7V2.min.js +1 -0
- package/dist/c-Y342FJ6K.min.js +1 -0
- package/dist/c-YM6CT4LJ.min.js +1 -0
- package/dist/{c-MVR3RWF3.min.js → c-YMFUIO54.min.js} +1 -1
- package/dist/c-YQVOKPKR.min.js +1 -0
- package/dist/c-YRJ3BJQZ.min.js +1 -0
- package/dist/c-YT5KPVNP.min.js +1 -0
- package/dist/components/ai/audienceProfile.d.ts +18 -1
- package/dist/components/ai/describeChart.d.ts +5 -1
- package/dist/components/ai/intentManifest.d.ts +16 -0
- package/dist/components/ai/intentRegistry.d.ts +12 -0
- package/dist/components/ai/intents.d.ts +6 -6
- package/dist/components/ai/streamSchema.d.ts +19 -0
- package/dist/components/ai/streamingTypes.d.ts +57 -11
- package/dist/components/ai/suggestCharts.d.ts +1 -1
- package/dist/components/ai/suggestStreamCharts.d.ts +43 -8
- package/dist/components/ai/suggestStreamDashboard.d.ts +35 -0
- package/dist/components/ai/variantDiscovery.d.ts +1 -1
- package/dist/components/charts/ordinal/BarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/DonutChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/PieChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/StackedBarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +14 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +6 -5
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -161
- package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +175 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +6 -5
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +6 -5
- package/dist/components/charts/realtime/aggregate.d.ts +11 -1
- package/dist/components/charts/realtime/resolveWindowSize.d.ts +1 -1
- package/dist/components/charts/shared/DirectLabelLayer.d.ts +25 -0
- package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
- package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
- package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
- package/dist/components/charts/shared/directLabels.d.ts +12 -0
- package/dist/components/charts/shared/hooks.d.ts +3 -1
- package/dist/components/charts/shared/knownChartComponents.d.ts +5 -2
- package/dist/components/charts/shared/lineSeriesSsr.d.ts +0 -12
- package/dist/components/charts/shared/useChartSetup.d.ts +2 -0
- package/dist/components/charts/value/BigNumber.streamCapability.d.ts +2 -0
- package/dist/components/charts/value/GaugeChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +4 -1
- package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -1
- package/dist/components/charts/xy/LineChart.d.ts +4 -1
- package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
- package/dist/components/realtime/HyperLogLog.d.ts +19 -0
- package/dist/components/realtime/ReorderBuffer.d.ts +2 -2
- package/dist/components/realtime/TDigest.d.ts +22 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +22 -5
- package/dist/components/realtime/applyChangelog.d.ts +38 -0
- package/dist/components/realtime/minHeap.d.ts +3 -0
- package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
- package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
- package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
- package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
- package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
- package/dist/components/recipes/atlas/braid.d.ts +62 -0
- package/dist/components/recipes/atlas/capsules.d.ts +18 -0
- package/dist/components/recipes/atlas/compare.d.ts +4 -0
- package/dist/components/recipes/atlas/completeness.d.ts +2 -0
- package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
- package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
- package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
- package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
- package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
- package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
- package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
- package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
- package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
- package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
- package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
- package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
- package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
- package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
- package/dist/components/recipes/atlas/forests.d.ts +11 -0
- package/dist/components/recipes/atlas/ids.d.ts +6 -0
- package/dist/components/recipes/atlas/index.d.ts +26 -0
- package/dist/components/recipes/atlas/ledger.d.ts +7 -0
- package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
- package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
- package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
- package/dist/components/recipes/atlas/motifs.d.ts +3 -0
- package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
- package/dist/components/recipes/atlas/prepare.d.ts +14 -0
- package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
- package/dist/components/recipes/atlas/profile.d.ts +19 -0
- package/dist/components/recipes/atlas/publish.d.ts +10 -0
- package/dist/components/recipes/atlas/queries.d.ts +34 -0
- package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
- package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
- package/dist/components/recipes/atlas/sections.d.ts +3 -0
- package/dist/components/recipes/atlas/support.d.ts +7 -0
- package/dist/components/recipes/atlas/types.d.ts +278 -0
- package/dist/components/recipes/atlas/validate.d.ts +12 -0
- package/dist/components/recipes/layout1d.d.ts +2 -20
- package/dist/components/recipes/minGapPlacement.d.ts +20 -0
- package/dist/components/semiotic-ai-core.d.ts +8 -3
- package/dist/components/semiotic-ai-stream.d.ts +10 -0
- package/dist/components/semiotic-ai.d.ts +4 -6
- package/dist/components/semiotic-atlas-core.d.ts +20 -0
- package/dist/components/semiotic-atlas.d.ts +8 -0
- package/dist/components/semiotic-realtime-core.d.ts +6 -2
- package/dist/components/semiotic-recipes-core.d.ts +9 -0
- package/dist/components/semiotic-stream-types.d.ts +14 -0
- package/dist/components/semiotic-xy.d.ts +1 -0
- package/dist/components/semiotic.d.ts +3 -11
- package/dist/components/server/encodeSvgFramesToGif.d.ts +2 -0
- package/dist/components/server/rasterizeSVG.d.ts +2 -0
- package/dist/components/server/registerServerXYPlugins.d.ts +2 -0
- package/dist/components/server/renderEvidence.d.ts +4 -0
- package/dist/components/server/serverChartConfigs.d.ts +8 -0
- package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
- package/dist/components/server/serverChartConfigsRealtime.d.ts +6 -0
- package/dist/components/server/serverRealtimeCategoryColors.d.ts +3 -0
- package/dist/components/server/staticAnnotations.d.ts +9 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
- package/dist/components/stream/SceneGraph.d.ts +3 -3
- package/dist/components/stream/StalenessBadge.d.ts +5 -2
- package/dist/components/stream/canvasSetup.d.ts +1 -2
- package/dist/components/stream/fontLoading.d.ts +4 -0
- package/dist/components/stream/networkCustomLayout.d.ts +8 -0
- package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
- package/dist/components/stream/physics/physicsSemanticUI.d.ts +2 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
- package/dist/components/stream/pipelinePathJoin.d.ts +27 -0
- package/dist/components/stream/pipelineTransitionTypes.d.ts +43 -0
- package/dist/components/stream/pipelineTransitions.d.ts +5 -35
- package/dist/components/stream/seriesGeometry.d.ts +2 -1
- package/dist/components/stream/shallowEqual.d.ts +2 -0
- package/dist/components/stream/streamEncodingTypes.d.ts +9 -0
- package/dist/components/stream/types.d.ts +25 -2
- package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
- package/dist/components/text/axisLabelAssessment.d.ts +15 -0
- package/dist/components/text/browserAxisLabelAssessment.d.ts +1 -0
- package/dist/components/text/browserLabelMeasurement.d.ts +3 -0
- package/dist/components/text/labelMeasurement.d.ts +19 -0
- package/dist/components/text/labelPlacement.d.ts +71 -0
- package/dist/components/text/useAxisLabelAssessment.d.ts +6 -0
- package/dist/components/text/useLabelMeasurer.d.ts +3 -0
- package/dist/controls.module.min.js +71 -1
- package/dist/geo.min.js +231 -1
- package/dist/geo.module.min.js +31 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/rough.min.js +2 -1
- package/dist/rough.module.min.js +2 -1
- package/dist/semiotic-access.module.min.js +1 -1
- package/dist/semiotic-ai-artifact-policy-constants.module.min.js +1 -1
- package/dist/semiotic-ai-core.d.ts +8 -3
- package/dist/semiotic-ai-core.min.js +4 -1
- package/dist/semiotic-ai-core.module.min.js +4 -1
- package/dist/semiotic-ai-hash-primitives.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +4 -6
- package/dist/semiotic-ai.module.min.js +14 -1
- package/dist/semiotic-artifact-react.min.js +269 -1
- package/dist/semiotic-artifact-react.module.min.js +137 -1
- package/dist/semiotic-artifact.min.js +3 -1
- package/dist/semiotic-artifact.module.min.js +3 -1
- package/dist/semiotic-atlas-core.d.ts +20 -0
- package/dist/semiotic-atlas-core.min.js +2 -0
- package/dist/semiotic-atlas-core.module.min.js +1 -0
- package/dist/semiotic-atlas-selection.module.min.js +2 -0
- package/dist/semiotic-atlas.d.ts +8 -0
- package/dist/semiotic-atlas.min.js +2 -0
- package/dist/semiotic-atlas.module.min.js +12 -0
- package/dist/semiotic-client-cjs-shared.min.js +1529 -1
- package/dist/semiotic-client-glyph.module.min.js +3 -1
- package/dist/semiotic-client-responsive.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-evidence.min.js +3 -1
- package/dist/semiotic-evidence.module.min.js +3 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +8 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +8 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.d.ts +6 -2
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +160 -1
- package/dist/semiotic-recipes-core.d.ts +9 -0
- package/dist/semiotic-recipes-core.module.min.js +72 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +3 -1
- package/dist/semiotic-server-edge-node.module.min.js +391 -1
- package/dist/semiotic-server-edge.min.js +651 -1
- package/dist/semiotic-server-edge.module.min.js +372 -1
- package/dist/semiotic-server-node.min.js +651 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-text.min.js +1 -1
- package/dist/semiotic-text.module.min.js +1 -1
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +11 -1
- package/dist/semiotic-utils-core.module.min.js +8 -1
- package/dist/semiotic-value.module.min.js +15 -1
- package/dist/semiotic-xy.d.ts +1 -0
- package/dist/semiotic.d.ts +3 -11
- package/dist/semiotic.module.min.js +10 -1
- package/dist/server.min.js +651 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +19 -3
- package/dist/c-2N7IU2NY.min.js +0 -1
- package/dist/c-2WK7YJLL.min.js +0 -1
- package/dist/c-33QOXEUG.min.js +0 -1
- package/dist/c-447VIMRO.min.js +0 -1
- package/dist/c-4FN7Q6VQ.min.js +0 -1
- package/dist/c-553QUDKA.min.js +0 -1
- package/dist/c-55BAJ333.min.js +0 -1
- package/dist/c-7242NXSG.min.js +0 -1
- package/dist/c-7EGHJU2F.min.js +0 -1
- package/dist/c-7HP7MB2I.min.js +0 -1
- package/dist/c-7NBU5ZKS.min.js +0 -1
- package/dist/c-AFBSWT77.min.js +0 -1
- package/dist/c-AJ7EC32V.min.js +0 -1
- package/dist/c-AQADQNY7.min.js +0 -1
- package/dist/c-ATM475SA.min.js +0 -1
- package/dist/c-AVO3Q7T7.min.js +0 -1
- package/dist/c-AZKPVBOC.min.js +0 -1
- package/dist/c-BNFJMDHN.min.js +0 -1
- package/dist/c-BNG5ECK5.min.js +0 -1
- package/dist/c-BOHCQILI.min.js +0 -1
- package/dist/c-CCTGN5CK.min.js +0 -1
- package/dist/c-CPSPZH6A.min.js +0 -1
- package/dist/c-CPV4N35K.min.js +0 -1
- package/dist/c-DE5Q3U2X.min.js +0 -1
- package/dist/c-DK662R77.min.js +0 -1
- package/dist/c-DY2676CR.min.js +0 -1
- package/dist/c-E32M6XW5.min.js +0 -1
- package/dist/c-E4JDJH4I.min.js +0 -1
- package/dist/c-E7I2L7CU.min.js +0 -1
- package/dist/c-EBOQ7ER7.min.js +0 -1
- package/dist/c-ELDWAO2V.min.js +0 -1
- package/dist/c-EUBTECGM.min.js +0 -1
- package/dist/c-GSZRZRD6.min.js +0 -1
- package/dist/c-GWX7JGMF.min.js +0 -1
- package/dist/c-GXV3C3MO.min.js +0 -1
- package/dist/c-HHTK2R75.min.js +0 -1
- package/dist/c-HLLFJYTY.min.js +0 -1
- package/dist/c-HPOYKCCG.min.js +0 -1
- package/dist/c-HXDKPIKR.min.js +0 -1
- package/dist/c-I4QJ6YLM.min.js +0 -1
- package/dist/c-IDJV3CZK.min.js +0 -1
- package/dist/c-ITKX3RC5.min.js +0 -1
- package/dist/c-JG2JCQLP.min.js +0 -1
- package/dist/c-JLGRHXGZ.min.js +0 -1
- package/dist/c-JUKIWTBJ.min.js +0 -1
- package/dist/c-KCRJGUHP.min.js +0 -1
- package/dist/c-LMGSSD2E.min.js +0 -1
- package/dist/c-LYQMZMZQ.min.js +0 -1
- package/dist/c-LYVKDBQJ.min.js +0 -1
- package/dist/c-MXCP7GNZ.min.js +0 -1
- package/dist/c-NG7BLZTR.min.js +0 -1
- package/dist/c-NYZ2QNAM.min.js +0 -1
- package/dist/c-OO5QLMJC.min.js +0 -1
- package/dist/c-OOVX2JPQ.min.js +0 -1
- package/dist/c-PP6VY3QU.min.js +0 -1
- package/dist/c-PRIKOLTE.min.js +0 -1
- package/dist/c-PSNI6KAZ.min.js +0 -1
- package/dist/c-PYNW54D2.min.js +0 -1
- package/dist/c-QAVFOEUY.min.js +0 -1
- package/dist/c-ROEHCIGV.min.js +0 -1
- package/dist/c-S3AZX5PP.min.js +0 -1
- package/dist/c-T2V7O2LO.min.js +0 -1
- package/dist/c-TIXX5CAU.min.js +0 -1
- package/dist/c-TKG2NP7G.min.js +0 -1
- package/dist/c-VXLOLYTO.min.js +0 -1
- package/dist/c-W4ZUKSEQ.min.js +0 -1
- package/dist/c-WH2O53VI.min.js +0 -1
- package/dist/c-WNGH47HF.min.js +0 -1
- package/dist/c-XDQKXPX4.min.js +0 -1
- package/dist/c-XSB27XPS.min.js +0 -1
- package/dist/c-YDECTEUW.min.js +0 -1
- package/dist/c-YF3YKVQI.min.js +0 -1
- package/dist/c-YLZIV3VS.min.js +0 -1
- package/dist/c-ZYPXQF7B.min.js +0 -1
|
@@ -1 +1,3 @@
|
|
|
1
|
-
function e(e,t){if("function"==typeof e)return t=>+e(t);let r=e||t;return e=>+e[r]}function t(e,t){if("function"==typeof e)return e;let r=e||t;return e=>e[r]}function r(e,t){return Gt.has(e)||Wt.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function a(e){for(let t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){let r=e[t];if("string"==typeof r&&r)return r}}function i(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function n(e,t={}){let r=!0===t.showRetractedAnnotations,a=!0===t.showSupersededAnnotations,i=new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;let t=e?.provenance?.stableId;return!(t&&i.has(t)&&!a)})}function s(e,t){return"number"==typeof t?`${e}[${t}]`:`${e}.${t}`}function o(e,t){return`${e}[Symbol(${t.description??""})]`}function l(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let r=Number(e);return Number.isSafeInteger(r)&&r>=0&&t>r}function c(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return}}function u(e,t,r,a){let i=c(e,t);return i&&"value"in i&&i.enumerable?d(i.value,r,a):[r]}function d(e,t="$",r=new Set){if(null===e||"string"==typeof e||"boolean"==typeof e)return[];if("number"==typeof e)return Number.isFinite(e)&&!Object.is(e,-0)?[]:[t];if("object"!=typeof e)return[t];if(r.has(e))return[t];let a,i,n;try{n=Array.isArray(e),a=Object.getPrototypeOf(e),i=Reflect.ownKeys(e)}catch{return[t]}if(a!==(n?Array.prototype:Object.prototype)&&null!==a)return[t];r.add(e);let d=[];try{if(n){let a=c(e,"length")?.value;if(!Number.isSafeInteger(a)||0>a)return[s(t,"length")];for(let e of i)"length"===e||"string"==typeof e&&l(e,a)||d.push("symbol"==typeof e?o(t,e):s(t,e));for(let i=0;a>i;i+=1)d.push(...u(e,i+"",s(t,i),r))}else for(let a of i)"symbol"!=typeof a?d.push(...u(e,a,s(t,a),r)):d.push(o(t,a));return d}catch{return[t]}finally{r.delete(e)}}function p(e){return function(){let e=globalThis;return e[Jt]||(e[Jt]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[Jt]}().recipes.get(e)}function h(e){return"string"==typeof e?p(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function m(e){return"string"==typeof e?e:e.id??e.name}function f(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function g(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function y(e,t,r){return r??h(t.recipe)??h(t.recipeId)??p(e)}function b(e,t,r=[]){let a=e.accessor?t[e.accessor]:void 0;if("string"==typeof a&&a)return a;if(e.field)return e.field;let i=r.find(e=>e&&"object"==typeof e);if(!i)return;let n=Object.entries(i).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?n.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in i):n.find(([,e])=>"string"==typeof e)?.[0]}function v(e,t){return e.dataRoles.find(e=>e.role===t)}function w(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function A(e,t,r,a,i,n={}){let s={...n};if(t)for(let[e,r]of Object.entries(t))s[e]=r;for(let e of r.dataRoles){let r=b(e,a,i),n=t&&r?t[r]:r;void 0!==n&&(s[e.role]=n)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{let r=s[t];return null==r?`{${t}}`:r+""})}function $(e,t,r){return"function"==typeof r?r(e,t):e[r]}function x(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function C(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function k(e,t,r=0){let a=new Set(e.filter(e=>null!=e.id).map(e=>e.id+"")),i=new Map;for(let n of e){let e=null==n.id?`${t}-${r++}`:n.id+"";for(;null==n.id&&a.has(e);)e=`${t}-${r++}`;a.add(e),i.set(e,null==n.id?{...n,id:e}:n)}return{seed:e,rows:Array.from(i.values()),nextId:r}}function S(e,t){let r="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!r)return null;let a=Array.isArray(t.data)?t.data:[],i=Math.max(2,Math.round(x(t.bins)??21)),n=Math.max(1,Math.round(x(t.pegRows)??i-1));if(r&&(a="GaltonBoardChart"===e?function(e){let t=Math.max(2,Math.round(e.bins)),r=Math.max(1,Math.round(e.pegRows??t-1)),a=Math.max(1,Math.round(e.count??Math.max(64,4*t))),i=(o=Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,Math.max(0,Math.min(1,o))),n=C(e.seed??1),s=e.idPrefix??"mechanical";var o;return Array.from({length:a},(e,t)=>{let a=0;for(let e=0;r>e;e+=1)n()<i&&(a+=1);let o=r/2;return{id:`${s}-${t}`,value:a,mechanical:!0,pegRows:r,branchProbability:i,pathRights:a,side:o>a?"left":a>o?"right":"center"}})}({bins:i,count:t.mechanicalCount,pegRows:n,branchProbability:t.branchProbability,seed:t.seed}):function(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>(e+"").trim()).filter(Boolean),r=t.length?t:["Intake"],a=Math.max(r.length,Math.round(e.count??Math.max(48,12*r.length))),i=function(e){let t=x(e);return null!=t&&t>0?t:1}(e.unitValue),n=C(e.seed??1),s=e.idPrefix??"mechanical-pile",o=r.map(()=>.65+.9*n()),l=o.reduce((e,t)=>e+t,0)||1,c=a-r.length,u=o.map(e=>e/l*c),d=u.map(e=>1+Math.floor(e)),p=a-d.reduce((e,t)=>e+t,0),h=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;p>0;e=(e+1)%h.length)d[h[e].index]+=1,p-=1;return r.map((e,t)=>({id:`${s}-${t}`,category:e,value:d[t]*i,mechanical:!0,unitCount:d[t],unitValue:i,share:d[t]/a}))}({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),a=k(a,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){let e=new Map,i=t.valueAccessor??(r?"value":void 0);return a.forEach((r,a)=>{let n=($(r,a,t.categoryAccessor??"category")??"unknown")+"",s=i?x($(r,a,i)):1;e.set(n,(e.get(n)??0)+Math.max(0,s??0))}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){let e=a.map((e,r)=>x($(e,r,t.valueAccessor??"value"))).filter(e=>null!=e),s=r?[0,n]:function(e){if(!e)return;let t=x(e[0]),r=x(e[1]);return null!=t&&null!=r?t>r?[r,t]:[t,r]:void 0}(t.valueExtent),o=s?.[0]??(e.length?Math.min(...e):0),l=s?.[1]??(e.length?Math.max(...e):1),c=o===l?1:l-o,u=Array.from({length:i},(e,t)=>({label:t+1+"",value:0}));for(let t of e)u[Math.max(0,Math.min(i-1,Math.floor((t-o)/c*i)))].value+=1;return{generated:r,rows:u}}if("CollisionSwarmChart"===e){let e=new Map;return a.forEach((r,a)=>{if(null==x($(r,a,t.xAccessor??"x")))return;let i=t.groupAccessor?($(r,a,t.groupAccessor)??"All")+"":"All";e.set(i,(e.get(i)??0)+1)}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){let e=x(t.windows?.size??10);if(null==e||0>=e)return null;let{events:i}=function(e){let{windowSize:t,watermark:r,watermarkAtArrivalAccessor:a}=e;if(!Number.isFinite(t)||0>=t)throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:i}=k(e.data,"event"),n=i.flatMap((t,r)=>{let a=x($(t,r,e.timeAccessor));return null==a?[]:[{datum:t,index:r,eventTime:a,arrivalTime:x($(t,r,e.arrivalAccessor))??a,watermarkAtArrival:0,late:!1}]}),s="function"==typeof r?null:x(r?.value),o="function"==typeof r?t:x(r?.delay)??t,l=-1/0,c=-1/0;for(let e of n.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){l=Math.max(l,e.eventTime);let i="function"==typeof r?x(r(l)):l-o;c=s??Math.max(c,i??l-t);let n=a?x($(e.datum,e.index,a)):null;e.watermarkAtArrival=n??c,e.late=e.watermarkAtArrival>=(Math.floor(e.eventTime/t)+1)*t}return{events:n,watermarkValue:n.length?c:s??-o}}({data:a,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),n=i.map(e=>e.eventTime),s=n.length?Math.min(...n):0,o=n.length?Math.max(...n):s+e,l=Math.min(x(t.timeExtent?.[0])??s,s),c=Math.max(x(t.timeExtent?.[1])??o,o),u=Math.floor(l/e)*e,d=Math.max(1,Math.ceil((c-u+e)/e)),p=Array.from({length:d},(t,r)=>({label:`${u+r*e}-${u+(r+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(let t of i){let r=p[Math.max(0,Math.min(d-1,Math.floor((t.eventTime-u)/e)))];t.late?r.secondary+=1:r.value+=1}return{generated:r,rows:p}}return null}function P(e){let t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function E(e,t){let r=e.physics&&"object"==typeof e.physics?e.physics:null,a=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,n=[e.settledProjectionRows,e.projectionRows,a?.rows,r?.settledProjectionRows,r?.projectionRows,r?.settledProjection&&"object"==typeof r.settledProjection?r.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(n)?n.map((e,r)=>{if(!e||"object"!=typeof e)return null;let a=e,n=P(a.count??a.value??a.total??a.bodies??a.events);if(null==n)return null;let s=a.label??a.id??a.name??"container "+(r+1),o=P(a.secondary??a.secondaryCount),l=P(a.observed??a.observedCount);return{label:i(s,t),count:n,...null!=o?{secondary:o}:{},..."string"==typeof a.secondaryLabel&&a.secondaryLabel?{secondaryLabel:a.secondaryLabel}:{},...null!=l?{observed:l}:{}}}).filter(e=>null!=e):null}function j(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function R(e){return Kt[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function B(e,t){let r=function(e){if(e){if("fits"in e||"buildProps"in e){let t=e,r={};for(let[e,a]of Object.entries(t.intentScores))"number"==typeof a&&Number.isFinite(a)&&(r[e]=a);return{family:t.family,intentScores:Object.keys(r).length?r:void 0}}return e}}(t);if(r?.act)return r.act;if(r?.intentScores){let e=function(e){let t,r=0;for(let[a,i]of Object.entries(e))if("number"==typeof i&&i>0){if(i>r){t=a,r=i;continue}if(i===r&&void 0!==t){let e=er.indexOf(a),r=er.indexOf(t);-1!==e&&(-1===r||r>e)&&(t=a)}}return t}(r.intentScores);if(e&&Zt[e]&&(r.intentScores[e]??0)>=3)return Zt[e]}return r?.family?_t[r.family]:function(e){return"BumpChart"===e?"ranking":Wt.has(e)||"StackedAreaChart"===e?"apportioning":Yt.has(e)?"relating":Gt.has(e)?"comparing":Ut.has(e)?"characterizing":Vt.has(e)?"tracking":Xt.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}function T(e){let t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;let t=e;if("string"!=typeof t.type||!rr.has(t.type))return!1;let r=t.provenance;return!(!r||"object"!=typeof r)&&(ar.has(r.authorKind)||ir.has(r.source)||nr.has(r.basis))})}function M(e="en"){let t,r;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?r.format(e):t.format(e):e+""}function F(e){let t=sr["string"==typeof e.type?e.type:"annotation"]||"an annotation",r=function(e){let t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,r=t?.authorKind??t?.source??t?.basis;return"watcher"===r?"a watcher-flagged ":"agent"===r||"ai"===r||"llm-inference"===r?"an AI-suggested ":""}(e),a=r?r+t.replace(/^an? /,""):t,i="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return i?`${a} labeled "${i}"`:a}function I(e){let t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;let r=n(t.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return;let a=r.map(F),i=a.slice(0,5),s=a.length-i.length,o=function(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}(i)+(s>0?`, and ${s} more`:""),l=r.length;return`The author has marked ${1===l?"one feature":l+" features"} on this chart: ${o}.`}function L(n,s,o={}){let l=void 0!==o.levels,c=new Set(o.levels??["l1","l2","l3"]);!l&&(o.capability||T(s))&&c.add("l4");let u=y(n,s,o.recipe);if(u){let e=["l1","l2","l3","l4"].filter(e=>c.has(e));!l&&!e.includes("l4")&&e.push("l4");let t=function(e,t,r={}){let a=g(t),i=f(t),n=r.locale??"en",s=("function"==typeof e.description?e.description({data:a,config:i,locale:n}):void 0)?.levels??function(e,t,r,a){let i=w(e,["nominal","ordinal"]),n=w(e,["quantitative"]),s=i?b(i,r,t):void 0,o=n?b(n,r,t):void 0,l=i?.role??s??"category",c=n?.role??o??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${l} and ${c} are mapped through the recipe's declared visual semantics`,{number:p,percent:h}=function(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}(a),f=new Map;if(s&&o)for(let e of t){let t=(e[s]??"Uncategorized")+"",r=Number(e[o]);Number.isFinite(r)&&f.set(t,(f.get(t)??0)+r)}let g=[...f].sort((e,t)=>t[1]-e[1]),y=g.reduce((e,[,t])=>e+t,0),v=g[0],A=g[1],$=y>0?((v?.[1]??0)+(A?.[1]??0))/y:0,x=e.intents.map(e=>({id:m(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,C=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${l} and ${c}. ${k=d,k&&k.charAt(0).toUpperCase()+k.slice(1)}.`,l2:g.length>0?`${g.length} categories total ${p.format(y)}. ${v[0]} accounts for ${p.format(v[1])}${y>0?` (${h.format(v[1]/y)})`:""}${A?`, followed by ${A[0]} at ${p.format(A[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>g.length?v?v[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>$?`The total is distributed across ${g.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${v[0]} and ${A[0]}, which together account for ${h.format($)}.`,l4:`The chart is intended for ${x??"explanation"}${C?` with a ${C} audience`:""}: ${e.designContract.whyCustom}`};var k}(e,a,i,n),o=r.levels??["l1","l2","l3","l4"],l={};for(let e of o)s[e]&&(l[e]=s[e]);let c=["l1","l2","l3","l4"].map(e=>l[e]).filter(e=>!!e).join(" "),u=r.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:c,levels:l,...u?.length?{caveats:u}:{}}}(u,s,{levels:e,locale:o.locale,audience:o.audience,includeCaveats:o.includeCaveats}),r=I(s);return{...t,text:r?`${r} ${t.text}`.trim():t.text,...r?{annotations:r}:{}}}let d=M(o.locale??"en"),p=R(n),h=Array.isArray(s.data)?s.data:null,v=a(s),A=Qt.has(n)?E(s,d):null,$=Qt.has(n)&&null===A?S(n,s):null,{measure:x,measureFallback:C,dimension:k,dimensionFallback:P}=r(n,s),F="string"==typeof x&&x?x:C,L="string"==typeof k&&k?k:P,D={};if(Qt.has(n)&&function(e,t,r,a,i,n,s=null){let o=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),l=s&&"EventDropChart"===e?"accepted event":function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}(e),c=s?s.generated?"The generated sample projection":"The source projection":"The settled projection";if(i.has("l1")&&(a.l1=function(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}(e,t)),!i.has("l2")&&!i.has("l3"))return;if(!r||0===r.length)return void(i.has("l2")&&(a.l2=s?"No valid source records are available.":"No settled projection is loaded yet."));let u=r.reduce((e,t)=>e+t.count,0),d=r.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),p=d[0]??r.slice().sort((e,t)=>t.count-e.count)[0];if(!p)return;let h=r.reduce((e,t)=>e+(t.secondary??0),0),m=r.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(i.has("l2"))if(s&&"EventDropChart"===e)a.l2=`${c} classifies ${n(u+h)} ${j(u+h,"event")} across ${r.length} ${j(r.length,o)}: ${n(u)} accepted and ${n(h)} late.`;else if(0===d.length)a.l2=`${c} contains ${n(u)} ${j(u,l)} across ${r.length} ${j(r.length,o)}; no ${j(2,o)} are non-empty yet.`;else{let e=h>0?` ${n(h)} ${j(h,l)} ${1===h?"is":"are"} marked ${m}.`:"";a.l2=`${c} contains ${n(u)} ${j(u,l)} across ${r.length} ${j(r.length,o)}; ${d.length} ${j(d.length,o)} ${1===d.length?"is":"are"} non-empty. The largest ${o} is ${p.label} with ${n(p.count)} ${j(p.count,l)}.${e}`}if(i.has("l3")&&u>0&&d.length>0){let e=d.find(e=>e!==p),t=function(e,t){if(0>=t)return"0%";let r=e/t*100;return(10>r?Math.round(10*r)/10:Math.round(r))+"%"}(p.count,u);a.l3=e?`${c} is most concentrated in ${p.label}, which holds ${n(p.count)} ${j(p.count,l)} (${t}); ${e.label} follows with ${n(e.count)} ${j(e.count,l)}.`:`${c} is concentrated in ${p.label}, which holds all ${n(p.count)} ${j(p.count,l)}.`}}(n,p,A??($?E({projectionRows:$.rows},d):null),D,c,d,$),c.has("l1")&&!Qt.has(n))if("BumpChart"===n)D.l1=`A ${p} ranking ${v??"series"} by ${F} across ${L}.`;else if(Vt.has(n)||Gt.has(n))D.l1=`A ${p} of ${F} by ${L}`+(v?`, split by ${v}.`:".");else if(Wt.has(n))D.l1=`A ${p} showing ${F} across ${L} categories.`;else if(Ut.has(n))D.l1=`A ${p} of the distribution of ${F}`+(v?` by ${v}.`:".");else if(Xt.has(n)){let e=Array.isArray(s.nodes)?s.nodes.length:void 0,t=Array.isArray(s.edges)?s.edges.length:void 0,r=[null!=e?`${e} ${O(e,"node")}`:null,null!=t?`${t} ${O(t,"edge")}`:null].filter(Boolean);D.l1=`A ${p}${r.length?" with "+r.join(" and "):""}.`}else if("BigNumber"===n){let e="string"==typeof s.label?s.label:F;D.l1=`A single value${e?" for "+e:""}.`}else D.l1=`A ${p}.`;let z=Vt.has(n)||"BumpChart"===n||Gt.has(n)||Wt.has(n)||Ut.has(n),H=null;if((c.has("l2")||c.has("l3")||c.has("l4"))&&z&&h&&h.length>0&&(H=function(e,t,r,a){let n=0,s=0,o=1/0,l=-1/0,c=null,u=null,d=0,p=0,h=null,m=null,f=NaN,g=NaN;for(let r of e){let e=t(r);Number.isFinite(e)&&(0===n&&(f=e,h=r),g=e,m=r,o>e&&(o=e,c=r,d=n),e>l&&(l=e,u=r,p=n),n++,s+=e)}return 0===n?null:{count:n,min:o,max:l,mean:s/n,minLabel:i(null!=c?r(c):null,a),maxLabel:i(null!=u?r(u):null,a),first:f,last:g,firstLabel:i(null!=h?r(h):null,a),lastLabel:i(null!=m?r(m):null,a),minIndex:d,maxIndex:p}}(h,e(x,C),t(k,P),d)),c.has("l2")&&z&&(h&&0!==h.length?H&&(D.l2=Wt.has(n)?`${H.count} segments totaling ${d(function(e){return e.mean*e.count}(H))}. Largest is ${H.maxLabel} at ${d(H.max)}; smallest is ${H.minLabel} at ${d(H.min)}.`:`${F} ranges from ${d(H.min)} (${H.minLabel}) to ${d(H.max)} (${H.maxLabel}), with a mean of ${d(H.mean)} across ${H.count} points.`):D.l2="No data is loaded yet."),c.has("l3")&&H&&!v&&Vt.has(n)?D.l3=function(e,t,r){let{first:a,last:i,min:n,max:s,maxLabel:o,minLabel:l,firstLabel:c,lastLabel:u,minIndex:d,maxIndex:p,count:h}=e,m=s-n,f=i-a;if(0===m)return`${N(t)} is constant at ${r(a)} across the series.`;if(.04>m/(Math.abs(e.mean)||1))return`${N(t)} ends roughly where it started (${r(a)} at ${c} to ${r(i)} at ${u}), ranging between ${r(n)} and ${r(s)}.`;let g=p>0&&h-1>p,y=d>0&&h-1>d,b=(s-Math.max(a,i))/m,v=(Math.min(a,i)-n)/m;return g&&b>.15?`Overall ${t} climbs to a peak of ${r(s)} (${o}), then falls to ${r(i)} (${u}).`:y&&v>.15?`Overall ${t} drops to a low of ${r(n)} (${l}), then recovers to ${r(i)} (${u}).`:.05>Math.abs(f)/m?`${N(t)} ends roughly where it started (${r(a)} at ${c} to ${r(i)} at ${u}), ranging between ${r(n)} and ${r(s)}.`:f>0?p===h-1?`Overall ${t} rises from ${r(a)} (${c}) to a peak of ${r(i)} (${u}).`:`Overall ${t} rises from ${r(a)} (${c}) to ${r(i)} (${u}), after peaking at ${r(s)} (${o}).`:d===h-1?`Overall ${t} falls from ${r(a)} (${c}) to a low of ${r(i)} (${u}).`:`Overall ${t} falls from ${r(a)} (${c}) to ${r(i)} (${u}), after dipping to ${r(n)} (${l}).`}(H,F,d):c.has("l3")&&H&&!v&&Gt.has(n)&&(D.l3=`The highest ${L} is ${H.maxLabel} and the lowest is ${H.minLabel}.`),c.has("l4")){let e=T(s)?"alerting":B(n,o.capability);e&&(D.l4=function(e,t,r,a,i,n,s,o){let l,c,u=tr[e],d=/^[aeiou]/i.test(u)?"an":"a";switch(e){case"locating":l="This is a map",c="read values by location";break;case"presenting":l="This is a single-value display",c=`read ${"string"==typeof r.label&&r.label?r.label:i} as the headline number`;break;case"tracing":l=`This is ${d} ${u} chart`,c="follow the movement between states";break;case"nesting":l=`This is ${d} ${u} chart`,c="read it for nested structure and how children sum into their parents";break;case"relating":l=`This is ${d} ${u} chart`,c=`read it for whether ${n} and ${i} move together`;break;default:l=`This is ${d} ${u} chart`,c=function(e,t,r,a,i,n){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+r;case"comparing":return`compare ${r} across ${a}`;case"ranking":return"read it top to bottom by "+r;case"apportioning":return`read each ${a}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+r;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,r){if(Gt.has(r)||Wt.has(r))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;let{first:a,last:i,min:n,max:s,minLabel:o,maxLabel:l,lastLabel:c,minIndex:u,maxIndex:d,count:p}=e,h=s-n;if(h>0){let e=d>0&&p-1>d,r=u>0&&p-1>u,m=(s-Math.max(a,i))/h,f=(Math.min(a,i)-n)/h;if(e&&m>.15)return`the peak of ${t(s)} at ${l} is the point to investigate`;if(r&&f>.15)return`the dip to ${t(n)} at ${o} is the point to investigate`;if(i>=s)return`the climb to ${t(i)} at ${c} warrants a closer look`;if(n>=i)return`the drop to ${t(i)} at ${c} warrants a closer look`}return`the extremes — ${l} (${t(s)}) and ${o} (${t(n)}) — are the points to check`}(t,i,n);case"tracking":return`read it for the trajectory of ${r}, which ${function(e){let t=e.max-e.min,r=e.last-e.first;return 0===t||.05>Math.abs(r)/t?"holds roughly steady":r>0?"rises":"falls"}(t)} from ${i(t.first)} (${t.firstLabel}) to ${i(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${r} across ${a}; ${t.maxLabel} leads at ${i(t.max)}`;case"ranking":return`read it top to bottom by ${r}; ${t.maxLabel} ranks highest at ${i(t.max)}`;case"apportioning":{let e=t.mean*t.count,r=e>0?Math.round(t.max/e*100):null;return`read each ${a}'s share of the ${i(e)} total; ${t.maxLabel} is the largest at ${i(t.max)}${null!=r?` (${r}%)`:""}`}case"characterizing":return`read it for the spread of ${r}, from ${i(t.min)} to ${i(t.max)}`;default:return"read the highlighted features"}}(e,a,i,n,s,t)}return`${l}; ${c}.${function(e,t){if(!t)return"";let r=t.familiarity?.[e];return"number"!=typeof r||r>2?"":` This ${R(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,o)}`}(e,n,s,v?null:H,F,L,d,o.audience))}let q=["l1","l2","l3","l4"].filter(e=>c.has(e)&&D[e]).map(e=>D[e]).join(" "),V=I(s);return{text:V?`${V} ${q}`.trim():q,levels:D,...V?{annotations:V}:{}}}function N(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function O(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function D(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function z(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function H(e,t="—"){return null==e||""===e?t:"object"==typeof e?H(e.id??e.name??e.label,t):e+""}function q(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function V(e){return H(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function G(e,t){let r=z(e,t,"children");return Array.isArray(r)?r:[]}function W(e,t,r){return`${e} ${1===e?t:r}`}function U(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?", leaf total "+t(e.leafTotal):`, known leaf total ${t(e.leafTotal)} across ${W(e.numericLeaves,"valued leaf","valued leaves")}`}function J(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function K(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function X(e,t="—"){return null==e||""===e?t:"object"==typeof e?X(e.id??e.name??e.label,t):e+""}function Q(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Y(e){return X(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Z(e){let t=[];return(e.linkedHover||e.selection||e.linkedBrush)&&t.push("Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&t.push("Hover or focus a mark for its details."),t.length>0?" "+t.join(" "):""}function _(e,t,r){let a=K(e,t,r);if(void 0!==a)return a;let i=e.properties;return i&&"object"==typeof i?K(i,t,r):void 0}function ee(e,t,r){return X(_(e,t,"id")??_(e,"name","name")??_(e,"NAME","NAME")??_(e,"label","label"),r)}function te(e){let t=0,r=1/0,a=-1/0,i=0;for(let n of e)null!=n.value&&(t+=1,r=Math.min(r,n.value),a=Math.max(a,n.value),i+=n.value);return 0===t?null:{count:t,min:r,max:a,total:i,average:i/t}}function re(e,t){let r=te(e);return r?`range ${t(r.min)} to ${t(r.max)}, average ${t(r.average)}, total ${t(r.total)}`:"no numeric values"}function ae(e,t,r,a){let i=function(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];let t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}(t.areas),n="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],s=Array.isArray(t.flows)?t.flows:[],o=Array.isArray(t.lines)?t.lines:[],l=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?i:n).map((r,a)=>({datum:r,index:a,label:ee(r,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${a+1}`),value:Q(_(r,l,"value"))})),d=u.filter(e=>null!=e.value),p={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${i.length} regions.${d.length>0?` Values are available for ${d.length} of ${i.length} regions; ${re(d,a)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${s.length} flows and ${n.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${n.length} locations and ${o.length} routes.`:`A proportional-symbol map with ${n.length} locations.`}${Z(t)}`,children:[]};if("ChoroplethMap"===e)p.children=function(e,t,r){let a,i=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),n=new Map,s=0;for(let[e,t]of i.entries())a!==t.value&&(s=e+1,a=t.value),n.set(t.index,s);let o=0;return function(e){let t=e.filter(e=>null!=e.value),r=e.filter(e=>null==e.value),a=[],i=te(t);if(i)if(i.min===i.max)a.push({id:"equal",label:"Equal values",rows:t});else{let e=i.min+(i.max-i.min)/3,r=i.min+2*(i.max-i.min)/3,n=t.filter(e=>e.value>=r),s=t.filter(t=>t.value>=e&&r>t.value),o=t.filter(t=>e>t.value);n.length>0&&a.push({id:"highest",label:"Highest values",rows:n}),s.length>0&&a.push({id:"middle",label:"Middle values",rows:s}),o.length>0&&a.push({id:"lowest",label:"Lowest values",rows:o})}return r.length>0&&a.push({id:"missing",label:"No numeric value",rows:r}),a}(e).map(e=>{let a=e.rows.slice(0,Math.max(0,t-o));o+=a.length;let s=a.map(e=>{let t=n.get(e.index),a=null==t||2>i.length?"":`, rank ${t} of ${i.length}`;return{id:`geo-${Y(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?e.label+": no numeric value.":`${e.label}: ${r(e.value)}${a}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),l=e.rows.length-a.length;return l>0&&s.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${l} more ${1===l?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:"regions-"+e.id,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${re(e.rows,r)}.`,children:s}})}(u,r,a);else if(u.length>0){let e=u.slice(0,r).map(e=>({id:`geo-${Y(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":": "+a(e.value)}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>r&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-r} more locations.`}),p.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}let h="FlowMap"===e?s:o;if(h.length>0){let e=h.slice(0,r).map((e,t)=>{let r=X(e.source,"unknown"),i=X(e.target,"unknown"),n=Q(K(e,l,"value"));return{id:`route-${Y(r)}-${Y(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==n?"":": "+a(n)}.`,...null==n?{}:{value:n},datum:e}});p.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${h.length} ${1===h.length?"route":"routes"}.`,children:e})}return p}function ie(e,t={},r={}){return!!y(e,t,r.recipe)||or.has(e)||lr.has(e)||cr.has(e)||Vt.has(e)||Gt.has(e)||Wt.has(e)||Ut.has(e)}function ne(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function se(e,t="—"){return null==e||""===e?t:"object"==typeof e?se(e.id??e.name??e.label,t):e+""}function oe(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function le(e){return se(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function ce(e,t){let r=[];return(e.linkedHover||e.selection||e.linkedBrush)&&r.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&r.push("Hover or focus a mark for its details."),r.length>0?" "+r.join(" "):""}function ue(e,t){t&&e.children?.push(t)}function de(s,o,l={}){let c=l.locale??"en",u=Math.max(1,l.maxLeaves??200),d=M(c),p=y(s,o,l.recipe);if(p)return function(e,t,r={}){let a=g(t),i=f(t),n=Math.max(1,r.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:a,config:i,locale:r.locale??"en"});let s=(m=e.navigation)&&"object"==typeof m?e.navigation:void 0,o=(s?.groupByRole?v(e,s.groupByRole):void 0)??(s?.groupBy?.[0]?v(e,s.groupBy[0])??e.dataRoles.find(e=>e.field===s.groupBy?.[0]):void 0)??w(e,["nominal","ordinal"]),l=o?b(o,i,a):void 0,c=(s?.idRole?v(e,s.idRole):void 0)??w(e,["identifier"]),u=c?b(c,i,a):void 0,d={id:"root",role:"chart",label:s?.summaryTemplate?A(s.summaryTemplate,void 0,e,i,a,{count:a.length}):`${e.name}: ${a.length} ${1===a.length?"item":"items"} represented.`,level:1,children:[]},p=0,h=(t,r,n)=>{let o=u?t[u]:void 0,l=s?.itemLabelTemplate?A(s.itemLabelTemplate,t,e,i,a,{count:a.length}):function(e,t,r,a){let i=w(t,["nominal","ordinal"]),n=t.dataRoles.filter(e=>"quantitative"===e.semanticType),s=i?b(i,r,a):void 0,o=[];s&&null!=e[s]&&o.push(e[s]+"");for(let t of n){let i=b(t,r,a);i&&null!=e[i]&&o.push(`${t.role}: ${e[i]+""}`)}return o.length>0?o.join(", "):"Data item"}(t,e,i,a);return{id:"datum-"+D(o??r),role:"datum",label:l,level:n,datum:t}};var m;if(l){let e=new Map;for(let t of a){let r=(t[l]??"Uncategorized")+"",a=e.get(r);a?a.push(t):e.set(r,[t])}d.children=[...e].map(([e,t],r)=>{let a=t.slice(0,Math.max(0,n-p));p+=a.length;let i=a.map((e,t)=>h(e,1e5*r+t,3));return t.length>a.length&&i.push({id:"more-"+D(e),role:"datum",label:`…and ${t.length-a.length} more items`,level:3}),{id:"group-"+D(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:i}})}else{let e=a.slice(0,n);d.children=e.map((e,t)=>h(e,t,2)),a.length>e.length&&d.children.push({id:"more",role:"datum",label:`…and ${a.length-e.length} more items`,level:2})}return d}(p,o,{maxLeaves:u,locale:c});let h={id:"root",role:"chart",label:L(s,o,{locale:c}).text||"Chart.",level:1,children:[]},m=function(e,t){let r=Array.isArray(e.annotations)?e.annotations:null;if(!r)return null;let a=n(r.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return null;let i=0,s=a.slice(0,t).map(e=>{let t=e.lifecycle?.status,r=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+i++,role:"annotation",level:3,label:`${a=F(e),a&&a.charAt(0).toUpperCase()+a.slice(1)}${r}.`,datum:e};var a});a.length>t&&s.push({id:"annotation-"+i++,role:"annotation",level:3,label:`…and ${a.length-t} more annotations.`});let o=a.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===o?"one marked feature":o+" marked features"}.`,children:s}}(o,u);if(or.has(s)){let e=function(e,t,r,a){let i=Array.isArray(t.nodes)?t.nodes:[],n=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],s=t.nodeIdAccessor??t.nodeIDAccessor,o=t.sourceAccessor??"source",l=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>se(ne(e,s,"id"),"unknown"),d=(e,t)=>se(ne(e,t,""),"unknown"),p=new Set;for(let e of n)p.add(d(e,o)),p.add(d(e,l));let h=i.length>0?i:[...p].map(e=>({id:e})),m=new Map;for(let e of h)m.set(u(e),{links:0,value:0});for(let e of n){let t=d(e,o),r=d(e,l),a=oe(ne(e,c,"value"))??0;for(let e of[t,r]){let t=m.get(e)??{links:0,value:0};t.links+=1,t.value+=a,m.set(e,t)}}let f={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${h.length} nodes and ${n.length} links.${ce(t,"network")}`,children:[]},g=0,y=new Map,b=t.colorBy??"group";for(let e of h){let t=se(ne(e,b,"group"),"Ungrouped"),r=y.get(t);r?r.push(e):y.set(t,[e])}let v=[...y].map(([e,t],i)=>{let n=[];for(let[e,s]of t.entries()){if(g>=r)break;g+=1;let t=u(s),o=m.get(t)??{links:0,value:0},l=o.value>0?`, ${a(o.value)} total flow`:"";n.push({id:`node-${i}-${e}-${le(t)}`,role:"datum",level:3,label:`${t}: ${o.links} ${1===o.links?"link":"links"}${l}.`,value:o.value>0?o.value:void 0,datum:s})}return{id:`nodes-${i}-${le(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:n}});v.length>0&&f.children?.push(...v);let w=n.slice(0,r).map((e,t)=>{let r=d(e,o),i=d(e,l),n=oe(ne(e,c,"value"));return{id:`link-${le(r)}-${le(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==n?"":": "+a(n)}.`,value:n,datum:e}});return n.length>r&&w.push({id:"links-more",role:"datum",level:3,label:`…and ${n.length-r} more links.`,value:void 0}),w.length>0&&f.children?.push({id:"links",role:"series",level:2,label:`Links: ${n.length} ${1===n.length?"connection":"connections"}.`,children:w}),f}(s,o,u,d);return ue(e,m),e}if(lr.has(s)){let e=function(e,t,r,a){let i=t.data&&"object"==typeof t.data?t.data:null,n=t.childrenAccessor??"children",s=t.valueAccessor??"value",o=t.nodeLabel??t.nodeIdAccessor,l=new WeakMap,c=new WeakSet,u=e=>{let t=l.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);let r,a=G(e,n);if(0===a.length){let t=q(z(e,s,"value"));r={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else r=a.reduce((e,t)=>{let r=u(t);return{descendants:e.descendants+1+r.descendants,depth:Math.max(e.depth,r.depth+1),leaves:e.leaves+r.leaves,numericLeaves:e.numericLeaves+r.numericLeaves,leafTotal:e.leafTotal+r.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),l.set(e,r),r},d=0,p=(e,t,i,l)=>{let c=H(z(e,o,"name"),"item "+i);if(l.has(e))return{id:`hierarchy-${V(i)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};let h=G(e,n),m=u(e);if(0===h.length){if(d>=r)return null;d+=1;let n=q(z(e,s,"value"));return{id:`hierarchy-${V(i)}-${V(c)}`,role:"datum",level:t,label:`${c}${null==n?"":": "+a(n)}.`,...null==n?{}:{value:n},datum:e}}let f=new Set(l);f.add(e);let g=[],y=0;for(let[e,a]of h.entries()){if(d>=r){y+=u(a).leaves;continue}let n=p(a,t+1,`${i}-${e}`,f);n&&g.push(n)}return y>0&&g.push({id:`hierarchy-${V(i)}-more`,role:"datum",level:t+1,label:`${W(y,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${r}.`}),{id:`hierarchy-${V(i)}-${V(c)}`,role:"series",level:t,label:`${c}: ${W(h.length,"direct child","direct children")}, ${W(m.descendants,"total descendant","total descendants")}, ${W(m.leaves,"leaf","leaves")}${U(m,a)}.`,datum:e,children:g}},h=i?u(i):null,m={id:"root",role:"chart",level:1,label:i?`A ${J(e)} chart with ${W(h.leaves,"leaf","leaves")} and ${W(h.descendants,"total descendant","total descendants")} across ${W(h.depth,"hierarchy level","hierarchy levels")}${U(h,a)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(i){let e=p(i,2,"root",new Set);if(e){let t=H(z(i,o,"name"),"");m.children="series"===e.role&&""===t?e.children:[e]}}return m}(s,o,u,d);return ue(e,m),e}if(cr.has(s)){let e=ae(s,o,u,d);return ue(e,m),e}let $=Array.isArray(o.data)?o.data:null,x=ie(s,o,l);if(!$||0===$.length||!x)return m&&(h.children=[m]),h;let{measure:C,measureFallback:k,dimension:S,dimensionFallback:P}=r(s,o),E=e(C,k),j=t(S,P),R="string"==typeof C&&C?C:k,B="string"==typeof S&&S?S:P,T=a(o),I=0,N=e=>`${e}-${I++}`,O=(e,t)=>{let r=e.slice(0,u).map(e=>((e,t)=>{let r=E(e),a=i(j(e),d);return{id:N("datum"),role:"datum",level:t,label:`${a}: ${Number.isFinite(r)?d(r):"—"}`,value:Number.isFinite(r)?r:void 0,datum:e}})(e,t));return e.length>u&&r.push({id:N("more"),role:"datum",level:t,label:`…and ${e.length-u} more points`}),r},K=[];if(Vt.has(s)||Gt.has(s)){let e=1/0,t=-1/0,r=1/0,a=-1/0,n=[],o=!0;for(let i of $){let s=E(i);Number.isFinite(s)&&(e>s&&(e=s),s>t&&(t=s));let l=j(i);n.push(l),"number"==typeof l&&Number.isFinite(l)?(r>l&&(r=l),l>a&&(a=l)):o=!1}let l=new Set,c=[];for(let e of n){let t=e+"";l.has(t)||(l.add(t),c.push(e))}let u=o?`${d(r)} to ${d(a)}`:`${i(c[0],d)} to ${i(c[c.length-1],d)} (${Gt.has(s)?c.length+" categories":$.length+" points"})`;K.push({id:N("axis"),role:"axis",level:2,label:`${Gt.has(s)?"Category axis":"X axis"}: ${B}, ${u}.`}),t>=e&&K.push({id:N("axis"),role:"axis",level:2,label:`Value axis: ${R}, ${d(e)} to ${d(t)}.`})}if(T){let e=t(T,T),r=new Map;for(let t of $){let a=(e(t)??"—")+"",i=r.get(a);i?i.push(t):r.set(a,[t])}let a=[];for(let[e,t]of r){let r=L(s,{...o,data:t},{levels:["l2","l3"],locale:c}).text;a.push({id:N("series"),role:"series",level:2,label:`Series ${e}: ${r}`,children:O(t,3)})}h.children=[...K,...a]}else h.children=[...K,...O($,2)];return m&&h.children.push(m),h}function pe(e){let[t,r]=Array.isArray(e)?e:[e,void 0],a=ur[t],i=Array.isArray(a)?[...a]:a;return void 0===r?{type:i}:{type:i,enum:[...dr[r]]}}function he(e){return"string"==typeof e&&e.trim().length>0}function me(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));let r=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!r)return null;let[a,i,n]=[parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255],s=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*s(a)+.7152*s(i)+.0722*s(n)}function fe(e,t){let r=me(e),a=me(t);return null===r||null===a?null:(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}function ge(e){return"string"==typeof e?.type?e.type:""}function ye(e){return!!e&&"object"==typeof e&&br.has(ge(e))}function be(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 ve(e){let t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;let r=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return r?r.length:1}function we(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function Ae(e,t,r={}){let a=[],i=p(e),n=Cr.has(e),s=!!hr[e]||!!i||n,o=!0===r.inChartContainer,l=!0===r.describe,c=!0===r.navigable,u=$r.has(e),d=wr.has(e),{hasTitle:h,hasDescription:m,hasSummary:f,unsupportedFinding:g}=function(e,t,r){let a=hr[e]?.props,i=fr.has(e)||void 0!==r&&gr.has(r),n=e=>!!a?.[e]||i,s=mr.filter(e=>he(t[e])&&!n(e));return{hasTitle:n("title")&&he(t.title),hasDescription:n("description")&&he(t.description),hasSummary:n("summary")&&he(t.summary),unsupportedFinding:s.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${s.join(" and ")} text was supplied, but ${1===s.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,i?.frameFamily),y=!1!==t.accessibleTable&&!u,b=h||m||f,v=function(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}(t),w=function(e){let t=we(e),r=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===r.pause||"function"==typeof r.pause}(t),A=n,$=function(e){let t=we(e);return!0===e.settledProjection||!0===t.settledProjection}(t)||Sr.has(e)&&y,x=function(e){let t=we(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}(t)||A,C=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],k=s?"pass":"manual",S=s?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(g&&a.push(g),a.push(function(e){let t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},r=e.colorScheme,a="string"==typeof e.background?e.background:null;if(a&&!a.startsWith("#"))return{...t,status:"manual",message:`Background "${a}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};let i=a??"#ffffff";if(!Array.isArray(r))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};let n=[],s=0;for(let e of r){if("string"!=typeof e||!e.startsWith("#"))continue;let t=fe(e,i);null!=t&&(s++,3>t&&n.push(`${e} (${t.toFixed(1)}:1)`))}return 0===s?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:n.length>0?{...t,status:"fail",message:`${n.length} color(s) fall below 3:1 contrast vs ${i}: ${n.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${s} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${i}.`}}(t)),a.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...u?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:y?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:m&&f?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}}),a.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),a.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||kr.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,r=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 r=t.fill;return"object"==typeof r&&null!==r&&"hatch"===r.type})}(t);a.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...e?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:r?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:r?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}});let i=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=>yr.has(e))}(t.colorScheme);a.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...i?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),a.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:r?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:r?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{let e=C.filter(ye);if(e.length>0){let r=t.autoPlaceAnnotations,i="object"==typeof r&&null!==r&&!0===r.redundantCues,n=e.filter(e=>{if("string"!=typeof e.color)return!1;let t=ge(e),r=i&&"text"===t;return!(vr.has(ge(a=e))&&!function(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}(a)||r);var a});a.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===n.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${n.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}a.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...s?{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&&a.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{let r=Rr[e];if(r&&v){let e=t[r];"number"==typeof e&&e>0&&24>2*e&&a.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${r}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}a.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:k,message:`The chart takes a single tab stop and navigates data with arrow keys${S} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),a.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...v?f||m?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),a.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:k,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${S}.`}),a.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:k,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${S}.`,fix:s?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),a.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...b?{status:"pass",message:`Provided: ${[h&&"title",m&&"description",f&&"summary"].filter(Boolean).join(", ")}.`}:o?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),a.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...m||f?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:l?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:h?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}});{let e=[t.description,t.summary].filter(he).join(". "),r=e?function(e){let t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),r=e.trim().split(/\s+/).filter(Boolean);if(0===r.length||0===t.length)return null;let a=0;for(let e of r)a+=ve(e);return r.length/t.length*.39+a/r.length*11.8-15.59}(e):null;a.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==r?{status:"not-applicable",message:"No description/summary text to grade."}:r>9?{status:"warn",message:`Description/summary reads at ~grade ${r.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(r))} (≤ 9).`}})}if(xr.has(e)){let e=he(t.xLabel),r=he(t.yLabel);a.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&r?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!r&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(Er.has(e)&&a.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),C.length>1){let e=C.filter(be).length;a.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===C.length?{status:"pass",message:`All ${C.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:C.length+" annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.",fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${C.length-e} of ${C.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&a.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&a.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:k,message:`Transitions animate with object constancy and data changes are mirrored to the live region${S}.`,fix:s?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),a.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),a.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),a.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:k,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${S}.`,fix:s?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),a.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...u?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:y?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}}),u||a.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...o?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),a.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:s?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${s?"":S}.`,fix:s?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),a.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...c?d?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:d?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:k,message:`Keyboard navigation steps through points and switches series/groups${S}.`,fix:s?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}});{let r,i=Array.isArray(t.data)?t.data:null,n=Array.isArray(t.nodes)?t.nodes:null,s={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};r=Ar.has(e)&&i&&i.length>7?{...s,status:"warn",message:i.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.'}:n&&n.length>200?{...s,status:"warn",message:n.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."}:i&&i.length>5e3?{...s,status:"warn",message:i.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."}:i?{...s,status:"pass",message:i.length+" data points — a reasonable density for non-visual consumption."}:n?{...s,status:"pass",message:n.length+" nodes — a reasonable density for non-visual consumption."}:{...s,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},a.push(r)}{let e=Array.isArray(t.data)?t.data:null,r=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]),i=!1;if(e&&!r)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){i=!0;break}if(i)break}i&&a.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}a.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...l?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:f?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),a.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...u?{status:"not-applicable",message:"Single value — nothing to skip."}:y?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}}),a.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:k,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${S}.`,fix:s?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),a.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...kr.has(e)||Pr.has(e)?w?{status:"pass",message:e+" animates continuously and declares an in-chart pause/stop control."}:{status:"warn",message:e+" animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.",fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:k,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${S}.`}}),n&&(a.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...w?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),a.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...$?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),a.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...x?{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 r=!0===t.responsiveWidth||!0===t.responsiveHeight,i=jr.has(e)&&!0===t.zoomable;a.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...r?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:i?{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."}})}i&&(i.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length))&&a.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:i.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"===i.accessibility.description&&!m&&a.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:i.name+" requires a recipe-aware description, but none is attached.",fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),i.accessibility.fallbackTable&&!1===t.accessibleTable&&a.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:i.name+" requires a fallback table, but accessibleTable is disabled.",fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."}));let P=a.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),E={criticalsPassed:P.filter(e=>"pass"===e.status).length,criticalsEvaluated:P.length,fails:a.filter(e=>"fail"===e.status).length,warnings:a.filter(e=>"warn"===e.status).length,manual:a.filter(e=>"manual"===e.status).length,passes:a.filter(e=>"pass"===e.status).length};return{component:e,ok:!P.some(e=>"fail"===e.status),summary:E,findings:a,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 $e(e,t){return!0===e?.supportsAccessibleTable&&!1!==t.accessibleTable}function xe(e){return"string"==typeof e&&e.trim().length>0}function Ce(e){if(0===e.length)return;let t=e.map(e=>"idle"===e.status?"no data received":"active"===e.status?"receiving data":"not receiving new data"),r=[...new Set(t)],a=1===r.length?r[0]:t.join(", then ");return`Last ${e.length} stream ${1===e.length?"status":"statuses"}: ${a}.`}function ke(e,t){return e?!e.supportsLegend||!1===t.showLegend||!0!==t.showLegend&&null==t.legend&&!["colorBy","lineBy","areaBy","stackBy","groupBy"].some(e=>null!=t[e])?"not-applicable":"isolate"===t.legendInteraction||"highlight"===t.legendInteraction?"built-in":"not-enabled":"unsupported"}function Se(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Pe(e){return Se(e)?e:void 0}function Ee(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function je(e){let t=Ee(e);return null==t?void 0:Math.max(0,Math.floor(t))}function Re(...e){return e.map(Pe).find(Boolean)}function Be(...e){return e.find(Array.isArray)}function Te(e){let t={};for(let[r,a]of Object.entries(e))void 0!==a&&(t[r]=a);return t}function Me(e,t,r){return e["string"==typeof t&&t?t:r]}function Fe(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function Ie(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Le(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function Ne(e,t,r){let a=e?.filter(e=>!0===Pe(e)?.sensor).length,i=Pe(t?.observation),n=Pe(i?.sensors),s=Be(r?.activeSensors);return Math.max(a??0,n?Object.keys(n).length:0,s?.length??0)||void 0}function Oe(e,t,r={}){let a,{capability:i,audience:n,locale:s}=r,o=r.levels??["l1","l2","l3"],l=!1!==r.includeStructure,c=B(e,i),u=L(e,t,{levels:c?[...o,"l4"]:o,locale:s,capability:i,audience:n}),{l4:d,...p}=u.levels,h=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),m={levels:p,text:u.annotations?`${u.annotations} ${h}`.trim():h,...u.annotations?{annotations:u.annotations}:{}};if(c&&d){let e=(f=i)?"fits"in f||"buildProps"in f?{family:f.family}:{family:f.family,intentScores:f.intentScores}:{};a={act:c,sentence:d,family:e.family,intentScores:e.intentScores}}var f;let g=l?de(e,t,{maxLeaves:r.maxLeaves,locale:s}):void 0,y=function(e,t,r){if(!1===r)return;let a=Se(r)?r:void 0,i=Pe(t.physics),n=Re(a?.snapshot,i?.snapshot,t.physicsSnapshot,function(e){let t=Pe(e);return!!t&&(Se(t.world)||"simulationState"in t||"liveBodyOrder"in t)}(t.snapshot)?t.snapshot:void 0),s=Re(a?.evidence,i?.evidence,t.physicsEvidence,t.settledEvidence),o=Re(a?.config,i?.config,n?.config,t.config),l=Re(Pe(n?.world),Pe(i?.world)),c=Re(Pe(o?.kernel),Pe(l?.options)),u=Be(l?.bodies),d=Be(l?.colliders,o?.colliders),p=Be(n?.queue,i?.queue),h=Be(n?.liveBodyOrder),m=Be(l?.springs),f=Be(n?.activeSensorPairs),g=function(e){if(!e||0===e.length)return;let t=e.map((e,t)=>{let r=Pe(e);if(!r)return;let a=Ee(r.count??r.value??r.total??r.bodies??r.events);if(null==a)return;let i=(r.label??r.id??r.name??"container "+(t+1))+"",n=null==r.id?void 0:r.id+"",s=Ee(r.secondary??r.secondaryCount),o=Ee(r.observed??r.observedCount);return Te({id:n,label:i,count:a,secondary:s,secondaryLabel:"string"==typeof r.secondaryLabel?r.secondaryLabel:void 0,observed:o})}).filter(e=>null!=e);if(0===t.length)return;let r=t.reduce((e,t)=>e+t.count,0),a=t.filter(e=>e.count>0).length,i=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:r,populatedCount:a,...i?{leader:i}:{}}}(function(e,t,r,a){let i=Pe(e.settledProjection),n=Pe(t?.settledProjection);return Be(r?.projectionRows,r?.aggregates,e.settledProjectionRows,e.projectionRows,i?.rows,t?.settledProjectionRows,t?.projectionRows,n?.rows,a?.binCounts)}(t,i,a,s)),y=function(e,t){let r=e?.map((e,t)=>{let r=Pe(e);if(!r)return;let a=Ee(r.count)??0,i=Ee(r.total),n={label:(r.label??r.id??"sediment "+(t+1))+"",count:a};return null!=r.id&&(n.id=r.id+""),null!=i&&(n.total=i),n}).filter(e=>null!=e),a=je(t?.bins)??r?.length??0,i=Ee(t?.count)??r?.reduce((e,t)=>e+t.count,0)??0,n=Ee(t?.total)??r?.reduce((e,t)=>e+(t.total??0),0),s=r?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==a||0!==i||n)return{bins:a,count:i,...null!=n&&n>0?{total:n}:{},...s?{leader:s}:{}}}(Be(a?.sediment,i?.sediment,n?.sediment),Re(a?.sedimentTotals,i?.sedimentTotals)),b=h?.length??u?.length??je(s?.bodyCount),v=function(e){if(e)return e.filter(e=>!0===Pe(e)?.sleeping).length}(u)??je(s?.sleepingCount),w=p?.length,A="string"==typeof n?.simulationState?n.simulationState:void 0,$="boolean"==typeof s?.settled?s.settled:A?"settled"===A:null!=b||null!=v||null!=w?null!=b&&v===b&&0===(w??0):void 0,x=Pe(c?.gravity),C=Ee(x?.x),k=Ee(x?.y),S=Te({state:A,settled:$,elapsedSeconds:Ee(n?.elapsedSeconds),paused:"boolean"==typeof n?.paused?n.paused:void 0,visible:"boolean"==typeof n?.visible?n.visible:void 0,seed:Ee(c?.seed),gravity:null!=C&&null!=k?{x:C,y:k}:void 0,fixedDt:Ee(o?.fixedDt??c?.fixedDt),timeScale:Ee(o?.timeScale),maxSubsteps:je(o?.maxSubsteps),liveBodies:b,sleepingBodies:v,queued:w,bodyLimit:Ee(o?.bodyLimit),eviction:"string"==typeof o?.eviction?o.eviction:void 0}),P=Te({colliders:d?.length,sensors:Ne(d,o,l),springs:m?.length,activeSensorPairs:f?.length}),E=Object.keys(P).length>0,j=Tr.has(e);if(!(Object.keys(S).length>0||E||g||y)||!j&&null==r)return;let R={simulation:S,...E?{geometry:P}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},B=function(e){let t=[],r=e.simulation,a=[r.state??(r.settled?"settled":void 0),null!=r.liveBodies?`${r.liveBodies} live ${Ie(r.liveBodies,"body")}`:void 0,null!=r.sleepingBodies?r.sleepingBodies+" sleeping":void 0,null!=r.queued?r.queued+" queued":void 0,null!=r.seed?"seed "+Le(r.seed):void 0,r.gravity?`gravity (${Le(r.gravity.x)}, ${Le(r.gravity.y)})`:void 0,null!=r.fixedDt?`fixed step ${Le(r.fixedDt)}s`:void 0,null!=r.timeScale?Le(r.timeScale)+"x time":void 0].filter(Boolean);a.length>0&&t.push(`Physics simulation: ${a.join("; ")}.`);let i=e.geometry;if(i){let e=[null!=i.colliders?`${i.colliders} ${Ie(i.colliders,"collider")}`:void 0,null!=i.sensors?`${i.sensors} ${Ie(i.sensors,"sensor")}`:void 0,null!=i.springs?`${i.springs} ${Ie(i.springs,"spring")}`:void 0,null!=i.activeSensorPairs?`${i.activeSensorPairs} active sensor ${Ie(i.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}let n=e.aggregates;if(n){let e=n.leader,r=e?` Largest is ${e.label} with ${Le(e.count)}.`:"";t.push(`Physics aggregates: ${Le(n.totalCount)} settled ${Ie(n.totalCount,"body")} across ${n.rows.length} ${Ie(n.rows.length,"container")}; ${n.populatedCount} populated.${r}`)}let s=e.sediment;if(s){let e=null!=s.total?", value total "+Le(s.total):"",r=s.leader?`; largest sediment bin is ${s.leader.label} with ${Le(s.leader.count)}`:"";t.push(`Physics sediment: ${s.count} retained ${Ie(s.count,"body")} in ${s.bins} ${Ie(s.bins,"bin")}${e}${r}.`)}return t.join(" ")}(R);return{...R,text:B}}(e,t,r.physics),b=function(e,t,r){let a=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&a.push(`Current value is ${Fe(t.value)}.`);let e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,r="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;a.push(`The gauge scale runs from ${Fe(e)} to ${Fe(r)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){let i=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&a.push(`The ProcessSankey time domain runs from ${Fe(t.domain[0])} to ${Fe(t.domain[1])}.`),i.length>0){a.push(`${i.length} source flow${1===i.length?"":"s"} are supplied.`);for(let n of i.slice(0,r)){let r=Me(n,t.sourceAccessor,"source"),i=Me(n,t.targetAccessor,"target"),s=Me(n,t.valueAccessor,"value");a.push("ProcessSankey"!==e||null==n.startTime&&null==n.endTime?`${Fe(r)} to ${Fe(i)} has value ${Fe(s)}.`:`${Fe(r)} to ${Fe(i)} has value ${Fe(s)} over ${Fe(n.startTime)}–${Fe(n.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){let e=Pe(t.data),i="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",n="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",s="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",o=[],l=e=>{let t=Array.isArray(e[i])?e[i]:[];if(0!==t.length)for(let e of t){let t=Pe(e);t&&l(t)}else o.push(e)};if(e&&l(e),o.length>0){a.push(o.length+" hierarchy leaves are supplied.");for(let e of o.slice(0,r))a.push(`${Fe(e[s])} has value ${Fe(e[n])}.`)}}if(Tr.has(e)&&Array.isArray(t.data)){let r=t.data;a.push(`${r.length} observed source row${1===r.length?"":"s"} are supplied.`);let i="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,n="CollisionSwarmChart"===e?"x":"value",s=r.map(e=>Ee(Me(e,i,n))).filter(e=>null!=e);s.length>0&&a.push(`Observed ${"string"==typeof i?i:n} ranges from ${Fe(Math.min(...s))} to ${Fe(Math.max(...s))}.`)}if(0!==a.length)return{source:"chart-props",statements:a,text:"Exact chart-prop facts: "+a.join(" ")}}(e,t,Math.max(1,r.maxLeaves??200)),v=[m.text,a?.sentence,y?.text,b?.text].filter(Boolean).join(" ");return{component:e,description:m,intent:a,structure:g,physics:y,facts:b,text:v}}function De(e){return"number"==typeof e?Number.isFinite(e)?"numeric":"unknown":e instanceof Date?"date":"string"==typeof e?Mr.test(e)&&!Number.isNaN(Date.parse(e))?"date":Fr.test(e)&&Number.isFinite(Number(e))?"numeric":"categorical":"boolean"==typeof e?"categorical":"unknown"}function ze(e){let t=e.length;if(0===t)return NaN;let r=t>>1;return t%2==0?(e[r-1]+e[r])/2:e[r]}function He(e,t,r){let a={numbers:r?[]:void 0,finite:0,min:1/0,max:-1/0,missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(let r of e){let e,i=r?.[t];if(null!=i&&""!==i){if("number"==typeof i)e=i;else if("string"==typeof i){let t=i.trim();if(""===t){a.missing++;continue}let r=Number(t);Number.isNaN(r)?/^[+-]?nan$/i.test(t)&&(e=r):e=r}void 0!==e?Number.isFinite(e)?(a.numbers?.push(e),a.finite++,a.min>e&&(a.min=e),e>a.max&&(a.max=e),0===e&&a.zero++,0>e&&a.negative++,Number.isInteger(e)||a.fractional++):a.nonFinite++:a.nonNumeric++}else a.missing++}return a}function qe(e,t){if(0===e.length)return;let r=(e.length-1)*t,a=Math.floor(r),i=Math.ceil(r);if(a===i)return e[a];let n=r-a;return e[a]*(1-n)+e[i]*n}function Ve(e,t={}){if(!Array.isArray(e)||0===e.length)return{};let r=new Set;for(let t of e)if(t&&"object"==typeof t)for(let e of Object.keys(t))r.add(e);let a={};for(let i of r){let r=He(e,i,!1!==t.quantiles),n=r.numbers?.sort((e,t)=>e-t);a[i]={field:i,observedCount:e.length-r.missing,finiteCount:r.finite,missingCount:r.missing,nonFiniteCount:r.nonFinite,nonNumericCount:r.nonNumeric,zeroCount:r.zero,negativeCount:r.negative,fractionalCount:r.fractional,...r.finite>0?{min:r.min,...n?{q1:qe(n,.25),median:qe(n,.5),q3:qe(n,.75)}:{},max:r.max}:{}}}return a}function Ge(e,t,r){return e[t]?.includes(r)??!1}function We(e,t,r,a){let i=e[t]??[];if(i.includes("identifier")||i.includes("ignore"))return 0;if(0===i.length)return a?1:0;let n="category"===r||"series"===r?"dimension":"time"===r?"temporal":"measure",s=i.includes(r)||i.includes(n)||"x"===r&&i.includes("temporal"),o=i.includes(r)&&("x"===r||"category"===r||"series"===r);return s&&(a||o)?2:0}function Ue(e,t){if(!t)return{repeated:!1};let r=new Set,a=0;for(let i of e){let e=i?.[t];null!=e&&(a++,r.add(e+""))}return{distinct:r.size,repeated:a>r.size}}function Je(e,t,r){return e?e===t?"time":Ge(r,e,"x")||Ir.test(e)?"named":"scatter":"none"}function Ke(e,t,r){if(!t||!r)return;let a=new Map;for(let i of e){let e=i?.[t],n=i?.[r];if(null==e||null==n)continue;let s=e+"",o=a.get(s)??new Set;o.add(n+""),a.set(s,o)}if(0===a.size)return;let i=0,n=0;for(let e of a.values())i+=e.size,e.size>=2&&n++;return{seriesPerX:i/a.size,multiSeriesFraction:n/a.size,xColumns:a.size}}function Xe(e,t,r,a){if((t[a]??[]).some(e=>"identifier"===e||"ignore"===e)||!e[r].some(e=>e.field===a))throw Error(`Invalid ${r} field "${a}": identifier, ignored, or not a candidate.`)}function Qe(e){return"numeric"===e.type?"numeric":"date"===e.type?"date":"categorical"===e.type?"categorical":"unknown"}function Ye(e,t){return t.test(e)?.2:0}function Ze(e,t){let r=null;for(let a=0;e.length>a;a++){let i=e[a]?.[t];if(null==i)continue;let n=i instanceof Date?i.getTime():Number(i);if(!Number.isFinite(n)||null!==r&&r>n)return!1;r=n}return null!==r}function _e(e,t,r,a,i,n,s={}){let o=[];for(let[l,c]of Object.entries(e)){let e=Qe(c),u=We(n,l,i,r.has(e));if(0===u)continue;let d,p=2===u,h=.5;h+=Ye(l,a),p&&(h+=.35),"categorical"===c.type&&(d=c.distinctCount,d&&d>=2&&12>=d&&(h+=.2),d&&d>50&&(h-=.2)),"numeric"===c.type&&Number.isFinite(c.min)&&Number.isFinite(c.max)&&c.max>c.min&&(h+=.1);let m={field:l,kind:e,quality:Math.max(0,Math.min(1,h)),distinctCount:d,...p?{hinted:!0}:{}};s.computeMonotonic&&("numeric"===e||"date"===e)&&(m.monotonic=Ze(t,l),m.monotonic&&(m.quality=Math.min(1,m.quality+.2))),o.push(m)}return o.sort((e,t)=>t.quality-e.quality),o}function et(e,t){return e.find(e=>t.test(e))}function tt(e){return null==e?"null":Array.isArray(e)?`[${e.map(tt).join(",")}]`:e instanceof Date?JSON.stringify(e):"object"==typeof e?`{${Object.entries(e).filter(([,e])=>void 0!==e).sort(([e],[t])=>t>e?-1:e>t?1:0).map(([e,t])=>`${JSON.stringify(e)}:${tt(t)}`).join(",")}}`:JSON.stringify(e)}function rt(e){return at(tt(e))}function at(e){let t=[..._r],r=Array.from((new TextEncoder).encode(e)),a=8*r.length;for(r.push(128);r.length%64!=56;)r.push(0);let i=Math.floor(a/4294967296),n=a>>>0;r.push(i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n);let s=[];for(let e=0;r.length>e;e+=4)s.push((r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0);for(let e=0;s.length>e;e+=16){let r=[...s.slice(e,e+16)];for(let e=16;64>e;e+=1){let t=Yr(r[e-15],7)^Yr(r[e-15],18)^r[e-15]>>>3,a=Yr(r[e-2],17)^Yr(r[e-2],19)^r[e-2]>>>10;r[e]=r[e-16]+t+r[e-7]+a>>>0}let[a,i,n,o,l,c,u,d]=t;for(let e=0;64>e;e+=1){let t=d+(Yr(l,6)^Yr(l,11)^Yr(l,25))+(l&c^~l&u)+ea[e]+r[e]>>>0,s=a&i^a&n^i&n;d=u,u=c,c=l,l=o+t>>>0,o=n,n=i,i=a,a=t+((Yr(a,2)^Yr(a,13)^Yr(a,22))+s>>>0)>>>0}let p=[a,i,n,o,l,c,u,d];for(let e=0;8>e;e+=1)t[e]=t[e]+p[e]>>>0}return t.map(e=>e.toString(16).padStart(8,"0")).join("")}function it(e,t){return`${e}[Symbol(${t.description??""})]`}function nt(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let r=Number(e);return Number.isSafeInteger(r)&&r>=0&&t>r}function st(e,t){return"number"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t}function ot(e){return e.sort((e,t)=>{let r=JSON.stringify(e),a=JSON.stringify(t);return a>r?-1:r>a?1:0})}function lt(e,t,r){if(null===e)return null;if(e instanceof Date){let a=e.getTime();return Number.isFinite(a)?{$type:"date",value:e.toISOString()}:void r.excluded.push(t)}switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isNaN(e)?{$type:"number",value:"NaN"}:e===1/0?{$type:"number",value:"Infinity"}:e===-1/0?{$type:"number",value:"-Infinity"}:Object.is(e,-0)?{$type:"number",value:"-0"}:e;case"bigint":return{$type:"bigint",value:""+e};case"undefined":case"function":case"symbol":return void r.excluded.push(t);case"object":{let a=e;if(r.ancestors.has(a))return void r.excluded.push(t);r.ancestors.add(a);try{if(Array.isArray(e)){for(let a of Reflect.ownKeys(e))"length"===a||"string"==typeof a&&nt(a,e.length)||r.excluded.push("symbol"==typeof a?it(t,a):st(t,a));return Array.from({length:e.length},(a,i)=>{let n=st(t,i),s=Object.getOwnPropertyDescriptor(e,i+"");if(!s||!("value"in s)||!s.enumerable)return r.excluded.push(n),null;let o=lt(s.value,n,r);return void 0===o?null:o})}let a={},i=Object.getPrototypeOf(e);if(i!==Object.prototype&&null!==i)return void r.excluded.push(t);let n=[];for(let a of Reflect.ownKeys(e)){if("symbol"==typeof a){r.excluded.push(it(t,a));continue}let i=Object.getOwnPropertyDescriptor(e,a);i&&"value"in i&&i.enumerable?n.push(a):r.excluded.push(st(t,a))}for(let i of n.sort()){let n=Object.getOwnPropertyDescriptor(e,i),s=lt(n&&"value"in n?n.value:void 0,st(t,i),r);void 0!==s&&Object.defineProperty(a,i,{value:s,enumerable:!0,configurable:!0,writable:!0})}return a}finally{r.ancestors.delete(a)}}default:return void r.excluded.push(t)}}function ct(e,t=new Set){if(null===e)return["null"];if(e instanceof Date)return Number.isFinite(e.getTime())?["date",e.toISOString()]:["excluded"];switch(typeof e){case"string":return["string",e];case"boolean":return["boolean",e];case"number":return["number",Number.isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":Object.is(e,-0)?"-0":e+""];case"bigint":return["bigint",""+e];case"undefined":case"function":case"symbol":return["excluded"];case"object":if(t.has(e))return["excluded"];t.add(e);try{let r=r=>{let a="symbol"==typeof r?["symbol-key",r.description??""]:["string-key",r],i=Object.getOwnPropertyDescriptor(e,r);return i?"value"in i?[a,"data",!!i.enumerable,ct(i.value,t)]:[a,"accessor",!!i.enumerable,!!i.get,!!i.set]:[a,"missing"]};if(Array.isArray(e))return["array",Array.from({length:e.length},(t,a)=>{let i=a+"";return Object.prototype.hasOwnProperty.call(e,i)?r(i):["hole"]}),ot(Reflect.ownKeys(e).filter(t=>"length"!==t&&!("string"==typeof t&&nt(t,e.length))).map(r))];let a=Object.getPrototypeOf(e);return[a!==Object.prototype&&null!==a?"non-json-object":"object",ot(Reflect.ownKeys(e).map(r))]}finally{t.delete(e)}default:return["excluded"]}}function ut(e){let t={excluded:[],ancestors:new Set},r=lt(e,"$",t)??null;return{value:r,text:JSON.stringify(r),excludedPaths:t.excluded}}function dt(e){let t=ut(e),r=at(JSON.stringify(["semiotic-value-fingerprint","v2",ct(e)]));return{...t,algorithm:"sha256",digest:r,fingerprint:"sha256:"+r}}function pt(e,t,r,a){bt(e,Object.keys(t),r,a);for(let[i,n]of Object.entries(t))n.values?(n.required||void 0!==e[i])&&wt(e,i,r,n.values,a):n.required?vt(e,i,r,a):kt(e,i,r,a)}function ht(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function mt(e,t,r,a){void 0!==e[t]&&("number"!=typeof e[t]||!Number.isFinite(e[t]))&&a.push({path:`${r}.${t}`,message:"Expected a finite number."})}function ft(e,t,r,a){void 0!==e[t]&&"boolean"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a boolean."})}function gt(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(gt):ht(e)&&Object.values(e).every(gt))}function yt(e,t,r,a){void 0!==e[t]&&(!ht(e[t])||!gt(e[t]))&&a.push({path:`${r}.${t}`,message:"Expected a JSON object."})}function bt(e,t,r,a){let i=new Set(t);for(let t of Object.keys(e))i.has(t)||a.push({path:`${r}.${t}`,message:"Unexpected property."})}function vt(e,t,r,a){("string"!=typeof e[t]||!e[t])&&a.push({path:`${r}.${t}`,message:"Expected a non-empty string."})}function wt(e,t,r,a,i){("string"!=typeof e[t]||!a.includes(e[t]))&&i.push({path:`${r}.${t}`,message:`Expected one of: ${a.join(", ")}.`})}function At(e,t,r,a){let i=e[t];if(void 0!==i)return ht(i)?i:void a.push({path:`${r}.${t}`,message:"Expected an object."})}function $t(e,t,r,a){let i=e[t];if(void 0!==i)return Array.isArray(i)?i:void a.push({path:`${r}.${t}`,message:"Expected an array."})}function xt(e,t,r){e?.some(e=>"string"!=typeof e||!e)&&r.push({path:t,message:"Expected non-empty string values."})}function Ct(e,t,r,a,i){void 0!==e[t]&&wt(e,t,r,a,i)}function kt(e,t,r,a){void 0!==e[t]&&"string"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a string."})}function St(e,t,r){ht(e)?(bt(e,["id","name","kind"],t,r),vt(e,"kind",t,r),kt(e,"id",t,r),kt(e,"name",t,r)):r.push({path:t,message:"Expected an actor object."})}function Pt(e){for(let t of Object.values(e))Object.freeze(t.suppliedBy),Object.freeze(t);return Object.freeze(e)}function Et(e){try{return function(e){let t=[],r=[];if(!ht(e))return{valid:!1,errors:[{path:"$",message:"Expected an object."}],warnings:r};let a=d(e);if(a.length>0)return{valid:!1,errors:a.map(e=>({path:e,message:"Expected a JSON-compatible value that survives serialization unchanged."})),warnings:r};if(bt(e,["contractVersion","artifact","purpose","claims","evidence","time","reception","form","contestability","accountability","inheritance","fieldStatus","extensions"],"$",t),"0.1"!==e.contractVersion&&t.push({path:"$.contractVersion",message:"Expected contract version 0.1."}),ht(e.artifact)){bt(e.artifact,["id","kind","component","title","createdAt","configFingerprint","dataFingerprint","revision"],"$.artifact",t),vt(e.artifact,"id","$.artifact",t),wt(e.artifact,"kind","$.artifact",["chart","dashboard","story","alert","agent-answer"],t);for(let r of["component","title","createdAt","configFingerprint","dataFingerprint","revision"])kt(e.artifact,r,"$.artifact",t)}else t.push({path:"$.artifact",message:"Expected an artifact identity object."});if(ht(e.purpose))if(Array.isArray(e.purpose.intents)){bt(e.purpose,["intents","communicativeAct","decisionContext","stakes","allowedUses","prohibitedUses"],"$.purpose",t),e.purpose.intents.forEach((e,r)=>{(!ht(e)||"string"!=typeof e.id||!e.id)&&t.push({path:`$.purpose.intents[${r}].id`,message:"Expected a non-empty intent identifier."}),ht(e)&&bt(e,["id","strength","source","rationale"],`$.purpose.intents[${r}]`,t),ht(e)&&void 0!==e.strength&&wt(e,"strength",`$.purpose.intents[${r}]`,["primary","secondary"],t),ht(e)&&(Ct(e,"source",`$.purpose.intents[${r}]`,["author","derived","model-proposal","import"],t),kt(e,"rationale",`$.purpose.intents[${r}]`,t))});for(let r of["allowedUses","prohibitedUses"])xt($t(e.purpose,r,"$.purpose",t),"$.purpose."+r,t);Ct(e.purpose,"stakes","$.purpose",["exploratory","informational","operational","high"],t),kt(e.purpose,"communicativeAct","$.purpose",t),kt(e.purpose,"decisionContext","$.purpose",t)}else t.push({path:"$.purpose.intents",message:"Expected an intent array."});else t.push({path:"$.purpose",message:"Expected a purpose object."});Array.isArray(e.claims)?e.claims.forEach((e,r)=>{if(!ht(e))return void t.push({path:`$.claims[${r}]`,message:"Expected a claim object."});bt(e,["id","text","kind","status","evidenceIds","scope","uncertainty","asOf","supersedes","authoredBy","review","tags"],`$.claims[${r}]`,t),vt(e,"id",`$.claims[${r}]`,t),wt(e,"kind",`$.claims[${r}]`,["description","observation","aggregation","inference","forecast","simulation","alert","recommendation","normative"],t),wt(e,"status",`$.claims[${r}]`,["supported","provisional","disputed","superseded","retracted","unsupported","unknown"],t),Array.isArray(e.evidenceIds)?e.evidenceIds.some(e=>"string"!=typeof e||!e)&&t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected non-empty string evidence identifiers."}):t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected an evidence identifier array."}),xt($t(e,"supersedes",`$.claims[${r}]`,t),`$.claims[${r}].supersedes`,t),kt(e,"text",`$.claims[${r}]`,t),kt(e,"asOf",`$.claims[${r}]`,t),yt(e,"scope",`$.claims[${r}]`,t),xt($t(e,"tags",`$.claims[${r}]`,t),`$.claims[${r}].tags`,t),void 0!==e.authoredBy&&St(e.authoredBy,`$.claims[${r}].authoredBy`,t);let a=At(e,"review",`$.claims[${r}]`,t);a&&(bt(a,["status","reviewer","reviewedAt","rationale"],`$.claims[${r}].review`,t),wt(a,"status",`$.claims[${r}].review`,["proposed","reviewed","approved","rejected"],t),void 0!==a.reviewer&&St(a.reviewer,`$.claims[${r}].review.reviewer`,t),kt(a,"reviewedAt",`$.claims[${r}].review`,t),kt(a,"rationale",`$.claims[${r}].review`,t));let i=At(e,"uncertainty",`$.claims[${r}]`,t);if(i){bt(i,["kind","lower","upper","confidence","unit","description"],`$.claims[${r}].uncertainty`,t),wt(i,"kind",`$.claims[${r}].uncertainty`,["interval","distribution","qualitative","unknown"],t);for(let e of["lower","upper","confidence"])mt(i,e,`$.claims[${r}].uncertainty`,t);kt(i,"unit",`$.claims[${r}].uncertainty`,t),kt(i,"description",`$.claims[${r}].uncertainty`,t)}}):t.push({path:"$.claims",message:"Expected a claim array."}),Array.isArray(e.evidence)?e.evidence.forEach((e,r)=>{if(!ht(e))return void t.push({path:`$.evidence[${r}]`,message:"Expected an evidence object."});bt(e,["id","role","label","source","fingerprint","dataVersion","observedAt","scope","sample","transformation","generatedClaimId","relationship"],`$.evidence[${r}]`,t),vt(e,"id",`$.evidence[${r}]`,t),wt(e,"role",`$.evidence[${r}]`,["source-data","external-source","transformation","statistical-test","model-output","human-observation","policy-rule","quality-check"],t);for(let a of["label","fingerprint","dataVersion","observedAt","generatedClaimId"])kt(e,a,`$.evidence[${r}]`,t);yt(e,"scope",`$.evidence[${r}]`,t);let a=At(e,"source",`$.evidence[${r}]`,t);if(a){bt(a,["name","uri","version","retrievedAt","publisher"],`$.evidence[${r}].source`,t);for(let e of["name","uri","version","retrievedAt","publisher"])kt(a,e,`$.evidence[${r}].source`,t)}let i=At(e,"transformation",`$.evidence[${r}]`,t);if(i){bt(i,["id","kind","description","inputEvidenceIds","parameters","assumptions","implementation","performedAt","performedBy"],`$.evidence[${r}].transformation`,t),vt(i,"id",`$.evidence[${r}].transformation`,t),wt(i,"kind",`$.evidence[${r}].transformation`,["aggregation","filter","normalization","binning","join","smoothing","forecasting","simulation","other"],t);let e=$t(i,"inputEvidenceIds",`$.evidence[${r}].transformation`,t);e?xt(e,`$.evidence[${r}].transformation.inputEvidenceIds`,t):t.push({path:`$.evidence[${r}].transformation.inputEvidenceIds`,message:"Expected an evidence identifier array."}),xt($t(i,"assumptions",`$.evidence[${r}].transformation`,t),`$.evidence[${r}].transformation.assumptions`,t),kt(i,"description",`$.evidence[${r}].transformation`,t),kt(i,"implementation",`$.evidence[${r}].transformation`,t),kt(i,"performedAt",`$.evidence[${r}].transformation`,t),yt(i,"parameters",`$.evidence[${r}].transformation`,t),void 0!==i.performedBy&&St(i.performedBy,`$.evidence[${r}].transformation.performedBy`,t)}let n=At(e,"sample",`$.evidence[${r}]`,t);if(n){bt(n,["rowCount","fields","values","truncated"],`$.evidence[${r}].sample`,t),xt($t(n,"fields",`$.evidence[${r}].sample`,t),`$.evidence[${r}].sample.fields`,t);let e=$t(n,"values",`$.evidence[${r}].sample`,t);e&&!function(e){return e.every(gt)}(e)&&t.push({path:`$.evidence[${r}].sample.values`,message:"Expected JSON values."}),mt(n,"rowCount",`$.evidence[${r}].sample`,t),ft(n,"truncated",`$.evidence[${r}].sample`,t)}Ct(e,"relationship",`$.evidence[${r}]`,["descriptive","correlational","causal","unknown"],t)}):t.push({path:"$.evidence",message:"Expected an evidence array."}),function(e,t){if(void 0===e||ht(e)){if(ht(e))for(let[r,a]of Object.entries(e)){let e="$.fieldStatus."+r;if(!ht(a)||"string"!=typeof a.status){t.push({path:e,message:"Expected a field state with a status."});continue}bt(a,["status","reason","suppliedBy","derived","reviewedBy"],e,t),["known","unknown","manual","not-applicable"].includes(a.status)||t.push({path:e+".status",message:"Expected one of: known, unknown, manual, not-applicable."}),void 0!==a.suppliedBy&&("string"!=typeof a.suppliedBy||!["author","system","model-proposal","import"].includes(a.suppliedBy))&&t.push({path:e+".suppliedBy",message:"Expected one of: author, system, model-proposal, import."}),kt(a,"reason",e,t),kt(a,"reviewedBy",e,t),ft(a,"derived",e,t);let i=Object.prototype.hasOwnProperty.call(ta,r)?ta[r]:void 0,n="model-proposal"===a.suppliedBy,s=n&&!0===i?.modelMayPropose&&"known"!==a.status;i&&"known"===a.status&&"string"!=typeof a.suppliedBy&&t.push({path:e+".suppliedBy",message:`Known field "${r}" must identify an allowed supplier.`}),i&&"string"==typeof a.suppliedBy&&!s&&!i.suppliedBy.includes(a.suppliedBy)&&t.push({path:e+".suppliedBy",message:`Field "${r}" cannot be supplied by ${a.suppliedBy}.`}),i&&!0===a.derived&&!i.derivable&&t.push({path:e+".derived",message:`Field "${r}" cannot be marked as derived.`}),i&&n&&(!i.modelMayPropose||"known"===a.status)&&t.push({path:e+".suppliedBy",message:"known"===a.status?`A model proposal cannot finalize field "${r}" as known.`:`Field "${r}" does not accept model proposals.`}),"required"===i?.humanReview&&"known"===a.status&&("string"!=typeof a.reviewedBy||!a.reviewedBy.trim())&&t.push({path:e+".reviewedBy",message:`Known field "${r}" requires an attributable human review.`})}}else t.push({path:"$.fieldStatus",message:"Expected a field-state object."})}(e.fieldStatus,t);let i=At(e,"time","$",t);return i&&function(e,t){let r="$.time";bt(e,[...ia,...Object.keys(na),"sources"],r,t);for(let a of ia)kt(e,a,r,t);for(let[a,i]of Object.entries(na)){let n=At(e,a,r,t);n&&pt(n,i,`${r}.${a}`,t)}$t(e,"sources",r,t)?.forEach((e,a)=>{let i=`${r}.sources[${a}]`;ht(e)?pt(e,sa,i,t):t.push({path:i,message:"Expected a source object."})})}(i,t),function(e,t){(function(e,t){let r=At(e,"reception","$",t);if(!r)return;bt(r,["channels","audience","strengths","risks","scaffolds","description","dataFallback","manualChecks"],"$.reception",t);let a=$t(r,"channels","$.reception",t);a||t.push({path:"$.reception.channels",message:"Expected a reception-channel array."}),a?.forEach((e,r)=>{let a=`$.reception.channels[${r}]`;ht(e)?(bt(e,["channel","disclosure","navigation","interactionInstructions","rawData","tokenBudget","privacyNotes"],a,t),wt(e,"channel",a,["visual","screen-reader","sonified","agent","print","low-bandwidth"],t),Ct(e,"disclosure",a,["summary","standard","detailed"],t),Ct(e,"rawData",a,["deny","bounded","allow"],t),ft(e,"navigation",a,t),ft(e,"interactionInstructions",a,t),mt(e,"tokenBudget",a,t),xt($t(e,"privacyNotes",a,t),a+".privacyNotes",t)):t.push({path:a,message:"Expected a channel object."})});for(let e of["strengths","risks","scaffolds","manualChecks"])xt($t(r,e,"$.reception",t),"$.reception."+e,t);kt(r,"audience","$.reception",t),kt(r,"description","$.reception",t),ft(r,"dataFallback","$.reception",t)})(e,t),function(e,t){let r=At(e,"form","$",t);r&&(bt(r,["chartFamily","whyThisForm","rejectedAlternatives","risks","misuse"],"$.form",t),kt(r,"chartFamily","$.form",t),kt(r,"whyThisForm","$.form",t),xt($t(r,"risks","$.form",t),"$.form.risks",t),xt($t(r,"misuse","$.form",t),"$.form.misuse",t),$t(r,"rejectedAlternatives","$.form",t)?.forEach((e,r)=>{let a=`$.form.rejectedAlternatives[${r}]`;ht(e)?(bt(e,["representation","reason"],a,t),vt(e,"representation",a,t),vt(e,"reason",a,t)):t.push({path:a,message:"Expected an alternative object."})}))}(e,t),function(e,t){let r=At(e,"contestability","$",t);r&&(bt(r,["sourceRequestsAllowed","alternativeViews","challenges","corrections","editorialExceptions"],"$.contestability",t),ft(r,"sourceRequestsAllowed","$.contestability",t),$t(r,"challenges","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.challenges[${r}]`;if(ht(e)){bt(e,["id","claimId","status","reason","raisedBy","raisedAt","counterclaimId","resolution"],a,t),vt(e,"id",a,t),vt(e,"claimId",a,t),vt(e,"reason",a,t),wt(e,"status",a,["open","accepted","declined","resolved"],t),void 0!==e.raisedBy&&St(e.raisedBy,a+".raisedBy",t);for(let r of["raisedAt","counterclaimId","resolution"])kt(e,r,a,t)}else t.push({path:a,message:"Expected a challenge object."})}),$t(r,"corrections","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.corrections[${r}]`;if(!ht(e))return void t.push({path:a,message:"Expected a correction object."});bt(e,["id","affectedClaimIds","replacementClaimIds","reason","createdAt","createdBy"],a,t),vt(e,"id",a,t),vt(e,"reason",a,t);let i=$t(e,"affectedClaimIds",a,t);i||t.push({path:a+".affectedClaimIds",message:"Expected an affected-claim array."}),xt(i,a+".affectedClaimIds",t),xt($t(e,"replacementClaimIds",a,t),a+".replacementClaimIds",t),kt(e,"createdAt",a,t),void 0!==e.createdBy&&St(e.createdBy,a+".createdBy",t)}),$t(r,"alternativeViews","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.alternativeViews[${r}]`;ht(e)?(bt(e,["id","label","rationale"],a,t),vt(e,"id",a,t),vt(e,"label",a,t),kt(e,"rationale",a,t)):t.push({path:a,message:"Expected an alternative-view object."})}),$t(r,"editorialExceptions","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.editorialExceptions[${r}]`;ht(e)?(bt(e,["ruleId","rationale","owner","reviewAt"],a,t),vt(e,"ruleId",a,t),vt(e,"rationale",a,t),kt(e,"owner",a,t),kt(e,"reviewAt",a,t)):t.push({path:a,message:"Expected an editorial-exception object."})}))}(e,t),function(e,t){let r=At(e,"accountability","$",t);r&&(bt(r,["authors","generatedBy","dataSources","codeRef","reviews","actions"],"$.accountability",t),$t(r,"authors","$.accountability",t)?.forEach((e,r)=>St(e,`$.accountability.authors[${r}]`,t)),xt($t(r,"dataSources","$.accountability",t),"$.accountability.dataSources",t),kt(r,"generatedBy","$.accountability",t),kt(r,"codeRef","$.accountability",t),$t(r,"reviews","$.accountability",t)?.forEach((e,r)=>{let a=`$.accountability.reviews[${r}]`;if(ht(e)){bt(e,["id","status","reviewer","reviewedAt","rationale","policyId"],a,t),vt(e,"id",a,t),wt(e,"status",a,["pending","approved","changes-requested","rejected"],t),void 0!==e.reviewer&&St(e.reviewer,a+".reviewer",t);for(let r of["reviewedAt","rationale","policyId"])kt(e,r,a,t)}else t.push({path:a,message:"Expected a review object."})}),$t(r,"actions","$.accountability",t)?.forEach((e,r)=>{let a=`$.accountability.actions[${r}]`;if(!ht(e))return void t.push({path:a,message:"Expected an action object."});bt(e,["id","action","actor","actedAt","claimIds","artifactId","artifactRevision","policyId","status","invalidatedByClaimId"],a,t),vt(e,"id",a,t),vt(e,"action",a,t);let i=$t(e,"claimIds",a,t);i||t.push({path:a+".claimIds",message:"Expected a claim identifier array."}),xt(i,a+".claimIds",t),void 0!==e.actor&&St(e.actor,a+".actor",t);for(let r of["actedAt","artifactId","artifactRevision","policyId","invalidatedByClaimId"])kt(e,r,a,t);Ct(e,"status",a,["proposed","taken","reversed","invalidated"],t)}))}(e,t),function(e,t){let r=At(e,"inheritance","$",t);if(r){bt(r,["requiredPaths","prohibitedExports","privacy","rawDataDefault","preservation","sourceArtifactIds"],"$.inheritance",t);for(let e of["requiredPaths","prohibitedExports","sourceArtifactIds"])xt($t(r,e,"$.inheritance",t),"$.inheritance."+e,t);Ct(r,"privacy","$.inheritance",["public","restricted","confidential","unknown"],t),Ct(r,"rawDataDefault","$.inheritance",["exclude","bounded","include"],t),Ct(r,"preservation","$.inheritance",["full-fidelity","claim-evidence-preserved","visual-only","lossy","unknown"],t)}}(e,t)}(e,t),yt(e,"extensions","$",t),Array.isArray(e.claims)&&0===e.claims.length&&r.push({path:"$.claims",message:"The contract declares no claims."}),Array.isArray(e.evidence)&&0===e.evidence.length&&r.push({path:"$.evidence",message:"The contract declares no evidence."}),{valid:0===t.length,errors:t,warnings:r}}(e)}catch{return{valid:!1,errors:[{path:"$",message:"Artifact contract could not be inspected safely."}],warnings:[]}}}function jt(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Rt(e,t={}){try{return function(e,t){if(!jt(e))return{transfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["Artifact contract must be a JSON object."]}};let r=ut(e),a=[...new Set([...r.excludedPaths,...d(e)])].sort(),i=r.value,n=function(e,t){if(!t||!jt(e)||!Array.isArray(e.evidence))return[];let r=[];return e.evidence.forEach((e,t)=>{jt(e)&&Object.prototype.hasOwnProperty.call(e,"sample")&&(delete e.sample,r.push(`$.evidence[${t}].sample`))}),r}(i,t.excludeEvidenceSamples),s=n.length?["Bounded evidence samples were excluded by the transfer policy."]:[],o=i?.contractVersion;if("string"!=typeof o||!o)return{contract:i,transfer:{status:"invalid",omittedPaths:[...a,...n],warnings:["Artifact contract is missing a string contractVersion.",...s]}};if("0.1"!==o)return{contract:i,transfer:{status:a.length>0?"invalid":"unsupported-version",omittedPaths:[...a,...n],warnings:[`Contract version ${o} is not interpreted by this runtime.`,...a.length>0?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...s]}};let l=Et(i),c=[...l.errors.map(({path:e,message:t})=>`${e}: ${t}`),...l.warnings.map(({path:e,message:t})=>`${e}: ${t}`),...a.length?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...s];return{contract:i,transfer:{status:!l.valid||a.length>0?"invalid":n.length>0?"excluded":"preserved",omittedPaths:[...a,...n],warnings:c}}}(e,t)}catch{let t=d(e);return{transfer:{status:"invalid",omittedPaths:t.length?t:["$"],warnings:["Artifact contract could not be inspected safely."]}}}}function Bt(e){if(Array.isArray(e))return e.map(Bt);if(!e||"object"!=typeof e)return e;let t={};for(let[r,a]of Object.entries(e))void 0===a||la.has(r)||(t[r]=Bt(a));return t}function Tt(e){if(Array.isArray(e))return e.map(Tt);if(!e||"object"!=typeof e)return e;let t={...e};return delete t.datum,Array.isArray(t.children)&&(t.children=t.children.map(Tt)),t}function Mt(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Ft(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)}function It(e,t){if(void 0===e)return;if(!e||"object"!=typeof e||Array.isArray(e))throw new TypeError(t+" must be an accessibility audit object");let r=e;if(void 0!==r.ok&&"boolean"!=typeof r.ok)throw new TypeError(t+".ok must be boolean");if(void 0!==r.findings){if(!Array.isArray(r.findings))throw new TypeError(t+".findings must be an array");for(let[e,a]of r.findings.entries()){let r=`${t}.findings[${e}]`;if(!a||"object"!=typeof a||Array.isArray(a))throw new TypeError(r+" must be a finding object");if(void 0!==a.critical&&"boolean"!=typeof a.critical)throw new TypeError(r+".critical must be boolean");if(void 0!==a.status&&!["pass","fail","warn","manual","not-applicable"].includes(a.status))throw new TypeError(r+".status must be an accessibility finding status")}}}function Lt(e,t){let{contract:r,transfer:a,binding:i}=e;if(void 0!==a&&(!Mt(a)||!["preserved","unsupported-version","invalid","excluded"].includes(a.status)||!Ft(a.omittedPaths)||!Ft(a.warnings)||"preserved"===a.status&&a.omittedPaths.length>0||"excluded"===a.status&&0===a.omittedPaths.length))throw new TypeError(`Evidence envelope ${t} has an invalid transfer report`);if(!(void 0===i||Mt(i)&&["match","mismatch","unknown"].includes(i.status)&&Ft(i.mismatchPaths)&&Ft(i.unknownPaths)))throw new TypeError(`Evidence envelope ${t} has an invalid identity binding`);if(!Mt(a))return;if(void 0===r){if("preserved"===a.status||"excluded"===a.status)throw new TypeError(`Evidence envelope ${t} requires the contract its transfer report preserves`);return}let n=Rt(r),s="excluded"===a.status&&"preserved"===n.transfer.status&&Ft(a.omittedPaths)&&a.omittedPaths.length>0;if(n.transfer.status!==a.status&&!s)throw new TypeError(`Evidence envelope ${t} transfer status does not match its contract`)}function Nt(e){let t=e.transferBindingVersion??ua;return rt({kind:"semiotic.chart-evidence.artifact-transfer",envelopeVersion:1,transferBindingVersion:t,contract:e.contract??null,transfer:e.transfer,...t===ua?{identityBinding:e.identityBinding??null}:{}})}function Ot(e,t,r={}){let a=function(e,t){if(Array.isArray(t.data))return t.data;if("ForceDirectedGraph"===e||"SankeyDiagram"===e||"ProcessSankey"===e||"ChordDiagram"===e)return[...Array.isArray(t.nodes)?t.nodes:[],...Array.isArray(t.edges)?t.edges:[]];if("ChoroplethMap"===e)return Array.isArray(t.areas)?t.areas:t.areas&&"object"==typeof t.areas&&Array.isArray(t.areas.features)?t.areas.features:"string"==typeof t.areas?[{geographyReference:t.areas}]:[];if("ProportionalSymbolMap"===e)return Array.isArray(t.points)?t.points:[];if("FlowMap"===e)return[...Array.isArray(t.nodes)?t.nodes:[],...Array.isArray(t.flows)?t.flows:[]];if("DistanceCartogram"===e)return[...Array.isArray(t.points)?t.points:[],...Array.isArray(t.lines)?t.lines:[]];if("TreeDiagram"===e||"Treemap"===e||"CirclePack"===e||"OrbitDiagram"===e)return t.data&&"object"==typeof t.data?[t.data]:[];if("BigNumber"===e||"GaugeChart"===e){let e=t.value;return void 0===e?[]:[{value:e}]}return[]}(e,t),i=function(e,t={}){let r=function(e,t={}){let{maxDistinct:r=10,sampleSize:a=5,keyScanRows:i=100}=t;if(!Array.isArray(e)||0===e.length)return{rowCount:0,fields:{},sample:[]};let n=new Set,s=Math.min(e.length,i);for(let t=0;s>t;t++){let r=e[t];if(r&&"object"==typeof r)for(let e of Object.keys(r))n.add(e)}let o={};for(let t of n){let a=[];for(let r=0;e.length>r;r++){let i=e[r]?.[t];null!=i&&a.push(i)}if(0===a.length){o[t]={type:"unknown"};continue}let i=De(a[0]);if("numeric"===i){let e=[],r=1/0,i=-1/0,n=0;for(let t=0;a.length>t;t++){let s=Number(a[t]);Number.isFinite(s)&&(e.push(s),r>s&&(r=s),s>i&&(i=s),n+=s)}if(0===e.length){o[t]={type:"unknown"};continue}e.sort((e,t)=>e-t),o[t]={type:"numeric",min:r,max:i,mean:n/e.length,median:ze(e)}}else if("date"===i){let e=1/0,r=-1/0;for(let t=0;a.length>t;t++){let i=a[t],n=i instanceof Date?i.getTime():Date.parse(i);Number.isFinite(n)&&(e>n&&(e=n),n>r&&(r=n))}if(e===1/0){o[t]={type:"unknown"};continue}o[t]={type:"date",min:new Date(e).toISOString(),max:new Date(r).toISOString()}}else if("categorical"===i){let e=new Map;for(let t=0;a.length>t;t++){let r=a[t]+"";e.set(r,(e.get(r)??0)+1)}let i=[...e.entries()].sort((e,t)=>t[1]-e[1]).slice(0,r).map(([e,t])=>({value:e,count:t}));o[t]={type:"categorical",distinctCount:e.size,topValues:i,distinctValues:e.size>r?void 0:i.map(e=>e.value)}}else o[t]={type:"unknown"}}return{rowCount:e.length,fields:o,sample:e.slice(0,a)}}(e??[]),a=Array.isArray(e)?e:[],i=function(e){if(e&&"object"==typeof e&&!Array.isArray(e)){let t=e;if("FeatureCollection"===t.type&&Array.isArray(t.features))return{hasHierarchy:!1,hasNetwork:!1,hasGeo:!0,geo:{features:t.features,points:Array.isArray(t.points)?t.points:void 0,flows:Array.isArray(t.flows)?t.flows:void 0}};if(Array.isArray(t.children))return{hasHierarchy:!0,hasNetwork:!1,hasGeo:!1,hierarchy:t};if(Array.isArray(t.nodes)&&(Array.isArray(t.edges)||Array.isArray(t.links)))return{hasHierarchy:!1,hasNetwork:!0,hasGeo:!1,network:{nodes:t.nodes,edges:t.edges??t.links}}}return{hasHierarchy:!1,hasNetwork:!1,hasGeo:!1}}(t.rawInput),n=function(e,t,r){let a={};for(let[t,r]of Object.entries(e??{}))a[t]=Array.from(new Set((Array.isArray(r)?r:[r]).filter(e=>"string"==typeof e&&Lr.has(e))));for(let e of t??[])"string"!=typeof e||0===e.length||(a[e]=Array.from(new Set([...a[e]??[],"identifier"])));return r&&(a[r]=Array.from(new Set([...a[r]??[],"series"]))),a}(t.fieldRoles,t.identifiers,t.seriesField);if(!i.hasNetwork&&!i.hasHierarchy&&!i.hasGeo){let e=function(e){if(3>e.length)return null;let t=e[0];if(!t||"object"!=typeof t)return null;let r=Object.keys(t),a=et(r,Ur),i=et(r,Jr);if(!a||!i||a===i)return null;let n=et(r,Kr),s=et(r,Xr),o=et(r,Qr),l=[];for(let t of e){if(!t)continue;let e=t[a],r=t[i];if(null==e||null==r)continue;let n=(e+"").trim(),s=(r+"").trim();!n||!s||n===s||l.push(t)}if(3>l.length)return null;let c=new Map,u=new Map,d=new Map;for(let e of l){let t=(e[a]+"").trim(),r=(e[i]+"").trim();c.has(t)||c.set(t,{id:t,label:t}),c.has(r)||c.set(r,{id:r,label:r});let l=`${t}->${r}`,p=o?Number(e[o]):1,h=Number.isFinite(p)?p:1;u.set(l,(u.get(l)??0)+h),d.has(l)||d.set(l,{source:t,target:r,...n?{startTime:e[n]}:{},...s?{endTime:e[s]}:{}})}let p=[];for(let[e,t]of d)p.push({...t,value:u.get(e)??1});return{nodes:Array.from(c.values()),edges:p}}(a);e&&(i.hasNetwork=!0,i.network=e)}let s={x:_e(r.fields,a,qr,Ir,"x",n,{computeMonotonic:!0}),y:_e(r.fields,a,Vr,Nr,"y",n),size:_e(r.fields,a,Hr,Or,"size",n),category:_e(r.fields,a,Wr,Dr,"category",n),series:_e(r.fields,a,Wr,zr,"series",n),time:_e(r.fields,a,Gr,/(date|time|timestamp)/i,"time",n,{computeMonotonic:!0})},o=function(e,t,r,a={}){let i=t.time[0]?.field,n=t.x.find(e=>Ge(r,e.field,"x"))?.field??i;n||(n=t.x.find(e=>"numeric"===e.kind&&Ir.test(e.field))?.field);let s=t.y.find(e=>e.field!==n)?.field;!n&&s&&(n=t.x.find(e=>"numeric"===e.kind&&e.field!==s)?.field);let o,l,c=t.size.find(e=>e.field!==n&&e.field!==s)?.field,u=Je(n,i,r);"time"===u||"named"===u?(l=t.series[0]?.field,o=t.category.find(e=>e.field!==l)?.field):(o=t.category[0]?.field,l=t.series.find(e=>e.field!==o)?.field);let d={x:n,y:s,size:c,category:o,series:l,time:i};if(a.primary)for(let[e,i]of Object.entries(a.primary))void 0!==i&&Xe(t,r,e,i),d[e]=i;let p=Je(d.x,d.time,r),h=Ue(e,d.category),m=Ue(e,d.series),f=Ue(e,d.x);return{primary:d,categoryCount:h.distinct,seriesCount:m.distinct,uniqueXCount:f.distinct,hasRepeatedX:f.repeated,monotonicX:t.x.find(e=>e.field===d.x)?.monotonic??!1,hasTimeAxis:t.time.length>0,xProvenance:p,stackability:Ke(e,d.x,d.series)}}(a,s,n);return{...r,data:a,numericFields:Ve(a,{quantiles:!1}),fieldRoles:n,identifiers:(l=n,Object.keys(l).filter(e=>Ge(l,e,"identifier"))),candidates:s,...o,hasHierarchy:i.hasHierarchy,hasNetwork:i.hasNetwork,hasGeo:i.hasGeo,network:i.network,hierarchy:i.hierarchy,geo:i.geo};var l}(a,{rawInput:t}),n=rt({component:e,rowCount:a.length,records:a}),s=Bt(i),o=Oe(e,t);if(o.structure){let e=Tt(o.structure);o.structure=e}let l=r.accessContract??function({component:e,props:t,options:r={}}){let a=Br[e],i=a?a.realtime:!0===r.realtime,n=L(e,t,{...r.locale?{locale:r.locale}:{}}),s=ie(e,t),o=s||!0===a?.recipeNavigation,l=s&&!1!==r.navigable?de(e,t,{...r.locale?{locale:r.locale}:{}}):void 0,c=Ae(e,t,{inChartContainer:!0===r.inChartContainer,describe:!0===r.describe||xe(t.summary),navigable:!1!==r.navigable&&o}),u=i?function(e){let t=e?.streamStatus;return t?(Array.isArray(t)?t:[t]).filter(e=>!!e&&"string"==typeof e.status).slice(-(e?.streamHistoryLimit??5)):[]}(r):[],d=function(e,t){return e?"delegated"===e.markNavigation||"not-applicable"===e.markNavigation?e.markNavigation:t?"built-in":"unsupported":"unsupported"}(a,o);return{schemaVersion:1,component:e,text:{...xe(t.title)?{title:t.title}:{},...xe(t.description)?{description:t.description}:{},...xe(t.summary)?{summary:t.summary}:{},accessibleTable:$e(a,t)},keyboard:{markNavigation:d,legendInteraction:ke(a,t),focusRing:d},navigation:{supported:o,composition:"chart-container",...l?{tree:l}:void 0,...l?{}:{note:o?s?"Structured datum navigation is available through ChartContainer; enable its navigable option to materialize the tree.":"Structured datum navigation is declared for this built-in recipe; load its recipe manifest through semiotic/ai before materializing the tree.":"No datum-level structured navigation is registered for this chart. Exact-value table access may still be available."}},table:{enabled:$e(a,t),source:"scene",pagination:"built-in"},mediaPreferences:{reducedMotion:a?"built-in":"unknown",forcedColors:a?"css-custom-properties":"unknown",note:a?"Runtime detection is available through useReducedMotion and useHighContrast; canvas styling uses CSS custom properties so forced-colors changes cascade.":"No generated runtime capability record exists for this component; media-preference support is unknown."},streamStatus:i?{supported:!0,status:u.at(-1)?.status??"idle",lastPushTime:u.at(-1)?.lastPushTime??null,history:u,historyLimit:r.streamHistoryLimit??5,...Ce(u)?{accessibleDescription:Ce(u)}:{},note:"Hosts may expose this bounded, non-visible description to screen readers or agents. Do not render it in visible UI."}:{supported:!1,note:"Static chart; no push-ingest lifecycle."},ssr:!0===a?.supportsSSR?{supported:!0,evidence:r.ssrEvidence,note:r.ssrEvidence?"Server rendering is registered and attached render evidence records the observed scene.":"Server rendering is registered; supply renderChartWithEvidence output before claiming a non-empty scene."}:{supported:!1,...r.ssrEvidence?{evidence:r.ssrEvidence}:{},note:i?"Live push charts intentionally omit static SSR; capture a supported bounded-window static twin before claiming server evidence.":a?"The chart capability registry does not expose this component through renderChart; do not claim server evidence for the HOC surface.":"No generated capability record exists for this component; SSR support is unknown and therefore reported as unsupported."},evidence:{audit:c,description:n}}}({component:e,props:t,options:{navigable:!1,inChartContainer:!0===r.inChartContainer,streamStatus:r.streamStatus,streamHistoryLimit:r.streamHistoryLimit,ssrEvidence:r.ssrEvidence}}),c={...l,navigation:{...l.navigation,...l.navigation.tree?{tree:Tt(l.navigation.tree)}:{}}},u=function(e){let t=e.data;if(Array.isArray(t))return t.length}(t),p=($=r.ssrEvidence,$?.markCount),h="number"!=typeof(A={intended:u,observed:p,evidence:r.ssrEvidence}).intended||"number"!=typeof A.observed?"unknown":0===A.observed&&A.intended>0||"empty"===A.evidence?.status&&A.intended>0?"mismatch":A.observed===A.intended?"match":"unknown",m=r.modalityChecks??{},f=m.vision??{observations:[]},g=m.tandem??{agreements:[],conflicts:[]},y=r.transformOperations??[],b=r.artifactContract??r.ssrEvidence?.artifactContract,v=b?Rt(b,{excludeEvidenceSamples:!0}):void 0,w=v?function(e,t){let r={...e,identityBinding:t};return{...r,transferBindingVersion:ua,transferFingerprint:Nt(r)}}(v,function(e,t,r){return"0.1"===e.contract?.contractVersion&&"invalid"!==e.transfer.status?function(e,t,r,a=function(e){let t=Object.entries(e).filter(([e,t])=>oa.includes(e)&&void 0!==t);if(0!==t.length)return 1===t.length&&"data"===t[0][0]?t[0][1]:Object.fromEntries(t)}(t)){let i=function(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!oa.includes(e)&&"recipeId"!==e))}(t),n=0===d(i).length?dt(i).fingerprint:void 0,s=void 0!==a&&0===d(a).length?function(e,t=[]){if(void 0===e)return;let r=t.filter(e=>!!e.transformation).map(({id:e,transformation:t})=>({evidenceId:e,transformation:t})).sort(({evidenceId:e},{evidenceId:t})=>t>e?-1:e>t?1:0);return dt(r.length>0?{data:e,transformations:r}:e).fingerprint}(a,e.evidence):void 0,o="ChartRecipe"===r&&"string"==typeof t.recipeId?t.recipeId:r,l=[],c=[];return void 0!==o&&(void 0===e.artifact.component?c.push("artifact.component"):e.artifact.component!==o&&l.push("artifact.component")),void 0===e.artifact.configFingerprint||void 0===n?c.push("artifact.configFingerprint"):e.artifact.configFingerprint!==n&&l.push("artifact.configFingerprint"),void 0!==e.artifact.dataFingerprint&&s?e.artifact.dataFingerprint!==s&&l.push("artifact.dataFingerprint"):c.push("artifact.dataFingerprint"),{status:l.length>0?"mismatch":c.length>0?"unknown":"match",mismatchPaths:l,unknownPaths:c}}(e.contract,r,t):{status:"unknown",mismatchPaths:[],unknownPaths:["artifactContract"]}}(v,e,t)):void 0;var A,$;return{schemaVersion:1,chart:{component:e,surfaceVersion:r.surfaceVersion??"1",...r.chartId?{chartId:r.chartId}:{}},input:{...r.sourceId?{source:r.sourceId}:{},rowCount:a.length,profile:s,hash:n},transform:{operations:y,hash:rt(y)},render:{mode:r.ssrEvidence?"svg":"not-rendered",...2===r.ssrEvidence?.sceneHashVersion&&r.ssrEvidence.sceneHash?{sceneHash:r.ssrEvidence.sceneHash,sceneHashVersion:2}:{},markInventoryHash:r.ssrEvidence?rt(r.ssrEvidence.markCountByType):void 0,imageHash:void 0,marksIntended:u,marksObserved:p,parity:h,...r.ssrEvidence?{evidence:r.ssrEvidence}:{}},access:c,meaning:{grounding:o,...o.intent?.act?{communicativeAct:o.intent.act}:{},...r.claims?{claims:r.claims}:{}},modalityChecks:{structured:{observations:m.structured?.observations??[],model:null},vision:{observations:f.observations??[],...f.model?{model:f.model}:{}},tandem:{agreements:g.agreements??[],conflicts:g.conflicts??[],...g.model?{model:g.model}:{}}},audit:{accessibility:c.evidence.audit,...r.audits},limits:{uncertaintyShown:r.uncertaintyShown,knownGaps:r.knownGaps??[],unsupportedClaims:r.unsupportedClaims??[],privacyScope:r.privacyScope??{semantic:["field names","aggregates","bounded navigation"],renderedSvg:["visual geometry","labels","no raw rows by default"],dashboardScreenshot:["everything visible; treat as broad disclosure"]}},...w?{artifact:w}:{}}}function Dt(e){if(!e||"object"!=typeof e||Array.isArray(e))throw new TypeError("Evidence envelope must be an object");let t=e;if(1!==t.schemaVersion)throw new TypeError("Unsupported evidence envelope schemaVersion: "+t.schemaVersion);for(let e of["chart","input","transform","render","access","meaning","modalityChecks","audit","limits"])if(!t[e]||"object"!=typeof t[e])throw new TypeError("Evidence envelope is missing section: "+e);if(1!==t.access?.schemaVersion)throw new TypeError("Evidence envelope has an incompatible access contract");let r=t.access;for(let e of["text","keyboard","navigation","table","mediaPreferences","streamStatus","ssr","evidence"])if(!r[e]||"object"!=typeof r[e])throw new TypeError("Evidence envelope access section is missing: "+e);if("boolean"!=typeof r.table.enabled)throw new TypeError("Evidence envelope access table state must be boolean");It(t.audit?.accessibility,"audit.accessibility"),It(r.evidence.audit,"access.evidence.audit");let a=t.chart,i=t.input,n=t.transform,s=t.render,o=t.meaning;if(!o.grounding||"object"!=typeof o.grounding)throw new TypeError("Evidence envelope meaning requires reader grounding");if(!a.component||"string"!=typeof a.component)throw new TypeError("Evidence envelope chart requires a component string");if(!Number.isSafeInteger(i.rowCount)||0>i.rowCount)throw new TypeError("Evidence envelope input requires non-negative rowCount");if(!Array.isArray(n.operations))throw new TypeError("Evidence envelope transform requires operations array");if(!["svg","canvas","png","not-rendered"].includes(s.mode))throw new TypeError("Evidence envelope render requires mode");(function(e){let t=e.evidence;if(void 0!==t&&!Mt(t))throw new TypeError("Evidence envelope render evidence must be an object");for(let r of[e,t])if((void 0!==r?.sceneHashVersion||r===t&&void 0!==r?.sceneHash)&&(2!==r?.sceneHashVersion||"string"!=typeof r.sceneHash||!/^[a-f0-9]{64}$/.test(r.sceneHash)))throw new TypeError("Evidence envelope requires a supported scene hash version and SHA-256 digest");if(void 0!==e.sceneHash&&void 0===e.sceneHashVersion){let r=t?.markCountByType;if(void 0!==e.markInventoryHash||!Mt(r)||!Object.values(r).every(e=>"number"==typeof e&&Number.isSafeInteger(e)&&e>=0)||e.sceneHash!==rt(r))throw new TypeError("Evidence envelope legacy scene hash must identify its mark inventory")}if(t&&(2===e.sceneHashVersion||2===t.sceneHashVersion)&&(2!==e.sceneHashVersion||2!==t.sceneHashVersion||e.sceneHash!==t.sceneHash))throw new TypeError("Evidence envelope scene hash does not match its render evidence")})(s),Lt({contract:s.evidence?.artifactContract,transfer:s.evidence?.artifactTransfer,binding:s.evidence?.artifactBinding},"render.evidence.artifact");let l=t.modalityChecks;for(let e of["structured","vision","tandem"])if(!l[e]||"object"!=typeof l[e])throw new TypeError("Evidence envelope modalityChecks is missing: "+e);for(let e of["structured","vision"])if(!Array.isArray(l[e].observations))throw new TypeError(`Evidence envelope ${e} observations must be an array`);for(let e of["structured","vision"])for(let t of l[e].observations)if(!t||"object"!=typeof t||"string"!=typeof t.id||"string"!=typeof t.finding)throw new TypeError(`Evidence envelope ${e} observations require string id and finding`);if(!Array.isArray(l.tandem.agreements)||!Array.isArray(l.tandem.conflicts))throw new TypeError("Evidence envelope tandem agreements and conflicts must be arrays");if(void 0!==t.artifact){if(!t.artifact||"object"!=typeof t.artifact||!t.artifact.transfer||"object"!=typeof t.artifact.transfer)throw new TypeError("Evidence envelope artifact requires a transfer report");let e=t.artifact,r=e.transferBindingVersion===ua;if(r&&void 0===e.identityBinding||!r&&void 0!==e.identityBinding)throw new TypeError("Evidence envelope artifact has an invalid identity binding");if(![da,ua].includes(e.transferBindingVersion)||"string"!=typeof e.transferFingerprint)throw new TypeError("Evidence envelope artifact requires a supported transfer binding");let a=Nt(e);if(e.transferFingerprint!==a)throw new TypeError("Evidence envelope artifact transfer fingerprint does not match its payload");Lt({contract:e.contract,transfer:e.transfer,binding:e.identityBinding},"artifact")}for(let e of l.tandem.conflicts)if(!e||"object"!=typeof e||"string"!=typeof e.id||0===e.id.length)throw new TypeError("Evidence envelope tandem conflict requires a non-empty id");if(!Array.isArray(l.tandem.agreements))throw new TypeError("Evidence envelope tandem agreements must be an array");for(let e of l.tandem.agreements)if(!e||"object"!=typeof e||"string"!=typeof e.id||"string"!=typeof e.finding)throw new TypeError("Evidence envelope tandem agreements require string id and finding");let c=t.limits;if(!Array.isArray(c.knownGaps)||!c.knownGaps.every(e=>"string"==typeof e)||!Array.isArray(c.unsupportedClaims)||!c.unsupportedClaims.every(e=>"string"==typeof e)||!c.privacyScope||"object"!=typeof c.privacyScope||Array.isArray(c.privacyScope)||!Object.values(c.privacyScope).every(e=>Array.isArray(e)&&e.every(e=>"string"==typeof e)))throw new TypeError("Evidence envelope limits require arrays and privacy scope");if(void 0!==s.marksObserved&&(!Number.isSafeInteger(s.marksObserved)||0>s.marksObserved))throw new TypeError("Evidence envelope marksObserved must be a non-negative safe integer");if(void 0!==o.claims){if(!Array.isArray(o.claims))throw new TypeError("Evidence envelope claims must be an array");for(let e of o.claims){if(!e||"object"!=typeof e||"string"!=typeof e.claim)throw new TypeError("Evidence envelope claims require a claim string");if(void 0!==e.confidence&&("number"!=typeof e.confidence||!Number.isFinite(e.confidence)))throw new TypeError("Evidence envelope claim confidence must be finite")}}if(n.operations.some(e=>!e||"string"!=typeof e.operation))throw new TypeError("Evidence envelope transform operations require operation strings");if(void 0!==s.marksIntended&&(!Number.isSafeInteger(s.marksIntended)||0>s.marksIntended))throw new TypeError("Evidence envelope marksIntended must be a non-negative safe integer");return e}function zt(e){let{contract:t,transfer:r,binding:a}=e;if(void 0===t&&void 0===r&&void 0===a)return[];let i=[],n=Array.isArray(a?.mismatchPaths)?a.mismatchPaths.filter(e=>"string"==typeof e):[];return r&&"preserved"!==r.status&&"excluded"!==r.status?i.push({id:"artifact.transfer-invalid",status:"fail",message:`The attached artifact transfer is ${r.status}; its contract cannot be relied on for publication.`}):(!r||void 0===t)&&i.push({id:"artifact.transfer-unknown",status:"unknown",message:"The attached artifact lacks a contract or a transfer report."}),"mismatch"===a?.status||n.length>0?i.push({id:"artifact.identity-mismatch",status:"fail",message:"The attached artifact does not identify this chart input"+(n.length?": "+n.join(", "):".")}):("match"!==a?.status||!Array.isArray(a.mismatchPaths)||!Array.isArray(a.unknownPaths)||a.mismatchPaths.length>0||a.unknownPaths.length>0)&&i.push({id:"artifact.identity-unknown",status:"unknown",message:"The attached artifact identity has not been fully verified."}),i}function Ht(e,t,r){return{id:e,severity:t,message:r}}function qt(e,t={}){let r=[];try{Dt(e)}catch(e){return{status:"fail",ok:!1,findings:[Ht("envelope.invalid","error",e instanceof Error?e.message:"The evidence envelope is invalid.")]}}let a={...e.limits,knownGaps:[...e.limits.knownGaps],unsupportedClaims:[...new Set(e.limits.unsupportedClaims)],privacyScope:Object.fromEntries(Object.entries(e.limits.privacyScope).map(([e,t])=>[e,[...t]]))},i=[{prefix:"",contract:e.artifact?.contract,transfer:e.artifact?.transfer,binding:e.artifact?.identityBinding},{prefix:"render.",contract:e.render.evidence?.artifactContract,transfer:e.render.evidence?.artifactTransfer,binding:e.render.evidence?.artifactBinding}];for(let e of i)for(let t of zt(e))r.push(Ht(`${e.prefix}${t.id}`,"error",t.message));e.render.evidence&&e.render.evidence.component!==e.chart.component&&r.push(Ht("render.component-mismatch","error","The render evidence names a different chart component."));let n=!1!==t.requireRenderEvidence,s=!1!==t.requireAccessTable,o=!1!==t.failOnCrossModalConflicts;n&&!e.render.evidence&&r.push(Ht("render.missing-evidence","error","Publication requires render evidence proving that intended marks were observed.")),n&&!e.access.ssr.supported&&r.push(Ht("access.ssr-unsupported","error","Publication requires a chart surface registered for server rendering; supplied evidence cannot promote an unsupported capability claim.")),("mismatch"===e.render.parity||"empty"===e.render.evidence?.status)&&r.push(Ht("render.parity-mismatch","error","Intended data did not produce matching observed marks.")),("degenerate"===e.render.evidence?.semanticStatus||"degraded"===e.render.evidence?.semanticStatus)&&r.push(Ht("render.semantic-viability","error",`Render evidence marks the encoding ${e.render.evidence.semanticStatus}.`)),s&&!e.access.table.enabled&&r.push(Ht("access.table-disabled","error","A required exact-value access route is disabled.")),!e.access.navigation.supported&&!0===t.requireNavigation&&r.push(Ht("access.navigation-missing","error","Structured navigation was required but is not available."));let l=e.audit.accessibility;if(l&&"object"==typeof l&&((l.findings??[]).some(e=>!0===e.critical&&"fail"===e.status)||!1===l.ok&&!0!==t.allowAccessibilityWarnings)&&r.push(Ht("audit.accessibility-blocking","error",!0===t.allowAccessibilityWarnings?"Accessibility audit contains critical failures.":"Accessibility audit is not passing.")),o&&e.modalityChecks.tandem.conflicts.length>0){let t=e.modalityChecks.tandem.conflicts.filter(e=>!e.resolution||"unresolved"===e.resolution);t.length>0&&r.push(Ht("modality.unresolved-conflicts","error",t.length+" cross-modal disagreement(s) remain unresolved."))}for(let e of a.unsupportedClaims)r.push(Ht("claim.unsupported","error","Claim is explicitly unsupported: "+e));for(let t of e.meaning.claims??[])if(!1===t.supported||0===t.confidence||!t.evidenceIds?.length){if(a.unsupportedClaims.includes(t.claim))continue;a.unsupportedClaims.push(t.claim),r.push(Ht("claim.unsupported","error",!1===t.supported?"Claim is explicitly unsupported: "+t.claim:"Claim lacks evidence links: "+t.claim))}return{status:r.some(e=>"error"===e.severity)?"fail":"pass",ok:!r.some(e=>"error"===e.severity),findings:r,limits:a}}var Vt=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),Gt=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),Wt=new Set(["PieChart","DonutChart","FunnelChart"]),Ut=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),Jt=Symbol.for("semiotic.chartRecipeRegistry"),Kt={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",BumpChart:"bump chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},Xt=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Qt=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),Yt=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),Zt={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},_t={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},er=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],tr={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},rr=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),ar=new Set(["system","agent","watcher"]),ir=new Set(["ai","agent","system","computed","dbt","great-expectations"]),nr=new Set(["rule","statistical-test","llm-inference","computed"]),sr={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"},or=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),lr=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),cr=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),ur=["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"]],dr=[["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"]],pr={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}},hr=Object.fromEntries(Object.entries({BarChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,brush:4,linkedBrush:17,onBrush:12,regression:14}],StackedBarChart:[["data","stackBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stackBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,9],normalize:4,sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:17,onBrush:12}],GroupedBarChart:[["data","groupBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,groupBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:17,onBrush:12}],SwarmPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],BoxPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],showOutliers:4,outlierRadius:1,categoryPadding:1,valueExtent:9,styleRules:9}],Histogram:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,bins:1,relative:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],ViolinPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],bins:1,curve:0,showIQR:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],RidgelinePlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,orientation:[0,9],categoryAccessor:6,valueAccessor:6,bins:1,amplitude:1,categoryPadding:1,valueExtent:9,styleRules:9}],DotPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,dotRadius:1,categoryPadding:1,valueExtent:9,styleRules:9,showGrid:4,regression:14}],PieChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,startAngle:1,valueFormat:12,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],DonutChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,innerRadius:1,centerContent:18,valueFormat:12,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],GaugeChart:[["value"],"none",[],["common"],{value:1,min:1,max:1,thresholds:9,gradientFill:10,arcWidth:1,cornerRadius:1,sweep:1,fillZones:4,showNeedle:4,needleColor:0,color:0,valueFormat:12,centerContent:19,showScaleLabels:4,backgroundColor:0,styleRules:9}],FunnelChart:[["data"],"array",["stepAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stepAccessor:6,valueAccessor:6,categoryAccessor:6,orientation:[0,10],connectorOpacity:1,showLabels:4,showAxes:4,showCategoryTicks:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],RadarChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,seriesAccessor:6,pointRadius:1,valueExtent:9,styleRules:9}],SwimlaneChart:[["subcategoryAccessor"],"array",["categoryAccessor","subcategoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,subcategoryAccessor:6,valueAccessor:6,orientation:[0,10],barPadding:1,roundedTop:16,valueExtent:9,trackFill:17,gradientFill:3,brush:4,onBrush:12,linkedBrush:17,showCategoryTicks:4,rTickValues:9,tickLabelEdgeAlign:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],LikertChart:[[],"array",["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],["common","ordinalAxis"],{data:9,levels:9,categoryAccessor:6,valueAccessor:6,levelAccessor:6,countAccessor:6,orientation:[0,9],barPadding:1,valueExtent:9,styleRules:9}],LineChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{frameProps:10,styleRules:9,data:9,xAccessor:6,yAccessor:6,lineBy:6,lineDataAccessor:0,curve:[0,11],lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,fillArea:20,areaOpacity:1,lineGradient:10,directLabel:3,gapStrategy:[0,12],forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9,brush:4,linkedBrush:17,onBrush:12}],BumpChart:[["data"],"array",["xAccessor","yAccessor"],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,rankDirection:[0,13],ribbon:4,curve:[0,14],ribbonSizeRange:9,samplesPerSegment:1,lineWidth:1,highlightTop:1,neutralColor:0,ribbonOpacity:1,lineOpacity:1,showPoints:4,pointRadius:1,showLabels:[11,15],labelPriorityAccessor:0,maxLabels:1,showAxes:4,styleRules:9,labelStyle:22,legend:5,legendInteraction:[0,1],legendPosition:[0,2],hoverHighlight:[11,16]}],AreaChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,areaBy:6,lineDataAccessor:0,curve:[0,11],y0Accessor:6,gradientFill:3,semanticGradient:21,semanticLine:4,lineGradient:10,areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],DifferenceChart:[[],"array",["xAccessor","seriesAAccessor","seriesBAccessor"],["common","xyAxis"],{data:9,xAccessor:6,seriesAAccessor:6,seriesBAccessor:6,seriesALabel:0,seriesBLabel:0,seriesAColor:0,seriesBColor:0,showLines:4,lineWidth:1,showPoints:4,pointRadius:1,curve:[0,11],areaOpacity:1,gradientFill:3,xExtent:9,yExtent:9,pointIdAccessor:6,windowSize:1,styleRules:9}],StackedAreaChart:[["data","areaBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,areaBy:6,lineDataAccessor:0,curve:[0,11],areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,normalize:4,baseline:[0,17],stackOrder:[0,18],pointIdAccessor:6,xExtent:9,yExtent:9}],Scatterplot:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,pointIdAccessor:6,marginalGraphics:22,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10,brush:4,linkedBrush:17,onBrush:12}],BubbleChart:[["data","sizeBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,sizeBy:6,xAccessor:6,yAccessor:6,sizeRange:9,bubbleOpacity:1,bubbleStrokeWidth:1,bubbleStrokeColor:0,pointIdAccessor:6,marginalGraphics:22,xExtent:9,yExtent:9,regression:14,brush:4,linkedBrush:17,onBrush:12}],Heatmap:[["data"],"array",["xAccessor","yAccessor","valueAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,valueAccessor:6,colorScheme:[0,19],customColorScale:12,showValues:4,valueFormat:12,cellBorderColor:0,cellBorderWidth:1,pointIdAccessor:6,xExtent:9,yExtent:9,legendPosition:[0,2],heatmapAggregation:[0,20],heatmapXBins:1,heatmapYBins:1}],QuadrantChart:[[],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xCenter:1,yCenter:1,quadrants:10,centerlineStyle:10,showQuadrantLabels:4,quadrantLabelSize:1,sizeBy:6,sizeRange:9,pointRadius:1,pointOpacity:1,pointIdAccessor:6}],MultiAxisLineChart:[["series"],"array",["xAccessor"],["common","xyAxis"],{data:9,xAccessor:6,series:9,colorScheme:7,pointIdAccessor:6,curve:0,lineWidth:1,styleRules:9}],WaterfallChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{data:9,xAccessor:6,yAccessor:6,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,styleRules:9,xExtent:9,yExtent:9,pointIdAccessor:6}],CandlestickChart:[[],"array",["xAccessor","highAccessor","lowAccessor"],["common","xyAxis"],{data:9,xAccessor:6,highAccessor:6,lowAccessor:6,openAccessor:6,closeAccessor:6,candlestickStyle:10,styleRules:9,pointIdAccessor:6,xExtent:9,yExtent:9,mode:[0,0]}],ConnectedScatterplot:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,orderAccessor:6,orderLabel:0,pointRadius:1,pointIdAccessor:6,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10}],ScatterplotMatrix:[["data","fields"],"array",[],["common"],{frameProps:10,data:9,fields:9,fieldLabels:10,cellSize:1,cellGap:1,pointRadius:1,pointOpacity:1,diagonal:[0,21],histogramBins:1,brushMode:[23,22],hoverMode:4,unselectedOpacity:1,idAccessor:6,styleRules:9}],MinimapChart:[["data"],"array",[],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,lineDataAccessor:0,curve:[0,11],lineWidth:1,styleRules:9,fillArea:4,areaOpacity:1,showPoints:4,pointRadius:1,minimap:10,renderBefore:4,onBrush:12,brushExtent:9,yExtent:9}],ForceDirectedGraph:[["nodes","edges"],"network",["nodeIdAccessor","sourceAccessor","targetAccessor"],["common"],{styleRules:9,nodes:9,edges:9,nodeIdAccessor:6,nodeIDAccessor:6,sourceAccessor:6,targetAccessor:6,nodeLabel:6,nodeSize:24,nodeSizeRange:9,edgeWidth:24,edgeColor:0,edgeOpacity:1,nodeStroke:0,nodeStrokeWidth:1,iterations:1,forceStrength:1,layoutExecution:[0,23],layoutLoadingContent:3,onLayoutStateChange:12,showLabels:4}],SankeyDiagram:[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,24],orientation:[0,9],nodeAlign:[0,25],nodePaddingRatio:1,nodeWidth:1,nodeLabel:6,showLabels:4,edgeOpacity:1,edgeSort:12}],ProcessSankey:[["domain"],"network",["sourceAccessor","targetAccessor"],["common"],{edges:9,nodes:9,domain:9,axisTicks:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,nodeLabel:6,startTimeAccessor:6,endTimeAccessor:6,systemInTimeAccessor:6,systemOutTimeAccessor:6,xExtentAccessor:6,groupBy:6,edgeIdAccessor:6,orientation:[0,10],legendPosition:[0,2],pairing:[0,26],packing:[0,27],laneOrder:[0,28],maxValueScale:1,lanePlacement:[0,29],nodeSizing:[0,30],showLabels:[11,31],labelPriorityAccessor:0,maxLabels:1,selectionDatum:[0,32],groupPadding:1,ribbonLane:[0,33],ribbonMinRun:25,lifetimeMode:[0,34],showLaneRails:4,showQualityReadout:4,edgeOpacity:1,styleRules:9,layoutExecution:[0,23],layoutWorkerThreshold:1,layoutLoadingContent:26,onLayoutStateChange:12,timeFormat:12,valueFormat:12,showParticles:4,particleStyle:10}],ChordDiagram:[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,35],padAngle:1,groupWidth:1,sortGroups:12,nodeLabel:6,showLabels:4,edgeOpacity:1}],TreeDiagram:[["data"],"object",[],["common"],{styleRules:9,data:10,layout:[0,36],orientation:[0,37],childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,edgeStyle:[0,38],nodeLabel:6,showLabels:4,nodeSize:1}],Treemap:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,labelMode:[0,39],padding:1,paddingTop:1,nodeLabel:6,nodeStyle:12}],CirclePack:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,nodeLabel:6,circleOpacity:1,padding:1}],OrbitDiagram:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,nodeIdAccessor:6,colorByDepth:4,orbitMode:27,orbitSize:16,speed:1,eccentricity:16,showRings:4,nodeRadius:16,showLabels:4,animated:4,revolution:12,revolutionStyle:[0,40],foregroundGraphics:10}],ChoroplethMap:[["areas","valueAccessor"],"array",["valueAccessor"],["common"],{styleRules:9,areas:28,valueAccessor:6,colorScheme:27,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1,areaOpacity:1}],ProportionalSymbolMap:[["points","sizeBy"],"array",["xAccessor","yAccessor"],["common"],{styleRules:9,points:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,areas:28,pointIdAccessor:6,areaStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],FlowMap:[["flows"],"array",[],["common"],{flows:9,nodes:9,nodeIdAccessor:0,xAccessor:6,yAccessor:6,valueAccessor:6,lineIdAccessor:6,lineType:[0,41],flowStyle:[0,42],areas:28,areaStyle:10,edgeColorBy:6,styleRules:9,edgeOpacity:1,edgeWidthRange:9,pointRadius:1,edgeLinecap:[0,43],showParticles:4,particleStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],DistanceCartogram:[["points","center","costAccessor"],"array",[],["common"],{styleRules:9,points:9,lines:9,xAccessor:6,yAccessor:6,nodeIdAccessor:0,center:0,costAccessor:6,strength:1,lineMode:[0,44],transition:1,pointRadius:1,showRings:30,showRingLabels:4,ringStyle:10,showNorth:4,costLabel:0,cartogramLayout:[0,45],projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],RealtimeLineChart:[[],"realtime",[],["realtime"],{styleRules:9,stroke:0,strokeWidth:1,strokeDasharray:0,opacity:1,aggregate:10,eventTime:10,transition:10}],RealtimeHistogram:[["binSize"],"realtime",[],["realtime"],{showTimeAxis:4,showValueAxis:4,axes:9,styleRules:9,binSize:1,direction:[0,46],categoryAccessor:6,colors:10,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,brush:14,onBrush:12,linkedBrush:17,transition:10}],TemporalHistogram:[["data","binSize"],"array",["timeAccessor","valueAccessor","categoryAccessor"],["realtimeStatic"],{showTimeAxis:4,showValueAxis:4,axes:9,styleRules:9,data:9,binSize:1,size:9,width:1,height:1,margin:2,className:0,timeAccessor:6,valueAccessor:6,direction:[0,46],categoryAccessor:6,colors:10,timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,transition:10,linkedHover:14,linkedBrush:17,brush:14,onBrush:12}],RealtimeSwarmChart:[[],"realtime",[],["realtime"],{styleRules:9,categoryAccessor:6,colors:10,radius:1,fill:0,opacity:1,stroke:0,strokeWidth:1,pointStyle:12,yScaleType:[0,6],transition:10}],RealtimeWaterfallChart:[[],"realtime",[],["realtime"],{styleRules:9,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,stroke:0,strokeWidth:1,opacity:1,transition:10}],RealtimeHeatmap:[[],"realtime",[],["realtime"],{styleRules:9,heatmapXBins:1,heatmapYBins:1,aggregation:[0,20],categoryAccessor:6,colorScheme:[0,19],customColorScale:12}],GaltonBoardChart:[[],"array",["valueAccessor"],["physics"],{styleRules:9,valueAccessor:6,valueExtent:9,bins:1,mode:[0,47],simulationMode:[0,48],pegRows:1,mechanicalCount:1,branchProbability:1,referenceLines:21,rerunMS:31,showProjection:4}],EventDropChart:[["data"],"array",["timeAccessor","arrivalAccessor","watermarkAtArrivalAccessor"],["physics"],{styleRules:9,timeAccessor:6,arrivalAccessor:6,watermarkAtArrivalAccessor:6,windows:10,watermark:22,timeExtent:9,timeScale:1,rerunMS:31,showProjection:4}],UnitPileChart:[[],"array",["categoryAccessor","valueAccessor"],["physics"],{styleRules:9,categoryAccessor:6,valueAccessor:6,mode:[0,47],simulationMode:[0,48],mechanicalCount:1,mechanicalCategories:9,unitValue:1,showProjection:4,sediment:4,rerunMS:31}],CollisionSwarmChart:[[],"array",["xAccessor","groupAccessor","radiusAccessor"],["physics"],{styleRules:9,xAccessor:6,groupAccessor:6,radiusAccessor:6,pointRadius:1,xExtent:9,collisionIterations:1,settle:4,rerunMS:31,showProjection:4}],GauntletChart:[["negativeProperties"],"array",["idAccessor","positiveAccessor","negativeAccessor","metricsAccessor","startTimeAccessor"],["physics"],{idAccessor:6,labelAccessor:6,positiveAccessor:6,negativeAccessor:6,metricsAccessor:6,initialViability:6,positiveProperties:9,negativeProperties:9,gates:9,events:32,bodyGroups:32,crashOffset:1,initialSpawnPacing:10,startTimeAccessor:6,onCapacityChange:12,crashDetection:4,rerunMS:31,showChrome:4,showProjection:4,showTethers:4,coreForceMode:[0,49],terminalBehavior:[0,50]}],CrucibleChart:[["data","phases"],"array",["idAccessor","labelAccessor","categoryAccessor","amountAccessor","metricsAccessor","initialStateAccessor"],["physics"],{description:0,summary:0,phases:9,products:9,events:9,outlets:9,idAccessor:6,labelAccessor:6,categoryAccessor:6,amountAccessor:6,metricsAccessor:6,initialStateAccessor:6,metrics:10,amountLabel:0,conservation:3,projection:10,playback:[0,51],snapshotAt:2,controls:3,paused:4,playbackRate:1,rerunMS:31,seed:25,bodyRadius:1,radiusRange:9,colorBy:6,showBonds:4,showChrome:4,showProjection:4,initialSpawnPacing:10,loading:4,loadingContent:3,emptyContent:3,onStateChange:12,onCrucibleObservation:12,onDiagnostic:12,onConservation:12,onClick:12}],ProcessFlowChart:[["stages"],"array",["idAccessor","stageAccessor","groupBy","workAccessor","radiusAccessor"],["physics"],{stages:9,stageAccessor:6,idAccessor:6,groupBy:6,groupLabelAccessor:6,workAccessor:6,styleRules:9,radiusAccessor:6,ballRadius:1,route:[0,52],groupCompletion:[0,53],groupAnchorAlong:1,showProjection:4,showChrome:4,chromeOptions:10,settle:4,gravityX:1,gravityY:1,springStiffness:1,springDamping:1,rerunMS:31,initialSpawnPacing:10,liveCapacity:4,bodyLimit:1,bodyMark:[0,54],seed:1}],PacketFlowChart:[[],"network",["nodeIdAccessor","nodeXAccessor","nodeYAccessor","sourceAccessor","targetAccessor","throughputAccessor","pathAccessor"],["common"],{size:9,background:0,legendLayout:10,nodes:9,links:9,edges:9,data:9,nodeIdAccessor:6,nodeXAccessor:6,nodeYAccessor:6,sourceAccessor:6,targetAccessor:6,throughputAccessor:6,pathAccessor:6,styleRules:9,coordinateMode:[0,55],particleRate:1,maxParticles:1,particleRadius:1,flowSpeed:1,pathConstraint:[0,56],reducedMotion:4,showStaticFlow:4,showNodeLabels:4,showSensors:4,paused:4,rerunMS:31,seed:1}],ChainReactionChart:[["data","taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor"],"array",["taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor","startAccessor","endAccessor","progressAccessor","statusAccessor","completionTimeAccessor","blockerAccessor","milestoneAccessor"],["physics"],{taskIDAccessor:6,labelAccessor:6,laneAccessor:6,dependencyAccessor:6,startAccessor:6,endAccessor:6,progressAccessor:6,statusAccessor:6,completionTimeAccessor:6,blockerAccessor:6,milestoneAccessor:6,mode:[0,57],insight:[0,58],currentTime:2,controls:20,mechanism:[0,59],orientation:[0,60],reducedMotion:[0,61],enableHover:4,seed:1,selectedTaskIDs:9,onSelectionChange:12,onObservation:12}],BigNumber:[[],"none",[],[],{width:25,height:25,className:0,chartId:0,description:0,summary:0,loading:4,loadingContent:3,emptyContent:3,value:1,label:0,caption:0,format:[6,62],locale:0,currency:0,precision:1,prefix:0,suffix:0,unit:0,comparison:10,target:10,delta:1,deltaFormat:[6,62],showDeltaPercent:4,direction:[0,63],sentiment:[0,64],thresholds:9,chartSlot:33,chartSize:1,windowSize:1,mode:[0,65],align:[0,66],padding:2,emphasis:[0,4],color:0,background:0,borderColor:0,borderRadius:25,animate:3,stalenessThreshold:1,staleLabel:0,headerSlot:33,valueSlot:33,deltaSlot:33,trendSlot:33,footerSlot:33,onClick:12,onObservation:12}]}).map(([e,[t,r,a,i,n]])=>[e,{required:[...t],dataShape:r,dataAccessors:[...a],props:Object.fromEntries(Object.entries(Object.assign({},...i.map(e=>pr[e]),n)).map(([e,t])=>[e,pe(t)]))}])),mr=["title","description","summary"],fr=new Set(["XYCustomChart","OrdinalCustomChart","NetworkCustomChart","GeoCustomChart"]),gr=new Set([...fr,"XYFrame","OrdinalFrame","NetworkFrame","GeoFrame"]),yr=new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]),br=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),vr=new Set(["label","callout","callout-circle","callout-rect"]),wr=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Ar=new Set(Object.keys({PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"})),$r=new Set(["BigNumber"]),xr=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),Cr=new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),kr=new Set(["OrbitDiagram",...Cr]),Sr=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),Pr=new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),Er=new Set(["MultiAxisLineChart"]),jr=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),Rr={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},Br=Object.freeze(Object.fromEntries([["AreaChart",13],["BubbleChart",13],["BumpChart",13],["CandlestickChart",13],["ConnectedScatterplot",13],["DifferenceChart",13],["Heatmap",13],["LineChart",13],["MinimapChart",13,"delegated"],["MultiAxisLineChart",13],["QuadrantChart",13],["Scatterplot",13],["ScatterplotMatrix",13,"delegated"],["StackedAreaChart",13],["WaterfallChart",13],["BarChart",13],["BoxPlot",13],["DonutChart",13],["DotPlot",13],["FunnelChart",13],["GaugeChart",5],["GroupedBarChart",13],["Histogram",13],["LikertChart",13],["PieChart",13],["RadarChart",13],["RidgelinePlot",13],["StackedBarChart",13],["SwarmPlot",13],["SwimlaneChart",13],["ViolinPlot",13],["ChordDiagram",13],["CirclePack",13],["ForceDirectedGraph",13],["OrbitDiagram",13],["ProcessSankey",13],["SankeyDiagram",13],["TreeDiagram",13],["Treemap",13],["ChoroplethMap",13],["DistanceCartogram",13],["FlowMap",13],["ProportionalSymbolMap",13],["RealtimeHeatmap",14],["RealtimeHistogram",14],["RealtimeLineChart",14],["RealtimeSwarmChart",14],["RealtimeWaterfallChart",14],["TemporalHistogram",13],["ChainReactionChart",5],["CollisionSwarmChart",13],["CrucibleChart",5],["EventDropChart",13],["GaltonBoardChart",13],["GauntletChart",5],["PacketFlowChart",13],["ProcessFlowChart",13],["UnitPileChart",13],["BigNumber",1,"not-applicable"],["ParallelCoordinatesRecipe",21],["CalendarHeatmapRecipe",21]].map(([e,t,r="unsupported"])=>[e,{supportsSSR:!!(1&t),realtime:!!(2&t),supportsAccessibleTable:!!(4&t),supportsLegend:!!(8&t),...16&t?{recipeNavigation:!0}:{},markNavigation:r}]))),Tr=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),Mr=/^\d{4}[-/]\d{2}/,Fr=/^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/,Ir=/^(x|index|rank|order|step|sequence|year|quarter|qtr|fiscal|month|week|day|date|time|timestamp)$/i,Lr=new Set(["identifier","measure","dimension","temporal","x","y","size","category","series","time","ignore"]),Nr=/^(y|value|amount|total|count|revenue|sales|price|score|rate|population|measure)$/i,Or=/(size|magnitude|volume|weight|count|amount)/i,Dr=/^(category|label|name|type|group|region|segment|kind|class)$/i,zr=/^(series|group|type|category|segment|cohort|product)$/i,Hr=new Set(["numeric"]),qr=new Set(["numeric","date"]),Vr=new Set(["numeric"]),Gr=new Set(["date"]),Wr=new Set(["categorical","boolean"]),Ur=/^(source|from|origin|stage|currentstage|sourcestage|fromstage)$/i,Jr=/^(target|to|destination|nextstage|next|targetstage|tostage|destinationstage|status)$/i,Kr=/^(starttime|startedat|enteredat|startdate|start|timestamp|date|time)$/i,Xr=/^(endtime|endedat|exitedat|completedat|finishtime|enddate|end)$/i,Qr=/^(value|weight|amount|count|magnitude|volume)$/i,Yr=(e,t)=>(e>>>t|e<<32-t)>>>0,Zr=e=>Math.floor(4294967296*(e-Math.floor(e)))>>>0,[_r,ea]=(()=>{let e=[],t=[];for(let r=2;64>t.length;r+=1){let a=!0;for(let e=2;r>=e*e;e+=1)if(r%e===0){a=!1;break}a&&(8>e.length&&e.push(Zr(Math.sqrt(r))),t.push(Zr(Math.cbrt(r))))}return[e,t]})(),ta=Pt({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}}),ra=["fresh","stale","unknown"],aa=["partial","provisional","settled","unknown"],ia=["observedAt","ingestedAt","processedAt","publishedAt","snapshotAt"],na={eventTime:{field:{},value:{},timezone:{},granularity:{}},presentation:{state:{values:["live","historical","mixed"]},label:{}},freshness:{status:{required:!0,values:ra},checkedAt:{},heartbeatAt:{},expiresAt:{},basis:{}},watermark:{value:{required:!0},policy:{},allowedLateness:{}},window:{start:{required:!0},end:{required:!0},status:{required:!0,values:["open","provisional","settled","reopened","corrected"]}},completeness:{status:{required:!0,values:aa},basis:{}},revision:{status:{required:!0,values:["original","backfilled","corrected","superseded"]},previousArtifactId:{},correctionId:{},reason:{}},snapshot:{id:{},format:{values:["iceberg","delta","other"]},schemaVersion:{},catalogRef:{}}},sa={id:{required:!0},kind:{required:!0,values:["stream","processing-job","quality-check","snapshot","publication"]},label:{},observedAt:{},version:{},timezone:{},granularity:{},freshness:{values:ra},completeness:{values:aa}},oa=["data","nodes","edges","points","areas","lines","flows"],la=new Set(["data","rawInput","sample","numericFields","network","hierarchy","geo","topValues","distinctValues"]),ca=1,ua=2,da=1;export{ca as CHART_EVIDENCE_ENVELOPE_VERSION,qt as evaluateEvidenceGate,Dt as fromEvidenceEnvelope,rt as stableEvidenceHash,Ot as toEvidenceEnvelope};
|
|
1
|
+
function e(e,t){if("function"==typeof e)return t=>+e(t);let r=e||t;return e=>+e[r]}function t(e,t){if("function"==typeof e)return e;let r=e||t;return e=>e[r]}function r(e,t){return Na.has(e)||Fa.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function a(e){for(let t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){let r=e[t];if("string"==typeof r&&r)return r}}function i(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function n(e,t={}){let r=!0===t.showRetractedAnnotations,a=!0===t.showSupersededAnnotations,i=/* @__PURE__ */new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;let t=e?.provenance?.stableId;return!(t&&i.has(t)&&!a)})}function s(e,t){return"number"==typeof t?`${e}[${t}]`:`${e}.${t}`}function o(e,t){return`${e}[Symbol(${t.description??""})]`}function l(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let r=Number(e);return Number.isSafeInteger(r)&&r>=0&&t>r}function c(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return}}function u(e,t,r,a){let i=c(e,t);return i&&"value"in i&&i.enumerable?d(i.value,r,a):[r]}function d(e,t="$",r=/* @__PURE__ */new Set){if(null===e||"string"==typeof e||"boolean"==typeof e)return[];if("number"==typeof e)return Number.isFinite(e)&&!Object.is(e,-0)?[]:[t];if("object"!=typeof e)return[t];if(r.has(e))return[t];let a,i,n;try{n=Array.isArray(e),a=Object.getPrototypeOf(e),i=Reflect.ownKeys(e)}catch{return[t]}if(a!==(n?Array.prototype:Object.prototype)&&null!==a)return[t];r.add(e);let d=[];try{if(n){let a=c(e,"length")?.value;if(!Number.isSafeInteger(a)||0>a)return[s(t,"length")];for(let e of i)"length"===e||"string"==typeof e&&l(e,a)||d.push("symbol"==typeof e?o(t,e):s(t,e));for(let i=0;a>i;i+=1)d.push(...u(e,i+"",s(t,i),r))}else for(let a of i)"symbol"!=typeof a?d.push(...u(e,a,s(t,a),r)):d.push(o(t,a));return d}catch{return[t]}finally{r.delete(e)}}function p(){let e=globalThis;return e[Ia]||(e[Ia]={recipes:/* @__PURE__ */new Map,capabilities:/* @__PURE__ */new Map,layouts:/* @__PURE__ */new Map}),e[Ia]}function h(e){return p().recipes.get(e)}function m(e){return"string"==typeof e?h(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function f(e){return"string"==typeof e?e:e.id??e.name}function g(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function y(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function v(e,t,r){return r??m(t.recipe)??m(t.recipeId)??h(e)}function b(e,t,r=[]){let a=e.accessor?t[e.accessor]:void 0;if("string"==typeof a&&a)return a;if(e.field)return e.field;let i=r.find(e=>e&&"object"==typeof e);if(!i)return;let n=Object.entries(i).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?n.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in i):n.find(([,e])=>"string"==typeof e)?.[0]}function $(e,t){return e.dataRoles.find(e=>e.role===t)}function w(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function C(e,t,r,a,i,n={}){let s={...n};if(t)for(let[e,r]of Object.entries(t))s[e]=r;for(let e of r.dataRoles){let r=b(e,a,i),n=t&&r?t[r]:r;void 0!==n&&(s[e.role]=n)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{let r=s[t];return null==r?`{${t}}`:r+""})}function x(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function A(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}function k(e,t,r,a){let i=w(e,["nominal","ordinal"]),n=w(e,["quantitative"]),s=i?b(i,r,t):void 0,o=n?b(n,r,t):void 0,l=i?.role??s??"category",c=n?.role??o??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${l} and ${c} are mapped through the recipe's declared visual semantics`,{number:p,percent:h}=A(a),m=/* @__PURE__ */new Map;if(s&&o)for(let e of t){let t=(e[s]??"Uncategorized")+"",r=Number(e[o]);Number.isFinite(r)&&m.set(t,(m.get(t)??0)+r)}let g=[...m].sort((e,t)=>t[1]-e[1]),y=g.reduce((e,[,t])=>e+t,0),v=g[0],$=g[1],C=y>0?((v?.[1]??0)+($?.[1]??0))/y:0,k=e.intents.map(e=>({id:f(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,S=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${l} and ${c}. ${x(d)}.`,l2:g.length>0?`${g.length} categories total ${p.format(y)}. ${v[0]} accounts for ${p.format(v[1])}${y>0?` (${h.format(v[1]/y)})`:""}${$?`, followed by ${$[0]} at ${p.format($[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>g.length?v?v[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>C?`The total is distributed across ${g.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${v[0]} and ${$[0]}, which together account for ${h.format(C)}.`,l4:`The chart is intended for ${k??"explanation"}${S?` with a ${S} audience`:""}: ${e.designContract.whyCustom}`}}function S(e,t,r={}){let a=y(t),i=g(t),n=r.locale??"en",s=("function"==typeof e.description?e.description({data:a,config:i,locale:n}):void 0)?.levels??k(e,a,i,n),o=r.levels??["l1","l2","l3","l4"],l={};for(let e of o)s[e]&&(l[e]=s[e]);let c=["l1","l2","l3","l4"].map(e=>l[e]).filter(e=>!!e).join(" "),u=r.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:c,levels:l,...u?.length?{caveats:u}:{}}}function j(e,t,r){return"function"==typeof r?r(e,t):e[r]}function E(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function P(e,t,r){return Math.max(t,Math.min(r,e))}function M(e,t){let r=E(e);return null!=r&&r>0?r:t}function B(e){if(!e)return;let t=E(e[0]),r=E(e[1]);return null!=t&&null!=r?t>r?[r,t]:[t,r]:void 0}function N(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function F(e,t,r=0){let a=new Set(e.filter(e=>null!=e.id).map(e=>e.id+"")),i=/* @__PURE__ */new Map;for(let n of e){let e=null==n.id?`${t}-${r++}`:n.id+"";for(;null==n.id&&a.has(e);)e=`${t}-${r++}`;a.add(e),i.set(e,null==n.id?{...n,id:e}:n)}return{seed:e,rows:Array.from(i.values()),nextId:r}}function T(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>(e+"").trim()).filter(Boolean),r=t.length?t:["Intake"],a=Math.max(r.length,Math.round(e.count??Math.max(48,12*r.length))),i=M(e.unitValue,1),n=N(e.seed??1),s=e.idPrefix??"mechanical-pile",o=r.map(()=>.65+.9*n()),l=o.reduce((e,t)=>e+t,0)||1,c=a-r.length,u=o.map(e=>e/l*c),d=u.map(e=>1+Math.floor(e)),p=a-d.reduce((e,t)=>e+t,0),h=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;p>0;e=(e+1)%h.length)d[h[e].index]+=1,p-=1;return r.map((e,t)=>({id:`${s}-${t}`,category:e,value:d[t]*i,mechanical:!0,unitCount:d[t],unitValue:i,share:d[t]/a}))}function I(e){let t=Math.max(2,Math.round(e.bins)),r=Math.max(1,Math.round(e.pegRows??t-1)),a=Math.max(1,Math.round(e.count??Math.max(64,4*t))),i=P(Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,0,1),n=N(e.seed??1),s=e.idPrefix??"mechanical";return Array.from({length:a},(e,t)=>{let a=0;for(let e=0;r>e;e+=1)n()<i&&(a+=1);let o=r/2;return{id:`${s}-${t}`,value:a,mechanical:!0,pegRows:r,branchProbability:i,pathRights:a,side:o>a?"left":a>o?"right":"center"}})}function D(e){let{windowSize:t,watermark:r,watermarkAtArrivalAccessor:a}=e;if(!Number.isFinite(t)||0>=t)throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:i}=F(e.data,"event"),n=i.flatMap((t,r)=>{let a=E(j(t,r,e.timeAccessor));return null==a?[]:[{datum:t,index:r,eventTime:a,arrivalTime:E(j(t,r,e.arrivalAccessor))??a,watermarkAtArrival:0,late:!1}]}),s="function"==typeof r?null:E(r?.value),o="function"==typeof r?t:E(r?.delay)??t,l=-1/0,c=-1/0;for(let e of n.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){l=Math.max(l,e.eventTime);let i="function"==typeof r?E(r(l)):l-o;c=s??Math.max(c,i??l-t);let n=a?E(j(e.datum,e.index,a)):null;e.watermarkAtArrival=n??c,e.late=e.watermarkAtArrival>=(Math.floor(e.eventTime/t)+1)*t}return{events:n,watermarkValue:n.length?c:s??-o}}function R(e,t){let r="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!r)return null;let a=Array.isArray(t.data)?t.data:[],i=Math.max(2,Math.round(E(t.bins)??21)),n=Math.max(1,Math.round(E(t.pegRows)??i-1));if(r&&(a="GaltonBoardChart"===e?I({bins:i,count:t.mechanicalCount,pegRows:n,branchProbability:t.branchProbability,seed:t.seed}):T({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),a=F(a,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){let e=/* @__PURE__ */new Map,i=t.valueAccessor??(r?"value":void 0);return a.forEach((r,a)=>{let n=(j(r,a,t.categoryAccessor??"category")??"unknown")+"",s=i?E(j(r,a,i)):1;e.set(n,(e.get(n)??0)+Math.max(0,s??0))}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){let e=a.map((e,r)=>E(j(e,r,t.valueAccessor??"value"))).filter(e=>null!=e),s=r?[0,n]:B(t.valueExtent),o=s?.[0]??(e.length?Math.min(...e):0),l=s?.[1]??(e.length?Math.max(...e):1),c=o===l?1:l-o,u=Array.from({length:i},(e,t)=>({label:t+1+"",value:0}));for(let t of e)u[Math.max(0,Math.min(i-1,Math.floor((t-o)/c*i)))].value+=1;return{generated:r,rows:u}}if("CollisionSwarmChart"===e){let e=/* @__PURE__ */new Map;return a.forEach((r,a)=>{if(null==E(j(r,a,t.xAccessor??"x")))return;let i=t.groupAccessor?(j(r,a,t.groupAccessor)??"All")+"":"All";e.set(i,(e.get(i)??0)+1)}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){let e=E(t.windows?.size??10);if(null==e||0>=e)return null;let{events:i}=D({data:a,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),n=i.map(e=>e.eventTime),s=n.length?Math.min(...n):0,o=n.length?Math.max(...n):s+e,l=Math.min(E(t.timeExtent?.[0])??s,s),c=Math.max(E(t.timeExtent?.[1])??o,o),u=Math.floor(l/e)*e,d=Math.max(1,Math.ceil((c-u+e)/e)),p=Array.from({length:d},(t,r)=>({label:`${u+r*e}-${u+(r+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(let t of i){let r=p[Math.max(0,Math.min(d-1,Math.floor((t.eventTime-u)/e)))];t.late?r.secondary+=1:r.value+=1}return{generated:r,rows:p}}return null}function O(e){let t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function L(e,t){let r=e.physics&&"object"==typeof e.physics?e.physics:null,a=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,n=[e.settledProjectionRows,e.projectionRows,a?.rows,r?.settledProjectionRows,r?.projectionRows,r?.settledProjection&&"object"==typeof r.settledProjection?r.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(n)?n.map((e,r)=>{if(!e||"object"!=typeof e)return null;let a=e,n=O(a.count??a.value??a.total??a.bodies??a.events);if(null==n)return null;let s=a.label??a.id??a.name??"container "+(r+1),o=O(a.secondary??a.secondaryCount),l=O(a.observed??a.observedCount);return{label:i(s,t),count:n,...null!=o?{secondary:o}:{},..."string"==typeof a.secondaryLabel&&a.secondaryLabel?{secondaryLabel:a.secondaryLabel}:{},...null!=l?{observed:l}:{}}}).filter(e=>null!=e):null}function q(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}function H(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}function V(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}function z(e,t){if(0>=t)return"0%";let r=e/t*100;return(10>r?Math.round(10*r)/10:Math.round(r))+"%"}function G(e,t,r,a,i,n,s=null){let o=q(e),l=s&&"EventDropChart"===e?"accepted event":H(e),c=s?s.generated?"The generated sample projection":"The source projection":"The settled projection";if(i.has("l1")&&(a.l1=V(e,t)),!i.has("l2")&&!i.has("l3"))return;if(!r||0===r.length)return void(i.has("l2")&&(a.l2=s?"No valid source records are available.":"No settled projection is loaded yet."));let u=r.reduce((e,t)=>e+t.count,0),d=r.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),p=d[0]??r.slice().sort((e,t)=>t.count-e.count)[0];if(!p)return;let h=r.reduce((e,t)=>e+(t.secondary??0),0),m=r.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(i.has("l2"))if(s&&"EventDropChart"===e)a.l2=`${c} classifies ${n(u+h)} ${U(u+h,"event")} across ${r.length} ${U(r.length,o)}: ${n(u)} accepted and ${n(h)} late.`;else if(0===d.length)a.l2=`${c} contains ${n(u)} ${U(u,l)} across ${r.length} ${U(r.length,o)}; no ${U(2,o)} are non-empty yet.`;else{let e=h>0?` ${n(h)} ${U(h,l)} ${1===h?"is":"are"} marked ${m}.`:"";a.l2=`${c} contains ${n(u)} ${U(u,l)} across ${r.length} ${U(r.length,o)}; ${d.length} ${U(d.length,o)} ${1===d.length?"is":"are"} non-empty. The largest ${o} is ${p.label} with ${n(p.count)} ${U(p.count,l)}.${e}`}if(i.has("l3")&&u>0&&d.length>0){let e=d.find(e=>e!==p),t=z(p.count,u);a.l3=e?`${c} is most concentrated in ${p.label}, which holds ${n(p.count)} ${U(p.count,l)} (${t}); ${e.label} follows with ${n(e.count)} ${U(e.count,l)}.`:`${c} is concentrated in ${p.label}, which holds all ${n(p.count)} ${U(p.count,l)}.`}}function U(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function W(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()}function J(e){return Da[e]||W(e)+" chart"}function K(e){let t,r=0;for(let[a,i]of Object.entries(e))if("number"==typeof i&&i>0){if(i>r){t=a,r=i;continue}if(i===r&&void 0!==t){let e=Va.indexOf(a),r=Va.indexOf(t);-1!==e&&(-1===r||r>e)&&(t=a)}}return t}function _(e){return"BumpChart"===e?"ranking":Fa.has(e)||"StackedAreaChart"===e?"apportioning":La.has(e)?"relating":Na.has(e)?"comparing":Ta.has(e)?"characterizing":Ba.has(e)?"tracking":Ra.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}function Q(e){if(e){if("fits"in e||"buildProps"in e){let t=e,r={};for(let[e,a]of Object.entries(t.intentScores))"number"==typeof a&&Number.isFinite(a)&&(r[e]=a);return{family:t.family,intentScores:Object.keys(r).length?r:void 0}}return e}}function X(e,t){let r=Q(t);if(r?.act)return r.act;if(r?.intentScores){let e=K(r.intentScores);if(e&&qa[e]&&(r.intentScores[e]??0)>=3)return qa[e]}return r?.family?Ha[r.family]:_(e)}function Y(e){let t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;let t=e;if("string"!=typeof t.type||!Ga.has(t.type))return!1;let r=t.provenance;return!(!r||"object"!=typeof r)&&(Ua.has(r.authorKind)||Wa.has(r.source)||Ja.has(r.basis))})}function Z(e="en"){let t,r;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?r.format(e):t.format(e):e+""}function ee(e,t,r,a){let n=0,s=0,o=1/0,l=-1/0,c=null,u=null,d=0,p=0,h=null,m=null,f=NaN,g=NaN;for(let r of e){let e=t(r);Number.isFinite(e)&&(0===n&&(f=e,h=r),g=e,m=r,o>e&&(o=e,c=r,d=n),e>l&&(l=e,u=r,p=n),n++,s+=e)}return 0===n?null:{count:n,min:o,max:l,mean:s/n,minLabel:i(null!=c?r(c):null,a),maxLabel:i(null!=u?r(u):null,a),first:f,last:g,firstLabel:i(null!=h?r(h):null,a),lastLabel:i(null!=m?r(m):null,a),minIndex:d,maxIndex:p}}function te(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}function re(e){let t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,r=t?.authorKind??t?.source??t?.basis;return"watcher"===r?"a watcher-flagged ":"agent"===r||"ai"===r||"llm-inference"===r?"an AI-suggested ":""}function ae(e){let t=Ka["string"==typeof e.type?e.type:"annotation"]||"an annotation",r=re(e),a=r?r+t.replace(/^an? /,""):t,i="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return i?`${a} labeled "${i}"`:a}function ie(e){let t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;let r=n(t.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return;let a=r.map(ae),i=a.slice(0,5),s=a.length-i.length,o=te(i)+(s>0?`, and ${s} more`:""),l=r.length;return`The author has marked ${1===l?"one feature":l+" features"} on this chart: ${o}.`}function ne(i,n,s={}){let o=void 0!==s.levels,l=new Set(s.levels??["l1","l2","l3"]);!o&&(s.capability||Y(n))&&l.add("l4");let c=v(i,n,s.recipe);if(c){let e=["l1","l2","l3","l4"].filter(e=>l.has(e));!o&&!e.includes("l4")&&e.push("l4");let t=S(c,n,{levels:e,locale:s.locale,audience:s.audience,includeCaveats:s.includeCaveats}),r=ie(n);return{...t,text:r?`${r} ${t.text}`.trim():t.text,...r?{annotations:r}:{}}}let u=Z(s.locale??"en"),d=J(i),p=Array.isArray(n.data)?n.data:null,h=a(n),m=Oa.has(i)?L(n,u):null,f=Oa.has(i)&&null===m?R(i,n):null,{measure:g,measureFallback:y,dimension:b,dimensionFallback:$}=r(i,n),w="string"==typeof g&&g?g:y,C="string"==typeof b&&b?b:$,x={};if(Oa.has(i)&&G(i,d,m??(f?L({projectionRows:f.rows},u):null),x,l,u,f),l.has("l1")&&!Oa.has(i))if("BumpChart"===i)x.l1=`A ${d} ranking ${h??"series"} by ${w} across ${C}.`;else if(Ba.has(i)||Na.has(i))x.l1=`A ${d} of ${w} by ${C}`+(h?`, split by ${h}.`:".");else if(Fa.has(i))x.l1=`A ${d} showing ${w} across ${C} categories.`;else if(Ta.has(i))x.l1=`A ${d} of the distribution of ${w}`+(h?` by ${h}.`:".");else if(Ra.has(i)){let e=Array.isArray(n.nodes)?n.nodes.length:void 0,t=Array.isArray(n.edges)?n.edges.length:void 0,r=[null!=e?`${e} ${me(e,"node")}`:null,null!=t?`${t} ${me(t,"edge")}`:null].filter(Boolean);x.l1=`A ${d}${r.length?" with "+r.join(" and "):""}.`}else if("BigNumber"===i){let e="string"==typeof n.label?n.label:w;x.l1=`A single value${e?" for "+e:""}.`}else x.l1=`A ${d}.`;let A=Ba.has(i)||"BumpChart"===i||Na.has(i)||Fa.has(i)||Ta.has(i),k=null;if((l.has("l2")||l.has("l3")||l.has("l4"))&&A&&p&&p.length>0&&(k=ee(p,e(g,y),t(b,$),u)),l.has("l2")&&A&&(p&&0!==p.length?k&&(x.l2=Fa.has(i)?`${k.count} segments totaling ${u(se(k))}. Largest is ${k.maxLabel} at ${u(k.max)}; smallest is ${k.minLabel} at ${u(k.min)}.`:`${w} ranges from ${u(k.min)} (${k.minLabel}) to ${u(k.max)} (${k.maxLabel}), with a mean of ${u(k.mean)} across ${k.count} points.`):x.l2="No data is loaded yet."),l.has("l3")&&k&&!h&&Ba.has(i)?x.l3=oe(k,w,u):l.has("l3")&&k&&!h&&Na.has(i)&&(x.l3=`The highest ${C} is ${k.maxLabel} and the lowest is ${k.minLabel}.`),l.has("l4")){let e=Y(n)?"alerting":X(i,s.capability);e&&(x.l4=le(e,i,n,h?null:k,w,C,u,s.audience))}let j=["l1","l2","l3","l4"].filter(e=>l.has(e)&&x[e]).map(e=>x[e]).join(" "),E=ie(n);return{text:E?`${E} ${j}`.trim():j,levels:x,...E?{annotations:E}:{}}}function se(e){return e.mean*e.count}function oe(e,t,r){let{first:a,last:i,min:n,max:s,maxLabel:o,minLabel:l,firstLabel:c,lastLabel:u,minIndex:d,maxIndex:p,count:h}=e,m=s-n,f=i-a;if(0===m)return`${he(t)} is constant at ${r(a)} across the series.`;if(.04>m/(Math.abs(e.mean)||1))return`${he(t)} ends roughly where it started (${r(a)} at ${c} to ${r(i)} at ${u}), ranging between ${r(n)} and ${r(s)}.`;let g=p>0&&h-1>p,y=d>0&&h-1>d,v=(s-Math.max(a,i))/m,b=(Math.min(a,i)-n)/m;return g&&v>.15?`Overall ${t} climbs to a peak of ${r(s)} (${o}), then falls to ${r(i)} (${u}).`:y&&b>.15?`Overall ${t} drops to a low of ${r(n)} (${l}), then recovers to ${r(i)} (${u}).`:.05>Math.abs(f)/m?`${he(t)} ends roughly where it started (${r(a)} at ${c} to ${r(i)} at ${u}), ranging between ${r(n)} and ${r(s)}.`:f>0?p===h-1?`Overall ${t} rises from ${r(a)} (${c}) to a peak of ${r(i)} (${u}).`:`Overall ${t} rises from ${r(a)} (${c}) to ${r(i)} (${u}), after peaking at ${r(s)} (${o}).`:d===h-1?`Overall ${t} falls from ${r(a)} (${c}) to a low of ${r(i)} (${u}).`:`Overall ${t} falls from ${r(a)} (${c}) to ${r(i)} (${u}), after dipping to ${r(n)} (${l}).`}function le(e,t,r,a,i,n,s,o){let l,c,u=za[e],d=/^[aeiou]/i.test(u)?"an":"a";switch(e){case"locating":l="This is a map",c="read values by location";break;case"presenting":l="This is a single-value display",c=`read ${"string"==typeof r.label&&r.label?r.label:i} as the headline number`;break;case"tracing":l=`This is ${d} ${u} chart`,c="follow the movement between states";break;case"nesting":l=`This is ${d} ${u} chart`,c="read it for nested structure and how children sum into their parents";break;case"relating":l=`This is ${d} ${u} chart`,c=`read it for whether ${n} and ${i} move together`;break;default:l=`This is ${d} ${u} chart`,c=ce(e,a,i,n,s,t)}return`${l}; ${c}.${pe(t,o)}`}function ce(e,t,r,a,i,n){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+r;case"comparing":return`compare ${r} across ${a}`;case"ranking":return"read it top to bottom by "+r;case"apportioning":return`read each ${a}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+r;default:return"read the highlighted features"}switch(e){case"alerting":return ue(t,i,n);case"tracking":return`read it for the trajectory of ${r}, which ${de(t)} from ${i(t.first)} (${t.firstLabel}) to ${i(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${r} across ${a}; ${t.maxLabel} leads at ${i(t.max)}`;case"ranking":return`read it top to bottom by ${r}; ${t.maxLabel} ranks highest at ${i(t.max)}`;case"apportioning":{let e=t.mean*t.count,r=e>0?Math.round(t.max/e*100):null;return`read each ${a}'s share of the ${i(e)} total; ${t.maxLabel} is the largest at ${i(t.max)}${null!=r?` (${r}%)`:""}`}case"characterizing":return`read it for the spread of ${r}, from ${i(t.min)} to ${i(t.max)}`;default:return"read the highlighted features"}}function ue(e,t,r){if(Na.has(r)||Fa.has(r))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;let{first:a,last:i,min:n,max:s,minLabel:o,maxLabel:l,lastLabel:c,minIndex:u,maxIndex:d,count:p}=e,h=s-n;if(h>0){let e=d>0&&p-1>d,r=u>0&&p-1>u,m=(s-Math.max(a,i))/h,f=(Math.min(a,i)-n)/h;if(e&&m>.15)return`the peak of ${t(s)} at ${l} is the point to investigate`;if(r&&f>.15)return`the dip to ${t(n)} at ${o} is the point to investigate`;if(i>=s)return`the climb to ${t(i)} at ${c} warrants a closer look`;if(n>=i)return`the drop to ${t(i)} at ${c} warrants a closer look`}return`the extremes — ${l} (${t(s)}) and ${o} (${t(n)}) — are the points to check`}function de(e){let t=e.max-e.min,r=e.last-e.first;return 0===t||.05>Math.abs(r)/t?"holds roughly steady":r>0?"rises":"falls"}function pe(e,t){if(!t)return"";let r=t.familiarity?.[e];return"number"!=typeof r||r>2?"":` This ${J(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}function he(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function me(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function fe(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function ge(e){return!!e&&"object"==typeof e}function ye(e,t,r,a){let i=w(t,["nominal","ordinal"]),n=t.dataRoles.filter(e=>"quantitative"===e.semanticType),s=i?b(i,r,a):void 0,o=[];s&&null!=e[s]&&o.push(e[s]+"");for(let t of n){let i=b(t,r,a);i&&null!=e[i]&&o.push(`${t.role}: ${e[i]+""}`)}return o.length>0?o.join(", "):"Data item"}function ve(e,t,r={}){let a=y(t),i=g(t),n=Math.max(1,r.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:a,config:i,locale:r.locale??"en"});let s=ge(e.navigation)?e.navigation:void 0,o=(s?.groupByRole?$(e,s.groupByRole):void 0)??(s?.groupBy?.[0]?$(e,s.groupBy[0])??e.dataRoles.find(e=>e.field===s.groupBy?.[0]):void 0)??w(e,["nominal","ordinal"]),l=o?b(o,i,a):void 0,c=(s?.idRole?$(e,s.idRole):void 0)??w(e,["identifier"]),u=c?b(c,i,a):void 0,d={id:"root",role:"chart",label:s?.summaryTemplate?C(s.summaryTemplate,void 0,e,i,a,{count:a.length}):`${e.name}: ${a.length} ${1===a.length?"item":"items"} represented.`,level:1,children:[]},p=0,h=(t,r,n)=>{let o=u?t[u]:void 0,l=s?.itemLabelTemplate?C(s.itemLabelTemplate,t,e,i,a,{count:a.length}):ye(t,e,i,a);return{id:"datum-"+fe(o??r),role:"datum",label:l,level:n,datum:t}};if(l){let e=/* @__PURE__ */new Map;for(let t of a){let r=(t[l]??"Uncategorized")+"",a=e.get(r);a?a.push(t):e.set(r,[t])}d.children=[...e].map(([e,t],r)=>{let a=t.slice(0,Math.max(0,n-p));p+=a.length;let i=a.map((e,t)=>h(e,1e5*r+t,3));return t.length>a.length&&i.push({id:"more-"+fe(e),role:"datum",label:`…and ${t.length-a.length} more items`,level:3}),{id:"group-"+fe(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:i}})}else{let e=a.slice(0,n);d.children=e.map((e,t)=>h(e,t,2)),a.length>e.length&&d.children.push({id:"more",role:"datum",label:`…and ${a.length-e.length} more items`,level:2})}return d}function be(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function $e(e,t="—"){return null==e||""===e?t:"object"==typeof e?$e(e.id??e.name??e.label,t):e+""}function we(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Ce(e){return $e(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function xe(e,t){let r=be(e,t,"children");return Array.isArray(r)?r:[]}function Ae(e,t,r){return`${e} ${1===e?t:r}`}function ke(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?", leaf total "+t(e.leafTotal):`, known leaf total ${t(e.leafTotal)} across ${Ae(e.numericLeaves,"valued leaf","valued leaves")}`}function Se(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function je(e,t,r,a){let i=t.data&&"object"==typeof t.data?t.data:null,n=t.childrenAccessor??"children",s=t.valueAccessor??"value",o=t.nodeLabel??t.nodeIdAccessor,l=/* @__PURE__ */new WeakMap,c=/* @__PURE__ */new WeakSet,u=e=>{let t=l.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);let r,a=xe(e,n);if(0===a.length){let t=we(be(e,s,"value"));r={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else r=a.reduce((e,t)=>{let r=u(t);return{descendants:e.descendants+1+r.descendants,depth:Math.max(e.depth,r.depth+1),leaves:e.leaves+r.leaves,numericLeaves:e.numericLeaves+r.numericLeaves,leafTotal:e.leafTotal+r.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),l.set(e,r),r},d=0,p=(e,t,i,l)=>{let c=$e(be(e,o,"name"),"item "+i);if(l.has(e))return{id:`hierarchy-${Ce(i)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};let h=xe(e,n),m=u(e);if(0===h.length){if(d>=r)return null;d+=1;let n=we(be(e,s,"value"));return{id:`hierarchy-${Ce(i)}-${Ce(c)}`,role:"datum",level:t,label:`${c}${null==n?"":": "+a(n)}.`,...null==n?{}:{value:n},datum:e}}let f=new Set(l);f.add(e);let g=[],y=0;for(let[e,a]of h.entries()){if(d>=r){y+=u(a).leaves;continue}let n=p(a,t+1,`${i}-${e}`,f);n&&g.push(n)}return y>0&&g.push({id:`hierarchy-${Ce(i)}-more`,role:"datum",level:t+1,label:`${Ae(y,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${r}.`}),{id:`hierarchy-${Ce(i)}-${Ce(c)}`,role:"series",level:t,label:`${c}: ${Ae(h.length,"direct child","direct children")}, ${Ae(m.descendants,"total descendant","total descendants")}, ${Ae(m.leaves,"leaf","leaves")}${ke(m,a)}.`,datum:e,children:g}},h=i?u(i):null,m={id:"root",role:"chart",level:1,label:i?`A ${Se(e)} chart with ${Ae(h.leaves,"leaf","leaves")} and ${Ae(h.descendants,"total descendant","total descendants")} across ${Ae(h.depth,"hierarchy level","hierarchy levels")}${ke(h,a)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(i){let e=p(i,2,"root",/* @__PURE__ */new Set);if(e){let t=$e(be(i,o,"name"),"");m.children="series"===e.role&&""===t?e.children:[e]}}return m}function Ee(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function Pe(e,t="—"){return null==e||""===e?t:"object"==typeof e?Pe(e.id??e.name??e.label,t):e+""}function Me(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Be(e){return Pe(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Ne(e){let t=[];return(e.linkedHover||e.selection||e.linkedBrush)&&t.push("Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&t.push("Hover or focus a mark for its details."),t.length>0?" "+t.join(" "):""}function Fe(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];let t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}function Te(e,t,r){let a=Ee(e,t,r);if(void 0!==a)return a;let i=e.properties;return i&&"object"==typeof i?Ee(i,t,r):void 0}function Ie(e,t,r){return Pe(Te(e,t,"id")??Te(e,"name","name")??Te(e,"NAME","NAME")??Te(e,"label","label"),r)}function De(e){let t=0,r=1/0,a=-1/0,i=0;for(let n of e)null!=n.value&&(t+=1,r=Math.min(r,n.value),a=Math.max(a,n.value),i+=n.value);return 0===t?null:{count:t,min:r,max:a,total:i,average:i/t}}function Re(e,t){let r=De(e);return r?`range ${t(r.min)} to ${t(r.max)}, average ${t(r.average)}, total ${t(r.total)}`:"no numeric values"}function Oe(e){let t=e.filter(e=>null!=e.value),r=e.filter(e=>null==e.value),a=[],i=De(t);if(i)if(i.min===i.max)a.push({id:"equal",label:"Equal values",rows:t});else{let e=i.min+(i.max-i.min)/3,r=i.min+2*(i.max-i.min)/3,n=t.filter(e=>e.value>=r),s=t.filter(t=>t.value>=e&&r>t.value),o=t.filter(t=>e>t.value);n.length>0&&a.push({id:"highest",label:"Highest values",rows:n}),s.length>0&&a.push({id:"middle",label:"Middle values",rows:s}),o.length>0&&a.push({id:"lowest",label:"Lowest values",rows:o})}return r.length>0&&a.push({id:"missing",label:"No numeric value",rows:r}),a}function Le(e,t,r){let a,i=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),n=/* @__PURE__ */new Map,s=0;for(let[e,t]of i.entries())a!==t.value&&(s=e+1,a=t.value),n.set(t.index,s);let o=0;return Oe(e).map(e=>{let a=e.rows.slice(0,Math.max(0,t-o));o+=a.length;let s=a.map(e=>{let t=n.get(e.index),a=null==t||2>i.length?"":`, rank ${t} of ${i.length}`;return{id:`geo-${Be(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?e.label+": no numeric value.":`${e.label}: ${r(e.value)}${a}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),l=e.rows.length-a.length;return l>0&&s.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${l} more ${1===l?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:"regions-"+e.id,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${Re(e.rows,r)}.`,children:s}})}function qe(e,t,r,a){let i=Fe(t.areas),n="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],s=Array.isArray(t.flows)?t.flows:[],o=Array.isArray(t.lines)?t.lines:[],l=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?i:n).map((r,a)=>({datum:r,index:a,label:Ie(r,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${a+1}`),value:Me(Te(r,l,"value"))})),d=u.filter(e=>null!=e.value),p={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${i.length} regions.${d.length>0?` Values are available for ${d.length} of ${i.length} regions; ${Re(d,a)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${s.length} flows and ${n.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${n.length} locations and ${o.length} routes.`:`A proportional-symbol map with ${n.length} locations.`}${Ne(t)}`,children:[]};if("ChoroplethMap"===e)p.children=Le(u,r,a);else if(u.length>0){let e=u.slice(0,r).map(e=>({id:`geo-${Be(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":": "+a(e.value)}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>r&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-r} more locations.`}),p.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}let h="FlowMap"===e?s:o;if(h.length>0){let e=h.slice(0,r).map((e,t)=>{let r=Pe(e.source,"unknown"),i=Pe(e.target,"unknown"),n=Me(Ee(e,l,"value"));return{id:`route-${Be(r)}-${Be(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==n?"":": "+a(n)}.`,...null==n?{}:{value:n},datum:e}});p.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${h.length} ${1===h.length?"route":"routes"}.`,children:e})}return p}function He(e,t={},r={}){return!!v(e,t,r.recipe)||_a.has(e)||Qa.has(e)||Xa.has(e)||Ba.has(e)||Na.has(e)||Fa.has(e)||Ta.has(e)}function Ve(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function ze(e,t="—"){return null==e||""===e?t:"object"==typeof e?ze(e.id??e.name??e.label,t):e+""}function Ge(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Ue(e){return ze(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function We(e,t){let r=[];return(e.linkedHover||e.selection||e.linkedBrush)&&r.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&r.push("Hover or focus a mark for its details."),r.length>0?" "+r.join(" "):""}function Je(e,t){t&&e.children?.push(t)}function Ke(e,t,r,a){let i=Array.isArray(t.nodes)?t.nodes:[],n=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],s=t.nodeIdAccessor??t.nodeIDAccessor,o=t.sourceAccessor??"source",l=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>ze(Ve(e,s,"id"),"unknown"),d=(e,t)=>ze(Ve(e,t,""),"unknown"),p=/* @__PURE__ */new Set;for(let e of n)p.add(d(e,o)),p.add(d(e,l));let h=i.length>0?i:[...p].map(e=>({id:e})),m=/* @__PURE__ */new Map;for(let e of h)m.set(u(e),{links:0,value:0});for(let e of n){let t=d(e,o),r=d(e,l),a=Ge(Ve(e,c,"value"))??0;for(let e of[t,r]){let t=m.get(e)??{links:0,value:0};t.links+=1,t.value+=a,m.set(e,t)}}let f={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${h.length} nodes and ${n.length} links.${We(t,"network")}`,children:[]},g=0,y=/* @__PURE__ */new Map,v=t.colorBy??"group";for(let e of h){let t=ze(Ve(e,v,"group"),"Ungrouped"),r=y.get(t);r?r.push(e):y.set(t,[e])}let b=[...y].map(([e,t],i)=>{let n=[];for(let[e,s]of t.entries()){if(g>=r)break;g+=1;let t=u(s),o=m.get(t)??{links:0,value:0},l=o.value>0?`, ${a(o.value)} total flow`:"";n.push({id:`node-${i}-${e}-${Ue(t)}`,role:"datum",level:3,label:`${t}: ${o.links} ${1===o.links?"link":"links"}${l}.`,value:o.value>0?o.value:void 0,datum:s})}return{id:`nodes-${i}-${Ue(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:n}});b.length>0&&f.children?.push(...b);let $=n.slice(0,r).map((e,t)=>{let r=d(e,o),i=d(e,l),n=Ge(Ve(e,c,"value"));return{id:`link-${Ue(r)}-${Ue(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==n?"":": "+a(n)}.`,value:n,datum:e}});return n.length>r&&$.push({id:"links-more",role:"datum",level:3,label:`…and ${n.length-r} more links.`,value:void 0}),$.length>0&&f.children?.push({id:"links",role:"series",level:2,label:`Links: ${n.length} ${1===n.length?"connection":"connections"}.`,children:$}),f}function _e(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Qe(e,t){let r=Array.isArray(e.annotations)?e.annotations:null;if(!r)return null;let a=n(r.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return null;let i=0,s=a.slice(0,t).map(e=>{let t=e.lifecycle?.status,r=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+i++,role:"annotation",level:3,label:`${_e(ae(e))}${r}.`,datum:e}});a.length>t&&s.push({id:"annotation-"+i++,role:"annotation",level:3,label:`…and ${a.length-t} more annotations.`});let o=a.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===o?"one marked feature":o+" marked features"}.`,children:s}}function Xe(n,s,o={}){let l=o.locale??"en",c=Math.max(1,o.maxLeaves??200),u=Z(l),d=v(n,s,o.recipe);if(d)return ve(d,s,{maxLeaves:c,locale:l});let p={id:"root",role:"chart",label:ne(n,s,{locale:l}).text||"Chart.",level:1,children:[]},h=Qe(s,c);if(_a.has(n)){let e=Ke(n,s,c,u);return Je(e,h),e}if(Qa.has(n)){let e=je(n,s,c,u);return Je(e,h),e}if(Xa.has(n)){let e=qe(n,s,c,u);return Je(e,h),e}let m=Array.isArray(s.data)?s.data:null,f=He(n,s,o);if(!m||0===m.length||!f)return h&&(p.children=[h]),p;let{measure:g,measureFallback:y,dimension:b,dimensionFallback:$}=r(n,s),w=e(g,y),C=t(b,$),x="string"==typeof g&&g?g:y,A="string"==typeof b&&b?b:$,k=a(s),S=0,j=e=>`${e}-${S++}`,E=(e,t)=>{let r=w(e),a=i(C(e),u);return{id:j("datum"),role:"datum",level:t,label:`${a}: ${Number.isFinite(r)?u(r):"—"}`,value:Number.isFinite(r)?r:void 0,datum:e}},P=(e,t)=>{let r=e.slice(0,c).map(e=>E(e,t));return e.length>c&&r.push({id:j("more"),role:"datum",level:t,label:`…and ${e.length-c} more points`}),r},M=[];if(Ba.has(n)||Na.has(n)){let e=1/0,t=-1/0,r=1/0,a=-1/0,s=[],o=!0;for(let i of m){let n=w(i);Number.isFinite(n)&&(e>n&&(e=n),n>t&&(t=n));let l=C(i);s.push(l),"number"==typeof l&&Number.isFinite(l)?(r>l&&(r=l),l>a&&(a=l)):o=!1}let l=/* @__PURE__ */new Set,c=[];for(let e of s){let t=e+"";l.has(t)||(l.add(t),c.push(e))}let d=o?`${u(r)} to ${u(a)}`:`${i(c[0],u)} to ${i(c[c.length-1],u)} (${Na.has(n)?c.length+" categories":m.length+" points"})`;M.push({id:j("axis"),role:"axis",level:2,label:`${Na.has(n)?"Category axis":"X axis"}: ${A}, ${d}.`}),t>=e&&M.push({id:j("axis"),role:"axis",level:2,label:`Value axis: ${x}, ${u(e)} to ${u(t)}.`})}if(k){let e=t(k,k),r=/* @__PURE__ */new Map;for(let t of m){let a=(e(t)??"—")+"",i=r.get(a);i?i.push(t):r.set(a,[t])}let a=[];for(let[e,t]of r){let r=ne(n,{...s,data:t},{levels:["l2","l3"],locale:l}).text;a.push({id:j("series"),role:"series",level:2,label:`Series ${e}: ${r}`,children:P(t,3)})}p.children=[...M,...a]}else p.children=[...M,...P(m,2)];return h&&p.children.push(h),p}function Ye(e){return Ya.has(e)}function Ze(e,t){return Ye(e)&&!Za[t].includes(e)}function et(e){return"string"==typeof e&&e.trim().length>0}function tt(e,t,r){let a=ti.has(e)||void 0!==r&&ri.has(r),i=t=>Ze(e,t)||a,n=ei.filter(e=>et(t[e])&&!i(e));return{hasTitle:i("title")&&et(t.title),hasDescription:i("description")&&et(t.description),hasSummary:i("summary")&&et(t.summary),unsupportedFinding:n.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${n.join(" and ")} text was supplied, but ${1===n.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}}function rt(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 r=t.fill;return"object"==typeof r&&null!==r&&"hatch"===r.type})}function at(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=>ai.has(e))}function it(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));let r=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!r)return null;let[a,i,n]=[parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255],s=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*s(a)+.7152*s(i)+.0722*s(n)}function nt(e,t){let r=it(e),a=it(t);return null===r||null===a?null:(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}function st(e){return"string"==typeof e?.type?e.type:""}function ot(e){return!!e&&"object"==typeof e&&ii.has(st(e))}function lt(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}function ct(e){return ni.has(st(e))&&!lt(e)}function ut(e){let t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}function dt(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=ut(e)}function pt(e){let t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),r=e.trim().split(/\s+/).filter(Boolean);if(0===r.length||0===t.length)return null;let a=0;for(let e of r)a+=ht(e);return r.length/t.length*.39+a/r.length*11.8-15.59}function ht(e){let t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;let r=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return r?r.length:1}function mt(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}function ft(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function gt(e){let t=ft(e),r=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===r.pause||"function"==typeof r.pause}function yt(e){let t=ft(e);return!0===e.settledProjection||!0===t.settledProjection}function vt(e){let t=ft(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}function bt(e){let t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},r=e.colorScheme,a="string"==typeof e.background?e.background:null;if(a&&!a.startsWith("#"))return{...t,status:"manual",message:`Background "${a}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};let i=a??"#ffffff";if(!Array.isArray(r))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};let n=[],s=0;for(let e of r){if("string"!=typeof e||!e.startsWith("#"))continue;let t=nt(e,i);null!=t&&(s++,3>t&&n.push(`${e} (${t.toFixed(1)}:1)`))}return 0===s?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:n.length>0?{...t,status:"fail",message:`${n.length} color(s) fall below 3:1 contrast vs ${i}: ${n.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${s} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${i}.`}}function $t(e,t,r={}){let a=[],i=h(e),n=ui.has(e),s=Ye(e)||!!i||n,o=!0===r.inChartContainer,l=!0===r.describe,c=!0===r.navigable,u=li.has(e),d=si.has(e),{hasTitle:p,hasDescription:m,hasSummary:f,unsupportedFinding:g}=tt(e,t,i?.frameFamily),y=!1!==t.accessibleTable&&!u,v=p||m||f,b=mt(t),$=gt(t),w=n,C=yt(t)||pi.has(e)&&y,x=vt(t)||w,A=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],k=s?"pass":"manual",S=s?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(g&&a.push(g),a.push(bt(t)),a.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...u?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:y?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:m&&f?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}}),a.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),a.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||di.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,r=rt(t);a.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...e?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:r?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:r?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}});let i=at(t.colorScheme);a.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...i?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),a.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:r?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:r?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{let e=A.filter(ot);if(e.length>0){let r=t.autoPlaceAnnotations,i="object"==typeof r&&null!==r&&!0===r.redundantCues,n=e.filter(e=>{if("string"!=typeof e.color)return!1;let t=st(e),r=i&&"text"===t;return!(ct(e)||r)});a.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===n.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${n.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}a.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...s?{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&&a.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{let r=gi[e];if(r&&b){let e=t[r];"number"==typeof e&&e>0&&24>2*e&&a.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${r}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}a.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:k,message:`The chart takes a single tab stop and navigates data with arrow keys${S} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),a.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...b?f||m?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),a.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:k,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${S}.`}),a.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:k,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${S}.`,fix:s?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),a.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...v?{status:"pass",message:`Provided: ${[p&&"title",m&&"description",f&&"summary"].filter(Boolean).join(", ")}.`}:o?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),a.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...m||f?{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."}:p?{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(et).join(". "),r=e?pt(e):null;a.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==r?{status:"not-applicable",message:"No description/summary text to grade."}:r>9?{status:"warn",message:`Description/summary reads at ~grade ${r.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(r))} (≤ 9).`}})}if(ci.has(e)){let e=et(t.xLabel),r=et(t.yLabel);a.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&r?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!r&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(mi.has(e)&&a.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),A.length>1){let e=A.filter(dt).length;a.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===A.length?{status:"pass",message:`All ${A.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:A.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:`${A.length-e} of ${A.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&a.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&a.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:k,message:`Transitions animate with object constancy and data changes are mirrored to the live region${S}.`,fix:s?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),a.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),a.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),a.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:k,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${S}.`,fix:s?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),a.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...u?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:y?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}}),u||a.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...o?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),a.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:s?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${s?"":S}.`,fix:s?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),a.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...c?d?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:d?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:k,message:`Keyboard navigation steps through points and switches series/groups${S}.`,fix:s?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}});{let r,i=Array.isArray(t.data)?t.data:null,n=Array.isArray(t.nodes)?t.nodes:null,s={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};r=oi.has(e)&&i&&i.length>7?{...s,status:"warn",message:i.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.'}:n&&n.length>200?{...s,status:"warn",message:n.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."}:i&&i.length>5e3?{...s,status:"warn",message:i.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."}:i?{...s,status:"pass",message:i.length+" data points — a reasonable density for non-visual consumption."}:n?{...s,status:"pass",message:n.length+" nodes — a reasonable density for non-visual consumption."}:{...s,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},a.push(r)}{let e=Array.isArray(t.data)?t.data:null,r=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]),i=!1;if(e&&!r)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){i=!0;break}if(i)break}i&&a.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}a.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...l?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:f?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),a.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...u?{status:"not-applicable",message:"Single value — nothing to skip."}:y?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}}),a.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:k,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${S}.`,fix:s?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),a.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...di.has(e)||hi.has(e)?$?{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:k,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${S}.`}}),n&&(a.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...$?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),a.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...C?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),a.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...x?{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 r=!0===t.responsiveWidth||!0===t.responsiveHeight,i=fi.has(e)&&!0===t.zoomable;a.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...r?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:i?{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."}})}i&&(i.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length))&&a.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:i.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"===i.accessibility.description&&!m&&a.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:i.name+" requires a recipe-aware description, but none is attached.",fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),i.accessibility.fallbackTable&&!1===t.accessibleTable&&a.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:i.name+" requires a fallback table, but accessibleTable is disabled.",fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."}));let j=a.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),E={criticalsPassed:j.filter(e=>"pass"===e.status).length,criticalsEvaluated:j.length,fails:a.filter(e=>"fail"===e.status).length,warnings:a.filter(e=>"warn"===e.status).length,manual:a.filter(e=>"manual"===e.status).length,passes:a.filter(e=>"pass"===e.status).length};return{component:e,ok:!j.some(e=>"fail"===e.status),summary:E,findings:a,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 wt(e,t){return!0===e?.supportsAccessibleTable&&!1!==t.accessibleTable}function Ct(e){return"string"==typeof e&&e.trim().length>0}function xt(e){let t=e?.streamStatus;return t?(Array.isArray(t)?t:[t]).filter(e=>!!e&&"string"==typeof e.status).slice(-(e?.streamHistoryLimit??5)):[]}function At(e){if(0===e.length)return;let t=e.map(e=>"idle"===e.status?"no data received":"active"===e.status?"receiving data":"not receiving new data"),r=[...new Set(t)],a=1===r.length?r[0]:t.join(", then ");return`Last ${e.length} stream ${1===e.length?"status":"statuses"}: ${a}.`}function kt(e,t){return e?!e.supportsLegend||!1===t.showLegend||!0!==t.showLegend&&null==t.legend&&!["colorBy","lineBy","areaBy","stackBy","groupBy"].some(e=>null!=t[e])?"not-applicable":"isolate"===t.legendInteraction||"highlight"===t.legendInteraction?"built-in":"not-enabled":"unsupported"}function St(e,t){return e?"delegated"===e.markNavigation||"not-applicable"===e.markNavigation?e.markNavigation:t?"built-in":"unsupported":"unsupported"}function jt({component:e,props:t,options:r={}}){let a=yi[e],i=a?a.realtime:!0===r.realtime,n=ne(e,t,{...r.locale?{locale:r.locale}:{}}),s=He(e,t),o=s||!0===a?.recipeNavigation,l=s&&!1!==r.navigable?Xe(e,t,{...r.locale?{locale:r.locale}:{}}):void 0,c=$t(e,t,{inChartContainer:!0===r.inChartContainer,describe:!0===r.describe||Ct(t.summary),navigable:!1!==r.navigable&&o}),u=i?xt(r):[],d=St(a,o);return{schemaVersion:1,component:e,text:{...Ct(t.title)?{title:t.title}:{},...Ct(t.description)?{description:t.description}:{},...Ct(t.summary)?{summary:t.summary}:{},accessibleTable:wt(a,t)},keyboard:{markNavigation:d,legendInteraction:kt(a,t),focusRing:d},navigation:{supported:o,composition:"chart-container",...l?{tree:l}:void 0,...l?{}:{note:o?s?"Structured datum navigation is available through ChartContainer; enable its navigable option to materialize the tree.":"Structured datum navigation is declared for this built-in recipe; load its recipe manifest through semiotic/ai before materializing the tree.":"No datum-level structured navigation is registered for this chart. Exact-value table access may still be available."}},table:{enabled:wt(a,t),source:"scene",pagination:"built-in"},mediaPreferences:{reducedMotion:a?"built-in":"unknown",forcedColors:a?"css-custom-properties":"unknown",note:a?"Runtime detection is available through useReducedMotion and useHighContrast; canvas styling uses CSS custom properties so forced-colors changes cascade.":"No generated runtime capability record exists for this component; media-preference support is unknown."},streamStatus:i?{supported:!0,status:u.at(-1)?.status??"idle",lastPushTime:u.at(-1)?.lastPushTime??null,history:u,historyLimit:r.streamHistoryLimit??5,...At(u)?{accessibleDescription:At(u)}:{},note:"Hosts may expose this bounded, non-visible description to screen readers or agents. Do not render it in visible UI."}:{supported:!1,note:"Static chart; no push-ingest lifecycle."},ssr:!0===a?.supportsSSR?{supported:!0,evidence:r.ssrEvidence,note:r.ssrEvidence?"Server rendering is registered and attached render evidence records the observed scene.":"Server rendering is registered; supply renderChartWithEvidence output before claiming a non-empty scene."}:{supported:!1,...r.ssrEvidence?{evidence:r.ssrEvidence}:{},note:i?"Live push charts intentionally omit static SSR; capture a supported bounded-window static twin before claiming server evidence.":a?"The chart capability registry does not expose this component through renderChart; do not claim server evidence for the HOC surface.":"No generated capability record exists for this component; SSR support is unknown and therefore reported as unsupported."},evidence:{audit:c,description:n}}}function Et(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Pt(e){return Et(e)?e:void 0}function Mt(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function Bt(e){let t=Mt(e);return null==t?void 0:Math.max(0,Math.floor(t))}function Nt(...e){return e.map(Pt).find(Boolean)}function Ft(...e){return e.find(Array.isArray)}function Tt(e){let t={};for(let[r,a]of Object.entries(e))void 0!==a&&(t[r]=a);return t}function It(e,t,r){return e["string"==typeof t&&t?t:r]}function Dt(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function Rt(e,t,r){let a=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&a.push(`Current value is ${Dt(t.value)}.`);let e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,r="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;a.push(`The gauge scale runs from ${Dt(e)} to ${Dt(r)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){let i=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&a.push(`The ProcessSankey time domain runs from ${Dt(t.domain[0])} to ${Dt(t.domain[1])}.`),i.length>0){a.push(`${i.length} source flow${1===i.length?"":"s"} are supplied.`);for(let n of i.slice(0,r)){let r=It(n,t.sourceAccessor,"source"),i=It(n,t.targetAccessor,"target"),s=It(n,t.valueAccessor,"value");a.push("ProcessSankey"!==e||null==n.startTime&&null==n.endTime?`${Dt(r)} to ${Dt(i)} has value ${Dt(s)}.`:`${Dt(r)} to ${Dt(i)} has value ${Dt(s)} over ${Dt(n.startTime)}–${Dt(n.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){let e=Pt(t.data),i="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",n="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",s="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",o=[],l=e=>{let t=Array.isArray(e[i])?e[i]:[];if(0!==t.length)for(let e of t){let t=Pt(e);t&&l(t)}else o.push(e)};if(e&&l(e),o.length>0){a.push(o.length+" hierarchy leaves are supplied.");for(let e of o.slice(0,r))a.push(`${Dt(e[s])} has value ${Dt(e[n])}.`)}}if(vi.has(e)&&Array.isArray(t.data)){let r=t.data;a.push(`${r.length} observed source row${1===r.length?"":"s"} are supplied.`);let i="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,n="CollisionSwarmChart"===e?"x":"value",s=r.map(e=>Mt(It(e,i,n))).filter(e=>null!=e);s.length>0&&a.push(`Observed ${"string"==typeof i?i:n} ranges from ${Dt(Math.min(...s))} to ${Dt(Math.max(...s))}.`)}if(0!==a.length)return{source:"chart-props",statements:a,text:"Exact chart-prop facts: "+a.join(" ")}}function Ot(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Lt(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function qt(e,t,r,a){let i=Pt(e.settledProjection),n=Pt(t?.settledProjection);return Ft(r?.projectionRows,r?.aggregates,e.settledProjectionRows,e.projectionRows,i?.rows,t?.settledProjectionRows,t?.projectionRows,n?.rows,a?.binCounts)}function Ht(e){if(!e||0===e.length)return;let t=e.map((e,t)=>{let r=Pt(e);if(!r)return;let a=Mt(r.count??r.value??r.total??r.bodies??r.events);if(null==a)return;let i=(r.label??r.id??r.name??"container "+(t+1))+"",n=null==r.id?void 0:r.id+"",s=Mt(r.secondary??r.secondaryCount),o=Mt(r.observed??r.observedCount);return Tt({id:n,label:i,count:a,secondary:s,secondaryLabel:"string"==typeof r.secondaryLabel?r.secondaryLabel:void 0,observed:o})}).filter(e=>null!=e);if(0===t.length)return;let r=t.reduce((e,t)=>e+t.count,0),a=t.filter(e=>e.count>0).length,i=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:r,populatedCount:a,...i?{leader:i}:{}}}function Vt(e,t){let r=e?.map((e,t)=>{let r=Pt(e);if(!r)return;let a=Mt(r.count)??0,i=Mt(r.total),n={label:(r.label??r.id??"sediment "+(t+1))+"",count:a};return null!=r.id&&(n.id=r.id+""),null!=i&&(n.total=i),n}).filter(e=>null!=e),a=Bt(t?.bins)??r?.length??0,i=Mt(t?.count)??r?.reduce((e,t)=>e+t.count,0)??0,n=Mt(t?.total)??r?.reduce((e,t)=>e+(t.total??0),0),s=r?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==a||0!==i||n)return{bins:a,count:i,...null!=n&&n>0?{total:n}:{},...s?{leader:s}:{}}}function zt(e){let t=Pt(e);return!!t&&(Et(t.world)||"simulationState"in t||"liveBodyOrder"in t)}function Gt(e){if(e)return e.filter(e=>!0===Pt(e)?.sleeping).length}function Ut(e,t,r){let a=e?.filter(e=>!0===Pt(e)?.sensor).length,i=Pt(t?.observation),n=Pt(i?.sensors),s=Ft(r?.activeSensors);return Math.max(a??0,n?Object.keys(n).length:0,s?.length??0)||void 0}function Wt(e){let t=[],r=e.simulation,a=[r.state??(r.settled?"settled":void 0),null!=r.liveBodies?`${r.liveBodies} live ${Ot(r.liveBodies,"body")}`:void 0,null!=r.sleepingBodies?r.sleepingBodies+" sleeping":void 0,null!=r.queued?r.queued+" queued":void 0,null!=r.seed?"seed "+Lt(r.seed):void 0,r.gravity?`gravity (${Lt(r.gravity.x)}, ${Lt(r.gravity.y)})`:void 0,null!=r.fixedDt?`fixed step ${Lt(r.fixedDt)}s`:void 0,null!=r.timeScale?Lt(r.timeScale)+"x time":void 0].filter(Boolean);a.length>0&&t.push(`Physics simulation: ${a.join("; ")}.`);let i=e.geometry;if(i){let e=[null!=i.colliders?`${i.colliders} ${Ot(i.colliders,"collider")}`:void 0,null!=i.sensors?`${i.sensors} ${Ot(i.sensors,"sensor")}`:void 0,null!=i.springs?`${i.springs} ${Ot(i.springs,"spring")}`:void 0,null!=i.activeSensorPairs?`${i.activeSensorPairs} active sensor ${Ot(i.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}let n=e.aggregates;if(n){let e=n.leader,r=e?` Largest is ${e.label} with ${Lt(e.count)}.`:"";t.push(`Physics aggregates: ${Lt(n.totalCount)} settled ${Ot(n.totalCount,"body")} across ${n.rows.length} ${Ot(n.rows.length,"container")}; ${n.populatedCount} populated.${r}`)}let s=e.sediment;if(s){let e=null!=s.total?", value total "+Lt(s.total):"",r=s.leader?`; largest sediment bin is ${s.leader.label} with ${Lt(s.leader.count)}`:"";t.push(`Physics sediment: ${s.count} retained ${Ot(s.count,"body")} in ${s.bins} ${Ot(s.bins,"bin")}${e}${r}.`)}return t.join(" ")}function Jt(e,t,r){if(!1===r)return;let a=Et(r)?r:void 0,i=Pt(t.physics),n=Nt(a?.snapshot,i?.snapshot,t.physicsSnapshot,zt(t.snapshot)?t.snapshot:void 0),s=Nt(a?.evidence,i?.evidence,t.physicsEvidence,t.settledEvidence),o=Nt(a?.config,i?.config,n?.config,t.config),l=Nt(Pt(n?.world),Pt(i?.world)),c=Nt(Pt(o?.kernel),Pt(l?.options)),u=Ft(l?.bodies),d=Ft(l?.colliders,o?.colliders),p=Ft(n?.queue,i?.queue),h=Ft(n?.liveBodyOrder),m=Ft(l?.springs),f=Ft(n?.activeSensorPairs),g=Ht(qt(t,i,a,s)),y=Vt(Ft(a?.sediment,i?.sediment,n?.sediment),Nt(a?.sedimentTotals,i?.sedimentTotals)),v=h?.length??u?.length??Bt(s?.bodyCount),b=Gt(u)??Bt(s?.sleepingCount),$=p?.length,w="string"==typeof n?.simulationState?n.simulationState:void 0,C="boolean"==typeof s?.settled?s.settled:w?"settled"===w:null!=v||null!=b||null!=$?null!=v&&b===v&&0===($??0):void 0,x=Pt(c?.gravity),A=Mt(x?.x),k=Mt(x?.y),S=Tt({state:w,settled:C,elapsedSeconds:Mt(n?.elapsedSeconds),paused:"boolean"==typeof n?.paused?n.paused:void 0,visible:"boolean"==typeof n?.visible?n.visible:void 0,seed:Mt(c?.seed),gravity:null!=A&&null!=k?{x:A,y:k}:void 0,fixedDt:Mt(o?.fixedDt??c?.fixedDt),timeScale:Mt(o?.timeScale),maxSubsteps:Bt(o?.maxSubsteps),liveBodies:v,sleepingBodies:b,queued:$,bodyLimit:Mt(o?.bodyLimit),eviction:"string"==typeof o?.eviction?o.eviction:void 0}),j=Tt({colliders:d?.length,sensors:Ut(d,o,l),springs:m?.length,activeSensorPairs:f?.length}),E=Object.keys(j).length>0,P=vi.has(e);if(!(Object.keys(S).length>0||E||g||y)||!P&&null==r)return;let M={simulation:S,...E?{geometry:j}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},B=Wt(M);return{...M,text:B}}function Kt(e){return e?"fits"in e||"buildProps"in e?{family:e.family}:{family:e.family,intentScores:e.intentScores}:{}}function _t(e,t,r={}){let a,{capability:i,audience:n,locale:s}=r,o=r.levels??["l1","l2","l3"],l=!1!==r.includeStructure,c=X(e,i),u=ne(e,t,{levels:c?[...o,"l4"]:o,locale:s,capability:i,audience:n}),{l4:d,...p}=u.levels,h=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),m={levels:p,text:u.annotations?`${u.annotations} ${h}`.trim():h,...u.annotations?{annotations:u.annotations}:{}};if(c&&d){let e=Kt(i);a={act:c,sentence:d,family:e.family,intentScores:e.intentScores}}let f=l?Xe(e,t,{maxLeaves:r.maxLeaves,locale:s}):void 0,g=Jt(e,t,r.physics),y=Rt(e,t,Math.max(1,r.maxLeaves??200)),v=[m.text,a?.sentence,g?.text,y?.text].filter(Boolean).join(" ");return{component:e,description:m,intent:a,structure:f,physics:g,facts:y,text:v}}function Qt(e){return"number"==typeof e?Number.isFinite(e)?"numeric":"unknown":e instanceof Date?"date":"string"==typeof e?bi.test(e)&&!Number.isNaN(Date.parse(e))?"date":$i.test(e)&&Number.isFinite(Number(e))?"numeric":"categorical":"boolean"==typeof e?"categorical":"unknown"}function Xt(e){let t=e.length;if(0===t)return NaN;let r=t>>1;return t%2==0?(e[r-1]+e[r])/2:e[r]}function Yt(e,t={}){let{maxDistinct:r=10,sampleSize:a=5,keyScanRows:i=100}=t;if(!Array.isArray(e)||0===e.length)return{rowCount:0,fields:{},sample:[]};let n=/* @__PURE__ */new Set,s=Math.min(e.length,i);for(let t=0;s>t;t++){let r=e[t];if(r&&"object"==typeof r)for(let e of Object.keys(r))n.add(e)}let o={};for(let t of n){let a=[];for(let r=0;e.length>r;r++){let i=e[r]?.[t];null!=i&&a.push(i)}if(0===a.length){o[t]={type:"unknown"};continue}let i=Qt(a[0]);if("numeric"===i){let e=[],r=1/0,i=-1/0,n=0;for(let t=0;a.length>t;t++){let s=Number(a[t]);Number.isFinite(s)&&(e.push(s),r>s&&(r=s),s>i&&(i=s),n+=s)}if(0===e.length){o[t]={type:"unknown"};continue}e.sort((e,t)=>e-t),o[t]={type:"numeric",min:r,max:i,mean:n/e.length,median:Xt(e)}}else if("date"===i){let e=1/0,r=-1/0;for(let t=0;a.length>t;t++){let i=a[t],n=i instanceof Date?i.getTime():Date.parse(i);Number.isFinite(n)&&(e>n&&(e=n),n>r&&(r=n))}if(e===1/0){o[t]={type:"unknown"};continue}o[t]={type:"date",min:new Date(e).toISOString(),max:new Date(r).toISOString()}}else if("categorical"===i){let e=/* @__PURE__ */new Map;for(let t=0;a.length>t;t++){let r=a[t]+"";e.set(r,(e.get(r)??0)+1)}let i=[...e.entries()].sort((e,t)=>t[1]-e[1]).slice(0,r).map(([e,t])=>({value:e,count:t}));o[t]={type:"categorical",distinctCount:e.size,topValues:i,distinctValues:e.size>r?void 0:i.map(e=>e.value)}}else o[t]={type:"unknown"}}return{rowCount:e.length,fields:o,sample:e.slice(0,a)}}function Zt(e,t,r){let a={numbers:r?[]:void 0,finite:0,min:1/0,max:-1/0,missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(let r of e){let e,i=r?.[t];if(null!=i&&""!==i){if("number"==typeof i)e=i;else if("string"==typeof i){let t=i.trim();if(""===t){a.missing++;continue}let r=Number(t);Number.isNaN(r)?/^[+-]?nan$/i.test(t)&&(e=r):e=r}void 0!==e?Number.isFinite(e)?(a.numbers?.push(e),a.finite++,a.min>e&&(a.min=e),e>a.max&&(a.max=e),0===e&&a.zero++,0>e&&a.negative++,Number.isInteger(e)||a.fractional++):a.nonFinite++:a.nonNumeric++}else a.missing++}return a}function er(e,t){if(0===e.length)return;let r=(e.length-1)*t,a=Math.floor(r),i=Math.ceil(r);if(a===i)return e[a];let n=r-a;return e[a]*(1-n)+e[i]*n}function tr(e,t={}){if(!Array.isArray(e)||0===e.length)return{};let r=/* @__PURE__ */new Set;for(let t of e)if(t&&"object"==typeof t)for(let e of Object.keys(t))r.add(e);let a={};for(let i of r){let r=Zt(e,i,!1!==t.quantiles),n=r.numbers?.sort((e,t)=>e-t);a[i]={field:i,observedCount:e.length-r.missing,finiteCount:r.finite,missingCount:r.missing,nonFiniteCount:r.nonFinite,nonNumericCount:r.nonNumeric,zeroCount:r.zero,negativeCount:r.negative,fractionalCount:r.fractional,...r.finite>0?{min:r.min,...n?{q1:er(n,.25),median:er(n,.5),q3:er(n,.75)}:{},max:r.max}:{}}}return a}function rr(e,t,r){let a={};for(let[t,r]of Object.entries(e??{}))a[t]=Array.from(new Set((Array.isArray(r)?r:[r]).filter(e=>"string"==typeof e&&Ci.has(e))));for(let e of t??[])"string"!=typeof e||0===e.length||(a[e]=Array.from(
|
|
2
|
+
/* @__PURE__ */new Set([...a[e]??[],"identifier"])));return r&&(a[r]=Array.from(
|
|
3
|
+
/* @__PURE__ */new Set([...a[r]??[],"series"]))),a}function ar(e,t,r){return e[t]?.includes(r)??!1}function ir(e){return Object.keys(e).filter(t=>ar(e,t,"identifier"))}function nr(e,t,r,a){let i=e[t]??[];if(i.includes("identifier")||i.includes("ignore"))return 0;if(0===i.length)return a?1:0;let n="category"===r||"series"===r?"dimension":"time"===r?"temporal":"measure",s=i.includes(r)||i.includes(n)||"x"===r&&i.includes("temporal"),o=i.includes(r)&&("x"===r||"category"===r||"series"===r);return s&&(a||o)?2:0}function sr(e,t){if(!t)return{repeated:!1};let r=/* @__PURE__ */new Set,a=0;for(let i of e){let e=i?.[t];null!=e&&(a++,r.add(e+""))}return{distinct:r.size,repeated:a>r.size}}function or(e,t,r){return e?e===t?"time":ar(r,e,"x")||wi.test(e)?"named":"scatter":"none"}function lr(e,t,r){if(!t||!r)return;let a=/* @__PURE__ */new Map;for(let i of e){let e=i?.[t],n=i?.[r];if(null==e||null==n)continue;let s=e+"",o=a.get(s)??/* @__PURE__ */new Set;o.add(n+""),a.set(s,o)}if(0===a.size)return;let i=0,n=0;for(let e of a.values())i+=e.size,e.size>=2&&n++;return{seriesPerX:i/a.size,multiSeriesFraction:n/a.size,xColumns:a.size}}function cr(e,t,r,a){if((t[a]??[]).some(e=>"identifier"===e||"ignore"===e)||!e[r].some(e=>e.field===a))throw Error(`Invalid ${r} field "${a}": identifier, ignored, or not a candidate.`)}function ur(e,t,r,a={}){let i=t.time[0]?.field,n=t.x.find(e=>ar(r,e.field,"x"))?.field??i;n||(n=t.x.find(e=>"numeric"===e.kind&&wi.test(e.field))?.field);let s=t.y.find(e=>e.field!==n)?.field;!n&&s&&(n=t.x.find(e=>"numeric"===e.kind&&e.field!==s)?.field);let o,l,c=t.size.find(e=>e.field!==n&&e.field!==s)?.field,u=or(n,i,r);"time"===u||"named"===u?(l=t.series[0]?.field,o=t.category.find(e=>e.field!==l)?.field):(o=t.category[0]?.field,l=t.series.find(e=>e.field!==o)?.field);let d={x:n,y:s,size:c,category:o,series:l,time:i};if(a.primary)for(let[e,i]of Object.entries(a.primary))void 0!==i&&cr(t,r,e,i),d[e]=i;let p=or(d.x,d.time,r),h=sr(e,d.category),m=sr(e,d.series),f=sr(e,d.x);return{primary:d,categoryCount:h.distinct,seriesCount:m.distinct,uniqueXCount:f.distinct,hasRepeatedX:f.repeated,monotonicX:t.x.find(e=>e.field===d.x)?.monotonic??!1,hasTimeAxis:t.time.length>0,xProvenance:p,stackability:lr(e,d.x,d.series)}}function dr(e){return"numeric"===e.type?"numeric":"date"===e.type?"date":"categorical"===e.type?"categorical":"unknown"}function pr(e,t){return t.test(e)?.2:0}function hr(e,t){let r=null;for(let a=0;e.length>a;a++){let i=e[a]?.[t];if(null==i)continue;let n=i instanceof Date?i.getTime():Number(i);if(!Number.isFinite(n)||null!==r&&r>n)return!1;r=n}return null!==r}function mr(e,t,r,a,i,n,s={}){let o=[];for(let[l,c]of Object.entries(e)){let e=dr(c),u=nr(n,l,i,r.has(e));if(0===u)continue;let d,p=2===u,h=.5;h+=pr(l,a),p&&(h+=.35),"categorical"===c.type&&(d=c.distinctCount,d&&d>=2&&12>=d&&(h+=.2),d&&d>50&&(h-=.2)),"numeric"===c.type&&Number.isFinite(c.min)&&Number.isFinite(c.max)&&c.max>c.min&&(h+=.1);let m={field:l,kind:e,quality:Math.max(0,Math.min(1,h)),distinctCount:d,...p?{hinted:!0}:{}};s.computeMonotonic&&("numeric"===e||"date"===e)&&(m.monotonic=hr(t,l),m.monotonic&&(m.quality=Math.min(1,m.quality+.2))),o.push(m)}return o.sort((e,t)=>t.quality-e.quality),o}function fr(e){if(e&&"object"==typeof e&&!Array.isArray(e)){let t=e;if("FeatureCollection"===t.type&&Array.isArray(t.features))return{hasHierarchy:!1,hasNetwork:!1,hasGeo:!0,geo:{features:t.features,points:Array.isArray(t.points)?t.points:void 0,flows:Array.isArray(t.flows)?t.flows:void 0}};if(Array.isArray(t.children))return{hasHierarchy:!0,hasNetwork:!1,hasGeo:!1,hierarchy:t};if(Array.isArray(t.nodes)&&(Array.isArray(t.edges)||Array.isArray(t.links)))return{hasHierarchy:!1,hasNetwork:!0,hasGeo:!1,network:{nodes:t.nodes,edges:t.edges??t.links}}}return{hasHierarchy:!1,hasNetwork:!1,hasGeo:!1}}function gr(e,t){return e.find(e=>t.test(e))}function yr(e){if(3>e.length)return null;let t=e[0];if(!t||"object"!=typeof t)return null;let r=Object.keys(t),a=gr(r,Ni),i=gr(r,Fi);if(!a||!i||a===i)return null;let n=gr(r,Ti),s=gr(r,Ii),o=gr(r,Di),l=[];for(let t of e){if(!t)continue;let e=t[a],r=t[i];if(null==e||null==r)continue;let n=(e+"").trim(),s=(r+"").trim();!n||!s||n===s||l.push(t)}if(3>l.length)return null;let c=/* @__PURE__ */new Map,u=/* @__PURE__ */new Map,d=/* @__PURE__ */new Map;for(let e of l){let t=(e[a]+"").trim(),r=(e[i]+"").trim();c.has(t)||c.set(t,{id:t,label:t}),c.has(r)||c.set(r,{id:r,label:r});let l=`${t}->${r}`,p=o?Number(e[o]):1,h=Number.isFinite(p)?p:1;u.set(l,(u.get(l)??0)+h),d.has(l)||d.set(l,{source:t,target:r,...n?{startTime:e[n]}:{},...s?{endTime:e[s]}:{}})}let p=[];for(let[e,t]of d)p.push({...t,value:u.get(e)??1});return{nodes:Array.from(c.values()),edges:p}}function vr(e,t={}){let r=Yt(e??[]),a=Array.isArray(e)?e:[],i=fr(t.rawInput),n=rr(t.fieldRoles,t.identifiers,t.seriesField);if(!i.hasNetwork&&!i.hasHierarchy&&!i.hasGeo){let e=yr(a);e&&(i.hasNetwork=!0,i.network=e)}let s={x:mr(r.fields,a,Ei,wi,"x",n,{computeMonotonic:!0}),y:mr(r.fields,a,Pi,xi,"y",n),size:mr(r.fields,a,ji,Ai,"size",n),category:mr(r.fields,a,Bi,ki,"category",n),series:mr(r.fields,a,Bi,Si,"series",n),time:mr(r.fields,a,Mi,/(date|time|timestamp)/i,"time",n,{computeMonotonic:!0})},o=ur(a,s,n);return{...r,data:a,numericFields:tr(a,{quantiles:!1}),fieldRoles:n,identifiers:ir(n),candidates:s,...o,hasHierarchy:i.hasHierarchy,hasNetwork:i.hasNetwork,hasGeo:i.hasGeo,network:i.network,hierarchy:i.hierarchy,geo:i.geo}}function br(e){return null==e?"null":Array.isArray(e)?`[${e.map(br).join(",")}]`:e instanceof Date?JSON.stringify(e):"object"==typeof e?`{${Object.entries(e).filter(([,e])=>void 0!==e).sort(([e],[t])=>t>e?-1:e>t?1:0).map(([e,t])=>`${JSON.stringify(e)}:${br(t)}`).join(",")}}`:JSON.stringify(e)}function $r(e){return wr(br(e))}function wr(e){let t=[...Li],r=Array.from((new TextEncoder).encode(e)),a=8*r.length;for(r.push(128);r.length%64!=56;)r.push(0);let i=Math.floor(a/4294967296),n=a>>>0;r.push(i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n);let s=[];for(let e=0;r.length>e;e+=4)s.push((r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0);for(let e=0;s.length>e;e+=16){let r=[...s.slice(e,e+16)];for(let e=16;64>e;e+=1){let t=Ri(r[e-15],7)^Ri(r[e-15],18)^r[e-15]>>>3,a=Ri(r[e-2],17)^Ri(r[e-2],19)^r[e-2]>>>10;r[e]=r[e-16]+t+r[e-7]+a>>>0}let[a,i,n,o,l,c,u,d]=t;for(let e=0;64>e;e+=1){let t=d+(Ri(l,6)^Ri(l,11)^Ri(l,25))+(l&c^~l&u)+qi[e]+r[e]>>>0,s=a&i^a&n^i&n;d=u,u=c,c=l,l=o+t>>>0,o=n,n=i,i=a,a=t+((Ri(a,2)^Ri(a,13)^Ri(a,22))+s>>>0)>>>0}let p=[a,i,n,o,l,c,u,d];for(let e=0;8>e;e+=1)t[e]=t[e]+p[e]>>>0}return t.map(e=>e.toString(16).padStart(8,"0")).join("")}function Cr(e,t){return`${e}[Symbol(${t.description??""})]`}function xr(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let r=Number(e);return Number.isSafeInteger(r)&&r>=0&&t>r}function Ar(e,t){return"number"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t}function kr(e){return e.sort((e,t)=>{let r=JSON.stringify(e),a=JSON.stringify(t);return a>r?-1:r>a?1:0})}function Sr(e,t,r){if(null===e)return null;if(e instanceof Date){let a=e.getTime();return Number.isFinite(a)?{$type:"date",value:e.toISOString()}:void r.excluded.push(t)}switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isNaN(e)?{$type:"number",value:"NaN"}:e===1/0?{$type:"number",value:"Infinity"}:e===-1/0?{$type:"number",value:"-Infinity"}:Object.is(e,-0)?{$type:"number",value:"-0"}:e;case"bigint":return{$type:"bigint",value:""+e};case"undefined":case"function":case"symbol":return void r.excluded.push(t);case"object":{let a=e;if(r.ancestors.has(a))return void r.excluded.push(t);r.ancestors.add(a);try{if(Array.isArray(e)){for(let a of Reflect.ownKeys(e))"length"===a||"string"==typeof a&&xr(a,e.length)||r.excluded.push("symbol"==typeof a?Cr(t,a):Ar(t,a));return Array.from({length:e.length},(a,i)=>{let n=Ar(t,i),s=Object.getOwnPropertyDescriptor(e,i+"");if(!s||!("value"in s)||!s.enumerable)return r.excluded.push(n),null;let o=Sr(s.value,n,r);return void 0===o?null:o})}let a={},i=Object.getPrototypeOf(e);if(i!==Object.prototype&&null!==i)return void r.excluded.push(t);let n=[];for(let a of Reflect.ownKeys(e)){if("symbol"==typeof a){r.excluded.push(Cr(t,a));continue}let i=Object.getOwnPropertyDescriptor(e,a);i&&"value"in i&&i.enumerable?n.push(a):r.excluded.push(Ar(t,a))}for(let i of n.sort()){let n=Object.getOwnPropertyDescriptor(e,i),s=Sr(n&&"value"in n?n.value:void 0,Ar(t,i),r);void 0!==s&&Object.defineProperty(a,i,{value:s,enumerable:!0,configurable:!0,writable:!0})}return a}finally{r.ancestors.delete(a)}}default:return void r.excluded.push(t)}}function jr(e,t=/* @__PURE__ */new Set){if(null===e)return["null"];if(e instanceof Date)return Number.isFinite(e.getTime())?["date",e.toISOString()]:["excluded"];switch(typeof e){case"string":return["string",e];case"boolean":return["boolean",e];case"number":return["number",Number.isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":Object.is(e,-0)?"-0":e+""];case"bigint":return["bigint",""+e];case"undefined":case"function":case"symbol":return["excluded"];case"object":if(t.has(e))return["excluded"];t.add(e);try{let r=r=>{let a="symbol"==typeof r?["symbol-key",r.description??""]:["string-key",r],i=Object.getOwnPropertyDescriptor(e,r);return i?"value"in i?[a,"data",!!i.enumerable,jr(i.value,t)]:[a,"accessor",!!i.enumerable,!!i.get,!!i.set]:[a,"missing"]};if(Array.isArray(e))return["array",Array.from({length:e.length},(t,a)=>{let i=a+"";return Object.prototype.hasOwnProperty.call(e,i)?r(i):["hole"]}),kr(Reflect.ownKeys(e).filter(t=>"length"!==t&&!("string"==typeof t&&xr(t,e.length))).map(r))];let a=Object.getPrototypeOf(e);return[a!==Object.prototype&&null!==a?"non-json-object":"object",kr(Reflect.ownKeys(e).map(r))]}finally{t.delete(e)}default:return["excluded"]}}function Er(e){let t={excluded:[],ancestors:/* @__PURE__ */new Set},r=Sr(e,"$",t)??null;return{value:r,text:JSON.stringify(r),excludedPaths:t.excluded}}function Pr(e){let t=Er(e),r=wr(JSON.stringify(["semiotic-value-fingerprint","v2",jr(e)]));return{...t,algorithm:"sha256",digest:r,fingerprint:"sha256:"+r}}function Mr(e,t,r,a){Rr(e,Object.keys(t),r,a);for(let[i,n]of Object.entries(t))n.values?(n.required||void 0!==e[i])&&Lr(e,i,r,n.values,a):n.required?Or(e,i,r,a):Gr(e,i,r,a)}function Br(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Nr(e,t,r,a){void 0!==e[t]&&("number"!=typeof e[t]||!Number.isFinite(e[t]))&&a.push({path:`${r}.${t}`,message:"Expected a finite number."})}function Fr(e,t,r,a){void 0!==e[t]&&"boolean"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a boolean."})}function Tr(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(Tr):Br(e)&&Object.values(e).every(Tr))}function Ir(e,t,r,a){void 0!==e[t]&&(!Br(e[t])||!Tr(e[t]))&&a.push({path:`${r}.${t}`,message:"Expected a JSON object."})}function Dr(e){return e.every(Tr)}function Rr(e,t,r,a){let i=new Set(t);for(let t of Object.keys(e))i.has(t)||a.push({path:`${r}.${t}`,message:"Unexpected property."})}function Or(e,t,r,a){("string"!=typeof e[t]||!e[t])&&a.push({path:`${r}.${t}`,message:"Expected a non-empty string."})}function Lr(e,t,r,a,i){("string"!=typeof e[t]||!a.includes(e[t]))&&i.push({path:`${r}.${t}`,message:`Expected one of: ${a.join(", ")}.`})}function qr(e,t,r,a){let i=e[t];if(void 0!==i)return Br(i)?i:void a.push({path:`${r}.${t}`,message:"Expected an object."})}function Hr(e,t,r,a){let i=e[t];if(void 0!==i)return Array.isArray(i)?i:void a.push({path:`${r}.${t}`,message:"Expected an array."})}function Vr(e,t,r){e?.some(e=>"string"!=typeof e||!e)&&r.push({path:t,message:"Expected non-empty string values."})}function zr(e,t,r,a,i){void 0!==e[t]&&Lr(e,t,r,a,i)}function Gr(e,t,r,a){void 0!==e[t]&&"string"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a string."})}function Ur(e,t,r){Br(e)?(Rr(e,["id","name","kind"],t,r),Or(e,"kind",t,r),Gr(e,"id",t,r),Gr(e,"name",t,r)):r.push({path:t,message:"Expected an actor object."})}function Wr(e,t){let r=qr(e,"reception","$",t);if(!r)return;Rr(r,["channels","audience","strengths","risks","scaffolds","description","dataFallback","manualChecks"],"$.reception",t);let a=Hr(r,"channels","$.reception",t);a||t.push({path:"$.reception.channels",message:"Expected a reception-channel array."}),a?.forEach((e,r)=>{let a=`$.reception.channels[${r}]`;Br(e)?(Rr(e,["channel","disclosure","navigation","interactionInstructions","rawData","tokenBudget","privacyNotes"],a,t),Lr(e,"channel",a,["visual","screen-reader","sonified","agent","print","low-bandwidth"],t),zr(e,"disclosure",a,["summary","standard","detailed"],t),zr(e,"rawData",a,["deny","bounded","allow"],t),Fr(e,"navigation",a,t),Fr(e,"interactionInstructions",a,t),Nr(e,"tokenBudget",a,t),Vr(Hr(e,"privacyNotes",a,t),a+".privacyNotes",t)):t.push({path:a,message:"Expected a channel object."})});for(let e of["strengths","risks","scaffolds","manualChecks"])Vr(Hr(r,e,"$.reception",t),"$.reception."+e,t);Gr(r,"audience","$.reception",t),Gr(r,"description","$.reception",t),Fr(r,"dataFallback","$.reception",t)}function Jr(e,t){let r=qr(e,"form","$",t);r&&(Rr(r,["chartFamily","whyThisForm","rejectedAlternatives","risks","misuse"],"$.form",t),Gr(r,"chartFamily","$.form",t),Gr(r,"whyThisForm","$.form",t),Vr(Hr(r,"risks","$.form",t),"$.form.risks",t),Vr(Hr(r,"misuse","$.form",t),"$.form.misuse",t),Hr(r,"rejectedAlternatives","$.form",t)?.forEach((e,r)=>{let a=`$.form.rejectedAlternatives[${r}]`;Br(e)?(Rr(e,["representation","reason"],a,t),Or(e,"representation",a,t),Or(e,"reason",a,t)):t.push({path:a,message:"Expected an alternative object."})}))}function Kr(e,t){let r=qr(e,"contestability","$",t);r&&(Rr(r,["sourceRequestsAllowed","alternativeViews","challenges","corrections","editorialExceptions"],"$.contestability",t),Fr(r,"sourceRequestsAllowed","$.contestability",t),Hr(r,"challenges","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.challenges[${r}]`;if(Br(e)){Rr(e,["id","claimId","status","reason","raisedBy","raisedAt","counterclaimId","resolution"],a,t),Or(e,"id",a,t),Or(e,"claimId",a,t),Or(e,"reason",a,t),Lr(e,"status",a,["open","accepted","declined","resolved"],t),void 0!==e.raisedBy&&Ur(e.raisedBy,a+".raisedBy",t);for(let r of["raisedAt","counterclaimId","resolution"])Gr(e,r,a,t)}else t.push({path:a,message:"Expected a challenge object."})}),Hr(r,"corrections","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.corrections[${r}]`;if(!Br(e))return void t.push({path:a,message:"Expected a correction object."});Rr(e,["id","affectedClaimIds","replacementClaimIds","reason","createdAt","createdBy"],a,t),Or(e,"id",a,t),Or(e,"reason",a,t);let i=Hr(e,"affectedClaimIds",a,t);i||t.push({path:a+".affectedClaimIds",message:"Expected an affected-claim array."}),Vr(i,a+".affectedClaimIds",t),Vr(Hr(e,"replacementClaimIds",a,t),a+".replacementClaimIds",t),Gr(e,"createdAt",a,t),void 0!==e.createdBy&&Ur(e.createdBy,a+".createdBy",t)}),Hr(r,"alternativeViews","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.alternativeViews[${r}]`;Br(e)?(Rr(e,["id","label","rationale"],a,t),Or(e,"id",a,t),Or(e,"label",a,t),Gr(e,"rationale",a,t)):t.push({path:a,message:"Expected an alternative-view object."})}),Hr(r,"editorialExceptions","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.editorialExceptions[${r}]`;Br(e)?(Rr(e,["ruleId","rationale","owner","reviewAt"],a,t),Or(e,"ruleId",a,t),Or(e,"rationale",a,t),Gr(e,"owner",a,t),Gr(e,"reviewAt",a,t)):t.push({path:a,message:"Expected an editorial-exception object."})}))}function _r(e,t){let r=qr(e,"accountability","$",t);r&&(Rr(r,["authors","generatedBy","dataSources","codeRef","reviews","actions"],"$.accountability",t),Hr(r,"authors","$.accountability",t)?.forEach((e,r)=>Ur(e,`$.accountability.authors[${r}]`,t)),Vr(Hr(r,"dataSources","$.accountability",t),"$.accountability.dataSources",t),Gr(r,"generatedBy","$.accountability",t),Gr(r,"codeRef","$.accountability",t),Hr(r,"reviews","$.accountability",t)?.forEach((e,r)=>{let a=`$.accountability.reviews[${r}]`;if(Br(e)){Rr(e,["id","status","reviewer","reviewedAt","rationale","policyId"],a,t),Or(e,"id",a,t),Lr(e,"status",a,["pending","approved","changes-requested","rejected"],t),void 0!==e.reviewer&&Ur(e.reviewer,a+".reviewer",t);for(let r of["reviewedAt","rationale","policyId"])Gr(e,r,a,t)}else t.push({path:a,message:"Expected a review object."})}),Hr(r,"actions","$.accountability",t)?.forEach((e,r)=>{let a=`$.accountability.actions[${r}]`;if(!Br(e))return void t.push({path:a,message:"Expected an action object."});Rr(e,["id","action","actor","actedAt","claimIds","artifactId","artifactRevision","policyId","status","invalidatedByClaimId"],a,t),Or(e,"id",a,t),Or(e,"action",a,t);let i=Hr(e,"claimIds",a,t);i||t.push({path:a+".claimIds",message:"Expected a claim identifier array."}),Vr(i,a+".claimIds",t),void 0!==e.actor&&Ur(e.actor,a+".actor",t);for(let r of["actedAt","artifactId","artifactRevision","policyId","invalidatedByClaimId"])Gr(e,r,a,t);zr(e,"status",a,["proposed","taken","reversed","invalidated"],t)}))}function Qr(e,t){let r=qr(e,"inheritance","$",t);if(r){Rr(r,["requiredPaths","prohibitedExports","privacy","rawDataDefault","preservation","sourceArtifactIds"],"$.inheritance",t);for(let e of["requiredPaths","prohibitedExports","sourceArtifactIds"])Vr(Hr(r,e,"$.inheritance",t),"$.inheritance."+e,t);zr(r,"privacy","$.inheritance",["public","restricted","confidential","unknown"],t),zr(r,"rawDataDefault","$.inheritance",["exclude","bounded","include"],t),zr(r,"preservation","$.inheritance",["full-fidelity","claim-evidence-preserved","visual-only","lossy","unknown"],t)}}function Xr(e,t){Wr(e,t),Jr(e,t),Kr(e,t),_r(e,t),Qr(e,t)}function Yr(e){for(let t of Object.values(e))Object.freeze(t.suppliedBy),Object.freeze(t);return Object.freeze(e)}function Zr(e,t){if(void 0===e||Br(e)){if(Br(e))for(let[r,a]of Object.entries(e)){let e="$.fieldStatus."+r;if(!Br(a)||"string"!=typeof a.status){t.push({path:e,message:"Expected a field state with a status."});continue}Rr(a,["status","reason","suppliedBy","derived","reviewedBy"],e,t),["known","unknown","manual","not-applicable"].includes(a.status)||t.push({path:e+".status",message:"Expected one of: known, unknown, manual, not-applicable."}),void 0!==a.suppliedBy&&("string"!=typeof a.suppliedBy||!["author","system","model-proposal","import"].includes(a.suppliedBy))&&t.push({path:e+".suppliedBy",message:"Expected one of: author, system, model-proposal, import."}),Gr(a,"reason",e,t),Gr(a,"reviewedBy",e,t),Fr(a,"derived",e,t);let i=Object.prototype.hasOwnProperty.call(Hi,r)?Hi[r]:void 0,n="model-proposal"===a.suppliedBy,s=n&&!0===i?.modelMayPropose&&"known"!==a.status;i&&"known"===a.status&&"string"!=typeof a.suppliedBy&&t.push({path:e+".suppliedBy",message:`Known field "${r}" must identify an allowed supplier.`}),i&&"string"==typeof a.suppliedBy&&!s&&!i.suppliedBy.includes(a.suppliedBy)&&t.push({path:e+".suppliedBy",message:`Field "${r}" cannot be supplied by ${a.suppliedBy}.`}),i&&!0===a.derived&&!i.derivable&&t.push({path:e+".derived",message:`Field "${r}" cannot be marked as derived.`}),i&&n&&(!i.modelMayPropose||"known"===a.status)&&t.push({path:e+".suppliedBy",message:"known"===a.status?`A model proposal cannot finalize field "${r}" as known.`:`Field "${r}" does not accept model proposals.`}),"required"===i?.humanReview&&"known"===a.status&&("string"!=typeof a.reviewedBy||!a.reviewedBy.trim())&&t.push({path:e+".reviewedBy",message:`Known field "${r}" requires an attributable human review.`})}}else t.push({path:"$.fieldStatus",message:"Expected a field-state object."})}function ea(e,t){let r="$.time";Rr(e,[...Gi,...Object.keys(Ui),"sources"],r,t);for(let a of Gi)Gr(e,a,r,t);for(let[a,i]of Object.entries(Ui)){let n=qr(e,a,r,t);n&&Mr(n,i,`${r}.${a}`,t)}Hr(e,"sources",r,t)?.forEach((e,a)=>{let i=`${r}.sources[${a}]`;Br(e)?Mr(e,Wi,i,t):t.push({path:i,message:"Expected a source object."})})}function ta(e){try{return ra(e)}catch{return{valid:!1,errors:[{path:"$",message:"Artifact contract could not be inspected safely."}],warnings:[]}}}function ra(e){let t=[],r=[];if(!Br(e))return{valid:!1,errors:[{path:"$",message:"Expected an object."}],warnings:r};let a=d(e);if(a.length>0)return{valid:!1,errors:a.map(e=>({path:e,message:"Expected a JSON-compatible value that survives serialization unchanged."})),warnings:r};if(Rr(e,["contractVersion","artifact","purpose","claims","evidence","time","reception","form","contestability","accountability","inheritance","fieldStatus","extensions"],"$",t),"0.1"!==e.contractVersion&&t.push({path:"$.contractVersion",message:"Expected contract version 0.1."}),Br(e.artifact)){Rr(e.artifact,["id","kind","component","title","createdAt","configFingerprint","dataFingerprint","revision"],"$.artifact",t),Or(e.artifact,"id","$.artifact",t),Lr(e.artifact,"kind","$.artifact",["chart","dashboard","story","alert","agent-answer"],t);for(let r of["component","title","createdAt","configFingerprint","dataFingerprint","revision"])Gr(e.artifact,r,"$.artifact",t)}else t.push({path:"$.artifact",message:"Expected an artifact identity object."});if(Br(e.purpose))if(Array.isArray(e.purpose.intents)){Rr(e.purpose,["intents","communicativeAct","decisionContext","stakes","allowedUses","prohibitedUses"],"$.purpose",t),e.purpose.intents.forEach((e,r)=>{(!Br(e)||"string"!=typeof e.id||!e.id)&&t.push({path:`$.purpose.intents[${r}].id`,message:"Expected a non-empty intent identifier."}),Br(e)&&Rr(e,["id","strength","source","rationale"],`$.purpose.intents[${r}]`,t),Br(e)&&void 0!==e.strength&&Lr(e,"strength",`$.purpose.intents[${r}]`,["primary","secondary"],t),Br(e)&&(zr(e,"source",`$.purpose.intents[${r}]`,["author","derived","model-proposal","import"],t),Gr(e,"rationale",`$.purpose.intents[${r}]`,t))});for(let r of["allowedUses","prohibitedUses"])Vr(Hr(e.purpose,r,"$.purpose",t),"$.purpose."+r,t);zr(e.purpose,"stakes","$.purpose",["exploratory","informational","operational","high"],t),Gr(e.purpose,"communicativeAct","$.purpose",t),Gr(e.purpose,"decisionContext","$.purpose",t)}else t.push({path:"$.purpose.intents",message:"Expected an intent array."});else t.push({path:"$.purpose",message:"Expected a purpose object."});Array.isArray(e.claims)?e.claims.forEach((e,r)=>{if(!Br(e))return void t.push({path:`$.claims[${r}]`,message:"Expected a claim object."});Rr(e,["id","text","kind","status","evidenceIds","scope","uncertainty","asOf","supersedes","authoredBy","review","tags"],`$.claims[${r}]`,t),Or(e,"id",`$.claims[${r}]`,t),Lr(e,"kind",`$.claims[${r}]`,["description","observation","aggregation","inference","forecast","simulation","alert","recommendation","normative"],t),Lr(e,"status",`$.claims[${r}]`,["supported","provisional","disputed","superseded","retracted","unsupported","unknown"],t),Array.isArray(e.evidenceIds)?e.evidenceIds.some(e=>"string"!=typeof e||!e)&&t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected non-empty string evidence identifiers."}):t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected an evidence identifier array."}),Vr(Hr(e,"supersedes",`$.claims[${r}]`,t),`$.claims[${r}].supersedes`,t),Gr(e,"text",`$.claims[${r}]`,t),Gr(e,"asOf",`$.claims[${r}]`,t),Ir(e,"scope",`$.claims[${r}]`,t),Vr(Hr(e,"tags",`$.claims[${r}]`,t),`$.claims[${r}].tags`,t),void 0!==e.authoredBy&&Ur(e.authoredBy,`$.claims[${r}].authoredBy`,t);let a=qr(e,"review",`$.claims[${r}]`,t);a&&(Rr(a,["status","reviewer","reviewedAt","rationale"],`$.claims[${r}].review`,t),Lr(a,"status",`$.claims[${r}].review`,["proposed","reviewed","approved","rejected"],t),void 0!==a.reviewer&&Ur(a.reviewer,`$.claims[${r}].review.reviewer`,t),Gr(a,"reviewedAt",`$.claims[${r}].review`,t),Gr(a,"rationale",`$.claims[${r}].review`,t));let i=qr(e,"uncertainty",`$.claims[${r}]`,t);if(i){Rr(i,["kind","lower","upper","confidence","unit","description"],`$.claims[${r}].uncertainty`,t),Lr(i,"kind",`$.claims[${r}].uncertainty`,["interval","distribution","qualitative","unknown"],t);for(let e of["lower","upper","confidence"])Nr(i,e,`$.claims[${r}].uncertainty`,t);Gr(i,"unit",`$.claims[${r}].uncertainty`,t),Gr(i,"description",`$.claims[${r}].uncertainty`,t)}}):t.push({path:"$.claims",message:"Expected a claim array."}),Array.isArray(e.evidence)?e.evidence.forEach((e,r)=>{if(!Br(e))return void t.push({path:`$.evidence[${r}]`,message:"Expected an evidence object."});Rr(e,["id","role","label","source","fingerprint","dataVersion","observedAt","scope","sample","transformation","generatedClaimId","relationship"],`$.evidence[${r}]`,t),Or(e,"id",`$.evidence[${r}]`,t),Lr(e,"role",`$.evidence[${r}]`,["source-data","external-source","transformation","statistical-test","model-output","human-observation","policy-rule","quality-check"],t);for(let a of["label","fingerprint","dataVersion","observedAt","generatedClaimId"])Gr(e,a,`$.evidence[${r}]`,t);Ir(e,"scope",`$.evidence[${r}]`,t);let a=qr(e,"source",`$.evidence[${r}]`,t);if(a){Rr(a,["name","uri","version","retrievedAt","publisher"],`$.evidence[${r}].source`,t);for(let e of["name","uri","version","retrievedAt","publisher"])Gr(a,e,`$.evidence[${r}].source`,t)}let i=qr(e,"transformation",`$.evidence[${r}]`,t);if(i){Rr(i,["id","kind","description","inputEvidenceIds","parameters","assumptions","implementation","performedAt","performedBy"],`$.evidence[${r}].transformation`,t),Or(i,"id",`$.evidence[${r}].transformation`,t),Lr(i,"kind",`$.evidence[${r}].transformation`,["aggregation","filter","normalization","binning","join","smoothing","forecasting","simulation","other"],t);let e=Hr(i,"inputEvidenceIds",`$.evidence[${r}].transformation`,t);e?Vr(e,`$.evidence[${r}].transformation.inputEvidenceIds`,t):t.push({path:`$.evidence[${r}].transformation.inputEvidenceIds`,message:"Expected an evidence identifier array."}),Vr(Hr(i,"assumptions",`$.evidence[${r}].transformation`,t),`$.evidence[${r}].transformation.assumptions`,t),Gr(i,"description",`$.evidence[${r}].transformation`,t),Gr(i,"implementation",`$.evidence[${r}].transformation`,t),Gr(i,"performedAt",`$.evidence[${r}].transformation`,t),Ir(i,"parameters",`$.evidence[${r}].transformation`,t),void 0!==i.performedBy&&Ur(i.performedBy,`$.evidence[${r}].transformation.performedBy`,t)}let n=qr(e,"sample",`$.evidence[${r}]`,t);if(n){Rr(n,["rowCount","fields","values","truncated"],`$.evidence[${r}].sample`,t),Vr(Hr(n,"fields",`$.evidence[${r}].sample`,t),`$.evidence[${r}].sample.fields`,t);let e=Hr(n,"values",`$.evidence[${r}].sample`,t);e&&!Dr(e)&&t.push({path:`$.evidence[${r}].sample.values`,message:"Expected JSON values."}),Nr(n,"rowCount",`$.evidence[${r}].sample`,t),Fr(n,"truncated",`$.evidence[${r}].sample`,t)}zr(e,"relationship",`$.evidence[${r}]`,["descriptive","correlational","causal","unknown"],t)}):t.push({path:"$.evidence",message:"Expected an evidence array."}),Zr(e.fieldStatus,t);let i=qr(e,"time","$",t);return i&&ea(i,t),Xr(e,t),Ir(e,"extensions","$",t),Array.isArray(e.claims)&&0===e.claims.length&&r.push({path:"$.claims",message:"The contract declares no claims."}),Array.isArray(e.evidence)&&0===e.evidence.length&&r.push({path:"$.evidence",message:"The contract declares no evidence."}),{valid:0===t.length,errors:t,warnings:r}}function aa(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ia(e,t){if(!t||!aa(e)||!Array.isArray(e.evidence))return[];let r=[];return e.evidence.forEach((e,t)=>{aa(e)&&Object.prototype.hasOwnProperty.call(e,"sample")&&(delete e.sample,r.push(`$.evidence[${t}].sample`))}),r}function na(e,t={}){try{return sa(e,t)}catch{let t=d(e);return{transfer:{status:"invalid",omittedPaths:t.length?t:["$"],warnings:["Artifact contract could not be inspected safely."]}}}}function sa(e,t){if(!aa(e))return{transfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["Artifact contract must be a JSON object."]}};let r=Er(e),a=[.../* @__PURE__ */new Set([...r.excludedPaths,...d(e)])].sort(),i=r.value,n=ia(i,t.excludeEvidenceSamples),s=n.length?["Bounded evidence samples were excluded by the transfer policy."]:[],o=i?.contractVersion;if("string"!=typeof o||!o)return{contract:i,transfer:{status:"invalid",omittedPaths:[...a,...n],warnings:["Artifact contract is missing a string contractVersion.",...s]}};if("0.1"!==o)return{contract:i,transfer:{status:a.length>0?"invalid":"unsupported-version",omittedPaths:[...a,...n],warnings:[`Contract version ${o} is not interpreted by this runtime.`,...a.length>0?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...s]}};let l=ta(i),c=[...l.errors.map(({path:e,message:t})=>`${e}: ${t}`),...l.warnings.map(({path:e,message:t})=>`${e}: ${t}`),...a.length?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...s];return{contract:i,transfer:{status:!l.valid||a.length>0?"invalid":n.length>0?"excluded":"preserved",omittedPaths:[...a,...n],warnings:c}}}function oa(e,t){return Ji.has(e)&&!("reading"===e&&"string"==typeof t)}function la(e){let t=Object.entries(e).filter(([e,t])=>oa(e,t)&&void 0!==t);if(0!==t.length)return 1===t.length&&"data"===t[0][0]?t[0][1]:Object.fromEntries(t)}function ca(e,t=[]){if(void 0===e)return;let r=t.filter(e=>!!e.transformation).map(({id:e,transformation:t})=>({evidenceId:e,transformation:t})).sort(({evidenceId:e},{evidenceId:t})=>t>e?-1:e>t?1:0);return Pr(r.length>0?{data:e,transformations:r}:e).fingerprint}function ua(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!oa(e,t)&&"recipeId"!==e))}function da(e,t,r,a=la(t)){let i=ua(t),n=0===d(i).length?Pr(i).fingerprint:void 0,s=void 0!==a&&0===d(a).length?ca(a,e.evidence):void 0,o="ChartRecipe"===r&&"string"==typeof t.recipeId?t.recipeId:r,l=[],c=[];return void 0!==o&&(void 0===e.artifact.component?c.push("artifact.component"):e.artifact.component!==o&&l.push("artifact.component")),void 0===e.artifact.configFingerprint||void 0===n?c.push("artifact.configFingerprint"):e.artifact.configFingerprint!==n&&l.push("artifact.configFingerprint"),void 0!==e.artifact.dataFingerprint&&s?e.artifact.dataFingerprint!==s&&l.push("artifact.dataFingerprint"):c.push("artifact.dataFingerprint"),{status:l.length>0?"mismatch":c.length>0?"unknown":"match",mismatchPaths:l,unknownPaths:c}}function pa(e){if(Array.isArray(e))return e.map(pa);if(!e||"object"!=typeof e)return e;let t={};for(let[r,a]of Object.entries(e))void 0===a||Ki.has(r)||(t[r]=pa(a));return t}function ha(e){if(Array.isArray(e))return e.map(ha);if(!e||"object"!=typeof e)return e;let t={...e};return delete t.datum,Array.isArray(t.children)&&(t.children=t.children.map(ha)),t}function ma(e,t){if(Array.isArray(t.data))return t.data;if("ForceDirectedGraph"===e||"SankeyDiagram"===e||"ProcessSankey"===e||"ChordDiagram"===e)return[...Array.isArray(t.nodes)?t.nodes:[],...Array.isArray(t.edges)?t.edges:[]];if("ChoroplethMap"===e)return Array.isArray(t.areas)?t.areas:t.areas&&"object"==typeof t.areas&&Array.isArray(t.areas.features)?t.areas.features:"string"==typeof t.areas?[{geographyReference:t.areas}]:[];if("ProportionalSymbolMap"===e)return Array.isArray(t.points)?t.points:[];if("FlowMap"===e)return[...Array.isArray(t.nodes)?t.nodes:[],...Array.isArray(t.flows)?t.flows:[]];if("DistanceCartogram"===e)return[...Array.isArray(t.points)?t.points:[],...Array.isArray(t.lines)?t.lines:[]];if("TreeDiagram"===e||"Treemap"===e||"CirclePack"===e||"OrbitDiagram"===e)return t.data&&"object"==typeof t.data?[t.data]:[];if("BigNumber"===e||"GaugeChart"===e){let e=t.value;return void 0===e?[]:[{value:e}]}return[]}function fa(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ga(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)}function ya(e,t){if(void 0===e)return;if(!e||"object"!=typeof e||Array.isArray(e))throw new TypeError(t+" must be an accessibility audit object");let r=e;if(void 0!==r.ok&&"boolean"!=typeof r.ok)throw new TypeError(t+".ok must be boolean");if(void 0!==r.findings){if(!Array.isArray(r.findings))throw new TypeError(t+".findings must be an array");for(let[e,a]of r.findings.entries()){let r=`${t}.findings[${e}]`;if(!a||"object"!=typeof a||Array.isArray(a))throw new TypeError(r+" must be a finding object");if(void 0!==a.critical&&"boolean"!=typeof a.critical)throw new TypeError(r+".critical must be boolean");if(void 0!==a.status&&!["pass","fail","warn","manual","not-applicable"].includes(a.status))throw new TypeError(r+".status must be an accessibility finding status")}}}function va(e){let t=e.evidence;if(void 0!==t&&!fa(t))throw new TypeError("Evidence envelope render evidence must be an object");for(let r of[e,t])if((void 0!==r?.sceneHashVersion||r===t&&void 0!==r?.sceneHash)&&(2!==r?.sceneHashVersion||"string"!=typeof r.sceneHash||!/^[a-f0-9]{64}$/.test(r.sceneHash)))throw new TypeError("Evidence envelope requires a supported scene hash version and SHA-256 digest");if(void 0!==e.sceneHash&&void 0===e.sceneHashVersion){let r=t?.markCountByType;if(void 0!==e.markInventoryHash||!fa(r)||!Object.values(r).every(e=>"number"==typeof e&&Number.isSafeInteger(e)&&e>=0)||e.sceneHash!==$r(r))throw new TypeError("Evidence envelope legacy scene hash must identify its mark inventory")}if(t&&(2===e.sceneHashVersion||2===t.sceneHashVersion)&&(2!==e.sceneHashVersion||2!==t.sceneHashVersion||e.sceneHash!==t.sceneHash))throw new TypeError("Evidence envelope scene hash does not match its render evidence")}function ba(e,t){let{contract:r,transfer:a,binding:i}=e;if(void 0!==a&&(!fa(a)||!["preserved","unsupported-version","invalid","excluded"].includes(a.status)||!ga(a.omittedPaths)||!ga(a.warnings)||"preserved"===a.status&&a.omittedPaths.length>0||"excluded"===a.status&&0===a.omittedPaths.length))throw new TypeError(`Evidence envelope ${t} has an invalid transfer report`);if(!(void 0===i||fa(i)&&["match","mismatch","unknown"].includes(i.status)&&ga(i.mismatchPaths)&&ga(i.unknownPaths)))throw new TypeError(`Evidence envelope ${t} has an invalid identity binding`);if(!fa(a))return;if(void 0===r){if("preserved"===a.status||"excluded"===a.status)throw new TypeError(`Evidence envelope ${t} requires the contract its transfer report preserves`);return}let n=na(r),s="excluded"===a.status&&"preserved"===n.transfer.status&&ga(a.omittedPaths)&&a.omittedPaths.length>0;if(n.transfer.status!==a.status&&!s)throw new TypeError(`Evidence envelope ${t} transfer status does not match its contract`)}function $a(e){let t=e.transferBindingVersion??Qi;return $r({kind:"semiotic.chart-evidence.artifact-transfer",envelopeVersion:1,transferBindingVersion:t,contract:e.contract??null,transfer:e.transfer,...t===Qi?{identityBinding:e.identityBinding??null}:{}})}function wa(e,t){let r={...e,identityBinding:t};return{...r,transferBindingVersion:Qi,transferFingerprint:$a(r)}}function Ca(e,t,r){return"0.1"===e.contract?.contractVersion&&"invalid"!==e.transfer.status?da(e.contract,r,t):{status:"unknown",mismatchPaths:[],unknownPaths:["artifactContract"]}}function xa(e){let t=e.data;if(Array.isArray(t))return t.length}function Aa(e){return e?.markCount}function ka(e){return"number"!=typeof e.intended||"number"!=typeof e.observed?"unknown":0===e.observed&&e.intended>0||"empty"===e.evidence?.status&&e.intended>0?"mismatch":e.observed===e.intended?"match":"unknown"}function Sa(e,t,r={}){let a=ma(e,t),i=vr(a,{rawInput:t}),n=$r({component:e,rowCount:a.length,records:a}),s=pa(i),o=_t(e,t);if(o.structure){let e=ha(o.structure);o.structure=e}let l=r.accessContract??jt({component:e,props:t,options:{navigable:!1,inChartContainer:!0===r.inChartContainer,streamStatus:r.streamStatus,streamHistoryLimit:r.streamHistoryLimit,ssrEvidence:r.ssrEvidence}}),c={...l,navigation:{...l.navigation,...l.navigation.tree?{tree:ha(l.navigation.tree)}:{}}},u=xa(t),d=Aa(r.ssrEvidence),p=ka({intended:u,observed:d,evidence:r.ssrEvidence}),h=r.modalityChecks??{},m=h.vision??{observations:[]},f=h.tandem??{agreements:[],conflicts:[]},g=r.transformOperations??[],y=r.artifactContract??r.ssrEvidence?.artifactContract,v=y?na(y,{excludeEvidenceSamples:!0}):void 0,b=v?wa(v,Ca(v,e,t)):void 0;return{schemaVersion:1,chart:{component:e,surfaceVersion:r.surfaceVersion??"1",...r.chartId?{chartId:r.chartId}:{}},input:{...r.sourceId?{source:r.sourceId}:{},rowCount:a.length,profile:s,hash:n},transform:{operations:g,hash:$r(g)},render:{mode:r.ssrEvidence?"svg":"not-rendered",...2===r.ssrEvidence?.sceneHashVersion&&r.ssrEvidence.sceneHash?{sceneHash:r.ssrEvidence.sceneHash,sceneHashVersion:2}:{},markInventoryHash:r.ssrEvidence?$r(r.ssrEvidence.markCountByType):void 0,imageHash:void 0,marksIntended:u,marksObserved:d,parity:p,...r.ssrEvidence?{evidence:r.ssrEvidence}:{}},access:c,meaning:{grounding:o,...o.intent?.act?{communicativeAct:o.intent.act}:{},...r.claims?{claims:r.claims}:{}},modalityChecks:{structured:{observations:h.structured?.observations??[],model:null},vision:{observations:m.observations??[],...m.model?{model:m.model}:{}},tandem:{agreements:f.agreements??[],conflicts:f.conflicts??[],...f.model?{model:f.model}:{}}},audit:{accessibility:c.evidence.audit,...r.audits},limits:{uncertaintyShown:r.uncertaintyShown,knownGaps:r.knownGaps??[],unsupportedClaims:r.unsupportedClaims??[],privacyScope:r.privacyScope??{semantic:["field names","aggregates","bounded navigation"],renderedSvg:["visual geometry","labels","no raw rows by default"],dashboardScreenshot:["everything visible; treat as broad disclosure"]}},...b?{artifact:b}:{}}}function ja(e){if(!e||"object"!=typeof e||Array.isArray(e))throw new TypeError("Evidence envelope must be an object");let t=e;if(1!==t.schemaVersion)throw new TypeError("Unsupported evidence envelope schemaVersion: "+t.schemaVersion);for(let e of["chart","input","transform","render","access","meaning","modalityChecks","audit","limits"])if(!t[e]||"object"!=typeof t[e])throw new TypeError("Evidence envelope is missing section: "+e);if(1!==t.access?.schemaVersion)throw new TypeError("Evidence envelope has an incompatible access contract");let r=t.access;for(let e of["text","keyboard","navigation","table","mediaPreferences","streamStatus","ssr","evidence"])if(!r[e]||"object"!=typeof r[e])throw new TypeError("Evidence envelope access section is missing: "+e);if("boolean"!=typeof r.table.enabled)throw new TypeError("Evidence envelope access table state must be boolean");ya(t.audit?.accessibility,"audit.accessibility"),ya(r.evidence.audit,"access.evidence.audit");let a=t.chart,i=t.input,n=t.transform,s=t.render,o=t.meaning;if(!o.grounding||"object"!=typeof o.grounding)throw new TypeError("Evidence envelope meaning requires reader grounding");if(!a.component||"string"!=typeof a.component)throw new TypeError("Evidence envelope chart requires a component string");if(!Number.isSafeInteger(i.rowCount)||0>i.rowCount)throw new TypeError("Evidence envelope input requires non-negative rowCount");if(!Array.isArray(n.operations))throw new TypeError("Evidence envelope transform requires operations array");if(!["svg","canvas","png","not-rendered"].includes(s.mode))throw new TypeError("Evidence envelope render requires mode");va(s),ba({contract:s.evidence?.artifactContract,transfer:s.evidence?.artifactTransfer,binding:s.evidence?.artifactBinding},"render.evidence.artifact");let l=t.modalityChecks;for(let e of["structured","vision","tandem"])if(!l[e]||"object"!=typeof l[e])throw new TypeError("Evidence envelope modalityChecks is missing: "+e);for(let e of["structured","vision"])if(!Array.isArray(l[e].observations))throw new TypeError(`Evidence envelope ${e} observations must be an array`);for(let e of["structured","vision"])for(let t of l[e].observations)if(!t||"object"!=typeof t||"string"!=typeof t.id||"string"!=typeof t.finding)throw new TypeError(`Evidence envelope ${e} observations require string id and finding`);if(!Array.isArray(l.tandem.agreements)||!Array.isArray(l.tandem.conflicts))throw new TypeError("Evidence envelope tandem agreements and conflicts must be arrays");if(void 0!==t.artifact){if(!t.artifact||"object"!=typeof t.artifact||!t.artifact.transfer||"object"!=typeof t.artifact.transfer)throw new TypeError("Evidence envelope artifact requires a transfer report");let e=t.artifact,r=e.transferBindingVersion===Qi;if(r&&void 0===e.identityBinding||!r&&void 0!==e.identityBinding)throw new TypeError("Evidence envelope artifact has an invalid identity binding");if(![Xi,Qi].includes(e.transferBindingVersion)||"string"!=typeof e.transferFingerprint)throw new TypeError("Evidence envelope artifact requires a supported transfer binding");let a=$a(e);if(e.transferFingerprint!==a)throw new TypeError("Evidence envelope artifact transfer fingerprint does not match its payload");ba({contract:e.contract,transfer:e.transfer,binding:e.identityBinding},"artifact")}for(let e of l.tandem.conflicts)if(!e||"object"!=typeof e||"string"!=typeof e.id||0===e.id.length)throw new TypeError("Evidence envelope tandem conflict requires a non-empty id");if(!Array.isArray(l.tandem.agreements))throw new TypeError("Evidence envelope tandem agreements must be an array");for(let e of l.tandem.agreements)if(!e||"object"!=typeof e||"string"!=typeof e.id||"string"!=typeof e.finding)throw new TypeError("Evidence envelope tandem agreements require string id and finding");let c=t.limits;if(!Array.isArray(c.knownGaps)||!c.knownGaps.every(e=>"string"==typeof e)||!Array.isArray(c.unsupportedClaims)||!c.unsupportedClaims.every(e=>"string"==typeof e)||!c.privacyScope||"object"!=typeof c.privacyScope||Array.isArray(c.privacyScope)||!Object.values(c.privacyScope).every(e=>Array.isArray(e)&&e.every(e=>"string"==typeof e)))throw new TypeError("Evidence envelope limits require arrays and privacy scope");if(void 0!==s.marksObserved&&(!Number.isSafeInteger(s.marksObserved)||0>s.marksObserved))throw new TypeError("Evidence envelope marksObserved must be a non-negative safe integer");if(void 0!==o.claims){if(!Array.isArray(o.claims))throw new TypeError("Evidence envelope claims must be an array");for(let e of o.claims){if(!e||"object"!=typeof e||"string"!=typeof e.claim)throw new TypeError("Evidence envelope claims require a claim string");if(void 0!==e.confidence&&("number"!=typeof e.confidence||!Number.isFinite(e.confidence)))throw new TypeError("Evidence envelope claim confidence must be finite")}}if(n.operations.some(e=>!e||"string"!=typeof e.operation))throw new TypeError("Evidence envelope transform operations require operation strings");if(void 0!==s.marksIntended&&(!Number.isSafeInteger(s.marksIntended)||0>s.marksIntended))throw new TypeError("Evidence envelope marksIntended must be a non-negative safe integer");return e}function Ea(e){let{contract:t,transfer:r,binding:a}=e;if(void 0===t&&void 0===r&&void 0===a)return[];let i=[],n=Array.isArray(a?.mismatchPaths)?a.mismatchPaths.filter(e=>"string"==typeof e):[];return r&&"preserved"!==r.status&&"excluded"!==r.status?i.push({id:"artifact.transfer-invalid",status:"fail",message:`The attached artifact transfer is ${r.status}; its contract cannot be relied on for publication.`}):(!r||void 0===t)&&i.push({id:"artifact.transfer-unknown",status:"unknown",message:"The attached artifact lacks a contract or a transfer report."}),"mismatch"===a?.status||n.length>0?i.push({id:"artifact.identity-mismatch",status:"fail",message:"The attached artifact does not identify this chart input"+(n.length?": "+n.join(", "):".")}):("match"!==a?.status||!Array.isArray(a.mismatchPaths)||!Array.isArray(a.unknownPaths)||a.mismatchPaths.length>0||a.unknownPaths.length>0)&&i.push({id:"artifact.identity-unknown",status:"unknown",message:"The attached artifact identity has not been fully verified."}),i}function Pa(e,t,r){return{id:e,severity:t,message:r}}function Ma(e,t={}){let r=[];try{ja(e)}catch(e){return{status:"fail",ok:!1,findings:[Pa("envelope.invalid","error",e instanceof Error?e.message:"The evidence envelope is invalid.")]}}let a={...e.limits,knownGaps:[...e.limits.knownGaps],unsupportedClaims:[...new Set(e.limits.unsupportedClaims)],privacyScope:Object.fromEntries(Object.entries(e.limits.privacyScope).map(([e,t])=>[e,[...t]]))},i=[{prefix:"",contract:e.artifact?.contract,transfer:e.artifact?.transfer,binding:e.artifact?.identityBinding},{prefix:"render.",contract:e.render.evidence?.artifactContract,transfer:e.render.evidence?.artifactTransfer,binding:e.render.evidence?.artifactBinding}];for(let e of i)for(let t of Ea(e))r.push(Pa(`${e.prefix}${t.id}`,"error",t.message));e.render.evidence&&e.render.evidence.component!==e.chart.component&&r.push(Pa("render.component-mismatch","error","The render evidence names a different chart component."));let n=!1!==t.requireRenderEvidence,s=!1!==t.requireAccessTable,o=!1!==t.failOnCrossModalConflicts;n&&!e.render.evidence&&r.push(Pa("render.missing-evidence","error","Publication requires render evidence proving that intended marks were observed.")),n&&!e.access.ssr.supported&&r.push(Pa("access.ssr-unsupported","error","Publication requires a chart surface registered for server rendering; supplied evidence cannot promote an unsupported capability claim.")),("mismatch"===e.render.parity||"empty"===e.render.evidence?.status)&&r.push(Pa("render.parity-mismatch","error","Intended data did not produce matching observed marks.")),("degenerate"===e.render.evidence?.semanticStatus||"degraded"===e.render.evidence?.semanticStatus)&&r.push(Pa("render.semantic-viability","error",`Render evidence marks the encoding ${e.render.evidence.semanticStatus}.`)),s&&!e.access.table.enabled&&r.push(Pa("access.table-disabled","error","A required exact-value access route is disabled.")),!e.access.navigation.supported&&!0===t.requireNavigation&&r.push(Pa("access.navigation-missing","error","Structured navigation was required but is not available."));let l=e.audit.accessibility;if(l&&"object"==typeof l&&((l.findings??[]).some(e=>!0===e.critical&&"fail"===e.status)||!1===l.ok&&!0!==t.allowAccessibilityWarnings)&&r.push(Pa("audit.accessibility-blocking","error",!0===t.allowAccessibilityWarnings?"Accessibility audit contains critical failures.":"Accessibility audit is not passing.")),o&&e.modalityChecks.tandem.conflicts.length>0){let t=e.modalityChecks.tandem.conflicts.filter(e=>!e.resolution||"unresolved"===e.resolution);t.length>0&&r.push(Pa("modality.unresolved-conflicts","error",t.length+" cross-modal disagreement(s) remain unresolved."))}for(let e of a.unsupportedClaims)r.push(Pa("claim.unsupported","error","Claim is explicitly unsupported: "+e));for(let t of e.meaning.claims??[])if(!1===t.supported||0===t.confidence||!t.evidenceIds?.length){if(a.unsupportedClaims.includes(t.claim))continue;a.unsupportedClaims.push(t.claim),r.push(Pa("claim.unsupported","error",!1===t.supported?"Claim is explicitly unsupported: "+t.claim:"Claim lacks evidence links: "+t.claim))}return{status:r.some(e=>"error"===e.severity)?"fail":"pass",ok:!r.some(e=>"error"===e.severity),findings:r,limits:a}}var Ba=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),Na=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),Fa=/* @__PURE__ */new Set(["PieChart","DonutChart","FunnelChart"]),Ta=/* @__PURE__ */new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),Ia=/* @__PURE__ */Symbol.for("semiotic.chartRecipeRegistry"),Da={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",BumpChart:"bump chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},Ra=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Oa=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),La=/* @__PURE__ */new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),qa={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},Ha={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},Va=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],za={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},Ga=/* @__PURE__ */new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),Ua=/* @__PURE__ */new Set(["system","agent","watcher"]),Wa=/* @__PURE__ */new Set(["ai","agent","system","computed","dbt","great-expectations"]),Ja=/* @__PURE__ */new Set(["rule","statistical-test","llm-inference","computed"]),Ka={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"},_a=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Qa=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Xa=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),Ya=new Set(["MotifBraidChart","DependencyForestChart","FlowCircuitChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"]),Za={title:["BigNumber"],description:[],summary:[]},ei=["title","description","summary"],ti=/* @__PURE__ */new Set(["XYCustomChart","OrdinalCustomChart","NetworkCustomChart","GeoCustomChart","PhysicsCustomChart"]),ri=/* @__PURE__ */new Set([...ti,"XYFrame","OrdinalFrame","NetworkFrame","GeoFrame"]),ai=/* @__PURE__ */new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]),ii=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),ni=new Set(["label","callout","callout-circle","callout-rect"]),si=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),oi=new Set(Object.keys({PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"})),li=/* @__PURE__ */new Set(["BigNumber"]),ci=/* @__PURE__ */new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),ui=/* @__PURE__ */new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),di=/* @__PURE__ */new Set(["OrbitDiagram",...ui]),pi=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),hi=/* @__PURE__ */new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),mi=/* @__PURE__ */new Set(["MultiAxisLineChart"]),fi=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),gi={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},yi=Object.freeze(Object.fromEntries([["AreaChart",13],["BubbleChart",13],["BumpChart",13],["CandlestickChart",13],["ConnectedScatterplot",13],["DifferenceChart",13],["Heatmap",13],["LineChart",13],["MinimapChart",13,"delegated"],["MultiAxisLineChart",13],["QuadrantChart",13],["Scatterplot",13],["ScatterplotMatrix",13,"delegated"],["StackedAreaChart",13],["WaterfallChart",13],["BarChart",13],["BoxPlot",13],["DonutChart",13],["DotPlot",13],["FunnelChart",13],["GaugeChart",5],["GroupedBarChart",13],["Histogram",13],["LikertChart",13],["PieChart",13],["RadarChart",13],["RidgelinePlot",13],["StackedBarChart",13],["SwarmPlot",13],["SwimlaneChart",13],["ViolinPlot",13],["ChordDiagram",13],["CirclePack",13],["DependencyForestChart",1],["ForceDirectedGraph",13],["MotifBraidChart",1],["OrbitDiagram",13],["ProcessSankey",13],["SankeyDiagram",13],["TreeDiagram",13],["Treemap",13],["ChoroplethMap",13],["DistanceCartogram",13],["FlowMap",13],["ProportionalSymbolMap",13],["RealtimeHeatmap",15],["RealtimeHistogram",15],["RealtimeLineChart",15],["RealtimeSwarmChart",15],["RealtimeWaterfallChart",15],["TemporalHistogram",13],["ChainReactionChart",5],["CollisionSwarmChart",13],["CrucibleChart",5],["EventDropChart",13],["FlowCircuitChart",1],["GaltonBoardChart",13],["GauntletChart",5],["PacketFlowChart",13],["ProcessFlowChart",13],["UnitPileChart",13],["BigNumber",1,"not-applicable"],["ParallelCoordinatesRecipe",21],["CalendarHeatmapRecipe",21]].map(([e,t,r="unsupported"])=>[e,{supportsSSR:!!(1&t),realtime:!!(2&t),supportsAccessibleTable:!!(4&t),supportsLegend:!!(8&t),...16&t?{recipeNavigation:!0}:{},markNavigation:r}]))),vi=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),bi=/^\d{4}[-/]\d{2}/,$i=/^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/,wi=/^(x|index|rank|order|step|sequence|year|quarter|qtr|fiscal|month|week|day|date|time|timestamp)$/i,Ci=/* @__PURE__ */new Set(["identifier","measure","dimension","temporal","x","y","size","category","series","time","ignore"]),xi=/^(y|value|amount|total|count|revenue|sales|price|score|rate|population|measure)$/i,Ai=/(size|magnitude|volume|weight|count|amount)/i,ki=/^(category|label|name|type|group|region|segment|kind|class)$/i,Si=/^(series|group|type|category|segment|cohort|product)$/i,ji=/* @__PURE__ */new Set(["numeric"]),Ei=/* @__PURE__ */new Set(["numeric","date"]),Pi=/* @__PURE__ */new Set(["numeric"]),Mi=/* @__PURE__ */new Set(["date"]),Bi=/* @__PURE__ */new Set(["categorical","boolean"]),Ni=/^(source|from|origin|stage|currentstage|sourcestage|fromstage)$/i,Fi=/^(target|to|destination|nextstage|next|targetstage|tostage|destinationstage|status)$/i,Ti=/^(starttime|startedat|enteredat|startdate|start|timestamp|date|time)$/i,Ii=/^(endtime|endedat|exitedat|completedat|finishtime|enddate|end)$/i,Di=/^(value|weight|amount|count|magnitude|volume)$/i,Ri=(e,t)=>(e>>>t|e<<32-t)>>>0,Oi=e=>Math.floor(4294967296*(e-Math.floor(e)))>>>0,[Li,qi]=/* @__PURE__ */(()=>{let e=[],t=[];for(let r=2;64>t.length;r+=1){let a=!0;for(let e=2;r>=e*e;e+=1)if(r%e===0){a=!1;break}a&&(8>e.length&&e.push(Oi(Math.sqrt(r))),t.push(Oi(Math.cbrt(r))))}return[e,t]})(),Hi=/* @__PURE__ */Yr({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}}),Vi=["fresh","stale","unknown"],zi=["partial","provisional","settled","unknown"],Gi=["observedAt","ingestedAt","processedAt","publishedAt","snapshotAt"],Ui={eventTime:{field:{},value:{},timezone:{},granularity:{}},presentation:{state:{values:["live","historical","mixed"]},label:{}},freshness:{status:{required:!0,values:Vi},checkedAt:{},heartbeatAt:{},expiresAt:{},basis:{}},watermark:{value:{required:!0},policy:{},allowedLateness:{}},window:{start:{required:!0},end:{required:!0},status:{required:!0,values:["open","provisional","settled","reopened","corrected"]}},completeness:{status:{required:!0,values:zi},basis:{}},revision:{status:{required:!0,values:["original","backfilled","corrected","superseded"]},previousArtifactId:{},correctionId:{},reason:{}},snapshot:{id:{},format:{values:["iceberg","delta","other"]},schemaVersion:{},catalogRef:{}}},Wi={id:{required:!0},kind:{required:!0,values:["stream","processing-job","quality-check","snapshot","publication"]},label:{},observedAt:{},version:{},timezone:{},granularity:{},freshness:{values:Vi},completeness:{values:zi}},Ji=/* @__PURE__ */new Set(["data","nodes","edges","points","areas","lines","flows","atlas","forest","circuit","edition","reading"]),Ki=/* @__PURE__ */new Set(["data","rawInput","sample","numericFields","network","hierarchy","geo","topValues","distinctValues"]),_i=1,Qi=2,Xi=1;export{_i as CHART_EVIDENCE_ENVELOPE_VERSION,Ma as evaluateEvidenceGate,ja as fromEvidenceEnvelope,$r as stableEvidenceHash,Sa as toEvidenceEnvelope};
|