semiotic 3.8.8 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -66
- package/agent-skill/semiotic-charts/SKILL.md +11 -2
- package/ai/behaviorContracts.cjs +33 -3
- package/ai/cli.js +53 -2
- package/ai/componentMetadata.cjs +15 -0
- package/ai/dist/mcp-server.js +1530 -611
- package/ai/examples.md +48 -42
- package/{CLAUDE.md → ai/reference.md} +46 -24
- package/ai/schema.json +10704 -825
- package/ai/surface-manifest.json +643 -2
- package/ai/system-prompt.md +83 -130
- package/dist/c-3BLJEQNG.min.js +1 -0
- package/dist/c-3KZD6AXJ.min.js +1 -0
- package/dist/c-4TWEX5HG.min.js +1 -0
- package/dist/c-52TEGIUJ.min.js +1 -0
- package/dist/c-5YCIX3VZ.min.js +1 -0
- package/dist/c-6FEKTA3U.min.js +1 -0
- package/dist/c-6O5EVOPH.min.js +1 -0
- package/dist/c-74HEEZGK.min.js +1 -0
- package/dist/c-AKAF6JAD.min.js +1 -0
- package/dist/c-BBKITSXB.min.js +1 -0
- package/dist/c-BWNB6USU.min.js +1 -0
- package/dist/c-C25ENHIK.min.js +1 -0
- package/dist/c-CDR5AO3R.min.js +1 -0
- package/dist/c-COHXCW3Q.min.js +1 -0
- package/dist/{chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js → c-DADXPJXV.min.js} +0 -1
- package/dist/c-E3JFRRMI.min.js +1 -0
- package/dist/c-EBFPQHHO.min.js +1 -0
- package/dist/c-G36WS6LN.min.js +1 -0
- package/dist/c-GIKRQI4X.min.js +1 -0
- package/dist/c-GPYOFETM.min.js +1 -0
- package/dist/c-IDUHYYSI.min.js +1 -0
- package/dist/{chunk-chunk-FQPKOAIH.module.min.js → c-IUHFPMHD.min.js} +0 -1
- package/dist/c-J5G56TUH.min.js +1 -0
- package/dist/c-JAZ73J32.min.js +1 -0
- package/dist/c-KG3NXHAL.min.js +1 -0
- package/dist/c-KII3PLZE.min.js +1 -0
- package/dist/c-LIXGXMNS.min.js +1 -0
- package/dist/c-LVEY6D6B.min.js +1 -0
- package/dist/c-M4Y3BHFR.min.js +1 -0
- package/dist/c-MAIICR2Z.min.js +1 -0
- package/dist/c-MG5DM6VE.min.js +1 -0
- package/dist/{chunk-minimapBrushOverlay-JU57U7NM.module.min.js → c-MNF2S4AA.min.js} +0 -1
- package/dist/c-MT3WBK7M.min.js +1 -0
- package/dist/c-NY3JWV2K.min.js +1 -0
- package/dist/c-O6U6K4CW.min.js +1 -0
- package/dist/c-OCI56QF2.min.js +1 -0
- package/dist/c-OQ7M4AGV.min.js +1 -0
- package/dist/c-OXYMVK7Q.min.js +1 -0
- package/dist/c-PPWDL5ZI.min.js +1 -0
- package/dist/c-QHF5YON3.min.js +1 -0
- package/dist/c-RR3GO5SW.min.js +1 -0
- package/dist/{chunk-chunk-J5QD4RAM.module.min.js → c-RSVIHIQ4.min.js} +0 -1
- package/dist/{chunk-chunk-EMO5NUGE.module.min.js → c-S2BXNNJN.min.js} +0 -1
- package/dist/{chunk-chunk-YCQYG6J5.module.min.js → c-SLGMUBUL.min.js} +0 -1
- package/dist/c-SUILCHWU.min.js +1 -0
- package/dist/c-TZW3JGJ5.min.js +1 -0
- package/dist/c-US5ZFT6E.min.js +1 -0
- package/dist/{chunk-chunk-RZH7VZYS.module.min.js → c-USFMFKIH.min.js} +0 -1
- package/dist/c-UUKVD4WB.min.js +1 -0
- package/dist/{chunk-chunk-SV4XAZ3Q.module.min.js → c-VGW3VG3I.min.js} +0 -1
- package/dist/c-W3CE4A4S.min.js +1 -0
- package/dist/{chunk-chunk-2NVFEB7P.module.min.js → c-WJCD5EUY.min.js} +0 -1
- package/dist/{chunk-chunk-2JGJ5GUG.module.min.js → c-X5UBGU2V.min.js} +0 -1
- package/dist/c-YDAY2WFR.min.js +1 -0
- package/dist/c-ZOWWU34K.min.js +1 -0
- package/dist/components/AccessibleNavTree.d.ts +1 -1
- package/dist/components/CategoryColors.d.ts +1 -1
- package/dist/components/GradientLegend.d.ts +14 -0
- package/dist/components/Legend.d.ts +2 -7
- package/dist/components/LinkedCharts.d.ts +1 -1
- package/dist/components/MobileAnnotationCalloutList.d.ts +1 -1
- package/dist/components/ObservationReadout.d.ts +45 -0
- package/dist/components/ThemeProvider.d.ts +4 -4
- package/dist/components/Tooltip/FlippingTooltip.d.ts +5 -7
- package/dist/components/Tooltip/Tooltip.d.ts +83 -5
- package/dist/components/Tooltip/tooltipChrome.d.ts +43 -0
- package/dist/components/ai/chartCapabilityTypes.d.ts +86 -2
- package/dist/components/ai/chartClinic.d.ts +2 -0
- package/dist/components/ai/deriveProfileFields.d.ts +40 -0
- package/dist/components/ai/evaluateChart.d.ts +85 -0
- package/dist/components/ai/fieldPolicy.d.ts +7 -0
- package/dist/components/ai/fieldRoles.d.ts +24 -0
- package/dist/components/ai/generativeChart.d.ts +18 -2
- package/dist/components/ai/inferIntent.d.ts +26 -2
- package/dist/components/ai/intents.d.ts +35 -0
- package/dist/components/ai/navigationTree.d.ts +2 -2
- package/dist/components/ai/observedSceneAudit.d.ts +2 -1
- package/dist/components/ai/profileData.d.ts +11 -0
- package/dist/components/ai/repairChartConfig.d.ts +2 -3
- package/dist/components/ai/semanticEvidence.d.ts +4 -0
- package/dist/components/ai/semanticViability.d.ts +11 -0
- package/dist/components/ai/semanticViabilityRegistry.d.ts +5 -0
- package/dist/components/ai/streamingTypes.d.ts +4 -0
- package/dist/components/ai/suggestCharts.d.ts +5 -6
- package/dist/components/ai/suggestDashboard.d.ts +2 -3
- package/dist/components/ai/suggestStreamCharts.d.ts +1 -1
- package/dist/components/ai/suggestStretchCharts.d.ts +2 -3
- package/dist/components/ai/suggestionPropContracts.d.ts +20 -0
- package/dist/components/ai/variantDiscovery.d.ts +3 -1
- package/dist/components/charts/custom/NetworkCustomChart.d.ts +3 -0
- package/dist/components/charts/custom/OrdinalCustomChart.d.ts +3 -0
- package/dist/components/charts/custom/XYCustomChart.d.ts +1 -1
- package/dist/components/charts/geo/ChoroplethMap.d.ts +3 -1
- package/dist/components/charts/geo/DistanceCartogram.d.ts +2 -7
- package/dist/components/charts/geo/cartogramOverlay.d.ts +28 -0
- package/dist/components/charts/index.d.ts +4 -3
- package/dist/components/charts/network/ProcessSankey.d.ts +2 -136
- package/dist/components/charts/network/ProcessSankeyProps.d.ts +139 -0
- package/dist/components/charts/network/Treemap.d.ts +2 -1
- package/dist/components/charts/network/processSankey/boundaryHubOrdering.d.ts +23 -0
- package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +2 -0
- package/dist/components/charts/network/processSankey/ordering.d.ts +3 -41
- package/dist/components/charts/network/processSankey/orderingTypes.d.ts +32 -0
- package/dist/components/charts/network/processSankey/packing.d.ts +1 -1
- package/dist/components/charts/network/processSankey/packingCache.d.ts +1 -1
- package/dist/components/charts/network/processSankey/packingOptimization.d.ts +72 -0
- package/dist/components/charts/ordinal/BarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -2
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +2 -2
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +2 -9
- package/dist/components/charts/physics/GauntletChart.d.ts +10 -41
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +1 -1
- package/dist/components/charts/physics/chainReactionAccessibleTable.d.ts +9 -0
- package/dist/components/charts/physics/chainReactionRuntime.d.ts +2 -1
- package/dist/components/charts/physics/chainReactionTypes.d.ts +6 -1
- package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +2 -2
- package/dist/components/charts/physics/crucibleClone.d.ts +6 -0
- package/dist/components/charts/physics/crucibleEffects.d.ts +1 -2
- package/dist/components/charts/physics/crucibleRecord.d.ts +7 -0
- package/dist/components/charts/physics/gauntletChrome.d.ts +4 -4
- package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
- package/dist/components/charts/physics/gauntletPublic.d.ts +4 -0
- package/dist/components/charts/physics/packetFlowOverlay.d.ts +7 -0
- package/dist/components/charts/physics/physicsChartLayout.d.ts +8 -0
- package/dist/components/charts/physics/physicsChartShared.d.ts +3 -1
- package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
- package/dist/components/charts/physics/physicsHocUtils.d.ts +26 -13
- package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +24 -0
- package/dist/components/charts/physics/processFlowOverlays.d.ts +9 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +17 -12
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +12 -7
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +37 -14
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +23 -14
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +22 -13
- package/dist/components/charts/realtime/aggregate.d.ts +4 -1
- package/dist/components/charts/realtime/eventTime.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +27 -0
- package/dist/components/charts/realtime/realtimeChartTypes.d.ts +30 -0
- package/dist/components/charts/realtime/useRealtimeCategoryColors.d.ts +30 -0
- package/dist/components/charts/shared/FrameTextAnnotationSVG.d.ts +10 -0
- package/dist/components/charts/shared/annotationActivation.d.ts +3 -7
- package/dist/components/charts/shared/annotationBandFill.d.ts +6 -0
- package/dist/components/charts/shared/annotationDispatch.d.ts +31 -0
- package/dist/components/charts/shared/annotationIdentity.d.ts +8 -0
- package/dist/components/charts/shared/annotationRules.d.ts +1 -15
- package/dist/components/charts/shared/boundedCategoryRegistry.d.ts +8 -0
- package/dist/components/charts/shared/chainReactionChartSpec.d.ts +3 -0
- package/dist/components/charts/shared/chartMode.d.ts +3 -2
- package/dist/components/charts/shared/chartSpecCore.d.ts +1 -0
- package/dist/components/charts/shared/formatUtils.d.ts +40 -9
- package/dist/components/charts/shared/frameTextAnnotation.d.ts +63 -0
- package/dist/components/charts/shared/gradient.d.ts +16 -0
- package/dist/components/charts/shared/hatchFill.d.ts +15 -0
- package/dist/components/charts/shared/hooks.d.ts +4 -4
- package/dist/components/charts/shared/legendUtils.d.ts +1 -0
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +3 -1
- package/dist/components/charts/shared/styleRules.d.ts +9 -2
- package/dist/components/charts/shared/styleRulesWireSchema.d.ts +353 -0
- package/dist/components/charts/shared/types.d.ts +26 -10
- package/dist/components/charts/shared/useChartLegend.d.ts +43 -9
- package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +5 -2
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +5 -1
- package/dist/components/charts/shared/useOrdinalBrush.d.ts +3 -3
- package/dist/components/charts/shared/useStreamingLegend.d.ts +6 -1
- package/dist/components/charts/value/types.d.ts +1 -1
- package/dist/components/charts/xy/BubbleChart.d.ts +1 -1
- package/dist/components/charts/xy/BumpChart.capability.d.ts +14 -1
- package/dist/components/charts/xy/BumpChart.d.ts +13 -73
- package/dist/components/charts/xy/BumpChart.semanticViability.d.ts +5 -0
- package/dist/components/charts/xy/CandlestickChart.d.ts +2 -2
- package/dist/components/charts/xy/LineChart.d.ts +2 -2
- package/dist/components/charts/xy/Scatterplot.d.ts +1 -1
- package/dist/components/charts/xy/bumpData.d.ts +44 -0
- package/dist/components/charts/xy/bumpIdentity.d.ts +2 -0
- package/dist/components/charts/xy/bumpLayout.d.ts +45 -0
- package/dist/components/charts/xy/bumpTooltip.d.ts +20 -0
- package/dist/components/legendLayout.d.ts +131 -4
- package/dist/components/realtime/ReorderBuffer.d.ts +2 -0
- package/dist/components/realtime/types.d.ts +10 -1
- package/dist/components/recipes/balanceSnapshotsToFlows.d.ts +42 -0
- package/dist/components/recipes/directedReachability.d.ts +14 -0
- package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +6 -6
- package/dist/components/recipes/gridObservatory.d.ts +1 -1
- package/dist/components/recipes/networkAnalysis.d.ts +1 -18
- package/dist/components/recipes/physics.d.ts +7 -4
- package/dist/components/recipes/processPhysics.d.ts +0 -1
- package/dist/components/recipes/waffle.d.ts +7 -4
- package/dist/components/semiotic-ai-core.d.ts +13 -4
- package/dist/components/semiotic-ai-observations.d.ts +3 -0
- package/dist/components/semiotic-ai.d.ts +16 -9
- package/dist/components/semiotic-client-shared.d.ts +10 -0
- package/dist/components/semiotic-experimental.d.ts +1 -1
- package/dist/components/semiotic-geo.d.ts +4 -1
- package/dist/components/semiotic-network.d.ts +7 -4
- package/dist/components/semiotic-ordinal.d.ts +4 -1
- package/dist/components/semiotic-physics.d.ts +11 -4
- package/dist/components/semiotic-realtime-core.d.ts +11 -4
- package/dist/components/semiotic-realtime-react.d.ts +4 -3
- package/dist/components/semiotic-realtime.d.ts +3 -1
- package/dist/components/semiotic-recipes-core.d.ts +7 -5
- package/dist/components/semiotic-server-edge.d.ts +3 -2
- package/dist/components/semiotic-server.d.ts +3 -2
- package/dist/components/semiotic-themes-core.d.ts +5 -48
- package/dist/components/semiotic-utils-core.d.ts +11 -5
- package/dist/components/semiotic-utils-react.d.ts +2 -0
- package/dist/components/semiotic-xy.d.ts +4 -1
- package/dist/components/semiotic.d.ts +68 -25
- package/dist/components/server/animatedGif.d.ts +1 -1
- package/dist/components/server/renderEvidence.d.ts +25 -2
- package/dist/components/server/renderToStaticSVG.d.ts +15 -7
- package/dist/components/server/serverChartConfigShared.d.ts +8 -1
- package/dist/components/server/serverChartConfigs.d.ts +1 -0
- package/dist/components/server/serverChartConfigsNetwork.d.ts +3 -3
- package/dist/components/server/serverChartConfigsNetworkChord.d.ts +2 -0
- package/dist/components/server/serverChartConfigsNetworkForce.d.ts +2 -0
- package/dist/components/server/serverChartConfigsNetworkHierarchy.d.ts +3 -0
- package/dist/components/server/serverChartConfigsXY.d.ts +3 -3
- package/dist/components/server/serverChartConfigsXYBubble.d.ts +5 -0
- package/dist/components/server/serverChartConfigsXYBump.d.ts +7 -0
- package/dist/components/server/serverChartConfigsXYScatter.d.ts +5 -0
- package/dist/components/server/staticAnnotationFallbacks.d.ts +10 -0
- package/dist/components/server/staticAnnotations.d.ts +28 -1
- package/dist/components/server/staticAxisTickLabel.d.ts +13 -0
- package/dist/components/server/staticLegend.d.ts +1 -1
- package/dist/components/server/staticLegendMargin.d.ts +41 -0
- package/dist/components/server/staticOrdinal.d.ts +8 -2
- package/dist/components/server/staticPhysics.d.ts +13 -1
- package/dist/components/server/staticPhysicsChrome.d.ts +20 -0
- package/dist/components/server/staticRawLegend.d.ts +15 -0
- package/dist/components/server/staticSVGChrome.d.ts +16 -55
- package/dist/components/server/staticXYAxes.d.ts +27 -0
- package/dist/components/server/staticXYAxisTicks.d.ts +39 -0
- package/dist/components/server/staticXYGrid.d.ts +11 -0
- package/dist/components/server/themeResolver.d.ts +5 -1
- package/dist/components/store/ThemeStore.d.ts +2 -98
- package/dist/components/store/designTokens.d.ts +1 -1
- package/dist/components/store/themeCSSVariables.d.ts +10 -0
- package/dist/components/store/themeCore.d.ts +91 -0
- package/dist/components/store/themePresets.d.ts +81 -0
- package/dist/components/store/themeSerialization.d.ts +2 -1
- package/dist/components/stream/AccessibleDataTable.d.ts +12 -14
- package/dist/components/stream/AccessibleTablePortalImpl.d.ts +6 -0
- package/dist/components/stream/GeoTileRenderer.d.ts +3 -0
- package/dist/components/stream/NetworkCanvasHitTester.d.ts +3 -1
- package/dist/components/stream/NetworkSSRFrame.d.ts +2 -1
- package/dist/components/stream/NetworkSVGOverlay.d.ts +3 -31
- package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -0
- package/dist/components/stream/SVGChartTitle.d.ts +9 -0
- package/dist/components/stream/SVGOverlay.d.ts +1 -21
- package/dist/components/stream/SVGUnderlay.d.ts +24 -0
- package/dist/components/stream/SceneToSVG.d.ts +1 -1
- package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
- package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
- package/dist/components/stream/StreamXYFrame.d.ts +1 -1
- package/dist/components/stream/accessibleDataRows.d.ts +11 -0
- package/dist/components/stream/accessibleDataTableModel.d.ts +40 -0
- package/dist/components/stream/accessibleTableTypes.d.ts +11 -0
- package/dist/components/stream/axisTickUtils.d.ts +19 -0
- package/dist/components/stream/canvasBackground.d.ts +10 -0
- package/dist/components/stream/canvasSetup.d.ts +24 -4
- package/dist/components/stream/frameCursorInteraction.d.ts +25 -0
- package/dist/components/stream/frameDefaultMargins.d.ts +37 -0
- package/dist/components/stream/frameGraphics.d.ts +18 -0
- package/dist/components/stream/frameGraphicsSubscription.d.ts +26 -0
- package/dist/components/stream/frameLegendOptions.d.ts +18 -0
- package/dist/components/stream/geoFrameCursorInteraction.d.ts +9 -0
- package/dist/components/stream/geoFrameHelpers.d.ts +29 -1
- package/dist/components/stream/geoTypes.d.ts +12 -11
- package/dist/components/stream/hitTarget.d.ts +61 -2
- package/dist/components/stream/moduleWorkerSession.d.ts +6 -0
- package/dist/components/stream/networkAnnotationAnchors.d.ts +37 -0
- package/dist/components/stream/networkCustomLayout.d.ts +2 -2
- package/dist/components/stream/networkFrameCursorInteraction.d.ts +12 -0
- package/dist/components/stream/networkFrameInteraction.d.ts +2 -0
- package/dist/components/stream/networkFramePaint.d.ts +15 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +1 -1
- package/dist/components/stream/networkTypes.d.ts +32 -32
- package/dist/components/stream/normalizeXYData.d.ts +7 -0
- package/dist/components/stream/ordinalFrameCursorInteraction.d.ts +7 -0
- package/dist/components/stream/ordinalFrameInteraction.d.ts +29 -0
- package/dist/components/stream/ordinalSceneSVG.d.ts +10 -0
- package/dist/components/stream/ordinalTypes.d.ts +12 -4
- package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +9 -1
- package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +25 -0
- package/dist/components/stream/physics/PhysicsControllers.d.ts +0 -3
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +4 -1
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +3 -24
- package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +9 -21
- package/dist/components/stream/physics/PhysicsSettledSVGElement.d.ts +37 -0
- package/dist/components/stream/physics/PhysicsSettledScene.d.ts +7 -3
- package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +1 -1
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +25 -4
- package/dist/components/stream/physics/physicsAnnotationContext.d.ts +19 -0
- package/dist/components/stream/physics/physicsBodyCanvas.d.ts +4 -0
- package/dist/components/stream/physics/physicsSettledChrome.d.ts +7 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +32 -0
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +36 -0
- package/dist/components/stream/pipelineConfig.d.ts +8 -17
- package/dist/components/stream/pipelineDomainResolution.d.ts +2 -2
- package/dist/components/stream/renderBackend.d.ts +2 -0
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +13 -2
- package/dist/components/stream/renderers/resolveCSSColor.d.ts +7 -0
- package/dist/components/stream/responsiveSize.d.ts +17 -0
- package/dist/components/stream/sceneCursor.d.ts +41 -0
- package/dist/components/stream/sceneRevisionDiagnostics.d.ts +1 -1
- package/dist/components/stream/svgOverlayUtils.d.ts +22 -1
- package/dist/components/stream/types.d.ts +33 -13
- package/dist/components/stream/useCanvasFrameHost.d.ts +12 -1
- package/dist/components/stream/useFrame.d.ts +24 -1
- package/dist/components/stream/useResponsiveSize.d.ts +6 -1
- package/dist/components/stream/useStalenessCheck.d.ts +1 -1
- package/dist/components/stream/xyFrameAxisTypes.d.ts +20 -4
- package/dist/components/stream/xyFrameCursorInteraction.d.ts +6 -0
- package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +1 -1
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -26
- package/dist/components/types/legendTypes.d.ts +6 -0
- package/dist/components/types/marginType.d.ts +7 -8
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/forceLayoutWorker.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.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.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-ai-core.d.ts +13 -4
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +16 -9
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1 -0
- package/dist/semiotic-client-glyph.module.min.js +2 -0
- package/dist/semiotic-client-responsive.module.min.js +2 -0
- package/dist/semiotic-client-shared.module.min.js +2 -0
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +2 -0
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -0
- package/dist/semiotic-experimental-node.module.min.js +2 -0
- package/dist/semiotic-experimental-react-shared.module.min.js +2 -0
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-experimental.d.ts +1 -1
- package/dist/semiotic-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-geo.d.ts +4 -1
- package/dist/semiotic-network.d.ts +7 -4
- package/dist/semiotic-ordinal.d.ts +4 -1
- package/dist/semiotic-physics.d.ts +11 -4
- package/dist/semiotic-realtime-core.d.ts +11 -4
- package/dist/semiotic-realtime-core.min.js +2 -1
- package/dist/semiotic-realtime-core.module.min.js +2 -1
- package/dist/semiotic-realtime-react.d.ts +4 -3
- package/dist/semiotic-realtime-react.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-realtime.d.ts +3 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -0
- package/dist/semiotic-recipes-core.d.ts +7 -5
- package/dist/semiotic-recipes-core.min.js +9 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -0
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-recipes-react.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +7 -1
- package/dist/semiotic-recipes.module.min.js +2 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -0
- package/dist/semiotic-server-edge.d.ts +3 -2
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-server.d.ts +3 -2
- package/dist/semiotic-themes-core.d.ts +5 -48
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes-react.min.js +1 -1
- package/dist/semiotic-themes-react.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.d.ts +11 -5
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.d.ts +2 -0
- package/dist/semiotic-utils-react.min.js +1 -1
- package/dist/semiotic-utils-react.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +2 -1
- package/dist/semiotic-utils.module.min.js +2 -1
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +4 -1
- package/dist/semiotic.d.ts +68 -25
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +53 -19
- package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +0 -20
- package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +0 -2
- package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +0 -1
- package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +0 -2
- package/dist/chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js +0 -2
- package/dist/chunk-chunk-2B3AIKUZ.module.min.js +0 -2
- package/dist/chunk-chunk-2CXCXRB4.module.min.js +0 -1
- package/dist/chunk-chunk-3GCILWPB.module.min.js +0 -2
- package/dist/chunk-chunk-46KRGJQP.module.min.js +0 -1
- package/dist/chunk-chunk-4ITOQRXM.module.min.js +0 -2
- package/dist/chunk-chunk-4MLLQUGW.module.min.js +0 -2
- package/dist/chunk-chunk-57RBPDBQ.module.min.js +0 -2
- package/dist/chunk-chunk-5UKL5W76.module.min.js +0 -2
- package/dist/chunk-chunk-5VVNW5AZ.module.min.js +0 -1
- package/dist/chunk-chunk-66PCWJUG.module.min.js +0 -1
- package/dist/chunk-chunk-6V5VQVCT.module.min.js +0 -2
- package/dist/chunk-chunk-7LE56WAE.module.min.js +0 -2
- package/dist/chunk-chunk-7T25U75Z.module.min.js +0 -2
- package/dist/chunk-chunk-ACLDBMRH.module.min.js +0 -2
- package/dist/chunk-chunk-AF53TBSN.module.min.js +0 -2
- package/dist/chunk-chunk-BTZYH2IE.module.min.js +0 -1
- package/dist/chunk-chunk-BWV55BZK.module.min.js +0 -2
- package/dist/chunk-chunk-BZNOAHJV.module.min.js +0 -2
- package/dist/chunk-chunk-CD6PVVS3.module.min.js +0 -2
- package/dist/chunk-chunk-DTSNLGRK.module.min.js +0 -2
- package/dist/chunk-chunk-FC3NZWYR.module.min.js +0 -2
- package/dist/chunk-chunk-FEPXDKJP.module.min.js +0 -1
- package/dist/chunk-chunk-FJ76HWQZ.module.min.js +0 -1
- package/dist/chunk-chunk-FRGBMTZR.module.min.js +0 -1
- package/dist/chunk-chunk-G75OPF5N.module.min.js +0 -2
- package/dist/chunk-chunk-H5IFO6CU.module.min.js +0 -2
- package/dist/chunk-chunk-HADHLMY5.module.min.js +0 -1
- package/dist/chunk-chunk-HBFA4NN6.module.min.js +0 -1
- package/dist/chunk-chunk-HCNDE26Q.module.min.js +0 -2
- package/dist/chunk-chunk-IY7RYD4S.module.min.js +0 -1
- package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
- package/dist/chunk-chunk-J3XWETBJ.module.min.js +0 -2
- package/dist/chunk-chunk-JJ4BSUYL.module.min.js +0 -2
- package/dist/chunk-chunk-JRHXQGEV.module.min.js +0 -2
- package/dist/chunk-chunk-KTWEBFMX.module.min.js +0 -2
- package/dist/chunk-chunk-L6FFYGYS.module.min.js +0 -1
- package/dist/chunk-chunk-LJDH3WV3.module.min.js +0 -2
- package/dist/chunk-chunk-LSJUXBMF.module.min.js +0 -1
- package/dist/chunk-chunk-N3Q33XCB.module.min.js +0 -2
- package/dist/chunk-chunk-NWIGA3UK.module.min.js +0 -1
- package/dist/chunk-chunk-OG3TTJGJ.module.min.js +0 -2
- package/dist/chunk-chunk-OZK46A5U.module.min.js +0 -1
- package/dist/chunk-chunk-PMR47KRY.module.min.js +0 -2
- package/dist/chunk-chunk-Q2YADC2V.module.min.js +0 -2
- package/dist/chunk-chunk-QQJNG23C.module.min.js +0 -2
- package/dist/chunk-chunk-RGJ6TKAH.module.min.js +0 -2
- package/dist/chunk-chunk-ROP4HI7H.module.min.js +0 -2
- package/dist/chunk-chunk-SFLUSZ73.module.min.js +0 -2
- package/dist/chunk-chunk-TCMHJWFJ.module.min.js +0 -1
- package/dist/chunk-chunk-TSCFL235.module.min.js +0 -1
- package/dist/chunk-chunk-U66USBWU.module.min.js +0 -1
- package/dist/chunk-chunk-UEZ6SHW5.module.min.js +0 -2
- package/dist/chunk-chunk-UOQRPGPK.module.min.js +0 -2
- package/dist/chunk-chunk-VUWYT7DY.module.min.js +0 -2
- package/dist/chunk-chunk-W5HWGQMD.module.min.js +0 -2
- package/dist/chunk-chunk-WFHZHWT7.module.min.js +0 -1
- package/dist/chunk-chunk-WGROBM3I.module.min.js +0 -2
- package/dist/chunk-chunk-WSDJFBKX.module.min.js +0 -2
- package/dist/chunk-chunk-YHNZCPOZ.module.min.js +0 -2
- package/dist/chunk-chunk-YWZB3KPI.module.min.js +0 -2
- package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +0 -2
- package/dist/components/stream/test-utils/frameScheduler.d.ts +0 -12
- package/dist/components/stream/test-utils/revisionConsumption.d.ts +0 -13
- package/dist/test-utils/canvasMock.d.ts +0 -86
- package/dist/test-utils/capturedFrameProps.d.ts +0 -67
- package/dist/test-utils/frameMock.d.ts +0 -81
- package/dist/test-utils/ordinalFixtures.d.ts +0 -48
- /package/dist/{chunk-chunk-JJ2OOIET.module.min.js → c-GGISSW5E.min.js} +0 -0
- /package/dist/{chunk-chunk-SIRIJ3DY.module.min.js → c-N4G2L7ID.min.js} +0 -0
- /package/dist/{chunk-chunk-CA3YDW6F.module.min.js → c-S6U5CGT5.min.js} +0 -0
- /package/dist/components/recipes/{mobileAnnotationStrategy.d.ts → mobileAnnotationBehavior.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolveAccessor as e,resolveRawAccessor as t}from"./c-RR3GO5SW.min.js";import{filterAnnotationsByStatus as i}from"./c-GPYOFETM.min.js";import{ChartErrorBoundary as n,DataSummaryProvider as r,LinkedCharts as a,annotationStableId as o,resolveResponsiveRules as s,useChartObserver as l,useDataSummaryToggle as c,useLinkedChartsActive as d,useSelection as u}from"./c-GIKRQI4X.min.js";import{useObservationSelector as m}from"./c-YDAY2WFR.min.js";import{getMinMax as h}from"./c-WJCD5EUY.min.js";async function p(e,t){const{format:i="png",filename:n="chart",scale:r=2,background:a="white"}=t||{},o=e.querySelector("svg");if(!o)throw Error("No SVG element found in the container");const s=o.cloneNode(!0),l=o.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",l.width+""),s.getAttribute("height")||s.setAttribute("height",l.height+""),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),f(o,s),"svg"===i){const e=(new XMLSerializer).serializeToString(s);g(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),n+".svg")}else{const t=l.width*r,i=l.height*r,o=document.createElement("canvas");o.width=t,o.height=i;const c=o.getContext("2d");c.fillStyle=a,c.fillRect(0,0,t,i),c.scale(r,r);const d=e.querySelector("canvas");d&&c.drawImage(d,0,0,l.width,l.height);const u=(new XMLSerializer).serializeToString(s),m=new Blob([u],{type:"image/svg+xml;charset=utf-8"}),h=URL.createObjectURL(m),p=new Image;p.width=l.width,p.height=l.height,await new Promise((e,t)=>{p.onload=()=>{c.drawImage(p,0,0),o.toBlob(i=>{i?(g(i,n+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(h)},p.onerror=()=>{URL.revokeObjectURL(h),t(Error("Failed to load SVG image"))},p.src=h})}}function f(e,t){const i=e.children,n=t.children,r=window.getComputedStyle(e),a=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(const e of a){const i=r.getPropertyValue(e);i&&"none"!==i&&""!==i&&t.style?.setProperty(e,i)}for(let e=0;Math.min(i.length,n.length)>e;e++)f(i[e],n[e])}function g(e,t){const i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(i)}var b=["value","threshold","partition-boundary","time-window","range-boundary"];function y({controlType:e,controlId:t,chartId:i,chartType:n="VisualizationControl",onObservation:r}){return(a,o,s)=>{r?.({type:a,controlType:e,value:o,chartType:n,timestamp:Date.now(),...t?{controlId:t}:{},...i?{chartId:i}:{},...s?{source:s}:{}})}}function v(e,t,i,n,r){return{id:e,...t?{controlId:t}:{},status:i,message:n,...r?{remediation:r}:{}}}function x({controls:e=[],minimumTargetSize:t=24}){const i=[],n=new Set;for(const r of e){const e=r?.id,a="controls."+(e||"unknown"),o=r?.domain,s=Array.isArray(o)&&2===o.length&&Number.isFinite(o[0])&&Number.isFinite(o[1])&&o[1]>o[0],l=b.includes(r?.type),c="string"==typeof r?.target&&r.target.trim().length>0,d=["slider","buttons","native-range"].includes(r?.keyboard??""),u=r?.minimumTargetSize;i.push(v(a+".semantic-type",e,l?"pass":"fail",l?`Control uses the semantic type "${r.type}".`:"Control has no recognized semantic type.","Use one of VISUALIZATION_CONTROL_TYPES.")),i.push(v(a+".state-binding",e,c?"pass":"fail",c?`Control is bound to "${r.target}".`:"Control has no declarative state binding.","Declare the controlled state key with target.")),i.push(v(a+".domain",e,s?"pass":"fail",s?"Control has a finite ordered value domain.":"Control has no finite ordered value domain.","Declare domain as [minimum, maximum].")),i.push(v(a+".keyboard",e,d?"pass":"fail",d?`Control declares a ${r.keyboard} keyboard path.`:"Control does not declare a keyboard path.","Declare slider, buttons, or native-range keyboard interaction.")),i.push(v(a+".value-text",e,"string"==typeof r?.valueText&&r.valueText.trim().length>0?"pass":"fail","string"==typeof r?.valueText&&r.valueText.trim().length>0?"Control declares human-readable value text.":"Control does not declare human-readable value text.","Provide valueText, typically with a {value} placeholder.")),i.push(v(a+".target-size",e,"number"!=typeof u||t>u?"fail":"pass","number"!=typeof u||t>u?`Control target is below the ${t}px minimum or undeclared.`:`Control declares a ${u}px target.`,`Declare minimumTargetSize of at least ${t}.`)),null!=r?.step&&i.push(v(a+".step",e,Number.isFinite(r.step)&&r.step>0?"pass":"fail",Number.isFinite(r.step)&&r.step>0?"Control has a positive quantization step.":"Control step must be a positive finite number.","Use a positive finite step.")),r?.observations?.length&&i.push(v(a+".observations",e,r.observations.includes("control-change")?"pass":"warn",r.observations.includes("control-change")?"Control declares control-change observation coverage.":"Control declares observations but omits control-change.","Include control-change so observable state changes are represented.")),e&&!n.has(e)||i.push(v(a+".identity",e,"fail",e?"Control id is duplicated.":"Control id is missing.","Use a unique stable control id.")),e&&n.add(e)}return{ok:i.every(e=>"fail"!==e.status),findings:i}}function w(e){return C(e),e}function C(e){if(!e||"object"!=typeof e)throw Error("Chart recipe must be an object.");if("string"!=typeof e.id||""===e.id.trim())throw Error("Chart recipe requires a non-empty id.");if("string"!=typeof e.name||""===e.name.trim())throw Error(`Chart recipe "${e.id}" requires a non-empty name.`);if(!Array.isArray(e.dataRoles)||0===e.dataRoles.length)throw Error(`Chart recipe "${e.id}" requires at least one data role.`);if(!Array.isArray(e.intents)||0===e.intents.length)throw Error(`Chart recipe "${e.id}" requires at least one intent.`);for(const t of e.intents)if("string"!=typeof t&&(!t||"string"!=typeof t.id&&"string"!=typeof t.name))throw Error(`Chart recipe "${e.id}" has an intent without an id or name.`);if(!e.designContract?.whyCustom)throw Error(`Chart recipe "${e.id}" requires designContract.whyCustom.`);if(!e.accessibility||"object"!=typeof e.accessibility)throw Error(`Chart recipe "${e.id}" requires accessibility expectations.`);if(void 0!==e.controls){const t=x({controls:e.controls}).findings.filter(e=>"fail"===e.status);if(t.length>0)throw Error(`Chart recipe "${e.id}" has invalid controls: ${t.map(e=>e.message).join(" ")}`)}if("portable"===e.portability){if(!k(e.layout))throw Error(`Portable chart recipe "${e.id}" must reference a registered layout by id.`);const t=e.layoutConfigSchema??e.portabilityConfig?.schema;if(!t)throw Error(`Portable chart recipe "${e.id}" requires a serializable layout config schema.`);if(!$(t))throw Error(`Portable chart recipe "${e.id}" has a layout config schema that is not JSON-safe.`)}}function k(e){return!!e&&"object"==typeof e&&"string"==typeof e.id}function $(e,t=new Set){if(null===e)return!0;const i=typeof e;if("string"===i||"boolean"===i)return!0;if("number"===i)return Number.isFinite(e);if("object"!==i)return!1;if(t.has(e))return!1;t.add(e);const n=Array.isArray(e)?e.every(e=>$(e,t)):Object.entries(e).every(([,e])=>$(e,t));return t.delete(e),n}function S(e){return"string"==typeof e?e:e.id??e.name}function A(e){return"string"==typeof e?3:"number"==typeof e.score&&Number.isFinite(e.score)?Math.max(0,Math.min(5,e.score>1?e.score:5*e.score)):"primary"===e.strength?5:"secondary"===e.strength?3:"supporting"===e.strength?2:3}function j(e){const t=new Set(e.intents.map(S));return t.has("geo")?"geo":t.has("hierarchy")?"hierarchy":t.has("flow")?"flow":t.has("relationship")?"network":t.has("distribution")?"distribution":t.has("correlation")?"relationship":t.has("trend")||t.has("composition-over-time")?"time-series":t.has("compare-categories")||t.has("rank")||t.has("part-to-whole")?"categorical":"custom"}function N(e){const t=Object.values(e.audience?.familiarity??{}),i=t.find(e=>"number"==typeof e);if(void 0!==i)return Math.max(1,Math.min(5,Math.round(i)));const n=t.filter(e=>"string"==typeof e);return n.includes("high")?4:n.includes("medium")?3:n.includes("low")?2:e.reception?.memorableForm?3:2}function I(e,t){return"nodes"===t?e.network?.nodes??[]:"edges"===t?e.network?.edges??[]:"areas"===t?e.geo?.features??[]:"points"===t?e.geo?.points??[]:"lines"===t?e.geo?.flows??[]:e.data}function M(e,t,i){return I(e,t.source).some(e=>null!=e&&Object.prototype.hasOwnProperty.call(e,i))}function L(e,t,i){if(t.field&&M(i,t,t.field))return t.field;if("nodes"===t.source||"edges"===t.source){const e="node-id"===t.role?"id":"edge-source"===t.role?"source":"edge-target"===t.role?"target":void 0;if(e&&M(i,t,e))return e}switch(t.semanticType){case"quantitative":return i.primary.y??i.primary.size??i.primary.x;case"temporal":return i.primary.time??i.primary.x;case"nominal":case"ordinal":return i.primary.category??i.primary.series;case"identifier":{const e=I(i,t.source);return["id","key","name"].find(t=>e.some(e=>null!=e&&Object.prototype.hasOwnProperty.call(e,t)))}case"geographic":return i.hasGeo?t.field:void 0;default:return t.field}}function P(e){const t={},i=[];for(const n of e.intents){const e=S(n);e&&(t[e]=A(n),"string"!=typeof n&&n.rationale&&i.push(n.rationale))}i.push(...(e.reception?.strengths??[]).map(e=>"Reception strength: "+e));const n=e.reception?.risks??[],r=e.designContract.misuse??[],a=[...e.designContract.caveats??[],...e.caveats??[]];return{component:e.id,displayName:e.name,candidateKind:"recipe",family:j(e),renderingFamily:e.frameFamily,importPath:"semiotic/ai",rubric:{familiarity:N(e),accuracy:4,precision:n.some(e=>/precis|comparison/i.test(e))?2:3},fits:t=>function(e,t){for(const i of e.dataRoles)if(!1!==i.required&&!L(0,i,t))return`needs data role "${i.role}" (${i.semanticType})`;const i=e.audit?.maxCategories;return"number"==typeof i&&"number"==typeof t.categoryCount&&t.categoryCount>i?`${t.categoryCount} categories exceeds this recipe's declared maximum of ${i}`:null}(e,t),intentScores:t,caveats:()=>[...n,...r,...a],buildProps:t=>function(e,t){const i={};for(const n of e.dataRoles){const e=L(0,n,t);e&&n.accessor&&(i[n.accessor]=e)}const n={recipeId:e.id,layoutConfig:i};e.frameFamily.startsWith("Network")?(n.nodes=t.network?.nodes??t.data,n.edges=t.network?.edges??[]):e.frameFamily.startsWith("Geo")?(n.areas=t.geo?.features??[],n.points=t.geo?.points??t.data,n.lines=t.geo?.flows??[]):n.data=t.data;const r=e.mobile??("number"==typeof e.accessibility.minimumHitTarget?{minimumHitTarget:e.accessibility.minimumHitTarget}:void 0);return r&&(n.mobileSemantics=r),n}(e,t),mobile:e.mobile??("number"==typeof e.accessibility.minimumHitTarget?{minimumHitTarget:e.accessibility.minimumHitTarget}:void 0),recipe:e,positiveRationale:i,whyCustom:{defaultAlternative:e.designContract.defaultAlternative,reason:e.designContract.whyNotDefault??e.designContract.whyCustom,tradeoff:e.designContract.tradeoff??(n.length>0?n[0]:void 0)}}}var z=Symbol.for("semiotic.chartRecipeRegistry");function R(){const e=globalThis;return e[z]||(e[z]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[z]}function T(e){C(e),R().recipes.set(e.id,e),R().capabilities.set(e.id,P(e))}function B(e){R().recipes.delete(e),R().capabilities.delete(e)}function F(e){return R().recipes.get(e)}function D(){return Array.from(R().recipes.values())}function E(){return Array.from(R().capabilities.values())}function O(){return R().capabilities.size>0}function H(e,t){if(!e)throw Error("Recipe layout requires a non-empty id.");if("function"!=typeof t)throw Error(`Recipe layout "${e}" must be a function.`);R().layouts.set(e,t)}function W(e){R().layouts.delete(e)}function U(e){return R().layouts.get(e)}function G(e){return"string"==typeof e?F(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}var V=["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","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"],q=new Set(V);function J(e){return q.has(e)}function Z(e){return"string"==typeof e?e:e.id??e.name}function _(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 X(e,t,i){return i??G(t.recipe)??G(t.recipeId)??F(e)}function K(e,t,i=[]){const n=e.accessor?t[e.accessor]:void 0;if("string"==typeof n&&n)return n;if(e.field)return e.field;const r=i.find(e=>e&&"object"==typeof e);if(!r)return;const a=Object.entries(r).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?a.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in r):a.find(([,e])=>"string"==typeof e)?.[0]}function Q(e,t){return e.dataRoles.find(e=>e.role===t)}function ee(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function te(e,t,i,n,r,a={}){const o={...a};if(t)for(const[e,i]of Object.entries(t))o[e]=i;for(const e of i.dataRoles){const i=K(e,n,r),a=t&&i?t[i]:i;void 0!==a&&(o[e.role]=a)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{const i=o[t];return null==i?`{${t}}`:i+""})}var ie=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend","recipe","layout"]),ne=new Set(["data","nodes","edges","points","areas","lines","flows"]);function re(e){if(null==e)return e;if("function"==typeof e)return;if("object"!=typeof e)return e;if(e.$$typeof)return;if(Array.isArray(e))return e.map(re).filter(e=>void 0!==e);if(e instanceof Date)return e;const t={};for(const[i,n]of Object.entries(e)){if("function"==typeof n)continue;if(n&&"object"==typeof n&&n.$$typeof)continue;const e=re(n);void 0!==e&&(t[i]=e)}return t}function ae(e,t){return!!ne.has(e)&&("areas"!==e||"string"!=typeof t)}var oe="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function se(e,t,i){const n=F(e)??G(t.recipe)??G(t.recipeId);if(n)return function(e,t,i){const n=function(e,t,i){const n={};for(const[r,a]of Object.entries(e))if(null!=a&&!ie.has(r)&&"recipeId"!==r&&(t||!ae(r,a)))if("function"==typeof a||a?.$$typeof){if(i)throw Error(`Portable recipe prop "${r}" is not JSON-safe.`)}else if($(a))n[r]=oe(a);else if(i)throw Error(`Portable recipe prop "${r}" is not JSON-safe.`);return n}(t,!1!==i?.includeData,"portable"===e.portability),r=e.intents.map(Z).filter(e=>!!e),a={name:e.name,intents:r,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily};if("portable"===e.portability){if(!$(n))throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:n,manifest:a,version:"1",createdAt:(new Date).toISOString(),...i?.selections?{selections:i.selections}:{}}}return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:"Recipe contains or may depend on non-serializable local layout callbacks.",warnings:["This config is inspectable but cannot be rendered remotely by CLI or MCP."],props:n,manifest:a,version:"1",createdAt:(new Date).toISOString(),...i?.selections?{selections:i.selections}:{}}}(n,t,i);if(!J(e))throw Error(`Unknown component "${e}". Known components: ${V.join(", ")}`);const r=!1!==i?.includeData,a={};for(const[e,i]of Object.entries(t))if(null!=i&&!ie.has(e)&&(r||!ae(e,i))&&"function"!=typeof i&&!i?.$$typeof)try{a[e]=oe(re(i))}catch{}return{component:e,props:a,version:"1",createdAt:(new Date).toISOString(),...i?.selections?{selections:i.selections}:{}}}function le(e){if(!e.component||!e.props)throw Error("Invalid chart config: missing component or props");if("ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw Error("Invalid chart recipe config: missing recipeId");const t=F(e.recipeId);if(!t)throw Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...oe(e.props),recipeId:e.recipeId}}}if(!J(e.component))throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:oe(e.props)}}function ce(e){const t=JSON.stringify(e);return"sc="+btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function de(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");const i=t.replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(escape(atob(i)));return JSON.parse(n)}async function ue(e,t="json"){const i="jsx"===t?me(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(i)}function me(e){const{props:t}=e,i=["<"+("LocalChartRecipe"===e.component?"ChartRecipe":e.component)];e.recipeId&&i.push(` recipeId="${e.recipeId}"`);for(const[e,n]of Object.entries(t))if("string"==typeof n)i.push(` ${e}="${n}"`);else if("boolean"==typeof n&&!0===n)i.push(" "+e);else if("boolean"==typeof n&&!1===n)i.push(` ${e}={false}`);else if("number"==typeof n)i.push(` ${e}={${n}}`);else{const t=JSON.stringify(n);i.push(80>t.length?` ${e}={${t}}`:` ${e}={${JSON.stringify(n,null,2)}}`)}return i.push("/>"),i.join("\n")}function he(e){const t=Object.create(null);for(const[i,n]of e){const e=[];for(const[,t]of n.clauses){const i=Object.create(null);for(const[e,n]of Object.entries(t.fields))i[e]="point"===n.type?{type:"point",values:Array.from(n.values)}:{type:"interval",range:n.range};e.push({clientId:t.clientId,type:t.type,fields:i})}t[i]={name:n.name,resolution:n.resolution,clauses:e}}return t}function pe(e){const t=new Map;for(const[i,n]of Object.entries(e)){const e=new Map;for(const t of n.clauses){const i=Object.create(null);for(const[e,n]of Object.entries(t.fields))i[e]="point"===n.type?{type:"point",values:new Set(n.values)}:{type:"interval",range:n.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:i})}t.set(i,{name:n.name,resolution:n.resolution,clauses:e})}return t}function fe(e){return"nominal"===e||"ordinal"===e}function ge(e){return"quantitative"===e||"temporal"===e}var be={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},ye={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},ve={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function xe(e){e=function(e){if(!function(e){return e.usermeta?.idid}(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!function(e){return"annotation-layer"===e.usermeta?.idid?.role}(e));if(1!==t.length)return e;const{layer:i,...n}=e,{usermeta:r,...a}=t[0];return{...n,...a}}(e);const t=[],{type:i,markProps:n}=function(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...i}=e;return{type:t,markProps:i}}(e.mark),r=e.encoding||{},a=r.x,o=r.y,s=r.color,l=r.size,c=r.theta,d=r.opacity;let u;e.data?.values?u=e.data.values:e.data?.url&&t.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&t.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&t.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&t.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||r.facet||r.row||r.column)&&t.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&t.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&t.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const m={};e.width&&(m.width=e.width),e.height&&(m.height=e.height);const p=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(p&&(m.title=p),s?.field&&(m.colorBy=s.field,s.scale?.scheme)){const e=be[s.scale.scheme];e&&(m.colorScheme=e)}void 0!==d?.value&&(m.pointOpacity=d.value);const f=a?.aggregate,g=o?.aggregate;if(u&&(f||g)){const e=g?o:a,t=g?a:o,i=ve[e.aggregate];if(i&&t?.field&&e.field)u=function(e,t){const{groupBy:i,value:n,agg:r="sum"}=t,a=new Map;for(const t of e){const e=t[i]+"";a.has(e)||a.set(e,[]),a.get(e).push(Number(t[n]))}const o=[];for(const[e,t]of a){let n;switch(r){case"count":n=t.length;break;case"mean":n=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":n=h(t)[0];break;case"max":n=h(t)[1];break;default:n=t.reduce((e,t)=>e+t,0)}o.push({[i]:e,value:n})}return o}(u,{groupBy:t.field,value:e.field,agg:i});else if(("count"===i||"count"===e.aggregate)&&t?.field&&u){const e=new Map;for(const i of u){const n=i[t.field]+"";e.set(n,(e.get(n)||0)+1)}u=Array.from(e,([e,i])=>({[t.field]:e,value:i}))}}if(a?.bin||o?.bin){const e="Histogram";u&&(m.data=u),a?.bin?(m.valueAccessor=a.field,o?.field&&(m.categoryAccessor=o.field),a.axis?.title&&(m.valueLabel=a.axis.title)):o?.bin&&(m.valueAccessor=o.field,a?.field&&(m.categoryAccessor=a.field),o.axis?.title&&(m.valueLabel=o.axis.title));const i=a?.bin||o?.bin,n="object"==typeof i?i.maxbins:void 0;return n&&(m.bins=n),Ce(e,m,t)}let b;switch(i){case"bar":b=function(e,t,i,n,r,a,o){let s;return i?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(s="StackedBarChart",n.stackBy=i.field):s="BarChart",fe(e?.type)&&ge(t?.type)?(n.categoryAccessor=e.field,n.valueAccessor=o?"value":t.field,e?.axis?.title&&(n.categoryLabel=e.axis.title),t?.axis?.title&&(n.valueLabel=t.axis.title)):ge(e?.type)&&fe(t?.type)?(n.categoryAccessor=t.field,n.valueAccessor=a?"value":e.field,n.orientation="horizontal",t?.axis?.title&&(n.categoryLabel=t.axis.title),e?.axis?.title&&(n.valueLabel=e.axis.title)):(e?.field&&(n.categoryAccessor=e.field),t?.field&&(n.valueAccessor=o?"value":t.field),e?.axis?.title&&(n.categoryLabel=e.axis.title),t?.axis?.title&&(n.valueLabel=t.axis.title)),r&&(n.data=r),s}(a,o,s,m,u,f,g);break;case"line":if(b="LineChart",we(a,o,m,f,g),s?.field&&(m.lineBy=s.field),n.interpolate){const e=ye[n.interpolate];e&&(m.curve=e)}!0===n.point&&(m.showPoints=!0),u&&(m.data=u);break;case"area":if(s?.field?(b="StackedAreaChart",m.areaBy=s.field):b="AreaChart",we(a,o,m,f,g),n.interpolate){const e=ye[n.interpolate];e&&(m.curve=e)}void 0!==n.opacity&&(m.areaOpacity=n.opacity),u&&(m.data=u);break;case"point":case"circle":case"square":l?.field?(b="BubbleChart",m.sizeBy=l.field,l.scale?.range&&(m.sizeRange=l.scale.range)):b="Scatterplot",we(a,o,m,f,g),u&&(m.data=u);break;case"rect":b="Heatmap",a?.field&&(m.xAccessor=a.field),o?.field&&(m.yAccessor=o.field),s?.field&&(m.valueAccessor=s.field,delete m.colorBy),a?.axis?.title&&(m.xLabel=a.axis.title),o?.axis?.title&&(m.yLabel=o.axis.title),u&&(m.data=u);break;case"arc":n.innerRadius&&n.innerRadius>0?(b="DonutChart",m.innerRadius=n.innerRadius):b="PieChart",c?.field?m.valueAccessor=c.field:o?.field&&(m.valueAccessor=g?"value":o.field),s?.field&&(m.categoryAccessor=s.field),a?.field&&!c?.field&&(m.categoryAccessor=a.field),u&&(m.data=u);break;case"tick":b="DotPlot",fe(a?.type)?(m.categoryAccessor=a.field,o?.field&&(m.valueAccessor=g?"value":o.field),a?.axis?.title&&(m.categoryLabel=a.axis.title),o?.axis?.title&&(m.valueLabel=o.axis.title)):fe(o?.type)?(m.categoryAccessor=o.field,a?.field&&(m.valueAccessor=f?"value":a.field),m.orientation="horizontal",o?.axis?.title&&(m.categoryLabel=o.axis.title),a?.axis?.title&&(m.valueLabel=a.axis.title)):(a?.field&&(m.categoryAccessor=a.field),o?.field&&(m.valueAccessor=g?"value":o.field)),u&&(m.data=u);break;default:t.push(`Unsupported mark type "${i}". Defaulting to Scatterplot.`),b="Scatterplot",we(a,o,m,f,g),u&&(m.data=u)}return Ce(b,m,t)}function we(e,t,i,n,r){e?.field&&(i.xAccessor=n?"value":e.field),t?.field&&(i.yAccessor=r?"value":t.field),e?.axis?.title&&(i.xLabel=e.axis.title),t?.axis?.title&&(i.yLabel=t.axis.title)}function Ce(e,t,i){const n={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(i.length>0){n.warnings=i;for(const e of i)console.warn("[semiotic/fromVegaLite] "+e)}return n}function ke(e,t,i={}){const n=Y(t),r=_(t),a=i.locale??"en",o="function"==typeof e.description?e.description({data:n,config:r,locale:a}):void 0,s=o?.levels??function(e,t,i,n){const r=ee(e,["nominal","ordinal"]),a=ee(e,["quantitative"]),o=r?K(r,i,t):void 0,s=a?K(a,i,t):void 0,l=r?.role??o??"category",c=a?.role??s??"value",d=e.encodings??[],u=d.length?d.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${l} and ${c} are mapped through the recipe's declared visual semantics`,{number:m,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})}}}(n),p=new Map;if(o&&s)for(const e of t){const t=(e[o]??"Uncategorized")+"",i=Number(e[s]);Number.isFinite(i)&&p.set(t,(p.get(t)??0)+i)}const f=[...p].sort((e,t)=>t[1]-e[1]),g=f.reduce((e,[,t])=>e+t,0),b=f[0],y=f[1],v=g>0?((b?.[1]??0)+(y?.[1]??0))/g:0,x=e.intents.map(e=>({id:Z(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,w=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${l} and ${c}. ${C=u,C?C.charAt(0).toUpperCase()+C.slice(1):C}.`,l2:f.length>0?`${f.length} categories total ${m.format(g)}. ${b[0]} accounts for ${m.format(b[1])}${g>0?` (${h.format(b[1]/g)})`:""}${y?`, followed by ${y[0]} at ${m.format(y[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>f.length?b?b[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>v?`The total is distributed across ${f.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${b[0]} and ${y[0]}, which together account for ${h.format(v)}.`,l4:`The chart is intended for ${x??"explanation"}${w?` with a ${w} audience`:""}: ${e.designContract.whyCustom}`};var C}(e,n,r,a),l=i.levels??["l1","l2","l3","l4"],c={};for(const e of l)s[e]&&(c[e]=s[e]);const d=["l1","l2","l3","l4"].map(e=>c[e]).filter(e=>!!e).join(" "),u=i.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:d,levels:c,...u?.length?{caveats:u}:{}}}var $e=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),Se=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),Ae=new Set(["PieChart","DonutChart","FunnelChart"]),je=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]);function Ne(e,t){return Se.has(e)||Ae.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 Ie(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const i=e[t];if("string"==typeof i&&i)return i}}function Me(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}var Le={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"},Pe=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),ze=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]);function Re(e){return Le[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function Te(e){const t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}var Be=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),Fe={"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"},De={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},Ee=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],Oe={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"};function He(e){return Fe[e]}function We(e,t){const i=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,i={};for(const[e,n]of Object.entries(t.intentScores))"number"==typeof n&&Number.isFinite(n)&&(i[e]=n);return{family:t.family,intentScores:Object.keys(i).length?i:void 0}}return e}}(t);if(i?.act)return i.act;if(i?.intentScores){const e=function(e){let t,i=0;for(const[n,r]of Object.entries(e))if("number"==typeof r&&r>0)if(r>i)t=n,i=r;else if(r===i&&void 0!==t){const e=Ee.indexOf(n),i=Ee.indexOf(t);-1===e||-1!==i&&e>=i||(t=n)}return t}(i.intentScores);if(e&&Fe[e]&&(i.intentScores[e]??0)>=3)return Fe[e]}return i?.family?De[i.family]:function(e){return"BumpChart"===e?"ranking":Ae.has(e)||"StackedAreaChart"===e?"apportioning":Be.has(e)?"relating":Se.has(e)?"comparing":je.has(e)?"characterizing":$e.has(e)?"tracking":Pe.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}var Ue=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),Ge=new Set(["system","agent","watcher"]),Ve=new Set(["ai","agent","system","computed","dbt","great-expectations"]),qe=new Set(["rule","statistical-test","llm-inference","computed"]);function Je(e){const t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;const t=e;if("string"!=typeof t.type||!Ue.has(t.type))return!1;const i=t.provenance;return!(!i||"object"!=typeof i)&&(Ge.has(i.authorKind)||Ve.has(i.source)||qe.has(i.basis))})}function Ze(e="en"){let t,i;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),i=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),i=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?i.format(e):t.format(e):e+""}var _e={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"};function Ye(e){const t=_e["string"==typeof e.type?e.type:"annotation"]||"an annotation",i=function(e){const t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,i=t?.authorKind??t?.source??t?.basis;return"watcher"===i?"a watcher-flagged ":"agent"===i||"ai"===i||"llm-inference"===i?"an AI-suggested ":""}(e),n=i?i+t.replace(/^an? /,""):t,r="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return r?`${n} labeled "${r}"`:n}function Xe(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const n=i(t.filter(e=>!!e&&"object"==typeof e));if(0===n.length)return;const r=n.map(Ye),a=r.slice(0,5),o=r.length-a.length,s=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]??""}(a)+(o>0?`, and ${o} more`:""),l=n.length;return`The author has marked ${1===l?"one feature":l+" features"} on this chart: ${s}.`}function Ke(i,n,r={}){const a=void 0!==r.levels,o=new Set(r.levels??["l1","l2","l3"]);a||!r.capability&&!Je(n)||o.add("l4");const s=X(i,n,r.recipe);if(s){const e=["l1","l2","l3","l4"].filter(e=>o.has(e));a||e.includes("l4")||e.push("l4");const t=ke(s,n,{levels:e,locale:r.locale,audience:r.audience,includeCaveats:r.includeCaveats}),i=Xe(n);return{...t,text:i?`${i} ${t.text}`.trim():t.text,...i?{annotations:i}:{}}}const l=Ze(r.locale??"en"),c=Re(i),d=Array.isArray(n.data)?n.data:null,u=Ie(n),m=ze.has(i)?function(e,t){const i=e.physics&&"object"==typeof e.physics?e.physics:null,n=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,r=[e.settledProjectionRows,e.projectionRows,n?.rows,i?.settledProjectionRows,i?.projectionRows,i?.settledProjection&&"object"==typeof i.settledProjection?i.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(r)?r.map((e,i)=>{if(!e||"object"!=typeof e)return null;const n=e,r=Te(n.count??n.value??n.total??n.bodies??n.events);if(null==r)return null;const a=n.label??n.id??n.name??"container "+(i+1),o=Te(n.secondary??n.secondaryCount),s=Te(n.observed??n.observedCount);return{label:Me(a,t),count:r,...null!=o?{secondary:o}:{},..."string"==typeof n.secondaryLabel&&n.secondaryLabel?{secondaryLabel:n.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}(n,l):null,{measure:h,measureFallback:p,dimension:f,dimensionFallback:g}=Ne(i,n),b="string"==typeof h&&h?h:p,y="string"==typeof f&&f?f:g,v={};if(ze.has(i)&&function(e,t,i,n,r,a){const 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),s=function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"body"}(e);if(r.has("l1")&&(n.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)),!r.has("l2")&&!r.has("l3"))return;if(!i||0===i.length)return void(r.has("l2")&&(n.l2="No settled projection is loaded yet."));const l=i.reduce((e,t)=>e+t.count,0),c=i.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),d=c[0]??i.slice().sort((e,t)=>t.count-e.count)[0];if(!d)return;const u=i.reduce((e,t)=>e+(t.secondary??0),0),m=i.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(r.has("l2"))if(0===c.length)n.l2=`The settled projection contains ${a(l)} ${et(l,s)} across ${i.length} ${et(i.length,o)}; no ${et(2,o)} are non-empty yet.`;else{const e=u>0?` ${a(u)} ${et(u,s)} ${1===u?"is":"are"} marked ${m}.`:"";n.l2=`The settled projection contains ${a(l)} ${et(l,s)} across ${i.length} ${et(i.length,o)}; ${c.length} ${et(c.length,o)} ${1===c.length?"is":"are"} non-empty. The largest ${o} is ${d.label} with ${a(d.count)} ${et(d.count,s)}.${e}`}if(r.has("l3")&&l>0&&c.length>0){const e=c.find(e=>e!==d),t=function(e,t){if(0>=t)return"0%";const i=e/t*100;return(10>i?Math.round(10*i)/10:Math.round(i))+"%"}(d.count,l);n.l3=e?`The settled projection is most concentrated in ${d.label}, which holds ${a(d.count)} ${et(d.count,s)} (${t}); ${e.label} follows with ${a(e.count)} ${et(e.count,s)}.`:`The settled projection is concentrated in ${d.label}, which holds all ${a(d.count)} ${et(d.count,s)}.`}}(i,c,m,v,o,l),o.has("l1")&&!ze.has(i))if("BumpChart"===i)v.l1=`A ${c} ranking ${u??"series"} by ${b} across ${y}.`;else if($e.has(i)||Se.has(i))v.l1=`A ${c} of ${b} by ${y}`+(u?`, split by ${u}.`:".");else if(Ae.has(i))v.l1=`A ${c} showing ${b} across ${y} categories.`;else if(je.has(i))v.l1=`A ${c} of the distribution of ${b}`+(u?` by ${u}.`:".");else if(Pe.has(i)){const e=Array.isArray(n.nodes)?n.nodes.length:void 0,t=Array.isArray(n.edges)?n.edges.length:void 0,i=[null!=e?`${e} ${et(e,"node")}`:null,null!=t?`${t} ${et(t,"edge")}`:null].filter(Boolean);v.l1=`A ${c}${i.length?" with "+i.join(" and "):""}.`}else if("BigNumber"===i){const e="string"==typeof n.label?n.label:b;v.l1=`A single value${e?" for "+e:""}.`}else v.l1=`A ${c}.`;const x=$e.has(i)||"BumpChart"===i||Se.has(i)||Ae.has(i)||je.has(i);let w=null;if((o.has("l2")||o.has("l3")||o.has("l4"))&&x&&d&&d.length>0&&(w=function(e,t,i,n){let r=0,a=0,o=1/0,s=-1/0,l=null,c=null,d=0,u=0,m=null,h=null,p=NaN,f=NaN;for(const i of e){const e=t(i);Number.isFinite(e)&&(0===r&&(p=e,m=i),f=e,h=i,o>e&&(o=e,l=i,d=r),e>s&&(s=e,c=i,u=r),r++,a+=e)}return 0===r?null:{count:r,min:o,max:s,mean:a/r,minLabel:Me(null!=l?i(l):null,n),maxLabel:Me(null!=c?i(c):null,n),first:p,last:f,firstLabel:Me(null!=m?i(m):null,n),lastLabel:Me(null!=h?i(h):null,n),minIndex:d,maxIndex:u}}(d,e(h,p),t(f,g),l)),o.has("l2")&&x&&(d&&0!==d.length?w&&(v.l2=Ae.has(i)?`${w.count} segments totaling ${l(function(e){return e.mean*e.count}(w))}. Largest is ${w.maxLabel} at ${l(w.max)}; smallest is ${w.minLabel} at ${l(w.min)}.`:`${b} ranges from ${l(w.min)} (${w.minLabel}) to ${l(w.max)} (${w.maxLabel}), with a mean of ${l(w.mean)} across ${w.count} points.`):v.l2="No data is loaded yet."),o.has("l3")&&w&&!u&&$e.has(i)?v.l3=function(e,t,i){const{first:n,last:r,min:a,max:o,maxLabel:s,minLabel:l,firstLabel:c,lastLabel:d,minIndex:u,maxIndex:m,count:h}=e,p=o-a,f=r-n;if(0===p)return`${Qe(t)} is constant at ${i(n)} across the series.`;if(.04>p/(Math.abs(e.mean)||1))return`${Qe(t)} ends roughly where it started (${i(n)} at ${c} to ${i(r)} at ${d}), ranging between ${i(a)} and ${i(o)}.`;const g=m>0&&h-1>m,b=u>0&&h-1>u,y=(o-Math.max(n,r))/p,v=(Math.min(n,r)-a)/p;return g&&y>.15?`Overall ${t} climbs to a peak of ${i(o)} (${s}), then falls to ${i(r)} (${d}).`:b&&v>.15?`Overall ${t} drops to a low of ${i(a)} (${l}), then recovers to ${i(r)} (${d}).`:.05>Math.abs(f)/p?`${Qe(t)} ends roughly where it started (${i(n)} at ${c} to ${i(r)} at ${d}), ranging between ${i(a)} and ${i(o)}.`:f>0?m===h-1?`Overall ${t} rises from ${i(n)} (${c}) to a peak of ${i(r)} (${d}).`:`Overall ${t} rises from ${i(n)} (${c}) to ${i(r)} (${d}), after peaking at ${i(o)} (${s}).`:u===h-1?`Overall ${t} falls from ${i(n)} (${c}) to a low of ${i(r)} (${d}).`:`Overall ${t} falls from ${i(n)} (${c}) to ${i(r)} (${d}), after dipping to ${i(a)} (${l}).`}(w,b,l):o.has("l3")&&w&&!u&&Se.has(i)&&(v.l3=`The highest ${y} is ${w.maxLabel} and the lowest is ${w.minLabel}.`),o.has("l4")){const e=Je(n)?"alerting":We(i,r.capability);e&&(v.l4=function(e,t,i,n,r,a,o,s){const l=Oe[e],c=/^[aeiou]/i.test(l)?"an":"a";let d,u;switch(e){case"locating":d="This is a map",u="read values by location";break;case"presenting":d="This is a single-value display",u=`read ${"string"==typeof i.label&&i.label?i.label:r} as the headline number`;break;case"tracing":d=`This is ${c} ${l} chart`,u="follow the movement between states";break;case"nesting":d=`This is ${c} ${l} chart`,u="read it for nested structure and how children sum into their parents";break;case"relating":d=`This is ${c} ${l} chart`,u=`read it for whether ${a} and ${r} move together`;break;default:d=`This is ${c} ${l} chart`,u=function(e,t,i,n,r,a){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 "+i;case"comparing":return`compare ${i} across ${n}`;case"ranking":return"read it top to bottom by "+i;case"apportioning":return`read each ${n}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+i;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,i){if(Se.has(i)||Ae.has(i))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:n,last:r,min:a,max:o,minLabel:s,maxLabel:l,lastLabel:c,minIndex:d,maxIndex:u,count:m}=e,h=o-a;if(h>0){const e=u>0&&m-1>u,i=d>0&&m-1>d,p=(o-Math.max(n,r))/h,f=(Math.min(n,r)-a)/h;if(e&&p>.15)return`the peak of ${t(o)} at ${l} is the point to investigate`;if(i&&f>.15)return`the dip to ${t(a)} at ${s} is the point to investigate`;if(r>=o)return`the climb to ${t(r)} at ${c} warrants a closer look`;if(a>=r)return`the drop to ${t(r)} at ${c} warrants a closer look`}return`the extremes — ${l} (${t(o)}) and ${s} (${t(a)}) — are the points to check`}(t,r,a);case"tracking":return`read it for the trajectory of ${i}, which ${function(e){const t=e.max-e.min,i=e.last-e.first;return 0===t||.05>Math.abs(i)/t?"holds roughly steady":i>0?"rises":"falls"}(t)} from ${r(t.first)} (${t.firstLabel}) to ${r(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${i} across ${n}; ${t.maxLabel} leads at ${r(t.max)}`;case"ranking":return`read it top to bottom by ${i}; ${t.maxLabel} ranks highest at ${r(t.max)}`;case"apportioning":{const e=t.mean*t.count,i=e>0?Math.round(t.max/e*100):null;return`read each ${n}'s share of the ${r(e)} total; ${t.maxLabel} is the largest at ${r(t.max)}${null!=i?` (${i}%)`:""}`}case"characterizing":return`read it for the spread of ${i}, from ${r(t.min)} to ${r(t.max)}`;default:return"read the highlighted features"}}(e,n,r,a,o,t)}return`${d}; ${u}.${function(e,t){if(!t)return"";const i=t.familiarity?.[e];return"number"!=typeof i||i>2?"":` This ${Re(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,s)}`}(e,i,n,u?null:w,b,y,l,r.audience))}const C=["l1","l2","l3","l4"].filter(e=>o.has(e)&&v[e]).map(e=>v[e]).join(" "),k=Xe(n);return{text:k?`${k} ${C}`.trim():C,levels:v,...k?{annotations:k}:{}}}function Qe(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function et(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function tt(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function it(e,t,i={}){const n=Y(t),r=_(t),a=Math.max(1,i.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:n,config:r,locale:i.locale??"en"});const o=(s=e.navigation)&&"object"==typeof s?e.navigation:void 0;var s;const l=(o?.groupByRole?Q(e,o.groupByRole):void 0)??(o?.groupBy?.[0]?Q(e,o.groupBy[0])??e.dataRoles.find(e=>e.field===o.groupBy?.[0]):void 0)??ee(e,["nominal","ordinal"]),c=l?K(l,r,n):void 0,d=(o?.idRole?Q(e,o.idRole):void 0)??ee(e,["identifier"]),u=d?K(d,r,n):void 0,m={id:"root",role:"chart",label:o?.summaryTemplate?te(o.summaryTemplate,void 0,e,r,n,{count:n.length}):`${e.name}: ${n.length} ${1===n.length?"item":"items"} represented.`,level:1,children:[]};let h=0;const p=(t,i,a)=>{const s=u?t[u]:void 0,l=o?.itemLabelTemplate?te(o.itemLabelTemplate,t,e,r,n,{count:n.length}):function(e,t,i,n){const r=ee(t,["nominal","ordinal"]),a=t.dataRoles.filter(e=>"quantitative"===e.semanticType),o=r?K(r,i,n):void 0,s=[];o&&null!=e[o]&&s.push(e[o]+"");for(const t of a){const r=K(t,i,n);r&&null!=e[r]&&s.push(`${t.role}: ${e[r]+""}`)}return s.length>0?s.join(", "):"Data item"}(t,e,r,n);return{id:"datum-"+tt(s??i),role:"datum",label:l,level:a,datum:t}};if(c){const e=new Map;for(const t of n){const i=(t[c]??"Uncategorized")+"",n=e.get(i);n?n.push(t):e.set(i,[t])}m.children=[...e].map(([e,t],i)=>{const n=t.slice(0,Math.max(0,a-h));h+=n.length;const r=n.map((e,t)=>p(e,1e5*i+t,3));return t.length>n.length&&r.push({id:"more-"+tt(e),role:"datum",label:`…and ${t.length-n.length} more items`,level:3}),{id:"group-"+tt(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:r}})}else{const e=n.slice(0,a);m.children=e.map((e,t)=>p(e,t,2)),n.length>e.length&&m.children.push({id:"more",role:"datum",label:`…and ${n.length-e.length} more items`,level:2})}return m}var nt=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),rt=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),at=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]);function ot(e,t,i){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:i]}function st(e,t="—"){return null==e||""===e?t:"object"==typeof e?st(e.id??e.name??e.label,t):e+""}function lt(e){const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function ct(e){return st(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function dt(e,t){const i=[];return(e.linkedHover||e.selection||e.linkedBrush)&&i.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&i.push("Hover or focus a mark for its details."),i.length>0?" "+i.join(" "):""}function ut(e,t){t&&e.children?.push(t)}function mt(e,t){const i=ot(e,t,"children");return Array.isArray(i)?i:[]}function ht(e,t,i){const n=ot(e,t,i);if(void 0!==n)return n;const r=e.properties;return r&&"object"==typeof r?ot(r,t,i):void 0}function pt(n,r,a={}){const o=a.locale??"en",s=Math.max(1,a.maxLeaves??200),l=Ze(o),c=X(n,r,a.recipe);if(c)return it(c,r,{maxLeaves:s,locale:o});const d={id:"root",role:"chart",label:Ke(n,r,{locale:o}).text||"Chart.",level:1,children:[]},u=function(e,t){const n=Array.isArray(e.annotations)?e.annotations:null;if(!n)return null;const r=i(n.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let a=0;const o=r.slice(0,t).map(e=>{const t=e.lifecycle?.status,i=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+a++,role:"annotation",level:3,label:`${n=Ye(e),n?n.charAt(0).toUpperCase()+n.slice(1):n}${i}.`,datum:e};var n});r.length>t&&o.push({id:"annotation-"+a++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});const s=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===s?"one marked feature":s+" marked features"}.`,children:o}}(r,s);if(nt.has(n)){const e=function(e,t,i,n){const r=Array.isArray(t.nodes)?t.nodes:[],a=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],o=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",l=t.targetAccessor??"target",c=t.valueAccessor??"value",d=e=>st(ot(e,o,"id"),"unknown"),u=(e,t)=>st(ot(e,t,""),"unknown"),m=new Set;for(const e of a)m.add(u(e,s)),m.add(u(e,l));const h=r.length>0?r:[...m].map(e=>({id:e})),p=new Map;for(const e of h)p.set(d(e),{links:0,value:0});for(const e of a){const t=u(e,s),i=u(e,l),n=lt(ot(e,c,"value"))??0;for(const e of[t,i]){const t=p.get(e)??{links:0,value:0};t.links+=1,t.value+=n,p.set(e,t)}}const f={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${h.length} nodes and ${a.length} links.${dt(t,"network")}`,children:[]};let g=0;const b=new Map,y=t.colorBy??"group";for(const e of h){const t=st(ot(e,y,"group"),"Ungrouped"),i=b.get(t);i?i.push(e):b.set(t,[e])}const v=[...b].map(([e,t],r)=>{const a=[];for(const[e,o]of t.entries()){if(g>=i)break;g+=1;const t=d(o),s=p.get(t)??{links:0,value:0},l=s.value>0?`, ${n(s.value)} total flow`:"";a.push({id:`node-${r}-${e}-${ct(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${l}.`,value:s.value>0?s.value:void 0,datum:o})}return{id:`nodes-${r}-${ct(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:a}});v.length>0&&f.children?.push(...v);const x=a.slice(0,i).map((e,t)=>{const i=u(e,s),r=u(e,l),a=lt(ot(e,c,"value"));return{id:`link-${ct(i)}-${ct(r)}-${t}`,role:"datum",level:3,label:`${i} to ${r}${null==a?"":": "+n(a)}.`,value:a,datum:e}});return a.length>i&&x.push({id:"links-more",role:"datum",level:3,label:`…and ${a.length-i} more links.`,value:void 0}),x.length>0&&f.children?.push({id:"links",role:"series",level:2,label:`Links: ${a.length} ${1===a.length?"connection":"connections"}.`,children:x}),f}(n,r,s,l);return ut(e,u),e}if(rt.has(n)){const e=function(e,t,i,n){const r=t.data&&"object"==typeof t.data?t.data:null,a=t.childrenAccessor??"children",o=t.valueAccessor??"value",s=t.nodeLabel??t.nodeIdAccessor;let l=0;const c=new WeakMap,d=e=>{const t=c.get(e);if(t)return t;const i=mt(e,a),n=0===i.length?{leaves:1,value:lt(ot(e,o,"value"))??0,depth:1}:i.reduce((e,t)=>{const i=d(t);return{leaves:e.leaves+i.leaves,value:e.value+i.value,depth:Math.max(e.depth,i.depth+1)}},{leaves:0,value:0,depth:1});return c.set(e,n),n},u=(e,t,r)=>{const o=mt(e,a),c=st(ot(e,s,"name"),"item "+r),m=d(e),h=m.value;if(0===o.length)return i>l?(l+=1,{id:`hierarchy-${ct(r)}-${ct(c)}`,role:"datum",level:t,label:`${c}${h>0?": "+n(h):""}.`,value:h>0?h:void 0,datum:e}):null;const p=o.map((e,i)=>u(e,t+1,`${r}-${i}`)).filter(e=>null!==e);return 0!==p.length||i>l||p.push({id:`hierarchy-${ct(r)}-more`,role:"datum",level:t+1,label:"More hierarchy items are not shown."}),{id:`hierarchy-${ct(r)}-${ct(c)}`,role:"series",level:t,label:`${c}: ${m.leaves} ${1===m.leaves?"descendant":"descendants"}${h>0?", total "+n(h):""}.`,children:p}},m=r?d(r):null,h={id:"root",role:"chart",label:r?`A ${"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"} chart with ${m.leaves} leaves across ${m.depth} hierarchy levels.`:"A hierarchy chart with no hierarchy data loaded.",level:1,children:[]};if(r){const e=u(r,2,"root");e&&(h.children="series"===e.role&&""===st(ot(r,s,"name"),"")?e.children:[e])}return h}(n,r,s,l);return ut(e,u),e}if(at.has(n)){const e=function(e,t,i,n){const r=function(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];const t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}(t.areas),a="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],o=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],l=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",d={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${r.length} regions.`:"FlowMap"===e?`A flow map with ${o.length} flows and ${a.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${a.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${a.length} locations.`}${dt(t,"geo")}`,children:[]},u=[],m="ChoroplethMap"===e?r:a;m.slice(0,i).forEach((i,r)=>{const a=st(ht(i,"ChoroplethMap"===e?t.idAccessor:c,"id")??ht(i,"name","name")??ht(i,"label","label"),`${"ChoroplethMap"===e?"region":"location"} ${r+1}`),o=lt(ht(i,l,"value"));u.push({id:`geo-${ct(a)}-${r}`,role:"datum",level:2,label:`${a}${null==o?"":": "+n(o)}.`,value:o,datum:i})}),m.length>i&&u.push({id:"geo-more",role:"datum",level:2,label:`…and ${m.length-i} more locations.`}),u.length>0&&d.children?.push({id:"ChoroplethMap"===e?"regions":"locations",role:"series",level:2,label:`${"ChoroplethMap"===e?"Regions":"Locations"}: ${m.length} marks.`,children:u.map(e=>({...e,level:3}))});const h="FlowMap"===e?o:s;if(h.length>0){const e=h.slice(0,i).map((e,t)=>{const i=st(e.source,"unknown"),r=st(e.target,"unknown"),a=lt(ot(e,l,"value"));return{id:`route-${ct(i)}-${ct(r)}-${t}`,role:"datum",level:3,label:`${i} to ${r}${null==a?"":": "+n(a)}.`,value:a,datum:e}});d.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${h.length} ${1===h.length?"route":"routes"}.`,children:e})}return d}(n,r,s,l);return ut(e,u),e}const m=Array.isArray(r.data)?r.data:null,h=$e.has(n)||Se.has(n)||Ae.has(n)||je.has(n);if(!m||0===m.length||!h)return u&&(d.children=[u]),d;const{measure:p,measureFallback:f,dimension:g,dimensionFallback:b}=Ne(n,r),y=e(p,f),v=t(g,b),x="string"==typeof p&&p?p:f,w="string"==typeof g&&g?g:b,C=Ie(r);let k=0;const $=e=>`${e}-${k++}`,S=(e,t)=>{const i=e.slice(0,s).map(e=>((e,t)=>{const i=y(e),n=Me(v(e),l);return{id:$("datum"),role:"datum",level:t,label:`${n}: ${Number.isFinite(i)?l(i):"—"}`,value:Number.isFinite(i)?i:void 0,datum:e}})(e,t));return e.length>s&&i.push({id:$("more"),role:"datum",level:t,label:`…and ${e.length-s} more points`}),i},A=[];if($e.has(n)||Se.has(n)){let e=1/0,t=-1/0,i=1/0,r=-1/0;const a=[];let o=!0;for(const n of m){const s=y(n);Number.isFinite(s)&&(e>s&&(e=s),s>t&&(t=s));const l=v(n);a.push(l),"number"==typeof l&&Number.isFinite(l)?(i>l&&(i=l),l>r&&(r=l)):o=!1}const s=new Set,c=[];for(const e of a){const t=e+"";s.has(t)||(s.add(t),c.push(e))}const d=o?`${l(i)} to ${l(r)}`:`${Me(c[0],l)} to ${Me(c[c.length-1],l)} (${Se.has(n)?c.length+" categories":m.length+" points"})`;A.push({id:$("axis"),role:"axis",level:2,label:`${Se.has(n)?"Category axis":"X axis"}: ${w}, ${d}.`}),e>t||A.push({id:$("axis"),role:"axis",level:2,label:`Value axis: ${x}, ${l(e)} to ${l(t)}.`})}if(C){const e=t(C,C),i=new Map;for(const t of m){const n=(e(t)??"—")+"",r=i.get(n);r?r.push(t):i.set(n,[t])}const a=[];for(const[e,t]of i){const i=Ke(n,{...r,data:t},{levels:["l2","l3"],locale:o}).text;a.push({id:$("series"),role:"series",level:2,label:`Series ${e}: ${i}`,children:S(t,3)})}d.children=[...A,...a]}else d.children=[...A,...S(m,2)];return u&&d.children.push(u),d}function ft(e,t){const i=[],n=e=>{if(i.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)n(t)};return n(e),i}function gt(e){let t=1;if(e.children)for(const i of e.children)t+=gt(i);return t}var bt=null,yt=new Set,vt=new Set,xt=1e3;function wt(e,t,i){const n=e??t;if(!Number.isFinite(n)||0>=n)throw new RangeError(`${i} must be a positive number, got ${n+""}`);return Math.floor(n)}function Ct(e,t){void 0!==console&&console.warn(`[conversationArc] ${e} failed:`,t)}function kt(e,t){try{const i=t();i&&"function"==typeof i.then&&Promise.resolve(i).catch(t=>Ct(e,t))}catch(t){Ct(e,t)}}function $t(e){if(e)return e;try{return globalThis.localStorage??null}catch{return null}}function St(e,t){if(!e)return[];try{return function(e){if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return Ct("localStorage load",e),[]}}(e.getItem(t))}catch(e){return Ct("localStorage read",e),[]}}var At=Object.freeze([]),jt=At,Nt=!1;function It(){return Nt?(jt=bt?Object.freeze(bt.buffer.slice()):At,Nt=!1,jt):jt}function Mt(){Nt=!0}var Lt=new Set;function Pt(){for(const e of Lt)try{e()}catch(e){void 0!==console&&console.warn("[conversationArc] change subscriber threw:",e)}}function zt(e){return Lt.add(e),()=>{Lt.delete(e)}}function Rt(e){if(!e||"object"!=typeof e)throw new TypeError("registerConversationArcSink: sink must be an object");return vt.add(e),()=>{vt.delete(e)}}function Tt(e={}){const t=e.key??"semiotic:conversation-arc",i=wt(e.maxEvents,xt,"createLocalStorageConversationArcSink: maxEvents");return{record(n){const r=$t(e.storage),a=St(r,t);a.push(n),function(e,t,i,n){if(e)try{e.setItem(t,JSON.stringify(i.slice(-n)))}catch(e){Ct("localStorage write",e)}}(r,t,a,i)},clear(){const i=$t(e.storage);if(i)try{i.removeItem(t)}catch(e){Ct("localStorage clear",e)}},load:()=>St($t(e.storage),t)}}function Bt(e={}){const t=e.dbName??"semiotic-conversation-arc",i=e.storeName??"events",n=wt(e.maxEvents,xt,"createIndexedDBConversationArcSink: maxEvents");let r=null;const a=()=>(r??(r=function(e,t,i){const n=function(e){if(e)return e;try{return globalThis.indexedDB??null}catch{return null}}(i);return n?new Promise(i=>{let r;try{r=n.open(e,1)}catch(e){return Ct("IndexedDB open",e),void i(null)}r.onupgradeneeded=()=>{const e=r.result;e.objectStoreNames.contains(t)||e.createObjectStore(t,{keyPath:"id",autoIncrement:!0})},r.onsuccess=()=>i(r.result),r.onerror=()=>{Ct("IndexedDB open",r.error),i(null)},r.onblocked=()=>{Ct("IndexedDB open",Error("upgrade blocked")),i(null)}}):Promise.resolve(null)}(t,i,e.indexedDB)),r);return{async record(e){const t=await a();t&&(await new Promise(n=>{try{const r=t.transaction(i,"readwrite");r.objectStore(i).add({event:e}),r.oncomplete=()=>n(),r.onerror=()=>{Ct("IndexedDB record",r.error),n()}}catch(e){Ct("IndexedDB record",e),n()}}),await function(e,t,i){return e?new Promise(n=>{try{const r=e.transaction(t,"readwrite"),a=r.objectStore(t),o=a.getAll();o.onsuccess=()=>{const e=Array.isArray(o.result)?o.result:[],t=e.length-i;if(t>0)for(const i of e.slice(0,t))null!=i.id&&a.delete(i.id)},o.onerror=()=>Ct("IndexedDB trim",o.error),r.oncomplete=()=>n(),r.onerror=()=>{Ct("IndexedDB trim",r.error),n()}}catch(e){Ct("IndexedDB trim",e),n()}}):Promise.resolve()}(t,i,n))},async clear(){const e=await a();e&&await new Promise(t=>{try{const n=e.transaction(i,"readwrite");n.objectStore(i).clear(),n.oncomplete=()=>t(),n.onerror=()=>{Ct("IndexedDB clear",n.error),t()}}catch(e){Ct("IndexedDB clear",e),t()}})},load:async()=>function(e,t){return e?new Promise(i=>{try{const n=e.transaction(t,"readonly").objectStore(t).getAll();n.onsuccess=()=>{i((Array.isArray(n.result)?n.result:[]).map(e=>e.event).filter(Boolean))},n.onerror=()=>{Ct("IndexedDB load",n.error),i([])}}catch(e){Ct("IndexedDB load",e),i([])}}):Promise.resolve([])}(await a(),i)}}function Ft(e){if(!e.url)throw new TypeError("createWebhookConversationArcSink: url is required");const t=e.method??"POST";return{record(i){const n=e.fetch??globalThis.fetch;if(!n)return;const r=e.mapEvent?e.mapEvent(i):i;return n(e.url,{method:t,headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify(r)}).then(()=>{})}}}function Dt(e,t={}){const i=Array.isArray(e)?e.slice():[],n=wt(t.capacity,Math.max(bt?.capacity??xt,i.length,1),"loadConversationArc: capacity"),r=t.sessionId??i[0]?.sessionId??bt?.sessionId??Wt();for(bt?(bt.enabled=t.enabled??!1,bt.sessionId=r,bt.capacity=n):bt={enabled:t.enabled??!1,sessionId:r,capacity:n,buffer:[]},t.append||(bt.buffer=[]),bt.buffer.push(...i);bt.buffer.length>bt.capacity;)bt.buffer.shift();return Mt(),Pt(),It()}function Et(e,t={}){return Dt(e,t)}function Ot(e,t,i){return Jt.record({type:"audience-set",audience:e,previous:t??void 0,...i})}function Ht(e,t){return Jt.record({type:"annotation-status-changed",toStatus:e,annotationId:t?.annotationId,fromStatus:t?.fromStatus,chartId:t?.chartId,arcId:t?.arcId,meta:t?.meta})}function Wt(){return`arc-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Ut(){return bt}function Gt(e={}){const t=e.capacity??1e3;if(!Number.isFinite(t)||0>=t)throw new RangeError("enableConversationArc: capacity must be a positive number, got "+t);if(bt){if(bt.enabled=!0,e.sessionId&&(bt.sessionId=e.sessionId),null!=e.capacity){for(bt.capacity=t;bt.buffer.length>bt.capacity;)bt.buffer.shift();Mt()}}else bt={enabled:!0,sessionId:e.sessionId??Wt(),capacity:t,buffer:[]},Mt();return Pt(),Jt}function Vt(){bt&&(bt.enabled=!1,Pt())}function qt(){return Jt}var Jt={get enabled(){return bt?.enabled??!1},get sessionId(){return bt?.sessionId??null},get capacity(){return bt?.capacity??0},record(e){const t=Ut();if(!t||!t.enabled)return null;const i={...e,timestamp:e.timestamp??Date.now(),sessionId:e.sessionId??t.sessionId};for(t.buffer.push(i);t.buffer.length>t.capacity;)t.buffer.shift();Mt(),Pt();for(const e of yt)try{e(i)}catch(e){void 0!==console&&console.warn("[conversationArc] subscriber threw:",e)}return function(e){for(const t of vt)t.record&&kt("sink record",()=>t.record?.(e))}(i),i},flush(){const e=Ut();if(!e)return[];const t=e.buffer.slice();return e.buffer=[],Mt(),Pt(),function(e){for(const t of vt)t.flush&&kt("sink flush",()=>t.flush?.(e))}(t),t},getEvents:()=>It(),subscribe:e=>(yt.add(e),()=>{yt.delete(e)}),clear(){const e=Ut();e&&(e.buffer=[],Mt(),Pt()),function(){for(const e of vt)e.clear&&kt("sink clear",()=>e.clear?.())}()},reset(){if(yt.clear(),vt.clear(),jt=At,Nt=!1,!bt)return Pt(),void Lt.clear();bt.buffer=[],bt.enabled=!1,bt=null,Pt(),Lt.clear()}};import*as Zt from"react";import{jsx as _t,jsxs as Yt}from"react/jsx-runtime";var Xt={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0,padding:0,margin:-1};function Kt({tree:e,label:t,visible:i=!1,className:n,onActiveChange:r,activeId:a,chartId:s,onObservation:l,onAnnotationActivate:c}){const[d,u]=Zt.useState(()=>new Set([e.id])),[h,p]=Zt.useState(e.id),f=void 0!==a,g=f?a:h,b=Zt.useRef(null),y=Zt.useRef(new Map),v=m(e=>e.pushObservation),x=Zt.useCallback(e=>{l?.(e),v?.(e)},[l,v]),w=Zt.useMemo(()=>function(e){const t=new Map,i=e=>{for(const n of e.children??[])t.set(n.id,e),i(n)};return i(e),t}(e),[e]),C=Zt.useMemo(()=>ft(e,d),[e,d]);Zt.useEffect(()=>{f||C.some(e=>e.id===h)||p(e.id)},[C,h,e.id,f]),Zt.useEffect(()=>{const e=[];let t=w.get(g);for(;t;)e.push(t.id),t=w.get(t.id);e.length>0&&u(t=>{if(e.every(e=>t.has(e)))return t;const i=new Set(t);for(const t of e)i.add(t);return i})},[g,w]),Zt.useEffect(()=>{b.current?.contains(document.activeElement)&&y.current.get(g)?.focus()},[g]);const k=Zt.useCallback((e,t,i)=>{const n=qt();n.enabled&&n.record("focus"===t?{type:"nav-node-focused",chartId:s,nodeId:e.id,role:e.role,level:e.level,label:e.label.length>200?e.label.slice(0,200):e.label}:{type:"nav-branch-expanded",chartId:s,nodeId:e.id,role:e.role,level:e.level,expanded:!!i})},[s]),$=Zt.useCallback(e=>{e.id!==g&&(f||p(e.id),r?.(e),k(e,"focus"),e.datum&&x({type:"focus",datum:e.datum,inputType:"navigation-tree",timestamp:Date.now(),chartType:"AccessibleNavTree",chartId:s}))},[r,f,k,g,x,s]),S=Zt.useCallback(e=>{if(e.datum){if("annotation"===e.role){const t=o(e.datum);return c?.({annotation:e.datum,annotationId:t,chartId:s,inputType:"navigation-tree"}),void(t&&x({type:"annotation-activate",annotationId:t,inputType:"navigation-tree",timestamp:Date.now(),chartType:"AccessibleNavTree",chartId:s}))}x({type:"activate",datum:e.datum,inputType:"navigation-tree",timestamp:Date.now(),chartType:"AccessibleNavTree",chartId:s})}},[s,x,c]),A=e=>{u(t=>new Set(t).add(e.id)),k(e,"toggle",!0)},j=e=>{u(t=>{const i=new Set(t);return i.delete(e.id),i}),k(e,"toggle",!1)},N=(e,t,n)=>{const r=!!e.children&&e.children.length>0,a=d.has(e.id);return Yt("li",{role:"treeitem","aria-label":e.label,"aria-level":e.level,"aria-posinset":t,"aria-setsize":n,"aria-expanded":r?a:void 0,"aria-selected":e.id===g,tabIndex:e.id===g?0:-1,ref:t=>{y.current.set(e.id,t)},onClick:t=>{t.stopPropagation(),$(e),r?(a?j:A)(e):S(e)},style:i?{listStyle:"none",padding:"2px 6px",paddingLeft:6+16*(e.level-1),cursor:r?"pointer":"default",fontSize:13,color:"var(--semiotic-text, currentColor)",background:e.id===g?"var(--semiotic-surface, var(--semiotic-grid, var(--semiotic-bg, #f0f4f8)))":"transparent",outline:"none"}:void 0,children:[Yt("span",{className:"semiotic-nav-tree-label semiotic-nav-tree-"+e.role,children:[i&&r?a?"▾ ":"▸ ":"",e.label]}),r&&a&&_t("ul",{role:"group",style:i?{margin:0,padding:0}:void 0,children:e.children.map((t,i)=>N(t,i+1,e.children.length))})]},e.id)};return _t("div",{ref:b,className:"semiotic-nav-tree"+(n?" "+n:""),style:i?void 0:Xt,onKeyDown:e=>{const t=C.findIndex(e=>e.id===g);if(-1===t)return;const i=C[t],n=!!i.children&&i.children.length>0,r=d.has(i.id);let a=!0;switch(e.key){case"ArrowDown":$(C[Math.min(t+1,C.length-1)]);break;case"ArrowUp":$(C[Math.max(t-1,0)]);break;case"Home":$(C[0]);break;case"End":$(C[C.length-1]);break;case"ArrowRight":n&&!r?A(i):n&&r?$(i.children[0]):a=!1;break;case"ArrowLeft":if(n&&r)j(i);else{const e=w.get(i.id);e?$(e):a=!1}break;case"Enter":case" ":n?(r?j:A)(i):S(i);break;default:a=!1}a&&(e.preventDefault(),e.stopPropagation())},children:_t("ul",{role:"tree","aria-label":t||"Chart navigation",style:i?{margin:0,padding:0}:void 0,children:N(e,1,1)})})}import*as Qt from"react";import{jsx as ei,jsxs as ti}from"react/jsx-runtime";function ii(e,t,i=0){const n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),a=Math.max(n,Math.min(r,e[0])),o=Math.max(n,Math.min(r,e[1])),s=a>o?[o,a]:[a,o];if(s[1]-s[0]>=i)return s;const l=(s[0]+s[1])/2,c=i/2;return[Math.max(n,Math.min(r-i,l-c)),Math.min(r,Math.max(n+i,l+c))]}function ni(e,t,i,n=1,r=n){const a="in"===i?n:-n;return ii([e[0]+a,e[1]-a],t,r)}function ri(e){const{domain:t,initialValue:i=t,step:n=1,minSpan:r=n,label:a,formatValue:o,onChange:s}=e,[l,c]=Qt.useState(()=>ii(i,t,r)),d=ii(l,t,r),u=Qt.useCallback(e=>{const i=ii(e,t,r);c(i),s?.(i)},[t,r,s]),m=Qt.useMemo(()=>({label:a,domain:t,value:d,step:n,formatValue:o,onChange:u,onClear:()=>u(t)}),[t,o,a,u,n,d]),h=Qt.useMemo(()=>({onZoomIn:()=>u(ni(d,t,"in",n,r)),onZoomOut:()=>u(ni(d,t,"out",n,r)),onReset:()=>u(t)}),[t,r,u,n,d]);return{value:d,setValue:u,xExtent:d,brush:m,zoom:h}}var ai={display:"grid",gap:8,padding:"10px 12px",border:"1px solid var(--semiotic-border, #d8dee4)",borderRadius:12,background:"var(--semiotic-surface, var(--semiotic-bg, rgba(255,255,255,0.92)))"},oi={fontSize:11,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--semiotic-text-secondary, #57606a)"};function si(e,t){return{minWidth:e,minHeight:e,padding:"0 12px",borderRadius:999,border:"1px solid var(--semiotic-border, #d8dee4)",background:t?"var(--semiotic-primary, #0969da)":"var(--semiotic-bg, #fff)",color:t?"var(--semiotic-bg, #fff)":"var(--semiotic-text, #24292f)",fontSize:13,fontWeight:650,touchAction:"manipulation"}}function li(e){return"function"==typeof e}function ci({brush:e,targetSize:t}){const i=e?.value,n=e?.domain,r=!!i&&!!n,a=!0===e?.disabled,o=e?.formatValue??(e=>e),s=!!e?.onChange&&r&&!a,l=n?.[0]??0,c=n?.[1]??1,d=i?.[0]??l,u=i?.[1]??c,m=e?.step??((c-l)/100||1);return ti("section",{style:ai,"aria-label":"Brush controls",children:[ei("div",{style:oi,children:e?.label??"Filter range"}),r?ti("div",{style:{display:"grid",gap:8},children:[ti("label",{style:{display:"grid",gap:4,fontSize:12},children:[ti("span",{children:["Start: ",o(d)]}),ei("input",{type:"range",min:l,max:c,step:m,value:d,disabled:!s,style:{minHeight:t},onChange:t=>{const i=Number(t.currentTarget.value);e?.onChange?.([Math.min(i,u),u])}})]}),ti("label",{style:{display:"grid",gap:4,fontSize:12},children:[ti("span",{children:["End: ",o(u)]}),ei("input",{type:"range",min:l,max:c,step:m,value:u,disabled:!s,style:{minHeight:t},onChange:t=>{const i=Number(t.currentTarget.value);e?.onChange?.([d,Math.max(i,d)])}})]})]}):ei("div",{style:{fontSize:12,color:"var(--semiotic-text-secondary, #57606a)"},children:"Provide a brush domain and value to expose range inputs beside the drag gesture."}),ei("button",{type:"button",disabled:a||!li(e?.onClear),onClick:e?.onClear,style:si(t),children:"Clear range"})]})}function di({zoom:e,targetSize:t}){const i=!0===e?.disabled;return ti("section",{style:ai,"aria-label":"Zoom controls",children:[ei("div",{style:oi,children:e?.label??"Zoom"}),ti("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[ei("button",{type:"button","aria-label":"Zoom out",disabled:i||!li(e?.onZoomOut),onClick:e?.onZoomOut,style:si(t),children:"-"}),ei("button",{type:"button","aria-label":"Reset zoom",disabled:i||!li(e?.onReset),onClick:e?.onReset,style:si(t),children:"Reset"}),ei("button",{type:"button","aria-label":"Zoom in",disabled:i||!li(e?.onZoomIn),onClick:e?.onZoomIn,style:si(t),children:"+"})]})]})}function ui({legend:e,targetSize:t}){const i=!0===e?.disabled,n=e?.items??[];return ti("section",{style:ai,"aria-label":"Legend controls",children:[ei("div",{style:oi,children:e?.label??"Series"}),n.length>0&&ei("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:n.map(n=>{const r=!1!==n.active;return ti("button",{type:"button",disabled:i||n.disabled||!e?.onToggle,onClick:()=>e?.onToggle?.(n.id,!r),style:si(t,r),"aria-pressed":r,children:[n.color&&ei("span",{"aria-hidden":"true",style:{display:"inline-block",width:9,height:9,marginRight:6,borderRadius:999,background:n.color}}),n.label??n.id]},n.id)})}),ti("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[ei("button",{type:"button",disabled:i||!li(e?.onShowAll),onClick:e?.onShowAll,style:si(t),children:"Show all"}),ei("button",{type:"button",disabled:i||!li(e?.onHideAll),onClick:e?.onHideAll,style:si(t),children:"Hide all"})]})]})}function mi({controls:e,targetSize:t=44,compact:i=!1,className:n,style:r,ariaLabel:a="Mobile chart controls",brush:o,zoom:s,legend:l}){const c=function(e,t){if(!1===e)return[];if(!0===e||"all"===e)return["brush","zoom","legend"];if(Array.isArray(e))return e;if(e)return[e];const i=[];return t.brush&&i.push("brush"),t.zoom&&i.push("zoom"),t.legend&&i.push("legend"),i}(e,{brush:o,zoom:s,legend:l});return 0===c.length?null:ti("div",{className:n,role:"group","aria-label":a,style:{display:"grid",gridTemplateColumns:i?"1fr":"repeat(auto-fit, minmax(180px, 1fr))",gap:10,...r},children:[c.includes("brush")&&ei(ci,{brush:o,targetSize:t}),c.includes("zoom")&&ei(di,{zoom:s,targetSize:t}),c.includes("legend")&&ei(ui,{legend:l,targetSize:t})]})}var hi=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),pi=new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),fi=new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),gi=new Set(["LineChart","AreaChart","StackedAreaChart"]),bi=new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]),yi=new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),vi=new Set(["PieChart","DonutChart"]),xi={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},wi=new Set(Object.keys(xi)),Ci={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},ki=new Set(["BigNumber"]),$i=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),Si=new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),Ai=new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),ji=new Set(["OrbitDiagram",...Ai]),Ni=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),Ii=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),Mi=new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),Li=new Set(["MultiAxisLineChart"]),Pi=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),zi={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},Ri=new Set([...$i,"RealtimeLineChart","RealtimeHeatmap"]),Ti=Object.fromEntries(Object.entries(zi).map(([e,t])=>[e,[t,"hoverRadius"]]));function Bi(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Fi(e){return"string"==typeof e&&e.trim().length>0}function Di(e){const t=Bi(e.capability)?e.capability:null,i=Bi(e.recipe)?e.recipe:null,n=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,i?.mobile];for(const e of n)if(Bi(e))return e;return null}function Ei(e){return Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1]&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[e[0],e[1]]:null}function Oi(e){return Ei(e.size)||Ei(Bi(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function Hi(e,t){e.push({...t,status:"pass"})}function Wi(e,t){e.push({...t,status:"warn"})}function Ui(e,t){e.push({...t,status:"manual"})}function Gi(e,t={},i={}){const n=i.viewportWidth??390,r=i.targetSize??44,a=Oi(t),o=s(t,{width:n,height:a?.[1]}),l=[],c=Oi(t=o.props),d=Di(t),u=function(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}(e,t),m=function(e){const t=Di(e);return!0===e.responsive||!0===e.mobile||!0===t?.responsive||!0===t?.supportsResponsiveLayout||Array.isArray(t?.breakpoints)||"number"==typeof t?.minViewportWidth||"responsive"===t?.strategy||"small-multiples"===t?.strategy||"summary-cards"===t?.strategy||null!=e.mobileLayout||null!=e.responsiveRules||"mobile-readable"===e.density}(t),h=!0===i.inChartContainer,p=Fi(t.title)||Fi(t.summary)||Fi(t.description)||!0===d?.summary||Fi(d?.summary);if(o.matches.length>0&&Hi(l,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${o.matches.length} responsive rule(s) applied for the ${n}px mobile audit.`}),c){const[t,i]=c;t>n&&!m?Wi(l,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${n}px mobile viewport with no responsive/mobile transform hint.`,fix:"Use responsive sizing, responsiveRules/mobileLayout, or an explicit mobile variant that preserves the task instead of clipping the desktop chart."}):Hi(l,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof d?.minViewportWidth&&d.minViewportWidth>n&&Wi(l,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${d.minViewportWidth}px minimum, wider than the audited ${n}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});const r=t/Math.max(1,i);430>=n&&r>2.4&&"BigNumber"!==e&&Wi(l,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${r.toFixed(1)}:1, which tends to compress phone charts vertically.`,fix:"Prefer stacked sections, small multiples, cards plus a sparkline, or a taller mobile-specific chart ratio."}),160>i&&"BigNumber"!==e&&Wi(l,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${i}px; most phone charts need enough vertical room for marks plus readable labels.`,fix:"Reserve more vertical space, remove nonessential axes, or switch to a card/sparkline pattern with external labels."})}else Ui(l,{id:"layout.unknown-size",category:"layout",impact:"medium",message:"No explicit size is available to audit. This may be responsive, but static mobile overflow cannot be checked.",fix:"Audit rendered widths at 320, 360, 390, and 430px, or pass size/responsiveRules metadata into the config."});const f=function(e){const t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,Bi(e.frameProps)?e.frameProps.data:void 0];let i=0;for(const e of t)Array.isArray(e)&&(i+=e.length);return i}(t);f>0&&(f>("number"==typeof d?.maxMarks?d.maxMarks:Ri.has(e)?1.25*n:Si.has(e)?Math.max(8,Math.floor(n/34)):n)?Wi(l,{id:"density.mark-budget",category:"density",impact:Ri.has(e)?"medium":"high",message:`${f} data item(s) exceed the rough mobile density budget for ${e} at ${n}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):Hi(l,{id:"density.mark-budget",category:"density",impact:"medium",message:f+" data item(s) are within the rough mobile density budget for this component."}));const g=function(e){const t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues];let i=0;for(const e of t)Array.isArray(e)&&(i+=e.length);return i>0?i:null}(t),b=!1!==t.showAxes&&!1!==t.axis;if(b&&null!=g){const e=Math.max(3,Math.floor(n/58));g>e&&Wi(l,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${g} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${n}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else b&&(Ri.has(e)||Si.has(e))&&Ui(l,{id:"density.axis-label-collision",category:"density",impact:"medium",message:"Axes are enabled, but label collision depends on rendered tick text and cannot be checked statically.",fix:"Verify tick labels at phone widths or provide explicit mobile tick density."});!function(e){const t=Bi(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!function(e){const t=Di(e),i=Bi(e.mobileInteraction)?e.mobileInteraction:null;return null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||null!=e.selection||null!=e.onClick||null!=e.onSelect||!0===e.mobileInteraction||!0===i?.tapToSelect||!0===i?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||Fi(t?.interaction?.hoverFallback)}(e)}(t)?Hi(l,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."}):Wi(l,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"The chart exposes tooltip/hover detail without an obvious tap, selection, or control alternative.",fix:"Enable tap-to-select, a persistent details panel, visible segment buttons, or another non-hover path for the same information."});const y=function(e,t){const i=Ti[e];if(!i)return null;let n=i.includes("hoverRadius")?30:null;for(const e of i){const i=t[e];"number"==typeof i&&Number.isFinite(i)&&i>0&&(n=null==n?i:Math.max(n,i))}return null==n?null:2*n}(e,t),v=Bi(t.mobileInteraction)?t.mobileInteraction:null,x=y??("number"==typeof v?.targetSize?v.targetSize:!0===t.mobileInteraction?44:"number"==typeof d?.minimumHitTarget?d.minimumHitTarget:"number"==typeof d?.interaction?.targetSize?d.interaction.targetSize:null);null!=x&&(24>x?Wi(l,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${x}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):r>x?Wi(l,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${x}px, above 24px but below the ${r}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):Hi(l,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${x}px, meeting the configured ${r}px target.`}));const w=[];null==t.brush&&null==t.onBrush||w.push("brush"),!0===t.zoomable&&w.push("pan/zoom"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||w.push("legend filtering"),w.length>0&&!function(e,t){const i=Di(e),n=Bi(e.mobileInteraction)?e.mobileInteraction:null,r=n?.standardControls;return!!(null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||Array.isArray(i?.interaction?.alternatives)&&i.interaction.alternatives.length>0)||!0===r||"all"===r||t.every(e=>"brush"===e?Array.isArray(r)?r.includes("brush"):"brush"===r:"pan/zoom"===e?Array.isArray(r)?r.includes("zoom"):"zoom"===r:"legend filtering"===e&&(Array.isArray(r)?r.includes("legend"):"legend"===r))}(t,w)&&Wi(l,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${w.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."}),!1===t.showLegend||!1===t.legend||!0!==t.showLegend&&!0!==t.legend&&null==t.colorBy&&null==t.groupBy&&null==t.lineBy&&null==t.areaBy&&null==t.stackBy||!0===t.directLabel||!0===t.showLabels||"direct"===t.labelStrategy||"direct-end"===t.labelStrategy||"direct"===d?.labels?.strategy||"inline"===d?.labels?.strategy||"external"===d?.labels?.strategy||n>430||Wi(l,{id:"semantics.legend-over-direct-labels",category:"semantics",impact:"medium",message:"The chart appears to rely on a legend instead of direct labels at phone width.",fix:"Prefer direct end labels, inline labels, or a compact chip selector so readers do not bounce between plot and legend."});const C=Array.isArray(t.annotations)?t.annotations.filter(e=>Bi(e)):[];if(C.length>("number"==typeof d?.maxAnnotations?d.maxAnnotations:3)&&430>=n&&Wi(l,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:C.length+" annotation(s) compete for phone plot space.",fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),C.length>0){const e=C.filter(e=>!Fi(e.mobileText)&&!Fi(e.shortText)&&!Fi(e.label));e.length>0&&Ui(l,{id:"annotation.mobile-copy",category:"annotation",impact:"low",message:e.length+" annotation(s) lack explicit short/mobile copy.",fix:"Add mobileText or shortText for notes that need to survive narrow layouts."})}m||"BigNumber"===e||Ui(l,{id:"layout.no-responsive-transform",category:"layout",impact:"low",message:"No explicit responsive transformation hint is present.",fix:"Declare responsiveRules/mobileLayout or a density/label strategy so the mobile version is a designed transformation, not an accidental resize."}),u&&(d?(Hi(l,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart/recipe provides a mobileSemantics/mobile contract, so the audit can inspect its authored phone behavior."}),!1===d.custom?.dataBearingSceneNodes?Wi(l,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"medium",message:"Custom mobile contract says emitted scene nodes are not data-bearing.",fix:"Preserve datum references, semantic roles, or accessible-table fields so intelligence, navigation, and tap details can recover the chart's meaning."}):!0!==d.custom?.dataBearingSceneNodes&&Ui(l,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"low",message:"Custom chart mobile contract does not state whether scene nodes are data-bearing.",fix:"Set mobile.custom.dataBearingSceneNodes and mobile.custom.navigationGranularity for custom layouts and interoperability adapters."})):Ui(l,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart layout is opaque to static mobile analysis because no mobileSemantics/mobile contract is present.",fix:"Declare mobileSemantics with strategy, breakpoints, mark budgets, touch target size, interaction alternatives, and custom scene semantics."})),p||h||Wi(l,{id:"semantics.no-mobile-summary",category:"semantics",impact:"medium",message:"No title, summary, description, or ChartContainer context is visible from the config.",fix:"Add title/summary text or wrap in ChartContainer so the small-screen reader gets the task before the chart."});const k=l.filter(e=>"warn"===e.status),$={highRisk:k.filter(e=>"high"===e.impact).length,warnings:k.length,manual:l.filter(e=>"manual"===e.status).length,passes:l.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:n,ok:0===$.highRisk,summary:$,findings:l,reference:"Mobile visualization audit: informed by MobileVisFixer, mobile exploratory interaction research, small-multiple mobile studies, responsive visualization grammars, constraint-based breakpoints, and WCAG 2.2 input modalities."}}var Vi={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},qi=["layout","density","interaction","annotation","semantics"];function Ji(e){const t=[],i=e.summary,n=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${i.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${n} - ${i.warnings} warning(s) - ${i.manual} manual check(s)`);for(const i of qi){const n=e.findings.filter(e=>e.category===i&&"not-applicable"!==e.status);if(0!==n.length){t.push(""),t.push(" "+i.toUpperCase());for(const e of n)t.push(` ${Vi[e.status]} [${e.impact}] ${e.id}: ${e.message}`),!e.fix||"warn"!==e.status&&"manual"!==e.status||t.push(" -> "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function Zi(){return["Static audit only: rendered label collision, CSS-resolved type size, and actual touch behavior still require viewport testing.","Use multiple widths, usually 320, 360, 390, 430, and 768 CSS pixels.","A mobile pass means no high-risk static warnings, not that the chart is perceptually or ergonomically optimal."]}import*as _i from"react";import*as Yi from"react";var Xi,Ki=[];function Qi(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function en(e){return e&&"object"==typeof e&&"number"==typeof e.targetSize?e.targetSize:void 0}function tn(e){return Array.isArray(e)?e.length>0:!!e}import{Fragment as nn,jsx as rn,jsxs as an}from"react/jsx-runtime";var on={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0,padding:0,margin:-1};function sn(){const e=c();return e?rn("button",{className:"semiotic-chart-action",onClick:e,title:"Data summary","aria-label":"Toggle data summary",style:bn,children:an("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[rn("rect",{x:"1",y:"1",width:"12",height:"3",rx:"0.5"}),rn("rect",{x:"1",y:"6",width:"8",height:"3",rx:"0.5"}),rn("rect",{x:"1",y:"11",width:"5",height:"2",rx:"0.5"})]})}):null}var ln={info:"var(--semiotic-info, #2563eb)",success:"var(--semiotic-success, #16a34a)",warning:"var(--semiotic-warning, #d97706)",error:"var(--semiotic-error, var(--semiotic-danger, #dc2626))",neutral:"var(--semiotic-text-secondary, #6b7280)"},cn={error:4,warning:3,info:2,success:1,neutral:0};function dn({level:e}){const t={width:15,height:15,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};switch(e){case"error":case"warning":return an("svg",{...t,children:[rn("path",{d:"M8 1.8 15 14H1L8 1.8Z"}),rn("path",{d:"M8 6.4v3.4"}),rn("circle",{cx:"8",cy:"11.8",r:"0.5",fill:"currentColor",stroke:"none"})]});case"success":return an("svg",{...t,children:[rn("circle",{cx:"8",cy:"8",r:"6.4"}),rn("path",{d:"M5 8.2 7 10.2 11 5.8"})]});case"info":return an("svg",{...t,children:[rn("circle",{cx:"8",cy:"8",r:"6.4"}),rn("path",{d:"M8 7.4V11"}),rn("circle",{cx:"8",cy:"5",r:"0.5",fill:"currentColor",stroke:"none"})]});default:return an("svg",{...t,children:[rn("path",{d:"M8 2a3.5 3.5 0 0 0-3.5 3.5c0 4-1.5 5-1.5 5h10s-1.5-1-1.5-5A3.5 3.5 0 0 0 8 2Z"}),rn("path",{d:"M6.5 13a1.5 1.5 0 0 0 3 0"})]})}}function un({notification:e,level:t,onDismiss:i}){const n=ln[t]??ln.info,r=!1!==e.dismissible;return an("div",{className:"semiotic-chart-notification semiotic-chart-notification--"+t,style:{display:"flex",alignItems:"flex-start",gap:8,padding:"6px 10px",borderRadius:4,borderLeft:"3px solid "+n,background:"var(--semiotic-surface, rgba(127, 127, 127, 0.08))"},children:[an("div",{style:{flex:1,minWidth:0},children:[e.source&&rn("div",{className:"semiotic-chart-notification-source",style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--semiotic-text-secondary, #666)"},children:e.source}),e.title&&rn("div",{className:"semiotic-chart-notification-title",style:{fontSize:12,fontWeight:600,color:n},children:e.title}),rn("div",{className:"semiotic-chart-notification-message",style:{fontSize:12,lineHeight:1.45,color:"var(--semiotic-text, #333)"},children:e.message})]}),r&&rn("button",{className:"semiotic-chart-notification-dismiss","aria-label":e.title?"Dismiss notification: "+e.title:"Dismiss notification",title:"Dismiss",onClick:i,style:{...bn,width:18,height:18,fontSize:13,lineHeight:1,flex:"none"},children:"×"})]})}function mn({visible:e,onDismiss:t}){const[i,n]=_i.useState(!1),r=_i.useRef(null),a=_i.useRef(null);if(_i.useEffect(()=>{0===e.length&&i&&n(!1)},[e.length,i]),_i.useEffect(()=>{if(!i)return;const e=e=>{r.current&&!r.current.contains(e.target)&&n(!1)},t=e=>{"Escape"===e.key&&(n(!1),a.current?.focus())};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[i]),0===e.length)return null;const o=e.reduce((e,t)=>cn[t.level]>cn[e]?t.level:e,e[0].level),s=ln[o]??ln.info,l=e.length,c=`${l} chart notification${1===l?"":"s"}, most severe: ${o}`;return an("div",{ref:r,className:"semiotic-chart-notifications",style:{position:"relative",display:"inline-flex"},children:[rn("span",{style:on,role:"status","aria-live":"polite",children:c}),an("button",{ref:a,className:"semiotic-chart-action semiotic-chart-notifications-toggle","aria-haspopup":"dialog","aria-expanded":i,"aria-label":`${c}. ${i?"Hide":"Show"} notifications`,title:c,onClick:()=>n(e=>!e),style:{...bn,color:s,position:"relative"},children:[rn(dn,{level:o}),rn("span",{className:"semiotic-chart-notifications-badge","aria-hidden":"true",style:{position:"absolute",top:-3,right:-3,minWidth:15,height:15,padding:"0 3px",boxSizing:"border-box",borderRadius:8,background:s,color:"#fff",fontSize:9,fontWeight:700,lineHeight:"15px",textAlign:"center"},children:l>99?"99+":l})]}),i&&rn("div",{className:"semiotic-chart-notifications-popover",role:"dialog","aria-label":"Chart notifications",style:{position:"absolute",top:"calc(100% + 6px)",right:0,zIndex:20,width:320,maxWidth:"min(360px, 90vw)",maxHeight:320,overflowY:"auto",display:"flex",flexDirection:"column",gap:6,padding:10,textAlign:"left",background:"var(--semiotic-bg, #fff)",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:6,boxShadow:"0 6px 24px rgba(0, 0, 0, 0.16)"},children:e.map(e=>rn(un,{notification:e.notification,level:e.level,onDismiss:()=>t(e)},e.key))})]})}var hn={live:{bg:"#22c55e",color:"#fff"},stale:{bg:"#ef4444",color:"#fff"},paused:{bg:"#eab308",color:"#000"},error:{bg:"#ef4444",color:"#fff"},static:{bg:"#6b7280",color:"#fff"}};function pn({height:e}){return rn("div",{role:"status","aria-busy":"true","aria-label":"Loading chart",style:{width:"100%",height:e,background:"linear-gradient(90deg, var(--semiotic-border, #e0e0e0) 25%, var(--semiotic-bg, #f5f5f5) 50%, var(--semiotic-border, #e0e0e0) 75%)",backgroundSize:"200% 100%",animation:"semiotic-skeleton-pulse 1.5s ease-in-out infinite",borderRadius:4}})}function fn({error:e}){return rn("div",{role:"alert",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",minHeight:120,padding:24,boxSizing:"border-box"},children:rn("div",{style:{textAlign:"center",maxWidth:400,fontSize:14,color:"var(--semiotic-text-secondary, #666)",lineHeight:1.5},children:e})})}var gn=_i.forwardRef(function({title:e,subtitle:t,children:i,width:a="100%",height:o=400,actions:s,chartConfig:l,describe:c,navigable:d,controls:u,banner:m,notifications:h,dataAudit:f,onNotificationDismiss:g,loading:b=!1,error:y,errorBoundary:v=!1,status:x,detailsPanel:w,mobile:C,mobileAudit:k,className:$,style:S},A){const j=_i.useRef(null),N=_i.useRef(null),[I,M]=_i.useState(!1),L=function(e,t){const[i,n]=Yi.useState(Ki),r=e?.component,a=e?.props,o=!!t,s="object"==typeof t?t.checkOutliers:void 0,l="object"==typeof t?t.errorsOnly:void 0,c="object"==typeof t?t.max:void 0;return Yi.useEffect(()=>{let e=!0;return o&&r&&a?((Xi??(Xi=import("./c-NY3JWV2K.min.js").catch(e=>{throw Xi=void 0,e})),Xi).then(({buildChartDataAuditNotifications:t})=>{e&&n(t({component:r,props:a},{checkOutliers:s,errorsOnly:l,max:c}))}).catch(()=>{e&&n(Ki)}),()=>{e=!1}):(n(e=>0===e.length?e:Ki),()=>{e=!1})},[s,r,o,l,c,a]),i}(l,f),P=_i.useMemo(()=>[...h??[],...L],[h,L]),[z,R]=_i.useState(()=>new Set);_i.useEffect(()=>{R(e=>{if(0===e.size)return e;const t=new Set(P.map((e,t)=>e.id??t+""));let i=!1;const n=new Set;for(const r of e)t.has(r)?n.add(r):i=!0;return i?n:e})},[P]);const T=_i.useMemo(()=>P.map((e,t)=>({notification:e,index:t,key:e.id??t+"",level:e.level??"info"})).filter(({key:e})=>!z.has(e)),[P,z]),B=_i.useCallback(e=>{R(t=>new Set(t).add(e.key)),g?.(e.notification,e.index)},[g]),F=!1!==s?.export&&void 0!==s?.export,D=!1!==s?.fullscreen&&void 0!==s?.fullscreen,E=!1!==s?.copyConfig&&void 0!==s?.copyConfig&&l,O=!0===s?.dataSummary,H=_i.useMemo(()=>{if(!c||!l?.component||!l?.props)return"";const e="object"==typeof c?c.levels:void 0;try{return Ke(l.component,l.props,e?{levels:e}:{}).text}catch{return""}},[c,l]),W="object"==typeof c&&!0===c.visible,U=_i.useMemo(()=>{if(!d||!l?.component||!l?.props)return null;const e="object"==typeof d?d.maxLeaves:void 0;try{return pt(l.component,l.props,e?{maxLeaves:e}:{})}catch{return null}},[d,l]),G="object"==typeof d&&!0===d.visible,V=_i.useMemo(()=>"object"==typeof s?.export?s.export:{},[s?.export]),q="object"==typeof s?.copyConfig?s.copyConfig.format:"json",J=_i.useCallback(async e=>{N.current&&await p(N.current,{...V,...e})},[V]),Z=_i.useCallback(()=>{j.current&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):j.current.requestFullscreen().catch(()=>{}))},[]),_=_i.useCallback(async e=>{l&&await ue({...l,version:l.version??"1",createdAt:l.createdAt??(new Date).toISOString()},e||q||"json")},[l,q]);_i.useEffect(()=>{const e=()=>{M(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),_i.useImperativeHandle(A,()=>({export:J,toggleFullscreen:Z,copyConfig:_,element:j.current}),[J,Z,_]);const Y=!0===C?{}:C&&"object"==typeof C?C:null,X=!!C,K=Y?.breakpoint??480,Q=void 0===Y?.chartMode?"mobile":Y.chartMode,ee=Y?.semantics,te=Y?.mobileInteraction??(!!X||void 0),ie=Y?.standardControls,ne=Qi(ie)?ie:null,re=ne?.controls??(Qi(ie)?void 0:ie)??function(e){return e&&"object"==typeof e?e.standardControls:void 0}(te),ae=_i.useMemo(()=>function(e,t){return tn(t)?e&&"object"==typeof e?{...e,standardControls:t}:!1===e||null==e?e:{standardControls:t}:e}(te,re),[te,re]),oe=X&&tn(re)?rn(mi,{controls:re,targetSize:ne?.targetSize??en(te)??44,compact:ne?.compact??!0,className:ne?.className,style:ne?.style,ariaLabel:ne?.ariaLabel,brush:ne?.brush,zoom:ne?.zoom,legend:ne?.legend}):null,se=Y?.summary,le=!0===Y?.allowHorizontalScroll,ce=!0===Y?.hideToolbar,de=_i.useMemo(()=>{if(!k||!l?.component||!l?.props)return null;const e="object"==typeof k?k:{},t=l.props;try{return Gi(l.component,{...t,mobileSemantics:t.mobileSemantics??ee,mobileInteraction:t.mobileInteraction??ae},{viewportWidth:e.viewportWidth??390,targetSize:e.targetSize??44,inChartContainer:!0})}catch{return null}},[k,l,ee,ae]);_i.useEffect(()=>{if(!de||de.ok)return;const e=de.findings.filter(e=>"pass"!==e.status).slice(0,5);console.warn(`[Semiotic mobile audit] ${l?.component}: ${de.summary.highRisk} high-risk mobile finding(s), ${de.summary.warnings} warning(s).`,e)},[de,l?.component]);const me=de&&!de.ok&&"object"==typeof k&&!0===k.visible?an("div",{className:"semiotic-chart-mobile-audit",role:"status",style:{padding:"8px 12px",fontSize:12,lineHeight:1.45,color:"var(--semiotic-warning, #6b3f00)",background:"color-mix(in srgb, var(--semiotic-warning, #d97706) 14%, var(--semiotic-bg, #fff))",borderBottom:"1px solid var(--semiotic-border, #e0e0e0)"},children:["Mobile audit: ",de.summary.highRisk," high-risk finding",1===de.summary.highRisk?"":"s"," and"," ",de.summary.warnings," warning",1===de.summary.warnings?"":"s"," at"," ",("object"==typeof k?k.viewportWidth:void 0)??390,"px."]}):null,he=T.length>0,pe=e||t||u||F||D||E||O||x||he,fe=_i.useMemo(()=>{if(!X||!_i.isValidElement(i))return i;if(!function(e){const t=e.type;return"function"==typeof t||"object"==typeof t&&null!==t}(i))return i;const e=i.props,t={};return Q&&null==e.mode&&(t.mode=Q),ee&&null==e.mobileSemantics&&(t.mobileSemantics=ee),void 0!==ae&&null==e.mobileInteraction&&(t.mobileInteraction=ae),Object.keys(t).length>0?_i.cloneElement(i,t):i},[i,X,Q,ee,ae]),ge=b?rn(pn,{height:o}):y?rn(fn,{error:y}):v?rn(n,{children:fe}):fe;return be=an(nn,{children:[rn("style",{dangerouslySetInnerHTML:{__html:`@keyframes semiotic-skeleton-pulse {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n}\n@media (max-width: ${K}px) {\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-header {\n padding: 10px 12px !important;\n gap: 10px !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-title-area {\n flex-basis: 100% !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-toolbar {\n width: 100% !important;\n margin-left: 0 !important;\n justify-content: flex-start !important;\n overflow-x: auto !important;\n -webkit-overflow-scrolling: touch;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"][data-semiotic-mobile-hide-toolbar="true"] .semiotic-chart-toolbar {\n display: none !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-action {\n min-width: 32px !important;\n min-height: 32px !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-mobile-summary {\n display: block !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-mobile-standard-controls {\n display: block !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"][data-semiotic-mobile-scroll="true"] .semiotic-chart-body {\n overflow-x: auto !important;\n justify-content: flex-start !important;\n -webkit-overflow-scrolling: touch;\n }\n}`}}),an("div",{ref:j,className:"semiotic-chart-container"+($?" "+$:""),"data-semiotic-mobile":X?"true":void 0,"data-semiotic-mobile-scroll":le?"true":void 0,"data-semiotic-mobile-hide-toolbar":ce?"true":void 0,style:{width:a,border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:"var(--semiotic-border-radius, 8px)",overflow:"hidden",background:"var(--semiotic-bg, #fff)",fontFamily:"var(--semiotic-font-family, sans-serif)",position:"relative",...I?{display:"flex",flexDirection:"column",width:"100%",height:"100%"}:{},...S},children:[pe&&an("div",{className:"semiotic-chart-header",style:{padding:"12px 16px",display:"flex",justifyContent:"space-between",alignItems:"flex-start",flexWrap:"wrap",gap:8,borderBottom:"1px solid var(--semiotic-border, #e0e0e0)"},children:[an("div",{className:"semiotic-chart-title-area",style:{minWidth:0,flex:"1 1 200px"},children:[e&&rn("div",{className:"semiotic-chart-title",style:{fontSize:14,fontWeight:600,color:"var(--semiotic-text, #333)"},children:e}),t&&rn("div",{className:"semiotic-chart-subtitle",style:{fontSize:12,color:"var(--semiotic-text-secondary, #666)",marginTop:e?2:0},children:t})]}),an("div",{className:"semiotic-chart-toolbar",style:{display:"flex",alignItems:"center",gap:4,marginLeft:"auto"},children:[u,he&&rn(mn,{visible:T,onDismiss:B}),F&&rn("button",{className:"semiotic-chart-action",onClick:()=>J(),title:"Export chart","aria-label":"Export chart",style:bn,children:an("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[rn("path",{d:"M7 2v8M3.5 7L7 10.5 10.5 7"}),rn("path",{d:"M2 12h10"})]})}),O&&rn(sn,{}),D&&rn("button",{className:"semiotic-chart-action",onClick:Z,title:I?"Exit fullscreen":"Fullscreen","aria-label":I?"Exit fullscreen":"Enter fullscreen",style:bn,children:rn("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:an(nn,I?{children:[rn("path",{d:"M9 1v4h4"}),rn("path",{d:"M5 13V9H1"}),rn("path",{d:"M13 5H9V1"}),rn("path",{d:"M1 9h4v4"})]}:{children:[rn("path",{d:"M1 5V1h4"}),rn("path",{d:"M13 9v4H9"}),rn("path",{d:"M9 1h4v4"}),rn("path",{d:"M5 13H1V9"})]})})}),E&&rn("button",{className:"semiotic-chart-action",onClick:()=>_(),title:"Copy config","aria-label":"Copy chart configuration",style:bn,children:an("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[rn("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1"}),rn("path",{d:"M9 5V2a1 1 0 00-1-1H2a1 1 0 00-1 1v6a1 1 0 001 1h3"})]})}),x&&rn("div",{className:"semiotic-chart-status","aria-live":"polite","aria-atomic":"true",style:{padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:700,letterSpacing:"0.05em",textTransform:"uppercase",background:hn[x].bg,color:hn[x].color,lineHeight:"18px"},children:x})]})]}),m&&rn("div",{className:"semiotic-chart-banner",children:m}),me,se&&rn("div",{className:"semiotic-chart-mobile-summary",style:{display:"none",padding:"8px 12px",fontSize:12,lineHeight:1.45,color:"var(--semiotic-text-secondary, #666)",borderBottom:"1px solid var(--semiotic-border, #e0e0e0)"},children:se}),oe&&rn("div",{className:"semiotic-chart-mobile-standard-controls",style:{display:"none",padding:"10px 12px",borderBottom:"1px solid var(--semiotic-border, #e0e0e0)",background:"var(--semiotic-surface, var(--semiotic-bg, #f6f8fa))"},children:oe}),H&&rn("div",{className:"semiotic-chart-description",role:"note",style:W?{padding:"8px 16px",fontSize:12,lineHeight:1.5,color:"var(--semiotic-text-secondary, #666)",borderBottom:"1px solid var(--semiotic-border, #e0e0e0)"}:on,children:H}),U&&rn("div",{className:"semiotic-chart-nav",style:G?{padding:"8px 8px",borderBottom:"1px solid var(--semiotic-border, #e0e0e0)",maxHeight:240,overflow:"auto"}:void 0,children:rn(Kt,{tree:U,label:"string"==typeof e&&e?e+" — navigable structure":"Chart navigable structure",visible:G,chartId:"string"==typeof l?.props?.chartId?l.props.chartId:void 0})}),an("div",{className:"semiotic-chart-body",ref:N,style:{position:"relative",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",...I?{flex:1}:{height:o}},children:[ge,w]})]})]}),O?rn(r,{children:be}):be;var be}),bn={width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",cursor:"pointer",borderRadius:4,color:"var(--semiotic-text-secondary, #666)",padding:0};import*as yn from"react";import{jsx as vn,jsxs as xn}from"react/jsx-runtime";function wn({children:e,controls:t,mobile:i,breakpoint:n=480,chartMode:r="mobile",mobileInteraction:a=!0,mobileSemantics:o,mobileSummary:s,chips:l=[],activeChip:c,onChipChange:d,detail:u,detailTitle:m="Details",detailMode:h="sheet",initialDetailOpen:p=!1,allowHorizontalScroll:f=!1,hideToolbar:g=!1,chartDefaults:b,...y}){const[v,x]=yn.useState(()=>c??l.find(e=>!e.disabled)?.id),[w,C]=yn.useState(p);yn.useEffect(()=>{void 0===c&&(l.length?l.some(e=>e.id===v&&!e.disabled)||x(l.find(e=>!e.disabled)?.id):x(void 0))},[c,l,v]);const k=c??v,$=yn.useCallback(e=>{e.disabled||(void 0===c&&x(e.id),d?.(e))},[c,d]),S=l.length?vn("div",{className:"semiotic-mobile-chip-row",role:"list","aria-label":"Mobile chart controls",children:l.map(e=>xn("button",{type:"button",className:"semiotic-mobile-chip","aria-pressed":e.id===k,disabled:e.disabled,onClick:()=>$(e),title:"string"==typeof e.description?e.description:void 0,children:[vn("span",{children:e.label}),e.description&&vn("small",{className:"semiotic-mobile-chip-description",children:e.description})]},e.id))}):null,A=s||S?xn("div",{className:"semiotic-mobile-summary-card",children:[s&&vn("div",{className:"semiotic-mobile-summary-copy",children:s}),S]}):i?.summary,j={breakpoint:n,chartMode:r,mobileInteraction:a,semantics:o,allowHorizontalScroll:f,hideToolbar:g,...i,summary:A},N=yn.useMemo(()=>{if(!b||!yn.isValidElement(e))return e;const t=e.props,i={};for(const[e,n]of Object.entries(b))null==t[e]&&(i[e]=n);return Object.keys(i).length>0?yn.cloneElement(e,i):e},[e,b]),I=!!u&&"sheet"===h,M=!!u&&"inline"===h||I&&w,L=I?vn("button",{type:"button",className:"semiotic-mobile-detail-toggle","aria-expanded":w,onClick:()=>C(e=>!e),children:w?"Hide details":"Show details"}):null,P=t||L?xn("div",{className:"semiotic-mobile-control-stack",children:[t,L]}):void 0;return xn("div",{className:"semiotic-mobile-chart-shell",children:[vn("style",{children:`\n .semiotic-mobile-chart-shell {\n display: grid;\n gap: 10px;\n width: 100%;\n }\n .semiotic-mobile-summary-card {\n display: grid;\n gap: 10px;\n }\n .semiotic-mobile-summary-copy {\n font-size: 13px;\n line-height: 1.45;\n }\n .semiotic-mobile-chip-row {\n display: flex;\n gap: 8px;\n overflow-x: auto;\n padding-bottom: 2px;\n -webkit-overflow-scrolling: touch;\n }\n .semiotic-mobile-chip {\n display: inline-flex;\n flex: 0 0 auto;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n min-height: 40px;\n min-width: 44px;\n border: 1px solid var(--semiotic-border, #d8d8d8);\n border-radius: 999px;\n padding: 7px 12px;\n background: var(--semiotic-bg, #fff);\n color: var(--semiotic-text, #222);\n font: inherit;\n font-size: 12px;\n font-weight: 700;\n cursor: pointer;\n }\n .semiotic-mobile-chip[aria-pressed="true"] {\n border-color: var(--semiotic-primary, #1f7a6d);\n background: color-mix(in srgb, var(--semiotic-primary, #1f7a6d) 14%, transparent);\n }\n .semiotic-mobile-chip:disabled {\n cursor: not-allowed;\n opacity: 0.45;\n }\n .semiotic-mobile-chip-description {\n display: block;\n max-width: 160px;\n margin-top: 2px;\n color: var(--semiotic-text-secondary, #666);\n font-size: 10px;\n font-weight: 500;\n line-height: 1.2;\n }\n .semiotic-mobile-control-stack {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n }\n .semiotic-mobile-detail-toggle {\n min-height: 32px;\n border: 1px solid var(--semiotic-border, #d8d8d8);\n border-radius: 999px;\n padding: 5px 10px;\n background: transparent;\n color: var(--semiotic-text, #222);\n font: inherit;\n font-size: 12px;\n font-weight: 700;\n cursor: pointer;\n }\n .semiotic-mobile-detail-panel {\n border: 1px solid var(--semiotic-border, #d8d8d8);\n border-radius: 16px;\n background: var(--semiotic-bg, #fff);\n color: var(--semiotic-text, #222);\n box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);\n overflow: hidden;\n }\n .semiotic-mobile-detail-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 10px 12px;\n border-bottom: 1px solid var(--semiotic-border, #d8d8d8);\n font-size: 13px;\n font-weight: 800;\n }\n .semiotic-mobile-detail-body {\n padding: 12px;\n font-size: 13px;\n line-height: 1.5;\n }\n @media (max-width: ${n}px) {\n .semiotic-mobile-detail-panel[data-mode="sheet"] {\n position: sticky;\n bottom: 8px;\n z-index: 2;\n max-height: min(55vh, 420px);\n overflow: auto;\n }\n }\n `}),vn(gn,{...y,controls:P,mobile:j,children:N}),M&&xn("section",{className:"semiotic-mobile-detail-panel","data-mode":h,"aria-label":"string"==typeof m?m:"Chart details",children:[xn("div",{className:"semiotic-mobile-detail-header",children:[vn("span",{children:m}),I&&vn("button",{type:"button",className:"semiotic-mobile-detail-toggle",onClick:()=>C(!1),children:"Close"})]}),vn("div",{className:"semiotic-mobile-detail-body",children:u})]})]})}import*as Cn from"react";import{jsx as kn,jsxs as $n}from"react/jsx-runtime";function Sn(e,t){if(t)return"function"==typeof t?t(e):e?.[t]}function An(e,t){const i="function"==typeof t?t(e):e[t];return Array.isArray(i)?i:[]}function jn(e){return{strategy:"small-multiples",responsive:!0,supportsResponsiveLayout:!0,summary:`${e} vertically stacked small multiple panel${1===e?"":"s"} with shared scale guidance.`,interaction:{primary:"tap",alternatives:["panel summary","linked selection"],hoverFallback:"tap-to-lock",targetSize:44},labels:{strategy:"external",minFontSize:12}}}function Nn(e,t){if(!Cn.isValidElement(e))return e;const i=e.props,n={};for(const[e,r]of Object.entries(t))void 0!==r&&null==i[e]&&(n[e]=r);return Object.keys(n).length>0?Cn.cloneElement(e,n):e}function In({items:e,children:t,columns:i=3,tabletColumns:n=2,mobileColumns:r=1,mobileBreakpoint:o=480,tabletBreakpoint:s=860,gap:l=12,mode:c="mobile",chartHeight:u=220,sharedExtent:m=!0,valueAccessor:h,dataAccessor:p="data",extentProps:f=["yExtent","valueExtent"],linkedHover:g,selection:b,linkedBy:y,linkProvider:v="auto",selections:x,showLegend:w=!1,legendPosition:C,legendInteraction:k,legendSelectionName:$,legendField:S,mobileInteraction:A=!0,mobileSemantics:j,labelMode:N="panel",chartDefaults:I,className:M,style:L}){const P=d(),z=e||"function"==typeof t?[]:Cn.Children.toArray(t),R=e??z.map((e,t)=>({id:"panel-"+(t+1)})),T=R.length,B=Cn.useMemo(()=>function(e,t,i,n){if(t&&"object"==typeof t)return t;if(!1===t)return{};const r=[],a=[];for(const t of e)if(t.extent&&r.push(t.extent[0],t.extent[1]),n)for(const e of An(t,i))a.push(Sn(e,n));const o=function(e){let t=1/0,i=-1/0;for(const n of e){const e=Number(n);Number.isFinite(e)&&(t>e&&(t=e),e>i&&(i=e))}if(Number.isFinite(t)&&Number.isFinite(i))return t===i?[t-1,i+1]:[t,i]}(a.length?a:r);return o?{yExtent:o,valueExtent:o}:{}}(R,m,p,h),[R,m,p,h]),F=Cn.useMemo(()=>{if(!y)return{name:void 0,fields:void 0,linkedHover:g,selection:b};const e=Array.isArray(y)?"small-multiples":y.name||"small-multiples",t=Array.isArray(y)?y:y.fields||[];return{name:e,fields:t,linkedHover:g??{name:e,fields:t},selection:b??{name:e}}},[y,g,b]),D=Cn.useMemo(()=>({linkedHover:F.linkedHover,selection:F.selection}),[F.linkedHover,F.selection]),E=Cn.useMemo(()=>{const e={mode:c,height:u,responsiveWidth:!0,mobileInteraction:A,mobileSemantics:j??jn(T),...D,...I};"legend"!==N&&(e.showLegend=!1),"direct"===N&&(e.directLabel=!0);for(const t of f)t in B&&(e[t]=B[t]);return e},[c,u,A,j,T,D,I,N,f,B]),O=$n("section",{className:["semiotic-small-multiple-chart",M].filter(Boolean).join(" "),style:L,"data-semiotic-small-multiple":"true",children:[kn("style",{children:`\n .semiotic-small-multiple-chart {\n --semiotic-small-multiple-columns: ${i};\n --semiotic-small-multiple-gap: ${l}px;\n display: grid;\n grid-template-columns: repeat(var(--semiotic-small-multiple-columns), minmax(0, 1fr));\n gap: var(--semiotic-small-multiple-gap);\n width: 100%;\n }\n .semiotic-small-multiple-panel {\n min-width: 0;\n border: 1px solid var(--semiotic-border, #d8d8d8);\n border-radius: 16px;\n background: var(--semiotic-bg, #fff);\n overflow: hidden;\n }\n .semiotic-small-multiple-heading {\n display: grid;\n gap: 3px;\n padding: 10px 12px 0;\n }\n .semiotic-small-multiple-title {\n margin: 0;\n color: var(--semiotic-text, #222);\n font-size: 13px;\n font-weight: 800;\n line-height: 1.25;\n }\n .semiotic-small-multiple-subtitle,\n .semiotic-small-multiple-summary {\n margin: 0;\n color: var(--semiotic-text-secondary, #666);\n font-size: 11px;\n line-height: 1.35;\n }\n .semiotic-small-multiple-plot {\n min-width: 0;\n padding: 4px 6px 8px;\n overflow: hidden;\n }\n @media (max-width: ${s}px) {\n .semiotic-small-multiple-chart {\n --semiotic-small-multiple-columns: ${n};\n }\n }\n @media (max-width: ${o}px) {\n .semiotic-small-multiple-chart {\n --semiotic-small-multiple-columns: ${r};\n }\n .semiotic-small-multiple-panel {\n border-radius: 14px;\n }\n .semiotic-small-multiple-heading {\n padding: 9px 10px 0;\n }\n }\n `}),R.map((e,i)=>{const n={...E},r="function"==typeof t?t(e,{item:e,index:i,count:T,chartProps:n,sharedExtent:B}):z[i];return $n("article",{className:"semiotic-small-multiple-panel","aria-label":"string"==typeof e.title?e.title:void 0,children:[(e.title||e.subtitle||e.summary)&&$n("header",{className:"semiotic-small-multiple-heading",children:[e.title&&kn("h3",{className:"semiotic-small-multiple-title",children:e.title}),e.subtitle&&kn("p",{className:"semiotic-small-multiple-subtitle",children:e.subtitle}),e.summary&&kn("p",{className:"semiotic-small-multiple-summary",children:e.summary})]}),kn("div",{className:"semiotic-small-multiple-plot",children:Nn(r,n)})]},e.id??i)})]});return!0===v||"auto"===v&&(y||g||b||x||!0===w)&&!P?kn(a,{selections:x,showLegend:w,legendPosition:C,legendInteraction:k,legendSelectionName:$??F.name??"small-multiples",legendField:S??F.fields?.[0]??"category",children:O}):O}import*as Mn from"react";import{Fragment as Ln,jsx as Pn,jsxs as zn}from"react/jsx-runtime";function Rn({children:e,columns:t="auto",minCellWidth:i=300,gap:n=16,tabletColumns:r,mobileColumns:a=1,mobileBreakpoint:o=480,tabletBreakpoint:s=860,chartDefaults:l,className:c,style:d}){const u="semiotic-chart-grid-"+Mn.useId().replace(/[^a-zA-Z0-9_-]/g,""),m="number"==typeof t?t:void 0,h="auto"===t?`repeat(auto-fill, minmax(${i}px, 1fr))`:`repeat(${t}, 1fr)`,p=["semiotic-chart-grid",u,c].filter(Boolean).join(" ");return zn(Ln,{children:[Pn("style",{children:`\n ${r?`\n @media (max-width: ${s}px) {\n .${u} {\n grid-template-columns: repeat(${r}, minmax(0, 1fr)) !important;\n }\n }`:""}\n @media (max-width: ${o}px) {\n .${u} {\n grid-template-columns: repeat(${a}, minmax(0, 1fr)) !important;\n }\n .${u} > [data-semiotic-chart-grid-primary="true"] {\n grid-column: span ${a} !important;\n }\n }\n `}),Pn("div",{className:p,style:{display:"grid",gridTemplateColumns:h,gap:n,width:"100%",...d},children:Mn.Children.map(e,e=>{if(!Mn.isValidElement(e))return e;const t=e.props,i={};if(l)for(const[e,n]of Object.entries(l))null==t[e]&&(i[e]=n);const n=Object.keys(i).length>0?Mn.cloneElement(e,i):e;return"primary"!==e.props.emphasis||void 0!==m&&2>m?n:Pn("div",{"data-semiotic-chart-grid-primary":"true",style:{gridColumn:"span 2",minWidth:0},children:n})})})]})}Rn.displayName="ChartGrid";import*as Tn from"react";import{Fragment as Bn,jsx as Fn,jsxs as Dn}from"react/jsx-runtime";function En({children:e,context:t,position:i="right",contextSize:n=250,mobilePosition:r="bottom",mobileBreakpoint:a=480,gap:o=12,className:s,style:l}){const c="semiotic-context-layout-"+Tn.useId().replace(/[^a-zA-Z0-9_-]/g,""),d="left"===i||"right"===i,u="left"===i||"top"===i,m={display:"flex",flexDirection:d?u?"row-reverse":"row":u?"column-reverse":"column",gap:o,width:"100%",...l},h=d?{flex:`0 0 ${n}px`,width:n,minHeight:0}:{flex:`0 0 ${n}px`,height:n,minWidth:0};return Dn(Bn,{children:[Fn("style",{children:`\n @media (max-width: ${a}px) {\n .${c}[data-mobile-position="bottom"] {\n flex-direction: column !important;\n }\n .${c}[data-mobile-position="top"] {\n flex-direction: column-reverse !important;\n }\n .${c}[data-mobile-position="bottom"] > .semiotic-context-panel,\n .${c}[data-mobile-position="top"] > .semiotic-context-panel {\n flex: 0 0 auto !important;\n width: 100% !important;\n height: auto !important;\n }\n }\n `}),Dn("div",{className:["semiotic-context-layout",c,s].filter(Boolean).join(" "),"data-mobile-position":r,style:m,children:[Fn("div",{className:"semiotic-context-primary",style:{flex:"1 1 0%",minWidth:0,minHeight:0},children:e}),Fn("div",{className:"semiotic-context-panel",style:h,children:t})]})]})}En.displayName="ContextLayout";import{useState as On,useEffect as Hn,useRef as Wn,useCallback as Un}from"react";import{jsx as Gn,jsxs as Vn}from"react/jsx-runtime";function qn({children:e,position:t="right",size:i=300,trigger:n="click",chartId:r,observation:a,dismissOnEmpty:o=!0,showClose:s=!0,onToggle:c,className:d,style:u}){const[m,h]=On(null),[p,f]=On(null),[g,b]=On(!1),[y,v]=On(!1),x=Wn(null),w=Wn(void 0),C="click"===n?["click","click-end"]:["hover","hover-end"],{latest:k}=l({types:C,chartId:r,limit:1}),$=void 0!==a?a:k,S=Un(()=>{v(!0),b(!1),clearTimeout(w.current),w.current=setTimeout(()=>{v(!1),h(null),f(null)},200)},[]);if(Hn(()=>{if($)if("click"===$.type||"hover"===$.type){const e=$;h(e.datum),f(e),b(e=>(e||(v(!0),clearTimeout(w.current),w.current=setTimeout(()=>v(!1),200)),!0))}else!o||"click-end"!==$.type&&"hover-end"!==$.type||S()},[o,S,$]),Hn(()=>{c?.(g)},[g,c]),Hn(()=>()=>clearTimeout(w.current),[]),!m&&!y)return null;const A=m&&p?e(m,p):null;if(null===A&&!y)return null;const j=function(e,t,i,n){const r={position:"absolute",background:"var(--semiotic-bg, #fff)",borderColor:"var(--semiotic-border, #e0e0e0)",borderStyle:"solid",borderWidth:0,boxSizing:"border-box",zIndex:10,display:"flex",flexDirection:"column",transition:n?"transform 200ms ease-out, opacity 200ms ease-out":void 0};return"right"===e?{...r,top:0,right:0,width:t,height:"100%",borderLeftWidth:1,padding:"12px 16px",transform:i?"translateX(0)":`translateX(${t}px)`,opacity:i?1:0}:"bottom"===e?{...r,bottom:0,left:0,width:"100%",height:t,borderTopWidth:1,padding:"12px 16px",transform:i?"translateY(0)":`translateY(${t}px)`,opacity:i?1:0}:{...r,top:"50%",left:"50%",transform:i?"translate(-50%, -50%) scale(1)":"translate(-50%, -50%) scale(0.95)",opacity:i?1:0,width:Math.min(t,400),maxHeight:"80%",borderWidth:1,borderRadius:8,padding:"16px 20px",boxShadow:"0 8px 32px rgba(0,0,0,0.12)"}}(t,i,g,y);return Vn("div",{ref:x,className:`semiotic-details-panel semiotic-details-${t}${d?" "+d:""}`,style:{...j,...u},children:[s&&Gn("button",{className:"semiotic-details-close",onClick:S,"aria-label":"Close details",style:Jn,children:Gn("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:Gn("path",{d:"M2 2l8 8M10 2l-8 8"})})}),Gn("div",{className:"semiotic-details-content",style:{overflow:"auto",flex:1},children:A})]})}var Jn={position:"absolute",top:8,right:8,width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",cursor:"pointer",borderRadius:4,color:"var(--semiotic-text-secondary, #666)",padding:0,zIndex:1};qn.displayName="DetailsPanel";import*as Zn from"react";import{interpolateLab as _n}from"d3-interpolate";function Yn(e){return null==e?null:e.data??e.datum??e}function Xn(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}var Kn=["hover","hover-end","focus","activate","click","click-end","selection","selection-end"];function Qn({children:e,observation:t,chartId:i,types:n=Kn,fallback:r=null,as:a="div",live:o="polite",atomic:s=!0,className:c,style:d}){const{latest:u}=l({chartId:i,types:n,limit:1}),m=void 0!==t?t:u,h=m&&n.includes(m.type)?m:null,p=er(h),f=p&&h?e(p,h):r;return Zn.createElement(a,{className:c,style:d,"aria-live":o,"aria-atomic":s},f)}function er(e){return e?"selection"===e.type?Yn(e.selection.fields):"hover"===e.type||"click"===e.type||"focus"===e.type||"activate"===e.type||"late-data"===e.type?Yn(e.datum):null:null}function tr(e){const t=e.designContract?.chartFamily??e.title??"chart",i=e.audience?.primary?" for "+e.audience.primary:"",n=e.designContract?.whyThisForm;return`${t}: ${e.intent.primary}${i}${n?". "+n:""}`}function ir(e,t){const i=e.intents.map(e=>"string"==typeof e?e:e.id??e.name).filter(e=>!!e),n=e.intents.find(e=>"string"!=typeof e&&"primary"===e.strength),r=("object"==typeof n?n.id??n.name:void 0)??i[0]??"explanation";return{ididVersion:"0.1",chartId:t.chartId,title:t.title??e.name,intent:{primary:r,secondary:i.filter(e=>e!==r)},audience:{primary:e.audience?.primary,familiarityAssumptions:Object.fromEntries(Object.entries(e.audience?.familiarity??{}).map(([e,t])=>[e,t+""])),literacyTargets:e.audience?.literacyTargets?.map(e=>({feature:e.concept,rationale:e.rationale}))},reception:e.reception?{channels:e.reception.channels,strengths:e.reception.strengths,risks:e.reception.risks,scaffolds:e.reception.scaffolds,memorableForm:e.reception.memorableForm}:void 0,designContract:{chartFamily:e.frameFamily,whyThisForm:e.designContract.whyThisForm??e.designContract.whyCustom,whyNotDefault:e.designContract.whyNotDefault,risks:e.reception?.risks,misuse:e.designContract.misuse},accessibility:{description:t.description,navigation:"required"===e.accessibility.keyboardNavigation||null!=e.navigation,dataFallback:!0===e.accessibility.fallbackTable||"required"===e.accessibility.accessibleTable||!0===e.accessibility.requiresAccessibleTable,manualChecks:["real screen-reader behavior","keyboard order quality","custom metaphor comprehension","animation distraction"]},provenance:t.dataSources||t.reviewStatus?{dataSources:t.dataSources,reviewStatus:t.reviewStatus,generatedBy:"Semiotic recipe intelligence"}:void 0}}Qn.displayName="ObservationReadout";import*as nr from"react";import{jsx as rr,jsxs as ar}from"react/jsx-runtime";function or({manifest:e,label:t="Intent Mark",className:i,showSummary:n=!0}){const[r,a]=nr.useState(!1),o=nr.useMemo(()=>JSON.stringify(e,null,2),[e]),s=nr.useCallback(async()=>{"undefined"!=typeof navigator&&navigator.clipboard&&(await navigator.clipboard.writeText(o),a(!0),window.setTimeout(()=>a(!1),1200))},[o]);return ar("details",{className:i?"semiotic-intent-mark "+i:"semiotic-intent-mark",style:{border:"1px solid var(--semiotic-border, #c8c8c8)",borderRadius:6,background:"var(--semiotic-surface, #fff)",color:"var(--semiotic-text, #222)",fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[ar("summary",{style:{cursor:"pointer",padding:"7px 10px",fontSize:12,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase"},children:[t," · ",e.intent.primary]}),ar("div",{style:{padding:"0 10px 10px"},children:[n&&rr("p",{style:{margin:"4px 0 10px",fontSize:13,lineHeight:1.45},children:tr(e)}),rr("button",{type:"button",onClick:s,style:{border:"1px solid currentColor",borderRadius:4,background:"transparent",color:"inherit",padding:"4px 8px",font:"inherit",fontSize:12,cursor:"pointer"},children:r?"Copied":"Copy manifest"}),rr("pre",{style:{maxHeight:280,overflow:"auto",margin:"10px 0 0",padding:10,background:"var(--semiotic-bg, #f5f5f5)",fontSize:11,lineHeight:1.45,whiteSpace:"pre-wrap"},children:o})]})]})}import{useCallback as sr,useEffect as lr,useMemo as cr,useRef as dr,useState as ur}from"react";var mr=["hover","click","focus","activate"];function hr(e){if("datum"===e.role&&e.datum)return e.datum;for(const t of e.children??[]){const e=hr(t);if(e)return e}return null}function pr(e,t){return e?t.map(t=>e[t]+"").join(""):""}function fr(e,t){if(e.id===t)return e;for(const i of e.children??[]){const e=fr(i,t);if(e)return e}return null}function gr(e){const{tree:t,chartId:i,observe:n=mr}=e,r=e.selectionName??"__semiotic-nav-sync"+(i?":"+i:""),a=cr(()=>{if(e.matchFields)return e.matchFields;const i=hr(t);return i?Object.keys(i).filter(e=>{return!e.startsWith("_")&&(null==(t=i[e])||"string"==typeof t||"number"==typeof t||"boolean"==typeof t);var t}):[]},[e.matchFields,t]),o=cr(()=>{const e=new Map,i=t=>{if("datum"===t.role&&t.datum){const i=pr(t.datum,a);e.has(i)||e.set(i,t.id)}for(const e of t.children??[])i(e)};return i(t),e},[t,a]),{selectPoints:s,clear:c}=u({name:r,fields:a}),d=cr(()=>[...n,"hover-end"],[n]),{latest:m}=l({chartId:i,types:d,limit:1}),[h,p]=ur(t.id),f=dr(h);f.current=h;const g=dr(t);lr(()=>{const e=g.current;g.current=t;const i=fr(e,f.current),n=fr(t,f.current);"datum"===i?.role&&"datum"===n?.role&&i.datum&&n.datum&&a.length>0&&pr(i.datum,a)===pr(n.datum,a)||i&&n&&"datum"!==i.role&&"datum"!==n.role||(p(t.id),c())},[t,c,a]);const b=sr(e=>{if(p(e.id),"datum"===e.role&&e.datum&&a.length>0){const t={};for(const i of a)t[i]=[e.datum[i]];s(t)}else c()},[a,s,c]),y=e.annotations,v=cr(()=>{const e=new Set;if(0===a.length||!y)return e;for(const t of y){const i=o.get(pr(t,a));i&&e.add(i)}return e},[y,o,a]),x=sr(e=>{const t="number"==typeof e?y?.[e]:e;if(!t||0===a.length)return!1;const i=o.get(pr(t,a));if(!i)return!1;p(i);const n={};for(const e of a)n[e]=[t[e]];return s(n),!0},[y,o,a,s]),w=dr(null),C=sr(e=>{if(i&&e.chartId!==i)return;if("hover-end"===e.type){if(e===w.current)return;return void(w.current=e)}if(!function(e){return"hover"===e.type||"click"===e.type||"focus"===e.type||"activate"===e.type}(e))return;if(!n.includes(e.type))return;if(e===w.current)return;if(w.current=e,0===a.length)return;const t=function(e){const t=e,i=t.data;if(!i||"object"!=typeof i||Array.isArray(i))return e;const n=e=>e.every(e=>"number"==typeof t[e]),r=n(["x0","x1","y0","y1","width","height","value"]),a=n(["y0","y1","sankeyWidth","value"])&&"source"in t&&"target"in t;return r||a?i:e}(e.datum),r=o.get(pr(t,a));r&&p(e=>e===r?e:r)},[i,n,o,a]),k=dr(null);return lr(()=>{m&&m!==k.current&&(k.current=m,C(m))},[m,C]),{activeId:h,onActiveChange:b,selection:{name:r},onObservation:C,handleObservation:C,annotatedIds:v,focusAnnotation:x}}import{Fragment as br,jsx as yr,jsxs as vr}from"react/jsx-runtime";function xr({items:e,title:t="Additional notes",empty:i=null,ordered:n=!0,renderItem:r,className:a,style:o}){if(!e.length)return i?yr(br,{children:i}):null;const s=n?"ol":"ul";return vr("section",{className:["semiotic-mobile-annotation-callouts",a].filter(Boolean).join(" "),style:o,children:[yr("style",{children:"\n .semiotic-mobile-annotation-callouts {\n display: grid;\n gap: 8px;\n padding: 10px 12px;\n border: 1px solid var(--semiotic-border, #d8d8d8);\n border-radius: 14px;\n background: var(--semiotic-bg, #fff);\n color: var(--semiotic-text, #222);\n }\n .semiotic-mobile-annotation-callouts h3 {\n margin: 0;\n font-size: 13px;\n font-weight: 800;\n line-height: 1.25;\n }\n .semiotic-mobile-annotation-callouts ol,\n .semiotic-mobile-annotation-callouts ul {\n display: grid;\n gap: 8px;\n margin: 0;\n padding-left: 18px;\n }\n .semiotic-mobile-annotation-callouts li {\n font-size: 13px;\n line-height: 1.45;\n }\n .semiotic-mobile-annotation-callouts small {\n display: block;\n margin-top: 2px;\n color: var(--semiotic-text-secondary, #666);\n font-size: 11px;\n line-height: 1.3;\n }\n "}),t&&yr("h3",{children:t}),yr(s,{children:e.map((e,t)=>yr("li",{children:r?r(e,t):vr(br,{children:[yr("span",{children:e.label}),(e.source||e.emphasis)&&yr("small",{children:[e.emphasis,e.source].filter(Boolean).join(" - ")})]})},e.id))})]})}export{p as exportChart,b as VISUALIZATION_CONTROL_TYPES,y as createControlObservationAdapter,x as auditVisualizationControls,w as defineChartRecipe,C as validateChartRecipe,k as isRegisteredRecipeLayout,$ as isJsonSafe,L as resolveRecipeRoleField,P as recipeToChartCapability,T as registerChartRecipe,B as unregisterChartRecipe,F as getChartRecipe,D as listChartRecipes,E as getRegisteredRecipeCapabilities,O as hasRegisteredRecipeCapabilities,H as registerRecipeLayout,W as unregisterRecipeLayout,U as getRecipeLayout,G as resolveChartRecipe,Z as recipeIntentId,_ as recipeConfig,K as fieldForRole,se as toConfig,le as fromConfig,ce as toURL,de as fromURL,ue as copyConfig,me as configToJSX,he as serializeSelections,pe as deserializeSelections,xe as fromVegaLite,ke as describeRecipeChart,He as communicativeActForIntent,We as resolveCommunicativeAct,Ke as describeChart,it as buildRecipeNavigationTree,pt as buildNavigationTree,ft as flattenVisible,gt as countNodes,zt as subscribeToConversationArcChange,Rt as registerConversationArcSink,Tt as createLocalStorageConversationArcSink,Bt as createIndexedDBConversationArcSink,Ft as createWebhookConversationArcSink,Dt as loadConversationArc,Et as replayConversationArc,Ot as recordAudienceChange,Ht as recordAnnotationStatusChange,Gt as enableConversationArc,Vt as disableConversationArc,qt as getConversationArcStore,Kt as AccessibleNavTree,ii as clampMobileRange,ni as zoomMobileRange,ri as useMobileRangeControls,mi as MobileStandardControls,hi as HIERARCHY_CHARTS,pi as NETWORK_CHARTS,fi as BAR_AREA_CHARTS,gi as TREND_SERIES_CHARTS,bi as ORDINAL_BAR_CHARTS,yi as CURVE_CHARTS,vi as PIE_CHARTS,xi as PART_TO_WHOLE_ACCESSORS,wi as PART_TO_WHOLE_CHARTS,Ci as NORMALIZED_STACK_ACCESSORS,ki as VALUE_CHARTS,$i as XY_WITH_AXES_CHARTS,Ai as PHYSICS_MOTION_CHARTS,ji as CONTINUOUS_MOTION_CHARTS,Ni as PHYSICS_SETTLED_CHARTS,Ii as PHYSICS_DIAGNOSTIC_CHARTS,Mi as REALTIME_CHARTS,Li as DUAL_AXIS_CHARTS,Pi as GEO_CHARTS,zi as POINT_TARGET_RADIUS_PROP,Gi as auditMobileVisualization,Ji as formatMobileVisualizationAudit,Zi as mobileVisualizationCaveats,gn as ChartContainer,wn as MobileChartContainer,In as SmallMultipleChart,Rn as ChartGrid,En as ContextLayout,qn as DetailsPanel,Xn as nonNegativeFinite,Qn as ObservationReadout,er as observedDatum,tr as summarizeIntentManifest,ir as intentManifestFromRecipe,or as IntentMark,gr as useNavigationSync,xr as MobileAnnotationCalloutList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=new WeakMap;function e(n,r){if(!r)return r;const i=function(t){const e=t.trim();if(!e.startsWith("var(")||!e.endsWith(")"))return null;const n=e.slice(4,-1),r=n.indexOf(",");if(-1===r){const t=n.trim();return t.startsWith("--")?{name:t}:null}const i=n.slice(0,r).trim(),a=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:a||void 0}:null}(r);if(!i)return r;const a=()=>i.fallback?e(n,i.fallback):r,s=n.canvas;if(!s)return a();let l=t.get(s);l&&0===l.version||(l={version:0,map:new Map},t.set(s,l));const c=l.map.get(r);if(void 0!==c)return c;const o=getComputedStyle(s).getPropertyValue(i.name).trim()||a()||r;return l.map.set(r,o),o}export{e as resolveCSSColor};
|
package/dist/{chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js → c-DADXPJXV.min.js}
RENAMED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import{useRef as t,useEffect as e}from"react";import{brush as r}from"d3-brush";import{select as n}from"d3-selection";import{jsx as s}from"react/jsx-runtime";function l({frameRef:l,cellSize:o,onBrush:i}){const c=t(null),u=o-4-4,a=o-4-4;return e(()=>{if(!c.current)return;const t=n(c.current).select(".brush-g"),e=r().extent([[0,0],[u,a]]).on("brush end",t=>{const e=l.current?.getScales();if(!e)return;if(!(r=t.selection)||!Array.isArray(r[0]))return void i(null);var r;const[[n,s],[o,c]]=t.selection,u=[[e.x.invert(n),e.y.invert(s)],[e.x.invert(o),e.y.invert(c)]];i(u)});return t.call(e),t.select(".selection").attr("fill","steelblue").attr("fill-opacity",.15).attr("stroke","steelblue").attr("stroke-width",1),()=>{e.on("brush end",null)}},[u,a,l,i]),s("svg",{ref:c,width:o,height:o,style:{position:"absolute",top:0,left:0},children:s("g",{className:"brush-g",transform:"translate(4,4)"})})}export{l as ScatterplotMatrixBrushOverlay};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t={}){const n=!0===t.showRetractedAnnotations,s=!0===t.showSupersededAnnotations,r=new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&r.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!n)return!1;const t=e?.provenance?.stableId;return!(t&&r.has(t)&&!s)})}export{e as filterAnnotationsByStatus};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","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"],t=new Set(e);function n(e,t=new Set){if(null===e)return!0;const r=typeof e;if("string"===r||"boolean"===r)return!0;if("number"===r)return Number.isFinite(e);if("object"!==r)return!1;if(t.has(e))return!1;t.add(e);const a=Array.isArray(e)?e.every(e=>n(e,t)):Object.entries(e).every(([,e])=>n(e,t));return t.delete(e),a}var r=Symbol.for("semiotic.chartRecipeRegistry");function a(e){return function(){const e=globalThis;return e[r]||(e[r]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[r]}().recipes.get(e)}function o(e){return"string"==typeof e?a(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function i(e){return"string"==typeof e?e:e.id??e.name}function s(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function l(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 c(e,t,n){return n??o(t.recipe)??o(t.recipeId)??a(e)}function u(e,t,n=[]){const r=e.accessor?t[e.accessor]:void 0;if("string"==typeof r&&r)return r;if(e.field)return e.field;const a=n.find(e=>e&&"object"==typeof e);if(!a)return;const o=Object.entries(a).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?o.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in a):o.find(([,e])=>"string"==typeof e)?.[0]}function h(e,t){return e.dataRoles.find(e=>e.role===t)}function d(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function p(e,t,n,r,a,o={}){const i={...o};if(t)for(const[e,n]of Object.entries(t))i[e]=n;for(const e of n.dataRoles){const n=u(e,r,a),o=t&&n?t[n]:n;void 0!==o&&(i[e.role]=o)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{const n=i[t];return null==n?`{${t}}`:n+""})}var f=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend","recipe","layout"]),m=new Set(["data","nodes","edges","points","areas","lines","flows"]);function g(e){if(null==e)return e;if("function"==typeof e)return;if("object"!=typeof e)return e;if(e.$$typeof)return;if(Array.isArray(e))return e.map(g).filter(e=>void 0!==e);if(e instanceof Date)return e;const t={};for(const[n,r]of Object.entries(e)){if("function"==typeof r)continue;if(r&&"object"==typeof r&&r.$$typeof)continue;const e=g(r);void 0!==e&&(t[n]=e)}return t}function $(e,t){return!!m.has(e)&&("areas"!==e||"string"!=typeof t)}var y="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function b(r,s,l){const c=a(r)??o(s.recipe)??o(s.recipeId);if(c)return function(e,t,r){const a=function(e,t,r){const a={};for(const[o,i]of Object.entries(e))if(null!=i&&!f.has(o)&&"recipeId"!==o&&(t||!$(o,i)))if("function"==typeof i||i?.$$typeof){if(r)throw Error(`Portable recipe prop "${o}" is not JSON-safe.`)}else if(n(i))a[o]=y(i);else if(r)throw Error(`Portable recipe prop "${o}" is not JSON-safe.`);return a}(t,!1!==r?.includeData,"portable"===e.portability),o=e.intents.map(i).filter(e=>!!e),s={name:e.name,intents:o,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily};if("portable"===e.portability){if(!n(a))throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:a,manifest:s,version:"1",createdAt:(new Date).toISOString(),...r?.selections?{selections:r.selections}:{}}}return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:"Recipe contains or may depend on non-serializable local layout callbacks.",warnings:["This config is inspectable but cannot be rendered remotely by CLI or MCP."],props:a,manifest:s,version:"1",createdAt:(new Date).toISOString(),...r?.selections?{selections:r.selections}:{}}}(c,s,l);if(!function(e){return t.has(e)}(r))throw Error(`Unknown component "${r}". Known components: ${e.join(", ")}`);const u=!1!==l?.includeData,h={};for(const[e,t]of Object.entries(s))if(null!=t&&!f.has(e)&&(u||!$(e,t))&&"function"!=typeof t&&!t?.$$typeof)try{h[e]=y(g(t))}catch{}return{component:r,props:h,version:"1",createdAt:(new Date).toISOString(),...l?.selections?{selections:l.selections}:{}}}function v(e){const{props:t}=e,n=["<"+("LocalChartRecipe"===e.component?"ChartRecipe":e.component)];e.recipeId&&n.push(` recipeId="${e.recipeId}"`);for(const[e,r]of Object.entries(t))if("string"==typeof r)n.push(` ${e}="${r}"`);else if("boolean"==typeof r&&!0===r)n.push(" "+e);else if("boolean"==typeof r&&!1===r)n.push(` ${e}={false}`);else if("number"==typeof r)n.push(` ${e}={${r}}`);else{const t=JSON.stringify(r);n.push(80>t.length?` ${e}={${t}}`:` ${e}={${JSON.stringify(r,null,2)}}`)}return n.push("/>"),n.join("\n")}function C(e,t){if("function"==typeof e)return t=>+e(t);const n=e||t;return e=>+e[n]}function w(e,t){if("function"==typeof e)return e;const n=e||t;return e=>e[n]}var k=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),A=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),S=new Set(["PieChart","DonutChart","FunnelChart"]),x=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]);function P(e,t){return A.has(e)||S.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 j(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const n=e[t];if("string"==typeof n&&n)return n}}function F(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function D(e,t={}){const n=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,a=new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&a.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!n)return!1;const t=e?.provenance?.stableId;return!(t&&a.has(t)&&!r)})}var B={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"},L=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),M=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]);function N(e){return B[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function T(e){const t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}var I=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),O={"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"},R={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},G=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],E={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"};function U(e,t){const n=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,n={};for(const[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(n[e]=r);return{family:t.family,intentScores:Object.keys(n).length?n:void 0}}return e}}(t);if(n?.act)return n.act;if(n?.intentScores){const e=function(e){let t,n=0;for(const[r,a]of Object.entries(e))if("number"==typeof a&&a>0)if(a>n)t=r,n=a;else if(a===n&&void 0!==t){const e=G.indexOf(r),n=G.indexOf(t);-1===e||-1!==n&&e>=n||(t=r)}return t}(n.intentScores);if(e&&O[e]&&(n.intentScores[e]??0)>=3)return O[e]}return n?.family?R[n.family]:function(e){return"BumpChart"===e?"ranking":S.has(e)||"StackedAreaChart"===e?"apportioning":I.has(e)?"relating":A.has(e)?"comparing":x.has(e)?"characterizing":k.has(e)?"tracking":L.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}var z=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),H=new Set(["system","agent","watcher"]),q=new Set(["ai","agent","system","computed","dbt","great-expectations"]),J=new Set(["rule","statistical-test","llm-inference","computed"]);function V(e){const t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;const t=e;if("string"!=typeof t.type||!z.has(t.type))return!1;const n=t.provenance;return!(!n||"object"!=typeof n)&&(H.has(n.authorKind)||q.has(n.source)||J.has(n.basis))})}function Q(e="en"){let t,n;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),n=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),n=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?n.format(e):t.format(e):e+""}var K={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"};function W(e){const t=K["string"==typeof e.type?e.type:"annotation"]||"an annotation",n=function(e){const t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,n=t?.authorKind??t?.source??t?.basis;return"watcher"===n?"a watcher-flagged ":"agent"===n||"ai"===n||"llm-inference"===n?"an AI-suggested ":""}(e),r=n?n+t.replace(/^an? /,""):t,a="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return a?`${r} labeled "${a}"`:r}function X(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const n=D(t.filter(e=>!!e&&"object"==typeof e));if(0===n.length)return;const r=n.map(W),a=r.slice(0,5),o=r.length-a.length,i=function(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}(a)+(o>0?`, and ${o} more`:""),s=n.length;return`The author has marked ${1===s?"one feature":s+" features"} on this chart: ${i}.`}function Z(e,t,n={}){const r=void 0!==n.levels,a=new Set(n.levels??["l1","l2","l3"]);r||!n.capability&&!V(t)||a.add("l4");const o=c(e,t,n.recipe);if(o){const e=["l1","l2","l3","l4"].filter(e=>a.has(e));r||e.includes("l4")||e.push("l4");const c=function(e,t,n={}){const r=l(t),a=s(t),o=n.locale??"en",c="function"==typeof e.description?e.description({data:r,config:a,locale:o}):void 0,h=c?.levels??function(e,t,n,r){const a=d(e,["nominal","ordinal"]),o=d(e,["quantitative"]),s=a?u(a,n,t):void 0,l=o?u(o,n,t):void 0,c=a?.role??s??"category",h=o?.role??l??"value",p=e.encodings??[],f=p.length?p.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${c} and ${h} are mapped through the recipe's declared visual semantics`,{number:m,percent:g}=function(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}(r),$=new Map;if(s&&l)for(const e of t){const t=(e[s]??"Uncategorized")+"",n=Number(e[l]);Number.isFinite(n)&&$.set(t,($.get(t)??0)+n)}const y=[...$].sort((e,t)=>t[1]-e[1]),b=y.reduce((e,[,t])=>e+t,0),v=y[0],C=y[1],w=b>0?((v?.[1]??0)+(C?.[1]??0))/b:0,k=e.intents.map(e=>({id:i(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,A=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${c} and ${h}. ${S=f,S?S.charAt(0).toUpperCase()+S.slice(1):S}.`,l2:y.length>0?`${y.length} categories total ${m.format(b)}. ${v[0]} accounts for ${m.format(v[1])}${b>0?` (${g.format(v[1]/b)})`:""}${C?`, followed by ${C[0]} at ${m.format(C[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>y.length?v?v[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>w?`The total is distributed across ${y.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${v[0]} and ${C[0]}, which together account for ${g.format(w)}.`,l4:`The chart is intended for ${k??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`};var S}(e,r,a,o),p=n.levels??["l1","l2","l3","l4"],f={};for(const e of p)h[e]&&(f[e]=h[e]);const m=["l1","l2","l3","l4"].map(e=>f[e]).filter(e=>!!e).join(" "),g=n.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:m,levels:f,...g?.length?{caveats:g}:{}}}(o,t,{levels:e,locale:n.locale,audience:n.audience,includeCaveats:n.includeCaveats}),h=X(t);return{...c,text:h?`${h} ${c.text}`.trim():c.text,...h?{annotations:h}:{}}}const h=Q(n.locale??"en"),p=N(e),f=Array.isArray(t.data)?t.data:null,m=j(t),g=M.has(e)?function(e,t){const n=e.physics&&"object"==typeof e.physics?e.physics:null,r=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,a=[e.settledProjectionRows,e.projectionRows,r?.rows,n?.settledProjectionRows,n?.projectionRows,n?.settledProjection&&"object"==typeof n.settledProjection?n.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(a)?a.map((e,n)=>{if(!e||"object"!=typeof e)return null;const r=e,a=T(r.count??r.value??r.total??r.bodies??r.events);if(null==a)return null;const o=r.label??r.id??r.name??"container "+(n+1),i=T(r.secondary??r.secondaryCount),s=T(r.observed??r.observedCount);return{label:F(o,t),count:a,...null!=i?{secondary:i}:{},..."string"==typeof r.secondaryLabel&&r.secondaryLabel?{secondaryLabel:r.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}(t,h):null,{measure:$,measureFallback:y,dimension:b,dimensionFallback:v}=P(e,t),D="string"==typeof $&&$?$:y,B="string"==typeof b&&b?b:v,I={};if(M.has(e)&&function(e,t,n,r,a,o){const i=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),s=function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"body"}(e);if(a.has("l1")&&(r.l1=function(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}(e,t)),!a.has("l2")&&!a.has("l3"))return;if(!n||0===n.length)return void(a.has("l2")&&(r.l2="No settled projection is loaded yet."));const l=n.reduce((e,t)=>e+t.count,0),c=n.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),u=c[0]??n.slice().sort((e,t)=>t.count-e.count)[0];if(!u)return;const h=n.reduce((e,t)=>e+(t.secondary??0),0),d=n.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(a.has("l2"))if(0===c.length)r.l2=`The settled projection contains ${o(l)} ${Y(l,s)} across ${n.length} ${Y(n.length,i)}; no ${Y(2,i)} are non-empty yet.`;else{const e=h>0?` ${o(h)} ${Y(h,s)} ${1===h?"is":"are"} marked ${d}.`:"";r.l2=`The settled projection contains ${o(l)} ${Y(l,s)} across ${n.length} ${Y(n.length,i)}; ${c.length} ${Y(c.length,i)} ${1===c.length?"is":"are"} non-empty. The largest ${i} is ${u.label} with ${o(u.count)} ${Y(u.count,s)}.${e}`}if(a.has("l3")&&l>0&&c.length>0){const e=c.find(e=>e!==u),t=function(e,t){if(0>=t)return"0%";const n=e/t*100;return(10>n?Math.round(10*n)/10:Math.round(n))+"%"}(u.count,l);r.l3=e?`The settled projection is most concentrated in ${u.label}, which holds ${o(u.count)} ${Y(u.count,s)} (${t}); ${e.label} follows with ${o(e.count)} ${Y(e.count,s)}.`:`The settled projection is concentrated in ${u.label}, which holds all ${o(u.count)} ${Y(u.count,s)}.`}}(e,p,g,I,a,h),a.has("l1")&&!M.has(e))if("BumpChart"===e)I.l1=`A ${p} ranking ${m??"series"} by ${D} across ${B}.`;else if(k.has(e)||A.has(e))I.l1=`A ${p} of ${D} by ${B}`+(m?`, split by ${m}.`:".");else if(S.has(e))I.l1=`A ${p} showing ${D} across ${B} categories.`;else if(x.has(e))I.l1=`A ${p} of the distribution of ${D}`+(m?` by ${m}.`:".");else if(L.has(e)){const e=Array.isArray(t.nodes)?t.nodes.length:void 0,n=Array.isArray(t.edges)?t.edges.length:void 0,r=[null!=e?`${e} ${Y(e,"node")}`:null,null!=n?`${n} ${Y(n,"edge")}`:null].filter(Boolean);I.l1=`A ${p}${r.length?" with "+r.join(" and "):""}.`}else if("BigNumber"===e){const e="string"==typeof t.label?t.label:D;I.l1=`A single value${e?" for "+e:""}.`}else I.l1=`A ${p}.`;const O=k.has(e)||"BumpChart"===e||A.has(e)||S.has(e)||x.has(e);let R=null;if((a.has("l2")||a.has("l3")||a.has("l4"))&&O&&f&&f.length>0&&(R=function(e,t,n,r){let a=0,o=0,i=1/0,s=-1/0,l=null,c=null,u=0,h=0,d=null,p=null,f=NaN,m=NaN;for(const n of e){const e=t(n);Number.isFinite(e)&&(0===a&&(f=e,d=n),m=e,p=n,i>e&&(i=e,l=n,u=a),e>s&&(s=e,c=n,h=a),a++,o+=e)}return 0===a?null:{count:a,min:i,max:s,mean:o/a,minLabel:F(null!=l?n(l):null,r),maxLabel:F(null!=c?n(c):null,r),first:f,last:m,firstLabel:F(null!=d?n(d):null,r),lastLabel:F(null!=p?n(p):null,r),minIndex:u,maxIndex:h}}(f,C($,y),w(b,v),h)),a.has("l2")&&O&&(f&&0!==f.length?R&&(I.l2=S.has(e)?`${R.count} segments totaling ${h(function(e){return e.mean*e.count}(R))}. Largest is ${R.maxLabel} at ${h(R.max)}; smallest is ${R.minLabel} at ${h(R.min)}.`:`${D} ranges from ${h(R.min)} (${R.minLabel}) to ${h(R.max)} (${R.maxLabel}), with a mean of ${h(R.mean)} across ${R.count} points.`):I.l2="No data is loaded yet."),a.has("l3")&&R&&!m&&k.has(e)?I.l3=function(e,t,n){const{first:r,last:a,min:o,max:i,maxLabel:s,minLabel:l,firstLabel:c,lastLabel:u,minIndex:h,maxIndex:d,count:p}=e,f=i-o,m=a-r;if(0===f)return`${_(t)} is constant at ${n(r)} across the series.`;if(.04>f/(Math.abs(e.mean)||1))return`${_(t)} ends roughly where it started (${n(r)} at ${c} to ${n(a)} at ${u}), ranging between ${n(o)} and ${n(i)}.`;const g=d>0&&p-1>d,$=h>0&&p-1>h,y=(i-Math.max(r,a))/f,b=(Math.min(r,a)-o)/f;return g&&y>.15?`Overall ${t} climbs to a peak of ${n(i)} (${s}), then falls to ${n(a)} (${u}).`:$&&b>.15?`Overall ${t} drops to a low of ${n(o)} (${l}), then recovers to ${n(a)} (${u}).`:.05>Math.abs(m)/f?`${_(t)} ends roughly where it started (${n(r)} at ${c} to ${n(a)} at ${u}), ranging between ${n(o)} and ${n(i)}.`:m>0?d===p-1?`Overall ${t} rises from ${n(r)} (${c}) to a peak of ${n(a)} (${u}).`:`Overall ${t} rises from ${n(r)} (${c}) to ${n(a)} (${u}), after peaking at ${n(i)} (${s}).`:h===p-1?`Overall ${t} falls from ${n(r)} (${c}) to a low of ${n(a)} (${u}).`:`Overall ${t} falls from ${n(r)} (${c}) to ${n(a)} (${u}), after dipping to ${n(o)} (${l}).`}(R,D,h):a.has("l3")&&R&&!m&&A.has(e)&&(I.l3=`The highest ${B} is ${R.maxLabel} and the lowest is ${R.minLabel}.`),a.has("l4")){const r=V(t)?"alerting":U(e,n.capability);r&&(I.l4=function(e,t,n,r,a,o,i,s){const l=E[e],c=/^[aeiou]/i.test(l)?"an":"a";let u,h;switch(e){case"locating":u="This is a map",h="read values by location";break;case"presenting":u="This is a single-value display",h=`read ${"string"==typeof n.label&&n.label?n.label:a} as the headline number`;break;case"tracing":u=`This is ${c} ${l} chart`,h="follow the movement between states";break;case"nesting":u=`This is ${c} ${l} chart`,h="read it for nested structure and how children sum into their parents";break;case"relating":u=`This is ${c} ${l} chart`,h=`read it for whether ${o} and ${a} move together`;break;default:u=`This is ${c} ${l} chart`,h=function(e,t,n,r,a,o){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 "+n;case"comparing":return`compare ${n} across ${r}`;case"ranking":return"read it top to bottom by "+n;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+n;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,n){if(A.has(n)||S.has(n))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:r,last:a,min:o,max:i,minLabel:s,maxLabel:l,lastLabel:c,minIndex:u,maxIndex:h,count:d}=e,p=i-o;if(p>0){const e=h>0&&d-1>h,n=u>0&&d-1>u,f=(i-Math.max(r,a))/p,m=(Math.min(r,a)-o)/p;if(e&&f>.15)return`the peak of ${t(i)} at ${l} is the point to investigate`;if(n&&m>.15)return`the dip to ${t(o)} at ${s} is the point to investigate`;if(a>=i)return`the climb to ${t(a)} at ${c} warrants a closer look`;if(o>=a)return`the drop to ${t(a)} at ${c} warrants a closer look`}return`the extremes — ${l} (${t(i)}) and ${s} (${t(o)}) — are the points to check`}(t,a,o);case"tracking":return`read it for the trajectory of ${n}, which ${function(e){const t=e.max-e.min,n=e.last-e.first;return 0===t||.05>Math.abs(n)/t?"holds roughly steady":n>0?"rises":"falls"}(t)} from ${a(t.first)} (${t.firstLabel}) to ${a(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${n} across ${r}; ${t.maxLabel} leads at ${a(t.max)}`;case"ranking":return`read it top to bottom by ${n}; ${t.maxLabel} ranks highest at ${a(t.max)}`;case"apportioning":{const e=t.mean*t.count,n=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${a(e)} total; ${t.maxLabel} is the largest at ${a(t.max)}${null!=n?` (${n}%)`:""}`}case"characterizing":return`read it for the spread of ${n}, from ${a(t.min)} to ${a(t.max)}`;default:return"read the highlighted features"}}(e,r,a,o,i,t)}return`${u}; ${h}.${function(e,t){if(!t)return"";const n=t.familiarity?.[e];return"number"!=typeof n||n>2?"":` This ${N(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,s)}`}(r,e,t,m?null:R,D,B,h,n.audience))}const G=["l1","l2","l3","l4"].filter(e=>a.has(e)&&I[e]).map(e=>I[e]).join(" "),z=X(t);return{text:z?`${z} ${G}`.trim():G,levels:I,...z?{annotations:z}:{}}}function _(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Y(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function ee(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}var te=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),ne=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),re=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]);function ae(e,t,n){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:n]}function oe(e,t="—"){return null==e||""===e?t:"object"==typeof e?oe(e.id??e.name??e.label,t):e+""}function ie(e){const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function se(e){return oe(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function le(e,t){const n=[];return(e.linkedHover||e.selection||e.linkedBrush)&&n.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&n.push("Hover or focus a mark for its details."),n.length>0?" "+n.join(" "):""}function ce(e,t){t&&e.children?.push(t)}function ue(e,t){const n=ae(e,t,"children");return Array.isArray(n)?n:[]}function he(e,t,n){const r=ae(e,t,n);if(void 0!==r)return r;const a=e.properties;return a&&"object"==typeof a?ae(a,t,n):void 0}function de(e,t,n={}){const r=n.locale??"en",a=Math.max(1,n.maxLeaves??200),o=Q(r),i=c(e,t,n.recipe);if(i)return function(e,t,n={}){const r=l(t),a=s(t),o=Math.max(1,n.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:r,config:a,locale:n.locale??"en"});const i=(c=e.navigation)&&"object"==typeof c?e.navigation:void 0;var c;const f=(i?.groupByRole?h(e,i.groupByRole):void 0)??(i?.groupBy?.[0]?h(e,i.groupBy[0])??e.dataRoles.find(e=>e.field===i.groupBy?.[0]):void 0)??d(e,["nominal","ordinal"]),m=f?u(f,a,r):void 0,g=(i?.idRole?h(e,i.idRole):void 0)??d(e,["identifier"]),$=g?u(g,a,r):void 0,y={id:"root",role:"chart",label:i?.summaryTemplate?p(i.summaryTemplate,void 0,e,a,r,{count:r.length}):`${e.name}: ${r.length} ${1===r.length?"item":"items"} represented.`,level:1,children:[]};let b=0;const v=(t,n,o)=>{const s=$?t[$]:void 0,l=i?.itemLabelTemplate?p(i.itemLabelTemplate,t,e,a,r,{count:r.length}):function(e,t,n,r){const a=d(t,["nominal","ordinal"]),o=t.dataRoles.filter(e=>"quantitative"===e.semanticType),i=a?u(a,n,r):void 0,s=[];i&&null!=e[i]&&s.push(e[i]+"");for(const t of o){const a=u(t,n,r);a&&null!=e[a]&&s.push(`${t.role}: ${e[a]+""}`)}return s.length>0?s.join(", "):"Data item"}(t,e,a,r);return{id:"datum-"+ee(s??n),role:"datum",label:l,level:o,datum:t}};if(m){const e=new Map;for(const t of r){const n=(t[m]??"Uncategorized")+"",r=e.get(n);r?r.push(t):e.set(n,[t])}y.children=[...e].map(([e,t],n)=>{const r=t.slice(0,Math.max(0,o-b));b+=r.length;const a=r.map((e,t)=>v(e,1e5*n+t,3));return t.length>r.length&&a.push({id:"more-"+ee(e),role:"datum",label:`…and ${t.length-r.length} more items`,level:3}),{id:"group-"+ee(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:a}})}else{const e=r.slice(0,o);y.children=e.map((e,t)=>v(e,t,2)),r.length>e.length&&y.children.push({id:"more",role:"datum",label:`…and ${r.length-e.length} more items`,level:2})}return y}(i,t,{maxLeaves:a,locale:r});const f={id:"root",role:"chart",label:Z(e,t,{locale:r}).text||"Chart.",level:1,children:[]},m=function(e,t){const n=Array.isArray(e.annotations)?e.annotations:null;if(!n)return null;const r=D(n.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let a=0;const o=r.slice(0,t).map(e=>{const t=e.lifecycle?.status,n=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+a++,role:"annotation",level:3,label:`${r=W(e),r?r.charAt(0).toUpperCase()+r.slice(1):r}${n}.`,datum:e};var r});r.length>t&&o.push({id:"annotation-"+a++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});const i=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===i?"one marked feature":i+" marked features"}.`,children:o}}(t,a);if(te.has(e)){const n=function(e,t,n,r){const a=Array.isArray(t.nodes)?t.nodes:[],o=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],i=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",l=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>oe(ae(e,i,"id"),"unknown"),h=(e,t)=>oe(ae(e,t,""),"unknown"),d=new Set;for(const e of o)d.add(h(e,s)),d.add(h(e,l));const p=a.length>0?a:[...d].map(e=>({id:e})),f=new Map;for(const e of p)f.set(u(e),{links:0,value:0});for(const e of o){const t=h(e,s),n=h(e,l),r=ie(ae(e,c,"value"))??0;for(const e of[t,n]){const t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=r,f.set(e,t)}}const m={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${p.length} nodes and ${o.length} links.${le(t,"network")}`,children:[]};let g=0;const $=new Map,y=t.colorBy??"group";for(const e of p){const t=oe(ae(e,y,"group"),"Ungrouped"),n=$.get(t);n?n.push(e):$.set(t,[e])}const b=[...$].map(([e,t],a)=>{const o=[];for(const[e,i]of t.entries()){if(g>=n)break;g+=1;const t=u(i),s=f.get(t)??{links:0,value:0},l=s.value>0?`, ${r(s.value)} total flow`:"";o.push({id:`node-${a}-${e}-${se(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${l}.`,value:s.value>0?s.value:void 0,datum:i})}return{id:`nodes-${a}-${se(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:o}});b.length>0&&m.children?.push(...b);const v=o.slice(0,n).map((e,t)=>{const n=h(e,s),a=h(e,l),o=ie(ae(e,c,"value"));return{id:`link-${se(n)}-${se(a)}-${t}`,role:"datum",level:3,label:`${n} to ${a}${null==o?"":": "+r(o)}.`,value:o,datum:e}});return o.length>n&&v.push({id:"links-more",role:"datum",level:3,label:`…and ${o.length-n} more links.`,value:void 0}),v.length>0&&m.children?.push({id:"links",role:"series",level:2,label:`Links: ${o.length} ${1===o.length?"connection":"connections"}.`,children:v}),m}(e,t,a,o);return ce(n,m),n}if(ne.has(e)){const n=function(e,t,n,r){const a=t.data&&"object"==typeof t.data?t.data:null,o=t.childrenAccessor??"children",i=t.valueAccessor??"value",s=t.nodeLabel??t.nodeIdAccessor;let l=0;const c=new WeakMap,u=e=>{const t=c.get(e);if(t)return t;const n=ue(e,o),r=0===n.length?{leaves:1,value:ie(ae(e,i,"value"))??0,depth:1}:n.reduce((e,t)=>{const n=u(t);return{leaves:e.leaves+n.leaves,value:e.value+n.value,depth:Math.max(e.depth,n.depth+1)}},{leaves:0,value:0,depth:1});return c.set(e,r),r},h=(e,t,a)=>{const i=ue(e,o),c=oe(ae(e,s,"name"),"item "+a),d=u(e),p=d.value;if(0===i.length)return n>l?(l+=1,{id:`hierarchy-${se(a)}-${se(c)}`,role:"datum",level:t,label:`${c}${p>0?": "+r(p):""}.`,value:p>0?p:void 0,datum:e}):null;const f=i.map((e,n)=>h(e,t+1,`${a}-${n}`)).filter(e=>null!==e);return 0!==f.length||n>l||f.push({id:`hierarchy-${se(a)}-more`,role:"datum",level:t+1,label:"More hierarchy items are not shown."}),{id:`hierarchy-${se(a)}-${se(c)}`,role:"series",level:t,label:`${c}: ${d.leaves} ${1===d.leaves?"descendant":"descendants"}${p>0?", total "+r(p):""}.`,children:f}},d=a?u(a):null,p={id:"root",role:"chart",label:a?`A ${"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"} chart with ${d.leaves} leaves across ${d.depth} hierarchy levels.`:"A hierarchy chart with no hierarchy data loaded.",level:1,children:[]};if(a){const e=h(a,2,"root");e&&(p.children="series"===e.role&&""===oe(ae(a,s,"name"),"")?e.children:[e])}return p}(e,t,a,o);return ce(n,m),n}if(re.has(e)){const n=function(e,t,n,r){const a=function(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];const t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}(t.areas),o="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],i=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],l=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${a.length} regions.`:"FlowMap"===e?`A flow map with ${i.length} flows and ${o.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${o.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${o.length} locations.`}${le(t,"geo")}`,children:[]},h=[],d="ChoroplethMap"===e?a:o;d.slice(0,n).forEach((n,a)=>{const o=oe(he(n,"ChoroplethMap"===e?t.idAccessor:c,"id")??he(n,"name","name")??he(n,"label","label"),`${"ChoroplethMap"===e?"region":"location"} ${a+1}`),i=ie(he(n,l,"value"));h.push({id:`geo-${se(o)}-${a}`,role:"datum",level:2,label:`${o}${null==i?"":": "+r(i)}.`,value:i,datum:n})}),d.length>n&&h.push({id:"geo-more",role:"datum",level:2,label:`…and ${d.length-n} more locations.`}),h.length>0&&u.children?.push({id:"ChoroplethMap"===e?"regions":"locations",role:"series",level:2,label:`${"ChoroplethMap"===e?"Regions":"Locations"}: ${d.length} marks.`,children:h.map(e=>({...e,level:3}))});const p="FlowMap"===e?i:s;if(p.length>0){const e=p.slice(0,n).map((e,t)=>{const n=oe(e.source,"unknown"),a=oe(e.target,"unknown"),o=ie(ae(e,l,"value"));return{id:`route-${se(n)}-${se(a)}-${t}`,role:"datum",level:3,label:`${n} to ${a}${null==o?"":": "+r(o)}.`,value:o,datum:e}});u.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${p.length} ${1===p.length?"route":"routes"}.`,children:e})}return u}(e,t,a,o);return ce(n,m),n}const g=Array.isArray(t.data)?t.data:null,$=k.has(e)||A.has(e)||S.has(e)||x.has(e);if(!g||0===g.length||!$)return m&&(f.children=[m]),f;const{measure:y,measureFallback:b,dimension:v,dimensionFallback:B}=P(e,t),L=C(y,b),M=w(v,B),N="string"==typeof y&&y?y:b,T="string"==typeof v&&v?v:B,I=j(t);let O=0;const R=e=>`${e}-${O++}`,G=(e,t)=>{const n=e.slice(0,a).map(e=>((e,t)=>{const n=L(e),r=F(M(e),o);return{id:R("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(n)?o(n):"—"}`,value:Number.isFinite(n)?n:void 0,datum:e}})(e,t));return e.length>a&&n.push({id:R("more"),role:"datum",level:t,label:`…and ${e.length-a} more points`}),n},E=[];if(k.has(e)||A.has(e)){let t=1/0,n=-1/0,r=1/0,a=-1/0;const i=[];let s=!0;for(const e of g){const o=L(e);Number.isFinite(o)&&(t>o&&(t=o),o>n&&(n=o));const l=M(e);i.push(l),"number"==typeof l&&Number.isFinite(l)?(r>l&&(r=l),l>a&&(a=l)):s=!1}const l=new Set,c=[];for(const e of i){const t=e+"";l.has(t)||(l.add(t),c.push(e))}const u=s?`${o(r)} to ${o(a)}`:`${F(c[0],o)} to ${F(c[c.length-1],o)} (${A.has(e)?c.length+" categories":g.length+" points"})`;E.push({id:R("axis"),role:"axis",level:2,label:`${A.has(e)?"Category axis":"X axis"}: ${T}, ${u}.`}),t>n||E.push({id:R("axis"),role:"axis",level:2,label:`Value axis: ${N}, ${o(t)} to ${o(n)}.`})}if(I){const n=w(I,I),a=new Map;for(const e of g){const t=(n(e)??"—")+"",r=a.get(t);r?r.push(e):a.set(t,[e])}const o=[];for(const[n,i]of a){const a=Z(e,{...t,data:i},{levels:["l2","l3"],locale:r}).text;o.push({id:R("series"),role:"series",level:2,label:`Series ${n}: ${a}`,children:G(i,3)})}f.children=[...E,...o]}else f.children=[...E,...G(g,2)];return m&&f.children.push(m),f}var pe=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]);function fe(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function me(e){return fe(e)?e:void 0}function ge(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function $e(e){const t=ge(e);return null==t?void 0:Math.max(0,Math.floor(t))}function ye(...e){return e.map(me).find(Boolean)}function be(...e){return e.find(Array.isArray)}function ve(e){const t={};for(const[n,r]of Object.entries(e))void 0!==r&&(t[n]=r);return t}function Ce(e,t,n){return e["string"==typeof t&&t?t:n]}function we(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function ke(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Ae(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function Se(e,t,n){const r=e?.filter(e=>!0===me(e)?.sensor).length,a=me(t?.observation),o=me(a?.sensors),i=be(n?.activeSensors);return Math.max(r??0,o?Object.keys(o).length:0,i?.length??0)||void 0}function xe(e,t,n={}){const{capability:r,audience:a,locale:o}=n,i=n.levels??["l1","l2","l3"],s=!1!==n.includeStructure,l=U(e,r),c=Z(e,t,{levels:l?[...i,"l4"]:i,locale:o,capability:r,audience:a}),{l4:u,...h}=c.levels,d=["l1","l2","l3"].map(e=>c.levels[e]).filter(Boolean).join(" "),p={levels:h,text:c.annotations?`${c.annotations} ${d}`.trim():d,...c.annotations?{annotations:c.annotations}:{}};let f;if(l&&u){const e=(m=r)?"fits"in m||"buildProps"in m?{family:m.family}:{family:m.family,intentScores:m.intentScores}:{};f={act:l,sentence:u,family:e.family,intentScores:e.intentScores}}var m;const g=s?de(e,t,{maxLeaves:n.maxLeaves,locale:o}):void 0,$=function(e,t,n){if(!1===n)return;const r=fe(n)?n:void 0,a=me(t.physics),o=ye(r?.snapshot,a?.snapshot,t.physicsSnapshot,function(e){const t=me(e);return!!t&&(fe(t.world)||"simulationState"in t||"liveBodyOrder"in t)}(t.snapshot)?t.snapshot:void 0),i=ye(r?.evidence,a?.evidence,t.physicsEvidence,t.settledEvidence),s=ye(r?.config,a?.config,o?.config,t.config),l=ye(me(o?.world),me(a?.world)),c=ye(me(s?.kernel),me(l?.options)),u=be(l?.bodies),h=be(l?.colliders,s?.colliders),d=be(o?.queue,a?.queue),p=be(o?.liveBodyOrder),f=be(l?.springs),m=be(o?.activeSensorPairs),g=function(e){if(!e||0===e.length)return;const t=e.map((e,t)=>{const n=me(e);if(!n)return;const r=ge(n.count??n.value??n.total??n.bodies??n.events);if(null==r)return;const a=(n.label??n.id??n.name??"container "+(t+1))+"",o=null==n.id?void 0:n.id+"",i=ge(n.secondary??n.secondaryCount),s=ge(n.observed??n.observedCount);return ve({id:o,label:a,count:r,secondary:i,secondaryLabel:"string"==typeof n.secondaryLabel?n.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;const n=t.reduce((e,t)=>e+t.count,0),r=t.filter(e=>e.count>0).length,a=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:n,populatedCount:r,...a?{leader:a}:{}}}(function(e,t,n,r){const a=me(e.settledProjection),o=me(t?.settledProjection);return be(n?.projectionRows,n?.aggregates,e.settledProjectionRows,e.projectionRows,a?.rows,t?.settledProjectionRows,t?.projectionRows,o?.rows,r?.binCounts)}(t,a,r,i)),$=function(e,t){const n=e?.map((e,t)=>{const n=me(e);if(!n)return;const r=ge(n.count)??0,a=ge(n.total),o={label:(n.label??n.id??"sediment "+(t+1))+"",count:r};return null!=n.id&&(o.id=n.id+""),null!=a&&(o.total=a),o}).filter(e=>null!=e),r=$e(t?.bins)??n?.length??0,a=ge(t?.count)??n?.reduce((e,t)=>e+t.count,0)??0,o=ge(t?.total)??n?.reduce((e,t)=>e+(t.total??0),0),i=n?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==r||0!==a||o)return{bins:r,count:a,...null!=o&&o>0?{total:o}:{},...i?{leader:i}:{}}}(be(r?.sediment,a?.sediment,o?.sediment),ye(r?.sedimentTotals,a?.sedimentTotals)),y=p?.length??u?.length??$e(i?.bodyCount),b=function(e){if(e)return e.filter(e=>!0===me(e)?.sleeping).length}(u)??$e(i?.sleepingCount),v=d?.length,C="string"==typeof o?.simulationState?o.simulationState:void 0,w="boolean"==typeof i?.settled?i.settled:C?"settled"===C:null!=y||null!=b||null!=v?null!=y&&b===y&&0===(v??0):void 0,k=me(c?.gravity),A=ge(k?.x),S=ge(k?.y),x=ve({state:C,settled:w,elapsedSeconds:ge(o?.elapsedSeconds),paused:"boolean"==typeof o?.paused?o.paused:void 0,visible:"boolean"==typeof o?.visible?o.visible:void 0,seed:ge(c?.seed),gravity:null!=A&&null!=S?{x:A,y:S}:void 0,fixedDt:ge(s?.fixedDt??c?.fixedDt),timeScale:ge(s?.timeScale),maxSubsteps:$e(s?.maxSubsteps),liveBodies:y,sleepingBodies:b,queued:v,bodyLimit:ge(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),P=ve({colliders:h?.length,sensors:Se(h,s,l),springs:f?.length,activeSensorPairs:m?.length}),j=Object.keys(P).length>0,F=pe.has(e);if(!(Object.keys(x).length>0||j||g||$)||!F&&null==n)return;const D={simulation:x,...j?{geometry:P}:{},...g?{aggregates:g}:{},...$?{sediment:$}:{}},B=function(e){const t=[],n=e.simulation,r=[n.state??(n.settled?"settled":void 0),null!=n.liveBodies?`${n.liveBodies} live ${ke(n.liveBodies,"body")}`:void 0,null!=n.sleepingBodies?n.sleepingBodies+" sleeping":void 0,null!=n.queued?n.queued+" queued":void 0,null!=n.seed?"seed "+Ae(n.seed):void 0,n.gravity?`gravity (${Ae(n.gravity.x)}, ${Ae(n.gravity.y)})`:void 0,null!=n.fixedDt?`fixed step ${Ae(n.fixedDt)}s`:void 0,null!=n.timeScale?Ae(n.timeScale)+"x time":void 0].filter(Boolean);r.length>0&&t.push(`Physics simulation: ${r.join("; ")}.`);const a=e.geometry;if(a){const e=[null!=a.colliders?`${a.colliders} ${ke(a.colliders,"collider")}`:void 0,null!=a.sensors?`${a.sensors} ${ke(a.sensors,"sensor")}`:void 0,null!=a.springs?`${a.springs} ${ke(a.springs,"spring")}`:void 0,null!=a.activeSensorPairs?`${a.activeSensorPairs} active sensor ${ke(a.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}const o=e.aggregates;if(o){const e=o.leader,n=e?` Largest is ${e.label} with ${Ae(e.count)}.`:"";t.push(`Physics aggregates: ${Ae(o.totalCount)} settled ${ke(o.totalCount,"body")} across ${o.rows.length} ${ke(o.rows.length,"container")}; ${o.populatedCount} populated.${n}`)}const i=e.sediment;if(i){const e=null!=i.total?", value total "+Ae(i.total):"",n=i.leader?`; largest sediment bin is ${i.leader.label} with ${Ae(i.leader.count)}`:"";t.push(`Physics sediment: ${i.count} retained ${ke(i.count,"body")} in ${i.bins} ${ke(i.bins,"bin")}${e}${n}.`)}return t.join(" ")}(D);return{...D,text:B}}(e,t,n.physics),y=function(e,t,n){const r=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&r.push(`Current value is ${we(t.value)}.`);const e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,n="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;r.push(`The gauge scale runs from ${we(e)} to ${we(n)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){const a=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&r.push(`The ProcessSankey time domain runs from ${we(t.domain[0])} to ${we(t.domain[1])}.`),a.length>0){r.push(`${a.length} source flow${1===a.length?"":"s"} are supplied.`);for(const o of a.slice(0,n)){const n=Ce(o,t.sourceAccessor,"source"),a=Ce(o,t.targetAccessor,"target"),i=Ce(o,t.valueAccessor,"value");r.push("ProcessSankey"!==e||null==o.startTime&&null==o.endTime?`${we(n)} to ${we(a)} has value ${we(i)}.`:`${we(n)} to ${we(a)} has value ${we(i)} over ${we(o.startTime)}–${we(o.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){const e=me(t.data),a="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",o="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",i="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",s=[],l=e=>{const t=Array.isArray(e[a])?e[a]:[];if(0!==t.length)for(const e of t){const t=me(e);t&&l(t)}else s.push(e)};if(e&&l(e),s.length>0){r.push(s.length+" hierarchy leaves are supplied.");for(const e of s.slice(0,n))r.push(`${we(e[i])} has value ${we(e[o])}.`)}}if(pe.has(e)&&Array.isArray(t.data)){const n=t.data;r.push(`${n.length} observed source row${1===n.length?"":"s"} are supplied.`);const a="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,o="CollisionSwarmChart"===e?"x":"value",i=n.map(e=>ge(Ce(e,a,o))).filter(e=>null!=e);i.length>0&&r.push(`Observed ${"string"==typeof a?a:o} ranges from ${we(Math.min(...i))} to ${we(Math.max(...i))}.`)}if(0!==r.length)return{source:"chart-props",statements:r,text:"Exact chart-prop facts: "+r.join(" ")}}(e,t,Math.max(1,n.maxLeaves??200)),b=[p.text,f?.sentence,$?.text,y?.text].filter(Boolean).join(" ");return{component:e,description:p,intent:f,structure:g,physics:$,facts:y,text:b}}export{a as getChartRecipe,b as toConfig,v as configToJSX,xe as buildReaderGrounding};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as r from"react";import{jsx as e}from"react/jsx-runtime";var t,n={isActive:!1,predicate:()=>!0};function u(){return t??(t=r.createContext(null)),t}function c({value:r,children:t}){const n=u();return e(n.Provider,{value:r,children:t})}function i(){const e=u();return r.useContext(e)??n}function o(r,t){return null!=r?e(c,{value:t,children:r}):r}export{c as CustomLayoutSelectionProvider,i as useCustomLayoutSelection,o as wrapWithCustomLayoutSelection};
|