semiotic 3.13.1 → 3.13.3
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 +48 -48
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/dist/mcp-server.js +4 -4
- package/ai/reference.md +23 -12
- package/ai/schema.json +258 -96
- package/ai/surface-manifest.json +1 -1
- package/ai/task-packets/compare-category-totals.json +5 -5
- package/ai/task-packets/compare-category-totals.md +2 -2
- package/ai/task-packets/correct-published-chart.json +5 -5
- package/ai/task-packets/correct-published-chart.md +2 -2
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +5 -5
- package/ai/task-packets/update-live-chart.md +2 -2
- package/dist/c-2YFVDRU4.min.js +1 -0
- package/dist/c-4OVDIXAR.min.js +1 -0
- package/dist/c-57IIWW46.min.js +1 -0
- package/dist/c-5HTUQRJT.min.js +1 -0
- package/dist/c-5NAU4JAY.min.js +1 -0
- package/dist/c-62UTMRQE.min.js +1 -0
- package/dist/c-6QV6F3U7.min.js +1 -0
- package/dist/c-73ORHEHO.min.js +1 -0
- package/dist/c-7S46KBYD.min.js +2 -0
- package/dist/c-AJSS332Z.min.js +2 -0
- package/dist/{c-ZWJDTDEV.min.js → c-AMQAAW7G.min.js} +1 -1
- package/dist/c-B3X2IJRQ.min.js +1 -0
- package/dist/c-BLLDBVFK.min.js +38 -0
- package/dist/c-BQWX6NBX.min.js +1 -0
- package/dist/c-C7TT4J7K.min.js +1 -0
- package/dist/c-CJ5GA7DM.min.js +1 -0
- package/dist/c-D7YDFHLY.min.js +1 -0
- package/dist/c-DHNROAXY.min.js +1 -0
- package/dist/c-DMDFJQU4.min.js +1 -0
- package/dist/{c-RAIBDXDV.min.js → c-FRVHZIGR.min.js} +1 -1
- package/dist/{c-I54V24WG.min.js → c-HAZCVHI7.min.js} +1 -1
- package/dist/c-HN5U72U7.min.js +1 -0
- package/dist/c-JA5F7ITS.min.js +1 -0
- package/dist/{c-VZNIIKL6.min.js → c-JDI7HKEM.min.js} +1 -1
- package/dist/{c-ISHYKYII.min.js → c-JVZRD4GL.min.js} +1 -1
- package/dist/{c-HGWITEJI.min.js → c-KJGJEOSV.min.js} +1 -1
- package/dist/c-LDGV6TDQ.min.js +1 -0
- package/dist/c-LW3GP7RY.min.js +1 -0
- package/dist/c-M2TPZE7P.min.js +1 -0
- package/dist/{c-XOGN3524.min.js → c-NBBYSAQY.min.js} +2 -2
- package/dist/c-OA6RJZ7S.min.js +1 -0
- package/dist/c-OBBSIOYU.min.js +1 -0
- package/dist/c-OMTJIC3P.min.js +1 -0
- package/dist/{c-SQQZPFVY.min.js → c-QPHM7AWW.min.js} +1 -1
- package/dist/{c-XZJWL7UL.min.js → c-QSEAAHEU.min.js} +1 -1
- package/dist/c-RQWI623R.min.js +1 -0
- package/dist/{c-62JIVHK5.min.js → c-RWFADOKS.min.js} +1 -1
- package/dist/c-TFESQSWE.min.js +1 -0
- package/dist/{c-SDGGMIYI.min.js → c-TJGC5JEM.min.js} +1 -1
- package/dist/{c-4P2EM44G.min.js → c-TOXWQRXS.min.js} +3 -3
- package/dist/c-TX53234M.min.js +1 -0
- package/dist/c-TZBEQ5UY.min.js +1 -0
- package/dist/c-UALVQIIJ.min.js +1 -0
- package/dist/c-VBDWHTC7.min.js +1 -0
- package/dist/c-VBIPDCE7.min.js +1 -0
- package/dist/c-WTNRBWZZ.min.js +51 -0
- package/dist/{c-3GIPT46Z.min.js → c-XG4LL2VI.min.js} +1 -1
- package/dist/c-XPNBS3W2.min.js +1 -0
- package/dist/c-XT3G3YWU.min.js +1 -0
- package/dist/c-YCBCZFOC.min.js +1 -0
- package/dist/c-ZBSL4Y32.min.js +1 -0
- package/dist/c-ZP6O6UHV.min.js +1 -0
- package/dist/c-ZVL7ULNH.min.js +1 -0
- package/dist/components/ChartErrorBoundary.d.ts +5 -1
- package/dist/components/ai/intentWeights.d.ts +22 -0
- package/dist/components/ai/streamSchema.d.ts +98 -0
- package/dist/components/ai/streamingTypes.d.ts +27 -4
- package/dist/components/ai/suggestCharts.d.ts +10 -2
- package/dist/components/ai/suggestStreamCharts.d.ts +60 -13
- package/dist/components/ai/suggestStreamDashboard.d.ts +9 -1
- package/dist/components/charts/network/processSankey/frameMargins.d.ts +1 -1
- package/dist/components/charts/network/processSankey/labelPlacement.d.ts +1 -1
- package/dist/components/charts/physics/physicsHocUtils.d.ts +1 -1
- package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +7 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +9 -2
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +13 -1
- package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +7 -1
- package/dist/components/charts/realtime/TemporalHistogram.capability.d.ts +5 -3
- package/dist/components/charts/realtime/aggregate.d.ts +11 -12
- package/dist/components/charts/realtime/defaultRealtimeTooltip.d.ts +9 -0
- package/dist/components/charts/realtime/eventTime.d.ts +7 -1
- package/dist/components/charts/realtime/useRealtimeLineIngestion.d.ts +13 -0
- package/dist/components/charts/shared/ChartError.d.ts +4 -6
- package/dist/components/charts/shared/GaugeReadout.d.ts +39 -4
- package/dist/components/charts/shared/axisExtent.d.ts +2 -1
- package/dist/components/charts/shared/chartMode.d.ts +2 -2
- package/dist/components/charts/shared/gaugeLayout.d.ts +69 -0
- package/dist/components/charts/shared/types.d.ts +4 -1
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useStreamStatus.d.ts +2 -2
- package/dist/components/charts/shared/withChartErrorBoundary.d.ts +14 -0
- package/dist/components/charts/xy/Scatterplot.streamCapability.d.ts +2 -0
- package/dist/components/charts/xy/WaterfallChart.d.ts +2 -0
- package/dist/components/charts/xy/WaterfallIndex.d.ts +12 -0
- package/dist/components/charts/xy/lineGapStrategy.d.ts +15 -3
- package/dist/components/legendGeometry.d.ts +148 -0
- package/dist/components/legendLayout.d.ts +20 -38
- package/dist/components/realtime/ReorderBuffer.d.ts +14 -0
- package/dist/components/realtime/SlidingExtent.d.ts +18 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +5 -1
- package/dist/components/realtime/renderers/types.d.ts +1 -0
- package/dist/components/realtime/renderers/waterfallRenderer.d.ts +1 -1
- package/dist/components/recipes/atlas/resolution/appearance.d.ts +1 -1
- package/dist/components/recipes/atlas/resolution/scene.d.ts +1 -1
- package/dist/components/recipes/compositional/edgeRouting.d.ts +9 -0
- package/dist/components/recipes/compositional/metrics.d.ts +2 -2
- package/dist/components/recipes/compositional/projection.d.ts +3 -1
- package/dist/components/recipes/compositional/routing.d.ts +3 -1
- package/dist/components/recipes/compositional/testFixtures.d.ts +4 -0
- package/dist/components/recipes/compositional/topology.d.ts +2 -0
- package/dist/components/recipes/compositional/types.d.ts +10 -1
- package/dist/components/recipes/compositional/useCompositionalInterfaces.d.ts +20 -0
- package/dist/components/semiotic-ai-core.d.ts +3 -2
- package/dist/components/semiotic-ai-stream.d.ts +3 -2
- package/dist/components/semiotic-network-zoom.d.ts +1 -1
- package/dist/components/semiotic-recipes-react.d.ts +2 -0
- package/dist/components/semiotic-utils-core.d.ts +2 -0
- package/dist/components/server/serverChartConfigHeatmap.d.ts +13 -0
- package/dist/components/server/staticLegend.d.ts +5 -0
- package/dist/components/server/staticLegendText.d.ts +13 -0
- package/dist/components/server/staticSVGChrome.d.ts +2 -2
- package/dist/components/store/ThemeStore.d.ts +4 -1
- package/dist/components/store/themeCore.d.ts +2 -0
- package/dist/components/stream/DataSourceAdapter.d.ts +15 -62
- package/dist/components/stream/FrameRuntime.d.ts +3 -0
- package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
- package/dist/components/stream/IngestActivity.d.ts +9 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +3 -1
- package/dist/components/stream/OrdinalPipelineStore.d.ts +5 -2
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +8 -3
- package/dist/components/stream/accessibleDataRows.d.ts +1 -0
- package/dist/components/stream/axisTickUtils.d.ts +25 -5
- package/dist/components/stream/frameDefaultMargins.d.ts +26 -4
- package/dist/components/stream/frameKeyboardNavigation.d.ts +8 -1
- package/dist/components/stream/geoTypes.d.ts +2 -0
- package/dist/components/stream/graphKeyboardNavigation.d.ts +4 -2
- package/dist/components/stream/hitTestUtils.d.ts +7 -0
- package/dist/components/stream/keyboardNav.d.ts +3 -1
- package/dist/components/stream/mediaQuery.d.ts +2 -0
- package/dist/components/stream/navigationGraph.d.ts +10 -3
- package/dist/components/stream/networkEdgeHitIndex.d.ts +6 -2
- package/dist/components/stream/networkFrameKeyboardNavigation.d.ts +2 -0
- package/dist/components/stream/networkNavGroups.d.ts +3 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +1 -0
- package/dist/components/stream/networkSceneTypes.d.ts +10 -0
- package/dist/components/stream/networkSpatialNavigation.d.ts +3 -0
- package/dist/components/stream/networkTypes.d.ts +2 -0
- package/dist/components/stream/networkZoom/ZoomableNetworkCustomChart.d.ts +6 -4
- package/dist/components/stream/networkZoom/gestures.d.ts +5 -0
- package/dist/components/stream/networkZoom/types.d.ts +10 -0
- package/dist/components/stream/ordinalAxisTicks.d.ts +27 -0
- package/dist/components/stream/ordinalSceneBuilders/pieScene.d.ts +10 -0
- package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -0
- package/dist/components/stream/ordinalTypes.d.ts +11 -2
- package/dist/components/stream/pipelineBufferUtils.d.ts +9 -0
- package/dist/components/stream/pipelineConfig.d.ts +7 -0
- package/dist/components/stream/pipelineDomainResolution.d.ts +3 -2
- package/dist/components/stream/pipelineTransitionTypes.d.ts +3 -5
- package/dist/components/stream/pipelineTransitionUtils.d.ts +4 -0
- package/dist/components/stream/pipelineTransitions.d.ts +1 -13
- package/dist/components/stream/renderers/networkArcRenderer.d.ts +1 -3
- package/dist/components/stream/renderers/networkCircleRenderer.d.ts +1 -3
- package/dist/components/stream/renderers/networkPrimitiveRenderer.d.ts +5 -0
- package/dist/components/stream/renderers/networkRectRenderer.d.ts +1 -3
- package/dist/components/stream/renderers/renderPulse.d.ts +8 -14
- package/dist/components/stream/roundScaleDomain.d.ts +9 -0
- package/dist/components/stream/sceneToSVGShared.d.ts +9 -0
- package/dist/components/stream/shallowEqual.d.ts +2 -0
- package/dist/components/stream/stalenessBands.d.ts +1 -1
- package/dist/components/stream/svgOverlayUtils.d.ts +12 -0
- package/dist/components/stream/types.d.ts +10 -2
- package/dist/components/stream/useFrame.d.ts +7 -4
- package/dist/components/stream/useMediaPreferences.d.ts +1 -4
- package/dist/components/stream/useOrdinalFrameHandle.d.ts +4 -14
- package/dist/components/stream/useStalenessCheck.d.ts +5 -3
- package/dist/components/stream/useStreamingDataHandle.d.ts +24 -0
- package/dist/components/stream/useXYFrameHandle.d.ts +4 -14
- package/dist/components/stream/xyDateTicks.d.ts +33 -4
- package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
- package/dist/components/stream/xyPlugins/registry.d.ts +7 -0
- package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +11 -2
- package/dist/components/stream/xySceneBuilders/types.d.ts +4 -0
- package/dist/components/types/legendTypes.d.ts +12 -1
- package/dist/geo.min.js +155 -152
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/semiotic-ai-core.d.ts +3 -2
- package/dist/semiotic-ai-core.min.js +5 -5
- package/dist/semiotic-ai-core.module.min.js +4 -4
- package/dist/semiotic-ai.module.min.js +2 -2
- package/dist/semiotic-artifact.min.js +6 -6
- package/dist/semiotic-artifact.module.min.js +5 -5
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-atlas.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1021 -1024
- package/dist/semiotic-client-compositional.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +2 -2
- package/dist/semiotic-experimental-network-resolution-react.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +3 -3
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-network-zoom.d.ts +1 -1
- package/dist/semiotic-network-zoom.min.js +7 -7
- package/dist/semiotic-network-zoom.module.min.js +1 -1
- 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 +101 -101
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-react.d.ts +2 -0
- package/dist/semiotic-recipes-react.min.js +8 -8
- package/dist/semiotic-server-edge-node.module.min.js +3 -3
- package/dist/semiotic-server-edge.min.js +399 -397
- package/dist/semiotic-server-edge.module.min.js +3 -3
- package/dist/semiotic-server-node.min.js +399 -397
- package/dist/semiotic-themes-core.min.js +2 -2
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +2 -2
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +2 -0
- package/dist/semiotic-utils-core.min.js +11 -11
- package/dist/semiotic-utils-core.module.min.js +3 -3
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +399 -397
- package/dist/server.module.min.js +3 -3
- package/dist/xy.module.min.js +1 -1
- package/package.json +11 -11
- package/dist/c-2M2OPWVA.min.js +0 -37
- package/dist/c-2N7IU2NY.min.js +0 -1
- package/dist/c-3UXQGCQT.min.js +0 -1
- package/dist/c-4RVDKSMQ.min.js +0 -1
- package/dist/c-4YPPVFZH.min.js +0 -1
- package/dist/c-6WJKNYIG.min.js +0 -1
- package/dist/c-7UN2WUMI.min.js +0 -1
- package/dist/c-AQUX6L2O.min.js +0 -1
- package/dist/c-BR5QDUCR.min.js +0 -1
- package/dist/c-C3YQVUB6.min.js +0 -1
- package/dist/c-COP4OISO.min.js +0 -1
- package/dist/c-ENRZPF5E.min.js +0 -1
- package/dist/c-FAOZZE77.min.js +0 -1
- package/dist/c-HBLICBM6.min.js +0 -1
- package/dist/c-I4BEWAKT.min.js +0 -1
- package/dist/c-IDCFMBA4.min.js +0 -2
- package/dist/c-KLJDKRD5.min.js +0 -1
- package/dist/c-LEICSI5V.min.js +0 -1
- package/dist/c-MOK4RWNO.min.js +0 -1
- package/dist/c-N2TVSOYL.min.js +0 -2
- package/dist/c-NHZ2E3CI.min.js +0 -1
- package/dist/c-OIJL2WZH.min.js +0 -1
- package/dist/c-OSLNYZ3Q.min.js +0 -51
- package/dist/c-OWRVBUSL.min.js +0 -1
- package/dist/c-QIVKWHDL.min.js +0 -1
- package/dist/c-QUAEYF34.min.js +0 -1
- package/dist/c-RDFFLRKC.min.js +0 -1
- package/dist/c-RTU5425Z.min.js +0 -1
- package/dist/c-SIQVOV6A.min.js +0 -1
- package/dist/c-SU6Z75M2.min.js +0 -1
- package/dist/c-SWVXFUDL.min.js +0 -1
- package/dist/c-TC47SNSI.min.js +0 -1
- package/dist/c-VLWWXOM5.min.js +0 -1
- package/dist/c-VNFIRKU5.min.js +0 -1
- package/dist/c-W5ATXREF.min.js +0 -1
- package/dist/c-WFX456JK.min.js +0 -5
- package/dist/c-WSWMQDFZ.min.js +0 -1
- package/dist/c-XORVM6C5.min.js +0 -1
- package/dist/c-YGTMWEEF.min.js +0 -1
- package/dist/c-ZDCTFRA6.min.js +0 -1
package/dist/geo.module.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
function t(e){return"default"in e?e.default:e}async function o(e){try{switch(e){case"world-110m":return{topology:t(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:t(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:t(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:t(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw new Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){let i=t instanceof Error?t.message:String(t);throw/Cannot find module|Failed to resolve|world-atlas/i.test(i)?new Error(`resolveReferenceGeography("${e}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:t}):t}}async function r(e){let t=Qe.get(e);if(t)return t;let{topology:i,objectName:r}=await o(e);if(!i||!i.objects)throw new Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof i} with keys: ${i?Object.keys(i).join(", "):"none"}`);let n=Ue(i,i.objects[r]),a="features"in n?n.features:[n];return Qe.set(e,a),a}function n(e){let t=Oe(()=>Array.isArray(e)?e:void 0,[e]),[i,o]=De(null);return Te(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return o(null),r(e).then(e=>{t||o(e)}),()=>{t=!0}}var t;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),o(null)}else o(null)},[e]),void 0!==t?t:i}function u(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function m(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,u=l>0?(c-n)/l:0;return o+Math.max(0,Math.min(1,u))*(r-o)}function h(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:n,edgeLinecap:a,styleRules:l}=e,s=Ae(t);return ge(e=>({stroke:r(e),strokeWidth:m(e[t],i,o),strokeLinecap:a,opacity:n,fillOpacity:0}),l,e=>({value:s(e)}))}function p({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 Ze("g",m?{children:[Ve("line",{x1:i,y1:o,x2:i+n,y2:o,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),Ve("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 Ze("g",{children:[Ve("line",{x1:l,y1:o-2.5,x2:l,y2:o+2.5,stroke:h.stroke,strokeWidth:.9,opacity:.65}),u&&Ze("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 Ze("g",{children:[Ve("circle",{cx:i,cy:o,r:a,fill:"none",stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray,opacity:.5}),u&&Ze("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&&Ze("g",{transform:"translate(24, 24)",children:[Ve("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),Ve("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),Ve("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),Ve("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),Ve("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),Ve("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function g(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function f(e){let t=1/0,i=-1/0;for(let o of e)Number.isFinite(o)&&(o<t&&(t=o),o>i&&(i=o));return t===1/0?[0,0]:[t,i]}function v(e,t){let i=t[1]-t[0];return 0===i?.5:(e-t[0])/i}function x(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=Ne(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=g(t.columns)??Math.max(1,Math.ceil(Math.sqrt(i.length*r/o))),a=g(t.rows)??Math.max(1,Math.ceil(i.length/(n*o)));n*a<i.length&&(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=f(i.map(e=>e.x)),s=f(i.map(e=>e.y)),c=i.map(e=>({...e,desiredColumn:v(e.x,l)*Math.max(0,n-1),desiredRow:v(e.y,s)*Math.max(0,a-1)})),u=(n-1)/2,d=(a-1)/2;c.sort((e,t)=>{let i=(e.desiredColumn-u)**2+(e.desiredRow-d)**2;return(t.desiredColumn-u)**2+(t.desiredRow-d)**2-i||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index});let m=new Set;for(let e=0;e<a;e+=1)for(let t=0;t<n;t+=1)m.add(e*n+t);let h=[];for(let e of c){let t=-1,i=1/0;for(let o of m){let r=Math.floor(o/n),a=(o%n-e.desiredColumn)**2+(r-e.desiredRow)**2;(a<i||a===i&&o<t)&&(t=o,i=a)}t<0||(m.delete(t),h.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/n),column:t%n,index:e.index}))}return h.sort((e,t)=>e.index-t.index),h.map(({index:e,...t})=>t)}function S(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 M(e,t){let i=e.properties&&"object"==typeof e.properties?e.properties:{},o=e.id??i.id??i.name??`area-${t}`;return{...i,id:String(o)}}function C(e){return`${e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")}Z`}function A(e,t,i){return C([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function R(e,t,i){let o=[];for(let r=0;r<6;r+=1){let n=-Math.PI/2+r*(Math.PI/3);o.push([e+Math.cos(n)*i,t+Math.sin(n)*i])}return C(o)}function N(e){return e.areas.map((t,i)=>{let o=M(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 F(e){return e.points.map(t=>{let i=Number(S(t,e.config.longitudeAccessor,["lon","longitude"])),o=Number(S(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 P(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;let i=e.map(e=>({datum:e,x:Number(S(e,t.columnAccessor)),y:Number(S(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 L({marks:e,color:t,fontSize:i,fontFamily:o,fontWeight:r}){let n=se();return Ve("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{let a=!n.isActive||n.predicate(e.datum);return Ve("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 I(e){if(Number.isFinite(e)&&!(Number(e)<=0))return Number(e)}function H(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function W(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function O(e,t){let i=W(e);return String(e.id??i.id??i.name??`feature-${t}`)}function D(e,t){if(0===e.length)return null;let i={type:"FeatureCollection",features:e},o=t.bounds(i);return Number.isFinite(o[0][0])&&Number.isFinite(o[0][1])&&Number.isFinite(o[1][0])&&Number.isFinite(o[1][1])?o:null}function T(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function B(e){if(!e)return 0;let t=ct.get(e);if(t)return t;let i=ut;return ut+=1,ct.set(e,i),i}function E(e){return e.map((e,t)=>{if(st.has(e))return{feature:e,index:t,bounds:st.get(e)??null};try{let i=Ke(e);return st.set(e,i),{feature:e,index:t,bounds:i}}catch{return st.set(e,null),{feature:e,index:t,bounds:null}}})}function $(e,t){return!t||e[1]>=t[0][1]&&e[1]<=t[1][1]&&(i=e[0],(o=t[0][0])<=(r=t[1][0])?i>=o&&i<=r:i>=o||i<=r);var i,o,r}function G(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&$(t,i.bounds))try{if(qe(e,t))return{feature:e,index:o}}catch{}}return null}function U(e,t,i,o={}){let r=e.filter((e,t)=>e.geometry&&(!o.featureFilter||o.featureFilter(e,t))),n=D(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[Ne(n[0][0],a,Math.max(a,i.width-a)),Ne(n[0][1],a,Math.max(a,i.height-a))],[Ne(n[1][0],a,Math.max(a,i.width-a)),Ne(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=I(o.columns),d=Math.max(2,u?s/u:I(o.cellSize)??10),m=Math.max(100,Math.round(I(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,g=o.gridOrigin?.[1]??0,[f,y]=T(l[0][0],l[1][0],p,d),[b,v]=T(l[0][1],l[1][1],g,d),x=[],S=E(r);for(let e=b;e<=v;e+=1){let i=g+(e+.5)*d;for(let r=f;r<=y;r+=1){let n=p+(r+.5)*d,a=t.invertedPoint(n,i);if(!a||!Number.isFinite(a[0])||!Number.isFinite(a[1]))continue;let l=G(S,a);if(!l)continue;let s={...W(l.feature),featureId:O(l.feature,l.index),featureIndex:l.index,gridRow:e,gridColumn:r,longitude:a[0],latitude:a[1],dotIndex:x.length};o.dotFilter&&!o.dotFilter(s,x.length)||x.push(s)}}return{dots:x,cellSize:d,features:r}}function Z(e){return Math.round(1e4*e)/1e4}function V(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${Z(Number(e[0]))},${Z(Number(e[1]))}`:"null"}function _(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function K(e){return"number"==typeof e&&Number.isFinite(e)?String(Z(e)):null===e?"null":"unavailable"}function q(e){let t=e.scales.projection;return[K(_(t,"scale")),V(_(t,"translate")),V(_(t,"center")),(i=_(t,"rotate"),Array.isArray(i)&&i.every(Number.isFinite)?i.map(e=>Z(Number(e))).join(","):"unavailable"),K(_(t,"clipAngle")),K(_(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>V(e.scales.projectedPoint(t,i)))].join("|");var i}function Q(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??"",B(t.featureFilter),B(t.dotFilter),q(e)].join("::")}function X(e){let t=lt.get(e.areas);t||(t=new Map,lt.set(e.areas,t));let i=Q(e),o=t.get(i);if(o)return o;let r=U(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 J(e){return`${e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")}Z`}function Y(e,t,i){return J([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function ee(e,t,i){return J(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 te(e,t,i){let{featureKey:o,dataKey:r}=i,n=new Map;for(let e of t){let t=String(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 String(i??"")};return e.map(e=>{let t=a(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}export{a as DEFAULT_HIT_RADIUS,d as geoAreaHitTarget,c as geoHitTarget,b as hitTargetPoint}from"./c-7NMCUG5N.min.js";import{a as ie}from"./c-IDCFMBA4.min.js";export{b as GeoCustomChart,a as StreamGeoFrame}from"./c-IDCFMBA4.min.js";import{a as oe,c as re,b as ne}from"./c-C3YQVUB6.min.js";import{S as ae,Q as le}from"./c-W5ATXREF.min.js";import{b as se}from"./c-363Q2L4Z.min.js";import{aX as ce,bH as ue,bB as de,b as me,bz as he,bF as pe,bO as ge,bo as fe,bx as ye,ba as be,a_ as ve,aY as xe,aR as Se,a$ as ke,a as we,bK as Me,bb as Ce,bI as Ae,bh as Re,O as Ne}from"./c-SU6Z75M2.min.js";export{aL as MultiLineTooltip,aK as Tooltip,bO as composeStyleRules,bK as makeNodeRuleContext,bI as makeRuleValueResolver,bL as matchesThreshold,bl as resolveResponsiveRules,bN as resolveStyleRules,bk as responsiveRuleMatches,bM as ruleMatches}from"./c-SU6Z75M2.min.js";import{f as Fe,c as Pe}from"./c-KLJDKRD5.min.js";import{d as Le,n as Ie,u as je,r as He}from"./c-WPL6PGP3.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-VZNIIKL6.min.js";export{e as glyphExtent,d as glyphPlacement}from"./c-ELGOCAEY.min.js";import{o as ze}from"./c-TC47SNSI.min.js";export{w as TooltipRoot,z as hasOwnTooltipChrome,s as hasTooltipContent,y as markTooltipChrome}from"./c-TC47SNSI.min.js";import{a as We}from"./c-GRTKU3C7.min.js";import{useMemo as Oe,useState as De,useEffect as Te,forwardRef as Be,useRef as Ee,useCallback as $e}from"react";import{scaleSequential as Ge}from"d3-scale";import{feature as Ue}from"topojson-client";import{jsxs as Ze,jsx as Ve,Fragment as _e}from"react/jsx-runtime";import{geoBounds as Ke,geoContains as qe}from"d3-geo";var Qe=/*#__PURE__*/new Map,Xe=/*#__PURE__*/ce(function(e){let t=ue(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=de(),{areas:o,valueAccessor:r,styleRules:a,colorScheme:l,projection:s="equalEarth",graticule:c,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:g,tileURL:f,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:S,legendInteraction:k,legendPosition:w,margin:M,className:C,selection:A,linkedHover:R,onObservation:N,onClick:F,chartId:P,loading:L,loadingContent:I,emptyContent:j,frameProps:H={},stroke:z,strokeWidth:W,opacity:O}=e,D=m??!!f,T=n(o),B=Oe(()=>T&&me(T),[T]),E=Oe(()=>"function"==typeof r?r:e=>e?.properties?.[r]??e?.[r],[r]),$=l??i??"blues",G=Oe(()=>{if(!B)return Ge(Le(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)||(o<e&&(e=o),o>t&&(t=o))}let i=Le($);return Ge(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[B,E,$]),U=Oe(()=>{let e=G.domain();return[e[0]??0,e[1]??1]},[G]),Z=he(k,E,U),{activeSelectionHook:V,hoverSelectionHook:_,customHoverBehavior:K,customClickBehavior:q}=pe({selection:A,linkedHover:R,onObservation:N,onClick:F,chartType:"ChoroplethMap",chartId:P,mobileInteraction:t.mobileInteraction}),Q=oe(A),X=_||Z.legendSelectionHook||V,J=Oe(()=>{let e=ge(e=>{let t=E(e);return{fill:null!=t&&isFinite(t)?G(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},a,e=>({value:E(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=ae(e,{stroke:z,strokeWidth:W,opacity:O});return X?Fe(t,X,Q,u):t},[E,G,X,Q,x,z,W,O,a]),Y=Oe(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=E(e);return Ze("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ve("div",{style:{fontWeight:600},children:t}),null!=i&&Ve("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):String(o??""))})]});var o},[E]),ee=fe(t),te=Oe(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>G(e),domain:U,label:"string"==typeof r?r:"value"}},[G,t.showLegend,r,U]),{legend:re,margin:ne,legendPosition:se,legendMarginReserved:ce}=ye({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:w,userMargin:M,defaults:ee,additionalLegend:te,chartWidth:t.width,chartHeight:t.height,legendLayout:H.legendLayout,frameLegend:H,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),we=be(L,t.width,t.height,I,e)||(B?null:be(!0,t.width,t.height,I,e)),Me=we?null:ve(B,t.width,t.height,j,e);if(Array.isArray(B)&&B.length>0){let e=B[0];if(!e||"object"!=typeof e||!e.geometry)return Ve(xe,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let Ce={projection:s,areas:B,areaStyle:J,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ne,enableHover:t.enableHover,...re&&{legend:re,legendPosition:se},...ce&&{__legendMarginReservedFor:re},legendHoverBehavior:Z.onLegendHover,legendClickBehavior:Z.onLegendClick,legendHighlightedCategory:Z.highlightedCategory,legendIsolatedCategories:"isolate"===k?Z.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?Y:Se(v)||Y,...null!=c&&{graticule:c},...null!=d&&{fitPadding:d},...D&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=g&&{dragRotate:g},...f&&{tileURL:f},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...le({linkedHover:R,selection:A,onObservation:N,onClick:F,mobileInteraction:t.mobileInteraction,customHoverBehavior:K,customClickBehavior:q,linkedHoverInClickPredicate:!1}),...S&&S.length>0&&{annotations:S},...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},...C&&{className:C},...null!=e.animate&&{animate:e.animate},...H};return we||Me||Ve(ke,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:Ve(ie,{...Ce})})},"ChoroplethMap"),Je={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5},Ye=[3,30],et=[1,4],tt=/*#__PURE__*/ce(/*#__PURE__*/Be(function(e,t){let i=Ee(null);re(t,{variant:"geo-points",frameRef:i});let o=ue(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:r,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:g,zoomable:f,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:S,tileCacheSize:k,areas:w,areaStyle:M=Je,tooltip:C,annotations:A,margin:R,className:N,selection:F,linkedHover:P,onObservation:L,onClick:I,chartId:j,loading:H,loadingContent:z,emptyContent:W,legendInteraction:O,legendPosition:D,frameProps:T={},stroke:B,strokeWidth:E,opacity:$}=e,G=c??("sparkline"===o.mode?et:Ye),U="sparkline"===o.mode?1.5:6,Z=f??!!x,V=n(w),_=ne({responsive:e,data:r??we,rawData:r,colorBy:u,colorScheme:m,legendInteraction:O,legendPosition:D,frameLegend:T,selection:F,linkedHover:P,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:L,onClick:I,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:j,showLegend:o.showLegend,userMargin:R,marginDefaults:fe(o),loading:H,loadingContent:z,emptyContent:W,width:o.width,height:o.height,hasTitle:!!o.title}),K=_.data,q=Oe(()=>{if(!s)return;let e="function"==typeof s?s:e=>e?.[s],t=K.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?We(t):void 0},[K,s]),Q=Oe(()=>{let e=ge(e=>({fill:u?He(e,u,_.colorScale):Ie,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?je(e,s,G,q):U}),d,Me(u,s)),t=ae(e,{stroke:B,strokeWidth:E,opacity:$});return _.effectiveSelectionHook?Fe(t,_.effectiveSelectionHook,_.resolvedSelection):t},[u,_.colorScale,_.effectiveSelectionHook,_.resolvedSelection,s,G,q,U,B,E,$,d]),X=Oe(()=>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}):String(e??""),n="string"==typeof u?u:null,a=n?e?.[n]:null;return Ze("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&Ve("div",{style:{fontWeight:600,marginBottom:2},children:t}),i&&null!=o&&Ze("div",{children:[Ze("span",{style:{opacity:.7},children:[i,": "]}),r(o)]}),n&&null!=a&&Ze("div",{children:[Ze("span",{style:{opacity:.7},children:[n,": "]}),String(a)]}),!t&&!i&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>Ze("div",{children:[Ze("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(_.earlyReturn)return _.earlyReturn;Ce("ProportionalSymbolMap",K,"xAccessor",a),Ce("ProportionalSymbolMap",K,"yAccessor",l);let J={projection:h,...null!=r&&{points:K},xAccessor:a,yAccessor:l,pointStyle:Q,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...V&&{areas:V,areaStyle:M},...null!=p&&{graticule:p},...null!=g&&{fitPadding:g},...Z&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...S&&{tileAttribution:S},...k&&{tileCacheSize:k},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:_.margin,enableHover:o.enableHover,tooltipContent:!1===C?()=>null:Se(C)||X,..._.legendBehaviorProps,...le({linkedHover:P,selection:F,onObservation:L,onClick:I,mobileInteraction:_.mobileInteraction,customHoverBehavior:_.customHoverBehavior,customClickBehavior:_.customClickBehavior,linkedHoverInClickPredicate:!1}),...A&&A.length>0&&{annotations:A},...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},...T};return Ve(ke,{componentName:"ProportionalSymbolMap",width:o.width,height:o.height,children:Ve(ie,{ref:i,...J})})}),"ProportionalSymbolMap"),it="__semiotic_x",ot="__semiotic_y",rt=/*#__PURE__*/ce(/*#__PURE__*/Be(function(e,t){let i=ue(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:r,nodeIdAccessor:a="id",xAccessor:l="lon",yAccessor:s="lat",valueAccessor:c="value",projection:u="equalEarth",graticule:d,fitPadding:m,zoomable:p,zoomExtent:g,onZoom:f,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:S="geo",flowStyle:k="basic",areas:w,areaStyle:M=Je,edgeColorBy:C,edgeOpacity:A=.6,edgeWidthRange:R=[1,8],pointRadius:N,edgeLinecap:F="round",colorScheme:P,styleRules:L,showParticles:I,particleStyle:j,tooltip:H,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:B,onClick:E,chartId:$,loading:G,loadingContent:U,emptyContent:Z,frameProps:V={},legendInteraction:_,legendPosition:K,stroke:q,strokeWidth:Q,opacity:X,lineIdAccessor:J}=e,Y=p??!!b,ee=n(w),te=Oe(()=>me(r),[r]),oe=ne({responsive:e,data:o??we,rawData:o,colorBy:C,colorScheme:P,legendInteraction:_,legendPosition:K,frameLegend:V,selection:D,linkedHover:T,fallbackFields:C?["string"==typeof C?C:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FlowMap",chartId:$,showLegend:i.showLegend,userMargin:W,marginDefaults:fe(i),loading:G,loadingContent:U,emptyContent:Z,width:i.width,height:i.height,hasTitle:!!i.title}),se=oe.data,ce=Pe(T),de=Re({name:ce?.name||"hover",fields:ce?.fields||[]}),he=ze(e=>e.pushObservation),pe=Oe(()=>{let e=new Map;for(let t of te)e.set(String(t[a]),t);return e},[te,a]),ge=Ee(null),ye=Ee(pe);ye.current=pe;let be=Ee(l);be.current=l;let ve=Ee(s);ve.current=s;let xe=$e(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=ye.current,i=t.get(String(e.source)),o=t.get(String(e.target));if(!i||!o)return null;let r="function"==typeof be.current?be.current:e=>e[be.current],n="function"==typeof ve.current?ve.current:e=>e[ve.current];return{...e,coordinates:[{[it]:r(i),[ot]:n(i)},{[it]:r(o),[ot]:n(o)}]}},[]);re(t,{variant:"geo-lines",frameRef:ge,overrides:{push:e=>{let t=xe(e);t&&ge.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=xe(i);e&&t.push(e)}t.length>0&&ge.current?.pushManyLines(t)}}});let Me=Oe(()=>{let e=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]),Ce=$e(e=>{if(T)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=String(t[a]),i=Me.get(e);i&&de.onHover(i)}else de.onHover(t)}else de.onHover(null);if(B||he){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};B&&B(o),he&&he(o)}else{let e={...t,type:"hover-end"};B&&B(e),he&&he(e)}}},[T,de,a,Me,B,$,he]),Ae=oe.customClickBehavior,Ne=Oe(()=>{let e="function"==typeof l?l:e=>e[l],t="function"==typeof s?s:e=>e[s];return se.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=pe.get(String(i.source)),r=pe.get(String(i.target));return o&&r?{...i,coordinates:[{[it]:e(o),[ot]:t(o)},{[it]:e(r),[ot]:t(r)}]}:null}).filter(Boolean)},[se,pe,l,s]),Le=Oe(()=>{let e="function"==typeof l?l:e=>e[l];return t=>null!=t&&"object"==typeof t&&it in t?t[it]:e(t)},[l]),je=Oe(()=>{let e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&ot in t?t[ot]:e(t)},[s]),De=Oe(()=>{let e=se.filter(e=>e&&"object"==typeof e).map(e=>Number(e[c]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return We(e)},[se,c]),Te=Oe(()=>h({valueAccessor:c,valueDomain:De,edgeWidthRange:R,resolveStroke:e=>C?He(e,C,oe.colorScale):Ie,edgeOpacity:A,edgeLinecap:F,styleRules:L}),[c,De,R,C,oe.colorScale,A,F,L]),Be=Oe(()=>{let e=ae(Te,{stroke:q,strokeWidth:Q,opacity:X});if(!oe.effectiveSelectionHook)return e;let t={...oe.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return Fe(e,oe.effectiveSelectionHook,{...oe.resolvedSelection||{},unselectedStyle:t})},[Te,oe.effectiveSelectionHook,oe.resolvedSelection,q,Q,X]),Ge=N??("sparkline"===i.mode?1.5:5),Ue=Oe(()=>ae(()=>({fill:"#333",r:Ge,fillOpacity:.8}),{stroke:q,strokeWidth:Q,opacity:X}),[Ge,q,Q,X]),_e=Oe(()=>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 Ve("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:Ve("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){let t=e[c];return Ze("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ze("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&Ve("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[a];return null!=t?Ve("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:Ve("div",{style:{fontWeight:600},children:t})}):null},[c,a]);if(oe.earlyReturn)return oe.earlyReturn;let Ke={projection:u,...null!=o&&{lines:Ne},points:te,xAccessor:Le,yAccessor:je,lineDataAccessor:"coordinates",...null!=J&&{lineIdAccessor:J},lineType:S,flowStyle:k,lineStyle:Be,pointStyle:Ue,...ee&&{areas:ee,areaStyle:M},...null!=d&&{graticule:d},...null!=m&&{fitPadding:m},...Y&&{zoomable:!0},...g&&{zoomExtent:g},...f&&{onZoom:f},...null!=y&&{dragRotate:y},...I&&{showParticles:I},...j&&{particleStyle:j},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[i.width,i.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:oe.margin,enableHover:i.enableHover,tooltipContent:!1===H?()=>null:Se(H)||_e,...oe.legendBehaviorProps,...le({linkedHover:T,selection:D,onObservation:B,onClick:E,mobileInteraction:oe.mobileInteraction,customHoverBehavior:Ce,customClickBehavior:Ae,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},...V};return Ve(ke,{componentName:"FlowMap",width:i.width,height:i.height,children:Ve(ie,{ref:ge,...Ke})})}),"FlowMap"),nt=/*#__PURE__*/ce(/*#__PURE__*/Be(function(e,t){let i=ue(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:c,strength:u=1,lineMode:d="straight",projection:m="mercator",graticule:h,fitPadding:g,zoomable:f,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:S,tileCacheSize:k,transition:w,colorBy:M,styleRules:C,colorScheme:A,pointRadius:R,tooltip:N,showRings:F,showRingLabels:P,ringStyle:L,showNorth:I,costLabel:j,cartogramLayout:H,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:B,onClick:E,chartId:$,loading:G,loadingContent:U,emptyContent:Z,legendPosition:V,frameProps:_={},stroke:K,strokeWidth:q,opacity:Q}=e,X="sparkline"===i.mode,J=H??(X?"strip":"radial"),Y=R??(X?1.5:5),ee=F??!0,te=P??("strip"!==J&&!i.compactMode),oe=I??("strip"!==J&&!X),se=f??!!x,ce=Oe(()=>me(o),[o]),de=ne({responsive:e,data:ce,rawData:o,colorBy:M,colorScheme:A,legendInteraction:void 0,legendPosition:V,frameLegend:_,selection:D,linkedHover:T,fallbackFields:M?["string"==typeof M?M:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DistanceCartogram",chartId:$,showLegend:i.showLegend,userMargin:W,marginDefaults:fe(i),loading:G,loadingContent:U,emptyContent:Z,width:i.width,height:i.height,hasTitle:!!i.title}),he=Oe(()=>{let e=ge(e=>{let t=e?.[l],i=null!=t&&String(t)===String(s);return{fill:M?He(e,M,de.colorScale):Ie,fillOpacity:i?1:.8,stroke:i?"var(--semiotic-text, #222)":"#fff",strokeWidth:i?1.25:1,r:i?1.35*Y:Y}},C,Me(M)),t=ae(e,{stroke:K,strokeWidth:q,opacity:Q});return de.effectiveSelectionHook?Fe(t,de.effectiveSelectionHook,de.resolvedSelection):t},[M,de.colorScale,de.effectiveSelectionHook,de.resolvedSelection,Y,K,q,Q,C,s,l]),pe=Oe(()=>({center:s,centerAccessor:l,costAccessor:c,strength:u,lineMode:d,layout:J}),[s,l,c,u,d,J]),ye=Oe(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof a?a:e=>e[a],i=new Map;for(let e of ce)i.set(String(e[l]),e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(String(o.source)),l=i.get(String(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]),be=Oe(()=>e=>{let t=("function"==typeof c?c:e=>e[c])(e),i=e[l]||e.name||e.id||"Point";return Ze("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ve("div",{style:{fontWeight:600},children:i}),null!=t&&Ze("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[c,l]),ve=Ee(null);re(t,{variant:"geo-points",frameRef:ve});let[xe,we]=De(null),Ae=$e(()=>{let e=ve.current?.getCartogramLayout?.();e&&we(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"})},[]);Te(()=>{let e=requestAnimationFrame(Ae);return()=>cancelAnimationFrame(e)},[Ae,u,s,i.width,i.height,ce,J]);let Re=Oe(()=>{if(!ee||!xe)return[];let{maxCost:e}=xe;if(e<=0)return[];if(Array.isArray(ee))return ee.filter(t=>t>0&&t<=e);let t="strip"===xe.layout?3:5,i="number"==typeof ee?ee:Math.min(t,Math.max(2,Math.ceil(e/5))),o=e/i,r=[];for(let e=1;e<=i;e++)r.push(Math.round(o*e*10)/10);return r},[ee,xe]),Ne=Oe(()=>{if(!xe)return _.foregroundGraphics||null;let e=Ve(p,{bottomMargin:de.margin.bottom,costLabel:j,layout:xe,ringStyle:L,ringValues:Re,showNorth:oe,showRingLabels:te,showRings:ee}),t=_.foregroundGraphics;return"function"==typeof t?i=>Ze(_e,{children:[e,t(i)]}):Ze(_e,{children:[e,t]})},[xe,Re,ee,te,oe,j,L,de.margin.bottom,_.foregroundGraphics]);if(de.earlyReturn)return de.earlyReturn;Ce("DistanceCartogram",ce,"xAccessor",n),Ce("DistanceCartogram",ce,"yAccessor",a);let Pe={projection:m,...null!=o&&{points:ce},...ye&&{lines:ye,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:a,pointIdAccessor:l,pointStyle:he,projectionTransform:pe,...w&&{transition:{duration:w}},...null!=h&&{graticule:h},...null!=g&&{fitPadding:g},...se&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...S&&{tileAttribution:S},...k&&{tileCacheSize:k},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:de.margin,enableHover:i.enableHover,tooltipContent:!1===N?()=>null:Se(N)||be,...de.legendBehaviorProps,...le({linkedHover:T,selection:D,onObservation:B,onClick:E,mobileInteraction:de.mobileInteraction,customHoverBehavior:de.customHoverBehavior,customClickBehavior:de.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},..._,foregroundGraphics:Ne};return Ve(ke,{componentName:"DistanceCartogram",width:i.width,height:i.height,children:Ve(ie,{ref:ve,...Pe})})}),"DistanceCartogram"),at=e=>{let t=e.config,i=t.source??"auto",o="areas"===i||"auto"===i&&e.areas.length>0,r=(o?N(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,i)=>!t.filter||t.filter(e.datum,i)),n=P(r.map(e=>e.datum),t),a=o?r:F({...e,points:r.map(e=>e.datum)}),l=n??x(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=f(l.map(e=>e.row)),c=f(l.map(e=>e.column)),u=Math.max(1,Math.round(s[1]-s[0])+1),d=Math.max(1,Math.round(c[1]-c[0])+1),m=Math.max(0,t.layoutPadding??8),h=Math.max(1,e.dimensions.width-2*m),p=Math.max(1,e.dimensions.height-2*m),g=h/d,y=p/u,b=g*d,k=y*u,w=(e.dimensions.width-b)/2,M=(e.dimensions.height-k)/2,C=Ne(t.cellPadding??.12,0,.8),I=Math.max(1,.5*Math.min(g,y)*(1-C)),j=t.sizeAccessor?l.map(e=>Number(S(e.datum,t.sizeAccessor))):[],H=t.sizeDomain??f(j),z=t.sizeRange??[.36,1],W=Ne(Math.min(z[0],z[1]),.05,1),O=Ne(Math.max(z[0],z[1]),W,1),D=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=String(S(r,t.idAccessor,["id","key","name"])??`grid-${o}`),a=String(S(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,d=S(r,t.categoryAccessor),m=null==d?void 0:String(d),h=S(r,t.fillAccessor),p=null!=h?String(h):m?e.resolveColor(m):e.theme.categorical[0]??"#4f86c6",f=t.sizeAccessor?Number(S(r,t.sizeAccessor)):NaN,b=t.sizeAccessor&&Number.isFinite(f)?Math.sqrt(Ne(v(f,H),0,1)):1,x=I*(W+b*(O-W)),k="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:u,category:m,row:i.row,column:i.column,x:w+(i.column-c[0]+.5)*g,y:M+(i.row-s[0]+.5)*y,radius:x,style:{fill:p,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...k}}}),T=t.shape??"circle";return{nodes:D.map(e=>"circle"===T?{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"===T?R(e.x,e.y,e.radius):A(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"===T?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:Ve(L,{marks:D,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??Ne(.23*Math.min(g,y),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}}},lt=/*#__PURE__*/new WeakMap,st=/*#__PURE__*/new WeakMap,ct=/*#__PURE__*/new WeakMap,ut=1,dt=e=>{let t=X(e),i=e.config,o=i.shape??"circle",r=Math.max(.5,I(i.dotRadius)??t.cellSize*Ne(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=H(l,i.categoryAccessor),m=H(l,i.fillAccessor),h={fill:null!=m?String(m):null!=d?e.resolveColor(String(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?ee(c,u,r):Y(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?Ve("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?Ve("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"},O(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{Xe as ChoroplethMap,nt as DistanceCartogram,rt as FlowMap,tt as ProportionalSymbolMap,dt as geographicDotGridLayout,at as geographicGridLayout,x as gridifyGeographicPoints,te as mergeData,r as resolveReferenceGeography,U as sampleGeographicDotGrid};
|
|
2
|
+
function t(e){return"default"in e?e.default:e}async function o(e){try{switch(e){case"world-110m":return{topology:t(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:t(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:t(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:t(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw new Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){let i=t instanceof Error?t.message:String(t);throw/Cannot find module|Failed to resolve|world-atlas/i.test(i)?new Error(`resolveReferenceGeography("${e}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:t}):t}}async function r(e){let t=Ee.get(e);if(t)return t;let{topology:i,objectName:r}=await o(e);if(!i||!i.objects)throw new Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof i} with keys: ${i?Object.keys(i).join(", "):"none"}`);let n=ze(i,i.objects[r]),a="features"in n?n.features:[n];return Ee.set(e,a),a}function n(e){let t=Ne(()=>Array.isArray(e)?e:void 0,[e]),[i,o]=Pe(null);return Fe(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return o(null),r(e).then(e=>{t||o(e)}),()=>{t=!0}}var t;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),o(null)}else o(null)},[e]),void 0!==t?t:i}function s(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function u(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,u=l>0?(c-n)/l:0;return o+Math.max(0,Math.min(1,u))*(r-o)}function m(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:n,edgeLinecap:a,styleRules:l}=e,s=ye(t);return le(e=>({stroke:r(e),strokeWidth:u(e[t],i,o),strokeLinecap:a,opacity:n,fillOpacity:0}),l,e=>({value:s(e)}))}function h({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 We("g",m?{children:[Oe("line",{x1:i,y1:o,x2:i+n,y2:o,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),Oe("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 We("g",{children:[Oe("line",{x1:l,y1:o-2.5,x2:l,y2:o+2.5,stroke:h.stroke,strokeWidth:.9,opacity:.65}),u&&We("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 We("g",{children:[Oe("circle",{cx:i,cy:o,r:a,fill:"none",stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray,opacity:.5}),u&&We("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&&We("g",{transform:"translate(24, 24)",children:[Oe("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),Oe("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),Oe("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),Oe("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),Oe("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),Oe("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function p(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function g(e){let t=1/0,i=-1/0;for(let o of e)Number.isFinite(o)&&(o<t&&(t=o),o>i&&(i=o));return t===1/0?[0,0]:[t,i]}function f(e,t){let i=t[1]-t[0];return 0===i?.5:(e-t[0])/i}function y(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=ve(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=p(t.columns)??Math.max(1,Math.ceil(Math.sqrt(i.length*r/o))),a=p(t.rows)??Math.max(1,Math.ceil(i.length/(n*o)));n*a<i.length&&(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=g(i.map(e=>e.x)),s=g(i.map(e=>e.y)),c=i.map(e=>({...e,desiredColumn:f(e.x,l)*Math.max(0,n-1),desiredRow:f(e.y,s)*Math.max(0,a-1)})),u=(n-1)/2,d=(a-1)/2;c.sort((e,t)=>{let i=(e.desiredColumn-u)**2+(e.desiredRow-d)**2;return(t.desiredColumn-u)**2+(t.desiredRow-d)**2-i||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index});let m=new Set;for(let e=0;e<a;e+=1)for(let t=0;t<n;t+=1)m.add(e*n+t);let h=[];for(let e of c){let t=-1,i=1/0;for(let o of m){let r=Math.floor(o/n),a=(o%n-e.desiredColumn)**2+(r-e.desiredRow)**2;(a<i||a===i&&o<t)&&(t=o,i=a)}t<0||(m.delete(t),h.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/n),column:t%n,index:e.index}))}return h.sort((e,t)=>e.index-t.index),h.map(({index:e,...t})=>t)}function v(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 S(e){return`${e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")}Z`}function w(e,t,i){return S([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function M(e,t,i){let o=[];for(let r=0;r<6;r+=1){let n=-Math.PI/2+r*(Math.PI/3);o.push([e+Math.cos(n)*i,t+Math.sin(n)*i])}return S(o)}function C({marks:e,color:t,fontSize:i,fontFamily:o,fontWeight:r}){let n=ee();return Oe("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{let a=!n.isActive||n.predicate(e.datum);return Oe("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 A(e){if(Number.isFinite(e)&&!(Number(e)<=0))return Number(e)}function R(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function N(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function P(e,t){let i=N(e);return String(e.id??i.id??i.name??`feature-${t}`)}function F(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function L(e){if(!e)return 0;let t=et.get(e);if(t)return t;let i=tt;return tt+=1,et.set(e,i),i}function H(e,t){return!t||e[1]>=t[0][1]&&e[1]<=t[1][1]&&(i=e[0],(o=t[0][0])<=(r=t[1][0])?i>=o&&i<=r:i>=o||i<=r);var i,o,r}function I(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&H(t,i.bounds))try{if(Be(e,t))return{feature:e,index:o}}catch{}}return null}function z(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={type:"FeatureCollection",features:e},o=t.bounds(i);return Number.isFinite(o[0][0])&&Number.isFinite(o[0][1])&&Number.isFinite(o[1][0])&&Number.isFinite(o[1][1])?o:null}(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[ve(n[0][0],a,Math.max(a,i.width-a)),ve(n[0][1],a,Math.max(a,i.height-a))],[ve(n[1][0],a,Math.max(a,i.width-a)),ve(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,g=o.gridOrigin?.[1]??0,[f,y]=F(l[0][0],l[1][0],p,d),[b,v]=F(l[0][1],l[1][1],g,d),x=[],k=function(e){return e.map((e,t)=>{if(Ye.has(e))return{feature:e,index:t,bounds:Ye.get(e)??null};try{let i=De(e);return Ye.set(e,i),{feature:e,index:t,bounds:i}}catch{return Ye.set(e,null),{feature:e,index:t,bounds:null}}})}(r);for(let e=b;e<=v;e+=1){let i=g+(e+.5)*d;for(let r=f;r<=y;r+=1){let n=p+(r+.5)*d,a=t.invertedPoint(n,i);if(!a||!Number.isFinite(a[0])||!Number.isFinite(a[1]))continue;let l=I(k,a);if(!l)continue;let s={...N(l.feature),featureId:P(l.feature,l.index),featureIndex:l.index,gridRow:e,gridColumn:r,longitude:a[0],latitude:a[1],dotIndex:x.length};o.dotFilter&&!o.dotFilter(s,x.length)||x.push(s)}}return{dots:x,cellSize:d,features:r}}function W(e){return Math.round(1e4*e)/1e4}function O(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${W(Number(e[0]))},${W(Number(e[1]))}`:"null"}function T(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function U(e){return"number"==typeof e&&Number.isFinite(e)?String(W(e)):null===e?"null":"unavailable"}function G(e){let t=e.scales.projection;return[U(T(t,"scale")),O(T(t,"translate")),O(T(t,"center")),(i=T(t,"rotate"),Array.isArray(i)&&i.every(Number.isFinite)?i.map(e=>W(Number(e))).join(","):"unavailable"),U(T(t,"clipAngle")),U(T(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>O(e.scales.projectedPoint(t,i)))].join("|");var i}function $(e){return`${e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")}Z`}function Z(e,t,i){return $([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function _(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 J(e,t,i){let{featureKey:o,dataKey:r}=i,n=new Map;for(let e of t){let t=String(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 String(i??"")})(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}export{a as DEFAULT_HIT_RADIUS,d as geoAreaHitTarget,c as geoHitTarget,b as hitTargetPoint}from"./c-7NMCUG5N.min.js";import{a as Q}from"./c-AJSS332Z.min.js";export{b as GeoCustomChart,a as StreamGeoFrame}from"./c-AJSS332Z.min.js";import{a as q,c as V,b as K}from"./c-DMDFJQU4.min.js";import{T as X,R as Y}from"./c-OBBSIOYU.min.js";import{b as ee}from"./c-363Q2L4Z.min.js";import{bW as te,bK as ie,bE as oe,b as re,bC as ne,bI as ae,bR as le,br as se,bA as ce,bd as ue,bc as de,ba as me,aS as he,a as pe,bN as ge,be as fe,bL as ye,bk as be,O as ve}from"./c-62UTMRQE.min.js";export{aM as MultiLineTooltip,aL as Tooltip,bR as composeStyleRules,bN as makeNodeRuleContext,bL as makeRuleValueResolver,bO as matchesThreshold,bo as resolveResponsiveRules,bQ as resolveStyleRules,bn as responsiveRuleMatches,bP as ruleMatches}from"./c-62UTMRQE.min.js";import{f as xe,c as ke}from"./c-C7TT4J7K.min.js";import{d as Se,n as we,u as Me,r as Ce}from"./c-WPL6PGP3.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-JDI7HKEM.min.js";export{e as glyphExtent,d as glyphPlacement}from"./c-ELGOCAEY.min.js";import{q as Ae}from"./c-B3X2IJRQ.min.js";export{B as TooltipRoot,E as hasOwnTooltipChrome,x as hasTooltipContent,D as markTooltipChrome}from"./c-B3X2IJRQ.min.js";import{a as Re}from"./c-GRTKU3C7.min.js";import{useMemo as Ne,useState as Pe,useEffect as Fe,forwardRef as je,useRef as Le,useCallback as He}from"react";import{scaleSequential as Ie}from"d3-scale";import{feature as ze}from"topojson-client";import{jsxs as We,jsx as Oe,Fragment as Te}from"react/jsx-runtime";import{geoBounds as De,geoContains as Be}from"d3-geo";var Ee=/*#__PURE__*/new Map,Ue=/*#__PURE__*/te(function(e){let t=ie(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=oe(),{areas:o,valueAccessor:r,styleRules:a,colorScheme:l,projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:g,tileURL:f,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:k,legendInteraction:S,legendPosition:w,margin:M,className:C,selection:A,linkedHover:R,onObservation:N,onClick:P,chartId:F,loading:j,loadingContent:L,emptyContent:H,frameProps:I={},stroke:z,strokeWidth:W,opacity:O}=e,T=m??!!f,D=n(o),B=Ne(()=>D&&re(D),[D]),E=Ne(()=>"function"==typeof r?r:e=>e?.properties?.[r]??e?.[r],[r]),U=l??i??"blues",G=Ne(()=>{if(!B)return Ie(Se(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)||(o<e&&(e=o),o>t&&(t=o))}let i=Se(U);return Ie(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[B,E,U]),$=Ne(()=>{let e=G.domain();return[e[0]??0,e[1]??1]},[G]),Z=ne(S,E,$),{activeSelectionHook:_,hoverSelectionHook:J,customHoverBehavior:V,customClickBehavior:K}=ae({selection:A,linkedHover:R,onObservation:N,onClick:P,chartType:"ChoroplethMap",chartId:F,mobileInteraction:t.mobileInteraction}),ee=q(A),te=J||Z.legendSelectionHook||_,pe=Ne(()=>{let e=le(e=>{let t=E(e);return{fill:null!=t&&isFinite(t)?G(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},a,e=>({value:E(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=X(e,{stroke:z,strokeWidth:W,opacity:O});return te?xe(t,te,ee,s):t},[E,G,te,ee,x,z,W,O,a]),ge=Ne(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=E(e);return We("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Oe("div",{style:{fontWeight:600},children:t}),null!=i&&Oe("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):String(o??""))})]});var o},[E]),fe=se(t),ye=Ne(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>G(e),domain:$,label:"string"==typeof r?r:"value"}},[G,t.showLegend,r,$]),{legend:be,margin:ve,legendPosition:ke,legendMarginReserved:we}=ce({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:w,userMargin:M,defaults:fe,additionalLegend:ye,chartWidth:t.width,chartHeight:t.height,legendLayout:I.legendLayout,frameLegend:I,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),Me=ue(j,t.width,t.height,L,e)||(B?null:ue(!0,t.width,t.height,L,e)),Ce=Me?null:de(B,t.width,t.height,H,e);if(Array.isArray(B)&&B.length>0){let e=B[0];if(!e||"object"!=typeof e||!e.geometry)return Oe(me,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let Ae={projection:c,areas:B,areaStyle:pe,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ve,enableHover:t.enableHover,...be&&{legend:be,legendPosition:ke},...we&&{__legendMarginReservedFor:be},legendHoverBehavior:Z.onLegendHover,legendClickBehavior:Z.onLegendClick,legendHighlightedCategory:Z.highlightedCategory,legendIsolatedCategories:"isolate"===S?Z.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?ge:he(v)||ge,...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...T&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=g&&{dragRotate:g},...f&&{tileURL:f},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...Y({linkedHover:R,selection:A,onObservation:N,onClick:P,mobileInteraction:t.mobileInteraction,customHoverBehavior:V,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},...C&&{className:C},...null!=e.animate&&{animate:e.animate},...I};return Me||Ce||Oe(Q,{...Ae})},"ChoroplethMap"),Ge={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5},$e=[3,30],Ze=[1,4],_e=/*#__PURE__*/te(/*#__PURE__*/je(function(e,t){let i=Le(null);V(t,{variant:"geo-points",frameRef:i});let o=ie(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:r,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:g,zoomable:f,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:S,areas:w,areaStyle:M=Ge,tooltip:C,annotations:A,margin:R,className:N,selection:P,linkedHover:F,onObservation:j,onClick:L,chartId:H,loading:I,loadingContent:z,emptyContent:W,legendInteraction:O,legendPosition:T,frameProps:D={},stroke:B,strokeWidth:E,opacity:U}=e,G=c??("sparkline"===o.mode?Ze:$e),$="sparkline"===o.mode?1.5:6,Z=f??!!x,_=n(w),J=K({responsive:e,data:r??pe,rawData:r,colorBy:u,colorScheme:m,legendInteraction:O,legendPosition:T,frameLegend:D,selection:P,linkedHover:F,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:j,onClick:L,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:H,showLegend:o.showLegend,userMargin:R,marginDefaults:se(o),loading:I,loadingContent:z,emptyContent:W,width:o.width,height:o.height,hasTitle:!!o.title,axisChrome:{hasAxis:!1}}),q=J.data,ee=Ne(()=>{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?Re(t):void 0},[q,s]),te=Ne(()=>{let e=le(e=>({fill:u?Ce(e,u,J.colorScale):we,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Me(e,s,G,ee):$}),d,ge(u,s)),t=X(e,{stroke:B,strokeWidth:E,opacity:U});return J.effectiveSelectionHook?xe(t,J.effectiveSelectionHook,J.resolvedSelection):t},[u,J.colorScale,J.effectiveSelectionHook,J.resolvedSelection,s,G,ee,$,B,E,U,d]),oe=Ne(()=>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}):String(e??""),n="string"==typeof u?u:null,a=n?e?.[n]:null;return We("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&Oe("div",{style:{fontWeight:600,marginBottom:2},children:t}),i&&null!=o&&We("div",{children:[We("span",{style:{opacity:.7},children:[i,": "]}),r(o)]}),n&&null!=a&&We("div",{children:[We("span",{style:{opacity:.7},children:[n,": "]}),String(a)]}),!t&&!i&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>We("div",{children:[We("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(J.earlyReturn)return J.earlyReturn;fe("ProportionalSymbolMap",q,"xAccessor",a),fe("ProportionalSymbolMap",q,"yAccessor",l);let re={projection:h,...null!=r&&{points:q},xAccessor:a,yAccessor:l,pointStyle:te,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},..._&&{areas:_,areaStyle:M},...null!=p&&{graticule:p},...null!=g&&{fitPadding:g},...Z&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...S&&{tileCacheSize:S},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:J.margin,enableHover:o.enableHover,tooltipContent:!1===C?()=>null:he(C)||oe,...J.legendBehaviorProps,...Y({linkedHover:F,selection:P,onObservation:j,onClick:L,mobileInteraction:J.mobileInteraction,customHoverBehavior:J.customHoverBehavior,customClickBehavior:J.customClickBehavior,linkedHoverInClickPredicate:!1}),...A&&A.length>0&&{annotations:A},...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},...D};return Oe(Q,{ref:i,...re})}),"ProportionalSymbolMap"),Je="__semiotic_x",Qe="__semiotic_y",qe=/*#__PURE__*/te(/*#__PURE__*/je(function(e,t){let i=ie(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:r,nodeIdAccessor:a="id",xAccessor:l="lon",yAccessor:s="lat",valueAccessor:c="value",projection:u="equalEarth",graticule:d,fitPadding:h,zoomable:p,zoomExtent:g,onZoom:f,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:k="geo",flowStyle:S="basic",areas:w,areaStyle:M=Ge,edgeColorBy:C,edgeOpacity:A=.6,edgeWidthRange:R=[1,8],pointRadius:N,edgeLinecap:P="round",colorScheme:F,styleRules:j,showParticles:L,particleStyle:H,tooltip:I,annotations:z,margin:W,className:O,selection:T,linkedHover:D,onObservation:B,onClick:E,chartId:U,loading:G,loadingContent:$,emptyContent:Z,frameProps:_={},legendInteraction:J,legendPosition:q,stroke:ee,strokeWidth:te,opacity:oe,lineIdAccessor:ne}=e,ae=p??!!b,le=n(w),ce=Ne(()=>re(r),[r]),ue=K({responsive:e,data:o??pe,rawData:o,colorBy:C,colorScheme:F,legendInteraction:J,legendPosition:q,frameLegend:_,selection:T,linkedHover:D,fallbackFields:C?["string"==typeof C?C:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FlowMap",chartId:U,showLegend:i.showLegend,userMargin:W,marginDefaults:se(i),loading:G,loadingContent:$,emptyContent:Z,width:i.width,height:i.height,hasTitle:!!i.title,axisChrome:{hasAxis:!1}}),de=ue.data,me=ke(D),ge=be({name:me?.name||"hover",fields:me?.fields||[]}),fe=Ae(e=>e.pushObservation),ye=Ne(()=>{let e=new Map;for(let t of ce)e.set(String(t[a]),t);return e},[ce,a]),ve=Le(null),Se=Le(ye);Se.current=ye;let Me=Le(l);Me.current=l;let Pe=Le(s);Pe.current=s;let Fe=He(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=Se.current,i=t.get(String(e.source)),o=t.get(String(e.target));if(!i||!o)return null;let r="function"==typeof Me.current?Me.current:e=>e[Me.current],n="function"==typeof Pe.current?Pe.current:e=>e[Pe.current];return{...e,coordinates:[{[Je]:r(i),[Qe]:n(i)},{[Je]:r(o),[Qe]:n(o)}]}},[]);V(t,{variant:"geo-lines",frameRef:ve,overrides:{push:e=>{let t=Fe(e);t&&ve.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=Fe(i);e&&t.push(e)}t.length>0&&ve.current?.pushManyLines(t)}}});let je=Ne(()=>{let e=new Map;for(let t of de)!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},[de]),Ie=He(e=>{if(D)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=String(t[a]),i=je.get(e);i&&ge.onHover(i)}else ge.onHover(t)}else ge.onHover(null);if(B||fe){let t={timestamp:Date.now(),chartType:"FlowMap",chartId:U};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),fe&&fe(o)}else{let e={...t,type:"hover-end"};B&&B(e),fe&&fe(e)}}},[D,ge,a,je,B,U,fe]),ze=ue.customClickBehavior,Te=Ne(()=>{let e="function"==typeof l?l:e=>e[l],t="function"==typeof s?s:e=>e[s];return de.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=ye.get(String(i.source)),r=ye.get(String(i.target));return o&&r?{...i,coordinates:[{[Je]:e(o),[Qe]:t(o)},{[Je]:e(r),[Qe]:t(r)}]}:null}).filter(Boolean)},[de,ye,l,s]),De=Ne(()=>{let e="function"==typeof l?l:e=>e[l];return t=>null!=t&&"object"==typeof t&&Je in t?t[Je]:e(t)},[l]),Be=Ne(()=>{let e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&Qe in t?t[Qe]:e(t)},[s]),Ee=Ne(()=>{let e=de.filter(e=>e&&"object"==typeof e).map(e=>Number(e[c]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return Re(e)},[de,c]),Ue=Ne(()=>m({valueAccessor:c,valueDomain:Ee,edgeWidthRange:R,resolveStroke:e=>C?Ce(e,C,ue.colorScale):we,edgeOpacity:A,edgeLinecap:P,styleRules:j}),[c,Ee,R,C,ue.colorScale,A,P,j]),$e=Ne(()=>{let e=X(Ue,{stroke:ee,strokeWidth:te,opacity:oe});if(!ue.effectiveSelectionHook)return e;let t={...ue.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return xe(e,ue.effectiveSelectionHook,{...ue.resolvedSelection||{},unselectedStyle:t})},[Ue,ue.effectiveSelectionHook,ue.resolvedSelection,ee,te,oe]),Ze=N??("sparkline"===i.mode?1.5:5),_e=Ne(()=>X(()=>({fill:"#333",r:Ze,fillOpacity:.8}),{stroke:ee,strokeWidth:te,opacity:oe}),[Ze,ee,te,oe]),qe=Ne(()=>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 Oe("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:Oe("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){let t=e[c];return We("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[We("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&Oe("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[a];return null!=t?Oe("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:Oe("div",{style:{fontWeight:600},children:t})}):null},[c,a]);if(ue.earlyReturn)return ue.earlyReturn;let Ve={projection:u,...null!=o&&{lines:Te},points:ce,xAccessor:De,yAccessor:Be,lineDataAccessor:"coordinates",...null!=ne&&{lineIdAccessor:ne},lineType:k,flowStyle:S,lineStyle:$e,pointStyle:_e,...le&&{areas:le,areaStyle:M},...null!=d&&{graticule:d},...null!=h&&{fitPadding:h},...ae&&{zoomable:!0},...g&&{zoomExtent:g},...f&&{onZoom:f},...null!=y&&{dragRotate:y},...L&&{showParticles:L},...H&&{particleStyle:H},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[i.width,i.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ue.margin,enableHover:i.enableHover,tooltipContent:!1===I?()=>null:he(I)||qe,...ue.legendBehaviorProps,...Y({linkedHover:D,selection:T,onObservation:B,onClick:E,mobileInteraction:ue.mobileInteraction,customHoverBehavior:Ie,customClickBehavior:ze,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},..._};return Oe(Q,{ref:ve,...Ve})}),"FlowMap"),Ve=/*#__PURE__*/te(/*#__PURE__*/je(function(e,t){let i=ie(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:c,strength:u=1,lineMode:d="straight",projection:m="mercator",graticule:p,fitPadding:g,zoomable:f,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:S,transition:w,colorBy:M,styleRules:C,colorScheme:A,pointRadius:R,tooltip:N,showRings:P,showRingLabels:F,ringStyle:j,showNorth:L,costLabel:H,cartogramLayout:I,annotations:z,margin:W,className:O,selection:T,linkedHover:D,onObservation:B,onClick:E,chartId:U,loading:G,loadingContent:$,emptyContent:Z,legendPosition:_,frameProps:J={},stroke:q,strokeWidth:ee,opacity:te}=e,oe="sparkline"===i.mode,ne=I??(oe?"strip":"radial"),ae=R??(oe?1.5:5),ce=P??!0,ue=F??("strip"!==ne&&!i.compactMode),de=L??("strip"!==ne&&!oe),me=f??!!x,pe=Ne(()=>re(o),[o]),ye=K({responsive:e,data:pe,rawData:o,colorBy:M,colorScheme:A,legendInteraction:void 0,legendPosition:_,frameLegend:J,selection:T,linkedHover:D,fallbackFields:M?["string"==typeof M?M:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DistanceCartogram",chartId:U,showLegend:i.showLegend,userMargin:W,marginDefaults:se(i),loading:G,loadingContent:$,emptyContent:Z,width:i.width,height:i.height,hasTitle:!!i.title,axisChrome:{hasAxis:!1}}),be=Ne(()=>{let e=le(e=>{let t=e?.[l],i=null!=t&&String(t)===String(s);return{fill:M?Ce(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*ae:ae}},C,ge(M)),t=X(e,{stroke:q,strokeWidth:ee,opacity:te});return ye.effectiveSelectionHook?xe(t,ye.effectiveSelectionHook,ye.resolvedSelection):t},[M,ye.colorScale,ye.effectiveSelectionHook,ye.resolvedSelection,ae,q,ee,te,C,s,l]),ve=Ne(()=>({center:s,centerAccessor:l,costAccessor:c,strength:u,lineMode:d,layout:ne}),[s,l,c,u,d,ne]),ke=Ne(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof a?a:e=>e[a],i=new Map;for(let e of pe)i.set(String(e[l]),e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(String(o.source)),l=i.get(String(o.target));return r&&l?{...o,coordinates:[{[n]:e(r),[a]:t(r)},{[n]:e(l),[a]:t(l)}]}:null}).filter(Boolean)},[r,pe,n,a,l]),Se=Ne(()=>e=>{let t=("function"==typeof c?c:e=>e[c])(e),i=e[l]||e.name||e.id||"Point";return We("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Oe("div",{style:{fontWeight:600},children:i}),null!=t&&We("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[c,l]),Me=Le(null);V(t,{variant:"geo-points",frameRef:Me});let[Ae,Re]=Pe(null),je=He(()=>{let e=Me.current?.getCartogramLayout?.();e&&Re(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"})},[]);Fe(()=>{let e=requestAnimationFrame(je);return()=>cancelAnimationFrame(e)},[je,u,s,i.width,i.height,pe,ne]);let Ie=Ne(()=>{if(!ce||!Ae)return[];let{maxCost:e}=Ae;if(e<=0)return[];if(Array.isArray(ce))return ce.filter(t=>t>0&&t<=e);let t="strip"===Ae.layout?3:5,i="number"==typeof ce?ce:Math.min(t,Math.max(2,Math.ceil(e/5))),o=e/i,r=[];for(let e=1;e<=i;e++)r.push(Math.round(o*e*10)/10);return r},[ce,Ae]),ze=Ne(()=>{if(!Ae)return J.foregroundGraphics||null;let e=Oe(h,{bottomMargin:ye.margin.bottom,costLabel:H,layout:Ae,ringStyle:j,ringValues:Ie,showNorth:de,showRingLabels:ue,showRings:ce}),t=J.foregroundGraphics;return"function"==typeof t?i=>We(Te,{children:[e,t(i)]}):We(Te,{children:[e,t]})},[Ae,Ie,ce,ue,de,H,j,ye.margin.bottom,J.foregroundGraphics]);if(ye.earlyReturn)return ye.earlyReturn;fe("DistanceCartogram",pe,"xAccessor",n),fe("DistanceCartogram",pe,"yAccessor",a);let De={projection:m,...null!=o&&{points:pe},...ke&&{lines:ke,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:a,pointIdAccessor:l,pointStyle:be,projectionTransform:ve,...w&&{transition:{duration:w}},...null!=p&&{graticule:p},...null!=g&&{fitPadding:g},...me&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...S&&{tileCacheSize:S},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ye.margin,enableHover:i.enableHover,tooltipContent:!1===N?()=>null:he(N)||Se,...ye.legendBehaviorProps,...Y({linkedHover:D,selection:T,onObservation:B,onClick:E,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},...J,foregroundGraphics:ze};return Oe(Q,{ref:Me,...De})}),"DistanceCartogram"),Ke=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:String(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(v(e,t.columnAccessor)),y:Number(v(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(v(t,e.config.longitudeAccessor,["lon","longitude"])),o=Number(v(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??y(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=g(l.map(e=>e.row)),c=g(l.map(e=>e.column)),u=Math.max(1,Math.round(s[1]-s[0])+1),d=Math.max(1,Math.round(c[1]-c[0])+1),m=Math.max(0,t.layoutPadding??8),h=Math.max(1,e.dimensions.width-2*m),p=Math.max(1,e.dimensions.height-2*m),b=h/d,x=p/u,k=b*d,S=x*u,A=(e.dimensions.width-k)/2,R=(e.dimensions.height-S)/2,N=ve(t.cellPadding??.12,0,.8),P=Math.max(1,.5*Math.min(b,x)*(1-N)),F=t.sizeAccessor?l.map(e=>Number(v(e.datum,t.sizeAccessor))):[],j=t.sizeDomain??g(F),L=t.sizeRange??[.36,1],H=ve(Math.min(L[0],L[1]),.05,1),I=ve(Math.max(L[0],L[1]),H,1),z=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=String(v(r,t.idAccessor,["id","key","name"])??`grid-${o}`),a=String(v(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,d=v(r,t.categoryAccessor),m=null==d?void 0:String(d),h=v(r,t.fillAccessor),p=null!=h?String(h):m?e.resolveColor(m):e.theme.categorical[0]??"#4f86c6",g=t.sizeAccessor?Number(v(r,t.sizeAccessor)):NaN,y=t.sizeAccessor&&Number.isFinite(g)?Math.sqrt(ve(f(g,j),0,1)):1,k=P*(H+y*(I-H)),S="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:u,category:m,row:i.row,column:i.column,x:A+(i.column-c[0]+.5)*b,y:R+(i.row-s[0]+.5)*x,radius:k,style:{fill:p,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...S}}}),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?M(e.x,e.y,e.radius):w(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:Oe(C,{marks:z,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??ve(.23*Math.min(b,x),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}}},Xe=/*#__PURE__*/new WeakMap,Ye=/*#__PURE__*/new WeakMap,et=/*#__PURE__*/new WeakMap,tt=1,it=e=>{let t=function(e){let t=Xe.get(e.areas);t||(t=new Map,Xe.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??"",L(t.featureFilter),L(t.dotFilter),G(e)].join("::")}(e),o=t.get(i);if(o)return o;let r=z(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,A(i.dotRadius)??t.cellSize*ve(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=R(l,i.categoryAccessor),m=R(l,i.fillAccessor),h={fill:null!=m?String(m):null!=d?e.resolveColor(String(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?_(c,u,r):Z(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?Oe("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?Oe("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"},P(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{Ue as ChoroplethMap,Ve as DistanceCartogram,qe as FlowMap,_e as ProportionalSymbolMap,it as geographicDotGridLayout,Ke as geographicGridLayout,y as gridifyGeographicPoints,J as mergeData,r as resolveReferenceGeography,z as sampleGeographicDotGrid};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{a as registerBuiltInNetworkLayouts}from"./c-
|
|
2
|
+
export{a as registerBuiltInNetworkLayouts}from"./c-RQWI623R.min.js";export{a as useForceLayout}from"./c-QSEAAHEU.min.js";export{a as DEFAULT_HIT_RADIUS,g as networkEdgeHitTarget,f as networkHitTarget}from"./c-7NMCUG5N.min.js";export{b as ChordDiagram,n as CirclePack,a as ForceDirectedGraph,p as NetworkCustomChart,o as OrbitDiagram,k as ProcessSankey,c as SankeyDiagram,l as TreeDiagram,m as Treemap,f as diagnoseProcessSankeyLayout,h as diagnoseProcessSankeyProps,g as explainProcessSankeyLayout,e as formatProcessSankeyIssue,i as inventoryAtTime,j as toProcessSankeyTime,d as validateProcessSankey}from"./c-2YFVDRU4.min.js";export{d as createNetworkPerspectiveFrame,m as projectNetworkScene,a as resolveNetworkPerspective}from"./c-MI27MBCH.min.js";export{b as StreamNetworkFrame,a as useNetworkPerspective}from"./c-6QV6F3U7.min.js";export{f as preloadNetworkPerspectiveExtras}from"./c-PTFHNN34.min.js";export{b as useCustomLayoutSelection}from"./c-363Q2L4Z.min.js";export{aM as MultiLineTooltip,aL as Tooltip,bR as composeStyleRules,bN as makeNodeRuleContext,bL as makeRuleValueResolver,bO as matchesThreshold,bo as resolveResponsiveRules,bQ as resolveStyleRules,bn as responsiveRuleMatches,bP as ruleMatches,bj as useSelectionActions}from"./c-62UTMRQE.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-JDI7HKEM.min.js";export{e as glyphExtent,d as glyphPlacement}from"./c-ELGOCAEY.min.js";export{B as TooltipRoot,E as hasOwnTooltipChrome,x as hasTooltipContent,D as markTooltipChrome}from"./c-B3X2IJRQ.min.js";export{NetworkPerspectiveBillboard,NetworkPerspectiveGround}from"./semiotic-network-placement.module.min.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{a as DEFAULT_HIT_RADIUS,b as hitTargetPoint,e as hitTargetRect}from"./c-7NMCUG5N.min.js";export{b as BarChart,f as BoxPlot,l as DonutChart,j as DotPlot,o as FunnelChart,m as GaugeChart,n as GroupedBarChart,g as Histogram,d as LikertChart,r as OrdinalCustomChart,k as PieChart,p as RadarChart,i as RidgelinePlot,c as StackedBarChart,a as StreamOrdinalFrame,e as SwarmPlot,q as SwimlaneChart,h as ViolinPlot}from"./c-
|
|
2
|
+
export{a as DEFAULT_HIT_RADIUS,b as hitTargetPoint,e as hitTargetRect}from"./c-7NMCUG5N.min.js";export{b as BarChart,f as BoxPlot,l as DonutChart,j as DotPlot,o as FunnelChart,m as GaugeChart,n as GroupedBarChart,g as Histogram,d as LikertChart,r as OrdinalCustomChart,k as PieChart,p as RadarChart,i as RidgelinePlot,c as StackedBarChart,a as StreamOrdinalFrame,e as SwarmPlot,q as SwimlaneChart,h as ViolinPlot}from"./c-D7YDFHLY.min.js";export{b as useCustomLayoutSelection}from"./c-363Q2L4Z.min.js";export{C as AnnotationLabel,aM as MultiLineTooltip,aL as Tooltip,bR as composeStyleRules,B as estimateLabelWidth,bN as makeNodeRuleContext,bL as makeRuleValueResolver,bS as makeStyleRuleStyleFn,bM as makeXYRuleContext,bO as matchesThreshold,bo as resolveResponsiveRules,bQ as resolveStyleRules,bn as responsiveRuleMatches,bP as ruleMatches}from"./c-62UTMRQE.min.js";export{h as createHatchPattern,j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-JDI7HKEM.min.js";export{e as glyphExtent,d as glyphPlacement}from"./c-ELGOCAEY.min.js";export{B as TooltipRoot,E as hasOwnTooltipChrome,x as hasTooltipContent,D as markTooltipChrome}from"./c-B3X2IJRQ.min.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
function m(e,t,i){let[n]=ot(()=>qe(t,i.seed,{durationMs:i.durationMs,maxEvents:i.maxEvents})),[a,r]=ot(n.isComplete),s=lt({target:e,options:i});s.current={target:e,options:i};let o=lt(void 0),l=lt(!1),u=ut(e=>{let{target:t,options:i}=s.current,a=t.current;if(!a||l.current)return 0;l.current=!0;try{let t=n.advance(e,i);return t.length&&a.pushMany(t.map(i.mapArrival)),n.isComplete()&&r(!0),t.length}finally{l.current=!1}},[n]),c=ut((e,t)=>{let i=o.current;o.current=e.elapsedSeconds,!l.current&&void 0!==i&&!s.current.options.manual&&u(1e3*Math.max(0,e.elapsedSeconds-i)),s.current.options.onTick?.(e,t)},[u]);return{frameProps:{continuous:!i.paused&&!i.manual&&!a,onTick:c},advance:u,getTime:n.getTime,getEmittedCount:n.getEmittedCount,isComplete:n.isComplete,snapshot:n.snapshot,restore:e=>{n.restore(e),o.current=void 0,r(n.isComplete())}}}function ee(e){let{data:t,encoding:i,defaults:n={},scales:a}=e,r=it({data:t,encoding:i}),s=[],o=new Map,l=[],u=[],c=new Map;return r.rows.forEach((e,t)=>{let{id:r,datum:d}=e,p=Math.max(0,nt(i.appearance?.size,d,t)??n.size??6),h=nt(i.appearance?.shape,d,t)??n.shape??{type:"circle",radius:p},m=e.placement.x??n.x??0,f=e.placement.y??n.y??0,y=a?.x?a.x(m):m,g=a?.y?a.y(f):f,b=nt(i.appearance?.color,d,t)??n.color,v=nt(i.appearance?.opacity,d,t)??n.opacity,w=nt(i.appearance?.stroke,d,t)??n.stroke,x=nt(i.appearance?.strokeWidth,d,t)??n.strokeWidth,S=nt(i.time?.spawnAt,d,t)??e.time.arrival,I=e.kinematics.velocityX,A=e.kinematics.velocityY,P=nt(i.dynamics?.mass,d,t)??n.mass??1,C=nt(i.dynamics?.friction,d,t),M=nt(i.dynamics?.restitution,d,t),E=nt(i.dynamics?.bodyCollisions,d,t),R={id:r,x:y,y:g,mass:P,shape:{...h},datum:d,...null!=S&&{spawnAt:S},...null!=I&&{vx:I},...null!=A&&{vy:A},...null!=C&&{friction:C},...null!=M&&{restitution:M},...null!=E&&{bodyCollisions:E}},T={...null!=b&&{fill:b},...null!=v&&{opacity:v},...null!=w&&{stroke:w},...null!=x&&{strokeWidth:x}},j={id:r,datum:d,appearance:{color:b,opacity:v,shape:h,size:p,stroke:w,strokeWidth:x},placement:{x:y,y:g,lane:e.placement.lane,space:i.placement?.space??"world"},time:{arrival:S,spawnAt:S,basis:i.time?.basis??"simulation",unit:i.time?.unit},kinematics:{velocityX:I,velocityY:A,space:i.kinematics?.space??"world"},dynamics:{bodyCollisions:E,friction:C,mass:P,restitution:M},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:R};s.push(j),o.set(r,j),l.push(R),c.set(r,T),u.push({id:r,bodyId:r,label:e.accessible.label,description:e.accessible.description,datum:d,x:y,y:g,group:e.accessible.group})}),{rows:s,byId:o,spawns:l,semanticItems:u,bodyStyle:e=>c.get(e.id)??{}}}function te(e){return t=>{let i=ee({data:t.data,encoding:e.encoding,defaults:e.defaults,scales:t.scales}),n=e.extend?.(t,i)??{};return{...n,initialSpawns:i.spawns,bodyStyle:i.bodyStyle,semanticItems:[...i.semanticItems,...n.semanticItems??[]]}}}function ie(e,t){let{layout:i,positiveProperties:n,negativeProperties:a,viability:r,outcome:s}=t,o=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?o.get(e.gateId):void 0,l=e.effects??[],c={...Ve(e,l),appliedAt:e.time},d=_e(u,c);if(d!==u){u=d;for(let i of l){let r={event:e,gate:t,negativeProperties:a,positiveProperties:n,project:u};i.when&&!i.when(r)||(u=Je(u,i,r))}u={...u,viability:r?.(u,{negativeProperties:a,positiveProperties:n})??ze(u,n,a)},e.final&&(u={...u,outcome:e.outcome??s?.(u,{layout:i,negativeProperties:a,positiveProperties:n})??(u.viability>20?"built":"approved_not_built")})}}return u}function ne(e){return e.projects.map(t=>ie(t,e))}function ae(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,a=new Map,r=e.assignmentForce??.45,s=e.returnForce??.35,o=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=new Map,c=0,d=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let i=n.get(e);if(i)return i;let r=t.find(e=>!a.has(e.id));if(!r)return null;let s={resourceId:r.id,resourceBodyId:r.bodyId,caseBodyId:e,assignedAt:c};return n.set(e,s),a.set(r.id,s),d+=1,s},release:e=>{let t=n.get(e);return!!t&&(n.delete(e),a.delete(t.resourceId),d+=1,!0)},getAssignment:e=>n.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 n)u.has(e)&&u.has(t.resourceBodyId)||(n.delete(e),a.delete(t.resourceId),d+=1)},getSnapshot:()=>({total:t.length,available:t.length-a.size,assigned:a.size,assignments:Array.from(n.values()),simulatedAt:c,metricRevision:d}),bodyForce:e=>{let t=i.get(e.body.id);if(t){let i=a.get(t.id),n=i?u.get(i.caseBodyId):void 0,o=n?n.x+(l.x??0):t.home.x,c=n?n.y+(l.y??0):t.home.y,d=i?r:s;return{x:(o-e.body.x)*d,y:(c-e.body.y)*d}}let c=n.get(e.body.id);if(!c||o<=0)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 re(e,t){let i="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):He(e.datum,t.deadlineAccessor)??He(e,t.deadlineAccessor);return Number.isFinite(Number(i))?Math.max(0,Number(i)):0}function se(e){function t(t){n.set(t.bodyId,t),r+=1,e.onStateChange?.({...t})}function i(e){let i=n.get(e);return!(!i||null!=i.completedAt||(t({...i,completedAt:a,state:"unhappy"===i.state?"resolved-unhappy":"resolved"}),0))}let n=new Map,a=0,r=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:a}),0))},complete:i,getCase:e=>n.get(e),tick:r=>{a=Math.max(a,r.elapsed);for(let s of r.controls.readBodies()){if(!Ke(s,e.bodyFilter))continue;if(!n.has(s.id)){let i=re(s,e);t({bodyId:s.id,openedAt:a,deadlineAt:a+i,state:"waiting"})}let o=n.get(s.id);o&&null==o.completedAt&&(e.completionRegionId&&r.getRegionState(s.id)?.activeRegionIds.includes(e.completionRegionId)?i(s.id):"waiting"===o.state&&a>=o.deadlineAt&&t({...o,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:a,metricRevision:r}}}}function oe(e){let t=new Set,i=0,n=0,a=0,r=!1;return{id:e.id??`dependency-gate:${e.regionId}`,continuous:!0,tick:s=>{i=Math.max(i,s.elapsed);let o=r;var l;l=i,r=e.isOpen?e.isOpen(l):null!=e.opensAt&&l>=e.opensAt;let u=s.controls.readBodies(),c=new Map(u.map(e=>[e.id,e]));for(let i of u)!s.getRegionState(i.id)?.activeRegionIds.includes(e.regionId)||!Ke(i,e.bodyFilter)||!r&&!t.has(i.id)&&(t.add(i.id),a+=1,e.onHeld?.(i));if(r&&!o){for(let i of t){let t=c.get(i);t&&(s.controls.applyImpulse(i,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),n+=1,e.onReleased?.(t))}t.clear(),a+=1}for(let e of t)c.has(e)||(t.delete(e),a+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:r,blocked:t.size,released:n,simulatedAt:i,metricRevision:a}),bodyForce:i=>{if(r||!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 a=e.holdForce??.4;return{x:(n.x-i.body.x)*a-.45*i.body.vx,y:(n.y-i.body.y)*a-.45*i.body.vy}}}}function le(e,t,i={}){let n=i.random??Math.random,a=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],r=rt(i.along??.5,.05,.95),s=i.jitterX??0,o=i.padY??20,l=a.x0+(a.x1-a.x0)*r+(2*n()-1)*s,u=Math.min(1,a.width/2),c=rt(l,a.x0+u,a.x1-u),d=e.boundaryY(c,"top")+o,p=e.boundaryY(c,"bottom")-o;return{x:c,y:p<=d?e.midY:d+n()*Math.max(1,p-d)}}function ue(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 ce(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function de(e,t,i,n,a){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??a)}function pe(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function he(e,t,i,n){let a=e.flatMap((e,a)=>{let r=ce(de(e,a,t,i,"time")),s=ce(de(e,a,t,n,"value"));return null==r||null==s?[]:[{time:pe(r),value:s,index:a}]});a.sort((e,t)=>e.time-t.time||e.index-t.index);let r=[];for(let e of a){let t=r[r.length-1];t?.time===e.time?t.value=e.value:r.push({time:e.time,value:e.value})}return r}function me(e,t,i,n){if(!e.length)return null;let a=e[0],r=e[e.length-1];if(t<a.time)return"clamp"===n?a.value:null;if(t>r.time)return"clamp"===n?r.value:null;let s=function(e,t){let i=0,n=e.length;for(;i<n;){let a=i+n>>>1;e[a].time<t?i=a+1:n=a}return i}(e,t),o=e[s];if(o?.time===t)return o.value;let l=e[Math.max(0,s-1)];if("step"===i||!o||o.time===l.time)return l.value;let u=(t-l.time)/(o.time-l.time);return l.value+(o.value-l.value)*u}function fe(e,t){if(1===e.length)return e[0];let i=(e.length-1)*t,n=Math.floor(i),a=Math.ceil(i);if(n===a)return e[n];let r=i-n;return e[n]+(e[a]-e[n])*r}function ye(e){let t=e.interpolation??"step",i=e.outsideDomain??"omit",n=function(e){let t=(e??ct).map(e=>{let t=ce(e);if(null==t||t<0||t>1)throw new RangeError(`physicsReferenceEnvelope quantiles must be finite values from 0 to 1; received ${String(e)}`);return pe(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}(e.quantiles),a=function(e){if(Array.isArray(e)){if(e.length>dt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(e.map(ce).filter(e=>null!=e).map(pe))).sort((e,t)=>e-t)}let t=e,i=ce(t.start),n=ce(t.end),a=ce(t.step);if(null==i||null==n||null==a||a<=0||n<i)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let r=Math.floor((n-i)/a)+1;if(r>dt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");let s=[],o=1e-10*Math.max(1,Math.abs(n),Math.abs(i));for(let e=0;e<r;e+=1){let t=i+e*a;if(t>n+o)break;s.push(pe(Math.min(t,n)))}if((!s.length||Math.abs(s[s.length-1]-n)>o)&&s.push(pe(n)),s.length>dt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(s)).sort((e,t)=>e-t)}(e.sampleAt),r=e.runs.map(t=>he(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:a.map(e=>{let a=r.map(n=>me(n,e,t,i)).filter(e=>null!=e).sort((e,t)=>e-t),s={};for(let e of n)s[e]=a.length?fe(a,e):null;return{time:e,count:a.length,min:a.length?a[0]:null,max:a.length?a[a.length-1]:null,median:a.length?fe(a,.5):null,quantiles:s}}),quantiles:n,interpolation:t,outsideDomain:i,runCount:e.runs.length}}function ge(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function be(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let i=ce(t);if(null==i||i<0||i>1)throw new RangeError(`comparePhysicsTrace quantile selectors must be from 0 to 1; received ${String(t)}`);let n=pe(i);if(!Object.prototype.hasOwnProperty.call(e.quantiles,n))throw new Error(`comparePhysicsTrace could not find quantile ${n} in the reference envelope`);return e.quantiles[n]??null}function ve(e,t,i){return e<t?"below":e>i?"above":"inside"}function we(e,t){let i=Math.max(0,t.time-e.time);if(!(i>0)||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,a=t.value-t.lower,r=e.value-e.upper,s=t.value-t.upper,o=[0,1];for(let[e,t]of[[n,a],[r,s]])(e<0&&t>0||e>0&&t<0)&&o.push(-e/(t-e));o.sort((e,t)=>e-t);let l=0,u=0,c=0;for(let n=0;n<o.length-1;n+=1){let a=o[n],r=o[n+1];if(!(r>a))continue;let s=(a+r)/2,d=(r-a)*i,p=ve(e.value+(t.value-e.value)*s,e.lower+(t.lower-e.lower)*s,e.upper+(t.upper-e.upper)*s);"below"===p?l+=d:"above"===p?c+=d:u+=d}return{below:l,inside:u,above:c,observed:i}}function xe(e,t,i={}){let n=i.interpolation??t.interpolation,a=i.outsideDomain??t.outsideDomain,r=he(e,i.traceId??"trace",i.timeAccessor,i.valueAccessor),s=i.lower??ge(t,"lower"),o=i.upper??ge(t,"upper"),l=t.points.map(e=>{let t=me(r,e.time,n,a),i=be(e,s),l=be(e,o);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":ve(t,i,l)}}),u=0,c=0,d=0,p=0,h=null,m=0,f=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),i=Math.max(0,e.lower-e.value);t>p&&(p=t,h=e.time),i>m&&(m=i,f=e.time)}let y=0,g=0,b=0,v=0;for(let e=0;e<l.length-1;e+=1){let t=l[e],i=l[e+1],a=Math.max(0,i.time-t.time);if(a>0){if("linear"===n){let e=we(t,i);y+=e.below,g+=e.inside,b+=e.above,v+=e.observed;continue}"unobserved"!==t.status&&(v+=a,"below"===t.status?y+=a:"above"===t.status?b+=a:g+=a)}}let w=l[0]?.time,x=l[l.length-1]?.time,S=null==w||null==x?0:Math.max(0,x-w),I=u+c+d;return{points:l,sampleCount:l.length,observedSamples:I,belowSamples:u,insideSamples:c,aboveSamples:d,totalDuration:S,observedDuration:v,unobservedDuration:Math.max(0,S-v),belowDuration:y,insideDuration:g,aboveDuration:b,peakExcess:p,peakExcessAt:h,peakDeficit:m,peakDeficitAt:f}}function Se(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function Ie(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Ae(e){return!!Ie(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&Ie(e.visitsByStage)&&Ie(e.firstEnteredAt)&&Ie(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function Pe(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function Ce(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,Pe(e)]))}}function Me(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),a=e.stages.findIndex(e=>e.id===n);if(a<0)return e;let r=i.entityId?.(t)??t.bodyId;if(!r)return e;let s=Se(e.entities,r),o=Ae(s)?s:Pe(r),l=o.currentStageId?e.stages.findIndex(e=>e.id===o.currentStageId):-1,u=!o.visitedStageIds.includes(n),c=Number(t.observation.timestamp),d=Number.isFinite(c)?c:0,p=Se(o.visitsByStage,n),h="number"==typeof p&&Number.isFinite(p)?p:0,m={...o,currentStageId:n,furthestStageId:a>o.furthestStageIndex?n:o.furthestStageId,furthestStageIndex:Math.max(o.furthestStageIndex,a),visitedStageIds:u?[...o.visitedStageIds,n]:o.visitedStageIds,visitsByStage:{...o.visitsByStage,[n]:h+1},firstEnteredAt:u?{...o.firstEnteredAt,[n]:d}:o.firstEnteredAt,lastEnteredAt:{...o.lastEnteredAt,[n]:d},regressionCount:l>=0&&a<l?o.regressionCount+1:o.regressionCount};return{...e,bodyIds:e.bodyIds.includes(r)?e.bodyIds:[...e.bodyIds,r],entities:{...e.entities,[r]:m}}}function Ee(e){let t=e.bodyIds.map(t=>{let i=Se(e.entities,t);return Ae(i)?i:Pe(t)}),i=t.length,n=i;return e.stages.map((e,a)=>{let r=t.filter(e=>e.furthestStageIndex>=a).length,s=t.filter(t=>t.visitedStageIds.includes(e.id)).length,o=t.reduce((t,i)=>{let n=Se(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:r,entered:s,total:i,conversion:i>0?r/i:0,fromPrevious:n>0?r/n:0,dropoff:Math.max(0,n-r),visits:o,repeatVisits:Math.max(0,o-s)};return n=r,l})}function Re(e){let[t,i]=e.size,n=e.flow??"down",a=null==(x=e.padding)?{top:24,right:24,bottom:24,left:24}:"number"==typeof x?{top:x,right:x,bottom:x,left:x}:{top:x.top??0,right:x.right??0,bottom:x.bottom??0,left:x.left??0},r=Math.max(.05,Math.min(1,e.channelRatio??1)),s={x:a.left,y:a.top,width:Math.max(1,t-a.left-a.right),height:Math.max(1,i-a.top-a.bottom)},o="down"===n?s.height:s.width,l=o*Math.max(0,e.chargeExtent??.12),u=o*Math.max(0,e.projectionExtent??0),c=o*Math.max(0,e.destinationExtent??.55),d=Math.max(0,o-l-c-u),p=function(e){if("number"==typeof e){let t=Math.max(1,Math.round(e));return Array.from({length:t},(e,t)=>({id:`bin-${t}`,label:String(t)}))}return 0===e.length?[{id:"bin-0",label:"0"}]:e.map((e,t)=>({id:e.id,label:e.label??e.id??String(t)}))}(e.destinations),h=("down"===n?s.width:s.height)/p.length,m="down"===n?(e,t)=>({x:s.x,y:s.y+e,width:s.width,height:t}):(e,t)=>({x:s.x+e,y:s.y,width:t,height:s.height}),f=m(0,l),y=m(l,d),g=l+d,b=m(g,c),v=m(g+c,u),w=p.map((e,t)=>{let i=t*h,a=h*r,o=(h-a)/2;if("down"===n){let n=s.x+i+o;return{id:e.id,label:e.label,order:t,x:n,y:b.y,width:a,height:b.height,centerX:s.x+(t+.5)*h,centerY:b.y+b.height/2}}let l=s.y+i+o;return{id:e.id,label:e.label,order:t,x:b.x,y:l,width:b.width,height:a,centerX:b.x+b.width/2,centerY:s.y+(t+.5)*h}});var x;return{width:t,height:i,flow:n,charge:f,apparatus:y,destinations:w,projection:v}}function Te(e,t){return e.destinations.find(e=>e.id===t)}function je(e,t,i){let{charge:n,flow:a}=e,r=Math.max(1,i),s=(t%r+.5)/r;return"down"===a?{x:n.x+n.width*s,y:n.y+n.height/2}:{x:n.x+n.width/2,y:n.y+n.height*s}}function ke(e,t={}){let i=t.thickness??4,n=t.idPrefix??"stage",{destinations:a,flow:r,width:s,height:o}=e,l=[];if(a.length>0){let t=a[0];if("down"===r){let r=t.y+t.height;l.push({id:`${n}-floor`,shape:{type:"segment",x1:e.charge.x,y1:r,x2:e.charge.x+e.charge.width,y2:r,thickness:i}});for(let e=1;e<a.length;e+=1){let s=a[e].centerX-(a[e].centerX-a[e-1].centerX)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:s,y1:t.y,x2:s,y2:r,thickness:i}})}}else{let r=t.x+t.width;l.push({id:`${n}-floor`,shape:{type:"segment",x1:r,y1:e.charge.y,x2:r,y2:e.charge.y+e.charge.height,thickness:i}});for(let e=1;e<a.length;e+=1){let s=a[e].centerY-(a[e].centerY-a[e-1].centerY)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:s,x2:r,y2:s,thickness:i}})}}}return!1!==t.walls&&l.push({id:`${n}-wall-left`,shape:{type:"segment",x1:1,y1:0,x2:1,y2:o,thickness:i}},{id:`${n}-wall-right`,shape:{type:"segment",x1:s-1,y1:0,x2:s-1,y2:o,thickness:i}}),l}function Be(e,t={}){let i=t.charge??"bodies",n=t.apparatus??"the apparatus",a=t.destination??"destinations",r=e.destinations.length,s="down"===e.flow?"downward":"left to right";return`${i} enter at the ${"down"===e.flow?"top":"left"}, travel ${s} through ${n}, and come to rest in ${r} ${a}: ${e.destinations.map(e=>e.label).join(", ")}.`}function Fe(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function Le(e,t,i,n){let a="function"==typeof e?e(t,i):e;return Number.isFinite(a)?Number(a):n}function Ne(e,t,i){return Fe(e[t])??i}function $e(e,t){return"number"==typeof e?e:e?.[t]??0}function De(e){let{band:t,idPrefix:i,plot:n,projection:a}=e,{includeBoundaryWalls:r=!0,includeInteriorWalls:s=!0,wallThickness:o=4}=t,l=function(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,i=new Set;for(let n of e.values){let a=e.scale(n);Number.isFinite(a)&&(i.add(Number(a)),i.add(Number(a)+t))}return Array.from(i).sort((e,t)=>e-t)}(t);if(l.length<2)return[];let u=r?0:1,c=r?l.length-1:l.length-2,d=[];for(let e=u;e<=c;e+=1){if(!s&&e>0&&e<l.length-1)continue;let t=l[e];d.push({id:`${i}-wall-${e}`,shape:"x"===a?{type:"aabb",x:t,y:n.y+n.height/2,width:o,height:n.height}:{type:"aabb",x:n.x+n.width/2,y:t,width:n.width,height:o}})}return d}function Oe(e){let{plot:t,idPrefix:i="physics-scale",bounds:n={},xBins:a,xBands:r,yBands:s}=e,o=[];if(!1!==n&&o.push(...Xe(t,{idPrefix:i,...n})),a){let{idPrefix:e,yTop:n,yBottom:r,...s}=a;o.push(...Qe({...s,idPrefix:e??`${i}-xbin`,yTop:n??t.y,yBottom:r??t.y+t.height}))}return r&&o.push(...De({band:r,idPrefix:r.idPrefix??`${i}-xband`,plot:t,projection:"x"})),s&&o.push(...De({band:s,idPrefix:s.idPrefix??`${i}-yband`,plot:t,projection:"y"})),o}function Ye(e){let{plot:t,rows:i,columns:n=i+1,pegRadius:a=3,idPrefix:r="galton-peg",yStart:s=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(i)),p=Math.max(1,Math.floor(n));if(0===d)return[];let h=d<=1?0:(o-s)/(d-1),m=t.width/p,f=[];for(let e=0;e<d;e+=1){let i=l&&e%2==1?m/2:0;for(let n=0;n<p;n+=1){let o=t.x+m*(n+.5)+i;o<t.x+a||o>t.x+t.width-a||f.push({id:`${r}-${e}-${n}`,shape:{type:"aabb",x:o,y:s+e*h,width:2*a,height:2*a},restitution:u,friction:c})}}return f}function Ge(e,t={}){let{idPrefix:i="physics-token",radius:n=5,shape:a,mass:r,vx:s,vy:o,spawnAt:l,seed:u=1,jitter:c,datum:d}=t,p=tt(u),h=$e(c,"x"),m=$e(c,"y");return e.map((e,u)=>{let c=Le(t.x,e,u,Ne(e,"x",0)),f=Le(t.y,e,u,Ne(e,"y",0)),y=Le(n,e,u,5),g="function"==typeof a?a(e,u):a??{type:"circle",radius:y};return{id:`${i}-${e.index??u}`,x:c+(p()-.5)*h,y:f+(p()-.5)*m,vx:Le(s,e,u,0),vy:Le(o,e,u,0),mass:Le(r,e,u,1),spawnAt:Le(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,...i}=e;return i})}function Ue(e,t={}){let{idPrefix:i="sediment",collider:n=!0,colliderThickness:a=1,restitution:r=.05,friction:s=.2,...o}=t,l=Ze(e,o),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+a/2,width:e.width,height:a},restitution:r,friction:s})):[];return{columns:l,colliders:u}}function We(e,t={}){let{timeAccessor:i="arrivalTime",timeScale:n=1,startAt:a=0,rebase:r=!0,sort:s=!0}=t,o=e.map((e,t)=>({spawn:e,time:function(e,t,i){return Fe("function"==typeof i?i(e,t):e[i]??e.datum?.[i])}(e,t,i)??e.spawnAt??t})),l=o.length?st(o.map(e=>e.time)):0;return{initialSpawns:o.map(({spawn:e,time:t})=>({...e,spawnAt:a+(r?t-l:t)})).sort((e,t)=>s?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:a,timeAccessor:"spawnAt",timeScale:n}}}import{R as qe,af as Ve,ag as _e,ae as Je,ab as ze,e as He,f as Ke,l as Xe,m as Qe,j as Ze,s as et}from"./c-N2TVSOYL.min.js";export{g as BuiltInPhysicsEngineAdapter,aU as ChainReactionChart,Y as CollisionSwarmChart,aO as CrucibleChart,av as DEFAULT_CRUCIBLE_HEIGHT,ax as DEFAULT_CRUCIBLE_OUTLETS,aw as DEFAULT_CRUCIBLE_SIZE,au as DEFAULT_CRUCIBLE_WIDTH,U as EventDropChart,P as GaltonBoardChart,ah as GauntletChart,ai as GuantletChart,aj as PacketFlowChart,ak as PhysicalFlowChart,X as PhysicsCustomChart,W as PhysicsPileChart,n as PhysicsPipelineStore,d as PhysicsSVGOverlay,i as PhysicsSedimentAccumulator,am as ProcessFlowChart,r as StreamPhysicsFrame,V as UnitPileChart,Q as WATERMARK_LONG_TAIL_JITTER,K as absorbRegion,z as aggregateRegionCounts,ap as applyCrucibleEvent,a as bodiesToAnnotationAnchors,M as bodyGroupSpec,x as buildCollisionSwarmPhysics,at as buildCrucibleEvidence,aF as buildCrucibleInitialSpawns,az as buildCrucibleLayout,aB as buildCruciblePhysicsConfig,aN as buildCrucibleProductEvents,aq as buildCrucibleProjection,aG as buildCrucibleStateSpawns,aH as buildCrucibleTerminalSpawns,u as buildEventDropPhysics,t as buildGaltonBoardPhysics,y as buildPhysicalFlowPhysics,b as buildPhysicsAnnotationContext,w as buildPhysicsPile,O as buildProcessFlowPhysics,aT as calculateBlockerAmplification,I as capacitatedRegion,F as chargeGateRegion,an as cloneCrucibleState,aM as compileCruciblePlan,aP as compileDependencyMachine,p as composePhysicsControllers,o as createCapacityQueueController,h as createDefaultPhysicsEngineAdapter,ay as createInitialCrucibleState,aR as createLogicalJoin,q as createPortalController,R as createSyntheticEmitter,aE as crucibleBondId,aA as crucibleBoundaryColliders,aC as crucibleComponentBodyId,aD as crucibleProductBodyId,ar as crucibleProjectionRows,aI as crucibleSemanticKey,as as evaluateCrucibleConservation,k as evaluatePhysicsBodyBudget,L as forceFieldRegion,B as groupCompletionRows,E as membraneRegion,c as normalizePhysicsAnnotations,Z as physicsProcessBoundaryColliders,aa as physicsProcessGroupSemanticItems,$ as physicsProcessRegionSemanticItem,_ as physicsProcessStageSemanticItems,ac as planGauntletPropertyWork,J as portalRegion,H as pressureFieldRegion,al as processChrome,N as processLaneWalls,C as processStageLayout,D as processStageRegions,v as readEventDropOccupancy,A as regionCountsToProjectionRows,T as registerPhysicsLivePrograms,ad as replaceGauntletNegative,aL as replayCruciblePlan,aS as replayStateTransitions,ao as resolveCrucibleSelector,aK as resolveCrucibleSnapshotAt,aJ as resolveCrucibleTime,aQ as routeDependencyTracks,G as routeSurfaceRegion,j as sedimentHeightfield,S as syntheticArrivals}from"./c-N2TVSOYL.min.js";export{p as EventDropLedger}from"./c-HGWITEJI.min.js";import{a as tt}from"./c-RI7UJTEY.min.js";import{f as it,e as nt,O as rt}from"./c-SU6Z75M2.min.js";export{aL as MultiLineTooltip,aK as Tooltip,f as compileMotionEncoding,bO as composeStyleRules,j as deriveMotionVector,bI as makeRuleValueResolver,bL as matchesThreshold,h as opacityFromAge,e as resolveMotionAccessor,g as resolveMotionAge,i as resolveMotionVector,bN as resolveStyleRules,bM as ruleMatches}from"./c-SU6Z75M2.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-VZNIIKL6.min.js";export{w as TooltipRoot,z as hasOwnTooltipChrome,s as hasTooltipContent,y as markTooltipChrome}from"./c-TC47SNSI.min.js";import{b as st}from"./c-GRTKU3C7.min.js";import{useState as ot,useRef as lt,useCallback as ut}from"react";var ct=[.1,.5,.9],dt=1e6,pt=et;export{We as arrivalReplay,Oe as collidersFromScales,xe as comparePhysicsTrace,ee as compilePhysicsEncoding,oe as createDependencyGateController,te as createPhysicsEncodingLayout,Ce as createProcessJourneyLedger,se as createServiceLevelController,ae as createServiceResourcePoolController,pt as default,Be as describePhysicsStageGeography,Ye as galtonPegs,je as physicsChargePoint,Te as physicsDestination,ye as physicsReferenceEnvelope,ke as physicsStageColliders,Re as physicsStageGeography,Ee as processJourneyRows,ue as processVolumePolygons,ie as resolveGauntletTerminalState,ne as resolveGauntletTerminalStates,Ue as sedimentBake,Ge as spawnFromTokens,le as stageTargetInVolume,Me as updateProcessJourney,m as useEmitters};
|
|
2
|
+
function s(e,t,i){let[n]=ut(()=>Ve(t,i.seed,{durationMs:i.durationMs,maxEvents:i.maxEvents})),[a,r]=ut(n.isComplete),s=ct({target:e,options:i});s.current={target:e,options:i};let o=ct(void 0),l=ct(!1),u=dt(e=>{let{target:t,options:i}=s.current,a=t.current;if(!a||l.current)return 0;l.current=!0;try{let t=n.advance(e,i);return t.length&&a.pushMany(t.map(i.mapArrival)),n.isComplete()&&r(!0),t.length}finally{l.current=!1}},[n]),c=dt((e,t)=>{let i=o.current;o.current=e.elapsedSeconds,!l.current&&void 0!==i&&!s.current.options.manual&&u(1e3*Math.max(0,e.elapsedSeconds-i)),s.current.options.onTick?.(e,t)},[u]);return{frameProps:{continuous:!i.paused&&!i.manual&&!a,onTick:c},advance:u,getTime:n.getTime,getEmittedCount:n.getEmittedCount,isComplete:n.isComplete,snapshot:n.snapshot,restore:e=>{n.restore(e),o.current=void 0,r(n.isComplete())}}}function m(e){let{data:t,encoding:i,defaults:n={},scales:a}=e,r=rt({data:t,encoding:i}),s=[],o=new Map,l=[],u=[],c=new Map;return r.rows.forEach((e,t)=>{let{id:r,datum:d}=e,p=Math.max(0,st(i.appearance?.size,d,t)??n.size??6),h=st(i.appearance?.shape,d,t)??n.shape??{type:"circle",radius:p},m=e.placement.x??n.x??0,f=e.placement.y??n.y??0,y=a?.x?a.x(m):m,g=a?.y?a.y(f):f,b=st(i.appearance?.color,d,t)??n.color,v=st(i.appearance?.opacity,d,t)??n.opacity,x=st(i.appearance?.stroke,d,t)??n.stroke,w=st(i.appearance?.strokeWidth,d,t)??n.strokeWidth,S=st(i.time?.spawnAt,d,t)??e.time.arrival,A=e.kinematics.velocityX,I=e.kinematics.velocityY,P=st(i.dynamics?.mass,d,t)??n.mass??1,C=st(i.dynamics?.friction,d,t),E=st(i.dynamics?.restitution,d,t),M=st(i.dynamics?.bodyCollisions,d,t),R={id:r,x:y,y:g,mass:P,shape:{...h},datum:d,...null!=S&&{spawnAt:S},...null!=A&&{vx:A},...null!=I&&{vy:I},...null!=C&&{friction:C},...null!=E&&{restitution:E},...null!=M&&{bodyCollisions:M}},T={...null!=b&&{fill:b},...null!=v&&{opacity:v},...null!=x&&{stroke:x},...null!=w&&{strokeWidth:w}},j={id:r,datum:d,appearance:{color:b,opacity:v,shape:h,size:p,stroke:x,strokeWidth:w},placement:{x:y,y:g,lane:e.placement.lane,space:i.placement?.space??"world"},time:{arrival:S,spawnAt:S,basis:i.time?.basis??"simulation",unit:i.time?.unit},kinematics:{velocityX:A,velocityY:I,space:i.kinematics?.space??"world"},dynamics:{bodyCollisions:M,friction:C,mass:P,restitution:E},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:R};s.push(j),o.set(r,j),l.push(R),c.set(r,T),u.push({id:r,bodyId:r,label:e.accessible.label,description:e.accessible.description,datum:d,x:y,y:g,group:e.accessible.group})}),{rows:s,byId:o,spawns:l,semanticItems:u,bodyStyle:e=>c.get(e.id)??{}}}function ee(e){return t=>{let i=m({data:t.data,encoding:e.encoding,defaults:e.defaults,scales:t.scales}),n=e.extend?.(t,i)??{};return{...n,initialSpawns:i.spawns,bodyStyle:i.bodyStyle,semanticItems:[...i.semanticItems,...n.semanticItems??[]]}}}function te(e,t){let{layout:i,positiveProperties:n,negativeProperties:a,viability:r,outcome:s}=t,o=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?o.get(e.gateId):void 0,l=e.effects??[],c={...We(e,l),appliedAt:e.time},d=He(u,c);if(d!==u){u=d;for(let i of l){let r={event:e,gate:t,negativeProperties:a,positiveProperties:n,project:u};i.when&&!i.when(r)||(u=Xe(u,i,r))}u={...u,viability:r?.(u,{negativeProperties:a,positiveProperties:n})??ze(u,n,a)},e.final&&(u={...u,outcome:e.outcome??s?.(u,{layout:i,negativeProperties:a,positiveProperties:n})??(u.viability>20?"built":"approved_not_built")})}}return u}function ie(e){return e.projects.map(t=>te(t,e))}function ne(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,a=new Map,r=e.assignmentForce??.45,s=e.returnForce??.35,o=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=new Map,c=0,d=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let i=n.get(e);if(i)return i;let r=t.find(e=>!a.has(e.id));if(!r)return null;let s={resourceId:r.id,resourceBodyId:r.bodyId,caseBodyId:e,assignedAt:c};return n.set(e,s),a.set(r.id,s),d+=1,s},release:e=>{let t=n.get(e);return!!t&&(n.delete(e),a.delete(t.resourceId),d+=1,!0)},getAssignment:e=>n.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 n)u.has(e)&&u.has(t.resourceBodyId)||(n.delete(e),a.delete(t.resourceId),d+=1)},getSnapshot:()=>({total:t.length,available:t.length-a.size,assigned:a.size,assignments:Array.from(n.values()),simulatedAt:c,metricRevision:d}),bodyForce:e=>{let t=i.get(e.body.id);if(t){let i=a.get(t.id),n=i?u.get(i.caseBodyId):void 0,o=n?n.x+(l.x??0):t.home.x,c=n?n.y+(l.y??0):t.home.y,d=i?r:s;return{x:(o-e.body.x)*d,y:(c-e.body.y)*d}}let c=n.get(e.body.id);if(!c||o<=0)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 ae(e,t){let i="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):Ke(e.datum,t.deadlineAccessor)??Ke(e,t.deadlineAccessor);return Number.isFinite(Number(i))?Math.max(0,Number(i)):0}function re(e){function t(t){n.set(t.bodyId,t),r+=1,e.onStateChange?.({...t})}function i(e){let i=n.get(e);return!(!i||null!=i.completedAt||(t({...i,completedAt:a,state:"unhappy"===i.state?"resolved-unhappy":"resolved"}),0))}let n=new Map,a=0,r=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:a}),0))},complete:i,getCase:e=>n.get(e),tick:r=>{a=Math.max(a,r.elapsed);for(let s of r.controls.readBodies()){if(!Qe(s,e.bodyFilter))continue;if(!n.has(s.id)){let i=ae(s,e);t({bodyId:s.id,openedAt:a,deadlineAt:a+i,state:"waiting"})}let o=n.get(s.id);o&&null==o.completedAt&&(e.completionRegionId&&r.getRegionState(s.id)?.activeRegionIds.includes(e.completionRegionId)?i(s.id):"waiting"===o.state&&a>=o.deadlineAt&&t({...o,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:a,metricRevision:r}}}}function se(e){let t=new Set,i=0,n=0,a=0,r=!1;return{id:e.id??`dependency-gate:${e.regionId}`,continuous:!0,tick:s=>{i=Math.max(i,s.elapsed);let o=r;var l;l=i,r=e.isOpen?e.isOpen(l):null!=e.opensAt&&l>=e.opensAt;let u=s.controls.readBodies(),c=new Map(u.map(e=>[e.id,e]));for(let i of u)!s.getRegionState(i.id)?.activeRegionIds.includes(e.regionId)||!Qe(i,e.bodyFilter)||!r&&!t.has(i.id)&&(t.add(i.id),a+=1,e.onHeld?.(i));if(r&&!o){for(let i of t){let t=c.get(i);t&&(s.controls.applyImpulse(i,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),n+=1,e.onReleased?.(t))}t.clear(),a+=1}for(let e of t)c.has(e)||(t.delete(e),a+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:r,blocked:t.size,released:n,simulatedAt:i,metricRevision:a}),bodyForce:i=>{if(r||!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 a=e.holdForce??.4;return{x:(n.x-i.body.x)*a-.45*i.body.vx,y:(n.y-i.body.y)*a-.45*i.body.vy}}}}function oe(e,t,i={}){let n=i.random??Math.random,a=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],r=ot(i.along??.5,.05,.95),s=i.jitterX??0,o=i.padY??20,l=a.x0+(a.x1-a.x0)*r+(2*n()-1)*s,u=Math.min(1,a.width/2),c=ot(l,a.x0+u,a.x1-u),d=e.boundaryY(c,"top")+o,p=e.boundaryY(c,"bottom")-o;return{x:c,y:p<=d?e.midY:d+n()*Math.max(1,p-d)}}function le(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 ue(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function ce(e,t,i,n,a){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??a)}function de(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function pe(e,t,i,n){let a=e.flatMap((e,a)=>{let r=ue(ce(e,a,t,i,"time")),s=ue(ce(e,a,t,n,"value"));return null==r||null==s?[]:[{time:de(r),value:s,index:a}]});a.sort((e,t)=>e.time-t.time||e.index-t.index);let r=[];for(let e of a){let t=r[r.length-1];t?.time===e.time?t.value=e.value:r.push({time:e.time,value:e.value})}return r}function he(e,t,i,n){if(!e.length)return null;let a=e[0],r=e[e.length-1];if(t<a.time)return"clamp"===n?a.value:null;if(t>r.time)return"clamp"===n?r.value:null;let s=function(e,t){let i=0,n=e.length;for(;i<n;){let a=i+n>>>1;e[a].time<t?i=a+1:n=a}return i}(e,t),o=e[s];if(o?.time===t)return o.value;let l=e[Math.max(0,s-1)];if("step"===i||!o||o.time===l.time)return l.value;let u=(t-l.time)/(o.time-l.time);return l.value+(o.value-l.value)*u}function me(e,t){if(1===e.length)return e[0];let i=(e.length-1)*t,n=Math.floor(i),a=Math.ceil(i);if(n===a)return e[n];let r=i-n;return e[n]+(e[a]-e[n])*r}function fe(e){let t=e.interpolation??"step",i=e.outsideDomain??"omit",n=function(e){let t=(e??Je).map(e=>{let t=ue(e);if(null==t||t<0||t>1)throw new RangeError(`physicsReferenceEnvelope quantiles must be finite values from 0 to 1; received ${String(e)}`);return de(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}(e.quantiles),a=function(e){if(Array.isArray(e)){if(e.length>qe)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(e.map(ue).filter(e=>null!=e).map(de))).sort((e,t)=>e-t)}let t=e,i=ue(t.start),n=ue(t.end),a=ue(t.step);if(null==i||null==n||null==a||a<=0||n<i)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let r=Math.floor((n-i)/a)+1;if(r>qe)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");let s=[],o=1e-10*Math.max(1,Math.abs(n),Math.abs(i));for(let e=0;e<r;e+=1){let t=i+e*a;if(t>n+o)break;s.push(de(Math.min(t,n)))}if((!s.length||Math.abs(s[s.length-1]-n)>o)&&s.push(de(n)),s.length>qe)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(s)).sort((e,t)=>e-t)}(e.sampleAt),r=e.runs.map(t=>pe(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:a.map(e=>{let a=r.map(n=>he(n,e,t,i)).filter(e=>null!=e).sort((e,t)=>e-t),s={};for(let e of n)s[e]=a.length?me(a,e):null;return{time:e,count:a.length,min:a.length?a[0]:null,max:a.length?a[a.length-1]:null,median:a.length?me(a,.5):null,quantiles:s}}),quantiles:n,interpolation:t,outsideDomain:i,runCount:e.runs.length}}function ye(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function ge(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let i=ue(t);if(null==i||i<0||i>1)throw new RangeError(`comparePhysicsTrace quantile selectors must be from 0 to 1; received ${String(t)}`);let n=de(i);if(!Object.prototype.hasOwnProperty.call(e.quantiles,n))throw new Error(`comparePhysicsTrace could not find quantile ${n} in the reference envelope`);return e.quantiles[n]??null}function be(e,t,i){return e<t?"below":e>i?"above":"inside"}function ve(e,t){let i=Math.max(0,t.time-e.time);if(!(i>0)||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,a=t.value-t.lower,r=e.value-e.upper,s=t.value-t.upper,o=[0,1];for(let[e,t]of[[n,a],[r,s]])(e<0&&t>0||e>0&&t<0)&&o.push(-e/(t-e));o.sort((e,t)=>e-t);let l=0,u=0,c=0;for(let n=0;n<o.length-1;n+=1){let a=o[n],r=o[n+1];if(!(r>a))continue;let s=(a+r)/2,d=(r-a)*i,p=be(e.value+(t.value-e.value)*s,e.lower+(t.lower-e.lower)*s,e.upper+(t.upper-e.upper)*s);"below"===p?l+=d:"above"===p?c+=d:u+=d}return{below:l,inside:u,above:c,observed:i}}function xe(e,t,i={}){let n=i.interpolation??t.interpolation,a=i.outsideDomain??t.outsideDomain,r=pe(e,i.traceId??"trace",i.timeAccessor,i.valueAccessor),s=i.lower??ye(t,"lower"),o=i.upper??ye(t,"upper"),l=t.points.map(e=>{let t=he(r,e.time,n,a),i=ge(e,s),l=ge(e,o);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":be(t,i,l)}}),u=0,c=0,d=0,p=0,h=null,m=0,f=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),i=Math.max(0,e.lower-e.value);t>p&&(p=t,h=e.time),i>m&&(m=i,f=e.time)}let y=0,g=0,b=0,v=0;for(let e=0;e<l.length-1;e+=1){let t=l[e],i=l[e+1],a=Math.max(0,i.time-t.time);if(a>0){if("linear"===n){let e=ve(t,i);y+=e.below,g+=e.inside,b+=e.above,v+=e.observed;continue}"unobserved"!==t.status&&(v+=a,"below"===t.status?y+=a:"above"===t.status?b+=a:g+=a)}}let x=l[0]?.time,w=l[l.length-1]?.time,S=null==x||null==w?0:Math.max(0,w-x),A=u+c+d;return{points:l,sampleCount:l.length,observedSamples:A,belowSamples:u,insideSamples:c,aboveSamples:d,totalDuration:S,observedDuration:v,unobservedDuration:Math.max(0,S-v),belowDuration:y,insideDuration:g,aboveDuration:b,peakExcess:p,peakExcessAt:h,peakDeficit:m,peakDeficitAt:f}}function we(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function Se(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Ae(e){return!!Se(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&Se(e.visitsByStage)&&Se(e.firstEnteredAt)&&Se(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function Ie(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function Pe(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,Ie(e)]))}}function Ce(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),a=e.stages.findIndex(e=>e.id===n);if(a<0)return e;let r=i.entityId?.(t)??t.bodyId;if(!r)return e;let s=we(e.entities,r),o=Ae(s)?s:Ie(r),l=o.currentStageId?e.stages.findIndex(e=>e.id===o.currentStageId):-1,u=!o.visitedStageIds.includes(n),c=Number(t.observation.timestamp),d=Number.isFinite(c)?c:0,p=we(o.visitsByStage,n),h="number"==typeof p&&Number.isFinite(p)?p:0,m={...o,currentStageId:n,furthestStageId:a>o.furthestStageIndex?n:o.furthestStageId,furthestStageIndex:Math.max(o.furthestStageIndex,a),visitedStageIds:u?[...o.visitedStageIds,n]:o.visitedStageIds,visitsByStage:{...o.visitsByStage,[n]:h+1},firstEnteredAt:u?{...o.firstEnteredAt,[n]:d}:o.firstEnteredAt,lastEnteredAt:{...o.lastEnteredAt,[n]:d},regressionCount:l>=0&&a<l?o.regressionCount+1:o.regressionCount};return{...e,bodyIds:e.bodyIds.includes(r)?e.bodyIds:[...e.bodyIds,r],entities:{...e.entities,[r]:m}}}function Ee(e){let t=e.bodyIds.map(t=>{let i=we(e.entities,t);return Ae(i)?i:Ie(t)}),i=t.length,n=i;return e.stages.map((e,a)=>{let r=t.filter(e=>e.furthestStageIndex>=a).length,s=t.filter(t=>t.visitedStageIds.includes(e.id)).length,o=t.reduce((t,i)=>{let n=we(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:r,entered:s,total:i,conversion:i>0?r/i:0,fromPrevious:n>0?r/n:0,dropoff:Math.max(0,n-r),visits:o,repeatVisits:Math.max(0,o-s)};return n=r,l})}function Me(e){let[t,i]=e.size,n=e.flow??"down",a=null==(w=e.padding)?{top:24,right:24,bottom:24,left:24}:"number"==typeof w?{top:w,right:w,bottom:w,left:w}:{top:w.top??0,right:w.right??0,bottom:w.bottom??0,left:w.left??0},r=Math.max(.05,Math.min(1,e.channelRatio??1)),s={x:a.left,y:a.top,width:Math.max(1,t-a.left-a.right),height:Math.max(1,i-a.top-a.bottom)},o="down"===n?s.height:s.width,l=o*Math.max(0,e.chargeExtent??.12),u=o*Math.max(0,e.projectionExtent??0),c=o*Math.max(0,e.destinationExtent??.55),d=Math.max(0,o-l-c-u),p=function(e){if("number"==typeof e){let t=Math.max(1,Math.round(e));return Array.from({length:t},(e,t)=>({id:`bin-${t}`,label:String(t)}))}return 0===e.length?[{id:"bin-0",label:"0"}]:e.map((e,t)=>({id:e.id,label:e.label??e.id??String(t)}))}(e.destinations),h=("down"===n?s.width:s.height)/p.length,m="down"===n?(e,t)=>({x:s.x,y:s.y+e,width:s.width,height:t}):(e,t)=>({x:s.x+e,y:s.y,width:t,height:s.height}),f=m(0,l),y=m(l,d),g=l+d,b=m(g,c),v=m(g+c,u),x=p.map((e,t)=>{let i=t*h,a=h*r,o=(h-a)/2;if("down"===n){let n=s.x+i+o;return{id:e.id,label:e.label,order:t,x:n,y:b.y,width:a,height:b.height,centerX:s.x+(t+.5)*h,centerY:b.y+b.height/2}}let l=s.y+i+o;return{id:e.id,label:e.label,order:t,x:b.x,y:l,width:b.width,height:a,centerX:b.x+b.width/2,centerY:s.y+(t+.5)*h}});var w;return{width:t,height:i,flow:n,charge:f,apparatus:y,destinations:x,projection:v}}function Re(e,t){return e.destinations.find(e=>e.id===t)}function Te(e,t,i){let{charge:n,flow:a}=e,r=Math.max(1,i),s=(t%r+.5)/r;return"down"===a?{x:n.x+n.width*s,y:n.y+n.height/2}:{x:n.x+n.width/2,y:n.y+n.height*s}}function je(e,t={}){let i=t.thickness??4,n=t.idPrefix??"stage",{destinations:a,flow:r,width:s,height:o}=e,l=[];if(a.length>0){let t=a[0];if("down"===r){let r=t.y+t.height;l.push({id:`${n}-floor`,shape:{type:"segment",x1:e.charge.x,y1:r,x2:e.charge.x+e.charge.width,y2:r,thickness:i}});for(let e=1;e<a.length;e+=1){let s=a[e].centerX-(a[e].centerX-a[e-1].centerX)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:s,y1:t.y,x2:s,y2:r,thickness:i}})}}else{let r=t.x+t.width;l.push({id:`${n}-floor`,shape:{type:"segment",x1:r,y1:e.charge.y,x2:r,y2:e.charge.y+e.charge.height,thickness:i}});for(let e=1;e<a.length;e+=1){let s=a[e].centerY-(a[e].centerY-a[e-1].centerY)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:s,x2:r,y2:s,thickness:i}})}}}return!1!==t.walls&&l.push({id:`${n}-wall-left`,shape:{type:"segment",x1:1,y1:0,x2:1,y2:o,thickness:i}},{id:`${n}-wall-right`,shape:{type:"segment",x1:s-1,y1:0,x2:s-1,y2:o,thickness:i}}),l}function Be(e,t={}){let i=t.charge??"bodies",n=t.apparatus??"the apparatus",a=t.destination??"destinations",r=e.destinations.length,s="down"===e.flow?"downward":"left to right";return`${i} enter at the ${"down"===e.flow?"top":"left"}, travel ${s} through ${n}, and come to rest in ${r} ${a}: ${e.destinations.map(e=>e.label).join(", ")}.`}function ke(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function Fe(e,t,i,n){let a="function"==typeof e?e(t,i):e;return Number.isFinite(a)?Number(a):n}function De(e,t,i){return ke(e[t])??i}function Le(e,t){return"number"==typeof e?e:e?.[t]??0}function $e(e){let{band:t,idPrefix:i,plot:n,projection:a}=e,{includeBoundaryWalls:r=!0,includeInteriorWalls:s=!0,wallThickness:o=4}=t,l=function(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,i=new Set;for(let n of e.values){let a=e.scale(n);Number.isFinite(a)&&(i.add(Number(a)),i.add(Number(a)+t))}return Array.from(i).sort((e,t)=>e-t)}(t);if(l.length<2)return[];let u=r?0:1,c=r?l.length-1:l.length-2,d=[];for(let e=u;e<=c;e+=1){if(!s&&e>0&&e<l.length-1)continue;let t=l[e];d.push({id:`${i}-wall-${e}`,shape:"x"===a?{type:"aabb",x:t,y:n.y+n.height/2,width:o,height:n.height}:{type:"aabb",x:n.x+n.width/2,y:t,width:n.width,height:o}})}return d}function Ne(e){let{plot:t,idPrefix:i="physics-scale",bounds:n={},xBins:a,xBands:r,yBands:s}=e,o=[];if(!1!==n&&o.push(...Ze(t,{idPrefix:i,...n})),a){let{idPrefix:e,yTop:n,yBottom:r,...s}=a;o.push(...et({...s,idPrefix:e??`${i}-xbin`,yTop:n??t.y,yBottom:r??t.y+t.height}))}return r&&o.push(...$e({band:r,idPrefix:r.idPrefix??`${i}-xband`,plot:t,projection:"x"})),s&&o.push(...$e({band:s,idPrefix:s.idPrefix??`${i}-yband`,plot:t,projection:"y"})),o}function Oe(e){let{plot:t,rows:i,columns:n=i+1,pegRadius:a=3,idPrefix:r="galton-peg",yStart:s=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(i)),p=Math.max(1,Math.floor(n));if(0===d)return[];let h=d<=1?0:(o-s)/(d-1),m=t.width/p,f=[];for(let e=0;e<d;e+=1){let i=l&&e%2==1?m/2:0;for(let n=0;n<p;n+=1){let o=t.x+m*(n+.5)+i;o<t.x+a||o>t.x+t.width-a||f.push({id:`${r}-${e}-${n}`,shape:{type:"aabb",x:o,y:s+e*h,width:2*a,height:2*a},restitution:u,friction:c})}}return f}function Ye(e,t={}){let{idPrefix:i="physics-token",radius:n=5,shape:a,mass:r,vx:s,vy:o,spawnAt:l,seed:u=1,jitter:c,datum:d}=t,p=nt(u),h=Le(c,"x"),m=Le(c,"y");return e.map((e,u)=>{let c=Fe(t.x,e,u,De(e,"x",0)),f=Fe(t.y,e,u,De(e,"y",0)),y=Fe(n,e,u,5),g="function"==typeof a?a(e,u):a??{type:"circle",radius:y};return{id:`${i}-${e.index??u}`,x:c+(p()-.5)*h,y:f+(p()-.5)*m,vx:Fe(s,e,u,0),vy:Fe(o,e,u,0),mass:Fe(r,e,u,1),spawnAt:Fe(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,...i}=e;return i})}function Ge(e,t={}){let{idPrefix:i="sediment",collider:n=!0,colliderThickness:a=1,restitution:r=.05,friction:s=.2,...o}=t,l=tt(e,o),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+a/2,width:e.width,height:a},restitution:r,friction:s})):[];return{columns:l,colliders:u}}function Ue(e,t={}){let{timeAccessor:i="arrivalTime",timeScale:n=1,startAt:a=0,rebase:r=!0,sort:s=!0}=t,o=e.map((e,t)=>({spawn:e,time:function(e,t,i){return ke("function"==typeof i?i(e,t):e[i]??e.datum?.[i])}(e,t,i)??e.spawnAt??t})),l=o.length?lt(o.map(e=>e.time)):0;return{initialSpawns:o.map(({spawn:e,time:t})=>({...e,spawnAt:a+(r?t-l:t)})).sort((e,t)=>s?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:a,timeAccessor:"spawnAt",timeScale:n}}}import{R as Ve,af as We,ag as He,ae as Xe,ab as ze,e as Ke,f as Qe,l as Ze,m as et,j as tt,s as it}from"./c-7S46KBYD.min.js";export{g as BuiltInPhysicsEngineAdapter,aU as ChainReactionChart,Y as CollisionSwarmChart,aO as CrucibleChart,av as DEFAULT_CRUCIBLE_HEIGHT,ax as DEFAULT_CRUCIBLE_OUTLETS,aw as DEFAULT_CRUCIBLE_SIZE,au as DEFAULT_CRUCIBLE_WIDTH,U as EventDropChart,P as GaltonBoardChart,ah as GauntletChart,ai as GuantletChart,aj as PacketFlowChart,ak as PhysicalFlowChart,X as PhysicsCustomChart,W as PhysicsPileChart,n as PhysicsPipelineStore,d as PhysicsSVGOverlay,i as PhysicsSedimentAccumulator,am as ProcessFlowChart,r as StreamPhysicsFrame,V as UnitPileChart,Q as WATERMARK_LONG_TAIL_JITTER,K as absorbRegion,z as aggregateRegionCounts,ap as applyCrucibleEvent,a as bodiesToAnnotationAnchors,M as bodyGroupSpec,x as buildCollisionSwarmPhysics,at as buildCrucibleEvidence,aF as buildCrucibleInitialSpawns,az as buildCrucibleLayout,aB as buildCruciblePhysicsConfig,aN as buildCrucibleProductEvents,aq as buildCrucibleProjection,aG as buildCrucibleStateSpawns,aH as buildCrucibleTerminalSpawns,u as buildEventDropPhysics,t as buildGaltonBoardPhysics,y as buildPhysicalFlowPhysics,b as buildPhysicsAnnotationContext,w as buildPhysicsPile,O as buildProcessFlowPhysics,aT as calculateBlockerAmplification,I as capacitatedRegion,F as chargeGateRegion,an as cloneCrucibleState,aM as compileCruciblePlan,aP as compileDependencyMachine,p as composePhysicsControllers,o as createCapacityQueueController,h as createDefaultPhysicsEngineAdapter,ay as createInitialCrucibleState,aR as createLogicalJoin,q as createPortalController,R as createSyntheticEmitter,aE as crucibleBondId,aA as crucibleBoundaryColliders,aC as crucibleComponentBodyId,aD as crucibleProductBodyId,ar as crucibleProjectionRows,aI as crucibleSemanticKey,as as evaluateCrucibleConservation,k as evaluatePhysicsBodyBudget,L as forceFieldRegion,B as groupCompletionRows,E as membraneRegion,c as normalizePhysicsAnnotations,Z as physicsProcessBoundaryColliders,aa as physicsProcessGroupSemanticItems,$ as physicsProcessRegionSemanticItem,_ as physicsProcessStageSemanticItems,ac as planGauntletPropertyWork,J as portalRegion,H as pressureFieldRegion,al as processChrome,N as processLaneWalls,C as processStageLayout,D as processStageRegions,v as readEventDropOccupancy,A as regionCountsToProjectionRows,T as registerPhysicsLivePrograms,ad as replaceGauntletNegative,aL as replayCruciblePlan,aS as replayStateTransitions,ao as resolveCrucibleSelector,aK as resolveCrucibleSnapshotAt,aJ as resolveCrucibleTime,aQ as routeDependencyTracks,G as routeSurfaceRegion,j as sedimentHeightfield,S as syntheticArrivals}from"./c-7S46KBYD.min.js";export{p as EventDropLedger}from"./c-KJGJEOSV.min.js";import{a as nt}from"./c-RI7UJTEY.min.js";import{f as rt,e as st,O as ot}from"./c-62UTMRQE.min.js";export{aM as MultiLineTooltip,aL as Tooltip,f as compileMotionEncoding,bR as composeStyleRules,j as deriveMotionVector,bL as makeRuleValueResolver,bO as matchesThreshold,h as opacityFromAge,e as resolveMotionAccessor,g as resolveMotionAge,i as resolveMotionVector,bQ as resolveStyleRules,bP as ruleMatches}from"./c-62UTMRQE.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-JDI7HKEM.min.js";export{B as TooltipRoot,E as hasOwnTooltipChrome,x as hasTooltipContent,D as markTooltipChrome}from"./c-B3X2IJRQ.min.js";import{b as lt}from"./c-GRTKU3C7.min.js";import{useState as ut,useRef as ct,useCallback as dt}from"react";var Je=[.1,.5,.9],qe=1e6,_e=it;export{Ue as arrivalReplay,Ne as collidersFromScales,xe as comparePhysicsTrace,m as compilePhysicsEncoding,se as createDependencyGateController,ee as createPhysicsEncodingLayout,Pe as createProcessJourneyLedger,re as createServiceLevelController,ne as createServiceResourcePoolController,_e as default,Be as describePhysicsStageGeography,Oe as galtonPegs,Te as physicsChargePoint,Re as physicsDestination,fe as physicsReferenceEnvelope,je as physicsStageColliders,Me as physicsStageGeography,Ee as processJourneyRows,le as processVolumePolygons,te as resolveGauntletTerminalState,ie as resolveGauntletTerminalStates,Ge as sedimentBake,Ye as spawnFromTokens,oe as stageTargetInVolume,Ce as updateProcessJourney,s as useEmitters};
|