semiotic 3.10.1 → 3.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -62
- package/ai/artifact-surface-inventory.json +4 -1
- package/ai/dist/mcp-server.js +25 -24
- package/ai/examples.md +28 -0
- package/ai/reference.md +6 -1
- package/ai/schema.json +121 -5
- package/ai/surface-manifest.json +3 -2
- package/ai/task-packets/compare-category-totals.json +7 -53
- package/ai/task-packets/compare-category-totals.md +4 -4
- package/ai/task-packets/correct-published-chart.json +7 -53
- package/ai/task-packets/correct-published-chart.md +4 -4
- package/ai/task-packets/index.json +9 -9
- package/ai/task-packets/update-live-chart.json +8 -54
- package/ai/task-packets/update-live-chart.md +4 -4
- package/dist/c-27DCB5T6.min.js +18 -0
- package/dist/c-2MONF2P6.min.js +1 -0
- package/dist/c-2TW5H5PD.min.js +1 -0
- package/dist/c-3AGX252H.min.js +1 -0
- package/dist/c-3B6JZEZT.min.js +1 -0
- package/dist/c-3BYZXCX3.min.js +4 -0
- package/dist/c-3DIPZJDO.min.js +1 -0
- package/dist/c-3FOUMWLR.min.js +1 -0
- package/dist/c-3NA6I656.min.js +2 -0
- package/dist/c-3OFVBWQY.min.js +1 -0
- package/dist/{c-QA3HMQJP.min.js → c-3PFVJFBK.min.js} +1 -1
- package/dist/c-3PPO7ZJF.min.js +4 -0
- package/dist/c-3YEW2PK6.min.js +1 -0
- package/dist/c-4JKDJUYD.min.js +1 -0
- package/dist/c-4LKK5YWB.min.js +1 -0
- package/dist/c-4MD53L2J.min.js +33 -0
- package/dist/c-4V3CD337.min.js +1 -0
- package/dist/c-4XLHPQTP.min.js +1 -0
- package/dist/c-5NYONM6V.min.js +5 -0
- package/dist/c-6IVBV5NO.min.js +1 -0
- package/dist/c-6ZU3QVLB.min.js +100 -0
- package/dist/c-72CBVNYX.min.js +209 -0
- package/dist/c-7APWCEPL.min.js +1 -0
- package/dist/c-7ASK4WBF.min.js +1 -0
- package/dist/{c-ORLEBW72.min.js → c-7FKPPCGN.min.js} +1 -1
- package/dist/c-7LY46QUI.min.js +41 -0
- package/dist/c-ABMGCCLT.min.js +1 -0
- package/dist/c-AINGQGUN.min.js +1 -0
- package/dist/c-AKLBQMQF.min.js +391 -0
- package/dist/c-AXJ2QI3F.min.js +1 -0
- package/dist/c-BQYD7T4E.min.js +1 -0
- package/dist/{c-V4XMSLC3.min.js → c-BYJJ7EMG.min.js} +1 -1
- package/dist/{c-J6DVC236.min.js → c-C4KIXUWU.min.js} +1 -1
- package/dist/c-C4SXYFXL.min.js +1 -0
- package/dist/c-CLDCKFBE.min.js +1 -0
- package/dist/c-CLJCJSFU.min.js +1 -0
- package/dist/c-CLLCX3PT.min.js +2 -0
- package/dist/c-ECHBKW7U.min.js +1 -0
- package/dist/c-EPJWM2UT.min.js +1 -0
- package/dist/c-F2GGJB2S.min.js +31 -0
- package/dist/c-FD2BXSRG.min.js +1 -0
- package/dist/c-FDUQDCBC.min.js +51 -0
- package/dist/c-FOTTQHOO.min.js +1 -0
- package/dist/c-FU7A5KSY.min.js +1 -0
- package/dist/c-G53AVC42.min.js +113 -0
- package/dist/c-GHN6IR4Y.min.js +1 -0
- package/dist/c-GSCO3FWL.min.js +1 -0
- package/dist/c-GYLOSK7M.min.js +1 -0
- package/dist/c-HK4OSLZA.min.js +1 -0
- package/dist/c-HLGTD5SJ.min.js +1 -0
- package/dist/c-HQ27AHMC.min.js +1 -0
- package/dist/{c-D6HAAPTX.min.js → c-IBRLFKWA.min.js} +1 -1
- package/dist/c-IHWZ2C6D.min.js +26 -0
- package/dist/c-IIV73MUW.min.js +1 -0
- package/dist/c-IPYGNVN6.min.js +116 -0
- package/dist/c-JJKRER47.min.js +1 -0
- package/dist/c-JO6AYCU4.min.js +1 -0
- package/dist/c-JWHPG6S2.min.js +1 -0
- package/dist/c-JXVYIXTV.min.js +1 -0
- package/dist/c-K2ZIYDI3.min.js +1 -0
- package/dist/c-K37JAIWA.min.js +4 -0
- package/dist/c-KGROWFT2.min.js +9 -0
- package/dist/c-MOP2NGLH.min.js +1 -0
- package/dist/c-MTX2AO5S.min.js +1 -0
- package/dist/c-N5WT7TXG.min.js +1 -0
- package/dist/c-NATWERHZ.min.js +1 -0
- package/dist/{c-42PLDTX7.min.js → c-O53GOO7H.min.js} +1 -1
- package/dist/c-OVQB75PE.min.js +1 -0
- package/dist/c-P3SKRNZN.min.js +1 -0
- package/dist/c-P5NXQWIM.min.js +1 -0
- package/dist/c-P7BQMVQQ.min.js +1 -0
- package/dist/{c-GNTXRXRN.min.js → c-PDQHLOKU.min.js} +1 -1
- package/dist/c-PKY4JFY5.min.js +1 -0
- package/dist/c-PQOZPM4G.min.js +1 -0
- package/dist/c-PZ3NEGNG.min.js +1 -0
- package/dist/c-QXLDCATV.min.js +1 -0
- package/dist/c-R2HUSWKB.min.js +1 -0
- package/dist/{c-HYW2XA4Q.min.js → c-RHDOOQ4X.min.js} +1 -1
- package/dist/c-RZPP5ERV.min.js +1 -0
- package/dist/c-SG2Y7EBY.min.js +46 -0
- package/dist/{c-WUWXGQYA.min.js → c-SJIB5RNI.min.js} +1 -1
- package/dist/c-SQNEVNWT.min.js +1 -0
- package/dist/c-STHZWF3D.min.js +1 -0
- package/dist/c-TIDKVMMZ.min.js +1 -0
- package/dist/c-TIMGODBG.min.js +1 -0
- package/dist/c-TR7OHUAO.min.js +2 -0
- package/dist/c-TTKWXGAI.min.js +61 -0
- package/dist/c-TVKZC4BY.min.js +1 -0
- package/dist/c-U5XVLSHN.min.js +1 -0
- package/dist/c-U6NLVFN4.min.js +1 -0
- package/dist/{c-VJTDST2R.min.js → c-UBHICVSC.min.js} +1 -1
- package/dist/c-UOPPO26M.min.js +1 -0
- package/dist/c-UUDAON4Z.min.js +1 -0
- package/dist/c-V32TPPY2.min.js +1 -0
- package/dist/c-V5KFJWQQ.min.js +1 -0
- package/dist/{c-P65V6HLO.min.js → c-VN557BQE.min.js} +1 -1
- package/dist/c-VXIYF7V2.min.js +1 -0
- package/dist/c-Y342FJ6K.min.js +1 -0
- package/dist/c-YM6CT4LJ.min.js +1 -0
- package/dist/{c-MVR3RWF3.min.js → c-YMFUIO54.min.js} +1 -1
- package/dist/c-YQVOKPKR.min.js +1 -0
- package/dist/c-YRJ3BJQZ.min.js +1 -0
- package/dist/c-YT5KPVNP.min.js +1 -0
- package/dist/components/ai/audienceProfile.d.ts +18 -1
- package/dist/components/ai/describeChart.d.ts +5 -1
- package/dist/components/ai/intentManifest.d.ts +16 -0
- package/dist/components/ai/intentRegistry.d.ts +12 -0
- package/dist/components/ai/intents.d.ts +6 -6
- package/dist/components/ai/streamSchema.d.ts +19 -0
- package/dist/components/ai/streamingTypes.d.ts +57 -11
- package/dist/components/ai/suggestCharts.d.ts +1 -1
- package/dist/components/ai/suggestStreamCharts.d.ts +43 -8
- package/dist/components/ai/suggestStreamDashboard.d.ts +35 -0
- package/dist/components/ai/variantDiscovery.d.ts +1 -1
- package/dist/components/charts/ordinal/BarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/DonutChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/PieChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/StackedBarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +14 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +6 -5
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -161
- package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +175 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +6 -5
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +6 -5
- package/dist/components/charts/realtime/aggregate.d.ts +11 -1
- package/dist/components/charts/realtime/resolveWindowSize.d.ts +1 -1
- package/dist/components/charts/shared/DirectLabelLayer.d.ts +25 -0
- package/dist/components/charts/shared/directLabels.d.ts +12 -0
- package/dist/components/charts/shared/knownChartComponents.d.ts +4 -1
- package/dist/components/charts/shared/lineSeriesSsr.d.ts +0 -12
- package/dist/components/charts/shared/useChartSetup.d.ts +2 -0
- package/dist/components/charts/value/BigNumber.streamCapability.d.ts +2 -0
- package/dist/components/charts/value/GaugeChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +4 -1
- package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -1
- package/dist/components/charts/xy/LineChart.d.ts +4 -1
- package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
- package/dist/components/realtime/HyperLogLog.d.ts +19 -0
- package/dist/components/realtime/ReorderBuffer.d.ts +2 -2
- package/dist/components/realtime/TDigest.d.ts +22 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +22 -5
- package/dist/components/realtime/applyChangelog.d.ts +38 -0
- package/dist/components/realtime/minHeap.d.ts +3 -0
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +1 -1
- package/dist/components/recipes/layout1d.d.ts +2 -20
- package/dist/components/recipes/minGapPlacement.d.ts +20 -0
- package/dist/components/semiotic-ai-core.d.ts +8 -3
- package/dist/components/semiotic-ai-stream.d.ts +10 -0
- package/dist/components/semiotic-ai.d.ts +4 -6
- package/dist/components/semiotic-realtime-core.d.ts +6 -2
- package/dist/components/semiotic-stream-types.d.ts +14 -0
- package/dist/components/semiotic-xy.d.ts +1 -0
- package/dist/components/semiotic.d.ts +3 -11
- package/dist/components/server/encodeSvgFramesToGif.d.ts +2 -0
- package/dist/components/server/rasterizeSVG.d.ts +2 -0
- package/dist/components/server/registerServerXYPlugins.d.ts +2 -0
- package/dist/components/server/renderEvidence.d.ts +4 -0
- package/dist/components/server/serverChartConfigs.d.ts +5 -0
- package/dist/components/server/serverChartConfigsRealtime.d.ts +6 -0
- package/dist/components/server/serverRealtimeCategoryColors.d.ts +3 -0
- package/dist/components/server/staticAnnotations.d.ts +9 -0
- package/dist/components/stream/SceneGraph.d.ts +3 -3
- package/dist/components/stream/StalenessBadge.d.ts +5 -2
- package/dist/components/stream/pipelinePathJoin.d.ts +27 -0
- package/dist/components/stream/pipelineTransitionTypes.d.ts +43 -0
- package/dist/components/stream/pipelineTransitions.d.ts +5 -35
- package/dist/components/stream/seriesGeometry.d.ts +2 -1
- package/dist/components/stream/streamEncodingTypes.d.ts +9 -0
- package/dist/components/stream/types.d.ts +25 -2
- package/dist/components/text/axisLabelAssessment.d.ts +15 -0
- package/dist/components/text/browserAxisLabelAssessment.d.ts +1 -0
- package/dist/components/text/browserLabelMeasurement.d.ts +3 -0
- package/dist/components/text/labelMeasurement.d.ts +19 -0
- package/dist/components/text/labelPlacement.d.ts +71 -0
- package/dist/components/text/useAxisLabelAssessment.d.ts +6 -0
- package/dist/components/text/useLabelMeasurer.d.ts +3 -0
- package/dist/controls.module.min.js +71 -1
- package/dist/geo.min.js +231 -1
- package/dist/geo.module.min.js +31 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/rough.min.js +2 -1
- package/dist/rough.module.min.js +2 -1
- package/dist/semiotic-access.module.min.js +1 -1
- package/dist/semiotic-ai-artifact-policy-constants.module.min.js +1 -1
- package/dist/semiotic-ai-core.d.ts +8 -3
- package/dist/semiotic-ai-core.min.js +4 -1
- package/dist/semiotic-ai-core.module.min.js +4 -1
- package/dist/semiotic-ai-hash-primitives.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +4 -6
- package/dist/semiotic-ai.module.min.js +14 -1
- package/dist/semiotic-artifact-react.min.js +269 -1
- package/dist/semiotic-artifact-react.module.min.js +137 -1
- package/dist/semiotic-artifact.min.js +3 -1
- package/dist/semiotic-artifact.module.min.js +3 -1
- package/dist/semiotic-atlas-core.min.js +2 -1
- package/dist/semiotic-atlas-core.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-atlas.module.min.js +11 -1
- package/dist/semiotic-client-cjs-shared.min.js +1529 -1
- package/dist/semiotic-client-glyph.module.min.js +3 -1
- package/dist/semiotic-client-responsive.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-evidence.min.js +3 -1
- package/dist/semiotic-evidence.module.min.js +3 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +8 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +8 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.d.ts +6 -2
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +160 -1
- package/dist/semiotic-recipes-core.module.min.js +72 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +3 -1
- package/dist/semiotic-server-edge-node.module.min.js +391 -1
- package/dist/semiotic-server-edge.min.js +651 -1
- package/dist/semiotic-server-edge.module.min.js +372 -1
- package/dist/semiotic-server-node.min.js +651 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-text.min.js +1 -1
- package/dist/semiotic-text.module.min.js +1 -1
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +11 -1
- package/dist/semiotic-utils-core.module.min.js +8 -1
- package/dist/semiotic-value.module.min.js +15 -1
- package/dist/semiotic-xy.d.ts +1 -0
- package/dist/semiotic.d.ts +3 -11
- package/dist/semiotic.module.min.js +10 -1
- package/dist/server.min.js +651 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +4 -3
- package/dist/c-2N7IU2NY.min.js +0 -1
- package/dist/c-2RL2QPZJ.min.js +0 -1
- package/dist/c-2WK7YJLL.min.js +0 -1
- package/dist/c-45CQWZZ6.min.js +0 -1
- package/dist/c-4BRHKVKV.min.js +0 -1
- package/dist/c-7242NXSG.min.js +0 -1
- package/dist/c-7DVPSB5C.min.js +0 -1
- package/dist/c-7EGHJU2F.min.js +0 -1
- package/dist/c-A7OGOFSL.min.js +0 -1
- package/dist/c-AFBSWT77.min.js +0 -1
- package/dist/c-AH5HWZWS.min.js +0 -1
- package/dist/c-AJ7EC32V.min.js +0 -1
- package/dist/c-AQADQNY7.min.js +0 -1
- package/dist/c-ATM475SA.min.js +0 -1
- package/dist/c-AVO3Q7T7.min.js +0 -1
- package/dist/c-B7GW7IHJ.min.js +0 -1
- package/dist/c-BNFJMDHN.min.js +0 -1
- package/dist/c-BOHCQILI.min.js +0 -1
- package/dist/c-C3TZLTZK.min.js +0 -1
- package/dist/c-CGQAQWBV.min.js +0 -1
- package/dist/c-CPV4N35K.min.js +0 -1
- package/dist/c-DIPEYUOW.min.js +0 -1
- package/dist/c-E4JDJH4I.min.js +0 -1
- package/dist/c-E72OTUZU.min.js +0 -1
- package/dist/c-E7I2L7CU.min.js +0 -1
- package/dist/c-ELDWAO2V.min.js +0 -1
- package/dist/c-EUBTECGM.min.js +0 -1
- package/dist/c-EUMPMDCS.min.js +0 -1
- package/dist/c-EZZT2WAE.min.js +0 -1
- package/dist/c-FHBVFCQB.min.js +0 -1
- package/dist/c-G4HCO2IQ.min.js +0 -1
- package/dist/c-G5VIJEOK.min.js +0 -1
- package/dist/c-GHVOXAYH.min.js +0 -1
- package/dist/c-GXV3C3MO.min.js +0 -1
- package/dist/c-HHTK2R75.min.js +0 -1
- package/dist/c-HLLFJYTY.min.js +0 -1
- package/dist/c-HP4ZFM47.min.js +0 -1
- package/dist/c-HPOYKCCG.min.js +0 -1
- package/dist/c-HYDTS5OP.min.js +0 -1
- package/dist/c-I4QJ6YLM.min.js +0 -1
- package/dist/c-IK33LNZ6.min.js +0 -1
- package/dist/c-IK3PZHRY.min.js +0 -1
- package/dist/c-JIMJF6F6.min.js +0 -1
- package/dist/c-JUKIWTBJ.min.js +0 -1
- package/dist/c-KKPMHAZC.min.js +0 -1
- package/dist/c-L6WNDBHV.min.js +0 -1
- package/dist/c-LDEX5OFW.min.js +0 -1
- package/dist/c-LESEUVC5.min.js +0 -1
- package/dist/c-LYQMZMZQ.min.js +0 -1
- package/dist/c-MB6CV5NC.min.js +0 -1
- package/dist/c-MOKJOIPE.min.js +0 -1
- package/dist/c-N3FXLRNT.min.js +0 -1
- package/dist/c-N5NPTJVJ.min.js +0 -1
- package/dist/c-NHBL4J67.min.js +0 -1
- package/dist/c-ODG6TFSY.min.js +0 -1
- package/dist/c-PRIKOLTE.min.js +0 -1
- package/dist/c-PSKKFZNP.min.js +0 -1
- package/dist/c-PSNI6KAZ.min.js +0 -1
- package/dist/c-QAVFOEUY.min.js +0 -1
- package/dist/c-R2P4RR7Q.min.js +0 -1
- package/dist/c-RFC7UAG7.min.js +0 -1
- package/dist/c-S3AZX5PP.min.js +0 -1
- package/dist/c-SGAURYHG.min.js +0 -1
- package/dist/c-SJMWU6UX.min.js +0 -1
- package/dist/c-STIIGQOD.min.js +0 -1
- package/dist/c-T2ASIJVZ.min.js +0 -1
- package/dist/c-T2V7O2LO.min.js +0 -1
- package/dist/c-TKG2NP7G.min.js +0 -1
- package/dist/c-TX3THUTO.min.js +0 -1
- package/dist/c-TX7XJM3Z.min.js +0 -1
- package/dist/c-UC7SIU2W.min.js +0 -1
- package/dist/c-UMXSJIOV.min.js +0 -1
- package/dist/c-VRSXMLYF.min.js +0 -1
- package/dist/c-VSLWSAN2.min.js +0 -1
- package/dist/c-VXLOLYTO.min.js +0 -1
- package/dist/c-W4ZUKSEQ.min.js +0 -1
- package/dist/c-WCBRPILW.min.js +0 -1
- package/dist/c-WGHT7OCY.min.js +0 -1
- package/dist/c-WWCW3APR.min.js +0 -1
- package/dist/c-XSB27XPS.min.js +0 -1
- package/dist/c-Y6PYUMFU.min.js +0 -1
- package/dist/c-YDECTEUW.min.js +0 -1
- package/dist/c-YF3YKVQI.min.js +0 -1
- package/dist/c-YLZIV3VS.min.js +0 -1
- package/dist/c-ZIVPFTOC.min.js +0 -1
package/dist/geo.module.min.js
CHANGED
|
@@ -1,2 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
function e(e){return"default"in e?e.default:e}async function t(t){let i=Be.get(t);if(i)return i;let{topology:o,objectName:r}=await async function(t){try{switch(t){case"world-110m":return{topology:e(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:e(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:e(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:e(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw Error(`Unknown reference geography: "${t}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(e){throw/Cannot find module|Failed to resolve|world-atlas/i.test(e instanceof Error?e.message:e+"")?Error(`resolveReferenceGeography("${t}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:e}):e}}(t);if(!o||!o.objects)throw Error(`resolveReferenceGeography("${t}"): Failed to load topology. Got ${typeof o} with keys: ${o?Object.keys(o).join(", "):"none"}`);let n=Te(o,o.objects[r]),a="features"in n?n.features:[n];return Be.set(t,a),a}function i(e){let i=De(()=>Array.isArray(e)?e:void 0,[e]),[o,r]=We(null);return Oe(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(i=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(i)){let i=!1;return r(null),t(e).then(e=>{i||r(e)}),()=>{i=!0}}var i;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),r(null)}else r(null)},[e]),void 0!==i?i:o}function o(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function r(e){let t=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=ve(),{areas:n,valueAccessor:a,styleRules:l,colorScheme:s,projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:f,tileURL:g,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:k,legendInteraction:w,legendPosition:S,margin:M,className:A,selection:C,linkedHover:R,onObservation:N,onClick:j,chartId:F,loading:P,loadingContent:H,emptyContent:L,frameProps:I={},stroke:z,strokeWidth:W,opacity:O}=e,D=m??!!g,T=i(n),E=Ie(()=>T&&ee(T),[T]),G=Ie(()=>"function"==typeof a?a:e=>e?.properties?.[a]??e?.[a],[a]),K=s??r??"blues",q=Ie(()=>{if(!E)return ze(Me(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(let i of E){let o=G(i);null==o||!isFinite(o)||(e>o&&(e=o),o>t&&(t=o))}let i=Me(K);return ze(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[E,G,K]),V=Ie(()=>{let e=q.domain();return[e[0]??0,e[1]??1]},[q]),Y=ye(w,G,V),{activeSelectionHook:Q,hoverSelectionHook:te,customHoverBehavior:ie,customClickBehavior:oe}=ge({selection:C,linkedHover:R,onObservation:N,onClick:j,chartType:"ChoroplethMap",chartId:F,mobileInteraction:t.mobileInteraction}),re=U(C),ne=te||Y.legendSelectionHook||Q,ue=Ie(()=>{let e=X(e=>{let t=G(e);return{fill:null!=t&&isFinite(t)?q(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},l,e=>({value:G(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=Z(e,{stroke:z,strokeWidth:W,opacity:O});return ne?ke(t,ne,re,o):t},[G,q,ne,re,x,z,W,O,l]),de=Ie(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=G(e);return Ge("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ee("div",{style:{fontWeight:600},children:t}),null!=i&&Ee("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):(o??"")+"")})]});var o},[G]),me=ce(t),he=Ie(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>q(e),domain:V,label:"string"==typeof a?a:"value"}},[q,t.showLegend,a,V]),{legend:be,margin:xe,legendPosition:we,legendMarginReserved:Se}=pe({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:S,userMargin:M,defaults:me,additionalLegend:he,chartWidth:t.width,chartHeight:t.height,legendLayout:I.legendLayout,frameLegend:I,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),Ae=se(P,t.width,t.height,H)||(E?null:se(!0,t.width,t.height,H)),Ce=Ae?null:le(E,t.width,t.height,L);if(Array.isArray(E)&&E.length>0){let e=E[0];if(!e||"object"!=typeof e||!e.geometry)return Ee(_,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let Re={projection:c,areas:E,areaStyle:ue,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:xe,enableHover:t.enableHover,...be&&{legend:be,legendPosition:we},...Se&&{__legendMarginReservedFor:be},legendHoverBehavior:Y.onLegendHover,legendClickBehavior:Y.onLegendClick,legendHighlightedCategory:Y.highlightedCategory,legendIsolatedCategories:"isolate"===w?Y.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?de:ae(v)||de,...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...D&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=f&&{dragRotate:f},...g&&{tileURL:g},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...$({linkedHover:R,selection:C,onObservation:N,onClick:j,mobileInteraction:t.mobileInteraction,customHoverBehavior:ie,customClickBehavior:oe,linkedHoverInClickPredicate:!1}),...k&&k.length>0&&{annotations:k},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...A&&{className:A},...null!=e.animate&&{animate:e.animate},...I};return Ae||Ce||Ee(J,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:Ee(B,{...Re})})}function n(e,t,i){let[o,r]=i;if(!t)return o;let[n,a]=t,l=a>n?a-n:0,s=Number(e),c=Number.isFinite(s)?s:n;return o+Math.max(0,Math.min(1,l>0?(c-n)/l:0))*(r-o)}function a({bottomMargin:e,costLabel:t,layout:{cx:i,cy:o,maxCost:r,availableRadius:n,layout:a},ringStyle:l,ringValues:s,showNorth:c,showRingLabels:u,showRings:d}){let m="strip"===a,h={stroke:m?"var(--semiotic-border, #999)":"#999",strokeWidth:m?1:.8,strokeDasharray:m?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:m?8:10,...l};return pt("g",m?{children:[ht("line",{x1:i,y1:o,x2:i+n,y2:o,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),ht("line",{x1:i,y1:o-3.5,x2:i,y2:o+3.5,stroke:h.stroke,strokeWidth:h.strokeWidth,opacity:.9}),d&&s.map(a=>{let l=i+(r>0?a/r*n:0);return pt("g",{children:[ht("line",{x1:l,y1:o-2.5,x2:l,y2:o+2.5,stroke:h.stroke,strokeWidth:.9,opacity:.65}),u&&pt("text",{x:l,y:o+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?" "+t:""]})]},a)})]}:{children:[s.map(e=>{let a=e/r*n;return pt("g",{children:[ht("circle",{cx:i,cy:o,r:a,fill:"none",stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray,opacity:.5}),u&&pt("text",{x:i+a+3,y:o-2,fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?" "+t:""]})]},e)}),c&&pt("g",{transform:"translate(24, 24)",children:[ht("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),ht("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),ht("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),ht("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),ht("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),ht("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function l(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function s(e,t,i){return Math.max(t,Math.min(i,e))}function c(e){let t=1/0,i=-1/0;for(let o of e)Number.isFinite(o)&&(t>o&&(t=o),o>i&&(i=o));return t===1/0?[0,0]:[t,i]}function u(e,t){let i=t[1]-t[0];return 0===i?.5:(e-t[0])/i}function d(e,t={}){let i=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===i.length)return[];let o=s(Number.isFinite(t.occupancy)?Number(t.occupancy):.72,.2,1),r=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):1.8,n=l(t.columns)??Math.max(1,Math.ceil(Math.sqrt(i.length*r/o))),a=l(t.rows)??Math.max(1,Math.ceil(i.length/(n*o)));i.length>n*a&&(null!=t.columns&&null==t.rows?a=Math.ceil(i.length/n):null!=t.rows&&null==t.columns?n=Math.ceil(i.length/a):a=Math.ceil(i.length/n));let d=c(i.map(e=>e.x)),m=c(i.map(e=>e.y)),h=i.map(e=>({...e,desiredColumn:u(e.x,d)*Math.max(0,n-1),desiredRow:u(e.y,m)*Math.max(0,a-1)})),p=(n-1)/2,f=(a-1)/2;h.sort((e,t)=>(t.desiredColumn-p)**2+(t.desiredRow-f)**2-((e.desiredColumn-p)**2+(e.desiredRow-f)**2)||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index);let g=new Set;for(let e=0;a>e;e+=1)for(let t=0;n>t;t+=1)g.add(e*n+t);let y=[];for(let e of h){let t=-1,i=1/0;for(let o of g){let r=(o%n-e.desiredColumn)**2+(Math.floor(o/n)-e.desiredRow)**2;(i>r||r===i&&t>o)&&(t=o,i=r)}0>t||(g.delete(t),y.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/n),column:t%n,index:e.index}))}return y.sort((e,t)=>e.index-t.index),y.map(({index:e,...t})=>t)}function m(e,t,i=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(let t of i)if(null!=e[t])return e[t]}function h(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function p(e,t,i){let o=[];for(let r=0;6>r;r+=1){let n=-Math.PI/2+r*(Math.PI/3);o.push([e+Math.cos(n)*i,t+Math.sin(n)*i])}return h(o)}function f({marks:e,color:t,fontSize:i,fontFamily:o,fontWeight:r}){let n=K();return vt("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{let a=!n.isActive||n.predicate(e.datum);return vt("text",{x:e.x,y:e.y,fill:t,fontFamily:o,fontSize:i,fontWeight:r,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function g(e,t,i){return Math.max(t,Math.min(i,e))}function y(e){if(Number.isFinite(e)&&Number(e)>0)return Number(e)}function b(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function v(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function x(e,t){let i=v(e);return(e.id??i.id??i.name??"feature-"+t)+""}function k(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function w(e){if(!e)return 0;let t=Ct.get(e);if(t)return t;let i=Rt;return Rt+=1,Ct.set(e,i),i}function S(e,t){return!t||!(t[0][1]>e[1]||e[1]>t[1][1]||(i=e[0],o=t[0][0],r=t[1][0],o>r?o>i&&i>r:o>i||i>r));var i,o,r}function M(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&S(t,i.bounds))try{if(wt(e,t))return{feature:e,index:o}}catch{}}return null}function A(e,t,i,o={}){let r=e.filter((e,t)=>e.geometry&&(!o.featureFilter||o.featureFilter(e,t))),n=function(e,t){if(0===e.length)return null;let i=t.bounds({type:"FeatureCollection",features:e});return Number.isFinite(i[0][0])&&Number.isFinite(i[0][1])&&Number.isFinite(i[1][0])&&Number.isFinite(i[1][1])?i:null}(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[g(n[0][0],a,Math.max(a,i.width-a)),g(n[0][1],a,Math.max(a,i.height-a))],[g(n[1][0],a,Math.max(a,i.width-a)),g(n[1][1],a,Math.max(a,i.height-a))]],s=Math.max(0,l[1][0]-l[0][0]),c=Math.max(0,l[1][1]-l[0][1]);if(0===s||0===c)return{dots:[],cellSize:10,features:r};let u=y(o.columns),d=Math.max(2,u?s/u:y(o.cellSize)??10),m=Math.max(100,Math.round(y(o.maxSamples)??25e3)),h=Math.ceil(s/d)*Math.ceil(c/d);h>m&&(d*=Math.sqrt(h/m));let p=o.gridOrigin?.[0]??0,f=o.gridOrigin?.[1]??0,[b,w]=k(l[0][0],l[1][0],p,d),[S,A]=k(l[0][1],l[1][1],f,d),C=[],R=function(e){return e.map((e,t)=>{if(At.has(e))return{feature:e,index:t,bounds:At.get(e)??null};try{let i=kt(e);return At.set(e,i),{feature:e,index:t,bounds:i}}catch{return At.set(e,null),{feature:e,index:t,bounds:null}}})}(r);for(let e=S;A>=e;e+=1){let i=f+(e+.5)*d;for(let r=b;w>=r;r+=1){let n=t.invertedPoint(p+(r+.5)*d,i);if(!n||!Number.isFinite(n[0])||!Number.isFinite(n[1]))continue;let a=M(R,n);if(!a)continue;let l={...v(a.feature),featureId:x(a.feature,a.index),featureIndex:a.index,gridRow:e,gridColumn:r,longitude:n[0],latitude:n[1],dotIndex:C.length};o.dotFilter&&!o.dotFilter(l,C.length)||C.push(l)}}return{dots:C,cellSize:d,features:r}}function C(e){return Math.round(1e4*e)/1e4}function R(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${C(Number(e[0]))},${C(Number(e[1]))}`:"null"}function N(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function j(e){return"number"==typeof e&&Number.isFinite(e)?C(e)+"":null===e?"null":"unavailable"}function F(e){let t=e.scales.projection;return[j(N(t,"scale")),R(N(t,"translate")),R(N(t,"center")),(i=N(t,"rotate"),Array.isArray(i)&&i.every(Number.isFinite)?i.map(e=>C(Number(e))).join(","):"unavailable"),j(N(t,"clipAngle")),j(N(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>R(e.scales.projectedPoint(t,i)))].join("|");var i}function P(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function H(e,t,i){return P([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function L(e,t,i){return P(Array.from({length:6},(o,r)=>{let n=-Math.PI/2+r*(Math.PI/3);return[e+Math.cos(n)*i,t+Math.sin(n)*i]}))}function I(e,t,i){let{featureKey:o,dataKey:r}=i,n=new Map;for(let e of t){let t=(Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0)+"";n.set(t,e)}return e.map(e=>{let t=(e=>{let t=o.split("."),i=e;for(let e of t)i=null!==i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;return(i??"")+""})(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}import{DEFAULT_HIT_RADIUS as z,geoAreaHitTarget as W,geoHitTarget as O,hitTargetPoint as D}from"./c-HLLFJYTY.min.js";import{GeoCustomChart as T,StreamGeoFrame_default as B}from"./c-L6WNDBHV.min.js";import"./c-TX7XJM3Z.min.js";import{useChartSetup as E,useFrameImperativeHandle as G,useResolvedSelection as U}from"./c-RFC7UAG7.min.js";import"./c-ORLEBW72.min.js";import"./c-R2P4RR7Q.min.js";import"./c-N3FXLRNT.min.js";import"./c-TKG2NP7G.min.js";import"./c-MOKJOIPE.min.js";import"./c-V4XMSLC3.min.js";import"./c-KKPMHAZC.min.js";import{buildCustomBehaviorProps as $,mergeShapeStyle as Z}from"./c-SGAURYHG.min.js";import{useCustomLayoutSelection as K}from"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-EUBTECGM.min.js";import{ChartError as _,EMPTY_ARRAY as q,MultiLineTooltip as V,SafeRender as J,Tooltip as Y,TooltipRoot as Q,composeStyleRules as X,filterSparseArray as ee,makeNodeRuleContext as te,makeRuleValueResolver as ie,markTooltipChrome as oe,matchesThreshold as re,normalizeLinkedHover as ne,normalizeTooltip as ae,renderEmptyState as le,renderLoadingState as se,resolveAxisFreeMarginDefaults as ce,resolveResponsiveRules as ue,resolveStyleRules as de,responsiveRuleMatches as me,ruleMatches as he,useChartLegendAndMargin as pe,useChartMode as fe,useChartSelection as ge,useGradientLegendInteraction as ye,useLinkedHover as be,useThemeSequential as ve,warnMissingField as xe,wrapStyleWithSelection as ke}from"./c-ODG6TFSY.min.js";import{DEFAULT_COLOR as we,getColor as Se,getSequentialInterpolator as Me,getSize as Ae}from"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import{useObservationSelector as Ce}from"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import{getMinMax as Re}from"./c-QA3HMQJP.min.js";import{glyphExtent as Ne,glyphPlacement as je,hatchFillId as Fe,hatchPatternDef as Pe,isHatchFill as He,resolveSvgFill as Le}from"./c-MB6CV5NC.min.js";import{useMemo as Ie}from"react";import{scaleSequential as ze}from"d3-scale";import{useState as We,useEffect as Oe,useMemo as De}from"react";import{feature as Te}from"topojson-client";var Be=new Map;import{jsx as Ee,jsxs as Ge}from"react/jsx-runtime";r.displayName="ChoroplethMap";import{useMemo as Ue,useRef as $e,forwardRef as Ze}from"react";var Ke={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5};import{jsx as _e,jsxs as qe}from"react/jsx-runtime";var Ve=[3,30],Je=[1,4],Ye=Ze(function(e,t){let o=$e(null);G(t,{variant:"geo-points",frameRef:o});let r=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:n,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,areas:S,areaStyle:M=Ke,tooltip:A,annotations:C,margin:R,className:N,selection:j,linkedHover:F,onObservation:P,onClick:H,chartId:L,loading:I,loadingContent:z,emptyContent:W,legendInteraction:O,legendPosition:D,frameProps:T={},stroke:U,strokeWidth:K,opacity:_}=e,V=c??("sparkline"===r.mode?Je:Ve),Y="sparkline"===r.mode?1.5:6,Q=g??!!x,ee=i(S),ie=E({data:n??q,rawData:n,colorBy:u,colorScheme:m,legendInteraction:O,legendPosition:D,frameLegend:T,selection:j,linkedHover:F,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:P,onClick:H,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:L,showLegend:r.showLegend,userMargin:R,marginDefaults:ce(r),loading:I,loadingContent:z,emptyContent:W,width:r.width,height:r.height,hasTitle:!!r.title}),oe=ie.data,re=Ue(()=>{if(!s)return;let e="function"==typeof s?s:e=>e?.[s],t=oe.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?Re(t):void 0},[oe,s]),ne=Ue(()=>{let e=X(e=>({fill:u?Se(e,u,ie.colorScale):we,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Ae(e,s,V,re):Y}),d,te(u,s)),t=Z(e,{stroke:U,strokeWidth:K,opacity:_});return ie.effectiveSelectionHook?ke(t,ie.effectiveSelectionHook,ie.resolvedSelection):t},[u,ie.colorScale,ie.effectiveSelectionHook,ie.resolvedSelection,s,V,re,Y,U,K,_,d]),le=Ue(()=>e=>{let t=e?.name||e?.label||e?.NAME||e?.id,i="string"==typeof s?s:null,o=("function"==typeof s?s:e=>e[s])(e),r=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",n="string"==typeof u?u:null,a=n?e?.[n]:null;return qe("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&_e("div",{style:{fontWeight:600,marginBottom:2},children:t}),i&&null!=o&&qe("div",{children:[qe("span",{style:{opacity:.7},children:[i,": "]}),r(o)]}),n&&null!=a&&qe("div",{children:[qe("span",{style:{opacity:.7},children:[n,": "]}),a+""]}),!t&&!i&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>qe("div",{children:[qe("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(ie.earlyReturn)return ie.earlyReturn;xe("ProportionalSymbolMap",oe,"xAccessor",a),xe("ProportionalSymbolMap",oe,"yAccessor",l);let se={projection:h,...null!=n&&{points:oe},xAccessor:a,yAccessor:l,pointStyle:ne,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ee&&{areas:ee,areaStyle:M},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...Q&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[r.width,r.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ie.margin,enableHover:r.enableHover,tooltipContent:!1===A?()=>null:ae(A)||le,...ie.legendBehaviorProps,...$({linkedHover:F,selection:j,onObservation:P,onClick:H,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior,linkedHoverInClickPredicate:!1}),...C&&C.length>0&&{annotations:C},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...r.title&&{title:r.title},...r.description&&{description:r.description},...r.summary&&{summary:r.summary},...void 0!==r.accessibleTable&&{accessibleTable:r.accessibleTable},...N&&{className:N},...null!=e.animate&&{animate:e.animate},...T};return _e(J,{componentName:"ProportionalSymbolMap",width:r.width,height:r.height,children:_e(B,{ref:o,...se})})});Ye.displayName="ProportionalSymbolMap";import{useMemo as Qe,useCallback as Xe,useRef as et,forwardRef as tt}from"react";import{jsx as it,jsxs as ot}from"react/jsx-runtime";var rt="__semiotic_x",nt="__semiotic_y",at=tt(function(e,t){let o=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:r,nodes:a,nodeIdAccessor:l="id",xAccessor:s="lon",yAccessor:c="lat",valueAccessor:u="value",projection:d="equalEarth",graticule:m,fitPadding:h,zoomable:p,zoomExtent:f,onZoom:g,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:k="geo",flowStyle:w="basic",areas:S,areaStyle:M=Ke,edgeColorBy:A,edgeOpacity:C=.6,edgeWidthRange:R=[1,8],pointRadius:N,edgeLinecap:j="round",colorScheme:F,styleRules:P,showParticles:H,particleStyle:L,tooltip:I,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:U,onClick:K,chartId:_,loading:V,loadingContent:Y,emptyContent:Q,frameProps:te={},legendInteraction:oe,legendPosition:re,stroke:le,strokeWidth:se,opacity:ue,lineIdAccessor:de}=e,me=p??!!b,he=i(S),pe=Qe(()=>ee(a),[a]),ge=E({data:r??q,rawData:r,colorBy:A,colorScheme:F,legendInteraction:oe,legendPosition:re,frameLegend:te,selection:D,linkedHover:T,fallbackFields:A?["string"==typeof A?A:""]:[],unwrapData:!1,onObservation:U,onClick:K,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FlowMap",chartId:_,showLegend:o.showLegend,userMargin:W,marginDefaults:ce(o),loading:V,loadingContent:Y,emptyContent:Q,width:o.width,height:o.height,hasTitle:!!o.title}),ye=ge.data,ve=ne(T),xe=be({name:ve?.name||"hover",fields:ve?.fields||[]}),Me=Ce(e=>e.pushObservation),Ae=Qe(()=>{let e=new Map;for(let t of pe)e.set(t[l]+"",t);return e},[pe,l]),Ne=et(null),je=et(Ae);je.current=Ae;let Fe=et(s);Fe.current=s;let Pe=et(c);Pe.current=c;let He=Xe(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=je.current,i=t.get(e.source+""),o=t.get(e.target+"");if(!i||!o)return null;let r="function"==typeof Fe.current?Fe.current:e=>e[Fe.current],n="function"==typeof Pe.current?Pe.current:e=>e[Pe.current];return{...e,coordinates:[{[rt]:r(i),[nt]:n(i)},{[rt]:r(o),[nt]:n(o)}]}},[]);G(t,{variant:"geo-lines",frameRef:Ne,overrides:{push:e=>{let t=He(e);t&&Ne.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=He(i);e&&t.push(e)}t.length>0&&Ne.current?.pushManyLines(t)}}});let Le=Qe(()=>{let e=new Map;for(let t of ye)!t||"object"!=typeof t||(null!=t.source&&!e.has(t.source)&&e.set(t.source,t),null!=t.target&&!e.has(t.target)&&e.set(t.target,t));return e},[ye]),Ie=Xe(e=>{if(T)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=Le.get(t[l]+"");e&&xe.onHover(e)}else xe.onHover(t)}else xe.onHover(null);if(U||Me){let t={timestamp:Date.now(),chartType:"FlowMap",chartId:_};if(e){let i=e.data||e.datum||e;Array.isArray(i)&&(i=i[0]);let o={...t,type:"hover",datum:i||{},x:e.x??0,y:e.y??0};U&&U(o),Me&&Me(o)}else{let e={...t,type:"hover-end"};U&&U(e),Me&&Me(e)}}},[T,xe,l,Le,U,_,Me]),ze=ge.customClickBehavior,We=Qe(()=>{let e="function"==typeof s?s:e=>e[s],t="function"==typeof c?c:e=>e[c];return ye.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=Ae.get(i.source+""),r=Ae.get(i.target+"");return o&&r?{...i,coordinates:[{[rt]:e(o),[nt]:t(o)},{[rt]:e(r),[nt]:t(r)}]}:null}).filter(Boolean)},[ye,Ae,s,c]),Oe=Qe(()=>{let e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&rt in t?t[rt]:e(t)},[s]),De=Qe(()=>{let e="function"==typeof c?c:e=>e[c];return t=>null!=t&&"object"==typeof t&&nt in t?t[nt]:e(t)},[c]),Te=Qe(()=>{let e=ye.filter(e=>e&&"object"==typeof e).map(e=>Number(e[u]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return Re(e)},[ye,u]),Be=Qe(()=>function(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:a,edgeLinecap:l,styleRules:s}=e,c=ie(t);return X(e=>({stroke:r(e),strokeWidth:n(e[t],i,o),strokeLinecap:l,opacity:a,fillOpacity:0}),s,e=>({value:c(e)}))}({valueAccessor:u,valueDomain:Te,edgeWidthRange:R,resolveStroke:e=>A?Se(e,A,ge.colorScale):we,edgeOpacity:C,edgeLinecap:j,styleRules:P}),[u,Te,R,A,ge.colorScale,C,j,P]),Ee=Qe(()=>{let e=Z(Be,{stroke:le,strokeWidth:se,opacity:ue});if(!ge.effectiveSelectionHook)return e;let t={...ge.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return ke(e,ge.effectiveSelectionHook,{...ge.resolvedSelection||{},unselectedStyle:t})},[Be,ge.effectiveSelectionHook,ge.resolvedSelection,le,se,ue]),Ge=N??("sparkline"===o.mode?1.5:5),Ue=Qe(()=>Z(()=>({fill:"#333",r:Ge,fillOpacity:.8}),{stroke:le,strokeWidth:se,opacity:ue}),[Ge,le,se,ue]),$e=Qe(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)return it("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:it("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){let t=e[u];return ot("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[ot("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&it("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[l];return null!=t?it("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:it("div",{style:{fontWeight:600},children:t})}):null},[u,l]);if(ge.earlyReturn)return ge.earlyReturn;let Ze={projection:d,...null!=r&&{lines:We},points:pe,xAccessor:Oe,yAccessor:De,lineDataAccessor:"coordinates",...null!=de&&{lineIdAccessor:de},lineType:k,flowStyle:w,lineStyle:Ee,pointStyle:Ue,...he&&{areas:he,areaStyle:M},...null!=m&&{graticule:m},...null!=h&&{fitPadding:h},...me&&{zoomable:!0},...f&&{zoomExtent:f},...g&&{onZoom:g},...null!=y&&{dragRotate:y},...H&&{showParticles:H},...L&&{particleStyle:L},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ge.margin,enableHover:o.enableHover,tooltipContent:!1===I?()=>null:ae(I)||$e,...ge.legendBehaviorProps,...$({linkedHover:T,selection:D,onObservation:U,onClick:K,mobileInteraction:ge.mobileInteraction,customHoverBehavior:Ie,customClickBehavior:ze,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...O&&{className:O},...null!=e.animate&&{animate:e.animate},...te};return it(J,{componentName:"FlowMap",width:o.width,height:o.height,children:it(B,{ref:Ne,...Ze})})});at.displayName="FlowMap";import{useMemo as lt,useRef as st,useState as ct,useEffect as ut,useCallback as dt,forwardRef as mt}from"react";import{jsx as ht,jsxs as pt}from"react/jsx-runtime";import{Fragment as ft,jsx as gt,jsxs as yt}from"react/jsx-runtime";var bt=mt(function(e,t){let i=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:o,lines:r,xAccessor:n="lon",yAccessor:l="lat",nodeIdAccessor:s="id",center:c,costAccessor:u,strength:d=1,lineMode:m="straight",projection:h="mercator",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,transition:S,colorBy:M,styleRules:A,colorScheme:C,pointRadius:R,tooltip:N,showRings:j,showRingLabels:F,ringStyle:P,showNorth:H,costLabel:L,cartogramLayout:I,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:U,onClick:K,chartId:_,loading:q,loadingContent:V,emptyContent:Y,legendPosition:Q,frameProps:ie={},stroke:oe,strokeWidth:re,opacity:ne}=e,le="sparkline"===i.mode,se=I??(le?"strip":"radial"),ue=R??(le?1.5:5),de=j??!0,me=F??("strip"!==se&&!i.compactMode),he=H??("strip"!==se&&!le),pe=g??!!x,ge=lt(()=>ee(o),[o]),ye=E({data:ge,rawData:o,colorBy:M,colorScheme:C,legendInteraction:void 0,legendPosition:Q,frameLegend:ie,selection:D,linkedHover:T,fallbackFields:M?["string"==typeof M?M:""]:[],unwrapData:!1,onObservation:U,onClick:K,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DistanceCartogram",chartId:_,showLegend:i.showLegend,userMargin:W,marginDefaults:ce(i),loading:q,loadingContent:V,emptyContent:Y,width:i.width,height:i.height,hasTitle:!!i.title}),be=lt(()=>{let e=X(e=>{let t=e?.[s],i=null!=t&&t+""==c+"";return{fill:M?Se(e,M,ye.colorScale):we,fillOpacity:i?1:.8,stroke:i?"var(--semiotic-text, #222)":"#fff",strokeWidth:i?1.25:1,r:i?1.35*ue:ue}},A,te(M)),t=Z(e,{stroke:oe,strokeWidth:re,opacity:ne});return ye.effectiveSelectionHook?ke(t,ye.effectiveSelectionHook,ye.resolvedSelection):t},[M,ye.colorScale,ye.effectiveSelectionHook,ye.resolvedSelection,ue,oe,re,ne,A,c,s]),ve=lt(()=>({center:c,centerAccessor:s,costAccessor:u,strength:d,lineMode:m,layout:se}),[c,s,u,d,m,se]),Me=lt(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof l?l:e=>e[l],i=new Map;for(let e of ge)i.set(e[s]+"",e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(o.source+""),a=i.get(o.target+"");return r&&a?{...o,coordinates:[{[n]:e(r),[l]:t(r)},{[n]:e(a),[l]:t(a)}]}:null}).filter(Boolean)},[r,ge,n,l,s]),Ae=lt(()=>e=>{let t=("function"==typeof u?u:e=>e[u])(e);return yt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[gt("div",{style:{fontWeight:600},children:e[s]||e.name||e.id||"Point"}),null!=t&&yt("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[u,s]),Ce=st(null);G(t,{variant:"geo-points",frameRef:Ce});let[Re,Ne]=ct(null),je=dt(()=>{let e=Ce.current?.getCartogramLayout?.();e&&Ne(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius&&t.layout===(e.layout??"radial")?t:{cx:e.cx,cy:e.cy,maxCost:e.maxCost,availableRadius:e.availableRadius,layout:e.layout??"radial"})},[]);ut(()=>{let e=requestAnimationFrame(je);return()=>cancelAnimationFrame(e)},[je,d,c,i.width,i.height,ge,se]);let Fe=lt(()=>{if(!de||!Re)return[];let{maxCost:e}=Re;if(0>=e)return[];if(Array.isArray(de))return de.filter(t=>t>0&&e>=t);let t="number"==typeof de?de:Math.min("strip"===Re.layout?3:5,Math.max(2,Math.ceil(e/5))),i=e/t,o=[];for(let e=1;t>=e;e++)o.push(Math.round(i*e*10)/10);return o},[de,Re]),Pe=lt(()=>{if(!Re)return ie.foregroundGraphics||null;let e=gt(a,{bottomMargin:ye.margin.bottom,costLabel:L,layout:Re,ringStyle:P,ringValues:Fe,showNorth:he,showRingLabels:me,showRings:de}),t=ie.foregroundGraphics;return"function"==typeof t?i=>yt(ft,{children:[e,t(i)]}):yt(ft,{children:[e,t]})},[Re,Fe,de,me,he,L,P,ye.margin.bottom,ie.foregroundGraphics]);if(ye.earlyReturn)return ye.earlyReturn;xe("DistanceCartogram",ge,"xAccessor",n),xe("DistanceCartogram",ge,"yAccessor",l);let He={projection:h,...null!=o&&{points:ge},...Me&&{lines:Me,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:l,pointIdAccessor:s,pointStyle:be,projectionTransform:ve,...S&&{transition:{duration:S}},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...pe&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ye.margin,enableHover:i.enableHover,tooltipContent:!1===N?()=>null:ae(N)||Ae,...ye.legendBehaviorProps,...$({linkedHover:T,selection:D,onObservation:U,onClick:K,mobileInteraction:ye.mobileInteraction,customHoverBehavior:ye.customHoverBehavior,customClickBehavior:ye.customClickBehavior,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...O&&{className:O},...null!=e.animate&&{animate:e.animate},...ie,foregroundGraphics:Pe};return gt(J,{componentName:"DistanceCartogram",width:i.width,height:i.height,children:gt(B,{ref:Ce,...He})})});bt.displayName="DistanceCartogram";import{jsx as vt}from"react/jsx-runtime";var xt=e=>{let t=e.config,i=t.source??"auto",o="areas"===i||"auto"===i&&e.areas.length>0,r=(o?function(e){return e.areas.map((t,i)=>{let o=function(e,t){let i=e.properties&&"object"==typeof e.properties?e.properties:{},o=e.id??i.id??i.name??"area-"+t;return{...i,id:o+""}}(t,i),r=e.scales.geoPath.centroid(t),n=Number.isFinite(r[0])&&Number.isFinite(r[1])?e.scales.invertedPoint(r[0],r[1]):null;return{datum:{...o,gridLongitude:n?.[0],gridLatitude:n?.[1]},x:r[0],y:r[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,i)=>!t.filter||t.filter(e.datum,i)),n=function(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;let i=e.map(e=>({datum:e,x:Number(m(e,t.columnAccessor)),y:Number(m(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return i.length!==e.length?null:i.map(e=>({...e,row:e.y,column:e.x}))}(r.map(e=>e.datum),t),a=o?r:function(e){return e.points.map(t=>{let i=Number(m(t,e.config.longitudeAccessor,["lon","longitude"])),o=Number(m(t,e.config.latitudeAccessor,["lat","latitude"])),r=Number.isFinite(i)&&Number.isFinite(o)?e.scales.projectedPoint(i,o):null;return{datum:t,x:r?.[0]??NaN,y:r?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}({...e,points:r.map(e=>e.datum)}),l=n??d(a,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===l.length)return{nodes:[]};let g=c(l.map(e=>e.row)),y=c(l.map(e=>e.column)),b=Math.max(1,Math.round(g[1]-g[0])+1),v=Math.max(1,Math.round(y[1]-y[0])+1),x=Math.max(0,t.layoutPadding??8),k=Math.max(1,e.dimensions.width-2*x)/v,w=Math.max(1,e.dimensions.height-2*x)/b,S=(e.dimensions.width-k*v)/2,M=(e.dimensions.height-w*b)/2,A=s(t.cellPadding??.12,0,.8),C=Math.max(1,.5*Math.min(k,w)*(1-A)),R=t.sizeAccessor?l.map(e=>Number(m(e.datum,t.sizeAccessor))):[],N=t.sizeDomain??c(R),j=t.sizeRange??[.36,1],F=s(Math.min(j[0],j[1]),.05,1),P=s(Math.max(j[0],j[1]),F,1),H=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=(m(r,t.idAccessor,["id","key","name"])??"grid-"+o)+"",a=(m(r,t.labelAccessor,["abbr","code","label","name","id"])??n)+"",l=Math.max(1,t.maxLabelLength??4),c=a.length>l?a.slice(0,l):a,d=m(r,t.categoryAccessor),h=null==d?void 0:d+"",p=m(r,t.fillAccessor),f=null!=p?p+"":h?e.resolveColor(h):e.theme.categorical[0]??"#4f86c6",b=t.sizeAccessor?Number(m(r,t.sizeAccessor)):NaN,v=t.sizeAccessor&&Number.isFinite(b)?Math.sqrt(s(u(b,N),0,1)):1,x=C*(F+v*(P-F)),A="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:c,category:h,row:i.row,column:i.column,x:S+(i.column-y[0]+.5)*k,y:M+(i.row-g[0]+.5)*w,radius:x,style:{fill:f,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...A}}}),L=t.shape??"circle";return{nodes:H.map(e=>{return"circle"===L?{type:"point",x:e.x,y:e.y,r:e.radius,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},pointId:e.id,_transitionKey:e.id}:{type:"geoarea",pathData:"hexagon"===L?p(e.x,e.y,e.radius):(t=e.x,i=e.y,o=e.radius,h([[t-o,i-o],[t+o,i-o],[t+o,i+o],[t-o,i+o]])),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===L?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0};var t,i,o}),overlays:!1===t.showLabels?null:vt(f,{marks:H,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??s(.23*Math.min(k,w),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}};import{geoBounds as kt,geoContains as wt}from"d3-geo";import{jsx as St}from"react/jsx-runtime";var Mt=new WeakMap,At=new WeakMap,Ct=new WeakMap,Rt=1,Nt=e=>{let t=function(e){let t=Mt.get(e.areas);t||(t=new Map,Mt.set(e.areas,t));let i=function(e){let t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",w(t.featureFilter),w(t.dotFilter),F(e)].join("::")}(e),o=t.get(i);if(o)return o;let r=A(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){let e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(i,r),r}(e),i=e.config,o=i.shape??"circle",r=Math.max(.5,y(i.dotRadius)??t.cellSize*g(i.radiusRatio??.24,.05,.5)),n=i.gridOrigin?.[0]??0,a=i.gridOrigin?.[1]??0;return{nodes:t.dots.map((l,s)=>{let c=n+(l.gridColumn+.5)*t.cellSize,u=a+(l.gridRow+.5)*t.cellSize,d=b(l,i.categoryAccessor),m=b(l,i.fillAccessor),h={fill:null!=m?m+"":null!=d?e.resolveColor(d+""):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof i.markStyle?i.markStyle(l,s):i.markStyle},p=`dot-${l.gridRow}-${l.gridColumn}`;return"circle"===o?{type:"point",x:c,y:u,r:r,style:h,datum:l,interactive:!1,pointId:p,_transitionKey:p}:{type:"geoarea",pathData:"hexagon"===o?L(c,u,r):H(c,u,r),centroid:[c,u],bounds:[[c-r,u-r],[c+r,u+r]],screenArea:"hexagon"===o?3*Math.sqrt(3)*r*r/2:(2*r)**2,style:h,datum:l,group:l.featureId,interactive:!1}}),overlays:i.showOutline?St("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?St("path",{d:r,fill:"none",stroke:i.outlineStyle?.stroke??"currentColor",strokeOpacity:i.outlineStyle?.opacity??i.outlineStyle?.fillOpacity??.22,strokeWidth:i.outlineStyle?.strokeWidth??.7,strokeDasharray:i.outlineStyle?.strokeDasharray,strokeLinecap:i.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},x(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{r as ChoroplethMap,z as DEFAULT_HIT_RADIUS,bt as DistanceCartogram,at as FlowMap,T as GeoCustomChart,V as MultiLineTooltip,Ye as ProportionalSymbolMap,B as StreamGeoFrame,Y as Tooltip,Q as TooltipRoot,X as composeStyleRules,W as geoAreaHitTarget,O as geoHitTarget,Nt as geographicDotGridLayout,xt as geographicGridLayout,Ne as glyphExtent,je as glyphPlacement,d as gridifyGeographicPoints,Fe as hatchFillId,Pe as hatchPatternDef,D as hitTargetPoint,He as isHatchFill,te as makeNodeRuleContext,ie as makeRuleValueResolver,oe as markTooltipChrome,re as matchesThreshold,I as mergeData,t as resolveReferenceGeography,ue as resolveResponsiveRules,de as resolveStyleRules,Le as resolveSvgFill,me as responsiveRuleMatches,he as ruleMatches,A as sampleGeographicDotGrid};
|
|
2
|
+
function e(e){return"default"in e?e.default:e}async function t(t){try{switch(t){case"world-110m":return{topology:e(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:e(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:e(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:e(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw Error(`Unknown reference geography: "${t}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(e){throw/Cannot find module|Failed to resolve|world-atlas/i.test(e instanceof Error?e.message:e+"")?Error(`resolveReferenceGeography("${t}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:e}):e}}async function i(e){let i=et.get(e);if(i)return i;let{topology:o,objectName:r}=await t(e);if(!o||!o.objects)throw Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof o} with keys: ${o?Object.keys(o).join(", "):"none"}`);let n=Qe(o,o.objects[r]),a="features"in n?n.features:[n];return et.set(e,a),a}function o(e){return"string"==typeof e&&["world-110m","world-50m","land-110m","land-50m"].includes(e)}function r(e){let t=Ye(()=>Array.isArray(e)?e:void 0,[e]),[r,n]=Je(null);return Xe(()=>{if(e&&!Array.isArray(e)){if(o(e)){let t=!1;return n(null),i(e).then(e=>{t||n(e)}),()=>{t=!0}}"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),n(null)}else n(null)},[e]),void 0!==t?t:r}function n(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function a(e){let t=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ue(),{areas:o,valueAccessor:a,styleRules:l,colorScheme:s,projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:f,tileURL:g,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:k,legendInteraction:w,legendPosition:S,margin:M,className:A,selection:C,linkedHover:R,onObservation:N,onClick:F,chartId:j,loading:P,loadingContent:H,emptyContent:L,frameProps:I={},stroke:z,strokeWidth:W,opacity:D}=e,T=m??!!g,O=r(o),B=qe(()=>O&&Ae(O),[O]),E=qe(()=>"function"==typeof a?a:e=>e?.properties?.[a]??e?.[a],[a]),G=s??i??"blues",$=qe(()=>{if(!B)return Ke(We(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(let i of B){let o=E(i);null==o||!isFinite(o)||(e>o&&(e=o),o>t&&(t=o))}let i=We(G);return Ke(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[B,E,G]),Z=qe(()=>{let e=$.domain();return[e[0]??0,e[1]??1]},[$]),_=ce(w,E,Z),{activeSelectionHook:V,hoverSelectionHook:U,customHoverBehavior:q,customClickBehavior:K}=de({selection:C,linkedHover:R,onObservation:N,onClick:F,chartType:"ChoroplethMap",chartId:j,mobileInteraction:t.mobileInteraction}),J=te(C),X=U||_.legendSelectionHook||V,Y=qe(()=>{let e=xe(e=>{let t=E(e);return{fill:null!=t&&isFinite(t)?$(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},l,e=>({value:E(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=ne(e,{stroke:z,strokeWidth:W,opacity:D});return X?je(t,X,J,n):t},[E,$,X,J,x,z,W,D,l]),ee=qe(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=E(e);/* @__PURE__ */
|
|
3
|
+
return it("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
4
|
+
/* @__PURE__ */tt("div",{style:{fontWeight:600},children:t}),null!=i&&/* @__PURE__ */tt("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):(o??"")+"")})]});var o},[E]),ie=Ie(t),oe=qe(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>$(e),domain:Z,label:"string"==typeof a?a:"value"}},[$,t.showLegend,a,Z]),{legend:ae,margin:le,legendPosition:he,legendMarginReserved:pe}=se({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:S,userMargin:M,defaults:ie,additionalLegend:oe,chartWidth:t.width,chartHeight:t.height,legendLayout:I.legendLayout,frameLegend:I,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),fe=Re(P,t.width,t.height,H)||(B?null:Re(!0,t.width,t.height,H)),ge=fe?null:Ce(B,t.width,t.height,L);if(Array.isArray(B)&&B.length>0){let e=B[0];if(!e||"object"!=typeof e||!e.geometry)/* @__PURE__ */
|
|
5
|
+
return tt(we,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let ye={projection:c,areas:B,areaStyle:Y,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:le,enableHover:t.enableHover,...ae&&{legend:ae,legendPosition:he},...pe&&{__legendMarginReservedFor:ae},legendHoverBehavior:_.onLegendHover,legendClickBehavior:_.onLegendClick,legendHighlightedCategory:_.highlightedCategory,legendIsolatedCategories:"isolate"===w?_.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?ee:ke(v)||ee,...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...T&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=f&&{dragRotate:f},...g&&{tileURL:g},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...re({linkedHover:R,selection:C,onObservation:N,onClick:F,mobileInteraction:t.mobileInteraction,customHoverBehavior:q,customClickBehavior:K,linkedHoverInClickPredicate:!1}),...k&&k.length>0&&{annotations:k},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...A&&{className:A},...null!=e.animate&&{animate:e.animate},...I};return fe||ge||/* @__PURE__ */tt(Me,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:/* @__PURE__ */tt(Q,{...ye})})}function l(e,t,i){let[o,r]=i;if(!t)return o;let[n,a]=t,l=a>n?a-n:0,s=Number(e),c=Number.isFinite(s)?s:n;return o+Math.max(0,Math.min(1,l>0?(c-n)/l:0))*(r-o)}function s(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:n,edgeLinecap:a,styleRules:s}=e,c=he(t);return xe(e=>({stroke:r(e),strokeWidth:l(e[t],i,o),strokeLinecap:a,opacity:n,fillOpacity:0}),s,e=>({value:c(e)}))}function c({bottomMargin:e,costLabel:t,layout:{cx:i,cy:o,maxCost:r,availableRadius:n,layout:a},ringStyle:l,ringValues:s,showNorth:c,showRingLabels:u,showRings:d}){let m="strip"===a,h={stroke:m?"var(--semiotic-border, #999)":"#999",strokeWidth:m?1:.8,strokeDasharray:m?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:m?8:10,...l};/* @__PURE__ */
|
|
6
|
+
return Nt("g",m?{children:[
|
|
7
|
+
/* @__PURE__ */Rt("line",{x1:i,y1:o,x2:i+n,y2:o,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),
|
|
8
|
+
/* @__PURE__ */Rt("line",{x1:i,y1:o-3.5,x2:i,y2:o+3.5,stroke:h.stroke,strokeWidth:h.strokeWidth,opacity:.9}),d&&s.map(a=>{let l=i+(r>0?a/r*n:0);/* @__PURE__ */
|
|
9
|
+
return Nt("g",{children:[
|
|
10
|
+
/* @__PURE__ */Rt("line",{x1:l,y1:o-2.5,x2:l,y2:o+2.5,stroke:h.stroke,strokeWidth:.9,opacity:.65}),u&&/* @__PURE__ */Nt("text",{x:l,y:o+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?" "+t:""]})]},a)})]}:{children:[s.map(e=>{let a=e/r*n;/* @__PURE__ */
|
|
11
|
+
return Nt("g",{children:[
|
|
12
|
+
/* @__PURE__ */Rt("circle",{cx:i,cy:o,r:a,fill:"none",stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray,opacity:.5}),u&&/* @__PURE__ */Nt("text",{x:i+a+3,y:o-2,fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?" "+t:""]})]},e)}),c&&/* @__PURE__ */Nt("g",{transform:"translate(24, 24)",children:[
|
|
13
|
+
/* @__PURE__ */Rt("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),
|
|
14
|
+
/* @__PURE__ */Rt("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),
|
|
15
|
+
/* @__PURE__ */Rt("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),
|
|
16
|
+
/* @__PURE__ */Rt("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),
|
|
17
|
+
/* @__PURE__ */Rt("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),
|
|
18
|
+
/* @__PURE__ */Rt("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function u(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function d(e,t,i){return Math.max(t,Math.min(i,e))}function m(e){let t=1/0,i=-1/0;for(let o of e)Number.isFinite(o)&&(t>o&&(t=o),o>i&&(i=o));return t===1/0?[0,0]:[t,i]}function h(e,t){let i=t[1]-t[0];return 0===i?.5:(e-t[0])/i}function p(e,t={}){let i=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===i.length)return[];let o=d(Number.isFinite(t.occupancy)?Number(t.occupancy):.72,.2,1),r=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):1.8,n=u(t.columns)??Math.max(1,Math.ceil(Math.sqrt(i.length*r/o))),a=u(t.rows)??Math.max(1,Math.ceil(i.length/(n*o)));i.length>n*a&&(null!=t.columns&&null==t.rows?a=Math.ceil(i.length/n):null!=t.rows&&null==t.columns?n=Math.ceil(i.length/a):a=Math.ceil(i.length/n));let l=m(i.map(e=>e.x)),s=m(i.map(e=>e.y)),c=i.map(e=>({...e,desiredColumn:h(e.x,l)*Math.max(0,n-1),desiredRow:h(e.y,s)*Math.max(0,a-1)})),p=(n-1)/2,f=(a-1)/2;c.sort((e,t)=>(t.desiredColumn-p)**2+(t.desiredRow-f)**2-((e.desiredColumn-p)**2+(e.desiredRow-f)**2)||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index);let g=/* @__PURE__ */new Set;for(let e=0;a>e;e+=1)for(let t=0;n>t;t+=1)g.add(e*n+t);let y=[];for(let e of c){let t=-1,i=1/0;for(let o of g){let r=(o%n-e.desiredColumn)**2+(Math.floor(o/n)-e.desiredRow)**2;(i>r||r===i&&t>o)&&(t=o,i=r)}0>t||(g.delete(t),y.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/n),column:t%n,index:e.index}))}return y.sort((e,t)=>e.index-t.index),y.map(({index:e,...t})=>t)}function f(e,t,i=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(let t of i)if(null!=e[t])return e[t]}function g(e,t){let i=e.properties&&"object"==typeof e.properties?e.properties:{},o=e.id??i.id??i.name??"area-"+t;return{...i,id:o+""}}function y(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function b(e,t,i){return y([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function v(e,t,i){let o=[];for(let r=0;6>r;r+=1){let n=-Math.PI/2+r*(Math.PI/3);o.push([e+Math.cos(n)*i,t+Math.sin(n)*i])}return y(o)}function x(e){return e.areas.map((t,i)=>{let o=g(t,i),r=e.scales.geoPath.centroid(t),n=Number.isFinite(r[0])&&Number.isFinite(r[1])?e.scales.invertedPoint(r[0],r[1]):null;return{datum:{...o,gridLongitude:n?.[0],gridLatitude:n?.[1]},x:r[0],y:r[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function k(e){return e.points.map(t=>{let i=Number(f(t,e.config.longitudeAccessor,["lon","longitude"])),o=Number(f(t,e.config.latitudeAccessor,["lat","latitude"])),r=Number.isFinite(i)&&Number.isFinite(o)?e.scales.projectedPoint(i,o):null;return{datum:t,x:r?.[0]??NaN,y:r?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function w(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;let i=e.map(e=>({datum:e,x:Number(f(e,t.columnAccessor)),y:Number(f(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return i.length!==e.length?null:i.map(e=>({...e,row:e.y,column:e.x}))}function S({marks:e,color:t,fontSize:i,fontFamily:o,fontWeight:r}){let n=ae();/* @__PURE__ */
|
|
19
|
+
return Lt("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{let a=!n.isActive||n.predicate(e.datum);/* @__PURE__ */
|
|
20
|
+
return Lt("text",{x:e.x,y:e.y,fill:t,fontFamily:o,fontSize:i,fontWeight:r,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function M(e,t,i){return Math.max(t,Math.min(i,e))}function A(e){if(Number.isFinite(e)&&Number(e)>0)return Number(e)}function C(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function R(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function N(e,t){let i=R(e);return(e.id??i.id??i.name??"feature-"+t)+""}function F(e,t){if(0===e.length)return null;let i=t.bounds({type:"FeatureCollection",features:e});return Number.isFinite(i[0][0])&&Number.isFinite(i[0][1])&&Number.isFinite(i[1][0])&&Number.isFinite(i[1][1])?i:null}function j(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function P(e){if(!e)return 0;let t=Bt.get(e);if(t)return t;let i=Et;return Et+=1,Bt.set(e,i),i}function H(e){return e.map((e,t)=>{if(Ot.has(e))return{feature:e,index:t,bounds:Ot.get(e)??null};try{let i=zt(e);return Ot.set(e,i),{feature:e,index:t,bounds:i}}catch{return Ot.set(e,null),{feature:e,index:t,bounds:null}}})}function L(e,t,i){return t>i?e>=t||i>=e:e>=t&&i>=e}function I(e,t){return!t||e[1]>=t[0][1]&&t[1][1]>=e[1]&&L(e[0],t[0][0],t[1][0])}function z(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&I(t,i.bounds))try{if(Wt(e,t))return{feature:e,index:o}}catch{}}return null}function W(e,t,i,o={}){let r=e.filter((e,t)=>e.geometry&&(!o.featureFilter||o.featureFilter(e,t))),n=F(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[M(n[0][0],a,Math.max(a,i.width-a)),M(n[0][1],a,Math.max(a,i.height-a))],[M(n[1][0],a,Math.max(a,i.width-a)),M(n[1][1],a,Math.max(a,i.height-a))]],s=Math.max(0,l[1][0]-l[0][0]),c=Math.max(0,l[1][1]-l[0][1]);if(0===s||0===c)return{dots:[],cellSize:10,features:r};let u=A(o.columns),d=Math.max(2,u?s/u:A(o.cellSize)??10),m=Math.max(100,Math.round(A(o.maxSamples)??25e3)),h=Math.ceil(s/d)*Math.ceil(c/d);h>m&&(d*=Math.sqrt(h/m));let p=o.gridOrigin?.[0]??0,f=o.gridOrigin?.[1]??0,[g,y]=j(l[0][0],l[1][0],p,d),[b,v]=j(l[0][1],l[1][1],f,d),x=[],k=H(r);for(let e=b;v>=e;e+=1){let i=f+(e+.5)*d;for(let r=g;y>=r;r+=1){let n=t.invertedPoint(p+(r+.5)*d,i);if(!n||!Number.isFinite(n[0])||!Number.isFinite(n[1]))continue;let a=z(k,n);if(!a)continue;let l={...R(a.feature),featureId:N(a.feature,a.index),featureIndex:a.index,gridRow:e,gridColumn:r,longitude:n[0],latitude:n[1],dotIndex:x.length};o.dotFilter&&!o.dotFilter(l,x.length)||x.push(l)}}return{dots:x,cellSize:d,features:r}}function D(e){return Math.round(1e4*e)/1e4}function T(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${D(Number(e[0]))},${D(Number(e[1]))}`:"null"}function O(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function B(e){return"number"==typeof e&&Number.isFinite(e)?D(e)+"":null===e?"null":"unavailable"}function E(e){return Array.isArray(e)&&e.every(Number.isFinite)?e.map(e=>D(Number(e))).join(","):"unavailable"}function G(e){let t=e.scales.projection;return[B(O(t,"scale")),T(O(t,"translate")),T(O(t,"center")),E(O(t,"rotate")),B(O(t,"clipAngle")),B(O(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>T(e.scales.projectedPoint(t,i)))].join("|")}function $(e){let t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",P(t.featureFilter),P(t.dotFilter),G(e)].join("::")}function Z(e){let t=Tt.get(e.areas);t||(t=/* @__PURE__ */new Map,Tt.set(e.areas,t));let i=$(e),o=t.get(i);if(o)return o;let r=W(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){let e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(i,r),r}function _(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function V(e,t,i){return _([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function U(e,t,i){return _(Array.from({length:6},(o,r)=>{let n=-Math.PI/2+r*(Math.PI/3);return[e+Math.cos(n)*i,t+Math.sin(n)*i]}))}function q(e,t,i){let{featureKey:o,dataKey:r}=i,n=/* @__PURE__ */new Map;for(let e of t){let t=(Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0)+"";n.set(t,e)}let a=e=>{let t=o.split("."),i=e;for(let e of t)i=null!==i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;return(i??"")+""};return e.map(e=>{let t=a(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}import{a as K,b as J,c as X,d as Y}from"./c-GSCO3FWL.min.js";import{a as Q,b as ee}from"./c-4MD53L2J.min.js";import"./c-PQOZPM4G.min.js";import{a as te,b as ie,c as oe}from"./c-HQ27AHMC.min.js";import"./c-7FKPPCGN.min.js";import"./c-STHZWF3D.min.js";import"./c-VXIYF7V2.min.js";import"./c-NATWERHZ.min.js";import"./c-P5NXQWIM.min.js";import"./c-BYJJ7EMG.min.js";import"./c-3AGX252H.min.js";import{Y as re,_ as ne}from"./c-KGROWFT2.min.js";import"./c-V5KFJWQQ.min.js";import{b as ae}from"./c-CLLCX3PT.min.js";import"./c-N5WT7TXG.min.js";import{Aa as le,Bb as se,Db as ce,Fb as ue,Kb as de,Mb as me,Nb as he,Oa as pe,Pa as fe,Pb as ge,Qb as ye,Rb as be,Sb as ve,Tb as xe,Va as ke,_a as we,a as Se,ab as Me,b as Ae,bb as Ce,cb as Re,db as Ne,gb as Fe,jb as je,mb as Pe,pb as He,qb as Le,sb as Ie,za as ze}from"./c-G53AVC42.min.js";import{d as We,n as De,r as Te,u as Oe}from"./c-Y342FJ6K.min.js";import{d as Be,e as Ee,r as Ge,s as $e,t as Ze,u as _e}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import{j as Ve}from"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import{a as Ue}from"./c-3PFVJFBK.min.js";import{useMemo as qe}from"react";import{scaleSequential as Ke}from"d3-scale";import{useState as Je,useEffect as Xe,useMemo as Ye}from"react";import{feature as Qe}from"topojson-client";var et=/* @__PURE__ */new Map;import{jsx as tt,jsxs as it}from"react/jsx-runtime";a.displayName="ChoroplethMap";import{useMemo as ot,useRef as rt,forwardRef as nt}from"react";var at={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5};import{jsx as lt,jsxs as st}from"react/jsx-runtime";var ct=[3,30],ut=[1,4],dt=nt(function(e,t){let i=rt(null);oe(t,{variant:"geo-points",frameRef:i});let o=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:n,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,areas:S,areaStyle:M=at,tooltip:A,annotations:C,margin:R,className:N,selection:F,linkedHover:j,onObservation:P,onClick:H,chartId:L,loading:I,loadingContent:z,emptyContent:W,legendInteraction:D,legendPosition:T,frameProps:O={},stroke:B,strokeWidth:E,opacity:G}=e,$=c??("sparkline"===o.mode?ut:ct),Z="sparkline"===o.mode?1.5:6,_=g??!!x,V=r(S),U=ie({data:n??Se,rawData:n,colorBy:u,colorScheme:m,legendInteraction:D,legendPosition:T,frameLegend:O,selection:F,linkedHover:j,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:P,onClick:H,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:L,showLegend:o.showLegend,userMargin:R,marginDefaults:Ie(o),loading:I,loadingContent:z,emptyContent:W,width:o.width,height:o.height,hasTitle:!!o.title}),q=U.data,K=ot(()=>{if(!s)return;let e="function"==typeof s?s:e=>e?.[s],t=q.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?Ue(t):void 0},[q,s]),J=ot(()=>{let e=xe(e=>({fill:u?Te(e,u,U.colorScale):De,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Oe(e,s,$,K):Z}),d,ge(u,s)),t=ne(e,{stroke:B,strokeWidth:E,opacity:G});return U.effectiveSelectionHook?je(t,U.effectiveSelectionHook,U.resolvedSelection):t},[u,U.colorScale,U.effectiveSelectionHook,U.resolvedSelection,s,$,K,Z,B,E,G,d]),X=ot(()=>e=>{let t=e?.name||e?.label||e?.NAME||e?.id,i="string"==typeof s?s:null,o=("function"==typeof s?s:e=>e[s])(e),r=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",n="string"==typeof u?u:null,a=n?e?.[n]:null;/* @__PURE__ */
|
|
21
|
+
return st("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&/* @__PURE__ */lt("div",{style:{fontWeight:600,marginBottom:2},children:t}),i&&null!=o&&/* @__PURE__ */st("div",{children:[
|
|
22
|
+
/* @__PURE__ */st("span",{style:{opacity:.7},children:[i,": "]}),r(o)]}),n&&null!=a&&/* @__PURE__ */st("div",{children:[
|
|
23
|
+
/* @__PURE__ */st("span",{style:{opacity:.7},children:[n,": "]}),a+""]}),!t&&!i&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>/* @__PURE__ */st("div",{children:[
|
|
24
|
+
/* @__PURE__ */st("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(U.earlyReturn)return U.earlyReturn;Ne("ProportionalSymbolMap",q,"xAccessor",a),Ne("ProportionalSymbolMap",q,"yAccessor",l);let Y={projection:h,...null!=n&&{points:q},xAccessor:a,yAccessor:l,pointStyle:J,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...V&&{areas:V,areaStyle:M},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},..._&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:U.margin,enableHover:o.enableHover,tooltipContent:!1===A?()=>null:ke(A)||X,...U.legendBehaviorProps,...re({linkedHover:j,selection:F,onObservation:P,onClick:H,mobileInteraction:U.mobileInteraction,customHoverBehavior:U.customHoverBehavior,customClickBehavior:U.customClickBehavior,linkedHoverInClickPredicate:!1}),...C&&C.length>0&&{annotations:C},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...N&&{className:N},...null!=e.animate&&{animate:e.animate},...O};/* @__PURE__ */
|
|
25
|
+
return lt(Me,{componentName:"ProportionalSymbolMap",width:o.width,height:o.height,children:/* @__PURE__ */lt(Q,{ref:i,...Y})})});dt.displayName="ProportionalSymbolMap";import{useMemo as mt,useCallback as ht,useRef as pt,forwardRef as ft}from"react";import{jsx as gt,jsxs as yt}from"react/jsx-runtime";var bt="__semiotic_x",vt="__semiotic_y",xt=ft(function(e,t){let i=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:o,nodes:n,nodeIdAccessor:a="id",xAccessor:l="lon",yAccessor:c="lat",valueAccessor:u="value",projection:d="equalEarth",graticule:m,fitPadding:h,zoomable:p,zoomExtent:f,onZoom:g,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:k="geo",flowStyle:w="basic",areas:S,areaStyle:M=at,edgeColorBy:A,edgeOpacity:C=.6,edgeWidthRange:R=[1,8],pointRadius:N,edgeLinecap:F="round",colorScheme:j,styleRules:P,showParticles:H,particleStyle:L,tooltip:I,annotations:z,margin:W,className:D,selection:T,linkedHover:O,onObservation:B,onClick:E,chartId:G,loading:$,loadingContent:Z,emptyContent:_,frameProps:V={},legendInteraction:U,legendPosition:q,stroke:K,strokeWidth:J,opacity:X,lineIdAccessor:Y}=e,ee=p??!!b,te=r(S),ae=mt(()=>Ae(n),[n]),le=ie({data:o??Se,rawData:o,colorBy:A,colorScheme:j,legendInteraction:U,legendPosition:q,frameLegend:V,selection:T,linkedHover:O,fallbackFields:A?["string"==typeof A?A:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FlowMap",chartId:G,showLegend:i.showLegend,userMargin:W,marginDefaults:Ie(i),loading:$,loadingContent:Z,emptyContent:_,width:i.width,height:i.height,hasTitle:!!i.title}),se=le.data,ce=Fe(O),ue=Pe({name:ce?.name||"hover",fields:ce?.fields||[]}),de=Ve(e=>e.pushObservation),he=mt(()=>{let e=/* @__PURE__ */new Map;for(let t of ae)e.set(t[a]+"",t);return e},[ae,a]),pe=pt(null),fe=pt(he);fe.current=he;let ge=pt(l);ge.current=l;let ye=pt(c);ye.current=c;let be=ht(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=fe.current,i=t.get(e.source+""),o=t.get(e.target+"");if(!i||!o)return null;let r="function"==typeof ge.current?ge.current:e=>e[ge.current],n="function"==typeof ye.current?ye.current:e=>e[ye.current];return{...e,coordinates:[{[bt]:r(i),[vt]:n(i)},{[bt]:r(o),[vt]:n(o)}]}},[]);oe(t,{variant:"geo-lines",frameRef:pe,overrides:{push:e=>{let t=be(e);t&&pe.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=be(i);e&&t.push(e)}t.length>0&&pe.current?.pushManyLines(t)}}});let ve=mt(()=>{let e=/* @__PURE__ */new Map;for(let t of se)!t||"object"!=typeof t||(null!=t.source&&!e.has(t.source)&&e.set(t.source,t),null!=t.target&&!e.has(t.target)&&e.set(t.target,t));return e},[se]),xe=ht(e=>{if(O)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=ve.get(t[a]+"");e&&ue.onHover(e)}else ue.onHover(t)}else ue.onHover(null);if(B||de){let t={timestamp:Date.now(),chartType:"FlowMap",chartId:G};if(e){let i=e.data||e.datum||e;Array.isArray(i)&&(i=i[0]);let o={...t,type:"hover",datum:i||{},x:e.x??0,y:e.y??0};B&&B(o),de&&de(o)}else{let e={...t,type:"hover-end"};B&&B(e),de&&de(e)}}},[O,ue,a,ve,B,G,de]),we=le.customClickBehavior,Ce=mt(()=>{let e="function"==typeof l?l:e=>e[l],t="function"==typeof c?c:e=>e[c];return se.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=he.get(i.source+""),r=he.get(i.target+"");return o&&r?{...i,coordinates:[{[bt]:e(o),[vt]:t(o)},{[bt]:e(r),[vt]:t(r)}]}:null}).filter(Boolean)},[se,he,l,c]),Re=mt(()=>{let e="function"==typeof l?l:e=>e[l];return t=>null!=t&&"object"==typeof t&&bt in t?t[bt]:e(t)},[l]),Ne=mt(()=>{let e="function"==typeof c?c:e=>e[c];return t=>null!=t&&"object"==typeof t&&vt in t?t[vt]:e(t)},[c]),He=mt(()=>{let e=se.filter(e=>e&&"object"==typeof e).map(e=>Number(e[u]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return Ue(e)},[se,u]),Le=mt(()=>s({valueAccessor:u,valueDomain:He,edgeWidthRange:R,resolveStroke:e=>A?Te(e,A,le.colorScale):De,edgeOpacity:C,edgeLinecap:F,styleRules:P}),[u,He,R,A,le.colorScale,C,F,P]),ze=mt(()=>{let e=ne(Le,{stroke:K,strokeWidth:J,opacity:X});if(!le.effectiveSelectionHook)return e;let t={...le.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return je(e,le.effectiveSelectionHook,{...le.resolvedSelection||{},unselectedStyle:t})},[Le,le.effectiveSelectionHook,le.resolvedSelection,K,J,X]),We=N??("sparkline"===i.mode?1.5:5),Oe=mt(()=>ne(()=>({fill:"#333",r:We,fillOpacity:.8}),{stroke:K,strokeWidth:J,opacity:X}),[We,K,J,X]),Be=mt(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)/* @__PURE__ */
|
|
26
|
+
return gt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */gt("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){let t=e[u];/* @__PURE__ */
|
|
27
|
+
return yt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
28
|
+
/* @__PURE__ */yt("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&/* @__PURE__ */gt("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[a];return null!=t?/* @__PURE__ */gt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */gt("div",{style:{fontWeight:600},children:t})}):null},[u,a]);if(le.earlyReturn)return le.earlyReturn;let Ee={projection:d,...null!=o&&{lines:Ce},points:ae,xAccessor:Re,yAccessor:Ne,lineDataAccessor:"coordinates",...null!=Y&&{lineIdAccessor:Y},lineType:k,flowStyle:w,lineStyle:ze,pointStyle:Oe,...te&&{areas:te,areaStyle:M},...null!=m&&{graticule:m},...null!=h&&{fitPadding:h},...ee&&{zoomable:!0},...f&&{zoomExtent:f},...g&&{onZoom:g},...null!=y&&{dragRotate:y},...H&&{showParticles:H},...L&&{particleStyle:L},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[i.width,i.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:le.margin,enableHover:i.enableHover,tooltipContent:!1===I?()=>null:ke(I)||Be,...le.legendBehaviorProps,...re({linkedHover:O,selection:T,onObservation:B,onClick:E,mobileInteraction:le.mobileInteraction,customHoverBehavior:xe,customClickBehavior:we,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...D&&{className:D},...null!=e.animate&&{animate:e.animate},...V};/* @__PURE__ */
|
|
29
|
+
return gt(Me,{componentName:"FlowMap",width:i.width,height:i.height,children:/* @__PURE__ */gt(Q,{ref:pe,...Ee})})});xt.displayName="FlowMap";import{useMemo as kt,useRef as wt,useState as St,useEffect as Mt,useCallback as At,forwardRef as Ct}from"react";import{jsx as Rt,jsxs as Nt}from"react/jsx-runtime";import{Fragment as Ft,jsx as jt,jsxs as Pt}from"react/jsx-runtime";var Ht=Ct(function(e,t){let i=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:o,lines:r,xAccessor:n="lon",yAccessor:a="lat",nodeIdAccessor:l="id",center:s,costAccessor:u,strength:d=1,lineMode:m="straight",projection:h="mercator",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,transition:S,colorBy:M,styleRules:A,colorScheme:C,pointRadius:R,tooltip:N,showRings:F,showRingLabels:j,ringStyle:P,showNorth:H,costLabel:L,cartogramLayout:I,annotations:z,margin:W,className:D,selection:T,linkedHover:O,onObservation:B,onClick:E,chartId:G,loading:$,loadingContent:Z,emptyContent:_,legendPosition:V,frameProps:U={},stroke:q,strokeWidth:K,opacity:J}=e,X="sparkline"===i.mode,Y=I??(X?"strip":"radial"),ee=R??(X?1.5:5),te=F??!0,ae=j??("strip"!==Y&&!i.compactMode),le=H??("strip"!==Y&&!X),se=g??!!x,ce=kt(()=>Ae(o),[o]),ue=ie({data:ce,rawData:o,colorBy:M,colorScheme:C,legendInteraction:void 0,legendPosition:V,frameLegend:U,selection:T,linkedHover:O,fallbackFields:M?["string"==typeof M?M:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DistanceCartogram",chartId:G,showLegend:i.showLegend,userMargin:W,marginDefaults:Ie(i),loading:$,loadingContent:Z,emptyContent:_,width:i.width,height:i.height,hasTitle:!!i.title}),de=kt(()=>{let e=xe(e=>{let t=e?.[l],i=null!=t&&t+""==s+"";return{fill:M?Te(e,M,ue.colorScale):De,fillOpacity:i?1:.8,stroke:i?"var(--semiotic-text, #222)":"#fff",strokeWidth:i?1.25:1,r:i?1.35*ee:ee}},A,ge(M)),t=ne(e,{stroke:q,strokeWidth:K,opacity:J});return ue.effectiveSelectionHook?je(t,ue.effectiveSelectionHook,ue.resolvedSelection):t},[M,ue.colorScale,ue.effectiveSelectionHook,ue.resolvedSelection,ee,q,K,J,A,s,l]),he=kt(()=>({center:s,centerAccessor:l,costAccessor:u,strength:d,lineMode:m,layout:Y}),[s,l,u,d,m,Y]),pe=kt(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof a?a:e=>e[a],i=/* @__PURE__ */new Map;for(let e of ce)i.set(e[l]+"",e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(o.source+""),l=i.get(o.target+"");return r&&l?{...o,coordinates:[{[n]:e(r),[a]:t(r)},{[n]:e(l),[a]:t(l)}]}:null}).filter(Boolean)},[r,ce,n,a,l]),fe=kt(()=>e=>{let t=("function"==typeof u?u:e=>e[u])(e);/* @__PURE__ */
|
|
30
|
+
return Pt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
31
|
+
/* @__PURE__ */jt("div",{style:{fontWeight:600},children:e[l]||e.name||e.id||"Point"}),null!=t&&/* @__PURE__ */Pt("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[u,l]),ye=wt(null);oe(t,{variant:"geo-points",frameRef:ye});let[be,ve]=St(null),we=At(()=>{let e=ye.current?.getCartogramLayout?.();e&&ve(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius&&t.layout===(e.layout??"radial")?t:{cx:e.cx,cy:e.cy,maxCost:e.maxCost,availableRadius:e.availableRadius,layout:e.layout??"radial"})},[]);Mt(()=>{let e=requestAnimationFrame(we);return()=>cancelAnimationFrame(e)},[we,d,s,i.width,i.height,ce,Y]);let Se=kt(()=>{if(!te||!be)return[];let{maxCost:e}=be;if(0>=e)return[];if(Array.isArray(te))return te.filter(t=>t>0&&e>=t);let t="number"==typeof te?te:Math.min("strip"===be.layout?3:5,Math.max(2,Math.ceil(e/5))),i=e/t,o=[];for(let e=1;t>=e;e++)o.push(Math.round(i*e*10)/10);return o},[te,be]),Ce=kt(()=>{if(!be)return U.foregroundGraphics||null;let e=/* @__PURE__ */jt(c,{bottomMargin:ue.margin.bottom,costLabel:L,layout:be,ringStyle:P,ringValues:Se,showNorth:le,showRingLabels:ae,showRings:te}),t=U.foregroundGraphics;return"function"==typeof t?i=>/* @__PURE__ */Pt(Ft,{children:[e,t(i)]}):/* @__PURE__ */Pt(Ft,{children:[e,t]})},[be,Se,te,ae,le,L,P,ue.margin.bottom,U.foregroundGraphics]);if(ue.earlyReturn)return ue.earlyReturn;Ne("DistanceCartogram",ce,"xAccessor",n),Ne("DistanceCartogram",ce,"yAccessor",a);let Re={projection:h,...null!=o&&{points:ce},...pe&&{lines:pe,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:a,pointIdAccessor:l,pointStyle:de,projectionTransform:he,...S&&{transition:{duration:S}},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...se&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ue.margin,enableHover:i.enableHover,tooltipContent:!1===N?()=>null:ke(N)||fe,...ue.legendBehaviorProps,...re({linkedHover:O,selection:T,onObservation:B,onClick:E,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...D&&{className:D},...null!=e.animate&&{animate:e.animate},...U,foregroundGraphics:Ce};/* @__PURE__ */
|
|
32
|
+
return jt(Me,{componentName:"DistanceCartogram",width:i.width,height:i.height,children:/* @__PURE__ */jt(Q,{ref:ye,...Re})})});Ht.displayName="DistanceCartogram";import{jsx as Lt}from"react/jsx-runtime";var It=e=>{let t=e.config,i=t.source??"auto",o="areas"===i||"auto"===i&&e.areas.length>0,r=(o?x(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,i)=>!t.filter||t.filter(e.datum,i)),n=w(r.map(e=>e.datum),t),a=o?r:k({...e,points:r.map(e=>e.datum)}),l=n??p(a,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===l.length)return{nodes:[]};let s=m(l.map(e=>e.row)),c=m(l.map(e=>e.column)),u=Math.max(1,Math.round(s[1]-s[0])+1),g=Math.max(1,Math.round(c[1]-c[0])+1),y=Math.max(0,t.layoutPadding??8),M=Math.max(1,e.dimensions.width-2*y)/g,A=Math.max(1,e.dimensions.height-2*y)/u,C=(e.dimensions.width-M*g)/2,R=(e.dimensions.height-A*u)/2,N=d(t.cellPadding??.12,0,.8),F=Math.max(1,.5*Math.min(M,A)*(1-N)),j=t.sizeAccessor?l.map(e=>Number(f(e.datum,t.sizeAccessor))):[],P=t.sizeDomain??m(j),H=t.sizeRange??[.36,1],L=d(Math.min(H[0],H[1]),.05,1),I=d(Math.max(H[0],H[1]),L,1),z=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=(f(r,t.idAccessor,["id","key","name"])??"grid-"+o)+"",a=(f(r,t.labelAccessor,["abbr","code","label","name","id"])??n)+"",l=Math.max(1,t.maxLabelLength??4),u=a.length>l?a.slice(0,l):a,m=f(r,t.categoryAccessor),p=null==m?void 0:m+"",g=f(r,t.fillAccessor),y=null!=g?g+"":p?e.resolveColor(p):e.theme.categorical[0]??"#4f86c6",b=t.sizeAccessor?Number(f(r,t.sizeAccessor)):NaN,v=t.sizeAccessor&&Number.isFinite(b)?Math.sqrt(d(h(b,P),0,1)):1,x=F*(L+v*(I-L)),k="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:u,category:p,row:i.row,column:i.column,x:C+(i.column-c[0]+.5)*M,y:R+(i.row-s[0]+.5)*A,radius:x,style:{fill:y,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...k}}}),W=t.shape??"circle";return{nodes:z.map(e=>"circle"===W?{type:"point",x:e.x,y:e.y,r:e.radius,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},pointId:e.id,_transitionKey:e.id}:{type:"geoarea",pathData:"hexagon"===W?v(e.x,e.y,e.radius):b(e.x,e.y,e.radius),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===W?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0}),overlays:!1===t.showLabels?null:/* @__PURE__ */Lt(S,{marks:z,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??d(.23*Math.min(M,A),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}};import{geoBounds as zt,geoContains as Wt}from"d3-geo";import{jsx as Dt}from"react/jsx-runtime";var Tt=/* @__PURE__ */new WeakMap,Ot=/* @__PURE__ */new WeakMap,Bt=/* @__PURE__ */new WeakMap,Et=1,Gt=e=>{let t=Z(e),i=e.config,o=i.shape??"circle",r=Math.max(.5,A(i.dotRadius)??t.cellSize*M(i.radiusRatio??.24,.05,.5)),n=i.gridOrigin?.[0]??0,a=i.gridOrigin?.[1]??0;return{nodes:t.dots.map((l,s)=>{let c=n+(l.gridColumn+.5)*t.cellSize,u=a+(l.gridRow+.5)*t.cellSize,d=C(l,i.categoryAccessor),m=C(l,i.fillAccessor),h={fill:null!=m?m+"":null!=d?e.resolveColor(d+""):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof i.markStyle?i.markStyle(l,s):i.markStyle},p=`dot-${l.gridRow}-${l.gridColumn}`;return"circle"===o?{type:"point",x:c,y:u,r:r,style:h,datum:l,interactive:!1,pointId:p,_transitionKey:p}:{type:"geoarea",pathData:"hexagon"===o?U(c,u,r):V(c,u,r),centroid:[c,u],bounds:[[c-r,u-r],[c+r,u+r]],screenArea:"hexagon"===o?3*Math.sqrt(3)*r*r/2:(2*r)**2,style:h,datum:l,group:l.featureId,interactive:!1}}),overlays:i.showOutline?/* @__PURE__ */Dt("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?/* @__PURE__ */Dt("path",{d:r,fill:"none",stroke:i.outlineStyle?.stroke??"currentColor",strokeOpacity:i.outlineStyle?.opacity??i.outlineStyle?.fillOpacity??.22,strokeWidth:i.outlineStyle?.strokeWidth??.7,strokeDasharray:i.outlineStyle?.strokeDasharray,strokeLinecap:i.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},N(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{a as ChoroplethMap,K as DEFAULT_HIT_RADIUS,Ht as DistanceCartogram,xt as FlowMap,ee as GeoCustomChart,fe as MultiLineTooltip,dt as ProportionalSymbolMap,Q as StreamGeoFrame,pe as Tooltip,ze as TooltipRoot,xe as composeStyleRules,Y as geoAreaHitTarget,X as geoHitTarget,Gt as geographicDotGridLayout,It as geographicGridLayout,Ee as glyphExtent,Be as glyphPlacement,p as gridifyGeographicPoints,$e as hatchFillId,Ze as hatchPatternDef,J as hitTargetPoint,Ge as isHatchFill,ge as makeNodeRuleContext,he as makeRuleValueResolver,le as markTooltipChrome,ye as matchesThreshold,q as mergeData,i as resolveReferenceGeography,Le as resolveResponsiveRules,ve as resolveStyleRules,_e as resolveSvgFill,He as responsiveRuleMatches,be as ruleMatches,W as sampleGeographicDotGrid};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
function
|
|
2
|
+
function s(){N("sankey",n),N("force",r),N("chord",m),N("tree",P),N("cluster",P),N("treemap",P),N("circlepack",P),N("partition",P),N("orbit",g)}import{a}from"./c-PZ3NEGNG.min.js";import"./c-6IVBV5NO.min.js";import{a as e,f as i,g as o}from"./c-GSCO3FWL.min.js";import{a as r,b as t,c as m,d as c,e as n,f as p,g as l,h as j,i as u,j as T,k as S,l as k,m as y,n as h,o as P,p as C,q as F,r as L,s as g,t as b,u as G}from"./c-7LY46QUI.min.js";import"./c-HLGTD5SJ.min.js";import"./c-PQOZPM4G.min.js";import"./c-IBRLFKWA.min.js";import"./c-HQ27AHMC.min.js";import{a as N,b as R}from"./c-SG2Y7EBY.min.js";import"./c-YMFUIO54.min.js";import"./c-BYJJ7EMG.min.js";import"./c-TIDKVMMZ.min.js";import"./c-TIMGODBG.min.js";import"./c-3AGX252H.min.js";import"./c-QXLDCATV.min.js";import"./c-U5XVLSHN.min.js";import"./c-KGROWFT2.min.js";import"./c-V5KFJWQQ.min.js";import{b as V}from"./c-CLLCX3PT.min.js";import"./c-RHDOOQ4X.min.js";import"./c-UBHICVSC.min.js";import"./c-N5WT7TXG.min.js";import{Aa as f,Nb as D,Oa as I,Pa as d,Pb as H,Qb as M,Rb as O,Sb as A,Tb as X,lb as v,pb as B,qb as Y,za as Q}from"./c-G53AVC42.min.js";import"./c-Y342FJ6K.min.js";import{d as J,e as U,r as E,s as K,t as w,u as W}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import"./c-3PFVJFBK.min.js";export{c as ChordDiagram,L as CirclePack,e as DEFAULT_HIT_RADIUS,t as ForceDirectedGraph,d as MultiLineTooltip,G as NetworkCustomChart,b as OrbitDiagram,h as ProcessSankey,p as SankeyDiagram,R as StreamNetworkFrame,I as Tooltip,Q as TooltipRoot,C as TreeDiagram,F as Treemap,X as composeStyleRules,u as diagnoseProcessSankeyLayout,S as diagnoseProcessSankeyProps,T as explainProcessSankeyLayout,j as formatProcessSankeyIssue,U as glyphExtent,J as glyphPlacement,K as hatchFillId,w as hatchPatternDef,k as inventoryAtTime,E as isHatchFill,H as makeNodeRuleContext,D as makeRuleValueResolver,f as markTooltipChrome,M as matchesThreshold,o as networkEdgeHitTarget,i as networkHitTarget,s as registerBuiltInNetworkLayouts,Y as resolveResponsiveRules,A as resolveStyleRules,W as resolveSvgFill,B as responsiveRuleMatches,O as ruleMatches,y as toProcessSankeyTime,V as useCustomLayoutSelection,a as useForceLayout,v as useSelectionActions,l as validateProcessSankey};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{
|
|
2
|
+
import{a,b as s,e as t}from"./c-GSCO3FWL.min.js";import{a as i,b as m,c as o,d as e,e as r,f as n,g as l,h as c,i as p,j as h,k as j,l as C,m as P,n as u,o as T,p as R,q as F,r as S}from"./c-IPYGNVN6.min.js";import"./c-PDQHLOKU.min.js";import"./c-PQOZPM4G.min.js";import"./c-IBRLFKWA.min.js";import"./c-HQ27AHMC.min.js";import"./c-PKY4JFY5.min.js";import"./c-SQNEVNWT.min.js";import"./c-2TW5H5PD.min.js";import"./c-HK4OSLZA.min.js";import"./c-VXIYF7V2.min.js";import"./c-NATWERHZ.min.js";import"./c-P5NXQWIM.min.js";import"./c-TIMGODBG.min.js";import"./c-3AGX252H.min.js";import"./c-QXLDCATV.min.js";import"./c-U5XVLSHN.min.js";import"./c-KGROWFT2.min.js";import"./c-V5KFJWQQ.min.js";import{b}from"./c-CLLCX3PT.min.js";import"./c-N5WT7TXG.min.js";import{Aa as L,E as V,F as N,Nb as d,Oa as H,Ob as X,Pa as A,Pb as G,Qb as O,Rb as W,Sb as g,Tb as D,Ub as I,pb as Q,qb as Y,za as k}from"./c-G53AVC42.min.js";import"./c-Y342FJ6K.min.js";import{d as B,e as K,q as M,r as f,s as v,t as y,u as U}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import"./c-3PFVJFBK.min.js";export{N as AnnotationLabel,m as BarChart,n as BoxPlot,a as DEFAULT_HIT_RADIUS,C as DonutChart,h as DotPlot,T as FunnelChart,P as GaugeChart,u as GroupedBarChart,l as Histogram,e as LikertChart,A as MultiLineTooltip,S as OrdinalCustomChart,j as PieChart,R as RadarChart,p as RidgelinePlot,o as StackedBarChart,i as StreamOrdinalFrame,r as SwarmPlot,F as SwimlaneChart,H as Tooltip,k as TooltipRoot,c as ViolinPlot,D as composeStyleRules,M as createHatchPattern,V as estimateLabelWidth,K as glyphExtent,B as glyphPlacement,v as hatchFillId,y as hatchPatternDef,s as hitTargetPoint,t as hitTargetRect,f as isHatchFill,G as makeNodeRuleContext,d as makeRuleValueResolver,I as makeStyleRuleStyleFn,X as makeXYRuleContext,L as markTooltipChrome,O as matchesThreshold,Y as resolveResponsiveRules,g as resolveStyleRules,U as resolveSvgFill,Q as responsiveRuleMatches,W as ruleMatches,b as useCustomLayoutSelection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function t(e,t,a){let i=e.plugin?.id;return(i??e.label??e.id??`${a}-${t}`)+""}function a(t,a){let i=e(t.circleRadius);if(null!=i&&i>0)return{type:"circle",radius:i};let n=t.bounds;return n?{type:"aabb",width:Math.max(1,n.max.x-n.min.x),height:Math.max(1,n.max.y-n.min.y)}:{type:"circle",radius:a}}function i(t,a){let i=t.position??{x:0,y:0},n=e(t.circleRadius);if(null!=n&&n>0)return{type:"aabb",x:i.x,y:i.y,width:2*n,height:2*n};let r=t.bounds;return r?{type:"aabb",x:(r.min.x+r.max.x)/2,y:(r.min.y+r.max.y)/2,width:Math.max(1,r.max.x-r.min.x),height:Math.max(1,r.max.y-r.min.y)}:{type:"aabb",x:i.x,y:i.y,width:2*a,height:2*a}}function n(e,t){return t?e.plugin?.[t]:e.plugin}function r(i,r=0,s={}){let o=s.fallbackRadius??4,l=i.position??{x:0,y:0},m=i.velocity??{x:0,y:0};return{id:t(i,r,s.idPrefix??"matter-body"),x:l.x,y:l.y,vx:m.x,vy:m.y,angle:i.angle,mass:e(i.mass)??1,shape:a(i,o),datum:n(i,s.datumFromPlugin)}}function s(e,a=0,n={}){let r=n.fallbackRadius??4;return{id:t(e,a,n.idPrefix??"matter-collider"),sensor:!!e.isSensor,shape:i(e,r)}}function o(e,t={}){return e.map((e,a)=>r(e,a,t))}function l(e,t={}){return e.map((e,a)=>s(e,a,t))}async function m(){let e=await d(P);return e.default??e}function c(e){return y(P,e)}import{a as u,b as y,c as d}from"./c-3OFVBWQY.min.js";var x="matter-js",p="semiotic/physics/matter",h={engine:"matter-js",determinism:"tolerance",sensors:!0,joints:!0,ccd:!1,maxBodiesHint:5e3,worker:!1},P={engine:"Matter.js",importPath:p,packageName:x,installCommand:"npm install "+x};export{h as MATTER_PHYSICS_CAPABILITIES,p as MATTER_PHYSICS_IMPORT_PATH,P as MATTER_PHYSICS_INSTALL,x as MATTER_PHYSICS_PACKAGE,u as PhysicsOptionalEngineDependencyError,m as loadMatterPhysicsPeer,d as loadOptionalPhysicsPeer,l as matterBodiesToPhysicsColliders,o as matterBodiesToPhysicsSpawns,r as matterBodyToPhysicsBodySpec,s as matterBodyToPhysicsColliderSpec,c as matterPhysicsDependencyError,y as optionalEngineDependencyError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
async function e(){let e=await
|
|
1
|
+
async function e(){let e=await n(p),a=e.default??e;return await(a.init?.()),a}function a(e){return r(p,e)}import{a as i,b as r,c as n}from"./c-3OFVBWQY.min.js";var t="@dimforge/rapier2d-compat",s="semiotic/physics/rapier",o={selectedPackage:t,rejectedPackage:"@dimforge/rapier2d-deterministic",determinism:"tolerance",reason:"Use @dimforge/rapier2d-compat for the optional browser adapter path because it is the maintained npm/WASM package with standard bundler behavior. Treat Rapier visual/position conformance as tolerance-classed; keep the built-in kernel as the strict deterministic default."},c={engine:"rapier2d-compat",determinism:"tolerance",sensors:!0,joints:!0,ccd:!0,maxBodiesHint:2e4,worker:!0},p={engine:"Rapier 2D",importPath:s,packageName:t,installCommand:"npm install "+t};export{i as PhysicsOptionalEngineDependencyError,c as RAPIER_PHYSICS_CAPABILITIES,o as RAPIER_PHYSICS_ENGINE_DECISION,s as RAPIER_PHYSICS_IMPORT_PATH,p as RAPIER_PHYSICS_INSTALL,t as RAPIER_PHYSICS_PACKAGE,n as loadOptionalPhysicsPeer,e as loadRapierPhysicsPeer,r as optionalEngineDependencyError,a as rapierPhysicsDependencyError};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
function e(e){let{data:t,encoding:i,defaults:n={},scales:r}=e,o=Ct({data:t,encoding:i}),a=[],s=new Map,l=[],u=[],d=new Map;return o.rows.forEach((e,t)=>{let{id:o,datum:p}=e,c=Math.max(0,Lt(i.appearance?.size,p,t)??n.size??6),h=Lt(i.appearance?.shape,p,t)??n.shape??{type:"circle",radius:c},m=e.placement.x??n.x??0,f=e.placement.y??n.y??0,g=r?.x?r.x(m):m,y=r?.y?r.y(f):f,b=Lt(i.appearance?.color,p,t)??n.color,x=Lt(i.appearance?.opacity,p,t)??n.opacity,w=Lt(i.appearance?.stroke,p,t)??n.stroke,v=Lt(i.appearance?.strokeWidth,p,t)??n.strokeWidth,A=Lt(i.time?.spawnAt,p,t)??e.time.arrival,I=e.kinematics.velocityX,M=e.kinematics.velocityY,S=Lt(i.dynamics?.mass,p,t)??n.mass??1,P=Lt(i.dynamics?.friction,p,t),E=Lt(i.dynamics?.restitution,p,t),j=Lt(i.dynamics?.bodyCollisions,p,t),k={id:o,x:g,y:y,mass:S,shape:{...h},datum:p,...null!=A&&{spawnAt:A},...null!=I&&{vx:I},...null!=M&&{vy:M},...null!=P&&{friction:P},...null!=E&&{restitution:E},...null!=j&&{bodyCollisions:j}},R={...null!=b&&{fill:b},...null!=x&&{opacity:x},...null!=w&&{stroke:w},...null!=v&&{strokeWidth:v}},B={id:o,datum:p,appearance:{color:b,opacity:x,shape:h,size:c,stroke:w,strokeWidth:v},placement:{x:g,y:y,lane:e.placement.lane,space:i.placement?.space??"world"},time:{arrival:A,spawnAt:A,basis:i.time?.basis??"simulation",unit:i.time?.unit},kinematics:{velocityX:I,velocityY:M,space:i.kinematics?.space??"world"},dynamics:{bodyCollisions:j,friction:P,mass:S,restitution:E},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:k};a.push(B),s.set(o,B),l.push(k),d.set(o,R),u.push({id:o,bodyId:o,label:e.accessible.label,description:e.accessible.description,datum:p,x:g,y:y,group:e.accessible.group})}),{rows:a,byId:s,spawns:l,semanticItems:u,bodyStyle:e=>d.get(e.id)??{}}}function t(t){return i=>{let n=e({data:i.data,encoding:t.encoding,defaults:t.defaults,scales:i.scales}),r=t.extend?.(i,n)??{};return{...r,initialSpawns:n.spawns,bodyStyle:n.bodyStyle,semanticItems:[...n.semanticItems,...r.semanticItems??[]]}}}function i(e,t){let{layout:i,positiveProperties:n,negativeProperties:r,viability:o,outcome:a}=t,s=function(e){return new Map(e.gates.map(e=>[e.id,e]))}(i),l=[...("function"==typeof t.events?t.events(e,i):t.events)??[]].sort((e,t)=>e.time-t.time),u=e;for(let e of l){let t=e.gateId?s.get(e.gateId):void 0,l=e.effects??[],d={...rt(e,l),appliedAt:e.time},p=At(u,d);if(p!==u){u=p;for(let i of l){let o={event:e,gate:t,negativeProperties:r,positiveProperties:n,project:u};i.when&&!i.when(o)||(u=ye(u,i,o))}u={...u,viability:o?.(u,{negativeProperties:r,positiveProperties:n})??tt(u,n,r)},e.final&&(u={...u,outcome:e.outcome??a?.(u,{layout:i,negativeProperties:r,positiveProperties:n})??(u.viability>20?"built":"approved_not_built")})}}return u}function n(e){return e.projects.map(t=>i(t,e))}function r(e){let t=e.resources.map(e=>({...e,bodyId:e.bodyId??e.id})),i=new Map(t.map(e=>[e.bodyId,e])),n=new Map,r=new Map,o=e.assignmentForce??.45,a=e.returnForce??.35,s=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=new Map,d=0,p=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let i=n.get(e);if(i)return i;let o=t.find(e=>!r.has(e.id));if(!o)return null;let a={resourceId:o.id,resourceBodyId:o.bodyId,caseBodyId:e,assignedAt:d};return n.set(e,a),r.set(o.id,a),p+=1,a},release:e=>{let t=n.get(e);return!!t&&(n.delete(e),r.delete(t.resourceId),p+=1,!0)},getAssignment:e=>n.get(e),tick:e=>{d=Math.max(d,e.elapsed),u=new Map(e.controls.readBodies().map(e=>[e.id,e]));for(let[e,t]of n)u.has(e)&&u.has(t.resourceBodyId)||(n.delete(e),r.delete(t.resourceId),p+=1)},getSnapshot:()=>({total:t.length,available:t.length-r.size,assigned:r.size,assignments:Array.from(n.values()),simulatedAt:d,metricRevision:p}),bodyForce:e=>{let t=i.get(e.body.id);if(t){let i=r.get(t.id),n=i?u.get(i.caseBodyId):void 0,s=i?o:a;return{x:((n?n.x+(l.x??0):t.home.x)-e.body.x)*s,y:((n?n.y+(l.y??0):t.home.y)-e.body.y)*s}}let d=n.get(e.body.id);if(!d||0>=s)return null;let p=u.get(d.resourceBodyId);return p?{x:(p.x-e.body.x)*s,y:(p.y-e.body.y)*s}:null}}}function o(e,t){let i="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):Ft(e.datum,t.deadlineAccessor)??Ft(e,t.deadlineAccessor);return Number.isFinite(Number(i))?Math.max(0,Number(i)):0}function a(e){function t(t){n.set(t.bodyId,t),a+=1,e.onStateChange?.({...t})}function i(e){let i=n.get(e);return!(!i||null!=i.completedAt||(t({...i,completedAt:r,state:"unhappy"===i.state?"resolved-unhappy":"resolved"}),0))}let n=new Map,r=0,a=0;return{id:e.id??"service-level",continuous:!0,protect:e=>{let i=n.get(e);return!(!i||null!=i.completedAt||"unhappy"===i.state||(t({...i,state:"protected",protectedAt:r}),0))},complete:i,getCase:e=>n.get(e),tick:a=>{r=Math.max(r,a.elapsed);for(let s of a.controls.readBodies()){if(!st(s,e.bodyFilter))continue;if(!n.has(s.id)){let i=o(s,e);t({bodyId:s.id,openedAt:r,deadlineAt:r+i,state:"waiting"})}let l=n.get(s.id);l&&null==l.completedAt&&(e.completionRegionId&&a.getRegionState(s.id)?.activeRegionIds.includes(e.completionRegionId)?i(s.id):"waiting"===l.state&&r>=l.deadlineAt&&t({...l,state:"unhappy"}))}},getSnapshot:()=>{let e=Array.from(n.values()),t=t=>e.filter(e=>e.state===t).length;return{total:e.length,waiting:t("waiting"),protected:t("protected"),unhappy:t("unhappy"),resolved:t("resolved"),resolvedUnhappy:t("resolved-unhappy"),simulatedAt:r,metricRevision:a}}}}function s(e){let t=new Set,i=0,n=0,r=0,o=!1;return{id:e.id??"dependency-gate:"+e.regionId,continuous:!0,tick:a=>{i=Math.max(i,a.elapsed);let s=o;var l;l=i,o=e.isOpen?e.isOpen(l):null!=e.opensAt&&l>=e.opensAt;let u=a.controls.readBodies(),d=new Map(u.map(e=>[e.id,e]));for(let i of u)!a.getRegionState(i.id)?.activeRegionIds.includes(e.regionId)||!st(i,e.bodyFilter)||!o&&!t.has(i.id)&&(t.add(i.id),r+=1,e.onHeld?.(i));if(o&&!s){for(let i of t){let t=d.get(i);t&&(a.controls.applyImpulse(i,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),n+=1,e.onReleased?.(t))}t.clear(),r+=1}for(let e of t)d.has(e)||(t.delete(e),r+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:o,blocked:t.size,released:n,simulatedAt:i,metricRevision:r}),bodyForce:i=>{if(o||!t.has(i.body.id))return null;let n=i.regions?.find(t=>t.id===e.regionId)?.shape;if(!n||"aabb"!==n.type)return{x:.8*-i.body.vx,y:.8*-i.body.vy};let r=e.holdForce??.4;return{x:(n.x-i.body.x)*r-.45*i.body.vx,y:(n.y-i.body.y)*r-.45*i.body.vy}}}}function l(e,t,i){return Math.max(t,Math.min(i,e))}function u(e,t,i={}){let n=i.random??Math.random,r=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],o=l(i.along??.5,.05,.95),a=i.jitterX??0,s=i.padY??20,u=r.x0+(r.x1-r.x0)*o+(2*n()-1)*a,d=Math.min(1,r.width/2),p=l(u,r.x0+d,r.x1-d),c=e.boundaryY(p,"top")+s,h=e.boundaryY(p,"bottom")-s;return{x:p,y:h>c?c+n()*Math.max(1,h-c):e.midY}}function d(e){return"bowtie"===e.shape?[{id:"incoming",role:"incoming",points:[[e.left,e.topY],[e.centerLeft,e.pinchTop],[e.centerLeft,e.pinchBottom],[e.left,e.bottomY]]},{id:"center",role:"center",points:[[e.centerLeft,e.pinchTop],[e.centerRight,e.pinchTop],[e.centerRight,e.pinchBottom],[e.centerLeft,e.pinchBottom]]},{id:"outgoing",role:"outgoing",points:[[e.centerRight,e.pinchTop],[e.right,e.topY],[e.right,e.bottomY],[e.centerRight,e.pinchBottom]]}]:[{id:"volume",role:"volume",points:[[e.left,e.topY],[e.right,"funnel"===e.shape?e.pinchTop:e.topY],[e.right,"funnel"===e.shape?e.pinchBottom:e.bottomY],[e.left,e.bottomY]]}]}function p(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function c(e,t,i,n,r){return"function"==typeof n?n(e,t,i):function(e,t){let i=e;for(let e of t.split(".")){if(null==i||"object"!=typeof i||!Object.prototype.hasOwnProperty.call(i,e))return;i=i[e]}return i}(e,n??r)}function h(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function m(e,t,i,n){let r=e.flatMap((e,r)=>{let o=p(c(e,r,t,i,"time")),a=p(c(e,r,t,n,"value"));return null==o||null==a?[]:[{time:h(o),value:a,index:r}]});r.sort((e,t)=>e.time-t.time||e.index-t.index);let o=[];for(let e of r){let t=o[o.length-1];t?.time===e.time?t.value=e.value:o.push({time:e.time,value:e.value})}return o}function f(e,t,i,n){if(!e.length)return null;let r=e[0],o=e[e.length-1];if(r.time>t)return"clamp"===n?r.value:null;if(t>o.time)return"clamp"===n?o.value:null;let a=function(e,t){let i=0,n=e.length;for(;n>i;){let r=i+n>>>1;t>e[r].time?i=r+1:n=r}return i}(e,t),s=e[a];if(s?.time===t)return s.value;let l=e[Math.max(0,a-1)];return"step"!==i&&s&&s.time!==l.time?l.value+(t-l.time)/(s.time-l.time)*(s.value-l.value):l.value}function g(e,t){if(1===e.length)return e[0];let i=(e.length-1)*t,n=Math.floor(i),r=Math.ceil(i);return n===r?e[n]:e[n]+(e[r]-e[n])*(i-n)}function y(e){let t=e.interpolation??"step",i=e.outsideDomain??"omit",n=function(e){let t=(e??ei).map(e=>{let t=p(e);if(null==t||0>t||t>1)throw new RangeError("physicsReferenceEnvelope quantiles must be finite values from 0 to 1; received "+e);return h(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}(e.quantiles),r=function(e){if(Array.isArray(e)){if(e.length>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(e.map(p).filter(e=>null!=e).map(h))).sort((e,t)=>e-t)}let t=e,i=p(t.start),n=p(t.end),r=p(t.step);if(null==i||null==n||null==r||0>=r||i>n)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let o=Math.floor((n-i)/r)+1;if(o>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");let a=[],s=1e-10*Math.max(1,Math.abs(n),Math.abs(i));for(let e=0;o>e;e+=1){let t=i+e*r;if(t>n+s)break;a.push(h(Math.min(t,n)))}if((!a.length||Math.abs(a[a.length-1]-n)>s)&&a.push(h(n)),a.length>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(a)).sort((e,t)=>e-t)}(e.sampleAt),o=e.runs.map(t=>m(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:r.map(e=>{let r=o.map(n=>f(n,e,t,i)).filter(e=>null!=e).sort((e,t)=>e-t),a={};for(let e of n)a[e]=r.length?g(r,e):null;return{time:e,count:r.length,min:r.length?r[0]:null,max:r.length?r[r.length-1]:null,median:r.length?g(r,.5):null,quantiles:a}}),quantiles:n,interpolation:t,outsideDomain:i,runCount:e.runs.length}}function b(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function x(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let i=p(t);if(null==i||0>i||i>1)throw new RangeError("comparePhysicsTrace quantile selectors must be from 0 to 1; received "+t);let n=h(i);if(!Object.prototype.hasOwnProperty.call(e.quantiles,n))throw Error(`comparePhysicsTrace could not find quantile ${n} in the reference envelope`);return e.quantiles[n]??null}function w(e,t,i){return t>e?"below":e>i?"above":"inside"}function v(e,t){let i=Math.max(0,t.time-e.time);if(0>=i||null==e.value||null==e.lower||null==e.upper||null==t.value||null==t.lower||null==t.upper)return{below:0,inside:0,above:0,observed:0};let n=e.value-e.lower,r=t.value-t.lower,o=e.value-e.upper,a=t.value-t.upper,s=[0,1];for(let[e,t]of[[n,r],[o,a]])(0>e&&t>0||e>0&&0>t)&&s.push(-e/(t-e));s.sort((e,t)=>e-t);let l=0,u=0,d=0;for(let n=0;s.length-1>n;n+=1){let r=s[n],o=s[n+1];if(r>=o)continue;let a=(r+o)/2,p=(o-r)*i,c=w(e.value+(t.value-e.value)*a,e.lower+(t.lower-e.lower)*a,e.upper+(t.upper-e.upper)*a);"below"===c?l+=p:"above"===c?d+=p:u+=p}return{below:l,inside:u,above:d,observed:i}}function A(e,t,i={}){let n=i.interpolation??t.interpolation,r=i.outsideDomain??t.outsideDomain,o=m(e,i.traceId??"trace",i.timeAccessor,i.valueAccessor),a=i.lower??b(t,"lower"),s=i.upper??b(t,"upper"),l=t.points.map(e=>{let t=f(o,e.time,n,r),i=x(e,a),l=x(e,s);if(null!=i&&null!=l&&i>l)throw new RangeError("comparePhysicsTrace lower band exceeds upper band at time "+e.time);return{time:e.time,value:t,lower:i,upper:l,status:null==t||null==i||null==l?"unobserved":w(t,i,l)}}),u=0,d=0,p=0,c=0,h=null,g=0,y=null;for(let e of l){if("below"===e.status?u+=1:"inside"===e.status?d+=1:"above"===e.status&&(p+=1),null==e.value||null==e.lower||null==e.upper)continue;let t=Math.max(0,e.value-e.upper),i=Math.max(0,e.lower-e.value);t>c&&(c=t,h=e.time),i>g&&(g=i,y=e.time)}let A=0,I=0,M=0,S=0;for(let e=0;l.length-1>e;e+=1){let t=l[e],i=l[e+1],r=Math.max(0,i.time-t.time);if(r>0){if("linear"===n){let e=v(t,i);A+=e.below,I+=e.inside,M+=e.above,S+=e.observed;continue}"unobserved"!==t.status&&(S+=r,"below"===t.status?A+=r:"above"===t.status?M+=r:I+=r)}}let P=l[0]?.time,E=l[l.length-1]?.time,j=null==P||null==E?0:Math.max(0,E-P);return{points:l,sampleCount:l.length,observedSamples:u+d+p,belowSamples:u,insideSamples:d,aboveSamples:p,totalDuration:j,observedDuration:S,unobservedDuration:Math.max(0,j-S),belowDuration:A,insideDuration:I,aboveDuration:M,peakExcess:c,peakExcessAt:h,peakDeficit:g,peakDeficitAt:y}}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function M(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function S(e){return!!M(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&M(e.visitsByStage)&&M(e.firstEnteredAt)&&M(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function P(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function E(e){let t=Array.from(new Set(e.bodyIds??[]));return{stages:e.stages.map(e=>({...e})),bodyIds:t,entities:Object.fromEntries(t.map(e=>[e,P(e)]))}}function j(e,t,i={}){if("region-enter"!==t.type)return e;let n=function(e,t){let i=t.stageId?.(e);if(i)return i;let n=e.region.metadata;if(n&&"object"==typeof n&&Object.prototype.hasOwnProperty.call(n,"stageId")){let e=n.stageId;if("string"==typeof e)return e}return e.region.id}(t,i),r=e.stages.findIndex(e=>e.id===n);if(0>r)return e;let o=i.entityId?.(t)??t.bodyId;if(!o)return e;let a=I(e.entities,o),s=S(a)?a:P(o),l=s.currentStageId?e.stages.findIndex(e=>e.id===s.currentStageId):-1,u=!s.visitedStageIds.includes(n),d=Number(t.observation.timestamp),p=Number.isFinite(d)?d:0,c=I(s.visitsByStage,n),h="number"==typeof c&&Number.isFinite(c)?c:0,m={...s,currentStageId:n,furthestStageId:r>s.furthestStageIndex?n:s.furthestStageId,furthestStageIndex:Math.max(s.furthestStageIndex,r),visitedStageIds:u?[...s.visitedStageIds,n]:s.visitedStageIds,visitsByStage:{...s.visitsByStage,[n]:h+1},firstEnteredAt:u?{...s.firstEnteredAt,[n]:p}:s.firstEnteredAt,lastEnteredAt:{...s.lastEnteredAt,[n]:p},regressionCount:l>=0&&l>r?s.regressionCount+1:s.regressionCount};return{...e,bodyIds:e.bodyIds.includes(o)?e.bodyIds:[...e.bodyIds,o],entities:{...e.entities,[o]:m}}}function k(e){let t=e.bodyIds.map(t=>{let i=I(e.entities,t);return S(i)?i:P(t)}),i=t.length,n=i;return e.stages.map((e,r)=>{let o=t.filter(e=>e.furthestStageIndex>=r).length,a=t.filter(t=>t.visitedStageIds.includes(e.id)).length,s=t.reduce((t,i)=>{let n=I(i.visitsByStage,e.id);return t+("number"==typeof n&&Number.isFinite(n)?n:0)},0),l={id:e.id,label:e.label??e.id,reached:o,entered:a,total:i,conversion:i>0?o/i:0,fromPrevious:n>0?o/n:0,dropoff:Math.max(0,n-o),visits:s,repeatVisits:Math.max(0,s-a)};return n=o,l})}function R(e){let[t,i]=e.size,n=e.flow??ii,r=null==(v=e.padding)?{top:ni,right:ni,bottom:ni,left:ni}:"number"==typeof v?{top:v,right:v,bottom:v,left:v}:{top:v.top??0,right:v.right??0,bottom:v.bottom??0,left:v.left??0},o=Math.max(.05,Math.min(1,e.channelRatio??si)),a={x:r.left,y:r.top,width:Math.max(1,t-r.left-r.right),height:Math.max(1,i-r.top-r.bottom)},s="down"===n?a.height:a.width,l=s*Math.max(0,e.chargeExtent??ri),u=s*Math.max(0,e.projectionExtent??ai),d=s*Math.max(0,e.destinationExtent??oi),p=Math.max(0,s-l-d-u),c=function(e){return"number"==typeof e?Array.from({length:Math.max(1,Math.round(e))},(e,t)=>({id:"bin-"+t,label:t+""})):0===e.length?[{id:"bin-0",label:"0"}]:e.map((e,t)=>({id:e.id,label:e.label??e.id??t+""}))}(e.destinations),h=("down"===n?a.width:a.height)/c.length,m="down"===n?(e,t)=>({x:a.x,y:a.y+e,width:a.width,height:t}):(e,t)=>({x:a.x+e,y:a.y,width:t,height:a.height}),f=m(0,l),g=m(l,p),y=l+p,b=m(y,d),x=m(y+d,u),w=c.map((e,t)=>{let i=t*h,r=h*o,s=(h-r)/2;return"down"===n?{id:e.id,label:e.label,order:t,x:a.x+i+s,y:b.y,width:r,height:b.height,centerX:a.x+(t+.5)*h,centerY:b.y+b.height/2}:{id:e.id,label:e.label,order:t,x:b.x,y:a.y+i+s,width:b.width,height:r,centerX:b.x+b.width/2,centerY:a.y+(t+.5)*h}});var v;return{width:t,height:i,flow:n,charge:f,apparatus:g,destinations:w,projection:x}}function B(e,t){return e.destinations.find(e=>e.id===t)}function N(e,t,i){let{charge:n,flow:r}=e,o=Math.max(1,i),a=(t%o+.5)/o;return"down"===r?{x:n.x+n.width*a,y:n.y+n.height/2}:{x:n.x+n.width/2,y:n.y+n.height*a}}function F(e,t={}){let i=t.thickness??4,n=t.idPrefix??"stage",{destinations:r,flow:o,width:a,height:s}=e,l=[];if(r.length>0){let t=r[0];if("down"===o){let o=t.y+t.height;l.push({id:n+"-floor",shape:{type:"segment",x1:e.charge.x,y1:o,x2:e.charge.x+e.charge.width,y2:o,thickness:i}});for(let e=1;r.length>e;e+=1){let a=r[e].centerX-(r[e].centerX-r[e-1].centerX)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:a,y1:t.y,x2:a,y2:o,thickness:i}})}}else{let o=t.x+t.width;l.push({id:n+"-floor",shape:{type:"segment",x1:o,y1:e.charge.y,x2:o,y2:e.charge.y+e.charge.height,thickness:i}});for(let e=1;r.length>e;e+=1){let a=r[e].centerY-(r[e].centerY-r[e-1].centerY)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:a,x2:o,y2:a,thickness:i}})}}}return!1!==t.walls&&l.push({id:n+"-wall-left",shape:{type:"segment",x1:1,y1:0,x2:1,y2:s,thickness:i}},{id:n+"-wall-right",shape:{type:"segment",x1:a-1,y1:0,x2:a-1,y2:s,thickness:i}}),l}function Y(e,t={}){return`${t.charge??"bodies"} enter at the ${"down"===e.flow?"top":"left"}, travel ${"down"===e.flow?"downward":"left to right"} through ${t.apparatus??"the apparatus"}, and come to rest in ${e.destinations.length} ${t.destination??"destinations"}: ${e.destinations.map(e=>e.label).join(", ")}.`}function $(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function T(e,t,i,n){let r="function"==typeof e?e(t,i):e;return Number.isFinite(r)?Number(r):n}function O(e,t,i){return $(e[t])??i}function C(e,t){return"number"==typeof e?e:e?.[t]??0}function D(e){let{band:t,idPrefix:i,plot:n,projection:r}=e,{includeBoundaryWalls:o=!0,includeInteriorWalls:a=!0,wallThickness:s=4}=t,l=function(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,i=new Set;for(let n of e.values){let r=e.scale(n);Number.isFinite(r)&&(i.add(Number(r)),i.add(Number(r)+t))}return Array.from(i).sort((e,t)=>e-t)}(t);if(2>l.length)return[];let u=o?l.length-1:l.length-2,d=[];for(let e=o?0:1;u>=e;e+=1){if(!a&&e>0&&l.length-1>e)continue;let t=l[e];d.push({id:`${i}-wall-${e}`,shape:"x"===r?{type:"aabb",x:t,y:n.y+n.height/2,width:s,height:n.height}:{type:"aabb",x:n.x+n.width/2,y:t,width:n.width,height:s}})}return d}function q(e){let{plot:t,idPrefix:i="physics-scale",bounds:n={},xBins:r,xBands:o,yBands:a}=e,s=[];if(!1!==n&&s.push(...De(t,{idPrefix:i,...n})),r){let{idPrefix:e,yTop:n,yBottom:o,...a}=r;s.push(...qe({...a,idPrefix:e??i+"-xbin",yTop:n??t.y,yBottom:o??t.y+t.height}))}return o&&s.push(...D({band:o,idPrefix:o.idPrefix??i+"-xband",plot:t,projection:"x"})),a&&s.push(...D({band:a,idPrefix:a.idPrefix??i+"-yband",plot:t,projection:"y"})),s}function W(e){let{plot:t,rows:i,columns:n=i+1,pegRadius:r=3,idPrefix:o="galton-peg",yStart:a=t.y+.18*t.height,yEnd:s=t.y+.58*t.height,stagger:l=!0,restitution:u=.2,friction:d=.04}=e,p=Math.max(0,Math.floor(i)),c=Math.max(1,Math.floor(n));if(0===p)return[];let h=p>1?(s-a)/(p-1):0,m=t.width/c,f=[];for(let e=0;p>e;e+=1){let i=l&&e%2==1?m/2:0;for(let n=0;c>n;n+=1){let s=t.x+m*(n+.5)+i;t.x+r>s||s>t.x+t.width-r||f.push({id:`${o}-${e}-${n}`,shape:{type:"aabb",x:s,y:a+e*h,width:2*r,height:2*r},restitution:u,friction:d})}}return f}function X(e,t={}){let{idPrefix:i="physics-token",radius:n=5,shape:r,mass:o,vx:a,vy:s,spawnAt:l,seed:u=1,jitter:d,datum:p}=t,c=Yt(u),h=C(d,"x"),m=C(d,"y");return e.map((e,u)=>{let d=T(t.x,e,u,O(e,"x",0)),f=T(t.y,e,u,O(e,"y",0)),g=T(n,e,u,5),y="function"==typeof r?r(e,u):r??{type:"circle",radius:g};return{id:`${i}-${e.index??u}`,x:d+(c()-.5)*h,y:f+(c()-.5)*m,vx:T(a,e,u,0),vy:T(s,e,u,0),mass:T(o,e,u,1),spawnAt:T(l,e,u,void 0),shape:y,datum:p?p(e,u):e.datum??e}}).map(e=>{if(Number.isFinite(e.spawnAt))return e;let{spawnAt:t,...i}=e;return i})}function z(e,t={}){let{idPrefix:i="sediment",collider:n=!0,colliderThickness:r=1,restitution:o=.05,friction:a=.2,...s}=t,l=Nt(e,s),u=n?l.filter(e=>e.height>0).map(e=>({id:`${i}-${e.binId}`,shape:{type:"aabb",x:e.x+e.width/2,y:e.y+r/2,width:e.width,height:r},restitution:o,friction:a})):[];return{columns:l,colliders:u}}function V(e,t={}){let{timeAccessor:i="arrivalTime",timeScale:n=1,startAt:r=0,rebase:o=!0,sort:a=!0}=t,s=e.map((e,t)=>({spawn:e,time:function(e,t,i){return $("function"==typeof i?i(e,t):e[i]??e.datum?.[i])}(e,t,i)??e.spawnAt??t})),l=s.length?Math.min(...s.map(e=>e.time)):0;return{initialSpawns:s.map(({spawn:e,time:t})=>({...e,spawnAt:r+(o?t-l:t)})).sort((e,t)=>a?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:r,timeAccessor:"spawnAt",timeScale:n}}}import{BuiltInPhysicsEngineAdapter as L,ChainReactionChart as H,CollisionSwarmChart as J,CrucibleChart as Q,DEFAULT_CRUCIBLE_HEIGHT as U,DEFAULT_CRUCIBLE_OUTLETS as G,DEFAULT_CRUCIBLE_SIZE as K,DEFAULT_CRUCIBLE_WIDTH as Z,EventDropChart as _,GaltonBoardChart as ee,GauntletChart as te,GuantletChart as ie,PacketFlowChart as ne,PhysicalFlowChart as re,PhysicsCustomChart as oe,PhysicsPileChart as ae,PhysicsPipelineStore as se,PhysicsSVGOverlay as le,PhysicsSedimentAccumulator as ue,ProcessFlowChart as de,StreamPhysicsFrame as pe,StreamPhysicsFrame_default as ce,UnitPileChart as he,absorbRegion as me,aggregateRegionCounts as fe,applyCrucibleEvent as ge,applyGauntletEffect as ye,bodiesToAnnotationAnchors as be,bodyGroupSpec as xe,buildCollisionSwarmPhysics as we,buildCrucibleEvidence as ve,buildCrucibleInitialSpawns as Ae,buildCrucibleLayout as Ie,buildCruciblePhysicsConfig as Me,buildCrucibleProductEvents as Se,buildCrucibleProjection as Pe,buildCrucibleStateSpawns as Ee,buildCrucibleTerminalSpawns as je,buildEventDropPhysics as ke,buildGaltonBoardPhysics as Re,buildPhysicalFlowPhysics as Be,buildPhysicsAnnotationContext as Ne,buildPhysicsPile as Fe,buildProcessFlowPhysics as Ye,calculateBlockerAmplification as $e,capacitatedRegion as Te,chargeGateRegion as Oe,cloneCrucibleState as Ce,collidersFromPlotBounds as De,collidersFromXScaleBins as qe,compileCruciblePlan as We,compileDependencyMachine as Xe,composePhysicsControllers as ze,createCapacityQueueController as Ve,createDefaultPhysicsEngineAdapter as Le,createInitialCrucibleState as He,createLogicalJoin as Je,createPortalController as Qe,crucibleBondId as Ue,crucibleBoundaryColliders as Ge,crucibleComponentBodyId as Ke,crucibleProductBodyId as Ze,crucibleProjectionRows as _e,crucibleSemanticKey as et,defaultViability as tt,evaluateCrucibleConservation as it,evaluatePhysicsBodyBudget as nt,eventLogItem as rt,forceFieldRegion as ot,groupCompletionRows as at,matchesPhysicsBodyFilter as st,membraneRegion as lt,normalizePhysicsAnnotations as ut,physicsProcessBoundaryColliders as dt,physicsProcessGroupSemanticItems as pt,physicsProcessRegionSemanticItem as ct,physicsProcessStageSemanticItems as ht,planGauntletPropertyWork as mt,portalRegion as ft,pressureFieldRegion as gt,processChrome as yt,processLaneWalls as bt,processStageLayout as xt,processStageRegions as wt,readEventDropOccupancy as vt,recordGauntletEvent as At,regionCountsToProjectionRows as It,replaceGauntletNegative as Mt,replayCruciblePlan as St,replayStateTransitions as Pt,resolveCrucibleSelector as Et,resolveCrucibleSnapshotAt as jt,resolveCrucibleTime as kt,routeDependencyTracks as Rt,routeSurfaceRegion as Bt,sedimentHeightfield as Nt,valueAtPath as Ft}from"./c-ZIVPFTOC.min.js";import"./c-HP4ZFM47.min.js";import{mulberry32 as Yt}from"./c-HYW2XA4Q.min.js";import"./c-VJTDST2R.min.js";import"./c-EUBTECGM.min.js";import{MultiLineTooltip as $t,Tooltip as Tt,TooltipRoot as Ot,compileMotionEncoding as Ct,composeStyleRules as Dt,deriveMotionVector as qt,makeRuleValueResolver as Wt,markTooltipChrome as Xt,matchesThreshold as zt,opacityFromAge as Vt,resolveMotionAccessor as Lt,resolveMotionAge as Ht,resolveMotionVector as Jt,resolveStyleRules as Qt,ruleMatches as Ut}from"./c-ODG6TFSY.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import{hatchFillId as Gt,hatchPatternDef as Kt,isHatchFill as Zt,resolveSvgFill as _t}from"./c-MB6CV5NC.min.js";var ei=[.1,.5,.9],ti=1e6,ii="down",ni=24,ri=.12,oi=.55,ai=0,si=1,li=ce;export{L as BuiltInPhysicsEngineAdapter,H as ChainReactionChart,J as CollisionSwarmChart,Q as CrucibleChart,U as DEFAULT_CRUCIBLE_HEIGHT,G as DEFAULT_CRUCIBLE_OUTLETS,K as DEFAULT_CRUCIBLE_SIZE,Z as DEFAULT_CRUCIBLE_WIDTH,_ as EventDropChart,ee as GaltonBoardChart,te as GauntletChart,ie as GuantletChart,$t as MultiLineTooltip,ne as PacketFlowChart,re as PhysicalFlowChart,oe as PhysicsCustomChart,ae as PhysicsPileChart,se as PhysicsPipelineStore,le as PhysicsSVGOverlay,ue as PhysicsSedimentAccumulator,de as ProcessFlowChart,pe as StreamPhysicsFrame,Tt as Tooltip,Ot as TooltipRoot,he as UnitPileChart,me as absorbRegion,fe as aggregateRegionCounts,ge as applyCrucibleEvent,V as arrivalReplay,be as bodiesToAnnotationAnchors,xe as bodyGroupSpec,we as buildCollisionSwarmPhysics,ve as buildCrucibleEvidence,Ae as buildCrucibleInitialSpawns,Ie as buildCrucibleLayout,Me as buildCruciblePhysicsConfig,Se as buildCrucibleProductEvents,Pe as buildCrucibleProjection,Ee as buildCrucibleStateSpawns,je as buildCrucibleTerminalSpawns,ke as buildEventDropPhysics,Re as buildGaltonBoardPhysics,Be as buildPhysicalFlowPhysics,Ne as buildPhysicsAnnotationContext,Fe as buildPhysicsPile,Ye as buildProcessFlowPhysics,$e as calculateBlockerAmplification,Te as capacitatedRegion,Oe as chargeGateRegion,Ce as cloneCrucibleState,q as collidersFromScales,A as comparePhysicsTrace,We as compileCruciblePlan,Xe as compileDependencyMachine,Ct as compileMotionEncoding,e as compilePhysicsEncoding,ze as composePhysicsControllers,Dt as composeStyleRules,Ve as createCapacityQueueController,Le as createDefaultPhysicsEngineAdapter,s as createDependencyGateController,He as createInitialCrucibleState,Je as createLogicalJoin,t as createPhysicsEncodingLayout,Qe as createPortalController,E as createProcessJourneyLedger,a as createServiceLevelController,r as createServiceResourcePoolController,Ue as crucibleBondId,Ge as crucibleBoundaryColliders,Ke as crucibleComponentBodyId,Ze as crucibleProductBodyId,_e as crucibleProjectionRows,et as crucibleSemanticKey,li as default,qt as deriveMotionVector,Y as describePhysicsStageGeography,it as evaluateCrucibleConservation,nt as evaluatePhysicsBodyBudget,ot as forceFieldRegion,W as galtonPegs,at as groupCompletionRows,Gt as hatchFillId,Kt as hatchPatternDef,Zt as isHatchFill,Wt as makeRuleValueResolver,Xt as markTooltipChrome,zt as matchesThreshold,lt as membraneRegion,ut as normalizePhysicsAnnotations,Vt as opacityFromAge,N as physicsChargePoint,B as physicsDestination,dt as physicsProcessBoundaryColliders,pt as physicsProcessGroupSemanticItems,ct as physicsProcessRegionSemanticItem,ht as physicsProcessStageSemanticItems,y as physicsReferenceEnvelope,F as physicsStageColliders,R as physicsStageGeography,mt as planGauntletPropertyWork,ft as portalRegion,gt as pressureFieldRegion,yt as processChrome,k as processJourneyRows,bt as processLaneWalls,xt as processStageLayout,wt as processStageRegions,d as processVolumePolygons,vt as readEventDropOccupancy,It as regionCountsToProjectionRows,Mt as replaceGauntletNegative,St as replayCruciblePlan,Pt as replayStateTransitions,Et as resolveCrucibleSelector,jt as resolveCrucibleSnapshotAt,kt as resolveCrucibleTime,i as resolveGauntletTerminalState,n as resolveGauntletTerminalStates,Lt as resolveMotionAccessor,Ht as resolveMotionAge,Jt as resolveMotionVector,Qt as resolveStyleRules,_t as resolveSvgFill,Rt as routeDependencyTracks,Bt as routeSurfaceRegion,Ut as ruleMatches,z as sedimentBake,Nt as sedimentHeightfield,X as spawnFromTokens,u as stageTargetInVolume,j as updateProcessJourney};
|
|
2
|
+
function e(e){let{data:t,encoding:a,defaults:i={},scales:s}=e,n=ea({data:t,encoding:a}),r=[],o=/* @__PURE__ */new Map,l=[],u=[],c=/* @__PURE__ */new Map;return n.rows.forEach((e,t)=>{let{id:n,datum:d}=e,p=Math.max(0,Zt(a.appearance?.size,d,t)??i.size??6),h=Zt(a.appearance?.shape,d,t)??i.shape??{type:"circle",radius:p},m=e.placement.x??i.x??0,y=e.placement.y??i.y??0,f=s?.x?s.x(m):m,g=s?.y?s.y(y):y,b=Zt(a.appearance?.color,d,t)??i.color,v=Zt(a.appearance?.opacity,d,t)??i.opacity,w=Zt(a.appearance?.stroke,d,t)??i.stroke,x=Zt(a.appearance?.strokeWidth,d,t)??i.strokeWidth,I=Zt(a.time?.spawnAt,d,t)??e.time.arrival,A=e.kinematics.velocityX,S=e.kinematics.velocityY,P=Zt(a.dynamics?.mass,d,t)??i.mass??1,C=Zt(a.dynamics?.friction,d,t),M=Zt(a.dynamics?.restitution,d,t),R=Zt(a.dynamics?.bodyCollisions,d,t),E={id:n,x:f,y:g,mass:P,shape:{...h},datum:d,...null!=I&&{spawnAt:I},...null!=A&&{vx:A},...null!=S&&{vy:S},...null!=C&&{friction:C},...null!=M&&{restitution:M},...null!=R&&{bodyCollisions:R}},B={...null!=b&&{fill:b},...null!=v&&{opacity:v},...null!=w&&{stroke:w},...null!=x&&{strokeWidth:x}},F={id:n,datum:d,appearance:{color:b,opacity:v,shape:h,size:p,stroke:w,strokeWidth:x},placement:{x:f,y:g,lane:e.placement.lane,space:a.placement?.space??"world"},time:{arrival:I,spawnAt:I,basis:a.time?.basis??"simulation",unit:a.time?.unit},kinematics:{velocityX:A,velocityY:S,space:a.kinematics?.space??"world"},dynamics:{bodyCollisions:R,friction:C,mass:P,restitution:M},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:E};r.push(F),o.set(n,F),l.push(E),c.set(n,B),u.push({id:n,bodyId:n,label:e.accessible.label,description:e.accessible.description,datum:d,x:f,y:g,group:e.accessible.group})}),{rows:r,byId:o,spawns:l,semanticItems:u,bodyStyle:e=>c.get(e.id)??{}}}function t(t){return a=>{let i=e({data:a.data,encoding:t.encoding,defaults:t.defaults,scales:a.scales}),s=t.extend?.(a,i)??{};return{...s,initialSpawns:i.spawns,bodyStyle:i.bodyStyle,semanticItems:[...i.semanticItems,...s.semanticItems??[]]}}}function a(e){return new Map(e.gates.map(e=>[e.id,e]))}function i(e,t){let{layout:i,positiveProperties:s,negativeProperties:n,viability:r,outcome:o}=t,l=a(i),u=[...("function"==typeof t.events?t.events(e,i):t.events)??[]].sort((e,t)=>e.time-t.time),c=e;for(let e of u){let t=e.gateId?l.get(e.gateId):void 0,a=e.effects??[],u={..._e(e,a),appliedAt:e.time},d=Ke(c,u);if(d!==c){c=d;for(let i of a){let a={event:e,gate:t,negativeProperties:n,positiveProperties:s,project:c};i.when&&!i.when(a)||(c=He(c,i,a))}c={...c,viability:r?.(c,{negativeProperties:n,positiveProperties:s})??qe(c,s,n)},e.final&&(c={...c,outcome:e.outcome??o?.(c,{layout:i,negativeProperties:n,positiveProperties:s})??(c.viability>20?"built":"approved_not_built")})}}return c}function s(e){return e.projects.map(t=>i(t,e))}function n(e){let t=e.resources.map(e=>({...e,bodyId:e.bodyId??e.id})),a=new Map(t.map(e=>[e.bodyId,e])),i=/* @__PURE__ */new Map,s=/* @__PURE__ */new Map,n=e.assignmentForce??.45,r=e.returnForce??.35,o=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=/* @__PURE__ */new Map,c=0,d=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let a=i.get(e);if(a)return a;let n=t.find(e=>!s.has(e.id));if(!n)return null;let r={resourceId:n.id,resourceBodyId:n.bodyId,caseBodyId:e,assignedAt:c};return i.set(e,r),s.set(n.id,r),d+=1,r},release:e=>{let t=i.get(e);return!!t&&(i.delete(e),s.delete(t.resourceId),d+=1,!0)},getAssignment:e=>i.get(e),tick:e=>{c=Math.max(c,e.elapsed),u=new Map(e.controls.readBodies().map(e=>[e.id,e]));for(let[e,t]of i)u.has(e)&&u.has(t.resourceBodyId)||(i.delete(e),s.delete(t.resourceId),d+=1)},getSnapshot:()=>({total:t.length,available:t.length-s.size,assigned:s.size,assignments:Array.from(i.values()),simulatedAt:c,metricRevision:d}),bodyForce:e=>{let t=a.get(e.body.id);if(t){let a=s.get(t.id),i=a?u.get(a.caseBodyId):void 0,o=a?n:r;return{x:((i?i.x+(l.x??0):t.home.x)-e.body.x)*o,y:((i?i.y+(l.y??0):t.home.y)-e.body.y)*o}}let c=i.get(e.body.id);if(!c||0>=o)return null;let d=u.get(c.resourceBodyId);return d?{x:(d.x-e.body.x)*o,y:(d.y-e.body.y)*o}:null}}}function r(e,t){let a="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):et(e.datum,t.deadlineAccessor)??et(e,t.deadlineAccessor);return Number.isFinite(Number(a))?Math.max(0,Number(a)):0}function o(e){function t(t){i.set(t.bodyId,t),n+=1,e.onStateChange?.({...t})}function a(e){let a=i.get(e);return!(!a||null!=a.completedAt||(t({...a,completedAt:s,state:"unhappy"===a.state?"resolved-unhappy":"resolved"}),0))}let i=/* @__PURE__ */new Map,s=0,n=0;return{id:e.id??"service-level",continuous:!0,protect:e=>{let a=i.get(e);return!(!a||null!=a.completedAt||"unhappy"===a.state||(t({...a,state:"protected",protectedAt:s}),0))},complete:a,getCase:e=>i.get(e),tick:n=>{s=Math.max(s,n.elapsed);for(let o of n.controls.readBodies()){if(!at(o,e.bodyFilter))continue;if(!i.has(o.id)){let a=r(o,e);t({bodyId:o.id,openedAt:s,deadlineAt:s+a,state:"waiting"})}let l=i.get(o.id);l&&null==l.completedAt&&(e.completionRegionId&&n.getRegionState(o.id)?.activeRegionIds.includes(e.completionRegionId)?a(o.id):"waiting"===l.state&&s>=l.deadlineAt&&t({...l,state:"unhappy"}))}},getSnapshot:()=>{let e=Array.from(i.values()),t=t=>e.filter(e=>e.state===t).length;return{total:e.length,waiting:t("waiting"),protected:t("protected"),unhappy:t("unhappy"),resolved:t("resolved"),resolvedUnhappy:t("resolved-unhappy"),simulatedAt:s,metricRevision:n}}}}function l(e){function t(t){return e.isOpen?e.isOpen(t):null!=e.opensAt&&t>=e.opensAt}let a=/* @__PURE__ */new Set,i=0,s=0,n=0,r=!1;return{id:e.id??"dependency-gate:"+e.regionId,continuous:!0,tick:o=>{i=Math.max(i,o.elapsed);let l=r;r=t(i);let u=o.controls.readBodies(),c=new Map(u.map(e=>[e.id,e]));for(let t of u)!o.getRegionState(t.id)?.activeRegionIds.includes(e.regionId)||!at(t,e.bodyFilter)||!r&&!a.has(t.id)&&(a.add(t.id),n+=1,e.onHeld?.(t));if(r&&!l){for(let t of a){let a=c.get(t);a&&(o.controls.applyImpulse(t,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),s+=1,e.onReleased?.(a))}a.clear(),n+=1}for(let e of a)c.has(e)||(a.delete(e),n+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:r,blocked:a.size,released:s,simulatedAt:i,metricRevision:n}),bodyForce:t=>{if(r||!a.has(t.body.id))return null;let i=t.regions?.find(t=>t.id===e.regionId)?.shape;if(!i||"aabb"!==i.type)return{x:.8*-t.body.vx,y:.8*-t.body.vy};let s=e.holdForce??.4;return{x:(i.x-t.body.x)*s-.45*t.body.vx,y:(i.y-t.body.y)*s-.45*t.body.vy}}}}function u(e,t,a){return Math.max(t,Math.min(a,e))}function c(e,t,a={}){let i=a.random??Math.random,s=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],n=u(a.along??.5,.05,.95),r=a.jitterX??0,o=a.padY??20,l=s.x0+(s.x1-s.x0)*n+(2*i()-1)*r,c=Math.min(1,s.width/2),d=u(l,s.x0+c,s.x1-c),p=e.boundaryY(d,"top")+o,h=e.boundaryY(d,"bottom")-o;return{x:d,y:h>p?p+i()*Math.max(1,h-p):e.midY}}function d(e){return"bowtie"===e.shape?[{id:"incoming",role:"incoming",points:[[e.left,e.topY],[e.centerLeft,e.pinchTop],[e.centerLeft,e.pinchBottom],[e.left,e.bottomY]]},{id:"center",role:"center",points:[[e.centerLeft,e.pinchTop],[e.centerRight,e.pinchTop],[e.centerRight,e.pinchBottom],[e.centerLeft,e.pinchBottom]]},{id:"outgoing",role:"outgoing",points:[[e.centerRight,e.pinchTop],[e.right,e.topY],[e.right,e.bottomY],[e.centerRight,e.pinchBottom]]}]:[{id:"volume",role:"volume",points:[[e.left,e.topY],[e.right,"funnel"===e.shape?e.pinchTop:e.topY],[e.right,"funnel"===e.shape?e.pinchBottom:e.bottomY],[e.left,e.bottomY]]}]}function p(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function h(e,t){let a=e;for(let e of t.split(".")){if(null==a||"object"!=typeof a||!Object.prototype.hasOwnProperty.call(a,e))return;a=a[e]}return a}function m(e,t,a,i,s){return"function"==typeof i?i(e,t,a):h(e,i??s)}function y(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function f(e){let t=(e??ca).map(e=>{let t=p(e);if(null==t||0>t||t>1)throw new RangeError("physicsReferenceEnvelope quantiles must be finite values from 0 to 1; received "+e);return y(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}function g(e){if(Array.isArray(e)){if(e.length>da)throw new RangeError(`physicsReferenceEnvelope sampleAt exceeds ${da} points`);return Array.from(new Set(e.map(p).filter(e=>null!=e).map(y))).sort((e,t)=>e-t)}let t=e,a=p(t.start),i=p(t.end),s=p(t.step);if(null==a||null==i||null==s||0>=s||a>i)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let n=Math.floor((i-a)/s)+1;if(n>da)throw new RangeError(`physicsReferenceEnvelope sampleAt exceeds ${da} points`);let r=[],o=1e-10*Math.max(1,Math.abs(i),Math.abs(a));for(let e=0;n>e;e+=1){let t=a+e*s;if(t>i+o)break;r.push(y(Math.min(t,i)))}if((!r.length||Math.abs(r[r.length-1]-i)>o)&&r.push(y(i)),r.length>da)throw new RangeError(`physicsReferenceEnvelope sampleAt exceeds ${da} points`);return Array.from(new Set(r)).sort((e,t)=>e-t)}function b(e,t,a,i){let s=e.flatMap((e,s)=>{let n=p(m(e,s,t,a,"time")),r=p(m(e,s,t,i,"value"));return null==n||null==r?[]:[{time:y(n),value:r,index:s}]});s.sort((e,t)=>e.time-t.time||e.index-t.index);let n=[];for(let e of s){let t=n[n.length-1];t?.time===e.time?t.value=e.value:n.push({time:e.time,value:e.value})}return n}function v(e,t){let a=0,i=e.length;for(;i>a;){let s=a+i>>>1;t>e[s].time?a=s+1:i=s}return a}function w(e,t,a,i){if(!e.length)return null;let s=e[0],n=e[e.length-1];if(s.time>t)return"clamp"===i?s.value:null;if(t>n.time)return"clamp"===i?n.value:null;let r=v(e,t),o=e[r];if(o?.time===t)return o.value;let l=e[Math.max(0,r-1)];return"step"!==a&&o&&o.time!==l.time?l.value+(t-l.time)/(o.time-l.time)*(o.value-l.value):l.value}function x(e,t){if(1===e.length)return e[0];let a=(e.length-1)*t,i=Math.floor(a),s=Math.ceil(a);return i===s?e[i]:e[i]+(e[s]-e[i])*(a-i)}function I(e){let t=e.interpolation??"step",a=e.outsideDomain??"omit",i=f(e.quantiles),s=g(e.sampleAt),n=e.runs.map(t=>b(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:s.map(e=>{let s=n.map(i=>w(i,e,t,a)).filter(e=>null!=e).sort((e,t)=>e-t),r={};for(let e of i)r[e]=s.length?x(s,e):null;return{time:e,count:s.length,min:s.length?s[0]:null,max:s.length?s[s.length-1]:null,median:s.length?x(s,.5):null,quantiles:r}}),quantiles:i,interpolation:t,outsideDomain:a,runCount:e.runs.length}}function A(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function S(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let a=p(t);if(null==a||0>a||a>1)throw new RangeError("comparePhysicsTrace quantile selectors must be from 0 to 1; received "+t);let i=y(a);if(!Object.prototype.hasOwnProperty.call(e.quantiles,i))throw Error(`comparePhysicsTrace could not find quantile ${i} in the reference envelope`);return e.quantiles[i]??null}function P(e,t,a){return t>e?"below":e>a?"above":"inside"}function C(e,t){let a=Math.max(0,t.time-e.time);if(0>=a||null==e.value||null==e.lower||null==e.upper||null==t.value||null==t.lower||null==t.upper)return{below:0,inside:0,above:0,observed:0};let i=e.value-e.lower,s=t.value-t.lower,n=e.value-e.upper,r=t.value-t.upper,o=[0,1];for(let[e,t]of[[i,s],[n,r]])(0>e&&t>0||e>0&&0>t)&&o.push(-e/(t-e));o.sort((e,t)=>e-t);let l=0,u=0,c=0;for(let i=0;o.length-1>i;i+=1){let s=o[i],n=o[i+1];if(s>=n)continue;let r=(s+n)/2,d=(n-s)*a,p=P(e.value+(t.value-e.value)*r,e.lower+(t.lower-e.lower)*r,e.upper+(t.upper-e.upper)*r);"below"===p?l+=d:"above"===p?c+=d:u+=d}return{below:l,inside:u,above:c,observed:a}}function M(e,t,a={}){let i=a.interpolation??t.interpolation,s=a.outsideDomain??t.outsideDomain,n=b(e,a.traceId??"trace",a.timeAccessor,a.valueAccessor),r=a.lower??A(t,"lower"),o=a.upper??A(t,"upper"),l=t.points.map(e=>{let t=w(n,e.time,i,s),a=S(e,r),l=S(e,o);if(null!=a&&null!=l&&a>l)throw new RangeError("comparePhysicsTrace lower band exceeds upper band at time "+e.time);return{time:e.time,value:t,lower:a,upper:l,status:null==t||null==a||null==l?"unobserved":P(t,a,l)}}),u=0,c=0,d=0,p=0,h=null,m=0,y=null;for(let e of l){if("below"===e.status?u+=1:"inside"===e.status?c+=1:"above"===e.status&&(d+=1),null==e.value||null==e.lower||null==e.upper)continue;let t=Math.max(0,e.value-e.upper),a=Math.max(0,e.lower-e.value);t>p&&(p=t,h=e.time),a>m&&(m=a,y=e.time)}let f=0,g=0,v=0,x=0;for(let e=0;l.length-1>e;e+=1){let t=l[e],a=l[e+1],s=Math.max(0,a.time-t.time);if(s>0){if("linear"===i){let e=C(t,a);f+=e.below,g+=e.inside,v+=e.above,x+=e.observed;continue}"unobserved"!==t.status&&(x+=s,"below"===t.status?f+=s:"above"===t.status?v+=s:g+=s)}}let I=l[0]?.time,M=l[l.length-1]?.time,R=null==I||null==M?0:Math.max(0,M-I);return{points:l,sampleCount:l.length,observedSamples:u+c+d,belowSamples:u,insideSamples:c,aboveSamples:d,totalDuration:R,observedDuration:x,unobservedDuration:Math.max(0,R-x),belowDuration:f,insideDuration:g,aboveDuration:v,peakExcess:p,peakExcessAt:h,peakDeficit:m,peakDeficitAt:y}}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function E(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function B(e){return!!E(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&E(e.visitsByStage)&&E(e.firstEnteredAt)&&E(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function F(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function k(e,t){let a=t.stageId?.(e);if(a)return a;let i=e.region.metadata;if(i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,"stageId")){let e=i.stageId;if("string"==typeof e)return e}return e.region.id}function T(e){let t=Array.from(new Set(e.bodyIds??[]));return{stages:e.stages.map(e=>({...e})),bodyIds:t,entities:Object.fromEntries(t.map(e=>[e,F(e)]))}}function j(e,t,a={}){if("region-enter"!==t.type)return e;let i=k(t,a),s=e.stages.findIndex(e=>e.id===i);if(0>s)return e;let n=a.entityId?.(t)??t.bodyId;if(!n)return e;let r=R(e.entities,n),o=B(r)?r:F(n),l=o.currentStageId?e.stages.findIndex(e=>e.id===o.currentStageId):-1,u=!o.visitedStageIds.includes(i),c=Number(t.observation.timestamp),d=Number.isFinite(c)?c:0,p=R(o.visitsByStage,i),h="number"==typeof p&&Number.isFinite(p)?p:0,m={...o,currentStageId:i,furthestStageId:s>o.furthestStageIndex?i:o.furthestStageId,furthestStageIndex:Math.max(o.furthestStageIndex,s),visitedStageIds:u?[...o.visitedStageIds,i]:o.visitedStageIds,visitsByStage:{...o.visitsByStage,[i]:h+1},firstEnteredAt:u?{...o.firstEnteredAt,[i]:d}:o.firstEnteredAt,lastEnteredAt:{...o.lastEnteredAt,[i]:d},regressionCount:l>=0&&l>s?o.regressionCount+1:o.regressionCount};return{...e,bodyIds:e.bodyIds.includes(n)?e.bodyIds:[...e.bodyIds,n],entities:{...e.entities,[n]:m}}}function N(e){let t=e.bodyIds.map(t=>{let a=R(e.entities,t);return B(a)?a:F(t)}),a=t.length,i=a;return e.stages.map((e,s)=>{let n=t.filter(e=>e.furthestStageIndex>=s).length,r=t.filter(t=>t.visitedStageIds.includes(e.id)).length,o=t.reduce((t,a)=>{let i=R(a.visitsByStage,e.id);return t+("number"==typeof i&&Number.isFinite(i)?i:0)},0),l={id:e.id,label:e.label??e.id,reached:n,entered:r,total:a,conversion:a>0?n/a:0,fromPrevious:i>0?n/i:0,dropoff:Math.max(0,i-n),visits:o,repeatVisits:Math.max(0,o-r)};return i=n,l})}function D(e){return null==e?{top:ha,right:ha,bottom:ha,left:ha}:"number"==typeof e?{top:e,right:e,bottom:e,left:e}:{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function L(e){return"number"==typeof e?Array.from({length:Math.max(1,Math.round(e))},(e,t)=>({id:"bin-"+t,label:t+""})):0===e.length?[{id:"bin-0",label:"0"}]:e.map((e,t)=>({id:e.id,label:e.label??e.id??t+""}))}function Y(e){let[t,a]=e.size,i=e.flow??pa,s=D(e.padding),n=Math.max(.05,Math.min(1,e.channelRatio??ga)),r={x:s.left,y:s.top,width:Math.max(1,t-s.left-s.right),height:Math.max(1,a-s.top-s.bottom)},o="down"===i?r.height:r.width,l=o*Math.max(0,e.chargeExtent??ma),u=o*Math.max(0,e.projectionExtent??fa),c=o*Math.max(0,e.destinationExtent??ya),d=Math.max(0,o-l-c-u),p=L(e.destinations),h=("down"===i?r.width:r.height)/p.length,m="down"===i?(e,t)=>({x:r.x,y:r.y+e,width:r.width,height:t}):(e,t)=>({x:r.x+e,y:r.y,width:t,height:r.height}),y=m(0,l),f=m(l,d),g=l+d,b=m(g,c),v=m(g+c,u),w=p.map((e,t)=>{let a=t*h,s=h*n,o=(h-s)/2;return"down"===i?{id:e.id,label:e.label,order:t,x:r.x+a+o,y:b.y,width:s,height:b.height,centerX:r.x+(t+.5)*h,centerY:b.y+b.height/2}:{id:e.id,label:e.label,order:t,x:b.x,y:r.y+a+o,width:b.width,height:s,centerX:b.x+b.width/2,centerY:r.y+(t+.5)*h}});return{width:t,height:a,flow:i,charge:y,apparatus:f,destinations:w,projection:v}}function $(e,t){return e.destinations.find(e=>e.id===t)}function O(e,t,a){let{charge:i,flow:s}=e,n=Math.max(1,a),r=(t%n+.5)/n;return"down"===s?{x:i.x+i.width*r,y:i.y+i.height/2}:{x:i.x+i.width/2,y:i.y+i.height*r}}function G(e,t={}){let a=t.thickness??4,i=t.idPrefix??"stage",{destinations:s,flow:n,width:r,height:o}=e,l=[];if(s.length>0){let t=s[0];if("down"===n){let n=t.y+t.height;l.push({id:i+"-floor",shape:{type:"segment",x1:e.charge.x,y1:n,x2:e.charge.x+e.charge.width,y2:n,thickness:a}});for(let e=1;s.length>e;e+=1){let r=s[e].centerX-(s[e].centerX-s[e-1].centerX)/2;l.push({id:`${i}-divider-${e}`,shape:{type:"segment",x1:r,y1:t.y,x2:r,y2:n,thickness:a}})}}else{let n=t.x+t.width;l.push({id:i+"-floor",shape:{type:"segment",x1:n,y1:e.charge.y,x2:n,y2:e.charge.y+e.charge.height,thickness:a}});for(let e=1;s.length>e;e+=1){let r=s[e].centerY-(s[e].centerY-s[e-1].centerY)/2;l.push({id:`${i}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:r,x2:n,y2:r,thickness:a}})}}}return!1!==t.walls&&l.push({id:i+"-wall-left",shape:{type:"segment",x1:1,y1:0,x2:1,y2:o,thickness:a}},{id:i+"-wall-right",shape:{type:"segment",x1:r-1,y1:0,x2:r-1,y2:o,thickness:a}}),l}function V(e,t={}){return`${t.charge??"bodies"} enter at the ${"down"===e.flow?"top":"left"}, travel ${"down"===e.flow?"downward":"left to right"} through ${t.apparatus??"the apparatus"}, and come to rest in ${e.destinations.length} ${t.destination??"destinations"}: ${e.destinations.map(e=>e.label).join(", ")}.`}function X(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function q(e,t,a,i){let s="function"==typeof e?e(t,a):e;return Number.isFinite(s)?Number(s):i}function U(e,t,a){return X(e[t])??a}function z(e,t){return"number"==typeof e?e:e?.[t]??0}function H(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,a=/* @__PURE__ */new Set;for(let i of e.values){let s=e.scale(i);Number.isFinite(s)&&(a.add(Number(s)),a.add(Number(s)+t))}return Array.from(a).sort((e,t)=>e-t)}function W(e){let{band:t,idPrefix:a,plot:i,projection:s}=e,{includeBoundaryWalls:n=!0,includeInteriorWalls:r=!0,wallThickness:o=4}=t,l=H(t);if(2>l.length)return[];let u=n?l.length-1:l.length-2,c=[];for(let e=n?0:1;u>=e;e+=1){if(!r&&e>0&&l.length-1>e)continue;let t=l[e];c.push({id:`${a}-wall-${e}`,shape:"x"===s?{type:"aabb",x:t,y:i.y+i.height/2,width:o,height:i.height}:{type:"aabb",x:i.x+i.width/2,y:t,width:i.width,height:o}})}return c}function _(e){let{plot:t,idPrefix:a="physics-scale",bounds:i={},xBins:s,xBands:n,yBands:r}=e,o=[];if(!1!==i&&o.push(...mt(t,{idPrefix:a,...i})),s){let{idPrefix:e,yTop:i,yBottom:n,...r}=s;o.push(...ft({...r,idPrefix:e??a+"-xbin",yTop:i??t.y,yBottom:n??t.y+t.height}))}return n&&o.push(...W({band:n,idPrefix:n.idPrefix??a+"-xband",plot:t,projection:"x"})),r&&o.push(...W({band:r,idPrefix:r.idPrefix??a+"-yband",plot:t,projection:"y"})),o}function J(e){let{plot:t,rows:a,columns:i=a+1,pegRadius:s=3,idPrefix:n="galton-peg",yStart:r=t.y+.18*t.height,yEnd:o=t.y+.58*t.height,stagger:l=!0,restitution:u=.2,friction:c=.04}=e,d=Math.max(0,Math.floor(a)),p=Math.max(1,Math.floor(i));if(0===d)return[];let h=d>1?(o-r)/(d-1):0,m=t.width/p,y=[];for(let e=0;d>e;e+=1){let a=l&&e%2==1?m/2:0;for(let i=0;p>i;i+=1){let o=t.x+m*(i+.5)+a;t.x+s>o||o>t.x+t.width-s||y.push({id:`${n}-${e}-${i}`,shape:{type:"aabb",x:o,y:r+e*h,width:2*s,height:2*s},restitution:u,friction:c})}}return y}function K(e,t={}){let{idPrefix:a="physics-token",radius:i=5,shape:s,mass:n,vx:r,vy:o,spawnAt:l,seed:u=1,jitter:c,datum:d}=t,p=qt(u),h=z(c,"x"),m=z(c,"y");return e.map((e,u)=>{let c=q(t.x,e,u,U(e,"x",0)),y=q(t.y,e,u,U(e,"y",0)),f=q(i,e,u,5),g="function"==typeof s?s(e,u):s??{type:"circle",radius:f};return{id:`${a}-${e.index??u}`,x:c+(p()-.5)*h,y:y+(p()-.5)*m,vx:q(r,e,u,0),vy:q(o,e,u,0),mass:q(n,e,u,1),spawnAt:q(l,e,u,void 0),shape:g,datum:d?d(e,u):e.datum??e}}).map(e=>{if(Number.isFinite(e.spawnAt))return e;let{spawnAt:t,...a}=e;return a})}function Q(e,t={}){let{idPrefix:a="sediment",collider:i=!0,colliderThickness:s=1,restitution:n=.05,friction:r=.2,...o}=t,l=ct(e,o),u=i?l.filter(e=>e.height>0).map(e=>({id:`${a}-${e.binId}`,shape:{type:"aabb",x:e.x+e.width/2,y:e.y+s/2,width:e.width,height:s},restitution:n,friction:r})):[];return{columns:l,colliders:u}}function Z(e,t,a){return X("function"==typeof a?a(e,t):e[a]??e.datum?.[a])}function ee(e,t={}){let{timeAccessor:a="arrivalTime",timeScale:i=1,startAt:s=0,rebase:n=!0,sort:r=!0}=t,o=e.map((e,t)=>({spawn:e,time:Z(e,t,a)??e.spawnAt??t})),l=o.length?Math.min(...o.map(e=>e.time)):0;return{initialSpawns:o.map(({spawn:e,time:t})=>({...e,spawnAt:s+(n?t-l:t)})).sort((e,t)=>r?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:s,timeAccessor:"spawnAt",timeScale:i}}}import{$ as te,A as ae,Aa as ie,B as se,Ba as ne,C as re,Ca as oe,D as le,Da as ue,E as ce,Ea as de,F as pe,Fa as he,G as me,Ga as ye,H as fe,Ha as ge,I as be,Ia as ve,J as we,Ja as xe,K as Ie,Ka as Ae,L as Se,La as Pe,M as Ce,Ma as Me,N as Re,Na as Ee,O as Be,Oa as Fe,P as ke,Pa as Te,Q as je,Qa as Ne,R as De,S as Le,T as Ye,U as $e,V as Oe,W as Ge,X as Ve,Y as Xe,Z as qe,_ as Ue,a as ze,aa as He,b as We,ba as _e,c as Je,ca as Ke,d as Qe,da as Ze,e as et,ea as tt,f as at,fa as it,g as st,ga as nt,h as rt,ha as ot,i as lt,ia as ut,j as ct,ja as dt,k as pt,ka as ht,l as mt,la as yt,m as ft,ma as gt,n as bt,na as vt,o as wt,oa as xt,p as It,pa as At,q as St,qa as Pt,r as Ct,ra as Mt,s as Rt,sa as Et,t as Bt,ta as Ft,u as kt,ua as Tt,v as jt,va as Nt,w as Dt,wa as Lt,x as Yt,xa as $t,y as Ot,ya as Gt,z as Vt,za as Xt}from"./c-72CBVNYX.min.js";import"./c-MOP2NGLH.min.js";import{a as qt}from"./c-RHDOOQ4X.min.js";import"./c-UBHICVSC.min.js";import"./c-N5WT7TXG.min.js";import{Aa as Ut,Nb as zt,Oa as Ht,Pa as Wt,Qb as _t,Rb as Jt,Sb as Kt,Tb as Qt,i as Zt,j as ea,k as ta,l as aa,m as ia,n as sa,za as na}from"./c-G53AVC42.min.js";import"./c-Y342FJ6K.min.js";import{r as ra,s as oa,t as la,u as ua}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import"./c-3PFVJFBK.min.js";var ca=[.1,.5,.9],da=1e6,pa="down",ha=24,ma=.12,ya=.55,fa=0,ga=1,ba=Rt;export{st as BuiltInPhysicsEngineAdapter,Ne as ChainReactionChart,$e as CollisionSwarmChart,Ae as CrucibleChart,Mt as DEFAULT_CRUCIBLE_HEIGHT,Ft as DEFAULT_CRUCIBLE_OUTLETS,Et as DEFAULT_CRUCIBLE_SIZE,Pt as DEFAULT_CRUCIBLE_WIDTH,je as EventDropChart,ke as GaltonBoardChart,Ze as GauntletChart,tt as GuantletChart,Wt as MultiLineTooltip,it as PacketFlowChart,nt as PhysicalFlowChart,Ye as PhysicsCustomChart,Le as PhysicsPileChart,bt as PhysicsPipelineStore,Qe as PhysicsSVGOverlay,lt as PhysicsSedimentAccumulator,ut as ProcessFlowChart,Ct as StreamPhysicsFrame,Ht as Tooltip,na as TooltipRoot,De as UnitPileChart,Ie as absorbRegion,Vt as aggregateRegionCounts,yt as applyCrucibleEvent,ee as arrivalReplay,ze as bodiesToAnnotationAnchors,Ce as bodyGroupSpec,Yt as buildCollisionSwarmPhysics,At as buildCrucibleEvidence,ne as buildCrucibleInitialSpawns,Nt as buildCrucibleLayout,$t as buildCruciblePhysicsConfig,xe as buildCrucibleProductEvents,gt as buildCrucibleProjection,oe as buildCrucibleStateSpawns,ue as buildCrucibleTerminalSpawns,kt as buildEventDropPhysics,Bt as buildGaltonBoardPhysics,Ot as buildPhysicalFlowPhysics,We as buildPhysicsAnnotationContext,Dt as buildPhysicsPile,Be as buildProcessFlowPhysics,Te as calculateBlockerAmplification,be as capacitatedRegion,pe as chargeGateRegion,dt as cloneCrucibleState,_ as collidersFromScales,M as comparePhysicsTrace,ve as compileCruciblePlan,Pe as compileDependencyMachine,ea as compileMotionEncoding,e as compilePhysicsEncoding,It as composePhysicsControllers,Qt as composeStyleRules,wt as createCapacityQueueController,rt as createDefaultPhysicsEngineAdapter,l as createDependencyGateController,Tt as createInitialCrucibleState,Ee as createLogicalJoin,t as createPhysicsEncodingLayout,St as createPortalController,T as createProcessJourneyLedger,o as createServiceLevelController,n as createServiceResourcePoolController,ie as crucibleBondId,Lt as crucibleBoundaryColliders,Gt as crucibleComponentBodyId,Xt as crucibleProductBodyId,vt as crucibleProjectionRows,de as crucibleSemanticKey,ba as default,sa as deriveMotionVector,V as describePhysicsStageGeography,xt as evaluateCrucibleConservation,pt as evaluatePhysicsBodyBudget,Se as forceFieldRegion,J as galtonPegs,se as groupCompletionRows,oa as hatchFillId,la as hatchPatternDef,ra as isHatchFill,zt as makeRuleValueResolver,Ut as markTooltipChrome,_t as matchesThreshold,ce as membraneRegion,Je as normalizePhysicsAnnotations,aa as opacityFromAge,O as physicsChargePoint,$ as physicsDestination,Oe as physicsProcessBoundaryColliders,Xe as physicsProcessGroupSemanticItems,Ge as physicsProcessRegionSemanticItem,Ve as physicsProcessStageSemanticItems,I as physicsReferenceEnvelope,G as physicsStageColliders,Y as physicsStageGeography,Ue as planGauntletPropertyWork,we as portalRegion,fe as pressureFieldRegion,ot as processChrome,N as processJourneyRows,Re as processLaneWalls,re as processStageLayout,le as processStageRegions,d as processVolumePolygons,jt as readEventDropOccupancy,ae as regionCountsToProjectionRows,te as replaceGauntletNegative,ge as replayCruciblePlan,Fe as replayStateTransitions,ht as resolveCrucibleSelector,ye as resolveCrucibleSnapshotAt,he as resolveCrucibleTime,i as resolveGauntletTerminalState,s as resolveGauntletTerminalStates,Zt as resolveMotionAccessor,ta as resolveMotionAge,ia as resolveMotionVector,Kt as resolveStyleRules,ua as resolveSvgFill,Me as routeDependencyTracks,me as routeSurfaceRegion,Jt as ruleMatches,Q as sedimentBake,ct as sedimentHeightfield,K as spawnFromTokens,c as stageTargetInVolume,j as updateProcessJourney};
|
package/dist/rough.min.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
function e(
|
|
1
|
+
function e(e){const t=e.trim();if(!t.startsWith("var(")||!t.endsWith(")"))return null;const r=t.slice(4,-1),i=r.indexOf(",");if(-1===i){const e=r.trim();return e.startsWith("--")?{name:e}:null}const n=r.slice(0,i).trim(),a=r.slice(i+1).trim();return n.startsWith("--")?{name:n,fallback:a||void 0}:null}function t(r,i){if(!i)return i;const n=e(i);if(!n)return i;const a=()=>n.fallback?t(r,n.fallback):i,o=r.canvas;if(!o)return a();let s=W.get(o);s&&s.version===j||(s={version:j,map:/* @__PURE__ */new Map},W.set(o,s));const l=s.map.get(i);if(void 0!==l)return l;const c=getComputedStyle(o).getPropertyValue(n.name).trim()||a()||i;return s.map.set(i,c),c}function r(e){return"number"==typeof e&&Number.isFinite(e)}function i(e){if(!Array.isArray(e))return null;const t=[];for(const i of e){if(!Array.isArray(i)||!r(i[0])||!r(i[1]))return null;t.push([i[0],i[1]])}return t}function n(e){if(e.style?.icon||e.fillGradient||e.strokeGradient||e.colorThresholds||e.clipRect)return null;if("rect"===e.type&&r(e.x)&&r(e.y)&&r(e.w)&&r(e.h))return{kind:"rectangle",x:e.x,y:e.y,width:e.w,height:e.h};if("point"===e.type&&r(e.x)&&r(e.y)&&r(e.r))return{kind:"circle",x:e.x,y:e.y,diameter:2*e.r};if("circle"===e.type&&r(e.cx)&&r(e.cy)&&r(e.r))return{kind:"circle",x:e.cx,y:e.cy,diameter:2*e.r};if("line"===e.type){const t=i(e.path);if(t&&t.length>=2&&!e._decayOpacities)return{kind:"linearPath",points:t};if(r(e.x1)&&r(e.y1)&&r(e.x2)&&r(e.y2))return{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}if("area"===e.type){const t=i(e.topPath),r=i(e.bottomPath);if(t&&r&&t.length>1&&r.length>1&&!e._decayOpacities)return{kind:"polygon",points:[...t,...r.slice().reverse()]}}if("geoarea"===e.type&&"string"==typeof e.pathData&&e.pathData)return{kind:"path",d:e.pathData};if(("bezier"===e.type||"ribbon"===e.type||"curved"===e.type)&&"string"==typeof e.pathD&&e.pathD)return{kind:"path",d:e.pathD};if("trapezoid"===e.type){const t=i(e.points);if(t&&t.length>=3)return{kind:"polygon",points:t}}if("connector"===e.type&&r(e.x1)&&r(e.y1)&&r(e.x2)&&r(e.y2))return{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2};if("violin"===e.type&&"string"==typeof e.pathString&&r(e.translateX)&&r(e.translateY))return{kind:"path",d:e.pathString,transform:{x:e.translateX,y:e.translateY}};if("symbol"===e.type&&"string"==typeof e.path){const t=r(e.x)?e.x:e.cx,i=r(e.y)?e.y:e.cy;if(r(t)&&r(i))return{kind:"path",d:e.path,transform:{x:t,y:i,rotation:r(e.rotation)?e.rotation:void 0}}}return"arc"===e.type&&r(e.cx)&&r(e.cy)&&r(e.outerR)&&r(e.startAngle)&&r(e.endAngle)?{kind:"arc",x:e.cx,y:e.cy,width:2*e.outerR,height:2*e.outerR,start:e.startAngle,stop:e.endAngle,closed:!0}:null}function a(e,t=/* @__PURE__ */new WeakSet){if(null==e||"string"==typeof e||"boolean"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:e+"";if("object"!=typeof e)return e+"";if(t.has(e))return"[Circular]";if(t.add(e),Array.isArray(e))return e.map(e=>a(e,t));const r=e;return Object.fromEntries(Object.keys(r).sort().map(e=>[e,a(r[e],t)]))}function o(e){return JSON.stringify(a(e))??e+""}function s(e){const t="string"==typeof e?e:o(e);let r=2166136261;for(let e=0;t.length>e;e+=1)r^=t.charCodeAt(e),r=Math.imul(r,16777619);return(r>>>0)%L+1}function l(e){return r(e)&&Math.trunc(Math.abs(e))%L||M}function c(e){const t=e.datum&&"object"==typeof e.datum?e.datum:void 0;return e._transitionKey??e.pointId??e.id??e.category??e.group??t?.id??t?.key??t?.name??null}function f(e){return{fill:"string"==typeof e.fill?e.fill:e.fill?"[CanvasPattern]":void 0,fillOpacity:e.fillOpacity,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap}}function u(e){if(!e)return;const t=e.split(/[\s,]+/).map(Number).filter(Number.isFinite);return t.length?t:void 0}function p(e,t){if(t.fill&&"string"!=typeof t.fill)return null;if("string"==typeof t.fill&&t.fill.startsWith("url("))return null;const r="string"==typeof t.fill&&"none"!==t.fill?t.fill:void 0,i=t.stroke&&"none"!==t.stroke?t.stroke:void 0;switch(e.type){case"line":case"connector":case"curved":return{stroke:i??"#007bff"};case"bezier":case"ribbon":return{fill:r??"#999999",stroke:i??"none"};case"geoarea":return{fill:r??"#e0e0e0",stroke:i??"none"};case"point":case"circle":case"rect":case"area":case"trapezoid":case"violin":case"arc":return{fill:r??"#4e79a7",stroke:i??"none"};case"symbol":return{fill:r,stroke:i??(r?"none":"#4e79a7")};default:return{fill:r,stroke:i??"#007bff"}}}function y(e,t,r){switch(t.kind){case"rectangle":return e.rectangle(t.x,t.y,t.width,t.height,r);case"circle":return e.circle(t.x,t.y,t.diameter,r);case"line":return e.line(t.x1,t.y1,t.x2,t.y2,r);case"linearPath":return e.linearPath(t.points,r);case"polygon":return e.polygon(t.points,r);case"path":return e.path(t.d,r);case"arc":return e.arc(t.x,t.y,t.width,t.height,t.start,t.stop,t.closed,r)}}function h(e,t,r){e.beginPath();for(const i of t.ops){const t="number"!=typeof r||0>r?i.data:i.data.map(e=>+e.toFixed(r));"move"===i.op?e.moveTo(t[0],t[1]):"lineTo"===i.op?e.lineTo(t[0],t[1]):"bcurveTo"===i.op&&e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}function d(e,t){const{drawable:r,geometry:i,style:n}=t,a=r.options,o=e.globalAlpha,s="path"===i.kind?i.transform:void 0;s&&(e.translate(s.x,s.y),s.rotation&&e.rotate(s.rotation));for(const t of r.sets){if(e.save(),"path"===t.type)e.strokeStyle="none"===a.stroke?"transparent":a.stroke,e.lineWidth=a.strokeWidth,e.globalAlpha=o*(n.opacity??1),a.strokeLineDash&&e.setLineDash(a.strokeLineDash),a.strokeLineDashOffset&&(e.lineDashOffset=a.strokeLineDashOffset),h(e,t,a.fixedDecimalPlaceDigits),e.stroke();else if("fillPath"===t.type)e.fillStyle=a.fill??"transparent",e.globalAlpha=o*(n.opacity??1)*(n.fillOpacity??1),h(e,t,a.fixedDecimalPlaceDigits),e.fill("curve"===r.shape||"polygon"===r.shape||"path"===r.shape?"evenodd":"nonzero");else{const r=0>a.fillWeight?a.strokeWidth/2:a.fillWeight;e.strokeStyle=a.fill??"transparent",e.lineWidth=r,e.globalAlpha=o*(n.opacity??1)*(n.fillOpacity??1),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),h(e,t,a.fixedDecimalPlaceDigits),e.stroke()}e.restore()}}function g(e={}){function i(e,t){const r=n(e);return o({backend:"roughjs",identity:c(e),type:e.type,geometry:r,style:f(t),options:m,seed:h})}function a(e,r,a){const l=n(e);if(!l)return null;const f=p(e,r);if(!f)return null;const d=a?{fill:f.fill?t(a,f.fill)||f.fill:void 0,stroke:t(a,f.stroke)||f.stroke}:f,m=`${i(e,r)}:${o(d)}`,v=x.get(m);if(v)return x.delete(m),x.set(m,v),v;const O=s(`${h}:${c(e)??o(l)}`),D={...k,seed:O,fill:d.fill,stroke:d.stroke,strokeWidth:r.strokeWidth??1,strokeLineDash:u(r.strokeDasharray)},w={drawable:y(b,l,D),geometry:l,style:r};for(x.set(m,w);x.size>g;){const e=x.keys().next().value;if(void 0===e)break;x.delete(e)}return w}const h=l(e.seed),g=r(e.cacheSize)?Math.max(1,Math.trunc(e.cacheSize)):1e3,k=Object.fromEntries(Object.entries({roughness:e.roughness,bowing:e.bowing,maxRandomnessOffset:e.maxRandomnessOffset,curveFitting:e.curveFitting,curveTightness:e.curveTightness,curveStepCount:e.curveStepCount,fillStyle:e.fillStyle,fillWeight:e.fillWeight,hachureAngle:e.hachureAngle,hachureGap:e.hachureGap,dashOffset:e.dashOffset,dashGap:e.dashGap,zigzagOffset:e.zigzagOffset,disableMultiStroke:e.disableMultiStroke,disableMultiStrokeFill:e.disableMultiStrokeFill,preserveVertices:e.preserveVertices,simplification:e.simplification,fixedDecimalPlaceDigits:e.fixedDecimalPlaceDigits}).filter(([,e])=>void 0!==e)),m=o({...k,seed:h}),b=S.default.generator(),x=/* @__PURE__ */new Map;return{id:"roughjs",seed:h,cacheKey:i,drawCanvas({context:e,node:t,style:r}){const i=a(t,r,e);return!!i&&(d(e,i),!0)},renderStaticSVG({node:e,style:t,key:r}){const i=a(e,t);if(!i)return null;const n="path"===i.geometry.kind?i.geometry.transform:void 0,o=b.toPaths(i.drawable).map((e,i)=>/* @__PURE__ */ /* @__PURE__ */(0,A.jsx)("path",{d:e.d,fill:e.fill??"none",fillOpacity:e.fill&&"none"!==e.fill?t.fillOpacity:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:t.opacity,strokeLinecap:t.strokeLinecap,strokeDasharray:t.strokeDasharray},`${r}-path-${i}`));/* @__PURE__ */ /* @__PURE__ */
|
|
2
|
+
return(0,A.jsx)("g",{"data-semiotic-render-backend":"roughjs",transform:n?`translate(${n.x} ${n.y})${n.rotation?` rotate(${180*n.rotation/Math.PI})`:""}`:void 0,children:o},r)},clearCache(){x.clear()},get cacheEntries(){return x.size}}}var k,m=Object.create,b=Object.defineProperty,x=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,w=(e,t,r,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of v(t))D.call(e,n)||n===r||b(e,n,{get:()=>t[n],enumerable:!(i=x(t,n))||i.enumerable});return e},P={};((e,t)=>{for(var r in t)b(e,r,{get:t[r],enumerable:!0})})(P,{createRoughRenderMode:()=>g,stableRoughSeed:()=>s}),module.exports=(k=P,w(b({},"__esModule",{value:!0}),k));var S=((e,t,r)=>(r=null!=e?m(O(e)):{},w(e&&e.__esModule?r:b(r,"default",{value:e,enumerable:!0}),e)))(require("roughjs")),W=/* @__PURE__ */new WeakMap,j=0,A=require("react/jsx-runtime"),M=1,L=2147483647;
|
package/dist/rough.module.min.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
function e(e){return"number"==typeof e&&Number.isFinite(e)}function t(t){if(!Array.isArray(t))return null;let r=[];for(let i of t){if(!Array.isArray(i)||!e(i[0])||!e(i[1]))return null;r.push([i[0],i[1]])}return r}function r(r){if(r.style?.icon||r.fillGradient||r.strokeGradient||r.colorThresholds||r.clipRect)return null;if("rect"===r.type&&e(r.x)&&e(r.y)&&e(r.w)&&e(r.h))return{kind:"rectangle",x:r.x,y:r.y,width:r.w,height:r.h};if("point"===r.type&&e(r.x)&&e(r.y)&&e(r.r))return{kind:"circle",x:r.x,y:r.y,diameter:2*r.r};if("circle"===r.type&&e(r.cx)&&e(r.cy)&&e(r.r))return{kind:"circle",x:r.cx,y:r.cy,diameter:2*r.r};if("line"===r.type){let i=t(r.path);if(i&&i.length>=2&&!r._decayOpacities)return{kind:"linearPath",points:i};if(e(r.x1)&&e(r.y1)&&e(r.x2)&&e(r.y2))return{kind:"line",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2}}if("area"===r.type){let e=t(r.topPath),i=t(r.bottomPath);if(e&&i&&e.length>1&&i.length>1&&!r._decayOpacities)return{kind:"polygon",points:[...e,...i.slice().reverse()]}}if("geoarea"===r.type&&"string"==typeof r.pathData&&r.pathData)return{kind:"path",d:r.pathData};if(("bezier"===r.type||"ribbon"===r.type||"curved"===r.type)&&"string"==typeof r.pathD&&r.pathD)return{kind:"path",d:r.pathD};if("trapezoid"===r.type){let e=t(r.points);if(e&&e.length>=3)return{kind:"polygon",points:e}}if("connector"===r.type&&e(r.x1)&&e(r.y1)&&e(r.x2)&&e(r.y2))return{kind:"line",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2};if("violin"===r.type&&"string"==typeof r.pathString&&e(r.translateX)&&e(r.translateY))return{kind:"path",d:r.pathString,transform:{x:r.translateX,y:r.translateY}};if("symbol"===r.type&&"string"==typeof r.path){let t=e(r.x)?r.x:r.cx,i=e(r.y)?r.y:r.cy;if(e(t)&&e(i))return{kind:"path",d:r.path,transform:{x:t,y:i,rotation:e(r.rotation)?r.rotation:void 0}}}return"arc"===r.type&&e(r.cx)&&e(r.cy)&&e(r.outerR)&&e(r.startAngle)&&e(r.endAngle)?{kind:"arc",x:r.cx,y:r.cy,width:2*r.outerR,height:2*r.outerR,start:r.startAngle,stop:r.endAngle,closed:!0}:null}function i(e,t
|
|
1
|
+
function e(e){return"number"==typeof e&&Number.isFinite(e)}function t(t){if(!Array.isArray(t))return null;let r=[];for(let i of t){if(!Array.isArray(i)||!e(i[0])||!e(i[1]))return null;r.push([i[0],i[1]])}return r}function r(r){if(r.style?.icon||r.fillGradient||r.strokeGradient||r.colorThresholds||r.clipRect)return null;if("rect"===r.type&&e(r.x)&&e(r.y)&&e(r.w)&&e(r.h))return{kind:"rectangle",x:r.x,y:r.y,width:r.w,height:r.h};if("point"===r.type&&e(r.x)&&e(r.y)&&e(r.r))return{kind:"circle",x:r.x,y:r.y,diameter:2*r.r};if("circle"===r.type&&e(r.cx)&&e(r.cy)&&e(r.r))return{kind:"circle",x:r.cx,y:r.cy,diameter:2*r.r};if("line"===r.type){let i=t(r.path);if(i&&i.length>=2&&!r._decayOpacities)return{kind:"linearPath",points:i};if(e(r.x1)&&e(r.y1)&&e(r.x2)&&e(r.y2))return{kind:"line",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2}}if("area"===r.type){let e=t(r.topPath),i=t(r.bottomPath);if(e&&i&&e.length>1&&i.length>1&&!r._decayOpacities)return{kind:"polygon",points:[...e,...i.slice().reverse()]}}if("geoarea"===r.type&&"string"==typeof r.pathData&&r.pathData)return{kind:"path",d:r.pathData};if(("bezier"===r.type||"ribbon"===r.type||"curved"===r.type)&&"string"==typeof r.pathD&&r.pathD)return{kind:"path",d:r.pathD};if("trapezoid"===r.type){let e=t(r.points);if(e&&e.length>=3)return{kind:"polygon",points:e}}if("connector"===r.type&&e(r.x1)&&e(r.y1)&&e(r.x2)&&e(r.y2))return{kind:"line",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2};if("violin"===r.type&&"string"==typeof r.pathString&&e(r.translateX)&&e(r.translateY))return{kind:"path",d:r.pathString,transform:{x:r.translateX,y:r.translateY}};if("symbol"===r.type&&"string"==typeof r.path){let t=e(r.x)?r.x:r.cx,i=e(r.y)?r.y:r.cy;if(e(t)&&e(i))return{kind:"path",d:r.path,transform:{x:t,y:i,rotation:e(r.rotation)?r.rotation:void 0}}}return"arc"===r.type&&e(r.cx)&&e(r.cy)&&e(r.outerR)&&e(r.startAngle)&&e(r.endAngle)?{kind:"arc",x:r.cx,y:r.cy,width:2*r.outerR,height:2*r.outerR,start:r.startAngle,stop:r.endAngle,closed:!0}:null}function i(e,t=/* @__PURE__ */new WeakSet){if(null==e||"string"==typeof e||"boolean"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:e+"";if("object"!=typeof e)return e+"";if(t.has(e))return"[Circular]";if(t.add(e),Array.isArray(e))return e.map(e=>i(e,t));let r=e;return Object.fromEntries(Object.keys(r).sort().map(e=>[e,i(r[e],t)]))}function n(e){return JSON.stringify(i(e))??e+""}function a(e){let t="string"==typeof e?e:n(e),r=2166136261;for(let e=0;t.length>e;e+=1)r^=t.charCodeAt(e),r=Math.imul(r,16777619);return(r>>>0)%m+1}function l(t){return e(t)&&Math.trunc(Math.abs(t))%m||1}function o(e){let t=e.datum&&"object"==typeof e.datum?e.datum:void 0;return e._transitionKey??e.pointId??e.id??e.category??e.group??t?.id??t?.key??t?.name??null}function s(e){return{fill:"string"==typeof e.fill?e.fill:e.fill?"[CanvasPattern]":void 0,fillOpacity:e.fillOpacity,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap}}function f(e){if(!e)return;let t=e.split(/[\s,]+/).map(Number).filter(Number.isFinite);return t.length?t:void 0}function c(e,t){if(t.fill&&"string"!=typeof t.fill||"string"==typeof t.fill&&t.fill.startsWith("url("))return null;let r="string"==typeof t.fill&&"none"!==t.fill?t.fill:void 0,i=t.stroke&&"none"!==t.stroke?t.stroke:void 0;switch(e.type){case"line":case"connector":case"curved":return{stroke:i??"#007bff"};case"bezier":case"ribbon":return{fill:r??"#999999",stroke:i??"none"};case"geoarea":return{fill:r??"#e0e0e0",stroke:i??"none"};case"point":case"circle":case"rect":case"area":case"trapezoid":case"violin":case"arc":return{fill:r??"#4e79a7",stroke:i??"none"};case"symbol":return{fill:r,stroke:i??(r?"none":"#4e79a7")};default:return{fill:r,stroke:i??"#007bff"}}}function p(e,t,r){switch(t.kind){case"rectangle":return e.rectangle(t.x,t.y,t.width,t.height,r);case"circle":return e.circle(t.x,t.y,t.diameter,r);case"line":return e.line(t.x1,t.y1,t.x2,t.y2,r);case"linearPath":return e.linearPath(t.points,r);case"polygon":return e.polygon(t.points,r);case"path":return e.path(t.d,r);case"arc":return e.arc(t.x,t.y,t.width,t.height,t.start,t.stop,t.closed,r)}}function u(e,t,r){e.beginPath();for(let i of t.ops){let t="number"!=typeof r||0>r?i.data:i.data.map(e=>+e.toFixed(r));"move"===i.op?e.moveTo(t[0],t[1]):"lineTo"===i.op?e.lineTo(t[0],t[1]):"bcurveTo"===i.op&&e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}function h(e,t){let{drawable:r,geometry:i,style:n}=t,a=r.options,l=e.globalAlpha,o="path"===i.kind?i.transform:void 0;o&&(e.translate(o.x,o.y),o.rotation&&e.rotate(o.rotation));for(let t of r.sets){if(e.save(),"path"===t.type)e.strokeStyle="none"===a.stroke?"transparent":a.stroke,e.lineWidth=a.strokeWidth,e.globalAlpha=l*(n.opacity??1),a.strokeLineDash&&e.setLineDash(a.strokeLineDash),a.strokeLineDashOffset&&(e.lineDashOffset=a.strokeLineDashOffset),u(e,t,a.fixedDecimalPlaceDigits),e.stroke();else if("fillPath"===t.type)e.fillStyle=a.fill??"transparent",e.globalAlpha=l*(n.opacity??1)*(n.fillOpacity??1),u(e,t,a.fixedDecimalPlaceDigits),e.fill("curve"===r.shape||"polygon"===r.shape||"path"===r.shape?"evenodd":"nonzero");else{let r=0>a.fillWeight?a.strokeWidth/2:a.fillWeight;e.strokeStyle=a.fill??"transparent",e.lineWidth=r,e.globalAlpha=l*(n.opacity??1)*(n.fillOpacity??1),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),u(e,t,a.fixedDecimalPlaceDigits),e.stroke()}e.restore()}}function y(t={}){function i(e,t){let i=r(e);return n({backend:"roughjs",identity:o(e),type:e.type,geometry:i,style:s(t),options:b,seed:y})}function u(e,t,l){let s=r(e);if(!s)return null;let u=c(e,t);if(!u)return null;let h=l?{fill:u.fill?d(l,u.fill)||u.fill:void 0,stroke:d(l,u.stroke)||u.stroke}:u,g=`${i(e,t)}:${n(h)}`,k=D.get(g);if(k)return D.delete(g),D.set(g,k),k;let b=a(`${y}:${o(e)??n(s)}`),O={...x,seed:b,fill:h.fill,stroke:h.stroke,strokeWidth:t.strokeWidth??1,strokeLineDash:f(t.strokeDasharray)},S={drawable:p(v,s,O),geometry:s,style:t};for(D.set(g,S);D.size>m;){let e=D.keys().next().value;if(void 0===e)break;D.delete(e)}return S}let y=l(t.seed),m=e(t.cacheSize)?Math.max(1,Math.trunc(t.cacheSize)):1e3,x=Object.fromEntries(Object.entries({roughness:t.roughness,bowing:t.bowing,maxRandomnessOffset:t.maxRandomnessOffset,curveFitting:t.curveFitting,curveTightness:t.curveTightness,curveStepCount:t.curveStepCount,fillStyle:t.fillStyle,fillWeight:t.fillWeight,hachureAngle:t.hachureAngle,hachureGap:t.hachureGap,dashOffset:t.dashOffset,dashGap:t.dashGap,zigzagOffset:t.zigzagOffset,disableMultiStroke:t.disableMultiStroke,disableMultiStrokeFill:t.disableMultiStrokeFill,preserveVertices:t.preserveVertices,simplification:t.simplification,fixedDecimalPlaceDigits:t.fixedDecimalPlaceDigits}).filter(([,e])=>void 0!==e)),b=n({...x,seed:y}),v=g.generator(),D=/* @__PURE__ */new Map;return{id:"roughjs",seed:y,cacheKey:i,drawCanvas({context:e,node:t,style:r}){let i=u(t,r,e);return!!i&&(h(e,i),!0)},renderStaticSVG({node:e,style:t,key:r}){let i=u(e,t);if(!i)return null;let n="path"===i.geometry.kind?i.geometry.transform:void 0,a=v.toPaths(i.drawable).map((e,i)=>/* @__PURE__ */k("path",{d:e.d,fill:e.fill??"none",fillOpacity:e.fill&&"none"!==e.fill?t.fillOpacity:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:t.opacity,strokeLinecap:t.strokeLinecap,strokeDasharray:t.strokeDasharray},`${r}-path-${i}`));/* @__PURE__ */
|
|
2
|
+
return k("g",{"data-semiotic-render-backend":"roughjs",transform:n?`translate(${n.x} ${n.y})${n.rotation?` rotate(${180*n.rotation/Math.PI})`:""}`:void 0,children:a},r)},clearCache(){D.clear()},get cacheEntries(){return D.size}}}import{a as d}from"./c-3FOUMWLR.min.js";import g from"roughjs";import{jsx as k}from"react/jsx-runtime";var m=2147483647;export{y as createRoughRenderMode,a as stableRoughSeed};
|