semiotic 3.9.2 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. package/README.md +99 -74
  2. package/agent-skill/semiotic-charts/SKILL.md +13 -7
  3. package/ai/artifact-contract-reference.md +408 -0
  4. package/ai/artifact-surface-inventory.json +5586 -0
  5. package/ai/behaviorContracts.cjs +24 -2
  6. package/ai/cli.js +480 -56
  7. package/ai/dist/mcp-server.js +68 -68
  8. package/ai/examples.md +1 -1
  9. package/ai/reference.md +31 -14
  10. package/ai/schema.json +1868 -438
  11. package/ai/surface-manifest.json +11 -4
  12. package/ai/system-prompt.md +2 -0
  13. package/ai/task-packets/compare-category-totals.json +301 -0
  14. package/ai/task-packets/compare-category-totals.md +188 -0
  15. package/ai/task-packets/correct-published-chart.json +271 -0
  16. package/ai/task-packets/correct-published-chart.md +597 -0
  17. package/ai/task-packets/index.json +40 -0
  18. package/ai/task-packets/update-live-chart.json +289 -0
  19. package/ai/task-packets/update-live-chart.md +424 -0
  20. package/dist/c-2N7IU2NY.min.js +1 -0
  21. package/dist/c-2WK7YJLL.min.js +1 -0
  22. package/dist/c-33QOXEUG.min.js +1 -0
  23. package/dist/c-42PLDTX7.min.js +1 -0
  24. package/dist/c-447VIMRO.min.js +1 -0
  25. package/dist/c-4FN7Q6VQ.min.js +1 -0
  26. package/dist/c-553QUDKA.min.js +1 -0
  27. package/dist/c-55BAJ333.min.js +1 -0
  28. package/dist/c-7242NXSG.min.js +1 -0
  29. package/dist/c-7EGHJU2F.min.js +1 -0
  30. package/dist/c-7HP7MB2I.min.js +1 -0
  31. package/dist/c-7NBU5ZKS.min.js +1 -0
  32. package/dist/c-AFBSWT77.min.js +1 -0
  33. package/dist/c-AJ7EC32V.min.js +1 -0
  34. package/dist/c-AQADQNY7.min.js +1 -0
  35. package/dist/c-ATM475SA.min.js +1 -0
  36. package/dist/c-AVO3Q7T7.min.js +1 -0
  37. package/dist/c-AZKPVBOC.min.js +1 -0
  38. package/dist/c-BNFJMDHN.min.js +1 -0
  39. package/dist/c-BNG5ECK5.min.js +1 -0
  40. package/dist/c-BOHCQILI.min.js +1 -0
  41. package/dist/c-CCTGN5CK.min.js +1 -0
  42. package/dist/c-CPSPZH6A.min.js +1 -0
  43. package/dist/c-CPV4N35K.min.js +1 -0
  44. package/dist/c-D6HAAPTX.min.js +1 -0
  45. package/dist/c-DE5Q3U2X.min.js +1 -0
  46. package/dist/c-DK662R77.min.js +1 -0
  47. package/dist/c-DY2676CR.min.js +1 -0
  48. package/dist/c-E32M6XW5.min.js +1 -0
  49. package/dist/c-E4JDJH4I.min.js +1 -0
  50. package/dist/c-E7I2L7CU.min.js +1 -0
  51. package/dist/c-EBOQ7ER7.min.js +1 -0
  52. package/dist/c-ELDWAO2V.min.js +1 -0
  53. package/dist/c-EUBTECGM.min.js +1 -0
  54. package/dist/c-GNTXRXRN.min.js +1 -0
  55. package/dist/c-GSZRZRD6.min.js +1 -0
  56. package/dist/c-GWX7JGMF.min.js +1 -0
  57. package/dist/c-GXV3C3MO.min.js +1 -0
  58. package/dist/c-HHTK2R75.min.js +1 -0
  59. package/dist/c-HLLFJYTY.min.js +1 -0
  60. package/dist/c-HPOYKCCG.min.js +1 -0
  61. package/dist/c-HXDKPIKR.min.js +1 -0
  62. package/dist/c-I4QJ6YLM.min.js +1 -0
  63. package/dist/c-IDJV3CZK.min.js +1 -0
  64. package/dist/c-ITKX3RC5.min.js +1 -0
  65. package/dist/c-JG2JCQLP.min.js +1 -0
  66. package/dist/c-JLGRHXGZ.min.js +1 -0
  67. package/dist/c-JO2UGTCP.min.js +1 -0
  68. package/dist/c-JUKIWTBJ.min.js +1 -0
  69. package/dist/c-KCRJGUHP.min.js +1 -0
  70. package/dist/c-LMGSSD2E.min.js +1 -0
  71. package/dist/c-LYQMZMZQ.min.js +1 -0
  72. package/dist/c-LYVKDBQJ.min.js +1 -0
  73. package/dist/c-MVR3RWF3.min.js +1 -0
  74. package/dist/c-MXCP7GNZ.min.js +1 -0
  75. package/dist/c-NG7BLZTR.min.js +1 -0
  76. package/dist/c-NYZ2QNAM.min.js +1 -0
  77. package/dist/c-OO5QLMJC.min.js +1 -0
  78. package/dist/c-OOVX2JPQ.min.js +1 -0
  79. package/dist/c-ORLEBW72.min.js +1 -0
  80. package/dist/c-P65V6HLO.min.js +1 -0
  81. package/dist/c-PP6VY3QU.min.js +1 -0
  82. package/dist/c-PRIKOLTE.min.js +1 -0
  83. package/dist/c-PSNI6KAZ.min.js +1 -0
  84. package/dist/c-PYNW54D2.min.js +1 -0
  85. package/dist/c-QA3HMQJP.min.js +1 -0
  86. package/dist/c-ROEHCIGV.min.js +1 -0
  87. package/dist/c-S3AZX5PP.min.js +1 -0
  88. package/dist/c-T2V7O2LO.min.js +1 -0
  89. package/dist/c-TIXX5CAU.min.js +1 -0
  90. package/dist/c-TKG2NP7G.min.js +1 -0
  91. package/dist/c-VJTDST2R.min.js +1 -0
  92. package/dist/c-VXLOLYTO.min.js +1 -0
  93. package/dist/c-W4ZUKSEQ.min.js +1 -0
  94. package/dist/c-WH2O53VI.min.js +1 -0
  95. package/dist/c-WNGH47HF.min.js +1 -0
  96. package/dist/c-WUWXGQYA.min.js +1 -0
  97. package/dist/c-XDQKXPX4.min.js +1 -0
  98. package/dist/{c-CKLIFCGN.min.js → c-XSB27XPS.min.js} +1 -1
  99. package/dist/c-YDECTEUW.min.js +1 -0
  100. package/dist/c-YF3YKVQI.min.js +1 -0
  101. package/dist/c-YLZIV3VS.min.js +1 -0
  102. package/dist/c-ZYPXQF7B.min.js +1 -0
  103. package/dist/components/Annotation.d.ts +2 -1
  104. package/dist/components/ai/chartRecipeRegistry.d.ts +6 -1
  105. package/dist/components/ai/chartRecipes.d.ts +4 -0
  106. package/dist/components/ai/describePhysicsProjection.d.ts +18 -0
  107. package/dist/components/ai/describePhysicsSource.d.ts +13 -0
  108. package/dist/components/artifact/ArtifactInspector.d.ts +26 -0
  109. package/dist/components/artifact/ArtifactInspectorContextSections.d.ts +18 -0
  110. package/dist/components/artifact/artifactContractDiff.d.ts +8 -0
  111. package/dist/components/artifact/artifactInspectorSummary.d.ts +53 -0
  112. package/dist/components/artifact/artifactRevision.d.ts +54 -0
  113. package/dist/components/artifact/artifactTestFixtures.d.ts +17 -0
  114. package/dist/components/artifact/attachmentAudit.d.ts +13 -0
  115. package/dist/components/artifact/claimCorrections.d.ts +3 -0
  116. package/dist/components/artifact/claimGraph.d.ts +5 -0
  117. package/dist/components/artifact/claimLifecycle.d.ts +32 -0
  118. package/dist/components/artifact/claims.d.ts +24 -0
  119. package/dist/components/artifact/collection.d.ts +10 -0
  120. package/dist/components/artifact/collectionCorrectionScope.d.ts +4 -0
  121. package/dist/components/artifact/collectionImpact.d.ts +11 -0
  122. package/dist/components/artifact/collectionLineage.d.ts +3 -0
  123. package/dist/components/artifact/collectionOperations.d.ts +8 -0
  124. package/dist/components/artifact/collectionPolicy.d.ts +22 -0
  125. package/dist/components/artifact/collectionTypes.d.ts +117 -0
  126. package/dist/components/artifact/configurationRepair.d.ts +8 -0
  127. package/dist/components/artifact/contract.d.ts +30 -0
  128. package/dist/components/artifact/evaluateArtifact.d.ts +12 -0
  129. package/dist/components/artifact/evaluateArtifactTypes.d.ts +78 -0
  130. package/dist/components/artifact/evaluationPresentation.d.ts +9 -0
  131. package/dist/components/artifact/evidenceSample.d.ts +8 -0
  132. package/dist/components/artifact/exportPaths.d.ts +8 -0
  133. package/dist/components/artifact/fieldPolicies.d.ts +12 -0
  134. package/dist/components/artifact/fingerprint.d.ts +36 -0
  135. package/dist/components/artifact/grounding.d.ts +51 -0
  136. package/dist/components/artifact/groundingBudget.d.ts +38 -0
  137. package/dist/components/artifact/hostTransfer.d.ts +13 -0
  138. package/dist/components/artifact/identity.d.ts +19 -0
  139. package/dist/components/artifact/inheritance.d.ts +48 -0
  140. package/dist/components/artifact/inheritanceIntegrity.d.ts +3 -0
  141. package/dist/components/artifact/jsonCompatibility.d.ts +2 -0
  142. package/dist/components/artifact/obligations.d.ts +3 -0
  143. package/dist/components/artifact/policies.d.ts +45 -0
  144. package/dist/components/artifact/policyRelations.d.ts +3 -0
  145. package/dist/components/artifact/recordProjection.d.ts +7 -0
  146. package/dist/components/artifact/representation.d.ts +50 -0
  147. package/dist/components/artifact/serialization.d.ts +40 -0
  148. package/dist/components/artifact/temporal.d.ts +32 -0
  149. package/dist/components/artifact/temporalAdapters.d.ts +75 -0
  150. package/dist/components/artifact/temporalAuditHelpers.d.ts +12 -0
  151. package/dist/components/artifact/temporalPresentation.d.ts +8 -0
  152. package/dist/components/artifact/types.d.ts +341 -0
  153. package/dist/components/artifact/validation.d.ts +13 -0
  154. package/dist/components/artifact/validationFieldStatus.d.ts +7 -0
  155. package/dist/components/artifact/validationPrimitives.d.ts +24 -0
  156. package/dist/components/artifact/validationSurfaces.d.ts +7 -0
  157. package/dist/components/artifact/validationTemporal.d.ts +3 -0
  158. package/dist/components/charts/geo/FlowMap.d.ts +7 -0
  159. package/dist/components/charts/geo/flowMapLineStyle.d.ts +18 -0
  160. package/dist/components/charts/ordinal/DonutChart.d.ts +2 -0
  161. package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
  162. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -0
  163. package/dist/components/charts/ordinal/PieChart.d.ts +2 -0
  164. package/dist/components/charts/ordinal/RadarChart.d.ts +2 -0
  165. package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -0
  166. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
  167. package/dist/components/charts/physics/EventDropChart.d.ts +3 -1
  168. package/dist/components/charts/physics/GaltonBoardChart.d.ts +4 -2
  169. package/dist/components/charts/physics/ProcessFlowChart.d.ts +6 -0
  170. package/dist/components/charts/physics/UnitPileChart.d.ts +2 -1
  171. package/dist/components/charts/physics/collisionSwarmPacking.d.ts +14 -0
  172. package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +1 -0
  173. package/dist/components/charts/physics/eventDropAdmission.d.ts +32 -0
  174. package/dist/components/charts/physics/eventDropPhysics.d.ts +22 -1
  175. package/dist/components/charts/physics/galtonBoardPhysics.d.ts +2 -9
  176. package/dist/components/charts/physics/physicsChartReconcile.d.ts +4 -0
  177. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  178. package/dist/components/charts/physics/physicsGaltonData.d.ts +10 -0
  179. package/dist/components/charts/physics/physicsHocHandle.d.ts +2 -0
  180. package/dist/components/charts/physics/physicsPileData.d.ts +11 -0
  181. package/dist/components/charts/physics/physicsPilePhysics.d.ts +5 -12
  182. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +1 -1
  183. package/dist/components/charts/physics/physicsSourceRows.d.ts +8 -0
  184. package/dist/components/charts/physics/usePhysicsChartData.d.ts +19 -0
  185. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +4 -0
  186. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +14 -6
  187. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +4 -0
  188. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +4 -0
  189. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +4 -0
  190. package/dist/components/charts/realtime/realtimeAccessors.d.ts +4 -0
  191. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +8 -7
  192. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +7 -0
  193. package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +17 -11
  194. package/dist/components/charts/shared/GaugeReadout.d.ts +9 -0
  195. package/dist/components/charts/shared/ThresholdAnnotation.d.ts +18 -0
  196. package/dist/components/charts/shared/ThresholdEndCap.d.ts +7 -0
  197. package/dist/components/charts/shared/auditAccessibilityText.d.ts +4 -2
  198. package/dist/components/charts/shared/numericTickFormatter.d.ts +2 -0
  199. package/dist/components/charts/shared/radialCenterContent.d.ts +10 -0
  200. package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
  201. package/dist/components/charts/shared/useChartLegend.d.ts +4 -0
  202. package/dist/components/charts/shared/useXYPointStyle.d.ts +2 -0
  203. package/dist/components/charts/xy/BubbleChart.d.ts +7 -0
  204. package/dist/components/charts/xy/CandlestickChart.d.ts +7 -0
  205. package/dist/components/charts/xy/DifferenceChart.d.ts +7 -0
  206. package/dist/components/charts/xy/MinimapChart.d.ts +7 -0
  207. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +7 -0
  208. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +6 -0
  209. package/dist/components/charts/xy/WaterfallChart.d.ts +8 -0
  210. package/dist/components/charts/xy/differenceMarkStyle.d.ts +28 -0
  211. package/dist/components/charts/xy/multiAxisFields.d.ts +23 -0
  212. package/dist/components/charts/xy/scatterplotMatrixCells.d.ts +50 -0
  213. package/dist/components/evidence/chartEvidenceEnvelope.d.ts +16 -8
  214. package/dist/components/evidence/evidenceEnvelopeInput.d.ts +8 -0
  215. package/dist/components/evidence/evidenceEnvelopeValidation.d.ts +11 -0
  216. package/dist/components/evidence/evidenceGate.d.ts +3 -1
  217. package/dist/components/evidence/renderedSceneHash.d.ts +23 -0
  218. package/dist/components/evidence/stableJsonHash.d.ts +4 -0
  219. package/dist/components/export/chartConfig.d.ts +40 -5
  220. package/dist/components/export/chartConfigArtifact.d.ts +6 -0
  221. package/dist/components/legendLayout.d.ts +18 -0
  222. package/dist/components/legendStyles.d.ts +4 -0
  223. package/dist/components/recipes/firstAvailableTrack.d.ts +17 -0
  224. package/dist/components/recipes/intervals.d.ts +1 -1
  225. package/dist/components/semiotic-ai-core.d.ts +33 -22
  226. package/dist/components/semiotic-ai.d.ts +15 -3
  227. package/dist/components/semiotic-artifact-react.d.ts +10 -0
  228. package/dist/components/semiotic-artifact.d.ts +23 -0
  229. package/dist/components/semiotic-experimental.d.ts +1 -1
  230. package/dist/components/semiotic-physics.d.ts +4 -4
  231. package/dist/components/semiotic-text.d.ts +2 -0
  232. package/dist/components/semiotic-utils-core.d.ts +18 -18
  233. package/dist/components/semiotic.d.ts +3 -3
  234. package/dist/components/server/renderEvidence.d.ts +12 -0
  235. package/dist/components/server/renderToStaticSVG.d.ts +3 -0
  236. package/dist/components/server/staticSVGChrome.d.ts +1 -4
  237. package/dist/components/server/staticXYAxisTicks.d.ts +2 -38
  238. package/dist/components/server/staticXYGrid.d.ts +1 -1
  239. package/dist/components/server/svgSizing.d.ts +6 -0
  240. package/dist/components/shared/svgRoot.d.ts +17 -0
  241. package/dist/components/store/selectionProvenance.d.ts +6 -0
  242. package/dist/components/stream/GeoSVGOverlay.d.ts +4 -0
  243. package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -0
  244. package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -0
  245. package/dist/components/stream/SVGOverlay.d.ts +4 -0
  246. package/dist/components/stream/SceneToSVG.d.ts +4 -19
  247. package/dist/components/stream/SceneToSVGXY.d.ts +13 -0
  248. package/dist/components/stream/StreamGeoFrame.d.ts +1 -2
  249. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -2
  250. package/dist/components/stream/XYGrid.d.ts +11 -0
  251. package/dist/components/stream/axisTickUtils.d.ts +0 -1
  252. package/dist/components/stream/hitTestUtils.d.ts +2 -0
  253. package/dist/components/stream/overlayAccessibleText.d.ts +18 -0
  254. package/dist/components/stream/physics/PhysicsControllers.d.ts +1 -1
  255. package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
  256. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +5 -4
  257. package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +9 -0
  258. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +3 -0
  259. package/dist/components/stream/physics/physicsCanvasCoordinates.d.ts +5 -0
  260. package/dist/components/stream/physics/physicsFixedPosition.d.ts +16 -0
  261. package/dist/components/stream/physics/physicsKernelCloning.d.ts +6 -0
  262. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +2 -0
  263. package/dist/components/stream/physics/physicsPipelineSettle.d.ts +15 -9
  264. package/dist/components/stream/physics/physicsRegionRuntime.d.ts +8 -17
  265. package/dist/components/stream/physics/physicsSemanticUI.d.ts +9 -0
  266. package/dist/components/stream/pipelineConfig.d.ts +4 -0
  267. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +1 -1
  268. package/dist/components/stream/resolveXYAxes.d.ts +13 -0
  269. package/dist/components/stream/sceneToSVGShared.d.ts +2 -1
  270. package/dist/components/stream/seriesGeometry.d.ts +13 -0
  271. package/dist/components/stream/streamEncodingTypes.d.ts +53 -0
  272. package/dist/components/stream/types.d.ts +4 -53
  273. package/dist/components/stream/useGeoFrameHandle.d.ts +16 -0
  274. package/dist/components/stream/useOrdinalFrameHandle.d.ts +15 -0
  275. package/dist/components/stream/useXYFrameHandle.d.ts +15 -0
  276. package/dist/components/stream/xyAxisTicks.d.ts +25 -0
  277. package/dist/components/stream/xyDateTicks.d.ts +3 -2
  278. package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
  279. package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +1 -1
  280. package/dist/components/stream/xySceneBuilders/types.d.ts +1 -0
  281. package/dist/components/text/annotationTextLayout.d.ts +28 -0
  282. package/dist/components/text/pretextAnnotationLayout.d.ts +29 -0
  283. package/dist/components/text/usePretextAnnotations.d.ts +12 -0
  284. package/dist/controls.module.min.js +1 -1
  285. package/dist/geo.min.js +1 -1
  286. package/dist/geo.module.min.js +1 -1
  287. package/dist/network.module.min.js +1 -1
  288. package/dist/ordinal.module.min.js +1 -1
  289. package/dist/physics-matter.min.js +1 -1
  290. package/dist/physics-matter.module.min.js +1 -1
  291. package/dist/physics-rapier.min.js +1 -1
  292. package/dist/physics-rapier.module.min.js +1 -1
  293. package/dist/physics.module.min.js +1 -1
  294. package/dist/physicsWorker.js +1 -1
  295. package/dist/processSankeyLayoutWorker.js +1 -1
  296. package/dist/rough.min.js +1 -1
  297. package/dist/rough.module.min.js +1 -1
  298. package/dist/semiotic-access.module.min.js +1 -1
  299. package/dist/semiotic-ai-artifact-policy-constants.module.min.js +2 -0
  300. package/dist/semiotic-ai-core.d.ts +33 -22
  301. package/dist/semiotic-ai-core.min.js +1 -1
  302. package/dist/semiotic-ai-core.module.min.js +1 -1
  303. package/dist/semiotic-ai-hash-primitives.module.min.js +2 -0
  304. package/dist/semiotic-ai.d.ts +15 -3
  305. package/dist/semiotic-ai.module.min.js +1 -1
  306. package/dist/semiotic-artifact-react.d.ts +10 -0
  307. package/dist/semiotic-artifact-react.min.js +2 -0
  308. package/dist/semiotic-artifact-react.module.min.js +2 -0
  309. package/dist/semiotic-artifact.d.ts +23 -0
  310. package/dist/semiotic-artifact.min.js +1 -0
  311. package/dist/semiotic-artifact.module.min.js +1 -0
  312. package/dist/semiotic-client-cjs-shared.min.js +1 -1
  313. package/dist/semiotic-client-glyph.module.min.js +1 -1
  314. package/dist/semiotic-client-responsive.module.min.js +1 -1
  315. package/dist/semiotic-client-shared.module.min.js +1 -1
  316. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +1 -1
  317. package/dist/semiotic-data.min.js +1 -1
  318. package/dist/semiotic-data.module.min.js +1 -1
  319. package/dist/semiotic-evidence.min.js +1 -1
  320. package/dist/semiotic-evidence.module.min.js +1 -1
  321. package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
  322. package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
  323. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  324. package/dist/semiotic-experimental-vacp.min.js +1 -1
  325. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  326. package/dist/semiotic-experimental.d.ts +1 -1
  327. package/dist/semiotic-line.module.min.js +1 -1
  328. package/dist/semiotic-physics.d.ts +4 -4
  329. package/dist/semiotic-realtime-core.module.min.js +1 -1
  330. package/dist/semiotic-realtime-react.module.min.js +1 -1
  331. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  332. package/dist/semiotic-recipes-core.module.min.js +1 -1
  333. package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
  334. package/dist/semiotic-recipes-react.min.js +1 -1
  335. package/dist/semiotic-server-edge-node.module.min.js +1 -1
  336. package/dist/semiotic-server-edge.min.js +1 -1
  337. package/dist/semiotic-server-edge.module.min.js +1 -1
  338. package/dist/semiotic-server-node.min.js +1 -1
  339. package/dist/semiotic-server-node.module.min.js +1 -1
  340. package/dist/semiotic-text.d.ts +2 -0
  341. package/dist/semiotic-text.min.js +2 -0
  342. package/dist/semiotic-text.module.min.js +2 -0
  343. package/dist/semiotic-themes-core.min.js +1 -1
  344. package/dist/semiotic-themes-core.module.min.js +1 -1
  345. package/dist/semiotic-themes.min.js +1 -1
  346. package/dist/semiotic-themes.module.min.js +1 -1
  347. package/dist/semiotic-utils-core.d.ts +18 -18
  348. package/dist/semiotic-utils-core.min.js +1 -1
  349. package/dist/semiotic-utils-core.module.min.js +1 -1
  350. package/dist/semiotic-value.module.min.js +1 -1
  351. package/dist/semiotic.d.ts +3 -3
  352. package/dist/semiotic.module.min.js +1 -1
  353. package/dist/server.min.js +1 -1
  354. package/dist/server.module.min.js +1 -1
  355. package/dist/xy.module.min.js +1 -1
  356. package/package.json +55 -14
  357. package/spec/README.md +8 -3
  358. package/spec/v0.1/artifact-contract.schema.json +2299 -0
  359. package/spec/v0.1/examples/artifact-contract-full.json +369 -0
  360. package/spec/v0.1/examples/artifact-contract-unknown-state.json +46 -0
  361. package/dist/c-3BLJEQNG.min.js +0 -1
  362. package/dist/c-3SCUN5HI.min.js +0 -1
  363. package/dist/c-3VVKFA4M.min.js +0 -1
  364. package/dist/c-43TJZS3F.min.js +0 -1
  365. package/dist/c-4DTZPSUD.min.js +0 -1
  366. package/dist/c-4ES5367Y.min.js +0 -1
  367. package/dist/c-52TEGIUJ.min.js +0 -1
  368. package/dist/c-54IRWOGM.min.js +0 -1
  369. package/dist/c-5D2S4RMI.min.js +0 -1
  370. package/dist/c-5JWCTX3G.min.js +0 -1
  371. package/dist/c-6CMMSN6N.min.js +0 -1
  372. package/dist/c-6HRB2L7H.min.js +0 -1
  373. package/dist/c-6O5EVOPH.min.js +0 -1
  374. package/dist/c-7W4SV36A.min.js +0 -1
  375. package/dist/c-A4WRGZFX.min.js +0 -1
  376. package/dist/c-AG7WWVIH.min.js +0 -1
  377. package/dist/c-AH6J4MTN.min.js +0 -1
  378. package/dist/c-AKAF6JAD.min.js +0 -1
  379. package/dist/c-ALYR5LKK.min.js +0 -1
  380. package/dist/c-BBKITSXB.min.js +0 -1
  381. package/dist/c-BYDPC44I.min.js +0 -1
  382. package/dist/c-CFFIU2MW.min.js +0 -1
  383. package/dist/c-CGNHBHCE.min.js +0 -1
  384. package/dist/c-CJYSXIFV.min.js +0 -1
  385. package/dist/c-CZF7MV67.min.js +0 -1
  386. package/dist/c-D53OKBSY.min.js +0 -1
  387. package/dist/c-DADXPJXV.min.js +0 -1
  388. package/dist/c-DBQ2V7CH.min.js +0 -1
  389. package/dist/c-DPMVAUAW.min.js +0 -1
  390. package/dist/c-ECJCKLYY.min.js +0 -1
  391. package/dist/c-EGATGOWJ.min.js +0 -1
  392. package/dist/c-EGR6VYBW.min.js +0 -1
  393. package/dist/c-ESNR43AN.min.js +0 -1
  394. package/dist/c-F3LIKINL.min.js +0 -1
  395. package/dist/c-F5ZB5GJ6.min.js +0 -1
  396. package/dist/c-G36WS6LN.min.js +0 -1
  397. package/dist/c-G3VYMHKE.min.js +0 -1
  398. package/dist/c-GGISSW5E.min.js +0 -1
  399. package/dist/c-GR6MOEQC.min.js +0 -1
  400. package/dist/c-GSVCN34B.min.js +0 -1
  401. package/dist/c-GYOQCEFP.min.js +0 -1
  402. package/dist/c-H3DNMTCC.min.js +0 -1
  403. package/dist/c-I6J3FEZE.min.js +0 -1
  404. package/dist/c-IGH6MGJ5.min.js +0 -1
  405. package/dist/c-II2EEAJN.min.js +0 -1
  406. package/dist/c-IUHFPMHD.min.js +0 -1
  407. package/dist/c-J6M4JHRS.min.js +0 -1
  408. package/dist/c-JM3MGLQV.min.js +0 -1
  409. package/dist/c-KM3N7F7R.min.js +0 -1
  410. package/dist/c-LF5BZFNC.min.js +0 -1
  411. package/dist/c-LKBSGFQC.min.js +0 -1
  412. package/dist/c-MNF2S4AA.min.js +0 -1
  413. package/dist/c-MT3WBK7M.min.js +0 -1
  414. package/dist/c-NDJADPIF.min.js +0 -1
  415. package/dist/c-NVPQCIL5.min.js +0 -1
  416. package/dist/c-NY3JWV2K.min.js +0 -1
  417. package/dist/c-OFWJBEE5.min.js +0 -1
  418. package/dist/c-OYFHP5F5.min.js +0 -1
  419. package/dist/c-PGKQGGQ2.min.js +0 -1
  420. package/dist/c-PPWDL5ZI.min.js +0 -1
  421. package/dist/c-Q2IPZ3MU.min.js +0 -1
  422. package/dist/c-QKHMBE2E.min.js +0 -1
  423. package/dist/c-QMVM3AY6.min.js +0 -1
  424. package/dist/c-QSGWX53A.min.js +0 -1
  425. package/dist/c-RJKEKZOO.min.js +0 -1
  426. package/dist/c-RSVIHIQ4.min.js +0 -1
  427. package/dist/c-S6U5CGT5.min.js +0 -1
  428. package/dist/c-SFDIIU5G.min.js +0 -1
  429. package/dist/c-SLGMUBUL.min.js +0 -1
  430. package/dist/c-SRTBCRVE.min.js +0 -1
  431. package/dist/c-T6UAIKBH.min.js +0 -1
  432. package/dist/c-TMCTEVVW.min.js +0 -1
  433. package/dist/c-TMOSJLT3.min.js +0 -1
  434. package/dist/c-TZW3JGJ5.min.js +0 -1
  435. package/dist/c-U6ESPM7V.min.js +0 -1
  436. package/dist/c-UC5PTTFI.min.js +0 -1
  437. package/dist/c-USFMFKIH.min.js +0 -1
  438. package/dist/c-VGKUEZBC.min.js +0 -1
  439. package/dist/c-VGW3VG3I.min.js +0 -1
  440. package/dist/c-VN2HG5BS.min.js +0 -1
  441. package/dist/c-VPZDY5Q4.min.js +0 -1
  442. package/dist/c-VRXUB2F2.min.js +0 -1
  443. package/dist/c-VUBQNQJH.min.js +0 -1
  444. package/dist/c-VUH4PGZY.min.js +0 -1
  445. package/dist/c-W3CE4A4S.min.js +0 -1
  446. package/dist/c-X5UBGU2V.min.js +0 -1
  447. package/dist/c-XDRV7RKW.min.js +0 -1
  448. package/dist/c-YGZHURXZ.min.js +0 -1
  449. package/dist/c-YZVRZGX2.min.js +0 -1
  450. /package/dist/{c-N4G2L7ID.min.js → c-HYW2XA4Q.min.js} +0 -0
  451. /package/dist/{c-ENF72HU5.min.js → c-QAVFOEUY.min.js} +0 -0
  452. /package/dist/{c-OCI56QF2.min.js → c-V4XMSLC3.min.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{DEFAULT_HIT_RADIUS as e,geoAreaHitTarget as t,geoHitTarget as o,hitTargetPoint as i}from"./c-3BLJEQNG.min.js";import{GeoCustomChart as n,StreamGeoFrame_default as r}from"./c-SFDIIU5G.min.js";import"./c-U6ESPM7V.min.js";import{useChartSetup as a,useFrameImperativeHandle as l,useResolvedSelection as s}from"./c-F5ZB5GJ6.min.js";import"./c-5D2S4RMI.min.js";import"./c-CZF7MV67.min.js";import"./c-RJKEKZOO.min.js";import"./c-VGKUEZBC.min.js";import"./c-T6UAIKBH.min.js";import"./c-OCI56QF2.min.js";import"./c-54IRWOGM.min.js";import{buildCustomBehaviorProps as c,mergeShapeStyle as u}from"./c-AG7WWVIH.min.js";import{useCustomLayoutSelection as d}from"./c-G36WS6LN.min.js";import"./c-UC5PTTFI.min.js";import"./c-DBQ2V7CH.min.js";import"./c-QSGWX53A.min.js";import"./c-VPZDY5Q4.min.js";import{ChartError as m,EMPTY_ARRAY as h,MultiLineTooltip as p,SafeRender as f,Tooltip as g,TooltipRoot as y,composeStyleRules as b,filterSparseArray as v,makeNodeRuleContext as x,makeRuleValueResolver as k,markTooltipChrome as w,matchesThreshold as S,normalizeLinkedHover as M,normalizeTooltip as A,renderEmptyState as C,renderLoadingState as R,resolveAxisFreeMarginDefaults as N,resolveResponsiveRules as j,resolveStyleRules as F,responsiveRuleMatches as P,ruleMatches as H,useChartLegendAndMargin as I,useChartMode as L,useChartSelection as z,useGradientLegendInteraction as W,useLinkedHover as O,useThemeSequential as B,warnMissingField as D,wrapStyleWithSelection as E}from"./c-VN2HG5BS.min.js";import"./c-GR6MOEQC.min.js";import{useObservationSelector as T}from"./c-VRXUB2F2.min.js";import{getMinMax as G}from"./c-GGISSW5E.min.js";import{DEFAULT_COLOR as U,getColor as Z,getSequentialInterpolator as $,getSize as V}from"./c-EGR6VYBW.min.js";import"./c-PGKQGGQ2.min.js";import{glyphExtent as _,glyphPlacement as K,hatchFillId as q,hatchPatternDef as Q,isHatchFill as J,resolveSvgFill as X}from"./c-QKHMBE2E.min.js";import{useMemo as Y}from"react";import{scaleSequential as ee}from"d3-scale";import{useState as te,useEffect as oe,useMemo as ie}from"react";import{feature as ne}from"topojson-client";var re=new Map;function ae(e){return"default"in e?e.default:e}async function le(e){const t=re.get(e);if(t)return t;const{topology:o,objectName:i}=await async function(e){try{switch(e){case"world-110m":return{topology:ae(await import("world-atlas/countries-110m.json")),objectName:"countries"};case"world-50m":return{topology:ae(await import("world-atlas/countries-50m.json")),objectName:"countries"};case"land-110m":return{topology:ae(await import("world-atlas/land-110m.json")),objectName:"land"};case"land-50m":return{topology:ae(await import("world-atlas/land-50m.json")),objectName:"land"};default:throw Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){if(/Cannot find module|Failed to resolve|world-atlas/i.test(t instanceof Error?t.message:t+""))throw 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});throw t}}(e);if(!o||!o.objects)throw Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof o} with keys: ${o?Object.keys(o).join(", "):"none"}`);const n=ne(o,o.objects[i]),r="features"in n?n.features:[n];return re.set(e,r),r}function se(e){const t=ie(()=>Array.isArray(e)?e:void 0,[e]),[o,i]=te(null);return oe(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return i(null),le(e).then(e=>{t||i(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".`),i(null)}else i(null)},[e]),void 0!==t?t:o}import{jsx as ce,jsxs as ue}from"react/jsx-runtime";function de(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function me(e){const t=L(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}),o=B(),{areas:i,valueAccessor:n,styleRules:a,colorScheme:l,projection:d="equalEarth",graticule:h,fitPadding:p,zoomable:g,zoomExtent:y,onZoom:x,dragRotate:k,tileURL:w,tileAttribution:S,tileCacheSize:M,tooltip:j,areaOpacity:F=1,annotations:P,legendInteraction:H,legendPosition:O,margin:D,className:T,selection:G,linkedHover:U,onObservation:Z,onClick:V,chartId:_,loading:K,loadingContent:q,emptyContent:Q,frameProps:J={},stroke:X,strokeWidth:te,opacity:oe}=e,ie=g??!!w,ne=se(i),re=Y(()=>ne?v(ne):ne,[ne]),ae=Y(()=>"function"==typeof n?n:e=>e?.properties?.[n]??e?.[n],[n]),le=l??o??"blues",me=Y(()=>{if(!re)return ee($(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(const o of re){const i=ae(o);null!=i&&isFinite(i)&&(e>i&&(e=i),i>t&&(t=i))}const o=$(le);return ee(o).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[re,ae,le]),he=Y(()=>{const e=me.domain();return[e[0]??0,e[1]??1]},[me]),pe=W(H,ae,he),{activeSelectionHook:fe,hoverSelectionHook:ge,customHoverBehavior:ye,customClickBehavior:be}=z({selection:G,linkedHover:U,onObservation:Z,onClick:V,chartType:"ChoroplethMap",chartId:_,mobileInteraction:t.mobileInteraction}),ve=s(G),xe=ge||pe.legendSelectionHook||fe,ke=Y(()=>{const e=b(e=>{const t=ae(e);return{fill:null!=t&&isFinite(t)?me(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:F}},a,e=>({value:ae(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=u(e,{stroke:X,strokeWidth:te,opacity:oe});return xe?E(t,xe,ve,de):t},[ae,me,xe,ve,F,X,te,oe,a]),we=Y(()=>e=>{const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",o=ae(e);return ue("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[ce("div",{style:{fontWeight:600},children:t}),null!=o&&ce("div",{style:{opacity:.7},children:(i=o,"number"==typeof i&&isFinite(i)?Number.isInteger(i)?i.toLocaleString():i.toLocaleString(void 0,{maximumFractionDigits:2}):(i??"")+"")})]});var i},[ae]),Se=N(t),Me=Y(()=>{if(!1!==t.showLegend)return{gradient:{colorFn:e=>me(e),domain:he,label:"string"==typeof n?n:"value"}}},[me,t.showLegend,n,he]),{legend:Ae,margin:Ce,legendPosition:Re,legendMarginReserved:Ne}=I({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:O,userMargin:D,defaults:Se,additionalLegend:Me,chartWidth:t.width,chartHeight:t.height,legendLayout:J.legendLayout,frameLegend:J,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),je=R(K,t.width,t.height,q)||(re?null:R(!0,t.width,t.height,q)),Fe=je?null:C(re,t.width,t.height,Q);if(Array.isArray(re)&&re.length>0){const e=re[0];if(!e||"object"!=typeof e||!e.geometry)return ce(m,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}const Pe={projection:d,areas:re,areaStyle:ke,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Ce,enableHover:t.enableHover,...Ae&&{legend:Ae,legendPosition:Re},...Ne&&{__legendMarginReservedFor:Ae},legendHoverBehavior:pe.onLegendHover,legendClickBehavior:pe.onLegendClick,legendHighlightedCategory:pe.highlightedCategory,legendIsolatedCategories:"isolate"===H?pe.isolatedCategories:void 0,tooltipContent:!1===j?()=>null:!0===j?we:A(j)||we,...null!=h&&{graticule:h},...null!=p&&{fitPadding:p},...ie&&{zoomable:!0},...y&&{zoomExtent:y},...x&&{onZoom:x},...null!=k&&{dragRotate:k},...w&&{tileURL:w},...S&&{tileAttribution:S},...M&&{tileCacheSize:M},...c({linkedHover:U,selection:G,onObservation:Z,onClick:V,mobileInteraction:t.mobileInteraction,customHoverBehavior:ye,customClickBehavior:be,linkedHoverInClickPredicate:!1}),...P&&P.length>0&&{annotations:P},...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},...T&&{className:T},...null!=e.animate&&{animate:e.animate},...J};return je||Fe||ce(f,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:ce(r,{...Pe})})}me.displayName="ChoroplethMap";import{useMemo as he,useRef as pe,forwardRef as fe}from"react";var ge={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5};import{jsx as ye,jsxs as be}from"react/jsx-runtime";var ve=[3,30],xe=[1,4],ke=fe(function(e,t){const o=pe(null);l(t,{variant:"geo-points",frameRef:o});const i=L(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:n,xAccessor:s="lon",yAccessor:d="lat",sizeBy:m,sizeRange:p,colorBy:g,styleRules:y,colorScheme:v,projection:k="equalEarth",graticule:w,fitPadding:S,zoomable:M,zoomExtent:C,onZoom:R,dragRotate:j,tileURL:F,tileAttribution:P,tileCacheSize:H,areas:I,areaStyle:z=ge,tooltip:W,annotations:O,margin:B,className:T,selection:$,linkedHover:_,onObservation:K,onClick:q,chartId:Q,loading:J,loadingContent:X,emptyContent:Y,legendInteraction:ee,legendPosition:te,frameProps:oe={},stroke:ie,strokeWidth:ne,opacity:re}=e,ae=p??("sparkline"===i.mode?xe:ve),le="sparkline"===i.mode?1.5:6,ce=M??!!F,ue=se(I),de=a({data:n??h,rawData:n,colorBy:g,colorScheme:v,legendInteraction:ee,legendPosition:te,frameLegend:oe,selection:$,linkedHover:_,fallbackFields:g?["string"==typeof g?g:""]:[],unwrapData:!1,onObservation:K,onClick:q,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:Q,showLegend:i.showLegend,userMargin:B,marginDefaults:N(i),loading:J,loadingContent:X,emptyContent:Y,width:i.width,height:i.height,hasTitle:!!i.title}),me=de.data,fe=he(()=>{if(!m)return;const e="function"==typeof m?m:e=>e?.[m],t=me.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?G(t):void 0},[me,m]),ke=he(()=>{const e=b(e=>({fill:g?Z(e,g,de.colorScale):U,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:m?V(e,m,ae,fe):le}),y,x(g,m)),t=u(e,{stroke:ie,strokeWidth:ne,opacity:re});return de.effectiveSelectionHook?E(t,de.effectiveSelectionHook,de.resolvedSelection):t},[g,de.colorScale,de.effectiveSelectionHook,de.resolvedSelection,m,ae,fe,le,ie,ne,re,y]),we=he(()=>e=>{const t=e?.name||e?.label||e?.NAME||e?.id,o="string"==typeof m?m:null,i=("function"==typeof m?m:e=>e[m])(e),n=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",r="string"==typeof g?g:null,a=r?e?.[r]:null;return be("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&ye("div",{style:{fontWeight:600,marginBottom:2},children:t}),o&&null!=i&&be("div",{children:[be("span",{style:{opacity:.7},children:[o,": "]}),n(i)]}),r&&null!=a&&be("div",{children:[be("span",{style:{opacity:.7},children:[r,": "]}),a+""]}),!t&&!o&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>be("div",{children:[be("span",{style:{opacity:.7},children:[e,": "]}),n(t)]},e))]})},[m,g]);if(de.earlyReturn)return de.earlyReturn;D("ProportionalSymbolMap",me,"xAccessor",s),D("ProportionalSymbolMap",me,"yAccessor",d);const Se={projection:k,...null!=n&&{points:me},xAccessor:s,yAccessor:d,pointStyle:ke,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ue&&{areas:ue,areaStyle:z},...null!=w&&{graticule:w},...null!=S&&{fitPadding:S},...ce&&{zoomable:!0},...C&&{zoomExtent:C},...R&&{onZoom:R},...null!=j&&{dragRotate:j},...F&&{tileURL:F},...P&&{tileAttribution:P},...H&&{tileCacheSize:H},size:[i.width,i.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:de.margin,enableHover:i.enableHover,tooltipContent:!1===W?()=>null:A(W)||we,...de.legendBehaviorProps,...c({linkedHover:_,selection:$,onObservation:K,onClick:q,mobileInteraction:de.mobileInteraction,customHoverBehavior:de.customHoverBehavior,customClickBehavior:de.customClickBehavior,linkedHoverInClickPredicate:!1}),...O&&O.length>0&&{annotations:O},...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},...T&&{className:T},...null!=e.animate&&{animate:e.animate},...oe};return ye(f,{componentName:"ProportionalSymbolMap",width:i.width,height:i.height,children:ye(r,{ref:o,...Se})})});ke.displayName="ProportionalSymbolMap";import{useMemo as we,useCallback as Se,useRef as Me,forwardRef as Ae}from"react";import{scaleLinear as Ce}from"d3-scale";import{jsx as Re,jsxs as Ne}from"react/jsx-runtime";var je="__semiotic_x",Fe="__semiotic_y",Pe=Ae(function(e,t){const o=L(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:i,nodes:n,nodeIdAccessor:s="id",xAccessor:d="lon",yAccessor:m="lat",valueAccessor:p="value",projection:g="equalEarth",graticule:y,fitPadding:b,zoomable:x,zoomExtent:k,onZoom:w,dragRotate:S,tileURL:C,tileAttribution:R,tileCacheSize:j,lineType:F="geo",flowStyle:P="basic",areas:H,areaStyle:I=ge,edgeColorBy:z,edgeOpacity:W=.6,edgeWidthRange:B=[1,8],pointRadius:D,edgeLinecap:$="round",colorScheme:V,showParticles:_,particleStyle:K,tooltip:q,annotations:Q,margin:J,className:X,selection:Y,linkedHover:ee,onObservation:te,onClick:oe,chartId:ie,loading:ne,loadingContent:re,emptyContent:ae,frameProps:le={},legendInteraction:ce,legendPosition:ue,stroke:de,strokeWidth:me,opacity:he,lineIdAccessor:pe}=e,fe=x??!!C,ye=se(H),be=we(()=>v(n),[n]),ve=a({data:i??h,rawData:i,colorBy:z,colorScheme:V,legendInteraction:ce,legendPosition:ue,frameLegend:le,selection:Y,linkedHover:ee,fallbackFields:z?["string"==typeof z?z:""]:[],unwrapData:!1,onObservation:te,onClick:oe,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FlowMap",chartId:ie,showLegend:o.showLegend,userMargin:J,marginDefaults:N(o),loading:ne,loadingContent:re,emptyContent:ae,width:o.width,height:o.height,hasTitle:!!o.title}),xe=ve.data,ke=M(ee),Ae=O({name:ke?.name||"hover",fields:ke?.fields||[]}),Pe=T(e=>e.pushObservation),He=we(()=>{const e=new Map;for(const t of be)e.set(t[s]+"",t);return e},[be,s]),Ie=Me(null),Le=Me(He);Le.current=He;const ze=Me(d);ze.current=d;const We=Me(m);We.current=m;const Oe=Se(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;const t=Le.current,o=t.get(e.source+""),i=t.get(e.target+"");if(!o||!i)return null;const n="function"==typeof ze.current?ze.current:e=>e[ze.current],r="function"==typeof We.current?We.current:e=>e[We.current];return{...e,coordinates:[{[je]:n(o),[Fe]:r(o)},{[je]:n(i),[Fe]:r(i)}]}},[]);l(t,{variant:"geo-lines",frameRef:Ie,overrides:{push:e=>{const t=Oe(e);t&&Ie.current?.pushLine(t)},pushMany:e=>{const t=[];for(const o of e){const e=Oe(o);e&&t.push(e)}t.length>0&&Ie.current?.pushManyLines(t)}}});const Be=we(()=>{const e=new Map;for(const t of xe)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},[xe]),De=Se(e=>{if(ee)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){const e=Be.get(t[s]+"");e&&Ae.onHover(e)}else Ae.onHover(t)}else Ae.onHover(null);if(te||Pe){const t={timestamp:Date.now(),chartType:"FlowMap",chartId:ie};if(e){let o=e.data||e.datum||e;Array.isArray(o)&&(o=o[0]);const i={...t,type:"hover",datum:o||{},x:e.x??0,y:e.y??0};te&&te(i),Pe&&Pe(i)}else{const e={...t,type:"hover-end"};te&&te(e),Pe&&Pe(e)}}},[ee,Ae,s,Be,te,ie,Pe]),Ee=ve.customClickBehavior,Te=we(()=>{const e="function"==typeof d?d:e=>e[d],t="function"==typeof m?m:e=>e[m];return xe.map(o=>{if(!o||"object"!=typeof o||null==o.source||null==o.target)return null;const i=He.get(o.source+""),n=He.get(o.target+"");return i&&n?{...o,coordinates:[{[je]:e(i),[Fe]:t(i)},{[je]:e(n),[Fe]:t(n)}]}:null}).filter(Boolean)},[xe,He,d,m]),Ge=we(()=>{const e="function"==typeof d?d:e=>e[d];return t=>null!=t&&"object"==typeof t&&je in t?t[je]:e(t)},[d]),Ue=we(()=>{const e="function"==typeof m?m:e=>e[m];return t=>null!=t&&"object"==typeof t&&Fe in t?t[Fe]:e(t)},[m]),Ze=we(()=>{const e=xe.filter(e=>e&&"object"==typeof e).map(e=>e[p]??0).filter(e=>isFinite(e));return 0===e.length?()=>B[0]:Ce().domain(G(e)).range(B)},[xe,p,B]),$e=we(()=>e=>({stroke:z?Z(e,z,ve.colorScale):U,strokeWidth:Ze(e[p]??0),strokeLinecap:$,opacity:W}),[z,ve.colorScale,Ze,p,W,$]),Ve=we(()=>{const e=u($e,{stroke:de,strokeWidth:me,opacity:he});if(!ve.effectiveSelectionHook)return e;const t={...ve.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return E(e,ve.effectiveSelectionHook,{...ve.resolvedSelection||{},unselectedStyle:t})},[$e,ve.effectiveSelectionHook,ve.resolvedSelection,de,me,he]),_e=D??("sparkline"===o.mode?1.5:5),Ke=we(()=>u(()=>({fill:"#333",r:_e,fillOpacity:.8}),{stroke:de,strokeWidth:me,opacity:he}),[_e,de,me,he]),qe=we(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)return Re("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:Re("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){const t=e[p];return Ne("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ne("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&Re("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}const t=e?.name||e?.label||e?.[s];return null!=t?Re("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:Re("div",{style:{fontWeight:600},children:t})}):null},[p,s]);if(ve.earlyReturn)return ve.earlyReturn;const Qe={projection:g,...null!=i&&{lines:Te},points:be,xAccessor:Ge,yAccessor:Ue,lineDataAccessor:"coordinates",...null!=pe&&{lineIdAccessor:pe},lineType:F,flowStyle:P,lineStyle:Ve,pointStyle:Ke,...ye&&{areas:ye,areaStyle:I},...null!=y&&{graticule:y},...null!=b&&{fitPadding:b},...fe&&{zoomable:!0},...k&&{zoomExtent:k},...w&&{onZoom:w},...null!=S&&{dragRotate:S},..._&&{showParticles:_},...K&&{particleStyle:K},...C&&{tileURL:C},...R&&{tileAttribution:R},...j&&{tileCacheSize:j},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ve.margin,enableHover:o.enableHover,tooltipContent:!1===q?()=>null:A(q)||qe,...ve.legendBehaviorProps,...c({linkedHover:ee,selection:Y,onObservation:te,onClick:oe,mobileInteraction:ve.mobileInteraction,customHoverBehavior:De,customClickBehavior:Ee,linkedHoverInClickPredicate:!1}),...Q&&Q.length>0&&{annotations:Q},...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},...X&&{className:X},...null!=e.animate&&{animate:e.animate},...le};return Re(f,{componentName:"FlowMap",width:o.width,height:o.height,children:Re(r,{ref:Ie,...Qe})})});Pe.displayName="FlowMap";import{useMemo as He,useRef as Ie,useState as Le,useEffect as ze,useCallback as We,forwardRef as Oe}from"react";import{jsx as Be,jsxs as De}from"react/jsx-runtime";function Ee({bottomMargin:e,costLabel:t,layout:{cx:o,cy:i,maxCost:n,availableRadius:r,layout:a},ringStyle:l,ringValues:s,showNorth:c,showRingLabels:u,showRings:d}){const 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 De("g",m?{children:[Be("line",{x1:o,y1:i,x2:o+r,y2:i,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),Be("line",{x1:o,y1:i-3.5,x2:o,y2:i+3.5,stroke:h.stroke,strokeWidth:h.strokeWidth,opacity:.9}),d&&s.map(a=>{const l=o+(n>0?a/n*r:0);return De("g",{children:[Be("line",{x1:l,y1:i-2.5,x2:l,y2:i+2.5,stroke:h.stroke,strokeWidth:.9,opacity:.65}),u&&De("text",{x:l,y:i+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=>{const a=e/n*r;return De("g",{children:[Be("circle",{cx:o,cy:i,r:a,fill:"none",stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray,opacity:.5}),u&&De("text",{x:o+a+3,y:i-2,fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?" "+t:""]})]},e)}),c&&De("g",{transform:"translate(24, 24)",children:[Be("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),Be("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),Be("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),Be("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),Be("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),Be("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}import{Fragment as Te,jsx as Ge,jsxs as Ue}from"react/jsx-runtime";var Ze=Oe(function(e,t){const o=L(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:i,lines:n,xAccessor:s="lon",yAccessor:d="lat",nodeIdAccessor:m="id",center:h,costAccessor:p,strength:g=1,lineMode:y="straight",projection:k="mercator",graticule:w,fitPadding:S,zoomable:M,zoomExtent:C,onZoom:R,dragRotate:j,tileURL:F,tileAttribution:P,tileCacheSize:H,transition:I,colorBy:z,styleRules:W,colorScheme:O,pointRadius:B,tooltip:T,showRings:G,showRingLabels:$,ringStyle:V,showNorth:_,costLabel:K,cartogramLayout:q,annotations:Q,margin:J,className:X,selection:Y,linkedHover:ee,onObservation:te,onClick:oe,chartId:ie,loading:ne,loadingContent:re,emptyContent:ae,legendPosition:le,frameProps:se={},stroke:ce,strokeWidth:ue,opacity:de}=e,me="sparkline"===o.mode,he=q??(me?"strip":"radial"),pe=B??(me?1.5:5),fe=G??!0,ge=$??("strip"!==he&&!o.compactMode),ye=_??("strip"!==he&&!me),be=M??!!F,ve=He(()=>v(i),[i]),xe=a({data:ve,rawData:i,colorBy:z,colorScheme:O,legendInteraction:void 0,legendPosition:le,frameLegend:se,selection:Y,linkedHover:ee,fallbackFields:z?["string"==typeof z?z:""]:[],unwrapData:!1,onObservation:te,onClick:oe,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DistanceCartogram",chartId:ie,showLegend:o.showLegend,userMargin:J,marginDefaults:N(o),loading:ne,loadingContent:re,emptyContent:ae,width:o.width,height:o.height,hasTitle:!!o.title}),ke=He(()=>{const e=b(e=>{const t=e?.[m],o=null!=t&&t+""==h+"";return{fill:z?Z(e,z,xe.colorScale):U,fillOpacity:o?1:.8,stroke:o?"var(--semiotic-text, #222)":"#fff",strokeWidth:o?1.25:1,r:o?1.35*pe:pe}},W,x(z)),t=u(e,{stroke:ce,strokeWidth:ue,opacity:de});return xe.effectiveSelectionHook?E(t,xe.effectiveSelectionHook,xe.resolvedSelection):t},[z,xe.colorScale,xe.effectiveSelectionHook,xe.resolvedSelection,pe,ce,ue,de,W,h,m]),we=He(()=>({center:h,centerAccessor:m,costAccessor:p,strength:g,lineMode:y,layout:he}),[h,m,p,g,y,he]),Se=He(()=>{if(!n)return;const e="function"==typeof s?s:e=>e[s],t="function"==typeof d?d:e=>e[d],o=new Map;for(const e of ve)o.set(e[m]+"",e);return n.map(i=>{if(i.coordinates)return i;const n=o.get(i.source+""),r=o.get(i.target+"");return n&&r?{...i,coordinates:[{[s]:e(n),[d]:t(n)},{[s]:e(r),[d]:t(r)}]}:null}).filter(Boolean)},[n,ve,s,d,m]),Me=He(()=>e=>{const t=("function"==typeof p?p:e=>e[p])(e);return Ue("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ge("div",{style:{fontWeight:600},children:e[m]||e.name||e.id||"Point"}),null!=t&&Ue("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[p,m]),Ae=Ie(null);l(t,{variant:"geo-points",frameRef:Ae});const[Ce,Re]=Le(null),Ne=We(()=>{const e=Ae.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"})},[]);ze(()=>{const e=requestAnimationFrame(Ne);return()=>cancelAnimationFrame(e)},[Ne,g,h,o.width,o.height,ve,he]);const je=He(()=>{if(!fe||!Ce)return[];const{maxCost:e}=Ce;if(0>=e)return[];if(Array.isArray(fe))return fe.filter(t=>t>0&&e>=t);const t="number"==typeof fe?fe:Math.min("strip"===Ce.layout?3:5,Math.max(2,Math.ceil(e/5))),o=e/t,i=[];for(let e=1;t>=e;e++)i.push(Math.round(o*e*10)/10);return i},[fe,Ce]),Fe=He(()=>{if(!Ce)return se.foregroundGraphics||null;const e=Ge(Ee,{bottomMargin:xe.margin.bottom,costLabel:K,layout:Ce,ringStyle:V,ringValues:je,showNorth:ye,showRingLabels:ge,showRings:fe}),t=se.foregroundGraphics;return"function"==typeof t?o=>Ue(Te,{children:[e,t(o)]}):Ue(Te,{children:[e,t]})},[Ce,je,fe,ge,ye,K,V,xe.margin.bottom,se.foregroundGraphics]);if(xe.earlyReturn)return xe.earlyReturn;D("DistanceCartogram",ve,"xAccessor",s),D("DistanceCartogram",ve,"yAccessor",d);const Pe={projection:k,...null!=i&&{points:ve},...Se&&{lines:Se,lineDataAccessor:"coordinates"},xAccessor:s,yAccessor:d,pointIdAccessor:m,pointStyle:ke,projectionTransform:we,...I&&{transition:{duration:I}},...null!=w&&{graticule:w},...null!=S&&{fitPadding:S},...be&&{zoomable:!0},...C&&{zoomExtent:C},...R&&{onZoom:R},...null!=j&&{dragRotate:j},...F&&{tileURL:F},...P&&{tileAttribution:P},...H&&{tileCacheSize:H},size:[o.width,o.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:xe.margin,enableHover:o.enableHover,tooltipContent:!1===T?()=>null:A(T)||Me,...xe.legendBehaviorProps,...c({linkedHover:ee,selection:Y,onObservation:te,onClick:oe,mobileInteraction:xe.mobileInteraction,customHoverBehavior:xe.customHoverBehavior,customClickBehavior:xe.customClickBehavior,linkedHoverInClickPredicate:!1}),...Q&&Q.length>0&&{annotations:Q},...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},...X&&{className:X},...null!=e.animate&&{animate:e.animate},...se,foregroundGraphics:Fe};return Ge(f,{componentName:"DistanceCartogram",width:o.width,height:o.height,children:Ge(r,{ref:Ae,...Pe})})});Ze.displayName="DistanceCartogram";import{jsx as $e}from"react/jsx-runtime";function Ve(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function _e(e,t,o){return Math.max(t,Math.min(o,e))}function Ke(e){let t=1/0,o=-1/0;for(const i of e)Number.isFinite(i)&&(t>i&&(t=i),i>o&&(o=i));return t===1/0?[0,0]:[t,o]}function qe(e,t){const o=t[1]-t[0];return 0===o?.5:(e-t[0])/o}function Qe(e,t={}){const o=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===o.length)return[];const i=_e(Number.isFinite(t.occupancy)?Number(t.occupancy):.72,.2,1),n=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):1.8;let r=Ve(t.columns)??Math.max(1,Math.ceil(Math.sqrt(o.length*n/i))),a=Ve(t.rows)??Math.max(1,Math.ceil(o.length/(r*i)));o.length>r*a&&(null!=t.columns&&null==t.rows?a=Math.ceil(o.length/r):null!=t.rows&&null==t.columns?r=Math.ceil(o.length/a):a=Math.ceil(o.length/r));const l=Ke(o.map(e=>e.x)),s=Ke(o.map(e=>e.y)),c=o.map(e=>({...e,desiredColumn:qe(e.x,l)*Math.max(0,r-1),desiredRow:qe(e.y,s)*Math.max(0,a-1)})),u=(r-1)/2,d=(a-1)/2;c.sort((e,t)=>(t.desiredColumn-u)**2+(t.desiredRow-d)**2-((e.desiredColumn-u)**2+(e.desiredRow-d)**2)||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index);const m=new Set;for(let e=0;a>e;e+=1)for(let t=0;r>t;t+=1)m.add(e*r+t);const h=[];for(const e of c){let t=-1,o=1/0;for(const i of m){const n=(i%r-e.desiredColumn)**2+(Math.floor(i/r)-e.desiredRow)**2;(o>n||n===o&&t>i)&&(t=i,o=n)}0>t||(m.delete(t),h.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/r),column:t%r,index:e.index}))}return h.sort((e,t)=>e.index-t.index),h.map(({index:e,...t})=>t)}function Je(e,t,o=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(const t of o)if(null!=e[t])return e[t]}function Xe(e){return e.map(([e,t],o)=>`${0===o?"M":"L"}${e},${t}`).join("")+"Z"}var Ye=e=>{const t=e.config,o=t.source??"auto",i="areas"===o||"auto"===o&&e.areas.length>0,n=i?function(e){return e.areas.map((t,o)=>{const i=function(e,t){const o=e.properties&&"object"==typeof e.properties?e.properties:{},i=e.id??o.id??o.name??"area-"+t;return{...o,id:i+""}}(t,o),n=e.scales.geoPath.centroid(t),r=Number.isFinite(n[0])&&Number.isFinite(n[1])?e.scales.invertedPoint(n[0],n[1]):null;return{datum:{...i,gridLongitude:r?.[0],gridLatitude:r?.[1]},x:n[0],y:n[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}(e):e.points.map((e,t)=>({datum:e,x:t,y:t})),r=n.filter((e,o)=>!t.filter||t.filter(e.datum,o)),a=function(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;const o=e.map(e=>({datum:e,x:Number(Je(e,t.columnAccessor)),y:Number(Je(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return o.length!==e.length?null:o.map(e=>({...e,row:e.y,column:e.x}))}(r.map(e=>e.datum),t),l=i?r:function(e){return e.points.map(t=>{const o=Number(Je(t,e.config.longitudeAccessor,["lon","longitude"])),i=Number(Je(t,e.config.latitudeAccessor,["lat","latitude"])),n=Number.isFinite(o)&&Number.isFinite(i)?e.scales.projectedPoint(o,i):null;return{datum:t,x:n?.[0]??NaN,y:n?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}({...e,points:r.map(e=>e.datum)}),s=a??Qe(l,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===s.length)return{nodes:[]};const c=Ke(s.map(e=>e.row)),u=Ke(s.map(e=>e.column)),d=Math.max(1,Math.round(c[1]-c[0])+1),m=Math.max(1,Math.round(u[1]-u[0])+1),h=Math.max(0,t.layoutPadding??8),p=Math.max(1,e.dimensions.width-2*h)/m,f=Math.max(1,e.dimensions.height-2*h)/d,g=(e.dimensions.width-p*m)/2,y=(e.dimensions.height-f*d)/2,b=_e(t.cellPadding??.12,0,.8),v=Math.max(1,.5*Math.min(p,f)*(1-b)),x=t.sizeAccessor?s.map(e=>Number(Je(e.datum,t.sizeAccessor))):[],k=t.sizeDomain??Ke(x),w=t.sizeRange??[.36,1],S=_e(Math.min(w[0],w[1]),.05,1),M=_e(Math.max(w[0],w[1]),S,1),A=s.map((o,i)=>{const n={...o.datum,gridRow:o.row,gridColumn:o.column},r=(Je(n,t.idAccessor,["id","key","name"])??"grid-"+i)+"",a=(Je(n,t.labelAccessor,["abbr","code","label","name","id"])??r)+"",l=Math.max(1,t.maxLabelLength??4),s=a.length>l?a.slice(0,l):a,d=Je(n,t.categoryAccessor),m=null==d?void 0:d+"",h=Je(n,t.fillAccessor),b=null!=h?h+"":m?e.resolveColor(m):e.theme.categorical[0]??"#4f86c6",x=t.sizeAccessor?Number(Je(n,t.sizeAccessor)):NaN,w=t.sizeAccessor&&Number.isFinite(x)?Math.sqrt(_e(qe(x,k),0,1)):1,A=v*(S+w*(M-S)),C="function"==typeof t.markStyle?t.markStyle(n,i):t.markStyle;return{datum:n,id:r,label:s,category:m,row:o.row,column:o.column,x:g+(o.column-u[0]+.5)*p,y:y+(o.row-c[0]+.5)*f,radius:A,style:{fill:b,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...C}}}),C=t.shape??"circle";return{nodes:A.map(e=>{return"circle"===C?{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"===C?function(e,t,o){const i=[];for(let n=0;6>n;n+=1){const r=-Math.PI/2+n*(Math.PI/3);i.push([e+Math.cos(r)*o,t+Math.sin(r)*o])}return Xe(i)}(e.x,e.y,e.radius):Xe([[(t=e.x)-(i=e.radius),(o=e.y)-i],[t+i,o-i],[t+i,o+i],[t-i,o+i]]),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===C?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0};var t,o,i}),overlays:!1===t.showLabels?null:$e(et,{marks:A,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??_e(.23*Math.min(p,f),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}}};function et({marks:e,color:t,fontSize:o,fontFamily:i,fontWeight:n}){const r=d();return $e("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{const a=!r.isActive||r.predicate(e.datum);return $e("text",{x:e.x,y:e.y,fill:t,fontFamily:i,fontSize:o,fontWeight:n,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}import{geoBounds as tt,geoContains as ot}from"d3-geo";import{jsx as it}from"react/jsx-runtime";var nt=new WeakMap,rt=new WeakMap,at=new WeakMap,lt=1;function st(e,t,o){return Math.max(t,Math.min(o,e))}function ct(e){if(Number.isFinite(e)&&Number(e)>0)return Number(e)}function ut(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function dt(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function mt(e,t){const o=dt(e);return(e.id??o.id??o.name??"feature-"+t)+""}function ht(e,t,o,i){return[Math.ceil((e-o)/i-.5),Math.floor((t-o)/i-.5)]}function pt(e){if(!e)return 0;const t=at.get(e);if(t)return t;const o=lt;return lt+=1,at.set(e,o),o}function ft(e,t){return!t||!(t[0][1]>e[1]||e[1]>t[1][1]||(o=e[0],i=t[0][0],n=t[1][0],i>n?i>o&&o>n:i>o||o>n));var o,i,n}function gt(e,t){for(const o of e){const{feature:e,index:i}=o;if(e.geometry&&ft(t,o.bounds))try{if(ot(e,t))return{feature:e,index:i}}catch{}}return null}function yt(e,t,o,i={}){const n=e.filter((e,t)=>e.geometry&&(!i.featureFilter||i.featureFilter(e,t))),r=function(e,t){if(0===e.length)return null;const o=t.bounds({type:"FeatureCollection",features:e});return Number.isFinite(o[0][0])&&Number.isFinite(o[0][1])&&Number.isFinite(o[1][0])&&Number.isFinite(o[1][1])?o:null}(n,t.geoPath);if(!r)return{dots:[],cellSize:10,features:n};const a=Math.max(0,i.layoutPadding??0),l=[[st(r[0][0],a,Math.max(a,o.width-a)),st(r[0][1],a,Math.max(a,o.height-a))],[st(r[1][0],a,Math.max(a,o.width-a)),st(r[1][1],a,Math.max(a,o.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:n};const u=ct(i.columns);let d=Math.max(2,u?s/u:ct(i.cellSize)??10);const m=Math.max(100,Math.round(ct(i.maxSamples)??25e3)),h=Math.ceil(s/d)*Math.ceil(c/d);h>m&&(d*=Math.sqrt(h/m));const p=i.gridOrigin?.[0]??0,f=i.gridOrigin?.[1]??0,[g,y]=ht(l[0][0],l[1][0],p,d),[b,v]=ht(l[0][1],l[1][1],f,d),x=[],k=function(e){return e.map((e,t)=>{if(rt.has(e))return{feature:e,index:t,bounds:rt.get(e)??null};try{const o=tt(e);return rt.set(e,o),{feature:e,index:t,bounds:o}}catch{return rt.set(e,null),{feature:e,index:t,bounds:null}}})}(n);for(let e=b;v>=e;e+=1){const o=f+(e+.5)*d;for(let n=g;y>=n;n+=1){const r=t.invertedPoint(p+(n+.5)*d,o);if(!r||!Number.isFinite(r[0])||!Number.isFinite(r[1]))continue;const a=gt(k,r);if(!a)continue;const l={...dt(a.feature),featureId:mt(a.feature,a.index),featureIndex:a.index,gridRow:e,gridColumn:n,longitude:r[0],latitude:r[1],dotIndex:x.length};i.dotFilter&&!i.dotFilter(l,x.length)||x.push(l)}}return{dots:x,cellSize:d,features:n}}function bt(e){return Math.round(1e4*e)/1e4}function vt(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${bt(Number(e[0]))},${bt(Number(e[1]))}`:"null"}function xt(e,t){const o=e[t];return"function"==typeof o?o.call(e):void 0}function kt(e){return"number"==typeof e&&Number.isFinite(e)?bt(e)+"":null===e?"null":"unavailable"}function wt(e){const t=e.scales.projection;return[kt(xt(t,"scale")),vt(xt(t,"translate")),vt(xt(t,"center")),(o=xt(t,"rotate"),Array.isArray(o)&&o.every(Number.isFinite)?o.map(e=>bt(Number(e))).join(","):"unavailable"),kt(xt(t,"clipAngle")),kt(xt(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,o])=>vt(e.scales.projectedPoint(t,o)))].join("|");var o}function St(e){return e.map(([e,t],o)=>`${0===o?"M":"L"}${e},${t}`).join("")+"Z"}var Mt=e=>{const t=function(e){let t=nt.get(e.areas);t||(t=new Map,nt.set(e.areas,t));const o=function(e){const t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",pt(t.featureFilter),pt(t.dotFilter),wt(e)].join("::")}(e),i=t.get(o);if(i)return i;const n=yt(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){const e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(o,n),n}(e),o=e.config,i=o.shape??"circle",n=Math.max(.5,ct(o.dotRadius)??t.cellSize*st(o.radiusRatio??.24,.05,.5)),r=o.gridOrigin?.[0]??0,a=o.gridOrigin?.[1]??0;return{nodes:t.dots.map((l,s)=>{const c=r+(l.gridColumn+.5)*t.cellSize,u=a+(l.gridRow+.5)*t.cellSize,d=ut(l,o.categoryAccessor),m=ut(l,o.fillAccessor),h={fill:null!=m?m+"":null!=d?e.resolveColor(d+""):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof o.markStyle?o.markStyle(l,s):o.markStyle},p=`dot-${l.gridRow}-${l.gridColumn}`;if("circle"===i)return{type:"point",x:c,y:u,r:n,style:h,datum:l,interactive:!1,pointId:p,_transitionKey:p};const f="hexagon"===i?function(e,t,o){return St(Array.from({length:6},(i,n)=>{const r=-Math.PI/2+n*(Math.PI/3);return[e+Math.cos(r)*o,t+Math.sin(r)*o]}))}(c,u,n):function(e,t,o){return St([[e-o,t-o],[e+o,t-o],[e+o,t+o],[e-o,t+o]])}(c,u,n);return{type:"geoarea",pathData:f,centroid:[c,u],bounds:[[c-n,u-n],[c+n,u+n]],screenArea:"hexagon"===i?3*Math.sqrt(3)*n*n/2:(2*n)**2,style:h,datum:l,group:l.featureId,interactive:!1}}),overlays:o.showOutline?it("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,i)=>{const n=e.scales.geoPath(t);return n?it("path",{d:n,fill:"none",stroke:o.outlineStyle?.stroke??"currentColor",strokeOpacity:o.outlineStyle?.opacity??o.outlineStyle?.fillOpacity??.22,strokeWidth:o.outlineStyle?.strokeWidth??.7,strokeDasharray:o.outlineStyle?.strokeDasharray,strokeLinecap:o.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},mt(t,i)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};function At(e,t,o){const{featureKey:i,dataKey:n}=o,r=new Map;for(const e of t){const t=(Object.prototype.hasOwnProperty.call(e,n)?e[n]:void 0)+"";r.set(t,e)}return e.map(e=>{const t=(e=>{const t=i.split(".");let o=e;for(const e of t)o=null!==o&&"object"==typeof o&&Object.prototype.hasOwnProperty.call(o,e)?o[e]:void 0;return(o??"")+""})(e),o=r.get(t);return o?{...e,properties:{...e.properties,...o}}:e})}export{me as ChoroplethMap,e as DEFAULT_HIT_RADIUS,Ze as DistanceCartogram,Pe as FlowMap,n as GeoCustomChart,p as MultiLineTooltip,ke as ProportionalSymbolMap,r as StreamGeoFrame,g as Tooltip,y as TooltipRoot,b as composeStyleRules,t as geoAreaHitTarget,o as geoHitTarget,Mt as geographicDotGridLayout,Ye as geographicGridLayout,_ as glyphExtent,K as glyphPlacement,Qe as gridifyGeographicPoints,q as hatchFillId,Q as hatchPatternDef,i as hitTargetPoint,J as isHatchFill,x as makeNodeRuleContext,k as makeRuleValueResolver,w as markTooltipChrome,S as matchesThreshold,At as mergeData,le as resolveReferenceGeography,j as resolveResponsiveRules,F as resolveStyleRules,X as resolveSvgFill,P as responsiveRuleMatches,H as ruleMatches,yt as sampleGeographicDotGrid};
2
+ function e(e){return"default"in e?e.default:e}async function t(t){let i=Be.get(t);if(i)return i;let{topology:o,objectName:r}=await async function(t){try{switch(t){case"world-110m":return{topology:e(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:e(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:e(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:e(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw Error(`Unknown reference geography: "${t}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(e){throw/Cannot find module|Failed to resolve|world-atlas/i.test(e instanceof Error?e.message:e+"")?Error(`resolveReferenceGeography("${t}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:e}):e}}(t);if(!o||!o.objects)throw Error(`resolveReferenceGeography("${t}"): Failed to load topology. Got ${typeof o} with keys: ${o?Object.keys(o).join(", "):"none"}`);let n=Te(o,o.objects[r]),a="features"in n?n.features:[n];return Be.set(t,a),a}function i(e){let i=De(()=>Array.isArray(e)?e:void 0,[e]),[o,r]=We(null);return Oe(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(i=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(i)){let i=!1;return r(null),t(e).then(e=>{i||r(e)}),()=>{i=!0}}var i;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),r(null)}else r(null)},[e]),void 0!==i?i:o}function o(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function r(e){let t=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=ve(),{areas:n,valueAccessor:a,styleRules:l,colorScheme:s,projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:f,tileURL:g,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:k,legendInteraction:w,legendPosition:S,margin:M,className:A,selection:C,linkedHover:N,onObservation:R,onClick:j,chartId:F,loading:P,loadingContent:L,emptyContent:H,frameProps:I={},stroke:z,strokeWidth:W,opacity:O}=e,D=m??!!g,T=i(n),E=Ie(()=>T&&ee(T),[T]),G=Ie(()=>"function"==typeof a?a:e=>e?.properties?.[a]??e?.[a],[a]),Z=s??r??"blues",q=Ie(()=>{if(!E)return ze(Me(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(let i of E){let o=G(i);null==o||!isFinite(o)||(e>o&&(e=o),o>t&&(t=o))}let i=Me(Z);return ze(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[E,G,Z]),J=Ie(()=>{let e=q.domain();return[e[0]??0,e[1]??1]},[q]),V=ye(w,G,J),{activeSelectionHook:Y,hoverSelectionHook:te,customHoverBehavior:ie,customClickBehavior:oe}=ge({selection:C,linkedHover:N,onObservation:R,onClick:j,chartType:"ChoroplethMap",chartId:F,mobileInteraction:t.mobileInteraction}),re=U(C),ne=te||V.legendSelectionHook||Y,ue=Ie(()=>{let e=X(e=>{let t=G(e);return{fill:null!=t&&isFinite(t)?q(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},l,e=>({value:G(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=K(e,{stroke:z,strokeWidth:W,opacity:O});return ne?ke(t,ne,re,o):t},[G,q,ne,re,x,z,W,O,l]),de=Ie(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=G(e);return Ge("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ee("div",{style:{fontWeight:600},children:t}),null!=i&&Ee("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):(o??"")+"")})]});var o},[G]),me=ce(t),he=Ie(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>q(e),domain:J,label:"string"==typeof a?a:"value"}},[q,t.showLegend,a,J]),{legend:be,margin:xe,legendPosition:we,legendMarginReserved:Se}=pe({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:S,userMargin:M,defaults:me,additionalLegend:he,chartWidth:t.width,chartHeight:t.height,legendLayout:I.legendLayout,frameLegend:I,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),Ae=se(P,t.width,t.height,L)||(E?null:se(!0,t.width,t.height,L)),Ce=Ae?null:le(E,t.width,t.height,H);if(Array.isArray(E)&&E.length>0){let e=E[0];if(!e||"object"!=typeof e||!e.geometry)return Ee(_,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let Ne={projection:c,areas:E,areaStyle:ue,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:xe,enableHover:t.enableHover,...be&&{legend:be,legendPosition:we},...Se&&{__legendMarginReservedFor:be},legendHoverBehavior:V.onLegendHover,legendClickBehavior:V.onLegendClick,legendHighlightedCategory:V.highlightedCategory,legendIsolatedCategories:"isolate"===w?V.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?de:ae(v)||de,...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...D&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=f&&{dragRotate:f},...g&&{tileURL:g},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...$({linkedHover:N,selection:C,onObservation:R,onClick:j,mobileInteraction:t.mobileInteraction,customHoverBehavior:ie,customClickBehavior:oe,linkedHoverInClickPredicate:!1}),...k&&k.length>0&&{annotations:k},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...A&&{className:A},...null!=e.animate&&{animate:e.animate},...I};return Ae||Ce||Ee(Q,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:Ee(B,{...Ne})})}function n(e,t,i){let[o,r]=i;if(!t)return o;let[n,a]=t,l=a>n?a-n:0,s=Number(e),c=Number.isFinite(s)?s:n;return o+Math.max(0,Math.min(1,l>0?(c-n)/l:0))*(r-o)}function a({bottomMargin:e,costLabel:t,layout:{cx:i,cy:o,maxCost:r,availableRadius:n,layout:a},ringStyle:l,ringValues:s,showNorth:c,showRingLabels:u,showRings:d}){let m="strip"===a,h={stroke:m?"var(--semiotic-border, #999)":"#999",strokeWidth:m?1:.8,strokeDasharray:m?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:m?8:10,...l};return pt("g",m?{children:[ht("line",{x1:i,y1:o,x2:i+n,y2:o,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),ht("line",{x1:i,y1:o-3.5,x2:i,y2:o+3.5,stroke:h.stroke,strokeWidth:h.strokeWidth,opacity:.9}),d&&s.map(a=>{let l=i+(r>0?a/r*n:0);return pt("g",{children:[ht("line",{x1:l,y1:o-2.5,x2:l,y2:o+2.5,stroke:h.stroke,strokeWidth:.9,opacity:.65}),u&&pt("text",{x:l,y:o+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?" "+t:""]})]},a)})]}:{children:[s.map(e=>{let a=e/r*n;return pt("g",{children:[ht("circle",{cx:i,cy:o,r:a,fill:"none",stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray,opacity:.5}),u&&pt("text",{x:i+a+3,y:o-2,fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?" "+t:""]})]},e)}),c&&pt("g",{transform:"translate(24, 24)",children:[ht("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),ht("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),ht("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),ht("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),ht("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),ht("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function l(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function s(e,t,i){return Math.max(t,Math.min(i,e))}function c(e){let t=1/0,i=-1/0;for(let o of e)Number.isFinite(o)&&(t>o&&(t=o),o>i&&(i=o));return t===1/0?[0,0]:[t,i]}function u(e,t){let i=t[1]-t[0];return 0===i?.5:(e-t[0])/i}function d(e,t={}){let i=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===i.length)return[];let o=s(Number.isFinite(t.occupancy)?Number(t.occupancy):.72,.2,1),r=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):1.8,n=l(t.columns)??Math.max(1,Math.ceil(Math.sqrt(i.length*r/o))),a=l(t.rows)??Math.max(1,Math.ceil(i.length/(n*o)));i.length>n*a&&(null!=t.columns&&null==t.rows?a=Math.ceil(i.length/n):null!=t.rows&&null==t.columns?n=Math.ceil(i.length/a):a=Math.ceil(i.length/n));let d=c(i.map(e=>e.x)),m=c(i.map(e=>e.y)),h=i.map(e=>({...e,desiredColumn:u(e.x,d)*Math.max(0,n-1),desiredRow:u(e.y,m)*Math.max(0,a-1)})),p=(n-1)/2,f=(a-1)/2;h.sort((e,t)=>(t.desiredColumn-p)**2+(t.desiredRow-f)**2-((e.desiredColumn-p)**2+(e.desiredRow-f)**2)||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index);let g=new Set;for(let e=0;a>e;e+=1)for(let t=0;n>t;t+=1)g.add(e*n+t);let y=[];for(let e of h){let t=-1,i=1/0;for(let o of g){let r=(o%n-e.desiredColumn)**2+(Math.floor(o/n)-e.desiredRow)**2;(i>r||r===i&&t>o)&&(t=o,i=r)}0>t||(g.delete(t),y.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/n),column:t%n,index:e.index}))}return y.sort((e,t)=>e.index-t.index),y.map(({index:e,...t})=>t)}function m(e,t,i=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(let t of i)if(null!=e[t])return e[t]}function h(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function p(e,t,i){let o=[];for(let r=0;6>r;r+=1){let n=-Math.PI/2+r*(Math.PI/3);o.push([e+Math.cos(n)*i,t+Math.sin(n)*i])}return h(o)}function f({marks:e,color:t,fontSize:i,fontFamily:o,fontWeight:r}){let n=Z();return vt("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{let a=!n.isActive||n.predicate(e.datum);return vt("text",{x:e.x,y:e.y,fill:t,fontFamily:o,fontSize:i,fontWeight:r,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function g(e,t,i){return Math.max(t,Math.min(i,e))}function y(e){if(Number.isFinite(e)&&Number(e)>0)return Number(e)}function b(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function v(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function x(e,t){let i=v(e);return(e.id??i.id??i.name??"feature-"+t)+""}function k(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function w(e){if(!e)return 0;let t=Ct.get(e);if(t)return t;let i=Nt;return Nt+=1,Ct.set(e,i),i}function S(e,t){return!t||!(t[0][1]>e[1]||e[1]>t[1][1]||(i=e[0],o=t[0][0],r=t[1][0],o>r?o>i&&i>r:o>i||i>r));var i,o,r}function M(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&S(t,i.bounds))try{if(wt(e,t))return{feature:e,index:o}}catch{}}return null}function A(e,t,i,o={}){let r=e.filter((e,t)=>e.geometry&&(!o.featureFilter||o.featureFilter(e,t))),n=function(e,t){if(0===e.length)return null;let i=t.bounds({type:"FeatureCollection",features:e});return Number.isFinite(i[0][0])&&Number.isFinite(i[0][1])&&Number.isFinite(i[1][0])&&Number.isFinite(i[1][1])?i:null}(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[g(n[0][0],a,Math.max(a,i.width-a)),g(n[0][1],a,Math.max(a,i.height-a))],[g(n[1][0],a,Math.max(a,i.width-a)),g(n[1][1],a,Math.max(a,i.height-a))]],s=Math.max(0,l[1][0]-l[0][0]),c=Math.max(0,l[1][1]-l[0][1]);if(0===s||0===c)return{dots:[],cellSize:10,features:r};let u=y(o.columns),d=Math.max(2,u?s/u:y(o.cellSize)??10),m=Math.max(100,Math.round(y(o.maxSamples)??25e3)),h=Math.ceil(s/d)*Math.ceil(c/d);h>m&&(d*=Math.sqrt(h/m));let p=o.gridOrigin?.[0]??0,f=o.gridOrigin?.[1]??0,[b,w]=k(l[0][0],l[1][0],p,d),[S,A]=k(l[0][1],l[1][1],f,d),C=[],N=function(e){return e.map((e,t)=>{if(At.has(e))return{feature:e,index:t,bounds:At.get(e)??null};try{let i=kt(e);return At.set(e,i),{feature:e,index:t,bounds:i}}catch{return At.set(e,null),{feature:e,index:t,bounds:null}}})}(r);for(let e=S;A>=e;e+=1){let i=f+(e+.5)*d;for(let r=b;w>=r;r+=1){let n=t.invertedPoint(p+(r+.5)*d,i);if(!n||!Number.isFinite(n[0])||!Number.isFinite(n[1]))continue;let a=M(N,n);if(!a)continue;let l={...v(a.feature),featureId:x(a.feature,a.index),featureIndex:a.index,gridRow:e,gridColumn:r,longitude:n[0],latitude:n[1],dotIndex:C.length};o.dotFilter&&!o.dotFilter(l,C.length)||C.push(l)}}return{dots:C,cellSize:d,features:r}}function C(e){return Math.round(1e4*e)/1e4}function N(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${C(Number(e[0]))},${C(Number(e[1]))}`:"null"}function R(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function j(e){return"number"==typeof e&&Number.isFinite(e)?C(e)+"":null===e?"null":"unavailable"}function F(e){let t=e.scales.projection;return[j(R(t,"scale")),N(R(t,"translate")),N(R(t,"center")),(i=R(t,"rotate"),Array.isArray(i)&&i.every(Number.isFinite)?i.map(e=>C(Number(e))).join(","):"unavailable"),j(R(t,"clipAngle")),j(R(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>N(e.scales.projectedPoint(t,i)))].join("|");var i}function P(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function L(e,t,i){return P([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function H(e,t,i){return P(Array.from({length:6},(o,r)=>{let n=-Math.PI/2+r*(Math.PI/3);return[e+Math.cos(n)*i,t+Math.sin(n)*i]}))}function I(e,t,i){let{featureKey:o,dataKey:r}=i,n=new Map;for(let e of t){let t=(Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0)+"";n.set(t,e)}return e.map(e=>{let t=(e=>{let t=o.split("."),i=e;for(let e of t)i=null!==i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;return(i??"")+""})(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}import{DEFAULT_HIT_RADIUS as z,geoAreaHitTarget as W,geoHitTarget as O,hitTargetPoint as D}from"./c-HLLFJYTY.min.js";import{GeoCustomChart as T,StreamGeoFrame_default as B}from"./c-CCTGN5CK.min.js";import"./c-55BAJ333.min.js";import{useChartSetup as E,useFrameImperativeHandle as G,useResolvedSelection as U}from"./c-KCRJGUHP.min.js";import"./c-ORLEBW72.min.js";import"./c-NYZ2QNAM.min.js";import"./c-BNG5ECK5.min.js";import"./c-TKG2NP7G.min.js";import"./c-OO5QLMJC.min.js";import"./c-V4XMSLC3.min.js";import"./c-4FN7Q6VQ.min.js";import{buildCustomBehaviorProps as $,mergeShapeStyle as K}from"./c-ITKX3RC5.min.js";import{useCustomLayoutSelection as Z}from"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-EUBTECGM.min.js";import{ChartError as _,EMPTY_ARRAY as q,MultiLineTooltip as J,SafeRender as Q,Tooltip as V,TooltipRoot as Y,composeStyleRules as X,filterSparseArray as ee,makeNodeRuleContext as te,makeRuleValueResolver as ie,markTooltipChrome as oe,matchesThreshold as re,normalizeLinkedHover as ne,normalizeTooltip as ae,renderEmptyState as le,renderLoadingState as se,resolveAxisFreeMarginDefaults as ce,resolveResponsiveRules as ue,resolveStyleRules as de,responsiveRuleMatches as me,ruleMatches as he,useChartLegendAndMargin as pe,useChartMode as fe,useChartSelection as ge,useGradientLegendInteraction as ye,useLinkedHover as be,useThemeSequential as ve,warnMissingField as xe,wrapStyleWithSelection as ke}from"./c-LMGSSD2E.min.js";import{DEFAULT_COLOR as we,getColor as Se,getSequentialInterpolator as Me,getSize as Ae}from"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import{useObservationSelector as Ce}from"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import{getMinMax as Ne}from"./c-QA3HMQJP.min.js";import{glyphExtent as Re,glyphPlacement as je,hatchFillId as Fe,hatchPatternDef as Pe,isHatchFill as Le,resolveSvgFill as He}from"./c-553QUDKA.min.js";import{useMemo as Ie}from"react";import{scaleSequential as ze}from"d3-scale";import{useState as We,useEffect as Oe,useMemo as De}from"react";import{feature as Te}from"topojson-client";var Be=new Map;import{jsx as Ee,jsxs as Ge}from"react/jsx-runtime";r.displayName="ChoroplethMap";import{useMemo as Ue,useRef as $e,forwardRef as Ke}from"react";var Ze={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5};import{jsx as _e,jsxs as qe}from"react/jsx-runtime";var Je=[3,30],Qe=[1,4],Ve=Ke(function(e,t){let o=$e(null);G(t,{variant:"geo-points",frameRef:o});let r=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:n,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,areas:S,areaStyle:M=Ze,tooltip:A,annotations:C,margin:N,className:R,selection:j,linkedHover:F,onObservation:P,onClick:L,chartId:H,loading:I,loadingContent:z,emptyContent:W,legendInteraction:O,legendPosition:D,frameProps:T={},stroke:U,strokeWidth:Z,opacity:_}=e,J=c??("sparkline"===r.mode?Qe:Je),V="sparkline"===r.mode?1.5:6,Y=g??!!x,ee=i(S),ie=E({data:n??q,rawData:n,colorBy:u,colorScheme:m,legendInteraction:O,legendPosition:D,frameLegend:T,selection:j,linkedHover:F,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:P,onClick:L,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:H,showLegend:r.showLegend,userMargin:N,marginDefaults:ce(r),loading:I,loadingContent:z,emptyContent:W,width:r.width,height:r.height,hasTitle:!!r.title}),oe=ie.data,re=Ue(()=>{if(!s)return;let e="function"==typeof s?s:e=>e?.[s],t=oe.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?Ne(t):void 0},[oe,s]),ne=Ue(()=>{let e=X(e=>({fill:u?Se(e,u,ie.colorScale):we,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Ae(e,s,J,re):V}),d,te(u,s)),t=K(e,{stroke:U,strokeWidth:Z,opacity:_});return ie.effectiveSelectionHook?ke(t,ie.effectiveSelectionHook,ie.resolvedSelection):t},[u,ie.colorScale,ie.effectiveSelectionHook,ie.resolvedSelection,s,J,re,V,U,Z,_,d]),le=Ue(()=>e=>{let t=e?.name||e?.label||e?.NAME||e?.id,i="string"==typeof s?s:null,o=("function"==typeof s?s:e=>e[s])(e),r=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",n="string"==typeof u?u:null,a=n?e?.[n]:null;return qe("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&_e("div",{style:{fontWeight:600,marginBottom:2},children:t}),i&&null!=o&&qe("div",{children:[qe("span",{style:{opacity:.7},children:[i,": "]}),r(o)]}),n&&null!=a&&qe("div",{children:[qe("span",{style:{opacity:.7},children:[n,": "]}),a+""]}),!t&&!i&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>qe("div",{children:[qe("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(ie.earlyReturn)return ie.earlyReturn;xe("ProportionalSymbolMap",oe,"xAccessor",a),xe("ProportionalSymbolMap",oe,"yAccessor",l);let se={projection:h,...null!=n&&{points:oe},xAccessor:a,yAccessor:l,pointStyle:ne,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ee&&{areas:ee,areaStyle:M},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...Y&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[r.width,r.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ie.margin,enableHover:r.enableHover,tooltipContent:!1===A?()=>null:ae(A)||le,...ie.legendBehaviorProps,...$({linkedHover:F,selection:j,onObservation:P,onClick:L,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior,linkedHoverInClickPredicate:!1}),...C&&C.length>0&&{annotations:C},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...r.title&&{title:r.title},...r.description&&{description:r.description},...r.summary&&{summary:r.summary},...void 0!==r.accessibleTable&&{accessibleTable:r.accessibleTable},...R&&{className:R},...null!=e.animate&&{animate:e.animate},...T};return _e(Q,{componentName:"ProportionalSymbolMap",width:r.width,height:r.height,children:_e(B,{ref:o,...se})})});Ve.displayName="ProportionalSymbolMap";import{useMemo as Ye,useCallback as Xe,useRef as et,forwardRef as tt}from"react";import{jsx as it,jsxs as ot}from"react/jsx-runtime";var rt="__semiotic_x",nt="__semiotic_y",at=tt(function(e,t){let o=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:r,nodes:a,nodeIdAccessor:l="id",xAccessor:s="lon",yAccessor:c="lat",valueAccessor:u="value",projection:d="equalEarth",graticule:m,fitPadding:h,zoomable:p,zoomExtent:f,onZoom:g,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:k="geo",flowStyle:w="basic",areas:S,areaStyle:M=Ze,edgeColorBy:A,edgeOpacity:C=.6,edgeWidthRange:N=[1,8],pointRadius:R,edgeLinecap:j="round",colorScheme:F,styleRules:P,showParticles:L,particleStyle:H,tooltip:I,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:U,onClick:Z,chartId:_,loading:J,loadingContent:V,emptyContent:Y,frameProps:te={},legendInteraction:oe,legendPosition:re,stroke:le,strokeWidth:se,opacity:ue,lineIdAccessor:de}=e,me=p??!!b,he=i(S),pe=Ye(()=>ee(a),[a]),ge=E({data:r??q,rawData:r,colorBy:A,colorScheme:F,legendInteraction:oe,legendPosition:re,frameLegend:te,selection:D,linkedHover:T,fallbackFields:A?["string"==typeof A?A:""]:[],unwrapData:!1,onObservation:U,onClick:Z,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FlowMap",chartId:_,showLegend:o.showLegend,userMargin:W,marginDefaults:ce(o),loading:J,loadingContent:V,emptyContent:Y,width:o.width,height:o.height,hasTitle:!!o.title}),ye=ge.data,ve=ne(T),xe=be({name:ve?.name||"hover",fields:ve?.fields||[]}),Me=Ce(e=>e.pushObservation),Ae=Ye(()=>{let e=new Map;for(let t of pe)e.set(t[l]+"",t);return e},[pe,l]),Re=et(null),je=et(Ae);je.current=Ae;let Fe=et(s);Fe.current=s;let Pe=et(c);Pe.current=c;let Le=Xe(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=je.current,i=t.get(e.source+""),o=t.get(e.target+"");if(!i||!o)return null;let r="function"==typeof Fe.current?Fe.current:e=>e[Fe.current],n="function"==typeof Pe.current?Pe.current:e=>e[Pe.current];return{...e,coordinates:[{[rt]:r(i),[nt]:n(i)},{[rt]:r(o),[nt]:n(o)}]}},[]);G(t,{variant:"geo-lines",frameRef:Re,overrides:{push:e=>{let t=Le(e);t&&Re.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=Le(i);e&&t.push(e)}t.length>0&&Re.current?.pushManyLines(t)}}});let He=Ye(()=>{let e=new Map;for(let t of ye)!t||"object"!=typeof t||(null!=t.source&&!e.has(t.source)&&e.set(t.source,t),null!=t.target&&!e.has(t.target)&&e.set(t.target,t));return e},[ye]),Ie=Xe(e=>{if(T)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=He.get(t[l]+"");e&&xe.onHover(e)}else xe.onHover(t)}else xe.onHover(null);if(U||Me){let t={timestamp:Date.now(),chartType:"FlowMap",chartId:_};if(e){let i=e.data||e.datum||e;Array.isArray(i)&&(i=i[0]);let o={...t,type:"hover",datum:i||{},x:e.x??0,y:e.y??0};U&&U(o),Me&&Me(o)}else{let e={...t,type:"hover-end"};U&&U(e),Me&&Me(e)}}},[T,xe,l,He,U,_,Me]),ze=ge.customClickBehavior,We=Ye(()=>{let e="function"==typeof s?s:e=>e[s],t="function"==typeof c?c:e=>e[c];return ye.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=Ae.get(i.source+""),r=Ae.get(i.target+"");return o&&r?{...i,coordinates:[{[rt]:e(o),[nt]:t(o)},{[rt]:e(r),[nt]:t(r)}]}:null}).filter(Boolean)},[ye,Ae,s,c]),Oe=Ye(()=>{let e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&rt in t?t[rt]:e(t)},[s]),De=Ye(()=>{let e="function"==typeof c?c:e=>e[c];return t=>null!=t&&"object"==typeof t&&nt in t?t[nt]:e(t)},[c]),Te=Ye(()=>{let e=ye.filter(e=>e&&"object"==typeof e).map(e=>Number(e[u]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return Ne(e)},[ye,u]),Be=Ye(()=>function(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:a,edgeLinecap:l,styleRules:s}=e,c=ie(t);return X(e=>({stroke:r(e),strokeWidth:n(e[t],i,o),strokeLinecap:l,opacity:a,fillOpacity:0}),s,e=>({value:c(e)}))}({valueAccessor:u,valueDomain:Te,edgeWidthRange:N,resolveStroke:e=>A?Se(e,A,ge.colorScale):we,edgeOpacity:C,edgeLinecap:j,styleRules:P}),[u,Te,N,A,ge.colorScale,C,j,P]),Ee=Ye(()=>{let e=K(Be,{stroke:le,strokeWidth:se,opacity:ue});if(!ge.effectiveSelectionHook)return e;let t={...ge.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return ke(e,ge.effectiveSelectionHook,{...ge.resolvedSelection||{},unselectedStyle:t})},[Be,ge.effectiveSelectionHook,ge.resolvedSelection,le,se,ue]),Ge=R??("sparkline"===o.mode?1.5:5),Ue=Ye(()=>K(()=>({fill:"#333",r:Ge,fillOpacity:.8}),{stroke:le,strokeWidth:se,opacity:ue}),[Ge,le,se,ue]),$e=Ye(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)return it("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:it("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){let t=e[u];return ot("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[ot("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&it("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[l];return null!=t?it("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:it("div",{style:{fontWeight:600},children:t})}):null},[u,l]);if(ge.earlyReturn)return ge.earlyReturn;let Ke={projection:d,...null!=r&&{lines:We},points:pe,xAccessor:Oe,yAccessor:De,lineDataAccessor:"coordinates",...null!=de&&{lineIdAccessor:de},lineType:k,flowStyle:w,lineStyle:Ee,pointStyle:Ue,...he&&{areas:he,areaStyle:M},...null!=m&&{graticule:m},...null!=h&&{fitPadding:h},...me&&{zoomable:!0},...f&&{zoomExtent:f},...g&&{onZoom:g},...null!=y&&{dragRotate:y},...L&&{showParticles:L},...H&&{particleStyle:H},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ge.margin,enableHover:o.enableHover,tooltipContent:!1===I?()=>null:ae(I)||$e,...ge.legendBehaviorProps,...$({linkedHover:T,selection:D,onObservation:U,onClick:Z,mobileInteraction:ge.mobileInteraction,customHoverBehavior:Ie,customClickBehavior:ze,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...O&&{className:O},...null!=e.animate&&{animate:e.animate},...te};return it(Q,{componentName:"FlowMap",width:o.width,height:o.height,children:it(B,{ref:Re,...Ke})})});at.displayName="FlowMap";import{useMemo as lt,useRef as st,useState as ct,useEffect as ut,useCallback as dt,forwardRef as mt}from"react";import{jsx as ht,jsxs as pt}from"react/jsx-runtime";import{Fragment as ft,jsx as gt,jsxs as yt}from"react/jsx-runtime";var bt=mt(function(e,t){let i=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:o,lines:r,xAccessor:n="lon",yAccessor:l="lat",nodeIdAccessor:s="id",center:c,costAccessor:u,strength:d=1,lineMode:m="straight",projection:h="mercator",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,transition:S,colorBy:M,styleRules:A,colorScheme:C,pointRadius:N,tooltip:R,showRings:j,showRingLabels:F,ringStyle:P,showNorth:L,costLabel:H,cartogramLayout:I,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:U,onClick:Z,chartId:_,loading:q,loadingContent:J,emptyContent:V,legendPosition:Y,frameProps:ie={},stroke:oe,strokeWidth:re,opacity:ne}=e,le="sparkline"===i.mode,se=I??(le?"strip":"radial"),ue=N??(le?1.5:5),de=j??!0,me=F??("strip"!==se&&!i.compactMode),he=L??("strip"!==se&&!le),pe=g??!!x,ge=lt(()=>ee(o),[o]),ye=E({data:ge,rawData:o,colorBy:M,colorScheme:C,legendInteraction:void 0,legendPosition:Y,frameLegend:ie,selection:D,linkedHover:T,fallbackFields:M?["string"==typeof M?M:""]:[],unwrapData:!1,onObservation:U,onClick:Z,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DistanceCartogram",chartId:_,showLegend:i.showLegend,userMargin:W,marginDefaults:ce(i),loading:q,loadingContent:J,emptyContent:V,width:i.width,height:i.height,hasTitle:!!i.title}),be=lt(()=>{let e=X(e=>{let t=e?.[s],i=null!=t&&t+""==c+"";return{fill:M?Se(e,M,ye.colorScale):we,fillOpacity:i?1:.8,stroke:i?"var(--semiotic-text, #222)":"#fff",strokeWidth:i?1.25:1,r:i?1.35*ue:ue}},A,te(M)),t=K(e,{stroke:oe,strokeWidth:re,opacity:ne});return ye.effectiveSelectionHook?ke(t,ye.effectiveSelectionHook,ye.resolvedSelection):t},[M,ye.colorScale,ye.effectiveSelectionHook,ye.resolvedSelection,ue,oe,re,ne,A,c,s]),ve=lt(()=>({center:c,centerAccessor:s,costAccessor:u,strength:d,lineMode:m,layout:se}),[c,s,u,d,m,se]),Me=lt(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof l?l:e=>e[l],i=new Map;for(let e of ge)i.set(e[s]+"",e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(o.source+""),a=i.get(o.target+"");return r&&a?{...o,coordinates:[{[n]:e(r),[l]:t(r)},{[n]:e(a),[l]:t(a)}]}:null}).filter(Boolean)},[r,ge,n,l,s]),Ae=lt(()=>e=>{let t=("function"==typeof u?u:e=>e[u])(e);return yt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[gt("div",{style:{fontWeight:600},children:e[s]||e.name||e.id||"Point"}),null!=t&&yt("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[u,s]),Ce=st(null);G(t,{variant:"geo-points",frameRef:Ce});let[Ne,Re]=ct(null),je=dt(()=>{let e=Ce.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"})},[]);ut(()=>{let e=requestAnimationFrame(je);return()=>cancelAnimationFrame(e)},[je,d,c,i.width,i.height,ge,se]);let Fe=lt(()=>{if(!de||!Ne)return[];let{maxCost:e}=Ne;if(0>=e)return[];if(Array.isArray(de))return de.filter(t=>t>0&&e>=t);let t="number"==typeof de?de:Math.min("strip"===Ne.layout?3:5,Math.max(2,Math.ceil(e/5))),i=e/t,o=[];for(let e=1;t>=e;e++)o.push(Math.round(i*e*10)/10);return o},[de,Ne]),Pe=lt(()=>{if(!Ne)return ie.foregroundGraphics||null;let e=gt(a,{bottomMargin:ye.margin.bottom,costLabel:H,layout:Ne,ringStyle:P,ringValues:Fe,showNorth:he,showRingLabels:me,showRings:de}),t=ie.foregroundGraphics;return"function"==typeof t?i=>yt(ft,{children:[e,t(i)]}):yt(ft,{children:[e,t]})},[Ne,Fe,de,me,he,H,P,ye.margin.bottom,ie.foregroundGraphics]);if(ye.earlyReturn)return ye.earlyReturn;xe("DistanceCartogram",ge,"xAccessor",n),xe("DistanceCartogram",ge,"yAccessor",l);let Le={projection:h,...null!=o&&{points:ge},...Me&&{lines:Me,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:l,pointIdAccessor:s,pointStyle:be,projectionTransform:ve,...S&&{transition:{duration:S}},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...pe&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ye.margin,enableHover:i.enableHover,tooltipContent:!1===R?()=>null:ae(R)||Ae,...ye.legendBehaviorProps,...$({linkedHover:T,selection:D,onObservation:U,onClick:Z,mobileInteraction:ye.mobileInteraction,customHoverBehavior:ye.customHoverBehavior,customClickBehavior:ye.customClickBehavior,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...O&&{className:O},...null!=e.animate&&{animate:e.animate},...ie,foregroundGraphics:Pe};return gt(Q,{componentName:"DistanceCartogram",width:i.width,height:i.height,children:gt(B,{ref:Ce,...Le})})});bt.displayName="DistanceCartogram";import{jsx as vt}from"react/jsx-runtime";var xt=e=>{let t=e.config,i=t.source??"auto",o="areas"===i||"auto"===i&&e.areas.length>0,r=(o?function(e){return e.areas.map((t,i)=>{let o=function(e,t){let i=e.properties&&"object"==typeof e.properties?e.properties:{},o=e.id??i.id??i.name??"area-"+t;return{...i,id:o+""}}(t,i),r=e.scales.geoPath.centroid(t),n=Number.isFinite(r[0])&&Number.isFinite(r[1])?e.scales.invertedPoint(r[0],r[1]):null;return{datum:{...o,gridLongitude:n?.[0],gridLatitude:n?.[1]},x:r[0],y:r[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,i)=>!t.filter||t.filter(e.datum,i)),n=function(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;let i=e.map(e=>({datum:e,x:Number(m(e,t.columnAccessor)),y:Number(m(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return i.length!==e.length?null:i.map(e=>({...e,row:e.y,column:e.x}))}(r.map(e=>e.datum),t),a=o?r:function(e){return e.points.map(t=>{let i=Number(m(t,e.config.longitudeAccessor,["lon","longitude"])),o=Number(m(t,e.config.latitudeAccessor,["lat","latitude"])),r=Number.isFinite(i)&&Number.isFinite(o)?e.scales.projectedPoint(i,o):null;return{datum:t,x:r?.[0]??NaN,y:r?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}({...e,points:r.map(e=>e.datum)}),l=n??d(a,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===l.length)return{nodes:[]};let g=c(l.map(e=>e.row)),y=c(l.map(e=>e.column)),b=Math.max(1,Math.round(g[1]-g[0])+1),v=Math.max(1,Math.round(y[1]-y[0])+1),x=Math.max(0,t.layoutPadding??8),k=Math.max(1,e.dimensions.width-2*x)/v,w=Math.max(1,e.dimensions.height-2*x)/b,S=(e.dimensions.width-k*v)/2,M=(e.dimensions.height-w*b)/2,A=s(t.cellPadding??.12,0,.8),C=Math.max(1,.5*Math.min(k,w)*(1-A)),N=t.sizeAccessor?l.map(e=>Number(m(e.datum,t.sizeAccessor))):[],R=t.sizeDomain??c(N),j=t.sizeRange??[.36,1],F=s(Math.min(j[0],j[1]),.05,1),P=s(Math.max(j[0],j[1]),F,1),L=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=(m(r,t.idAccessor,["id","key","name"])??"grid-"+o)+"",a=(m(r,t.labelAccessor,["abbr","code","label","name","id"])??n)+"",l=Math.max(1,t.maxLabelLength??4),c=a.length>l?a.slice(0,l):a,d=m(r,t.categoryAccessor),h=null==d?void 0:d+"",p=m(r,t.fillAccessor),f=null!=p?p+"":h?e.resolveColor(h):e.theme.categorical[0]??"#4f86c6",b=t.sizeAccessor?Number(m(r,t.sizeAccessor)):NaN,v=t.sizeAccessor&&Number.isFinite(b)?Math.sqrt(s(u(b,R),0,1)):1,x=C*(F+v*(P-F)),A="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:c,category:h,row:i.row,column:i.column,x:S+(i.column-y[0]+.5)*k,y:M+(i.row-g[0]+.5)*w,radius:x,style:{fill:f,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...A}}}),H=t.shape??"circle";return{nodes:L.map(e=>{return"circle"===H?{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"===H?p(e.x,e.y,e.radius):(t=e.x,i=e.y,o=e.radius,h([[t-o,i-o],[t+o,i-o],[t+o,i+o],[t-o,i+o]])),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===H?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0};var t,i,o}),overlays:!1===t.showLabels?null:vt(f,{marks:L,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??s(.23*Math.min(k,w),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}};import{geoBounds as kt,geoContains as wt}from"d3-geo";import{jsx as St}from"react/jsx-runtime";var Mt=new WeakMap,At=new WeakMap,Ct=new WeakMap,Nt=1,Rt=e=>{let t=function(e){let t=Mt.get(e.areas);t||(t=new Map,Mt.set(e.areas,t));let i=function(e){let t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",w(t.featureFilter),w(t.dotFilter),F(e)].join("::")}(e),o=t.get(i);if(o)return o;let r=A(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){let e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(i,r),r}(e),i=e.config,o=i.shape??"circle",r=Math.max(.5,y(i.dotRadius)??t.cellSize*g(i.radiusRatio??.24,.05,.5)),n=i.gridOrigin?.[0]??0,a=i.gridOrigin?.[1]??0;return{nodes:t.dots.map((l,s)=>{let c=n+(l.gridColumn+.5)*t.cellSize,u=a+(l.gridRow+.5)*t.cellSize,d=b(l,i.categoryAccessor),m=b(l,i.fillAccessor),h={fill:null!=m?m+"":null!=d?e.resolveColor(d+""):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof i.markStyle?i.markStyle(l,s):i.markStyle},p=`dot-${l.gridRow}-${l.gridColumn}`;return"circle"===o?{type:"point",x:c,y:u,r:r,style:h,datum:l,interactive:!1,pointId:p,_transitionKey:p}:{type:"geoarea",pathData:"hexagon"===o?H(c,u,r):L(c,u,r),centroid:[c,u],bounds:[[c-r,u-r],[c+r,u+r]],screenArea:"hexagon"===o?3*Math.sqrt(3)*r*r/2:(2*r)**2,style:h,datum:l,group:l.featureId,interactive:!1}}),overlays:i.showOutline?St("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?St("path",{d:r,fill:"none",stroke:i.outlineStyle?.stroke??"currentColor",strokeOpacity:i.outlineStyle?.opacity??i.outlineStyle?.fillOpacity??.22,strokeWidth:i.outlineStyle?.strokeWidth??.7,strokeDasharray:i.outlineStyle?.strokeDasharray,strokeLinecap:i.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},x(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{r as ChoroplethMap,z as DEFAULT_HIT_RADIUS,bt as DistanceCartogram,at as FlowMap,T as GeoCustomChart,J as MultiLineTooltip,Ve as ProportionalSymbolMap,B as StreamGeoFrame,V as Tooltip,Y as TooltipRoot,X as composeStyleRules,W as geoAreaHitTarget,O as geoHitTarget,Rt as geographicDotGridLayout,xt as geographicGridLayout,Re as glyphExtent,je as glyphPlacement,d as gridifyGeographicPoints,Fe as hatchFillId,Pe as hatchPatternDef,D as hitTargetPoint,Le as isHatchFill,te as makeNodeRuleContext,ie as makeRuleValueResolver,oe as markTooltipChrome,re as matchesThreshold,I as mergeData,t as resolveReferenceGeography,ue as resolveResponsiveRules,de as resolveStyleRules,He as resolveSvgFill,me as responsiveRuleMatches,he as ruleMatches,A as sampleGeographicDotGrid};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{useForceLayout as m}from"./c-OFWJBEE5.min.js";import"./c-KM3N7F7R.min.js";import{DEFAULT_HIT_RADIUS as i,networkEdgeHitTarget as r,networkHitTarget as o}from"./c-3BLJEQNG.min.js";import{ChordDiagram as t,CirclePack as c,ForceDirectedGraph as n,NetworkCustomChart as p,OrbitDiagram as s,ProcessSankey as j,SankeyDiagram as G,TreeDiagram as e,Treemap as B,chordLayoutPlugin as V,diagnoseProcessSankeyLayout as W,diagnoseProcessSankeyProps as Q,explainProcessSankeyLayout as S,forceLayoutPlugin as f,formatProcessSankeyIssue as E,hierarchyLayoutPlugin as I,inventoryAtTime as C,orbitLayoutPlugin as H,sankeyLayoutPlugin as M,toProcessSankeyTime as N,validateProcessSankey as R}from"./c-H3DNMTCC.min.js";import"./c-4DTZPSUD.min.js";import"./c-U6ESPM7V.min.js";import"./c-RSVIHIQ4.min.js";import"./c-F5ZB5GJ6.min.js";import{StreamNetworkFrame_default as a,registerLayoutPlugin as F}from"./c-ALYR5LKK.min.js";import"./c-6HRB2L7H.min.js";import"./c-OCI56QF2.min.js";import"./c-5JWCTX3G.min.js";import"./c-54IRWOGM.min.js";import"./c-GSVCN34B.min.js";import"./c-AG7WWVIH.min.js";import{useCustomLayoutSelection as D}from"./c-G36WS6LN.min.js";import"./c-MT3WBK7M.min.js";import"./c-UC5PTTFI.min.js";import"./c-N4G2L7ID.min.js";import"./c-VGW3VG3I.min.js";import"./c-DBQ2V7CH.min.js";import"./c-QSGWX53A.min.js";import"./c-VPZDY5Q4.min.js";import{MultiLineTooltip as K,Tooltip as L,TooltipRoot as T,composeStyleRules as P,makeNodeRuleContext as J,makeRuleValueResolver as O,markTooltipChrome as U,matchesThreshold as k,resolveResponsiveRules as A,resolveStyleRules as X,responsiveRuleMatches as Y,ruleMatches as Z,useSelectionActions as l}from"./c-VN2HG5BS.min.js";import"./c-GR6MOEQC.min.js";import"./c-VRXUB2F2.min.js";import"./c-GGISSW5E.min.js";import"./c-EGR6VYBW.min.js";import"./c-PGKQGGQ2.min.js";import{glyphExtent as u,glyphPlacement as b,hatchFillId as d,hatchPatternDef as h,isHatchFill as w,resolveSvgFill as x}from"./c-QKHMBE2E.min.js";function y(){F("sankey",M),F("force",f),F("chord",V),F("tree",I),F("cluster",I),F("treemap",I),F("circlepack",I),F("partition",I),F("orbit",H)}export{t as ChordDiagram,c as CirclePack,i as DEFAULT_HIT_RADIUS,n as ForceDirectedGraph,K as MultiLineTooltip,p as NetworkCustomChart,s as OrbitDiagram,j as ProcessSankey,G as SankeyDiagram,a as StreamNetworkFrame,L as Tooltip,T as TooltipRoot,e as TreeDiagram,B as Treemap,P as composeStyleRules,W as diagnoseProcessSankeyLayout,Q as diagnoseProcessSankeyProps,S as explainProcessSankeyLayout,E as formatProcessSankeyIssue,u as glyphExtent,b as glyphPlacement,d as hatchFillId,h as hatchPatternDef,C as inventoryAtTime,w as isHatchFill,J as makeNodeRuleContext,O as makeRuleValueResolver,U as markTooltipChrome,k as matchesThreshold,r as networkEdgeHitTarget,o as networkHitTarget,y as registerBuiltInNetworkLayouts,A as resolveResponsiveRules,X as resolveStyleRules,x as resolveSvgFill,Y as responsiveRuleMatches,Z as ruleMatches,N as toProcessSankeyTime,D as useCustomLayoutSelection,m as useForceLayout,l as useSelectionActions,R as validateProcessSankey};
2
+ function m(){J("sankey",D),J("force",Q),J("chord",A),J("tree",W),J("cluster",W),J("treemap",W),J("circlepack",W),J("partition",W),J("orbit",a)}import{useForceLayout as i}from"./c-WH2O53VI.min.js";import"./c-AFBSWT77.min.js";import{DEFAULT_HIT_RADIUS as r,networkEdgeHitTarget as o,networkHitTarget as t}from"./c-HLLFJYTY.min.js";import{ChordDiagram as c,CirclePack as n,ForceDirectedGraph as p,NetworkCustomChart as s,OrbitDiagram as j,ProcessSankey as e,SankeyDiagram as V,TreeDiagram as T,Treemap as f,chordLayoutPlugin as A,diagnoseProcessSankeyLayout as U,diagnoseProcessSankeyProps as C,explainProcessSankeyLayout as K,forceLayoutPlugin as Q,formatProcessSankeyIssue as S,hierarchyLayoutPlugin as W,inventoryAtTime as X,orbitLayoutPlugin as a,sankeyLayoutPlugin as D,toProcessSankeyTime as E,validateProcessSankey as H}from"./c-PP6VY3QU.min.js";import"./c-GXV3C3MO.min.js";import"./c-55BAJ333.min.js";import"./c-D6HAAPTX.min.js";import"./c-KCRJGUHP.min.js";import{StreamNetworkFrame_default as I,registerLayoutPlugin as J}from"./c-TIXX5CAU.min.js";import"./c-MVR3RWF3.min.js";import"./c-V4XMSLC3.min.js";import"./c-HXDKPIKR.min.js";import"./c-4FN7Q6VQ.min.js";import"./c-2N7IU2NY.min.js";import"./c-YLZIV3VS.min.js";import"./c-ITKX3RC5.min.js";import{useCustomLayoutSelection as L}from"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-HYW2XA4Q.min.js";import"./c-VJTDST2R.min.js";import"./c-EUBTECGM.min.js";import{MultiLineTooltip as P,Tooltip as Y,TooltipRoot as M,composeStyleRules as R,makeNodeRuleContext as F,makeRuleValueResolver as N,markTooltipChrome as O,matchesThreshold as B,resolveResponsiveRules as G,resolveStyleRules as k,responsiveRuleMatches as l,ruleMatches as u,useSelectionActions as Z}from"./c-LMGSSD2E.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import{glyphExtent as b,glyphPlacement as d,hatchFillId as h,hatchPatternDef as w,isHatchFill as x,resolveSvgFill as y}from"./c-553QUDKA.min.js";export{c as ChordDiagram,n as CirclePack,r as DEFAULT_HIT_RADIUS,p as ForceDirectedGraph,P as MultiLineTooltip,s as NetworkCustomChart,j as OrbitDiagram,e as ProcessSankey,V as SankeyDiagram,I as StreamNetworkFrame,Y as Tooltip,M as TooltipRoot,T as TreeDiagram,f as Treemap,R as composeStyleRules,U as diagnoseProcessSankeyLayout,C as diagnoseProcessSankeyProps,K as explainProcessSankeyLayout,S as formatProcessSankeyIssue,b as glyphExtent,d as glyphPlacement,h as hatchFillId,w as hatchPatternDef,X as inventoryAtTime,x as isHatchFill,F as makeNodeRuleContext,N as makeRuleValueResolver,O as markTooltipChrome,B as matchesThreshold,o as networkEdgeHitTarget,t as networkHitTarget,m as registerBuiltInNetworkLayouts,G as resolveResponsiveRules,k as resolveStyleRules,y as resolveSvgFill,l as responsiveRuleMatches,u as ruleMatches,E as toProcessSankeyTime,L as useCustomLayoutSelection,i as useForceLayout,Z as useSelectionActions,H as validateProcessSankey};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{DEFAULT_HIT_RADIUS as m,hitTargetPoint as i,hitTargetRect as r}from"./c-3BLJEQNG.min.js";import{BarChart as o,BoxPlot as t,DonutChart as n,DotPlot as p,FunnelChart as s,GaugeChart as c,GroupedBarChart as j,Histogram as G,LikertChart as E,OrdinalCustomChart as V,PieChart as B,RadarChart as I,RidgelinePlot as K,StackedBarChart as S,StreamOrdinalFrame_default as M,SwarmPlot as R,SwimlaneChart as W,ViolinPlot as Q}from"./c-II2EEAJN.min.js";import"./c-SLGMUBUL.min.js";import"./c-U6ESPM7V.min.js";import"./c-RSVIHIQ4.min.js";import"./c-F5ZB5GJ6.min.js";import"./c-3VVKFA4M.min.js";import"./c-G3VYMHKE.min.js";import"./c-SRTBCRVE.min.js";import"./c-RJKEKZOO.min.js";import"./c-F3LIKINL.min.js";import"./c-VGKUEZBC.min.js";import"./c-T6UAIKBH.min.js";import"./c-5JWCTX3G.min.js";import"./c-54IRWOGM.min.js";import"./c-GSVCN34B.min.js";import"./c-AG7WWVIH.min.js";import{useCustomLayoutSelection as U}from"./c-G36WS6LN.min.js";import"./c-MT3WBK7M.min.js";import"./c-UC5PTTFI.min.js";import"./c-VPZDY5Q4.min.js";import{AnnotationLabel as C,MultiLineTooltip as F,Tooltip as H,TooltipRoot as L,composeStyleRules as N,estimateLabelWidth as T,makeNodeRuleContext as f,makeRuleValueResolver as J,makeStyleRuleStyleFn as O,makeXYRuleContext as a,markTooltipChrome as A,matchesThreshold as P,resolveResponsiveRules as Z,resolveStyleRules as e,responsiveRuleMatches as Y,ruleMatches as X}from"./c-VN2HG5BS.min.js";import"./c-GR6MOEQC.min.js";import"./c-VRXUB2F2.min.js";import"./c-GGISSW5E.min.js";import"./c-EGR6VYBW.min.js";import"./c-PGKQGGQ2.min.js";import{createHatchPattern as d,glyphExtent as l,glyphPlacement as x,hatchFillId as D,hatchPatternDef as b,isHatchFill as g,resolveSvgFill as h}from"./c-QKHMBE2E.min.js";export{C as AnnotationLabel,o as BarChart,t as BoxPlot,m as DEFAULT_HIT_RADIUS,n as DonutChart,p as DotPlot,s as FunnelChart,c as GaugeChart,j as GroupedBarChart,G as Histogram,E as LikertChart,F as MultiLineTooltip,V as OrdinalCustomChart,B as PieChart,I as RadarChart,K as RidgelinePlot,S as StackedBarChart,M as StreamOrdinalFrame,R as SwarmPlot,W as SwimlaneChart,H as Tooltip,L as TooltipRoot,Q as ViolinPlot,N as composeStyleRules,d as createHatchPattern,T as estimateLabelWidth,l as glyphExtent,x as glyphPlacement,D as hatchFillId,b as hatchPatternDef,i as hitTargetPoint,r as hitTargetRect,g as isHatchFill,f as makeNodeRuleContext,J as makeRuleValueResolver,O as makeStyleRuleStyleFn,a as makeXYRuleContext,A as markTooltipChrome,P as matchesThreshold,Z as resolveResponsiveRules,e as resolveStyleRules,h as resolveSvgFill,Y as responsiveRuleMatches,X as ruleMatches,U as useCustomLayoutSelection};
2
+ import{DEFAULT_HIT_RADIUS as m,hitTargetPoint as i,hitTargetRect as r}from"./c-HLLFJYTY.min.js";import{BarChart as o,BoxPlot as t,DonutChart as n,DotPlot as p,FunnelChart as s,GaugeChart as c,GroupedBarChart as j,Histogram as K,LikertChart as E,OrdinalCustomChart as T,PieChart as C,RadarChart as D,RidgelinePlot as Q,StackedBarChart as G,StreamOrdinalFrame_default as N,SwarmPlot as O,SwimlaneChart as R,ViolinPlot as U}from"./c-DY2676CR.min.js";import"./c-GNTXRXRN.min.js";import"./c-55BAJ333.min.js";import"./c-D6HAAPTX.min.js";import"./c-KCRJGUHP.min.js";import"./c-DE5Q3U2X.min.js";import"./c-DK662R77.min.js";import"./c-ROEHCIGV.min.js";import"./c-AVO3Q7T7.min.js";import"./c-BNG5ECK5.min.js";import"./c-TKG2NP7G.min.js";import"./c-OO5QLMJC.min.js";import"./c-HXDKPIKR.min.js";import"./c-4FN7Q6VQ.min.js";import"./c-2N7IU2NY.min.js";import"./c-YLZIV3VS.min.js";import"./c-ITKX3RC5.min.js";import{useCustomLayoutSelection as V}from"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-EUBTECGM.min.js";import{AnnotationLabel as A,MultiLineTooltip as J,Tooltip as L,TooltipRoot as H,composeStyleRules as I,estimateLabelWidth as P,makeNodeRuleContext as X,makeRuleValueResolver as Y,makeStyleRuleStyleFn as f,makeXYRuleContext as S,markTooltipChrome as a,matchesThreshold as B,resolveResponsiveRules as M,resolveStyleRules as W,responsiveRuleMatches as e,ruleMatches as F}from"./c-LMGSSD2E.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import{createHatchPattern as Z,glyphExtent as d,glyphPlacement as l,hatchFillId as x,hatchPatternDef as b,isHatchFill as g,resolveSvgFill as h}from"./c-553QUDKA.min.js";export{A as AnnotationLabel,o as BarChart,t as BoxPlot,m as DEFAULT_HIT_RADIUS,n as DonutChart,p as DotPlot,s as FunnelChart,c as GaugeChart,j as GroupedBarChart,K as Histogram,E as LikertChart,J as MultiLineTooltip,T as OrdinalCustomChart,C as PieChart,D as RadarChart,Q as RidgelinePlot,G as StackedBarChart,N as StreamOrdinalFrame,O as SwarmPlot,R as SwimlaneChart,L as Tooltip,H as TooltipRoot,U as ViolinPlot,I as composeStyleRules,Z as createHatchPattern,P as estimateLabelWidth,d as glyphExtent,l as glyphPlacement,x as hatchFillId,b as hatchPatternDef,i as hitTargetPoint,r as hitTargetRect,g as isHatchFill,X as makeNodeRuleContext,Y as makeRuleValueResolver,f as makeStyleRuleStyleFn,S as makeXYRuleContext,a as markTooltipChrome,B as matchesThreshold,M as resolveResponsiveRules,W as resolveStyleRules,h as resolveSvgFill,e as responsiveRuleMatches,F as ruleMatches,V as useCustomLayoutSelection};
@@ -1 +1 @@
1
- var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,a={};((e,n)=>{for(var i in n)t(e,i,{get:n[i],enumerable:!0})})(a,{MATTER_PHYSICS_CAPABILITIES:()=>m,MATTER_PHYSICS_IMPORT_PATH:()=>l,MATTER_PHYSICS_INSTALL:()=>y,MATTER_PHYSICS_PACKAGE:()=>u,PhysicsOptionalEngineDependencyError:()=>o,loadMatterPhysicsPeer:()=>S,loadOptionalPhysicsPeer:()=>c,matterBodiesToPhysicsColliders:()=>T,matterBodiesToPhysicsSpawns:()=>b,matterBodyToPhysicsBodySpec:()=>f,matterBodyToPhysicsColliderSpec:()=>g,matterPhysicsDependencyError:()=>E,optionalEngineDependencyError:()=>s}),module.exports=(e=a,((e,a,o,s)=>{if(a)for(let o of i(a))r.call(e,o)||void 0===o||t(e,o,{get:()=>a[o],enumerable:!(s=n(a,o))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o=class extends Error{constructor(e,t){super(`${e.engine} is an optional Semiotic physics engine. Install ${e.packageName} to use ${e.importPath}: ${e.installCommand}`),this.name="PhysicsOptionalEngineDependencyError",this.details=e,t&&(this.cause=t)}};function s(e,t){return new o(e,t)}async function c(e){try{return await import(e.packageName)}catch(t){throw s(e,t)}}var u="matter-js",l="semiotic/physics/matter",m={engine:"matter-js",determinism:"tolerance",sensors:!0,joints:!0,ccd:!1,maxBodiesHint:5e3,worker:!1},y={engine:"Matter.js",importPath:l,packageName:u,installCommand:"npm install "+u};function d(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function p(e,t,n){const i=e.plugin?.id;return(i??e.label??e.id??`${n}-${t}`)+""}function h(e,t){const n=d(e.circleRadius);if(null!=n&&n>0)return{type:"circle",radius:n};const i=e.bounds;return i?{type:"aabb",width:Math.max(1,i.max.x-i.min.x),height:Math.max(1,i.max.y-i.min.y)}:{type:"circle",radius:t}}function x(e,t){const n=e.position??{x:0,y:0},i=d(e.circleRadius);if(null!=i&&i>0)return{type:"aabb",x:n.x,y:n.y,width:2*i,height:2*i};const r=e.bounds;return r?{type:"aabb",x:(r.min.x+r.max.x)/2,y:(r.min.y+r.max.y)/2,width:Math.max(1,r.max.x-r.min.x),height:Math.max(1,r.max.y-r.min.y)}:{type:"aabb",x:n.x,y:n.y,width:2*t,height:2*t}}function P(e,t){return t?e.plugin?.[t]:e.plugin}function f(e,t=0,n={}){const i=n.fallbackRadius??4,r=e.position??{x:0,y:0},a=e.velocity??{x:0,y:0};return{id:p(e,t,n.idPrefix??"matter-body"),x:r.x,y:r.y,vx:a.x,vy:a.y,angle:e.angle,mass:d(e.mass)??1,shape:h(e,i),datum:P(e,n.datumFromPlugin)}}function g(e,t=0,n={}){const i=n.fallbackRadius??4;return{id:p(e,t,n.idPrefix??"matter-collider"),sensor:!!e.isSensor,shape:x(e,i)}}function b(e,t={}){return e.map((e,n)=>f(e,n,t))}function T(e,t={}){return e.map((e,n)=>g(e,n,t))}async function S(){const e=await c(y);return e.default??e}function E(e){return s(y,e)}
1
+ function e(e,t){return new g(e,t)}async function t(t){try{return await(import(t.packageName))}catch(n){throw e(t,n)}}function n(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function i(e,t,n){const i=e.plugin?.id;return(i??e.label??e.id??`${n}-${t}`)+""}function r(e,t){const i=n(e.circleRadius);if(null!=i&&i>0)return{type:"circle",radius:i};const r=e.bounds;return r?{type:"aabb",width:Math.max(1,r.max.x-r.min.x),height:Math.max(1,r.max.y-r.min.y)}:{type:"circle",radius:t}}function a(e,t){const i=e.position??{x:0,y:0},r=n(e.circleRadius);if(null!=r&&r>0)return{type:"aabb",x:i.x,y:i.y,width:2*r,height:2*r};const a=e.bounds;return a?{type:"aabb",x:(a.min.x+a.max.x)/2,y:(a.min.y+a.max.y)/2,width:Math.max(1,a.max.x-a.min.x),height:Math.max(1,a.max.y-a.min.y)}:{type:"aabb",x:i.x,y:i.y,width:2*t,height:2*t}}function o(e,t){return t?e.plugin?.[t]:e.plugin}function s(e,t=0,a={}){const s=a.fallbackRadius??4,c=e.position??{x:0,y:0},u=e.velocity??{x:0,y:0};return{id:i(e,t,a.idPrefix??"matter-body"),x:c.x,y:c.y,vx:u.x,vy:u.y,angle:e.angle,mass:n(e.mass)??1,shape:r(e,s),datum:o(e,a.datumFromPlugin)}}function c(e,t=0,n={}){const r=n.fallbackRadius??4;return{id:i(e,t,n.idPrefix??"matter-collider"),sensor:!!e.isSensor,shape:a(e,r)}}function u(e,t={}){return e.map((e,n)=>s(e,n,t))}function l(e,t={}){return e.map((e,n)=>c(e,n,t))}async function m(){const e=await t(E);return e.default??e}function y(t){return e(E,t)}var d,p=Object.defineProperty,h=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,P=Object.prototype.hasOwnProperty,f={};((e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})})(f,{MATTER_PHYSICS_CAPABILITIES:()=>S,MATTER_PHYSICS_IMPORT_PATH:()=>T,MATTER_PHYSICS_INSTALL:()=>E,MATTER_PHYSICS_PACKAGE:()=>b,PhysicsOptionalEngineDependencyError:()=>g,loadMatterPhysicsPeer:()=>m,loadOptionalPhysicsPeer:()=>t,matterBodiesToPhysicsColliders:()=>l,matterBodiesToPhysicsSpawns:()=>u,matterBodyToPhysicsBodySpec:()=>s,matterBodyToPhysicsColliderSpec:()=>c,matterPhysicsDependencyError:()=>y,optionalEngineDependencyError:()=>e}),module.exports=(d=f,((e,t,n,i)=>{if(t)for(let n of x(t))P.call(e,n)||void 0===n||p(e,n,{get:()=>t[n],enumerable:!(i=h(t,n))||i.enumerable});return e})(p({},"__esModule",{value:!0}),d));var g=class extends Error{constructor(e,t){super(`${e.engine} is an optional Semiotic physics engine. Install ${e.packageName} to use ${e.importPath}: ${e.installCommand}`),this.name="PhysicsOptionalEngineDependencyError",this.details=e,t&&(this.cause=t)}},b="matter-js",T="semiotic/physics/matter",S={engine:"matter-js",determinism:"tolerance",sensors:!0,joints:!0,ccd:!1,maxBodiesHint:5e3,worker:!1},E={engine:"Matter.js",importPath:T,packageName:b,installCommand:"npm install "+b};
@@ -1 +1 @@
1
- import{PhysicsOptionalEngineDependencyError as t,loadOptionalPhysicsPeer as n,optionalEngineDependencyError as i}from"./c-S6U5CGT5.min.js";var e="matter-js",a="semiotic/physics/matter",r={engine:"matter-js",determinism:"tolerance",sensors:!0,joints:!0,ccd:!1,maxBodiesHint:5e3,worker:!1},s={engine:"Matter.js",importPath:a,packageName:e,installCommand:"npm install "+e};function u(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function o(t,n,i){const e=t.plugin?.id;return(e??t.label??t.id??`${i}-${n}`)+""}function m(t,n){const i=u(t.circleRadius);if(null!=i&&i>0)return{type:"circle",radius:i};const e=t.bounds;return e?{type:"aabb",width:Math.max(1,e.max.x-e.min.x),height:Math.max(1,e.max.y-e.min.y)}:{type:"circle",radius:n}}function c(t,n){const i=t.position??{x:0,y:0},e=u(t.circleRadius);if(null!=e&&e>0)return{type:"aabb",x:i.x,y:i.y,width:2*e,height:2*e};const a=t.bounds;return a?{type:"aabb",x:(a.min.x+a.max.x)/2,y:(a.min.y+a.max.y)/2,width:Math.max(1,a.max.x-a.min.x),height:Math.max(1,a.max.y-a.min.y)}:{type:"aabb",x:i.x,y:i.y,width:2*n,height:2*n}}function x(t,n){return n?t.plugin?.[n]:t.plugin}function l(t,n=0,i={}){const e=i.fallbackRadius??4,a=t.position??{x:0,y:0},r=t.velocity??{x:0,y:0};return{id:o(t,n,i.idPrefix??"matter-body"),x:a.x,y:a.y,vx:r.x,vy:r.y,angle:t.angle,mass:u(t.mass)??1,shape:m(t,e),datum:x(t,i.datumFromPlugin)}}function y(t,n=0,i={}){const e=i.fallbackRadius??4;return{id:o(t,n,i.idPrefix??"matter-collider"),sensor:!!t.isSensor,shape:c(t,e)}}function d(t,n={}){return t.map((t,i)=>l(t,i,n))}function p(t,n={}){return t.map((t,i)=>y(t,i,n))}async function f(){const t=await n(s);return t.default??t}function h(t){return i(s,t)}export{r as MATTER_PHYSICS_CAPABILITIES,a as MATTER_PHYSICS_IMPORT_PATH,s as MATTER_PHYSICS_INSTALL,e as MATTER_PHYSICS_PACKAGE,t as PhysicsOptionalEngineDependencyError,f as loadMatterPhysicsPeer,n as loadOptionalPhysicsPeer,p as matterBodiesToPhysicsColliders,d as matterBodiesToPhysicsSpawns,l as matterBodyToPhysicsBodySpec,y as matterBodyToPhysicsColliderSpec,h as matterPhysicsDependencyError,i as optionalEngineDependencyError};
1
+ function t(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function i(t,i,e){let n=t.plugin?.id;return(n??t.label??t.id??`${e}-${i}`)+""}function e(i,e){let n=t(i.circleRadius);if(null!=n&&n>0)return{type:"circle",radius:n};let a=i.bounds;return a?{type:"aabb",width:Math.max(1,a.max.x-a.min.x),height:Math.max(1,a.max.y-a.min.y)}:{type:"circle",radius:e}}function n(i,e){let n=i.position??{x:0,y:0},a=t(i.circleRadius);if(null!=a&&a>0)return{type:"aabb",x:n.x,y:n.y,width:2*a,height:2*a};let r=i.bounds;return r?{type:"aabb",x:(r.min.x+r.max.x)/2,y:(r.min.y+r.max.y)/2,width:Math.max(1,r.max.x-r.min.x),height:Math.max(1,r.max.y-r.min.y)}:{type:"aabb",x:n.x,y:n.y,width:2*e,height:2*e}}function a(t,i){return i?t.plugin?.[i]:t.plugin}function r(n,r=0,u={}){let m=u.fallbackRadius??4,l=n.position??{x:0,y:0},s=n.velocity??{x:0,y:0};return{id:i(n,r,u.idPrefix??"matter-body"),x:l.x,y:l.y,vx:s.x,vy:s.y,angle:n.angle,mass:t(n.mass)??1,shape:e(n,m),datum:a(n,u.datumFromPlugin)}}function u(t,e=0,a={}){let r=a.fallbackRadius??4;return{id:i(t,e,a.idPrefix??"matter-collider"),sensor:!!t.isSensor,shape:n(t,r)}}function m(t,i={}){return t.map((t,e)=>r(t,e,i))}function l(t,i={}){return t.map((t,e)=>u(t,e,i))}async function s(){let t=await c(h);return t.default??t}function o(t){return y(h,t)}import{PhysicsOptionalEngineDependencyError as x,loadOptionalPhysicsPeer as c,optionalEngineDependencyError as y}from"./c-E7I2L7CU.min.js";var d="matter-js",p="semiotic/physics/matter",f={engine:"matter-js",determinism:"tolerance",sensors:!0,joints:!0,ccd:!1,maxBodiesHint:5e3,worker:!1},h={engine:"Matter.js",importPath:p,packageName:d,installCommand:"npm install "+d};export{f as MATTER_PHYSICS_CAPABILITIES,p as MATTER_PHYSICS_IMPORT_PATH,h as MATTER_PHYSICS_INSTALL,d as MATTER_PHYSICS_PACKAGE,x as PhysicsOptionalEngineDependencyError,s as loadMatterPhysicsPeer,c as loadOptionalPhysicsPeer,l as matterBodiesToPhysicsColliders,m as matterBodiesToPhysicsSpawns,r as matterBodyToPhysicsBodySpec,u as matterBodyToPhysicsColliderSpec,o as matterPhysicsDependencyError,y as optionalEngineDependencyError};
@@ -1 +1 @@
1
- var e,r=Object.defineProperty,t=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,n={};((e,t)=>{for(var a in t)r(e,a,{get:t[a],enumerable:!0})})(n,{PhysicsOptionalEngineDependencyError:()=>o,RAPIER_PHYSICS_CAPABILITIES:()=>m,RAPIER_PHYSICS_ENGINE_DECISION:()=>d,RAPIER_PHYSICS_IMPORT_PATH:()=>l,RAPIER_PHYSICS_INSTALL:()=>P,RAPIER_PHYSICS_PACKAGE:()=>p,loadOptionalPhysicsPeer:()=>c,loadRapierPhysicsPeer:()=>u,optionalEngineDependencyError:()=>s,rapierPhysicsDependencyError:()=>h}),module.exports=(e=n,((e,n,o,s)=>{if(n)for(let o of a(n))i.call(e,o)||void 0===o||r(e,o,{get:()=>n[o],enumerable:!(s=t(n,o))||s.enumerable});return e})(r({},"__esModule",{value:!0}),e));var o=class extends Error{constructor(e,r){super(`${e.engine} is an optional Semiotic physics engine. Install ${e.packageName} to use ${e.importPath}: ${e.installCommand}`),this.name="PhysicsOptionalEngineDependencyError",this.details=e,r&&(this.cause=r)}};function s(e,r){return new o(e,r)}async function c(e){try{return await import(e.packageName)}catch(r){throw s(e,r)}}var p="@dimforge/rapier2d-compat",l="semiotic/physics/rapier",d={selectedPackage:p,rejectedPackage:"@dimforge/rapier2d-deterministic",determinism:"tolerance",reason:"Use @dimforge/rapier2d-compat for the optional browser adapter path because it is the maintained npm/WASM package with standard bundler behavior. Treat Rapier visual/position conformance as tolerance-classed; keep the built-in kernel as the strict deterministic default."},m={engine:"rapier2d-compat",determinism:"tolerance",sensors:!0,joints:!0,ccd:!0,maxBodiesHint:2e4,worker:!0},P={engine:"Rapier 2D",importPath:l,packageName:p,installCommand:"npm install "+p};async function u(){const e=await c(P),r=e.default??e;return await(r.init?.()),r}function h(e){return s(P,e)}
1
+ function e(e,r){return new l(e,r)}async function r(r){try{return await(import(r.packageName))}catch(t){throw e(r,t)}}async function t(){const e=await r(h),t=e.default??e;return await(t.init?.()),t}function a(r){return e(h,r)}var i,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,p={};((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})})(p,{PhysicsOptionalEngineDependencyError:()=>l,RAPIER_PHYSICS_CAPABILITIES:()=>u,RAPIER_PHYSICS_ENGINE_DECISION:()=>P,RAPIER_PHYSICS_IMPORT_PATH:()=>m,RAPIER_PHYSICS_INSTALL:()=>h,RAPIER_PHYSICS_PACKAGE:()=>d,loadOptionalPhysicsPeer:()=>r,loadRapierPhysicsPeer:()=>t,optionalEngineDependencyError:()=>e,rapierPhysicsDependencyError:()=>a}),module.exports=(i=p,((e,r,t,a)=>{if(r)for(let t of s(r))c.call(e,t)||void 0===t||n(e,t,{get:()=>r[t],enumerable:!(a=o(r,t))||a.enumerable});return e})(n({},"__esModule",{value:!0}),i));var l=class extends Error{constructor(e,r){super(`${e.engine} is an optional Semiotic physics engine. Install ${e.packageName} to use ${e.importPath}: ${e.installCommand}`),this.name="PhysicsOptionalEngineDependencyError",this.details=e,r&&(this.cause=r)}},d="@dimforge/rapier2d-compat",m="semiotic/physics/rapier",P={selectedPackage:d,rejectedPackage:"@dimforge/rapier2d-deterministic",determinism:"tolerance",reason:"Use @dimforge/rapier2d-compat for the optional browser adapter path because it is the maintained npm/WASM package with standard bundler behavior. Treat Rapier visual/position conformance as tolerance-classed; keep the built-in kernel as the strict deterministic default."},u={engine:"rapier2d-compat",determinism:"tolerance",sensors:!0,joints:!0,ccd:!0,maxBodiesHint:2e4,worker:!0},h={engine:"Rapier 2D",importPath:m,packageName:d,installCommand:"npm install "+d};
@@ -1 +1 @@
1
- import{PhysicsOptionalEngineDependencyError as e,loadOptionalPhysicsPeer as a,optionalEngineDependencyError as i}from"./c-S6U5CGT5.min.js";var t="@dimforge/rapier2d-compat",r="semiotic/physics/rapier",n={selectedPackage:t,rejectedPackage:"@dimforge/rapier2d-deterministic",determinism:"tolerance",reason:"Use @dimforge/rapier2d-compat for the optional browser adapter path because it is the maintained npm/WASM package with standard bundler behavior. Treat Rapier visual/position conformance as tolerance-classed; keep the built-in kernel as the strict deterministic default."},o={engine:"rapier2d-compat",determinism:"tolerance",sensors:!0,joints:!0,ccd:!0,maxBodiesHint:2e4,worker:!0},s={engine:"Rapier 2D",importPath:r,packageName:t,installCommand:"npm install "+t};async function c(){const e=await a(s),i=e.default??e;return await(i.init?.()),i}function m(e){return i(s,e)}export{e as PhysicsOptionalEngineDependencyError,o as RAPIER_PHYSICS_CAPABILITIES,n as RAPIER_PHYSICS_ENGINE_DECISION,r as RAPIER_PHYSICS_IMPORT_PATH,s as RAPIER_PHYSICS_INSTALL,t as RAPIER_PHYSICS_PACKAGE,a as loadOptionalPhysicsPeer,c as loadRapierPhysicsPeer,i as optionalEngineDependencyError,m as rapierPhysicsDependencyError};
1
+ async function e(){let e=await t(m),a=e.default??e;return await(a.init?.()),a}function a(e){return r(m,e)}import{PhysicsOptionalEngineDependencyError as i,loadOptionalPhysicsPeer as t,optionalEngineDependencyError as r}from"./c-E7I2L7CU.min.js";var n="@dimforge/rapier2d-compat",o="semiotic/physics/rapier",s={selectedPackage:n,rejectedPackage:"@dimforge/rapier2d-deterministic",determinism:"tolerance",reason:"Use @dimforge/rapier2d-compat for the optional browser adapter path because it is the maintained npm/WASM package with standard bundler behavior. Treat Rapier visual/position conformance as tolerance-classed; keep the built-in kernel as the strict deterministic default."},c={engine:"rapier2d-compat",determinism:"tolerance",sensors:!0,joints:!0,ccd:!0,maxBodiesHint:2e4,worker:!0},m={engine:"Rapier 2D",importPath:o,packageName:n,installCommand:"npm install "+n};export{i as PhysicsOptionalEngineDependencyError,c as RAPIER_PHYSICS_CAPABILITIES,s as RAPIER_PHYSICS_ENGINE_DECISION,o as RAPIER_PHYSICS_IMPORT_PATH,m as RAPIER_PHYSICS_INSTALL,n as RAPIER_PHYSICS_PACKAGE,t as loadOptionalPhysicsPeer,e as loadRapierPhysicsPeer,r as optionalEngineDependencyError,a as rapierPhysicsDependencyError};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{BuiltInPhysicsEngineAdapter as e,ChainReactionChart as t,CollisionSwarmChart as n,CrucibleChart as i,DEFAULT_CRUCIBLE_HEIGHT as o,DEFAULT_CRUCIBLE_OUTLETS as r,DEFAULT_CRUCIBLE_SIZE as s,DEFAULT_CRUCIBLE_WIDTH as a,EventDropChart as l,GaltonBoardChart as c,GauntletChart as u,GuantletChart as d,PacketFlowChart as p,PhysicalFlowChart as h,PhysicsCustomChart as m,PhysicsPileChart as f,PhysicsPipelineStore as g,PhysicsSVGOverlay as y,PhysicsSedimentAccumulator as b,ProcessFlowChart as x,StreamPhysicsFrame as w,StreamPhysicsFrame_default as v,UnitPileChart as I,absorbRegion as A,aggregateRegionCounts as M,applyCrucibleEvent as S,applyGauntletEffect as E,bodiesToAnnotationAnchors as j,bodyGroupSpec as P,buildCollisionSwarmPhysics as k,buildCrucibleEvidence as R,buildCrucibleInitialSpawns as B,buildCrucibleLayout as N,buildCruciblePhysicsConfig as Y,buildCrucibleProductEvents as $,buildCrucibleProjection as F,buildCrucibleStateSpawns as C,buildCrucibleTerminalSpawns as D,buildEventDropPhysics as O,buildGaltonBoardPhysics as q,buildPhysicalFlowPhysics as T,buildPhysicsAnnotationContext as G,buildPhysicsPile as W,buildProcessFlowPhysics as X,calculateBlockerAmplification as V,capacitatedRegion as z,chargeGateRegion as Q,cloneCrucibleState as L,collidersFromPlotBounds as H,collidersFromXScaleBins as K,compileCruciblePlan as U,compileDependencyMachine as _,composePhysicsControllers as J,createCapacityQueueController as Z,createDefaultPhysicsEngineAdapter as ee,createInitialCrucibleState as te,createLogicalJoin as ne,createPortalController as ie,crucibleBondId as oe,crucibleBoundaryColliders as re,crucibleComponentBodyId as se,crucibleProductBodyId as ae,crucibleProjectionRows as le,crucibleSemanticKey as ce,defaultViability as ue,evaluateCrucibleConservation as de,evaluatePhysicsBodyBudget as pe,eventLogItem as he,forceFieldRegion as me,groupCompletionRows as fe,matchesPhysicsBodyFilter as ge,membraneRegion as ye,normalizePhysicsAnnotations as be,physicsProcessBoundaryColliders as xe,physicsProcessGroupSemanticItems as we,physicsProcessRegionSemanticItem as ve,physicsProcessStageSemanticItems as Ie,planGauntletPropertyWork as Ae,portalRegion as Me,pressureFieldRegion as Se,processChrome as Ee,processLaneWalls as je,processStageLayout as Pe,processStageRegions as ke,recordGauntletEvent as Re,regionCountsToProjectionRows as Be,replaceGauntletNegative as Ne,replayCruciblePlan as Ye,replayStateTransitions as $e,resolveCrucibleSelector as Fe,resolveCrucibleSnapshotAt as Ce,resolveCrucibleTime as De,routeDependencyTracks as Oe,routeSurfaceRegion as qe,sedimentHeightfield as Te,valueAtPath as Ge}from"./c-ECJCKLYY.min.js";import{mulberry32 as We}from"./c-N4G2L7ID.min.js";import"./c-VGW3VG3I.min.js";import"./c-DBQ2V7CH.min.js";import"./c-QSGWX53A.min.js";import"./c-VPZDY5Q4.min.js";import{MultiLineTooltip as Xe,Tooltip as Ve,TooltipRoot as ze,compileMotionEncoding as Qe,composeStyleRules as Le,deriveMotionVector as He,makeRuleValueResolver as Ke,markTooltipChrome as Ue,matchesThreshold as _e,opacityFromAge as Je,resolveMotionAccessor as Ze,resolveMotionAge as et,resolveMotionVector as tt,resolveStyleRules as nt,ruleMatches as it}from"./c-VN2HG5BS.min.js";import"./c-GR6MOEQC.min.js";import"./c-VRXUB2F2.min.js";import"./c-GGISSW5E.min.js";import"./c-EGR6VYBW.min.js";import"./c-PGKQGGQ2.min.js";import{hatchFillId as ot,hatchPatternDef as rt,isHatchFill as st,resolveSvgFill as at}from"./c-QKHMBE2E.min.js";function lt(e){const{data:t,encoding:n,defaults:i={},scales:o}=e,r=Qe({data:t,encoding:n}),s=[],a=new Map,l=[],c=[],u=new Map;return r.rows.forEach((e,t)=>{const{id:r,datum:d}=e,p=Math.max(0,Ze(n.appearance?.size,d,t)??i.size??6),h=Ze(n.appearance?.shape,d,t)??i.shape??{type:"circle",radius:p},m=e.placement.x??i.x??0,f=e.placement.y??i.y??0,g=o?.x?o.x(m):m,y=o?.y?o.y(f):f,b=Ze(n.appearance?.color,d,t)??i.color,x=Ze(n.appearance?.opacity,d,t)??i.opacity,w=Ze(n.appearance?.stroke,d,t)??i.stroke,v=Ze(n.appearance?.strokeWidth,d,t)??i.strokeWidth,I=Ze(n.time?.spawnAt,d,t)??e.time.arrival,A=e.kinematics.velocityX,M=e.kinematics.velocityY,S=Ze(n.dynamics?.mass,d,t)??i.mass??1,E=Ze(n.dynamics?.friction,d,t),j=Ze(n.dynamics?.restitution,d,t),P=Ze(n.dynamics?.bodyCollisions,d,t),k={id:r,x:g,y:y,mass:S,shape:{...h},datum:d,...null!=I&&{spawnAt:I},...null!=A&&{vx:A},...null!=M&&{vy:M},...null!=E&&{friction:E},...null!=j&&{restitution:j},...null!=P&&{bodyCollisions:P}},R={...null!=b&&{fill:b},...null!=x&&{opacity:x},...null!=w&&{stroke:w},...null!=v&&{strokeWidth:v}},B={id:r,datum:d,appearance:{color:b,opacity:x,shape:h,size:p,stroke:w,strokeWidth:v},placement:{x:g,y:y,lane:e.placement.lane,space:n.placement?.space??"world"},time:{arrival:I,spawnAt:I,basis:n.time?.basis??"simulation",unit:n.time?.unit},kinematics:{velocityX:A,velocityY:M,space:n.kinematics?.space??"world"},dynamics:{bodyCollisions:P,friction:E,mass:S,restitution:j},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:k};s.push(B),a.set(r,B),l.push(k),u.set(r,R),c.push({id:r,bodyId:r,label:e.accessible.label,description:e.accessible.description,datum:d,x:g,y:y,group:e.accessible.group})}),{rows:s,byId:a,spawns:l,semanticItems:c,bodyStyle:e=>u.get(e.id)??{}}}function ct(e){return t=>{const n=lt({data:t.data,encoding:e.encoding,defaults:e.defaults,scales:t.scales}),i=e.extend?.(t,n)??{};return{...i,initialSpawns:n.spawns,bodyStyle:n.bodyStyle,semanticItems:[...n.semanticItems,...i.semanticItems??[]]}}}function ut(e,t){const{layout:n,positiveProperties:i,negativeProperties:o,viability:r,outcome:s}=t,a=function(e){return new Map(e.gates.map(e=>[e.id,e]))}(n),l=[...("function"==typeof t.events?t.events(e,n):t.events)??[]].sort((e,t)=>e.time-t.time);let c=e;for(const e of l){const t=e.gateId?a.get(e.gateId):void 0,l=e.effects??[],u={...he(e,l),appliedAt:e.time},d=Re(c,u);if(d!==c){c=d;for(const n of l){const r={event:e,gate:t,negativeProperties:o,positiveProperties:i,project:c};n.when&&!n.when(r)||(c=E(c,n,r))}c={...c,viability:r?.(c,{negativeProperties:o,positiveProperties:i})??ue(c,i,o)},e.final&&(c={...c,outcome:e.outcome??s?.(c,{layout:n,negativeProperties:o,positiveProperties:i})??(c.viability>20?"built":"approved_not_built")})}}return c}function dt(e){return e.projects.map(t=>ut(t,e))}function pt(e){const t=e.resources.map(e=>({...e,bodyId:e.bodyId??e.id})),n=new Map(t.map(e=>[e.bodyId,e])),i=new Map,o=new Map,r=e.assignmentForce??.45,s=e.returnForce??.35,a=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0};let c=new Map,u=0,d=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{const n=i.get(e);if(n)return n;const r=t.find(e=>!o.has(e.id));if(!r)return null;const s={resourceId:r.id,resourceBodyId:r.bodyId,caseBodyId:e,assignedAt:u};return i.set(e,s),o.set(r.id,s),d+=1,s},release:e=>{const t=i.get(e);return!!t&&(i.delete(e),o.delete(t.resourceId),d+=1,!0)},getAssignment:e=>i.get(e),tick:e=>{u=Math.max(u,e.elapsed),c=new Map(e.controls.readBodies().map(e=>[e.id,e]));for(const[e,t]of i)c.has(e)&&c.has(t.resourceBodyId)||(i.delete(e),o.delete(t.resourceId),d+=1)},getSnapshot:()=>({total:t.length,available:t.length-o.size,assigned:o.size,assignments:Array.from(i.values()),simulatedAt:u,metricRevision:d}),bodyForce:e=>{const t=n.get(e.body.id);if(t){const n=o.get(t.id),i=n?c.get(n.caseBodyId):void 0,a=n?r:s;return{x:((i?i.x+(l.x??0):t.home.x)-e.body.x)*a,y:((i?i.y+(l.y??0):t.home.y)-e.body.y)*a}}const u=i.get(e.body.id);if(!u||0>=a)return null;const d=c.get(u.resourceBodyId);return d?{x:(d.x-e.body.x)*a,y:(d.y-e.body.y)*a}:null}}}function ht(e,t){const n="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):Ge(e.datum,t.deadlineAccessor)??Ge(e,t.deadlineAccessor);return Number.isFinite(Number(n))?Math.max(0,Number(n)):0}function mt(e){const t=new Map;let n=0,i=0;function o(n){t.set(n.bodyId,n),i+=1,e.onStateChange?.({...n})}function r(e){const i=t.get(e);return!(!i||null!=i.completedAt||(o({...i,completedAt:n,state:"unhappy"===i.state?"resolved-unhappy":"resolved"}),0))}return{id:e.id??"service-level",continuous:!0,protect:e=>{const i=t.get(e);return!(!i||null!=i.completedAt||"unhappy"===i.state||(o({...i,state:"protected",protectedAt:n}),0))},complete:r,getCase:e=>t.get(e),tick:i=>{n=Math.max(n,i.elapsed);for(const s of i.controls.readBodies()){if(!ge(s,e.bodyFilter))continue;if(!t.has(s.id)){const t=ht(s,e);o({bodyId:s.id,openedAt:n,deadlineAt:n+t,state:"waiting"})}const a=t.get(s.id);a&&null==a.completedAt&&(e.completionRegionId&&i.getRegionState(s.id)?.activeRegionIds.includes(e.completionRegionId)?r(s.id):"waiting"!==a.state||a.deadlineAt>n||o({...a,state:"unhappy"}))}},getSnapshot:()=>{const e=Array.from(t.values()),o=t=>e.filter(e=>e.state===t).length;return{total:e.length,waiting:o("waiting"),protected:o("protected"),unhappy:o("unhappy"),resolved:o("resolved"),resolvedUnhappy:o("resolved-unhappy"),simulatedAt:n,metricRevision:i}}}}function ft(e){const t=new Set;let n=0,i=0,o=0,r=!1;return{id:e.id??"dependency-gate:"+e.regionId,continuous:!0,tick:s=>{n=Math.max(n,s.elapsed);const a=r;var l;l=n,r=e.isOpen?e.isOpen(l):null!=e.opensAt&&l>=e.opensAt;const c=s.controls.readBodies(),u=new Map(c.map(e=>[e.id,e]));for(const n of c){const i=s.getRegionState(n.id)?.activeRegionIds.includes(e.regionId);i&&ge(n,e.bodyFilter)&&(r||t.has(n.id)||(t.add(n.id),o+=1,e.onHeld?.(n)))}if(r&&!a){for(const n of t){const t=u.get(n);t&&(s.controls.applyImpulse(n,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),i+=1,e.onReleased?.(t))}t.clear(),o+=1}for(const e of t)u.has(e)||(t.delete(e),o+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:r,blocked:t.size,released:i,simulatedAt:n,metricRevision:o}),bodyForce:n=>{if(r||!t.has(n.body.id))return null;const i=n.regions?.find(t=>t.id===e.regionId),o=i?.shape;if(!o||"aabb"!==o.type)return{x:.8*-n.body.vx,y:.8*-n.body.vy};const s=e.holdForce??.4;return{x:(o.x-n.body.x)*s-.45*n.body.vx,y:(o.y-n.body.y)*s-.45*n.body.vy}}}}function gt(e,t,n){return Math.max(t,Math.min(n,e))}function yt(e,t,n={}){const i=n.random??Math.random,o=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],r=gt(n.along??.5,.05,.95),s=n.jitterX??0,a=n.padY??20,l=o.x0+(o.x1-o.x0)*r+(2*i()-1)*s,c=Math.min(1,o.width/2),u=gt(l,o.x0+c,o.x1-c),d=e.boundaryY(u,"top")+a,p=e.boundaryY(u,"bottom")-a;return{x:u,y:p>d?d+i()*Math.max(1,p-d):e.midY}}function bt(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]]}]}var xt=[.1,.5,.9],wt=1e6;function vt(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function It(e,t,n,i,o){return"function"==typeof i?i(e,t,n):function(e,t){let n=e;for(const e of t.split(".")){if(null==n||"object"!=typeof n)return;if(!Object.prototype.hasOwnProperty.call(n,e))return;n=n[e]}return n}(e,i??o)}function At(e){const t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function Mt(e,t,n,i){const o=e.flatMap((e,o)=>{const r=vt(It(e,o,t,n,"time")),s=vt(It(e,o,t,i,"value"));return null==r||null==s?[]:[{time:At(r),value:s,index:o}]});o.sort((e,t)=>e.time-t.time||e.index-t.index);const r=[];for(const e of o){const t=r[r.length-1];t?.time===e.time?t.value=e.value:r.push({time:e.time,value:e.value})}return r}function St(e,t,n,i){if(!e.length)return null;const o=e[0],r=e[e.length-1];if(o.time>t)return"clamp"===i?o.value:null;if(t>r.time)return"clamp"===i?r.value:null;const s=function(e,t){let n=0,i=e.length;for(;i>n;){const o=n+i>>>1;t>e[o].time?n=o+1:i=o}return n}(e,t),a=e[s];if(a?.time===t)return a.value;const l=e[Math.max(0,s-1)];return"step"!==n&&a&&a.time!==l.time?l.value+(t-l.time)/(a.time-l.time)*(a.value-l.value):l.value}function Et(e,t){if(1===e.length)return e[0];const n=(e.length-1)*t,i=Math.floor(n),o=Math.ceil(n);return i===o?e[i]:e[i]+(e[o]-e[i])*(n-i)}function jt(e){const t=e.interpolation??"step",n=e.outsideDomain??"omit",i=function(e){const t=(e??xt).map(e=>{const t=vt(e);if(null==t||0>t||t>1)throw new RangeError("physicsReferenceEnvelope quantiles must be finite values from 0 to 1; received "+e);return At(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}(e.quantiles),o=function(e){if(Array.isArray(e)){if(e.length>wt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(e.map(vt).filter(e=>null!=e).map(At))).sort((e,t)=>e-t)}const t=e,n=vt(t.start),i=vt(t.end),o=vt(t.step);if(null==n||null==i||null==o||0>=o||n>i)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");const r=Math.floor((i-n)/o)+1;if(r>wt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");const s=[],a=1e-10*Math.max(1,Math.abs(i),Math.abs(n));for(let e=0;r>e;e+=1){const t=n+e*o;if(t>i+a)break;s.push(At(Math.min(t,i)))}if(s.length&&a>=Math.abs(s[s.length-1]-i)||s.push(At(i)),s.length>wt)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=>Mt(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:o.map(e=>{const o=r.map(i=>St(i,e,t,n)).filter(e=>null!=e).sort((e,t)=>e-t),s={};for(const e of i)s[e]=o.length?Et(o,e):null;return{time:e,count:o.length,min:o.length?o[0]:null,max:o.length?o[o.length-1]:null,median:o.length?Et(o,.5):null,quantiles:s}}),quantiles:i,interpolation:t,outsideDomain:n,runCount:e.runs.length}}function Pt(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function kt(e,t){if("min"===t||"median"===t||"max"===t)return e[t];const n=vt(t);if(null==n||0>n||n>1)throw new RangeError("comparePhysicsTrace quantile selectors must be from 0 to 1; received "+t);const i=At(n);if(!Object.prototype.hasOwnProperty.call(e.quantiles,i))throw Error(`comparePhysicsTrace could not find quantile ${i} in the reference envelope`);return e.quantiles[i]??null}function Rt(e,t,n){return t>e?"below":e>n?"above":"inside"}function Bt(e,t){const n=Math.max(0,t.time-e.time);if(0>=n||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};const i=e.value-e.lower,o=t.value-t.lower,r=e.value-e.upper,s=t.value-t.upper,a=[0,1];for(const[e,t]of[[i,o],[r,s]])(0>e&&t>0||e>0&&0>t)&&a.push(-e/(t-e));a.sort((e,t)=>e-t);let l=0,c=0,u=0;for(let i=0;a.length-1>i;i+=1){const o=a[i],r=a[i+1];if(o>=r)continue;const s=(o+r)/2,d=(r-o)*n,p=Rt(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?u+=d:c+=d}return{below:l,inside:c,above:u,observed:n}}function Nt(e,t,n={}){const i=n.interpolation??t.interpolation,o=n.outsideDomain??t.outsideDomain,r=Mt(e,n.traceId??"trace",n.timeAccessor,n.valueAccessor),s=n.lower??Pt(t,"lower"),a=n.upper??Pt(t,"upper"),l=t.points.map(e=>{const t=St(r,e.time,i,o),n=kt(e,s),l=kt(e,a);if(null!=n&&null!=l&&n>l)throw new RangeError("comparePhysicsTrace lower band exceeds upper band at time "+e.time);return{time:e.time,value:t,lower:n,upper:l,status:null==t||null==n||null==l?"unobserved":Rt(t,n,l)}});let c=0,u=0,d=0,p=0,h=null,m=0,f=null;for(const e of l){if("below"===e.status?c+=1:"inside"===e.status?u+=1:"above"===e.status&&(d+=1),null==e.value||null==e.lower||null==e.upper)continue;const t=Math.max(0,e.value-e.upper),n=Math.max(0,e.lower-e.value);t>p&&(p=t,h=e.time),n>m&&(m=n,f=e.time)}let g=0,y=0,b=0,x=0;for(let e=0;l.length-1>e;e+=1){const t=l[e],n=l[e+1],o=Math.max(0,n.time-t.time);if(o>0){if("linear"===i){const e=Bt(t,n);g+=e.below,y+=e.inside,b+=e.above,x+=e.observed;continue}"unobserved"!==t.status&&(x+=o,"below"===t.status?g+=o:"above"===t.status?b+=o:y+=o)}}const w=l[0]?.time,v=l[l.length-1]?.time,I=null==w||null==v?0:Math.max(0,v-w);return{points:l,sampleCount:l.length,observedSamples:c+u+d,belowSamples:c,insideSamples:u,aboveSamples:d,totalDuration:I,observedDuration:x,unobservedDuration:Math.max(0,I-x),belowDuration:g,insideDuration:y,aboveDuration:b,peakExcess:p,peakExcessAt:h,peakDeficit:m,peakDeficitAt:f}}function Yt(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function $t(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Ft(e){return!!$t(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&$t(e.visitsByStage)&&$t(e.firstEnteredAt)&&$t(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function Ct(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function Dt(e){const t=Array.from(new Set(e.bodyIds??[]));return{stages:e.stages.map(e=>({...e})),bodyIds:t,entities:Object.fromEntries(t.map(e=>[e,Ct(e)]))}}function Ot(e,t,n={}){if("region-enter"!==t.type)return e;const i=function(e,t){const n=t.stageId?.(e);if(n)return n;const i=e.region.metadata;if(i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,"stageId")){const e=i.stageId;if("string"==typeof e)return e}return e.region.id}(t,n),o=e.stages.findIndex(e=>e.id===i);if(0>o)return e;const r=n.entityId?.(t)??t.bodyId;if(!r)return e;const s=Yt(e.entities,r),a=Ft(s)?s:Ct(r),l=a.currentStageId?e.stages.findIndex(e=>e.id===a.currentStageId):-1,c=!a.visitedStageIds.includes(i),u=Number(t.observation.timestamp),d=Number.isFinite(u)?u:0,p=Yt(a.visitsByStage,i),h="number"==typeof p&&Number.isFinite(p)?p:0,m={...a,currentStageId:i,furthestStageId:o>a.furthestStageIndex?i:a.furthestStageId,furthestStageIndex:Math.max(a.furthestStageIndex,o),visitedStageIds:c?[...a.visitedStageIds,i]:a.visitedStageIds,visitsByStage:{...a.visitsByStage,[i]:h+1},firstEnteredAt:c?{...a.firstEnteredAt,[i]:d}:a.firstEnteredAt,lastEnteredAt:{...a.lastEnteredAt,[i]:d},regressionCount:l>=0&&l>o?a.regressionCount+1:a.regressionCount};return{...e,bodyIds:e.bodyIds.includes(r)?e.bodyIds:[...e.bodyIds,r],entities:{...e.entities,[r]:m}}}function qt(e){const t=e.bodyIds.map(t=>{const n=Yt(e.entities,t);return Ft(n)?n:Ct(t)}),n=t.length;let i=n;return e.stages.map((e,o)=>{const r=t.filter(e=>e.furthestStageIndex>=o).length,s=t.filter(t=>t.visitedStageIds.includes(e.id)).length,a=t.reduce((t,n)=>{const i=Yt(n.visitsByStage,e.id);return t+("number"==typeof i&&Number.isFinite(i)?i:0)},0),l={id:e.id,label:e.label??e.id,reached:r,entered:s,total:n,conversion:n>0?r/n:0,fromPrevious:i>0?r/i:0,dropoff:Math.max(0,i-r),visits:a,repeatVisits:Math.max(0,a-s)};return i=r,l})}function Tt(e){const[t,n]=e.size,i=e.flow??"down",o=null==(v=e.padding)?{top:24,right:24,bottom:24,left:24}:"number"==typeof v?{top:v,right:v,bottom:v,left:v}:{top:v.top??0,right:v.right??0,bottom:v.bottom??0,left:v.left??0},r=Math.max(.05,Math.min(1,e.channelRatio??1)),s={x:o.left,y:o.top,width:Math.max(1,t-o.left-o.right),height:Math.max(1,n-o.top-o.bottom)},a="down"===i?s.height:s.width,l=a*Math.max(0,e.chargeExtent??.12),c=a*Math.max(0,e.projectionExtent??0),u=a*Math.max(0,e.destinationExtent??.55),d=Math.max(0,a-l-u-c),p=function(e){return"number"==typeof e?Array.from({length:Math.max(1,Math.round(e))},(e,t)=>({id:"bin-"+t,label:t+""})):0===e.length?[{id:"bin-0",label:"0"}]:e.map((e,t)=>({id:e.id,label:e.label??e.id??t+""}))}(e.destinations),h=("down"===i?s.width:s.height)/p.length,m="down"===i?(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),g=m(l,d),y=l+d,b=m(y,u),x=m(y+u,c),w=p.map((e,t)=>{const n=t*h,o=h*r,a=(h-o)/2;return"down"===i?{id:e.id,label:e.label,order:t,x:s.x+n+a,y:b.y,width:o,height:b.height,centerX:s.x+(t+.5)*h,centerY:b.y+b.height/2}:{id:e.id,label:e.label,order:t,x:b.x,y:s.y+n+a,width:b.width,height:o,centerX:b.x+b.width/2,centerY:s.y+(t+.5)*h}});var v;return{width:t,height:n,flow:i,charge:f,apparatus:g,destinations:w,projection:x}}function Gt(e,t){return e.destinations.find(e=>e.id===t)}function Wt(e,t,n){const{charge:i,flow:o}=e,r=Math.max(1,n),s=(t%r+.5)/r;return"down"===o?{x:i.x+i.width*s,y:i.y+i.height/2}:{x:i.x+i.width/2,y:i.y+i.height*s}}function Xt(e,t={}){const n=t.thickness??4,i=t.idPrefix??"stage",{destinations:o,flow:r,width:s,height:a}=e,l=[];if(o.length>0){const t=o[0];if("down"===r){const r=t.y+t.height;l.push({id:i+"-floor",shape:{type:"segment",x1:e.charge.x,y1:r,x2:e.charge.x+e.charge.width,y2:r,thickness:n}});for(let e=1;o.length>e;e+=1){const s=o[e].centerX-(o[e].centerX-o[e-1].centerX)/2;l.push({id:`${i}-divider-${e}`,shape:{type:"segment",x1:s,y1:t.y,x2:s,y2:r,thickness:n}})}}else{const r=t.x+t.width;l.push({id:i+"-floor",shape:{type:"segment",x1:r,y1:e.charge.y,x2:r,y2:e.charge.y+e.charge.height,thickness:n}});for(let e=1;o.length>e;e+=1){const s=o[e].centerY-(o[e].centerY-o[e-1].centerY)/2;l.push({id:`${i}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:s,x2:r,y2:s,thickness:n}})}}}return!1!==t.walls&&l.push({id:i+"-wall-left",shape:{type:"segment",x1:1,y1:0,x2:1,y2:a,thickness:n}},{id:i+"-wall-right",shape:{type:"segment",x1:s-1,y1:0,x2:s-1,y2:a,thickness:n}}),l}function Vt(e,t={}){return`${t.charge??"bodies"} enter at the ${"down"===e.flow?"top":"left"}, travel ${"down"===e.flow?"downward":"left to right"} through ${t.apparatus??"the apparatus"}, and come to rest in ${e.destinations.length} ${t.destination??"destinations"}: ${e.destinations.map(e=>e.label).join(", ")}.`}function zt(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function Qt(e,t,n,i){const o="function"==typeof e?e(t,n):e;return Number.isFinite(o)?Number(o):i}function Lt(e,t,n){return zt(e[t])??n}function Ht(e,t){return"number"==typeof e?e:e?.[t]??0}function Kt(e){const{band:t,idPrefix:n,plot:i,projection:o}=e,{includeBoundaryWalls:r=!0,includeInteriorWalls:s=!0,wallThickness:a=4}=t,l=function(e){const t=e.bandwidth??e.scale.bandwidth?.()??0,n=new Set;for(const i of e.values){const o=e.scale(i);Number.isFinite(o)&&(n.add(Number(o)),n.add(Number(o)+t))}return Array.from(n).sort((e,t)=>e-t)}(t);if(2>l.length)return[];const c=r?l.length-1:l.length-2,u=[];for(let e=r?0:1;c>=e;e+=1){if(!s&&e>0&&l.length-1>e)continue;const t=l[e];u.push({id:`${n}-wall-${e}`,shape:"x"===o?{type:"aabb",x:t,y:i.y+i.height/2,width:a,height:i.height}:{type:"aabb",x:i.x+i.width/2,y:t,width:i.width,height:a}})}return u}function Ut(e){const{plot:t,idPrefix:n="physics-scale",bounds:i={},xBins:o,xBands:r,yBands:s}=e,a=[];if(!1!==i&&a.push(...H(t,{idPrefix:n,...i})),o){const{idPrefix:e,yTop:i,yBottom:r,...s}=o;a.push(...K({...s,idPrefix:e??n+"-xbin",yTop:i??t.y,yBottom:r??t.y+t.height}))}return r&&a.push(...Kt({band:r,idPrefix:r.idPrefix??n+"-xband",plot:t,projection:"x"})),s&&a.push(...Kt({band:s,idPrefix:s.idPrefix??n+"-yband",plot:t,projection:"y"})),a}function _t(e){const{plot:t,rows:n,columns:i=n+1,pegRadius:o=3,idPrefix:r="galton-peg",yStart:s=t.y+.18*t.height,yEnd:a=t.y+.58*t.height,stagger:l=!0,restitution:c=.2,friction:u=.04}=e,d=Math.max(0,Math.floor(n)),p=Math.max(1,Math.floor(i));if(0===d)return[];const h=d>1?(a-s)/(d-1):0,m=t.width/p,f=[];for(let e=0;d>e;e+=1){const n=l&&e%2==1?m/2:0;for(let i=0;p>i;i+=1){const a=t.x+m*(i+.5)+n;t.x+o>a||a>t.x+t.width-o||f.push({id:`${r}-${e}-${i}`,shape:{type:"aabb",x:a,y:s+e*h,width:2*o,height:2*o},restitution:c,friction:u})}}return f}function Jt(e,t={}){const{idPrefix:n="physics-token",radius:i=5,shape:o,mass:r,vx:s,vy:a,spawnAt:l,seed:c=1,jitter:u,datum:d}=t,p=We(c),h=Ht(u,"x"),m=Ht(u,"y");return e.map((e,c)=>{const u=Qt(t.x,e,c,Lt(e,"x",0)),f=Qt(t.y,e,c,Lt(e,"y",0)),g=Qt(i,e,c,5),y="function"==typeof o?o(e,c):o??{type:"circle",radius:g};return{id:`${n}-${e.index??c}`,x:u+(p()-.5)*h,y:f+(p()-.5)*m,vx:Qt(s,e,c,0),vy:Qt(a,e,c,0),mass:Qt(r,e,c,1),spawnAt:Qt(l,e,c,void 0),shape:y,datum:d?d(e,c):e.datum??e}}).map(e=>{if(Number.isFinite(e.spawnAt))return e;const{spawnAt:t,...n}=e;return n})}function Zt(e,t={}){const{idPrefix:n="sediment",collider:i=!0,colliderThickness:o=1,restitution:r=.05,friction:s=.2,...a}=t,l=Te(e,a),c=i?l.filter(e=>e.height>0).map(e=>({id:`${n}-${e.binId}`,shape:{type:"aabb",x:e.x+e.width/2,y:e.y+o/2,width:e.width,height:o},restitution:r,friction:s})):[];return{columns:l,colliders:c}}function en(e,t={}){const{timeAccessor:n="arrivalTime",timeScale:i=1,startAt:o=0,rebase:r=!0,sort:s=!0}=t,a=e.map((e,t)=>({spawn:e,time:function(e,t,n){return zt("function"==typeof n?n(e,t):e[n]??e.datum?.[n])}(e,t,n)??e.spawnAt??t})),l=a.length?Math.min(...a.map(e=>e.time)):0;return{initialSpawns:a.map(({spawn:e,time:t})=>({...e,spawnAt:o+(r?t-l:t)})).sort((e,t)=>s?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:o,timeAccessor:"spawnAt",timeScale:i}}}var tn=v;export{e as BuiltInPhysicsEngineAdapter,t as ChainReactionChart,n as CollisionSwarmChart,i as CrucibleChart,o as DEFAULT_CRUCIBLE_HEIGHT,r as DEFAULT_CRUCIBLE_OUTLETS,s as DEFAULT_CRUCIBLE_SIZE,a as DEFAULT_CRUCIBLE_WIDTH,l as EventDropChart,c as GaltonBoardChart,u as GauntletChart,d as GuantletChart,Xe as MultiLineTooltip,p as PacketFlowChart,h as PhysicalFlowChart,m as PhysicsCustomChart,f as PhysicsPileChart,g as PhysicsPipelineStore,y as PhysicsSVGOverlay,b as PhysicsSedimentAccumulator,x as ProcessFlowChart,w as StreamPhysicsFrame,Ve as Tooltip,ze as TooltipRoot,I as UnitPileChart,A as absorbRegion,M as aggregateRegionCounts,S as applyCrucibleEvent,en as arrivalReplay,j as bodiesToAnnotationAnchors,P as bodyGroupSpec,k as buildCollisionSwarmPhysics,R as buildCrucibleEvidence,B as buildCrucibleInitialSpawns,N as buildCrucibleLayout,Y as buildCruciblePhysicsConfig,$ as buildCrucibleProductEvents,F as buildCrucibleProjection,C as buildCrucibleStateSpawns,D as buildCrucibleTerminalSpawns,O as buildEventDropPhysics,q as buildGaltonBoardPhysics,T as buildPhysicalFlowPhysics,G as buildPhysicsAnnotationContext,W as buildPhysicsPile,X as buildProcessFlowPhysics,V as calculateBlockerAmplification,z as capacitatedRegion,Q as chargeGateRegion,L as cloneCrucibleState,Ut as collidersFromScales,Nt as comparePhysicsTrace,U as compileCruciblePlan,_ as compileDependencyMachine,Qe as compileMotionEncoding,lt as compilePhysicsEncoding,J as composePhysicsControllers,Le as composeStyleRules,Z as createCapacityQueueController,ee as createDefaultPhysicsEngineAdapter,ft as createDependencyGateController,te as createInitialCrucibleState,ne as createLogicalJoin,ct as createPhysicsEncodingLayout,ie as createPortalController,Dt as createProcessJourneyLedger,mt as createServiceLevelController,pt as createServiceResourcePoolController,oe as crucibleBondId,re as crucibleBoundaryColliders,se as crucibleComponentBodyId,ae as crucibleProductBodyId,le as crucibleProjectionRows,ce as crucibleSemanticKey,tn as default,He as deriveMotionVector,Vt as describePhysicsStageGeography,de as evaluateCrucibleConservation,pe as evaluatePhysicsBodyBudget,me as forceFieldRegion,_t as galtonPegs,fe as groupCompletionRows,ot as hatchFillId,rt as hatchPatternDef,st as isHatchFill,Ke as makeRuleValueResolver,Ue as markTooltipChrome,_e as matchesThreshold,ye as membraneRegion,be as normalizePhysicsAnnotations,Je as opacityFromAge,Wt as physicsChargePoint,Gt as physicsDestination,xe as physicsProcessBoundaryColliders,we as physicsProcessGroupSemanticItems,ve as physicsProcessRegionSemanticItem,Ie as physicsProcessStageSemanticItems,jt as physicsReferenceEnvelope,Xt as physicsStageColliders,Tt as physicsStageGeography,Ae as planGauntletPropertyWork,Me as portalRegion,Se as pressureFieldRegion,Ee as processChrome,qt as processJourneyRows,je as processLaneWalls,Pe as processStageLayout,ke as processStageRegions,bt as processVolumePolygons,Be as regionCountsToProjectionRows,Ne as replaceGauntletNegative,Ye as replayCruciblePlan,$e as replayStateTransitions,Fe as resolveCrucibleSelector,Ce as resolveCrucibleSnapshotAt,De as resolveCrucibleTime,ut as resolveGauntletTerminalState,dt as resolveGauntletTerminalStates,Ze as resolveMotionAccessor,et as resolveMotionAge,tt as resolveMotionVector,nt as resolveStyleRules,at as resolveSvgFill,Oe as routeDependencyTracks,qe as routeSurfaceRegion,it as ruleMatches,Zt as sedimentBake,Te as sedimentHeightfield,Jt as spawnFromTokens,yt as stageTargetInVolume,Ot as updateProcessJourney};
2
+ function e(e){let{data:t,encoding:i,defaults:n={},scales:r}=e,o=Dt({data:t,encoding:i}),a=[],s=new Map,l=[],u=[],d=new Map;return o.rows.forEach((e,t)=>{let{id:o,datum:p}=e,c=Math.max(0,Vt(i.appearance?.size,p,t)??n.size??6),h=Vt(i.appearance?.shape,p,t)??n.shape??{type:"circle",radius:c},m=e.placement.x??n.x??0,f=e.placement.y??n.y??0,g=r?.x?r.x(m):m,y=r?.y?r.y(f):f,b=Vt(i.appearance?.color,p,t)??n.color,x=Vt(i.appearance?.opacity,p,t)??n.opacity,w=Vt(i.appearance?.stroke,p,t)??n.stroke,v=Vt(i.appearance?.strokeWidth,p,t)??n.strokeWidth,A=Vt(i.time?.spawnAt,p,t)??e.time.arrival,I=e.kinematics.velocityX,M=e.kinematics.velocityY,S=Vt(i.dynamics?.mass,p,t)??n.mass??1,E=Vt(i.dynamics?.friction,p,t),P=Vt(i.dynamics?.restitution,p,t),j=Vt(i.dynamics?.bodyCollisions,p,t),k={id:o,x:g,y:y,mass:S,shape:{...h},datum:p,...null!=A&&{spawnAt:A},...null!=I&&{vx:I},...null!=M&&{vy:M},...null!=E&&{friction:E},...null!=P&&{restitution:P},...null!=j&&{bodyCollisions:j}},R={...null!=b&&{fill:b},...null!=x&&{opacity:x},...null!=w&&{stroke:w},...null!=v&&{strokeWidth:v}},B={id:o,datum:p,appearance:{color:b,opacity:x,shape:h,size:c,stroke:w,strokeWidth:v},placement:{x:g,y:y,lane:e.placement.lane,space:i.placement?.space??"world"},time:{arrival:A,spawnAt:A,basis:i.time?.basis??"simulation",unit:i.time?.unit},kinematics:{velocityX:I,velocityY:M,space:i.kinematics?.space??"world"},dynamics:{bodyCollisions:j,friction:E,mass:S,restitution:P},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:k};a.push(B),s.set(o,B),l.push(k),d.set(o,R),u.push({id:o,bodyId:o,label:e.accessible.label,description:e.accessible.description,datum:p,x:g,y:y,group:e.accessible.group})}),{rows:a,byId:s,spawns:l,semanticItems:u,bodyStyle:e=>d.get(e.id)??{}}}function t(t){return i=>{let n=e({data:i.data,encoding:t.encoding,defaults:t.defaults,scales:i.scales}),r=t.extend?.(i,n)??{};return{...r,initialSpawns:n.spawns,bodyStyle:n.bodyStyle,semanticItems:[...n.semanticItems,...r.semanticItems??[]]}}}function i(e,t){let{layout:i,positiveProperties:n,negativeProperties:r,viability:o,outcome:a}=t,s=function(e){return new Map(e.gates.map(e=>[e.id,e]))}(i),l=[...("function"==typeof t.events?t.events(e,i):t.events)??[]].sort((e,t)=>e.time-t.time),u=e;for(let e of l){let t=e.gateId?s.get(e.gateId):void 0,l=e.effects??[],d={...rt(e,l),appliedAt:e.time},p=At(u,d);if(p!==u){u=p;for(let i of l){let o={event:e,gate:t,negativeProperties:r,positiveProperties:n,project:u};i.when&&!i.when(o)||(u=ye(u,i,o))}u={...u,viability:o?.(u,{negativeProperties:r,positiveProperties:n})??tt(u,n,r)},e.final&&(u={...u,outcome:e.outcome??a?.(u,{layout:i,negativeProperties:r,positiveProperties:n})??(u.viability>20?"built":"approved_not_built")})}}return u}function n(e){return e.projects.map(t=>i(t,e))}function r(e){let t=e.resources.map(e=>({...e,bodyId:e.bodyId??e.id})),i=new Map(t.map(e=>[e.bodyId,e])),n=new Map,r=new Map,o=e.assignmentForce??.45,a=e.returnForce??.35,s=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=new Map,d=0,p=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let i=n.get(e);if(i)return i;let o=t.find(e=>!r.has(e.id));if(!o)return null;let a={resourceId:o.id,resourceBodyId:o.bodyId,caseBodyId:e,assignedAt:d};return n.set(e,a),r.set(o.id,a),p+=1,a},release:e=>{let t=n.get(e);return!!t&&(n.delete(e),r.delete(t.resourceId),p+=1,!0)},getAssignment:e=>n.get(e),tick:e=>{d=Math.max(d,e.elapsed),u=new Map(e.controls.readBodies().map(e=>[e.id,e]));for(let[e,t]of n)u.has(e)&&u.has(t.resourceBodyId)||(n.delete(e),r.delete(t.resourceId),p+=1)},getSnapshot:()=>({total:t.length,available:t.length-r.size,assigned:r.size,assignments:Array.from(n.values()),simulatedAt:d,metricRevision:p}),bodyForce:e=>{let t=i.get(e.body.id);if(t){let i=r.get(t.id),n=i?u.get(i.caseBodyId):void 0,s=i?o:a;return{x:((n?n.x+(l.x??0):t.home.x)-e.body.x)*s,y:((n?n.y+(l.y??0):t.home.y)-e.body.y)*s}}let d=n.get(e.body.id);if(!d||0>=s)return null;let p=u.get(d.resourceBodyId);return p?{x:(p.x-e.body.x)*s,y:(p.y-e.body.y)*s}:null}}}function o(e,t){let i="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):$t(e.datum,t.deadlineAccessor)??$t(e,t.deadlineAccessor);return Number.isFinite(Number(i))?Math.max(0,Number(i)):0}function a(e){function t(t){n.set(t.bodyId,t),a+=1,e.onStateChange?.({...t})}function i(e){let i=n.get(e);return!(!i||null!=i.completedAt||(t({...i,completedAt:r,state:"unhappy"===i.state?"resolved-unhappy":"resolved"}),0))}let n=new Map,r=0,a=0;return{id:e.id??"service-level",continuous:!0,protect:e=>{let i=n.get(e);return!(!i||null!=i.completedAt||"unhappy"===i.state||(t({...i,state:"protected",protectedAt:r}),0))},complete:i,getCase:e=>n.get(e),tick:a=>{r=Math.max(r,a.elapsed);for(let s of a.controls.readBodies()){if(!st(s,e.bodyFilter))continue;if(!n.has(s.id)){let i=o(s,e);t({bodyId:s.id,openedAt:r,deadlineAt:r+i,state:"waiting"})}let l=n.get(s.id);l&&null==l.completedAt&&(e.completionRegionId&&a.getRegionState(s.id)?.activeRegionIds.includes(e.completionRegionId)?i(s.id):"waiting"===l.state&&r>=l.deadlineAt&&t({...l,state:"unhappy"}))}},getSnapshot:()=>{let e=Array.from(n.values()),t=t=>e.filter(e=>e.state===t).length;return{total:e.length,waiting:t("waiting"),protected:t("protected"),unhappy:t("unhappy"),resolved:t("resolved"),resolvedUnhappy:t("resolved-unhappy"),simulatedAt:r,metricRevision:a}}}}function s(e){let t=new Set,i=0,n=0,r=0,o=!1;return{id:e.id??"dependency-gate:"+e.regionId,continuous:!0,tick:a=>{i=Math.max(i,a.elapsed);let s=o;var l;l=i,o=e.isOpen?e.isOpen(l):null!=e.opensAt&&l>=e.opensAt;let u=a.controls.readBodies(),d=new Map(u.map(e=>[e.id,e]));for(let i of u)!a.getRegionState(i.id)?.activeRegionIds.includes(e.regionId)||!st(i,e.bodyFilter)||!o&&!t.has(i.id)&&(t.add(i.id),r+=1,e.onHeld?.(i));if(o&&!s){for(let i of t){let t=d.get(i);t&&(a.controls.applyImpulse(i,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),n+=1,e.onReleased?.(t))}t.clear(),r+=1}for(let e of t)d.has(e)||(t.delete(e),r+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:o,blocked:t.size,released:n,simulatedAt:i,metricRevision:r}),bodyForce:i=>{if(o||!t.has(i.body.id))return null;let n=i.regions?.find(t=>t.id===e.regionId)?.shape;if(!n||"aabb"!==n.type)return{x:.8*-i.body.vx,y:.8*-i.body.vy};let r=e.holdForce??.4;return{x:(n.x-i.body.x)*r-.45*i.body.vx,y:(n.y-i.body.y)*r-.45*i.body.vy}}}}function l(e,t,i){return Math.max(t,Math.min(i,e))}function u(e,t,i={}){let n=i.random??Math.random,r=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],o=l(i.along??.5,.05,.95),a=i.jitterX??0,s=i.padY??20,u=r.x0+(r.x1-r.x0)*o+(2*n()-1)*a,d=Math.min(1,r.width/2),p=l(u,r.x0+d,r.x1-d),c=e.boundaryY(p,"top")+s,h=e.boundaryY(p,"bottom")-s;return{x:p,y:h>c?c+n()*Math.max(1,h-c):e.midY}}function d(e){return"bowtie"===e.shape?[{id:"incoming",role:"incoming",points:[[e.left,e.topY],[e.centerLeft,e.pinchTop],[e.centerLeft,e.pinchBottom],[e.left,e.bottomY]]},{id:"center",role:"center",points:[[e.centerLeft,e.pinchTop],[e.centerRight,e.pinchTop],[e.centerRight,e.pinchBottom],[e.centerLeft,e.pinchBottom]]},{id:"outgoing",role:"outgoing",points:[[e.centerRight,e.pinchTop],[e.right,e.topY],[e.right,e.bottomY],[e.centerRight,e.pinchBottom]]}]:[{id:"volume",role:"volume",points:[[e.left,e.topY],[e.right,"funnel"===e.shape?e.pinchTop:e.topY],[e.right,"funnel"===e.shape?e.pinchBottom:e.bottomY],[e.left,e.bottomY]]}]}function p(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function c(e,t,i,n,r){return"function"==typeof n?n(e,t,i):function(e,t){let i=e;for(let e of t.split(".")){if(null==i||"object"!=typeof i||!Object.prototype.hasOwnProperty.call(i,e))return;i=i[e]}return i}(e,n??r)}function h(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function m(e,t,i,n){let r=e.flatMap((e,r)=>{let o=p(c(e,r,t,i,"time")),a=p(c(e,r,t,n,"value"));return null==o||null==a?[]:[{time:h(o),value:a,index:r}]});r.sort((e,t)=>e.time-t.time||e.index-t.index);let o=[];for(let e of r){let t=o[o.length-1];t?.time===e.time?t.value=e.value:o.push({time:e.time,value:e.value})}return o}function f(e,t,i,n){if(!e.length)return null;let r=e[0],o=e[e.length-1];if(r.time>t)return"clamp"===n?r.value:null;if(t>o.time)return"clamp"===n?o.value:null;let a=function(e,t){let i=0,n=e.length;for(;n>i;){let r=i+n>>>1;t>e[r].time?i=r+1:n=r}return i}(e,t),s=e[a];if(s?.time===t)return s.value;let l=e[Math.max(0,a-1)];return"step"!==i&&s&&s.time!==l.time?l.value+(t-l.time)/(s.time-l.time)*(s.value-l.value):l.value}function g(e,t){if(1===e.length)return e[0];let i=(e.length-1)*t,n=Math.floor(i),r=Math.ceil(i);return n===r?e[n]:e[n]+(e[r]-e[n])*(i-n)}function y(e){let t=e.interpolation??"step",i=e.outsideDomain??"omit",n=function(e){let t=(e??ei).map(e=>{let t=p(e);if(null==t||0>t||t>1)throw new RangeError("physicsReferenceEnvelope quantiles must be finite values from 0 to 1; received "+e);return h(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}(e.quantiles),r=function(e){if(Array.isArray(e)){if(e.length>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(e.map(p).filter(e=>null!=e).map(h))).sort((e,t)=>e-t)}let t=e,i=p(t.start),n=p(t.end),r=p(t.step);if(null==i||null==n||null==r||0>=r||i>n)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let o=Math.floor((n-i)/r)+1;if(o>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");let a=[],s=1e-10*Math.max(1,Math.abs(n),Math.abs(i));for(let e=0;o>e;e+=1){let t=i+e*r;if(t>n+s)break;a.push(h(Math.min(t,n)))}if((!a.length||Math.abs(a[a.length-1]-n)>s)&&a.push(h(n)),a.length>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(a)).sort((e,t)=>e-t)}(e.sampleAt),o=e.runs.map(t=>m(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:r.map(e=>{let r=o.map(n=>f(n,e,t,i)).filter(e=>null!=e).sort((e,t)=>e-t),a={};for(let e of n)a[e]=r.length?g(r,e):null;return{time:e,count:r.length,min:r.length?r[0]:null,max:r.length?r[r.length-1]:null,median:r.length?g(r,.5):null,quantiles:a}}),quantiles:n,interpolation:t,outsideDomain:i,runCount:e.runs.length}}function b(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function x(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let i=p(t);if(null==i||0>i||i>1)throw new RangeError("comparePhysicsTrace quantile selectors must be from 0 to 1; received "+t);let n=h(i);if(!Object.prototype.hasOwnProperty.call(e.quantiles,n))throw Error(`comparePhysicsTrace could not find quantile ${n} in the reference envelope`);return e.quantiles[n]??null}function w(e,t,i){return t>e?"below":e>i?"above":"inside"}function v(e,t){let i=Math.max(0,t.time-e.time);if(0>=i||null==e.value||null==e.lower||null==e.upper||null==t.value||null==t.lower||null==t.upper)return{below:0,inside:0,above:0,observed:0};let n=e.value-e.lower,r=t.value-t.lower,o=e.value-e.upper,a=t.value-t.upper,s=[0,1];for(let[e,t]of[[n,r],[o,a]])(0>e&&t>0||e>0&&0>t)&&s.push(-e/(t-e));s.sort((e,t)=>e-t);let l=0,u=0,d=0;for(let n=0;s.length-1>n;n+=1){let r=s[n],o=s[n+1];if(r>=o)continue;let a=(r+o)/2,p=(o-r)*i,c=w(e.value+(t.value-e.value)*a,e.lower+(t.lower-e.lower)*a,e.upper+(t.upper-e.upper)*a);"below"===c?l+=p:"above"===c?d+=p:u+=p}return{below:l,inside:u,above:d,observed:i}}function A(e,t,i={}){let n=i.interpolation??t.interpolation,r=i.outsideDomain??t.outsideDomain,o=m(e,i.traceId??"trace",i.timeAccessor,i.valueAccessor),a=i.lower??b(t,"lower"),s=i.upper??b(t,"upper"),l=t.points.map(e=>{let t=f(o,e.time,n,r),i=x(e,a),l=x(e,s);if(null!=i&&null!=l&&i>l)throw new RangeError("comparePhysicsTrace lower band exceeds upper band at time "+e.time);return{time:e.time,value:t,lower:i,upper:l,status:null==t||null==i||null==l?"unobserved":w(t,i,l)}}),u=0,d=0,p=0,c=0,h=null,g=0,y=null;for(let e of l){if("below"===e.status?u+=1:"inside"===e.status?d+=1:"above"===e.status&&(p+=1),null==e.value||null==e.lower||null==e.upper)continue;let t=Math.max(0,e.value-e.upper),i=Math.max(0,e.lower-e.value);t>c&&(c=t,h=e.time),i>g&&(g=i,y=e.time)}let A=0,I=0,M=0,S=0;for(let e=0;l.length-1>e;e+=1){let t=l[e],i=l[e+1],r=Math.max(0,i.time-t.time);if(r>0){if("linear"===n){let e=v(t,i);A+=e.below,I+=e.inside,M+=e.above,S+=e.observed;continue}"unobserved"!==t.status&&(S+=r,"below"===t.status?A+=r:"above"===t.status?M+=r:I+=r)}}let E=l[0]?.time,P=l[l.length-1]?.time,j=null==E||null==P?0:Math.max(0,P-E);return{points:l,sampleCount:l.length,observedSamples:u+d+p,belowSamples:u,insideSamples:d,aboveSamples:p,totalDuration:j,observedDuration:S,unobservedDuration:Math.max(0,j-S),belowDuration:A,insideDuration:I,aboveDuration:M,peakExcess:c,peakExcessAt:h,peakDeficit:g,peakDeficitAt:y}}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function M(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function S(e){return!!M(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&M(e.visitsByStage)&&M(e.firstEnteredAt)&&M(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function E(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function P(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,E(e)]))}}function j(e,t,i={}){if("region-enter"!==t.type)return e;let n=function(e,t){let i=t.stageId?.(e);if(i)return i;let n=e.region.metadata;if(n&&"object"==typeof n&&Object.prototype.hasOwnProperty.call(n,"stageId")){let e=n.stageId;if("string"==typeof e)return e}return e.region.id}(t,i),r=e.stages.findIndex(e=>e.id===n);if(0>r)return e;let o=i.entityId?.(t)??t.bodyId;if(!o)return e;let a=I(e.entities,o),s=S(a)?a:E(o),l=s.currentStageId?e.stages.findIndex(e=>e.id===s.currentStageId):-1,u=!s.visitedStageIds.includes(n),d=Number(t.observation.timestamp),p=Number.isFinite(d)?d:0,c=I(s.visitsByStage,n),h="number"==typeof c&&Number.isFinite(c)?c:0,m={...s,currentStageId:n,furthestStageId:r>s.furthestStageIndex?n:s.furthestStageId,furthestStageIndex:Math.max(s.furthestStageIndex,r),visitedStageIds:u?[...s.visitedStageIds,n]:s.visitedStageIds,visitsByStage:{...s.visitsByStage,[n]:h+1},firstEnteredAt:u?{...s.firstEnteredAt,[n]:p}:s.firstEnteredAt,lastEnteredAt:{...s.lastEnteredAt,[n]:p},regressionCount:l>=0&&l>r?s.regressionCount+1:s.regressionCount};return{...e,bodyIds:e.bodyIds.includes(o)?e.bodyIds:[...e.bodyIds,o],entities:{...e.entities,[o]:m}}}function k(e){let t=e.bodyIds.map(t=>{let i=I(e.entities,t);return S(i)?i:E(t)}),i=t.length,n=i;return e.stages.map((e,r)=>{let o=t.filter(e=>e.furthestStageIndex>=r).length,a=t.filter(t=>t.visitedStageIds.includes(e.id)).length,s=t.reduce((t,i)=>{let n=I(i.visitsByStage,e.id);return t+("number"==typeof n&&Number.isFinite(n)?n:0)},0),l={id:e.id,label:e.label??e.id,reached:o,entered:a,total:i,conversion:i>0?o/i:0,fromPrevious:n>0?o/n:0,dropoff:Math.max(0,n-o),visits:s,repeatVisits:Math.max(0,s-a)};return n=o,l})}function R(e){let[t,i]=e.size,n=e.flow??ii,r=null==(v=e.padding)?{top:ni,right:ni,bottom:ni,left:ni}:"number"==typeof v?{top:v,right:v,bottom:v,left:v}:{top:v.top??0,right:v.right??0,bottom:v.bottom??0,left:v.left??0},o=Math.max(.05,Math.min(1,e.channelRatio??si)),a={x:r.left,y:r.top,width:Math.max(1,t-r.left-r.right),height:Math.max(1,i-r.top-r.bottom)},s="down"===n?a.height:a.width,l=s*Math.max(0,e.chargeExtent??ri),u=s*Math.max(0,e.projectionExtent??ai),d=s*Math.max(0,e.destinationExtent??oi),p=Math.max(0,s-l-d-u),c=function(e){return"number"==typeof e?Array.from({length:Math.max(1,Math.round(e))},(e,t)=>({id:"bin-"+t,label:t+""})):0===e.length?[{id:"bin-0",label:"0"}]:e.map((e,t)=>({id:e.id,label:e.label??e.id??t+""}))}(e.destinations),h=("down"===n?a.width:a.height)/c.length,m="down"===n?(e,t)=>({x:a.x,y:a.y+e,width:a.width,height:t}):(e,t)=>({x:a.x+e,y:a.y,width:t,height:a.height}),f=m(0,l),g=m(l,p),y=l+p,b=m(y,d),x=m(y+d,u),w=c.map((e,t)=>{let i=t*h,r=h*o,s=(h-r)/2;return"down"===n?{id:e.id,label:e.label,order:t,x:a.x+i+s,y:b.y,width:r,height:b.height,centerX:a.x+(t+.5)*h,centerY:b.y+b.height/2}:{id:e.id,label:e.label,order:t,x:b.x,y:a.y+i+s,width:b.width,height:r,centerX:b.x+b.width/2,centerY:a.y+(t+.5)*h}});var v;return{width:t,height:i,flow:n,charge:f,apparatus:g,destinations:w,projection:x}}function B(e,t){return e.destinations.find(e=>e.id===t)}function N(e,t,i){let{charge:n,flow:r}=e,o=Math.max(1,i),a=(t%o+.5)/o;return"down"===r?{x:n.x+n.width*a,y:n.y+n.height/2}:{x:n.x+n.width/2,y:n.y+n.height*a}}function $(e,t={}){let i=t.thickness??4,n=t.idPrefix??"stage",{destinations:r,flow:o,width:a,height:s}=e,l=[];if(r.length>0){let t=r[0];if("down"===o){let o=t.y+t.height;l.push({id:n+"-floor",shape:{type:"segment",x1:e.charge.x,y1:o,x2:e.charge.x+e.charge.width,y2:o,thickness:i}});for(let e=1;r.length>e;e+=1){let a=r[e].centerX-(r[e].centerX-r[e-1].centerX)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:a,y1:t.y,x2:a,y2:o,thickness:i}})}}else{let o=t.x+t.width;l.push({id:n+"-floor",shape:{type:"segment",x1:o,y1:e.charge.y,x2:o,y2:e.charge.y+e.charge.height,thickness:i}});for(let e=1;r.length>e;e+=1){let a=r[e].centerY-(r[e].centerY-r[e-1].centerY)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:a,x2:o,y2:a,thickness:i}})}}}return!1!==t.walls&&l.push({id:n+"-wall-left",shape:{type:"segment",x1:1,y1:0,x2:1,y2:s,thickness:i}},{id:n+"-wall-right",shape:{type:"segment",x1:a-1,y1:0,x2:a-1,y2:s,thickness:i}}),l}function Y(e,t={}){return`${t.charge??"bodies"} enter at the ${"down"===e.flow?"top":"left"}, travel ${"down"===e.flow?"downward":"left to right"} through ${t.apparatus??"the apparatus"}, and come to rest in ${e.destinations.length} ${t.destination??"destinations"}: ${e.destinations.map(e=>e.label).join(", ")}.`}function F(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function O(e,t,i,n){let r="function"==typeof e?e(t,i):e;return Number.isFinite(r)?Number(r):n}function T(e,t,i){return F(e[t])??i}function D(e,t){return"number"==typeof e?e:e?.[t]??0}function C(e){let{band:t,idPrefix:i,plot:n,projection:r}=e,{includeBoundaryWalls:o=!0,includeInteriorWalls:a=!0,wallThickness:s=4}=t,l=function(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,i=new Set;for(let n of e.values){let r=e.scale(n);Number.isFinite(r)&&(i.add(Number(r)),i.add(Number(r)+t))}return Array.from(i).sort((e,t)=>e-t)}(t);if(2>l.length)return[];let u=o?l.length-1:l.length-2,d=[];for(let e=o?0:1;u>=e;e+=1){if(!a&&e>0&&l.length-1>e)continue;let t=l[e];d.push({id:`${i}-wall-${e}`,shape:"x"===r?{type:"aabb",x:t,y:n.y+n.height/2,width:s,height:n.height}:{type:"aabb",x:n.x+n.width/2,y:t,width:n.width,height:s}})}return d}function q(e){let{plot:t,idPrefix:i="physics-scale",bounds:n={},xBins:r,xBands:o,yBands:a}=e,s=[];if(!1!==n&&s.push(...Ce(t,{idPrefix:i,...n})),r){let{idPrefix:e,yTop:n,yBottom:o,...a}=r;s.push(...qe({...a,idPrefix:e??i+"-xbin",yTop:n??t.y,yBottom:o??t.y+t.height}))}return o&&s.push(...C({band:o,idPrefix:o.idPrefix??i+"-xband",plot:t,projection:"x"})),a&&s.push(...C({band:a,idPrefix:a.idPrefix??i+"-yband",plot:t,projection:"y"})),s}function W(e){let{plot:t,rows:i,columns:n=i+1,pegRadius:r=3,idPrefix:o="galton-peg",yStart:a=t.y+.18*t.height,yEnd:s=t.y+.58*t.height,stagger:l=!0,restitution:u=.2,friction:d=.04}=e,p=Math.max(0,Math.floor(i)),c=Math.max(1,Math.floor(n));if(0===p)return[];let h=p>1?(s-a)/(p-1):0,m=t.width/c,f=[];for(let e=0;p>e;e+=1){let i=l&&e%2==1?m/2:0;for(let n=0;c>n;n+=1){let s=t.x+m*(n+.5)+i;t.x+r>s||s>t.x+t.width-r||f.push({id:`${o}-${e}-${n}`,shape:{type:"aabb",x:s,y:a+e*h,width:2*r,height:2*r},restitution:u,friction:d})}}return f}function X(e,t={}){let{idPrefix:i="physics-token",radius:n=5,shape:r,mass:o,vx:a,vy:s,spawnAt:l,seed:u=1,jitter:d,datum:p}=t,c=Yt(u),h=D(d,"x"),m=D(d,"y");return e.map((e,u)=>{let d=O(t.x,e,u,T(e,"x",0)),f=O(t.y,e,u,T(e,"y",0)),g=O(n,e,u,5),y="function"==typeof r?r(e,u):r??{type:"circle",radius:g};return{id:`${i}-${e.index??u}`,x:d+(c()-.5)*h,y:f+(c()-.5)*m,vx:O(a,e,u,0),vy:O(s,e,u,0),mass:O(o,e,u,1),spawnAt:O(l,e,u,void 0),shape:y,datum:p?p(e,u):e.datum??e}}).map(e=>{if(Number.isFinite(e.spawnAt))return e;let{spawnAt:t,...i}=e;return i})}function z(e,t={}){let{idPrefix:i="sediment",collider:n=!0,colliderThickness:r=1,restitution:o=.05,friction:a=.2,...s}=t,l=Nt(e,s),u=n?l.filter(e=>e.height>0).map(e=>({id:`${i}-${e.binId}`,shape:{type:"aabb",x:e.x+e.width/2,y:e.y+r/2,width:e.width,height:r},restitution:o,friction:a})):[];return{columns:l,colliders:u}}function L(e,t={}){let{timeAccessor:i="arrivalTime",timeScale:n=1,startAt:r=0,rebase:o=!0,sort:a=!0}=t,s=e.map((e,t)=>({spawn:e,time:function(e,t,i){return F("function"==typeof i?i(e,t):e[i]??e.datum?.[i])}(e,t,i)??e.spawnAt??t})),l=s.length?Math.min(...s.map(e=>e.time)):0;return{initialSpawns:s.map(({spawn:e,time:t})=>({...e,spawnAt:r+(o?t-l:t)})).sort((e,t)=>a?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:r,timeAccessor:"spawnAt",timeScale:n}}}import{BuiltInPhysicsEngineAdapter as V,ChainReactionChart as Q,CollisionSwarmChart as J,CrucibleChart as U,DEFAULT_CRUCIBLE_HEIGHT as H,DEFAULT_CRUCIBLE_OUTLETS as K,DEFAULT_CRUCIBLE_SIZE as G,DEFAULT_CRUCIBLE_WIDTH as _,EventDropChart as Z,GaltonBoardChart as ee,GauntletChart as te,GuantletChart as ie,PacketFlowChart as ne,PhysicalFlowChart as re,PhysicsCustomChart as oe,PhysicsPileChart as ae,PhysicsPipelineStore as se,PhysicsSVGOverlay as le,PhysicsSedimentAccumulator as ue,ProcessFlowChart as de,StreamPhysicsFrame as pe,StreamPhysicsFrame_default as ce,UnitPileChart as he,absorbRegion as me,aggregateRegionCounts as fe,applyCrucibleEvent as ge,applyGauntletEffect as ye,bodiesToAnnotationAnchors as be,bodyGroupSpec as xe,buildCollisionSwarmPhysics as we,buildCrucibleEvidence as ve,buildCrucibleInitialSpawns as Ae,buildCrucibleLayout as Ie,buildCruciblePhysicsConfig as Me,buildCrucibleProductEvents as Se,buildCrucibleProjection as Ee,buildCrucibleStateSpawns as Pe,buildCrucibleTerminalSpawns as je,buildEventDropPhysics as ke,buildGaltonBoardPhysics as Re,buildPhysicalFlowPhysics as Be,buildPhysicsAnnotationContext as Ne,buildPhysicsPile as $e,buildProcessFlowPhysics as Ye,calculateBlockerAmplification as Fe,capacitatedRegion as Oe,chargeGateRegion as Te,cloneCrucibleState as De,collidersFromPlotBounds as Ce,collidersFromXScaleBins as qe,compileCruciblePlan as We,compileDependencyMachine as Xe,composePhysicsControllers as ze,createCapacityQueueController as Le,createDefaultPhysicsEngineAdapter as Ve,createInitialCrucibleState as Qe,createLogicalJoin as Je,createPortalController as Ue,crucibleBondId as He,crucibleBoundaryColliders as Ke,crucibleComponentBodyId as Ge,crucibleProductBodyId as _e,crucibleProjectionRows as Ze,crucibleSemanticKey as et,defaultViability as tt,evaluateCrucibleConservation as it,evaluatePhysicsBodyBudget as nt,eventLogItem as rt,forceFieldRegion as ot,groupCompletionRows as at,matchesPhysicsBodyFilter as st,membraneRegion as lt,normalizePhysicsAnnotations as ut,physicsProcessBoundaryColliders as dt,physicsProcessGroupSemanticItems as pt,physicsProcessRegionSemanticItem as ct,physicsProcessStageSemanticItems as ht,planGauntletPropertyWork as mt,portalRegion as ft,pressureFieldRegion as gt,processChrome as yt,processLaneWalls as bt,processStageLayout as xt,processStageRegions as wt,readEventDropOccupancy as vt,recordGauntletEvent as At,regionCountsToProjectionRows as It,replaceGauntletNegative as Mt,replayCruciblePlan as St,replayStateTransitions as Et,resolveCrucibleSelector as Pt,resolveCrucibleSnapshotAt as jt,resolveCrucibleTime as kt,routeDependencyTracks as Rt,routeSurfaceRegion as Bt,sedimentHeightfield as Nt,valueAtPath as $t}from"./c-447VIMRO.min.js";import"./c-EBOQ7ER7.min.js";import{mulberry32 as Yt}from"./c-HYW2XA4Q.min.js";import"./c-VJTDST2R.min.js";import"./c-EUBTECGM.min.js";import{MultiLineTooltip as Ft,Tooltip as Ot,TooltipRoot as Tt,compileMotionEncoding as Dt,composeStyleRules as Ct,deriveMotionVector as qt,makeRuleValueResolver as Wt,markTooltipChrome as Xt,matchesThreshold as zt,opacityFromAge as Lt,resolveMotionAccessor as Vt,resolveMotionAge as Qt,resolveMotionVector as Jt,resolveStyleRules as Ut,ruleMatches as Ht}from"./c-LMGSSD2E.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import{hatchFillId as Kt,hatchPatternDef as Gt,isHatchFill as _t,resolveSvgFill as Zt}from"./c-553QUDKA.min.js";var ei=[.1,.5,.9],ti=1e6,ii="down",ni=24,ri=.12,oi=.55,ai=0,si=1,li=ce;export{V as BuiltInPhysicsEngineAdapter,Q as ChainReactionChart,J as CollisionSwarmChart,U as CrucibleChart,H as DEFAULT_CRUCIBLE_HEIGHT,K as DEFAULT_CRUCIBLE_OUTLETS,G as DEFAULT_CRUCIBLE_SIZE,_ as DEFAULT_CRUCIBLE_WIDTH,Z as EventDropChart,ee as GaltonBoardChart,te as GauntletChart,ie as GuantletChart,Ft as MultiLineTooltip,ne as PacketFlowChart,re as PhysicalFlowChart,oe as PhysicsCustomChart,ae as PhysicsPileChart,se as PhysicsPipelineStore,le as PhysicsSVGOverlay,ue as PhysicsSedimentAccumulator,de as ProcessFlowChart,pe as StreamPhysicsFrame,Ot as Tooltip,Tt as TooltipRoot,he as UnitPileChart,me as absorbRegion,fe as aggregateRegionCounts,ge as applyCrucibleEvent,L as arrivalReplay,be as bodiesToAnnotationAnchors,xe as bodyGroupSpec,we as buildCollisionSwarmPhysics,ve as buildCrucibleEvidence,Ae as buildCrucibleInitialSpawns,Ie as buildCrucibleLayout,Me as buildCruciblePhysicsConfig,Se as buildCrucibleProductEvents,Ee as buildCrucibleProjection,Pe as buildCrucibleStateSpawns,je as buildCrucibleTerminalSpawns,ke as buildEventDropPhysics,Re as buildGaltonBoardPhysics,Be as buildPhysicalFlowPhysics,Ne as buildPhysicsAnnotationContext,$e as buildPhysicsPile,Ye as buildProcessFlowPhysics,Fe as calculateBlockerAmplification,Oe as capacitatedRegion,Te as chargeGateRegion,De as cloneCrucibleState,q as collidersFromScales,A as comparePhysicsTrace,We as compileCruciblePlan,Xe as compileDependencyMachine,Dt as compileMotionEncoding,e as compilePhysicsEncoding,ze as composePhysicsControllers,Ct as composeStyleRules,Le as createCapacityQueueController,Ve as createDefaultPhysicsEngineAdapter,s as createDependencyGateController,Qe as createInitialCrucibleState,Je as createLogicalJoin,t as createPhysicsEncodingLayout,Ue as createPortalController,P as createProcessJourneyLedger,a as createServiceLevelController,r as createServiceResourcePoolController,He as crucibleBondId,Ke as crucibleBoundaryColliders,Ge as crucibleComponentBodyId,_e as crucibleProductBodyId,Ze as crucibleProjectionRows,et as crucibleSemanticKey,li as default,qt as deriveMotionVector,Y as describePhysicsStageGeography,it as evaluateCrucibleConservation,nt as evaluatePhysicsBodyBudget,ot as forceFieldRegion,W as galtonPegs,at as groupCompletionRows,Kt as hatchFillId,Gt as hatchPatternDef,_t as isHatchFill,Wt as makeRuleValueResolver,Xt as markTooltipChrome,zt as matchesThreshold,lt as membraneRegion,ut as normalizePhysicsAnnotations,Lt as opacityFromAge,N as physicsChargePoint,B as physicsDestination,dt as physicsProcessBoundaryColliders,pt as physicsProcessGroupSemanticItems,ct as physicsProcessRegionSemanticItem,ht as physicsProcessStageSemanticItems,y as physicsReferenceEnvelope,$ as physicsStageColliders,R as physicsStageGeography,mt as planGauntletPropertyWork,ft as portalRegion,gt as pressureFieldRegion,yt as processChrome,k as processJourneyRows,bt as processLaneWalls,xt as processStageLayout,wt as processStageRegions,d as processVolumePolygons,vt as readEventDropOccupancy,It as regionCountsToProjectionRows,Mt as replaceGauntletNegative,St as replayCruciblePlan,Et as replayStateTransitions,Pt as resolveCrucibleSelector,jt as resolveCrucibleSnapshotAt,kt as resolveCrucibleTime,i as resolveGauntletTerminalState,n as resolveGauntletTerminalStates,Vt as resolveMotionAccessor,Qt as resolveMotionAge,Jt as resolveMotionVector,Ut as resolveStyleRules,Zt as resolveSvgFill,Rt as routeDependencyTracks,Bt as routeSurfaceRegion,Ht as ruleMatches,z as sedimentBake,Nt as sedimentHeightfield,X as spawnFromTokens,u as stageTargetInVolume,j as updateProcessJourney};