semiotic 3.9.2 → 3.10.1
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 +97 -76
- package/agent-skill/semiotic-charts/SKILL.md +13 -7
- package/ai/artifact-contract-reference.md +408 -0
- package/ai/artifact-surface-inventory.json +5586 -0
- package/ai/behaviorContracts.cjs +24 -2
- package/ai/cli.js +480 -56
- package/ai/componentMetadata.cjs +3 -1
- package/ai/dist/mcp-server.js +68 -68
- package/ai/examples.md +68 -1
- package/ai/reference.md +105 -14
- package/ai/schema.json +6646 -18
- package/ai/surface-manifest.json +34 -6
- package/ai/system-prompt.md +2 -0
- package/ai/task-packets/compare-category-totals.json +301 -0
- package/ai/task-packets/compare-category-totals.md +188 -0
- package/ai/task-packets/correct-published-chart.json +271 -0
- package/ai/task-packets/correct-published-chart.md +597 -0
- package/ai/task-packets/index.json +40 -0
- package/ai/task-packets/update-live-chart.json +289 -0
- package/ai/task-packets/update-live-chart.md +424 -0
- package/dist/c-2N7IU2NY.min.js +1 -0
- package/dist/c-2RL2QPZJ.min.js +1 -0
- package/dist/c-2WK7YJLL.min.js +1 -0
- package/dist/c-42PLDTX7.min.js +1 -0
- package/dist/c-45CQWZZ6.min.js +1 -0
- package/dist/c-4BRHKVKV.min.js +1 -0
- package/dist/c-7242NXSG.min.js +1 -0
- package/dist/c-7DVPSB5C.min.js +1 -0
- package/dist/c-7EGHJU2F.min.js +1 -0
- package/dist/c-A7OGOFSL.min.js +1 -0
- package/dist/c-AFBSWT77.min.js +1 -0
- package/dist/c-AH5HWZWS.min.js +1 -0
- package/dist/c-AJ7EC32V.min.js +1 -0
- package/dist/c-AQADQNY7.min.js +1 -0
- package/dist/c-ATM475SA.min.js +1 -0
- package/dist/c-AVO3Q7T7.min.js +1 -0
- package/dist/c-B7GW7IHJ.min.js +1 -0
- package/dist/c-BNFJMDHN.min.js +1 -0
- package/dist/c-BOHCQILI.min.js +1 -0
- package/dist/c-C3TZLTZK.min.js +1 -0
- package/dist/c-CGQAQWBV.min.js +1 -0
- package/dist/c-CPV4N35K.min.js +1 -0
- package/dist/c-D6HAAPTX.min.js +1 -0
- package/dist/c-DIPEYUOW.min.js +1 -0
- package/dist/c-E4JDJH4I.min.js +1 -0
- package/dist/c-E72OTUZU.min.js +1 -0
- package/dist/c-E7I2L7CU.min.js +1 -0
- package/dist/c-ELDWAO2V.min.js +1 -0
- package/dist/c-EUBTECGM.min.js +1 -0
- package/dist/c-EUMPMDCS.min.js +1 -0
- package/dist/c-EZZT2WAE.min.js +1 -0
- package/dist/c-FHBVFCQB.min.js +1 -0
- package/dist/c-G4HCO2IQ.min.js +1 -0
- package/dist/c-G5VIJEOK.min.js +1 -0
- package/dist/c-GHVOXAYH.min.js +1 -0
- package/dist/c-GNTXRXRN.min.js +1 -0
- package/dist/c-GXV3C3MO.min.js +1 -0
- package/dist/c-HHTK2R75.min.js +1 -0
- package/dist/c-HLLFJYTY.min.js +1 -0
- package/dist/c-HP4ZFM47.min.js +1 -0
- package/dist/c-HPOYKCCG.min.js +1 -0
- package/dist/c-HYDTS5OP.min.js +1 -0
- package/dist/c-I4QJ6YLM.min.js +1 -0
- package/dist/c-IK33LNZ6.min.js +1 -0
- package/dist/c-IK3PZHRY.min.js +1 -0
- package/dist/c-J6DVC236.min.js +1 -0
- package/dist/c-JIMJF6F6.min.js +1 -0
- package/dist/c-JUKIWTBJ.min.js +1 -0
- package/dist/c-KKPMHAZC.min.js +1 -0
- package/dist/c-L6WNDBHV.min.js +1 -0
- package/dist/c-LDEX5OFW.min.js +1 -0
- package/dist/c-LESEUVC5.min.js +1 -0
- package/dist/c-LYQMZMZQ.min.js +1 -0
- package/dist/c-MB6CV5NC.min.js +1 -0
- package/dist/c-MOKJOIPE.min.js +1 -0
- package/dist/c-MVR3RWF3.min.js +1 -0
- package/dist/c-N3FXLRNT.min.js +1 -0
- package/dist/c-N5NPTJVJ.min.js +1 -0
- package/dist/c-NHBL4J67.min.js +1 -0
- package/dist/c-ODG6TFSY.min.js +1 -0
- package/dist/c-ORLEBW72.min.js +1 -0
- package/dist/c-P65V6HLO.min.js +1 -0
- package/dist/c-PRIKOLTE.min.js +1 -0
- package/dist/c-PSKKFZNP.min.js +1 -0
- package/dist/c-PSNI6KAZ.min.js +1 -0
- package/dist/c-QA3HMQJP.min.js +1 -0
- package/dist/c-R2P4RR7Q.min.js +1 -0
- package/dist/c-RFC7UAG7.min.js +1 -0
- package/dist/c-S3AZX5PP.min.js +1 -0
- package/dist/c-SGAURYHG.min.js +1 -0
- package/dist/c-SJMWU6UX.min.js +1 -0
- package/dist/c-STIIGQOD.min.js +1 -0
- package/dist/c-T2ASIJVZ.min.js +1 -0
- package/dist/c-T2V7O2LO.min.js +1 -0
- package/dist/c-TKG2NP7G.min.js +1 -0
- package/dist/c-TX3THUTO.min.js +1 -0
- package/dist/c-TX7XJM3Z.min.js +1 -0
- package/dist/c-UC7SIU2W.min.js +1 -0
- package/dist/c-UMXSJIOV.min.js +1 -0
- package/dist/c-VJTDST2R.min.js +1 -0
- package/dist/c-VRSXMLYF.min.js +1 -0
- package/dist/c-VSLWSAN2.min.js +1 -0
- package/dist/c-VXLOLYTO.min.js +1 -0
- package/dist/c-W4ZUKSEQ.min.js +1 -0
- package/dist/c-WCBRPILW.min.js +1 -0
- package/dist/c-WGHT7OCY.min.js +1 -0
- package/dist/c-WUWXGQYA.min.js +1 -0
- package/dist/c-WWCW3APR.min.js +1 -0
- package/dist/{c-CKLIFCGN.min.js → c-XSB27XPS.min.js} +1 -1
- package/dist/c-Y6PYUMFU.min.js +1 -0
- package/dist/c-YDECTEUW.min.js +1 -0
- package/dist/c-YF3YKVQI.min.js +1 -0
- package/dist/c-YLZIV3VS.min.js +1 -0
- package/dist/c-ZIVPFTOC.min.js +1 -0
- package/dist/components/Annotation.d.ts +2 -1
- package/dist/components/ai/chartRecipeRegistry.d.ts +6 -1
- package/dist/components/ai/chartRecipes.d.ts +4 -0
- package/dist/components/ai/describePhysicsProjection.d.ts +18 -0
- package/dist/components/ai/describePhysicsSource.d.ts +13 -0
- package/dist/components/artifact/ArtifactInspector.d.ts +26 -0
- package/dist/components/artifact/ArtifactInspectorContextSections.d.ts +18 -0
- package/dist/components/artifact/artifactContractDiff.d.ts +8 -0
- package/dist/components/artifact/artifactInspectorSummary.d.ts +53 -0
- package/dist/components/artifact/artifactRevision.d.ts +54 -0
- package/dist/components/artifact/artifactTestFixtures.d.ts +17 -0
- package/dist/components/artifact/attachmentAudit.d.ts +13 -0
- package/dist/components/artifact/claimCorrections.d.ts +3 -0
- package/dist/components/artifact/claimGraph.d.ts +5 -0
- package/dist/components/artifact/claimLifecycle.d.ts +32 -0
- package/dist/components/artifact/claims.d.ts +24 -0
- package/dist/components/artifact/collection.d.ts +10 -0
- package/dist/components/artifact/collectionCorrectionScope.d.ts +4 -0
- package/dist/components/artifact/collectionImpact.d.ts +11 -0
- package/dist/components/artifact/collectionLineage.d.ts +3 -0
- package/dist/components/artifact/collectionOperations.d.ts +8 -0
- package/dist/components/artifact/collectionPolicy.d.ts +22 -0
- package/dist/components/artifact/collectionTypes.d.ts +117 -0
- package/dist/components/artifact/configurationRepair.d.ts +8 -0
- package/dist/components/artifact/contract.d.ts +30 -0
- package/dist/components/artifact/evaluateArtifact.d.ts +12 -0
- package/dist/components/artifact/evaluateArtifactTypes.d.ts +78 -0
- package/dist/components/artifact/evaluationPresentation.d.ts +9 -0
- package/dist/components/artifact/evidenceSample.d.ts +8 -0
- package/dist/components/artifact/exportPaths.d.ts +8 -0
- package/dist/components/artifact/fieldPolicies.d.ts +12 -0
- package/dist/components/artifact/fingerprint.d.ts +36 -0
- package/dist/components/artifact/grounding.d.ts +51 -0
- package/dist/components/artifact/groundingBudget.d.ts +38 -0
- package/dist/components/artifact/hostTransfer.d.ts +13 -0
- package/dist/components/artifact/identity.d.ts +19 -0
- package/dist/components/artifact/inheritance.d.ts +48 -0
- package/dist/components/artifact/inheritanceIntegrity.d.ts +3 -0
- package/dist/components/artifact/jsonCompatibility.d.ts +2 -0
- package/dist/components/artifact/obligations.d.ts +3 -0
- package/dist/components/artifact/policies.d.ts +45 -0
- package/dist/components/artifact/policyRelations.d.ts +3 -0
- package/dist/components/artifact/recordProjection.d.ts +7 -0
- package/dist/components/artifact/representation.d.ts +50 -0
- package/dist/components/artifact/serialization.d.ts +40 -0
- package/dist/components/artifact/temporal.d.ts +32 -0
- package/dist/components/artifact/temporalAdapters.d.ts +75 -0
- package/dist/components/artifact/temporalAuditHelpers.d.ts +12 -0
- package/dist/components/artifact/temporalPresentation.d.ts +8 -0
- package/dist/components/artifact/types.d.ts +341 -0
- package/dist/components/artifact/validation.d.ts +13 -0
- package/dist/components/artifact/validationFieldStatus.d.ts +7 -0
- package/dist/components/artifact/validationPrimitives.d.ts +24 -0
- package/dist/components/artifact/validationSurfaces.d.ts +7 -0
- package/dist/components/artifact/validationTemporal.d.ts +3 -0
- package/dist/components/charts/geo/FlowMap.d.ts +7 -0
- package/dist/components/charts/geo/flowMapLineStyle.d.ts +18 -0
- package/dist/components/charts/ordinal/DonutChart.d.ts +2 -0
- package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -0
- package/dist/components/charts/ordinal/PieChart.d.ts +2 -0
- package/dist/components/charts/ordinal/RadarChart.d.ts +2 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -0
- package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
- package/dist/components/charts/physics/EventDropChart.d.ts +3 -1
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +4 -2
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +6 -0
- package/dist/components/charts/physics/UnitPileChart.d.ts +2 -1
- package/dist/components/charts/physics/collisionSwarmPacking.d.ts +14 -0
- package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +1 -0
- package/dist/components/charts/physics/eventDropAdmission.d.ts +32 -0
- package/dist/components/charts/physics/eventDropPhysics.d.ts +22 -1
- package/dist/components/charts/physics/galtonBoardPhysics.d.ts +2 -9
- package/dist/components/charts/physics/physicsChartReconcile.d.ts +4 -0
- package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
- package/dist/components/charts/physics/physicsGaltonData.d.ts +10 -0
- package/dist/components/charts/physics/physicsHocHandle.d.ts +2 -0
- package/dist/components/charts/physics/physicsPileData.d.ts +11 -0
- package/dist/components/charts/physics/physicsPilePhysics.d.ts +5 -12
- package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +1 -1
- package/dist/components/charts/physics/physicsSourceRows.d.ts +8 -0
- package/dist/components/charts/physics/usePhysicsChartData.d.ts +19 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +4 -0
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +14 -6
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +4 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +4 -0
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeAccessors.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +8 -7
- package/dist/components/charts/realtime/realtimeChartTypes.d.ts +7 -0
- package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +17 -11
- package/dist/components/charts/shared/GaugeReadout.d.ts +9 -0
- package/dist/components/charts/shared/ThresholdAnnotation.d.ts +18 -0
- package/dist/components/charts/shared/ThresholdEndCap.d.ts +7 -0
- package/dist/components/charts/shared/auditAccessibilityText.d.ts +4 -2
- package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
- package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
- package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
- package/dist/components/charts/shared/hooks.d.ts +3 -1
- package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
- package/dist/components/charts/shared/numericTickFormatter.d.ts +2 -0
- package/dist/components/charts/shared/radialCenterContent.d.ts +10 -0
- package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
- package/dist/components/charts/shared/useChartLegend.d.ts +4 -0
- package/dist/components/charts/shared/useXYPointStyle.d.ts +2 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +7 -0
- package/dist/components/charts/xy/CandlestickChart.d.ts +7 -0
- package/dist/components/charts/xy/DifferenceChart.d.ts +7 -0
- package/dist/components/charts/xy/MinimapChart.d.ts +7 -0
- package/dist/components/charts/xy/MultiAxisLineChart.d.ts +7 -0
- package/dist/components/charts/xy/ScatterplotMatrix.d.ts +6 -0
- package/dist/components/charts/xy/WaterfallChart.d.ts +8 -0
- package/dist/components/charts/xy/differenceMarkStyle.d.ts +28 -0
- package/dist/components/charts/xy/multiAxisFields.d.ts +23 -0
- package/dist/components/charts/xy/scatterplotMatrixCells.d.ts +50 -0
- package/dist/components/evidence/chartEvidenceEnvelope.d.ts +16 -8
- package/dist/components/evidence/evidenceEnvelopeInput.d.ts +8 -0
- package/dist/components/evidence/evidenceEnvelopeValidation.d.ts +11 -0
- package/dist/components/evidence/evidenceGate.d.ts +3 -1
- package/dist/components/evidence/renderedSceneHash.d.ts +23 -0
- package/dist/components/evidence/stableJsonHash.d.ts +4 -0
- package/dist/components/export/chartConfig.d.ts +40 -5
- package/dist/components/export/chartConfigArtifact.d.ts +6 -0
- package/dist/components/legendLayout.d.ts +18 -0
- package/dist/components/legendStyles.d.ts +4 -0
- package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
- package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
- package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
- package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
- package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
- package/dist/components/recipes/atlas/braid.d.ts +62 -0
- package/dist/components/recipes/atlas/capsules.d.ts +18 -0
- package/dist/components/recipes/atlas/compare.d.ts +4 -0
- package/dist/components/recipes/atlas/completeness.d.ts +2 -0
- package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
- package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
- package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
- package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
- package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
- package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
- package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
- package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
- package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
- package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
- package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
- package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
- package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
- package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
- package/dist/components/recipes/atlas/forests.d.ts +11 -0
- package/dist/components/recipes/atlas/ids.d.ts +6 -0
- package/dist/components/recipes/atlas/index.d.ts +26 -0
- package/dist/components/recipes/atlas/ledger.d.ts +7 -0
- package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
- package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
- package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
- package/dist/components/recipes/atlas/motifs.d.ts +3 -0
- package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
- package/dist/components/recipes/atlas/prepare.d.ts +14 -0
- package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
- package/dist/components/recipes/atlas/profile.d.ts +19 -0
- package/dist/components/recipes/atlas/publish.d.ts +10 -0
- package/dist/components/recipes/atlas/queries.d.ts +34 -0
- package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
- package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
- package/dist/components/recipes/atlas/sections.d.ts +3 -0
- package/dist/components/recipes/atlas/support.d.ts +7 -0
- package/dist/components/recipes/atlas/types.d.ts +278 -0
- package/dist/components/recipes/atlas/validate.d.ts +12 -0
- package/dist/components/recipes/firstAvailableTrack.d.ts +17 -0
- package/dist/components/recipes/intervals.d.ts +1 -1
- package/dist/components/semiotic-ai-core.d.ts +33 -22
- package/dist/components/semiotic-ai.d.ts +15 -3
- package/dist/components/semiotic-artifact-react.d.ts +10 -0
- package/dist/components/semiotic-artifact.d.ts +23 -0
- package/dist/components/semiotic-atlas-core.d.ts +20 -0
- package/dist/components/semiotic-atlas.d.ts +8 -0
- package/dist/components/semiotic-experimental.d.ts +1 -1
- package/dist/components/semiotic-physics.d.ts +4 -4
- package/dist/components/semiotic-recipes-core.d.ts +9 -0
- package/dist/components/semiotic-text.d.ts +2 -0
- package/dist/components/semiotic-utils-core.d.ts +18 -18
- package/dist/components/semiotic.d.ts +3 -3
- package/dist/components/server/renderEvidence.d.ts +12 -0
- package/dist/components/server/renderToStaticSVG.d.ts +3 -0
- package/dist/components/server/serverChartConfigs.d.ts +3 -0
- package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
- package/dist/components/server/staticSVGChrome.d.ts +1 -4
- package/dist/components/server/staticXYAxisTicks.d.ts +2 -38
- package/dist/components/server/staticXYGrid.d.ts +1 -1
- package/dist/components/server/svgSizing.d.ts +6 -0
- package/dist/components/shared/svgRoot.d.ts +17 -0
- package/dist/components/store/selectionProvenance.d.ts +6 -0
- package/dist/components/stream/GeoSVGOverlay.d.ts +4 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
- package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -0
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -0
- package/dist/components/stream/SVGOverlay.d.ts +4 -0
- package/dist/components/stream/SceneToSVG.d.ts +4 -19
- package/dist/components/stream/SceneToSVGXY.d.ts +13 -0
- package/dist/components/stream/StreamGeoFrame.d.ts +1 -2
- package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -2
- package/dist/components/stream/XYGrid.d.ts +11 -0
- package/dist/components/stream/axisTickUtils.d.ts +0 -1
- package/dist/components/stream/canvasSetup.d.ts +1 -2
- package/dist/components/stream/fontLoading.d.ts +4 -0
- package/dist/components/stream/hitTestUtils.d.ts +2 -0
- package/dist/components/stream/networkCustomLayout.d.ts +8 -0
- package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
- package/dist/components/stream/overlayAccessibleText.d.ts +18 -0
- package/dist/components/stream/physics/PhysicsControllers.d.ts +1 -1
- package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +5 -4
- package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +9 -0
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +3 -0
- package/dist/components/stream/physics/physicsCanvasCoordinates.d.ts +5 -0
- package/dist/components/stream/physics/physicsFixedPosition.d.ts +16 -0
- package/dist/components/stream/physics/physicsKernelCloning.d.ts +6 -0
- package/dist/components/stream/physics/physicsPipelineObservations.d.ts +2 -0
- package/dist/components/stream/physics/physicsPipelineSettle.d.ts +15 -9
- package/dist/components/stream/physics/physicsRegionRuntime.d.ts +8 -17
- package/dist/components/stream/physics/physicsSemanticUI.d.ts +11 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
- package/dist/components/stream/pipelineConfig.d.ts +4 -0
- package/dist/components/stream/pipelineStoreUpdateResults.d.ts +1 -1
- package/dist/components/stream/resolveXYAxes.d.ts +13 -0
- package/dist/components/stream/sceneToSVGShared.d.ts +2 -1
- package/dist/components/stream/seriesGeometry.d.ts +13 -0
- package/dist/components/stream/shallowEqual.d.ts +2 -0
- package/dist/components/stream/streamEncodingTypes.d.ts +53 -0
- package/dist/components/stream/types.d.ts +4 -53
- package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
- package/dist/components/stream/useGeoFrameHandle.d.ts +16 -0
- package/dist/components/stream/useOrdinalFrameHandle.d.ts +15 -0
- package/dist/components/stream/useXYFrameHandle.d.ts +15 -0
- package/dist/components/stream/xyAxisTicks.d.ts +25 -0
- package/dist/components/stream/xyDateTicks.d.ts +3 -2
- package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
- package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +1 -1
- package/dist/components/stream/xySceneBuilders/types.d.ts +1 -0
- package/dist/components/text/annotationTextLayout.d.ts +28 -0
- package/dist/components/text/pretextAnnotationLayout.d.ts +29 -0
- package/dist/components/text/usePretextAnnotations.d.ts +12 -0
- package/dist/controls.module.min.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.min.js +1 -1
- package/dist/physics-rapier.module.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/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-access.module.min.js +1 -1
- package/dist/semiotic-ai-artifact-policy-constants.module.min.js +2 -0
- package/dist/semiotic-ai-core.d.ts +33 -22
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai-hash-primitives.module.min.js +2 -0
- package/dist/semiotic-ai.d.ts +15 -3
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-artifact-react.d.ts +10 -0
- package/dist/semiotic-artifact-react.min.js +2 -0
- package/dist/semiotic-artifact-react.module.min.js +2 -0
- package/dist/semiotic-artifact.d.ts +23 -0
- package/dist/semiotic-artifact.min.js +1 -0
- package/dist/semiotic-artifact.module.min.js +1 -0
- package/dist/semiotic-atlas-core.d.ts +20 -0
- package/dist/semiotic-atlas-core.min.js +1 -0
- package/dist/semiotic-atlas-core.module.min.js +1 -0
- package/dist/semiotic-atlas-selection.module.min.js +2 -0
- package/dist/semiotic-atlas.d.ts +8 -0
- package/dist/semiotic-atlas.min.js +2 -0
- package/dist/semiotic-atlas.module.min.js +2 -0
- package/dist/semiotic-client-cjs-shared.min.js +1 -1
- package/dist/semiotic-client-glyph.module.min.js +1 -1
- package/dist/semiotic-client-responsive.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +1 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-evidence.min.js +1 -1
- package/dist/semiotic-evidence.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-experimental.d.ts +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-physics.d.ts +4 -4
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +9 -0
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -1
- 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-text.d.ts +2 -0
- package/dist/semiotic-text.min.js +2 -0
- package/dist/semiotic-text.module.min.js +2 -0
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +18 -18
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.d.ts +3 -3
- 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.module.min.js +1 -1
- package/package.json +70 -14
- package/spec/README.md +8 -3
- package/spec/v0.1/artifact-contract.schema.json +2299 -0
- package/spec/v0.1/examples/artifact-contract-full.json +369 -0
- package/spec/v0.1/examples/artifact-contract-unknown-state.json +46 -0
- package/dist/c-3BLJEQNG.min.js +0 -1
- package/dist/c-3SCUN5HI.min.js +0 -1
- package/dist/c-3VVKFA4M.min.js +0 -1
- package/dist/c-43TJZS3F.min.js +0 -1
- package/dist/c-4DTZPSUD.min.js +0 -1
- package/dist/c-4ES5367Y.min.js +0 -1
- package/dist/c-52TEGIUJ.min.js +0 -1
- package/dist/c-54IRWOGM.min.js +0 -1
- package/dist/c-5D2S4RMI.min.js +0 -1
- package/dist/c-5JWCTX3G.min.js +0 -1
- package/dist/c-6CMMSN6N.min.js +0 -1
- package/dist/c-6HRB2L7H.min.js +0 -1
- package/dist/c-6O5EVOPH.min.js +0 -1
- package/dist/c-7W4SV36A.min.js +0 -1
- package/dist/c-A4WRGZFX.min.js +0 -1
- package/dist/c-AG7WWVIH.min.js +0 -1
- package/dist/c-AH6J4MTN.min.js +0 -1
- package/dist/c-AKAF6JAD.min.js +0 -1
- package/dist/c-ALYR5LKK.min.js +0 -1
- package/dist/c-BBKITSXB.min.js +0 -1
- package/dist/c-BYDPC44I.min.js +0 -1
- package/dist/c-CFFIU2MW.min.js +0 -1
- package/dist/c-CGNHBHCE.min.js +0 -1
- package/dist/c-CJYSXIFV.min.js +0 -1
- package/dist/c-CZF7MV67.min.js +0 -1
- package/dist/c-D53OKBSY.min.js +0 -1
- package/dist/c-DADXPJXV.min.js +0 -1
- package/dist/c-DBQ2V7CH.min.js +0 -1
- package/dist/c-DPMVAUAW.min.js +0 -1
- package/dist/c-ECJCKLYY.min.js +0 -1
- package/dist/c-EGATGOWJ.min.js +0 -1
- package/dist/c-EGR6VYBW.min.js +0 -1
- package/dist/c-ESNR43AN.min.js +0 -1
- package/dist/c-F3LIKINL.min.js +0 -1
- package/dist/c-F5ZB5GJ6.min.js +0 -1
- package/dist/c-G36WS6LN.min.js +0 -1
- package/dist/c-G3VYMHKE.min.js +0 -1
- package/dist/c-GGISSW5E.min.js +0 -1
- package/dist/c-GR6MOEQC.min.js +0 -1
- package/dist/c-GSVCN34B.min.js +0 -1
- package/dist/c-GYOQCEFP.min.js +0 -1
- package/dist/c-H3DNMTCC.min.js +0 -1
- package/dist/c-I6J3FEZE.min.js +0 -1
- package/dist/c-IGH6MGJ5.min.js +0 -1
- package/dist/c-II2EEAJN.min.js +0 -1
- package/dist/c-IUHFPMHD.min.js +0 -1
- package/dist/c-J6M4JHRS.min.js +0 -1
- package/dist/c-JM3MGLQV.min.js +0 -1
- package/dist/c-KM3N7F7R.min.js +0 -1
- package/dist/c-LF5BZFNC.min.js +0 -1
- package/dist/c-LKBSGFQC.min.js +0 -1
- package/dist/c-MNF2S4AA.min.js +0 -1
- package/dist/c-MT3WBK7M.min.js +0 -1
- package/dist/c-NDJADPIF.min.js +0 -1
- package/dist/c-NVPQCIL5.min.js +0 -1
- package/dist/c-NY3JWV2K.min.js +0 -1
- package/dist/c-OFWJBEE5.min.js +0 -1
- package/dist/c-OYFHP5F5.min.js +0 -1
- package/dist/c-PGKQGGQ2.min.js +0 -1
- package/dist/c-PPWDL5ZI.min.js +0 -1
- package/dist/c-Q2IPZ3MU.min.js +0 -1
- package/dist/c-QKHMBE2E.min.js +0 -1
- package/dist/c-QMVM3AY6.min.js +0 -1
- package/dist/c-QSGWX53A.min.js +0 -1
- package/dist/c-RJKEKZOO.min.js +0 -1
- package/dist/c-RSVIHIQ4.min.js +0 -1
- package/dist/c-S6U5CGT5.min.js +0 -1
- package/dist/c-SFDIIU5G.min.js +0 -1
- package/dist/c-SLGMUBUL.min.js +0 -1
- package/dist/c-SRTBCRVE.min.js +0 -1
- package/dist/c-T6UAIKBH.min.js +0 -1
- package/dist/c-TMCTEVVW.min.js +0 -1
- package/dist/c-TMOSJLT3.min.js +0 -1
- package/dist/c-TZW3JGJ5.min.js +0 -1
- package/dist/c-U6ESPM7V.min.js +0 -1
- package/dist/c-UC5PTTFI.min.js +0 -1
- package/dist/c-USFMFKIH.min.js +0 -1
- package/dist/c-VGKUEZBC.min.js +0 -1
- package/dist/c-VGW3VG3I.min.js +0 -1
- package/dist/c-VN2HG5BS.min.js +0 -1
- package/dist/c-VPZDY5Q4.min.js +0 -1
- package/dist/c-VRXUB2F2.min.js +0 -1
- package/dist/c-VUBQNQJH.min.js +0 -1
- package/dist/c-VUH4PGZY.min.js +0 -1
- package/dist/c-W3CE4A4S.min.js +0 -1
- package/dist/c-X5UBGU2V.min.js +0 -1
- package/dist/c-XDRV7RKW.min.js +0 -1
- package/dist/c-YGZHURXZ.min.js +0 -1
- package/dist/c-YZVRZGX2.min.js +0 -1
- /package/dist/{c-N4G2L7ID.min.js → c-HYW2XA4Q.min.js} +0 -0
- /package/dist/{c-ENF72HU5.min.js → c-QAVFOEUY.min.js} +0 -0
- /package/dist/{c-OCI56QF2.min.js → c-V4XMSLC3.min.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e({content:e,centerX:t,centerY:o,width:i,height:r}){let a=function(e,t,o){if(!ui.isValidElement(e)||!gi.has(e.type))return null;let i=e,r="text"===i.type?ui.cloneElement(i,{x:i.props.x??0,y:i.props.y??0,textAnchor:i.props.textAnchor??"middle",dominantBaseline:i.props.dominantBaseline??"middle"}):i;return mi("g",{className:"semiotic-radial-center-content",transform:`translate(${t},${o})`,pointerEvents:"none",children:r})}(e,t,o);return a?mi("svg",{width:i,height:r,style:{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},children:a}):mi("div",{style:{position:"absolute",left:t,top:o,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:e})}function t(e,t,o){let{scales:i,config:r,getConnector:a,getO:n}=e;if(!a||!i)return[];let l=[],{projection:s}=i,c=new Map;for(let e of t){if("point"!==e.type&&"rect"!==e.type)continue;let t=e.datum;if(!t)continue;let o,i,r=a(t);r&&("point"===e.type?(o=e.x,i=e.y):(o=e.x+e.w/2,i=e.y+("vertical"===s?0:e.h/2)),c.has(r)||c.set(r,[]),c.get(r).push({x:o,y:i,datum:t,category:n(t)}))}let h=new Map(i.o.domain().map((e,t)=>[e,t])),d=r.connectorStyle,u={stroke:e.config.themeSemantic?.border||e.config.themeSemantic?.secondary||"#999",strokeWidth:1,opacity:.5},m=(e,t,o)=>{var i;l.push({type:"connector",x1:e.x,y1:e.y,x2:t.x,y2:t.y,style:(i=e.datum,"function"==typeof d?d(i):d||u),datum:e.datum,group:o})};for(let[e,t]of c)if(t.length>=2){t.sort((e,t)=>(h.get(e.category)??-1)-(h.get(t.category)??-1));for(let o=0;t.length-1>o;o++)m(t[o],t[o+1],e);"radial"===s&&t.length>=3&&m(t[t.length-1],t[0],e)}return l}function o(e,t,o){let i="function"==typeof e?e(o?t.w:t.h):e;return"number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0}function i(e){let t=e.getSymbol;return t?ni(t,e.config.symbolMap):null}function r(e,t,o,i,r,a,n){e.push(t?{type:"symbol",x:i,y:r,size:Math.PI*a*a,symbolType:t(o),style:n,datum:o}:{type:"point",x:i,y:r,r:a,style:n,datum:o})}function a(e,t){let{columns:o,config:i,resolvePieceStyle:r}=e,a=[],n=Math.min(t.width,t.height)/2-4,l="donut"===i.chartType?i.innerRadius||60:0,s=-Math.PI/2+(i.startAngle||0)*Math.PI/180,c=null!=i.sweepAngle?i.sweepAngle*Math.PI/180:2*Math.PI,h=null!=i.sweepAngle&&360>i.sweepAngle,d=Object.values(o),u=d.some(e=>{let t=e.pieceData[0];return t&&("number"==typeof t._pct||"number"==typeof t._pctStart||null!=t._roundedEnds)}),m=h&&!u&&d.length>1&&(i.cornerRadius??0)>0;for(let e=0;d.length>e;e++){let t=d[e],o=t.pieceData[0],h="number"==typeof o?._pctStart?o._pctStart:t.pctStart,u=s+h*c,g=s+(h+("number"==typeof o?._pct?o._pct:t.pct))*c,p=r(t.pieceData[0],t.name),f=0===e,y=e===d.length-1,v={type:"wedge",cx:0,cy:0,innerRadius:l,outerRadius:n,startAngle:u,endAngle:g,...i.cornerRadius&&{cornerRadius:i.cornerRadius},style:p,datum:o?._nonInteractive?null:t.pieceData,category:t.name};o?._roundedEnds?v.roundedEnds=o._roundedEnds:m&&(v.roundedEnds={start:f,end:y}),o?._gradientBand&&(v._gradientBand=o._gradientBand),a.push(v)}return a}function n(e,t,o){return{...e[0],...o,category:t,data:e}}function l(e){let t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:Ri(e,.25)??o,median:Ri(e,.5)??(o+i)/2,q3:Ri(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}function s(e,t,o,i,r){let a=Array(r).fill(0);for(let n of e)t>n||n>o||a[Math.min(Math.floor((n-t)/i),r-1)]++;return a}function c(e,t,o){let i=rt(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function h(e,t,o,i=30){let r=t-e.x,a=o-e.y,n=Math.sqrt(r*r+a*a);return n>it(e.r,i)?null:{datum:e.datum,x:e.x,y:e.y,distance:n}}function d(e,t,o,i=30){let r=t-e.x,a=o-e.y,n=Math.sqrt(r*r+a*a);return n>it(di(e.size),i)?null:{datum:e.datum,x:e.x,y:e.y,distance:n}}function u(e,t,o,i=30){if(null==e.datum)return null;let r=oi(e.glyph,e.size),a=e.x+r.centerDx,n=e.y+r.centerDy,l=t-a,s=o-n,c=Math.sqrt(l*l+s*s);return c>it(r.radius,i)?null:{datum:e.datum,x:a,y:n,distance:c}}function m(e,t,o){let i=t-e.cx,r=o-e.cy,a=Math.sqrt(i*i+r*r);if(e.innerRadius>a||a>e.outerRadius)return null;let n=nt(Math.atan2(r,i)),l=nt(e.startAngle),s=nt(e.endAngle);if(!(l>s?n>=l||s>=n:n>=l&&s>=n))return null;let c=(e.startAngle+e.endAngle)/2,h=(e.innerRadius+e.outerRadius)/2;return{datum:e.datum,x:e.cx+Math.cos(c)*h,y:e.cy+Math.sin(c)*h,distance:0,category:e.category}}function g(e,t,o){let i=e.columnWidth/2;if("vertical"===e.projection){if(!(e.x-i>t||t>e.x+i||Math.min(e.minPos,e.maxPos)>o||o>Math.max(e.minPos,e.maxPos)))return{datum:e.datum,x:e.x,y:e.medianPos,distance:0,category:e.category,stats:e.stats}}else{let r=e.y-i,a=e.y+i;if(!(Math.min(e.minPos,e.maxPos)>t||t>Math.max(e.minPos,e.maxPos)||r>o||o>a))return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function p(e,t,o){if(!e.bounds)return null;let{x:i,y:r,width:a,height:n}=e.bounds;return i>t||t>i+a||r>o||o>r+n?null:{datum:e.datum,x:i+a/2,y:r+n/2,distance:0,category:e.category,stats:e.stats}}function f(e,t,o,i){let r=e.style.strokeWidth??1;if(0>=r||"none"===e.style.stroke)return null;let a=b(t,o,e.x1,e.y1,e.x2,e.y2);return!a||a.distance>Math.max(i,r/2)?null:{datum:e.datum,x:a.x,y:a.y,distance:a.distance,category:e.group}}function y(e,t,o){if(3>e.points.length)return null;let i=x(e.points,t,o),r=w(e.points,t,o),a=e.style.strokeWidth??1;if(!(r||e.style.stroke&&"none"!==e.style.stroke&&a>0&&a/2>=i))return null;let n=v(e.points);return{datum:e.datum,x:n.x,y:n.y,distance:r?0:i,category:e.category}}function v(e){let t=e.reduce((e,t)=>({x:e.x+t[0],y:e.y+t[1]}),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function b(e,t,o,i,r,a){let n=r-o,l=a-i,s=n*n+l*l;if(0===s)return null;let c=Math.max(0,Math.min(1,((e-o)*n+(t-i)*l)/s)),h=o+c*n,d=i+c*l;return{x:h,y:d,distance:Math.hypot(e-h,t-d)}}function x(e,t,o){let i=1/0;for(let r=0;e.length>r;r++){let a=e[r],n=e[(r+1)%e.length],l=b(t,o,a[0],a[1],n[0],n[1]);l&&i>l.distance&&(i=l.distance)}return i}function w(e,t,o){if(x(e,t,o)<=16*Number.EPSILON)return!0;let i=!1;for(let r=0,a=e.length-1;e.length>r;a=r++){let[n,l]=e[r],[s,c]=e[a];l>o!=c>o&&(s-n)*(o-l)/(c-l)+n>t&&(i=!i)}return i}function k(e){let t=e.pointer.clientX-e.canvasRect.left-e.margin.left,o=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>o||o>e.height)return{kind:"outside"};if(0===e.scene.length)return{kind:"miss"};let i="radial"===e.projection,r=function(e,t,o,i=30,r,a=0){let n=null,l=null;if(r){let e=ot(r,t,o,i,a);e&&!1!==e.node.interactive&&(n={node:e.node,datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(let a of e){let e=null;switch(a.type){case"rect":if(null==a.datum)break;e=c(a,t,o);break;case"point":if(!1===a.interactive||r)break;e=h(a,t,o,i);break;case"symbol":e=d(a,t,o,i);break;case"glyph":e=u(a,t,o,i);break;case"wedge":if(null===a.datum)break;e=m(a,t,o);break;case"boxplot":e=g(a,t,o);break;case"violin":e=p(a,t,o);break;case"connector":e=f(a,t,o,i);break;case"trapezoid":e=y(a,t,o)}e&&(e.node=a,"connector"===a.type?(!l||l.distance>e.distance)&&(l=e):(!n||n.distance>e.distance)&&(n=e))}return n??l??function(e,t,o){let i=new Map;for(let t of e){if("connector"!==t.type)continue;let e=t.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}for(let e of i.values()){let i=e[0];if(2>e.length||!i.style.fill||"none"===i.style.fill)continue;let r=[[i.x1,i.y1],...e.map(e=>[e.x2,e.y2])];if(!w(r,t,o))continue;let a=v(r);return{node:i,datum:i.datum,x:a.x,y:a.y,distance:0,category:i.group}}return null}(e,t,o)}(e.scene,i?t-e.width/2:t,i?o-e.height/2:o,e.hoverRadius,e.pointQuadtree,e.maxPointRadius);return r?{kind:"hit",hit:r}:{kind:"miss"}}function A(e,t){return Nt(e.datum||{},e.x,e.y,{...e.stats&&{stats:e.stats},...e.category&&{category:e.category},__oAccessor:"string"==typeof t.oAccessor?t.oAccessor:void 0,__rAccessor:"string"==typeof t.rAccessor?t.rAccessor:void 0,__chartType:t.chartType})}function S(e){let{width:t,height:o,totalWidth:i,totalHeight:r,margin:a,scales:n,showAxes:l,showGrid:s}=e,{rTickValues:c,axisExtent:h}=e,d="radial"===n?.projection,u="horizontal"===n?.projection,m=Vi(()=>n&&!d&&s?(c||Ae(n.r,5,h)).map(e=>({value:e,pixel:n.r(e)})):[],[n,d,c,h,s]),g=s&&n&&!d,p=l&&n&&!d;return g||p?Yi("svg",{width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:Qi("g",{transform:`translate(${a.left},${a.top})`,children:[g&&Yi("g",{className:"ordinal-grid",children:m.map((e,i)=>Yi("line",{x1:u?e.pixel:0,y1:u?0:e.pixel,x2:u?e.pixel:t,y2:u?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),p&&Yi(Xi,{children:Qi(Xi,u?{children:[Yi("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yi("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[Yi("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yi("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function R(e){let{width:t,height:o,totalWidth:i,totalHeight:r,margin:a,scales:n,showAxes:l,showCategoryTicks:s,oLabel:c,rLabel:h,oFormat:d,rFormat:u,showGrid:m,title:g,description:p,idPrefix:f,legend:y,legendHoverBehavior:v,legendClickBehavior:b,legendHighlightedCategory:x,legendIsolatedCategories:w,legendPosition:k="right",legendLayout:A,foregroundGraphics:S,annotations:R,onAnnotationActivate:P,onObservation:C,chartId:_,chartType:L,autoPlaceAnnotations:M,svgAnnotationRules:I,xAccessor:T,yAccessor:H,annotationData:B,underlayRendered:F,canvasObscuresUnderlay:$=!0,children:O}=e,W=So({onAnnotationActivate:P,onObservation:C,chartId:_,chartType:L}),D="radial"===n?.projection,N="horizontal"===n?.projection,E=!1!==s,j=!F||$,z=po({showAxes:l,projection:D?"radial":N?"horizontal":"vertical",hasCategoryLabel:!!c,hasValueLabel:!!h}),V=go(A,z.leftAxis),G=y&&"left"===k&&V>0?V:a.left,q=Vi(()=>{if(!l||!E||!n||D)return[];let e=n.o.bandwidth(),t=n.o.domain().map((t,o)=>({value:t,pixel:(n.o(t)??0)+e/2,label:d?d(t,o):t}));if(2>=t.length)return t;let o=Math.abs(t[1].pixel-t[0].pixel)||e,i=t.map(e=>{return t=e.label,N?"string"==typeof t||"number"==typeof t?16:24:"string"==typeof t||"number"==typeof t?6.5*(t+"").length:60;var t}),r=N?0:6;if(i.every((e,t)=>0===t||o>=(i[t-1]+e)/2+r))return t;let a=Math.max(...i)+r,s=Math.max(1,Math.ceil(a/o));return 1===s?t:t.filter((e,t)=>t%s===0)},[l,E,n,d,D,N]),X=e.rTickValues,Y=e.tickLabelEdgeAlign,Q=e.axisExtent,K=Vi(()=>{if(!l&&!m||!n||D)return[];let e=X||Ae(n.r,5,Q),t=u||ro(e);return e.map(e=>({value:e,pixel:n.r(e),label:t(e)}))},[l,m,n,u,D,X,Q]),Z=Gi(new Map),U=Gi(R?.length??0),J=R?.length??0;U.current!==J&&(U.current=J,Z.current=new Map);let ee=Vi(()=>{if(!R||0===R.length)return null;let e=tt(R),i=qt("ordinal",W),r="horizontal"===n?.projection,a=n?.o?e=>(n.o(e)??0)+n.o.bandwidth()/2:null,l={scales:n?{x:r?n.r:a||n.r,y:r&&a||n.r,time:n.r,value:n.r,o:n.o}:null,timeAxis:"x",xAccessor:T,yAccessor:H,width:t,height:o,data:B,frameType:"ordinal",projection:r?"horizontal":"vertical",stickyPositionCache:Z.current},s=M?Dt({annotations:e,context:l,..."object"==typeof M?M:{}}):e;return so(s,i,I,l)},[R,M,I,t,o,n,T,H,B,W]),te=l||g||p||y||S||ee&&ee.length>0||m||O,oe=qi(),{titleId:ie,descId:re,labelledBy:ae}=st(f||_||oe);return te?Qi("svg",{role:"img","aria-labelledby":ae,width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[Yi("title",{id:ie,children:ct(g,"Ordinal Chart")}),Yi("desc",{id:re,children:lt(g,p,{familyPhrase:"ordinal data visualization",fallback:"Ordinal data visualization"})}),Qi("g",{transform:`translate(${a.left},${a.top})`,children:[m&&n&&!D&&j&&Yi("g",{className:"ordinal-grid",children:K.map((e,i)=>Yi("line",{x1:N?e.pixel:0,y1:N?0:e.pixel,x2:N?e.pixel:t,y2:N?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),l&&n&&!D&&(()=>{let e={fontSize:"var(--semiotic-tick-font-size, 12px)"},i={fontSize:"var(--semiotic-axis-label-font-size, 12px)"};return Yi("g",{className:"ordinal-axes",children:Qi(Xi,N?{children:[Qi("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[j&&Yi("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),q.map((t,o)=>Qi("g",{transform:`translate(0,${t.pixel})`,children:[Yi("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Yi("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):Yi("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:Yi("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},"cat-"+o)),c&&Yi("text",{x:15-G,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-G}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),Qi("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[j&&Yi("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),j&&n?.r&&(()=>{let e=n.r(0);return e>1&&t-1>e?Yi("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),K.map((t,i)=>{let r=Y?0===i?"start":i===K.length-1?"end":"middle":"middle";return Qi("g",{transform:`translate(${t.pixel},${o})`,children:[Yi("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yi("text",{y:18,textAnchor:r,fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+i)}),h&&Yi("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]}:{children:[Qi("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[j&&(()=>{let e=n?.r?n.r(0):o,i=0>e||e>o?o:e;return Yi("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),q.map((t,i)=>Qi("g",{transform:`translate(${t.pixel},${o})`,children:[Yi("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Yi("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):Yi("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:Yi("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},"cat-"+i)),c&&Yi("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),Qi("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[j&&Yi("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),K.map((t,o)=>Qi("g",{transform:`translate(0,${t.pixel})`,children:[Yi("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yi("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+o)),h&&Yi("text",{x:15-G,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-G}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]})})})(),ee,S,O]}),Yi(Ht,{title:g,totalWidth:i,marginTop:a.top}),ho({legend:y,totalWidth:i,totalHeight:r,margin:a,legendPosition:k,title:g,legendLayout:A,axisChrome:z,legendHoverBehavior:v,legendClickBehavior:b,legendHighlightedCategory:x,legendIsolatedCategories:w})]}):null}function P(e){let[t,o]=Ki.useState(()=>Ui);return Ki.useEffect(()=>{if(t)return;let e=!1;return(Ui?Promise.resolve(Ui):(Ji||(Ji=import("./c-7242NXSG.min.js").then(e=>Ui=e.OrdinalBrushOverlay).catch(e=>{throw Ji=null,e})),Ji)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?Zi(t,{...e}):null}function C(e){let{innerRadius:t,outerRadius:o,startAngle:i,endAngle:r}=e,a=0>=t;if(0>=(e.cornerRadius??0)||!e.roundStart&&!e.roundEnd){if(a){let e=tr(o,i),t=tr(o,r);return`M0,0 L${e.x},${e.y} A${o},${o} 0 ${r-i>Math.PI?1:0} 1 ${t.x},${t.y} Z`}let e=tr(o,i),n=tr(o,r),l=tr(t,r),s=tr(t,i),c=r-i>Math.PI?1:0;return`M${e.x},${e.y} A${o},${o} 0 ${c} 1 ${n.x},${n.y} L${l.x},${l.y} A${t},${t} 0 ${c} 0 ${s.x},${s.y} Z`}let n=Math.max(0,Math.min(e.cornerRadius??0,(o-t)/2));if(0===n)return C({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});let l=Math.asin(Math.min(1,n/Math.max(1e-9,o-n))),s=a?0:Math.asin(Math.min(1,n/Math.max(1e-9,t+n))),c=r-i,h=e.roundStart&&e.roundEnd?c/2:c,d=!!e.roundStart&&h>l,u=!!e.roundEnd&&h>l;if(!d&&!u)return C({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});let m=i+(d?l:0),g=r-(u?l:0),p=i+(d?s:0),f=r-(u?s:0),y=tr(o,m),v=tr(o,g),b=(o-n)*Math.cos(l),x=tr(b,i),w=tr(b,r),k=a?null:tr(t,f),A=a?null:tr(t,p),S=a?0:(t+n)*Math.cos(s),R=a?null:tr(S,i),P=a?null:tr(S,r),_=g-m>Math.PI?1:0,L=a?0:f-p>Math.PI?1:0,M="";if(d)M+=`M${x.x},${x.y}`,M+=` A${n},${n} 0 0 1 ${y.x},${y.y}`;else{let e=tr(o,i);M+=`M${e.x},${e.y}`}if(u)M+=` A${o},${o} 0 ${_} 1 ${v.x},${v.y}`,M+=` A${n},${n} 0 0 1 ${w.x},${w.y}`;else{let e=tr(o,r);M+=` A${o},${o} 0 ${_} 1 ${e.x},${e.y}`}if(a)M+=" L0,0";else{if(u)M+=` L${P.x},${P.y}`,M+=` A${n},${n} 0 0 1 ${k.x},${k.y}`;else{let e=tr(t,r);M+=` L${e.x},${e.y}`}if(d)M+=` A${t},${t} 0 ${L} 0 ${A.x},${A.y}`,M+=` A${n},${n} 0 0 1 ${R.x},${R.y}`;else{let e=tr(t,i);M+=` A${t},${t} 0 ${L} 0 ${e.x},${e.y}`}}return M+=" Z",M}function _(e){let t=C({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,cornerRadius:e.cornerRadius,roundStart:e.roundStart,roundEnd:e.roundEnd}),o=[],i=e.colors;if(i.length>0){let t=(e.endAngle-e.startAngle)/i.length;for(let r=0;i.length>r;r++)o.push({d:C({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle+r*t,endAngle:e.endAngle}),color:i[r]})}return{clipPath:t,slices:o}}function L(e,t){let o=t._gradientBand.colors;if(0===o.length)return;let{clipPath:i,slices:r}=_({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds?.start??!0,roundEnd:t.roundedEnds?.end??!0,colors:o}),a=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(a);for(let t of r)e.fillStyle=si(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore();let n=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&n>0&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=si(e,t.style.stroke)||t.style.stroke,e.lineWidth=n,e.stroke(a),e.restore())}function M(e,t){e.beginPath(),t.innerRadius>0?(e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerRadius,t.endAngle,t.startAngle,!0)):(e.moveTo(t.cx,t.cy),e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle)),e.closePath()}function I(e,t){let o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=er().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);let r=new Path2D(i);e.fill(r);let a=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&a>0&&(e.lineWidth=a,e.stroke(r)),e.restore()}function T(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function H(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function B(e,t){let o=`${e}@${"u">typeof window&&window.devicePixelRatio||1}`,i=sr.get(o);if(void 0!==i)return i;let r=ti({background:e,stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45},t),a=ai(r)?null:r;return sr.set(o,a),a}function F(e,t,o,i,r,a){e.moveTo(t+a,o),e.lineTo(t+i-a,o),e.quadraticCurveTo(t+i,o,t+i,o+a),e.lineTo(t+i,o+r-a),e.quadraticCurveTo(t+i,o+r,t+i-a,o+r),e.lineTo(t+a,o+r),e.quadraticCurveTo(t,o+r,t,o+r-a),e.lineTo(t,o+a),e.quadraticCurveTo(t,o,t+a,o),e.closePath()}function $(e){return 1e6>e?1e4>e?1e3>e?Math.round(e)+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function O(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function W(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function D(e){return(t,o,i,r)=>{e(t,o.filter(W),{x:i.r,y:i.r},r)}}function N(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function E(e,t){let o=e.datum;if(!o)return null;let i=[],r=o.__funnelStepLabel,a=Number(o.__funnelStepLabelX),n=Number(o.__funnelStepLabelY),l=Number(o.__funnelRowWidth);"string"==typeof r&&Number.isFinite(a)&&Number.isFinite(n)&&(!Number.isFinite(l)||l>=8.4*r.length+16)&&i.push(vr("text",{x:a,y:n+3,textAnchor:"middle",dominantBaseline:"hanging",fontSize:14,fontWeight:"bold",fill:"#fff",fontFamily:"var(--semiotic-font-family, sans-serif)",stroke:"rgba(0,0,0,0.6)",strokeWidth:3,paintOrder:"stroke",children:r},t+"-funnel-step"));let s=Number(o.__funnelValue),c=Number(o.__funnelValueLabelX),h=Number(o.__funnelValueLabelY),d=Number(o.__funnelBarW);if(Number.isFinite(s)&&0!==s&&Number.isFinite(c)&&Number.isFinite(h)&&d>=60){let e=Number(o.__funnelPercent),r=!0!==o.__funnelIsFirstStep&&Number.isFinite(e)?`${N(s)} (${.05>Math.abs(e-Math.round(e))?Math.round(e):e.toFixed(1)}%)`:N(s);7.8*r.length+16>d&&(r=N(s)),d>=7.8*r.length+16&&i.push(vr("text",{x:c,y:h+22,textAnchor:"middle",dominantBaseline:"hanging",fontSize:13,fontWeight:"bold",fill:"#fff",fontFamily:"var(--semiotic-font-family, sans-serif)",stroke:"rgba(0,0,0,0.5)",strokeWidth:3,paintOrder:"stroke",children:r},t+"-funnel-value"))}return i.length?vr("g",{children:i},t+"-funnel-labels"):null}function j(e){return"connector"===e.node.type}function z(e,t,o,i){if(2>e.length)return null;let r=e[0].node,a=r.style.fill;if(!a||"none"===a)return null;let n=yo(`${t?t+"-":""}connector-${o}-${i}-hatch`),l=ai(a)?ri(a,n):null,s=[`${r.x1},${r.y1}`,...e.map(({node:e})=>`${e.x2},${e.y2}`)].join(" "),c=wr(pr.Fragment,{children:[l&&xr("defs",{children:l}),xr("polygon",{points:s,fill:l?`url(#${n})`:wo(a,"#999"),opacity:r.style.fillOpacity??r.style.opacity??.3,"data-semiotic-connector-fill":r.group||"_default"})]});return Wo(c,r,`ordinal-connector-fill-${o}-${i}`)}function V(e,t,o){let i=new Map;for(let t of e){if(!j(t))continue;let e=t.node.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}if(0===i.size)return;let r=Array.from(i.values()).map((e,i)=>wr("g",{children:[z(e,t,o,i),e.map(e=>e.element)]},`ordinal-connectors-${o}-${i}`)),a=e[0],n=j(a)?null:a.element;for(let e of i.values())for(let t of e)t.element=null;a.element=wr(pr.Fragment,{children:[r,n]},"ordinal-connector-run-"+o)}function G(e){let t=dt({nodes:e.nodes,renderMode:e.renderMode,fallback:(t,o)=>function(e,t,o){return Wo(function(e,t,o){let i=("category"in e?e.category:void 0)||("group"in e?e.group:void 0)||"",r=o=>`ord-${e.type}-${i}-${t}-${o}`,a=`ord-${e.type}-${i}-${t}`;switch(e.type){case"rect":{let t,o,i=e,r=yo(a)+"-grad",n=Et(i,r);if(n)o=`url(#${r})`;else if(ai(i.style.fill)){let e=yo(a)+"-hatch";t=ri(i.style.fill,e),o=`url(#${e})`}else o=wo(i.style.fill);let l=n||t?br("defs",{children:[n,t]}):null;if(i.cornerRadii&&ii(i.cornerRadii)){let e=no(i);return br(fr.Fragment,{children:[l,vr("path",{d:e,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},a)}if(i.roundedTop&&i.roundedTop>0){let e,t=Math.min(i.roundedTop,i.w/2,i.h/2),{x:r,y:n,w:s,h:c}=i;switch(i.roundedEdge){case"right":e=`M${r},${n} L${r+s-t},${n} A${t},${t} 0 0 1 ${r+s},${n+t} L${r+s},${n+c-t} A${t},${t} 0 0 1 ${r+s-t},${n+c} L${r},${n+c} Z`;break;case"left":e=`M${r+s},${n} L${r+t},${n} A${t},${t} 0 0 0 ${r},${n+t} L${r},${n+c-t} A${t},${t} 0 0 0 ${r+t},${n+c} L${r+s},${n+c} Z`;break;case"bottom":e=`M${r},${n} L${r+s},${n} L${r+s},${n+c-t} A${t},${t} 0 0 1 ${r+s-t},${n+c} L${r+t},${n+c} A${t},${t} 0 0 1 ${r},${n+c-t} Z`;break;default:e=`M${r},${n+c} L${r},${n+t} A${t},${t} 0 0 1 ${r+t},${n} L${r+s-t},${n} A${t},${t} 0 0 1 ${r+s},${n+t} L${r+s},${n+c} Z`}return br(fr.Fragment,{children:[l,vr("path",{d:e,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},a)}return br(fr.Fragment,{children:[l,vr("rect",{x:i.x,y:i.y,width:i.w,height:i.h,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth}),E(i,a)]},a)}case"point":{let t=e;return vr("circle",{cx:t.x,cy:t.y,r:t.r,fill:wo(t.style.fill),opacity:t.style.opacity??t.style.fillOpacity??.8,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},a)}case"symbol":return ko(e,t,o);case"glyph":return Kt(e,e.x,e.y,`${o??""}ord-glyph-${e.pointId??t}`);case"wedge":{let i,r=e;if(r._gradientBand&&r._gradientBand.colors.length>0){let e=yo(`${o?o+"-":""}gauge-grad-${r.category||a}-${t}`),{clipPath:i,slices:n}=_({innerRadius:r.innerRadius,outerRadius:r.outerRadius,startAngle:r.startAngle,endAngle:r.endAngle,cornerRadius:r.cornerRadius,roundStart:r.roundedEnds?.start??!0,roundEnd:r.roundedEnds?.end??!0,colors:r._gradientBand.colors});return br("g",{transform:`translate(${r.cx},${r.cy})`,opacity:r.style.opacity,fillOpacity:r.style.fillOpacity,children:[vr("defs",{children:vr("clipPath",{id:e,children:vr("path",{d:i})})}),vr("g",{clipPath:`url(#${e})`,children:n.map((e,t)=>vr("path",{d:e.d,fill:wo(e.color)},t))}),r.style.stroke&&"none"!==r.style.stroke&&vr("path",{d:i,fill:"none",stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},a)}if(r.roundedEnds)i=C({innerRadius:r.innerRadius,outerRadius:r.outerRadius,startAngle:r.startAngle,endAngle:r.endAngle,cornerRadius:r.cornerRadius,roundStart:r.roundedEnds.start,roundEnd:r.roundedEnds.end});else{let e=yr().innerRadius(r.innerRadius).outerRadius(r.outerRadius).startAngle(r.startAngle+Math.PI/2).endAngle(r.endAngle+Math.PI/2);r.cornerRadius&&e.cornerRadius(r.cornerRadius),i=e(Rt)||""}return vr("path",{d:i,transform:`translate(${r.cx},${r.cy})`,fill:wo(r.style.fill),stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,opacity:r.style.opacity},a)}case"boxplot":{let t=e,o=t.columnWidth/2,i=t.style.strokeWidth??1;return br("g","vertical"===t.projection?{children:[vr("line",{x1:t.x,y1:t.minPos,x2:t.x,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("rect",{x:t.x-o,y:Math.min(t.q1Pos,t.q3Pos),width:t.columnWidth,height:Math.abs(t.q3Pos-t.q1Pos),fill:wo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("line",{x1:t.x-o,y1:t.medianPos,x2:t.x+o,y2:t.medianPos,stroke:t.style.stroke||"#333",strokeWidth:2*i}),vr("line",{x1:t.x-.5*o,y1:t.minPos,x2:t.x+.5*o,y2:t.minPos,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("line",{x1:t.x-.5*o,y1:t.maxPos,x2:t.x+.5*o,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:i})]}:{children:[vr("line",{x1:t.minPos,y1:t.y,x2:t.maxPos,y2:t.y,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("rect",{x:Math.min(t.q1Pos,t.q3Pos),y:t.y-o,width:Math.abs(t.q3Pos-t.q1Pos),height:t.columnWidth,fill:wo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("line",{x1:t.medianPos,y1:t.y-o,x2:t.medianPos,y2:t.y+o,stroke:t.style.stroke||"#333",strokeWidth:2*i}),vr("line",{x1:t.minPos,y1:t.y-.5*o,x2:t.minPos,y2:t.y+.5*o,stroke:t.style.stroke||"#333",strokeWidth:i}),vr("line",{x1:t.maxPos,y1:t.y-.5*o,x2:t.maxPos,y2:t.y+.5*o,stroke:t.style.stroke||"#333",strokeWidth:i})]},a)}case"violin":{let t=e,o=[vr("path",{d:t.pathString,transform:t.translateX||t.translateY?`translate(${t.translateX},${t.translateY})`:void 0,fill:wo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:t.style.strokeWidth??1},r("path"))];if(t.iqrLine&&t.bounds){let e=t.bounds,i=e.x+e.width/2,a=e.y+e.height/2;t.iqrLine.isVertical?o.push(vr("line",{x1:i,y1:t.iqrLine.q1Pos,x2:i,y2:t.iqrLine.q3Pos,stroke:t.style.stroke||"#333",strokeWidth:2},r("iqr")),vr("circle",{cx:i,cy:t.iqrLine.medianPos,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},r("med"))):o.push(vr("line",{x1:t.iqrLine.q1Pos,y1:a,x2:t.iqrLine.q3Pos,y2:a,stroke:t.style.stroke||"#333",strokeWidth:2},r("iqr")),vr("circle",{cx:t.iqrLine.medianPos,cy:a,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},r("med")))}return vr("g",{children:o},a)}case"connector":{let t=e,o=t.style.fill&&"none"!==t.style.fill?wo(t.style.fill,"var(--semiotic-border, #999)"):"var(--semiotic-border, #999)";return vr("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.stroke||o,strokeWidth:t.style.strokeWidth??1,opacity:t.style.opacity??.5},a)}case"trapezoid":{let t=e,o=t.points.map(e=>`${e[0]},${e[1]}`).join(" ");return vr("polygon",{points:o,fill:wo(t.style.fill,"#999"),opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},a)}default:return null}}(e,t,o),e,"ordinal-cursor-"+t)}(t,o,e.idPrefix)}),o=0;for(let i=0;t.length>i;){if(t[i].renderedByBackend){i++;continue}let r=i+1;for(;t.length>r&&!t[r].renderedByBackend;)r++;V(t.slice(i,r),e.idPrefix,o++),i=r}return t}function q(e){let t=xo(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:Ar("div",{className:"semiotic-tooltip",style:Xt,children:[null!=t.title&&kr("div",{style:{fontWeight:"bold"},children:t.title+""}),t.entries.map(e=>Ar("div",{children:[Ar("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():e.value+""]},e.key))]})}function X({hover:e}){let t=e.data||{},o=e.stats,i=e.category;if(Array.isArray(t)){let e=i||t[0]?.category||"";if(o)return Ar("div",{className:"semiotic-tooltip",style:Xt,children:[e&&kr("div",{style:{fontWeight:"bold"},children:e+""}),Ar("div",{children:["n = ",o.n]}),Ar("div",{children:["Min: ",o.min.toLocaleString()]}),Ar("div",{children:["Q1: ",o.q1.toLocaleString()]}),Ar("div",{children:["Median: ",o.median.toLocaleString()]}),Ar("div",{children:["Q3: ",o.q3.toLocaleString()]}),Ar("div",{children:["Max: ",o.max.toLocaleString()]}),Ar("div",{style:{opacity:.8},children:["Mean: ",o.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});let r=t.length;return Ar("div",{className:"semiotic-tooltip",style:Xt,children:[e&&kr("div",{style:{fontWeight:"bold"},children:e+""}),Ar("div",{children:[r," items"]})]})}if(null!=t.bin&&null!=t.count){let e=t.range||[];return Ar("div",{className:"semiotic-tooltip",style:Xt,children:[t.category&&kr("div",{style:{fontWeight:"bold"},children:t.category+""}),Ar("div",{children:["Count: ",t.count]}),2===e.length&&Ar("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}let r=e.__oAccessor,a=e.__rAccessor,n=e.__chartType;if("swarm"===n||"point"===n)return q(t);let l=(r&&null!=t[r]?t[r]:null)||t.category||t.name||t.group||t.__rName||"",s=t.__aggregateValue??(a&&null!=t[a]?t[a]:null)??t.value??t.__rValue??t.pct??"";return l||""!==s?Ar("div",{className:"semiotic-tooltip",style:Xt,children:[l&&kr("div",{style:{fontWeight:"bold"},children:l+""}),""!==s&&kr("div",{children:"number"==typeof s?s.toLocaleString():s+""})]}):q(t)}function Y({ref:e,frameRef:t,setup:o}){return Tr(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,o)=>t.current?.update(e,o)??[],replace:e=>t.current?.replace(e),clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t]),{effectiveLegendProps:o.legendBehaviorProps,effectiveMargin:o.margin}}function Q(e){let{colorBy:t,colorScale:o,color:i,themeCategorical:r,colorScheme:a,categoryIndexMap:n,userPieceStyle:l,stroke:s,strokeWidth:c,opacity:h,effectiveSelectionHook:d,resolvedSelection:u,cycleByCategory:m=!1,baseStyleExtras:g,linkStrokeToFill:p=!1,styleRules:f,resolveRuleValue:y}=e,v=Hr(()=>(e,l)=>{let s="function"==typeof g?g(e,l):g,c=s?{...s}:{};if(void 0===c.fill)if(t){if(!o)return c;c.fill=Eo(e,t,o)}else c.fill=mo(i,r,a,m?l:void 0,n);if(f&&f.length>0){let t=fo(e,f,{value:y?y(e,l):void 0,category:l});Object.assign(c,t)}return p&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[t,o,i,r,a,n,m,g,p,f,y]),b=Hr(()=>at(l?"function"==typeof l?(e,t)=>({...v(e,t),...l(e,t)||{}}):(e,t)=>({...v(e,t),...l}):v,{stroke:s,strokeWidth:c,opacity:h}),[v,l,s,c,h]);return Hr(()=>Do(b,d??null,u),[b,d,u])}function K({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){let r=Fr(()=>to("string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0),[o]),a="string"==typeof i?i:"value",n=Ro({name:r?.name||"__unused_ordinal_brush__",xField:r?.xField||a}),l=$r(n.brushInteraction);l.current=n.brushInteraction;let s=Br(e=>{if(r){l.current.end(e?e.r:null)}t?.(e)},[t,r]),c=!!(e||o||t);return{hasBrush:c,handleBrush:s,brushStreamProps:c?{brush:{dimension:"r"},onBrush:s}:{}}}function Z(e,t){if("function"==typeof e)return e;let o=e||t;return e=>e[o]}function U(e,t,o,i,r,a,n={}){let l=new Map,s=new Set(t);for(let n of e){let e=o(n);l.has(e)||l.set(e,new Map);let c=l.get(e);if(i){let e=i(n);if(null==e||!Number.isFinite(e))continue;if(!Number.isInteger(e)){"production"!==process.env.NODE_ENV&&console.warn("[LikertChart] Ignoring non-integer Likert score:",e);continue}let o=e-1;if(0>o||o>=t.length)continue;let r=t[o];c.set(r,(c.get(r)||0)+1)}else if(r&&a){let e=r(n),t=a(n);if(!s.has(e))continue;c.set(e,(c.get(e)||0)+(Number.isFinite(t)?t:0))}}let c=[];for(let[e,o]of l){let i=0;for(let e of t)i+=o.get(e)||0;if(0!==i)for(let r=0;t.length>r;r++){let a=t[r],l=o.get(a)||0,s={};n.category&&(s[n.category]=e),n.level&&(s[n.level]=a),n.count&&(s[n.count]=l),n.score&&(s[n.score]=r+1),c.push({...s,__likertCategory:e,__likertLevel:a,__likertLevelLabel:a,__likertCount:l,__likertPct:l/i*100,__likertLevelIndex:r})}}return c}function J(e,t){let o=t.length,i=o%2!=0,r=Math.floor(o/2),a=[];for(let t of e){let e=t.__likertLevelIndex;if(i&&e===r){let e=t.__likertPct/2;a.push({...t,__likertLevel:ea,__likertPct:-e}),a.push({...t,__likertLevel:ta,__likertPct:e})}else a.push(r>e?{...t,__likertPct:-t.__likertPct}:t)}return a}function ee(e,t){let o=t.length,i=o%2!=0,r=Math.floor(o/2),a=new Map;for(let t of e){let e=a.get(t.__likertCategory)||[];e.push(t),a.set(t.__likertCategory,e)}let n=[];for(let[,e]of a){let t,a,l=new Map;for(let o of e)o.__likertLevel===ea?t=o:o.__likertLevel===ta?a=o:l.set(o.__likertLevelIndex,o);i&&t&&n.push(t);for(let e=r-1;e>=0;e--){let t=l.get(e);t&&n.push(t)}i&&a&&n.push(a);for(let e=i?r+1:r;o>e;e++){let t=l.get(e);t&&n.push(t)}}return n}function te(e){let t=e.__likertPct??e.data?.__likertPct;return"number"==typeof t&&Number.isFinite(t)?t:void 0}function oe(e){return t=>{let o=t.category||t.data&&t.data[0]?.category||"",i=t.stats||(t.data||t).stats;if(i&&null!=i.median)return pa("div",{className:"semiotic-tooltip",style:Xt,children:[o&&ga("div",{style:{fontWeight:"bold"},children:o+""}),null!=i.n&&pa("div",{children:["n = ",i.n]}),null!=i.min&&pa("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&pa("div",{children:["Q1: ",i.q1.toLocaleString()]}),pa("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&pa("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&pa("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&pa("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){let i=e.valueAccessor,r=(Array.isArray(t.data)?t.data:[]).map(e=>Number("function"==typeof i?i(e):e[i])).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t),a=r.length,n=a>0?a%2!=0?r[Math.floor(a/2)]:(r[a/2-1]+r[a/2])/2:null;return pa("div",{className:"semiotic-tooltip",style:Xt,children:[o&&ga("div",{style:{fontWeight:"bold"},children:o+""}),a>0&&pa("div",{children:["n = ",a]}),null!=n&&pa("div",{children:["Median: ",n.toLocaleString()]})]})}return ga("div",{className:"semiotic-tooltip",style:Xt,children:ga("div",{style:{fontWeight:"bold"},children:o+""})})}}function ie(e=240){let t=360-e,o=180+t/2,i=o*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:o,startAngleRad:i,offsetRad:-Math.PI/2+i}}function re(e){return Math.max(0,Math.min(1,e))}function ae(e){let t=e.trim();if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e.split("").map(e=>e+e).join("")),6===e.length&&/^[0-9a-f]{6}$/i.test(e))return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}let o=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(o){let e=[Number(o[1]),Number(o[2]),Number(o[3])];if(e.every(Number.isFinite))return e}return null}function ne(e,t,o){let i=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(o)}`}function le(e,t,o){let i=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:re(e.offset),color:e.color??o,opacity:null==e.opacity?1:re(e.opacity)})).sort((e,t)=>e.offset-t.offset);if(0===i.length)return"#999999";let r=e=>{if(1===e.opacity)return e.color;let t=ae(e.color);return t?`rgba(${t[0]},${t[1]},${t[2]},${e.opacity})`:e.color};if(1===i.length)return r(i[0]);let a=re(t);if(i[0].offset>=a)return r(i[0]);if(a>=i[i.length-1].offset)return r(i[i.length-1]);for(let e=0;i.length-1>e;e++){let t=i[e],o=i[e+1];if(t.offset>a||a>o.offset)continue;let n=o.offset-t.offset,l=n>0?(a-t.offset)/n:0,s=ae(t.color),c=ae(o.color);if(!s||!c)return r(.5>l?t:o);let[h,d,u]=s,[m,g,p]=c,f=h+(m-h)*l,y=d+(g-d)*l,v=u+(p-u)*l,b=t.opacity+(o.opacity-t.opacity)*l;return 1===b?ne(f,y,v):`rgba(${Math.round(f)},${Math.round(y)},${Math.round(v)},${b})`}return r(i[i.length-1])}function se(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}import{buildRegressionAnnotation as ce}from"./c-GNTXRXRN.min.js";import{useCustomChartSetup as he}from"./c-TX7XJM3Z.min.js";import{validateArrayData as de}from"./c-D6HAAPTX.min.js";import{useChartSetup as ue,useFrameImperativeHandle as me,useResolvedSelection as ge}from"./c-RFC7UAG7.min.js";import{useStreamingLegend as pe}from"./c-NHBL4J67.min.js";import{barCanvasRenderer as fe}from"./c-SJMWU6UX.min.js";import{DataSourceAdapter as ye,IncrementalExtent as ve,buildEnrichAnnotationData as be,ordinalFrameLegendOptions as xe,resolveAnnotationAccessor as we,snapOrdinalIntroTargets as ke,ticksForMode as Ae,toIdSet as Se}from"./c-C3TZLTZK.min.js";import{buildRectNode as Re,normalizeColorGradient as Pe,normalizeGradient as Ce}from"./c-AVO3Q7T7.min.js";import{RingBuffer as _e,compactTimestampBufferForRemoval as Le,computePulseIntensity as Me,createTimestampBufferForData as Ie,ensureRingBufferCapacity as Te,hasActivePulses as He,pushWithTimestamp as Be,refreshIdlePulse as Fe,setPulseState as $e,useOrdinalKeyboardNavigation as Oe,useSemanticFrameInteractions as We}from"./c-N3FXLRNT.min.js";import{pointCanvasRenderer as De}from"./c-MOKJOIPE.min.js";import{symbolCanvasRenderer as Ne}from"./c-PSKKFZNP.min.js";import{glyphCanvasRenderer as Ee}from"./c-KKPMHAZC.min.js";import{AXIS_FRAME_DEFAULT_MARGIN as je}from"./c-2N7IU2NY.min.js";import{accessorsEquivalent as ze,resolveAccessor as Ve,resolveStringAccessor as Ge}from"./c-YLZIV3VS.min.js";import{StalenessBadge as qe,attachUpdateResultStore as Xe,buildBaseMetadataProps as Ye,buildCustomBehaviorProps as Qe,buildDatumIndexMap as Ke,buildOrdinalTooltip as Ze,buildTooltipProps as Ue,composeOverlays as Je,computeDecayOpacity as et,filterAnnotationsByStatus as tt,findHitPointInQuadtree as ot,getHitRadius as it,hitTestRect as rt,mergeShapeStyle as at,normalizeAngle as nt,overlayAccessibleDescription as lt,overlayAccessibleIds as st,overlayAccessibleTitle as ct,paintSceneWithBackend as ht,renderSceneListWithBackend as dt,resolveFrameGraphics as ut,runCustomLayoutAttempt as mt,shouldHandleFramePointer as gt,useConfigSync as pt,useLayoutSelectionSync as ft,useLegendCategoryEmission as yt,useStableShallow as vt,useStalenessCheck as bt,warnCustomLayoutDiagnostics as xt}from"./c-SGAURYHG.min.js";import{wrapWithCustomLayoutSelection as wt}from"./c-YDECTEUW.min.js";import{renderPathPulse as kt}from"./c-W4ZUKSEQ.min.js";import{buildResolveColor as At,resolveCustomLayoutPalette as St}from"./c-EUBTECGM.min.js";import{ARC_NOOP as Rt,AccessibleDataTable as Pt,AccessibleTablePortal as Ct,AriaLiveTooltip as _t,CanvasFrameBackground as Lt,ChartError as Mt,FlippingTooltip as It,FocusRing as Tt,SVGChartTitle as Ht,SafeRender as Bt,SceneRevisionDiagnosticsObserver as Ft,ScreenReaderSummary as $t,SkipToTableLink as Ot,UpdateResultTracker as Wt,annotationLayout as Dt,buildHoverData as Nt,buildRectSVGGradient as Et,composeStyleRules as jt,computeCanvasAriaLabel as zt,computeEasing as Vt,computeRawProgress as Gt,createDefaultAnnotationRules as qt,defaultTooltipStyle as Xt,filterSparseArray as Yt,getDevicePixelRatio as Qt,glyphNodeToSVG as Kt,isAnnotationActivationTarget as Zt,isServerEnvironment as Ut,lerp as Jt,makeRuleValueResolver as eo,normalizeLinkedBrush as to,normalizeTooltip as oo,now as io,numericTickFormatter as ro,observationInputType as ao,perCornerSvgPath as no,rehitCanvasMarkCursor as lo,renderAnnotationPass as so,renderEmptyState as co,renderLegendFromConfig as ho,renderLoadingState as uo,resolveDefaultFill as mo,resolveLegendSideGutter as go,resolveOrdinalAxisChrome as po,resolveStyleRules as fo,safeSvgId as yo,sceneMarkCursor as vo,setCanvasMarkCursor as bo,smartTooltipEntries as xo,svgFill as wo,symbolSceneNodeToSVG as ko,syncCanvasMarkCursor as Ao,useAnnotationActivationOptions as So,useBrushSelection as Ro,useCanvasMarkCursorCleanup as Po,useChartMode as Co,useChartSelection as _o,useFrame as Lo,useFrameCanvasHost as Mo,useHydration as Io,useSceneRevisionDiagnostics as To,useSortedData as Ho,useThemeCategorical as Bo,useThemeDiverging as Fo,useWasHydratingFromSSR as $o,warnMissingField as Oo,withSceneMarkCursor as Wo,wrapStyleWithSelection as Do}from"./c-ODG6TFSY.min.js";import{STREAMING_PALETTE as No,getColor as Eo,getSize as jo,interpolateBrBG as zo,interpolatePRGn as Vo,interpolatePiYG as Go,interpolateRdBu as qo,interpolateRdYlBu as Xo,interpolateRdYlGn as Yo,interpolateSpectral as Qo,resolveExplicitColor as Ko}from"./c-CPV4N35K.min.js";import{resolveThemeSemanticColors as Zo}from"./c-JUKIWTBJ.min.js";import{getMax as Uo,getMinMax as Jo}from"./c-QA3HMQJP.min.js";import{coerceCanvasFill as ei,createHatchPattern as ti,glyphHitGeometry as oi,hasAnyCornerRadius as ii,hatchPatternDef as ri,isHatchFill as ai,makeSymbolResolver as ni,parseCanvasColor as li,resolveCSSColor as si,resolveCanvasFill as ci,subscribeToCanvasFontInvalidation as hi,symbolRadius as di}from"./c-MB6CV5NC.min.js";import*as ui from"react";import{jsx as mi}from"react/jsx-runtime";var gi=new Set(["svg","g","text","tspan","path","circle","ellipse","rect","line","polyline","polygon","use","image","defs","symbol"]);import{forwardRef as pi,memo as fi,useCallback as yi,useEffect as vi,useMemo as bi,useRef as xi,useState as wi}from"react";import{scaleBand as ki,scaleLinear as Ai}from"d3-scale";var Si=class{constructor(){this.colorSchemeMap=new Map,this.colorSchemeIndex=0}resetColors(){this.colorSchemeMap.clear(),this.colorSchemeIndex=0}resolvePieceStyle(e,t,o){if(t&&"function"==typeof e.pieceStyle){let i=e.pieceStyle(t,o);return i&&!i.fill&&o?{...i,fill:this.getColorFromScheme(e,o)}:i}return e.pieceStyle&&"object"==typeof e.pieceStyle?e.pieceStyle:e.barColors&&o?{fill:Ko(e.barColors,o)??"#007bff"}:{fill:o?this.getColorFromScheme(e,o):"#007bff"}}resolveSummaryStyle(e,t,o){return t&&"function"==typeof e.summaryStyle?e.summaryStyle(t,o):e.summaryStyle&&"object"==typeof e.summaryStyle?e.summaryStyle:{fill:"#007bff",fillOpacity:.6,stroke:"#007bff",strokeWidth:1}}getColorFromScheme(e,t){let o=this.colorSchemeMap.get(t);if(o)return o;let i=Array.isArray(e.colorScheme)?e.colorScheme:e.themeCategorical||No,r=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,r),r}};import{quantileSorted as Ri}from"d3-array";import{scaleLinear as Pi}from"d3-scale";var Ci={bar:function(e,t){let{scales:i,columns:r,config:a,getR:n,getStack:l,resolvePieceStyle:s}=e,{r:c,projection:h}=i,d=[],u="vertical"===h,m="horizontal"===h,g=a.normalize,p=[];if(l){let e=new Set;for(let t of Object.values(r))for(let o of t.pieceData){let t=l(o);e.has(t)||(e.add(t),p.push(t))}}else p.push("_default");for(let e of Object.values(r)){let t=new Map;for(let o of e.pieceData){let e=l?l(o):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});let i=t.get(e);i.total+=n(o),i.pieces.push(o)}let o=0;if(g)for(let e of t.values())o+=Math.abs(e.total);let i=0,r=0;for(let a of p){let n=t.get(a);if(!n)continue;let h=n.total;g&&o>0&&(h/=o);let p=s(n.pieces[0],l?a:e.name),f={...n.pieces[0],__aggregateValue:n.total,__pieceCount:n.pieces.length,category:e.name};if(u){let t=c(0>h?r:i+h),o=0>h?c(r+h)-c(r):c(i)-c(i+h);d.push(Re(e.x,t,e.width,Math.abs(o),p,f,a)),0>h?r+=h:i+=h}else if(m){let t=c(0>h?r+h:i),o=0>h?c(r)-c(r+h):c(i+h)-c(i);d.push(Re(t,e.x,Math.abs(o),e.width,p,f,a)),0>h?r+=h:i+=h}}}let f="vertical"===h;for(let e of d){if("rect"!==e.type)continue;let t=e.datum?.__aggregateValue??0;e.roundedEdge=f?0>t?"bottom":"top":0>t?"left":"right",a.gradientFill&&(e.fillGradient=a.gradientFill)}if(void 0!==a.roundedTop){let e=new Map;for(let t of d){if("rect"!==t.type)continue;let o=t.datum?.category||"";e.has(o)||e.set(o,[]),e.get(o).push(t)}for(let t of e.values()){if(0===t.length)continue;let e=t.filter(e=>(e.datum?.__aggregateValue??0)>=0),i=t.filter(e=>0>(e.datum?.__aggregateValue??0));if(e.length>0){let t=e.reduce(f?(e,t)=>t.y>e.y?e:t:(e,t)=>e.x+e.w>t.x+t.w?e:t),i=o(a.roundedTop,t,f);i>0&&(t.roundedTop=i)}if(i.length>0){let e=i.reduce(f?(e,t)=>e.y+e.h>t.y+t.h?e:t:(e,t)=>t.x>e.x?e:t),t=o(a.roundedTop,e,f);t>0&&(e.roundedTop=t)}}}return d},clusterbar:function(e,t){let{scales:i,columns:r,config:a,getR:n,getGroup:l,resolvePieceStyle:s}=e,{r:c,projection:h}=i,d=[],u="vertical"===h,m=[],g=new Set;for(let e of Object.values(r))for(let t of e.pieceData){let e=l?l(t):"_default";g.has(e)||(g.add(e),m.push(e))}let p=m.length||1;for(let e of Object.values(r)){let t=e.width/p,o=.2*t,i=t-o,r=new Map;for(let t of e.pieceData){let e=l?l(t):"_default";r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let a=0;m.length>a;a++){let l=r.get(m[a])||[];for(let r of l){let l=n(r),h=s(r,m[a]);if(u){let n=e.x+a*t+o/2,s=c(0),u=c(l);d.push(Re(n,Math.min(s,u),i,Math.abs(s-u),h,r,m[a]))}else{let n=e.x+a*t+o/2,s=c(0),u=c(l);d.push(Re(Math.min(s,u),n,Math.abs(u-s),i,h,r,m[a]))}}}}for(let e of d){if("rect"!==e.type||null==e.datum)continue;let t=n(e.datum),i=o(a.roundedTop,e,u);i>0&&(e.roundedTop=i),e.roundedEdge=u?0>t?"bottom":"top":0>t?"left":"right",a.gradientFill&&(e.fillGradient=a.gradientFill)}return d},point:function(e,t){let{scales:o,columns:a,getR:n,multiScales:l,resolvePieceStyle:s}=e,{r:c,projection:h}=o,d=[],u="vertical"===h,m="radial"===h,g=l.length>0,p=i(e),f=2*Math.PI,y=-Math.PI/2;for(let e of Object.values(a))for(let t of e.pieceData){let o,i,a=t.__rIndex??0,h=t.__rValue??n(t),v=g&&l[a]||c,b=s(t,e.name),x=b.r||5;if(m){let t=y+(e.pctStart+e.pct/2)*f,r=v(h);o=Math.cos(t)*r,i=Math.sin(t)*r}else u?(o=e.middle,i=v(h)):(o=v(h),i=e.middle);r(d,p,t,o,i,x,b)}return d},swarm:function(e,t){let{scales:o,columns:a,getR:n,resolvePieceStyle:l}=e,{r:s,projection:c}=o,h=[],d="vertical"===c,u=i(e);for(let e of Object.values(a)){let t=e.width/2;for(let o=0;e.pieceData.length>o;o++){let i=e.pieceData[o],a=n(i),c=l(i,e.name),m=c.r||4,g=(7919*o%100/100-.5)*t*.8;r(h,u,i,d?e.middle+g:s(a),d?s(a):e.middle+g,m,c)}}return h},pie:a,donut:a,boxplot:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:s}=e,{r:c,projection:h}=o,d=[],u="vertical"===h,m=!1!==r.showOutliers;for(let t of Object.values(i)){let o=t.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(0===o.length)continue;let i=l(o),{min:r,max:h,q1:g,median:p,q3:f}=i,y=f-g,v=g-1.5*y,b=f+1.5*y,x=o.find(e=>e>=v)??r,w=h;for(let e=o.length-1;e>=0;e--)if(b>=o[e]){w=o[e];break}i.min=x,i.max=w;let k=s(n(t.pieceData,t.name,i),t.name),A=[];if(m)for(let e of t.pieceData){let o=a(e);if(v>o||o>b){let i=u?t.middle:c(o),r=u?c(o):t.middle;A.push({px:i,py:r,value:o,datum:e})}}if(d.push({type:"boxplot",x:u?t.middle:0,y:u?0:t.middle,projection:u?"vertical":"horizontal",columnWidth:.6*t.width,minPos:c(x),q1Pos:c(g),medianPos:c(p),q3Pos:c(f),maxPos:c(w),stats:i,style:k,datum:t.pieceData,category:t.name,outliers:A}),m)for(let t of A)d.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:k.fill||e.config.themeSemantic?.secondary||"#999",opacity:.6,cursor:k.cursor},datum:t.datum})}return d},violin:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:c}=e,{r:h,projection:d}=o,u=[],m="vertical"===d,g=r.bins||20,p=!1!==r.showIQR;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;let o,i=t[0],r=t[t.length-1],d=(r-i)/g||1,f=s(t,i,r,d,g),y=Uo(f,1),v=e.width/2*.9;if(m){o=`M ${e.middle} ${h(i)}`;for(let t=0;g>t;t++){let r=h(i+(t+.5)*d);o+=` L ${e.middle+f[t]/y*v} ${r}`}o+=` L ${e.middle} ${h(r)}`;for(let t=g-1;t>=0;t--){let r=h(i+(t+.5)*d);o+=` L ${e.middle-f[t]/y*v} ${r}`}o+=" Z"}else{o=`M ${h(i)} ${e.middle}`;for(let t=0;g>t;t++)o+=` L ${h(i+(t+.5)*d)} ${e.middle-f[t]/y*v}`;o+=` L ${h(r)} ${e.middle}`;for(let t=g-1;t>=0;t--)o+=` L ${h(i+(t+.5)*d)} ${e.middle+f[t]/y*v}`;o+=" Z"}let b,x=l(t),w=c(n(e.pieceData,e.name,x),e.name);p&&t.length>=4&&(b={q1Pos:h(x.q1),medianPos:h(x.median),q3Pos:h(x.q3),centerPos:e.middle,isVertical:m});let k=m?{x:e.x,y:Math.min(h(r),h(i)),width:e.width,height:Math.abs(h(r)-h(i))}:{x:Math.min(h(i),h(r)),y:e.x,width:Math.abs(h(r)-h(i)),height:e.width};u.push({type:"violin",pathString:o,translateX:0,translateY:0,bounds:k,iqrLine:b,stats:x,style:w,datum:e.pieceData,category:e.name})}return u},histogram:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:n}=e,{r:l}=o,c=[],h=r.bins||25,d=r.normalize,u=l.domain?.(),m=u?+u[0]:void 0,g=u?+u[1]:void 0;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;let[o,i]=Jo(t),r=null!=m&&isFinite(m)?m:o,u=null!=g&&isFinite(g)?g:i,p=(u-r)/h||1,f=s(t,r,u,p,h),y=t.length,v=Uo(f,1);for(let t=0;h>t;t++){if(0===f[t])continue;let o=(d?f[t]/y:f[t]/v)*e.width*.9,i=l(r+t*p),a=l(r+(t+1)*p),s=Math.min(i,a),h=Math.abs(a-i),u=e.x+e.width-o,m={...e.pieceData[0],bin:t,count:f[t],range:[r+t*p,r+(t+1)*p],category:e.name,data:e.pieceData},g=n(m,e.name);c.push(Re(s,u,h,o,g,m,e.name))}}return c},ridgeline:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:c}=e,{r:h,projection:d}=o,u=[],m=r.bins||20,g="horizontal"===d,p=r.amplitude||1.5;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;let o,i=t[0],r=t[t.length-1],d=(r-i)/m||1,f=s(t,i,r,d,m),y=Uo(f,1),v=l(t),b=c(n(e.pieceData,e.name,v),e.name),x=e.width*p;if(g){let t=e.x+e.width;o=`M ${h(i)} ${t}`;for(let e=0;m>e;e++)o+=` L ${h(i+(e+.5)*d)} ${t-f[e]/y*x}`;o+=` L ${h(r)} ${t} Z`}else{let t=e.x;o=`M ${t} ${h(i)}`;for(let e=0;m>e;e++){let r=h(i+(e+.5)*d);o+=` L ${t+f[e]/y*x} ${r}`}o+=` L ${t} ${h(r)} Z`}let w=g?{x:Math.min(h(i),h(r)),y:e.x,width:Math.abs(h(r)-h(i)),height:e.width}:{x:e.x,y:Math.min(h(r),h(i)),width:e.width,height:Math.abs(h(r)-h(i))};u.push({type:"violin",pathString:o,translateX:0,translateY:0,bounds:w,stats:v,style:{...b,fillOpacity:b.fillOpacity??.5},datum:e.pieceData,category:e.name})}return u},timeline:function(e,t){let{scales:o,columns:i,getRawRange:r,resolvePieceStyle:a}=e,{r:n,projection:l}=o,s=[],c="horizontal"===l;for(let e of Object.values(i))for(let t of e.pieceData){let o=r(t);if(!o)continue;let[i,l]=o,h=a(t,e.name);if(c){let o=n(Math.min(i,l)),r=n(Math.max(i,l));s.push(Re(o,e.x,r-o,e.width,h,t,e.name))}else{let o=n(Math.max(i,l)),r=n(Math.min(i,l));s.push(Re(e.x,o,e.width,r-o,h,t,e.name))}}return s},funnel:function(e,t){let{columns:o,getR:i,getStack:r,resolvePieceStyle:a}=e,n=[],l=t.width/2,s=!1!==e.config.showLabels,c=e.scales.o.domain().map(e=>o[e]).filter(Boolean);if(0===c.length)return n;let h=[],d=new Set;for(let e of c)for(let t of e.pieceData){let e=r?r(t):"_default";d.has(e)||(d.add(e),h.push(e))}let u=h.length>1&&"_default"!==h[0],m=[],g=0;for(let e of c){let t=new Map,o=0;for(let a of e.pieceData){let e=r?r(a):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});let n=t.get(e),l=i(a);n.total+=l,n.pieces.push(a),o+=l}m.push({col:e,groups:t,stepTotal:o}),u||o>g&&(g=o)}if(u)for(let e of m){let t=0,o=0;for(let i=0;h.length>i;i++){let r=e.groups.get(h[i]);r&&(i%2==0?t+=r.total:o+=r.total)}let i=Math.max(t,o);i>g&&(g=i)}if(0===g)return n;let p=new Map;for(let e of h){let t=m[0].groups.get(e);p.set(e,t?.total??0)}let f=m[0].stepTotal,y=u?.95*l:.9*t.width,v=Pi().domain([0,g]).range([0,y]),b=e.config.connectorOpacity??.3,x=new Map;for(let t=0;m.length>t;t++){let o=m[t],i=o.col,r=0===t,c=i.width,d=.55*c,g=i.x+(c-d)/2,y=new Map;if(u){let e=0;for(let t of h){let i=o.groups.get(t);i&&(e+=v(i.total))}let t=l,c=l;for(let u=0;h.length>u;u++){let m=h[u],f=o.groups.get(m);if(!f)continue;let b=v(f.total),x=u%2==0,w=x?t:c-b;x?t+=b:c-=b;let k=a(f.pieces[0],m),A=p.get(m)??f.total,S={...f.pieces[0],__funnelValue:f.total,__funnelPercent:A>0?f.total/A*100:0,__funnelStep:i.name,__funnelIsFirstStep:r,__aggregateValue:f.total,__pieceCount:f.pieces.length,category:m};s&&(0===u&&(S.__funnelStepLabel=i.name,S.__funnelStepLabelX=l,S.__funnelStepLabelY=g,S.__funnelRowWidth=e),S.__funnelValueLabelX=w+b/2,S.__funnelValueLabelY=g,S.__funnelBarW=b),n.push(Re(w,g,b,d,k,S,m)),y.set(m,{x:w,y:g,w:b,h:d})}}else{let e=o.stepTotal,t=v(e),c=l-t/2,u=h[0],m="_default"!==u,p=o.groups.get(u)?.pieces[0]??i.pieceData[0],b=m?u:i.name,x=a(p,b),w=f>0?e/f*100:0,k={...p,__funnelValue:e,__funnelPercent:w,__funnelStep:i.name,__funnelIsFirstStep:r,category:m?u:i.name};s&&(k.__funnelStepLabel=i.name,k.__funnelStepLabelX=l,k.__funnelStepLabelY=g,k.__funnelRowWidth=t,k.__funnelValueLabelX=l,k.__funnelValueLabelY=g,k.__funnelBarW=t),n.push(Re(c,g,t,d,x,k,b)),y.set(u,{x:c,y:g,w:t,h:d})}if(t>0&&x.size>0){let t=u?h:[h[0]];for(let r of t){let t=x.get(r),l=y.get(r);if(!t||!l)continue;let s=(()=>{let e=o.groups.get(r);return a(e?e.pieces[0]:i.pieceData[0],"_default"===r?i.name:r)})(),c={type:"trapezoid",points:[[t.x,t.y+t.h],[t.x+t.w,t.y+t.h],[l.x+l.w,l.y],[l.x,l.y]],style:{fill:s.fill||e.config.themeSemantic?.secondary||"#999",opacity:b,cursor:s.cursor},datum:o.groups.get(r)?.pieces[0]??i.pieceData[0],category:"_default"===r?i.name:r};n.push(c)}}x=y}return n},"bar-funnel":function(e,t){let{columns:o,getR:i,getStack:r,resolvePieceStyle:a,scales:n}=e,l=[],s=n.o.domain().map(e=>o[e]).filter(Boolean);if(0===s.length)return l;let c=[],h=new Set;for(let e of s)for(let t of e.pieceData){let e=r?r(t):"_default";h.has(e)||(h.add(e),c.push(e))}let d=c.length>1&&"_default"!==c[0],u=[];for(let e of s){let t=new Map,o=0;for(let a of e.pieceData){let e=r?r(a):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});let n=t.get(e),l=i(a);n.total+=l,n.pieces.push(a),o+=l}u.push({col:e,groups:t,stepTotal:o})}let m=new Map;for(let e of c){let t=u[0]?.groups.get(e);m.set(e,t?.total??0)}let g=n.r,p=d?c.length:1,f=d?.15:0;for(let e=0;u.length>e;e++){let t=u[e],o=t.col,i=0===e,r=e>0?u[e-1]:null,n=o.width/p,s=n*f,h=n-s;for(let e=0;c.length>e;e++){let u=c[e],p=t.groups.get(u);if(!p)continue;let f=p.total,y=m.get(u)??f,v=y>0?f/y*100:0,b=r?.groups.get(u)?.total??f,x=i?0:Math.max(0,b-f),w=o.x+e*n+s/2,k=g(f),A=g(0)-k,S=a(p.pieces[0],d?u:o.name),R={...p.pieces[0],__barFunnelValue:f,__barFunnelPercent:v,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:x,__barFunnelCategory:"_default"===u?void 0:u,category:d?u:o.name,__barFunnelLabelX:w+h/2,__barFunnelLabelY:g(f+x)};if(l.push(Re(w,k,h,A,S,R,d?u:o.name)),x>0){let e=g(f+x),t=k-e,i={...S},r={...p.pieces[0],__barFunnelValue:x,__barFunnelPercent:y>0?x/y*100:0,__barFunnelIsFirstStep:!1,__barFunnelIsDropoff:!0,__barFunnelStep:o.name,__barFunnelCategory:"_default"===u?void 0:u,category:d?u:o.name};l.push(Re(w,e,h,t,i,r,d?u:o.name))}}}return l},swimlane:function(e,t){let{scales:o,columns:i,getR:r,getStack:a,resolvePieceStyle:n}=e,{r:l,projection:s}=o,c=[],h="horizontal"===s,d=e.config.gradientFill,u=h?"left":"bottom",m=new Map,g=t=>{let o=m.get(t);if(void 0!==o)return o;let i="function"==typeof e.config.roundedTop?e.config.roundedTop(t.width):e.config.roundedTop,r="number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0;return m.set(t,r),r},p=e.config.trackFill;if(p){let e="string"==typeof p?p:p.color,t="string"==typeof p?1:p.opacity??1,[o,r]=l.range(),a=Math.min(o,r),n=Math.abs(r-o);for(let o of Object.values(i)){let i={fill:e,opacity:t},r=h?Re(a,o.x,n,o.width,i,null,"__track__"):Re(o.x,a,o.width,n,i,null,"__track__"),l=g(o);l>0&&(r.cornerRadii={tl:l,tr:l,br:l,bl:l}),c.push(r)}}for(let e of Object.values(i)){let t=0,o=c.length,i=g(e);for(let o of e.pieceData){let i=Math.abs(r(o));if(0===i)continue;let s,m=a?a(o):e.name,g=n(o,m);if(h){let r=l(t),a=l(t+i);s=Re(r,e.x,a-r,e.width,g,o,m)}else{let r=l(t+i),a=l(t);s=Re(e.x,r,e.width,a-r,g,o,m)}d&&(s.fillGradient=d,s.roundedEdge=u),c.push(s),t+=i}if(i>0&&c.length>o){let e=c.slice(o),t=e[0],r=e[e.length-1];1===e.length?t.cornerRadii={tl:i,tr:i,br:i,bl:i}:h?(t.cornerRadii={tl:i,bl:i},r.cornerRadii={tr:i,br:i}):(t.cornerRadii={bl:i,br:i},r.cornerRadii={tl:i,tr:i})}}return c}},_i=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Li=["scene-style","data-paint","accessibility","evidence"],Mi=(e,t)=>({retainedData:e,invalidations:t}),Ii=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ti=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Hi=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Bi=["scene-geometry","data-paint","accessibility","evidence"],Fi=["scene-style","data-paint","accessibility","evidence"],$i=[],Oi={chartType:Mi("rebuild",Ii),runtimeMode:Mi("rebuild",Ii),categoryAccessor:Mi("rebuild",Ii),valueAccessor:Mi("rebuild",Ii),oAccessor:Mi("rebuild",Ii),rAccessor:Mi("rebuild",Ii),stackBy:Mi("rebuild",Ii),groupBy:Mi("rebuild",Ii),timeAccessor:Mi("rebuild",Ii),accessorRevision:Mi("rebuild",Ii),colorAccessor:Mi("rebuild",Fi),symbolAccessor:Mi("rebuild",Bi),connectorAccessor:Mi("rebuild",Bi),dataIdAccessor:Mi("rebuild",Bi),projection:Mi("preserve",Ti),extentPadding:Mi("preserve",Ti),axisExtent:Mi("preserve",Ti),rExtent:Mi("preserve",Ti),oExtent:Mi("preserve",Ti),multiAxis:Mi("preserve",Ti),normalize:Mi("preserve",Ti),bins:Mi("preserve",Ti),oSort:Mi("preserve",Hi),barPadding:Mi("preserve",Hi),roundedTop:Mi("preserve",Hi),baselinePadding:Mi("preserve",Hi),innerRadius:Mi("preserve",Hi),cornerRadius:Mi("preserve",Hi),startAngle:Mi("preserve",Hi),sweepAngle:Mi("preserve",Hi),trackFill:Mi("preserve",Hi),showOutliers:Mi("preserve",Hi),showIQR:Mi("preserve",Hi),amplitude:Mi("preserve",Hi),connectorOpacity:Mi("preserve",Hi),showLabels:Mi("preserve",Hi),dynamicColumnWidth:Mi("rebuild",Hi),customLayout:Mi("preserve",Hi),layoutConfig:Mi("preserve",Hi),layoutMargin:Mi("preserve",Hi),symbolMap:Mi("preserve",Bi),pieceStyle:Mi("preserve",Fi),summaryStyle:Mi("preserve",Fi),connectorStyle:Mi("preserve",Fi),gradientFill:Mi("preserve",Fi),colorScheme:Mi("preserve",Fi),themeCategorical:Mi("preserve",Fi),themeSemantic:Mi("preserve",Fi),themeSequential:Mi("preserve",Fi),themeDiverging:Mi("preserve",Fi),barColors:Mi("preserve",Fi),decay:Mi("preserve",Fi),pulse:Mi("preserve",Fi),staleness:Mi("preserve",Fi),layoutSelection:Mi("preserve",Fi),windowSize:Mi("preserve",$i),windowMode:Mi("preserve",$i),clock:Mi("preserve",$i),transition:Mi("preserve",$i),introAnimation:Mi("preserve",$i),onLayoutError:Mi("preserve",$i)},Wi=Mi("preserve",Hi),Di=class{constructor(){this.tracker=new Wt}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},_i)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Li):this.recordNoop("restyle")}recordConfig(e){let t=function(e){let t="preserve",o=new Set;for(let i of e){let e=Oi[i]??Wi;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)o.add(t)}return{retainedData:t,invalidations:o}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};import{quadtree as Ni}from"d3-quadtree";var Ei=class{constructor(e){this.rExtent=new ve,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new Di,this.rAccessors=[],this.categories=new Set,this._hasStreamingData=!1,this.styleResolver=new Si,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.version=0,this._dataVersion=0,this._bufferArrayCache=null,this._pointQuadtree=null,this._maxPointRadius=0,this._datumIndexCache=null,this._categoryIndexCache=null,this._hasRenderedOnce=!1,this.config=e,this.buffer=new _e(e.windowSize),this.getO=Ge(e.categoryAccessor||e.oAccessor,"category");let t=e.valueAccessor||e.rAccessor;Array.isArray(t)?(this.rAccessors=t.map(e=>Ve(e,"value")),this.getR=this.rAccessors[0],this.rExtents=t.map(()=>new ve)):(this.getR=Ve(t,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=Ge(e.stackBy),this.getGroup=Ge(e.groupBy),this.getColor=Ge(e.colorAccessor),this.getSymbol=Ge(e.symbolAccessor),this.getConnector=Ge(e.connectorAccessor),this.getDataId=Ge(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new _e(e.windowSize))}syncPulseTimestampBuffer(){var e,t,o,i;this.timestampBuffer=(e=!!this.config.pulse,t=this.buffer,o=this.timestampBuffer,i=this.currentTime(),e?null!=o&&o.capacity===t.capacity&&o.size===t.size?o:Ie(t,i):null)}currentTime(){return this.config.clock?.()??io()}ingest(e){let t=this.currentTime();if(this.lastIngestTime=t,this._dataVersion++,e.bounded){this.buffer.clear(),this.rExtent.clear();for(let e of this.rExtents)e.clear();e.preserveCategoryOrder?this._hasStreamingData=!0:this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),Te(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(let o of e.inserts)Be(this.buffer,o,this.timestampBuffer,t),this.categories.add(this.getO(o)),this.pushValueExtent(o)}else{this._hasStreamingData=!0;for(let o of e.inserts){let e=Be(this.buffer,o,this.timestampBuffer,t);this.categories.add(this.getO(o)),this.pushValueExtent(o),null!=e&&this.evictValueExtent(e)}}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}pushValueExtent(e){if("timeline"===this.config.chartType){let t=this.getRawRange(e);t&&(this.rExtent.push(t[0]),this.rExtent.push(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].push(this.rAccessors[t](e));this.rExtent.push(this.getR(e))}else this.rExtent.push(this.getR(e))}evictValueExtent(e){if("timeline"===this.config.chartType){let t=this.getRawRange(e);t&&(this.rExtent.evict(t[0]),this.rExtent.evict(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].evict(this.rAccessors[t](e));this.rExtent.evict(this.getR(e))}else this.rExtent.evict(this.getR(e))}getRawRange(e){let t=this.config.valueAccessor||this.config.rAccessor;if(!t)return null;let o="function"==typeof t?t(e):e[t];return Array.isArray(o)&&o.length>=2?[+o[0],+o[1]]:null}computeScene(e){let{config:t,buffer:o}=this,i=this.scales,r=this.multiScales,a=this.columns;if(0===o.size)return this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,void this.version++;this.rExtent.dirty&&this.rExtent.recalculate(o,this.getR);let n,l,s=this.getBufferArray(),c=t.projection||"vertical",h=t.oExtent||this.resolveCategories(s),d=this.computeValueDomain(s,h),u="horizontal"===c,m="radial"===c,g=Math.min(.9,Math.max(0,null!=t.barPadding?t.barPadding/("vertical"===c?e.width:e.height):.1));if(m){n=ki().domain(h).range([0,1]).padding(0);let o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;l=Ai().domain(d).range([i,o])}else u?(n=ki().domain(h).range([0,e.height]).padding(g),l=Ai().domain(d).range([0,e.width])):(n=ki().domain(h).range([0,e.width]).padding(g),l=Ai().domain(d).range([e.height,0]));this.scales={o:n,r:l,projection:c},this.multiScales=this.rAccessors.length>1&&t.multiAxis?this.rAccessors.map((i,r)=>{let a=this.rExtents[r];a.dirty&&a.recalculate(o,i);let[n,l]=a.extent;n===1/0&&(n=0,l=1);let s=l-n,c=s>0?s*(t.extentPadding??.05):1;return n-=c,l+=c,n>0&&(n=0),u?Ai().domain([n,l]).range([0,e.width]):Ai().domain([n,l]).range([e.height,0])}):[];let p=s;this.rAccessors.length>1&&(p=s.flatMap(e=>this.rAccessors.map((t,o)=>({...e,__rIndex:o,__rValue:t(e),__rName:this.resolveRAccessorName(o)})))),this.columns=this.buildColumns(p,h,n,c,e),this._customLayoutFailedThisBuild=!1;let f=this.buildSceneNodes(p,e);this._customLayoutFailedThisBuild?!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=i,this.multiScales=r,this.columns=a):(this.scene=[],this.rebuildPointQuadtree()):(this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=f,this.rebuildPointQuadtree(),this.config.decay&&this.applyDecay(this.scene,s),this.config.pulse&&this.applyPulse(this.scene,s),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&this.prevPositionMap.size>0&&this.startTransition(),this.version++)}resolveRAccessorName(e){let t=this.config.valueAccessor||this.config.rAccessor,o=Array.isArray(t)?t[e]:t;return"string"==typeof o?o:"value"+e}resolveCategories(e){let t=this.config.oSort,o="streaming"===this.config.runtimeMode||this._hasStreamingData,i="auto"===t?void 0:t,r=null;if(o){r=new Set;for(let t of e)r.add(this.getO(t))}let a=r?Array.from(this.categories).filter(e=>r.has(e)):Array.from(this.categories);if(o&&void 0===i){let e=Math.max(50,3*r.size);if(this.categories.size>e){let t=this.categories.size-e;for(let e of this.categories){if(0>=t)break;r.has(e)||(this.categories.delete(e),t--)}}return a}if(!1===i)return a;if("function"==typeof i)return a.sort(i);let n=new Map;for(let t of e){let e=this.getO(t);n.set(e,(n.get(e)||0)+Math.abs(this.getR(t)))}return a.sort("asc"===i?(e,t)=>(n.get(e)||0)-(n.get(t)||0):(e,t)=>(n.get(t)||0)-(n.get(e)||0))}computeValueDomain(e,t){return function(e){let{data:t,chartType:o,projection:i,normalize:r,rExtent:a,extentPadding:n=.05,baselinePadding:l,axisExtent:s,getO:c,getR:h,getStack:d,rawRExtent:u}=e,m=n;if("radial"===i&&("pie"===o||"donut"===o))return[0,1];let g=0,p=0;if("bar"===o&&d&&r)g=0,p=1;else if("bar"===o&&d){let e=new Map,o=new Map;for(let i of t){let t=c(i),r=h(i);0>r?o.set(t,(o.get(t)||0)+r):e.set(t,(e.get(t)||0)+r)}for(let t of e.values())t>p&&(p=t);for(let e of o.values())g>e&&(g=e)}else if("bar"===o){let e=new Map;for(let o of t){let t=c(o),i=h(o);e.set(t,(e.get(t)||0)+i)}for(let t of e.values())t>p&&(p=t),g>t&&(g=t)}else if("swimlane"===o){let e=new Map;for(let o of t){let t=c(o),i=Math.abs(h(o));e.set(t,(e.get(t)||0)+i)}for(let t of e.values())t>p&&(p=t)}else if("clusterbar"===o||"bar-funnel"===o)for(let e of t){let t=h(e);t>p&&(p=t),g>t&&(g=t)}else{let e=u[0],t=u[1];e!==1/0&&(g=e),t!==-1/0&&(p=t)}a&&(null!=a[0]&&(g=a[0]),null!=a[1]&&(p=a[1]));let f="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(f&&(null!=a?.[0]||null!=a?.[1]||(g>0&&(g=0),0>p&&(p=0))),"bar-funnel"!==o&&"exact"!==s){let e=p-g,t=e>0?e*m:1,i=f&&!l&&0===g,r=f&&!l&&0===p||"swimlane"===o;null==a?.[0]&&!i&&(g-=t),null==a?.[1]&&!r&&(p+=t)}return[g,p]}({data:e,chartType:this.config.chartType,projection:this.config.projection,normalize:this.config.normalize,rExtent:this.config.rExtent,extentPadding:this.config.extentPadding,baselinePadding:this.config.baselinePadding,axisExtent:this.config.axisExtent,getO:this.getO,getR:this.getR,getStack:this.getStack,rawRExtent:this.rExtent.extent})}buildColumns(e,t,o,i,r){return function(e){let{data:t,oExtent:o,oScale:i,projection:r,layout:a,dynamicColumnWidth:n,getO:l,getR:s}=e,c=Object.create(null),h=new Map;for(let e of t){let t=l(e);h.has(t)||h.set(t,[]),h.get(t).push(e)}let d=0;if("radial"===r)for(let e of t)d+=Math.abs(s(e));let u=null;if(n&&"radial"!==r){u=new Map;let e=0;for(let t of o){let o,i=h.get(t)||[];o="string"==typeof n?i.reduce((e,t)=>e+(Number(t[n])||0),0):n(i),u.set(t,o),e+=o}let t=("horizontal"===r?a.height:a.width)-i.padding()*i.step()*o.length;if(e>0)for(let[o,i]of u)u.set(o,i/e*t)}let m=0,g=0;for(let e of o){let t,o,r=h.get(e)||[],a=r.reduce((e,t)=>e+Math.abs(s(t)),0),n=d>0?a/d:0;u?(t=g,o=u.get(e)||i.bandwidth(),g+=o+i.padding()*i.step()):(t=i(e)??0,o=i.bandwidth()),c[e]={name:e,x:t,y:0,width:o,middle:t+o/2,padding:i.padding()*i.step(),pieceData:r,pct:n,pctStart:m},m+=n}return c}({data:e,oExtent:t,oScale:o,projection:i,layout:r,dynamicColumnWidth:this.config.dynamicColumnWidth,getO:this.getO,getR:this.getR})}getSceneContext(){return{scales:this.scales,columns:this.columns,config:this.config,getR:this.getR,getStack:this.getStack,getGroup:this.getGroup,getColor:this.getColor,getSymbol:this.getSymbol,getConnector:this.getConnector,getO:this.getO,multiScales:this.multiScales,rAccessors:this.rAccessors,resolvePieceStyle:(e,t)=>this.styleResolver.resolvePieceStyle(this.config,e,t),resolveSummaryStyle:(e,t)=>this.styleResolver.resolveSummaryStyle(this.config,e,t),getRawRange:e=>this.getRawRange(e)}}buildSceneNodes(e,o){if(!this.scales)return[];if(this.config.customLayout){let t=this.buildLayoutContext(e,o),i=mt({family:"ordinal",logLabel:"ordinal customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:this.config.onLayoutError,run:()=>this.config.customLayout(t)});if("failure"===i.kind)return this.lastCustomLayoutFailure=i.diagnostic,this._customLayoutFailedThisBuild=!0,i.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);let r=i.result;this.customLayoutOverlays=r.overlays??null,this.lastCustomLayoutResult=r,this.lastCustomLayoutFailure=null;let a=r.nodes??[];if(this._customRestyle=r.restyle,this.hasCustomRestyle=!!r.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(let e of a)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(a,this.config.layoutSelection??null)}return xt({label:"ordinal customLayout",nodes:a,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),a}this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1;let i=this.getSceneContext(),r=Ci[this.config.chartType],a=r?r(i,o):[];return this.getConnector&&this.scales&&(a=[...t(i,a),...a]),a}buildLayoutContext(e,t){let o=this.config,i=o.layoutMargin??{top:0,right:0,bottom:0,left:0},r=St(o.colorScheme,o.themeCategorical,No),a=this.scales;return{data:e,scales:{o:a.o,r:a.r,projection:a.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:"radial"===a.projection?{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height}:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:o.themeSemantic??{},categorical:[...r]},resolveColor:At(r,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){let o=this.config.decay;return o&&t>1?et(o,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;let t=Ke(e);return this._datumIndexCache={version:this._dataVersion,map:t},t}getCategoryIndexMap(e){if(this._categoryIndexCache&&this._categoryIndexCache.version===this._dataVersion)return this._categoryIndexCache.map;let t=function(e,t){let o="function"==typeof t,i=o?null:t||"category",r=new Map;for(let a=0;e.length>a;a++){let n=e[a],l=o?t(n):n[i],s=r.get(l);s?s.push(a):r.set(l,[a])}return r}(e,this.config.categoryAccessor||this.config.oAccessor);return this._categoryIndexCache={version:this._dataVersion,map:t},t}rebuildPointQuadtree(){let e=function(e){let t=0,o=0;for(let i of e)"point"===i.type&&!1!==i.interactive&&(t++,i.r>o&&(o=i.r));if(500>=t)return{quadtree:null,maxRadius:o};let i=Array(t),r=0;for(let t of e)"point"===t.type&&!1!==t.interactive&&(i[r++]=t);return{maxRadius:o,quadtree:Ni().x(e=>e.x).y(e=>e.y).addAll(i)}}(this.scene);this._pointQuadtree=e.quadtree,this._maxPointRadius=e.maxRadius}get pointQuadtree(){return this._pointQuadtree}get maxPointRadius(){return this._maxPointRadius}applyDecay(e,t){if(!this.config.decay)return;let o=t.length;if(1>=o)return;let i=this.getDatumIndexMap(t);for(let t of e){if("connector"===t.type||"violin"===t.type||"boxplot"===t.type||"wedge"===t.type||!t.datum)continue;let e=i.get(t.datum);if(null==e)continue;let r=this.computeDecayOpacity(e,o);t.style={...t.style,opacity:(t.style?.opacity??1)*r}}}applyPulse(e,t,o=this.currentTime()){return!(!this.config.pulse||!this.timestampBuffer)&&function(e,t,o,i,r,a){let n=e.color??"rgba(255,255,255,0.6)",l=e.glowRadius??4,s=!1;for(let c of t){if("connector"===c.type||"violin"===c.type||"boxplot"===c.type)continue;if("wedge"===c.type){let t=c.category;if(!t)continue;let i=0;for(let n of r(t)??[]){let t=o.get(n);null!=t&&(i=Math.max(i,Me(e,t,a)))}s=$e(c,i,n)||s;continue}if(null==c.datum)continue;let t=i.get(c.datum);if(null==t)continue;let h=o.get(t),d=null==h?0:Me(e,h,a);s=$e(c,d,n,l)||s}return s}(this.config.pulse,e,this.timestampBuffer,this.getDatumIndexMap(t),e=>this.getCategoryIndexMap(t).get(e),o)}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&He(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}synthesizeIntroPositions(){this.prevPositionMap.clear();let e,t=new Map,o=this.scales?.r(0)??0,i="horizontal"!==this.scales?.projection;for(let r=0;this.scene.length>r;r++){let a=this.scene[r],n=this.getNodeKey(a,t);n&&("rect"===a.type?this.prevPositionMap.set(n,i?{x:a.x,y:o,w:a.w,h:0,opacity:a.style.opacity??1}:{x:o,y:a.y,w:0,h:a.h,opacity:a.style.opacity??1}):"point"===a.type?this.prevPositionMap.set(n,{x:a.x,y:a.y,r:0,opacity:0}):"wedge"===a.type&&(void 0===e&&(e=a.startAngle),this.prevPositionMap.set(n,{x:a.cx,y:a.cy,startAngle:e,endAngle:e,innerRadius:a.innerRadius,outerRadius:a.outerRadius,opacity:0})))}}getNodeKey(e,t){if("point"===e.type){let o=`p:${e.datum?this.getO(e.datum):""}:${e.datum?this.getR(e.datum):0}`,i=t.get(o)||0;return t.set(o,i+1),`${o}:${i}`}if("rect"===e.type){let o=e.datum?null!=e.datum.category&&""!==e.datum.category?e.datum.category+"":(this.getO(e.datum)??"")+"":"",i=`r:${e.group||""}:${o}`,r=t.get(i)||0;return t.set(i,r+1),0===r?i:`${i}:${r}`}return"wedge"===e.type?"w:"+(e.category??""):null}snapshotPositions(){this.prevPositionMap.clear();let e=new Map;for(let t=0;this.scene.length>t;t++){let o=this.scene[t],i=this.getNodeKey(o,e);i&&("point"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,r:o.r,opacity:o.style.opacity??o.style.fillOpacity}):"rect"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,w:o.w,h:o.h,opacity:o.style.opacity??o.style.fillOpacity}):"wedge"===o.type&&this.prevPositionMap.set(i,{x:o.cx,y:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius,opacity:o.style.opacity??1}))}}startTransition(){if(!this.config.transition||0===this.prevPositionMap.size)return;let e=this.config.transition.duration??300;if(this.exitNodes.length>0){let e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}let t=!1,o=new Set,i=new Map;for(let e=0;this.scene.length>e;e++){let r=this.scene[e],a=this.getNodeKey(r,i);if(!a)continue;r._transitionKey=a;let n=this.prevPositionMap.get(a);if("point"===r.type)n?(o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.x!==r.x||n.y!==r.y||void 0!==n.r&&n.r!==r.r)&&(r._targetX=r.x,r._targetY=r.y,r._targetR=r.r,r.x=n.x,r.y=n.y,void 0!==n.r&&(r.r=n.r),t=!0)):(r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r._targetR=r.r,r.r=0,r.style={...r.style,opacity:0},t=!0);else if("rect"===r.type)n?(o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.x!==r.x||n.y!==r.y||n.w!==r.w||n.h!==r.h)&&(r._targetX=r.x,r._targetY=r.y,r._targetW=r.w,r._targetH=r.h,r.x=n.x,r.y=n.y,r.w=n.w??r.w,r.h=n.h??r.h,t=!0)):(r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r.style={...r.style,opacity:0},t=!0);else if("wedge"===r.type)if(n)o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.startAngle!==r.startAngle||n.endAngle!==r.endAngle)&&(r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle,r.startAngle=n.startAngle,r.endAngle=n.endAngle,t=!0);else{r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle;let e=r.startAngle;r.startAngle=e,r.endAngle=e,r.style={...r.style,opacity:0},this.prevPositionMap.set(a,{x:r.cx,y:r.cy,startAngle:e,endAngle:e,innerRadius:r.innerRadius,outerRadius:r.outerRadius,opacity:0}),t=!0}}this.exitNodes=[];for(let[e,i]of this.prevPositionMap)if(!o.has(e)){if(e.startsWith("p:"))this.exitNodes.push({type:"point",x:i.x,y:i.y,r:i.r??3,style:{opacity:i.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))this.exitNodes.push({type:"rect",x:i.x,y:i.y,w:i.w??0,h:i.h??0,style:{opacity:i.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("w:")){let t=((i.startAngle??0)+(i.endAngle??0))/2,o={type:"wedge",cx:i.x,cy:i.y,innerRadius:i.innerRadius??0,outerRadius:i.outerRadius??100,startAngle:i.startAngle??0,endAngle:i.endAngle??0,style:{opacity:i.opacity??1},datum:null,category:e.slice(2),_targetStartAngle:t,_targetEndAngle:t,_targetOpacity:0,_transitionKey:e};this.exitNodes.push(o)}t=!0}this.exitNodes.length>0&&(this.scene=[...this.scene,...this.exitNodes]),t&&(this.activeTransition={startTime:this.currentTime(),duration:e})}advanceTransition(e){if(!this.activeTransition)return!1;let t=Gt(e,this.activeTransition),o=Vt(t,"linear"===this.config.transition?.easing?"linear":"ease-out-cubic");for(let e of this.scene){let t=e._transitionKey;if(t)if("point"===e.type){if(void 0!==e._targetOpacity){let i=this.prevPositionMap.get(t);e.style.opacity=Jt(i?i.opacity??1:0,e._targetOpacity,o)}let i=this.prevPositionMap.get(t);void 0!==e._targetX&&i&&(e.x=Jt(i.x,e._targetX,o),e.y=Jt(i.y,e._targetY,o)),void 0!==e._targetR&&void 0!==i?.r&&(e.r=Jt(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){let i=this.prevPositionMap.get(t);e.style.opacity=Jt(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX)continue;let i=this.prevPositionMap.get(t);if(!i)continue;e.x=Jt(i.x,e._targetX,o),e.y=Jt(i.y,e._targetY,o),void 0!==i.w&&(e.w=Jt(i.w,e._targetW,o),e.h=Jt(i.h,e._targetH,o))}else if("wedge"===e.type){if(void 0!==e._targetOpacity){let i=this.prevPositionMap.get(t);e.style={...e.style,opacity:Jt(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0!==e._targetStartAngle&&void 0!==e._targetEndAngle){let i=this.prevPositionMap.get(t);i&&void 0!==i.startAngle&&(e.startAngle=Jt(i.startAngle,e._targetStartAngle,o),e.endAngle=Jt(i.endAngle,e._targetEndAngle,o))}}}if(t>=1){for(let e of this.scene)if(void 0!==e._targetOpacity&&(e.style={...e.style||{},opacity:0===e._targetOpacity?0:e._targetOpacity},e._targetOpacity=void 0),"point"===e.type){if(void 0===e._targetX&&void 0===e._targetR)continue;void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY),void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0);if(this.exitNodes.length>0){let e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}return this.activeTransition=null,!1}return!0}cancelIntroAnimation(){this.prevPositionMap.clear(),this.activeTransition=null,ke(this.scene),this.exitNodes=[]}getBufferArray(){return this._bufferArrayCache?.version!==this._dataVersion&&(this._bufferArrayCache={version:this._dataVersion,data:this.buffer.toArray()}),this._bufferArrayCache.data}getData(){return this.buffer.toArray()}remove(e){if(!this.getDataId)throw Error("remove() requires dataIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();let t=Se(e),o=this.getDataId,i=e=>t.has(o(e));Le(this.buffer,this.timestampBuffer,i);let r=this.buffer.remove(i);if(0===r.length)return this.updateResults.recordNoop("remove"),r;for(let e of r)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach(e=>this.categories.add(this.getO(e))),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length),r}update(e,t){if(!this.getDataId)throw Error("update() requires dataIdAccessor to be configured");let o=Se(e),i=this.getDataId,r=new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&r.add(t)});let a=this.buffer.update(e=>o.has(i(e)),t);if(0===a.length)return this.updateResults.recordNoop("update"),a;for(let e of a)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),r.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",a.length),a}clear(){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this._hasStreamingData=!1,this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.columns={},this.multiScales=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._pointQuadtree=null,this._maxPointRadius=0,this.styleResolver.resetColors(),this._dataVersion++,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getOAccessor(){return this.getO}getRAccessor(){return this.getR}applyCustomRestyle(e,t){let o=this._customRestyle;if(o)for(let i of e){let e=this._baseStyles.get(i)??i.style??{},r=o(i,t);i.style=r?{...e,...r}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}rebuildAccessorDerivedState(){this.categories.clear(),this.rExtent.clear();for(let e of this.rExtents)e.clear();this._categoryIndexCache=null,this.buffer.forEach(e=>{this.categories.add(this.getO(e)),this.pushValueExtent(e)})}updateConfig(e){let t={...this.config},o=Object.keys(e).filter(o=>e[o]!==t[o]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e&&e.colorScheme!==t.colorScheme||"themeCategorical"in e&&e.themeCategorical!==t.themeCategorical||"colorAccessor"in e&&!ze(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!ze(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!ze(e.oAccessor,t.oAccessor))&&(this._categoryIndexCache=null),Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let i=!1;("categoryAccessor"in e||"oAccessor"in e)&&(ze(this.config.categoryAccessor||this.config.oAccessor,t.categoryAccessor||t.oAccessor)||(this.getO=Ge(this.config.categoryAccessor||this.config.oAccessor,"category"),i=!0));let r=!1;if("valueAccessor"in e||"rAccessor"in e){let e=this.config.valueAccessor||this.config.rAccessor,o=t.valueAccessor||t.rAccessor,i=Array.isArray(e)?e:[e],a=Array.isArray(o)?o:[o];if(r=i.length!==a.length||i.some((e,t)=>!ze(e,a[t])),r){let e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>Ve(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new ve)):(this.getR=Ve(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!ze(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?Ge(this.config.stackBy):void 0),"groupBy"in e&&!ze(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?Ge(this.config.groupBy):void 0),"colorAccessor"in e&&!ze(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?Ge(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!ze(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?Ge(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!ze(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?Ge(this.config.connectorAccessor):void 0),(i||r||"accessorRevision"in e&&e.accessorRevision!==t.accessorRevision)&&this.rebuildAccessorDerivedState(),this.updateResults.recordConfig(o)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};Xe(Ei);import{useCallback as ji,useImperativeHandle as zi}from"react";import{useMemo as Vi,useRef as Gi,useId as qi}from"react";import{Fragment as Xi,jsx as Yi,jsxs as Qi}from"react/jsx-runtime";import*as Ki from"react";import{jsx as Zi}from"react/jsx-runtime";var Ui=null,Ji=null;import{arc as er}from"d3-shape";var tr=(e,t)=>({x:e*Math.cos(t),y:e*Math.sin(t)}),or=(e,t,o,i)=>{let r=t.filter(e=>"wedge"===e.type);for(let t of r){let o=t.style.strokeWidth??1,i=t.style.stroke,r=!(!i||"none"===i||0>=o);if(e.globalAlpha=(t.style.fillOpacity??1)*(t.style.opacity??1),t._gradientBand&&t._gradientBand.colors.length>0)L(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(M(e,t),kt(e,t)),e.globalAlpha=1;else{if(e.fillStyle=ci(e,t.style.fill,"#007bff"),t.roundedEnds){r&&(e.strokeStyle=si(e,i)||i,e.lineWidth=o);let a=C({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds.start,roundEnd:t.roundedEnds.end});e.save(),e.translate(t.cx,t.cy);let n=new Path2D(a);e.fill(n),r&&e.stroke(n),e.restore()}else t.cornerRadius?(r&&(e.strokeStyle=si(e,i)||i,e.lineWidth=o),I(e,t)):(M(e,t),e.fill(),r&&(e.strokeStyle=si(e,i)||i,e.lineWidth=o,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(M(e,t),kt(e,t)),e.globalAlpha=1}}},ir=(e,t,o,i)=>{let r=t.filter(e=>"boxplot"===e.type);for(let t of r){let o=t.columnWidth/2,i="vertical"===t.projection,r=si(e,"var(--semiotic-primary, #007bff)"),a=si(e,"var(--semiotic-text, #333)"),n=ci(e,t.style.fill,r),l=t.style.stroke,s="string"==typeof l?si(e,l)||l:a,c=t.style.strokeWidth??1,h=c>0&&!("string"==typeof l&&"none"===l.trim().toLowerCase()),d=t.style.fillOpacity??t.style.opacity??.6;if(e.save(),h&&(e.strokeStyle=s,e.lineWidth=c,e.beginPath(),i?(e.moveTo(t.x,t.minPos),e.lineTo(t.x,t.maxPos)):(e.moveTo(t.minPos,t.y),e.lineTo(t.maxPos,t.y)),e.stroke(),e.beginPath(),i?(e.moveTo(t.x-.4*o,t.minPos),e.lineTo(t.x+.4*o,t.minPos),e.moveTo(t.x-.4*o,t.maxPos),e.lineTo(t.x+.4*o,t.maxPos)):(e.moveTo(t.minPos,t.y-.4*o),e.lineTo(t.minPos,t.y+.4*o),e.moveTo(t.maxPos,t.y-.4*o),e.lineTo(t.maxPos,t.y+.4*o)),e.stroke()),e.globalAlpha=d,e.fillStyle=n,i){let i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(t.x-o,i,t.columnWidth,r),e.globalAlpha=1,h&&e.strokeRect(t.x-o,i,t.columnWidth,r)}else{let i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(i,t.y-o,r,t.columnWidth),e.globalAlpha=1,h&&e.strokeRect(i,t.y-o,r,t.columnWidth)}h&&(e.strokeStyle=s,e.lineWidth=2*c,e.beginPath(),i?(e.moveTo(t.x-o,t.medianPos),e.lineTo(t.x+o,t.medianPos)):(e.moveTo(t.medianPos,t.y-o),e.lineTo(t.medianPos,t.y+o)),e.stroke()),e.restore()}},rr=new WeakMap,ar=(e,t,o,i)=>{for(let o of t){if("violin"!==o.type)continue;e.save(),(o.translateX||o.translateY)&&e.translate(o.translateX,o.translateY);let t=rr.get(o);(!t||t.source!==o.pathString)&&(t={source:o.pathString,path:new Path2D(o.pathString)},rr.set(o,t));let i=t.path;e.globalAlpha=o.style.fillOpacity??o.style.opacity??.6,e.fillStyle=ci(e,o.style.fill,"#007bff"),e.fill(i),e.globalAlpha=1;let r=o.style.strokeWidth??1;if(o.style.stroke&&"none"!==o.style.stroke&&r>0&&(e.strokeStyle=si(e,o.style.stroke)||o.style.stroke,e.lineWidth=r,e.stroke(i)),o.iqrLine){e.strokeStyle="#333",e.lineWidth=2,e.globalAlpha=.8;let t=o.iqrLine.centerPos,i=!1!==o.iqrLine.isVertical;e.beginPath(),i?(e.moveTo(t,o.iqrLine.q1Pos),e.lineTo(t,o.iqrLine.q3Pos)):(e.moveTo(o.iqrLine.q1Pos,t),e.lineTo(o.iqrLine.q3Pos,t)),e.stroke(),e.beginPath(),i?e.arc(t,o.iqrLine.medianPos,3,0,2*Math.PI):e.arc(o.iqrLine.medianPos,t,3,0,2*Math.PI),e.fillStyle="#fff",e.fill(),e.strokeStyle="#333",e.lineWidth=1,e.stroke(),e.globalAlpha=1}e.restore()}},nr=(e,t,o,i)=>{let r=t.filter(e=>"connector"===e.type);if(0===r.length)return;let a=new Map;for(let e of r){let t=e.group||"_default";a.has(t)||a.set(t,[]),a.get(t).push(e)}for(let[,t]of a){if(0===t.length)continue;let o=t[0].style;if(o.fill&&"none"!==o.fill){e.beginPath(),e.moveTo(t[0].x1,t[0].y1);for(let o of t)e.lineTo(o.x2,o.y2);e.closePath(),e.globalAlpha=o.fillOpacity??o.opacity??.3,e.fillStyle=ei(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(let o of t){let t=o.style.strokeWidth??1;0>=t||"none"===o.style.stroke||(e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=si(e,o.style.stroke)||ci(e,o.style.fill,"")||si(e,"var(--semiotic-border, #999)"),e.lineWidth=t,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1)}}},lr=(e,t,o,i)=>{let r=t.filter(e=>"trapezoid"===e.type);for(let t of r){let o=t.points;if(4>o.length)continue;e.globalAlpha=t.style?.opacity??1,e.beginPath(),e.moveTo(o[0][0],o[0][1]);for(let t=1;o.length>t;t++)e.lineTo(o[t][0],o[t][1]);e.closePath(),e.fillStyle=ei(e,t.style?.fill)||"#999",e.fill();let i=t.style?.strokeWidth??1;t.style?.stroke&&"none"!==t.style.stroke&&i>0&&(e.strokeStyle=si(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.stroke()),e.globalAlpha=1}},sr=new Map,cr=D(fe),hr=D(De),dr=D(Ne),ur=D(Ee),mr=e=>[nr,...e],gr={bar:mr([cr]),clusterbar:mr([cr]),point:mr([hr,dr]),swarm:mr([hr,dr]),pie:[or],donut:[or],boxplot:mr([ir,hr]),violin:mr([ar]),histogram:mr([cr]),ridgeline:mr([ar]),timeline:mr([cr]),funnel:[cr,lr,(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&null!=e.datum);if(0===r.length||!r.some(e=>null!=e.datum?.__funnelStepLabel||null!=e.datum?.__funnelValueLabelX))return;let a=si(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif";e.textBaseline="top",e.lineJoin="round",e.textAlign="center",e.font="bold 14px "+a;for(let t of r){let o=t.datum;if(!o||!o.__funnelStepLabel)continue;let i=o.__funnelStepLabel;if(e.measureText(i).width+16>(o.__funnelRowWidth??o.__funnelBarW??0))continue;let r=o.__funnelStepLabelX,a=o.__funnelStepLabelY+3;e.strokeStyle="rgba(0,0,0,0.6)",e.lineWidth=3,e.strokeText(i,r,a),e.fillStyle="#fff",e.fillText(i,r,a)}e.font="bold 13px "+a;for(let t of r){let o=t.datum;if(!o||null==o.__funnelValueLabelX)continue;let i=o.__funnelBarW??0;if(60>i)continue;let r=o.__funnelValue;if(null==r||0===r)continue;let a,n=o.__funnelPercent,l=!0===o.__funnelIsFirstStep;if(a=l?T(r):null!=n?`${T(r)} (${H(n)})`:T(r),e.measureText(a).width+16>i){if(l||null==n)continue;if(a=T(r),e.measureText(a).width+16>i)continue}let s=o.__funnelValueLabelX,c=(o.__funnelValueLabelY??t.y)+14+5;e.textAlign="center",e.strokeStyle="rgba(0,0,0,0.5)",e.lineWidth=3,e.strokeText(a,s,c),e.fillStyle="#fff",e.fillText(a,s,c)}e.lineWidth=1,e.lineJoin="miter"}],"bar-funnel":[cr,(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(let t of r){let o=("string"==typeof t.style.fill?t.style.fill:null)||si(e,"var(--semiotic-border, #999)"),i=B(o,e);e.globalAlpha=t.style.opacity??1,e.beginPath(),e.rect(t.x,t.y,t.w,t.h),i?e.fillStyle=i:(e.fillStyle=o,e.globalAlpha=.4*(t.style.opacity??1)),e.fill(),e.globalAlpha=1}},(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===r.length)return;let a=si(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif",n=function(e,t){let[o,i,r]=li(e,t);return(.2126*o+.7152*i+.0722*r)/255>.6}(e,si(e,"var(--semiotic-text, #333)")),l=n?"#1f2937":"#ffffff",s=n?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)",c=n?"#f3f4f6":"#1a1a1a",h=c;for(let t of r){let o=t.datum;if(!o)continue;let i=o.__barFunnelValue;if(null==i||25>t.w)continue;let r=o.__barFunnelPercent,n=!(!0===o.__barFunnelIsFirstStep)&&null!=r,d=n?O(r):"",u=$(i);e.font="bold 13px "+a;let m=n?e.measureText(d).width:0;e.font="11px "+a;let g=e.measureText(u).width,p=Math.max(m,g)+12,f=n?32:17,y=o.__barFunnelLabelX,v=y-p/2,b=o.__barFunnelLabelY-f-4;e.save(),e.shadowColor="rgba(0,0,0,0.15)",e.shadowBlur=4,e.shadowOffsetY=1,e.fillStyle=l,e.beginPath(),F(e,v,b,p,f,4),e.fill(),e.restore(),e.strokeStyle=s,e.lineWidth=.5,e.beginPath(),F(e,v,b,p,f,4),e.stroke(),e.textAlign="center",e.textBaseline="top",n?(e.font="bold 13px "+a,e.fillStyle=c,e.fillText(d,y,b+3),e.font="11px "+a,e.fillStyle=h,e.fillText(u,y,b+3+13+2)):(e.font="bold 11px "+a,e.fillStyle=c,e.fillText(u,y,b+3))}e.lineWidth=1}],swimlane:mr([cr]),custom:mr([cr,hr,dr,ur,or,ir,ar,lr])};import*as pr from"react";import*as fr from"react";import{arc as yr}from"d3-shape";import{jsx as vr,jsxs as br}from"react/jsx-runtime";import{jsx as xr,jsxs as wr}from"react/jsx-runtime";import{jsx as kr,jsxs as Ar}from"react/jsx-runtime";X.ownsChrome=!0;import{jsx as Sr,jsxs as Rr}from"react/jsx-runtime";var Pr=je,Cr=fi(pi(function(t,o){let{chartType:i,runtimeMode:r,data:a,oAccessor:n="category",rAccessor:l="value",colorAccessor:s,symbolAccessor:c,symbolMap:h,stackBy:d,groupBy:u,multiAxis:m,timeAccessor:g,valueAccessor:p,categoryAccessor:f,accessorRevision:y,projection:v="vertical",size:b=[600,400],responsiveWidth:x,responsiveHeight:w,margin:C,maxDevicePixelRatio:_,barPadding:L,roundedTop:M,gradientFill:I,trackFill:T,baselinePadding:H,innerRadius:B,cornerRadius:F,normalize:$,startAngle:O,sweepAngle:W,dynamicColumnWidth:D,bins:N,showOutliers:E,showIQR:j,amplitude:z,connectorOpacity:V,showLabels:q,connectorAccessor:Y,connectorStyle:Q,dataIdAccessor:K,rExtent:Z,oExtent:U,extentPadding:J=.05,oSort:ee,windowMode:te="sliding",windowSize:oe=200,pieceStyle:ie,summaryStyle:re,renderMode:ae,colorScheme:ne,barColors:le,showAxes:se=!0,showCategoryTicks:ce,categoryLabel:he,valueLabel:de,categoryFormat:ue,valueFormat:me,oLabel:ge,rLabel:pe,oFormat:fe,rFormat:ve,rTickValues:ke,tickLabelEdgeAlign:Ae,axisExtent:Se,enableHover:Re=!0,hoverRadius:Pe=30,hoverAnnotation:_e,tooltipContent:Le,customHoverBehavior:Me,customClickBehavior:Ie,onObservation:Te,annotationObservationCallback:He,chartId:Be,annotations:$e,onAnnotationActivate:De,autoPlaceAnnotations:Ne,svgAnnotationRules:Ee,showGrid:je=!1,legend:ze,legendHoverBehavior:Ve,legendClickBehavior:Ge,legendHighlightedCategory:Xe,legendIsolatedCategories:Ye,legendPosition:Qe,legendLayout:Ke,legendCategoryAccessor:Ze,onCategoriesChange:Ue,backgroundGraphics:et,foregroundGraphics:tt,title:ot,className:it,background:rt,centerContent:at,decay:nt,pulse:lt,transition:st,animate:ct,staleness:dt,frameScheduler:mt,clock:xt,random:kt,seed:At,paused:St=!1,suspendWhenHidden:Rt=!0,brush:Mt,onBrush:Ht,accessibleTable:Bt=!0,description:Wt,summary:Dt,customLayout:Nt,onLayoutError:Et,layoutConfig:jt,layoutSelection:Vt}=t,{customHoverBehavior:Gt,customClickBehavior:qt,hasClickBehavior:Xt}=We({customHoverBehavior:Me,customClickBehavior:Ie,onObservation:Te,chartId:Be,chartType:"StreamOrdinalFrame"}),Kt=f??n,Jt=p??l,eo=he??ge,to=de??pe,oo=ue??fe,io=me??ve,ro=xi(!0),no=Lo({sizeProp:b,responsiveWidth:x,responsiveHeight:w,userMargin:C,marginDefault:Pr,title:ot,legend:ze,legendPosition:Qe,...xe(t,ze),animate:ct,transitionProp:st,frameScheduler:mt,clock:xt,random:kt,seed:At,paused:St,suspendWhenHidden:Rt,themeDirtyRef:ro}),{reducedMotionRef:so,responsiveRef:co,size:ho,margin:uo,adjustedWidth:mo,adjustedHeight:go,currentTheme:po,transition:fo,introEnabled:yo,tableId:xo,rafRef:wo,renderFnRef:ko,scheduleRender:So,frameRuntime:Ro}=no;vi(()=>hi(()=>{ro.current=!0,So()}),[So]);let Co=Io(),_o=$o(),Ho=bi(()=>Yt(a),[a]),Bo=xi(null),Fo=xi(!1),[Oo,Wo]=wi(null),[Do,No]=wi(null),Eo=ut(tt,ho,uo,Do),jo=ut(et,ho,uo,Do),zo=et||"transparent"===rt?null:Sr("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-uo.left,y:-uo.top,width:ho[0],height:ho[1],fill:rt||"var(--semiotic-bg, transparent)"}),Vo=et&&rt&&"transparent"!==rt?Sr("rect",{className:"semiotic-canvas-background semiotic-canvas-background--combined","data-semiotic-layer":"canvas-background",x:-uo.left,y:-uo.top,width:ho[0],height:ho[1],fill:rt}):null,[Go,qo]=wi(0),Xo=xi(0),[Yo,Qo]=wi(!1),Ko=xi({w:-1,h:-1}),Uo=xi(!1),Jo=To("StreamOrdinalFrame"),ei=Re||_e,ti="streaming"===r,oi=bi(()=>({chartType:i,runtimeMode:ti?"streaming":"bounded",windowSize:oe,windowMode:te,extentPadding:J,projection:v,oAccessor:ti?void 0:Kt,rAccessor:ti?void 0:Jt,accessorRevision:y,colorAccessor:s,symbolAccessor:c,symbolMap:h,stackBy:d,groupBy:u,multiAxis:m,timeAccessor:ti?g:void 0,valueAccessor:ti?p||("string"==typeof Jt||"function"==typeof Jt?Jt:void 0):void 0,categoryAccessor:ti?Kt:void 0,rExtent:Z,oExtent:U,axisExtent:Se,barPadding:L,roundedTop:M,gradientFill:Ce(I),trackFill:T,baselinePadding:H,innerRadius:B,cornerRadius:F,normalize:$,startAngle:O,sweepAngle:W,dynamicColumnWidth:D,bins:N,showOutliers:E,showIQR:j,amplitude:z,connectorOpacity:V,showLabels:q,connectorAccessor:Y,connectorStyle:Q,dataIdAccessor:K,oSort:ee,pieceStyle:ie,summaryStyle:re,colorScheme:ne,themeCategorical:po?.colors?.categorical,themeSemantic:Zo(po),themeSequential:po?.colors?.sequential,themeDiverging:po?.colors?.diverging,barColors:le,decay:nt,pulse:lt,transition:fo,introAnimation:yo,staleness:dt,clock:Ro.now,customLayout:Nt,onLayoutError:Et,layoutConfig:jt,layoutMargin:uo}),[i,ti,oe,te,J,v,Kt,Jt,y,s,c,h,d,u,m,g,p,Z,U,Se,L,M,I,T,H,B,F,$,O,W,D,N,E,j,z,V,q,Y,Q,K,ee,ie,re,ne,po,le,nt,lt,fo,yo,dt,Ro.now,Nt,Et,jt,uo]),ii=vt(oi),ri=xi(null);ri.current||(ri.current=new Ei(ii));let ai=yt(ri,Ze,Ue,e=>e.getData());pt(ri,ii,ro,So),ft(ri,Vt,ro,So);let ni=xi(null);ni.current||(ni.current=new ye(e=>{let t=ri.current;t&&t.ingest(e)&&(ro.current=!0,So())})),function(e,{storeRef:t,adapterRef:o,dirtyRef:i,scheduleRender:r,hoverRef:a,setHoverPoint:n}){let l=ji(e=>{o.current?.push(e)},[o]),s=ji(e=>{o.current?.pushMany(e)},[o]),c=ji(()=>{o.current?.clear(),t.current?.clear(),i.current=!0,r()},[o,t,i,r]),h=ji(e=>{o.current?.clearLastData(),o.current?.setReplacementData(e)},[o]);zi(e,()=>({push:l,pushMany:s,replace:h,remove:e=>{o.current?.flush();let l=t.current?.remove(e)??[];if(l.length>0){let e=a.current?.data;a.current&&l.some(Array.isArray(e)?t=>e.includes(t):t=>t===e)&&(a.current=null,n(null)),i.current=!0,r()}return l},update:(e,a)=>{o.current?.flush();let n=t.current?.update(e,a)??[];return n.length>0&&(i.current=!0,r()),n},clear:c,getData:()=>(o.current?.flush(),t.current?.getData()??[]),getScales:()=>t.current?.scales??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null}),[l,s,h,c,r,o,t,i,a,n])}(o,{storeRef:ri,adapterRef:ni,dirtyRef:ro,scheduleRender:So,hoverRef:Bo,setHoverPoint:Wo}),vi(()=>{a&&ni.current?.setBoundedData(Ho)},[a,Ho]);let{canvasRef:li,resolutionDirtyRef:si}=Mo(no,{storeRef:ri,dirtyRef:ro,hydrated:Co,wasHydratingFromSSR:_o,cleanup:()=>ni.current?.clear(),maxDevicePixelRatio:_,canvasPaintDependencies:[i,mo,go,se,rt,et,ae,So]}),{hoverHandlerRef:ci,hoverLeaveRef:di,onPointerMove:ui,onPointerLeave:mi,pointerStateRef:gi}=no;ci.current=e=>{let t=li.current;if(!t)return;let o=ri.current;if(!o)return void bo(t);let r=k({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:uo.left,top:uo.top},width:mo,height:go,projection:v,hoverRadius:Pe,scene:o.scene,pointQuadtree:o.pointQuadtree,maxPointRadius:o.maxPointRadius});if(bo(t,"hit"===r.kind?vo(r.hit.node):void 0),!ei)return;if("hit"!==r.kind)return void(Bo.current&&(Bo.current=null,Wo(null),Gt&&Gt(null),So()));let a=A(r.hit,{oAccessor:Kt,rAccessor:Jt,chartType:i});Bo.current=a,Wo(a),Gt?.(a),So()},di.current=()=>{bo(li.current),Bo.current&&(Bo.current=null,Wo(null),Gt?.(null),So())},Po(li);let pi=yi(e=>{if(Zt(e.target)||!qt)return;let t=li.current;if(!t)return qt(null),void So();let o=ri.current;if(!o)return qt(null),void So();let r=k({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:uo.left,top:uo.top},width:mo,height:go,projection:v,hoverRadius:Pe,scene:o.scene,pointQuadtree:o.pointQuadtree,maxPointRadius:o.maxPointRadius});if("hit"!==r.kind)return qt(null),void So();qt(A(r.hit,{oAccessor:Kt,rAccessor:Jt,chartType:i}),{type:"activate",inputType:ao(e.nativeEvent.pointerType)}),So()},[qt,li,uo.left,uo.top,mo,go,v,Pe,Kt,Jt,i,So]),{kbFocusIndexRef:fi,focusedNavPointRef:ki,onKeyDown:Ai}=Oe({storeRef:ri,hoverRef:Bo,setHoverPoint:Wo,customHoverBehavior:Gt,customClickBehavior:qt,scheduleRender:So,chartType:i,oAccessor:Kt,rAccessor:Jt}),Si=yi(e=>{gt(gi,e,!!ei,Fo.current,li.current,"mouse")&&(fi.current=-1,ki.current=null,ui(e))},[li,ei,ki,fi,ui,gi]);ko.current=()=>{if(wo.current=null,!Ro.isActive)return;let e=li.current;if(!e)return;let t=e.getContext("2d");if(!t)return;let o=ri.current;if(!o)return;let r=Ro.now(),a=null!=o.activeTransition,n=o.advanceTransition(so.current?r+1e6:r),l=!so.current&&n,s=Ko.current.w!==mo||Ko.current.h!==go,c=ro.current,h=o.consumeStylePaintPending(),d=!1,u=Jo.current.beforeCompute(o.getLastUpdateResult(),l);var m;(c||s)&&(!l||s)&&(o.computeScene({width:mo,height:go}),Ko.current={w:mo,h:go},d=!0,ai()),(d||h)&&(Fo.current=Ao(e,o.scene)),Fo.current&&(a||d||h)&&lo((m={canvas:e,pointer:gi.current,store:o,margin:{left:uo.left,top:uo.top},width:mo,height:go,projection:v,hoverRadius:Pe,geometryMoved:a||d}).canvas,m.pointer,e=>{let t=k({pointer:e,canvasRect:m.canvas.getBoundingClientRect(),margin:m.margin,width:m.width,height:m.height,projection:m.projection,hoverRadius:m.hoverRadius,scene:m.store.scene,pointQuadtree:m.geometryMoved?null:m.store.pointQuadtree,maxPointRadius:m.store.maxPointRadius});return"hit"===t.kind?vo(t.hit.node):void 0}),Jo.current.afterCompute(u,d,s),ro.current=c&&l&&!d,si.current=!1;let g=Fe(o,r,d,Uo);(d||l)&&e.setAttribute("aria-label",zt(o.scene,i+" chart"));let p=Qt(_,ho),f=ho[0]*p,y=ho[1]*p;(e.width!==f||e.height!==y)&&(e.width=f,e.height=y,e.style.width=ho[0]+"px",e.style.height=ho[1]+"px"),t.setTransform(p,0,0,p,0,0),t.clearRect(0,0,ho[0],ho[1]);let b=dt&&o.lastIngestTime>0&&r-o.lastIngestTime>(dt?.threshold??5e3);b&&(t.globalAlpha=dt?.dimOpacity??.5);let x="radial"===v;t.save(),t.beginPath(),t.rect(uo.left,uo.top,mo,go),t.clip(),x?(t.save(),t.translate(uo.left+mo/2,uo.top+go/2)):t.translate(uo.left,uo.top);let w=Nt?gr.custom:gr[i]||[],A={width:mo,height:go},S=o.scales;S&&ht({context:t,nodes:o.scene,renderMode:ae,pixelRatio:p,paintBuiltIn:e=>{for(let o of w)o(t,e,S,A)}}),x&&t.restore(),t.restore(),b&&(t.globalAlpha=1),d&&o.scales?(No(o.scales),qo(e=>e+1),Xo.current=r):l&&o.scales&&r-Xo.current>=33&&(qo(e=>e+1),Xo.current=r),dt?.showBadge&&Qo(!!b),(l||null!=o.activeTransition||g.pending)&&So()},bt(dt,ri,ro,So,Ro.now,Yo,Qo);let Ri=ei&&Oo?Le?Le(Oo):Sr(X,{hover:Oo}):null,Pi="radial"===v,Ci=Ri?Sr(It,{x:Oo?Pi?Oo.x+mo/2:Oo.x:0,y:Oo?Pi?Oo.y+go/2:Oo.y:0,containerWidth:mo,containerHeight:go,margin:uo,className:"stream-ordinal-tooltip",children:Ri}):null,_i="horizontal"===v?Kt:Jt,Li=we("horizontal"===v?Jt:Kt,void 0,"__semiotic_resolvedO",""),Mi=we(_i,void 0,"__semiotic_resolvedR",""),Ii=Li.key,Ti=Mi.key,Hi=be(Li,Mi,$e&&$e.length>0||!1);if(Ut||!Co&&_o){let t=ri.current;t&&a&&(t.ingest({inserts:Ho,bounded:!0}),t.computeScene({width:mo,height:go}));let o=t?.scene??[],i=t?.scales??null,r=ut(tt,ho,uo,i),n=ut(et,ho,uo,i),l="radial"===v,s=l?uo.left+mo/2:uo.left,c=l?uo.top+go/2:uo.top;return Rr("div",{ref:co,className:"stream-ordinal-frame"+(it?" "+it:""),role:"img","aria-label":Wt||("string"==typeof ot?ot:"Ordinal chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:x?"100%":ho[0],height:w?"100%":ho[1]},children:[Sr($t,{summary:Dt}),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",width:ho[0],height:ho[1],style:{position:"absolute",left:0,top:0},children:[Rr("g",{transform:`translate(${uo.left},${uo.top})`,children:[rt&&Sr("rect",{x:0,y:0,width:mo,height:go,fill:rt}),n]}),Sr("g",{transform:`translate(${s},${c})`,children:G({nodes:o,renderMode:ae,idPrefix:xo}).map(e=>e.element)})]}),Sr(R,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:i,showAxes:se,showCategoryTicks:ce,oLabel:eo,rLabel:to,oFormat:oo,rFormat:io,rTickValues:ke,tickLabelEdgeAlign:Ae,axisExtent:Se,showGrid:je,title:ot,description:Wt,legend:ze,legendHoverBehavior:Ve,legendClickBehavior:Ge,legendHighlightedCategory:Xe,legendIsolatedCategories:Ye,legendPosition:Qe,legendLayout:Ke,foregroundGraphics:Je(r,wt(ri.current?.customLayoutOverlays,Vt??null)),annotations:$e,onAnnotationActivate:De,onObservation:He??Te,chartId:Be,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:Ne,svgAnnotationRules:Ee,annotationFrame:0,xAccessor:Ii,yAccessor:Ti,annotationData:Hi(t?.getData())}),at&&"radial"===v&&Sr(e,{content:at,centerX:uo.left+mo/2,centerY:uo.top+go/2,width:ho[0],height:ho[1]})]})}return Rr("div",{ref:co,className:"stream-ordinal-frame"+(it?" "+it:""),role:"group","aria-label":Wt||("string"==typeof ot?ot:"Ordinal chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:x?"100%":ho[0],height:w?"100%":ho[1],overflow:"visible"},onKeyDown:Ai,children:["production"!==process.env.NODE_ENV&&ri.current&&Sr(Ft,{store:ri.current,diagnostics:Jo.current}),Bt&&Rr(Ct,{accessibleTable:Bt,children:[Sr(Ot,{tableId:xo}),Sr(Pt,{scene:ri.current?.scene??[],chartType:i+" chart",tableId:xo,chartTitle:"string"==typeof ot?ot:void 0})]}),Sr($t,{summary:Dt}),Sr(_t,{hoverPoint:Oo}),Rr("div",{role:"img","aria-label":Wt||("string"==typeof ot?ot:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Si,onMouseLeave:mi,onClick:Xt?pi:void 0,children:[Rr(Lt,{size:ho,margin:uo,children:[Vo,zo,jo]}),Sr(S,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:Do,showAxes:se,showGrid:je,rFormat:io,rTickValues:ke,axisExtent:Se}),Sr("canvas",{ref:li,"aria-label":zt(ri.current?.scene??[],i+" chart"),style:{position:"absolute",top:0,left:0,width:ho[0],height:ho[1]}}),Sr(R,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:Do,showAxes:se,showCategoryTicks:ce,oLabel:eo,rLabel:to,oFormat:oo,rFormat:io,rTickValues:ke,axisExtent:Se,showGrid:je,title:ot,description:Wt,legend:ze,legendHoverBehavior:Ve,legendClickBehavior:Ge,legendHighlightedCategory:Xe,legendIsolatedCategories:Ye,legendPosition:Qe,legendLayout:Ke,foregroundGraphics:Je(Eo,wt(ri.current?.customLayoutOverlays,Vt??null)),annotations:$e,onAnnotationActivate:De,onObservation:He??Te,chartId:Be,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:Ne,svgAnnotationRules:Ee,annotationFrame:Go,xAccessor:Ii,yAccessor:Ti,annotationData:Hi(ri.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),(Mt||Ht)&&"radial"!==v&&Sr(P,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:Do,onBrush:Ht||(()=>{})}),at&&"radial"===v&&Sr(e,{content:at,centerX:uo.left+mo/2,centerY:uo.top+go/2,width:ho[0],height:ho[1]}),dt?.showBadge&&Sr(qe,{isStale:Yo,position:dt.badgePosition}),Sr(Tt,{active:fi.current>=0,hoverPoint:Oo,margin:uo,size:ho,shape:ki.current?.shape,width:ki.current?.w,height:ki.current?.h}),Ci]})]})}));Cr.displayName="StreamOrdinalFrame";var _r=Cr;import{useMemo as Lr,forwardRef as Mr,useRef as Ir}from"react";import{useImperativeHandle as Tr}from"react";import{useMemo as Hr}from"react";import{useCallback as Br,useMemo as Fr,useRef as $r}from"react";import{jsx as Or}from"react/jsx-runtime";var Wr=Mr(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ir(null),{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="vertical",valueFormat:h,colorBy:d,colorScheme:u,sort:m=!1,barPadding:g=40,roundedTop:p,gradientFill:f=!1,styleRules:y,baselinePadding:v=!1,tooltip:b,annotations:x,regression:w,valueExtent:k,frameProps:A={},selection:S,linkedHover:R,linkedBrush:P,brush:C,onBrush:_,onObservation:L,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:F,legendInteraction:$,legendPosition:O,color:W,stroke:D,strokeWidth:N,opacity:E,showCategoryTicks:j,categoryFormat:z,dataIdAccessor:V}=e,{width:G,height:q,enableHover:X,showGrid:Z,showLegend:U,title:J,description:ee,summary:te,accessibleTable:oe,categoryLabel:ie,valueLabel:re}=o,ae=Lr(()=>Yt(r),[r]),ne=ue({data:ae,rawData:r,colorBy:d,colorScheme:u,legendInteraction:$,legendPosition:O,frameLegend:A,selection:S,linkedHover:R,fallbackFields:d?["string"==typeof d?d:""]:[],unwrapData:!0,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"BarChart",chartId:T,showLegend:U,userMargin:a,marginDefaults:o.marginDefaults,loading:H,loadingContent:B,emptyContent:F,width:G,height:q,hasTitle:!!J,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!ie,hasValueLabel:!!re})}),{effectiveLegendProps:le,effectiveMargin:se}=Y({ref:t,frameRef:i,setup:ne});Oo("BarChart",ae,"categoryAccessor",l),Oo("BarChart",ae,"valueAccessor",s);let he=Ho(ae,m,s),me=Bo(),ge=Lr(()=>new Map,[]),pe=Lr(()=>eo(s),[s]),fe=K({brushProp:C,onBrushProp:_,linkedBrush:P,valueAccessor:s}),ye=Q({colorBy:d,colorScale:ne.colorScale,color:W,themeCategorical:me,colorScheme:u,categoryIndexMap:ge,userPieceStyle:A?.pieceStyle,stroke:D,strokeWidth:N,opacity:E,styleRules:y,resolveRuleValue:pe,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection}),ve=Lr(()=>Ze({categoryAccessor:l,valueAccessor:s,groupAccessor:d&&d!==l?d:void 0,groupLabel:"string"==typeof d?d:"group",valueFormat:h}),[l,s,d,h]),be=Lr(()=>Ce(f),[f]);if(ne.earlyReturn)return ne.earlyReturn;let xe=de({componentName:"BarChart",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(xe)return Or(Mt,{componentName:"BarChart",message:xe,width:G,height:q});let we=ce(w),ke=we?[we,...x||[]]:x,Ae={chartType:"bar",...null!=r&&{data:he},oAccessor:l,rAccessor:s,projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:ye,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:se,barPadding:g,...null!=p&&{roundedTop:p},...be&&{gradientFill:be},...V&&{dataIdAccessor:V},baselinePadding:v,enableHover:X,showAxes:o.showAxes,oLabel:ie,rLabel:re,rFormat:h,...z&&{oFormat:z},showGrid:Z,showCategoryTicks:j,oSort:m,...le,...Ye({title:J,description:ee,summary:te,accessibleTable:oe,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:b,defaultTooltipContent:ve}),...Qe({linkedHover:R,selection:S,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...ke&&ke.length>0&&{annotations:ke},...k&&{rExtent:k},...fe.brushStreamProps,...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return Or(Bt,{componentName:"BarChart",width:G,height:q,children:Or(_r,{ref:i,...Ae})})});Wr.displayName="BarChart";import{useMemo as Dr,forwardRef as Nr,useRef as Er}from"react";import{jsx as jr}from"react/jsx-runtime";var zr=Nr(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Er(null),{data:r,margin:a,className:n,categoryAccessor:l="category",stackBy:s,valueAccessor:c="value",orientation:h="vertical",valueFormat:d,colorBy:u,colorScheme:m,normalize:g=!1,sort:p=!1,barPadding:f=40,roundedTop:y,gradientFill:v,styleRules:b,baselinePadding:x=!1,tooltip:w,annotations:k,valueExtent:A,frameProps:S={},selection:R,linkedHover:P,linkedBrush:C,brush:_,onBrush:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:F,emptyContent:$,legendInteraction:O,legendPosition:W,color:D,stroke:N,strokeWidth:E,opacity:j,categoryFormat:z}=e,{width:V,height:G,enableHover:q,showGrid:X,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=o,re=Dr(()=>Yt(r),[r]),ae=u||s,ne=ue({data:re,rawData:r,colorBy:ae,colorScheme:m,legendInteraction:O,legendPosition:W,frameLegend:S,selection:R,linkedHover:P,fallbackFields:ae?["string"==typeof ae?ae:""]:[],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"StackedBarChart",chartId:H,showLegend:Z,userMargin:a,marginDefaults:o.marginDefaults,loading:B,loadingContent:F,emptyContent:$,width:V,height:G,hasTitle:!!U,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),le=Bo(),se=Dr(()=>new Map,[]),ce=Dr(()=>eo(c),[c]),he=K({brushProp:_,onBrushProp:L,linkedBrush:C,valueAccessor:c}),me=Q({colorBy:ae,colorScale:ne.colorScale,color:D,themeCategorical:le,colorScheme:m,categoryIndexMap:se,userPieceStyle:S?.pieceStyle,stroke:N,strokeWidth:E,opacity:j,styleRules:b,resolveRuleValue:ce,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection}),ge=Dr(()=>Ze({categoryAccessor:s,valueAccessor:c,groupAccessor:l,valueFormat:d}),[s,l,c,d]),pe=de({componentName:"StackedBarChart",data:r,accessors:{categoryAccessor:l,valueAccessor:c},requiredProps:{stackBy:s}}),{effectiveLegendProps:fe,effectiveMargin:ye}=Y({ref:t,frameRef:i,setup:ne}),ve=Dr(()=>Ce(v),[v]);if(ne.earlyReturn)return ne.earlyReturn;let be={chartType:"bar",...null!=r&&{data:re},oAccessor:l,rAccessor:c,stackBy:s,normalize:g,oSort:p,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:me,size:[V,G],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ye,barPadding:f,...null!=y&&{roundedTop:y},...ve&&{gradientFill:ve},baselinePadding:x,enableHover:q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:oe,rLabel:ie,rFormat:d,...z&&{oFormat:z},showGrid:X,...fe,...Ye({title:U,description:J,summary:ee,accessibleTable:te,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:w,defaultTooltipContent:ge}),...Qe({linkedHover:P,selection:R,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...k&&k.length>0&&{annotations:k},...A&&{rExtent:A},...he.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return pe?jr(Mt,{componentName:"StackedBarChart",message:pe,width:V,height:G}):jr(Bt,{componentName:"StackedBarChart",width:V,height:G,children:jr(_r,{ref:i,...be})})});zr.displayName="StackedBarChart";import*as Vr from"react";import{useMemo as Gr,useCallback as qr,forwardRef as Xr,useRef as Yr,useImperativeHandle as Qr}from"react";import{useMemo as Kr,useCallback as Zr,useRef as Ur}from"react";var Jr={RdBu:qo,PiYG:Go,PRGn:Vo,BrBG:zo,RdYlBu:Xo,RdYlGn:Yo,Spectral:Qo},ea="__likert_neutral_neg",ta="__likert_neutral_pos",oa=["Very Low","Low","Neutral","High","Very High"];import{jsx as ia}from"react/jsx-runtime";var ra=new Map,aa=Xr(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Yr(null),{data:r,margin:a,className:n,categoryAccessor:l="question",valueAccessor:s,levelAccessor:c,countAccessor:h="count",levels:d=oa,orientation:u="horizontal",colorScheme:m,barPadding:g=20,styleRules:p,tooltip:f,annotations:y,valueExtent:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,valueFormat:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,categoryFormat:T,stroke:H,strokeWidth:B,opacity:F}=e,{width:$,height:O,enableHover:W,showGrid:D,showLegend:N,title:E,description:j,summary:z,accessibleTable:V,categoryLabel:G,valueLabel:q}=o,X="horizontal"===u,Y=void 0===r,K=!c,oe=Fo(),ie=Gr(()=>m&&Array.isArray(m)&&m.length>=d.length?m:function(e,t){if(0>=e)return[];if(t&&Object.prototype.hasOwnProperty.call(Jr,t)){let o=Jr[t];if(1===e)return[o(.5)];let i=[];for(let t=0;e>t;t++)i.push(o(t/(e-1)));return i}let o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],r="#a8a8a8";if(1===e)return[r];let a=e%2!=0,n=Math.floor(e/2),l=[];for(let e=0;n>e;e++)l.push(o[Math.min(Math.floor(e*o.length/n),o.length-1)]);a&&l.push(r);for(let e=0;n>e;e++)l.push(i[Math.min(Math.floor(e*i.length/n),i.length-1)]);return l}(d.length,oe),[m,d.length,oe]),re=Gr(()=>{let e=new Map;for(let t=0;d.length>t;t++)e.set(d[t],ie[t]||"#888");return e},[d,ie]),ae=Gr(()=>{if(!1!==N)return{legendGroups:[{styleFn:e=>({fill:re.get(e.label)||"#888"}),items:d.map(e=>({label:e})),label:""}]}},[N,d,re]),ne=Gr(()=>Object.hasOwn(b,"legend")?b:{...b,legend:ae},[b,ae]),{processedData:le,reAggregate:se,accumulatorRef:ce}=function({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:r,countAccessor:a,isDiverging:n,frameRef:l}){let s=!r,c=Kr(()=>Z(o,"question"),[o]),h=Kr(()=>s?Z(i,"score"):null,[s,i]),d=Kr(()=>s?null:Z(r,"level"),[s,r]),u=Kr(()=>s?null:Z(a,"count"),[s,a]),m=Ur([]),g=Kr(()=>({category:"string"==typeof o?o:void 0,level:"string"==typeof r?r:void 0,count:"string"==typeof a?a:void 0,score:r||"string"!=typeof i?void 0:i}),[o,a,r,i]);return{processedData:Kr(()=>{let o=e||[];if(0===o.length)return[];let i=U(o,t,c,h,d,u,g);return n&&(i=J(i,t),i=ee(i,t)),i},[e,t,c,h,d,u,g,n]),reAggregate:Zr(e=>{let o=U(e,t,c,h,d,u,g);n&&(o=J(o,t),o=ee(o,t)),l.current?.replace(o)},[t,c,h,d,u,g,n,l]),accumulatorRef:m}}({data:r,levels:d,categoryAccessor:l,valueAccessor:s,levelAccessor:c,countAccessor:h,isDiverging:X,frameRef:i}),he="__likertLevelLabel",me=pe({isPushMode:Y,colorBy:he,colorScheme:ie,showLegend:N,legendPosition:I}),{wrapPush:ge,wrapPushMany:fe}=me,ye=qr(e=>ge(e=>{ce.current.push(e),se(ce.current)})(e),[ge,se,ce]),ve=qr(e=>fe(e=>{ce.current.push(...e),se(ce.current)})(e),[fe,se,ce]);Qr(t,()=>({push:ye,pushMany:ve,remove:e=>i.current?.remove(e)??[],update:(e,t)=>i.current?.update(e,t)??[],replace:e=>i.current?.replace(e),clear:()=>{ce.current=[],me.resetCategories(),i.current?.clear()},getData:()=>i.current?.getData()??[],getScales:()=>i.current?.getScales()??null}),[ye,ve,ce,me]);let be=ue({data:le,rawData:r,colorBy:he,colorScheme:ie,legendInteraction:M,legendPosition:I,frameLegend:ne,selection:x,linkedHover:w,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"LikertChart",chartId:R,showLegend:N,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:$,height:O,hasTitle:!!E,axisChrome:{hasAxis:!1!==o.showAxes,hasAxisLabel:X?!!q:!!G}}),xe=Gr(()=>{let e=d.length;return e%2!=0&&re.get(d[Math.floor(e/2)])||"#888"},[d,re]),we=Q({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:ra,userPieceStyle:b?.pieceStyle,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:be.effectiveSelectionHook,resolvedSelection:be.resolvedSelection,styleRules:p,resolveRuleValue:te,baseStyleExtras:e=>{let t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===ea||o===ta)return{fill:xe};let i=t||o;return i&&re.has(i)?{fill:re.get(i)}:{fill:"#888"}}}),ke=Gr(()=>{let e=d.length;return e%2!=0?d[Math.floor(e/2)]:""},[d]),Ae=Gr(()=>e=>{let t=e.data||e,o=t.__likertLevel||"Unknown",i=o===ea||o===ta?ke:o,r=t.__likertCategory||"",a=Math.abs(t.__likertPct||0),n=o===ea||o===ta?2*a:a,l=t.__likertCount||0;return Vr.createElement("div",{className:"semiotic-tooltip",style:Xt},Vr.createElement("div",{style:{fontWeight:"bold"}},r),Vr.createElement("div",{style:{marginTop:4}},`${i}: ${n.toFixed(1)}% (n=${l})`))},[ke]),Se=Gr(()=>{if(!d||2>d.length)return"LikertChart requires `levels` with at least 2 entries.";if(s&&c)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(c&&!h)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==r&&0===r.length)return null;let e={categoryAccessor:l};return K?s&&(e.valueAccessor=s):(c&&(e.levelAccessor=c),h&&(e.countAccessor=h)),de({componentName:"LikertChart",data:r,accessors:e,requiredProps:{levels:d}})},[r,l,s,c,h,d,K]),Re=be.legendBehaviorProps,Pe=Gr(()=>{let e={...be.margin};if(Y&&be.legend){let t=be.legendPosition;"bottom"===t&&80>e.bottom?e.bottom=80:"top"===t&&50>e.top?e.top=50:"right"===t&&110>e.right?e.right=110:"left"===t&&110>e.left&&(e.left=110)}else if(me.streamingMarginAdjust)for(let[t,o]of Object.entries(me.streamingMarginAdjust))o>e[t]&&(e[t]=o);return X&&100>e.left&&(e.left=100),e},[be.margin,be.legend,be.legendPosition,me.streamingMarginAdjust,X,Y]),Ce=Gr(()=>P||(X?e=>Math.abs(Number(e)).toFixed(0)+"%":e=>Number(e).toFixed(0)+"%"),[X,P]);if(be.earlyReturn)return be.earlyReturn;let _e={chartType:"bar",...null!=r&&{data:le},oAccessor:"__likertCategory",rAccessor:"__likertPct",stackBy:"__likertLevel",normalize:!1,projection:X?"horizontal":"vertical",pieceStyle:we,size:[$,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Pe,barPadding:g,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:G,rLabel:q||(X?void 0:"Percentage"),rFormat:Ce,...T&&{oFormat:T},showGrid:D,...Re,...E&&{title:E},...j&&{description:j},...z&&{summary:z},...void 0!==V&&{accessibleTable:V},...n&&{className:n},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===f?()=>null:!0===f?Ae:oo(f)||Ae,...Qe({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:be.mobileInteraction,customHoverBehavior:be.customHoverBehavior,customClickBehavior:be.customClickBehavior}),...y&&y.length>0&&{annotations:y},...v&&{rExtent:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return Se?ia(Mt,{componentName:"LikertChart",message:Se,width:$,height:O}):ia(Bt,{componentName:"LikertChart",width:$,height:O,children:ia(_r,{ref:i,..._e})})});aa.displayName="LikertChart";import{useMemo as na,forwardRef as la,useRef as sa}from"react";import{jsx as ca}from"react/jsx-runtime";var ha=la(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=sa(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="vertical",valueFormat:h,colorBy:d,colorScheme:u,styleRules:m,sizeBy:g,sizeRange:p=[3,8],symbolBy:f,symbolMap:y,pointRadius:v=4,pointOpacity:b=.7,categoryPadding:x=20,tooltip:w,annotations:k,valueExtent:A,brush:S,onBrush:R,linkedBrush:P,frameProps:C={},selection:_,linkedHover:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:F,emptyContent:$,legendInteraction:O,legendPosition:W,color:D,stroke:N,strokeWidth:E,opacity:j,showCategoryTicks:z,categoryFormat:V}=e,{width:G,height:q,enableHover:X,showGrid:Y,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=o,re=na(()=>Yt(r),[r]),ae=ue({data:re,rawData:r,colorBy:d,colorScheme:u,legendInteraction:O,legendPosition:W,frameLegend:C,selection:_,linkedHover:L,fallbackFields:d?["string"==typeof d?d:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"SwarmPlot",chartId:H,showLegend:Z,userMargin:a,marginDefaults:o.marginDefaults,loading:B,loadingContent:F,emptyContent:$,width:G,height:q,hasTitle:!!U,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),ne=K({brushProp:S,onBrushProp:R,linkedBrush:P,valueAccessor:s}),le=na(()=>{if(!g)return;let e=re.map(e=>"function"==typeof g?g(e):e[g]);return Jo(e)},[re,g]),se=Bo(),ce=na(()=>new Map,[]),he=na(()=>eo(s),[s]),ge=Q({colorBy:d,colorScale:ae.colorScale,color:D,themeCategorical:se,colorScheme:u,categoryIndexMap:ce,userPieceStyle:C?.pieceStyle,stroke:N,strokeWidth:E,opacity:j,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection,baseStyleExtras:e=>({fillOpacity:b,r:g?jo(e,g,p,le):v}),styleRules:m,resolveRuleValue:he}),pe=na(()=>Ze({categoryAccessor:l,valueAccessor:s,groupAccessor:d||void 0,valueFormat:h}),[l,s,d,h]);if(ae.earlyReturn)return ae.earlyReturn;let fe=de({componentName:"SwarmPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(fe)return ca(Mt,{componentName:"SwarmPlot",message:fe,width:G,height:q});let ye={chartType:"swarm",...null!=r&&{data:re},oAccessor:l,rAccessor:s,...f&&{symbolAccessor:f},...y&&{symbolMap:y},projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:ge,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ae.margin,barPadding:x,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:oe,rLabel:ie,rFormat:h,...V&&{oFormat:V},showGrid:Y,showCategoryTicks:z,...ae.legendBehaviorProps,...Ye({title:U,description:J,summary:ee,accessibleTable:te,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:w,defaultTooltipContent:pe}),...Qe({linkedHover:L,selection:_,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...k&&k.length>0&&{annotations:k},...A&&{rExtent:A},...ne.brushStreamProps,...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return ca(Bt,{componentName:"SwarmPlot",width:G,height:q,children:ca(_r,{ref:i,...ye})})});ha.displayName="SwarmPlot";import{useMemo as da,forwardRef as ua,useRef as ma}from"react";import{jsx as ga,jsxs as pa}from"react/jsx-runtime";import{jsx as fa}from"react/jsx-runtime";var ya=ua(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ma(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="vertical",valueFormat:h,colorBy:d,colorScheme:u,styleRules:m,showOutliers:g=!0,outlierRadius:p=3,categoryPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:k,onObservation:A,onClick:S,hoverHighlight:R,chartId:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:F,showCategoryTicks:$,categoryFormat:O}=e,{width:W,height:D,enableHover:N,showGrid:E,showLegend:j,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,K=da(()=>Yt(r),[r]),Z=ue({data:K,rawData:r,colorBy:d,colorScheme:u,legendInteraction:M,legendPosition:I,frameLegend:x,selection:w,linkedHover:k,fallbackFields:d?["string"==typeof d?d:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"BoxPlot",chartId:P,showLegend:j,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:W,height:D,hasTitle:!!z,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),U=Bo(),J=da(()=>new Map,[]),ee=da(()=>{let e=eo(s);return t=>"number"==typeof t.median?t.median:e(t)},[s]),te=Q({colorBy:d,colorScale:Z.colorScale,color:T,themeCategorical:U,colorScheme:u,categoryIndexMap:J,userPieceStyle:void 0,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0,styleRules:m,resolveRuleValue:ee}),ie=da(()=>oe(),[]);if(Z.earlyReturn)return Z.earlyReturn;let re=de({componentName:"BoxPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(re)return fa(Mt,{componentName:"BoxPlot",message:re,width:W,height:D});let ae={chartType:"boxplot",...null!=r&&{data:K},oAccessor:l,rAccessor:s,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:te,showOutliers:g,size:[W,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,barPadding:f,enableHover:N,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:h,...O&&{oFormat:O},showGrid:E,showCategoryTicks:$,...Z.legendBehaviorProps,...Ye({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:y,defaultTooltipContent:ie}),...Qe({linkedHover:k,selection:w,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return fa(Bt,{componentName:"BoxPlot",width:W,height:D,children:fa(_r,{ref:i,...ae})})});ya.displayName="BoxPlot";import{useMemo as va,forwardRef as ba,useRef as xa}from"react";import{jsx as wa,jsxs as ka}from"react/jsx-runtime";var Aa=e=>{let t=e?.category;return null==t?"All":t+""},Sa=ba(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:"horizontal",mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=xa(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l=Aa,valueAccessor:s="value",bins:c=25,relative:h=!1,valueFormat:d,colorBy:u,colorScheme:m,styleRules:g,categoryPadding:p=("sparkline"===o.mode?0:20),tooltip:f,annotations:y,valueExtent:v,brush:b,onBrush:x,linkedBrush:w,frameProps:k={},selection:A,linkedHover:S,onObservation:R,onClick:P,hoverHighlight:C,chartId:_,loading:L,loadingContent:M,emptyContent:I,legendInteraction:T,legendPosition:H,color:B,stroke:F,strokeWidth:$,opacity:O,showCategoryTicks:W,categoryFormat:D}=e,{width:N,height:E,enableHover:j,showGrid:z,showLegend:V,title:G,description:q,summary:X,accessibleTable:Y,categoryLabel:Z,valueLabel:U}=o,J=va(()=>Yt(r),[r]),ee=ue({data:J,rawData:r,colorBy:u,colorScheme:m,legendInteraction:T,legendPosition:H,frameLegend:k,selection:A,linkedHover:S,fallbackFields:u?["string"==typeof u?u:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:R,onClick:P,hoverHighlight:C,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"Histogram",chartId:_,showLegend:V,userMargin:a,marginDefaults:o.marginDefaults,loading:L,loadingContent:M,emptyContent:I,width:N,height:E,hasTitle:!!G,axisChrome:po({showAxes:o.showAxes,projection:"horizontal",hasCategoryLabel:!!Z,hasValueLabel:!!U})}),te=K({brushProp:b,onBrushProp:x,linkedBrush:w,valueAccessor:s}),oe=va(()=>{if(0===J.length)return;let e="function"==typeof s?s:e=>e[s],t=1/0,o=-1/0;for(let i of J){let r=e(i);null!=r&&isFinite(r)&&(t>r&&(t=r),r>o&&(o=r))}return t>o?void 0:[t,o]},[J,s]),ie=Bo(),re=va(()=>new Map,[]),ae=va(()=>{let e=eo(s);return t=>"number"==typeof t.count?t.count:e(t)},[s]),ne=Q({colorBy:u,colorScale:ee.colorScale,color:B,themeCategorical:ie,colorScheme:m,categoryIndexMap:re,userPieceStyle:void 0,stroke:F,strokeWidth:$,opacity:O,effectiveSelectionHook:ee.effectiveSelectionHook,resolvedSelection:ee.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0,styleRules:g,resolveRuleValue:ae}),le=va(()=>e=>{let t=e.data||e,o=t.category||e.category||"",i=t.count,r=t.range;return ka("div",{className:"semiotic-tooltip",style:Xt,children:[o&&wa("div",{style:{fontWeight:"bold"},children:o+""}),null!=i&&ka("div",{children:["Count: ",i]}),r&&2===r.length&&ka("div",{style:{opacity:.8},children:[Number(r[0]).toFixed(1)," – ",Number(r[1]).toFixed(1)]})]})},[]);if(ee.earlyReturn)return ee.earlyReturn;let se=de({componentName:"Histogram",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(se)return wa(Mt,{componentName:"Histogram",message:se,width:N,height:E});let ce={chartType:"histogram",...null!=r&&{data:J},oAccessor:l,rAccessor:s,projection:"horizontal",summaryStyle:ne,bins:c,normalize:h,...v?{rExtent:v}:oe&&{rExtent:oe},size:[N,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee.margin,barPadding:p,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:Z,rLabel:U,rFormat:d,...D&&{oFormat:D},showGrid:z,showCategoryTicks:W,...ee.legendBehaviorProps,...Ye({title:G,description:q,summary:X,accessibleTable:Y,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:f,defaultTooltipContent:le}),...Qe({linkedHover:S,selection:A,onObservation:R,onClick:P,hoverHighlight:C,mobileInteraction:ee.mobileInteraction,customHoverBehavior:ee.customHoverBehavior,customClickBehavior:ee.customClickBehavior}),...y&&y.length>0&&{annotations:y},...te.brushStreamProps,...Object.fromEntries(Object.entries(k).filter(([e])=>"pieceStyle"!==e))};return wa(Bt,{componentName:"Histogram",width:N,height:E,children:wa(_r,{ref:i,...ce})})});Sa.displayName="Histogram";import{useMemo as Ra,forwardRef as Pa,useRef as Ca}from"react";import{jsx as _a}from"react/jsx-runtime";var La=Pa(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ca(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="vertical",bins:h=25,curve:d="catmullRom",showIQR:u=!0,valueFormat:m,colorBy:g,colorScheme:p,styleRules:f,categoryPadding:y=20,tooltip:v,annotations:b,valueExtent:x,brush:w,onBrush:k,linkedBrush:A,frameProps:S={},selection:R,linkedHover:P,onObservation:C,onClick:_,hoverHighlight:L,chartId:M,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:F,color:$,stroke:O,strokeWidth:W,opacity:D,showCategoryTicks:N,categoryFormat:E}=e,{width:j,height:z,enableHover:V,showGrid:G,showLegend:q,title:X,description:Y,summary:Z,accessibleTable:U,categoryLabel:J,valueLabel:ee}=o,te=Ra(()=>Yt(r),[r]),ie=ue({data:te,rawData:r,colorBy:g,colorScheme:p,legendInteraction:B,legendPosition:F,frameLegend:S,selection:R,linkedHover:P,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:C,onClick:_,hoverHighlight:L,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ViolinPlot",chartId:M,showLegend:q,userMargin:a,marginDefaults:o.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:j,height:z,hasTitle:!!X,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!J,hasValueLabel:!!ee})}),re=K({brushProp:w,onBrushProp:k,linkedBrush:A,valueAccessor:s}),ae=Bo(),ne=Ra(()=>new Map,[]),le=Ra(()=>{let e=eo(s);return t=>"number"==typeof t.median?t.median:e(t)},[s]),se=Q({colorBy:g,colorScale:ie.colorScale,color:$,themeCategorical:ae,colorScheme:p,categoryIndexMap:ne,userPieceStyle:void 0,stroke:O,strokeWidth:W,opacity:D,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0,styleRules:f,resolveRuleValue:le}),ce=Ra(()=>oe({valueAccessor:s}),[s]);if(ie.earlyReturn)return ie.earlyReturn;let he=de({componentName:"ViolinPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(he)return _a(Mt,{componentName:"ViolinPlot",message:he,width:j,height:z});let ge={chartType:"violin",...null!=r&&{data:te},oAccessor:l,rAccessor:s,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:se,bins:h,showIQR:u,size:[j,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,barPadding:y,enableHover:V,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:J,rLabel:ee,rFormat:m,...E&&{oFormat:E},showGrid:G,showCategoryTicks:N,...ie.legendBehaviorProps,...Ye({title:X,description:Y,summary:Z,accessibleTable:U,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:v,defaultTooltipContent:ce}),...Qe({linkedHover:P,selection:R,onObservation:C,onClick:_,hoverHighlight:L,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...b&&b.length>0&&{annotations:b},...x&&{rExtent:x},...re.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return _a(Bt,{componentName:"ViolinPlot",width:j,height:z,children:_a(_r,{ref:i,...ge})})});La.displayName="ViolinPlot";import{useMemo as Ma,forwardRef as Ia,useRef as Ta}from"react";import{jsx as Ha}from"react/jsx-runtime";var Ba=Ia(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ta(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="horizontal",bins:h=20,amplitude:d=1.5,valueFormat:u,colorBy:m,colorScheme:g,styleRules:p,categoryPadding:f=5,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:k,onObservation:A,onClick:S,hoverHighlight:R,chartId:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:F,showCategoryTicks:$,categoryFormat:O}=e,{width:W,height:D,enableHover:N,showGrid:E,showLegend:j,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,K=Ma(()=>Yt(r),[r]),Z=ue({data:K,rawData:r,colorBy:m,colorScheme:g,legendInteraction:M,legendPosition:I,frameLegend:x,selection:w,linkedHover:k,fallbackFields:m?["string"==typeof m?m:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"RidgelinePlot",chartId:P,showLegend:j,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:W,height:D,hasTitle:!!z,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),U=Bo(),J=Ma(()=>new Map,[]),ee=Ma(()=>{let e=eo(s);return t=>"number"==typeof t.median?t.median:e(t)},[s]),te=Q({colorBy:m,colorScale:Z.colorScale,color:T,themeCategorical:U,colorScheme:g,categoryIndexMap:J,userPieceStyle:void 0,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0,styleRules:p,resolveRuleValue:ee}),ie=Ma(()=>oe(),[]);if(Z.earlyReturn)return Z.earlyReturn;let re=de({componentName:"RidgelinePlot",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(re)return Ha(Mt,{componentName:"RidgelinePlot",message:re,width:W,height:D});let ae={chartType:"ridgeline",...null!=r&&{data:K},oAccessor:l,rAccessor:s,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:te,bins:h,size:[W,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,barPadding:f,enableHover:N,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:u,...O&&{oFormat:O},showGrid:E,showCategoryTicks:$,oSort:!1,amplitude:d,...Z.legendBehaviorProps,...Ye({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:y,defaultTooltipContent:ie}),...Qe({linkedHover:k,selection:w,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return Ha(Bt,{componentName:"RidgelinePlot",width:W,height:D,children:Ha(_r,{ref:i,...ae})})});Ba.displayName="RidgelinePlot";import{useMemo as Fa,forwardRef as $a,useRef as Oa}from"react";import{jsx as Wa}from"react/jsx-runtime";var Da=$a(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid??!0,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Oa(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",orientation:c="horizontal",valueFormat:h,colorBy:d,colorScheme:u,styleRules:m,sort:g="auto",dotRadius:p=5,categoryPadding:f=10,tooltip:y,annotations:v,regression:b,valueExtent:x,frameProps:w={},selection:k,linkedHover:A,onObservation:S,onClick:R,hoverHighlight:P,chartId:C,loading:_,loadingContent:L,emptyContent:M,legendInteraction:I,legendPosition:T,color:H,stroke:B,strokeWidth:F,opacity:$,categoryFormat:O}=e,{width:W,height:D,enableHover:N,showGrid:E,showLegend:j,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,K=Fa(()=>Yt(r),[r]),Z=ue({data:K,rawData:r,colorBy:d,colorScheme:u,legendInteraction:I,legendPosition:T,frameLegend:w,selection:k,linkedHover:A,fallbackFields:d?["string"==typeof d?d:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DotPlot",chartId:C,showLegend:j,userMargin:a,marginDefaults:o.marginDefaults,loading:_,loadingContent:L,emptyContent:M,width:W,height:D,hasTitle:!!z,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),U=Ho(K,g,s),J=Bo(),ee=Fa(()=>new Map,[]),te=Fa(()=>eo(s),[s]),oe=Q({colorBy:d,colorScale:Z.colorScale,color:H,themeCategorical:J,colorScheme:u,categoryIndexMap:ee,userPieceStyle:w?.pieceStyle,stroke:B,strokeWidth:F,opacity:$,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection,baseStyleExtras:{r:p,fillOpacity:.8},styleRules:m,resolveRuleValue:te}),ie=Fa(()=>Ze({categoryAccessor:l,valueAccessor:s,valueFormat:h}),[l,s,h]);if(Z.earlyReturn)return Z.earlyReturn;let re=de({componentName:"DotPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(re)return Wa(Mt,{componentName:"DotPlot",message:re,width:W,height:D});let ae=ce(b),ne=ae?[ae,...v||[]]:v,le={chartType:"point",...null!=r&&{data:U},oAccessor:l,rAccessor:s,projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:oe,size:[W,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,barPadding:f,enableHover:N,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:h,...O&&{oFormat:O},showGrid:E,oSort:g,...Z.legendBehaviorProps,...Ye({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:y,defaultTooltipContent:ie}),...Qe({linkedHover:A,selection:k,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...ne&&ne.length>0&&{annotations:ne},...x&&{rExtent:x},...Object.fromEntries(Object.entries(w).filter(([e])=>"pieceStyle"!==e))};return Wa(Bt,{componentName:"DotPlot",width:W,height:D,children:Wa(_r,{ref:i,...le})})});Da.displayName="DotPlot";import{useMemo as Na,forwardRef as Ea,useRef as ja}from"react";import{jsx as za}from"react/jsx-runtime";var Va=Ea(function(e,t){let o=Co(e.mode,{width:e.width??400,height:e.height??400,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ja(null),{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",colorBy:c,colorScheme:h,styleRules:d,startAngle:u=0,cornerRadius:m,valueFormat:g,tooltip:p,annotations:f,frameProps:y={},selection:v,linkedHover:b,onObservation:x,onClick:w,hoverHighlight:k,chartId:A,loading:S,loadingContent:R,emptyContent:P,legendInteraction:C,legendPosition:_,color:L,stroke:M,strokeWidth:I,opacity:T}=e,{width:H,height:B,enableHover:F,showLegend:$,title:O,description:W,summary:D,accessibleTable:N}=o,E=Na(()=>Yt(r),[r]),j=c||l,z=ue({data:E,rawData:r,colorBy:j,colorScheme:h,legendInteraction:C,legendPosition:_,frameLegend:y,selection:v,linkedHover:b,fallbackFields:j?["string"==typeof j?j:""]:[],unwrapData:!0,onObservation:x,onClick:w,hoverHighlight:k,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"PieChart",chartId:A,showLegend:$,userMargin:a,marginDefaults:o.marginDefaults,loading:S,loadingContent:R,emptyContent:P,width:H,height:B,hasTitle:!!O,axisChrome:{hasAxis:!1}}),V=Bo(),G=Na(()=>new Map,[]),q=Na(()=>{let e=eo(s);return t=>{let o=e(t);return null==o?void 0:Math.abs(o)}},[s]),X=Q({colorBy:j,colorScale:z.colorScale,color:L,themeCategorical:V,colorScheme:h,categoryIndexMap:G,userPieceStyle:y?.pieceStyle,stroke:M,strokeWidth:I,opacity:T,effectiveSelectionHook:z.effectiveSelectionHook,resolvedSelection:z.resolvedSelection,cycleByCategory:!0,styleRules:d,resolveRuleValue:q}),K=Na(()=>Ze({categoryAccessor:l,valueAccessor:s,groupAccessor:c&&c!==l?c:void 0,groupLabel:"string"==typeof c?c:"group",pieData:!0,valueFormat:g}),[l,s,c,g]),Z=de({componentName:"PieChart",data:r,accessors:{categoryAccessor:l,valueAccessor:s}}),{effectiveLegendProps:U,effectiveMargin:J}=Y({ref:t,frameRef:i,setup:z});if(z.earlyReturn)return z.earlyReturn;let ee={chartType:"pie",...null!=r&&{data:E},oAccessor:l,rAccessor:s,projection:"radial",pieceStyle:X,startAngle:u,...null!=m&&{cornerRadius:m},size:[H,B],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:J,enableHover:F,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...U,...Ye({title:O,description:W,summary:D,accessibleTable:N,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:p,defaultTooltipContent:K}),...Qe({linkedHover:b,selection:v,onObservation:x,onClick:w,hoverHighlight:k,mobileInteraction:z.mobileInteraction,customHoverBehavior:z.customHoverBehavior,customClickBehavior:z.customClickBehavior}),...f&&f.length>0&&{annotations:f},...Object.fromEntries(Object.entries(y).filter(([e])=>"pieceStyle"!==e))};return Z?za(Mt,{componentName:"PieChart",message:Z,width:H,height:B}):za(Bt,{componentName:"PieChart",width:H,height:B,children:za(_r,{ref:i,...ee})})});Va.displayName="PieChart";import{useMemo as Ga,forwardRef as qa,useRef as Xa}from"react";import{jsx as Ya}from"react/jsx-runtime";var Qa=qa(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:400,height:400}),i=Xa(null),{data:r,margin:a,className:n,categoryAccessor:l="category",valueAccessor:s="value",innerRadius:c,centerContent:h,colorBy:d,colorScheme:u,styleRules:m,startAngle:g=0,cornerRadius:p,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:F,height:$,enableHover:O,showLegend:W,title:D,description:N,summary:E,accessibleTable:j}=o,z=Ga(()=>Yt(r),[r]),V=d||l,G=ue({data:z,rawData:r,colorBy:V,colorScheme:u,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:V?["string"==typeof V?V:""]:[],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DonutChart",chartId:R,showLegend:W,userMargin:a,marginDefaults:o.marginDefaults,loading:P,loadingContent:C,emptyContent:_,width:F,height:$,hasTitle:!!D,axisChrome:{hasAxis:!1}}),q=c??Math.max(2,.15*Math.min(F,$)),X=Bo(),K=Ga(()=>new Map,[]),Z=Ga(()=>{let e=eo(s);return t=>{let o=e(t);return null==o?void 0:Math.abs(o)}},[s]),U=Q({colorBy:V,colorScale:G.colorScale,color:I,themeCategorical:X,colorScheme:u,categoryIndexMap:K,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:G.effectiveSelectionHook,resolvedSelection:G.resolvedSelection,cycleByCategory:!0,styleRules:m,resolveRuleValue:Z}),J=Ga(()=>Ze({categoryAccessor:l,valueAccessor:s,groupAccessor:d&&d!==l?d:void 0,groupLabel:"string"==typeof d?d:"group",pieData:!0,valueFormat:f}),[l,s,d,f]),ee=de({componentName:"DonutChart",data:r,accessors:{categoryAccessor:l,valueAccessor:s}}),{effectiveLegendProps:te,effectiveMargin:oe}=Y({ref:t,frameRef:i,setup:G});if(G.earlyReturn)return G.earlyReturn;let ie={chartType:"donut",...null!=r&&{data:z},oAccessor:l,rAccessor:s,projection:"radial",pieceStyle:U,innerRadius:q,startAngle:g,...null!=p&&{cornerRadius:p},centerContent:h,size:[F,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:oe,enableHover:O,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...te,...Ye({title:D,description:N,summary:E,accessibleTable:j,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:y,defaultTooltipContent:J}),...Qe({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:G.mobileInteraction,customHoverBehavior:G.customHoverBehavior,customClickBehavior:G.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return ee?Ya(Mt,{componentName:"DonutChart",message:ee,width:F,height:$}):Ya(Bt,{componentName:"DonutChart",width:F,height:$,children:Ya(_r,{ref:i,...ie})})});Qa.displayName="DonutChart";import{jsx as Ka,jsxs as Za}from"react/jsx-runtime";import{useMemo as Ua,forwardRef as Ja,useRef as en}from"react";import{jsx as tn,jsxs as on}from"react/jsx-runtime";var rn=Ja(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:!1,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:300,height:250}),i=en(null),r="context"===o.mode,{compactMode:a}=o,{value:n,min:l=0,max:s=100,thresholds:c,gradientFill:h,color:d,backgroundColor:u="var(--semiotic-grid, #e0e0e0)",arcWidth:m=.3,cornerRadius:g,showNeedle:p=!0,needleColor:f="var(--semiotic-text, #333)",centerContent:y,valueFormat:v,showScaleLabels:b=!a,sweep:x=240,fillZones:w=!0,tooltip:k,styleRules:A,annotations:S,frameProps:R={},className:P,stroke:C,strokeWidth:_,opacity:L}=e,{width:M,height:I,title:T,description:H,summary:B,accessibleTable:F}=o,$=Pe(h),O=Math.max(l,Math.min(s,n)),W=s-l||1,D=(O-l)/W,{gaugeData:N,pieceStyle:E,gaugeAnnotations:j}=Ua(()=>function(e){let{min:t,max:o,value:i,thresholds:r,fillColor:a,backgroundColor:n,fillZones:l,showScaleLabels:s,gradientFill:c,gradientSteps:h=240}=e,d=o-t||1,u=(Math.max(t,Math.min(o,i))-t)/d,m=r&&r.length>0?[...r].sort((e,t)=>e.value-t.value):[{value:o,color:a||"#007bff"}];m=m.map(e=>({...e,value:Math.max(t,Math.min(o,e.value))})),o>m[m.length-1].value&&m.push({value:o,color:m[m.length-1].color});let g=!!c&&c.stops.length>=2,p=[],f=new Map,y=[];if(g){let e=l?u:1,t=se("bg",0);if(p.push({category:t,value:1,_zone:"Track",_isFill:!1,_pctStart:0,_pct:1,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0}),f.set(t,{fill:n,opacity:.4}),e>0){let t=Math.max(1,Math.floor(h)),o=Math.max(1,Math.min(t,Math.round(e*t))),i=[];for(let t=0;o>t;t++)i.push(le(c.stops,e*(t+.5)/o,a||m[0]?.color||"#007bff"));let r=se("fill",0);p.push({category:r,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),f.set(r,{fill:i[0]||n})}}else{let e=t;for(let o=0;m.length>o;o++){let i=m[o],r=(i.value-e)/d,a=(e-t)/d,s=(i.value-t)/d,c=Math.max(0,(l?Math.min(u,s):s)-a),h=l?Math.max(0,r-c):0;if(c>0){let e=se("fill",o);p.push({category:e,value:c,_zone:i.label||"Zone "+(o+1),_isFill:!0}),f.set(e,{fill:i.color})}if(h>0){let e=se("bg",o);p.push({category:e,value:h,_zone:i.label||"Zone "+(o+1),_isFill:!1}),f.set(e,{fill:n,opacity:.4})}e=i.value}}if(s&&r&&r.length>0)for(let e of r)e.value>t&&o>e.value&&y.push({type:"gauge-label",value:e.value,label:e.label||e.value+""});return{gaugeData:p,pieceStyle:(e,t)=>f.get(t||e.category)||{fill:n},gaugeAnnotations:y}}({min:l,max:s,value:n,thresholds:c,fillColor:d,backgroundColor:u,fillZones:w,showScaleLabels:b,gradientFill:$}),[n,l,s,c,d,u,b,w,$]),z=Ua(()=>jt(E,A,(e,t)=>({value:"number"==typeof e.value?e.value:void 0,category:t??(null==e.category?void 0:e.category+"")})),[E,A]),V=Ua(()=>at(z,{stroke:C,strokeWidth:_,opacity:L}),[z,C,_,L]),{activeSelectionHook:G,customHoverBehavior:q,customClickBehavior:X}=_o({selection:e.selection,linkedHover:e.linkedHover,fallbackFields:["category"],onObservation:e.onObservation,chartType:"GaugeChart",chartId:e.chartId,onClick:e.onClick,hoverHighlight:e.hoverHighlight,colorByField:"category",mobileInteraction:o.mobileInteraction}),Y=ge(e.selection),Q=Ua(()=>Do(V,G,Y),[V,G,Y]),{sweepRad:K,startAngleDeg:Z}=ie(x),U=function(e=240){let{sweepRad:t,offsetRad:o}=ie(e),i=[[Math.cos(o),Math.sin(o)],[Math.cos(o+t),Math.sin(o+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)t+.001>=((e-o)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)&&i.push([Math.cos(e),Math.sin(e)]);let r=i.map(e=>e[0]),a=i.map(e=>e[1]),[n,l]=Jo(r),[s,c]=Jo(a);return{minX:n,maxX:l,minY:s,maxY:c,width:l-n,height:c-s,cx:(n+l)/2,cy:(s+c)/2}}(x),J=Math.min(10,Math.max(1,Math.min(M,I)/12)),ee=U.cx,te=U.cy,oe=Math.max(4,Math.min((M-2*J)/U.width,(I-2*J)/U.height)-2),re=Math.max(0,Math.min(oe-1.5,oe*(1-m))),ae=M/2-ee*oe,ne=I/2-te*oe,ce=2*(oe+4),he=Ua(()=>a&&null==y?null:null!=y?"function"==typeof y?y(O,l,s):y:function({value:e,min:t,max:o,radius:i,showScaleLabels:r}){let a=Math.max(16,.3*i);return Za("g",{textAnchor:"middle",children:[Ka("text",{y:0,dominantBaseline:"central",fontSize:a,fontWeight:700,fill:"var(--semiotic-text, #333)",children:e}),r&&Za("text",{y:.7*a+11,fontSize:11,fill:"var(--semiotic-text-secondary, #666)",children:[t," – ",o]})]})}({value:v?v(O):Math.round(O)+"",min:l,max:s,radius:oe,showScaleLabels:b}),[y,O,l,s,v,b,oe,a]),de=Ua(()=>r&&null==y?{type:"gauge-value",text:v?v(O):Math.round(O)+""}:null,[r,y,O,v]),ue=Ua(()=>{if(!p)return null;let e=-Math.PI/2+Z*Math.PI/180+D*K,t=re>20?re-8:oe-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:f}},[p,Z,D,K,re,oe,f]),me=Ua(()=>(e,t,o)=>{if("gauge-needle"===e.type){let i=(o.width||M)/2,r=(o.height||I)/2,a=Math.max(1,oe-re),n=Math.max(1,Math.min(2.5,.4*a)),l=Math.max(1,Math.min(5,.6*a));return on("g",{transform:`translate(${i},${r})`,children:[tn("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:n,strokeLinecap:"round"}),tn("circle",{cx:0,cy:0,r:l,fill:e.color})]},"gauge-needle-"+t)}if("gauge-label"===e.type){let i,r,a=-Math.PI/2+Z*Math.PI/180+(e.value-l)/W*K,n=(o.width||M)/2,s=(o.height||I)/2,c=re-1,h=oe+1,d=Math.cos(a)*c,u=Math.sin(a)*c,m=Math.cos(a)*h,g=Math.sin(a)*h,p=oe+10,f=Math.cos(a)*p,y=Math.sin(a)*p,v=((a+Math.PI/2)/(2*Math.PI)*12+12)%12;return v>=11||1>v?(i="middle",r="auto"):v>=1&&5>v?(i="start",r="middle"):v>=5&&7>v?(i="middle",r="hanging"):(i="end",r="middle"),on("g",{transform:`translate(${n},${s})`,children:[tn("line",{x1:d,y1:u,x2:m,y2:g,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),tn("text",{x:f,y:y,textAnchor:i,dominantBaseline:r,fill:"var(--semiotic-text-secondary, #666)",fontSize:10,style:{userSelect:"none",fontSize:"var(--semiotic-gauge-label-font-size, 10px)"},children:e.label})]},"gauge-label-"+t)}return"gauge-value"===e.type?tn("text",{x:(o.width||M)/2,y:(o.height||I)/2-.2*re,textAnchor:"middle",dominantBaseline:"middle",fontSize:Math.max(12,Math.min(22,.28*oe)),fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},"gauge-value-"+t):null},[M,I,l,W,Z,K,re,oe]),pe=Ua(()=>{let e=[...j,...S||[]];return ue&&e.push(ue),de&&e.push(de),e},[j,S,ue,de]),fe=Ua(()=>e=>{let t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;return on("div",{className:"semiotic-tooltip",style:{padding:"6px 10px",background:"var(--semiotic-tooltip-bg, white)",borderRadius:"var(--semiotic-tooltip-radius, 6px)",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0,0,0,0.15))"},children:[tn("div",{style:{fontWeight:600},children:o}),tn("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:i?"Current: "+Math.round(O):"Remaining"})]})},[O]),ye=uo(e.loading,M,I,e.loadingContent),ve=ye?null:co(Number.isFinite(n)?[{value:n}]:[],M,I,e.emptyContent);if(ye)return ye;if(ve)return ve;if(0===N.length)return tn(Mt,{componentName:"GaugeChart",message:"No data to display",width:M,height:I});let be={chartType:"donut",data:N,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:Q,innerRadius:re,startAngle:Z,sweepAngle:x,...null!=g&&{cornerRadius:g},centerContent:he,size:[M,I],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:{top:ne-ce/2,bottom:I-ne-ce/2,left:ae-ce/2,right:M-ae-ce/2},enableHover:o.enableHover,showAxes:!1,showCategoryTicks:!1,tooltipContent:!1===k?()=>null:oo(k)||fe,...Qe({linkedHover:e.linkedHover,selection:e.selection,onObservation:e.onObservation,onClick:e.onClick,hoverRadius:e.hoverRadius,hoverHighlight:e.hoverHighlight,mobileInteraction:o.mobileInteraction,customHoverBehavior:q,customClickBehavior:X}),svgAnnotationRules:me,...pe.length>0&&{annotations:pe},...T&&{title:T},...H&&{description:H},...B&&{summary:B},...void 0!==F&&{accessibleTable:F},...P&&{className:P},...null!=e.animate&&{animate:e.animate},...R};return tn(Bt,{componentName:"GaugeChart",width:M,height:I,children:tn(_r,{ref:i,...be})})});rn.displayName="GaugeChart";import{useMemo as an,forwardRef as nn,useRef as ln}from"react";import{jsx as sn}from"react/jsx-runtime";var cn=nn(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ln(null),{data:r,margin:a,className:n,categoryAccessor:l="category",groupBy:s,valueAccessor:c="value",orientation:h="vertical",valueFormat:d,colorBy:u,colorScheme:m,sort:g=!1,barPadding:p=60,roundedTop:f,gradientFill:y,styleRules:v,baselinePadding:b=!1,tooltip:x,annotations:w,valueExtent:k,frameProps:A={},selection:S,linkedHover:R,linkedBrush:P,brush:C,onBrush:_,onObservation:L,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:F,legendInteraction:$,legendPosition:O,color:W,stroke:D,strokeWidth:N,opacity:E,categoryFormat:j}=e,{width:z,height:V,enableHover:G,showGrid:q,showLegend:X,title:Z,description:U,summary:J,accessibleTable:ee,categoryLabel:te,valueLabel:oe}=o,ie=an(()=>Yt(r),[r]),re=u||s,ae=ue({data:ie,rawData:r,colorBy:re,colorScheme:m,legendInteraction:$,legendPosition:O,frameLegend:A,selection:S,linkedHover:R,fallbackFields:re?["string"==typeof re?re:""]:[],unwrapData:!0,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"GroupedBarChart",chartId:T,showLegend:X,userMargin:a,marginDefaults:o.marginDefaults,loading:H,loadingContent:B,emptyContent:F,width:z,height:V,hasTitle:!!Z,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!te,hasValueLabel:!!oe})}),ne=Bo(),le=an(()=>new Map,[]),se=an(()=>eo(c),[c]),ce=K({brushProp:C,onBrushProp:_,linkedBrush:P,valueAccessor:c}),he=Q({colorBy:re,colorScale:ae.colorScale,color:W,themeCategorical:ne,colorScheme:m,categoryIndexMap:le,userPieceStyle:A.pieceStyle,stroke:D,strokeWidth:N,opacity:E,styleRules:v,resolveRuleValue:se,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection}),me=an(()=>Ze({categoryAccessor:s,valueAccessor:c,groupAccessor:l,valueFormat:d}),[s,l,c,d]),ge=de({componentName:"GroupedBarChart",data:r,accessors:{categoryAccessor:l,valueAccessor:c},requiredProps:{groupBy:s}}),{effectiveLegendProps:pe,effectiveMargin:fe}=Y({ref:t,frameRef:i,setup:ae}),ye=an(()=>Ce(y),[y]);if(ae.earlyReturn)return ae.earlyReturn;let ve={chartType:"clusterbar",...null!=r&&{data:ie},oAccessor:l,rAccessor:c,groupBy:s,oSort:g,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:he,size:[z,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe,barPadding:p,...null!=f&&{roundedTop:f},...ye&&{gradientFill:ye},baselinePadding:b,enableHover:G,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:te,rLabel:oe,rFormat:d,...j&&{oFormat:j},showGrid:q,...pe,...Ye({title:Z,description:U,summary:J,accessibleTable:ee,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:x,defaultTooltipContent:me}),...Qe({linkedHover:R,selection:S,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...w&&w.length>0&&{annotations:w},...k&&{rExtent:k},...ce.brushStreamProps,...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return ge?sn(Mt,{componentName:"GroupedBarChart",message:ge,width:z,height:V}):sn(Bt,{componentName:"GroupedBarChart",width:z,height:V,children:sn(_r,{ref:i,...ve})})});cn.displayName="GroupedBarChart";import{useMemo as hn,forwardRef as dn,useRef as un}from"react";import{jsx as mn,jsxs as gn}from"react/jsx-runtime";var pn=dn(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:!1,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:!1,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=un(null);me(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,stepAccessor:l="step",valueAccessor:s="value",categoryAccessor:c,colorBy:h,colorScheme:d,styleRules:u,orientation:m="horizontal",connectorOpacity:g=.3,showLabels:p=!0,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B,categoryFormat:F}=e,$="vertical"===m,{width:O,height:W,enableHover:D,showLegend:N,title:E,description:j,summary:z,accessibleTable:V}=o,G=$?{top:E?60:40,right:20,bottom:60,left:60}:{top:E?40:10,right:10,bottom:10,left:10},q=hn(()=>Yt(r),[r]),X=h||c,Y=!X,K=ue({data:q,rawData:r,colorBy:X,colorScheme:d,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:X?["string"==typeof X?X:""]:[],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FunnelChart",chartId:R,showLegend:N,userMargin:a,marginDefaults:G,loading:P,loadingContent:C,emptyContent:_,width:O,height:W,hasTitle:!!E,axisChrome:po({showAxes:$&&o.showAxes,projection:$?"vertical":"horizontal",hasCategoryLabel:!1,hasValueLabel:!1})});Oo("FunnelChart",q,"stepAccessor",l),Oo("FunnelChart",q,"valueAccessor",s);let Z=Bo(),U=hn(()=>new Map,[]),J=hn(()=>eo(s),[s]),ee=hn(()=>{if(Y)return I||(Z?.[0]?Z[0]:Array.isArray(d)&&d[0]?d[0]:"#4e79a7")},[Y,I,Z,d]),te=Q({colorBy:ee?void 0:X,colorScale:K.colorScale,color:ee??I,themeCategorical:Z,colorScheme:d,categoryIndexMap:U,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:K.effectiveSelectionHook,resolvedSelection:K.resolvedSelection,styleRules:u,resolveRuleValue:J}),oe=hn(()=>e=>{let t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",r=t?.__funnelPercent??t?.__barFunnelPercent,a=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,n=t?.__barFunnelIsDropoff,l=t?.__barFunnelCategory??t?.category,s=null==r||a?"":` (${.05>Math.abs(r-Math.round(r))?Math.round(r)+"%":r.toFixed(1)+"%"})`;return gn("div",{className:"semiotic-tooltip",style:Xt,children:[o&&mn("div",{style:{fontWeight:"bold"},children:o+""}),l&&l!==o&&mn("div",{style:{marginTop:2,opacity:.8},children:l+""}),n&&mn("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),gn("div",{style:{marginTop:4},children:[!f||"number"!=typeof i&&"string"!=typeof i?i+"":f(i),s]})]})},[f]);if(K.earlyReturn)return K.earlyReturn;let ie=de({componentName:"FunnelChart",data:r,accessors:{stepAccessor:l,valueAccessor:s}});if(ie)return mn(Mt,{componentName:"FunnelChart",message:ie,width:O,height:W});let re={chartType:$?"bar-funnel":"funnel",...null!=r&&{data:q},oAccessor:l,rAccessor:s,...c&&{stackBy:c},projection:$?"vertical":"horizontal",barPadding:$?40:0,pieceStyle:te,size:[O,W],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:K.margin,enableHover:D,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:$&&o.showAxes,showCategoryTicks:$&&o.showAxes,...F&&{oFormat:F},...f&&{rFormat:f},showGrid:$,...!$&&{connectorOpacity:g},showLabels:p,...K.legendBehaviorProps,...E&&{title:E},...j&&{description:j},...z&&{summary:z},...void 0!==V&&{accessibleTable:V},...n&&{className:n},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===y?()=>null:!0===y||null==y?oe:oo(y)||oe,...Qe({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return mn(Bt,{componentName:"FunnelChart",width:O,height:W,children:mn(_r,{ref:i,...re})})});pn.displayName="FunnelChart";import{useMemo as fn,forwardRef as yn,useRef as vn}from"react";import{jsx as bn}from"react/jsx-runtime";var xn=yn(function(e,t){let o=vn(null);me(t,{variant:"xy",frameRef:o});let i=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:a,className:n,categoryAccessor:l="attribute",valueAccessor:s="value",seriesAccessor:c,colorBy:h,categoryFormat:d,colorScheme:u,styleRules:m,pointRadius:g=4,valueExtent:p,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:F,height:$,enableHover:O,showGrid:W,showLegend:D,title:N,description:E,summary:j,accessibleTable:z}=i,V=fn(()=>Yt(r),[r]),G=c||("string"==typeof h?h:void 0)||("function"==typeof h?h:void 0),q=G??"__radar",X=h||G,Y=ue({data:V,rawData:r,colorBy:X,colorScheme:u,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:["string"==typeof X?X:"","string"==typeof l?l:""].filter(Boolean),unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"RadarChart",chartId:R,showLegend:D,userMargin:a,marginDefaults:i.marginDefaults,loading:P,loadingContent:C,emptyContent:_,width:F,height:$,hasTitle:!!N,axisChrome:po({showAxes:!0,projection:"radial",hasCategoryLabel:!1,hasValueLabel:!1})}),K=Bo(),Z=fn(()=>new Map,[]),U=fn(()=>eo(s),[s]),J=Q({colorBy:X,colorScale:Y.colorScale,color:I,themeCategorical:K,colorScheme:u,categoryIndexMap:Z,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:Y.effectiveSelectionHook,resolvedSelection:Y.resolvedSelection,baseStyleExtras:{r:g,fillOpacity:.85},styleRules:m,resolveRuleValue:U}),ee=fn(()=>Ze({categoryAccessor:l,valueAccessor:s,groupAccessor:G,groupLabel:"string"==typeof G?G:"series",valueFormat:f}),[l,s,G,f]);if(Y.earlyReturn)return Y.earlyReturn;let te=de({componentName:"RadarChart",data:r,accessors:{categoryAccessor:l,valueAccessor:s}});if(te)return bn(Mt,{componentName:"RadarChart",message:te,width:F,height:$});let oe={chartType:"point",projection:"radial",...null!=r&&{data:V},oAccessor:l,rAccessor:s,connectorAccessor:q,connectorStyle:e=>{let t="function"==typeof J?J(e):{},o="string"==typeof t.fill?t.fill:void 0;return{fill:o,fillOpacity:.15,stroke:o,strokeWidth:2,opacity:.7}},pieceStyle:J,...d&&{oFormat:d},rExtent:p??[0],rFormat:f,oLabel:"",size:[F,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Y.margin,enableHover:O,showAxes:!0,showGrid:W,...Y.legendBehaviorProps,...Ye({title:N,description:E,summary:j,accessibleTable:z,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:y,defaultTooltipContent:ee}),...Qe({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:Y.mobileInteraction,customHoverBehavior:Y.customHoverBehavior,customClickBehavior:Y.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e&&"connectorStyle"!==e))};return bn(Bt,{componentName:"RadarChart",width:F,height:$,children:bn(_r,{ref:o,...oe})})});xn.displayName="RadarChart";import{useMemo as wn,forwardRef as kn,useRef as An}from"react";import{jsx as Sn}from"react/jsx-runtime";var Rn=kn(function(e,t){let o=Co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=An(null),{data:r,margin:a,className:n,categoryAccessor:l="category",subcategoryAccessor:s,valueAccessor:c="value",orientation:h="horizontal",valueFormat:d,colorBy:u,colorScheme:m,styleRules:g,barPadding:p,tooltip:f,annotations:y,brush:v,onBrush:b,linkedBrush:x,frameProps:w={},selection:k,linkedHover:A,onObservation:S,onClick:R,hoverHighlight:P,chartId:C,loading:_,loadingContent:L,emptyContent:M,legendInteraction:I,legendPosition:T,color:H,stroke:B,strokeWidth:F,opacity:$,categoryFormat:O,rTickValues:W,tickLabelEdgeAlign:D,showCategoryTicks:N,gradientFill:E,trackFill:j,roundedTop:z,valueExtent:V}=e,{width:G,height:q,enableHover:X,showGrid:Z,showLegend:U,title:J,description:ee,summary:te,accessibleTable:oe,categoryLabel:ie,valueLabel:re}=o,ae=wn(()=>Yt(r),[r]),ne=u||s,le=wn(()=>{if(null!=p)return p;if("sparkline"!==o.mode)return 40;let e=new Set(ae.map(e=>"function"==typeof l?l(e):e[l])),t=Math.max(1,e.size);return t>1?Math.max(0,Math.min(1,(("horizontal"===h?q:G)-2*t)/(t-1))):1},[p,o.mode,ae,l,h,G,q]),se=ue({data:ae,rawData:r,colorBy:ne,colorScheme:m,legendInteraction:I,legendPosition:T,frameLegend:w,selection:k,linkedHover:A,fallbackFields:ne?["string"==typeof ne?ne:""]:[],unwrapData:!0,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"SwimlaneChart",chartId:C,showLegend:U,userMargin:a,marginDefaults:o.marginDefaults,loading:_,loadingContent:L,emptyContent:M,width:G,height:q,hasTitle:!!J,axisChrome:po({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!1!==N&&!!ie,hasValueLabel:!!re})}),ce=K({brushProp:v,onBrushProp:b,linkedBrush:x,valueAccessor:c}),he=Bo(),me=wn(()=>new Map,[]),ge=wn(()=>eo(c),[c]),pe=Q({colorBy:ne,colorScale:se.colorScale,color:H,themeCategorical:he,colorScheme:m,categoryIndexMap:me,userPieceStyle:w?.pieceStyle,stroke:B,strokeWidth:F,opacity:$,effectiveSelectionHook:se.effectiveSelectionHook,resolvedSelection:se.resolvedSelection,cycleByCategory:!0,styleRules:g,resolveRuleValue:ge}),fe=wn(()=>Ze({categoryAccessor:s,valueAccessor:c,groupAccessor:l,valueFormat:d}),[s,l,c,d]),ye=de({componentName:"SwimlaneChart",data:r,accessors:{categoryAccessor:l,valueAccessor:c,subcategoryAccessor:s},requiredProps:{subcategoryAccessor:s}}),{effectiveLegendProps:ve,effectiveMargin:be}=Y({ref:t,frameRef:i,setup:se}),xe=wn(()=>Ce(E),[E]);if(se.earlyReturn)return se.earlyReturn;let we={chartType:"swimlane",...null!=r&&{data:ae},oAccessor:l,rAccessor:c,stackBy:s,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:pe,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be,barPadding:le,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:!1===N?void 0:ie,rLabel:re,rFormat:d,...W&&{rTickValues:W},...null!=D&&{tickLabelEdgeAlign:D},...O&&{oFormat:O},...void 0!==N&&{showCategoryTicks:N},showGrid:Z,...ve,...Ye({title:J,description:ee,summary:te,accessibleTable:oe,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ue({tooltip:f,defaultTooltipContent:fe}),...Qe({linkedHover:A,selection:k,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:se.mobileInteraction,customHoverBehavior:se.customHoverBehavior,customClickBehavior:se.customClickBehavior}),...y&&y.length>0&&{annotations:y},...xe&&{gradientFill:xe},...null!=j&&{trackFill:j},...null!=z&&{roundedTop:z},...V&&{rExtent:V},...ce.brushStreamProps,...Object.fromEntries(Object.entries(w).filter(([e])=>"pieceStyle"!==e))};return ye?Sn(Mt,{componentName:"SwimlaneChart",message:ye,width:G,height:q}):Sn(Bt,{componentName:"SwimlaneChart",width:G,height:q,children:Sn(_r,{ref:i,...we})})});Rn.displayName="SwimlaneChart";import{forwardRef as Pn,useMemo as Cn}from"react";import{jsx as _n}from"react/jsx-runtime";var Ln=Pn(function(e,t){let{data:o,layout:i,layoutConfig:r,onLayoutError:a,categoryAccessor:n="category",valueAccessor:l="value",oExtent:s,rExtent:c,projection:h="vertical",margin:d,className:u,colorBy:m,colorScheme:g,tooltip:p,showAxes:f=!1,annotations:y,onObservation:v,onClick:b,selection:x,linkedHover:w,chartId:k,loading:A,loadingContent:S,emptyContent:R,frameProps:P={}}=e,{frameRef:C,resolved:_,safeData:L,setup:M,earlyReturn:I}=he({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:o,colorBy:m,colorScheme:g,frameLegend:P,selection:x,linkedHover:w,onObservation:v,onClick:b,chartId:k,loading:A,loadingContent:S,emptyContent:R,margin:d,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),T=M.effectiveSelectionHook,H=Cn(()=>T?.isActive?{isActive:!0,predicate:T.predicate}:null,[T?.isActive,T?.predicate]),B=Cn(()=>oo(p),[p]);if(I)return I;let{width:F,height:$,enableHover:O,showGrid:W,title:D,description:N,summary:E,accessibleTable:j}=_,z={chartType:"custom",...null!=o&&{data:L},customLayout:i,layoutConfig:r,onLayoutError:a,...H&&{layoutSelection:H},oAccessor:n,rAccessor:l,oExtent:s,rExtent:c,projection:h,colorAccessor:m,colorScheme:g,size:[F,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:M.margin,enableHover:O,showAxes:f,showGrid:W,annotations:y,...Ye({title:D,description:N,summary:E,accessibleTable:j,className:u,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===p?{tooltipContent:()=>null}:B?{tooltipContent:B}:{},...M.legendBehaviorProps,...Qe({linkedHover:w,selection:x,onObservation:v,onClick:b,hoverHighlight:!1,mobileInteraction:M.mobileInteraction,customHoverBehavior:M.customHoverBehavior,customClickBehavior:M.customClickBehavior}),...P};return _n(Bt,{componentName:"OrdinalCustomChart",width:F,height:$,children:_n(_r,{ref:C,...z})})});Ln.displayName="OrdinalCustomChart";export{_r as StreamOrdinalFrame_default,Wr as BarChart,zr as StackedBarChart,aa as LikertChart,ha as SwarmPlot,ya as BoxPlot,Sa as Histogram,La as ViolinPlot,Ba as RidgelinePlot,Da as DotPlot,Va as PieChart,Qa as DonutChart,rn as GaugeChart,cn as GroupedBarChart,pn as FunnelChart,xn as RadarChart,Rn as SwimlaneChart,Ln as OrdinalCustomChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{customXYPlugin as m}from"./c-E72OTUZU.min.js";import"./c-LESEUVC5.min.js";import"./c-R2P4RR7Q.min.js";import"./c-SJMWU6UX.min.js";import"./c-MOKJOIPE.min.js";import"./c-PSKKFZNP.min.js";import"./c-KKPMHAZC.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-MB6CV5NC.min.js";export{m as customXYPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0})}function t(){return Object.create(null)}function n(e,t){return e.slice(0,t+1).map(e=>e.replaceAll("%","%25").replaceAll(">","%3E")).join(">")}function r(e,t,n){return t.has(e)?"node":(function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(r=n.nodeIdsBySection,o=e)?r[o]:void 0)?"section":"global";var r,o}function o(n,o,i){let s=[],u=new Set(o.nodes.map(e=>e.id)),a=new Set;for(let e of o.measureValues){let t=n.measures[e.measureId];if(!t)continue;let o=r(e.subjectId,u,i);s.push({measureId:e.measureId,subjectId:e.subjectId,subjectKind:o,value:e.value,status:e.status,unitKind:t.unitKind,countUnit:t.countUnit,timeDenominator:t.timeDenominator}),"section"===o&&a.add(`${e.measureId}\0${e.subjectId}`)}let c=t();for(let t of o.nodes)e(c,t.id,t);let d=t(),l=t();for(let e of s){if("node"!==e.subjectKind)continue;let t=c[e.subjectId];if(!t?.sectionId)continue;let n=`${e.measureId}\0${t.sectionId}`;a.has(n)||(d[n]=(d[n]??0)+e.value,"exact"!==e.status?l[n]=e.status:l[n]||(l[n]="exact"))}for(let[e,t]of Object.entries(d)){let r=e.split("\0"),o=r[0],i=n.measures[o];i&&s.push({measureId:o,subjectId:r[1],subjectKind:"section",value:t,status:l[e]??"exact",unitKind:i.unitKind,countUnit:i.countUnit,timeDenominator:i.timeDenominator})}return{entries:s}}function i(e,t,n){return e.entries.find(e=>e.measureId===t&&e.subjectId===n)}function s(e,t=[],n){let r=void 0===n?void 0:new Set("string"==typeof n?[n]:n),o=t.filter(e=>!e.missingPrehistory&&void 0!==e.partition&&r?.has(e.partition)),i=new Set(o.map(e=>e.id)),s=new Set(o.map(e=>e.entityId)),u=new Map,a=0;for(let t of e){if(void 0!==n&&"string"==typeof t.roles.occurrence&&!i.has(t.roles.occurrence))continue;let e=Object.entries(t.entityWeights);0===e.length&&void 0===n&&(a+=t.entityCount);for(let[t,r]of e)(void 0===n||s.has(t))&&u.set(t,r)}return[...u.values()].reduce((e,t)=>e+t,a)}function u(e){let t=e.spec.comparison;if(!t)return;let n=t.partitions.map(n=>{let r=i(e.ledger,t.denominatorMeasureId,n)?.value??0,o={};return o["repeated-state-episode"]=s(e.motifs.matches.filter(e=>"repeated-state-episode"===e.template),e.source.occurrences,n),{partition:n,assigned:r,motifUsers:o,outcomes:{purchases:i(e.ledger,"purchases",n)?.value??0}}});return{partitions:[...t.partitions],denominatorMeasureId:t.denominatorMeasureId,referencePartition:t.referencePartition,rows:n}}function a(e,t){let n=e.spec.comparison?.denominatorMeasureId??e.spec.motifs.denominatorRef??"assigned";return i(e.ledger,n,t)?.value}function c(e,t,n){return 0===n||1e4*e%n!=0?Math.round((t-e)/Math.max(n,1)*1e4):1e4*(t-e)/n}function d(e,t){return t.length>0&&e.some((n,r)=>t.every((t,n)=>e[r+n]===t))}function l(e){let t=[];for(let n of e.occurrences??[]){if(n.missingPrehistory)continue;let e=n.nodePath;for(let r=0;e.length-1>r;r++)t.push({from:e[r],to:e[r+1],via:r>0?e[r-1]:void 0,occurrenceIds:[n.id]})}return{hops:t,graphAdjacency:e.edges.map(e=>({source:e.source,target:e.target,edgeId:e.id}))}}function f(e,t){for(let n=0;t.length-1>n;n++)if(!e.edges.some(e=>e.source===t[n]&&e.target===t[n+1]))return!1;return t.length>0}function m(e,t){return t.length>=2&&(e.occurrences??[]).some(e=>!e.missingPrehistory&&d(e.nodePath,t))}function p(e,t,n){let r=new Set;for(let o of e.occurrences??[]){if(o.missingPrehistory)continue;let e=o.nodePath;for(let o=0;e.length-1>o;o++)e[o]===t&&(null!=n&&(0===o||e[o-1]!==n)||r.add(e[o+1]))}return[...r]}export{s as countMotifEntities,e as setOwnValue,t as idDictionary,n as prefixIdFor,o as buildLedger,i as ledgerValue,u as buildComparison,a as assignedDenominator,c as signedDifferenceBps,d as containsRoute,l as buildRouteSupportIndex,f as graphWalkExists,m as isSupportedRoute,p as nextSupportedNodes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(t){return null==t?"null":Array.isArray(t)?`[${t.map(e).join(",")}]`:t instanceof Date?JSON.stringify(t):"object"==typeof t?`{${Object.entries(t).filter(([,e])=>void 0!==e).sort(([e],[t])=>t>e?-1:e>t?1:0).map(([t,r])=>`${JSON.stringify(t)}:${e(r)}`).join(",")}}`:JSON.stringify(t)}function t(t){return r(e(t))}function r(e){let t=[...me],r=Array.from((new TextEncoder).encode(e)),i=8*r.length;for(r.push(128);r.length%64!=56;)r.push(0);let n=Math.floor(i/4294967296),a=i>>>0;r.push(n>>>24&255,n>>>16&255,n>>>8&255,255&n,a>>>24&255,a>>>16&255,a>>>8&255,255&a);let o=[];for(let e=0;r.length>e;e+=4)o.push((r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0);for(let e=0;o.length>e;e+=16){let r=[...o.slice(e,e+16)];for(let e=16;64>e;e+=1){let t=pe(r[e-15],7)^pe(r[e-15],18)^r[e-15]>>>3,i=pe(r[e-2],17)^pe(r[e-2],19)^r[e-2]>>>10;r[e]=r[e-16]+t+r[e-7]+i>>>0}let[i,n,a,s,l,c,u,d]=t;for(let e=0;64>e;e+=1){let t=d+(pe(l,6)^pe(l,11)^pe(l,25))+(l&c^~l&u)+he[e]+r[e]>>>0,o=i&n^i&a^n&a;d=u,u=c,c=l,l=s+t>>>0,s=a,a=n,n=i,i=t+((pe(i,2)^pe(i,13)^pe(i,22))+o>>>0)>>>0}let p=[i,n,a,s,l,c,u,d];for(let e=0;8>e;e+=1)t[e]=t[e]+p[e]>>>0}return t.map(e=>e.toString(16).padStart(8,"0")).join("")}function i(e,t){return`${e}[Symbol(${t.description??""})]`}function n(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let r=Number(e);return Number.isSafeInteger(r)&&r>=0&&t>r}function a(e,t){return"number"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t}function o(e){return e.sort((e,t)=>{let r=JSON.stringify(e),i=JSON.stringify(t);return i>r?-1:r>i?1:0})}function s(e,t,r){if(null===e)return null;if(e instanceof Date){let i=e.getTime();return Number.isFinite(i)?{$type:"date",value:e.toISOString()}:void r.excluded.push(t)}switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isNaN(e)?{$type:"number",value:"NaN"}:e===1/0?{$type:"number",value:"Infinity"}:e===-1/0?{$type:"number",value:"-Infinity"}:Object.is(e,-0)?{$type:"number",value:"-0"}:e;case"bigint":return{$type:"bigint",value:""+e};case"undefined":case"function":case"symbol":return void r.excluded.push(t);case"object":{let o=e;if(r.ancestors.has(o))return void r.excluded.push(t);r.ancestors.add(o);try{if(Array.isArray(e)){for(let o of Reflect.ownKeys(e))"length"===o||"string"==typeof o&&n(o,e.length)||r.excluded.push("symbol"==typeof o?i(t,o):a(t,o));return Array.from({length:e.length},(i,n)=>{let o=a(t,n),l=Object.getOwnPropertyDescriptor(e,n+"");if(!l||!("value"in l)||!l.enumerable)return r.excluded.push(o),null;let c=s(l.value,o,r);return void 0===c?null:c})}let o={},l=Object.getPrototypeOf(e);if(l!==Object.prototype&&null!==l)return void r.excluded.push(t);let c=[];for(let n of Reflect.ownKeys(e)){if("symbol"==typeof n){r.excluded.push(i(t,n));continue}let o=Object.getOwnPropertyDescriptor(e,n);o&&"value"in o&&o.enumerable?c.push(n):r.excluded.push(a(t,n))}for(let i of c.sort()){let n=Object.getOwnPropertyDescriptor(e,i),l=s(n&&"value"in n?n.value:void 0,a(t,i),r);void 0!==l&&Object.defineProperty(o,i,{value:l,enumerable:!0,configurable:!0,writable:!0})}return o}finally{r.ancestors.delete(o)}}default:return void r.excluded.push(t)}}function l(e,t=new Set){if(null===e)return["null"];if(e instanceof Date)return Number.isFinite(e.getTime())?["date",e.toISOString()]:["excluded"];switch(typeof e){case"string":return["string",e];case"boolean":return["boolean",e];case"number":return["number",Number.isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":Object.is(e,-0)?"-0":e+""];case"bigint":return["bigint",""+e];case"undefined":case"function":case"symbol":return["excluded"];case"object":if(t.has(e))return["excluded"];t.add(e);try{let r=r=>{let i="symbol"==typeof r?["symbol-key",r.description??""]:["string-key",r],n=Object.getOwnPropertyDescriptor(e,r);return n?"value"in n?[i,"data",!!n.enumerable,l(n.value,t)]:[i,"accessor",!!n.enumerable,!!n.get,!!n.set]:[i,"missing"]};if(Array.isArray(e))return["array",Array.from({length:e.length},(t,i)=>{let n=i+"";return Object.prototype.hasOwnProperty.call(e,n)?r(n):["hole"]}),o(Reflect.ownKeys(e).filter(t=>"length"!==t&&!("string"==typeof t&&n(t,e.length))).map(r))];let i=Object.getPrototypeOf(e);return[i!==Object.prototype&&null!==i?"non-json-object":"object",o(Reflect.ownKeys(e).map(r))]}finally{t.delete(e)}default:return["excluded"]}}function c(e){let t={excluded:[],ancestors:new Set},r=s(e,"$",t)??null;return{value:r,text:JSON.stringify(r),excludedPaths:t.excluded}}function u(e){let t=c(e),i=r(JSON.stringify(["semiotic-value-fingerprint","v2",l(e)]));return{...t,algorithm:"sha256",digest:i,fingerprint:"sha256:"+i}}function d(e,t){return"number"==typeof t?`${e}[${t}]`:`${e}.${t}`}function p(e,t){return`${e}[Symbol(${t.description??""})]`}function f(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let r=Number(e);return Number.isSafeInteger(r)&&r>=0&&t>r}function m(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return}}function h(e,t,r,i){let n=m(e,t);return n&&"value"in n&&n.enumerable?y(n.value,r,i):[r]}function y(e,t="$",r=new Set){if(null===e||"string"==typeof e||"boolean"==typeof e)return[];if("number"==typeof e)return Number.isFinite(e)&&!Object.is(e,-0)?[]:[t];if("object"!=typeof e)return[t];if(r.has(e))return[t];let i,n,a;try{a=Array.isArray(e),i=Object.getPrototypeOf(e),n=Reflect.ownKeys(e)}catch{return[t]}if(i!==(a?Array.prototype:Object.prototype)&&null!==i)return[t];r.add(e);let o=[];try{if(a){let i=m(e,"length")?.value;if(!Number.isSafeInteger(i)||0>i)return[d(t,"length")];for(let e of n)"length"===e||"string"==typeof e&&f(e,i)||o.push("symbol"==typeof e?p(t,e):d(t,e));for(let n=0;i>n;n+=1)o.push(...h(e,n+"",d(t,n),r))}else for(let i of n)"symbol"!=typeof i?o.push(...h(e,i,d(t,i),r)):o.push(p(t,i));return o}catch{return[t]}finally{r.delete(e)}}function v(e,t,r,i){A(e,Object.keys(t),r,i);for(let[n,a]of Object.entries(t))a.values?(a.required||void 0!==e[n])&&E(e,n,r,a.values,i):a.required?j(e,n,r,i):M(e,n,r,i)}function $(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function g(e,t,r,i){void 0!==e[t]&&("number"!=typeof e[t]||!Number.isFinite(e[t]))&&i.push({path:`${r}.${t}`,message:"Expected a finite number."})}function b(e,t,r,i){void 0!==e[t]&&"boolean"!=typeof e[t]&&i.push({path:`${r}.${t}`,message:"Expected a boolean."})}function w(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(w):$(e)&&Object.values(e).every(w))}function x(e,t,r,i){void 0!==e[t]&&(!$(e[t])||!w(e[t]))&&i.push({path:`${r}.${t}`,message:"Expected a JSON object."})}function A(e,t,r,i){let n=new Set(t);for(let t of Object.keys(e))n.has(t)||i.push({path:`${r}.${t}`,message:"Unexpected property."})}function j(e,t,r,i){("string"!=typeof e[t]||!e[t])&&i.push({path:`${r}.${t}`,message:"Expected a non-empty string."})}function E(e,t,r,i,n){("string"!=typeof e[t]||!i.includes(e[t]))&&n.push({path:`${r}.${t}`,message:`Expected one of: ${i.join(", ")}.`})}function k(e,t,r,i){let n=e[t];if(void 0!==n)return $(n)?n:void i.push({path:`${r}.${t}`,message:"Expected an object."})}function B(e,t,r,i){let n=e[t];if(void 0!==n)return Array.isArray(n)?n:void i.push({path:`${r}.${t}`,message:"Expected an array."})}function I(e,t,r){e?.some(e=>"string"!=typeof e||!e)&&r.push({path:t,message:"Expected non-empty string values."})}function O(e,t,r,i,n){void 0!==e[t]&&E(e,t,r,i,n)}function M(e,t,r,i){void 0!==e[t]&&"string"!=typeof e[t]&&i.push({path:`${r}.${t}`,message:"Expected a string."})}function P(e,t,r){$(e)?(A(e,["id","name","kind"],t,r),j(e,"kind",t,r),M(e,"id",t,r),M(e,"name",t,r)):r.push({path:t,message:"Expected an actor object."})}function N(e){for(let t of Object.values(e))Object.freeze(t.suppliedBy),Object.freeze(t);return Object.freeze(e)}function S(e){try{return function(e){let t=[],r=[];if(!$(e))return{valid:!1,errors:[{path:"$",message:"Expected an object."}],warnings:r};let i=y(e);if(i.length>0)return{valid:!1,errors:i.map(e=>({path:e,message:"Expected a JSON-compatible value that survives serialization unchanged."})),warnings:r};if(A(e,["contractVersion","artifact","purpose","claims","evidence","time","reception","form","contestability","accountability","inheritance","fieldStatus","extensions"],"$",t),"0.1"!==e.contractVersion&&t.push({path:"$.contractVersion",message:"Expected contract version 0.1."}),$(e.artifact)){A(e.artifact,["id","kind","component","title","createdAt","configFingerprint","dataFingerprint","revision"],"$.artifact",t),j(e.artifact,"id","$.artifact",t),E(e.artifact,"kind","$.artifact",["chart","dashboard","story","alert","agent-answer"],t);for(let r of["component","title","createdAt","configFingerprint","dataFingerprint","revision"])M(e.artifact,r,"$.artifact",t)}else t.push({path:"$.artifact",message:"Expected an artifact identity object."});if($(e.purpose))if(Array.isArray(e.purpose.intents)){A(e.purpose,["intents","communicativeAct","decisionContext","stakes","allowedUses","prohibitedUses"],"$.purpose",t),e.purpose.intents.forEach((e,r)=>{(!$(e)||"string"!=typeof e.id||!e.id)&&t.push({path:`$.purpose.intents[${r}].id`,message:"Expected a non-empty intent identifier."}),$(e)&&A(e,["id","strength","source","rationale"],`$.purpose.intents[${r}]`,t),$(e)&&void 0!==e.strength&&E(e,"strength",`$.purpose.intents[${r}]`,["primary","secondary"],t),$(e)&&(O(e,"source",`$.purpose.intents[${r}]`,["author","derived","model-proposal","import"],t),M(e,"rationale",`$.purpose.intents[${r}]`,t))});for(let r of["allowedUses","prohibitedUses"])I(B(e.purpose,r,"$.purpose",t),"$.purpose."+r,t);O(e.purpose,"stakes","$.purpose",["exploratory","informational","operational","high"],t),M(e.purpose,"communicativeAct","$.purpose",t),M(e.purpose,"decisionContext","$.purpose",t)}else t.push({path:"$.purpose.intents",message:"Expected an intent array."});else t.push({path:"$.purpose",message:"Expected a purpose object."});Array.isArray(e.claims)?e.claims.forEach((e,r)=>{if(!$(e))return void t.push({path:`$.claims[${r}]`,message:"Expected a claim object."});A(e,["id","text","kind","status","evidenceIds","scope","uncertainty","asOf","supersedes","authoredBy","review","tags"],`$.claims[${r}]`,t),j(e,"id",`$.claims[${r}]`,t),E(e,"kind",`$.claims[${r}]`,["description","observation","aggregation","inference","forecast","simulation","alert","recommendation","normative"],t),E(e,"status",`$.claims[${r}]`,["supported","provisional","disputed","superseded","retracted","unsupported","unknown"],t),Array.isArray(e.evidenceIds)?e.evidenceIds.some(e=>"string"!=typeof e||!e)&&t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected non-empty string evidence identifiers."}):t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected an evidence identifier array."}),I(B(e,"supersedes",`$.claims[${r}]`,t),`$.claims[${r}].supersedes`,t),M(e,"text",`$.claims[${r}]`,t),M(e,"asOf",`$.claims[${r}]`,t),x(e,"scope",`$.claims[${r}]`,t),I(B(e,"tags",`$.claims[${r}]`,t),`$.claims[${r}].tags`,t),void 0!==e.authoredBy&&P(e.authoredBy,`$.claims[${r}].authoredBy`,t);let i=k(e,"review",`$.claims[${r}]`,t);i&&(A(i,["status","reviewer","reviewedAt","rationale"],`$.claims[${r}].review`,t),E(i,"status",`$.claims[${r}].review`,["proposed","reviewed","approved","rejected"],t),void 0!==i.reviewer&&P(i.reviewer,`$.claims[${r}].review.reviewer`,t),M(i,"reviewedAt",`$.claims[${r}].review`,t),M(i,"rationale",`$.claims[${r}].review`,t));let n=k(e,"uncertainty",`$.claims[${r}]`,t);if(n){A(n,["kind","lower","upper","confidence","unit","description"],`$.claims[${r}].uncertainty`,t),E(n,"kind",`$.claims[${r}].uncertainty`,["interval","distribution","qualitative","unknown"],t);for(let e of["lower","upper","confidence"])g(n,e,`$.claims[${r}].uncertainty`,t);M(n,"unit",`$.claims[${r}].uncertainty`,t),M(n,"description",`$.claims[${r}].uncertainty`,t)}}):t.push({path:"$.claims",message:"Expected a claim array."}),Array.isArray(e.evidence)?e.evidence.forEach((e,r)=>{if(!$(e))return void t.push({path:`$.evidence[${r}]`,message:"Expected an evidence object."});A(e,["id","role","label","source","fingerprint","dataVersion","observedAt","scope","sample","transformation","generatedClaimId","relationship"],`$.evidence[${r}]`,t),j(e,"id",`$.evidence[${r}]`,t),E(e,"role",`$.evidence[${r}]`,["source-data","external-source","transformation","statistical-test","model-output","human-observation","policy-rule","quality-check"],t);for(let i of["label","fingerprint","dataVersion","observedAt","generatedClaimId"])M(e,i,`$.evidence[${r}]`,t);x(e,"scope",`$.evidence[${r}]`,t);let i=k(e,"source",`$.evidence[${r}]`,t);if(i){A(i,["name","uri","version","retrievedAt","publisher"],`$.evidence[${r}].source`,t);for(let e of["name","uri","version","retrievedAt","publisher"])M(i,e,`$.evidence[${r}].source`,t)}let n=k(e,"transformation",`$.evidence[${r}]`,t);if(n){A(n,["id","kind","description","inputEvidenceIds","parameters","assumptions","implementation","performedAt","performedBy"],`$.evidence[${r}].transformation`,t),j(n,"id",`$.evidence[${r}].transformation`,t),E(n,"kind",`$.evidence[${r}].transformation`,["aggregation","filter","normalization","binning","join","smoothing","forecasting","simulation","other"],t);let e=B(n,"inputEvidenceIds",`$.evidence[${r}].transformation`,t);e?I(e,`$.evidence[${r}].transformation.inputEvidenceIds`,t):t.push({path:`$.evidence[${r}].transformation.inputEvidenceIds`,message:"Expected an evidence identifier array."}),I(B(n,"assumptions",`$.evidence[${r}].transformation`,t),`$.evidence[${r}].transformation.assumptions`,t),M(n,"description",`$.evidence[${r}].transformation`,t),M(n,"implementation",`$.evidence[${r}].transformation`,t),M(n,"performedAt",`$.evidence[${r}].transformation`,t),x(n,"parameters",`$.evidence[${r}].transformation`,t),void 0!==n.performedBy&&P(n.performedBy,`$.evidence[${r}].transformation.performedBy`,t)}let a=k(e,"sample",`$.evidence[${r}]`,t);if(a){A(a,["rowCount","fields","values","truncated"],`$.evidence[${r}].sample`,t),I(B(a,"fields",`$.evidence[${r}].sample`,t),`$.evidence[${r}].sample.fields`,t);let e=B(a,"values",`$.evidence[${r}].sample`,t);e&&!function(e){return e.every(w)}(e)&&t.push({path:`$.evidence[${r}].sample.values`,message:"Expected JSON values."}),g(a,"rowCount",`$.evidence[${r}].sample`,t),b(a,"truncated",`$.evidence[${r}].sample`,t)}O(e,"relationship",`$.evidence[${r}]`,["descriptive","correlational","causal","unknown"],t)}):t.push({path:"$.evidence",message:"Expected an evidence array."}),function(e,t){if(void 0===e||$(e)){if($(e))for(let[r,i]of Object.entries(e)){let e="$.fieldStatus."+r;if(!$(i)||"string"!=typeof i.status){t.push({path:e,message:"Expected a field state with a status."});continue}A(i,["status","reason","suppliedBy","derived","reviewedBy"],e,t),["known","unknown","manual","not-applicable"].includes(i.status)||t.push({path:e+".status",message:"Expected one of: known, unknown, manual, not-applicable."}),void 0!==i.suppliedBy&&("string"!=typeof i.suppliedBy||!["author","system","model-proposal","import"].includes(i.suppliedBy))&&t.push({path:e+".suppliedBy",message:"Expected one of: author, system, model-proposal, import."}),M(i,"reason",e,t),M(i,"reviewedBy",e,t),b(i,"derived",e,t);let n=Object.prototype.hasOwnProperty.call(ye,r)?ye[r]:void 0,a="model-proposal"===i.suppliedBy,o=a&&!0===n?.modelMayPropose&&"known"!==i.status;n&&"known"===i.status&&"string"!=typeof i.suppliedBy&&t.push({path:e+".suppliedBy",message:`Known field "${r}" must identify an allowed supplier.`}),n&&"string"==typeof i.suppliedBy&&!o&&!n.suppliedBy.includes(i.suppliedBy)&&t.push({path:e+".suppliedBy",message:`Field "${r}" cannot be supplied by ${i.suppliedBy}.`}),n&&!0===i.derived&&!n.derivable&&t.push({path:e+".derived",message:`Field "${r}" cannot be marked as derived.`}),n&&a&&(!n.modelMayPropose||"known"===i.status)&&t.push({path:e+".suppliedBy",message:"known"===i.status?`A model proposal cannot finalize field "${r}" as known.`:`Field "${r}" does not accept model proposals.`}),"required"===n?.humanReview&&"known"===i.status&&("string"!=typeof i.reviewedBy||!i.reviewedBy.trim())&&t.push({path:e+".reviewedBy",message:`Known field "${r}" requires an attributable human review.`})}}else t.push({path:"$.fieldStatus",message:"Expected a field-state object."})}(e.fieldStatus,t);let n=k(e,"time","$",t);return n&&function(e,t){let r="$.time";A(e,[...ge,...Object.keys(be),"sources"],r,t);for(let i of ge)M(e,i,r,t);for(let[i,n]of Object.entries(be)){let a=k(e,i,r,t);a&&v(a,n,`${r}.${i}`,t)}B(e,"sources",r,t)?.forEach((e,i)=>{let n=`${r}.sources[${i}]`;$(e)?v(e,we,n,t):t.push({path:n,message:"Expected a source object."})})}(n,t),function(e,t){(function(e,t){let r=k(e,"reception","$",t);if(!r)return;A(r,["channels","audience","strengths","risks","scaffolds","description","dataFallback","manualChecks"],"$.reception",t);let i=B(r,"channels","$.reception",t);i||t.push({path:"$.reception.channels",message:"Expected a reception-channel array."}),i?.forEach((e,r)=>{let i=`$.reception.channels[${r}]`;$(e)?(A(e,["channel","disclosure","navigation","interactionInstructions","rawData","tokenBudget","privacyNotes"],i,t),E(e,"channel",i,["visual","screen-reader","sonified","agent","print","low-bandwidth"],t),O(e,"disclosure",i,["summary","standard","detailed"],t),O(e,"rawData",i,["deny","bounded","allow"],t),b(e,"navigation",i,t),b(e,"interactionInstructions",i,t),g(e,"tokenBudget",i,t),I(B(e,"privacyNotes",i,t),i+".privacyNotes",t)):t.push({path:i,message:"Expected a channel object."})});for(let e of["strengths","risks","scaffolds","manualChecks"])I(B(r,e,"$.reception",t),"$.reception."+e,t);M(r,"audience","$.reception",t),M(r,"description","$.reception",t),b(r,"dataFallback","$.reception",t)})(e,t),function(e,t){let r=k(e,"form","$",t);r&&(A(r,["chartFamily","whyThisForm","rejectedAlternatives","risks","misuse"],"$.form",t),M(r,"chartFamily","$.form",t),M(r,"whyThisForm","$.form",t),I(B(r,"risks","$.form",t),"$.form.risks",t),I(B(r,"misuse","$.form",t),"$.form.misuse",t),B(r,"rejectedAlternatives","$.form",t)?.forEach((e,r)=>{let i=`$.form.rejectedAlternatives[${r}]`;$(e)?(A(e,["representation","reason"],i,t),j(e,"representation",i,t),j(e,"reason",i,t)):t.push({path:i,message:"Expected an alternative object."})}))}(e,t),function(e,t){let r=k(e,"contestability","$",t);r&&(A(r,["sourceRequestsAllowed","alternativeViews","challenges","corrections","editorialExceptions"],"$.contestability",t),b(r,"sourceRequestsAllowed","$.contestability",t),B(r,"challenges","$.contestability",t)?.forEach((e,r)=>{let i=`$.contestability.challenges[${r}]`;if($(e)){A(e,["id","claimId","status","reason","raisedBy","raisedAt","counterclaimId","resolution"],i,t),j(e,"id",i,t),j(e,"claimId",i,t),j(e,"reason",i,t),E(e,"status",i,["open","accepted","declined","resolved"],t),void 0!==e.raisedBy&&P(e.raisedBy,i+".raisedBy",t);for(let r of["raisedAt","counterclaimId","resolution"])M(e,r,i,t)}else t.push({path:i,message:"Expected a challenge object."})}),B(r,"corrections","$.contestability",t)?.forEach((e,r)=>{let i=`$.contestability.corrections[${r}]`;if(!$(e))return void t.push({path:i,message:"Expected a correction object."});A(e,["id","affectedClaimIds","replacementClaimIds","reason","createdAt","createdBy"],i,t),j(e,"id",i,t),j(e,"reason",i,t);let n=B(e,"affectedClaimIds",i,t);n||t.push({path:i+".affectedClaimIds",message:"Expected an affected-claim array."}),I(n,i+".affectedClaimIds",t),I(B(e,"replacementClaimIds",i,t),i+".replacementClaimIds",t),M(e,"createdAt",i,t),void 0!==e.createdBy&&P(e.createdBy,i+".createdBy",t)}),B(r,"alternativeViews","$.contestability",t)?.forEach((e,r)=>{let i=`$.contestability.alternativeViews[${r}]`;$(e)?(A(e,["id","label","rationale"],i,t),j(e,"id",i,t),j(e,"label",i,t),M(e,"rationale",i,t)):t.push({path:i,message:"Expected an alternative-view object."})}),B(r,"editorialExceptions","$.contestability",t)?.forEach((e,r)=>{let i=`$.contestability.editorialExceptions[${r}]`;$(e)?(A(e,["ruleId","rationale","owner","reviewAt"],i,t),j(e,"ruleId",i,t),j(e,"rationale",i,t),M(e,"owner",i,t),M(e,"reviewAt",i,t)):t.push({path:i,message:"Expected an editorial-exception object."})}))}(e,t),function(e,t){let r=k(e,"accountability","$",t);r&&(A(r,["authors","generatedBy","dataSources","codeRef","reviews","actions"],"$.accountability",t),B(r,"authors","$.accountability",t)?.forEach((e,r)=>P(e,`$.accountability.authors[${r}]`,t)),I(B(r,"dataSources","$.accountability",t),"$.accountability.dataSources",t),M(r,"generatedBy","$.accountability",t),M(r,"codeRef","$.accountability",t),B(r,"reviews","$.accountability",t)?.forEach((e,r)=>{let i=`$.accountability.reviews[${r}]`;if($(e)){A(e,["id","status","reviewer","reviewedAt","rationale","policyId"],i,t),j(e,"id",i,t),E(e,"status",i,["pending","approved","changes-requested","rejected"],t),void 0!==e.reviewer&&P(e.reviewer,i+".reviewer",t);for(let r of["reviewedAt","rationale","policyId"])M(e,r,i,t)}else t.push({path:i,message:"Expected a review object."})}),B(r,"actions","$.accountability",t)?.forEach((e,r)=>{let i=`$.accountability.actions[${r}]`;if(!$(e))return void t.push({path:i,message:"Expected an action object."});A(e,["id","action","actor","actedAt","claimIds","artifactId","artifactRevision","policyId","status","invalidatedByClaimId"],i,t),j(e,"id",i,t),j(e,"action",i,t);let n=B(e,"claimIds",i,t);n||t.push({path:i+".claimIds",message:"Expected a claim identifier array."}),I(n,i+".claimIds",t),void 0!==e.actor&&P(e.actor,i+".actor",t);for(let r of["actedAt","artifactId","artifactRevision","policyId","invalidatedByClaimId"])M(e,r,i,t);O(e,"status",i,["proposed","taken","reversed","invalidated"],t)}))}(e,t),function(e,t){let r=k(e,"inheritance","$",t);if(r){A(r,["requiredPaths","prohibitedExports","privacy","rawDataDefault","preservation","sourceArtifactIds"],"$.inheritance",t);for(let e of["requiredPaths","prohibitedExports","sourceArtifactIds"])I(B(r,e,"$.inheritance",t),"$.inheritance."+e,t);O(r,"privacy","$.inheritance",["public","restricted","confidential","unknown"],t),O(r,"rawDataDefault","$.inheritance",["exclude","bounded","include"],t),O(r,"preservation","$.inheritance",["full-fidelity","claim-evidence-preserved","visual-only","lossy","unknown"],t)}}(e,t)}(e,t),x(e,"extensions","$",t),Array.isArray(e.claims)&&0===e.claims.length&&r.push({path:"$.claims",message:"The contract declares no claims."}),Array.isArray(e.evidence)&&0===e.evidence.length&&r.push({path:"$.evidence",message:"The contract declares no evidence."}),{valid:0===t.length,errors:t,warnings:r}}(e)}catch{return{valid:!1,errors:[{path:"$",message:"Artifact contract could not be inspected safely."}],warnings:[]}}}function R(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function F(e,t={}){try{return function(e,t){if(!R(e))return{transfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["Artifact contract must be a JSON object."]}};let r=c(e),i=[...new Set([...r.excludedPaths,...y(e)])].sort(),n=r.value,a=function(e,t){if(!t||!R(e)||!Array.isArray(e.evidence))return[];let r=[];return e.evidence.forEach((e,t)=>{R(e)&&Object.prototype.hasOwnProperty.call(e,"sample")&&(delete e.sample,r.push(`$.evidence[${t}].sample`))}),r}(n,t.excludeEvidenceSamples),o=a.length?["Bounded evidence samples were excluded by the transfer policy."]:[],s=n?.contractVersion;if("string"!=typeof s||!s)return{contract:n,transfer:{status:"invalid",omittedPaths:[...i,...a],warnings:["Artifact contract is missing a string contractVersion.",...o]}};if("0.1"!==s)return{contract:n,transfer:{status:i.length>0?"invalid":"unsupported-version",omittedPaths:[...i,...a],warnings:[`Contract version ${s} is not interpreted by this runtime.`,...i.length>0?[`Non-JSON values could not be preserved at: ${i.join(", ")}.`]:[],...o]}};let l=S(n),u=[...l.errors.map(({path:e,message:t})=>`${e}: ${t}`),...l.warnings.map(({path:e,message:t})=>`${e}: ${t}`),...i.length?[`Non-JSON values could not be preserved at: ${i.join(", ")}.`]:[],...o];return{contract:n,transfer:{status:!l.valid||i.length>0?"invalid":a.length>0?"excluded":"preserved",omittedPaths:[...i,...a],warnings:u}}}(e,t)}catch{let t=y(e);return{transfer:{status:"invalid",omittedPaths:t.length?t:["$"],warnings:["Artifact contract could not be inspected safely."]}}}}function q(e){let t=F(e);if(!t.contract||"preserved"!==t.transfer.status)throw new TypeError(t.transfer.warnings.join(" ")||"Artifact contract could not be serialized without loss.");return t}function C(e,t){return xe.has(e)&&!("reading"===e&&"string"==typeof t)}function D(e){let t=Object.entries(e).filter(([e,t])=>C(e,t)&&void 0!==t);if(0!==t.length)return 1===t.length&&"data"===t[0][0]?t[0][1]:Object.fromEntries(t)}function T(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!C(e,t)&&"recipeId"!==e))}function J(e,t,r,i=D(t)){let n=T(t),a=0===y(n).length?u(n).fingerprint:void 0,o=void 0!==i&&0===y(i).length?function(e,t=[]){if(void 0===e)return;let r=t.filter(e=>!!e.transformation).map(({id:e,transformation:t})=>({evidenceId:e,transformation:t})).sort(({evidenceId:e},{evidenceId:t})=>t>e?-1:e>t?1:0);return u(r.length>0?{data:e,transformations:r}:e).fingerprint}(i,e.evidence):void 0,s="ChartRecipe"===r&&"string"==typeof t.recipeId?t.recipeId:r,l=[],c=[];return void 0!==s&&(void 0===e.artifact.component?c.push("artifact.component"):e.artifact.component!==s&&l.push("artifact.component")),void 0===e.artifact.configFingerprint||void 0===a?c.push("artifact.configFingerprint"):e.artifact.configFingerprint!==a&&l.push("artifact.configFingerprint"),void 0!==e.artifact.dataFingerprint&&o?e.artifact.dataFingerprint!==o&&l.push("artifact.dataFingerprint"):c.push("artifact.dataFingerprint"),{status:l.length>0?"mismatch":c.length>0?"unknown":"match",mismatchPaths:l,unknownPaths:c}}function V(e,t){return e===t}function z(e,t){if("function"==typeof e)return t=>+e(t);let r=e||t;return e=>+e[r]}function K(e,t){if("function"==typeof e)return e;let r=e||t;return e=>e[r]}function U(e,t){return"function"==typeof e?t=>e(t)+"":e?t=>t[e]+"":t?e=>e[t]+"":void 0}function L(e){return e?"function"==typeof e?e:t=>t[e]||t.id:null}function _(e){return"string"==typeof e?e:e.id}function Q(e){let[t,r]=e,i=160>t||116>r,n=i?Math.min(12,Math.max(2,.08*t)):32,a=i?Math.min(8,Math.max(2,.12*r)):24,o=i?a:34;return{width:t,height:r,plot:{x:n,y:a,width:Math.max(1,t-2*n),height:Math.max(1,r-a-o)}}}function W(e){let t=(e??"")+"";if(!t)return"#4e79a7";let r=["#4e79a7","#59a14f","#e15759","#f28e2b","#76b7b2","#edc948","#b07aa1","#ff9da7"],i=0;for(let e=0;t.length>e;e+=1)i=31*i+t.charCodeAt(e)>>>0;return r[i%r.length]}function Y(e,t="#4e79a7",r){let i=r?.styleRules,n=!!i&&i.length>0,a=n?ue(r?.valueAccessor):void 0;return r=>{let o=r.datum,s=o&&e?"function"==typeof e?e(o,0):o[e]:void 0,l={fill:null==s?t:W(s),stroke:"#111827",strokeWidth:1,opacity:.9};return n&&o&&Object.assign(l,de(o,i,{value:a?a(o):void 0,category:null==s?void 0:s+""})),l}}function Z(e,t,r,i){return{fixedDt:1/120,maxSubsteps:8,colliders:t,observation:{chartType:r},kernel:{seed:e,gravity:{x:0,y:760},cellSize:36,collisionIterations:6,velocityDamping:.995,restitution:.08,friction:.4,sleepSpeed:8,sleepAfter:.6,...i}}}function G(e,t,r){return"function"==typeof r?r(e,t):e[r]}function H(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function X(e,t,r){return Math.max(t,Math.min(r,e))}function ee(e,t){let r=H(e);return null!=r&&r>0?r:t}function te(e){if(!e)return;let t=H(e[0]),r=H(e[1]);return null!=t&&null!=r?t>r?[r,t]:[t,r]:void 0}function re(e){return((e??"unknown")+"").trim().replace(/[^A-Za-z0-9_-]+/g,"_")||"unknown"}function ie(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function ne(e){let t=Math.max(2,Math.round(e.bins)),r=Math.max(1,Math.round(e.pegRows??t-1)),i=Math.max(1,Math.round(e.count??Math.max(64,4*t))),n=X(Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,0,1),a=ie(e.seed??1),o=e.idPrefix??"mechanical";return Array.from({length:i},(e,t)=>{let i=0;for(let e=0;r>e;e+=1)a()<n&&(i+=1);let s=r/2;return{id:`${o}-${t}`,value:i,mechanical:!0,pegRows:r,branchProbability:n,pathRights:i,side:s>i?"left":i>s?"right":"center"}})}function ae(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>(e+"").trim()).filter(Boolean),r=t.length?t:["Intake"],i=Math.max(r.length,Math.round(e.count??Math.max(48,12*r.length))),n=ee(e.unitValue,1),a=ie(e.seed??1),o=e.idPrefix??"mechanical-pile",s=r.map(()=>.65+.9*a()),l=s.reduce((e,t)=>e+t,0)||1,c=i-r.length,u=s.map(e=>e/l*c),d=u.map(e=>1+Math.floor(e)),p=i-d.reduce((e,t)=>e+t,0),f=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;p>0;e=(e+1)%f.length)d[f[e].index]+=1,p-=1;return r.map((e,t)=>({id:`${o}-${t}`,category:e,value:d[t]*n,mechanical:!0,unitCount:d[t],unitValue:n,share:d[t]/i}))}function oe(e,t){let r=e/t,i=Math.round(r);return Math.ceil(i>0&&Number.EPSILON*r*4>=Math.abs(r-i)?i:r)}function se(e,t={}){let r=!0===t.showRetractedAnnotations,i=!0===t.showSupersededAnnotations,n=new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&n.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;let t=e?.provenance?.stableId;return!(t&&n.has(t)&&!i)})}function le(e,t,r=0){let i=new Set(e.filter(e=>null!=e.id).map(e=>e.id+"")),n=new Map;for(let a of e){let e=null==a.id?`${t}-${r++}`:a.id+"";for(;null==a.id&&i.has(e);)e=`${t}-${r++}`;i.add(e),n.set(e,null==a.id?{...a,id:e}:a)}return{seed:e,rows:Array.from(n.values()),nextId:r}}function ce(e){let{windowSize:t,watermark:r,watermarkAtArrivalAccessor:i}=e;if(!Number.isFinite(t)||0>=t)throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:n}=le(e.data,"event"),a=n.flatMap((t,r)=>{let i=H(G(t,r,e.timeAccessor));return null==i?[]:[{datum:t,index:r,eventTime:i,arrivalTime:H(G(t,r,e.arrivalAccessor))??i,watermarkAtArrival:0,late:!1}]}),o="function"==typeof r?null:H(r?.value),s="function"==typeof r?t:H(r?.delay)??t,l=-1/0,c=-1/0;for(let e of a.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){l=Math.max(l,e.eventTime);let n="function"==typeof r?H(r(l)):l-s;c=o??Math.max(c,n??l-t);let a=i?H(G(e.datum,e.index,i)):null;e.watermarkAtArrival=a??c,e.late=e.watermarkAtArrival>=(Math.floor(e.eventTime/t)+1)*t}return{events:a,watermarkValue:a.length?c:o??-s}}import{makeRuleValueResolver as ue,resolveStyleRules as de}from"./c-I4QJ6YLM.min.js";var pe=(e,t)=>(e>>>t|e<<32-t)>>>0,fe=e=>Math.floor(4294967296*(e-Math.floor(e)))>>>0,[me,he]=(()=>{let e=[],t=[];for(let r=2;64>t.length;r+=1){let i=!0;for(let e=2;r>=e*e;e+=1)if(r%e===0){i=!1;break}i&&(8>e.length&&e.push(fe(Math.sqrt(r))),t.push(fe(Math.cbrt(r))))}return[e,t]})(),ye=N({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}}),ve=["fresh","stale","unknown"],$e=["partial","provisional","settled","unknown"],ge=["observedAt","ingestedAt","processedAt","publishedAt","snapshotAt"],be={eventTime:{field:{},value:{},timezone:{},granularity:{}},presentation:{state:{values:["live","historical","mixed"]},label:{}},freshness:{status:{required:!0,values:ve},checkedAt:{},heartbeatAt:{},expiresAt:{},basis:{}},watermark:{value:{required:!0},policy:{},allowedLateness:{}},window:{start:{required:!0},end:{required:!0},status:{required:!0,values:["open","provisional","settled","reopened","corrected"]}},completeness:{status:{required:!0,values:$e},basis:{}},revision:{status:{required:!0,values:["original","backfilled","corrected","superseded"]},previousArtifactId:{},correctionId:{},reason:{}},snapshot:{id:{},format:{values:["iceberg","delta","other"]},schemaVersion:{},catalogRef:{}}},we={id:{required:!0},kind:{required:!0,values:["stream","processing-job","quality-check","snapshot","publication"]},label:{},observedAt:{},version:{},timezone:{},granularity:{},freshness:{values:ve},completeness:{values:$e}},xe=new Set(["data","nodes","edges","points","areas","lines","flows","atlas","forest","circuit","edition","reading"]);export{t as stableEvidenceHash,u as fingerprintValue,y as nonJsonValuePaths,F as serializeArtifactContract,q as requireSerializableArtifactContract,C as isChartDataProp,D as artifactDataValue,T as artifactConfigurationValue,J as compareArtifactIdentity,Q as physicsChartArea,Y as styleFromColorAccessor,Z as baseConfig,G as readAccessor,H as finiteNumber,X as clampNumber,ee as positiveNumber,te as normalizedFiniteExtent,re as safeIdPart,ie as seededRandom,ne as generateGaltonMechanicalSamples,le as createPhysicsSourceState,ce as resolveEventDropAdmissions,ae as generatePhysicsPileMechanicalSamples,oe as physicsPileUnitCount,V as accessorsEquivalent,z as resolveAccessor,K as resolveRawAccessor,U as resolveStringAccessor,L as resolveLabelFn,_ as resolveNodeRefId,se as filterAnnotationsByStatus};
|