semiotic 3.9.0 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -90
- package/agent-skill/semiotic-charts/SKILL.md +14 -10
- package/ai/componentMetadata.cjs +13 -3
- package/ai/dist/mcp-server.js +140 -36407
- package/ai/examples.md +109 -6
- package/ai/reference.md +55 -18
- package/ai/schema.json +5964 -1190
- package/ai/surface-manifest.json +51 -7
- package/ai/system-prompt.md +16 -3
- package/dist/c-3SCUN5HI.min.js +1 -0
- package/dist/c-3VVKFA4M.min.js +1 -0
- package/dist/c-43TJZS3F.min.js +1 -0
- package/dist/c-4DTZPSUD.min.js +1 -0
- package/dist/c-4ES5367Y.min.js +1 -0
- package/dist/c-54IRWOGM.min.js +1 -0
- package/dist/c-5D2S4RMI.min.js +1 -0
- package/dist/c-5JWCTX3G.min.js +1 -0
- package/dist/c-6CMMSN6N.min.js +1 -0
- package/dist/c-6HRB2L7H.min.js +1 -0
- package/dist/c-7W4SV36A.min.js +1 -0
- package/dist/c-A4WRGZFX.min.js +1 -0
- package/dist/c-AG7WWVIH.min.js +1 -0
- package/dist/c-AH6J4MTN.min.js +1 -0
- package/dist/c-ALYR5LKK.min.js +1 -0
- package/dist/c-BYDPC44I.min.js +1 -0
- package/dist/c-CFFIU2MW.min.js +1 -0
- package/dist/c-CGNHBHCE.min.js +1 -0
- package/dist/c-CJYSXIFV.min.js +1 -0
- package/dist/c-CKLIFCGN.min.js +1 -0
- package/dist/c-CZF7MV67.min.js +1 -0
- package/dist/c-D53OKBSY.min.js +1 -0
- package/dist/c-DBQ2V7CH.min.js +1 -0
- package/dist/c-DPMVAUAW.min.js +1 -0
- package/dist/c-ECJCKLYY.min.js +1 -0
- package/dist/c-EGATGOWJ.min.js +1 -0
- package/dist/c-EGR6VYBW.min.js +1 -0
- package/dist/c-ENF72HU5.min.js +1 -0
- package/dist/c-ESNR43AN.min.js +1 -0
- package/dist/c-F3LIKINL.min.js +1 -0
- package/dist/c-F5ZB5GJ6.min.js +1 -0
- package/dist/c-G3VYMHKE.min.js +1 -0
- package/dist/c-GR6MOEQC.min.js +1 -0
- package/dist/c-GSVCN34B.min.js +1 -0
- package/dist/c-GYOQCEFP.min.js +1 -0
- package/dist/c-H3DNMTCC.min.js +1 -0
- package/dist/c-I6J3FEZE.min.js +1 -0
- package/dist/c-IGH6MGJ5.min.js +1 -0
- package/dist/c-II2EEAJN.min.js +1 -0
- package/dist/c-J6M4JHRS.min.js +1 -0
- package/dist/c-JM3MGLQV.min.js +1 -0
- package/dist/c-KM3N7F7R.min.js +1 -0
- package/dist/c-LF5BZFNC.min.js +1 -0
- package/dist/c-LKBSGFQC.min.js +1 -0
- package/dist/c-NDJADPIF.min.js +1 -0
- package/dist/c-NVPQCIL5.min.js +1 -0
- package/dist/c-OFWJBEE5.min.js +1 -0
- package/dist/c-OYFHP5F5.min.js +1 -0
- package/dist/c-PGKQGGQ2.min.js +1 -0
- package/dist/c-Q2IPZ3MU.min.js +1 -0
- package/dist/c-QKHMBE2E.min.js +1 -0
- package/dist/c-QMVM3AY6.min.js +1 -0
- package/dist/c-QSGWX53A.min.js +1 -0
- package/dist/c-RJKEKZOO.min.js +1 -0
- package/dist/c-SFDIIU5G.min.js +1 -0
- package/dist/c-SRTBCRVE.min.js +1 -0
- package/dist/c-T6UAIKBH.min.js +1 -0
- package/dist/c-TMCTEVVW.min.js +1 -0
- package/dist/c-TMOSJLT3.min.js +1 -0
- package/dist/c-U6ESPM7V.min.js +1 -0
- package/dist/c-UC5PTTFI.min.js +1 -0
- package/dist/c-VGKUEZBC.min.js +1 -0
- package/dist/c-VN2HG5BS.min.js +1 -0
- package/dist/{c-J5G56TUH.min.js → c-VPZDY5Q4.min.js} +1 -1
- package/dist/c-VRXUB2F2.min.js +1 -0
- package/dist/c-VUBQNQJH.min.js +1 -0
- package/dist/c-VUH4PGZY.min.js +1 -0
- package/dist/c-XDRV7RKW.min.js +1 -0
- package/dist/c-YGZHURXZ.min.js +1 -0
- package/dist/components/Annotation.d.ts +1 -1
- package/dist/components/access/chartAccessCapabilities.generated.d.ts +14 -0
- package/dist/components/access/chartAccessContract.d.ts +90 -0
- package/dist/components/access/chartAccessContractFixtures.d.ts +11 -0
- package/dist/components/ai/aestheticProfileTypes.d.ts +35 -0
- package/dist/components/ai/annotationProvenance.d.ts +2 -7
- package/dist/components/ai/auditVisualHierarchy.d.ts +49 -0
- package/dist/components/ai/builtInChartRecipeLayouts.d.ts +2 -0
- package/dist/components/ai/builtInChartRecipePublic.d.ts +4 -0
- package/dist/components/ai/builtInChartRecipes.d.ts +26 -0
- package/dist/components/ai/chartCapabilities.d.ts +3 -1
- package/dist/components/ai/chartRecipeRegistry.d.ts +2 -1
- package/dist/components/ai/chartRecipes.d.ts +6 -0
- package/dist/components/ai/colorEvidence.d.ts +12 -0
- package/dist/components/ai/evaluateAesthetics.d.ts +47 -0
- package/dist/components/ai/geoNavigation.d.ts +4 -0
- package/dist/components/ai/hierarchyNavigation.d.ts +4 -0
- package/dist/components/ai/navigationTree.d.ts +7 -1
- package/dist/components/ai/qualityFixtures.d.ts +8 -0
- package/dist/components/ai/suggestionPropContracts.d.ts +1 -1
- package/dist/components/ai/useNavigationSync.d.ts +3 -3
- package/dist/components/charts/index.d.ts +4 -0
- package/dist/components/charts/network/ChordDiagram.d.ts +5 -1
- package/dist/components/charts/network/CirclePack.d.ts +8 -1
- package/dist/components/charts/network/OrbitDiagram.d.ts +9 -0
- package/dist/components/charts/network/TreeDiagram.d.ts +8 -1
- package/dist/components/charts/network/Treemap.d.ts +8 -1
- package/dist/components/charts/ordinal/BarChart.d.ts +6 -0
- package/dist/components/charts/ordinal/BoxPlot.d.ts +3 -0
- package/dist/components/charts/ordinal/DonutChart.d.ts +3 -0
- package/dist/components/charts/ordinal/DotPlot.d.ts +3 -0
- package/dist/components/charts/ordinal/FunnelChart.d.ts +3 -0
- package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
- package/dist/components/charts/ordinal/Histogram.d.ts +3 -0
- package/dist/components/charts/ordinal/LikertChart.d.ts +3 -0
- package/dist/components/charts/ordinal/PieChart.d.ts +3 -0
- package/dist/components/charts/ordinal/RadarChart.capability.d.ts +2 -0
- package/dist/components/charts/ordinal/RadarChart.d.ts +75 -0
- package/dist/components/charts/ordinal/RidgelinePlot.d.ts +3 -0
- package/dist/components/charts/ordinal/SwarmPlot.d.ts +3 -0
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +3 -0
- package/dist/components/charts/ordinal/ViolinPlot.d.ts +3 -0
- package/dist/components/charts/physics/GauntletChart.d.ts +1 -5
- package/dist/components/charts/physics/chainReactionTypes.d.ts +3 -0
- package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
- package/dist/components/charts/physics/physicsHocUtils.d.ts +7 -1
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +10 -1
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +11 -1
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +14 -5
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +7 -1
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +7 -1
- package/dist/components/charts/realtime/aggregate.d.ts +12 -1
- package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +4 -2
- package/dist/components/charts/realtime/realtimeStyleRules.d.ts +4 -0
- package/dist/components/charts/shared/annotationStatusFilter.d.ts +18 -0
- package/dist/components/charts/shared/chartDefinitionPilot.d.ts +5 -4
- package/dist/components/charts/shared/chartSpecCore.d.ts +2 -2
- package/dist/components/charts/shared/heatmapStyleRules.d.ts +13 -0
- package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
- package/dist/components/charts/shared/networkUtils.d.ts +14 -0
- package/dist/components/charts/shared/selectionUtils.d.ts +3 -1
- package/dist/components/charts/shared/types.d.ts +4 -2
- package/dist/components/charts/shared/useChartLegend.d.ts +2 -1
- package/dist/components/charts/shared/useLikertAggregation.d.ts +8 -2
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +9 -5
- package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +1 -1
- package/dist/components/charts/shared/useXYBrush.d.ts +24 -0
- package/dist/components/charts/xy/Heatmap.d.ts +16 -0
- package/dist/components/charts/xy/LineChart.d.ts +9 -0
- package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
- package/dist/components/charts/xy/WaterfallChart.capability.d.ts +2 -0
- package/dist/components/charts/xy/WaterfallChart.d.ts +68 -0
- package/dist/components/evidence/chartEvidenceEnvelope.d.ts +146 -0
- package/dist/components/evidence/evidenceGate.d.ts +28 -0
- package/dist/components/realtime/BinAccumulator.d.ts +5 -1
- package/dist/components/realtime/types.d.ts +16 -7
- package/dist/components/recipes/adjacencyFlow.d.ts +12 -0
- package/dist/components/recipes/adjacencyFlowAggregation.d.ts +72 -0
- package/dist/components/recipes/adjacencyFlowGeometry.d.ts +79 -0
- package/dist/components/recipes/lineageDag.d.ts +17 -0
- package/dist/components/recipes/lineageDagHulls.d.ts +22 -0
- package/dist/components/recipes/transitDiagram.d.ts +75 -0
- package/dist/components/recipes/transitDiagramGeometry.d.ts +47 -0
- package/dist/components/semiotic-access.d.ts +9 -0
- package/dist/components/semiotic-ai-audits.d.ts +17 -0
- package/dist/components/semiotic-ai-core.d.ts +9 -0
- package/dist/components/semiotic-ai.d.ts +5 -17
- package/dist/components/semiotic-evidence.d.ts +10 -0
- package/dist/components/semiotic-line.d.ts +9 -0
- package/dist/components/semiotic-network.d.ts +3 -0
- package/dist/components/semiotic-ordinal.d.ts +2 -0
- package/dist/components/semiotic-realtime-core.d.ts +3 -2
- package/dist/components/semiotic-recipes-core.d.ts +6 -0
- package/dist/components/semiotic-themes-core.d.ts +3 -0
- package/dist/components/semiotic-utils-core.d.ts +5 -0
- package/dist/components/semiotic-utils.d.ts +1 -1
- package/dist/components/semiotic-xy.d.ts +3 -0
- package/dist/components/semiotic.d.ts +9 -3
- package/dist/components/server/renderDashboard.d.ts +37 -0
- package/dist/components/server/renderEvidence.d.ts +27 -0
- package/dist/components/server/renderToStaticSVG.d.ts +2 -30
- package/dist/components/server/serverChartConfigShared.d.ts +13 -0
- package/dist/components/server/serverChartConfigs.d.ts +9 -0
- package/dist/components/server/serverChartConfigsComposite.d.ts +4 -0
- package/dist/components/server/serverChartConfigsCustom.d.ts +2 -0
- package/dist/components/server/serverChartConfigsGeo.d.ts +1 -0
- package/dist/components/server/serverChartConfigsOrdinal.d.ts +3 -2
- package/dist/components/server/serverChartConfigsXY.d.ts +1 -0
- package/dist/components/server/serverChartConfigsXYExtra.d.ts +3 -0
- package/dist/components/server/serverCompositeChainReaction.d.ts +3 -0
- package/dist/components/server/serverOrdinalGauge.d.ts +3 -0
- package/dist/components/server/serverOrdinalLikert.d.ts +2 -0
- package/dist/components/store/selectionProvenance.d.ts +8 -0
- package/dist/components/store/themeCore.d.ts +5 -1
- package/dist/components/stream/GeoPipelineStore.d.ts +1 -1
- package/dist/components/stream/MarginalGraphics.d.ts +3 -3
- package/dist/components/stream/MarginalGraphicsLazy.d.ts +22 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +2 -0
- package/dist/components/stream/OrdinalPipelineStore.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +1 -1
- package/dist/components/stream/SceneToSVG.d.ts +1 -1
- package/dist/components/stream/canvasSetup.d.ts +8 -2
- package/dist/components/stream/customLayoutAttempt.d.ts +21 -0
- package/dist/components/stream/geoTypes.d.ts +1 -1
- package/dist/components/stream/isServerEnvironment.d.ts +6 -0
- package/dist/components/stream/layouts/forceLayoutNodeSize.d.ts +12 -0
- package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +2 -9
- package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +2 -21
- package/dist/components/stream/layouts/forceLayoutWorkerPolicy.d.ts +21 -0
- package/dist/components/stream/layouts/index.d.ts +6 -12
- package/dist/components/stream/layouts/missingPlugin.d.ts +7 -0
- package/dist/components/stream/layouts/registerBuiltIn.d.ts +1 -0
- package/dist/components/stream/layouts/registry.d.ts +12 -0
- package/dist/components/stream/marginalConfig.d.ts +3 -0
- package/dist/components/stream/networkCustomLayout.d.ts +7 -0
- package/dist/components/stream/networkCustomLayoutOutput.d.ts +13 -0
- package/dist/components/stream/networkCustomLayoutRunner.d.ts +1 -1
- package/dist/components/stream/networkTypes.d.ts +5 -1
- package/dist/components/stream/ordinalTypes.d.ts +1 -1
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +1 -1
- package/dist/components/stream/pipelineDomainResolution.d.ts +6 -0
- package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +4 -0
- package/dist/components/stream/renderers/resolveCSSColor.d.ts +4 -4
- package/dist/components/stream/types.d.ts +8 -1
- package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +18 -0
- package/dist/components/stream/useMarginalValues.d.ts +13 -0
- package/dist/components/stream/xyCanvasRenderers.d.ts +4 -4
- package/dist/components/stream/xyPlugins/areaPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/barPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/candlestickPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/customPlugin.d.ts +6 -0
- package/dist/components/stream/xyPlugins/heatmapPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/lineFamily.d.ts +5 -0
- package/dist/components/stream/xyPlugins/linePlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/missingPlugin.d.ts +7 -0
- package/dist/components/stream/xyPlugins/mixedPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/pointPlugin.d.ts +3 -0
- package/dist/components/stream/xyPlugins/registerBuiltIn.d.ts +1 -0
- package/dist/components/stream/xyPlugins/registry.d.ts +31 -0
- package/dist/components/stream/xyPlugins/stackedAreaPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/swarmPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/waterfallPlugin.d.ts +2 -0
- package/dist/forceLayoutWorker.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.module.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-access.d.ts +9 -0
- package/dist/semiotic-access.min.js +2 -0
- package/dist/semiotic-access.module.min.js +2 -0
- package/dist/semiotic-ai-core.d.ts +9 -0
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +5 -17
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-evidence.d.ts +10 -0
- package/dist/semiotic-evidence.min.js +1 -0
- package/dist/semiotic-evidence.module.min.js +1 -0
- 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-line.d.ts +9 -0
- package/dist/semiotic-line.min.js +2 -0
- package/dist/semiotic-line.module.min.js +2 -0
- package/dist/semiotic-network.d.ts +3 -0
- package/dist/semiotic-ordinal.d.ts +2 -0
- package/dist/semiotic-realtime-core.d.ts +3 -2
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +6 -0
- package/dist/semiotic-recipes-core.module.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-themes-core.d.ts +3 -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 +5 -0
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils.d.ts +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +3 -0
- package/dist/semiotic.d.ts +9 -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 +39 -60
- package/dist/c-3KZD6AXJ.min.js +0 -1
- package/dist/c-4TWEX5HG.min.js +0 -1
- package/dist/c-5YCIX3VZ.min.js +0 -1
- package/dist/c-6FEKTA3U.min.js +0 -1
- package/dist/c-74HEEZGK.min.js +0 -1
- package/dist/c-BWNB6USU.min.js +0 -1
- package/dist/c-C25ENHIK.min.js +0 -1
- package/dist/c-CDR5AO3R.min.js +0 -1
- package/dist/c-E3JFRRMI.min.js +0 -1
- package/dist/c-EBFPQHHO.min.js +0 -1
- package/dist/c-GIKRQI4X.min.js +0 -1
- package/dist/c-GPYOFETM.min.js +0 -1
- package/dist/c-IDUHYYSI.min.js +0 -1
- package/dist/c-JAZ73J32.min.js +0 -1
- package/dist/c-KG3NXHAL.min.js +0 -1
- package/dist/c-KII3PLZE.min.js +0 -1
- package/dist/c-LIXGXMNS.min.js +0 -1
- package/dist/c-LVEY6D6B.min.js +0 -1
- package/dist/c-M4Y3BHFR.min.js +0 -1
- package/dist/c-MAIICR2Z.min.js +0 -1
- package/dist/c-MG5DM6VE.min.js +0 -1
- package/dist/c-O6U6K4CW.min.js +0 -1
- package/dist/c-OQ7M4AGV.min.js +0 -1
- package/dist/c-OXYMVK7Q.min.js +0 -1
- package/dist/c-QHF5YON3.min.js +0 -1
- package/dist/c-RR3GO5SW.min.js +0 -1
- package/dist/c-S2BXNNJN.min.js +0 -1
- package/dist/c-SUILCHWU.min.js +0 -1
- package/dist/c-US5ZFT6E.min.js +0 -1
- package/dist/c-UUKVD4WB.min.js +0 -1
- package/dist/c-WJCD5EUY.min.js +0 -1
- package/dist/c-YDAY2WFR.min.js +0 -1
- package/dist/c-ZOWWU34K.min.js +0 -1
- /package/dist/{c-COHXCW3Q.min.js → c-YZVRZGX2.min.js} +0 -0
package/dist/c-GIKRQI4X.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ObservationProvider as e,SelectionProvider as t,buildPredicate as n,hasOwnEnumerableKey as r,useObservationSelector as i,useReducedMotion as o,useSelectionSelector as a,useTheme as s,useThemeSelector as l}from"./c-YDAY2WFR.min.js";import{confidenceZScore as c,fitLinearForForecast as u,forecastIntervalStats as d,getMinMax as h,linearRegression as f,polynomialRegression as m}from"./c-WJCD5EUY.min.js";var y={fresh:1,aging:1.5,stale:3};function p(e,t,n={}){return Number.isFinite(t)&&t>0?Number.isNaN(e)?"fresh":e===1/0?"expired":0>e||t*(n.fresh??1)>e?"fresh":t*(n.aging??1.5)>e?"aging":t*(n.stale??3)>e?"stale":"expired":"fresh"}function g(e,t,n){if(null!=e)return"function"==typeof e?e(t,n):"object"==typeof e&&null!==e&&"constant"in e?e.constant:t[e]}function b(e){const{data:t,encoding:n}=e,r=[],i=new Map;return t.forEach((e,t)=>{const o=g(n.id,e,t);if(null==o||""===o)throw Error(`[semiotic] Motion encoding row ${t} resolved an empty id.`);const a=o+"";if(i.has(a))throw Error(`[semiotic] Duplicate motion encoding id "${a}".`);const s=g(n.process?.group,e,t),l=g(n.process?.stage,e,t),c=g(n.accessible?.group,e,t)??(null!=s?s+"":null!=l?l+"":void 0),u={};for(const r of Object.keys(n.evidence??{}))u[r]=g(n.evidence?.[r],e,t);const d={id:a,datum:e,time:{arrival:g(n.time?.arrival,e,t),basis:n.time?.basis,unit:n.time?.unit},placement:{x:g(n.placement?.x,e,t),y:g(n.placement?.y,e,t),lane:g(n.placement?.lane,e,t),space:n.placement?.space},kinematics:{velocityX:g(n.kinematics?.velocityX,e,t),velocityY:g(n.kinematics?.velocityY,e,t),space:n.kinematics?.space},process:{group:s,stage:l,target:g(n.process?.target,e,t),work:g(n.process?.work,e,t)},evidence:u,accessible:{description:g(n.accessible?.description,e,t),group:c,label:g(n.accessible?.label,e,t)??a}};r.push(d),i.set(a,d)}),{rows:r,byId:i}}function x(e){const t=e.now-e.arrival;return{age:t,progress:Number.isFinite(t)&&Number.isFinite(e.ttl)&&e.ttl>0?Math.max(0,t)/e.ttl:t===1/0&&Number.isFinite(e.ttl)&&e.ttl>0?1/0:0,lifecycle:p(t,e.ttl,e.thresholds)}}function v(e){const t=Math.max(0,Math.min(1,e.minOpacity??.1));if(Number.isNaN(e.age))return 1;if(e.age===1/0)return t;if(!Number.isFinite(e.extent)||0>=e.extent)return 1;const n=Math.max(0,e.age);if("step"===e.type)return(e.threshold??.5*e.extent)>n?1:t;if("exponential"===e.type){const r=e.halfLife??e.extent/2;return t+Math.pow(.5,n/(r>0?r:e.extent/2))*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function k(e,t){const n=Number.isFinite(e)?e:0,r=Number.isFinite(t)?t:0;return{velocityX:n,velocityY:r,speed:Math.hypot(n,r),direction:Math.atan2(r,n)}}function w(e,t,n){return Number.isFinite(n)&&n>0?k((t.x-e.x)/n,(t.y-e.y)/n):k(0,0)}var $=[40,40],M=[.5,.5];function A(e,t){const[n,r]=e.viewBox??$,[i,o]=e.anchor??M,a=r>0?r:1,s=Math.max(0,t)/a,l=(n>0?n:a)*s,c=a*s;return{width:l,height:c,scale:s,offsetX:-i*l,offsetY:-o*c}}function S(e,t){const n=A(e,t),r=[[n.offsetX,n.offsetY],[n.offsetX+n.width,n.offsetY],[n.offsetX,n.offsetY+n.height],[n.offsetX+n.width,n.offsetY+n.height]];let i=0;for(const[e,t]of r){const n=Math.sqrt(e*e+t*t);n>i&&(i=n)}return i}function W(e,t,n,r){if("none"!==e)return"color"===e||null==e?t??r:"accent"===e?n:e}var C=null;function L(e){if("undefined"==typeof Path2D)return null;C||(C=new Map);const t=C.get(e);if(t)return t;const n=new Path2D(e);return C.size>1024&&C.clear(),C.set(e,n),n}function j(e,t,n=0,r="horizontal"){const[i,o]=e.viewBox??$,a=Math.min(1,Math.max(0,n)),s=Math.min(1,Math.max(0,t));return s>a?a>0||1>s?"vertical"===r?{x:0,y:o*(1-s),width:i,height:o*(s-a)}:{x:i*a,y:0,width:i*(s-a),height:o}:null:{x:0,y:0,width:0,height:0}}function N(e,t){const n=A(e,t);return{centerDx:n.offsetX+n.width/2,centerDy:n.offsetY+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2,radius:Math.hypot(n.width,n.height)/2}}function O(e,t,n,r,i,o=e=>e){for(const a of t.parts){const t=L(a.d);if(!t)continue;const s=a.opacity??1,l=e.globalAlpha;1!==s&&(e.globalAlpha=l*s);const c=i?"none"===a.fill?void 0:i:W(a.fill,n,r);c&&(e.fillStyle=o(c),e.fill(t));const u=i?a.stroke&&"none"!==a.stroke?i:void 0:W(a.stroke??"none",n,r);u&&(e.strokeStyle=o(u),e.lineWidth=a.strokeWidth??1,e.lineCap=a.strokeLinecap??"butt",e.lineJoin=a.strokeLinejoin??"miter",e.stroke(t)),1!==s&&(e.globalAlpha=l)}}function I(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle}}var R=null;function z(e={},t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45}=e,s={background:n,stroke:r,lineWidth:i,spacing:o,angle:a},l=Math.max(8,Math.ceil(2*o));let c;try{c=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(R||(R=document.createElement("canvas")),R.width=e,R.height=e,R)}(l)}catch{return I(s)}const u=c.getContext("2d");if(!u)return I(s);n&&"transparent"!==n?(u.fillStyle=n,u.fillRect(0,0,l,l)):u.clearRect(0,0,l,l),u.strokeStyle=r,u.lineWidth=i,u.lineCap="square";const d=a*Math.PI/180;if(45===a||-45===a){const e=a>0?1:-1;for(let t=-l;2*l>=t;t+=o)u.beginPath(),u.moveTo(t,0),u.lineTo(t+e*l,l),u.stroke()}else{u.save(),u.translate(l/2,l/2),u.rotate(d);const e=2*l;for(let t=-e;e>=t;t+=o)u.beginPath(),u.moveTo(-e,t),u.lineTo(e,t),u.stroke();u.restore()}return(t||u).createPattern(c,"repeat")}var P=new WeakMap,F=0,T=!1,D=null,E=null,B=null,H=new Set;function G(e,t){if(!t)return t;const n=function(e){const t=e.trim();if(!t.startsWith("var(")||!t.endsWith(")"))return null;const n=t.slice(4,-1),r=n.indexOf(",");if(-1===r){const e=n.trim();return e.startsWith("--")?{name:e}:null}const i=n.slice(0,r).trim(),o=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:o||void 0}:null}(t);if(!n)return t;const r=()=>n.fallback?G(e,n.fallback):t,i=e.canvas;if(!i)return r();let o=P.get(i);o&&o.version===F||(o={version:F,map:new Map},P.set(i,o));const a=o.map.get(t);if(void 0!==a)return a;const s=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||t;return o.map.set(t,s),s}function _(){return F}import{jsx as V,jsxs as q}from"react/jsx-runtime";function Y(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function U(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function X(e,t){let n=2166136261;const r=U(t);for(let e=0;r.length>e;e++)n^=r.charCodeAt(e),n=Math.imul(n,16777619);return`${e}-hatch-${(n>>>0).toString(36)}`}var Z=new Map;function K(e,t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l=Math.max(8,Math.ceil(2*o));return q("pattern",{id:t,width:l,height:l,patternUnits:"userSpaceOnUse",patternTransform:0!==a?`rotate(${a})`:void 0,children:[n&&"transparent"!==n&&V("rect",{width:l,height:l,fill:n}),V("line",{x1:0,y1:0,x2:0,y2:l,stroke:r,strokeWidth:i,strokeOpacity:s}),V("line",{x1:o,y1:0,x2:o,y2:l,stroke:r,strokeWidth:i,strokeOpacity:s})]},t)}function J(e,t,n="#4e79a7"){if(Y(e)){const n=X(t,e);return{fill:`url(#${n})`,def:K(e,n)}}return e&&"string"==typeof e?{fill:e}:{fill:n}}function Q(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:n+""}import*as ee from"react";function te(e){const t=i(e=>e.pushObservation),n=ee.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return ee.useMemo(()=>({...e,onObservation:n}),[n,e])}function ne(e,t={}){const n=Q(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(r){const i=function(e){const t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}(r);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:i}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:i,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function re(e){return e instanceof Element&&null!=e.closest("[data-semiotic-annotation-widget]")}import{jsx as ie,jsxs as oe}from"react/jsx-runtime";var ae="var(--semiotic-bg, #ffffff)";function se(e,t){return(e+"").length*t*.6}function le(e){const{x:t,y:n,text:r,fill:i,fontSize:o=12,fontWeight:a,fontFamily:s,textAnchor:l="start",dominantBaseline:c,background:u,className:d}=e,h=function(e){return void 0===e||!0===e||"halo"===e?{type:"halo"}:!1===e||"none"===e?null:"box"===e?{type:"box"}:{type:e.type??"halo",...e}}(u),f=e=>ie("text",{x:t,y:n,textAnchor:l,dominantBaseline:c,fill:i,fontSize:o,fontWeight:a,fontFamily:s,className:d,...e?{style:{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}}:{},children:r});if(!h)return f();if("halo"===h.type)return f({stroke:h.fill??ae,strokeWidth:h.haloWidth??3});const m=h.padding??{x:6,y:3},y="number"==typeof m?m:m.x,p="number"==typeof m?m:m.y,g=se(r,o),b=o+2*p;let x,v;return x="middle"===l?t-g/2-y:"end"===l?t-g-y:t-y,v="middle"===c||"central"===c?n-b/2:"hanging"===c||"text-before-edge"===c?n-p:n-.8*o-p,oe("g",{className:d,children:[ie("rect",{x:x,y:v,width:g+2*y,height:b,rx:h.radius??3,ry:h.radius??3,fill:h.fill??ae,fillOpacity:h.opacity??.85,stroke:h.stroke,strokeWidth:h.strokeWidth}),f()]})}import*as ce from"react";import{jsx as ue}from"react/jsx-runtime";var de={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};function he({chrome:e="default",className:t="",style:n,children:r,...i}){const o="default"===e?{...de,...n}:n;return ue("div",{...i,"data-semiotic-tooltip-chrome":!0,className:("semiotic-tooltip "+t).trim(),style:o,children:r})}function fe(e){return e.ownsChrome=!0,e}function me(e){if("string"!=typeof e)return null!=e;const t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function ye(e){if(!ce.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const n=e.props,r=n["data-semiotic-tooltip-chrome"];if(null!=r&&!1!==r&&"false"!==r)return!0;const i=n.style;if(i&&"object"==typeof i){if(me(i.background))return!0;if(me(i.backgroundColor))return!0}return!1}fe(he);var pe=["name","label","title"],ge=["type","kind","category","group","class","status","role","shape"],be=["value","amount","total","count","weight","score"],xe=new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);function ve(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}function ke(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const n=t.maxEntries??6,r=!1!==t.skipPositional,i=[];for(const[t,n]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;if(r&&xe.has(t.toLowerCase()))continue;if(null==n)continue;const e=typeof n;("string"===e||"number"===e||"boolean"===e||n instanceof Date)&&i.push({key:t,lower:t.toLowerCase(),value:n})}if(0===i.length)return{entries:[]};let o=i.findIndex(e=>pe.includes(e.lower));const a=o>=0;0>o&&(o=i.findIndex(e=>"id"===e.lower)),0>o&&(o=i.findIndex(e=>"string"==typeof e.value));const s=0>o?void 0:i[o];let l=i.filter((e,t)=>t!==o);a&&(l=l.filter(e=>"id"!==e.lower));const c=ve(l,ge),u=ve(l,be),d=new Set(ge),h=new Set(be),f=[];c&&f.push({key:c.key,value:c.value}),u&&f.push({key:u.key,value:u.value});for(const e of l){if(f.length>=n)break;e!==c&&e!==u&&(d.has(e.lower)||h.has(e.lower)||f.push({key:e.key,value:e.value}))}return{titleKey:s?.key,title:s?.value,entries:f}}function we(e,t){return"touch"===t?Math.max(e,24):e}function $e(e){return Array.isArray(e)?e[0]:e}function Me(e,t,n,r){return{data:$e(e),x:t,y:n,__semioticHoverData:!0,...r}}import{jsx as Ae,jsxs as Se}from"react/jsx-runtime";function We(e,t){return"function"==typeof t?t(e):e[t]}function Ce(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}if(e instanceof Date)return e.toLocaleDateString();if("object"==typeof e&&null!==e){if(void 0!==e.id)return e.id+"";if(void 0!==e.name)return e.name+"";try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return e+""}function Le(e={}){const{fields:t,title:n,format:r,style:i={},className:o=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let a;const s=[];if(n){const t=We(e,n);a=Ce(t,r)}if(t&&t.length>0)t.forEach(t=>{let n,i,o;"string"==typeof t?(n=t,i=t,o=r):(n=t.label,i=t.accessor||t.key||"",o=t.format||r);const a=We(e,i);s.push({label:n,value:Ce(a,o)})});else if(!n){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){a=Ce(e[n],r);break}if(!a){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(a=Ce(e[t[0]],r))}}return Se(he,{className:o,style:i,children:[a&&Ae("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:a}),s.map((e,t)=>Se("div",{style:{marginTop:0===t&&a?"4px":0},children:[e.label&&Se("span",{children:[e.label,": "]}),e.value]},t))]})}}function je(e={}){const{fields:t=[],title:n,format:r,style:i={},className:o="",showLabels:a=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const l=[];if(n){const t=We(e,n);l.push({value:Ce(t,r)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let n,i,o;"string"==typeof t?(n=t,i=t,o=r):(n=t.label,i=t.accessor||t.key||"",o=t.format||r);const s=Ce(We(e,i),o);l.push({label:a?n:void 0,value:s})});else{const t=ke(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:Ce(t.title,r),bold:!0}),t.entries.forEach(e=>{l.push({label:a?e.key:void 0,value:Ce(e.value,r)})})}return Array.isArray(l)&&0!==l.length?Ae(he,{className:("semiotic-tooltip-multiline "+o).trim(),style:i,children:l.map((e,t)=>Se("div",{style:{marginBottom:l.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&Se("strong",{children:[e.label,s]}),e.value]},t))}):null}}function Ne(e){return"multi"===e||Oe(e)}function Oe(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function Ie(e){const{tooltip:t,defaultTooltipContent:n,multiDefaultContent:r=ze(),customFunctionContext:i="datum"}=e,o=t;return!1===t?{tooltipContent:()=>null}:Ne(o)?{tooltipContent:(Oe(o)&&"function"==typeof o.content?Pe(o.content):void 0)||r,tooltipMode:"multi"}:"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:Pe(o)||n}}function Re(e){const{tooltip:t,defaultTooltipContent:n,customFunctionContext:r="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===r&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:Pe(t)||n}}function ze(){return e=>{const t=e.allSeries;if(!t||0===t.length)return Ae(he,{children:Ae("div",{children:Ce(e.data?.value??e.data?.y)})});const n=e.xValue??e.data?.time??e.data?.x;return Se(he,{children:[null!=n&&Ae("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:Ce(n)}),t.map((e,t)=>Se("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[Ae("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),Ae("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),Ae("span",{style:{fontWeight:500,fontSize:"0.85em"},children:Ce(e.value)})]},t))]})}}function Pe(e){if(!0!==e){if("function"==typeof e){const t=e;return e=>{const n=!0===e?.__semioticHoverData||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType);let r=$e(n?e.data??{}:e);if(!r)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof r?.x0&&"number"==typeof r?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof r?.sankeyWidth)&&r.data&&"object"==typeof r.data&&(r=r.data),!r)return null;if(n&&(void 0!==e.allSeries||void 0!==e.xValue)){const t={...r};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),r=t}const i=t(r);return null==i?null:ye(i)?i:Ae(he,{children:i})}}if(!1===e||void 0===e)return!1;if(Oe(e)){if("function"==typeof e.content)return Pe(e.content);"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');const t=je();return Pe(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){const t=Le(e);return Pe(e=>t(e))}if("multi"===e){"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');const e=je();return Pe(t=>e(t))}return Le()}}import*as Fe from"react";import{jsx as Te,jsxs as De}from"react/jsx-runtime";function Ee({componentName:e,message:t,diagnosticHint:n,width:r,height:i}){return Te("div",{role:"alert",style:{width:r,height:Math.max(i,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:De("div",{style:{textAlign:"center",maxWidth:400},children:[Te("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),Te("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&Te("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:n})]})})}import{jsx as Be}from"react/jsx-runtime";var He=class extends Fe.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:Be(Ee,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}};import{createContext as Ge,useContext as _e,useMemo as Ve}from"react";import{scaleOrdinal as qe}from"d3-scale";function Ye(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function Ue(e,t,n){const r=e=>e.toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function Xe(e){const t=e.map(Ye),n=t.length-1;return e=>{if(0>=e){const[e,n,r]=t[0];return Ue(e,n,r)}if(e>=1){const[e,r,i]=t[n];return Ue(e,r,i)}const r=e*n,i=Math.floor(r),o=r-i,[a,s,l]=t[i],[c,u,d]=t[i+1];return Ue(Math.round(a+(c-a)*o),Math.round(s+(u-s)*o),Math.round(l+(d-l)*o))}}var Ze=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Ke=Xe(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),Je=Xe(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),Qe=Xe(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),et=Xe(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),tt=Xe(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),nt=Xe(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),rt=Xe(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),it=Xe(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),ot=Xe(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),at=Xe(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),st=Xe(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),lt=Xe(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),ct={blues:Ke,reds:Je,greens:Qe,viridis:rt,oranges:et,purples:tt,greys:nt,plasma:it,inferno:ot,magma:at,cividis:st,turbo:lt};function ut(e){return e&&Object.prototype.hasOwnProperty.call(ct,e)?ct[e]:Ke}var dt=Xe(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),ht=Xe(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),ft=Xe(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),mt=Xe(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),yt=Xe(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),pt=Xe(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),gt=Xe(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]),bt={category10:Ze,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],...ct},xt=Ze,vt="#007bff";function kt(e,t,n=xt){if(e&&"object"==typeof e&&!Array.isArray(e)){const t=Object.values(e).filter(e=>"string"==typeof e&&e.length>0);if(t.length>0)return t}if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e){const t=Object.prototype.hasOwnProperty.call(bt,e)?bt[e]:void 0;if(Array.isArray(t)&&t.length>0)return t}return t&&t.length>0?t:n}var wt=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],$t=["#f0f0f0","#b5d4ea","#f4c2a1","#b8dab2","#d4b5e0","#f9e0a2","#a8d8d8"],Mt=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]);function At(e,t,n){if("function"==typeof t){const r=t(e);return n&&r&&"string"==typeof r&&!function(e){const t=e.toLowerCase();return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||Mt.has(t)}(r)?n(r):r}const r=e?.[t]+"";return n?n(r):xt[Math.abs(function(e){let t=0;for(let n=0;e.length>n;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}(r))%xt.length]}function St(e,t){if(null==t||!Object.prototype.hasOwnProperty.call(e,t))return;const n=e[t];return"string"==typeof n&&n.length>0?n:void 0}function Wt(e,t,n="category10"){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;return t=>St(e,t)??"#999"}const r=Array.from(new Set(e.map(e=>e?.[t]).filter(e=>null!=e).map(e=>e+""))),i=r.every(e=>!isNaN(Number(e)));if(Array.isArray(n))return qe().domain(r).range(n).unknown("#999");const o=Object.prototype.hasOwnProperty.call(bt,n)?bt[n]:bt.category10;if(i&&"function"==typeof o){let e=-1/0;for(const t of r){const n=Number(t);n>e&&(e=n)}return t=>o(Number(t)/e)}{const e=Array.isArray(o)?o:xt;return qe().domain(r).range(e).unknown("#999")}}function Ct(e,t,n=[3,20],r){let i;if(i="function"==typeof t?t(e):e?.[t],!r)return i;const[o,a]=r,[s,l]=n;if(a===o)return(s+l)/2;let c=(i-o)/(a-o);return 0>c?c=0:c>1&&(c=1),s+c*(l-s)}import{jsx as Lt}from"react/jsx-runtime";var jt=Ge(null);function Nt({colors:e,categories:t,colorScheme:n="category10",children:r}){const i=Ve(()=>{if(e)return e;if(t){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;let r=0;return Object.fromEntries(t.map(t=>[t,St(e,t)??xt[r++%xt.length]]))}const e=Array.isArray(n)?n:kt(n,void 0);return Object.fromEntries(t.map((t,n)=>[t,e[n%e.length]]))}return{}},[e,t,n]);return Lt(jt.Provider,{value:i,children:r})}function Ot(){return _e(jt)}Nt.displayName="CategoryColorProvider";import{useId as It,useMemo as Rt,useCallback as zt}from"react";import{useSyncExternalStore as Pt}from"react";var Ft={positions:new Map},Tt=new Set;function Dt(){for(const e of Tt)e()}function Et(e,t){const n=Ft.positions.get(e);if(n?.locked)return;if(!n||n.sourceId!==t)return;const r=new Map(Ft.positions);r.delete(e),Ft={positions:r},Dt()}function Bt(e,t){const n=Ft.positions.get(e);if(!n?.locked)return;if(t&&n.sourceId!==t)return;const r=new Map(Ft.positions);r.delete(e),Ft={positions:r},Dt()}function Ht(){return Ft}function Gt(e){return Tt.add(e),()=>Tt.delete(e)}var _t={positions:new Map};function Vt(){return()=>{}}function qt(){return _t}function Yt(e){const t=Pt(e?Gt:Vt,e?Ht:qt,e?Ht:qt);return e?t.positions.get(e)??null:null}function Ut(e){const t=It(),r=e.clientId||t,{name:i}=e,o=a(e=>e.selections.get(i)),s=a(e=>e.setClause),l=a(e=>e.clearClause),c=Rt(()=>!!o&&o.clauses.size>0,[o]);return{predicate:Rt(()=>o&&0!==o.clauses.size?n(o,r):()=>!0,[o,r]),isActive:c,selectPoints:zt(e=>{const t={};let n=!1;for(const[r,i]of Object.entries(e))t[r]={type:"point",values:new Set(i)},n=!0;n&&s(i,{clientId:r,type:"point",fields:t})},[r,i,s]),selectInterval:zt(e=>{const t={};let n=!1;for(const[r,i]of Object.entries(e))t[r]={type:"interval",range:i},n=!0;n&&s(i,{clientId:r,type:"interval",fields:t})},[r,i,s]),clear:zt(()=>{l(i,r)},[l,i,r]),clientId:r}}function Xt(e,t){const n=It(),r=t||n,i=a(e=>e.setClause),o=a(e=>e.clearClause);return{selectPoints:zt(t=>{const n={};let o=!1;for(const[e,r]of Object.entries(t))n[e]={type:"point",values:new Set(r)},o=!0;o&&i(e,{clientId:r,type:"point",fields:n})},[e,r,i]),clear:zt(()=>o(e,r),[e,r,o]),clientId:r}}function Zt(e){const t=e.name||"hover",{fields:n}=e,{predicate:i,isActive:o,selectPoints:a,clear:s}=Ut({name:t,fields:n});return{onHover:zt(e=>{if(!e)return void s();const t={};for(const r of n){const n=e[r];void 0!==n&&(t[r]=[n])}r(t)&&a(t)},[n,a,s]),predicate:i,isActive:o}}function Kt(e){return 2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function Jt(e){const{name:t,xField:n,yField:i}=e,{predicate:o,isActive:a,selectInterval:s,clear:l}=Ut({name:t,fields:[n,i].filter(Boolean)}),c=n&&i?"xyBrush":n?"xBrush":"yBrush",u=zt(e=>{if(!e)return void l();const t={};"xyBrush"===c&&function(e){return 2===e.length&&Array.isArray(e[0])&&2===e[0].length&&Array.isArray(e[1])&&2===e[1].length}(e)?(n&&(t[n]=[Math.min(e[0][0],e[1][0]),Math.max(e[0][0],e[1][0])]),i&&(t[i]=[Math.min(e[0][1],e[1][1]),Math.max(e[0][1],e[1][1])])):"xBrush"===c&&Kt(e)?n&&(t[n]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]):"yBrush"===c&&Kt(e)&&i&&(t[i]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]),r(t)&&s(t)},[c,n,i,s,l]);return{brushInteraction:Rt(()=>({brush:c,during:u,end:u}),[c,u]),predicate:o,isActive:a,clear:l}}function Qt(e,t,r){const i=a(e=>e.selections.get(t));return Rt(()=>{if(!i||0===i.clauses.size)return e;const t=n(i,r);return e.filter(t)},[e,i,r])}function en(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function tn(e,t){const{when:n}=e,r=t.width,i=t.height,o=function(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}(t),a=function(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}(t);return!("number"==typeof n.minWidth&&n.minWidth>r||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof i||n.minHeight>i)||"number"==typeof n.maxHeight&&("number"!=typeof i||i>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||n.minAspectRatio>o)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function nn(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const r=n.map((e,t)=>({rule:e,index:t})).filter(e=>tn(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:r.reduce((e,t)=>function(e,t){const n={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])en(e[r])&&en(t[r])&&(n[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}(e,t.rule.transform),e),matches:r}}import{useMemo as rn}from"react";function on(e={}){const{limit:t=50,types:n,chartId:r}=e,o=i(e=>e.version),a=i(e=>e.observations),s=i(e=>e.clearObservations),l=rn(()=>{let e=a;if(n&&n.length>0){const t=new Set(n);e=e.filter(e=>t.has(e.type))}return r&&(e=e.filter(e=>e.chartId===r)),e.length>t&&(e=e.slice(e.length-t)),e},[a,n,r,t,o]);return{observations:l,latest:l.length>0?l[l.length-1]:null,clear:s}}import{createContext as an,useContext as sn,useEffect as ln,useId as cn,useLayoutEffect as un,useMemo as dn,useRef as hn,useState as fn,useCallback as mn}from"react";function yn(e,t){const n=e.get(t);if(void 0!==n)return n;if(e.size>=4096)return function(e){let t=2166136261;for(let n=0;e.length>n;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}(t);const r=e.size;return e.set(t,r),r}import*as pn from"react";function gn(...e){let t;for(const n of e)n&&(t=bn(t)&&bn(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function bn(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function xn(e){return"object"==typeof e&&null!==e&&"gradient"in e}function vn(e,t,n,r,i=8){const o=r,a="left"===r?"right":"right"===r?"left":"top"===r?"bottom":"top",s=Math.max(t[o],Math.max(0,("left"===r||"right"===r?n[0]:n[1])-i)-e[a]);e[o]>s&&(e[o]=s)}function kn(e){return Math.ceil(7*e.length)}function wn(e,t){if(bn(e)){const n=zn(t),r=e.legendGroups.flatMap(e=>[e.label?kn(e.label):0,...e.items.map(e=>n.swatchSize+n.labelGap+kn(e.label))]);return Math.max(100,...r)}if(xn(e)){const{gradient:t}=e,n=t.format||(e=>Math.round(100*e)/100+""),r=Math.max(kn(n(t.domain[0])),kn(n(t.domain[1]))),i=t.label?kn(t.label):0;return Math.max(100,19+r,i)}return 100}function $n(e){return(bn(e)||xn(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function Mn(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?Wn:Sn:0}function An(e){return Math.max(0,e?.edgeGutter??3)}var Sn=34,Wn=70;function Cn(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?64:46:22:0}function Ln(e){const t=e.axes?.find(e=>"bottom"===e.orient),n=e.axes?.find(e=>"top"===e.orient),r=e.axes?.find(e=>"left"===e.orient),i=e.axes?.find(e=>"right"===e.orient),o=!n||!!t,a=!!n&&!t,s=!i||!!r,l=!!i,c=!1!==e.showAxes;return{hasAxis:c&&o,hasAxisLabel:c&&o&&!!(t?.label??e.xLabel),rotatedTicks:c&&o&&(e.rotatedTicks??!!t?.autoRotate),topAxis:a?{hasAxis:c,hasAxisLabel:c&&!!(n?.label??e.xLabel),rotatedTicks:c&&(e.rotatedTicks??!!n?.autoRotate)}:void 0,leftAxis:s?{hasAxis:c,hasAxisLabel:c&&!!(r?.label??e.yLabel)}:void 0,rightAxis:l?{hasAxis:c,hasAxisLabel:c&&!!(i?.label??e.yLabelRight??e.yLabel)}:void 0}}function jn(e,t){return Ln({showAxes:e.showAxes??t.showAxes,xLabel:e.xLabel??t.xLabel,yLabel:e.yLabel??t.yLabel,yLabelRight:e.yLabelRight??t.yLabelRight,axes:e.axes??t.axes})}function Nn(e){const t=e.projection??"vertical",n=!1!==e.showAxes&&"radial"!==t;return{hasAxis:n,hasAxisLabel:n&&("horizontal"===t?e.hasValueLabel:e.hasCategoryLabel),leftAxis:{hasAxis:n,hasAxisLabel:n&&("horizontal"===t?e.hasCategoryLabel:e.hasValueLabel)}}}function On(e,t,n){if(xn(e))return e.gradient.label?46:26;if(!bn(e))return 20;const r=zn(n),i=Math.max(1,n?.maxWidth??t);let o=r.rowHeight;for(const t of e.legendGroups){let e=0,n=0;for(const o of t.items){const t=r.swatchSize+r.labelGap+kn(o.label),a=0===n?t:n+r.itemGap+t;n>0&&a>i?(e+=1,n=t):n=a}t.items.length>0&&(e+=1),o=Math.max(o,e*r.rowHeight,t.label?kn(t.label):0)}return o+(e.legendGroups.length>1?16:0)}function In(e,t,n){return wn(e,t)+$n(e)+Mn(t,n)+An(t)}function Rn(e,t){const{legend:n}=t;if(!n)return;const r=t.position??"right",i=On(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+$n(n)+Cn("bottom"===r?t.axisChrome:"top"===r?t.axisChrome?.topAxis:void 0,t.legendLayout)+("top"===r&&t.hasTitle?24:0),o=Math.max(t.minimumMargin??0,"top"===r?t.hasTitle?58:34:0);"right"===r?e.right=Math.max(e.right,o,In(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===r?e.left=Math.max(e.left,o,In(n,t.legendLayout,t.axisChrome?.leftAxis)):"top"===r?e.top=Math.max(e.top,o,i):e.bottom=Math.max(e.bottom,o,i)}function zn(e){const t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}import*as Pn from"react";import{jsx as Fn,jsxs as Tn}from"react/jsx-runtime";function Dn({config:e,orientation:t="vertical",width:n=100,customClickBehavior:r,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:a,legendInteraction:s}){const{colorFn:l,domain:c,label:u,format:d}=e,h=d||(e=>Math.round(100*e)/100+""),f="grad-legend-"+Pn.useId(),m=!(!r&&!i),y="isolate"===s||void 0===s&&null!=a,[p,g]=Pn.useState(0),[b,x]=Pn.useState(null),v=Pn.useRef([]),k=(e,t=!1)=>{const n=t?5-e-1:e,r=c[0]+n/5*(c[1]-c[0]),i=c[0]+(n+1)/5*(c[1]-c[0]);return{label:`${h(r)} – ${h(i)}`,valueRange:[r,i],interactionKey:`${r}:${i}`}},w=(e,n,s)=>{const l="string"==typeof e.interactionKey?e.interactionKey:e.label,c=a?.has(l)??!1,u=o===l,d=b===s,h=e=>{const t=(e+5)%5;g(t),v.current[t]?.focus()};return Fn("rect",{ref:e=>{v.current[s]=e},className:"semiotic-gradient-legend-bin",...n,fill:a?.size&&!c||null!=o&&!u?"rgba(255,255,255,0.65)":"transparent",stroke:d||c||u?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:d?3:2,tabIndex:s===p?0:-1,role:"option","aria-label":e.label,"aria-selected":y?c:void 0,"aria-current":!(y||!u)||void 0,onClick:r?()=>r(e):void 0,onMouseEnter:i?()=>i(e):void 0,onMouseLeave:i?()=>i(null):void 0,onFocus:()=>{g(s),x(s),i?.(e)},onBlur:()=>{x(null),i?.(null)},onKeyDown:n=>{if(("Enter"===n.key||" "===n.key)&&r)return n.preventDefault(),void r(e);const i="horizontal"===t?"ArrowRight":"ArrowDown";n.key===("horizontal"===t?"ArrowLeft":"ArrowUp")||n.key===i?(n.preventDefault(),h(s+(n.key===i?1:-1))):"Home"!==n.key&&"End"!==n.key||(n.preventDefault(),h("Home"===n.key?0:4))},style:{cursor:"pointer",pointerEvents:"all"}},"gradient-interaction-"+s)},$="horizontal"===t,M=[];for(let e=0;64>=e;e++){const t=e/64;M.push(Fn("stop",{offset:100*t+"%",stopColor:l($?c[0]+t*(c[1]-c[0]):c[1]-t*(c[1]-c[0]))},e))}if($){const e=12,t=Math.min(n,200),r=Math.max(0,(n-t)/2),i=u?18:0;return Tn("g",{"aria-label":u||"Gradient legend",role:m?"listbox":void 0,"aria-orientation":m?"horizontal":void 0,"aria-multiselectable":!(!m||!y)||void 0,style:{fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},children:[Fn("defs",{children:Fn("linearGradient",{id:f,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:M})}),u&&Fn("text",{x:r+t/2,y:12,textAnchor:"middle",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),Fn("rect",{x:r,y:i,width:t,height:e,fill:`url(#${f})`,rx:2}),m&&Array.from({length:5},(n,o)=>w(k(o),{x:r+o*t/5,y:i,width:t/5,height:e},o)),Fn("text",{x:r,y:i+e+12,textAnchor:"start",fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:h(c[0])}),Fn("text",{x:r+t,y:i+e+12,textAnchor:"end",fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:h(c[1])})]})}const A=u?18:0;return Tn("g",{"aria-label":u||"Gradient legend",role:m?"listbox":void 0,"aria-orientation":m?"vertical":void 0,"aria-multiselectable":!(!m||!y)||void 0,style:{fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},children:[u&&Fn("text",{x:0,y:12,textAnchor:"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),Fn("defs",{children:Fn("linearGradient",{id:f,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:M})}),Fn("rect",{x:0,y:A,width:14,height:100,fill:`url(#${f})`,rx:2}),m&&Array.from({length:5},(e,t)=>w(k(t,!0),{x:0,y:A+100*t/5,width:14,height:20},t)),Fn("text",{x:19,y:A+10,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:h(c[1])}),Fn("text",{x:19,y:A+100,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:h(c[0])})]})}import{jsx as En,jsxs as Bn}from"react/jsx-runtime";var Hn={fill:(e,t)=>En("rect",{style:e,width:t,height:t}),line:(e,t)=>En("line",{style:e,x1:0,y1:0,x2:t,y2:t})};function Gn(e,t,n,r,i){let o;return o="function"==typeof n?n(e):(0,Hn[n])(r(e,t),i),o}function _n({swatchSize:e}){return En("path",{d:`M${.25*e},${.55*e} L${.45*e},${.75*e} L${.8*e},${.3*e}`,fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}function Vn(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function qn(e,t,n,r,i,o){const{legendGroup:{type:a="fill",styleFn:s,items:l},customClickBehavior:c,customHoverBehavior:u,highlightedCategory:d,isolatedCategories:h,focusedGroupIndex:f,focusedItemIndex:m,groupIndex:y,onFocusedIndexChange:p,interactive:g,useIsolateAria:b,metrics:{swatchSize:x,labelGap:v}}=e,k=!!h?.size&&h.has(t.label);return Bn("g",{transform:r,onClick:c?()=>c(t):void 0,onMouseEnter:u?()=>u(t):void 0,onMouseLeave:u?()=>u(null):void 0,tabIndex:g?y===f&&n===m?0:-1:void 0,role:g?"option":void 0,"aria-selected":g&&b?k:void 0,"aria-current":!(!g||b||null==d||t.label!==d)||void 0,"aria-label":t.label,onKeyDown:g?e=>{if("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c?.(t)),e.key===i||e.key===o){e.preventDefault();const t=(n+(e.key===o?1:-1)+l.length)%l.length;p(y,t);const r=e.currentTarget.parentElement?.children[t];r instanceof SVGElement&&r.focus()}}:void 0,onFocus:g?e=>{p(y,n),u?.(t),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","visible")}:void 0,onBlur:g?e=>{u?.(null),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","hidden")}:void 0,style:{cursor:g?"pointer":"default",opacity:Vn(t,d,h),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[g&&En("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:x+v+2+7*t.label.length,height:x+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),Gn(t,n,a,s,x),k&&En(_n,{swatchSize:x}),En("text",{y:x/2,x:x+v,dominantBaseline:"central",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:t.label})]},"legend-item-"+n)}var Yn=(e,t,n,r,i,o,a,s,l,c,u)=>{const{items:d}=e,h=[];let f=0;const m={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=i,metrics:u};return d.forEach((e,t)=>{h.push(qn(m,e,t,`translate(0,${f})`,"ArrowUp","ArrowDown")),f+=u.rowHeight}),h};function Un(e){const{legendGroups:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,legendInteraction:a,title:s="Legend",width:l=100,height:c=20,orientation:u="vertical",legendLayout:d}=e,h=zn(d),[f,m]=pn.useState(0),[y,p]=pn.useState(0),g=pn.useCallback((e,t)=>{m(e),p(t)},[]),b="vertical"===u?(({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:a,focusedItemIndex:s,onFocusedIndexChange:l,legendInteraction:c,metrics:u})=>{const d=[],h=function(e,t){let n=24;return e.map(({hasLabel:e,itemCount:r})=>{n+=5;const i=n;let o;n+=8,e&&(n+=16,o=n,n+=8);const a=n;return n+=r*t+8,{lineY:i,labelY:o,itemsY:a,endY:n}})}(e.map(e=>({hasLabel:!!e.label,itemCount:e.items.length})),u.rowHeight);return e.forEach((e,f)=>{const m=h[f];d.push(En("line",{stroke:"gray",x1:0,y1:m.lineY,x2:t,y2:m.lineY},"legend-top-line legend-symbol-"+f)),e.label&&null!=m.labelY&&d.push(En("text",{y:m.labelY,className:"legend-group-label",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label},"legend-text-"+f)),d.push(En("g",{className:"legend-item",transform:`translate(0,${m.itemsY})`,children:Yn(e,n,r,i,o,a,s,f,l,c,u)},"legend-group-"+f))}),d})({legendGroups:t||[],width:l,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:y,onFocusedIndexChange:g,legendInteraction:a,metrics:h}):(({legendGroups:e,height:t,width:n,customClickBehavior:r,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:a,focusedGroupIndex:s,focusedItemIndex:l,onFocusedIndexChange:c,legendInteraction:u,metrics:d})=>{let h=0;const f=[];e.forEach((e,t)=>{let m=0;e.label&&(m+=16);const y=((e,t,n,r,i,o,a,s,l,c,u,d)=>{const{items:h}=e,f=[],{swatchSize:m,labelGap:y,itemGap:p,rowHeight:g,align:b}=u,x={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=i,metrics:u},v=h.map(e=>m+y+7*e.label.length),k=[];let w=0,$=0;v.forEach((e,t)=>{const n=0===$?e:$+p+e;d&&d>0&&$>0&&n>d?(k.push({start:w,end:t,width:$}),w=t,$=e):$=n}),h.length>0&&k.push({start:w,end:h.length,width:$}),k.forEach((e,t)=>{let n="center"===b?Math.max(0,((d??e.width)-e.width)/2):"end"===b?Math.max(0,(d??e.width)-e.width):0;for(let r=e.start;e.end>r;r++)f.push(qn(x,h[r],r,`translate(${n},${t*g})`,"ArrowLeft","ArrowRight")),n+=v[r]+p});const M=Math.max(0,...k.map(e=>e.width)),A=k.length;return{items:f,offset:M,totalRows:A,totalHeight:A*g}})(e,r,i,o,a,s,l,t,c,u,d,d.maxWidth??n);m+=y.offset+5,f.push({label:e.label,...y,offset:m,totalRows:y.totalRows,totalHeight:y.totalHeight}),h+=m+12});const m=d.maxWidth??n;let y=h>m?0:"center"===d.align?Math.max(0,(m-h)/2):"end"===d.align?Math.max(0,m-h):0;const p=[];return f.forEach((n,r)=>{const i=e[r];i.label&&(p.push(En("text",{transform:`translate(${y},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:i.label},"legend-text-"+r)),y+=16),p.push(En("g",{className:"legend-item",transform:`translate(${y},0)`,children:n.items},"legend-group-"+r)),y+=n.offset+5,e[r+1]&&p.push(En("line",{stroke:"gray",x1:y,y1:-8,x2:y,y2:(n.totalHeight||t)+0+8},"legend-top-line legend-symbol-"+r)),y+=12}),En("g",{children:p})})({legendGroups:t||[],title:s,height:c,width:l,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:y,onFocusedIndexChange:g,legendInteraction:a,metrics:h}),x=!(!n&&!r);return Bn("g",{role:x?"listbox":void 0,"aria-multiselectable":!(!x||"isolate"!==a&&(void 0!==a||null==o))||void 0,"aria-label":"Chart legend",style:{fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},children:[void 0!==s&&""!==s&&"vertical"===u&&En("text",{className:"legend-title",y:16,x:l/2,textAnchor:"middle",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:s}),b]})}import{useRef as Xn,useState as Zn,useEffect as Kn}from"react";function Jn(e,t=0,n=1/0,r=0){const i=Number.isFinite(t)?t:0,o=Number.isFinite(n)?Math.max(i,n):1/0,a=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(o,a));return r>0&&Number.isFinite(r)?Math.max(i,Math.min(o,Math.round(s/r)*r)):s}function Qn(e,t,n,r={}){const i=Xn(null),[o,a]=Zn(null);return Kn(()=>{if(!t&&!n)return;const e=i.current;if(!e||"undefined"==typeof ResizeObserver)return;const o=(e,t)=>({w:Jn(e,r.minWidth,r.maxWidth,r.widthStep),h:Jn(t,r.minHeight,r.maxHeight,r.heightStep)}),s=new ResizeObserver(e=>{for(const t of e){const{width:e,height:n}=t.contentRect,r=o(e,n);a(e=>e&&e.w===r.w&&e.h===r.h?e:r)}});return s.observe(e),()=>s.disconnect()},[t,n,r.minWidth,r.maxWidth,r.widthStep,r.minHeight,r.maxHeight,r.heightStep]),[i,[t&&o?o.w:e[0],n&&o?o.h:e[1]]]}import{jsx as er,jsxs as tr}from"react/jsx-runtime";var nr=an(!1),rr=an(!1);function ir(){return sn(rr)}var or=an(null),ar="undefined"==typeof window?ln:un;function sr(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function lr(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function cr(e){const t=sn(or),n=cn(),r=sr(e),i=hn([]);lr(i.current,r)||(i.current=r);const o=i.current;ar(()=>{if(t)return()=>t.unregisterCategories(n)},[t,n]),ar(()=>{t&&t.registerCategories(n,o)},[t,n,o])}function ur(){return null!==sn(or)}var dr="__linked-legend-isolate__",hr="__linked-legend-highlight__";function fr({categoryColors:e,interaction:t,selectionName:n,field:r}){const i=Object.entries(e),o=i.map(([e])=>e),s=[{styleFn:e=>({fill:e.color||"#333",stroke:e.color||"#333"}),type:"fill",items:i.map(([e,t])=>({label:e,color:t})),label:""}],{selectPoints:l,clear:c}=Ut({name:n,fields:[r],clientId:dr}),{selectPoints:u,clear:d}=Ut({name:n,fields:[r],clientId:hr}),h=a(e=>e.selections.get(n)),{isolatedCategories:f,highlightedCategory:m}=dn(()=>{const e=new Set;let t=null;const n=h?.clauses.get(dr)?.fields[r];if("point"===n?.type)for(const t of n.values)e.add(t+"");const i=h?.clauses.get(hr)?.fields[r];if("point"===i?.type){const e=i.values.values().next().value;null!=e&&(t=e+"")}return{isolatedCategories:e,highlightedCategory:t}},[h,r]),y=mn(e=>{"highlight"===t&&(e?u({[r]:[e.label]}):d())},[t,r,u,d]),p=mn(e=>{if("isolate"!==t)return;const n=new Set(f);n.has(e.label)?n.delete(e.label):n.add(e.label),0===n.size||n.size===o.length?c():l({[r]:Array.from(n)})},[t,r,f,o.length,l,c]),[g,[b]]=Qn([0,0],!0,!1),x=dn(()=>function(e,t){if(!t||0===e.length)return 1;let n=0,r=1;for(const i of e){const e=26+7*i.length;n>0&&n+e>t&&(r++,n=0),n+=e}return r}(i.map(([e])=>e),b),[i,b]);return 0===i.length?null:er("div",{ref:g,style:{width:"100%",display:"block"},children:er("svg",{width:"100%",height:Math.max(30,22*x+8),style:{display:"block",overflow:"visible"},children:er(Un,{legendGroups:s,title:!1,orientation:"horizontal",width:b,height:20,customHoverBehavior:"highlight"===t?y:void 0,customClickBehavior:"isolate"===t?p:void 0,highlightedCategory:m,isolatedCategories:f})})})}function mr({children:n,selections:r,showLegend:i,legendPosition:o="top",legendInteraction:a="none",legendSelectionName:s="legend",legendField:c="category"}){const u=dn(()=>{if(!r)return;const e=new Map;for(const[t,n]of Object.entries(r))n.resolution&&e.set(t,{name:t,resolution:n.resolution,clauses:new Map});return e.size>0?{selections:e}:void 0},[r]),d=Ot(),h=l(e=>e.theme.colors.categorical),f=h.length>0?h:xt,[m,y]=fn({}),p=hn(new Map),g=dn(()=>({registerCategories:(e,t)=>{const n=sr(t);y(t=>lr(t[e]??[],n)?t:{...t,[e]:n})},unregisterCategories:e=>{y(t=>{if(!Object.prototype.hasOwnProperty.call(t,e))return t;const n={...t};return delete n[e],n})}}),[]),b=dn(()=>{const e=[];for(const t of Object.values(m))for(const n of t)e.push(n);return sr(e)},[m]),x=dn(()=>{const e=d??{},t=new Map(p.current),n=Object.entries(e).filter(e=>"string"==typeof e[1]&&e[1].length>0),r=b.map(n=>{const r=yn(t,n);return[n,St(e,n)??f[r%f.length]]});return{categoryIndexes:t,colors:Object.fromEntries([...n,...r])}},[d,b,f]);ar(()=>{p.current=x.categoryIndexes},[x]);const v=x.colors,k=void 0===i||i,w=Object.keys(v).length>0;return er(t,{initialState:u,children:er(e,{children:er(rr.Provider,{value:!0,children:er(or.Provider,{value:g,children:er(Nt,{colors:v,children:tr(nr.Provider,{value:k&&w,children:[k&&"top"===o&&er(fr,{categoryColors:v,interaction:a,selectionName:s,field:c}),n,k&&"bottom"===o&&er(fr,{categoryColors:v,interaction:a,selectionName:s,field:c})]})})})})})})}var yr=Object.freeze([]);function pr(e){if(!e)return yr;let t=!1;for(let n=0;e.length>n;n++){const r=e[n];if(null==r||"object"!=typeof r){t=!0;break}}if(!t)return e;const n=[];for(const t of e)null!=t&&"object"==typeof t&&n.push(t);return n}var gr={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"};function br(e,t){const n={...e};for(const e of t)n[gr[e]]++;return n}function xr(e,t,n){const r=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:r,revisions:br(n,r)}}var vr=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=xr({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){const n=xr(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}};import{memo as kr,useEffect as wr,useRef as $r}from"react";var Mr={sceneGeometry:0,layout:0,domain:0};function Ar(e){const{domain:t,layout:n,sceneGeometry:r}=e.revisions;return{domain:t,layout:n,sceneGeometry:r}}function Sr(e,t){return{sceneGeometry:Math.max(e.sceneGeometry,t.sceneGeometry),layout:Math.max(e.layout,t.layout),domain:Math.max(e.domain,t.domain)}}var Wr="production"!==process.env.NODE_ENV,Cr={revisions:Mr,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},Lr=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=Mr,this.lastObserved=Mr,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){Wr&&(this.lastObserved=Sr(this.lastObserved,Ar(e)))}beforeCompute(e,t){if(!Wr)return Cr;const n=Sr(Ar(e),this.lastObserved),r=function(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}(n),i=!((o=n).sceneGeometry===(a=this.lastConsumed).sceneGeometry&&o.layout===a.layout&&o.domain===a.domain);var o,a;return{revisions:n,signature:r,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:i,warnUnconsumed:!t&&i&&this.lastUnconsumedWarning!==r}}afterCompute(e,t,n){if(Wr){if(t&&e.wasUnconsumed&&(this.lastConsumed=e.revisions),e.warnUnconsumed&&!t)return console.warn(`[semiotic] ${this.hostName} observed scene-affecting revisions without a scene rebuild: ${e.signature}.`),void(this.lastUnconsumedWarning=e.signature);t&&e.sawSignals&&!e.wasUnconsumed&&!n&&this.lastDuplicateWarning!==e.signature?(console.warn(`[semiotic] ${this.hostName} performed scene rebuild with unchanged scene revisions: ${e.signature}.`),this.lastDuplicateWarning=e.signature):t&&!e.sawSignals&&(this.lastDuplicateWarning="")}}};function jr(e){return $r(new Lr(e))}function Nr(e,t,n,r=!1,i=!1){const o=e.beforeCompute(t.getLastUpdateResult(),r);n(),e.afterCompute(o,!0,i)}var Or=kr(function({store:e,diagnostics:t}){return wr(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null});function Ir(e,t){const n=e.fillStyle,r="#010203";try{e.fillStyle=r,e.fillStyle=t}catch{return e.fillStyle=n,[78,121,167]}const i=e.fillStyle;if(e.fillStyle=n,"string"!=typeof i)return[78,121,167];if(i.toLowerCase()===r&&t.trim().toLowerCase()!==r)return[78,121,167];if(i.startsWith("#"))return[parseInt(i.slice(1,3),16),parseInt(i.slice(3,5),16),parseInt(i.slice(5,7),16)];const o=i.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return o?[+o[1],+o[2],+o[3]]:[78,121,167]}import{curveMonotoneX as Rr,curveMonotoneY as zr,curveCardinal as Pr,curveCatmullRom as Fr,curveStep as Tr,curveStepBefore as Dr,curveStepAfter as Er,curveBasis as Br,curveNatural as Hr}from"d3-shape";function Gr(e){switch(e){case"monotoneX":return Rr;case"monotoneY":return zr;case"cardinal":return Pr;case"catmullRom":return Fr;case"step":return Tr;case"stepBefore":return Dr;case"stepAfter":return Er;case"basis":return Br;case"natural":return Hr;default:return null}}function _r(e,t,n){if(null==t)return n;if(Y(t)){const r=function(e,t){const n=e.background??"transparent",r=e.stroke??"#000",i="transparent"===n||"none"===n?n:G(t,n)||n,o=G(t,r)||r||"#000",a="undefined"!=typeof window&&window.devicePixelRatio||1,s=`${U(e)}|${i}|${o}@${a}`,l=Z.get(s);if(void 0!==l)return l;const c=z({background:i,stroke:o,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle},t),u=Y(c)?null:c;return Z.set(s,u),u}(t,e);return r||t.background&&G(e,t.background)||n}return"string"!=typeof t?t:G(e,t)||n}function Vr(e,t,n){const r=_r(e,t,n);if("string"==typeof r&&r.trim().startsWith("var(")){const t=G(e,n);return t&&!t.trim().startsWith("var(")?t:n}return r}function qr(e,t){if(null==t)return;const n=_r(e,t,"");return""===n?void 0:n}function Yr(e,t,n,r,i,o,a){const s=t.stops.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity)));if(2>s.length)return null;const l=e.createLinearGradient(r,i,o,a);for(const t of s)l.addColorStop(Math.max(0,Math.min(1,t.offset)),Ur(e,t,n));return l}function Ur(e,t,n){const r=t.color??n,i=G(e,r)||r;if(null==t.opacity)return i;const o=Math.max(0,Math.min(1,t.opacity)),[a,s,l]=Ir(e,i);return`rgba(${a},${s},${l},${o})`}function Xr(e,t,n,r){t.fill&&(e.fillStyle=_r(e,t.fill,n),void 0!==t.fillOpacity&&(e.globalAlpha=(t.opacity??1)*t.fillOpacity),r())}function Zr(e,t,n){t.stroke&&"none"!==t.stroke&&(e.strokeStyle=G(e,t.stroke)||t.stroke,e.lineWidth=t.strokeWidth??1,e.globalAlpha=(t.opacity??1)*(t.strokeOpacity??1),n())}import{jsx as Kr}from"react/jsx-runtime";function Jr(e){const{legend:t,totalWidth:n,totalHeight:r,margin:i,legendPosition:o="right",legendLayout:a,legendHoverBehavior:s,legendClickBehavior:l,legendHighlightedCategory:c,legendIsolatedCategories:u,legendInteraction:d}=e;if(!t)return null;const{x:h,y:f,width:m}=function(e,t){const n=t.position??"right",r="top"===n||"bottom"===n,i=Math.max(0,t.totalWidth-t.margin.left-t.margin.right),o=Math.max(1,r?t.legendLayout?.maxWidth??i:t.reservedWidth??wn(e,t.legendLayout)),a=$n(e),s=Mn(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),l=An(t.legendLayout),c=On(e,i,t.legendLayout),u=Cn(t.axisChrome,t.legendLayout),d=Cn(t.axisChrome?.topAxis,t.legendLayout);if("left"===n)return{x:Math.max(l,t.margin.left-s-o-a),y:t.margin.top,width:o,height:c};if("top"===n)return{x:t.margin.left,y:t.margin.top-d-a-c,width:o,height:c};if("bottom"===n){const e=t.totalHeight-t.margin.bottom;return{x:t.margin.left,y:Math.max(e+a,Math.min(e+u+a,t.totalHeight-c)),width:o,height:c}}return{x:Math.min(t.totalWidth-o-l,t.totalWidth-t.margin.right+s+a),y:t.margin.top,width:o,height:c}}(t,{totalWidth:n,totalHeight:r,margin:i,position:o,legendLayout:a,axisChrome:e.axisChrome}),y="top"===o||"bottom"===o;return Kr("g",{transform:`translate(${h}, ${f})`,children:xn(t)?Kr(Dn,{config:t.gradient,orientation:y?"horizontal":"vertical",width:m,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):bn(t)?Kr(Un,{legendGroups:t.legendGroups,title:"",width:m,orientation:y?"horizontal":"vertical",legendLayout:a,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}import{jsx as Qr}from"react/jsx-runtime";var ei={secondary:0,primary:3},ti=".annotation-deferred{opacity:0;pointer-events:none;transition:opacity .12s ease}.stream-xy-frame:hover .annotation-deferred,.stream-ordinal-frame:hover .annotation-deferred,.stream-network-frame:hover .annotation-deferred,.stream-geo-frame:hover .annotation-deferred,.stream-xy-frame:focus-within .annotation-deferred,.stream-ordinal-frame:focus-within .annotation-deferred,.stream-network-frame:focus-within .annotation-deferred,.stream-geo-frame:focus-within .annotation-deferred{opacity:1;pointer-events:auto}@media (prefers-reduced-motion:reduce){.annotation-deferred{transition:none}}";function ni(e){return!0===e?._annotationDeferred}function ri(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function ii(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function oi(e){return Math.max(.72,.95-.06*e)}function ai(e){const t=e.map((e,t)=>{return{p:e,i:t,emphasis:(n=e.annotation,"primary"===n?.emphasis||"secondary"===n?.emphasis?n.emphasis:null),confidence:ii(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),r=e.some(e=>ni(e.annotation)),i=e.some(e=>null!=ri(e.annotation)),o=e.some(e=>"layer"===ri(e.annotation));if(!n&&!r&&!i)return e.map(e=>e.node);const a=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);a.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,a.length)});for(const e of t)e.emphasis&&(e.rank=ei[e.emphasis]);const s=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{const{p:t,i:n,emphasis:r,readingOrder:i}=e,o=ni(t.annotation);let a=t.node;if("primary"===r||"secondary"===r||null!=i){const e=null==r&&null!=i;a=Qr("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":"annotation-emphasis annotation-emphasis--"+r,..."secondary"===r?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:oi(i),"data-annotation-reading-order":i}:{},children:t.node},"annotation-emphasis-"+n)}const s=ri(t.annotation);return s&&(a=Qr("g",{className:"annotation-cohesion--"+s,children:a},"annotation-cohesion-"+n)),o&&(a=Qr("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:a},"annotation-deferred-"+n)),a});return r&&s.unshift(Qr("style",{children:ti},"annotation-disclosure-style")),o&&s.unshift(Qr("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),s}function si(e,t,n,r){return function(e,t,n,r){const i=[];return e.forEach((e,o)=>{let a;if(n){const i=n(e,o,r);a=null!=i?i:t(e,o,r)}else a=t(e,o,r);a&&i.push({node:a,annotation:e})}),{nodes:ai(i),renderedAnnotations:i.map(e=>e.annotation)}}(e,t,n,r).nodes}import*as li from"react";import{jsx as ci,jsxs as ui}from"react/jsx-runtime";function di(e,t=120,n=8){if(!e)return[];const r=Math.max(1,Math.floor(t/n)),i=e.split(/\s+/),o=[];let a="";for(const e of i)a&&a.length+1+e.length>r?(o.push(a),a=e):a=a?`${a} ${e}`:e;return a&&o.push(a),o}function hi(e,t,n,r){return"curly"===e?r?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:r?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function fi(e,t,n,r){if(!e)return ci("g",{className:"annotation-note"});const{label:i,title:o,orientation:a,align:s,wrap:l=120,noWrap:c}=e;if(!i&&!o)return ci("g",{className:"annotation-note"});let u=a;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");let d=s;d&&"dynamic"!==d||(d="topBottom"===u?0>t?"right":"left":0>n?"bottom":"top");let h="start";"topBottom"===u?"right"===d?h="end":"middle"===d&&(h="middle"):h=0>t?"end":"start";const f=16,m=o?c?[o]:di(o,l):[],y=i?c?[i]:di(i,l):[],p="leftRight"===u?"end"===h?-4:4:0;let g=0;const b=[],x=r||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";e.useHTML||e.html?b.push(ci("foreignObject",{className:"annotation-note-html",x:"end"===h?p-l:"middle"===h?p-l/2:p,y:-16,width:l,height:Math.max(f,(m.length+y.length)*f+(o&&i?2:0))+f,style:{overflow:"visible"},children:ui("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:x,fontSize:"12px",lineHeight:"16px",overflow:"visible",textAlign:"end"===h?"right":"middle"===h?"center":"left",whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[o&&ci("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:o}),i&&ci("div",{className:"annotation-note-label",children:i})]})},"annotation-note-html")):(m.length>0&&(b.push(ci("text",{className:"annotation-note-title",fill:x,textAnchor:h,fontWeight:"bold",children:m.map((e,t)=>ci("tspan",{x:p,dy:0===t?0:f,children:e},t))},"annotation-note-title")),g=m.length*f),y.length>0&&b.push(ci("text",{className:"annotation-note-label",fill:x,textAnchor:h,y:g,children:y.map((e,t)=>ci("tspan",{x:p,dy:0===t?0:f,children:e},t))},"annotation-note-label")));let v=null;if((o||i)&&(0!==t||0!==n))if("topBottom"===u){const e=Math.min(l,120);let t=0,n=e;"end"===h?(t=-e,n=0):"middle"===h&&(t=-e/2,n=e/2),v=ci("line",{className:"note-line",x1:t,x2:n,y1:0,y2:0,stroke:r||"var(--semiotic-text-secondary, currentColor)"})}else{const e=(m.length+y.length)*f+(y.length>0?f:0);let t=0,n=e;"bottom"===d?(t=-e,n=0):"middle"===d&&(t=-e/2,n=e/2),v=ci("line",{className:"note-line",x1:0,x2:0,y1:t,y2:n,stroke:r||"var(--semiotic-text-secondary, currentColor)"})}const k=Math.max(0,m.length+y.length-1)*f;let w=0;return"topBottom"===u?w=0>n?-(k+2):18:"leftRight"===u&&(w="middle"===d?-(k+f+(y.length>0&&m.length>0?2:0))/2+8:"bottom"===d||0>n?-(k+2):18),ui("g",{className:"annotation-note",transform:`translate(${t},${n})`,children:[ci("g",{className:"annotation-note-content",transform:0!==w?`translate(0,${w})`:void 0,children:b}),v]})}function mi(e,t,n,r,i){const o=[];switch(e){case"callout-circle":{const e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&o.push(ci("circle",{r:e,fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"subject-circle"));break}case"callout-rect":{const e=t?.width||0,r=t?.height||0;(e>0||r>0)&&o.push(ci("rect",{width:e,height:r,fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"subject-rect"));break}case"callout-custom":t?.custom&&o.push(...Array.isArray(t.custom)?t.custom:[t.custom]);break;case"xy-threshold":{const e=r||0,a=i||0;if(void 0!==t?.x){const r=(t.x||0)-e;o.push(ci("line",{x1:r,y1:(t.y1||0)-a,x2:r,y2:(t.y2||0)-a,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"))}else if(void 0!==t?.y){const r=(t.y||0)-a;o.push(ci("line",{x1:(t.x1||0)-e,y1:r,x2:(t.x2||0)-e,y2:r,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"))}else void 0!==t?.x1||void 0!==t?.x2?o.push(ci("line",{x1:(t.x1||0)-e,y1:0,x2:(t.x2||0)-e,y2:0,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line")):void 0===t?.y1&&void 0===t?.y2||o.push(ci("line",{x1:0,y1:(t.y1||0)-a,x2:0,y2:(t.y2||0)-a,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"));break}case"bracket":{const e=t?.type||"curly",r=t?.width??t?.height;void 0!==r&&o.push(ci("path",{d:hi(e,r,t?.depth||30,void 0===t?.width),fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"bracket-path"));break}}return ci("g",{className:"annotation-subject",children:o})}function yi(e,t,n,r,i,o){const a=[];let s=0,l=0;if("callout-circle"!==i&&"label"!==i||!o?.radius){if("callout-rect"===i&&o){const n=o.width||0,r=o.height||0;if(n>0||r>0){const i=n/2,o=r/2,a=e-i,c=t-o;if(0!==a||0!==c){const e=Math.abs(a),t=Math.abs(c),u=n/2,d=r/2,h=e*d>t*u?u/e:d/t;s=i+a*h,l=o+c*h}}}else if("bracket"===i&&o){const e=o.width,t=o.height,n=o.depth||30;void 0!==e?(s=e/2,l=n):void 0!==t&&(s=n,l=t/2)}}else{const n=(o.radius||0)+(o.radiusPadding||0);if(n>0&&(0!==e||0!==t)){const r=Math.atan2(t,e);s=Math.cos(r)*n,l=Math.sin(r)*n}}const c=Math.sqrt((e-s)**2+(t-l)**2);if(c>.5){const i=r||"var(--semiotic-text-secondary, currentColor)",o="curve"===n?.type;let u=Math.atan2(t-l,e-s);if(o){const r=(s+e)/2,o=(l+t)/2,d=-(t-l)/c,h=(e-s)/c,f=(n?.curve??.25)*c,m=r+d*f,y=o+h*f;a.push(ci("path",{className:"connector-curve",d:`M${s},${l}Q${m},${y} ${e},${t}`,fill:"none",stroke:i},"connector-line")),u=Math.atan2(y-l,m-s)}else a.push(ci("line",{x1:s,y1:l,x2:e,y2:t,stroke:i},"connector-line"));if("arrow"===n?.end){const e=10,t=16/180*Math.PI;a.push(ci("path",{d:`M${s},${l}L${s+e*Math.cos(u+t)},${l+e*Math.sin(u+t)}L${s+e*Math.cos(u-t)},${l+e*Math.sin(u-t)}Z`,fill:i,stroke:"none"},"connector-arrow"))}}return ci("g",{className:"annotation-connector",children:a})}function pi(e){const{x:t=0,y:n=0,dx:r,dy:i,nx:o,ny:a,note:s,connector:l,subject:c,type:u,color:d,className:h,disable:f,opacity:m,strokeDasharray:y,events:p={},"data-testid":g}=e,b=Array.isArray(t)?t[0]??0:t,x=Array.isArray(n)?n[0]??0:n,v=new Set(Array.isArray(f)?f:[]);let k=r||0,w=i||0;null!=o&&(k=o-b),null!=a&&(w=a-x);const $="string"==typeof u?u:"label";if("bracket"===$&&c&&0===k&&0===w)if(void 0!==c.width){k=c.width/2;const e=c.depth||30;w=e+(0>e?-5:5)}else if(void 0!==c.height){const e=c.depth||30;k=e+(0>e?-5:5),w=c.height/2}return ui("g",{className:("annotation "+(h||"")).trim(),transform:`translate(${b},${x})`,"data-testid":g,...null!=m&&{opacity:m},...y&&{strokeDasharray:y},...p,children:[!v.has("connector")&&yi(k,w,l,d,$,c),!v.has("subject")&&mi($,c,d,b,x),!v.has("note")&&fi(s,k,w,d)]})}function gi(e){const{noteData:t}=e,{screenCoordinates:n}=t,r="string"==typeof t.type?t.type:"label",i=t.eventListeners||t.events||{};if(t.coordinates&&n){const e=t.nx||n[0][0]+(t.dx??0),i=t.ny||n[0][1]+(t.dy??0),o=n.map((n,o)=>{const a=Object.assign({},t,{note:0===o?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:i});return ci(pi,{"data-testid":"semiotic-annotation",...a,type:r},"multi-annotation-"+o)});return ci("g",{children:o})}const o=t.note||{title:"none",label:t.label},a=`${o.label}-${o.title}-${t.i}`;return ci(pi,{"data-testid":"semiotic-annotation",events:i,...t,type:r},a)}import{packEnclose as bi}from"d3-hierarchy";import{area as xi,curveLinear as vi,curveMonotoneX as ki,curveMonotoneY as wi,curveStep as $i,curveStepAfter as Mi,curveStepBefore as Ai,curveBasis as Si,curveCardinal as Wi,curveCatmullRom as Ci}from"d3-shape";function Li(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function ji(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function Ni(e){return null==e?null:e+""}function Oi(e,t,n){return t.stickyPositionCache?.set(e,n),n}function Ii(e,t,n){const r=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===r){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let r=n.pointNodes.length-1;r>=0;r--){const i=n.pointNodes[r];if(i.pointId===e.pointId)return Oi(t,n,{x:i.x,y:i.y})}const r=function(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],r=e.scales?.x??e.scales?.time,i=e.scales?.y??e.scales?.value;if(!r||!i)return null;const o=n[e.xAccessor||"x"],a=n[e.yAccessor||"y"];return null==o||null==a?null:{x:r(o),y:i(a)}}(n);return r?Oi(t,n,r):null}if("semantic"===r){const r=function(e,t,n){const r=function(e){return Ni(e.provenance?.stableId??e.stableId)}(e);if(!r)return null;const i=n.pointNodes?.find(e=>Ni(e.pointId)===r);if(i)return Oi(t,n,{x:i.x,y:i.y});const o=n.data?.find(e=>function(e){return Ni(e.stableId??e.id??e.provenance?.stableId)}(e)===r);if(!o)return null;const a=Li(o,n),s=ji(o,n);return null==a||null==s?null:Oi(t,n,{x:a,y:s})}(e,t,n);if(r)return r}let i=null,o=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(i=t.x,o=t.y)}if(null!=i&&null!=o||(i=Li(e,n),o=ji(e,n)),null!=i&&null!=o)return Oi(t,n,{x:i,y:o});if("sticky"===r){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function Ri(e,t,n,r=50){return!(-r>e||e>(n.width||0)+r||-r>t||t>(n.height||0)+r)}function zi(e,t,n,r){const i=J(e.fill??e.color,t,r);return function(e,t,n,r){if(!e||"object"!=typeof e)return;const i=e;if(!Array.isArray(i.stops))return;const o=i.stops.flatMap(e=>{if(!e||"object"!=typeof e)return[];const{offset:t,color:n,opacity:i}=e;return"number"==typeof t&&Number.isFinite(t)?[{offset:Math.max(0,Math.min(1,t)),color:"string"==typeof n&&n?n:r,opacity:"number"==typeof i&&Number.isFinite(i)?Math.max(0,Math.min(1,i)):void 0}]:[]}).sort((e,t)=>e.offset-t.offset);if(!o.length)return;const a="horizontal"===i.direction?"horizontal":"vertical"===i.direction?"vertical":n,s=t+"-gradient";return{fill:`url(#${s})`,def:V("linearGradient",{id:s,x1:0,y1:0,x2:"horizontal"===a?"100%":0,y2:"vertical"===a?"100%":0,children:o.map((e,t)=>V("stop",{offset:100*e.offset+"%",stopColor:e.color,stopOpacity:e.opacity},`${e.offset}-${t}`))},s)}}(e.gradient,t,n,"string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:r)??i}var Pi=new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]);function Fi(e,t,n,r){const i=function(e,t,n){const r=e.position,i="string"==typeof r&&Pi.has(r)?r:"bottom-left",o=i.endsWith("left")?"left":i.endsWith("right")?"right":"center",a=i.startsWith("top")?"top":i.startsWith("bottom")?"bottom":"middle",s="top"===a?0:"bottom"===a?n:n/2;return{x:("left"===o?0:"right"===o?t:t/2)+("number"==typeof e.dx&&Number.isFinite(e.dx)?e.dx:0),y:s+("number"==typeof e.dy&&Number.isFinite(e.dy)?e.dy:0),textAnchor:"start"===e.textAnchor||"middle"===e.textAnchor||"end"===e.textAnchor?e.textAnchor:"left"===o?"start":"right"===o?"end":"middle",dominantBaseline:"auto"===e.dominantBaseline||"middle"===e.dominantBaseline||"hanging"===e.dominantBaseline?e.dominantBaseline:"top"===a?"hanging":"bottom"===a?"auto":"middle"}}(e,t,n);return{...i,fill:e.fill??e.color??r.fill,fontSize:e.fontSize??r.fontSize,fontFamily:e.fontFamily??r.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,letterSpacing:e.letterSpacing,opacity:e.opacity,className:e.className,style:{pointerEvents:"none"}}}import{jsx as Ti}from"react/jsx-runtime";var Di={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"};function Ei({annotation:e,width:t,height:n,defaults:r=Di}){const i=e.label??e.text;return null==i?null:Ti("text",{...Fi(e,t,n,r),children:i})}import{jsx as Bi,jsxs as Hi}from"react/jsx-runtime";var Gi={linear:vi,monotoneX:ki,monotoneY:wi,step:$i,stepAfter:Mi,stepBefore:Ai,basis:Si,cardinal:Wi,catmullRom:Ci};function _i(e,t={}){return function(e,n,r){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{const t=Ii(e,n,r);if(!t)return null;const{x:i,y:o}=t;if(!Ri(i,o,r))return null;const a="callout"===e.type?"callout-circle":e.type,s="callout-circle"===a?{radius:e.radius??12,radiusPadding:e.radiusPadding}:"callout-rect"===a?{width:e.width,height:e.height}:void 0;return Bi(gi,{noteData:{x:i,y:o,dx:e.dx??30,dy:e.dy??-30,note:{label:e.label,title:e.title,wrap:e.wrap||120},type:a,...s?{subject:s}:{},connector:e.connector||{end:"arrow"},color:e.color,disable:e.disable,opacity:e.opacity,strokeDasharray:e.strokeDasharray,className:e.className}},"ann-"+n)}case"x-threshold":{const t=Li(null!=e.value?{...e,x:e.value}:e,r);if(null==t)return null;const i=e.color||"#f97316",o=e.labelPosition||"top";let a;a="bottom"===o?(r.height||0)-4:"center"===o?(r.height||0)/2:16;const s=t>.6*(r.width||0),l=s?t-4:t+4,c=s?"end":"start";return Hi("g",{opacity:e.opacity,children:[Bi("line",{x1:t,y1:0,x2:t,y2:r.height||0,stroke:i,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&Bi(le,{x:l,y:a,text:e.label,textAnchor:c,fill:i,fontSize:12,fontWeight:"bold",background:e.labelBackground??"halo"})]},"ann-"+n)}case"y-threshold":{const t=ji(null!=e.value?{...e,y:e.value}:e,r);if(null==t)return null;const i=e.color||"#f97316",o=e.labelPosition||"right";let s,l;"left"===o?(s=4,l="start"):"center"===o?(s=(r.width||0)/2,l="middle"):(s=(r.width||0)-4,l="end");const c=20>(a=t)?Math.min((r.height||0)-4,a+16):a-4;return Hi("g",{opacity:e.opacity,children:[Bi("line",{x1:0,y1:t,x2:r.width||0,y2:t,stroke:i,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&Bi(le,{x:s,y:c,text:e.label,textAnchor:l,fill:i,fontSize:12,fontWeight:"bold",background:e.labelBackground??"halo"})]},"ann-"+n)}case"enclose":{const t=(e.coordinates||[]).map(e=>({x:Li({...e,type:"point"},r),y:ji({...e,type:"point"},r),r:1})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;const i=bi(t),o=e.padding||10;return Hi("g",{children:[Bi("circle",{cx:i.x,cy:i.y,r:i.r+o,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&Bi(le,{x:i.x,y:i.y-i.r-o-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+n)}case"rect-enclose":{const t=(e.coordinates||[]).map(e=>({x:Li({...e,type:"point"},r),y:ji({...e,type:"point"},r)})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;const i=e.padding||10,o=t.map(e=>e.x),a=t.map(e=>e.y),[s,l]=h(o),[c,u]=h(a),d=s-i,f=l+i,m=c-i;return Hi("g",{children:[Bi("rect",{x:d,y:m,width:f-d,height:u+i-m,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&Bi(le,{x:(d+f)/2,y:m-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+n)}case"highlight":{const t=r.data||[],i="function"==typeof e.filter?t.filter(e.filter):e.field&&null!=e.value?t.filter(t=>t[e.field]===e.value):[],o={stroke:e.color||"#f97316",strokeWidth:2,fill:"none"};return Bi("g",{children:i.map((t,n)=>{const i=Li(t,r),a=ji(t,r);if(null==i||null==a)return null;const s="function"==typeof e.r?e.r(t):e.r||6,l="function"==typeof e.style?e.style(t):e.style||o;return Bi("circle",{cx:i,cy:a,r:s,...l},"hl-"+n)})},"ann-"+n)}case"bracket":{const t=Li(e,r),i=ji(e,r);return Bi(gi,{noteData:{x:t??0,y:i??0,dx:e.dx||0,dy:e.dy||0,note:{label:e.label,title:e.title,wrap:e.wrap||120},type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth||30},color:e.color}},"ann-"+n)}case"trend":{const t=r.data||[];if(2>t.length)return null;const i=r.xAccessor||"x",o=r.yAccessor||"y",a="ordinal"===r.frameType,s="horizontal"===r.projection,l=a?i:null,c=a?o:null;let u;const d=[],h=new Map;if(a&&l&&c){for(const e of t){const t=e[l];if(null==t)continue;const n=t+"";h.has(n)||(h.set(n,d.length),d.push(n))}u=t.map(e=>{const t=e[l],n=e[c];if(null==t||null==n)return null;const r=h.get(t+"");return null!=r?[r,+n]:null}).filter(e=>null!==e)}else u=t.map(e=>[e[i],e[o]]).filter(e=>null!=e[0]&&null!=e[1]);if(2>u.length)return null;const y=r.scales?.x??r.scales?.time,p=r.scales?.y??r.scales?.value;if(!y||!p)return null;const g=e=>t=>{const n=Math.max(0,Math.floor(t)),r=Math.min(d.length-1,n+1),i=t-n,o=e(d[n]);return o+(e(d[r])-o)*i},b=y,x=p;let v;if(a)if(s){const e=g(x);v=(t,n)=>[b(n),e(t)]}else{const e=g(b);v=(t,n)=>[e(t),x(n)]}else v=(e,t)=>[b(e),x(t)];const k=e.method||"linear";let w;w="loess"===k?function(e,t=.3){const n=e.length;if(2>n)return e.slice();const r=e.slice().sort((e,t)=>e[0]-t[0]),i=r.map(e=>e[0]),o=r.map(e=>e[1]),a=Math.max(2,Math.ceil(t*n)),s=[];for(let e=0;n>e;e++){const t=i[e],r=i.map(e=>Math.abs(e-t)),l=r.slice().sort((e,t)=>e-t)[Math.min(a-1,n-1)]||1,c=[];for(let e=0;n>e;e++){const t=0===l?0:r[e]/l;c[e]=1>t?Math.pow(1-Math.pow(t,3),3):0}let u=0,d=0,h=0,f=0,m=0;for(let e=0;n>e;e++){const t=c[e];0!==t&&(u+=t,d+=t*i[e],h+=t*o[e],f+=t*i[e]*i[e],m+=t*i[e]*o[e])}if(0===u){s.push([t,o[e]]);continue}const y=u*f-d*d;if(1e-12>Math.abs(y))s.push([t,h/u]);else{const e=(u*m-d*h)/y;s.push([t,(h-e*d)/u+e*t])}}return s}(u,e.bandwidth??.3):("polynomial"===k?m(u,e.order||2):f(u)).points;const $=w.map(([e,t])=>{const[n,r]=v(e,t);return`${n},${r}`}).join(" "),M=e.color||"#6366f1",A=w[w.length-1],[S,W]=v(A[0],A[1]);return Hi("g",{children:[Bi("polyline",{points:$,fill:"none",stroke:M,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&Bi("text",{x:S+4,y:W-4,fill:M,fontSize:11,children:e.label})]},"ann-"+n)}case"band":{const t=r.scales?.y??r.scales?.value,a=t?.domain?.(),s=e.y0??a?.[0],l=e.y1??a?.[1],c=null!=s&&t?t(s):0,u=null!=l&&t?t(l):r.height||0,d=zi(e,"ann-"+n,"vertical","var(--semiotic-primary, #6366f1)");return Hi("g",{opacity:e.opacity,children:[d.def&&Bi("defs",{children:d.def}),Bi("rect",{x:0,y:Math.min(c,u),width:r.width||0,height:Math.abs(u-c),fill:d.fill,fillOpacity:e.fillOpacity??.1}),e.label&&Bi(le,{x:(r.width||0)-4,y:(i=c,o=u,Math.max(Math.min(i,o),0)+16),textAnchor:"end",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+n)}case"x-band":{const t=r.scales?.x??r.scales?.time,i=t?.domain?.(),o=e.x0??i?.[0],a=e.x1??i?.[1],s=null!=o&&t?t(o):null,l=null!=a&&t?t(a):null;if(null==s||null==l)return null;const c=zi(e,"ann-"+n,"horizontal","var(--semiotic-primary, #6366f1)");return Hi("g",{opacity:e.opacity,children:[c.def&&Bi("defs",{children:c.def}),Bi("rect",{x:Math.min(s,l),y:0,width:Math.abs(l-s),height:r.height||0,fill:c.fill,fillOpacity:e.fillOpacity??.1}),e.label&&Bi(le,{x:Math.min(s,l)+4,y:16,textAnchor:"start",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+n)}case"envelope":{const t=r.data||[];if(2>t.length)return null;const i=r.xAccessor||"x",o=r.scales?.x??r.scales?.time,a=r.scales?.y??r.scales?.value;if(!o||!a)return null;const s=e.upperAccessor||"upperBounds",l=e.lowerAccessor||"lowerBounds",c=e.filter,u=t.filter(e=>null!=e[s]&&null!=e[l]&&!(c&&!c(e))).sort((e,t)=>e[i]-t[i]);if(2>u.length)return null;const d=Gi[r.curve||"linear"]||vi,h=xi().x(e=>o(e[i])).y0(e=>a(e[l])).y1(e=>a(e[s])).curve(d)(u);if(!h)return null;const f=e.fill||"#6366f1";return Hi("g",{children:[Bi("path",{d:h,fill:f,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&u.length>0&&Bi("text",{x:o(u[u.length-1][i])+4,y:a(u[u.length-1][s])-4,fill:f,fontSize:11,children:e.label})]},"ann-"+n)}case"anomaly-band":{const t=r.data||[];if(2>t.length)return null;const i=r.yAccessor||"y",o=r.scales?.x??r.scales?.time,a=r.scales?.y??r.scales?.value;if(!o||!a)return null;const s=t.map(e=>e[i]).filter(e=>null!=e&&isFinite(e));if(2>s.length)return null;const l=s.reduce((e,t)=>e+t,0)/s.length,c=s.reduce((e,t)=>e+(t-l)**2,0)/s.length,u=Math.sqrt(c),d=e.threshold??2,h=l-d*u,f=!1!==e.showBand,m=e.fill||"#6366f1",y=e.fillOpacity??.1,p=e.anomalyColor||"#ef4444",g=e.anomalyRadius??6,b=a(l+d*u),x=a(h),v=t.filter(e=>{const t=e[i];return null!=t&&Math.abs(t-l)>d*u});return Hi("g",{children:[f&&Bi("rect",{x:0,y:Math.min(b,x),width:r.width||0,height:Math.abs(x-b),fill:m,fillOpacity:y}),v.map((e,t)=>{const n=Li(e,r),i=ji(e,r);return null==n||null==i?null:Bi("circle",{cx:n,cy:i,r:g,fill:p,fillOpacity:.7,stroke:p,strokeWidth:1.5},"anomaly-"+t)}),e.label&&Bi("text",{x:(r.width||0)-4,y:Math.min(b,x)-4,textAnchor:"end",fill:m,fontSize:11,children:e.label})]},"ann-"+n)}case"forecast":{const t=r.data||[];if(3>t.length)return null;const i=r.xAccessor||"x",o=r.yAccessor||"y",a=r.scales?.x??r.scales?.time,s=r.scales?.y??r.scales?.value;if(!a||!s)return null;const l=t.map(e=>[e[i],e[o]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]);if(3>l.length)return null;let h;if("polynomial"===(e.method||"linear")){const t=m(l,e.order||2).equation;h=e=>t.reduce((t,n,r)=>t+n*Math.pow(e,r),0)}else{const e=u(l);if(!e)return null;h=e}const f=l.length,{se:y,meanX:p,ssX:g}=d(l,h),b=c(e.confidence??.95),x=e.steps??5,v=l[f-1][0],k=(v-l[0][0])/Math.max(f-1,1),w=[];for(let e=1;x>=e;e++)w.push(v+e*k);const $=[];for(const e of w){const t=h(e),n=y*Math.sqrt(1+1/f+(g>0?(e-p)**2/g:0))*b;$.push({x:e,yCenter:t,yUpper:t+n,yLower:t-n})}const M=`M${$.map(e=>`${a(e.x)},${s(e.yUpper)}`).join(" L")} L${$.slice().reverse().map(e=>`${a(e.x)},${s(e.yLower)}`).join(" L")} Z`,A=$.map(e=>`${a(e.x)},${s(e.yCenter)}`).join(" "),S=`${a(v)},${s(h(v))}`,W=e.strokeColor||"#6366f1";return Hi("g",{children:[Bi("path",{d:M,fill:e.fill||"#6366f1",fillOpacity:e.fillOpacity??.15,stroke:"none"}),Bi("polyline",{points:`${S} ${A}`,fill:"none",stroke:W,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&$.length>0&&Bi("text",{x:a($[$.length-1].x)+4,y:s($[$.length-1].yCenter)-4,fill:W,fontSize:11,children:e.label})]},"ann-"+n)}case"widget":{let i,o;if(null!=e.px&&null!=e.py)i=e.px,o=e.py;else{const t=Ii(e,n,r);if(!t)return null;i=t.x,o=t.y}if(!Ri(i,o,r))return null;const a=e.dx??0,s=e.dy??0,l=e.width??32,c=e.height??32,u=e.content??Bi("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});return Bi("foreignObject",{x:i+a-l/2,y:o+s-c/2,width:l,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:Bi("div",{...ne(e,t),style:{width:l,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},"ann-"+n)}case"text":{const t=Ii(e,n,r);if(!t)return null;const{x:i,y:o}=t,a=i+(e.dx||0),s=o+(e.dy||0),l=e.color||"var(--semiotic-text, #333)",c=Bi("text",{x:a,y:s,fill:l,fontSize:e.fontSize||11,opacity:e.opacity,strokeDasharray:e.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:e.label});return!0!==e._redundantConnector?li.cloneElement(c,{key:"ann-text-"+n}):Hi("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[Bi("line",{x1:i,y1:o,x2:a,y2:s,stroke:l,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),li.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},"ann-text-"+n)}case"frame-text":return Bi(Ei,{annotation:e,width:r.width||0,height:r.height||0},"ann-frame-text-"+n);case"category-highlight":{const t=e.category;if(null==t)return null;const i=e=>"function"==typeof e&&"function"==typeof e.bandwidth,o=r.scales?.o,a=r.scales?.x,s=r.scales?.y,l=i(o)?o:i(a)?a:i(s)?s:null;if(!l)return null;const c=l(t+"");if(null==c)return null;const u=l.bandwidth(),d=e.color||"var(--semiotic-primary, #4589ff)",h=e.opacity??.15,f=e.label;return Hi("g",(r.projection?"vertical"===r.projection:l===a)?{children:[Bi("rect",{x:c,y:0,width:u,height:r.height||0,fill:d,fillOpacity:h}),f&&Bi(le,{x:c+u/2,y:16,textAnchor:"middle",fill:d,fontSize:12,fontWeight:"bold",text:f,background:e.labelBackground??"none"})]}:{children:[Bi("rect",{x:0,y:c,width:r.width||0,height:u,fill:d,fillOpacity:h}),f&&Bi(le,{x:12,y:c+u/2,dominantBaseline:"middle",fill:d,fontSize:12,fontWeight:"bold",text:f,background:e.labelBackground??"none"})]},"ann-"+n)}default:return null}var i,o,a}}var Vi=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),qi=new Set(["label","callout","callout-circle","callout-rect"]);function Yi(e){return"string"==typeof e?.type?e.type:""}function Ui(e){return!!e&&"object"==typeof e&&Vi.has(Yi(e))}function Xi(e){return qi.has(Yi(e))&&!function(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}(e)}function Zi(e){return"primary"===e?.emphasis||!0===e?.defensive}function Ki(e,t,n={}){return"number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations)?Math.max(0,Math.floor(n.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4))):1/0}function Ji(e){let t;const n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;const r=e?.provenance?.confidence;switch("number"==typeof r&&Number.isFinite(r)&&(t+=15*Math.max(0,Math.min(1,r))),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}var Qi=32,eo=6,to=4,no=8,ro=72;var io={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};function oo(e){if(!ao(e))return e;const t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function ao(e){return Ui(e)}function so(e,t){if(!e)return[];const n=Math.max(1,Math.floor(t/7)),r=e.split(/\s+/).filter(Boolean),i=[];let o="";for(const e of r)o&&o.length+e.length+1>n?(i.push(o),o=e):o=o?`${o} ${e}`:e;return o&&i.push(o),i}function lo(e,t,n,r,i){const o=e+n,a=t+r;return Math.abs(n)>Math.abs(r)?{x:0>n?o-i.width-4:o+4,y:0>r?a-i.height:a,width:i.width,height:i.height}:{x:0>n?o-i.width:o,y:0>r?a-i.height-4:a+4,width:i.width,height:i.height}}function co(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function uo(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function ho(e,t,n,r,i,o,a,s){const l=co(e,a);let c=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,n,r){const i=Math.max(0,r-e.x),o=Math.max(0,r-e.y);return(i+Math.max(0,e.x+e.width-(t-r)))*e.height+(o+Math.max(0,e.y+e.height-(n-r)))*e.width}(l,i,o,s);for(const e of n)c+=12*uo(l,e);for(const e of r)c+=4*uo(l,e);return c}function fo(e){const{annotations:t,context:n,defaultOffset:r=Qi,notePadding:i=eo,markPadding:o=to,edgePadding:a=no,preserveManualOffsets:s=!0,routeLongConnectors:l=!0,connectorThreshold:c=ro,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:m,cohesion:y,audience:p}=e,g=n.width||0,b=n.height||0,x="object"==typeof m?m:{},v=x.breakpoint??480,k=!!m&&v>=g,w=k&&!1!==x.preferShortText?t.map(oo):t,$=k&&!u?{maxAnnotations:x.maxAnnotations??("callout-list"===x.strategy?1:2),minVisible:x.minVisible??1}:u,M=d||k&&(!1!==x.progressiveDisclosure||"callout-list"===x.strategy),A=k&&!f?x.responsive??{minWidth:v}:f,S=k&&!y?x.cohesion:y;if(0===w.length||0>=g||0>=b)return w.slice();const W=[],C=function(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}(n,o);let L=!1;const j=w.map((e,t)=>{if(!ao(e))return e;const o=function(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const r=e.pointId??e.nodeId;if(null!=r&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===r);if(e)return{x:e.x,y:e.y}}const i=e.coordinates,o=n.scales?.geoProjection;if(Array.isArray(i)&&i.length>=2&&o){const e=i[0],t=i[1];if("number"==typeof e&&"number"==typeof t){const n=o([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?Ii(e,t,n):{x:e.x,y:e.y}}(e,t,n);if(!o)return e;const u=function(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t="number"==typeof e.wrap?e.wrap:120,n=[...so("string"==typeof e.title?e.title:void 0,t),...so("string"==typeof e.label?e.label:void 0,t)],r=n.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(t,7*r)+10),height:Math.max(18,16*n.length+6)}}(e);if(s&&("number"==typeof(d=e).dx||"number"==typeof d.dy)){const t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e);return W.push(co(lo(o.x,o.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,u),i)),e}var d;let h=null,f=1/0;for(const e of function(e){const t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}(r)){const t=ho(lo(o.x,o.y,e.dx,e.dy,u),e,W,C,g,b,i,a);f>t&&(h=e,f=t)}if(!h)return e;const m=co(lo(o.x,o.y,h.dx,h.dy,u),i);W.push(m);const y=Math.hypot(h.dx,h.dy),p=l&&y>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return L=!0,{...e,dx:h.dx,dy:h.dy,...p?{connector:p}:{}}}),N=L?j:w.slice();let O=N;if(h){let e=!1;const t=N.map(t=>{const n=function(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}(t);return n!==t&&(e=!0),n});O=e?t:N}{let e=!1;const t=O.map(t=>{if(!0!==t?.defensive)return t;const n=function(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(io,t.source)?io[t.source]:t.source:null,r="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!r)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const i=[n,r].filter(Boolean).join(" · "),o="string"==typeof e.label?e.label:"";return o.includes(`(${i})`)?e:{...e,label:o?`${o} (${i})`:`(${i})`}}(t);return n!==t&&(e=!0),n});O=e?t:O}const I=new Set;if($){const e="object"==typeof $?$:{},t=function(e){if(!e)return 1;const t=function(e){const t=e?.familiarity;if(!t)return 3;const n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}(e);return t>2?4>t?1:.6:1.5}(p),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??Ki(g,b,e))*t))},{deferred:r}=function(e){const{annotations:t,width:n,height:r}=e,i=Math.max(0,e.minVisible??1),o=Ki(n,r,e),a=t.map((e,t)=>{return{annotation:e,index:t,note:(n=e,Ui(n))};var n}),s=a.filter(e=>e.note);if(0===s.length||o>=s.length)return{visible:t.slice(),deferred:[],budget:o};const l=s.filter(e=>Zi(e.annotation)),c=s.filter(e=>!Zi(e.annotation)).sort((e,t)=>Ji(t.annotation)-Ji(e.annotation)||e.index-t.index),u=Math.min(c.length,Math.max(Math.max(0,o-l.length),Math.max(0,i-l.length))),d=new Set([...l.map(e=>e.index),...c.slice(0,u).map(e=>e.index)]),h=[],f=[];for(const{annotation:e,index:t,note:n}of a)!n||d.has(t)?h.push(e):f.push(e);return{visible:h,deferred:f,budget:o}}({annotations:O,width:g,height:b,...n});for(const e of r)I.add(e)}if(A&&("object"==typeof A&&"number"==typeof A.minWidth?A.minWidth:480)>=g)for(const e of O)ao(e)&&"secondary"===e.emphasis&&I.add(e);if(I.size>0)for(const e of O)!0===e?.defensive&&I.delete(e);let R;return R=0===I.size?O:M?O.map(e=>I.has(e)?{...e,_annotationDeferred:!0}:e):O.filter(e=>!I.has(e)),S?function(e,t){let n=!1;const r=e.map(e=>ao(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?r:e}(R,S):R}import{jsx as mo}from"react/jsx-runtime";function yo({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?mo("foreignObject",{x:0,y:0,width:t,height:n,children:e}):mo("text",{x:t/2,y:22,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontSize:14,className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)",fontFamily:"var(--semiotic-title-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-title-font-weight, bold)"},children:e}):null}import*as po from"react";import{jsx as go}from"react/jsx-runtime";function bo(e){if(!1!==e?.interactive)return e?.style?.cursor}function xo(e){if(!e)return!1;for(const t of e)if(bo(t))return!0;return!1}function vo(e,t){if(!e)return;const n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function ko(e,t){return vo(e),xo(t)}function wo(e,t,n){e&&(t.inside&&"touch"!==t.pointerType?vo(e,n(t)):vo(e))}function $o(e){const t=po.useRef(null);po.useEffect(()=>{e.current&&(t.current=e.current)}),po.useEffect(()=>()=>vo(t.current),[])}function Mo(e,t,n){const r=bo(t);return r&&null!=e&&!1!==e?go("g",{style:{cursor:r},"data-semiotic-mark-cursor":r,children:e},n):e}import*as Ao from"react";function So(e){return(e.tl??0)>0||(e.tr??0)>0||(e.br??0)>0||(e.bl??0)>0}function Wo(e){const t=e.cornerRadii;if(!t)return{tl:0,tr:0,br:0,bl:0};const n=Math.min(e.w,e.h)/2,r=e=>Math.max(0,Math.min(e??0,n));return{tl:r(t.tl),tr:r(t.tr),br:r(t.br),bl:r(t.bl)}}import{symbol as Co,symbolCircle as Lo,symbolCross as jo,symbolDiamond as No,symbolSquare as Oo,symbolStar as Io,symbolTriangle as Ro,symbolWye as zo}from"d3-shape";var Po={circle:Lo,square:Oo,triangle:Ro,diamond:No,star:Io,cross:jo,wye:zo},Fo=new Set(["circle","square","triangle","diamond","star","cross","wye","chevron"]),To=["circle","triangle","diamond","star","square","chevron","cross","wye"];function Do(e,t,n){if(n)return n;const r=e??"circle";if("chevron"===r)return function(e){const t=1.5*Eo(e),n=.92*t;return`M0,${-t}L${n},${(.78*t).toFixed(3)}L0,${(.28*t).toFixed(3)}L${-n},${(.78*t).toFixed(3)}Z`}(t);const i=Object.prototype.hasOwnProperty.call(Po,r)?Po[r]:Lo;return Co(i,Math.max(1,t))()??""}function Eo(e){return Math.sqrt(Math.max(1,e)/Math.PI)}function Bo(e,t){const n=new Map;let r=0;return i=>{const o=e(i)+"",a=t&&Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a&&Fo.has(a))return a;let s=n.get(o);return s||(s=To[r%To.length],r++,n.set(o,s)),s}}import{jsx as Ho,jsxs as Go}from"react/jsx-runtime";var _o={innerRadius:0,outerRadius:0,startAngle:0,endAngle:0};function Vo(e,t="#4e79a7"){return Y(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function qo(e){const t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?"s_"+t:t}function Yo(e,t,n,r){const i=e.glyph;if(!i?.parts?.length||0>=e.size)return null;const o=A(i,e.size);if(0>=o.scale)return null;const a=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${o.offsetX},${o.offsetY}) scale(${o.scale})`,s=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),l=j(i,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=l?qo(r+"-clip"):void 0,u=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),d=t=>i.parts.map((n,r)=>{const i=t?"none"===n.fill?void 0:t:W(n.fill,s,e.accent),o=t?n.stroke&&"none"!==n.stroke?t:void 0:W(n.stroke??"none",s,e.accent);return i||o?Ho("path",{d:n.d,fill:i??"none",stroke:o,strokeWidth:o?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},r):null});return Go("g",{transform:a,opacity:1===u?void 0:u,children:[l&&c&&Ho("clipPath",{id:c,children:Ho("rect",{x:l.x,y:l.y,width:l.width,height:l.height})}),l&&e.ghostColor?Ho("g",{children:d(e.ghostColor)}):null,l&&c?Ho("g",{clipPath:`url(#${c})`,children:d()}):d()]},r)}function Uo(e,t){const n=e.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity))).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color??t,opacity:null==e.opacity?void 0:Math.max(0,Math.min(1,e.opacity))}));return 2>n.length?null:n.map((e,t)=>Ho("stop",{offset:e.offset,stopColor:e.color,stopOpacity:e.opacity},t))}function Xo(e,t,n){const r=Do(e.symbolType,e.size,e.path);return Ho("path",{d:r,transform:e.rotation?`translate(${e.x},${e.y}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.x},${e.y})`,fill:e.style.fill?Vo(e.style.fill):"none",fillOpacity:e.style.fillOpacity,opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},`${n??""}symbol-${t}`)}import{jsx as Zo,jsxs as Ko}from"react/jsx-runtime";function Jo(e,t){return Mo(function(e,t){switch(e.type){case"geoarea":{const n=e;if(!n.pathData)return null;const r=Y(n.style.fill)?K(n.style.fill,`geoarea-${t}-hatch`):void 0;return Ko(Ao.Fragment,{children:[r&&Zo("defs",{children:r}),Zo("path",{d:n.pathData,fill:r?`url(#geoarea-${t}-hatch)`:Vo(n.style.fill,"#e0e0e0"),fillOpacity:n.style.fillOpacity??1,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth??.5,strokeDasharray:n.style.strokeDasharray,opacity:n._decayOpacity??1})]},"geoarea-"+t)}case"point":{const n=e,r=Y(n.style.fill)?K(n.style.fill,`geopoint-${t}-hatch`):void 0;return Ko(Ao.Fragment,{children:[r&&Zo("defs",{children:r}),Zo("circle",{cx:n.x,cy:n.y,r:n.r,fill:r?`url(#geopoint-${t}-hatch)`:Vo(n.style.fill),fillOpacity:n.style.fillOpacity??.8,stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,opacity:n._decayOpacity??n.style.opacity??1})]},"point-"+t)}case"line":{const n=e;if(2>n.path.length)return null;const r="M"+n.path.map(e=>`${e[0]},${e[1]}`).join("L");return Zo("path",{d:r,fill:"none",stroke:n.style.stroke||"#4e79a7",strokeWidth:n.style.strokeWidth??1.5,strokeDasharray:n.style.strokeDasharray,opacity:n.style.opacity??1},"line-"+t)}case"glyph":return Yo(e,e.x,e.y,"geo-glyph-"+(e.pointId??t));default:return null}}(e,t),e,"geo-cursor-"+t)}import*as Qo from"react";import{area as ea,line as ta}from"d3-shape";function na(e,t,n){let r=n;for(const n of t)"lesser"===n.thresholdType?n.value>e&&(r=n.color):e>n.value&&(r=n.color);return r}function ra(e,t,n,r){if(2>e.length||t.length!==e.length||0===n.length)return[];const i=[],o=(e,t,n)=>{const r=i[i.length-1];r?.color===e?r.path.push(n):i.push({color:e,path:[t,n]})};for(let i=1;e.length>i;i++){const[a,s]=e[i-1],[l,c]=e[i],u=t[i-1],d=t[i]-u,h=[0,...0===d?[]:n.map(({value:e})=>(e-u)/d).filter(e=>e>0&&1>e&&Number.isFinite(e)).sort((e,t)=>e-t).filter((e,t,n)=>0===t||e!==n[t-1]),1];for(let e=1;h.length>e;e++){const t=h[e-1],i=h[e];o(na(u+d*((t+i)/2),n,r),[a+(l-a)*t,s+(c-s)*t],[a+(l-a)*i,s+(c-s)*i])}}return i}import*as ia from"react";import{arc as oa}from"d3-shape";import{jsx as aa,jsxs as sa}from"react/jsx-runtime";function la(e,t){return Mo(function(e,t){switch(e.type){case"circle":{const n=e,r=Y(n.style.fill)?K(n.style.fill,`net-circle-${t}-hatch`):void 0;return sa(ia.Fragment,{children:[r&&aa("defs",{children:r}),aa("circle",{cx:n.cx,cy:n.cy,r:n.r,fill:r?`url(#net-circle-${t}-hatch)`:Vo(n.style.fill),stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,fillOpacity:n.style.fillOpacity,strokeOpacity:n.style.strokeOpacity,opacity:n.style.opacity})]},"net-circle-"+t)}case"rect":{const n=e,r=Y(n.style.fill)?K(n.style.fill,`net-rect-${t}-hatch`):void 0;return sa(ia.Fragment,{children:[r&&aa("defs",{children:r}),aa("rect",{x:n.x,y:n.y,width:n.w,height:n.h,fill:r?`url(#net-rect-${t}-hatch)`:Vo(n.style.fill),stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,fillOpacity:n.style.fillOpacity,strokeOpacity:n.style.strokeOpacity,opacity:n.style.opacity})]},"net-rect-"+t)}case"arc":{const n=e,r=oa().innerRadius(n.innerR).outerRadius(n.outerR).startAngle(n.startAngle+Math.PI/2).endAngle(n.endAngle+Math.PI/2)(_o)||"",i=Y(n.style.fill)?K(n.style.fill,`net-arc-${t}-hatch`):void 0;return sa(ia.Fragment,{children:[i&&aa("defs",{children:i}),aa("path",{d:r,transform:`translate(${n.cx},${n.cy})`,fill:i?`url(#net-arc-${t}-hatch)`:Vo(n.style.fill),stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,fillOpacity:n.style.fillOpacity,strokeOpacity:n.style.strokeOpacity,opacity:n.style.opacity})]},"net-arc-"+t)}case"symbol":{const n=e,r=Do(n.symbolType,n.size,n.path);return aa("path",{d:r,transform:n.rotation?`translate(${n.cx},${n.cy}) rotate(${180*n.rotation/Math.PI})`:`translate(${n.cx},${n.cy})`,fill:n.style.fill?Vo(n.style.fill):"none",stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,fillOpacity:n.style.fillOpacity,strokeOpacity:n.style.strokeOpacity,opacity:n.style.opacity},"net-symbol-"+t)}case"glyph":return Yo(e,e.cx,e.cy,"net-glyph-"+(e.id??t));default:return null}}(e,t),e,"network-node-cursor-"+t)}function ca(e,t){return Mo(function(e,t){switch(e.type){case"line":return aa("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.style.stroke||"#999",strokeWidth:e.style.strokeWidth??1,opacity:e.style.opacity},"net-edge-"+t);case"bezier":{const n=e,r=`net-bezier-${t}-hatch`,i=Y(n.style.fill)?K(n.style.fill,r):void 0;return sa(ia.Fragment,{children:[i&&aa("defs",{children:i}),aa("path",{d:n.pathD,fill:i?`url(#${r})`:Vo(n.style.fill,"#999"),fillOpacity:n.style.fillOpacity,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth,opacity:n.style.opacity})]},"net-edge-"+t)}case"ribbon":{const n=e,r=`net-ribbon-${t}-hatch`,i=Y(n.style.fill)?K(n.style.fill,r):void 0;return sa(ia.Fragment,{children:[i&&aa("defs",{children:i}),aa("path",{d:n.pathD,fill:i?`url(#${r})`:Vo(n.style.fill,"#999"),fillOpacity:n.style.fillOpacity,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth,opacity:n.style.opacity})]},"net-edge-"+t)}case"curved":{const n=e;return aa("path",{d:n.pathD,fill:Vo(n.style.fill,"none"),stroke:n.style.stroke||"#999",strokeWidth:n.style.strokeWidth??1,opacity:n.style.opacity},"net-edge-"+t)}default:return null}}(e,t),e,"network-edge-cursor-"+t)}function ua(e,t){return aa("text",{x:e.x,y:e.y,textAnchor:e.anchor||"middle",dominantBaseline:e.baseline||"auto",fontSize:e.fontSize||11,fontWeight:e.fontWeight,fill:e.fill||"var(--semiotic-text, #333)",stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:e.paintOrder,children:e.text},"net-label-"+t)}import*as da from"react";import{arc as ha}from"d3-shape";var fa=(e,t)=>({x:e*Math.cos(t),y:e*Math.sin(t)});function ma(e){const{innerRadius:t,outerRadius:n,startAngle:r,endAngle:i}=e,o=0>=t;if(0>=(e.cornerRadius??0)||!e.roundStart&&!e.roundEnd){if(o){const e=fa(n,r),t=fa(n,i);return`M0,0 L${e.x},${e.y} A${n},${n} 0 ${i-r>Math.PI?1:0} 1 ${t.x},${t.y} Z`}const e=fa(n,r),a=fa(n,i),s=fa(t,i),l=fa(t,r),c=i-r>Math.PI?1:0;return`M${e.x},${e.y} A${n},${n} 0 ${c} 1 ${a.x},${a.y} L${s.x},${s.y} A${t},${t} 0 ${c} 0 ${l.x},${l.y} Z`}const a=Math.max(0,Math.min(e.cornerRadius??0,(n-t)/2));if(0===a)return ma({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});const s=Math.asin(Math.min(1,a/Math.max(1e-9,n-a))),l=o?0:Math.asin(Math.min(1,a/Math.max(1e-9,t+a))),c=i-r,u=e.roundStart&&e.roundEnd?c/2:c,d=!!e.roundStart&&u>s,h=!!e.roundEnd&&u>s;if(!d&&!h)return ma({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});const f=r+(d?s:0),m=i-(h?s:0),y=r+(d?l:0),p=i-(h?l:0),g=fa(n,f),b=fa(n,m),x=(n-a)*Math.cos(s),v=fa(x,r),k=fa(x,i),w=o?null:fa(t,p),$=o?null:fa(t,y),M=o?0:(t+a)*Math.cos(l),A=o?null:fa(M,r),S=o?null:fa(M,i),W=m-f>Math.PI?1:0,C=o?0:p-y>Math.PI?1:0;let L="";if(d)L+=`M${v.x},${v.y}`,L+=` A${a},${a} 0 0 1 ${g.x},${g.y}`;else{const e=fa(n,r);L+=`M${e.x},${e.y}`}if(h)L+=` A${n},${n} 0 ${W} 1 ${b.x},${b.y}`,L+=` A${a},${a} 0 0 1 ${k.x},${k.y}`;else{const e=fa(n,i);L+=` A${n},${n} 0 ${W} 1 ${e.x},${e.y}`}if(o)L+=" L0,0";else{if(h)L+=` L${S.x},${S.y}`,L+=` A${a},${a} 0 0 1 ${w.x},${w.y}`;else{const e=fa(t,i);L+=` L${e.x},${e.y}`}if(d)L+=` A${t},${t} 0 ${C} 0 ${$.x},${$.y}`,L+=` A${a},${a} 0 0 1 ${A.x},${A.y}`;else{const e=fa(t,r);L+=` A${t},${t} 0 ${C} 0 ${e.x},${e.y}`}}return L+=" Z",L}function ya(e){const t=ma({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,cornerRadius:e.cornerRadius,roundStart:e.roundStart,roundEnd:e.roundEnd}),n=[],r=e.colors;if(r.length>0){const t=(e.endAngle-e.startAngle)/r.length;for(let i=0;r.length>i;i++)n.push({d:ma({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle+i*t,endAngle:e.endAngle}),color:r[i]})}return{clipPath:t,slices:n}}import{jsx as pa,jsxs as ga}from"react/jsx-runtime";function ba(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 xa(e,t){const n=e.datum;if(!n)return null;const r=[],i=n.__funnelStepLabel,o=Number(n.__funnelStepLabelX),a=Number(n.__funnelStepLabelY),s=Number(n.__funnelRowWidth);"string"!=typeof i||!Number.isFinite(o)||!Number.isFinite(a)||Number.isFinite(s)&&8.4*i.length+16>s||r.push(pa("text",{x:o,y:a+3,textAnchor:"middle",dominantBaseline:"hanging",fontSize:14,fontWeight:"bold",fill:"#fff",stroke:"rgba(0,0,0,0.6)",strokeWidth:3,paintOrder:"stroke",children:i},t+"-funnel-step"));const l=Number(n.__funnelValue),c=Number(n.__funnelValueLabelX),u=Number(n.__funnelValueLabelY),d=Number(n.__funnelBarW);if(Number.isFinite(l)&&0!==l&&Number.isFinite(c)&&Number.isFinite(u)&&d>=60){const e=Number(n.__funnelPercent);let i=!0!==n.__funnelIsFirstStep&&Number.isFinite(e)?`${ba(l)} (${.05>Math.abs(e-Math.round(e))?Math.round(e):e.toFixed(1)}%)`:ba(l);7.8*i.length+16>d&&(i=ba(l)),7.8*i.length+16>d||r.push(pa("text",{x:c,y:u+22,textAnchor:"middle",dominantBaseline:"hanging",fontSize:13,fontWeight:"bold",fill:"#fff",stroke:"rgba(0,0,0,0.5)",strokeWidth:3,paintOrder:"stroke",children:i},t+"-funnel-value"))}return r.length?pa("g",{children:r},t+"-funnel-labels"):null}function va(e,t,n){return Mo(function(e,t,n){const r=("category"in e?e.category:void 0)||("group"in e?e.group:void 0)||"",i=n=>`ord-${e.type}-${r}-${t}-${n}`,o=`ord-${e.type}-${r}-${t}`;switch(e.type){case"rect":{const t=e,n=qo(o)+"-grad",r=function(e,t){const n=e.fillGradient;if(!n||"object"!=typeof n)return null;let r=e.x,i=e.y,o=e.x,a=e.y+e.h;"bottom"===e.roundedEdge?(i=e.y+e.h,a=e.y):"right"===e.roundedEdge?(r=e.x+e.w,i=e.y,o=e.x,a=e.y):"left"===e.roundedEdge&&(r=e.x,i=e.y,o=e.x+e.w,a=e.y);const s=Uo(n.stops,Vo(e.style.fill));return s?Ho("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:r,y1:i,x2:o,y2:a,children:s}):null}(t,n);let i,a;if(r)a=`url(#${n})`;else if(Y(t.style.fill)){const e=qo(o)+"-hatch";i=K(t.style.fill,e),a=`url(#${e})`}else a=Vo(t.style.fill);const s=r||i?ga("defs",{children:[r,i]}):null;if(t.cornerRadii&&So(t.cornerRadii)){const e=function(e){const{x:t,y:n,w:r,h:i}=e,{tl:o,tr:a,br:s,bl:l}=Wo(e);let c=`M${t+o},${n}`;return c+=` L${t+r-a},${n}`,a>0&&(c+=` A${a},${a} 0 0 1 ${t+r},${n+a}`),c+=` L${t+r},${n+i-s}`,s>0&&(c+=` A${s},${s} 0 0 1 ${t+r-s},${n+i}`),c+=` L${t+l},${n+i}`,l>0&&(c+=` A${l},${l} 0 0 1 ${t},${n+i-l}`),c+=` L${t},${n+o}`,o>0&&(c+=` A${o},${o} 0 0 1 ${t+o},${n}`),c+=" Z",c}(t);return ga(da.Fragment,{children:[s,pa("path",{d:e,fill:a,opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth})]},o)}if(t.roundedTop&&t.roundedTop>0){const e=Math.min(t.roundedTop,t.w/2,t.h/2),{x:n,y:r,w:i,h:l}=t;let c;switch(t.roundedEdge){case"right":c=`M${n},${r} L${n+i-e},${r} A${e},${e} 0 0 1 ${n+i},${r+e} L${n+i},${r+l-e} A${e},${e} 0 0 1 ${n+i-e},${r+l} L${n},${r+l} Z`;break;case"left":c=`M${n+i},${r} L${n+e},${r} A${e},${e} 0 0 0 ${n},${r+e} L${n},${r+l-e} A${e},${e} 0 0 0 ${n+e},${r+l} L${n+i},${r+l} Z`;break;case"bottom":c=`M${n},${r} L${n+i},${r} L${n+i},${r+l-e} A${e},${e} 0 0 1 ${n+i-e},${r+l} L${n+e},${r+l} A${e},${e} 0 0 1 ${n},${r+l-e} Z`;break;default:c=`M${n},${r+l} L${n},${r+e} A${e},${e} 0 0 1 ${n+e},${r} L${n+i-e},${r} A${e},${e} 0 0 1 ${n+i},${r+e} L${n+i},${r+l} Z`}return ga(da.Fragment,{children:[s,pa("path",{d:c,fill:a,opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth})]},o)}return ga(da.Fragment,{children:[s,pa("rect",{x:t.x,y:t.y,width:t.w,height:t.h,fill:a,opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth}),xa(t,o)]},o)}case"point":{const t=e;return pa("circle",{cx:t.x,cy:t.y,r:t.r,fill:Vo(t.style.fill),opacity:t.style.opacity??t.style.fillOpacity??.8,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},o)}case"symbol":return Xo(e,t,n);case"glyph":return Yo(e,e.x,e.y,`${n??""}ord-glyph-${e.pointId??t}`);case"wedge":{const r=e;if(r._gradientBand&&r._gradientBand.colors.length>0){const e=qo(`${n?n+"-":""}gauge-grad-${r.category||o}-${t}`),{clipPath:i,slices:a}=ya({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 ga("g",{transform:`translate(${r.cx},${r.cy})`,opacity:r.style.opacity,fillOpacity:r.style.fillOpacity,children:[pa("defs",{children:pa("clipPath",{id:e,children:pa("path",{d:i})})}),pa("g",{clipPath:`url(#${e})`,children:a.map((e,t)=>pa("path",{d:e.d,fill:Vo(e.color)},t))}),r.style.stroke&&"none"!==r.style.stroke&&pa("path",{d:i,fill:"none",stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},o)}let i;if(r.roundedEnds)i=ma({innerRadius:r.innerRadius,outerRadius:r.outerRadius,startAngle:r.startAngle,endAngle:r.endAngle,cornerRadius:r.cornerRadius,roundStart:r.roundedEnds.start,roundEnd:r.roundedEnds.end});else{const e=ha().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(_o)||""}return pa("path",{d:i,transform:`translate(${r.cx},${r.cy})`,fill:Vo(r.style.fill),stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,opacity:r.style.opacity},o)}case"boxplot":{const t=e,n=t.columnWidth/2,r=t.style.strokeWidth??1;return ga("g","vertical"===t.projection?{children:[pa("line",{x1:t.x,y1:t.minPos,x2:t.x,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:r}),pa("rect",{x:t.x-n,y:Math.min(t.q1Pos,t.q3Pos),width:t.columnWidth,height:Math.abs(t.q3Pos-t.q1Pos),fill:Vo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:r}),pa("line",{x1:t.x-n,y1:t.medianPos,x2:t.x+n,y2:t.medianPos,stroke:t.style.stroke||"#333",strokeWidth:2*r}),pa("line",{x1:t.x-.5*n,y1:t.minPos,x2:t.x+.5*n,y2:t.minPos,stroke:t.style.stroke||"#333",strokeWidth:r}),pa("line",{x1:t.x-.5*n,y1:t.maxPos,x2:t.x+.5*n,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:r})]}:{children:[pa("line",{x1:t.minPos,y1:t.y,x2:t.maxPos,y2:t.y,stroke:t.style.stroke||"#333",strokeWidth:r}),pa("rect",{x:Math.min(t.q1Pos,t.q3Pos),y:t.y-n,width:Math.abs(t.q3Pos-t.q1Pos),height:t.columnWidth,fill:Vo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:r}),pa("line",{x1:t.medianPos,y1:t.y-n,x2:t.medianPos,y2:t.y+n,stroke:t.style.stroke||"#333",strokeWidth:2*r}),pa("line",{x1:t.minPos,y1:t.y-.5*n,x2:t.minPos,y2:t.y+.5*n,stroke:t.style.stroke||"#333",strokeWidth:r}),pa("line",{x1:t.maxPos,y1:t.y-.5*n,x2:t.maxPos,y2:t.y+.5*n,stroke:t.style.stroke||"#333",strokeWidth:r})]},o)}case"violin":{const t=e,n=[pa("path",{d:t.pathString,transform:t.translateX||t.translateY?`translate(${t.translateX},${t.translateY})`:void 0,fill:Vo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:t.style.strokeWidth??1},i("path"))];if(t.iqrLine&&t.bounds){const e=t.bounds,r=e.x+e.width/2,o=e.y+e.height/2;t.iqrLine.isVertical?n.push(pa("line",{x1:r,y1:t.iqrLine.q1Pos,x2:r,y2:t.iqrLine.q3Pos,stroke:t.style.stroke||"#333",strokeWidth:2},i("iqr")),pa("circle",{cx:r,cy:t.iqrLine.medianPos,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},i("med"))):n.push(pa("line",{x1:t.iqrLine.q1Pos,y1:o,x2:t.iqrLine.q3Pos,y2:o,stroke:t.style.stroke||"#333",strokeWidth:2},i("iqr")),pa("circle",{cx:t.iqrLine.medianPos,cy:o,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},i("med")))}return pa("g",{children:n},o)}case"connector":{const t=e,n=t.style.fill&&"none"!==t.style.fill?Vo(t.style.fill,"var(--semiotic-border, #999)"):"var(--semiotic-border, #999)";return pa("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.stroke||n,strokeWidth:t.style.strokeWidth??1,opacity:t.style.opacity??.5},o)}case"trapezoid":{const t=e,n=t.points.map(e=>`${e[0]},${e[1]}`).join(" ");return pa("polygon",{points:n,fill:Vo(t.style.fill,"#999"),opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},o)}default:return null}}(e,t,n),e,"ordinal-cursor-"+t)}import{jsx as ka,jsxs as wa}from"react/jsx-runtime";function $a(e,t,n,r){if(!e||2>t.length)return null;const i=Uo(e.stops,r);return i?ka("linearGradient",{id:n,gradientUnits:"userSpaceOnUse",x1:t[0][0],y1:0,x2:t[t.length-1][0],y2:0,children:i}):null}function Ma(e,t,n,r=30){const i=function(e,t,n,r=30){switch(e.type){case"line":{const r=e;if(0===r.path.length)return null;const i=Gr(r.curve),o=i?ta().x(([e])=>e).y(([,e])=>e).curve(i)(r.path)??"":"M"+r.path.map(([e,t])=>`${e},${t}`).join("L"),a=qo(`${n?n+"-":""}line-${t}-stroke-gradient`),s=$a(r.strokeGradient,r.path,a,r.style.stroke||"#4e79a7");return wa(Qo.Fragment,{children:[s&&ka("defs",{children:s}),ka("path",{d:o,fill:"none",stroke:s?`url(#${a})`:r.style.stroke||"#4e79a7",strokeWidth:r.style.strokeWidth??2,strokeDasharray:r.style.strokeDasharray,opacity:r.style.opacity})]},"line-"+t)}case"area":{const i=e;if(0===i.topPath.length)return null;const o=Gr(i.curve),a=!o||2>i.topPath.length||2>i.bottomPath.length?`M${i.topPath.map(([e,t])=>`${e},${t}`).join("L")}L${[...i.bottomPath].reverse().map(([e,t])=>`${e},${t}`).join("L")}Z`:ea().x(([e])=>e).y0((e,t)=>i.bottomPath[t][1]).y1(([,e])=>e).curve(o)(i.topPath)??"",s=`${n?n+"-":""}area-${t}-hatch`,l=Y(i.style.fill)?K(i.style.fill,s):void 0,c=qo(`${n?n+"-":""}area-${t}-gradient`),u=function(e,t){const n=e.fillGradient;if(!n||"object"!=typeof n)return null;let r=1/0;for(const[,t]of e.topPath)r=Math.min(r,t);let i=-1/0;for(const[,t]of e.bottomPath)i=Math.max(i,t);if(!Number.isFinite(r)||!Number.isFinite(i))return null;const o=Uo(n.stops,Vo(e.style.fill));return o?ka("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:0,y1:r,x2:0,y2:i,children:o}):null}(i,c),d=u?`url(#${c})`:l?`url(#${s})`:Vo(i.style.fill),h=u?void 0:i.style.fillOpacity??i.style.opacity??.7,f=o?ta().x(([e])=>e).y(([,e])=>e).curve(o)(i.topPath)??"":"M"+i.topPath.map(([e,t])=>`${e},${t}`).join("L"),m=bo(i),y=m&&r>=0?ka("path",{d:f,fill:"none",stroke:"transparent",strokeWidth:Math.max(1,2*r),strokeLinecap:"round",pointerEvents:"stroke",style:{cursor:m},"data-semiotic-mark-cursor":m,"data-semiotic-cursor-hit-target":"area-top-path","aria-hidden":"true"},`area-${t}-cursor-target`):null,p=qo(`${n?n+"-":""}area-${t}-stroke-gradient`),g=!(!i.colorThresholds?.length||!i.rawValues||i.rawValues.length!==i.topPath.length),b=!!i.strokeColorBands?.length,x=g||b?null:$a(i.strokeGradient,i.topPath,p,i.style.stroke||"#4e79a7"),v=i.style.strokeWidth??2;let k=1/0,w=-1/0;for(const[e]of i.topPath)k>e&&(k=e),e>w&&(w=e);const $=b?i.strokeColorBands.map((e,r)=>qo(`${n?n+"-":""}area-${t}-stroke-band-${r}`)):[],M=b?i.strokeColorBands.map((e,t)=>ka("clipPath",{id:$[t],children:ka("rect",{x:k-v,y:e.y,width:w-k+2*v,height:e.height})},$[t])):null,A=i.style.stroke&&"none"!==i.style.stroke?b?i.strokeColorBands.map((e,n)=>ka("path",{d:f,fill:"none",stroke:e.color??Vo(i.style.stroke),strokeWidth:v,opacity:(i.style.opacity??1)*(e.opacity??1),clipPath:`url(#${$[n]})`},`area-${t}-stroke-band-${n}`)):g?ra(i.topPath,i.rawValues,i.colorThresholds,Vo(i.style.stroke)).map((e,n)=>ka("path",{d:"M"+e.path.map(([e,t])=>`${e},${t}`).join("L"),fill:"none",stroke:e.color,strokeWidth:v,opacity:i.style.opacity},`area-${t}-threshold-${n}`)):ka("path",{d:f,fill:"none",stroke:x?`url(#${p})`:Vo(i.style.stroke),strokeWidth:v,opacity:i.style.opacity}):null;if(i.clipRect){const e=`${n?n+"-":""}area-clip-${t}`;return wa("g",{children:[wa("defs",{children:[u,!u&&l,x,M,ka("clipPath",{id:e,children:ka("rect",{x:i.clipRect.x,y:i.clipRect.y,width:i.clipRect.width,height:i.clipRect.height})})]}),wa("g",{clipPath:`url(#${e})`,children:[ka("path",{d:a,fill:d,fillOpacity:h,opacity:u?i.style.opacity:void 0,stroke:"none"}),A,y]})]},"area-"+t)}return wa(Qo.Fragment,{children:[(u||l||x||M)&&wa("defs",{children:[u,!u&&l,x,M]}),ka("path",{d:a,fill:d,fillOpacity:h,opacity:u?i.style.opacity:void 0,stroke:"none"}),A,y]},"area-"+t)}case"point":{const r=e,i=`${n?n+"-":""}point-${t}-hatch`,o=Y(r.style.fill)?K(r.style.fill,i):void 0;return wa(Qo.Fragment,{children:[o&&ka("defs",{children:o}),ka("circle",{cx:r.x,cy:r.y,r:r.r,fill:o?`url(#${i})`:Vo(r.style.fill),opacity:r.style.opacity??r.style.fillOpacity??.8,stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},"point-"+t)}case"symbol":return Xo(e,t);case"glyph":return Yo(e,e.x,e.y,`${n??""}glyph-${e.pointId??t}`);case"rect":{const r=e,i=`${n?n+"-":""}xyrect-${t}-hatch`,o=Y(r.style.fill)?K(r.style.fill,i):void 0;return wa(Qo.Fragment,{children:[o&&ka("defs",{children:o}),ka("rect",{x:r.x,y:r.y,width:r.w,height:r.h,fill:o?`url(#${i})`:Vo(r.style.fill),opacity:r.style.opacity,stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},"rect-"+t)}case"heatcell":{const n=e,r={x:n.x,y:n.y,width:n.w,height:n.h,fill:n.fill,stroke:n.style?.stroke,strokeWidth:n.style?.strokeWidth,...null!=n.style?.opacity&&{opacity:n.style.opacity}};if(n.showValues&&null!=n.value&&n.w>=20&&n.h>=20){const e=n.valueFormat?n.valueFormat(n.value):Number.isInteger(n.value)?n.value+"":100>Math.abs(n.value)?1>Math.abs(n.value)?n.value.toPrecision(3):n.value.toFixed(1):n.value.toFixed(0),[i,o,a]=function(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}const t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}(n.fill),s=.299*i+.587*o+.114*a>128?"#000":"#fff",l=Math.max(10,Math.min(16,.3*Math.min(n.w,n.h)));return wa("g",{children:[ka("rect",{...r}),ka("text",{x:n.x+n.w/2,y:n.y+n.h/2,textAnchor:"middle",dominantBaseline:"middle",fill:s,fontSize:l+"px",children:e})]},"heatcell-"+t)}return ka("rect",{...r},"heatcell-"+t)}case"candlestick":{const n=e;if(n.isRange){const e=n.dotRadius??Math.max(2,n.bodyWidth/2);return wa("g",{children:[ka("line",{x1:n.x,y1:n.highY,x2:n.x,y2:n.lowY,stroke:n.wickColor,strokeWidth:n.wickWidth}),ka("circle",{cx:n.x,cy:n.highY,r:e,fill:n.wickColor}),ka("circle",{cx:n.x,cy:n.lowY,r:e,fill:n.wickColor})]},"candle-"+t)}const r=Math.min(n.openY,n.closeY),i=Math.max(Math.abs(n.openY-n.closeY),1),o=n.isUp?n.upColor:n.downColor;return wa("g",{children:[ka("line",{x1:n.x,y1:n.highY,x2:n.x,y2:n.lowY,stroke:n.wickColor,strokeWidth:n.wickWidth}),ka("rect",{x:n.x-n.bodyWidth/2,y:r,width:n.bodyWidth,height:i,fill:o,stroke:o,strokeWidth:1})]},"candle-"+t)}default:return null}}(e,t,n,r);return"area"===e.type?i:Mo(i,e,"xy-cursor-"+t)}var Aa="undefined"==typeof window||"undefined"==typeof document;import{useEffect as Sa,useLayoutEffect as Wa,useRef as Ca,useState as La,useSyncExternalStore as ja}from"react";var Na="undefined"!=typeof window?Wa:Sa;function Oa(){const[e,t]=La(!1);return Na(()=>{t(!0)},[]),e}var Ia=()=>()=>{},Ra=()=>!1,za=()=>!0;function Pa(){const e=ja(Ia,Ra,za);return Ca(e).current}import*as Fa from"react";import{jsx as Ta}from"react/jsx-runtime";var Da=Fa.createContext(null);function Ea({children:e}){const[t,n]=Fa.useState(!1),r=Fa.useCallback(()=>n(e=>!e),[]),i=Fa.useMemo(()=>({visible:t,setVisible:n,toggle:r}),[t,r]);return Ta(Da.Provider,{value:i,children:e})}function Ba(){return Fa.useContext(Da)}function Ha(){const e=Fa.useContext(Da);return e?e.toggle:null}import{jsx as Ga}from"react/jsx-runtime";var _a={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function Va({hoverPoint:e}){let t="";if(e){const n=e.data||e;t="object"==typeof n?"Data point: "+Object.entries(n).filter(([,e])=>"object"!=typeof e&&"function"!=typeof e).map(([e,t])=>`${e}: ${t}`).join(", "):"Data point: "+n}return Ga("div",{"aria-live":"polite","aria-atomic":"true",style:_a,children:t})}function qa(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[n,r]of Object.entries(e))n.startsWith("_")||null!=r&&""!==r&&("number"==typeof r?Number.isFinite(r)&&(t[n]=r):"string"==typeof r?t[n]=r:"boolean"==typeof r?t[n]=r+"":r instanceof Date&&(t[n]=r.toISOString().slice(0,10)));return t}function Ya(e){return e&&"object"==typeof e?e:{}}function Ua(e){return Ya(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Xa(e,t){const n=Ya(e.accessibility);return{label:"string"==typeof n.label&&n.label.length>0?n.label:"string"==typeof e.label&&e.label.length>0?e.label:t,values:qa(Ua(e))}}function Za(e){const t=[];if(!Array.isArray(e))return t;const n=e.some(e=>e&&("line"===e.type||"area"===e.type));for(const r of e)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":if(n)break;t.push({label:"Point",values:qa(Ua(r))});break;case"line":case"area":{const e=Ua(r),n=Array.isArray(e)?e:[],i="line"===r.type?"Line point":"Area point";for(const e of n)t.push({label:i,values:qa(e)});break}case"rect":{const e=Ua(r),n=null!=e&&"object"==typeof e?e:{},i=n.category??r.group??"",o=n.value??n.__aggregateValue??n.total,a=qa(n);null==a.category&&""!==i&&(a.category=i+""),null==a.value&&null!=o&&(a.value="number"==typeof o||"string"==typeof o?o:o+""),t.push({label:"Bar",values:a});break}case"heatcell":{const e=qa(Ua(r));null==e.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(e.value=r.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=Ua(r),n=qa(e);if(null==n.category){const t=Ya(e),r=t.category??t.label;null!=r&&(n.category=r+"")}t.push({label:"Wedge",values:n});break}case"circle":t.push({label:"Node",values:qa(Ua(r))});break;case"arc":t.push({label:"Arc",values:qa(Ua(r))});break;case"candlestick":t.push({label:"Candlestick",values:qa(Ua(r))});break;case"geoarea":{const e=Ya(Ua(r)),n=qa(e);if(null==n.name){const t=Ya(e.properties).name??e.name;null!=t&&(n.name=t+"")}t.push({label:"Region",values:n});break}}}catch{}return t}import*as Ka from"react";var Ja=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":t+""};function Qa(e){return null==e||""===e?"—":"number"==typeof e?Number.isNaN(e)?"—":Ja(e):"boolean"==typeof e?e?"true":"false":"object"==typeof e?"—":e+""}function es(e){return null==e||"object"!=typeof e||Array.isArray(e)?{}:e}function ts(e){return null!=e&&"object"==typeof e?es(e).id:e}function ns(e){const t=es(e.datum);return{source:ts(t.source??e.source),target:ts(t.target??e.target)}}import{jsx as rs,jsxs as is}from"react/jsx-runtime";var os=Ka.lazy(()=>import("./c-PPWDL5ZI.min.js"));function as({accessibleTable:e,children:t}){return"object"!=typeof e?t:"undefined"==typeof document?null:rs(Ka.Suspense,{fallback:null,children:rs(os,{target:e.portalTarget,children:t})})}function ss(e,t){if(!e||0===e.length)return t+", empty";const n={};for(const t of e){if(null===t?.datum)continue;const e=t.type+"";n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return t+", empty";const r=[],i={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},o=["point","line","area","rect","heatcell","circle","candlestick","wedge","arc","geoarea"],a=Object.keys(n).sort((e,t)=>{const n=o.indexOf(e),r=o.indexOf(t);return(-1===n?999:n)-(-1===r?999:r)});for(const e of a)r.push(`${n[e]} ${i[e]||e}`);return`${t}, ${r.join(", ")}`}function ls(e,t,n){const r=[];return e>0&&r.push(e+" nodes"),t>0&&r.push(t+" edges"),0===r.length?n+", empty":`${n}, ${r.join(", ")}`}var cs=25,us="semiotic-accessible-data-table",ds=us+" semiotic-accessible-data-table-hidden",hs=us+" semiotic-accessible-data-table-visible",fs=hs+" semiotic-accessible-data-table-network",ms={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},ys={position:"absolute",top:0,left:0,right:0,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",padding:"14px 16px 12px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontFamily:"var(--semiotic-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)",fontSize:13,lineHeight:1.5,color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",borderRadius:"var(--semiotic-border-radius, 0px) var(--semiotic-border-radius, 0px) 0 0"},ps={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},gs={position:"absolute",top:10,right:10,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",cursor:"pointer",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:13,lineHeight:1,padding:0,borderRadius:"var(--semiotic-border-radius, 4px)"},bs={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},xs={textAlign:"left",padding:"5px 10px",borderBottom:"2px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))"},vs={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},ks={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},ws={marginTop:8,padding:"4px 10px",fontSize:12,cursor:"pointer",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",borderRadius:"var(--semiotic-border-radius, 4px)",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",fontFamily:"inherit"};function $s({scene:e,chartType:t,tableId:n,chartTitle:r}){const[i,o]=Ka.useState(!1),[a,s]=Ka.useState(5),l=Ba(),c=l?.visible??!1,u=i||c,d=Ka.useRef(null),h=r?"Data summary for "+r:n?`Data summary for ${t} ${n}`:"Data summary for "+t;Ka.useEffect(()=>{u||s(5)},[u]);const f=Ka.useCallback(e=>{e.target===e.currentTarget&&(i||c||o(!0))},[i,c]),m=Ka.useCallback(e=>{c||d.current?.contains(e.relatedTarget)||o(!1)},[c]);if(!e||0===e.length)return n?rs("span",{id:n,tabIndex:-1,style:_a}):null;if(!u)return rs("div",{id:n,className:ds,tabIndex:-1,onFocus:f,style:_a,role:"region","aria-label":h,children:is("button",{type:"button",onClick:()=>o(!0),style:ms,children:["View data summary (",e.length," elements)"]})});const y=Za(e),p=function(e){const t=new Map;for(const n of e??[])for(const[e,r]of Object.entries(n?.values??{})){if(null==r||""===r)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:new Set},t.set(e,n)),"number"==typeof r){if(!Number.isFinite(r))continue;n.count++,n.sum+=r,n.min>r&&(n.min=r),r>n.max&&(n.max=r)}else"object"!=typeof r&&"function"!=typeof r&&n.strings.add(r+"")}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};const n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}(y),g=function(e,t){const n=[e+" data points."];for(const e of t)if(e.numeric)n.push(`${e.name}: ${Ja(e.min)} to ${Ja(e.max)}, mean ${Ja(e.mean)}.`);else{const t=e.uniqueValues,r=t.length>3?`${t.slice(0,3).join(", ")}… (${e.count} unique)`:t.join(", ");n.push(`${e.name}: ${r}.`)}return n.join(" ")}(y.length,p),b=Math.min(a,y.length),x=y.slice(0,b),v=y.length-b,k=new Set;for(const e of x)for(const t of Object.keys(e.values))k.add(t);const w=Array.from(k);return is("div",{ref:d,id:n,className:hs,tabIndex:-1,onBlur:m,style:ys,role:"region","aria-label":h,children:[rs("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{c&&l&&l.setVisible(!1),o(!1)},"aria-label":"Close data summary",style:gs,children:"×"}),rs("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:ps,children:g}),is("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Sample data for "+t,style:bs,children:[rs("caption",{className:"semiotic-accessible-data-table-caption",style:ks,children:v>0?`First ${b} of ${y.length} data points`:`All ${y.length} data points`}),rs("thead",{children:is("tr",{children:[rs("th",{style:xs,children:"type"}),w.map(e=>rs("th",{style:xs,children:e},e))]})}),rs("tbody",{children:x.map((e,t)=>is("tr",{children:[rs("td",{style:vs,children:e.label}),w.map(t=>rs("td",{style:vs,children:Qa(e.values[t])},t))]},t))})]}),v>0&&is("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>s(e=>e+cs),style:ws,children:["Show ",Math.min(cs,v)," more"," ",1===v?"row":"rows"," (",v," remaining)"]})]})}function Ms({nodes:e,edges:t,chartType:n,tableId:r,chartTitle:i}){const[o,a]=Ka.useState(!1),[s,l]=Ka.useState(5),[c,u]=Ka.useState(5),d=Ba(),h=d?.visible??!1,f=o||h,m=i?"Data summary for "+i:r?`Data summary for ${n} ${r}`:"Data summary for "+n,y=Ka.useRef(null);Ka.useEffect(()=>{f||(l(5),u(5))},[f]);const p=Ka.useCallback(e=>{e.target===e.currentTarget&&(o||h||a(!0))},[o,h]),g=Ka.useCallback(e=>{h||y.current?.contains(e.relatedTarget)||a(!1)},[h]),b=Array.isArray(e)?e:[],x=Array.isArray(t)?t:[];if(0===b.length&&0===x.length)return r?rs("span",{id:r,tabIndex:-1,style:_a}):null;if(!f)return rs("div",{id:r,className:ds,tabIndex:-1,onFocus:p,style:_a,role:"region","aria-label":m,children:is("button",{type:"button",onClick:()=>a(!0),style:ms,children:["View data summary (",b.length," nodes, ",x.length," edges)"]})});const{nodeRows:v,edgeRows:k,hasWeights:w,summary:$}=function(e,t){const n=new Map,r=[];let i=!1;for(let e=0;t.length>e;e++){const o=t[e];if(!o||"object"!=typeof o)continue;const a=es(o.datum),{source:s,target:l}=ns(o),c="number"==typeof a.value&&Number.isFinite(a.value),u=c?a.value:0;i||(i=c);for(const[e,t,r]of[[s,1,3],[l,0,2]]){if(null==e||""===e)continue;const i=e+"",o=n.get(i)??[0,0,0,0];o[t]++,o[r]+=u,n.set(i,o)}r.push(Xa(o,null!=s||null!=l?`${null==s?"?":s+""} → ${null==l?"?":l+""}`:"Edge "+(e+1)))}const o=[];let a=0,s=0;for(let t=0;e.length>t;t++){const r=e[t];if(!r||"object"!=typeof r)continue;const i=es(r.datum).id??r.id,l=null!=i?i+"":"node-"+t,[c,u,d,h]=n.get(l)??[0,0,0,0],f=c+u;a+=f,f>s&&(s=f),o.push({id:l,degree:f,inDeg:c,outDeg:u,wDegree:d+h,wInDeg:d,wOutDeg:h,semantic:Xa(r,l)})}o.sort((e,t)=>t.degree-e.degree);const l=[`${o.length} nodes, ${t.length} edges.`];return o.length>0&&l.push(`Mean degree: ${Ja(a/o.length)}, max degree: ${s}.`),{nodeRows:o,edgeRows:r,hasWeights:i,summary:l.join(" ")}}(b,x),M=Math.min(s,v.length),A=v.slice(0,M),S=v.length-M,W=Math.min(c,k.length),C=k.slice(0,W),L=k.length-W,j=new Set;for(const e of A)for(const t of Object.keys(e.semantic.values))j.add(t);const N=Array.from(j),O=new Set;for(const e of C)for(const t of Object.keys(e.values))O.add(t);const I=Array.from(O);return is("div",{ref:y,id:r,className:fs,tabIndex:-1,onBlur:g,style:ys,role:"region","aria-label":m,children:[rs("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{h&&d&&d.setVisible(!1),a(!1)},"aria-label":"Close data summary",style:gs,children:"×"}),rs("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:ps,children:$}),v.length>0&&is("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Node data and degree summary for "+n,style:bs,children:[rs("caption",{className:"semiotic-accessible-data-table-caption",style:ks,children:S>0?`Top ${M} of ${v.length} nodes by degree`:`All ${v.length} nodes by degree`}),rs("thead",{children:is("tr",{children:[rs("th",{style:xs,children:"node"}),N.map(e=>rs("th",{style:xs,children:e},e)),rs("th",{style:xs,children:"degree"}),rs("th",{style:xs,children:"in"}),rs("th",{style:xs,children:"out"}),w&&rs("th",{style:xs,children:"w. degree"}),w&&rs("th",{style:xs,children:"w. in"}),w&&rs("th",{style:xs,children:"w. out"})]})}),rs("tbody",{children:A.map((e,t)=>is("tr",{"aria-label":e.semantic.label,children:[rs("td",{style:vs,children:e.semantic.label}),N.map(t=>rs("td",{style:vs,children:Qa(e.semantic.values[t])},t)),rs("td",{style:vs,children:e.degree}),rs("td",{style:vs,children:e.inDeg}),rs("td",{style:vs,children:e.outDeg}),w&&rs("td",{style:vs,children:Ja(e.wDegree)}),w&&rs("td",{style:vs,children:Ja(e.wInDeg)}),w&&rs("td",{style:vs,children:Ja(e.wOutDeg)})]},t))})]}),S>0&&is("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>l(e=>e+cs),style:ws,children:["Show ",Math.min(cs,S)," more"," ",1===S?"node":"nodes"," (",S," remaining)"]}),k.length>0&&is("table",{className:"semiotic-accessible-data-table-table semiotic-accessible-data-table-edges",role:"table","aria-label":"Edge data for "+n,style:{...bs,marginTop:12},children:[rs("caption",{className:"semiotic-accessible-data-table-caption",style:ks,children:L>0?`First ${W} of ${k.length} edges`:`All ${k.length} edges`}),rs("thead",{children:is("tr",{children:[rs("th",{style:xs,children:"edge"}),I.map(e=>rs("th",{style:xs,children:e},e))]})}),rs("tbody",{children:C.map((e,t)=>is("tr",{"aria-label":e.label,children:[rs("td",{style:vs,children:e.label}),I.map(t=>rs("td",{style:vs,children:Qa(e.values[t])},t))]},t))})]}),L>0&&is("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>u(e=>e+cs),style:ws,children:["Show ",Math.min(cs,L)," more"," ",1===L?"edge":"edges"," (",L," remaining)"]})]})}function As({summary:e}){return e?rs("div",{role:"note",style:_a,children:e}):null}function Ss({tableId:e}){return rs("a",{href:"#"+e,style:_a,onClick:t=>{t.preventDefault();const n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:e=>{Object.assign(e.currentTarget.style,{position:"absolute",width:"auto",height:"auto",overflow:"visible",clip:"auto",whiteSpace:"normal",padding:"4px 8px",background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:"4px",zIndex:"10",fontSize:"12px",top:"4px",left:"4px"})},onBlur:e=>{const t=e.currentTarget;t.removeAttribute("style"),Object.assign(t.style,_a)},children:"Skip to data table"})}import{jsx as Ws}from"react/jsx-runtime";var Cs="var(--semiotic-focus, #005fcc)";function Ls({active:e,hoverPoint:t,margin:n,size:r,shape:i="circle",width:o,height:a,pathData:s}){if(!e||!t)return null;const l=t.x+n.left,c=t.y+n.top;let u;if("geoarea"!==i&&"path"!==i||!s)if("rect"===i&&null!=o&&null!=a){const e=Math.max(o,4),t=Math.max(a,4);u=Ws("rect",{x:l-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:Cs,strokeWidth:2,strokeDasharray:"4,2"})}else u=Ws("circle","wedge"===i?{cx:l,cy:c,r:12,fill:"none",stroke:Cs,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:l,cy:c,r:8,fill:"none",stroke:Cs,strokeWidth:2,strokeDasharray:"4,2"});else u=Ws("g",{transform:`translate(${n.left},${n.top})`,children:Ws("path",{d:s,fill:"none",stroke:Cs,strokeWidth:2.5,strokeDasharray:"6,3"})});return Ws("svg",{style:{position:"absolute",left:0,top:0,width:r[0],height:r[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:u})}import*as js from"react";import{jsx as Ns}from"react/jsx-runtime";function Os({x:e,y:t,containerWidth:n,containerHeight:r,margin:i,children:o,className:a="stream-frame-tooltip",zIndex:s=1}){const l=Number.isFinite(e)&&Number.isFinite(t),c=js.useRef(null),[u,d]=js.useState(null);js.useLayoutEffect(()=>{const e=c.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();Number.isFinite(t.width)&&Number.isFinite(t.height)&&d(e=>e&&.5>Math.abs(e.width-t.width)&&.5>Math.abs(e.height-t.height)?e:{width:t.width,height:t.height})};if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[a,n,r,l]);let h;h=u?`translate(${u.width+12>n-e?"calc(-100% - 12px)":"12px"}, ${u.height+12>r-t?"calc(-100% - 4px)":"4px"})`:`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${.3*r>t?"4px":"calc(-100% - 4px)"})`;const f=ye(o),m=f?null:de;return l?Ns("div",{ref:c,className:f?a:(a+" semiotic-tooltip").trim(),style:{...m||{},position:"absolute",left:i.left+e,top:i.top+t,transform:h,pointerEvents:"none",zIndex:s,width:"max-content"},children:o}):null}import*as Is from"react";import{useCallback as Rs,useEffect as zs,useLayoutEffect as Ps,useMemo as Fs,useRef as Ts}from"react";function Ds(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}function Es(e,t){return Math.min((e-t.startTime)/t.duration,1)}function Bs(e,t,n){return e+(t-e)*n}function Hs(){return"undefined"!=typeof performance?performance.now():Date.now()}var Gs=()=>"undefined"!=typeof performance?performance.now():Date.now();function _s(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 Vs(e,t){const n=e();return Number.isFinite(n)?n:t}var qs=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??Gs,this.lastWallTime=Vs(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=Vs(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??Gs;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=Vs(t,this.lastWallTime))}setRandomSource(e,t){const n=function(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:_s(n)))}},Ys="undefined"==typeof window?zs:Ps,Us={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)};function Xs(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function Zs(e){const t=o(),n=Ts(t);n.current=t;const[r,i]=Qn(e.sizeProp,e.responsiveWidth,e.responsiveHeight),a=i[0],s=i[1],c=Fs(()=>[a,s],[a,s]),u=!!e.title,d=!!e.legend&&"top"===e.legendPosition,h=Fs(()=>{const t=function(e,t,n=!1){const r=n?t?58:34:t?36:0;return r>e.top?{...e,top:r}:e}({...e.marginDefault,...e.userMargin},u,d);if(e.legend&&!e.legendMarginReserved){const n={...t},r=e.legendPosition??"right";Rn(t,{legend:e.legend,position:r,size:c,hasTitle:u,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),vn(t,n,c,r)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,u,d,c]),f=i[0]-h.left-h.right,m=i[1]-h.top-h.bottom,y=Xs(e.foregroundGraphics,i,h),p=Xs(e.backgroundGraphics,i,h),g=l(e=>e.theme),{transition:b,introEnabled:x}=function(e,t){if(!1===e)return{transition:void 0,introEnabled:!1};const n="undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;return{transition:e?!0===e?{duration:300}:{duration:e.duration??300,easing:"linear"===e.easing?"linear":"ease-out"}:t,introEnabled:!(n||!e||!0!==e&&!1===e.intro)}}(e.animate,e.transitionProp),v="semiotic-table-"+Is.useId(),k=Ts(null);if(!k.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;k.current=new qs({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const w=k.current;w.configure({clock:e.clock,random:e.random,seed:e.seed});const $=Ts(null),M=Ts(e.frameScheduler??Us);M.current=e.frameScheduler??Us;const A=Ts(null),S=Ts(!1),W=Ts(()=>{}),C=Rs(()=>{if(null!==$.current||S.current)return;const e=M.current;let t=!1,n=!1;const r=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(S.current=!0),$.current=null,A.current=null;try{W.current()}finally{e&&(S.current=!1)}});n=!0,t||($.current=r,A.current=e)},[]),L=Rs(()=>{null!==$.current&&((A.current??M.current).cancelAnimationFrame($.current),$.current=null,A.current=null)},[]);Ys(()=>{w.setPaused(!0===e.paused)},[w,e.paused]),zs(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void w.setVisible(!0);const t=()=>w.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[w,e.suspendWhenHidden]),zs(()=>()=>{L()},[L]);const j=Ts(()=>{}),N=Ts(()=>{}),O=Ts({inside:!1,clientX:0,clientY:0,pointerType:void 0}),I=Ts(null),R=Ts(null),z=Ts(null),P=Rs(()=>{const e=I.current;I.current=null,e&&j.current(e)},[]),G=Rs(e=>{const t=O.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,I.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===R.current){const e=M.current;let t=!1;const n=e.requestAnimationFrame(()=>{t=!0,R.current=null,z.current=null,P()});t||(R.current=n,z.current=e)}},[P]),_=Rs(()=>{O.current.inside=!1,I.current=null,null!==R.current&&((z.current??M.current).cancelAnimationFrame(R.current),R.current=null,z.current=null),N.current()},[]);zs(()=>()=>{I.current=null,null!==R.current&&((z.current??M.current).cancelAnimationFrame(R.current),R.current=null,z.current=null)},[]);const V=e.themeDirtyRef,q=Ts(!1);return Ys(()=>{if(!V)return;const t=!q.current;q.current=!0,t&&e.skipInitialThemeInvalidation||(F++,V.current=!0,C())},[g,e.skipInitialThemeInvalidation,C,V]),zs(()=>{if(V)return function(e,t){!function(){if(T)return;if("undefined"==typeof window||"undefined"==typeof document)return;T=!0;const e=e=>{if(!e?.includes("--"))return"";const t=document.createElement("span").style;return t.cssText=e,Array.from(t).filter(e=>e.startsWith("--")).sort().map(e=>`${e}:${t.getPropertyValue(e)}!${t.getPropertyPriority(e)}`).join(";")},t=(t,n)=>{const r=t.target;if(!(r instanceof Element))return!1;if(r===n||r.contains(n))return!0;if(!n.contains(r))return!1;const i="CANVAS"===r.tagName;return!(!i&&!r.querySelector("canvas")||i&&"style"===t.attributeName&&e(t.oldValue)===e(r.getAttribute("style")))},n=e=>{const n=[];for(const r of H){const i=r.getElement();i&&(!e||e.some(e=>t(e,i)))&&n.push(r)}if(!e||0!==n.length){F++;for(const e of n)e.listener()}};if("undefined"!=typeof MutationObserver&&document.documentElement&&(D=new MutationObserver(e=>{n(e)})).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme","data-semiotic-theme-mode"],attributeOldValue:!0,subtree:!0}),"function"==typeof window.matchMedia)try{E=window.matchMedia("(prefers-color-scheme: dark)"),B=()=>n(),"function"==typeof E.addEventListener?E.addEventListener("change",B):"function"==typeof E.addListener&&E.addListener(B)}catch{}}();const n={getElement:e,listener:t};return H.add(n),()=>{H.delete(n)&&0===H.size&&(D?.disconnect(),D=null,E&&B&&("function"==typeof E.removeEventListener?E.removeEventListener("change",B):"function"==typeof E.removeListener&&E.removeListener(B)),E=null,B=null,T=!1)}}(()=>r.current,()=>{V.current=!0,C()})},[r,C,V]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:r,size:i,margin:h,adjustedWidth:f,adjustedHeight:m,resolvedForeground:y,resolvedBackground:p,currentTheme:g,transition:b,introEnabled:x,tableId:v,frameRuntime:w,rafRef:$,renderFnRef:W,scheduleRender:C,cancelRender:L,hoverHandlerRef:j,hoverLeaveRef:N,onPointerMove:G,onPointerLeave:_,pointerStateRef:O}}function Ks(e,t,n){const r=Math.round(t[0]*n),i=Math.round(t[1]*n),o=0===t[0]?n:r/t[0],a=0===t[1]?n:i/t[1],s=t[0]+"px",l=t[1]+"px";return e.style.width!==s&&(e.style.width=s),e.style.height!==l&&(e.style.height=l),e.width!==r&&(e.width=r),e.height!==i&&(e.height=i),{effectiveDprX:o,effectiveDprY:a}}function Js(e,t,n,r){const i=e.getContext("2d");if(!i)return null;const{effectiveDprX:o,effectiveDprY:a}=Ks(e,t,r);return i.setTransform(o,0,0,a,0,0),i.translate(n.left,n.top),i}function Qs(e){if("undefined"==typeof window)return 1;const t=window.devicePixelRatio||1,n=function(){if("undefined"==typeof window)return!1;const e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t=768>Math.min(window.innerWidth||1/0,window.innerHeight||1/0);return e||t}()?2:3;return Math.max(1,Math.min(t,"number"==typeof e&&e>0?e:n))}import{useEffect as el,useRef as tl}from"react";import{jsx as nl,jsxs as rl}from"react/jsx-runtime";function il(e){const{cancelRender:t,dirtyRef:n,frameRuntime:r,manageFrameRuntime:i,maxDevicePixelRatio:o,scheduleRender:a}=e,s=tl(null),l=tl(null),c=tl(!1),u=tl(!1),d=tl(!1);return function(e){const{hydrated:t,wasHydratingFromSSR:n,storeRef:r,dirtyRef:i,renderFnRef:o,cancelRender:a,cleanup:s}=e;Na(()=>{const e=r.current;t&&n&&e?.cancelIntroAnimation?.(),!n&&e?.sceneNodes&&e.sceneNodes.length>0&&e?.markStylePaintPending?e.markStylePaintPending():i.current=!0,a?.(),o.current()},[t,n]);const l=Ca(s);l.current=s,Sa(()=>()=>l.current?.(),[])}({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),el(()=>{if(!1!==i)return r.subscribe(()=>{r.isActive?(n.current=!0,a()):t()})},[t,n,r,i,a]),el(()=>function(){if("undefined"==typeof window||"function"!=typeof window.matchMedia)return()=>{};let e=null,t=!1;const n=()=>{e&&("function"==typeof e.removeEventListener?e.removeEventListener("change",i):"function"==typeof e.removeListener&&e.removeListener(i))},r=()=>{const t=`(resolution: ${window.devicePixelRatio||1}dppx)`;e=window.matchMedia(t),e.media.includes("resolution")?"function"==typeof e.addEventListener?e.addEventListener("change",i):"function"==typeof e.addListener&&e.addListener(i):e=null};function i(){t||(n(),e=null,c.current=!0,a(),queueMicrotask(()=>{t||r()}))}return r(),()=>{t=!0,n(),e=null}}(),[a]),el(()=>{d.current?(c.current=!0,a()):d.current=!0},[o,a]),el(()=>{!u.current&&(u.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),{canvasRef:s,interactionCanvasRef:l,resolutionDirtyRef:c}}function ol(e,t){return il({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}function al({children:e,size:t,margin:n,backdropFill:r,overflowVisible:i=!1}){return e||r?rl("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:i?"visible":void 0},children:[r&&"transparent"!==r?nl("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:r}):null,nl("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function sl(e){return"touch"===e?"touch":"pointer"}function ll(e){const t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function cl(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"focus"===s?.type&&t({type:"focus",datum:n,inputType:"touch"===s.inputType?"pointer":s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"hover-end",timestamp:l,chartType:o,chartId:a}))}function ul(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"activate"===s?.type&&t({type:"activate",datum:n,inputType:s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"click-end",timestamp:l,chartType:o,chartId:a}))}import{jsx as dl}from"react/jsx-runtime";var hl="undefined"!=typeof process&&"production"!==process.env?.NODE_ENV;function fl({componentName:e,width:t,height:n,children:r}){return dl(He,{fallback:r=>dl(Ee,{componentName:e,message:r.message,width:t,height:n}),children:r})}var ml={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--semiotic-text-secondary, #666)",fontSize:13,fontFamily:"inherit",border:"1px dashed var(--semiotic-border, #ddd)",borderRadius:4,boxSizing:"border-box"},yl={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2};function pl(e,t,n,r){return!1===r||null==e||Array.isArray(e)&&e.length>0?null:Array.isArray(e)?dl("div",{style:{...ml,width:t,height:n},children:r||"No data available"}):null}function gl(e,t,n,r){if(!e)return null;if(!1===r)return null;if(null!=r)return dl("div",{style:{width:t,height:n,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:r});const i=Math.min(5,Math.floor(n/40)),o=Math.max(8,Math.floor(n/(3*i))),a=Math.max(6,Math.floor(n/(2.5*i))),s=Math.floor((n-(i*(o+a)-a))/2);return dl("div",{style:{width:t,height:n,position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:Array.from({length:i},(e,n)=>dl("div",{className:"semiotic-loading-bar",style:{...yl,position:"absolute",top:s+n*(o+a),left:Math.floor(.1*t),width:30+(37*n+13)%50+"%",height:o,opacity:.5+n%2*.2}},n))})}function bl(e,t,n,r){if(!hl)return;if(!t||0===t.length)return;if("string"!=typeof r)return;const i=t[0];if(!i||"object"!=typeof i)return;if(r in i)return;const o=Object.keys(i).join(", ");console.warn(`[semiotic] ${e}: ${n} "${r}" not found in data. Available keys: ${o}`)}function xl(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}function vl(e){return e?"string"==typeof e?{name:e}:e:null}var kl=.5;function wl(e,t,n){return t?(r,...i)=>{const o={...e(r,...i)};if(t.isActive)if(t.predicate(r))n?.selectedStyle&&Object.assign(o,n.selectedStyle);else{const e=n?.unselectedOpacity??.5;o.opacity=e,o.fillOpacity=e,o.strokeOpacity=e,n?.unselectedStyle&&Object.assign(o,n.unselectedStyle)}return o}:e}var $l={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1};function Ml(e,t={}){const n=t.mobileSemantics?.interaction,r="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,i="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,o=!!n||void 0!==r,a=e&&"object"==typeof e?e:void 0;if(!1===e||!1===a?.enabled||void 0===e&&!i&&!o)return $l;const s=a??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??r??44,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??44,standardControls:s.standardControls??!1}}var Al={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}},Sl={top:10,bottom:10,left:10,right:10};function Wl(e){return e.compactMode?e.marginDefaults:Sl}function Cl(e,t,n){if(!1!==t)return e;const r={...e};return"horizontal"===n?r.left=Math.min(r.left,15):r.bottom=Math.min(r.bottom,15),r}import{useMemo as Ll,useCallback as jl,useEffect as Nl,useState as Ol}from"react";function Il({data:e,colorBy:t,colorScale:n,getColor:r,strokeColor:i,strokeWidth:o,categories:a}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==i&&(n.stroke=i),void 0!==o&&(n.strokeWidth=o),n},type:"fill",items:(a&&a.length>0?a:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((i,o)=>{const a=e.find("function"==typeof t?e=>t(e)===i:e=>e[t]===i),s=a?r(a,t,n):n?n(i):wt[o%wt.length];return{label:i+"",color:s,__semioticCategory:!0}}),label:""}]}}function Rl(e,t){if(!t)return[];const n=new Set;for(const r of e){const e="function"==typeof t?t(r):r[t];n.add(e+"")}return Array.from(n)}function zl(e,t){return null!=e&&Object.hasOwn(e,t)}function Pl({data:e,colorBy:t,colorScale:n,showLegend:r,legendPosition:i,userMargin:o,defaults:a={top:50,bottom:60,left:70,right:40},categories:s,additionalLegend:l,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:m}){const{legendPosition:y,legendLayout:p}=function(e,t,n){const r=zl(n,"legendPosition"),i=zl(n,"legendLayout");return{legendPosition:r?n?.legendPosition??"right":e??"right",legendLayout:i?n?.legendLayout:t}}(i,d,h),g=zl(h,"legend"),b=sn(nr),x=ur(),v=void 0!==r?r:!b&&!!t,k=!!t&&(v||x),w=Ll(()=>k?void 0!==s?s:Rl(e,t):[],[s,t,e,k]);cr(x&&t?w:[]);const $=Ll(()=>{if(!v||!t)return;const r=Il({data:e,colorBy:t,colorScale:n,getColor:At,categories:w});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[v,t,e,n,w]),M=Ll(()=>g?h?.legend:gn($,l),[$,l,h?.legend,g]),{hasAxis:A,hasAxisLabel:S,rotatedTicks:W,topAxis:C,leftAxis:L,rightAxis:j}=m??{},N=void 0!==C,O=void 0!==L,I=void 0!==j,{hasAxis:R,hasAxisLabel:z,rotatedTicks:P}=C??{},{hasAxis:F,hasAxisLabel:T}=L??{},{hasAxis:D,hasAxisLabel:E}=j??{},B=Ll(()=>{const e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=t=>{const n=e[t];return"number"==typeof n?n:a[t]},n={top:t("top"),right:t("right"),bottom:t("bottom"),left:t("left")},r={...n};return M&&(Rn(n,{legend:M,position:y,size:[c??600,u??400],hasTitle:f,legendLayout:p,minimumMargin:"bottom"===y?80:"top"===y?50:0,axisChrome:void 0===A?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:A,hasAxisLabel:S,rotatedTicks:W,topAxis:N?{hasAxis:R,hasAxisLabel:z,rotatedTicks:P}:void 0,leftAxis:O?{hasAxis:F,hasAxisLabel:T}:void 0,rightAxis:I?{hasAxis:D,hasAxisLabel:E}:void 0}}),null!=c&&null!=u&&vn(n,r,[c,u],y)),n},[a,o,M,y,c,u,p,f,A,S,W,N,R,z,P,O,F,T,I,D,E]);return{legend:M,margin:B,legendPosition:y,legendLayout:p,legendMarginReserved:void 0!==M&&!zl(h,"margin"),hasAutomaticLegend:void 0!==$}}function Fl(e){const t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function Tl(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function Dl(e,t,n,r=!0,i=!1){const[o,a]=Ol(null),[s,l]=Ol(new Set),c=Ll(()=>new Set,[]),u=Ll(()=>new Set(n),[n]),d=null!=o&&u.has(o)?o:null,h=Ll(()=>{if(0===s.size)return s;const e=new Set(Array.from(s).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===s.size?s:e},[u,c,s]);Nl(()=>{r&&t&&e&&"none"!==e||(a(null),l(e=>0===e.size?e:new Set))},[t,r,e]),Nl(()=>{a(e=>null==e||u.has(e)?e:null),l(e=>{if(0===e.size)return e;const t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?new Set:t.size===e.size?e:t})},[u]);const f=jl(t=>{r&&"highlight"===e&&a(!t||!u.has(t.label)||i&&!0!==t.__semioticCategory?null:t.label)},[u,r,e,i]),m=jl(t=>{!r||"isolate"!==e||!u.has(t.label)||i&&!0!==t.__semioticCategory||l(e=>{const n=new Set(Array.from(e).filter(e=>u.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===u.size?new Set:n})},[u,r,e,i]),y=Ll(()=>{if(!r||!e||"none"===e||!t)return null;const n=e=>{const n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:n+""};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,r,e,d,h]);return{highlightedCategory:r&&"highlight"===e?d:null,isolatedCategories:r&&"isolate"===e?h:c,onLegendHover:f,onLegendClick:m,legendSelectionHook:y}}function El(e,t,n,r=5){const[i,o]=n,[a,s]=Ol(null),[l,c]=Ol(new Map),u=Ll(()=>new Set,[]);Nl(()=>{s(null),c(new Map)},[i,o,r,e]);const d=jl(t=>{if("highlight"!==e||!t)return void("highlight"===e&&s(null));const n=Fl(t);n&&s({key:Tl(t,n),range:n})},[e]),h=jl(t=>{if("isolate"!==e)return;const n=Fl(t);n&&c(e=>{const i=new Map(e),o=Tl(t,n);return i.has(o)?i.delete(o):i.set(o,n),i.size===r?new Map:i})},[r,e]),f=Ll(()=>{const n="highlight"===e&&a?[a.range]:"isolate"===e?[...l.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{const r=t(e);return Number.isFinite(r)&&n.some(([e,t])=>r>=Math.min(e,t)&&Math.max(e,t)>=r)}}},[a,l,e,t]);return{highlightedCategory:"highlight"===e?a?.key??null:null,isolatedCategories:"isolate"===e?new Set(l.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}import{useMemo as Bl,useCallback as Hl,useState as Gl,useId as _l,useEffect as Vl,useRef as ql}from"react";function Yl(e,t,n){const r=e.xValue??t?.[n];if(null==r)return null;const i=Number(r);return Number.isFinite(i)?i:null}function Ul(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?{...t,xValue:e.xValue}:t||{}}function Xl(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}var Zl=[];function Kl(){const e=s(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function Jl(){const e=s();return e?.colors?.sequential||void 0}function Ql(){const e=s();return e?.colors?.diverging||void 0}function ec(e,t,n,r,i){if(e)return e;if(n&&"object"==typeof n&&!Array.isArray(n)){const e=St(n,r);if(e)return e}let o;if(Array.isArray(n))o=n;else if(t&&t.length>0)o=t;else if("string"==typeof n){const e=bt[n];Array.isArray(e)&&(o=e)}return o&&0!==o.length?null!=r?(i.has(r)||i.set(r,i.size),o[i.get(r)%o.length]):o[0]:vt}function tc(e,t,n){const r=Ot(),i=Kl();return Bl(()=>{if(!t)return;const o=r??void 0,a=n??(i&&i.length>0?i:void 0)??"category10";if(0!==e.length){if("function"==typeof t){const n=Array.from(new Set(e.map(e=>t(e)+"")));if(o&&Xl(o)){const e=Wt(n.map(e=>({_cat:e})),"_cat",a);return t=>St(o,t)??e(t)}return Wt(n.map(e=>({_cat:e})),"_cat",a)}if(o&&Xl(o)){const n=Wt(e,t,a);return e=>St(o,e)??n(e)}return Wt(e,t,a)}if(o&&Xl(o)){const e=Wt([{_:"a"}],"_",a);return t=>St(o,t)??e(t)}},[e,t,n,r,i])}function nc(e,t,n){return Bl(()=>{if(!t||"auto"===t||"function"==typeof t)return e;const r=[...e],i="function"==typeof(o=n)?o:e=>e[o];var o;return r.sort("asc"===t?(e,t)=>i(e)-i(t):(e,t)=>i(t)-i(e))},[e,t,n])}function rc({selection:e,linkedHover:t,fallbackFields:n=Zl,unwrapData:r=!1,onObservation:o,chartType:a,chartId:s,onClick:l,hoverHighlight:c,colorByField:u,mobileInteraction:d}){const h=_l(),f=Bl(()=>xl(t,n),[t,n]),m=Bl(()=>"series"===f?.mode?[f.seriesField||u||n[0]].filter(e=>!!e):f?.fields||n,[f,u,n]),y=Ut({name:e?.name||"__unused__",fields:m}),p=Zt({name:f?.name||"hover",fields:m}),g=i(e=>e.pushObservation),b=Hl(e=>{o?.(e),g?.(e)},[o,g]),x=e?{isActive:y.isActive,predicate:y.predicate}:null,[v,k]=Gl(null),w=ql(!1),$=u||n[0],M=Bl(()=>{if(!c||null==v||!$)return null;const e=v,t=$;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[c,v,$]),A=Hl((e,n)=>{const r=!e&&w.current&&!!d?.enabled&&d.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===f?.mode&&f.xField){const n=Yl(e,t,f.xField);null!=n&&function(e,t,n){const r=Ft.positions.get(e);r?.locked||r&&r.xValue===t&&r.sourceId===n||(Ft={positions:new Map(Ft.positions).set(e,{xValue:t,sourceId:n})},Dt())}(f.name||"hover",n,h)}"x-position"!==f?.mode&&p.onHover(t)}else"x-position"!==f?.mode||r||Et(f.name||"hover",h),"x-position"===f?.mode||r||p.onHover(null);if(c&&$)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[$];k(null!=n?n+"":null)}else r||k(null);(o||g)&&cl({onObservation:b,datum:e?Ul(e):null,x:e?.x,y:e?.y,chartType:a||"unknown",chartId:s,context:n})},[t,p,f,h,o,a,s,g,b,c,$,d]),S=Hl((n=!0)=>{w.current=!1,t&&"x-position"!==f?.mode&&p.onHover(null),e&&d?.tapToSelect&&y.clear(),n&&c&&k(null),"x-position"===f?.mode&&(Bt(f.name||"hover",h),Et(f.name||"hover",h))},[t,f,p,e,d,y,c,h]),W=Hl((n,r)=>{const i=!!d?.enabled&&(d.tapToLockTooltip||d.tapToSelect),u=!!d?.enabled&&"backgroundTap"===d.clearSelection;if("x-position"===f?.mode&&f.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=Yl(n,e,f.xField);null!=t&&function(e,t,n){const r=Ft.positions.get(e);if(r?.locked){const t=new Map(Ft.positions);return t.delete(e),Ft={positions:t},Dt(),!1}Ft={positions:new Map(Ft.positions).set(e,{xValue:t,sourceId:n,locked:!0})},Dt()}(f.name||"hover",t,h)}if(i)if(n){w.current=!0;const r=Ul(n);if(t&&"x-position"!==f?.mode&&p.onHover(r),e&&d?.tapToSelect&&m.length>0){const e={};for(const t of m){const n=r[t];void 0!==n&&(e[t]=[n])}Xl(e)&&y.selectPoints(e)}if(c&&$){const e=r?.[$];k(null!=e?e+"":null)}}else u&&S();if(n||u){if(n&&l){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),l(e,{x:n.x??0,y:n.y??0})}(o||g)&&ul({onObservation:b,datum:n?Ul(n):null,x:n?.x,y:n?.y,chartType:a||"unknown",chartId:s,context:r})}},[l,o,g,b,a,s,f,h,d,t,p,e,y,m,c,$,S]);return Vl(()=>{if(!d?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&w.current&&S()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.enabled,S]),Vl(()=>()=>{w.current&&S(!1)},[S]),Vl(()=>{if("x-position"!==f?.mode)return;const e=f.name||"hover";return()=>{Bt(e,h),Et(e,h)}},[f?.mode,f?.name,h]),{activeSelectionHook:x,hoverSelectionHook:M,customHoverBehavior:A,customClickBehavior:W,crosshairSourceId:h}}function ic(e,t){const n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function oc(e,t,n){return function(e,t,n){const r=Al[e||"primary"],i=e&&"primary"!==e||!n?.width?r.width:n.width,o=e&&"primary"!==e||!n?.height?r.height:n.height,a=nn({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=a.mode||e||"primary",l=Al[s],c="context"===s||"sparkline"===s,u="primary"===s&&n?.width?n.width:l.width;return{mode:s,width:a.width??u,height:a.height??("primary"===s&&n?.height?n.height:l.height),showAxes:a.showAxes??l.showAxes,showGrid:a.showGrid??l.showGrid,enableHover:a.enableHover??(!!a.linkedHover||l.enableHover),showLegend:a.showLegend??l.showLegend,showLabels:a.showLabels??l.showLabels,title:c?void 0:a.title,description:a.description,summary:a.summary,accessibleTable:a.accessibleTable,xLabel:c?void 0:a.xLabel,yLabel:c?void 0:a.yLabel,categoryLabel:c?void 0:a.categoryLabel,valueLabel:c?void 0:a.valueLabel,marginDefaults:Cl(l.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:Ml(a.mobileInteraction,{mode:s,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}(e,t,n)}export{yr as EMPTY_ARRAY,pr as filterSparseArray,Ze as schemeCategory10,rt as interpolateViridis,ct as SEQUENTIAL_INTERPOLATORS,ut as getSequentialInterpolator,dt as interpolateRdBu,ht as interpolatePiYG,ft as interpolatePRGn,mt as interpolateBrBG,yt as interpolateRdYlBu,pt as interpolateRdYlGn,gt as interpolateSpectral,bt as COLOR_SCHEMES,xt as DEFAULT_COLORS,vt as DEFAULT_COLOR,kt as resolveCategoricalPalette,wt as STREAMING_PALETTE,$t as DEPTH_PALETTE_COLORS,At as getColor,St as resolveExplicitColor,Wt as createColorScale,Ct as getSize,Ds as computeEasing,Es as computeRawProgress,Bs as lerp,Hs as now,y as DEFAULT_LIFECYCLE_THRESHOLDS,p as bandFromAge,g as resolveMotionAccessor,b as compileMotionEncoding,x as resolveMotionAge,v as opacityFromAge,k as resolveMotionVector,w as deriveMotionVector,Do as symbolPathString,Eo as symbolRadius,Bo as makeSymbolResolver,vr as UpdateResultTracker,jr as useSceneRevisionDiagnostics,Nr as runSceneBuild,Or as SceneRevisionDiagnosticsObserver,A as glyphPlacement,S as glyphExtent,j as glyphFractionClipRect,N as glyphHitGeometry,O as drawGlyphParts,G as resolveCSSColor,_ as getCSSColorCacheVersion,Ir as parseCanvasColor,z as createHatchPattern,Y as isHatchFill,X as hatchFillId,K as hatchPatternDef,J as resolveSvgFill,Gr as resolveCurveFactory,_r as resolveCanvasFill,Vr as resolveCanvasPaint,qr as coerceCanvasFill,Yr as buildLinearFillGradient,Xr as paintNetworkFill,Zr as paintNetworkStroke,gn as composeLegendConfigs,vn as clampLegendReservation,Mn as resolveLegendSideGutter,Ln as resolveXYAxisChrome,jn as resolveXYFramePropsAxisChrome,Nn as resolveOrdinalAxisChrome,Rn as reserveLegendMargin,Jr as renderLegendFromConfig,Q as annotationStableId,te as useAnnotationActivationOptions,ne as annotationActivationProps,re as isAnnotationActivationTarget,se as estimateLabelWidth,le as AnnotationLabel,ti as ANNOTATION_DISCLOSURE_REVEAL_CSS,si as renderAnnotationPass,_i as createDefaultAnnotationRules,Yi as annotationType,Ui as isNoteAnnotation,Xi as annotationDrawsConnector,Ki as annotationBudget,fo as annotationLayout,Bt as unlockCrosshair,Yt as useCrosshairPosition,yo as SVGChartTitle,ra as buildThresholdLineSegments,So as hasAnyCornerRadius,Wo as clampCornerRadii,Vo as svgFill,qo as safeSvgId,bo as sceneMarkCursor,xo as sceneHasAuthoredCursor,vo as setCanvasMarkCursor,ko as syncCanvasMarkCursor,wo as rehitCanvasMarkCursor,$o as useCanvasMarkCursorCleanup,Mo as withSceneMarkCursor,la as networkSceneNodeToSVG,ca as networkSceneEdgeToSVG,ua as networkLabelToSVG,Jo as geoSceneNodeToSVG,ma as annularSectorPath,ya as buildGaugeGradientGeometry,va as ordinalSceneNodeToSVG,Ma as xySceneNodeToSVG,Aa as isServerEnvironment,Oa as useHydration,Pa as useWasHydratingFromSSR,Ea as DataSummaryProvider,Ba as useDataSummary,Ha as useDataSummaryToggle,Va as AriaLiveTooltip,Za as extractAllRows,as as AccessibleTablePortal,ss as computeCanvasAriaLabel,ls as computeNetworkAriaLabel,$s as AccessibleDataTable,Ms as NetworkAccessibleDataTable,As as ScreenReaderSummary,Ss as SkipToTableLink,Ls as FocusRing,de as defaultTooltipStyle,he as TooltipRoot,fe as markTooltipChrome,ye as hasOwnTooltipChrome,Os as FlippingTooltip,Qn as useResponsiveSize,_s as createSeededFrameRandom,Zs as useFrame,Ks as syncCanvasSize,Js as prepareCanvas,Qs as getDevicePixelRatio,ol as useFrameCanvasHost,al as CanvasFrameBackground,we as getPointerHitRadius,Me as buildHoverData,ke as smartTooltipEntries,Le as Tooltip,je as MultiLineTooltip,Ne as isMultiTooltip,Oe as isMultiTooltipConfig,Ie as resolveMultiCapableTooltip,Re as resolveTooltipContent,ze as MultiPointTooltip,Pe as normalizeTooltip,sl as observationInputType,ll as isInteractiveKeyboardTarget,cl as emitHoverObservations,ul as emitClickObservations,Ee as ChartError,He as ChartErrorBoundary,fl as SafeRender,pl as renderEmptyState,gl as renderLoadingState,bl as warnMissingField,Nt as CategoryColorProvider,Ot as useCategoryColors,xl as normalizeLinkedHover,vl as normalizeLinkedBrush,kl as DEFAULT_SELECTION_OPACITY,wl as wrapStyleWithSelection,Ut as useSelection,Xt as useSelectionActions,Zt as useLinkedHover,Jt as useBrushSelection,Qt as useFilteredData,tn as responsiveRuleMatches,nn as resolveResponsiveRules,Ml as resolveMobileInteraction,Wl as resolveAxisFreeMarginDefaults,yn as resolveBoundedCategoryIndex,on as useChartObserver,ir as useLinkedChartsActive,cr as useLinkedChartCategories,ur as useLinkedChartCategoryRegistryActive,mr as LinkedCharts,Il as createLegend,Rl as distinctCategories,Pl as useChartLegendAndMargin,Dl as useLegendInteraction,El as useGradientLegendInteraction,Kl as useThemeCategorical,Jl as useThemeSequential,Ql as useThemeDiverging,ec as resolveDefaultFill,tc as useColorScale,nc as useSortedData,rc as useChartSelection,ic as getCrosshairProps,oc as useChartMode};
|
package/dist/c-GPYOFETM.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bandFromAge as t,defaultTooltipStyle as e,drawGlyphParts as n,glyphFractionClipRect as r,glyphHitGeometry as o,glyphPlacement as a,normalizeTooltip as c,opacityFromAge as s,resolveCSSColor as l,resolveCanvasFill as i,setCanvasMarkCursor as u,withSceneMarkCursor as f}from"./c-GIKRQI4X.min.js";function d(t,e){const n={...t};return e.provenance&&(n.provenance=e.provenance),e.lifecycle&&(n.lifecycle=e.lifecycle),n}function h(){return(new Date).toISOString()}function p(t,e={}){const n=t.provenance;return{...t,provenance:{...n,...e,createdAt:e.createdAt??n?.createdAt??h()}}}function y(t){if(null==t)return null;if("number"==typeof t)return t;if(t instanceof Date)return t.getTime();const e=Date.parse(t);return Number.isFinite(e)?e:null}function g(t){const e=y(t?.now);if(null!=e)return e;const n=t?.dataExtent;if(n)if(Array.isArray(n)){const t=y(n[n.length-1]);if(null!=t)return t}else if("max"in n){const t=y(n.max);if(null!=t)return t}return Date.now()}function m(e,n,r={}){const o=e?.lifecycle?.freshness,a=y(e?.provenance?.createdAt),c=function(t){if(null==t)return null;if("number"==typeof t)return t;const e=function(t){const e=/^P(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/.exec(t);return e?1e3*(3600*(24*parseInt(e[1]||"0",10)+parseInt(e[2]||"0",10))+60*parseInt(e[3]||"0",10)+parseInt(e[4]||"0",10)):0}(t);return e>0?e:null}(e?.lifecycle?.ttlHint);return null==a||null==c?o??"fresh":t(n-a,c,r)}function x(t,e={}){const n=g(e);return t.map(t=>{const r=m(t,n,e.thresholds);return{...t,lifecycle:{...t.lifecycle,freshness:r}}})}var b={fresh:null,aging:.55,stale:.35,expired:.2},v={fresh:null,aging:null,stale:"4 4",expired:"2 4"};function w(t,e,n){return t&&n in t?t[n]:e[n]}function k(t,e={}){const n=g(e),r=!0===e.showExpiredAnnotations,o=[];for(const a of t){const t=m(a,n,e.thresholds);if("expired"===t&&!r)continue;const c=w(e.opacity,b,t),s=w(e.strokeDasharray,v,t),l=e.labelSuffix?.[t],i={...a,lifecycle:{...a.lifecycle,freshness:t}};null!=c&&null==i.opacity&&(i.opacity=c),null!=s&&null==i.strokeDasharray&&(i.strokeDasharray=s),l&&"string"==typeof i.label&&(i.label=i.label+l);const u=a.lifecycle?.anchor;u&&null==i.anchor&&(i.anchor=u),o.push(i)}return o}var A={proposed:.7,accepted:null,disputed:.7,retracted:.25},I={proposed:"3 3",accepted:null,disputed:"2 3",retracted:"2 4"},M={proposed:" (proposed)",accepted:"",disputed:" (?)",retracted:""};function _(t,e,n){return t&&n in t?t[n]:e[n]}function S(t,e={}){const n=!0===e.showRetractedAnnotations,r=!0===e.showSupersededAnnotations,o=new Set;for(const e of t){const t=e?.lifecycle?.supersedes;t&&"retracted"!==e?.lifecycle?.status&&o.add(t)}return t.filter(t=>{if("retracted"===t?.lifecycle?.status&&!n)return!1;const e=t?.provenance?.stableId;return!(e&&o.has(e)&&!r)})}function D(t,e={}){const n=[];for(const r of S(t,e)){const t=r?.lifecycle?.status;if(!t){n.push(r);continue}const o=_(e.opacity,A,t),a=_(e.strokeDasharray,I,t),c=e.labelSuffix?.[t]??M[t],s={...r};null!=o&&(s.opacity=("number"==typeof s.opacity?s.opacity:1)*o),null!=a&&null==s.strokeDasharray&&(s.strokeDasharray=a),c&&"string"==typeof s.label&&(s.label=s.label+c),n.push(s)}return n}import{jsx as O,jsxs as R}from"react/jsx-runtime";function B(t){return"string"==typeof t?t:"value"}function E(t){return null==t?"–":"number"==typeof t?Math.abs(t)>9999?t.toLocaleString():t+"":t instanceof Date?t.toLocaleDateString():t+""}function P(t,e){if(!e)return E(t);try{const n=e(t);return null==n?E(t):n}catch{return E(t)}}function C(t,e){return"function"==typeof e?e(t):t[e]}function T(t,e){if(!t)return[];const n=[];return(Array.isArray(t)?t:[t]).forEach((t,r)=>{const o="string"==typeof t?.y0Accessor?t.y0Accessor:"low",a="string"==typeof t?.y1Accessor?t.y1Accessor:"high";n.push({label:o,accessor:t=>t.bands?.[r]?.y0??(0===r?t.band?.y0:void 0),format:e}),n.push({label:a,accessor:t=>t.bands?.[r]?.y1??(0===r?t.band?.y1:void 0),format:e})}),n}function j(t){const n=t.find(t=>"title"===t.role),r=t.filter(t=>"title"!==t.role);return t=>{const o=t.data;if(!o)return null;const a=n?P(C(o,n.accessor),n.format):null;return R("div",{className:"semiotic-tooltip",style:e,children:[null!=a&&O("div",{style:{fontWeight:"bold",marginBottom:r.length>0?4:0},children:a}),r.map((t,e)=>{const n=P(C(o,t.accessor),t.format);return R("div",{style:e>0?{marginTop:2}:void 0,children:[R("span",{style:{opacity:.7},children:[t.label,": "]}),O("span",{children:n})]},e)})]})}}function L({categoryAccessor:t,valueAccessor:n,groupAccessor:r,groupLabel:o,pieData:a=!1,valueFormat:c}){return s=>{const l=a?s.data?.[0]||s.data||s:s.data||s,i=C(l,t),u=C(l,n),f=r?C(l,r):void 0;return R("div",{className:"semiotic-tooltip",style:e,children:[O("div",{style:{fontWeight:"bold"},children:E(i)}),O("div",{style:{marginTop:4},children:P(u,c)}),null!=f&&R("div",{style:{marginTop:2,opacity:.8},children:[o||B(r),": ",E(f)]})]})}}import*as z from"react";function G(...t){const e=t.filter(t=>null!=t);return 0===e.length?null:1===e.length?e[0]:z.createElement(z.Fragment,null,...e)}import{useEffect as H,useRef as $}from"react";function N(t,e,n,r){H(()=>{t.current?.updateConfig(e),n.current=!0,r()},[e,r,t,n])}function U(t,e,n,r){const o=$(null);H(()=>{const a=t.current;if(!a)return;const c=e??null;o.current!==c&&(o.current=c,a.setLayoutSelection(c),a.hasCustomRestyle?a.restyleScene(c):n.current=!0,r())},[e,r,t,n])}var W={fresh:1,aging:.7,stale:.45,expired:.25},F={alpha:1,band:"fresh",isStale:!1};function Y(e,n){if(!e||0>=n)return F;const r=null!=e.threshold&&e.threshold>0?e.threshold:5e3,o=e.graded;if(o){const e="object"==typeof o?o:{},a=t(n,r,e.thresholds);return{alpha:{...W,...e.opacities??{}}[a],band:a,isStale:"fresh"!==a}}return n>r?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:F}import{useEffect as V,useRef as X}from"react";function K(t,e,n,r,o,a,c){const s=X("fresh");V(()=>{if(!t)return void(s.current="fresh");const l=setInterval(()=>{const l=e.current;if(!l||0===l.lastIngestTime)return;const i=Y(t,o()-l.lastIngestTime);i.band===s.current&&i.isStale===a||(s.current=i.band,i.isStale!==a&&c(i.isStale),n.current=!0,r())},1e3);return()=>clearInterval(l)},[t,a,r,o,e,c,n])}import{jsx as q}from"react/jsx-runtime";function Q({isStale:t,position:e}){return q("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===e?{top:4,left:4}:"bottom-left"===e?{bottom:4,left:4}:"bottom-right"===e?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:t?"#dc3545":"#28a745",color:"white"},children:t?"STALE":"LIVE"})}import{useRef as J}from"react";function Z(t){const e=J(t);return function(t,e){if(Object.is(t,e))return!0;if(Array.isArray(t)&&Array.isArray(e))return et(t,e);if(!nt(t)||!nt(e))return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;const n=t[r],o=e[r];if(!Object.is(n,o))if(Array.isArray(n)&&Array.isArray(o)){if(!et(n,o))return!1}else{if(!nt(n)||!nt(o))return!1;if(!tt(n,o))return!1}}return!0}(e.current,t)||(e.current=t),e.current}function tt(t,e){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;if(!Object.is(t[r],e[r]))return!1}return!0}function et(t,e){if(t.length!==e.length)return!1;for(let n=0;t.length>n;n++)if(!Object.is(t[n],e[n]))return!1;return!0}function nt(t){if(null===t||"object"!=typeof t)return!1;if(Array.isArray(t))return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function rt(t){const{background:e,hasBackgroundGraphics:n=!1,themeBackground:r=""}=t;return"transparent"===e?null:n?e||null:e||(r&&"transparent"!==r?r:"")||null}function ot(t){const{background:e,hasBackgroundGraphics:n=!1,themeBackground:r=""}=t;return"transparent"===e||n?null:e||(r&&"transparent"!==r?r:"")||null}function at(t,e){const{background:n,hasBackgroundGraphics:r=!1,themeBackground:o="",x:a=0,y:c=0,width:s,height:i}=e,u=ot({background:n,hasBackgroundGraphics:r,themeBackground:o});if(!u)return!1;const f=l(t,u);return!(!f||"transparent"===f.trim().toLowerCase()||(t.fillStyle=f,t.fillRect(a,c,s,i),0))}function ct(t,e,n,r){return"function"==typeof t?t({size:e,margin:n,scales:r}):t}function st({foregroundGraphics:t,backgroundGraphics:e,size:n,margin:r,scales:o,background:a,themeBackgroundColor:c,resolveScaleAwareGraphics:s=!0}){const l=`var(--semiotic-bg, ${c})`;return{resolvedForeground:s||"function"!=typeof t?ct(t,n,r,o):null,resolvedBackground:s||"function"!=typeof e?ct(e,n,r,o):null,themeBackground:l,surfaceBackground:rt({background:a,hasBackgroundGraphics:!!e,themeBackground:l})}}function lt(t,e,o,c,s){if(0>=e.size)return;const l=e.glyph;if(!l||!l.parts?.length)return;const u=a(l,e.size);if(0>=u.scale)return;const f=(e.style.opacity??1)*(e._decayOpacity??1);if(0>=f)return;const d=e=>{const n=i(t,e,e);return"string"==typeof n?n:e},h=e.color??("string"==typeof e.style.fill?e.style.fill:void 0);t.save(),t.translate(o,c),e.rotation&&t.rotate(e.rotation),t.translate(u.offsetX,u.offsetY),t.scale(u.scale,u.scale),t.globalAlpha=s*f*(e.style.fillOpacity??1);const p=r(l,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal");p&&e.ghostColor&&n(t,l,h,e.accent,e.ghostColor,d),p&&(t.beginPath(),t.rect(p.x,p.y,p.width,p.height),t.clip()),n(t,l,h,e.accent,void 0,d),t.restore()}var it=(t,e)=>{const n=t.globalAlpha;for(const r of e)"glyph"===r.type&<(t,r,r.x,r.y,n);t.globalAlpha=n};function ut(t,e){const n=t.globalAlpha;for(const r of e)"glyph"===r.type&<(t,r,r.cx,r.cy,n);t.globalAlpha=n}var ft=new Set;function dt(t,e){const n="function"==typeof t?t(e.datum??null,e):t;return(r=n)&&"object"==typeof r&&"string"==typeof r.id&&"function"==typeof r.cacheKey&&"function"==typeof r.drawCanvas&&"function"==typeof r.renderStaticSVG?n:void 0;var r}function ht(t,e){if("undefined"!=typeof process&&"production"===process.env?.NODE_ENV)return;const n=`${t}:${e}`;ft.has(n)||(ft.add(n),console.warn(`[Semiotic] Render backend "${t}" does not support scene node "${e}"; using the built-in renderer.`))}function pt(t){const{context:e,nodes:n,renderMode:r,pixelRatio:o,paintBuiltIn:a}=t;if(!r||"sketchy"===r)return void a(n);let c=[];const s=()=>{c.length&&(a(c),c=[])};for(const t of n){const n=dt(r,t);if(!n){c.push(t);continue}let l;s(),e.save();try{l=n.drawCanvas({context:e,node:t,style:t.style??{},pixelRatio:o})}finally{e.restore()}l||(ht(n.id,t.type??"unknown"),a([t]))}s()}function yt(t){const{node:e,index:n,renderMode:r,fallback:o}=t,a=dt(r,e);if(!a)return{element:o(),renderedByBackend:!1};const c=a.renderStaticSVG({node:e,style:e.style??{},key:`${a.id}-${n}`});return null!=c?{element:f(c,e,`${a.id}-${n}-cursor`),renderedByBackend:!0}:(ht(a.id,e.type??"unknown"),{element:o(),renderedByBackend:!1})}function gt(t){return yt(t).element}function mt(t){const e=[];return t.nodes.forEach((n,r)=>{const o=yt({node:n,index:r,renderMode:t.renderMode,fallback:()=>t.fallback(n,r)});null!=o.element&&!1!==o.element&&e.push({node:n,index:r,...o})}),e}function xt(t){const e=new Map;for(const n of t){const t=n.group??"_default";let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}for(const t of e.values()){t.sort((t,e)=>t.x-e.x||t.y-e.y);for(let e=0;t.length>e;e++)t[e]._groupIndex=e}const n=Array.from(e.keys()).sort((t,n)=>{const r=e.get(t),o=e.get(n);return(r.length>0?r[0].y:0)-(o.length>0?o[0].y:0)}),r=Array.from(e.values()).flat();r.sort((t,e)=>t.x-e.x||t.y-e.y);const o=new Map;for(let t=0;r.length>t;t++){r[t]._flatIndex=t;const e=r[t].datum?.id;null!=e&&o.set(e+"",t)}return{flat:r,groups:n,byGroup:e,idToIdx:o}}function bt(t,e){if(0===t.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};const n=Math.max(0,Math.min(e,t.flat.length-1)),r=t.flat[n];return{flatIndex:n,group:r.group??"_default",indexInGroup:r._groupIndex??0}}function vt(t,e,n){const{group:r,indexInGroup:o}=e,a=n.byGroup.get(r);switch(t){case"ArrowRight":return a.length-1>o?a[o+1]._flatIndex:e.flatIndex;case"ArrowLeft":return o>0?a[o-1]._flatIndex:e.flatIndex;case"ArrowDown":{const t=n.groups.indexOf(r);return n.groups.length-1>t?wt(n,n.groups[t+1],a[o]):e.flatIndex}case"ArrowUp":{const t=n.groups.indexOf(r);return t>0?wt(n,n.groups[t-1],a[o]):e.flatIndex}case"PageDown":return Math.min(e.flatIndex+Math.max(1,Math.floor(.1*n.flat.length)),n.flat.length-1);case"PageUp":return Math.max(e.flatIndex-Math.max(1,Math.floor(.1*n.flat.length)),0);case"Home":return 0;case"End":return n.flat.length-1;case"Escape":return-1;default:return null}}function wt(t,e,n){const r=t.byGroup.get(e);let o=0,a=Math.abs(r[0].x-n.x);for(let t=1;r.length>t;t++){const e=Math.abs(r[t].x-n.x);a>e&&(a=e,o=t)}return r[o]._flatIndex}function kt(t){const e=[];for(const n of t)switch(n.type){case"point":if(!1===n.interactive)break;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});break;case"symbol":if(0>=n.size)break;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});break;case"glyph":{if(0>=n.size||null==n.datum)break;const t=o(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:"_default"});break}case"line":{const t=n,r=Array.isArray(t.datum)?t.datum:[],o=t.group??"_default";for(let n=0;t.path.length>n&&r.length>n;n++)e.push({x:t.path[n][0],y:t.path[n][1],datum:r[n],shape:"circle",group:o});break}case"area":{if(!1===n.interactive)break;const t=n,r=Array.isArray(t.datum)?t.datum:[],o=t.group??"_default";for(let n=0;t.topPath.length>n&&r.length>n;n++)e.push({x:t.topPath[n][0],y:t.topPath[n][1],datum:r[n],shape:"circle",group:o});break}case"rect":e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:n.group??"_default"});break;case"heatcell":e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function At(t){const e=[];for(const n of t)if("rect"===n.type&&null!=n.x){if(null==n.datum)continue;e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:n.group??n.datum?.category??""})}else if("point"===n.type){if(!1===n.interactive)continue;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"})}else if("symbol"===n.type){if(0>=n.size)continue;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"})}else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const t=o(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:"_default"})}else if("wedge"===n.type&&null!=n.cx){if(null===n.datum)continue;const t=((n.startAngle||0)+(n.endAngle||0))/2,r=((n.innerRadius||0)+(n.outerRadius||50))/2;e.push({x:n.cx+Math.cos(t)*r,y:n.cy+Math.sin(t)*r,datum:n.datum,shape:"wedge",group:"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function It(t){const e=[];for(const n of t)if("circle"===n.type&&null!=n.cx){if(0>=n.r)continue;e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum?.id??"_default"})}else if("rect"===n.type&&null!=n.x){if(0>=n.w||0>=n.h)continue;e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:n.datum?.id??"_default"})}else if("arc"===n.type&&null!=n.cx)e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum?.id??"_default"});else if("symbol"===n.type&&null!=n.cx){if(0>=n.size)continue;e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum?.id??"_default"})}else if("glyph"===n.type&&null!=n.cx){if(0>=n.size||null==n.datum)continue;const t=o(n.glyph,n.size);e.push({x:n.cx+t.centerDx,y:n.cy+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:n.datum?.id??"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function Mt(t,e,n,r,o){const a=n.flat[e.flatIndex];if(!a)return vt(t,e,n);const c=a.datum?.id;switch(t){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":{const r=function(t,e,n){let r=null,o=1/0;for(let a=0;t.flat.length>a;a++){const c=t.flat[a];if(c===e)continue;const s=c.x-e.x,l=c.y-e.y;let i=!1;switch(n){case"right":i=s>0&&Math.abs(s)>=Math.abs(l);break;case"left":i=0>s&&Math.abs(s)>=Math.abs(l);break;case"down":i=l>0&&Math.abs(l)>=Math.abs(s);break;case"up":i=0>l&&Math.abs(l)>=Math.abs(s)}if(!i)continue;const u=s*s+l*l;o>u&&(o=u,r=a)}return r}(n,a,"ArrowRight"===t?"right":"ArrowLeft"===t?"left":"ArrowDown"===t?"down":"up")??e.flatIndex;return r!==e.flatIndex&&(o.current=-1),r}case"Enter":{if(null==c)return e.flatIndex;const t=function(t,e){const n=t+"",r=[];for(const t of e){const e=t.datum??t,o=_t(e.source),a=_t(e.target),c=null!=o,s=null!=a;c&&o+""===n&&s?r.push(a+""):s&&a+""===n&&c&&r.push(o+"")}return r}(c,r);if(0===t.length)return e.flatIndex;const a=n.idToIdx.get(t[(o.current+1)%t.length])??-1;return 0>a?e.flatIndex:(o.current=-1,a)}default:{const r=vt(t,e,n);return null!==r&&r!==e.flatIndex&&(o.current=-1),r}}}function _t(t){return"object"==typeof t&&null!==t&&"id"in t?t.id:t}function St(t){const e=[];for(const n of t)if("point"===n.type&&null!=n.x&&!1!==n.interactive)e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle"});else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const t=o(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight})}else"geoarea"===n.type&&n.centroid&&!1!==n.interactive&&e.push({x:n.centroid[0],y:n.centroid[1],datum:n.datum,shape:"geoarea",pathData:n.pathData});return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function Dt(t,e,n){switch(t){case"ArrowRight":case"ArrowDown":return n-1>e?e+1:e;case"ArrowLeft":case"ArrowUp":return e>0?e-1:e;case"PageDown":return Math.min(e+Math.max(1,Math.floor(.1*n)),n-1);case"PageUp":return Math.max(e-Math.max(1,Math.floor(.1*n)),0);case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function Ot(t){return{data:t.datum||{},x:t.x,y:t.y,__semioticHoverData:!0}}function Rt(t,e,n,r,o,a){return function(t,e,n){const r=t.current;r.inside=!0,r.clientX=e.clientX,r.clientY=e.clientY,r.pointerType=e.pointerType??n}(t,e,a),!(!n&&!r||!n&&"touch"===t.current.pointerType&&(u(o),1))}function Bt(t){const{title:e,description:n,summary:r,accessibleTable:o,className:a,animate:c,maxDevicePixelRatio:s,axisExtent:l,autoPlaceAnnotations:i}=t,u={};return e&&(u.title=e),n&&(u.description=n),r&&(u.summary=r),void 0!==o&&(u.accessibleTable=o),a&&(u.className=a),null!=c&&(u.animate=c),void 0!==s&&(u.maxDevicePixelRatio=s),void 0!==l&&(u.axisExtent=l),void 0!==i&&(u.autoPlaceAnnotations=i),u}function Et(t){const{linkedHover:e,selection:n,onObservation:r,onClick:o,hoverRadius:a,hoverHighlight:c,forceHoverBehavior:s,forceClickBehavior:l,mobileInteraction:i,customHoverBehavior:u,customClickBehavior:f,linkedHoverInClickPredicate:d=!0}=t,h={};r&&(h.annotationObservationCallback=r);const p=i?.enabled?Math.max(a??30,Math.ceil((i.targetSize||44)/2),24):a;return(s||e||r||o||c)&&(h.customHoverBehavior=u),f&&(l||(d?r||o||e:r||o)||i?.enabled&&(i.tapToSelect||i.tapToLockTooltip)&&(e||c||n))&&(h.customClickBehavior=f),null!=p&&(h.hoverRadius=p),h}function Pt(t){const{tooltip:e,defaultTooltipContent:n}=t;return{tooltipContent:!1===e?()=>null:c(e)||n}}function Ct(t,e,n){if(1>=n)return 1;const r=n-1;return s({age:r-e,extent:r,type:t.type,halfLife:t.halfLife??n/2,threshold:t.stepThreshold??.5*n,minOpacity:t.minOpacity??.1})}function Tt(t){const e=new Map;for(let n=0;t.length>n;n++)e.set(t[n],n);return e}function jt(t,e,n,r=Tt(n)){const o=n.length;if(o>1)for(const n of e){if("line"===n.type){const e=Array.isArray(n.datum)?n.datum:[];if(2>e.length)continue;const a=Array(e.length);let c=!1;for(let n=0;e.length>n;n++){const s=r.get(e[n]);null!=s?(a[n]=Ct(t,s,o),1>a[n]&&(c=!0)):a[n]=1}c&&(n._decayOpacities=a);continue}if("area"===n.type){const e=Array.isArray(n.datum)?n.datum:[],a=n.topPath?n.topPath.length:e.length;if(2>a)continue;if(e.length===a){const c=Array(a);let s=!1;for(let n=0;e.length>n;n++){const a=r.get(e[n]);null!=a?(c[n]=Ct(t,a,o),1>c[n]&&(s=!0)):c[n]=1}s&&(n._decayOpacities=c)}else{let c=1;for(const n of e){const e=r.get(n);if(null!=e){const n=Ct(t,e,o);c>n&&(c=n)}}if(1>c){const t=Array(a);t.fill(c),n._decayOpacities=t}}continue}const e=r.get(n.datum);if(null==e)continue;const a=Ct(t,e,o);"candlestick"===n.type?n._decayOpacity=a:n.style={...n.style,opacity:(n.style?.opacity??1)*a}}}function Lt(t){if("production"===process.env.NODE_ENV)return;const{label:e,nodes:n,overlays:r,warned:o}=t;zt(r)&&0===n.length&&Gt(o,"overlay-only",`[semiotic] ${e} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),n.length>0&&n.every(t=>null==t.datum)&&Gt(o,"null-datums",`[semiotic] ${e} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function zt(t){return null!=t&&!1!==t&&""!==t&&(!Array.isArray(t)||t.some(zt))}function Gt(t,e,n){t.has(e)||(t.add(e),console.warn(n))}function Ht(t,e,n,r){const o=function(t){if(t instanceof Error)return{name:t.name||"Error",message:t.message||"Custom layout threw."};if("string"==typeof t)return{name:"Error",message:t};if(null==t)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:t+""}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}(e),a="network"===t?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:t,source:a,message:`Semiotic ${t} ${a} failed: ${o.message}`,error:o,recovery:n?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:n,affectedRevision:r}}var $t=new WeakMap;function Nt(){return this.updateResults.last}function Ut(){return this.updateResults.last}function Wt(t){return this.updateResults.subscribe(t)}function Ft(t){this.config.layoutSelection=t}function Yt(){$t.set(this,!0)}function Vt(){const t=!0===$t.get(this);return $t.delete(this),t}function Xt(t){Object.assign(t.prototype,{getLastUpdateResult:Nt,getUpdateSnapshot:Ut,subscribeUpdateResult:Wt,setLayoutSelection:Ft,markStylePaintPending:Yt,consumeStylePaintPending:Vt})}function Kt(t,e,n){return n.x>t||t>n.x+n.w||n.y>e||e>n.y+n.h?{hit:!1,cx:0,cy:0}:{hit:!0,cx:n.x+n.w/2,cy:n.y+n.h/2}}function qt(t,e=30){return Math.max((t??4)+5,12,e)}function Qt(t){return t instanceof Date?t:"number"==typeof t&&t>1e9?new Date(t):null}function Jt(t,e){const n=Qt(t);if(!n)return!1;const r=Qt(e);return!r||n.getFullYear()!==r.getFullYear()||n.getMonth()!==r.getMonth()}function Zt(t){let e=t%(2*Math.PI);return 0>e&&(e+=2*Math.PI),e}function te(t,e,n,r,o,a=t=>t.x,c=t=>t.y,s=t=>t.r){const l=Math.max(r,o+5,12),i=e-l,u=e+l,f=n-l,d=n+l;let h=null,p=1/0;return t.visit((t,o,l,y,g)=>{if(o>u||i>y||l>d||f>g)return!0;if(!t.length){let o=t;do{const t=o.data,l=a(t)-e,i=c(t)-n,u=Math.sqrt(l*l+i*i);qt(s(t),r)>=u&&p>u&&(h=t,p=u),o=o.next}while(o)}return!1}),h?{node:h,distance:p}:null}function ee(t){return!(!t._pulseIntensity||0>=t._pulseIntensity)}function ne(t,e,n=.3){ee(e)&&(t.globalAlpha=e._pulseIntensity*n,t.fillStyle=e._pulseColor||"rgba(255,255,255,0.6)",t.fillRect(e.x,e.y,e.w,e.h))}function re(t,e,n=.6){if(!ee(e))return;const r=e.r+(e._pulseGlowRadius??4)*e._pulseIntensity,o=e.cx??e.x??0,a=e.cy??e.y??0;t.beginPath(),t.arc(o,a,r,0,2*Math.PI),t.strokeStyle=e._pulseColor||"rgba(255,255,255,0.6)",t.lineWidth=2*e._pulseIntensity,t.globalAlpha=e._pulseIntensity*n,t.stroke()}function oe(t,e,n,r=.35){ee(e)&&(t.globalAlpha=e._pulseIntensity*r,t.fillStyle=e._pulseColor||"rgba(255,255,255,0.6)",n?t.fill(n):t.fill())}export{Ct as computeDecayOpacity,Tt as buildDatumIndexMap,jt as applyDecay,Lt as warnCustomLayoutDiagnostics,Ht as createCustomLayoutFailureDiagnostic,Xt as attachUpdateResultStore,G as composeOverlays,N as useConfigSync,U as useLayoutSelectionSync,Kt as hitTestRect,qt as getHitRadius,Jt as isTimeLandmark,Zt as normalizeAngle,te as findHitPointInQuadtree,Y as resolveStaleness,K as useStalenessCheck,Q as StalenessBadge,d as withProvenance,h as currentTimestamp,p as withCurrentProvenance,m as annotationFreshnessFor,x as computeAnnotationFreshness,k as applyAnnotationLifecycle,S as filterAnnotationsByStatus,D as applyAnnotationStatus,Z as useStableShallow,ot as resolveCanvasBackground,at as paintCanvasBackground,ct as resolveFrameGraphics,st as resolveFrameLayers,ne as renderRectPulse,re as renderCirclePulse,oe as renderPathPulse,it as glyphCanvasRenderer,ut as networkGlyphRenderer,pt as paintSceneWithBackend,gt as renderSceneWithBackend,mt as renderSceneListWithBackend,B as accessorName,E as formatVal,T as bandTooltipFields,j as buildDefaultTooltip,L as buildOrdinalTooltip,xt as buildNavGraph,bt as resolvePosition,vt as nextGraphIndex,kt as extractXYNavPoints,At as extractOrdinalNavPoints,It as extractNetworkNavPoints,Mt as nextNetworkIndex,St as extractGeoNavPoints,Dt as nextIndex,Ot as navPointToHover,Rt as shouldHandleFramePointer,Bt as buildBaseMetadataProps,Et as buildCustomBehaviorProps,Pt as buildTooltipProps};
|
package/dist/c-IDUHYYSI.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{forceLayout as n}from"./c-QHF5YON3.min.js";import{canUseForceWorker as t,runForceLayoutWorker as e,shouldUseForceWorker as r}from"./c-OXYMVK7Q.min.js";import{useWasHydratingFromSSR as o}from"./c-GIKRQI4X.min.js";import{useEffect as i,useMemo as s,useRef as u,useState as a}from"react";var d=new WeakMap;function l(n){const t=[];for(const e of Object.keys(n).sort()){const r=n[e];if(void 0!==r){if("function"==typeof r)return null;t.push(`${e}:${r+""}`)}}return t.join("|")}function c(n,t,e){return null==e?null:d.get(n)?.get(t)?.get(e)??null}function p(n,t,e,r){if(null==e)return;let o=d.get(n);o||(o=new WeakMap,d.set(n,o));let i=o.get(t);if(i||(i=new Map,o.set(t,i)),!i.has(e)&&i.size>=16){const n=i.keys().next().value;void 0!==n&&i.delete(n)}i.set(e,r)}function f(d,f,m={}){const g=o(),{seed:h,iterations:k,repulsion:y,linkDistance:w,linkStrength:b,centerStrength:j,damping:v,nodeRadius:R,nodePadding:x,inset:O,execution:E,workerThreshold:M}=m,S=s(()=>({seed:h,iterations:k,repulsion:y,linkDistance:w,linkStrength:b,centerStrength:j,damping:v,nodeRadius:R,nodePadding:x,inset:O,execution:E,workerThreshold:M}),[h,k,y,w,b,j,v,R,x,O,E,M]),A=u(g),[Q,T]=a(()=>{if("undefined"==typeof window||g){const t=n(d,f,S);return p(d,f,l(S),t),{positions:t,status:"ready",error:null}}const t=c(d,f,l(S));return t?{positions:t,status:"ready",error:null}:{positions:null,status:"pending",error:null}});return i(()=>{if(A.current)return void(A.current=!1);const o=l(S),i=c(d,f,o);if(i)return void T(n=>"ready"===n.status&&n.positions===i?n:{positions:i,status:"ready",error:null});const s=new AbortController;return T(n=>({positions:n.positions,status:"pending",error:null})),async function(o,i,s={}){const{execution:u="auto",signal:a,workerThreshold:d,nodeRadius:l,...c}=s,p=c.iterations??260;if(!t()||!r(u,o.length,i.length,p,d))return n(o,i,{...c,nodeRadius:l});const f={kind:"normalized",nodes:o.map(n=>({...n})),edges:i.map(n=>({...n})),options:c,nodeRadii:"function"==typeof l?Object.fromEntries(o.map(n=>[n.id,l(n)])):null==l?void 0:Object.fromEntries(o.map(n=>[n.id,l]))};try{return(await e(f,a)).positions}catch(t){if("AbortError"===t?.name)throw t;return n(o,i,{...c,nodeRadius:l})}}(d,f,{...S,signal:s.signal}).then(n=>{p(d,f,o,n),T({positions:n,status:"ready",error:null})}).catch(n=>{"AbortError"!==n.name&&T(t=>({positions:t.positions,status:"error",error:n}))}),()=>s.abort()},[d,f,S]),Q}export{f as useForceLayout};
|
package/dist/c-JAZ73J32.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function t(t,n,r=t.responsiveRules){if(!Array.isArray(r)||0===r.length)return{props:t,matches:[]};const i=r.map((e,t)=>({rule:e,index:t})).filter(e=>function(e,t){const{when:n}=e,r=t.width,i=t.height,o=function(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}(t),a=function(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}(t);return!("number"==typeof n.minWidth&&n.minWidth>r||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof i||n.minHeight>i)||"number"==typeof n.maxHeight&&("number"!=typeof i||i>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||n.minAspectRatio>o)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}(e.rule,n)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:i.reduce((t,n)=>function(t,n){const r={...t,...n};for(const i of["margin","frameProps","mobileSemantics","style"])e(t[i])&&e(n[i])&&(r[i]={...t[i],...n[i]});return"string"==typeof t.className&&"string"==typeof n.className&&(r.className=`${t.className} ${n.className}`),r}(t,n.rule.transform),t),matches:i}}function n(e){const t=[],n=e.domain;null==n?t.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} as numbers or Date-compatible values."}):Array.isArray(n)&&2===n.length&&Number.isFinite(Number(n[0]))&&Number.isFinite(Number(n[1]))||t.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times.",fix:"Use domain={[t0, t1]} with t0 <= t1."});const r=e.edges;if(Array.isArray(r)&&r.length>0){const e=r[0];null!=e.startTime&&null!=e.endTime||t.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}const i=e.nodes,o=Array.isArray(i)?i.length:0;return!0!==e.showLabels||24>o||t.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${o} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),80>(Array.isArray(r)?r.length:0)||null!=e.layoutExecution||"off"===e.packing||t.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),t}function r(e,t){return e===t}function i(e,t){if("function"==typeof e)return t=>+e(t);const n=e||t;return e=>+e[n]}function o(e,t){if("function"==typeof e)return e;const n=e||t;return e=>e[n]}function a(e,t){return"function"==typeof e?t=>e(t)+"":e?t=>t[e]+"":t?e=>e[t]+"":void 0}function s(e){return e?"function"==typeof e?e:t=>t[e]||t.id:null}function u(e){return"string"==typeof e?e:e.id}var c=/^\d{4}-\d{1,2}$/;function l(e){const t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;const n=c.test(t)?t+"-01":t;if(n===t&&10>t.length)return NaN;const r=Date.parse(n);return Number.isFinite(r)?r:NaN}function f(e){return e instanceof Date?e.getTime():"string"==typeof e?l(e):+e}var m=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),d=new Set(["label","callout","callout-circle","callout-rect"]);function h(e){return"string"==typeof e?.type?e.type:""}function y(e){return!!e&&"object"==typeof e&&m.has(h(e))}function p(e){return d.has(h(e))&&!function(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}(e)}function g(e,t={}){const n=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,i=new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!n)return!1;const t=e?.provenance?.stableId;return!(t&&i.has(t)&&!r)})}function b(e){return e instanceof Date?"date:"+e.getTime():`${typeof e}:${e+""}`}var A={kind:"rank-competition"};function x(e,t,n,r){const i=e??t;return"function"==typeof i?i(n,r):n[i+""]}function N(e){const t=new Map;(Array.isArray(e.data)?e.data:[]).forEach((n,r)=>{if(!Number.isFinite(Number(x(e.yAccessor,"y",n,r))))return;const i=b(x(e.xAccessor,"x",n,r)),o=t.get(i)??new Set;o.add(x(e.lineBy,"series",n,r)+""),t.set(i,o)});const n=Array.from(t.values(),e=>e.size).sort((e,t)=>e-t);if(0===n.length)return[];const r=Math.floor(n.length/2),i={columns:n.length,median:n.length%2?n[r]:(n[r-1]+n[r])/2,max:n[n.length-1],contestedColumns:n.filter(e=>e>=2).length},o=2>i.max;return o||2>i.contestedColumns||2>i.median?[{code:o?"BUMP_NO_RANK_COMPETITION":"BUMP_SPARSE_RANK_COMPETITION",severity:o?"error":"warning",message:o?"Every ranking column contains one series, so every trajectory remains at rank 1.":"Too few ranking columns contain competing series for reliable rank movement.",fix:"Use a lineBy field with repeated series across shared x columns, or choose a value-based chart.",metrics:{...i}}]:[]}var S=Symbol.for("semiotic.semantic-viability"),w=globalThis,v=w[S]??(w[S]=new Map);function E(e){return v.has(e)}function M(e){return v.get(e)}function _(e){let t=e>>>0;return function(){t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function T(e){return"primary"===e?.emphasis||!0===e?.defensive}function P(e,t,n={}){return"number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations)?Math.max(0,Math.floor(n.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4))):1/0}function k(e){let t;const n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;const r=e?.provenance?.confidence;switch("number"==typeof r&&Number.isFinite(r)&&(t+=15*Math.max(0,Math.min(1,r))),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}function R(e){const{annotations:t,width:n,height:r}=e,i=Math.max(0,e.minVisible??1),o=P(n,r,e),a=t.map((e,t)=>{return{annotation:e,index:t,note:(n=e,y(n))};var n}),s=a.filter(e=>e.note);if(0===s.length||o>=s.length)return{visible:t.slice(),deferred:[],budget:o};const u=s.filter(e=>T(e.annotation)),c=s.filter(e=>!T(e.annotation)).sort((e,t)=>k(t.annotation)-k(e.annotation)||e.index-t.index),l=Math.min(c.length,Math.max(Math.max(0,o-u.length),Math.max(0,i-u.length))),f=new Set([...u.map(e=>e.index),...c.slice(0,l).map(e=>e.index)]),m=[],d=[];for(const{annotation:e,index:t,note:n}of a)!n||f.has(t)?m.push(e):d.push(e);return{visible:m,deferred:d,budget:o}}function I(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:n+""}export{t as resolveResponsiveRules,b as bumpXIdentity,A as BUMP_CHART_SEMANTIC_VIABILITY,N as evaluateRankCompetition,E as hasRegisteredSemanticViability,M as getRegisteredSemanticViability,n as diagnoseProcessSankeyProps,_ as mulberry32,r as accessorsEquivalent,i as resolveAccessor,o as resolveRawAccessor,a as resolveStringAccessor,s as resolveLabelFn,u as resolveNodeRefId,l as parseDateLikeString,f as coerceDateLikeValue,h as annotationType,y as isNoteAnnotation,p as annotationDrawsConnector,P as annotationBudget,R as annotationDensity,g as filterAnnotationsByStatus,I as annotationStableId};
|