semiotic 3.10.1 → 3.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/README.md +64 -63
  2. package/ai/artifact-surface-inventory.json +4 -1
  3. package/ai/behaviorContracts.cjs +1 -1
  4. package/ai/dist/mcp-server.js +25 -24
  5. package/ai/examples.md +28 -0
  6. package/ai/reference.md +9 -4
  7. package/ai/schema.json +121 -5
  8. package/ai/surface-manifest.json +3 -2
  9. package/ai/system-prompt.md +1 -1
  10. package/ai/task-packets/compare-category-totals.json +7 -53
  11. package/ai/task-packets/compare-category-totals.md +4 -4
  12. package/ai/task-packets/correct-published-chart.json +7 -53
  13. package/ai/task-packets/correct-published-chart.md +4 -4
  14. package/ai/task-packets/index.json +9 -9
  15. package/ai/task-packets/update-live-chart.json +8 -54
  16. package/ai/task-packets/update-live-chart.md +4 -4
  17. package/dist/c-27DCB5T6.min.js +18 -0
  18. package/dist/c-2MONF2P6.min.js +1 -0
  19. package/dist/c-3AGX252H.min.js +1 -0
  20. package/dist/c-3B6JZEZT.min.js +1 -0
  21. package/dist/c-3BYZXCX3.min.js +4 -0
  22. package/dist/c-3DIPZJDO.min.js +1 -0
  23. package/dist/c-3FOUMWLR.min.js +1 -0
  24. package/dist/c-3NA6I656.min.js +2 -0
  25. package/dist/c-3OFVBWQY.min.js +1 -0
  26. package/dist/{c-QA3HMQJP.min.js → c-3PFVJFBK.min.js} +1 -1
  27. package/dist/c-3PPO7ZJF.min.js +4 -0
  28. package/dist/c-3YEW2PK6.min.js +1 -0
  29. package/dist/c-43XNOQNQ.min.js +391 -0
  30. package/dist/c-4JKDJUYD.min.js +1 -0
  31. package/dist/c-4LKK5YWB.min.js +1 -0
  32. package/dist/c-4V3CD337.min.js +1 -0
  33. package/dist/c-4XLHPQTP.min.js +1 -0
  34. package/dist/c-5NYONM6V.min.js +5 -0
  35. package/dist/c-5PIKBUMF.min.js +1 -0
  36. package/dist/c-6IVBV5NO.min.js +1 -0
  37. package/dist/c-7APWCEPL.min.js +1 -0
  38. package/dist/{c-ORLEBW72.min.js → c-7FKPPCGN.min.js} +1 -1
  39. package/dist/c-ABMGCCLT.min.js +1 -0
  40. package/dist/c-AINGQGUN.min.js +1 -0
  41. package/dist/c-AXJ2QI3F.min.js +1 -0
  42. package/dist/c-BQYD7T4E.min.js +1 -0
  43. package/dist/{c-V4XMSLC3.min.js → c-BYJJ7EMG.min.js} +1 -1
  44. package/dist/c-C4SXYFXL.min.js +1 -0
  45. package/dist/c-CLDCKFBE.min.js +1 -0
  46. package/dist/c-CLJCJSFU.min.js +1 -0
  47. package/dist/c-CLLCX3PT.min.js +2 -0
  48. package/dist/c-CO4NDAD6.min.js +51 -0
  49. package/dist/c-ECHBKW7U.min.js +1 -0
  50. package/dist/c-EPJWM2UT.min.js +1 -0
  51. package/dist/c-FD2BXSRG.min.js +1 -0
  52. package/dist/c-FHNY57SO.min.js +209 -0
  53. package/dist/c-FMCUQ6JX.min.js +1 -0
  54. package/dist/c-FOTTQHOO.min.js +1 -0
  55. package/dist/c-FU7A5KSY.min.js +1 -0
  56. package/dist/c-GHN6IR4Y.min.js +1 -0
  57. package/dist/{c-J6DVC236.min.js → c-GK263BF4.min.js} +1 -1
  58. package/dist/c-GSCO3FWL.min.js +1 -0
  59. package/dist/c-GYLOSK7M.min.js +1 -0
  60. package/dist/c-HK4OSLZA.min.js +1 -0
  61. package/dist/c-HLGTD5SJ.min.js +1 -0
  62. package/dist/c-HNHKIMIV.min.js +61 -0
  63. package/dist/{c-D6HAAPTX.min.js → c-IBRLFKWA.min.js} +1 -1
  64. package/dist/c-IIV73MUW.min.js +1 -0
  65. package/dist/c-IJCZGUG6.min.js +31 -0
  66. package/dist/c-ISA6IJ6V.min.js +41 -0
  67. package/dist/c-JC76YAHB.min.js +33 -0
  68. package/dist/c-JJKRER47.min.js +1 -0
  69. package/dist/c-JO6AYCU4.min.js +1 -0
  70. package/dist/c-JOPGDP6N.min.js +1 -0
  71. package/dist/c-JWHPG6S2.min.js +1 -0
  72. package/dist/c-JXVYIXTV.min.js +1 -0
  73. package/dist/c-K2ZIYDI3.min.js +1 -0
  74. package/dist/c-K37JAIWA.min.js +4 -0
  75. package/dist/c-KXH7LFIL.min.js +26 -0
  76. package/dist/c-M43PK7K4.min.js +1 -0
  77. package/dist/c-MTX2AO5S.min.js +1 -0
  78. package/dist/c-N5WT7TXG.min.js +1 -0
  79. package/dist/c-NATWERHZ.min.js +1 -0
  80. package/dist/{c-42PLDTX7.min.js → c-O53GOO7H.min.js} +1 -1
  81. package/dist/c-OVQB75PE.min.js +1 -0
  82. package/dist/c-P3SKRNZN.min.js +1 -0
  83. package/dist/c-P5NXQWIM.min.js +1 -0
  84. package/dist/c-P7BQMVQQ.min.js +1 -0
  85. package/dist/{c-GNTXRXRN.min.js → c-PDQHLOKU.min.js} +1 -1
  86. package/dist/c-PITYSOPK.min.js +1 -0
  87. package/dist/c-QPO24R7Q.min.js +1 -0
  88. package/dist/c-QXLDCATV.min.js +1 -0
  89. package/dist/c-R2HUSWKB.min.js +1 -0
  90. package/dist/{c-HYW2XA4Q.min.js → c-RHDOOQ4X.min.js} +1 -1
  91. package/dist/c-RZPP5ERV.min.js +1 -0
  92. package/dist/c-SAP5KY6R.min.js +9 -0
  93. package/dist/{c-WUWXGQYA.min.js → c-SJIB5RNI.min.js} +1 -1
  94. package/dist/c-SQNEVNWT.min.js +1 -0
  95. package/dist/c-STHZWF3D.min.js +1 -0
  96. package/dist/c-TIDKVMMZ.min.js +1 -0
  97. package/dist/c-TIMGODBG.min.js +1 -0
  98. package/dist/c-TR7OHUAO.min.js +2 -0
  99. package/dist/c-TVKZC4BY.min.js +1 -0
  100. package/dist/c-U5XVLSHN.min.js +1 -0
  101. package/dist/c-U6NLVFN4.min.js +1 -0
  102. package/dist/{c-VJTDST2R.min.js → c-UBHICVSC.min.js} +1 -1
  103. package/dist/c-UMGHCBH5.min.js +114 -0
  104. package/dist/c-UOPPO26M.min.js +1 -0
  105. package/dist/c-UUDAON4Z.min.js +1 -0
  106. package/dist/c-V32TPPY2.min.js +1 -0
  107. package/dist/c-V5KFJWQQ.min.js +1 -0
  108. package/dist/c-VEMCBQZZ.min.js +100 -0
  109. package/dist/{c-P65V6HLO.min.js → c-VN557BQE.min.js} +1 -1
  110. package/dist/c-WD2RL76M.min.js +116 -0
  111. package/dist/c-Y342FJ6K.min.js +1 -0
  112. package/dist/c-YL7HJL5J.min.js +1 -0
  113. package/dist/c-YM6CT4LJ.min.js +1 -0
  114. package/dist/{c-MVR3RWF3.min.js → c-YMFUIO54.min.js} +1 -1
  115. package/dist/c-YQVOKPKR.min.js +1 -0
  116. package/dist/c-YRJ3BJQZ.min.js +1 -0
  117. package/dist/c-YT5KPVNP.min.js +1 -0
  118. package/dist/c-Z6GRGS53.min.js +1 -0
  119. package/dist/c-ZVOFLE2P.min.js +46 -0
  120. package/dist/components/CategoryColors.d.ts +7 -0
  121. package/dist/components/LinkedCharts.d.ts +2 -1
  122. package/dist/components/ai/audienceProfile.d.ts +18 -1
  123. package/dist/components/ai/describeChart.d.ts +5 -1
  124. package/dist/components/ai/intentManifest.d.ts +16 -0
  125. package/dist/components/ai/intentRegistry.d.ts +12 -0
  126. package/dist/components/ai/intents.d.ts +6 -6
  127. package/dist/components/ai/streamSchema.d.ts +19 -0
  128. package/dist/components/ai/streamingTypes.d.ts +57 -11
  129. package/dist/components/ai/suggestCharts.d.ts +1 -1
  130. package/dist/components/ai/suggestStreamCharts.d.ts +43 -8
  131. package/dist/components/ai/suggestStreamDashboard.d.ts +35 -0
  132. package/dist/components/ai/variantDiscovery.d.ts +1 -1
  133. package/dist/components/charts/ordinal/BarChart.streamCapability.d.ts +2 -0
  134. package/dist/components/charts/ordinal/DonutChart.streamCapability.d.ts +2 -0
  135. package/dist/components/charts/ordinal/GroupedBarChart.streamCapability.d.ts +2 -0
  136. package/dist/components/charts/ordinal/PieChart.streamCapability.d.ts +2 -0
  137. package/dist/components/charts/ordinal/StackedBarChart.streamCapability.d.ts +2 -0
  138. package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +14 -0
  139. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +6 -5
  140. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -1
  141. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -161
  142. package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +175 -0
  143. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +6 -5
  144. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +6 -5
  145. package/dist/components/charts/realtime/aggregate.d.ts +11 -1
  146. package/dist/components/charts/realtime/resolveWindowSize.d.ts +1 -1
  147. package/dist/components/charts/shared/DirectLabelLayer.d.ts +25 -0
  148. package/dist/components/charts/shared/directLabels.d.ts +12 -0
  149. package/dist/components/charts/shared/knownChartComponents.d.ts +4 -1
  150. package/dist/components/charts/shared/lineSeriesSsr.d.ts +0 -12
  151. package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
  152. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -1
  153. package/dist/components/charts/value/BigNumber.streamCapability.d.ts +2 -0
  154. package/dist/components/charts/value/GaugeChart.streamCapability.d.ts +2 -0
  155. package/dist/components/charts/xy/BubbleChart.d.ts +4 -1
  156. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -1
  157. package/dist/components/charts/xy/LineChart.d.ts +4 -1
  158. package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
  159. package/dist/components/data/transforms.d.ts +1 -0
  160. package/dist/components/realtime/HyperLogLog.d.ts +19 -0
  161. package/dist/components/realtime/ReorderBuffer.d.ts +2 -2
  162. package/dist/components/realtime/TDigest.d.ts +22 -0
  163. package/dist/components/realtime/WindowAccumulator.d.ts +22 -5
  164. package/dist/components/realtime/applyChangelog.d.ts +38 -0
  165. package/dist/components/realtime/minHeap.d.ts +3 -0
  166. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +1 -1
  167. package/dist/components/recipes/layout1d.d.ts +2 -20
  168. package/dist/components/recipes/minGapPlacement.d.ts +20 -0
  169. package/dist/components/semiotic-ai-core.d.ts +8 -3
  170. package/dist/components/semiotic-ai-stream.d.ts +10 -0
  171. package/dist/components/semiotic-ai.d.ts +4 -6
  172. package/dist/components/semiotic-realtime-core.d.ts +6 -2
  173. package/dist/components/semiotic-stream-types.d.ts +14 -0
  174. package/dist/components/semiotic-xy.d.ts +1 -0
  175. package/dist/components/semiotic.d.ts +3 -11
  176. package/dist/components/server/encodeSvgFramesToGif.d.ts +2 -0
  177. package/dist/components/server/rasterizeSVG.d.ts +2 -0
  178. package/dist/components/server/registerServerXYPlugins.d.ts +2 -0
  179. package/dist/components/server/renderEvidence.d.ts +4 -0
  180. package/dist/components/server/serverChartConfigs.d.ts +5 -0
  181. package/dist/components/server/serverChartConfigsRealtime.d.ts +6 -0
  182. package/dist/components/server/serverRealtimeCategoryColors.d.ts +3 -0
  183. package/dist/components/server/staticAnnotations.d.ts +9 -0
  184. package/dist/components/stream/SceneGraph.d.ts +3 -3
  185. package/dist/components/stream/StalenessBadge.d.ts +5 -2
  186. package/dist/components/stream/pipelinePathJoin.d.ts +27 -0
  187. package/dist/components/stream/pipelineTransitionTypes.d.ts +43 -0
  188. package/dist/components/stream/pipelineTransitions.d.ts +5 -35
  189. package/dist/components/stream/seriesGeometry.d.ts +2 -1
  190. package/dist/components/stream/streamEncodingTypes.d.ts +9 -0
  191. package/dist/components/stream/types.d.ts +25 -2
  192. package/dist/components/text/axisLabelAssessment.d.ts +15 -0
  193. package/dist/components/text/browserAxisLabelAssessment.d.ts +1 -0
  194. package/dist/components/text/browserLabelMeasurement.d.ts +3 -0
  195. package/dist/components/text/labelMeasurement.d.ts +19 -0
  196. package/dist/components/text/labelPlacement.d.ts +71 -0
  197. package/dist/components/text/useAxisLabelAssessment.d.ts +6 -0
  198. package/dist/components/text/useLabelMeasurer.d.ts +3 -0
  199. package/dist/controls.module.min.js +71 -1
  200. package/dist/geo.min.js +231 -1
  201. package/dist/geo.module.min.js +31 -1
  202. package/dist/network.module.min.js +1 -1
  203. package/dist/ordinal.module.min.js +1 -1
  204. package/dist/physics-matter.module.min.js +1 -1
  205. package/dist/physics-rapier.module.min.js +1 -1
  206. package/dist/physics.module.min.js +1 -1
  207. package/dist/physicsWorker.js +1 -1
  208. package/dist/rough.min.js +2 -1
  209. package/dist/rough.module.min.js +2 -1
  210. package/dist/semiotic-access.module.min.js +1 -1
  211. package/dist/semiotic-ai-artifact-policy-constants.module.min.js +1 -1
  212. package/dist/semiotic-ai-core.d.ts +8 -3
  213. package/dist/semiotic-ai-core.min.js +4 -1
  214. package/dist/semiotic-ai-core.module.min.js +4 -1
  215. package/dist/semiotic-ai-hash-primitives.module.min.js +1 -1
  216. package/dist/semiotic-ai.d.ts +4 -6
  217. package/dist/semiotic-ai.module.min.js +14 -1
  218. package/dist/semiotic-artifact-react.min.js +269 -1
  219. package/dist/semiotic-artifact-react.module.min.js +137 -1
  220. package/dist/semiotic-artifact.min.js +3 -1
  221. package/dist/semiotic-artifact.module.min.js +3 -1
  222. package/dist/semiotic-atlas-core.min.js +2 -1
  223. package/dist/semiotic-atlas-core.module.min.js +1 -1
  224. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  225. package/dist/semiotic-atlas.module.min.js +11 -1
  226. package/dist/semiotic-client-cjs-shared.min.js +1530 -1
  227. package/dist/semiotic-client-glyph.module.min.js +3 -1
  228. package/dist/semiotic-client-responsive.module.min.js +1 -1
  229. package/dist/semiotic-client-shared.module.min.js +1 -1
  230. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -1
  231. package/dist/semiotic-data.min.js +1 -1
  232. package/dist/semiotic-data.module.min.js +1 -1
  233. package/dist/semiotic-evidence.min.js +3 -1
  234. package/dist/semiotic-evidence.module.min.js +3 -1
  235. package/dist/semiotic-experimental-auxiliary.module.min.js +8 -1
  236. package/dist/semiotic-experimental-node-auxiliary.module.min.js +8 -1
  237. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  238. package/dist/semiotic-experimental-vacp.min.js +1 -1
  239. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  240. package/dist/semiotic-line.module.min.js +1 -1
  241. package/dist/semiotic-realtime-core.d.ts +6 -2
  242. package/dist/semiotic-realtime-core.module.min.js +1 -1
  243. package/dist/semiotic-realtime-react.module.min.js +1 -1
  244. package/dist/semiotic-recipes-core-cjs-base.min.js +160 -1
  245. package/dist/semiotic-recipes-core.module.min.js +72 -1
  246. package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
  247. package/dist/semiotic-recipes-react.min.js +3 -1
  248. package/dist/semiotic-server-edge-node.module.min.js +391 -1
  249. package/dist/semiotic-server-edge.min.js +651 -1
  250. package/dist/semiotic-server-edge.module.min.js +372 -1
  251. package/dist/semiotic-server-node.min.js +651 -1
  252. package/dist/semiotic-server-node.module.min.js +1 -1
  253. package/dist/semiotic-text.min.js +1 -1
  254. package/dist/semiotic-text.module.min.js +1 -1
  255. package/dist/semiotic-themes-core.min.js +1 -1
  256. package/dist/semiotic-themes-core.module.min.js +1 -1
  257. package/dist/semiotic-themes.min.js +1 -1
  258. package/dist/semiotic-themes.module.min.js +1 -1
  259. package/dist/semiotic-utils-core.min.js +11 -1
  260. package/dist/semiotic-utils-core.module.min.js +8 -1
  261. package/dist/semiotic-value.module.min.js +15 -1
  262. package/dist/semiotic-xy.d.ts +1 -0
  263. package/dist/semiotic.d.ts +3 -11
  264. package/dist/semiotic.module.min.js +10 -1
  265. package/dist/server.min.js +651 -1
  266. package/dist/server.module.min.js +1 -1
  267. package/dist/xy.module.min.js +1 -1
  268. package/package.json +8 -7
  269. package/dist/c-2N7IU2NY.min.js +0 -1
  270. package/dist/c-2RL2QPZJ.min.js +0 -1
  271. package/dist/c-2WK7YJLL.min.js +0 -1
  272. package/dist/c-45CQWZZ6.min.js +0 -1
  273. package/dist/c-4BRHKVKV.min.js +0 -1
  274. package/dist/c-7242NXSG.min.js +0 -1
  275. package/dist/c-7DVPSB5C.min.js +0 -1
  276. package/dist/c-7EGHJU2F.min.js +0 -1
  277. package/dist/c-A7OGOFSL.min.js +0 -1
  278. package/dist/c-AFBSWT77.min.js +0 -1
  279. package/dist/c-AH5HWZWS.min.js +0 -1
  280. package/dist/c-AJ7EC32V.min.js +0 -1
  281. package/dist/c-AQADQNY7.min.js +0 -1
  282. package/dist/c-ATM475SA.min.js +0 -1
  283. package/dist/c-AVO3Q7T7.min.js +0 -1
  284. package/dist/c-B7GW7IHJ.min.js +0 -1
  285. package/dist/c-BNFJMDHN.min.js +0 -1
  286. package/dist/c-BOHCQILI.min.js +0 -1
  287. package/dist/c-C3TZLTZK.min.js +0 -1
  288. package/dist/c-CGQAQWBV.min.js +0 -1
  289. package/dist/c-CPV4N35K.min.js +0 -1
  290. package/dist/c-DIPEYUOW.min.js +0 -1
  291. package/dist/c-E4JDJH4I.min.js +0 -1
  292. package/dist/c-E72OTUZU.min.js +0 -1
  293. package/dist/c-E7I2L7CU.min.js +0 -1
  294. package/dist/c-ELDWAO2V.min.js +0 -1
  295. package/dist/c-EUBTECGM.min.js +0 -1
  296. package/dist/c-EUMPMDCS.min.js +0 -1
  297. package/dist/c-EZZT2WAE.min.js +0 -1
  298. package/dist/c-FHBVFCQB.min.js +0 -1
  299. package/dist/c-G4HCO2IQ.min.js +0 -1
  300. package/dist/c-G5VIJEOK.min.js +0 -1
  301. package/dist/c-GHVOXAYH.min.js +0 -1
  302. package/dist/c-GXV3C3MO.min.js +0 -1
  303. package/dist/c-HHTK2R75.min.js +0 -1
  304. package/dist/c-HLLFJYTY.min.js +0 -1
  305. package/dist/c-HP4ZFM47.min.js +0 -1
  306. package/dist/c-HPOYKCCG.min.js +0 -1
  307. package/dist/c-HYDTS5OP.min.js +0 -1
  308. package/dist/c-I4QJ6YLM.min.js +0 -1
  309. package/dist/c-IK33LNZ6.min.js +0 -1
  310. package/dist/c-IK3PZHRY.min.js +0 -1
  311. package/dist/c-JIMJF6F6.min.js +0 -1
  312. package/dist/c-JUKIWTBJ.min.js +0 -1
  313. package/dist/c-KKPMHAZC.min.js +0 -1
  314. package/dist/c-L6WNDBHV.min.js +0 -1
  315. package/dist/c-LDEX5OFW.min.js +0 -1
  316. package/dist/c-LESEUVC5.min.js +0 -1
  317. package/dist/c-LYQMZMZQ.min.js +0 -1
  318. package/dist/c-MB6CV5NC.min.js +0 -1
  319. package/dist/c-MOKJOIPE.min.js +0 -1
  320. package/dist/c-N3FXLRNT.min.js +0 -1
  321. package/dist/c-N5NPTJVJ.min.js +0 -1
  322. package/dist/c-NHBL4J67.min.js +0 -1
  323. package/dist/c-ODG6TFSY.min.js +0 -1
  324. package/dist/c-PRIKOLTE.min.js +0 -1
  325. package/dist/c-PSKKFZNP.min.js +0 -1
  326. package/dist/c-PSNI6KAZ.min.js +0 -1
  327. package/dist/c-QAVFOEUY.min.js +0 -1
  328. package/dist/c-R2P4RR7Q.min.js +0 -1
  329. package/dist/c-RFC7UAG7.min.js +0 -1
  330. package/dist/c-S3AZX5PP.min.js +0 -1
  331. package/dist/c-SGAURYHG.min.js +0 -1
  332. package/dist/c-SJMWU6UX.min.js +0 -1
  333. package/dist/c-STIIGQOD.min.js +0 -1
  334. package/dist/c-T2ASIJVZ.min.js +0 -1
  335. package/dist/c-T2V7O2LO.min.js +0 -1
  336. package/dist/c-TKG2NP7G.min.js +0 -1
  337. package/dist/c-TX3THUTO.min.js +0 -1
  338. package/dist/c-TX7XJM3Z.min.js +0 -1
  339. package/dist/c-UC7SIU2W.min.js +0 -1
  340. package/dist/c-UMXSJIOV.min.js +0 -1
  341. package/dist/c-VRSXMLYF.min.js +0 -1
  342. package/dist/c-VSLWSAN2.min.js +0 -1
  343. package/dist/c-VXLOLYTO.min.js +0 -1
  344. package/dist/c-W4ZUKSEQ.min.js +0 -1
  345. package/dist/c-WCBRPILW.min.js +0 -1
  346. package/dist/c-WGHT7OCY.min.js +0 -1
  347. package/dist/c-WWCW3APR.min.js +0 -1
  348. package/dist/c-XSB27XPS.min.js +0 -1
  349. package/dist/c-Y6PYUMFU.min.js +0 -1
  350. package/dist/c-YDECTEUW.min.js +0 -1
  351. package/dist/c-YF3YKVQI.min.js +0 -1
  352. package/dist/c-YLZIV3VS.min.js +0 -1
  353. package/dist/c-ZIVPFTOC.min.js +0 -1
@@ -0,0 +1,114 @@
1
+ function e(e,t,n={}){return Number.isFinite(t)&&t>0&&!Number.isNaN(e)?e===1/0?"expired":0>e||t*(n.fresh??1)>e?"fresh":t*(n.aging??1.5)>e?"aging":t*(n.stale??3)>e?"stale":"expired":"fresh"}function t(e,t,n){if(null!=e)return"function"==typeof e?e(t,n):"object"==typeof e&&null!==e&&"constant"in e?e.constant:t[e]}function n(e){let{data:n,encoding:i}=e,r=[],a=/* @__PURE__ */new Map;return n.forEach((e,n)=>{let o=t(i.id,e,n);if(null==o||""===o)throw Error(`[semiotic] Motion encoding row ${n} resolved an empty id.`);let l=o+"";if(a.has(l))throw Error(`[semiotic] Duplicate motion encoding id "${l}".`);let s=t(i.process?.group,e,n),c=t(i.process?.stage,e,n),u=t(i.accessible?.group,e,n)??(null!=s?s+"":null!=c?c+"":void 0),d={};for(let r of Object.keys(i.evidence??{}))d[r]=t(i.evidence?.[r],e,n);let h={id:l,datum:e,time:{arrival:t(i.time?.arrival,e,n),basis:i.time?.basis,unit:i.time?.unit},placement:{x:t(i.placement?.x,e,n),y:t(i.placement?.y,e,n),lane:t(i.placement?.lane,e,n),space:i.placement?.space},kinematics:{velocityX:t(i.kinematics?.velocityX,e,n),velocityY:t(i.kinematics?.velocityY,e,n),space:i.kinematics?.space},process:{group:s,stage:c,target:t(i.process?.target,e,n),work:t(i.process?.work,e,n)},evidence:d,accessible:{description:t(i.accessible?.description,e,n),group:u,label:t(i.accessible?.label,e,n)??l}};r.push(h),a.set(l,h)}),{rows:r,byId:a}}function i(t){let n=t.now-t.arrival;return{age:n,progress:Number.isFinite(n)&&Number.isFinite(t.ttl)&&t.ttl>0?Math.max(0,n)/t.ttl:n===1/0&&Number.isFinite(t.ttl)&&t.ttl>0?1/0:0,lifecycle:e(n,t.ttl,t.thresholds)}}function r(e){let t=Math.max(0,Math.min(1,e.minOpacity??.1));if(Number.isNaN(e.age))return 1;if(e.age===1/0)return t;if(!Number.isFinite(e.extent)||0>=e.extent)return 1;let n=Math.max(0,e.age);if("step"===e.type)return(e.threshold??.5*e.extent)>n?1:t;if("exponential"===e.type){let i=e.halfLife??e.extent/2;return t+Math.pow(.5,n/(i>0?i:e.extent/2))*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function a(e,t){let n=Number.isFinite(e)?e:0,i=Number.isFinite(t)?t:0;return{velocityX:n,velocityY:i,speed:Math.hypot(n,i),direction:Math.atan2(i,n)}}function o(e,t,n){return Number.isFinite(n)&&n>0?a((t.x-e.x)/n,(t.y-e.y)/n):a(0,0)}function l(e,t){return(e+"").length*t*.6}function s(e){return void 0===e||!0===e||"halo"===e?{type:"halo"}:!1===e||"none"===e?null:"box"===e?{type:"box"}:{...e,type:e.type??"halo"}}function c(e){let{x:t,y:n,text:i,fill:r,fontSize:a=12,fontWeight:o,fontFamily:c,textAnchor:u="start",dominantBaseline:d,background:h,className:f}=e,m=s(h),p=e=>/* @__PURE__ */na("text",{x:t,y:n,textAnchor:u,dominantBaseline:d,fill:r,fontSize:a,fontWeight:o,fontFamily:c,className:f,...e?{style:{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}}:{},children:i});if(!m)return p();if("halo"===m.type)return p({stroke:m.fill??ra,strokeWidth:m.haloWidth??3});let y,g,b=m.padding??{x:6,y:3},x="number"==typeof b?b:b.x,v="number"==typeof b?b:b.y,w=l(i,a),k=a+2*v;return y="middle"===u?t-w/2-x:"end"===u?t-w-x:t-x,g="middle"===d||"central"===d?n-k/2:"hanging"===d||"text-before-edge"===d?n-v:n-.8*a-v,/* @__PURE__ */ia("g",{className:f,children:[
2
+ /* @__PURE__ */na("rect",{x:y,y:g,width:w+2*x,height:k,rx:m.radius??3,ry:m.radius??3,fill:m.fill??ra,fillOpacity:m.opacity??.85,stroke:m.stroke,strokeWidth:m.strokeWidth}),p()]})}function u(e){let t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:n+""}function d(e){let t=_r(e=>e.pushObservation),n=aa.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return aa.useMemo(()=>({...e,onObservation:n}),[n,e])}function h(e){let t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}function f(e,t={}){let n=u(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(i){let r=h(i);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:r}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:r,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function m(e){return e instanceof Element&&null!=e.closest("[data-semiotic-annotation-widget]")}function p({chrome:e="default",className:t="",style:n,children:i,...r}){let a="default"===e?{...sa,...n}:n;/* @__PURE__ */
3
+ return la("div",{...r,"data-semiotic-tooltip-chrome":!0,className:("semiotic-tooltip "+t).trim(),style:a,children:i})}function y(e){return e.ownsChrome=!0,e}function g(e){if("string"!=typeof e)return null!=e;let t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function b(e){if(!oa.isValidElement(e))return!1;let t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;let n=e.props,i=n["data-semiotic-tooltip-chrome"];if(null!=i&&!1!==i&&"false"!==i)return!0;let r=n.style;return!(!r||"object"!=typeof r||!g(r.background)&&!g(r.backgroundColor))}function x(e,t){for(let n of t){let t=e.find(e=>e.lower===n);if(t)return t}}function v(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};let n=t.maxEntries??6,i=!1!==t.skipPositional,r=[];for(let[t,n]of Object.entries(e)){if(t.startsWith("_")||"data"===t)continue;let e=t.toLowerCase();if(i&&ha.has(e)||null==n)continue;let a=typeof n;"string"!==a&&"number"!==a&&"boolean"!==a&&!(n instanceof Date)||r.push({key:t,lower:e,value:n})}if(0===r.length)return{entries:[]};let a=r.findIndex(e=>ca.includes(e.lower)),o=a>=0;0>a&&(a=r.findIndex(e=>"id"===e.lower)),0>a&&(a=r.findIndex(e=>"string"==typeof e.value));let l=0>a?void 0:r[a],s=r.filter((e,t)=>t!==a&&(!o||"id"!==e.lower)),c=x(s,ua),u=x(s,da),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(let e of s){if(d.length>=n)break;ua.includes(e.lower)||da.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:l?.key,title:l?.value,entries:d}}function w(e,t){return"touch"===t?Math.max(e,24):e}function k(e){return Array.isArray(e)?e[0]:e}function M(e,t,n,i){return{data:k(e),x:t,y:n,__semioticHoverData:!0,...i}}function A(e,t){return"function"==typeof t?t(e):e[t]}function S(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";let t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}if(e instanceof Date)return e.toLocaleDateString();if("object"==typeof e&&null!==e){if(void 0!==e.id)return e.id+"";if(void 0!==e.name)return e.name+"";try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return e+""}function C(e={}){let{fields:t,title:n,format:i,style:r={},className:a=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let o,l=[];if(n){let t=A(e,n);o=S(t,i)}if(t&&t.length>0)t.forEach(t=>{let n,r,a;"string"==typeof t?(n=t,r=t,a=i):(n=t.label,r=t.accessor||t.key||"",a=t.format||i);let o=A(e,r);l.push({label:n,value:S(o,a)})});else if(!n){let t=["value","y","name","id","label"];for(let n of t)if(void 0!==e[n]){o=S(e[n],i);break}if(!o){let t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(o=S(e[t[0]],i))}}/* @__PURE__ */
4
+ return ma(p,{className:a,style:r,children:[o&&/* @__PURE__ */fa("div",{style:{fontWeight:l.length>0?"bold":"normal"},children:o}),l.map((e,t)=>/* @__PURE__ */ma("div",{style:{marginTop:0===t&&o?"4px":0},children:[e.label&&/* @__PURE__ */ma("span",{children:[e.label,": "]}),e.value]},t))]})}}function $(e={}){let{fields:t=[],title:n,format:i,style:r={},className:a="",showLabels:o=!0,separator:l=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;let s=[];if(n){let t=A(e,n);s.push({value:S(t,i)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let n,r,a;"string"==typeof t?(n=t,r=t,a=i):(n=t.label,r=t.accessor||t.key||"",a=t.format||i);let l=S(A(e,r),a);s.push({label:o?n:void 0,value:l})});else{let t=v(e,{skipPositional:!1});null!=t.title&&s.push({label:void 0,value:S(t.title,i),bold:!0}),t.entries.forEach(e=>{s.push({label:o?e.key:void 0,value:S(e.value,i)})})}return Array.isArray(s)&&0!==s.length?/* @__PURE__ */fa(p,{className:("semiotic-tooltip-multiline "+a).trim(),style:r,children:s.map((e,t)=>/* @__PURE__ */ma("div",{style:{marginBottom:s.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */ma("strong",{children:[e.label,l]}),e.value]},t))}):null}}function j(e){return"multi"===e||L(e)}function L(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function N(e){let{tooltip:t,defaultTooltipContent:n,multiDefaultContent:i=z(),customFunctionContext:r="datum"}=e,a=t;return!1===t?{tooltipContent:()=>null}:j(a)?{tooltipContent:(L(a)&&"function"==typeof a.content?F(a.content):void 0)||i,tooltipMode:"multi"}:"hover"===r&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:F(a)||n}}function I(e){let{tooltip:t,defaultTooltipContent:n,customFunctionContext:i="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:F(t)||n}}function z(){return e=>{let t=e.allSeries;if(!t||0===t.length)/* @__PURE__ */
5
+ return fa(p,{children:/* @__PURE__ */fa("div",{children:S(e.data?.value??e.data?.y)})});let n=e.xValue??e.data?.time??e.data?.x;/* @__PURE__ */
6
+ return ma(p,{children:[null!=n&&/* @__PURE__ */fa("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:S(n)}),t.map((e,t)=>/* @__PURE__ */ma("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[
7
+ /* @__PURE__ */fa("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),
8
+ /* @__PURE__ */fa("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),
9
+ /* @__PURE__ */fa("span",{style:{fontWeight:500,fontSize:"0.85em"},children:S(e.value)})]},t))]})}}function F(e){if(!0!==e){if("function"==typeof e){let t=e;return e=>{let n=!0===e?.__semioticHoverData||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),i=k(n?e.data??{}:e);if(!i||(("node"===e?.nodeOrEdge&&"number"==typeof i?.x0&&"number"==typeof i?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof i?.sankeyWidth)&&i.data&&"object"==typeof i.data&&(i=i.data),!i))return null;if(n&&(void 0!==e.allSeries||void 0!==e.xValue)){let t={...i};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),i=t}let r=t(i);return null==r?null:b(r)?r:/* @__PURE__ */fa(p,{children:r})}}if(!1===e||void 0===e)return!1;if(L(e)){if("function"==typeof e.content)return F(e.content);"u">typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');let t=$();return F(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){let t=C(e);return F(e=>t(e))}if("multi"===e){"u">typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');let e=$();return F(t=>e(t))}return C()}}function T({componentName:e,message:t,diagnosticHint:n,width:i,height:r}){/* @__PURE__ */
10
+ return ya("div",{role:"alert",style:{width:i,height:Math.max(r,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:/* @__PURE__ */ga("div",{style:{textAlign:"center",maxWidth:400},children:[
11
+ /* @__PURE__ */ya("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),
12
+ /* @__PURE__ */ya("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&/* @__PURE__ */ya("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:n})]})})}function R({colors:e,children:t}){/* @__PURE__ */
13
+ return Ma(Aa.Provider,{value:e,children:t})}function O(e){let t=wa(Aa),n=wa(Sa);return e?n:t}function W({colors:e,categories:t,colorScheme:n="category10",children:i}){let r=ka(()=>{if(e)return e;if(t){if(n&&"object"==typeof n&&!Array.isArray(n)){let e=n,i=0;return Object.fromEntries(t.map(t=>[t,Ar(e,t)??xr[i++%xr.length]]))}let e=Array.isArray(n)?n:wr(n,void 0);return Object.fromEntries(t.map((t,n)=>[t,e[n%e.length]]))}return{}},[e,t,n]);/* @__PURE__ */
14
+ return Ma(Sa.Provider,{value:r,children:/* @__PURE__ */Ma(Aa.Provider,{value:r,children:i})})}function D(){return wa(Aa)}function E(){for(let e of Ia)e()}function B(e,t,n){let i=Na.positions.get(e);i?.locked||i&&i.xValue===t&&i.sourceId===n||(Na={positions:new Map(Na.positions).set(e,{xValue:t,sourceId:n})},E())}function H(e,t){let n=Na.positions.get(e);if(n?.locked||!n||n.sourceId!==t)return;let i=new Map(Na.positions);i.delete(e),Na={positions:i},E()}function P(e,t,n){if(Na.positions.get(e)?.locked){let t=new Map(Na.positions);return t.delete(e),Na={positions:t},E(),!1}return Na={positions:new Map(Na.positions).set(e,{xValue:t,sourceId:n,locked:!0})},E(),!0}function G(e,t){let n=Na.positions.get(e);if(!n?.locked||t&&n.sourceId!==t)return;let i=new Map(Na.positions);i.delete(e),Na={positions:i},E()}function V(){return Na}function _(e){return Ia.add(e),()=>Ia.delete(e)}function Y(){return()=>{}}function U(){return za}function X(e){let t=La(e?_:Y,e?V:U,e?V:U);return e?t.positions.get(e)??null:null}function q(e){let t=Ca(),n=e.clientId||t,{name:i}=e,r=qr(e=>e.selections.get(i)),a=qr(e=>e.setClause),o=qr(e=>e.clearClause),l=$a(()=>!!r&&r.clauses.size>0,[r]);return{predicate:$a(()=>r&&0!==r.clauses.size?Ur(r,n):()=>!0,[r,n]),isActive:l,selectPoints:ja(e=>{let t={},r=!1;for(let[n,i]of Object.entries(e))t[n]={type:"point",values:new Set(i)},r=!0;r&&a(i,{clientId:n,type:"point",fields:t})},[n,i,a]),selectInterval:ja(e=>{let t={},r=!1;for(let[n,i]of Object.entries(e))t[n]={type:"interval",range:i},r=!0;r&&a(i,{clientId:n,type:"interval",fields:t})},[n,i,a]),clear:ja(()=>{o(i,n)},[o,i,n]),clientId:n}}function K(e,t){let n=Ca(),i=t||n,r=qr(e=>e.setClause),a=qr(e=>e.clearClause);return{selectPoints:ja(t=>{let n={},a=!1;for(let[e,i]of Object.entries(t))n[e]={type:"point",values:new Set(i)},a=!0;a&&r(e,{clientId:i,type:"point",fields:n})},[e,i,r]),clear:ja(()=>a(e,i),[e,i,a]),clientId:i}}function Z(e){let t=e.name||"hover",{fields:n}=e,{predicate:i,isActive:r,selectPoints:a,clear:o}=q({name:t,fields:n});return{onHover:ja(e=>{if(!e)return void o();let t=Qr(e),i={};for(let r of n){let n=t[r];if(void 0!==n)i[r]=[n];else{let t=Jr(e)?.map(e=>Qr(e)[r]).filter(e=>void 0!==e);t?.length&&(i[r]=[...new Set(t)])}}Pr(i)?a(i):o()},[n,a,o]),predicate:i,isActive:r}}function J(e){return 2===e.length&&Array.isArray(e[0])&&2===e[0].length&&Array.isArray(e[1])&&2===e[1].length}function Q(e){return 2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function ee(e){let{name:t,xField:n,yField:i}=e,{predicate:r,isActive:a,selectInterval:o,clear:l}=q({name:t,fields:[n,i].filter(Boolean)}),s=n&&i?"xyBrush":n?"xBrush":"yBrush",c=ja(e=>{if(!e)return void l();let t={};"xyBrush"===s&&J(e)?(n&&(t[n]=[Math.min(e[0][0],e[1][0]),Math.max(e[0][0],e[1][0])]),i&&(t[i]=[Math.min(e[0][1],e[1][1]),Math.max(e[0][1],e[1][1])])):"xBrush"===s&&Q(e)?n&&(t[n]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]):"yBrush"===s&&Q(e)&&i&&(t[i]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]),Pr(t)&&o(t)},[s,n,i,o,l]);return{brushInteraction:$a(()=>({brush:s,during:c,end:c}),[s,c]),predicate:r,isActive:a,clear:l}}function te(e,t,n){let i=qr(e=>e.selections.get(t));return $a(()=>{if(!i||0===i.clauses.size)return e;let t=Ur(i,n);return e.filter(t)},[e,i,n])}function ne(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ie(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}function re(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}function ae(e,t){let{when:n}=e,i=t.width,r=t.height,a=re(t),o=ie(t);return!("number"==typeof n.minWidth&&n.minWidth>i||"number"==typeof n.maxWidth&&i>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof r||n.minHeight>r)||"number"==typeof n.maxHeight&&("number"!=typeof r||r>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof a||n.minAspectRatio>a)||"number"==typeof n.maxAspectRatio&&("number"!=typeof a||a>n.maxAspectRatio)||n.orientation&&o!==n.orientation)}function oe(e,t){let n={...e,...t};for(let i of["margin","frameProps","mobileSemantics","style"])ne(e[i])&&ne(t[i])&&(n[i]={...e[i],...t[i]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}function le(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};let i=n.map((e,t)=>({rule:e,index:t})).filter(e=>ae(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:i.reduce((e,t)=>oe(e,t.rule.transform),e),matches:i}}function se(e={}){let{limit:t=50,types:n,chartId:i}=e,r=_r(e=>e.version),a=_r(e=>e.observations),o=_r(e=>e.clearObservations),l=Fa(()=>{let e=a;if(n&&n.length>0){let t=new Set(n);e=e.filter(e=>t.has(e.type))}return i&&(e=e.filter(e=>e.chartId===i)),e.length>t&&(e=e.slice(e.length-t)),e},[a,n,i,t,r]);return{observations:l,latest:l.length>0?l[l.length-1]:null,clear:o}}function ce(e){let t=2166136261;for(let n=0;e.length>n;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function ue(e,t){let n=e.get(t);if(void 0!==n)return n;if(e.size>=4096)return ce(t);let i=e.size;return e.set(t,i),i}function de(e){let t=e?.find(e=>"bottom"===e.orient),n=e?.find(e=>"top"===e.orient),i=e?.find(e=>"left"===e.orient),r=e?.find(e=>"right"===e.orient);return{bottomAxis:t,topAxis:n,leftAxis:i,rightAxis:r,xAxis:t??n,yAxis:i??r,xOrient:t||!n?"bottom":"top",yOrient:i||!r?"left":"right"}}function he(e){let t=6;for(let n=1;e.length>n;n++){let i=Math.abs(e[n]-e[n-1]);i>0&&Number.isFinite(i)&&(t=Math.max(t,Math.ceil(Math.log10(Math.max(Math.abs(e[n]),Math.abs(e[n-1]))/i))+1))}let n=Math.min(17,t);return e=>Number.isInteger(e)?e+"":Number(e.toPrecision(n))+""}function fe(...e){let t;for(let n of e)n&&(t=me(t)&&me(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function me(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function pe(e){return"object"==typeof e&&null!==e&&"gradient"in e}function ye(e,t,n=!1){let i=n?t?58:34:t?36:0;return i>e.top?{...e,top:i}:e}function ge(e,t,n,i,r=8){let a=i,o="left"===i?"right":"right"===i?"left":"top"===i?"bottom":"top",l=Math.max(t[a],Math.max(0,("left"===i||"right"===i?n[0]:n[1])-r)-e[o]);e[a]>l&&(e[a]=l)}function be(e){return Math.ceil(7*e.length)}function xe(e,t){if(me(e)){let n=Ie(t),i=100;for(let t of e.legendGroups){t.label&&(i=Math.max(i,be(t.label)));for(let e of t.items)i=Math.max(i,n.swatchSize+n.labelGap+be(e.label))}return i}if(pe(e)){let{gradient:t}=e,n=t.format||he(t.domain),i=Math.max(be(n(t.domain[0])),be(n(t.domain[1]))),r=t.label?be(t.label):0;return Math.max(100,19+i,r)}return 100}function ve(e){return(me(e)||pe(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function we(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?Ua:Ya:0}function ke(e){return Math.max(0,e?.edgeGutter??3)}function Me(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?64:46:22:0}function Ae(e){let{bottomAxis:t,topAxis:n,leftAxis:i,rightAxis:r}=de(e.axes),a=!(n&&!t||!1===t?.visible),o=!!n&&!t&&!1!==n.visible,l=!(r&&!i||!1===i?.visible),s=!!r&&!1!==r.visible,c=!1!==e.showAxes;return{hasAxis:c&&a,hasAxisLabel:c&&a&&!!(t?.label??e.xLabel),rotatedTicks:c&&a&&(e.rotatedTicks??!!t?.autoRotate),topAxis:o?{hasAxis:c,hasAxisLabel:c&&!!(n?.label??e.xLabel),rotatedTicks:c&&(e.rotatedTicks??!!n?.autoRotate)}:void 0,leftAxis:l?{hasAxis:c,hasAxisLabel:c&&!!(i?.label??e.yLabel)}:void 0,rightAxis:s?{hasAxis:c,hasAxisLabel:c&&!!(r?.label??e.yLabelRight??e.yLabel)}:void 0}}function Se(e,t){return Ae({showAxes:e.showAxes??t.showAxes,xLabel:e.xLabel??t.xLabel,yLabel:e.yLabel??t.yLabel,yLabelRight:e.yLabelRight??t.yLabelRight,axes:e.axes??t.axes})}function Ce(e){let t=e.projection??"vertical",n=!1!==e.showAxes&&"radial"!==t;return{hasAxis:n,hasAxisLabel:n&&("horizontal"===t?e.hasValueLabel:e.hasCategoryLabel),leftAxis:{hasAxis:n,hasAxisLabel:n&&("horizontal"===t?e.hasCategoryLabel:e.hasValueLabel)}}}function $e(e,t,n){if(pe(e))return e.gradient.label?46:26;if(!me(e))return 20;let i=Ie(n),r=Math.max(1,n?.maxWidth??t),a=i.rowHeight;for(let t of e.legendGroups){let e=0,n=0;for(let a of t.items){let t=i.swatchSize+i.labelGap+be(a.label),o=0===n?t:n+i.itemGap+t;n>0&&o>r?(e+=1,n=t):n=o}t.items.length>0&&(e+=1),a=Math.max(a,e*i.rowHeight,t.label?be(t.label):0)}return a+(e.legendGroups.length>1?16:0)}function je(e,t,n){return xe(e,t)+ve(e)+we(t,n)+ke(t)}function Le(e,t){let{legend:n}=t;if(!n)return;let i=t.position??"right",r=$e(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+ve(n)+Me("bottom"===i?t.axisChrome:"top"===i?t.axisChrome?.topAxis:void 0,t.legendLayout)+("top"===i&&t.hasTitle?24:0),a=Math.max(t.minimumMargin??0,"top"===i?t.hasTitle?58:34:0);"right"===i?e.right=Math.max(e.right,a,je(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===i?e.left=Math.max(e.left,a,je(n,t.legendLayout,t.axisChrome?.leftAxis)):"top"===i?e.top=Math.max(e.top,a,r):e.bottom=Math.max(e.bottom,a,r)}function Ne(e,t){let n=t.position??"right",i="top"===n||"bottom"===n,r=Math.max(0,t.totalWidth-t.margin.left-t.margin.right),a=Math.max(1,i?t.legendLayout?.maxWidth??r:t.reservedWidth??xe(e,t.legendLayout)),o=ve(e),l=we(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),s=ke(t.legendLayout),c=$e(e,r,t.legendLayout),u=Me(t.axisChrome,t.legendLayout),d=Me(t.axisChrome?.topAxis,t.legendLayout);if("left"===n)return{x:Math.max(s,t.margin.left-l-a-o),y:t.margin.top,width:a,height:c};if("top"===n)return{x:t.margin.left,y:t.margin.top-d-o-c,width:a,height:c};if("bottom"===n){let e=t.totalHeight-t.margin.bottom;return{x:t.margin.left,y:Math.max(e+o,Math.min(e+u+o,t.totalHeight-c)),width:a,height:c}}return{x:Math.min(t.totalWidth-a-s,t.totalWidth-t.margin.right+l+o),y:t.margin.top,width:a,height:c}}function Ie(e){let t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function ze(e,t){let n=24;return e.map(({hasLabel:e,itemCount:i})=>{n+=5;let r,a=n;n+=8,e&&(n+=16,r=n,n+=8);let o=n;return n+=i*t+8,{lineY:a,labelY:r,itemsY:o,endY:n}})}function Fe(e,t,n=!1){let i={...e};for(let e of t??[])!1===e.visible&&("top"!==e.orient||!n)&&(i[e.orient]=0);return i}function Te({config:e,orientation:t="vertical",width:n=100,customClickBehavior:i,customHoverBehavior:r,highlightedCategory:a,isolatedCategories:o,legendInteraction:l}){let{colorFn:s,domain:c,label:u,format:d}=e,h="horizontal"===t,f=d||he(c),m="grad-legend-"+Xa.useId(),p=!(!i&&!r),y="isolate"===l||void 0===l&&null!=o,[g,b]=Xa.useState(0),[x,v]=Xa.useState(null),w=Xa.useRef([]),k=e=>{let t=h?e:5-e-1,n=c[0]+t/5*(c[1]-c[0]),i=c[0]+(t+1)/5*(c[1]-c[0]);return{label:`${f(n)} – ${f(i)}`,valueRange:[n,i],interactionKey:`${n}:${i}`}},M=(e,n,l)=>{let s="string"==typeof e.interactionKey?e.interactionKey:e.label,c=o?.has(s)??!1,u=a===s,d=x===l,h=e=>{let t=(e+5)%5;b(t),w.current[t]?.focus()};/* @__PURE__ */
15
+ return qa("rect",{ref:e=>{w.current[l]=e},className:"semiotic-gradient-legend-bin",...n,fill:o?.size&&!c||null!=a&&!u?"rgba(255,255,255,0.65)":"transparent",stroke:d||c||u?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:d?3:2,tabIndex:l===g?0:-1,role:"option","aria-label":e.label,"aria-selected":y?c:void 0,"aria-current":!(y||!u)||void 0,onClick:i?()=>i(e):void 0,onMouseEnter:r?()=>r(e):void 0,onMouseLeave:r?()=>r(null):void 0,onFocus:()=>{b(l),v(l),r?.(e)},onBlur:()=>{v(null),r?.(null)},onKeyDown:n=>{if(("Enter"===n.key||" "===n.key)&&i)return n.preventDefault(),void i(e);let r="horizontal"===t?"ArrowRight":"ArrowDown";n.key===("horizontal"===t?"ArrowLeft":"ArrowUp")||n.key===r?(n.preventDefault(),h(l+(n.key===r?1:-1))):("Home"===n.key||"End"===n.key)&&(n.preventDefault(),h("Home"===n.key?0:4))},style:{cursor:"pointer",pointerEvents:"all"}},"gradient-interaction-"+l)},[A,S]=c,C=Xa.useMemo(()=>Array.from({length:65},(e,t)=>{let n=t/64;/* @__PURE__ */
16
+ return qa("stop",{offset:n,stopColor:s(h?A+n*(S-A):S-n*(S-A))},t)}),[s,A,S,h]),$=h?Math.min(n,200):14,j=h?12:100,L=h?Math.max(0,(n-$)/2):0,N=u?18:0;/* @__PURE__ */
17
+ return Ka("g",{"aria-label":u||"Gradient legend",role:p?"listbox":void 0,"aria-orientation":p?t:void 0,"aria-multiselectable":!(!p||!y)||void 0,style:Va,children:[
18
+ /* @__PURE__ */qa("defs",{children:/* @__PURE__ */qa("linearGradient",{id:m,x1:"0%",y1:"0%",x2:h?"100%":"0%",y2:h?"0%":"100%",children:C})}),u&&/* @__PURE__ */qa("text",{x:h?L+$/2:0,y:12,textAnchor:h?"middle":"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),
19
+ /* @__PURE__ */qa("rect",{x:L,y:N,width:$,height:j,fill:`url(#${m})`,rx:2}),p&&Array.from({length:5},(e,t)=>M(k(t),{x:h?L+t*$/5:0,y:h?N:N+t*j/5,width:h?$/5:$,height:h?j:j/5},t)),[0,1].map(e=>/* @__PURE__ */qa("text",{x:h?L+e*$:$+5,y:N+(h?j+12:e?j:10),textAnchor:h?e?"end":"start":void 0,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:f(c[h?e:1-e])},e))]})}function Re(e,t,n,i,r){if("function"==typeof n)return n(e);let a=i(e,t);return"fill"===n?/* @__PURE__ */Za("rect",{style:a,width:r,height:r}):/* @__PURE__ */Za("line",{style:a,x1:0,y1:0,x2:r,y2:r})}function Oe({swatchSize:e}){/* @__PURE__ */
20
+ return Za("path",{d:`M${.25*e},${.55*e} L${.45*e},${.75*e} L${.8*e},${.3*e}`,fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}function We(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function De(e,t,n,i,r,a){let{legendGroup:{type:o="fill",styleFn:l,items:s},customClickBehavior:c,customHoverBehavior:u,highlightedCategory:d,isolatedCategories:h,focusedGroupIndex:f,focusedItemIndex:m,groupIndex:p,onFocusedIndexChange:y,interactive:g,useIsolateAria:b,metrics:{swatchSize:x,labelGap:v}}=e,w=!!h?.size&&h.has(t.label);/* @__PURE__ */
21
+ return Ja("g",{transform:i,onClick:c?()=>c(t):void 0,onMouseEnter:u?()=>u(t):void 0,onMouseLeave:u?()=>u(null):void 0,tabIndex:g?p===f&&n===m?0:-1:void 0,role:g?"option":void 0,"aria-selected":g&&b?w:void 0,"aria-current":!(!g||b||null==d||t.label!==d)||void 0,"aria-label":t.label,onKeyDown:g?e=>{if(("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c?.(t)),e.key===r||e.key===a){e.preventDefault();let t=(n+(e.key===a?1:-1)+s.length)%s.length;y(p,t);let i=e.currentTarget.parentElement?.children[t];i instanceof SVGElement&&i.focus()}}:void 0,onFocus:g?e=>{y(p,n),u?.(t),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","visible")}:void 0,onBlur:g?e=>{u?.(null),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","hidden")}:void 0,style:{cursor:g?"pointer":"default",opacity:We(t,d,h),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[g&&/* @__PURE__ */Za("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:x+v+2+7*t.label.length,height:x+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),Re(t,n,o,l,x),w&&/* @__PURE__ */Za(Oe,{swatchSize:x}),
22
+ /* @__PURE__ */Za("text",{y:x/2,x:x+v,dominantBaseline:"central",fontSize:12,style:_a,fill:"var(--semiotic-text, #333)",children:t.label})]},"legend-item-"+n)}function Ee(e){let{legendGroups:t,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:a,legendInteraction:o,title:l="Legend",width:s=100,height:c=20,orientation:u="vertical",legendLayout:d}=e,h=Ie(d),[f,m]=Ga.useState(0),[p,y]=Ga.useState(0),g=Ga.useCallback((e,t)=>{m(e),y(t)},[]),b="vertical"===u?to({legendGroups:t||[],width:s,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:a,focusedGroupIndex:f,focusedItemIndex:p,onFocusedIndexChange:g,legendInteraction:o,metrics:h}):no({legendGroups:t||[],title:l,height:c,width:s,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:a,focusedGroupIndex:f,focusedItemIndex:p,onFocusedIndexChange:g,legendInteraction:o,metrics:h}),x=!(!n&&!i);/* @__PURE__ */
23
+ return Ja("g",{role:x?"listbox":void 0,"aria-multiselectable":!(!x||"isolate"!==o&&(void 0!==o||null==a))||void 0,"aria-label":"Chart legend",style:Va,children:[void 0!==l&&""!==l&&"vertical"===u&&/* @__PURE__ */Za("text",{className:"legend-title",y:16,x:s/2,textAnchor:"middle",fontSize:12,style:_a,fill:"var(--semiotic-text, #333)",children:l}),b]})}function Be(e,t=0,n=1/0,i=0){let r=Number.isFinite(t)?t:0,a=Number.isFinite(n)?Math.max(r,n):1/0,o=Number.isFinite(e)?Math.floor(e):r,l=Math.max(r,Math.min(a,o));return i>0&&Number.isFinite(i)?Math.max(r,Math.min(a,Math.round(l/i)*i)):l}function He(e,t,n,i={}){let r=io(null),[a,o]=ro(null);return lo(()=>{if(!t&&!n)return;let e=r.current;if(!e||typeof ResizeObserver>"u")return;let a=(e,t)=>({w:Be(e,i.minWidth,i.maxWidth,i.widthStep),h:Be(t,i.minHeight,i.maxHeight,i.heightStep)}),l=e.getBoundingClientRect();(l.width>0||l.height>0)&&o(a(l.width,l.height));let s=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect,i=a(e,n);o(e=>e&&e.w===i.w&&e.h===i.h?e:i)}});return s.observe(e),()=>s.disconnect()},[t,n,i.minWidth,i.maxWidth,i.widthStep,i.minHeight,i.maxHeight,i.heightStep]),[r,[t&&a?a.w:e[0],n&&a?a.h:e[1]]]}function Pe(){return Ra(ho)}function Ge(e){let t=/* @__PURE__ */new Set,n=[];for(let i of e)t.has(i)||(t.add(i),n.push(i));return n}function Ve(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function _e(e,t){let n=Ra(fo),i=Wa(),r=Ge(e),a=r.map(e=>t?.(e)),o=Ba({categories:[],colors:[]});(!Ve(o.current.categories,r)||!Ve(o.current.colors,a))&&(o.current={categories:r,colors:a});let l=o.current;mo(()=>{if(n)return()=>n.unregisterCategories(i)},[n,i]),mo(()=>{n&&n.registerCategories(i,l)},[n,i,l])}function Ye(){return null!==Ra(fo)}function Ue({categoryColors:e,interaction:t,selectionName:n,field:i}){let r=Object.entries(e),a=r.map(([e])=>e),o=[{styleFn:e=>({fill:e.color||"#333",stroke:e.color||"#333"}),type:"fill",items:r.map(([e,t])=>({label:e,color:t})),label:""}],{selectPoints:l,clear:s}=q({name:n,fields:[i],clientId:po}),{selectPoints:c,clear:u}=q({name:n,fields:[i],clientId:yo}),d=qr(e=>e.selections.get(n)),{isolatedCategories:h,highlightedCategory:f}=Ea(()=>{let e=/* @__PURE__ */new Set,t=null,n=d?.clauses.get(po)?.fields[i];if("point"===n?.type)for(let t of n.values)e.add(t+"");let r=d?.clauses.get(yo)?.fields[i];if("point"===r?.type){let e=r.values.values().next().value;null!=e&&(t=e+"")}return{isolatedCategories:e,highlightedCategory:t}},[d,i]),m=Pa(e=>{"highlight"===t&&(e?c({[i]:[e.label]}):u())},[t,i,c,u]),p=Pa(e=>{if("isolate"!==t)return;let n=new Set(h);n.has(e.label)?n.delete(e.label):n.add(e.label),0===n.size||n.size===a.length?s():l({[i]:Array.from(n)})},[t,i,h,a.length,l,s]),[y,[g]]=He([0,0],!0,!1),b=Ea(()=>Xe(r.map(([e])=>e),g),[r,g]);return 0===r.length?null:/* @__PURE__ */so("div",{ref:y,style:{width:"100%",display:"block"},children:/* @__PURE__ */so("svg",{width:"100%",height:Math.max(30,22*b+8),style:{display:"block",overflow:"visible"},children:/* @__PURE__ */so(Ee,{legendGroups:o,title:!1,orientation:"horizontal",width:g,height:20,customHoverBehavior:"highlight"===t?m:void 0,customClickBehavior:"isolate"===t?p:void 0,highlightedCategory:f,isolatedCategories:h})})})}function Xe(e,t){if(!t||0===e.length)return 1;let n=0,i=1;for(let r of e){let e=26+7*r.length;n>0&&n+e>t&&(i++,n=0),n+=e}return i}function qe({children:e,selections:t,showLegend:n,legendPosition:i="top",legendInteraction:r="none",legendSelectionName:a="legend",legendField:o="category"}){let l=Ea(()=>{if(!t)return;let e=/* @__PURE__ */new Map;for(let[n,i]of Object.entries(t))i.resolution&&e.set(n,{name:n,resolution:i.resolution,clauses:/* @__PURE__ */new Map});return e.size>0?{selections:e}:void 0},[t]),s=D(),c=Gr(e=>e.theme.colors.categorical),u=c.length>0?c:xr,[d,h]=Ha({}),f=Ba(/* @__PURE__ */new Map),m=Ea(()=>({registerCategories:(e,t)=>{h(n=>Ve(n[e]?.categories??[],t.categories)&&Ve(n[e]?.colors??[],t.colors)?n:{...n,[e]:t})},unregisterCategories:e=>{h(t=>{if(!Object.prototype.hasOwnProperty.call(t,e))return t;let n={...t};return delete n[e],n})}}),[]),p=Ea(()=>{let e=[];for(let{categories:t}of Object.values(d))for(let n of t)e.push(n);return Ge(e)},[d]),y=Ea(()=>{let e=s??{},t=new Map(f.current),n=Object.entries(e).filter(e=>"string"==typeof e[1]&&e[1].length>0),i=p.map(n=>{let i=ue(t,n);return[n,Ar(e,n)??u[i%u.length]]});return{categoryIndexes:t,colors:Object.fromEntries([...n,...i])}},[s,p,u]);mo(()=>{f.current=y.categoryIndexes},[y]);let g=y.colors,b=Ea(()=>{let e=/* @__PURE__ */new Map,t=!1;for(let{categories:n,colors:i}of Object.values(d))n.forEach((n,r)=>{let a=i[r];a&&(e.has(n)&&e.get(n)!==a&&(t=!0),e.set(n,a))});return{colors:{...g,...Object.fromEntries(e)},conflicting:t}},[g,d]),x=(n??!0)&&!b.conflicting,v=Object.keys(g).length>0;/* @__PURE__ */
24
+ return so(Xr,{initialState:l,children:/* @__PURE__ */so(Vr,{children:/* @__PURE__ */so(ho.Provider,{value:!0,children:/* @__PURE__ */so(fo.Provider,{value:m,children:/* @__PURE__ */so(R,{colors:g,children:/* @__PURE__ */co(uo.Provider,{value:x&&v,children:[x&&"top"===i&&/* @__PURE__ */so(Ue,{categoryColors:b.colors,interaction:r,selectionName:a,field:o}),e,x&&"bottom"===i&&/* @__PURE__ */so(Ue,{categoryColors:b.colors,interaction:r,selectionName:a,field:o})]})})})})})})}function Ke(e){if(null==e)return()=>{};let t="function"==typeof e?e:t=>t[e];return e=>Qe(t(e))}function Ze(e,t){let n=Ke(e),i=Ke(t);return(e,t)=>{let r=i(e);return{value:r,x:n(e),y:r,category:t}}}function Je(e,t){let n=Ke(t??"value"),i=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{let t=i?i(e):void 0;return{value:n(e),category:null==t?void 0:t+""}}}function Qe(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){let t=Number(e);return Number.isFinite(t)?t:void 0}}function et(e,t,n){let i=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&i!==e.eq||void 0!==e.ne&&i===e.ne||void 0!==e.in&&!e.in.includes(i))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;let r=Qe(i);if(void 0===r||void 0!==e.gt&&e.gt>=r||void 0!==e.gte&&e.gte>r||void 0!==e.lt&&r>=e.lt||void 0!==e.lte&&r>e.lte)return!1;if(void 0!==e.within){let[t,n]=e.within;if(t>r||r>n)return!1}if(void 0!==e.outside){let[t,n]=e.outside;if(r>=t&&n>=r)return!1}return!0}function tt(e,t,n){let i=e.when;return void 0===i||!0===i||!1!==i&&("function"==typeof i?i(t,n):et(i,t,n))}function nt(e,t,n){if(!t||0===t.length)return{};let i={};for(let r of t){if(!tt(r,e,n))continue;let t="function"==typeof r.style?r.style(e,n):r.style;t&&(i={...i,...t})}return i}function it(e,t,n,i=e=>e){let r=e??(()=>({}));return t&&0!==t.length?(e,a)=>{let o=i(e),l={...r(e,a)};return Object.assign(l,nt(o,t,n(o,a))),l}:r}function rt(e,t,n){return e&&0!==e.length?(i,r)=>{let a=nt(i,e,t(i,r)),o=n?n(i,r):void 0;return o?{...a,...o}:a}:n}function at(e,t,n,i){if(!e||0===e.length)return i;let r=Je(t,n);return(t,n)=>{let a=t&&t.data||t,o=nt(a,e,r(a)),l=i?i(t,n):void 0;return l?{...o,...l}:o}}function ot(e,t,n,i){return rt(e,Ze(t,n),i)}function lt(e,t,n){let i=Ke(t);return rt(e,(e,t)=>({value:i(e),category:t}),n)}function st(e){if(!e)return go;let t=!1;for(let n=0;e.length>n;n++){let i=e[n];if(null==i||"object"!=typeof i){t=!0;break}}if(!t)return e;let n=[];for(let t of e)null!=t&&"object"==typeof t&&n.push(t);return n}function ct(e,t){let n={...e};for(let e of t)n[xo[e]]++;return n}function ut(e,t,n){let i=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:i,revisions:ct(n,i)}}function dt(e){let{domain:t,layout:n,sceneGeometry:i}=e.revisions;return{domain:t,layout:n,sceneGeometry:i}}function ht(e,t){return e.sceneGeometry===t.sceneGeometry&&e.layout===t.layout&&e.domain===t.domain}function ft(e,t){return{sceneGeometry:Math.max(e.sceneGeometry,t.sceneGeometry),layout:Math.max(e.layout,t.layout),domain:Math.max(e.domain,t.domain)}}function mt(e){return Mo(new $o(e))}function pt(e,t,n,i=!1,r=!1){let a=e.beforeCompute(t.getLastUpdateResult(),i);n(),e.afterCompute(a,!0,r)}function yt(e){let{legend:t,totalWidth:n,totalHeight:i,margin:r,legendPosition:a="right",legendLayout:o,legendHoverBehavior:l,legendClickBehavior:s,legendHighlightedCategory:c,legendIsolatedCategories:u,legendInteraction:d}=e;if(!t)return null;let{x:h,y:f,width:m}=Ne(t,{totalWidth:n,totalHeight:i,margin:r,position:a,legendLayout:o,axisChrome:e.axisChrome}),p="top"===a||"bottom"===a;/* @__PURE__ */
25
+ return Lo("g",{transform:`translate(${h}, ${f})`,children:pe(t)?/* @__PURE__ */Lo(Te,{config:t.gradient,orientation:p?"horizontal":"vertical",width:m,customHoverBehavior:l,customClickBehavior:s,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):me(t)?/* @__PURE__ */Lo(Ee,{legendGroups:t.legendGroups,title:"",width:m,orientation:p?"horizontal":"vertical",legendLayout:o,customHoverBehavior:l,customClickBehavior:s,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}function gt(e){return!0===e?._annotationDeferred}function bt(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function xt(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis?e.emphasis:null}function vt(e){let t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function wt(e){return Math.max(.72,.95-.06*e)}function kt(e){let t=e.map((e,t)=>({p:e,i:t,emphasis:xt(e.annotation),confidence:vt(e.annotation),readingOrder:null,rank:1})),n=t.some(e=>null!=e.emphasis||null!=e.confidence),i=e.some(e=>gt(e.annotation)),r=e.some(e=>null!=bt(e.annotation)),a=e.some(e=>"layer"===bt(e.annotation));if(!n&&!i&&!r)return e.map(e=>e.node);let o=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);o.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,o.length)});for(let e of t)e.emphasis&&(e.rank=Io[e.emphasis]);let l=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{let{p:t,i:n,emphasis:i,readingOrder:r}=e,a=gt(t.annotation),o=t.node;if("primary"===i||"secondary"===i||null!=r){let e=null==i&&null!=r;o=/* @__PURE__ */No("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":"annotation-emphasis annotation-emphasis--"+i,..."secondary"===i?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:wt(r),"data-annotation-reading-order":r}:{},children:t.node},"annotation-emphasis-"+n)}let l=bt(t.annotation);return l&&(o=/* @__PURE__ */No("g",{className:"annotation-cohesion--"+l,children:o},"annotation-cohesion-"+n)),a&&(o=/* @__PURE__ */No("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:o},"annotation-deferred-"+n)),o});return i&&l.unshift(
26
+ /* @__PURE__ */No("style",{children:zo},"annotation-disclosure-style")),a&&l.unshift(
27
+ /* @__PURE__ */No("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),l}function Mt(e,t,n,i){return At(e,t,n,i).nodes}function At(e,t,n,i){let r=[];return e.forEach((e,a)=>{let o;o=n?n(e,a,i)??t(e,a,i):t(e,a,i),o&&r.push({node:o,annotation:e})}),{nodes:kt(r),renderedAnnotations:r.map(e=>e.annotation)}}function St(e,t,n){if(!e)return null;let i="object"==typeof e?e:{};/* @__PURE__ */
28
+ return Fo("circle",{className:"semiotic-threshold-end-cap",cx:t[0],cy:t[1],r:Math.max(0,i.radius??4),fill:i.fill??n})}function Ct(e,t){return Math.max(Math.min(e,t),0)+16}function $t({ann:e,position:t,vertical:n,width:i,height:r,color:a,fontSize:o=12,fontFamily:l,bold:s,background:u,dash:d="6,3",labelGap:h=4}){let f=e.labelPosition,m=t>.6*i,p=n?t+(m?-4:4):"left"===f?4:"center"===f?i/2:i-4,y=n?"bottom"===f?r-4:"center"===f?r/2:16:20>t?Math.min(r-4,t+16):t-h,g=n?m?"end":"start":"left"===f?"start":"center"===f?"middle":"end",b=n?[t,0]:[0,t],x=n?[t,r]:[i,t];/* @__PURE__ */
29
+ return Ro("g",{opacity:e.opacity,children:[
30
+ /* @__PURE__ */To("line",{x1:b[0],y1:b[1],x2:x[0],y2:x[1],stroke:a,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||d}),St(e.endCap,b,a),e.label&&/* @__PURE__ */To(c,{x:p,y:y,text:e.label,textAnchor:g,fill:a,fontSize:o,fontFamily:l,fontWeight:s?"bold":void 0,background:u??e.labelBackground??"halo"})]})}function jt(e){return{label:e.label,title:e.title,wrap:e.wrap||120,noWrap:"function"==typeof e._noteLayout?e.noWrap:void 0,_noteLayout:e._noteLayout}}function Lt(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function Nt(e,t,n){if(!e)return[];let i=Math.max(1,Math.floor(t/n)),r=[],a="";for(let t of e.split(/\s+/))t&&(a&&a.length+1+t.length>i?(r.push(a),a=t):a=a?`${a} ${t}`:t);return a&&r.push(a),r}function It(e,t,n,i){return"curly"===e?i?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:i?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function zt(e,t,n,i){if(!e)/* @__PURE__ */return Wo("g",{className:"annotation-note"});let{label:r,title:a,orientation:o,align:l,wrap:s=120,noWrap:c}=e;if(!r&&!a)/* @__PURE__ */return Wo("g",{className:"annotation-note"});let u=o;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");let d="topBottom"===u,h="leftRight"===u,f=l;(!f||"dynamic"===f)&&(f=d?0>t?"right":"left":0>n?"bottom":"top");let m="start";d?"right"===f?m="end":"middle"===f&&(m="middle"):m=0>t?"end":"start";let p=e.useHTML||e.html,y=p?void 0:Lt(e),g=y?.lineHeight??16,b=y?.titleLines??(a?c?[a]:Nt(a,s,8):[]),x=y?.labelLines??(r?c?[r]:Nt(r,s,8):[]),v=b.length+x.length,w=h?"end"===m?-4:4:0,k=[],M=i||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";if(p)k.push(
31
+ /* @__PURE__ */Wo("foreignObject",{className:"annotation-note-html",x:"end"===m?w-s:"middle"===m?w-s/2:w,y:-g,width:s,height:Math.max(g,v*g+(a&&r?2:0))+g,style:{overflow:"visible"},children:/* @__PURE__ */Do("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:M,fontSize:"12px",lineHeight:g+"px",overflow:"visible",textAlign:"end"===m?"right":"middle"===m?"center":"left",whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[a&&/* @__PURE__ */Wo("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:a}),r&&/* @__PURE__ */Wo("div",{className:"annotation-note-label",children:r})]})},"annotation-note-html"));else for(let e of[!0,!1]){let t=e?b:x;if(0===t.length)continue;let n="annotation-note-"+(e?"title":"label");k.push(
32
+ /* @__PURE__ */Wo("text",{className:n,fill:M,textAnchor:m,fontWeight:e?y?.titleFontWeight??"bold":void 0,y:e?void 0:b.length*g,children:t.map((e,t)=>/* @__PURE__ */Wo("tspan",{x:w,dy:0===t?0:g,children:e},t))},n))}let A=null;if((a||r)&&(0!==t||0!==n)){let e=d?y?y.width:Math.min(s,120):(b.length+x.length+(x.length>0?1:0))*g,t=d?m:f,n="end"===t||"bottom"===t?-e:"middle"===t?-e/2:0;A=/* @__PURE__ */Wo("line",{className:"note-line",x1:d?n:0,x2:d?n+e:0,y1:d?0:n,y2:d?0:n+e,stroke:i||"var(--semiotic-text-secondary, currentColor)"})}let S=Math.max(0,v-1)*g,C=0;(d||h)&&(C=h&&"middle"===f?-(S+g+(x.length>0&&b.length>0?2:0))/2+g/2:0>n||h&&"bottom"===f?-(S+2):2+g);let $=0!==C?`translate(0,${C})`:void 0;/* @__PURE__ */
33
+ return Do("g",{className:"annotation-note",transform:`translate(${t},${n})`,...y?.textProps,children:[
34
+ /* @__PURE__ */Wo("g",{className:"annotation-note-content",transform:$,children:k}),A]})}function Ft(e,t,n,i,r){let a=null,o=n||"var(--semiotic-text-secondary, currentColor)";switch(e){case"callout-circle":{let e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&(a=/* @__PURE__ */Wo("circle",{r:e,fill:"none",stroke:o},"subject-circle"));break}case"callout-rect":{let e=t?.width||0,n=t?.height||0;(e>0||n>0)&&(a=/* @__PURE__ */Wo("rect",{width:e,height:n,fill:"none",stroke:o},"subject-rect"));break}case"callout-custom":a=t?.custom;break;case"xy-threshold":{let e=i||0,n=r||0,l=0,s=0,c=0,u=0;if(void 0!==t?.x)l=s=(t.x||0)-e,c=(t.y1||0)-n,u=(t.y2||0)-n;else if(void 0!==t?.y)c=u=(t.y||0)-n,l=(t.x1||0)-e,s=(t.x2||0)-e;else if(void 0!==t?.x1||void 0!==t?.x2)l=(t.x1||0)-e,s=(t.x2||0)-e;else{if(void 0===t?.y1&&void 0===t?.y2)break;c=(t.y1||0)-n,u=(t.y2||0)-n}a=/* @__PURE__ */Wo("line",{x1:l,y1:c,x2:s,y2:u,stroke:o,strokeDasharray:"5,5"},"threshold-line");break}case"bracket":{let e=t?.type||"curly",n=t?.width??t?.height;void 0!==n&&(a=/* @__PURE__ */Wo("path",{d:It(e,n,t?.depth||30,void 0===t?.width),fill:"none",stroke:o},"bracket-path"));break}}/* @__PURE__ */
35
+ return Wo("g",{className:"annotation-subject",children:a})}function Tt(e,t,n,i,r,a){let o,l,s=0,c=0;if("callout-circle"!==r&&"label"!==r||!a?.radius){if("callout-rect"===r&&a){let n=a.width||0,i=a.height||0;if(n>0||i>0){let r=n/2,a=i/2,o=e-r,l=t-a;if(0!==o||0!==l){let e=Math.abs(o),t=Math.abs(l),u=n/2,d=i/2,h=e*d>t*u?u/e:d/t;s=r+o*h,c=a+l*h}}}else if("bracket"===r&&a){let e=a.width,t=a.height,n=a.depth||30;void 0!==e?(s=e/2,c=n):void 0!==t&&(s=n,c=t/2)}}else{let n=(a.radius||0)+(a.radiusPadding||0);if(n>0&&(0!==e||0!==t)){let i=Math.atan2(t,e);s=Math.cos(i)*n,c=Math.sin(i)*n}}let u=e-s,d=t-c,h=Math.hypot(u,d);if(h>.5){let r=i||"var(--semiotic-text-secondary, currentColor)",a="curve"===n?.type,f=Math.atan2(d,u);if(a){let i=(s+e)/2,a=(c+t)/2,l=-d/h,m=u/h,p=(n?.curve??.25)*h,y=i+l*p,g=a+m*p;o=/* @__PURE__ */Wo("path",{className:"connector-curve",d:`M${s},${c}Q${y},${g} ${e},${t}`,fill:"none",stroke:r},"connector-line"),f=Math.atan2(g-c,y-s)}else o=/* @__PURE__ */Wo("line",{x1:s,y1:c,x2:e,y2:t,stroke:r},"connector-line");if("arrow"===n?.end){let e=.2792526803190927;l=/* @__PURE__ */Wo("path",{d:`M${s},${c}L${s+10*Math.cos(f+e)},${c+10*Math.sin(f+e)}L${s+10*Math.cos(f-e)},${c+10*Math.sin(f-e)}Z`,fill:r,stroke:"none"},"connector-arrow")}}/* @__PURE__ */
36
+ return Do("g",{className:"annotation-connector",children:[o,l]})}function Rt(e){let{x:t=0,y:n=0,dx:i,dy:r,nx:a,ny:o,note:l,connector:s,subject:c,type:u,color:d,className:h,disable:f,opacity:m,strokeDasharray:p,events:y={},"data-testid":g}=e,b=Array.isArray(t)?t[0]??0:t,x=Array.isArray(n)?n[0]??0:n,v=Array.isArray(f)?f:[],w=i||0,k=r||0;null!=a&&(w=a-b),null!=o&&(k=o-x);let M="string"==typeof u?u:"label";if("bracket"===M&&c&&0===w&&0===k)if(void 0!==c.width){w=c.width/2;let e=c.depth||30;k=e+(0>e?-5:5)}else if(void 0!==c.height){let e=c.depth||30;w=e+(0>e?-5:5),k=c.height/2}/* @__PURE__ */
37
+ return Do("g",{className:("annotation "+(h||"")).trim(),transform:`translate(${b},${x})`,"data-testid":g,...null!=m&&{opacity:m},...p&&{strokeDasharray:p},...y,children:[!v.includes("connector")&&Tt(w,k,s,d,M,c),!v.includes("subject")&&Ft(M,c,d,b,x),!v.includes("note")&&zt(l,w,k,d)]})}function Ot(e){let{noteData:t}=e,{screenCoordinates:n}=t,i="string"==typeof t.type?t.type:"label",r=t.eventListeners||t.events||{};if(t.coordinates&&n){let e=t.nx||n[0][0]+(t.dx??0),r=t.ny||n[0][1]+(t.dy??0),a=n.map((n,a)=>{let o=Object.assign({},t,{note:0===a?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:r});/* @__PURE__ */
38
+ return Wo(Rt,{"data-testid":"semiotic-annotation",...o,type:i},"multi-annotation-"+a)});/* @__PURE__ */
39
+ return Wo("g",{children:a})}let a=t.note||{title:"none",label:t.label},o=`${a.label}-${a.title}-${t.i}`;/* @__PURE__ */
40
+ return Wo(Rt,{"data-testid":"semiotic-annotation",events:r,...t,type:i},o)}function Wt(e,t=.3){let n=e.length;if(2>n)return e.slice();let i=e.slice().sort((e,t)=>e[0]-t[0]),r=i.map(e=>e[0]),a=i.map(e=>e[1]),o=Math.min(n,Math.max(2,Math.ceil(t*n))),l=Number.isFinite(o)&&r.every(Number.isFinite),s=0,c=o-1,u=[];for(let e=0;n>e;e++){let t,i=r[e],d=0,h=n-1;if(l){for(;n-1>c&&Math.abs(r[s]-i)>=Math.abs(r[c+1]-i);)s++,c++;let e=Math.max(Math.abs(r[s]-i),Math.abs(r[c]-i));t=e||1,e>0&&(d=s,h=c)}else t=r.map(e=>Math.abs(e-i)).sort((e,t)=>e-t)[o-1]||1;let f=0,m=0,p=0,y=0,g=0;for(let e=d;h>=e;e++){let n=Math.abs(r[e]-i)/t,o=1>n?Math.pow(1-Math.pow(n,3),3):0;0!==o&&(f+=o,m+=o*r[e],p+=o*a[e],y+=o*r[e]*r[e],g+=o*r[e]*a[e])}if(0===f){u.push([i,a[e]]);continue}let b=f*y-m*m;if(1e-12>Math.abs(b))u.push([i,p/f]);else{let e=(f*g-m*p)/b;u.push([i,(p-e*m)/f+e*i])}}return u}function Dt(e,t){let n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function Et(e,t){let n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function Bt(e){let t=e.data;if(!t||0===t.length)return null;let n=t[t.length-1],i=e.scales?.x??e.scales?.time,r=e.scales?.y??e.scales?.value;if(!i||!r)return null;let a=n[e.xAccessor||"x"],o=n[e.yAccessor||"y"];return null==a||null==o?null:{x:i(a),y:r(o)}}function Ht(e){return null==e?null:e+""}function Pt(e){return Ht(e.provenance?.stableId??e.stableId)}function Gt(e){return Ht(e.stableId??e.id??e.provenance?.stableId)}function Vt(e,t,n){return t.stickyPositionCache?.set(e,n),n}function _t(e,t,n){let i=Pt(e);if(!i)return null;let r=n.pointNodes?.find(e=>Ht(e.pointId)===i);if(r)return Vt(t,n,{x:r.x,y:r.y});let a=n.data?.find(e=>Gt(e)===i);if(!a)return null;let o=Dt(a,n),l=Et(a,n);return null==o||null==l?null:Vt(t,n,{x:o,y:l})}function Yt(e,t,n){let i=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===i){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let i=n.pointNodes.length-1;i>=0;i--){let r=n.pointNodes[i];if(r.pointId===e.pointId)return Vt(t,n,{x:r.x,y:r.y})}let i=Bt(n);return i?Vt(t,n,i):null}if("semantic"===i){let i=_t(e,t,n);if(i)return i}let r=null,a=null;if(null!=e.pointId&&n.pointNodes){let t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(r=t.x,a=t.y)}if((null==r||null==a)&&(r=Dt(e,n),a=Et(e,n)),null!=r&&null!=a)return Vt(t,n,{x:r,y:a});if("sticky"===i){let e=n.stickyPositionCache?.get(t);if(e)return e}return null}function Ut(e,t,n,i=50){return!(-i>e||e>(n.width||0)+i||-i>t||t>(n.height||0)+i)}function Xt(e,t,n,i){let r=Rr(e.fill??e.color,t,i);return Or(e.gradient,t,n,"string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:i)??r}function qt(e,t,n){let i=e.position,r="string"==typeof i&&Ko.has(i)?i:"bottom-left",a=r.endsWith("left")?"left":r.endsWith("right")?"right":"center",o=r.startsWith("top")?"top":r.startsWith("bottom")?"bottom":"middle",l="top"===o?0:"bottom"===o?n:n/2;return{x:("left"===a?0:"right"===a?t:t/2)+("number"==typeof e.dx&&Number.isFinite(e.dx)?e.dx:0),y:l+("number"==typeof e.dy&&Number.isFinite(e.dy)?e.dy:0),textAnchor:"start"===e.textAnchor||"middle"===e.textAnchor||"end"===e.textAnchor?e.textAnchor:"left"===a?"start":"right"===a?"end":"middle",dominantBaseline:"auto"===e.dominantBaseline||"middle"===e.dominantBaseline||"hanging"===e.dominantBaseline?e.dominantBaseline:"top"===o?"hanging":"bottom"===o?"auto":"middle"}}function Kt(e,t,n,i){return{...qt(e,t,n),fill:e.fill??e.color??i.fill,fontSize:e.fontSize??i.fontSize,fontFamily:e.fontFamily??i.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,letterSpacing:e.letterSpacing,opacity:e.opacity,className:e.className,style:{pointerEvents:"none"}}}function Zt({annotation:e,width:t,height:n,defaults:i=Jo}){let r=e.label??e.text;return null==r?null:/* @__PURE__ */Zo("text",{...Kt(e,t,n,i),children:r})}function Jt(e,t={}){return function(e,n,i){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{let t=Yt(e,n,i);if(!t)return null;let{x:r,y:a}=t;if(!Ut(r,a,i))return null;let o="callout"===e.type?"callout-circle":e.type,l="callout-circle"===o?{radius:e.radius??12,radiusPadding:e.radiusPadding}:"callout-rect"===o?{width:e.width,height:e.height}:void 0;/* @__PURE__ */
41
+ return Qo(Ot,{noteData:{x:r,y:a,dx:e.dx??30,dy:e.dy??-30,note:jt(e),type:o,...l?{subject:l}:{},connector:e.connector||{end:"arrow"},color:e.color,disable:e.disable,opacity:e.opacity,strokeDasharray:e.strokeDasharray,className:e.className}},"ann-"+n)}case"x-threshold":case"y-threshold":{let t="x-threshold"===e.type,r=null!=e.value?{...e,[t?"x":"y"]:e.value}:e,a=t?Dt(r,i):Et(r,i);return null==a?null:/* @__PURE__ */Qo($t,{ann:e,position:a,vertical:t,width:i.width||0,height:i.height||0,color:e.color||"#f97316",bold:!0},"ann-"+n)}case"enclose":{let t=(e.coordinates||[]).map(e=>({x:Dt({...e,type:"point"},i),y:Et({...e,type:"point"},i),r:1})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;let r=Eo(t),a=e.padding||10;/* @__PURE__ */
42
+ return el("g",{children:[
43
+ /* @__PURE__ */Qo("circle",{cx:r.x,cy:r.y,r:r.r+a,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&/* @__PURE__ */Qo(c,{x:r.x,y:r.y-r.r-a-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+n)}case"rect-enclose":{let t=(e.coordinates||[]).map(e=>({x:Dt({...e,type:"point"},i),y:Et({...e,type:"point"},i)})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;let r=e.padding||10,a=t.map(e=>e.x),o=t.map(e=>e.y),[l,s]=ea(a),[u,d]=ea(o),h=l-r,f=s+r,m=u-r;/* @__PURE__ */
44
+ return el("g",{children:[
45
+ /* @__PURE__ */Qo("rect",{x:h,y:m,width:f-h,height:d+r-m,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&/* @__PURE__ */Qo(c,{x:(h+f)/2,y:m-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+n)}case"highlight":{let t=i.data||[],r="function"==typeof e.filter?t.filter(e.filter):e.field&&null!=e.value?t.filter(t=>t[e.field]===e.value):[],a={stroke:e.color||"#f97316",strokeWidth:2,fill:"none"};/* @__PURE__ */
46
+ return Qo("g",{children:r.map((t,n)=>{let r=Dt(t,i),o=Et(t,i);if(null==r||null==o)return null;let l="function"==typeof e.r?e.r(t):e.r||6,s="function"==typeof e.style?e.style(t):e.style||a;/* @__PURE__ */
47
+ return Qo("circle",{cx:r,cy:o,r:l,...s},"hl-"+n)})},"ann-"+n)}case"bracket":{let t=Dt(e,i),r=Et(e,i);/* @__PURE__ */
48
+ return Qo(Ot,{noteData:{x:t??0,y:r??0,dx:e.dx||0,dy:e.dy||0,note:jt(e),type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth||30},color:e.color}},"ann-"+n)}case"trend":{let t=i.data||[];if(2>t.length)return null;let r,a=i.xAccessor||"x",o=i.yAccessor||"y",l="ordinal"===i.frameType,s="horizontal"===i.projection,c=l?a:null,u=l?o:null,d=[],h=/* @__PURE__ */new Map;if(l&&c&&u){for(let e of t){let t=e[c];if(null==t)continue;let n=t+"";h.has(n)||(h.set(n,d.length),d.push(n))}r=t.map(e=>{let t=e[c],n=e[u];if(null==t||null==n)return null;let i=h.get(t+"");return null!=i?[i,+n]:null}).filter(e=>null!==e)}else r=t.map(e=>[e[a],e[o]]).filter(e=>null!=e[0]&&null!=e[1]);if(2>r.length)return null;let f=i.scales?.x??i.scales?.time,m=i.scales?.y??i.scales?.value;if(!f||!m)return null;let p,y=e=>t=>{let n=Math.max(0,Math.floor(t)),i=Math.min(d.length-1,n+1),r=t-n,a=e(d[n]);return a+(e(d[i])-a)*r},g=f,b=m;if(l)if(s){let e=y(b);p=(t,n)=>[g(n),e(t)]}else{let e=y(g);p=(t,n)=>[e(t),b(n)]}else p=(e,t)=>[g(e),b(t)];let x,v=e.method||"linear";x="loess"===v?Wt(r,e.bandwidth??.3):("polynomial"===v?Dr(r,e.order||2):Wr(r)).points;let w=x.map(([e,t])=>{let[n,i]=p(e,t);return`${n},${i}`}).join(" "),k=e.color||"#6366f1",M=x[x.length-1],[A,S]=p(M[0],M[1]);/* @__PURE__ */
49
+ return el("g",{children:[
50
+ /* @__PURE__ */Qo("polyline",{points:w,fill:"none",stroke:k,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&/* @__PURE__ */Qo("text",{x:A+4,y:S-4,fill:k,fontSize:11,children:e.label})]},"ann-"+n)}case"band":{let t=i.scales?.y??i.scales?.value,r=t?.domain?.(),a=e.y0??r?.[0],o=e.y1??r?.[1],l=null!=a&&t?t(a):0,s=null!=o&&t?t(o):i.height||0,u=Xt(e,"ann-"+n,"vertical","var(--semiotic-primary, #6366f1)");/* @__PURE__ */
51
+ return el("g",{opacity:e.opacity,children:[u.def&&/* @__PURE__ */Qo("defs",{children:u.def}),
52
+ /* @__PURE__ */Qo("rect",{x:0,y:Math.min(l,s),width:i.width||0,height:Math.abs(s-l),fill:u.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */Qo(c,{x:(i.width||0)-4,y:Ct(l,s),textAnchor:"end",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+n)}case"x-band":{let t=i.scales?.x??i.scales?.time,r=t?.domain?.(),a=e.x0??r?.[0],o=e.x1??r?.[1],l=null!=a&&t?t(a):null,s=null!=o&&t?t(o):null;if(null==l||null==s)return null;let u=Xt(e,"ann-"+n,"horizontal","var(--semiotic-primary, #6366f1)");/* @__PURE__ */
53
+ return el("g",{opacity:e.opacity,children:[u.def&&/* @__PURE__ */Qo("defs",{children:u.def}),
54
+ /* @__PURE__ */Qo("rect",{x:Math.min(l,s),y:0,width:Math.abs(s-l),height:i.height||0,fill:u.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */Qo(c,{x:Math.min(l,s)+4,y:16,textAnchor:"start",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+n)}case"envelope":{let t=i.data||[];if(2>t.length)return null;let r=i.xAccessor||"x",a=i.scales?.x??i.scales?.time,o=i.scales?.y??i.scales?.value;if(!a||!o)return null;let l=e.upperAccessor||"upperBounds",s=e.lowerAccessor||"lowerBounds",c=e.filter,u=t.filter(e=>!(null==e[l]||null==e[s]||c&&!c(e))).sort((e,t)=>e[r]-t[r]);if(2>u.length)return null;let d=tl[i.curve||"linear"]||Ho,h=Bo().x(e=>a(e[r])).y0(e=>o(e[s])).y1(e=>o(e[l])).curve(d)(u);if(!h)return null;let f=e.fill||"#6366f1";/* @__PURE__ */
55
+ return el("g",{children:[
56
+ /* @__PURE__ */Qo("path",{d:h,fill:f,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&u.length>0&&/* @__PURE__ */Qo("text",{x:a(u[u.length-1][r])+4,y:o(u[u.length-1][l])-4,fill:f,fontSize:11,children:e.label})]},"ann-"+n)}case"anomaly-band":{let t=i.data||[];if(2>t.length)return null;let r=i.yAccessor||"y",a=i.scales?.x??i.scales?.time,o=i.scales?.y??i.scales?.value;if(!a||!o)return null;let l=t.map(e=>e[r]).filter(e=>null!=e&&isFinite(e));if(2>l.length)return null;let s=l.reduce((e,t)=>e+t,0)/l.length,c=l.reduce((e,t)=>e+(t-s)**2,0)/l.length,u=Math.sqrt(c),d=e.threshold??2,h=s-d*u,f=!1!==e.showBand,m=e.fill||"#6366f1",p=e.fillOpacity??.1,y=e.anomalyColor||"#ef4444",g=e.anomalyRadius??6,b=o(s+d*u),x=o(h),v=t.filter(e=>{let t=e[r];return null!=t&&Math.abs(t-s)>d*u});/* @__PURE__ */
57
+ return el("g",{children:[f&&/* @__PURE__ */Qo("rect",{x:0,y:Math.min(b,x),width:i.width||0,height:Math.abs(x-b),fill:m,fillOpacity:p}),v.map((e,t)=>{let n=Dt(e,i),r=Et(e,i);return null==n||null==r?null:/* @__PURE__ */Qo("circle",{cx:n,cy:r,r:g,fill:y,fillOpacity:.7,stroke:y,strokeWidth:1.5},"anomaly-"+t)}),e.label&&/* @__PURE__ */Qo("text",{x:(i.width||0)-4,y:Math.min(b,x)-4,textAnchor:"end",fill:m,fontSize:11,children:e.label})]},"ann-"+n)}case"forecast":{let t=i.data||[];if(3>t.length)return null;let r=i.xAccessor||"x",a=i.yAccessor||"y",o=i.scales?.x??i.scales?.time,l=i.scales?.y??i.scales?.value;if(!o||!l)return null;let s,c=t.map(e=>[e[r],e[a]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]);if(3>c.length)return null;if("polynomial"===(e.method||"linear")){let t=Dr(c,e.order||2).equation;s=e=>t.reduce((t,n,i)=>t+n*Math.pow(e,i),0)}else{let e=Er(c);if(!e)return null;s=e}let u=c.length,{se:d,meanX:h,ssX:f}=Br(c,s),m=Hr(e.confidence??.95),p=e.steps??5,y=c[u-1][0],g=(y-c[0][0])/Math.max(u-1,1),b=[];for(let e=1;p>=e;e++)b.push(y+e*g);let x=[];for(let e of b){let t=s(e),n=d*Math.sqrt(1+1/u+(f>0?(e-h)**2/f:0))*m;x.push({x:e,yCenter:t,yUpper:t+n,yLower:t-n})}let v=`M${x.map(e=>`${o(e.x)},${l(e.yUpper)}`).join(" L")} L${x.slice().reverse().map(e=>`${o(e.x)},${l(e.yLower)}`).join(" L")} Z`,w=x.map(e=>`${o(e.x)},${l(e.yCenter)}`).join(" "),k=`${o(y)},${l(s(y))}`,M=e.strokeColor||"#6366f1";/* @__PURE__ */
58
+ return el("g",{children:[
59
+ /* @__PURE__ */Qo("path",{d:v,fill:e.fill||"#6366f1",fillOpacity:e.fillOpacity??.15,stroke:"none"}),
60
+ /* @__PURE__ */Qo("polyline",{points:`${k} ${w}`,fill:"none",stroke:M,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&x.length>0&&/* @__PURE__ */Qo("text",{x:o(x[x.length-1].x)+4,y:l(x[x.length-1].yCenter)-4,fill:M,fontSize:11,children:e.label})]},"ann-"+n)}case"widget":{let r,a;if(null!=e.px&&null!=e.py)r=e.px,a=e.py;else{let t=Yt(e,n,i);if(!t)return null;r=t.x,a=t.y}if(!Ut(r,a,i))return null;let o=e.dx??0,l=e.dy??0,s=e.width??32,c=e.height??32,u=e.content??/* @__PURE__ */Qo("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});/* @__PURE__ */
61
+ return Qo("foreignObject",{x:r+o-s/2,y:a+l-c/2,width:s,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:/* @__PURE__ */Qo("div",{...f(e,t),style:{width:s,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},"ann-"+n)}case"text":{let t=Yt(e,n,i);if(!t)return null;let{x:r,y:a}=t,o=r+(e.dx||0),l=a+(e.dy||0),s=e.color||"var(--semiotic-text, #333)",c=/* @__PURE__ */Qo("text",{x:o,y:l,fill:s,fontSize:e.fontSize||11,opacity:e.opacity,strokeDasharray:e.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:e.label});return!0!==e._redundantConnector?Oo.cloneElement(c,{key:"ann-text-"+n}):/* @__PURE__ */el("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[
62
+ /* @__PURE__ */Qo("line",{x1:r,y1:a,x2:o,y2:l,stroke:s,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),Oo.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},"ann-text-"+n)}case"frame-text":/* @__PURE__ */
63
+ return Qo(Zt,{annotation:e,width:i.width||0,height:i.height||0},"ann-frame-text-"+n);case"category-highlight":{let t=e.category;if(null==t)return null;let r=e=>"function"==typeof e&&"function"==typeof e.bandwidth,a=i.scales?.o,o=i.scales?.x,l=i.scales?.y,s=r(a)?a:r(o)?o:r(l)?l:null;if(!s)return null;let u=s(t+"");if(null==u)return null;let d=s.bandwidth(),h=e.color||"var(--semiotic-primary, #4589ff)",f=e.opacity??.15,m=e.label;/* @__PURE__ */
64
+ return el("g",(i.projection?"vertical"===i.projection:s===o)?{children:[
65
+ /* @__PURE__ */Qo("rect",{x:u,y:0,width:d,height:i.height||0,fill:h,fillOpacity:f}),m&&/* @__PURE__ */Qo(c,{x:u+d/2,y:16,textAnchor:"middle",fill:h,fontSize:12,fontWeight:"bold",text:m,background:e.labelBackground??"none"})]}:{children:[
66
+ /* @__PURE__ */Qo("rect",{x:0,y:u,width:i.width||0,height:d,fill:h,fillOpacity:f}),m&&/* @__PURE__ */Qo(c,{x:12,y:u+d/2,dominantBaseline:"middle",fill:h,fontSize:12,fontWeight:"bold",text:m,background:e.labelBackground??"none"})]},"ann-"+n)}default:return null}}}function Qt(e){return"string"==typeof e?.type?e.type:""}function en(e){return!!e&&"object"==typeof e&&nl.has(Qt(e))}function tn(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}function nn(e){return il.has(Qt(e))&&!tn(e)}function rn(e){return en(e)}function an(e){return"primary"===e?.emphasis||!0===e?.defensive}function on(e,t,n){return Math.max(t,Math.min(n,e))}function ln(e,t,n={}){return"number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations)?Math.max(0,Math.floor(n.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4))):1/0}function sn(e){let t,n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;let i=e?.provenance?.confidence;switch("number"==typeof i&&Number.isFinite(i)&&(t+=15*on(i,0,1)),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}function cn(e){let{annotations:t,width:n,height:i}=e,r=Math.max(0,e.minVisible??1),a=ln(n,i,e),o=t.map((e,t)=>({annotation:e,index:t,note:rn(e)})),l=o.filter(e=>e.note);if(0===l.length||a>=l.length)return{visible:t.slice(),deferred:[],budget:a};let s=l.filter(e=>an(e.annotation)),c=l.filter(e=>!an(e.annotation)).sort((e,t)=>sn(t.annotation)-sn(e.annotation)||e.index-t.index),u=Math.min(c.length,Math.max(Math.max(0,a-s.length),Math.max(0,r-s.length))),d=/* @__PURE__ */new Set([...s.map(e=>e.index),...c.slice(0,u).map(e=>e.index)]),h=[],f=[];for(let{annotation:e,index:t,note:n}of o)!n||d.has(t)?h.push(e):f.push(e);return{visible:h,deferred:f,budget:a}}function un(e){return"number"==typeof e.dx||"number"==typeof e.dy}function dn(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}function hn(e){let t=e?.familiarity;if(!t)return 3;let n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}function fn(e){if(!e)return 1;let t=hn(e);return t>2?4>t?1:.6:1.5}function mn(e){let t=e?.provenance;if(!t||"object"!=typeof t)return e;let n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(cl,t.source)?cl[t.source]:t.source:null,i="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!i||null!=e.label&&"string"!=typeof e.label)return e;let r=[n,i].filter(Boolean).join(" · "),a="string"==typeof e.label?e.label:"";return a.includes(`(${r})`)?e:{...e,label:a?`${a} (${r})`:`(${r})`}}function pn(e,t){let n=!1,i=e.map(e=>bn(e)&&"blended"!==e.cohesion&&"layer"!==e.cohesion?(n=!0,{...e,cohesion:t}):e);return n?i:e}function yn(e){if(!bn(e))return e;let t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function gn(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}function bn(e){return en(e)}function xn(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};let t=Lt(e);if(t)return{width:Math.max(24,t.width+10),height:Math.max(18,t.height+6)};let n="number"==typeof e.wrap?e.wrap:120,i=[...Nt("string"==typeof e.title?e.title:void 0,n,7),...Nt("string"==typeof e.label?e.label:void 0,n,7)],r=i.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(n,7*r)+10),height:Math.max(18,16*i.length+6)}}function vn(e,t,n,i,r){let a=e+n,o=t+i;return Math.abs(n)>Math.abs(i)?{x:0>n?a-r.width-4:a+4,y:0>i?o-r.height:o,width:r.width,height:r.height}:{x:0>n?a-r.width:a,y:0>i?o-r.height-4:o+4,width:r.width,height:r.height}}function wn(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function kn(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function Mn(e,t,n,i){let r=Math.max(0,i-e.x),a=Math.max(0,i-e.y);return(r+Math.max(0,e.x+e.width-(t-i)))*e.height+(a+Math.max(0,e.y+e.height-(n-i)))*e.width}function An(e){let t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}function Sn(e,t){return(e.pointNodes||[]).map(e=>{let n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}function Cn(e,t,n,i,r,a,o,l){let s=wn(e,o),c=.4*Math.hypot(t.dx,t.dy)+80*Mn(s,r,a,l);for(let e of n)c+=12*kn(s,e);for(let e of i)c+=4*kn(s,e);return c}function $n(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};let i=e.pointId??e.nodeId;if(null!=i&&n.pointNodes){let e=n.pointNodes.find(e=>e.pointId===i);if(e)return{x:e.x,y:e.y}}let r=e.coordinates,a=n.scales?.geoProjection;if(Array.isArray(r)&&r.length>=2&&a){let e=r[0],t=r[1];if("number"==typeof e&&"number"==typeof t){let n=a([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?Yt(e,t,n):{x:e.x,y:e.y}}function jn(e){let{annotations:t,context:n,defaultOffset:i=rl,notePadding:r=al,markPadding:a=ol,edgePadding:o=ll,preserveManualOffsets:l=!0,routeLongConnectors:s=!0,connectorThreshold:c=sl,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:m,cohesion:p,audience:y}=e,g=n.width||0,b=n.height||0,x="object"==typeof m?m:{},v=x.breakpoint??480,w=!!m&&v>=g,k=w&&!1!==x.preferShortText?t.map(yn):t,M=w&&!u?{maxAnnotations:x.maxAnnotations??("callout-list"===x.strategy?1:2),minVisible:x.minVisible??1}:u,A=d||w&&(!1!==x.progressiveDisclosure||"callout-list"===x.strategy),S=w&&!f?x.responsive??{minWidth:v}:f,C=w&&!p?x.cohesion:p;if(0===k.length||0>=g||0>=b)return k.slice();let $=[],j=Sn(n,a),L=!1,N=k.map((e,t)=>{if(!bn(e))return e;let a=$n(e,t,n);if(!a)return e;let u=xn(!0===e.defensive?mn(e):e);if(l&&un(e)){let t=dn(e);return $.push(wn(vn(a.x,a.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,u),r)),e}let d=null,h=1/0;for(let e of An(i)){let t=Cn(vn(a.x,a.y,e.dx,e.dy,u),e,$,j,g,b,r,o);h>t&&(d=e,h=t)}if(!d)return e;let f=wn(vn(a.x,a.y,d.dx,d.dy,u),r);$.push(f);let m=Math.hypot(d.dx,d.dy),p=s&&m>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return L=!0,{...e,dx:d.dx,dy:d.dy,...p?{connector:p}:{}}}),I=L?N:k.slice(),z=I;if(h){let e=!1,t=I.map(t=>{let n=gn(t);return n!==t&&(e=!0),n});z=e?t:I}{let e=!1,t=z.map(t=>{if(!0!==t?.defensive)return t;let n=mn(t);return n!==t&&(e=!0),n});z=e?t:z}let F,T=/* @__PURE__ */new Set;if(M){let e="object"==typeof M?M:{},t=fn(y),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??ln(g,b,e))*t))},{deferred:i}=cn({annotations:z,width:g,height:b,...n});for(let e of i)T.add(e)}if(S&&("object"==typeof S&&"number"==typeof S.minWidth?S.minWidth:480)>=g)for(let e of z)bn(e)&&"secondary"===e.emphasis&&T.add(e);if(T.size>0)for(let e of z)!0===e?.defensive&&T.delete(e);return F=0===T.size?z:A?z.map(e=>T.has(e)?{...e,_annotationDeferred:!0}:e):z.filter(e=>!T.has(e)),C?pn(F,C):F}function Ln({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?/* @__PURE__ */ul("foreignObject",{x:0,y:0,width:t,height:n,children:e}):/* @__PURE__ */ul("text",{x:t/2,y:22,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontSize:14,className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)",fontFamily:"var(--semiotic-title-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-title-font-weight, bold)"},children:e}):null}function Nn(e){if(!1!==e?.interactive)return e?.style?.cursor}function In(e){if(!e)return!1;for(let t of e)if(Nn(t))return!0;return!1}function zn(e,t){if(!e)return;let n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function Fn(e,t){return zn(e),In(t)}function Tn(e,t,n){if(e){if(!t.inside||"touch"===t.pointerType)return void zn(e);zn(e,n(t))}}function Rn(e){let t=dl.useRef(null);dl.useEffect(()=>{e.current&&(t.current=e.current)}),dl.useEffect(()=>()=>zn(t.current),[])}function On(e,t,n){let i=Nn(t);return i&&null!=e&&!1!==e?/* @__PURE__ */hl("g",{style:{cursor:i},"data-semiotic-mark-cursor":i,children:e},n):e}function Wn(){let[e,t]=yl(!1);return bl(()=>{t(!0)},[]),e}function Dn(){let e=gl(xl,vl,wl);return pl(e).current}function En(e){let{hydrated:t,wasHydratingFromSSR:n,storeRef:i,dirtyRef:r,renderFnRef:a,cancelRender:o,cleanup:l}=e;bl(()=>{if(!t)return;let e=i.current;t&&n&&e?.cancelIntroAnimation?.(),!n&&e?.sceneNodes&&e.sceneNodes.length>0&&e?.markStylePaintPending?e.markStylePaintPending():r.current=!0,o?.(),a.current()},[t,n]);let s=pl(l);s.current=l,fl(()=>()=>s.current?.(),[])}function Bn({children:e}){let[t,n]=kl.useState(!1),i=kl.useCallback(()=>n(e=>!e),[]),r=kl.useMemo(()=>({visible:t,setVisible:n,toggle:i}),[t,i]);/* @__PURE__ */
67
+ return Ml(Al.Provider,{value:r,children:e})}function Hn(){return kl.useContext(Al)}function Pn(){let e=kl.useContext(Al);return e?e.toggle:null}function Gn({hoverPoint:e}){let t="";if(e){let n=e.data||e;t="object"==typeof n?"Data point: "+Object.entries(n).filter(([,e])=>"object"!=typeof e&&"function"!=typeof e).map(([e,t])=>`${e}: ${t}`).join(", "):"Data point: "+n}/* @__PURE__ */
68
+ return Sl("div",{"aria-live":"polite","aria-atomic":"true",style:Cl,children:t})}function Vn(e){let t={};if(null==e||"object"!=typeof e)return t;for(let[n,i]of Object.entries(e))n.startsWith("_")||null==i||""===i||("number"==typeof i?Number.isFinite(i)&&(t[n]=i):"string"==typeof i?t[n]=i:"boolean"==typeof i?t[n]=i+"":i instanceof Date&&(t[n]=i.toISOString().slice(0,10)));return t}function _n(e){return e&&"object"==typeof e?e:{}}function Yn(e){return _n(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Un(e,t){let n=_n(e.accessibility);return{label:"string"==typeof n.label&&n.label.length>0?n.label:"string"==typeof e.label&&e.label.length>0?e.label:t,values:Vn(Yn(e))}}function Xn(e){let t=[];if(!Array.isArray(e))return t;let n=e.some(e=>e&&("line"===e.type||"area"===e.type));for(let i of e)if(i&&"object"==typeof i&&null!==i.datum)try{switch(i.type){case"point":if(n)break;t.push({label:"Point",values:Vn(Yn(i))});break;case"line":case"area":{let e=Yn(i),n=Array.isArray(e)?e:[],r="line"===i.type?"Line point":"Area point";for(let e of n)t.push({label:r,values:Vn(e)});break}case"rect":{let e=Yn(i),n=null!=e&&"object"==typeof e?e:{},r=n.category??i.group??"",a=n.value??n.__aggregateValue??n.total,o=Vn(n);null==o.category&&""!==r&&(o.category=r+""),null==o.value&&null!=a&&(o.value="number"==typeof a||"string"==typeof a?a:a+""),t.push({label:"Bar",values:o});break}case"heatcell":{let e=Vn(Yn(i));null==e.value&&"number"==typeof i.value&&Number.isFinite(i.value)&&(e.value=i.value),t.push({label:"Cell",values:e});break}case"wedge":{let e=Yn(i),n=Vn(e);if(null==n.category){let t=_n(e),i=t.category??t.label;null!=i&&(n.category=i+"")}t.push({label:"Wedge",values:n});break}case"circle":t.push({label:"Node",values:Vn(Yn(i))});break;case"arc":t.push({label:"Arc",values:Vn(Yn(i))});break;case"candlestick":t.push({label:"Candlestick",values:Vn(Yn(i))});break;case"geoarea":{let e=_n(Yn(i)),n=Vn(e);if(null==n.name){let t=_n(e.properties).name??e.name;null!=t&&(n.name=t+"")}t.push({label:"Region",values:n});break}}}catch{}return t}function qn(e){return null==e||""===e?"—":"number"==typeof e?Number.isNaN(e)?"—":jl(e):"boolean"==typeof e?e?"true":"false":"object"==typeof e?"—":e+""}function Kn(e){let t=/* @__PURE__ */new Map;for(let n of e??[])for(let[e,i]of Object.entries(n?.values??{})){if(null==i||""===i)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:/* @__PURE__ */new Set},t.set(e,n)),"number"==typeof i){if(!Number.isFinite(i))continue;n.count++,n.sum+=i,n.min>i&&(n.min=i),i>n.max&&(n.max=i)}else"object"!=typeof i&&"function"!=typeof i&&n.strings.add(i+"")}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};let n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}function Zn(e,t){let n=[e+" data points."];for(let e of t)if(e.numeric)n.push(`${e.name}: ${jl(e.min)} to ${jl(e.max)}, mean ${jl(e.mean)}.`);else{let t=e.uniqueValues,i=t.length>3?`${t.slice(0,3).join(", ")}… (${e.count} unique)`:t.join(", ");n.push(`${e.name}: ${i}.`)}return n.join(" ")}function Jn(e){return null==e||"object"!=typeof e||Array.isArray(e)?{}:e}function Qn(e){return null!=e&&"object"==typeof e?Jn(e).id:e}function ei(e){let t=Jn(e.datum);return{source:Qn(t.source??e.source),target:Qn(t.target??e.target)}}function ti(e,t){let n=/* @__PURE__ */new Map,i=[],r=!1;for(let e=0;t.length>e;e++){let a=t[e];if(!a||"object"!=typeof a)continue;let o=Jn(a.datum),{source:l,target:s}=ei(a),c="number"==typeof o.value&&Number.isFinite(o.value),u=c?o.value:0;r||(r=c);for(let[e,t,i]of[[l,1,3],[s,0,2]]){if(null==e||""===e)continue;let r=e+"",a=n.get(r)??[0,0,0,0];a[t]++,a[i]+=u,n.set(r,a)}i.push(Un(a,null!=l||null!=s?`${null==l?"?":l+""} → ${null==s?"?":s+""}`:"Edge "+(e+1)))}let a=[],o=0,l=0;for(let t=0;e.length>t;t++){let i=e[t];if(!i||"object"!=typeof i||null===i.datum)continue;let r=Jn(i.datum).id??i.id,s=null!=r?r+"":"node-"+t,[c,u,d,h]=n.get(s)??[0,0,0,0],f=c+u;o+=f,f>l&&(l=f),a.push({id:s,degree:f,inDeg:c,outDeg:u,wDegree:d+h,wInDeg:d,wOutDeg:h,semantic:Un(i,s)})}a.sort((e,t)=>t.degree-e.degree);let s=[`${a.length} nodes, ${t.length} edges.`];return a.length>0&&s.push(`Mean degree: ${jl(o/a.length)}, max degree: ${l}.`),{nodeRows:a,edgeRows:i,hasWeights:r,summary:s.join(" ")}}function ni({accessibleTable:e,children:t}){return"object"!=typeof e?t:typeof document>"u"?null:/* @__PURE__ */Ll($l.Suspense,{fallback:null,children:/* @__PURE__ */Ll(Il,{target:e.portalTarget,children:t})})}function ii(e,t){if(!e||0===e.length)return t+", empty";let n={};for(let t of e){if(null===t?.datum)continue;let e=t.type+"";n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return t+", empty";let i=[],r={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},a=["point","line","area","rect","heatcell","circle","candlestick","wedge","arc","geoarea"],o=Object.keys(n).sort((e,t)=>{let n=a.indexOf(e),i=a.indexOf(t);return(-1===n?999:n)-(-1===i?999:i)});for(let e of o)i.push(`${n[e]} ${r[e]||e}`);return`${t}, ${i.join(", ")}`}function ri(e,t,n){let i=[];return e>0&&i.push(e+" nodes"),t>0&&i.push(t+" edges"),0===i.length?n+", empty":`${n}, ${i.join(", ")}`}function ai({scene:e,chartType:t,tableId:n,chartTitle:i}){let[r,a]=$l.useState(!1),[o,l]=$l.useState(5),s=Hn(),c=s?.visible??!1,u=r||c,d=$l.useRef(null),h=i?"Data summary for "+i:n?`Data summary for ${t} ${n}`:"Data summary for "+t;$l.useEffect(()=>{u||l(5)},[u]);let f=$l.useCallback(e=>{e.target===e.currentTarget&&!r&&!c&&a(!0)},[r,c]),m=$l.useCallback(e=>{c||d.current?.contains(e.relatedTarget)||a(!1)},[c]);if(!e||0===e.length)return n?/* @__PURE__ */Ll("span",{id:n,tabIndex:-1,style:Cl}):null;if(!u)/* @__PURE__ */
69
+ return Ll("div",{id:n,className:Tl,tabIndex:-1,onFocus:f,style:Cl,role:"region","aria-label":h,children:/* @__PURE__ */Nl("button",{type:"button",onClick:()=>a(!0),style:Wl,children:["View data summary (",e.length," elements)"]})});let p=Xn(e),y=Kn(p),g=Zn(p.length,y),b=Math.min(o,p.length),x=p.slice(0,b),v=p.length-b,w=/* @__PURE__ */new Set;for(let e of x)for(let t of Object.keys(e.values))w.add(t);let k=Array.from(w);/* @__PURE__ */
70
+ return Nl("div",{ref:d,id:n,className:Rl,tabIndex:-1,onBlur:m,style:Dl,role:"region","aria-label":h,children:[
71
+ /* @__PURE__ */Ll("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{c&&s&&s.setVisible(!1),a(!1)},"aria-label":"Close data summary",style:Bl,children:"×"}),
72
+ /* @__PURE__ */Ll("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:El,children:g}),
73
+ /* @__PURE__ */Nl("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Sample data for "+t,style:Hl,children:[
74
+ /* @__PURE__ */Ll("caption",{className:"semiotic-accessible-data-table-caption",style:Vl,children:v>0?`First ${b} of ${p.length} data points`:`All ${p.length} data points`}),
75
+ /* @__PURE__ */Ll("thead",{children:/* @__PURE__ */Nl("tr",{children:[
76
+ /* @__PURE__ */Ll("th",{style:Pl,children:"type"}),k.map(e=>/* @__PURE__ */Ll("th",{style:Pl,children:e},e))]})}),
77
+ /* @__PURE__ */Ll("tbody",{children:x.map((e,t)=>/* @__PURE__ */Nl("tr",{children:[
78
+ /* @__PURE__ */Ll("td",{style:Gl,children:e.label}),k.map(t=>/* @__PURE__ */Ll("td",{style:Gl,children:qn(e.values[t])},t))]},t))})]}),v>0&&/* @__PURE__ */Nl("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>l(e=>e+zl),style:_l,children:["Show ",Math.min(zl,v)," more"," ",1===v?"row":"rows"," (",v," remaining)"]})]})}function oi({nodes:e,edges:t,chartType:n,tableId:i,chartTitle:r}){let[a,o]=$l.useState(!1),[l,s]=$l.useState(5),[c,u]=$l.useState(5),d=Hn(),h=d?.visible??!1,f=a||h,m=r?"Data summary for "+r:i?`Data summary for ${n} ${i}`:"Data summary for "+n,p=$l.useRef(null);$l.useEffect(()=>{f||(s(5),u(5))},[f]);let y=$l.useCallback(e=>{e.target===e.currentTarget&&!a&&!h&&o(!0)},[a,h]),g=$l.useCallback(e=>{h||p.current?.contains(e.relatedTarget)||o(!1)},[h]),b=e.filter(e=>null!==e.datum);if(0===b.length&&0===t.length)return i?/* @__PURE__ */Ll("span",{id:i,tabIndex:-1,style:Cl}):null;if(!f)/* @__PURE__ */
79
+ return Ll("div",{id:i,className:Tl,tabIndex:-1,onFocus:y,style:Cl,role:"region","aria-label":m,children:/* @__PURE__ */Nl("button",{type:"button",onClick:()=>o(!0),style:Wl,children:["View data summary (",b.length," nodes, ",t.length," edges)"]})});let{nodeRows:x,edgeRows:v,hasWeights:w,summary:k}=ti(b,t),M=Math.min(l,x.length),A=x.slice(0,M),S=x.length-M,C=Math.min(c,v.length),$=v.slice(0,C),j=v.length-C,L=/* @__PURE__ */new Set;for(let e of A)for(let t of Object.keys(e.semantic.values))L.add(t);let N=Array.from(L),I=/* @__PURE__ */new Set;for(let e of $)for(let t of Object.keys(e.values))I.add(t);let z=Array.from(I);/* @__PURE__ */
80
+ return Nl("div",{ref:p,id:i,className:Ol,tabIndex:-1,onBlur:g,style:Dl,role:"region","aria-label":m,children:[
81
+ /* @__PURE__ */Ll("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{h&&d&&d.setVisible(!1),o(!1)},"aria-label":"Close data summary",style:Bl,children:"×"}),
82
+ /* @__PURE__ */Ll("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:El,children:k}),x.length>0&&/* @__PURE__ */Nl("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Node data and degree summary for "+n,style:Hl,children:[
83
+ /* @__PURE__ */Ll("caption",{className:"semiotic-accessible-data-table-caption",style:Vl,children:S>0?`Top ${M} of ${x.length} nodes by degree`:`All ${x.length} nodes by degree`}),
84
+ /* @__PURE__ */Ll("thead",{children:/* @__PURE__ */Nl("tr",{children:[
85
+ /* @__PURE__ */Ll("th",{style:Pl,children:"node"}),N.map(e=>/* @__PURE__ */Ll("th",{style:Pl,children:e},e)),
86
+ /* @__PURE__ */Ll("th",{style:Pl,children:"degree"}),
87
+ /* @__PURE__ */Ll("th",{style:Pl,children:"in"}),
88
+ /* @__PURE__ */Ll("th",{style:Pl,children:"out"}),w&&/* @__PURE__ */Ll("th",{style:Pl,children:"w. degree"}),w&&/* @__PURE__ */Ll("th",{style:Pl,children:"w. in"}),w&&/* @__PURE__ */Ll("th",{style:Pl,children:"w. out"})]})}),
89
+ /* @__PURE__ */Ll("tbody",{children:A.map((e,t)=>/* @__PURE__ */Nl("tr",{"aria-label":e.semantic.label,children:[
90
+ /* @__PURE__ */Ll("td",{style:Gl,children:e.semantic.label}),N.map(t=>/* @__PURE__ */Ll("td",{style:Gl,children:qn(e.semantic.values[t])},t)),
91
+ /* @__PURE__ */Ll("td",{style:Gl,children:e.degree}),
92
+ /* @__PURE__ */Ll("td",{style:Gl,children:e.inDeg}),
93
+ /* @__PURE__ */Ll("td",{style:Gl,children:e.outDeg}),w&&/* @__PURE__ */Ll("td",{style:Gl,children:jl(e.wDegree)}),w&&/* @__PURE__ */Ll("td",{style:Gl,children:jl(e.wInDeg)}),w&&/* @__PURE__ */Ll("td",{style:Gl,children:jl(e.wOutDeg)})]},t))})]}),S>0&&/* @__PURE__ */Nl("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>s(e=>e+zl),style:_l,children:["Show ",Math.min(zl,S)," more"," ",1===S?"node":"nodes"," (",S," remaining)"]}),v.length>0&&/* @__PURE__ */Nl("table",{className:"semiotic-accessible-data-table-table semiotic-accessible-data-table-edges",role:"table","aria-label":"Edge data for "+n,style:{...Hl,marginTop:12},children:[
94
+ /* @__PURE__ */Ll("caption",{className:"semiotic-accessible-data-table-caption",style:Vl,children:j>0?`First ${C} of ${v.length} edges`:`All ${v.length} edges`}),
95
+ /* @__PURE__ */Ll("thead",{children:/* @__PURE__ */Nl("tr",{children:[
96
+ /* @__PURE__ */Ll("th",{style:Pl,children:"edge"}),z.map(e=>/* @__PURE__ */Ll("th",{style:Pl,children:e},e))]})}),
97
+ /* @__PURE__ */Ll("tbody",{children:$.map((e,t)=>/* @__PURE__ */Nl("tr",{"aria-label":e.label,children:[
98
+ /* @__PURE__ */Ll("td",{style:Gl,children:e.label}),z.map(t=>/* @__PURE__ */Ll("td",{style:Gl,children:qn(e.values[t])},t))]},t))})]}),j>0&&/* @__PURE__ */Nl("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>u(e=>e+zl),style:_l,children:["Show ",Math.min(zl,j)," more"," ",1===j?"edge":"edges"," (",j," remaining)"]})]})}function li({summary:e}){return e?/* @__PURE__ */Ll("div",{role:"note",style:Cl,children:e}):null}function si({tableId:e}){/* @__PURE__ */
99
+ return Ll("a",{href:"#"+e,style:Cl,onClick:t=>{t.preventDefault();let n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:e=>{Object.assign(e.currentTarget.style,{position:"absolute",width:"auto",height:"auto",overflow:"visible",clip:"auto",whiteSpace:"normal",padding:"4px 8px",background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:"4px",zIndex:"10",fontSize:"12px",top:"4px",left:"4px"})},onBlur:e=>{let t=e.currentTarget;t.removeAttribute("style"),Object.assign(t.style,Cl)},children:"Skip to data table"})}function ci({active:e,hoverPoint:t,margin:n,size:i,shape:r="circle",width:a,height:o,pathData:l}){if(!e||!t)return null;let s,c=t.x+n.left,u=t.y+n.top;if("geoarea"!==r&&"path"!==r||!l)if("rect"===r&&null!=a&&null!=o){let e=Math.max(a,4),t=Math.max(o,4);s=/* @__PURE__ */Yl("rect",{x:c-e/2-3,y:u-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:Ul,strokeWidth:2,strokeDasharray:"4,2"})}else s=/* @__PURE__ */Yl("circle","wedge"===r?{cx:c,cy:u,r:12,fill:"none",stroke:Ul,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:c,cy:u,r:8,fill:"none",stroke:Ul,strokeWidth:2,strokeDasharray:"4,2"});else s=/* @__PURE__ */Yl("g",{transform:`translate(${n.left},${n.top})`,children:/* @__PURE__ */Yl("path",{d:l,fill:"none",stroke:Ul,strokeWidth:2.5,strokeDasharray:"6,3"})});/* @__PURE__ */
100
+ return Yl("svg",{style:{position:"absolute",left:0,top:0,width:i[0],height:i[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:s})}function ui({x:e,y:t,containerWidth:n,containerHeight:i,margin:r,children:a,className:o="stream-frame-tooltip",zIndex:l=1}){let s,c=Number.isFinite(e)&&Number.isFinite(t),u=Xl.useRef(null),[d,h]=Xl.useState(null);Xl.useLayoutEffect(()=>{let e=u.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();!Number.isFinite(t.width)||!Number.isFinite(t.height)||h(e=>e&&.5>Math.abs(e.width-t.width)&&.5>Math.abs(e.height-t.height)?e:{width:t.width,height:t.height})};if(t(),typeof ResizeObserver>"u")return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[o,n,i,c]),s=d?`translate(${d.width+12>n-e?"calc(-100% - 12px)":"12px"}, ${d.height+12>i-t?"calc(-100% - 4px)":"4px"})`:`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${.3*i>t?"4px":"calc(-100% - 4px)"})`;let f=b(a),m=f?null:sa;return c?/* @__PURE__ */ql("div",{ref:u,className:f?o:(o+" semiotic-tooltip").trim(),style:{...m||{},position:"absolute",left:r.left+e,top:r.top+t,transform:s,pointerEvents:"none",zIndex:l,width:"max-content"},children:a}):null}function di(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}function hi(e,t){return Math.min((e-t.startTime)/t.duration,1)}function fi(e,t,n){return e+(t-e)*n}function mi(){return"u">typeof performance?performance.now():Date.now()}function pi(e,t){if(!1===e)return{transition:void 0,introEnabled:!1};let n="u">typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;return{transition:e?!0===e?{duration:300}:{duration:e.duration??300,easing:"linear"===e.easing?"linear":"ease-out"}:t,introEnabled:!(n||!e||!0!==e&&!1===e.intro)}}function yi(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function gi(e,t){let n=e();return Number.isFinite(n)?n:t}function bi(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function xi(e){let t=Yr(),n=ts(t);n.current=t;let[i,r]=He(e.sizeProp,e.responsiveWidth,e.responsiveHeight),a=r[0],o=r[1],l=es(()=>[a,o],[a,o]),s=!!e.title,c=!!e.legend&&"top"===e.legendPosition,u=es(()=>{let t=ye({...e.marginDefault,...e.userMargin},s,c);if(e.legend&&!e.legendMarginReserved){let n={...t},i=e.legendPosition??"right";Le(t,{legend:e.legend,position:i,size:l,hasTitle:s,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),ge(t,n,l,i)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,s,c,l]),d=r[0]-u.left-u.right,h=r[1]-u.top-u.bottom,f=bi(e.foregroundGraphics,r,u),m=bi(e.backgroundGraphics,r,u),p=Gr(e=>e.theme),{transition:y,introEnabled:g}=pi(e.animate,e.transitionProp),b="semiotic-table-"+Kl.useId(),x=ts(null);if(!x.current){let t=!e.suspendWhenHidden||typeof document>"u"||!document.hidden;x.current=new is({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}let v=x.current;v.configure({clock:e.clock,random:e.random,seed:e.seed});let w=ts(null),k=ts(e.frameScheduler??as);k.current=e.frameScheduler??as;let M=ts(null),A=ts(!1),S=ts(()=>{}),C=Zl(()=>{if(null!==w.current||A.current)return;let e=k.current,t=!1,n=!1,i=e.requestAnimationFrame(()=>{t=!0;let e=!n;e&&(A.current=!0),w.current=null,M.current=null;try{S.current()}finally{e&&(A.current=!1)}});n=!0,t||(w.current=i,M.current=e)},[]),$=Zl(()=>{null!==w.current&&((M.current??k.current).cancelAnimationFrame(w.current),w.current=null,M.current=null)},[]);rs(()=>{v.setPaused(!0===e.paused)},[v,e.paused]),Jl(()=>{if(!e.suspendWhenHidden||typeof document>"u")return void v.setVisible(!0);let t=()=>v.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[v,e.suspendWhenHidden]),Jl(()=>()=>{$()},[$]);let j=ts(()=>{}),L=ts(()=>{}),N=ts({inside:!1,clientX:0,clientY:0,pointerType:void 0}),I=ts(null),z=ts(null),F=ts(null),T=Zl(()=>{let e=I.current;I.current=null,e&&j.current(e)},[]),R=Zl(e=>{let t=N.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,I.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===z.current){let e=k.current,t=!1,n=e.requestAnimationFrame(()=>{t=!0,z.current=null,F.current=null,T()});t||(z.current=n,F.current=e)}},[T]),O=Zl(()=>{N.current.inside=!1,I.current=null,null!==z.current&&((F.current??k.current).cancelAnimationFrame(z.current),z.current=null,F.current=null),L.current()},[]);Jl(()=>()=>{I.current=null,null!==z.current&&((F.current??k.current).cancelAnimationFrame(z.current),z.current=null,F.current=null)},[]);let W=e.themeDirtyRef,D=ts(!1);return rs(()=>{if(!W)return;let t=!D.current;D.current=!0,(!t||!e.skipInitialThemeInvalidation)&&(zr(),W.current=!0,C())},[p,e.skipInitialThemeInvalidation,C,W]),Jl(()=>{if(W)return Ir(()=>i.current,()=>{W.current=!0,C()})},[i,C,W]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:i,size:r,margin:u,adjustedWidth:d,adjustedHeight:h,resolvedForeground:f,resolvedBackground:m,currentTheme:p,transition:y,introEnabled:g,tableId:b,frameRuntime:v,rafRef:w,renderFnRef:S,scheduleRender:C,cancelRender:$,hoverHandlerRef:j,hoverLeaveRef:L,onPointerMove:R,onPointerLeave:O,pointerStateRef:N}}function vi(e,t,n){let i=Math.round(t[0]*n),r=Math.round(t[1]*n),a=0===t[0]?n:i/t[0],o=0===t[1]?n:r/t[1],l=t[0]+"px",s=t[1]+"px";return e.style.width!==l&&(e.style.width=l),e.style.height!==s&&(e.style.height=s),e.width!==i&&(e.width=i),e.height!==r&&(e.height=r),{effectiveDprX:a,effectiveDprY:o}}function wi(e,t,n,i){let r=e.getContext("2d");if(!r)return null;let{effectiveDprX:a,effectiveDprY:o}=vi(e,t,i);return r.setTransform(a,0,0,o,0,0),r.translate(n.left,n.top),r}function ki(e,t){if(typeof window>"u")return 1;let n=window.devicePixelRatio||1,i="u">=typeof window&&("function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches||768>Math.min(window.innerWidth||1/0,window.innerHeight||1/0))?2:3,r="number"==typeof e&&e>0?e:i;if(!t)return Math.max(1,Math.min(n,r));let[a,o]=t,l=Math.min(Math.sqrt(8388608/(a*o)),16384/Math.max(a,o));return Math.max(1>l?0:1,Math.min(n,r,l))}function Mi(e){function t(){i||(r(),n=null,e(),queueMicrotask(()=>{i||a()}))}if(typeof window>"u"||"function"!=typeof window.matchMedia)return()=>{};let n=null,i=!1,r=()=>{n&&("function"==typeof n.removeEventListener?n.removeEventListener("change",t):"function"==typeof n.removeListener&&n.removeListener(t))},a=()=>{let e=`(resolution: ${window.devicePixelRatio||1}dppx)`;n=window.matchMedia(e),n.media.includes("resolution")?"function"==typeof n.addEventListener?n.addEventListener("change",t):"function"==typeof n.addListener&&n.addListener(t):n=null};return a(),()=>{i=!0,r(),n=null}}function Ai(e){let{cancelRender:t,dirtyRef:n,frameRuntime:i,manageFrameRuntime:r,maxDevicePixelRatio:a,scheduleRender:o}=e,l=ss(null),s=ss(null),c=ss(!1),u=ss(!1),d=ss(!1);return ds(()=>{!u.current&&(u.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),En({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),os(()=>{if(!1!==r)return i.subscribe(()=>{i.isActive?(n.current=!0,o()):t()})},[t,n,i,r,o]),os(()=>Mi(()=>{c.current=!0,o()}),[o]),os(()=>{d.current?(c.current=!0,o()):d.current=!0},[a,o]),{canvasRef:l,interactionCanvasRef:s,resolutionDirtyRef:c}}function Si(e,t){return Ai({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}function Ci({children:e,size:t,margin:n,backdropFill:i,overflowVisible:r=!1}){return e||i?/* @__PURE__ */us("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:r?"visible":void 0},children:[i&&"transparent"!==i?/* @__PURE__ */cs("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:i}):null,
101
+ /* @__PURE__ */cs("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function $i(e){return"touch"===e?"touch":"pointer"}function ji(e){let t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function Li(e){let{onObservation:t,datum:n,x:i=0,y:r=0,chartType:a,chartId:o,context:l,timestamp:s=Date.now()}=e;if(t){if(!n)return void t({type:"hover-end",timestamp:s,chartType:a,chartId:o});t({type:"hover",datum:n,x:i,y:r,timestamp:s,chartType:a,chartId:o}),"focus"===l?.type&&t({type:"focus",datum:n,inputType:"touch"===l.inputType?"pointer":l.inputType,timestamp:s,chartType:a,chartId:o})}}function Ni(e){let{onObservation:t,datum:n,x:i=0,y:r=0,chartType:a,chartId:o,context:l,timestamp:s=Date.now()}=e;if(t){if(!n)return void t({type:"click-end",timestamp:s,chartType:a,chartId:o});t({type:"click",datum:n,x:i,y:r,timestamp:s,chartType:a,chartId:o}),"activate"===l?.type&&t({type:"activate",datum:n,inputType:l.inputType,timestamp:s,chartType:a,chartId:o})}}function Ii({componentName:e,width:t,height:n,children:i}){/* @__PURE__ */
102
+ return hs(xa,{fallback:i=>/* @__PURE__ */hs(T,{componentName:e,message:i.message,width:t,height:n}),children:i})}function zi(e,t,n,i){return!1===i||null==e||Array.isArray(e)&&e.length>0||!Array.isArray(e)?null:/* @__PURE__ */hs("div",{style:{...ms,width:t,height:n},children:i||"No data available"})}function Fi(e,t,n,i){if(!e||!1===i)return null;if(null!=i)/* @__PURE__ */
103
+ return hs("div",{style:{width:t,height:n,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:i});let r=Math.min(5,Math.floor(n/40)),a=Math.max(8,Math.floor(n/(3*r))),o=Math.max(6,Math.floor(n/(2.5*r))),l=Math.floor((n-(r*(a+o)-o))/2);/* @__PURE__ */
104
+ return hs("div",{style:{width:t,height:n,position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:Array.from({length:r},(e,n)=>/* @__PURE__ */hs("div",{className:"semiotic-loading-bar",style:{...ps,position:"absolute",top:l+n*(a+o),left:Math.floor(.1*t),width:30+(37*n+13)%50+"%",height:a,opacity:.5+n%2*.2}},n))})}function Ti(e,t,n,i){if(!fs||!t||0===t.length||"string"!=typeof i)return;let r=t[0];if(!r||"object"!=typeof r||i in r)return;let a=Object.keys(r).join(", ");console.warn(`[semiotic] ${e}: ${n} "${i}" not found in data. Available keys: ${a}`)}function Ri(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}function Oi(e){return e?"string"==typeof e?{name:e}:e:null}function Wi(e,t,n,i){if(!t)return e;let r=(r,...a)=>{let o={...e(r,...a)};if(t.isActive)if(t.predicate(i?i(r):r))n?.selectedStyle&&Object.assign(o,n.selectedStyle);else{let e=n?.unselectedOpacity??.5;o.opacity=e,o.fillOpacity=e,o.strokeOpacity=e,n?.unselectedStyle&&Object.assign(o,n.unselectedStyle)}return o};return Zr(r,[r])}function Di(e,t={}){let n=t.mobileSemantics?.interaction,i="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,r="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,a=!!n||void 0!==i,o=e&&"object"==typeof e?e:void 0;if(!1===e||!1===o?.enabled||void 0===e&&!r&&!a)return gs;let l=o??{};return{enabled:!0,tapToSelect:l.tapToSelect??!0,tapToLockTooltip:l.tapToLockTooltip??!0,clearSelection:l.clearSelection??"backgroundTap",targetSize:l.targetSize??i??44,snap:l.snap??"nearestDatum",brushHandleSize:l.brushHandleSize??44,standardControls:l.standardControls??!1}}function Ei(e,t,n){let i=bs[e||"primary"],r=e&&"primary"!==e||!n?.width?i.width:n.width,a=e&&"primary"!==e||!n?.height?i.height:n.height,o=le({...t,mode:e},{width:t.width??r,height:t.height??a}).props,l=o.mode||e||"primary",s=bs[l],c="context"===l||"sparkline"===l,u="primary"===l&&n?.width?n.width:s.width;return{mode:l,width:o.width??u,height:o.height??("primary"===l&&n?.height?n.height:s.height),showAxes:o.showAxes??s.showAxes,showGrid:o.showGrid??s.showGrid,enableHover:o.enableHover??(!!o.linkedHover||s.enableHover),showLegend:o.showLegend??s.showLegend,showLabels:o.showLabels??s.showLabels,title:c?void 0:o.title,description:o.description,summary:o.summary,accessibleTable:o.accessibleTable,xLabel:c?void 0:o.xLabel,yLabel:c?void 0:o.yLabel,categoryLabel:c?void 0:o.categoryLabel,valueLabel:c?void 0:o.valueLabel,marginDefaults:Hi(s.marginDefaults,o.showCategoryTicks,o.orientation),compactMode:c,mobileInteraction:Di(o.mobileInteraction,{mode:l,width:o.width??u,mobileSemantics:o.mobileSemantics}),mobileSemantics:o.mobileSemantics}}function Bi(e){return e.compactMode?e.marginDefaults:xs}function Hi(e,t,n){if(!1!==t)return e;let i={...e};return"horizontal"===n?i.left=Math.min(i.left,15):i.bottom=Math.min(i.bottom,15),i}function Pi({data:e,colorBy:t,colorScale:n,getColor:i,strokeColor:r,strokeWidth:a,categories:o}){return{legendGroups:[{styleFn:e=>{let t=e.color||"#333",n={fill:t,stroke:t};return void 0!==r&&(n.stroke=r),void 0!==a&&(n.strokeWidth=a),n},type:"fill",items:(void 0!==o?o:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((r,a)=>{let o=e.find("function"==typeof t?e=>t(e)===r:e=>e[t]===r),l=o?i(o,t,n):n?n(r):kr[a%kr.length];return{label:r+"",color:l,__semioticCategory:!0}}),label:""}]}}function Gi(e,t){if(!t)return[];let n=/* @__PURE__ */new Set;for(let i of e){let e="function"==typeof t?t(i):i[t];null!=e&&n.add(e+"")}return Array.from(n)}function Vi(e,t){return null!=e&&Object.hasOwn(e,t)}function _i(e,t,n){let i=Vi(n,"legendPosition"),r=Vi(n,"legendLayout");return{legendPosition:i?n?.legendPosition??"right":e??"right",legendLayout:r?n?.legendLayout:t}}function Yi({data:e,colorBy:t,colorScale:n,showLegend:i,legendPosition:r,userMargin:a,defaults:o={top:50,bottom:60,left:70,right:40},categories:l,additionalLegend:s,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:m}){let{legendPosition:p,legendLayout:y}=_i(r,d,h),g=Vi(h,"legend"),b=Ra(uo),x=Ye(),v=void 0!==i?i:!b&&!!t,w=!!t&&(v||x),k=vs(()=>w?void 0!==l?l:Gi(e,t):[],[l,t,e,w]);_e(x&&t?k:[],n);let M=vs(()=>{if(!v||!t)return;let i=Pi({data:e,colorBy:t,colorScale:n,getColor:Mr,categories:k});return 0!==i.legendGroups.reduce((e,t)=>e+t.items.length,0)?i:void 0},[v,t,e,n,k]),A=vs(()=>g?h?.legend:fe(M,s),[M,s,h?.legend,g]),{hasAxis:S,hasAxisLabel:C,rotatedTicks:$,topAxis:j,leftAxis:L,rightAxis:N}=m??{},I=void 0!==j,z=void 0!==L,F=void 0!==N,{hasAxis:T,hasAxisLabel:R,rotatedTicks:O}=j??{},{hasAxis:W,hasAxisLabel:D}=L??{},{hasAxis:E,hasAxisLabel:B}=N??{},H=vs(()=>{let e="number"==typeof a?{top:a,bottom:a,left:a,right:a}:a??{},t=Fe(o,h?.axes,f),n=n=>{let i=e[n];return"number"==typeof i?i:t[n]},i={top:n("top"),right:n("right"),bottom:n("bottom"),left:n("left")},r={...i};return A&&(Le(i,{legend:A,position:p,size:[c??600,u??400],hasTitle:f,legendLayout:y,minimumMargin:"bottom"===p?80:"top"===p?50:0,axisChrome:void 0===S?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:S,hasAxisLabel:C,rotatedTicks:$,topAxis:I?{hasAxis:T,hasAxisLabel:R,rotatedTicks:O}:void 0,leftAxis:z?{hasAxis:W,hasAxisLabel:D}:void 0,rightAxis:F?{hasAxis:E,hasAxisLabel:B}:void 0}}),null!=c&&null!=u&&ge(i,r,[c,u],p)),i},[o,h?.axes,a,A,p,c,u,y,f,S,C,$,I,T,R,O,z,W,D,F,E,B]);return{legend:A,margin:H,legendPosition:p,legendLayout:y,legendMarginReserved:void 0!==A&&!Vi(h,"margin"),hasAutomaticLegend:void 0!==M}}function Ui(e){let t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function Xi(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function qi(e,t,n,i=!0,r=!1){let[a,o]=Ms(null),[l,s]=Ms(
105
+ /* @__PURE__ */new Set),c=vs(()=>/* @__PURE__ */new Set,[]),u=vs(()=>new Set(n),[n]),d=null!=a&&u.has(a)?a:null,h=vs(()=>{if(0===l.size)return l;let e=new Set(Array.from(l).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===l.size?l:e},[u,c,l]);ks(()=>{(!i||!t||!e||"none"===e)&&(o(null),s(e=>0===e.size?e:/* @__PURE__ */new Set))},[t,i,e]),ks(()=>{o(e=>null==e||u.has(e)?e:null),s(e=>{if(0===e.size)return e;let t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?/* @__PURE__ */new Set:t.size===e.size?e:t})},[u]);let f=ws(t=>{!i||"highlight"!==e||o(!t||!u.has(t.label)||r&&!0!==t.__semioticCategory?null:t.label)},[u,i,e,r]),m=ws(t=>{!i||"isolate"!==e||!u.has(t.label)||r&&!0!==t.__semioticCategory||s(e=>{let n=new Set(Array.from(e).filter(e=>u.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===u.size?/* @__PURE__ */new Set:n})},[u,i,e,r]),p=vs(()=>{if(!i||!e||"none"===e||!t)return null;let n=e=>{let n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:n+""};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,i,e,d,h]);return{highlightedCategory:i&&"highlight"===e?d:null,isolatedCategories:i&&"isolate"===e?h:c,onLegendHover:f,onLegendClick:m,legendSelectionHook:p}}function Ki(e,t,n,i=5){let[r,a]=n,[o,l]=Ms(null),[s,c]=Ms(/* @__PURE__ */new Map),u=vs(()=>/* @__PURE__ */new Set,[]);ks(()=>{l(null),c(/* @__PURE__ */new Map)},[r,a,i,e]);let d=ws(t=>{if("highlight"!==e||!t)return void("highlight"===e&&l(null));let n=Ui(t);n&&l({key:Xi(t,n),range:n})},[e]),h=ws(t=>{if("isolate"!==e)return;let n=Ui(t);n&&c(e=>{let r=new Map(e),a=Xi(t,n);return r.has(a)?r.delete(a):r.set(a,n),r.size===i?/* @__PURE__ */new Map:r})},[i,e]),f=vs(()=>{let n="highlight"===e&&o?[o.range]:"isolate"===e?[...s.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{let i=t(e);return Number.isFinite(i)&&n.some(([e,t])=>i>=Math.min(e,t)&&Math.max(e,t)>=i)}}},[o,s,e,t]);return{highlightedCategory:"highlight"===e?o?.key??null:null,isolatedCategories:"isolate"===e?new Set(s.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}function Zi(e,t,n){let i=e.xValue??t?.[n];if(null==i)return null;let r=Number(i);return Number.isFinite(r)?r:null}function Ji(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?{...t,xValue:e.xValue}:t||{}}function Qi(e){if(!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function er(){let e=Kr()?.colors?.categorical;return e&&e.length>0?e:void 0}function tr(){return Kr()?.colors?.sequential||void 0}function nr(){return Kr()?.colors?.diverging||void 0}function ir(e,t,n,i,r){if(e)return e;if(n&&"object"==typeof n&&!Array.isArray(n)){let e=Ar(n,i);if(e)return e}let a;if(Array.isArray(n))a=n;else if(t&&t.length>0)a=t;else if("string"==typeof n){let e=br[n];Array.isArray(e)&&(a=e)}return a&&0!==a.length?null!=i?(r.has(i)||r.set(i,r.size),a[r.get(i)%a.length]):a[0]:vr}function rr(e){return"function"==typeof e?e:t=>t[e]}function ar(e,t,n){let i=O(null!=n),r=er();return As(()=>{if(!t)return;let a=i??void 0,o=n??(r&&r.length>0?r:void 0)??"category10";if(0!==e.length){if("function"==typeof t){let n=Array.from(new Set(e.map(e=>t(e)+"")));if(a&&Qi(a)){let e=n.map(e=>({_cat:e})),t=Sr(e,"_cat",o);return e=>Ar(a,e)??t(e)}let i=n.map(e=>({_cat:e}));return Sr(i,"_cat",o)}if(a&&Qi(a)){let n=Sr(e,t,o);return e=>Ar(a,e)??n(e)}return Sr(e,t,o)}if(a&&Qi(a)){let e=Sr([{_:"a"}],"_",o);return t=>Ar(a,t)??e(t)}},[e,t,n,i,r])}function or(e,t,n){return As(()=>{if(!t||"auto"===t||"function"==typeof t)return e;let i=[...e],r=rr(n);return i.sort("asc"===t?(e,t)=>r(e)-r(t):(e,t)=>r(t)-r(e))},[e,t,n])}function lr({selection:e,linkedHover:t,fallbackFields:n=Ns,unwrapData:i=!1,onObservation:r,chartType:a,chartId:o,onClick:l,hoverHighlight:s,colorByField:c,mobileInteraction:u,emitObservations:d=!0}){let h=$s(),f=As(()=>Ri(t,n),[t,n]),m=As(()=>"series"===f?.mode?[f.seriesField||c||n[0]].filter(e=>!!e):f?.fields||n,[f,c,n]),p=q({name:e?.name||"__unused__",fields:m}),y=Z({name:f?.name||"hover",fields:m}),g=_r(e=>e.pushObservation),b=Ss(e=>{r?.(e),g?.(e)},[r,g]),x=e?{isActive:p.isActive,predicate:p.predicate}:null,[v,w]=Cs(null),k=Ls(!1),M=c||n[0],A=As(()=>{if(!s||null==v||!M)return null;let e=v,t=M;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[s,v,M]),S=Ss((e,n)=>{let i=!e&&k.current&&!!u?.enabled&&u.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===f?.mode&&f.xField){let n=Zi(e,t,f.xField);null!=n&&B(f.name||"hover",n,h)}"x-position"!==f?.mode&&y.onHover(t)}else"x-position"===f?.mode&&!i&&H(f.name||"hover",h),"x-position"!==f?.mode&&!i&&y.onHover(null);if(s&&M)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);let n=t?.[M];w(null!=n?n+"":null)}else i||w(null);d&&(r||g)&&Li({onObservation:b,datum:e?Ji(e):null,x:e?.x,y:e?.y,chartType:a||"unknown",chartId:o,context:n})},[t,y,f,h,r,a,o,g,b,d,s,M,u]),C=Ss((n=!0)=>{k.current=!1,t&&"x-position"!==f?.mode&&y.onHover(null),e&&u?.tapToSelect&&p.clear(),n&&s&&w(null),"x-position"===f?.mode&&(G(f.name||"hover",h),H(f.name||"hover",h))},[t,f,y,e,u,p,s,h]),$=Ss((n,i)=>{let c=!!u?.enabled&&(u.tapToLockTooltip||u.tapToSelect),x=!!u?.enabled&&"backgroundTap"===u.clearSelection;if("x-position"===f?.mode&&f.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);let t=Zi(n,e,f.xField);null!=t&&P(f.name||"hover",t,h)}if(c)if(n){k.current=!0;let i=Ji(n);if(t&&"x-position"!==f?.mode&&y.onHover(i),e&&u?.tapToSelect&&m.length>0){let e={};for(let t of m){let n=i[t];void 0!==n&&(e[t]=[n])}Qi(e)&&p.selectPoints(e)}if(s&&M){let e=i?.[M];w(null!=e?e+"":null)}}else x&&C();if(n||x){if(n&&l){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),l(e,{x:n.x??0,y:n.y??0})}d&&(r||g)&&Ni({onObservation:b,datum:n?Ji(n):null,x:n?.x,y:n?.y,chartType:a||"unknown",chartId:o,context:i})}},[l,d,r,g,b,a,o,f,h,u,t,y,e,p,m,s,M,C]);return js(()=>{if(!u?.enabled||typeof document>"u")return;let e=e=>{"Escape"===e.key&&k.current&&C()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u?.enabled,C]),js(()=>()=>{k.current&&C(!1)},[C]),js(()=>{if("x-position"!==f?.mode)return;let e=f.name||"hover";return()=>{G(e,h),H(e,h)}},[f?.mode,f?.name,h]),{activeSelectionHook:x,hoverSelectionHook:A,customHoverBehavior:S,customClickBehavior:$,crosshairSourceId:h}}function sr(e,t){let n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function cr(e,t,n){return Ei(e,t,n)}function ur(e,t="#4e79a7"){return Fr(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function dr(e){let t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?"s_"+t:t}function hr(e,t,n,i){let r=e.glyph;if(!r?.parts?.length||0>=e.size)return null;let a=jr(r,e.size);if(0>=a.scale)return null;let o=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${a.offsetX},${a.offsetY}) scale(${a.scale})`,l=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),s=Nr(r,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=s?dr(i+"-clip"):void 0,u=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),d=t=>r.parts.map((n,i)=>{let r=t?"none"===n.fill?void 0:t:Lr(n.fill,l,e.accent),a=t?n.stroke&&"none"!==n.stroke?t:void 0:Lr(n.stroke??"none",l,e.accent);return r||a?/* @__PURE__ */zs("path",{d:n.d,fill:r??"none",stroke:a,strokeWidth:a?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},i):null});/* @__PURE__ */
106
+ return Fs("g",{transform:o,opacity:1===u?void 0:u,children:[s&&c&&/* @__PURE__ */zs("clipPath",{id:c,children:/* @__PURE__ */zs("rect",{x:s.x,y:s.y,width:s.width,height:s.height})}),s&&e.ghostColor?/* @__PURE__ */zs("g",{children:d(e.ghostColor)}):null,s&&c?/* @__PURE__ */zs("g",{clipPath:`url(#${c})`,children:d()}):d()]},i)}function fr(e,t){let n=e.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity))).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color??t,opacity:null==e.opacity?void 0:Math.max(0,Math.min(1,e.opacity))}));return 2>n.length?null:n.map((e,t)=>/* @__PURE__ */zs("stop",{offset:e.offset,stopColor:e.color,stopOpacity:e.opacity},t))}function mr(e,t){let n=e.fillGradient;if(!n||"object"!=typeof n)return null;let i=e.x,r=e.y,a=e.x,o=e.y+e.h;"bottom"===e.roundedEdge?(r=e.y+e.h,o=e.y):"right"===e.roundedEdge?(i=e.x+e.w,r=e.y,a=e.x,o=e.y):"left"===e.roundedEdge&&(i=e.x,r=e.y,a=e.x+e.w,o=e.y);let l=fr(n.stops,ur(e.style.fill));return l?/* @__PURE__ */zs("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:i,y1:r,x2:a,y2:o,children:l}):null}function pr(e){let{x:t,y:n,w:i,h:r}=e,{tl:a,tr:o,br:l,bl:s}=Cr(e),c=`M${t+a},${n}`;return c+=` L${t+i-o},${n}`,o>0&&(c+=` A${o},${o} 0 0 1 ${t+i},${n+o}`),c+=` L${t+i},${n+r-l}`,l>0&&(c+=` A${l},${l} 0 0 1 ${t+i-l},${n+r}`),c+=` L${t+s},${n+r}`,s>0&&(c+=` A${s},${s} 0 0 1 ${t},${n+r-s}`),c+=` L${t},${n+a}`,a>0&&(c+=` A${a},${a} 0 0 1 ${t+a},${n}`),c+=" Z",c}function yr(e,t,n){let i=$r(e.symbolType,e.size,e.path);/* @__PURE__ */
107
+ return zs("path",{d:i,transform:e.rotation?`translate(${e.x},${e.y}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.x},${e.y})`,fill:e.style.fill?ur(e.style.fill):"none",fillOpacity:e.style.fillOpacity,opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},`${n??""}symbol-${t}`)}function gr(e,t,n){let i="point"===e.type,r=i?"circle":"rect",a=i?{cx:e.x,cy:e.y,r:e.r}:{x:e.x,y:e.y,width:e.w,height:e.h},o=`${n?n+"-":""}${i?"point":"xyrect"}-${t}-hatch`,l=Fr(e.style.fill)?Tr(e.style.fill,o):void 0;/* @__PURE__ */
108
+ return Fs(Is.Fragment,{children:[l&&/* @__PURE__ */zs("defs",{children:l}),Is.createElement(r,{...a,fill:l?`url(#${o})`:ur(e.style.fill),opacity:i?e.style.opacity??e.style.fillOpacity??.8:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth})]},`${e.type}-${t}`)}import{l as br,m as xr,n as vr,o as wr,p as kr,r as Mr,s as Ar,t as Sr}from"./c-Y342FJ6K.min.js";import{E as Cr,a as $r,d as jr,f as Lr,h as Nr,l as Ir,n as zr,r as Fr,t as Tr,u as Rr,v as Or}from"./c-3BYZXCX3.min.js";import{a as Wr,b as Dr,c as Er,d as Br,e as Hr}from"./c-JXVYIXTV.min.js";import{g as Pr,h as Gr,i as Vr,j as _r,k as Yr,m as Ur,n as Xr,o as qr,v as Kr}from"./c-5NYONM6V.min.js";import{a as Zr,b as Jr,c as Qr}from"./c-U6NLVFN4.min.js";import{a as ea}from"./c-3PFVJFBK.min.js";var ta={fresh:1,aging:1.5,stale:3};import{jsx as na,jsxs as ia}from"react/jsx-runtime";var ra="var(--semiotic-bg, #ffffff)";import*as aa from"react";import*as oa from"react";import{jsx as la}from"react/jsx-runtime";var sa={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};y(p);var ca=["name","label","title"],ua=["type","kind","category","group","class","status","role","shape"],da=["value","amount","total","count","weight","score"],ha=/* @__PURE__ */new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);import{jsx as fa,jsxs as ma}from"react/jsx-runtime";import*as pa from"react";import{jsx as ya,jsxs as ga}from"react/jsx-runtime";import{jsx as ba}from"react/jsx-runtime";var xa=class extends pa.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){let{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:/* @__PURE__ */ba(T,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}};import{createContext as va,useContext as wa,useMemo as ka}from"react";import{jsx as Ma}from"react/jsx-runtime";var Aa=va(null),Sa=va(null);W.displayName="CategoryColorProvider";import{useId as Ca,useMemo as $a,useCallback as ja}from"react";import{useSyncExternalStore as La}from"react";var Na={positions:/* @__PURE__ */new Map},Ia=/* @__PURE__ */new Set,za={positions:/* @__PURE__ */new Map};import{useMemo as Fa}from"react";import{createContext as Ta,useContext as Ra,useEffect as Oa,useId as Wa,useLayoutEffect as Da,useMemo as Ea,useRef as Ba,useState as Ha,useCallback as Pa}from"react";import*as Ga from"react";var Va={fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},_a={fontSize:"var(--semiotic-legend-font-size, 12px)"},Ya=34,Ua=70;import*as Xa from"react";import{jsx as qa,jsxs as Ka}from"react/jsx-runtime";import{jsx as Za,jsxs as Ja}from"react/jsx-runtime";var Qa=(e,t,n,i,r,a,o,l,s,c,u)=>{let{items:d}=e,h=[],f=0,m={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:i,isolatedCategories:r,focusedGroupIndex:a,focusedItemIndex:o,groupIndex:l,onFocusedIndexChange:s,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=r,metrics:u};return d.forEach((e,t)=>{h.push(De(m,e,t,`translate(0,${f})`,"ArrowUp","ArrowDown")),f+=u.rowHeight}),h},eo=(e,t,n,i,r,a,o,l,s,c,u,d)=>{let{items:h}=e,f=[],{swatchSize:m,labelGap:p,itemGap:y,rowHeight:g,align:b}=u,x={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:i,isolatedCategories:r,focusedGroupIndex:a,focusedItemIndex:o,groupIndex:l,onFocusedIndexChange:s,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=r,metrics:u},v=h.map(e=>m+p+7*e.label.length),w=[],k=0,M=0;v.forEach((e,t)=>{let n=0===M?e:M+y+e;d&&d>0&&M>0&&n>d?(w.push({start:k,end:t,width:M}),k=t,M=e):M=n}),h.length>0&&w.push({start:k,end:h.length,width:M}),w.forEach((e,t)=>{let n="center"===b?Math.max(0,((d??e.width)-e.width)/2):"end"===b?Math.max(0,(d??e.width)-e.width):0;for(let i=e.start;e.end>i;i++)f.push(De(x,h[i],i,`translate(${n},${t*g})`,"ArrowLeft","ArrowRight")),n+=v[i]+y});let A=w.reduce((e,t)=>Math.max(e,t.width),0),S=w.length;return{items:f,offset:A,totalRows:S,totalHeight:S*g}},to=({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:a,focusedGroupIndex:o,focusedItemIndex:l,onFocusedIndexChange:s,legendInteraction:c,metrics:u})=>{let d=[],h=ze(e.map(e=>({hasLabel:!!e.label,itemCount:e.items.length})),u.rowHeight);return e.forEach((e,f)=>{let m=h[f];d.push(
109
+ /* @__PURE__ */Za("line",{stroke:"gray",x1:0,y1:m.lineY,x2:t,y2:m.lineY},"legend-top-line legend-symbol-"+f)),e.label&&null!=m.labelY&&d.push(
110
+ /* @__PURE__ */Za("text",{y:m.labelY,className:"legend-group-label",fontSize:12,style:_a,fill:"var(--semiotic-text, #333)",children:e.label},"legend-text-"+f)),d.push(
111
+ /* @__PURE__ */Za("g",{className:"legend-item",transform:`translate(0,${m.itemsY})`,children:Qa(e,n,i,r,a,o,l,f,s,c,u)},"legend-group-"+f))}),d},no=({legendGroups:e,height:t,width:n,customClickBehavior:i,customHoverBehavior:r,highlightedCategory:a,isolatedCategories:o,focusedGroupIndex:l,focusedItemIndex:s,onFocusedIndexChange:c,legendInteraction:u,metrics:d})=>{let h=0,f=[];e.forEach((e,t)=>{let m=0;e.label&&(m+=16);let p=eo(e,i,r,a,o,l,s,t,c,u,d,d.maxWidth??n);m+=p.offset+5,f.push({label:e.label,...p,offset:m,totalRows:p.totalRows,totalHeight:p.totalHeight}),h+=m+12});let m=d.maxWidth??n,p=h>m?0:"center"===d.align?Math.max(0,(m-h)/2):"end"===d.align?Math.max(0,m-h):0,y=[];return f.forEach((n,i)=>{let r=e[i];r.label&&(y.push(
112
+ /* @__PURE__ */Za("text",{transform:`translate(${p},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",fontSize:12,style:_a,fill:"var(--semiotic-text, #333)",children:r.label},"legend-text-"+i)),p+=16),y.push(
113
+ /* @__PURE__ */Za("g",{className:"legend-item",transform:`translate(${p},0)`,children:n.items},"legend-group-"+i)),p+=n.offset+5,e[i+1]&&y.push(
114
+ /* @__PURE__ */Za("line",{stroke:"gray",x1:p,y1:-8,x2:p,y2:(n.totalHeight||t)+0+8},"legend-top-line legend-symbol-"+i)),p+=12}),/* @__PURE__ */Za("g",{children:y})};import{useRef as io,useState as ro,useEffect as ao,useLayoutEffect as oo}from"react";var lo=typeof window>"u"?ao:oo;import{jsx as so,jsxs as co}from"react/jsx-runtime";var uo=Ta(!1),ho=Ta(!1),fo=Ta(null),mo=typeof window>"u"?Oa:Da,po="__linked-legend-isolate__",yo="__linked-legend-highlight__",go=Object.freeze([]),bo=typeof window>"u"||typeof document>"u",xo={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},vo=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=ut({kind:"initialize"},[],this.revisions),this.listeners=/* @__PURE__ */new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){let n=ut(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(let e of[...this.listeners])e();return n}};import{memo as wo,useEffect as ko,useRef as Mo}from"react";var Ao={sceneGeometry:0,layout:0,domain:0},So="production"!==process.env.NODE_ENV,Co={revisions:Ao,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},$o=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=Ao,this.lastObserved=Ao,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){So&&(this.lastObserved=ft(this.lastObserved,dt(e)))}beforeCompute(e,t){if(!So)return Co;let n=ft(dt(e),this.lastObserved),i=`${(a=n).sceneGeometry}|${a.layout}|${a.domain}`,r=!ht(n,this.lastConsumed);var a;return{revisions:n,signature:i,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:r,warnUnconsumed:!t&&r&&this.lastUnconsumedWarning!==i}}afterCompute(e,t,n){if(So){if(t&&e.wasUnconsumed&&(this.lastConsumed=e.revisions),e.warnUnconsumed&&!t)return console.warn(`[semiotic] ${this.hostName} observed scene-affecting revisions without a scene rebuild: ${e.signature}.`),void(this.lastUnconsumedWarning=e.signature);t&&e.sawSignals&&!e.wasUnconsumed&&!n&&this.lastDuplicateWarning!==e.signature?(console.warn(`[semiotic] ${this.hostName} performed scene rebuild with unchanged scene revisions: ${e.signature}.`),this.lastDuplicateWarning=e.signature):t&&!e.sawSignals&&(this.lastDuplicateWarning="")}}},jo=wo(function({store:e,diagnostics:t}){return ko(()=>{let n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null});import{jsx as Lo}from"react/jsx-runtime";import{jsx as No}from"react/jsx-runtime";var Io={secondary:0,primary:3},zo=".annotation-deferred{opacity:0;pointer-events:none;transition:opacity .12s ease}.stream-xy-frame:hover .annotation-deferred,.stream-ordinal-frame:hover .annotation-deferred,.stream-network-frame:hover .annotation-deferred,.stream-geo-frame:hover .annotation-deferred,.stream-xy-frame:focus-within .annotation-deferred,.stream-ordinal-frame:focus-within .annotation-deferred,.stream-network-frame:focus-within .annotation-deferred,.stream-geo-frame:focus-within .annotation-deferred{opacity:1;pointer-events:auto}@media (prefers-reduced-motion:reduce){.annotation-deferred{transition:none}}";import{jsx as Fo}from"react/jsx-runtime";import{jsx as To,jsxs as Ro}from"react/jsx-runtime";import*as Oo from"react";import{jsx as Wo,jsxs as Do}from"react/jsx-runtime";import{packEnclose as Eo}from"d3-hierarchy";import{area as Bo,curveLinear as Ho,curveMonotoneX as Po,curveMonotoneY as Go,curveStep as Vo,curveStepAfter as _o,curveStepBefore as Yo,curveBasis as Uo,curveCardinal as Xo,curveCatmullRom as qo}from"d3-shape";var Ko=new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]);import{jsx as Zo}from"react/jsx-runtime";var Jo={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"};import{jsx as Qo,jsxs as el}from"react/jsx-runtime";var tl={linear:Ho,monotoneX:Po,monotoneY:Go,step:Vo,stepAfter:_o,stepBefore:Yo,basis:Uo,cardinal:Xo,catmullRom:qo},nl=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),il=new Set(["label","callout","callout-circle","callout-rect"]),rl=32,al=6,ol=4,ll=8,sl=72,cl={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};import{jsx as ul}from"react/jsx-runtime";import*as dl from"react";import{jsx as hl}from"react/jsx-runtime";import{useEffect as fl,useLayoutEffect as ml,useRef as pl,useState as yl,useSyncExternalStore as gl}from"react";var bl="u">typeof window?ml:fl,xl=()=>()=>{},vl=()=>!1,wl=()=>!0;import*as kl from"react";import{jsx as Ml}from"react/jsx-runtime";var Al=kl.createContext(null);import{jsx as Sl}from"react/jsx-runtime";var Cl={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};import*as $l from"react";var jl=e=>{if(null==e)return"";let t=Math.round(100*e)/100;return Number.isNaN(t)?"":t+""};import{jsx as Ll,jsxs as Nl}from"react/jsx-runtime";var Il=$l.lazy(()=>import("./c-P3SKRNZN.min.js")),zl=25,Fl="semiotic-accessible-data-table",Tl=Fl+" semiotic-accessible-data-table-hidden",Rl=Fl+" semiotic-accessible-data-table-visible",Ol=Rl+" semiotic-accessible-data-table-network",Wl={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Dl={position:"absolute",top:0,left:0,right:0,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",padding:"14px 16px 12px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontFamily:"var(--semiotic-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)",fontSize:13,lineHeight:1.5,color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",borderRadius:"var(--semiotic-border-radius, 0px) var(--semiotic-border-radius, 0px) 0 0"},El={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},Bl={position:"absolute",top:10,right:10,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",cursor:"pointer",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:13,lineHeight:1,padding:0,borderRadius:"var(--semiotic-border-radius, 4px)"},Hl={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},Pl={textAlign:"left",padding:"5px 10px",borderBottom:"2px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))"},Gl={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},Vl={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},_l={marginTop:8,padding:"4px 10px",fontSize:12,cursor:"pointer",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",borderRadius:"var(--semiotic-border-radius, 4px)",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",fontFamily:"inherit"};import{jsx as Yl}from"react/jsx-runtime";var Ul="var(--semiotic-focus, #005fcc)";import*as Xl from"react";import{jsx as ql}from"react/jsx-runtime";import*as Kl from"react";import{useCallback as Zl,useEffect as Jl,useLayoutEffect as Ql,useMemo as es,useRef as ts}from"react";var ns=()=>"u">typeof performance?performance.now():Date.now(),is=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=/* @__PURE__ */new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??ns,this.lastWallTime=gi(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){let e=gi(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(let e of this.subscribers)e()}setClock(e){let t=e??ns;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=gi(t,this.lastWallTime))}setRandomSource(e,t){let n="number"==typeof(i=t)&&Number.isFinite(i)?Math.trunc(i):void 0;var i;e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:yi(n)))}},rs=typeof window>"u"?Jl:Ql,as={requestAnimationFrame:e=>(typeof window>"u"?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>(typeof window>"u"?globalThis:window).cancelAnimationFrame(e)};import{useEffect as os,useLayoutEffect as ls,useRef as ss}from"react";import{jsx as cs,jsxs as us}from"react/jsx-runtime";var ds=typeof window>"u"?os:ls;import{jsx as hs}from"react/jsx-runtime";var fs="u">typeof process&&"production"!==process.env?.NODE_ENV,ms={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--semiotic-text-secondary, #666)",fontSize:13,fontFamily:"inherit",border:"1px dashed var(--semiotic-border, #ddd)",borderRadius:4,boxSizing:"border-box"},ps={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2},ys=.5,gs={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},bs={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}},xs={top:10,bottom:10,left:10,right:10};import{useMemo as vs,useCallback as ws,useEffect as ks,useState as Ms}from"react";import{useMemo as As,useCallback as Ss,useState as Cs,useId as $s,useEffect as js,useRef as Ls}from"react";var Ns=[];import*as Is from"react";import{jsx as zs,jsxs as Fs}from"react/jsx-runtime";var Ts={innerRadius:0,outerRadius:0,startAngle:0,endAngle:0};export{go as a,st as b,di as c,hi as d,fi as e,mi as f,ta as g,e as h,t as i,n as j,i as k,r as l,a as m,o as n,bo as o,vo as p,mt as q,pt as r,jo as s,de as t,he as u,fe as v,ge as w,we as x,Ae as y,Se as z,Ce as A,Le as B,Fe as C,yt as D,l as E,c as F,u as G,d as H,f as I,m as J,zo as K,Mt as L,Jt as M,Qt as N,en as O,nn as P,ln as Q,jn as R,G as S,X as T,Ln as U,Ts as V,ur as W,dr as X,hr as Y,fr as Z,mr as _,pr as $,yr as aa,gr as ba,Nn as ca,In as da,zn as ea,Fn as fa,Tn as ga,Rn as ha,On as ia,Wn as ja,Dn as ka,Bn as la,Hn as ma,Pn as na,Gn as oa,Xn as pa,ni as qa,ii as ra,ri as sa,ai as ta,oi as ua,li as va,si as wa,ci as xa,sa as ya,p as za,y as Aa,b as Ba,ui as Ca,He as Da,yi as Ea,xi as Fa,vi as Ga,wi as Ha,ki as Ia,Si as Ja,Ci as Ka,w as La,M as Ma,v as Na,C as Oa,$ as Pa,j as Qa,L as Ra,N as Sa,I as Ta,z as Ua,F as Va,$i as Wa,ji as Xa,Li as Ya,Ni as Za,T as _a,xa as $a,Ii as ab,zi as bb,Fi as cb,Ti as db,O as eb,W as fb,D as gb,Ri as hb,Oi as ib,ys as jb,Wi as kb,q as lb,K as mb,Z as nb,ee as ob,te as pb,ae as qb,le as rb,Di as sb,Bi as tb,ue as ub,se as vb,Pe as wb,_e as xb,Ye as yb,qe as zb,Pi as Ab,Gi as Bb,Yi as Cb,qi as Db,Ki as Eb,er as Fb,tr as Gb,nr as Hb,ir as Ib,ar as Jb,or as Kb,lr as Lb,sr as Mb,cr as Nb,Ke as Ob,Ze as Pb,Je as Qb,et as Rb,tt as Sb,nt as Tb,it as Ub,rt as Vb,at as Wb,ot as Xb,lt as Yb};
@@ -0,0 +1 @@
1
+ function e(e,t){if("function"==typeof e)return t=>+e(t);let a=e||t;return e=>+e[a]}function t(e,t){if("function"==typeof e)return e;let a=e||t;return e=>e[a]}function a(e,t){return _e.has(e)||Je.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function r(e){for(let t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){let a=e[t];if("string"==typeof a&&a)return a}}function n(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function l(e,t={}){let a=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,n=/* @__PURE__ */new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&n.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!a)return!1;let t=e?.provenance?.stableId;return!(t&&n.has(t)&&!r)})}function i(){let e=globalThis;return e[et]||(e[et]={recipes:/* @__PURE__ */new Map,capabilities:/* @__PURE__ */new Map,layouts:/* @__PURE__ */new Map}),e[et]}function o(e){return i().recipes.get(e)}function s(e){let t=i().layouts.get(e)?.identity;return t?{...t}:void 0}function c(e){return"string"==typeof e?o(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function u(e){return"string"==typeof e?e:e.id??e.name}function h(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function d(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function m(e,t,a){return a??c(t.recipe)??c(t.recipeId)??o(e)}function f(e,t,a=[]){let r=e.accessor?t[e.accessor]:void 0;if("string"==typeof r&&r)return r;if(e.field)return e.field;let n=a.find(e=>e&&"object"==typeof e);if(!n)return;let l=Object.entries(n).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?l.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in n):l.find(([,e])=>"string"==typeof e)?.[0]}function p(e,t){return e.dataRoles.find(e=>e.role===t)}function g(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function $(e,t,a,r,n,l={}){let i={...l};if(t)for(let[e,a]of Object.entries(t))i[e]=a;for(let e of a.dataRoles){let a=f(e,r,n),l=t&&a?t[a]:a;void 0!==l&&(i[e.role]=l)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{let a=i[t];return null==a?`{${t}}`:a+""})}function b(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function v(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}function y(e,t,a,r){let n=g(e,["nominal","ordinal"]),l=g(e,["quantitative"]),i=n?f(n,a,t):void 0,o=l?f(l,a,t):void 0,s=n?.role??i??"category",c=l?.role??o??"value",h=e.encodings??[],d=h.length?h.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${s} and ${c} are mapped through the recipe's declared visual semantics`,{number:m,percent:p}=v(r),$=/* @__PURE__ */new Map;if(i&&o)for(let e of t){let t=(e[i]??"Uncategorized")+"",a=Number(e[o]);Number.isFinite(a)&&$.set(t,($.get(t)??0)+a)}let y=[...$].sort((e,t)=>t[1]-e[1]),w=y.reduce((e,[,t])=>e+t,0),C=y[0],k=y[1],A=w>0?((C?.[1]??0)+(k?.[1]??0))/w:0,x=e.intents.map(e=>({id:u(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,M=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${s} and ${c}. ${b(d)}.`,l2:y.length>0?`${y.length} categories total ${m.format(w)}. ${C[0]} accounts for ${m.format(C[1])}${w>0?` (${p.format(C[1]/w)})`:""}${k?`, followed by ${k[0]} at ${m.format(k[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>y.length?C?C[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>A?`The total is distributed across ${y.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${C[0]} and ${k[0]}, which together account for ${p.format(A)}.`,l4:`The chart is intended for ${x??"explanation"}${M?` with a ${M} audience`:""}: ${e.designContract.whyCustom}`}}function w(e,t,a={}){let r=d(t),n=h(t),l=a.locale??"en",i=("function"==typeof e.description?e.description({data:r,config:n,locale:l}):void 0)?.levels??y(e,r,n,l),o=a.levels??["l1","l2","l3","l4"],s={};for(let e of o)i[e]&&(s[e]=i[e]);let c=["l1","l2","l3","l4"].map(e=>s[e]).filter(e=>!!e).join(" "),u=a.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:c,levels:s,...u?.length?{caveats:u}:{}}}function C(e,t,a){return"function"==typeof a?a(e,t):e[a]}function k(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function A(e,t,a){return Math.max(t,Math.min(a,e))}function x(e,t){let a=k(e);return null!=a&&a>0?a:t}function M(e){if(!e)return;let t=k(e[0]),a=k(e[1]);return null!=t&&null!=a?t>a?[a,t]:[t,a]:void 0}function S(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function F(e,t,a=0){let r=new Set(e.filter(e=>null!=e.id).map(e=>e.id+"")),n=/* @__PURE__ */new Map;for(let l of e){let e=null==l.id?`${t}-${a++}`:l.id+"";for(;null==l.id&&r.has(e);)e=`${t}-${a++}`;r.add(e),n.set(e,null==l.id?{...l,id:e}:l)}return{seed:e,rows:Array.from(n.values()),nextId:a}}function L(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>(e+"").trim()).filter(Boolean),a=t.length?t:["Intake"],r=Math.max(a.length,Math.round(e.count??Math.max(48,12*a.length))),n=x(e.unitValue,1),l=S(e.seed??1),i=e.idPrefix??"mechanical-pile",o=a.map(()=>.65+.9*l()),s=o.reduce((e,t)=>e+t,0)||1,c=r-a.length,u=o.map(e=>e/s*c),h=u.map(e=>1+Math.floor(e)),d=r-h.reduce((e,t)=>e+t,0),m=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;d>0;e=(e+1)%m.length)h[m[e].index]+=1,d-=1;return a.map((e,t)=>({id:`${i}-${t}`,category:e,value:h[t]*n,mechanical:!0,unitCount:h[t],unitValue:n,share:h[t]/r}))}function P(e,t){let a=e/t,r=Math.round(a);return Math.ceil(r>0&&Number.EPSILON*a*4>=Math.abs(a-r)?r:a)}function D(e){let t=Math.max(2,Math.round(e.bins)),a=Math.max(1,Math.round(e.pegRows??t-1)),r=Math.max(1,Math.round(e.count??Math.max(64,4*t))),n=A(Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,0,1),l=S(e.seed??1),i=e.idPrefix??"mechanical";return Array.from({length:r},(e,t)=>{let r=0;for(let e=0;a>e;e+=1)l()<n&&(r+=1);let o=a/2;return{id:`${i}-${t}`,value:r,mechanical:!0,pegRows:a,branchProbability:n,pathRights:r,side:o>r?"left":r>o?"right":"center"}})}function j(e){let{windowSize:t,watermark:a,watermarkAtArrivalAccessor:r}=e;if(!Number.isFinite(t)||0>=t)throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:n}=F(e.data,"event"),l=n.flatMap((t,a)=>{let r=k(C(t,a,e.timeAccessor));return null==r?[]:[{datum:t,index:a,eventTime:r,arrivalTime:k(C(t,a,e.arrivalAccessor))??r,watermarkAtArrival:0,late:!1}]}),i="function"==typeof a?null:k(a?.value),o="function"==typeof a?t:k(a?.delay)??t,s=-1/0,c=-1/0;for(let e of l.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){s=Math.max(s,e.eventTime);let n="function"==typeof a?k(a(s)):s-o;c=i??Math.max(c,n??s-t);let l=r?k(C(e.datum,e.index,r)):null;e.watermarkAtArrival=l??c,e.late=e.watermarkAtArrival>=(Math.floor(e.eventTime/t)+1)*t}return{events:l,watermarkValue:l.length?c:i??-o}}function B(e,t){let a="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!a)return null;let r=Array.isArray(t.data)?t.data:[],n=Math.max(2,Math.round(k(t.bins)??21)),l=Math.max(1,Math.round(k(t.pegRows)??n-1));if(a&&(r="GaltonBoardChart"===e?D({bins:n,count:t.mechanicalCount,pegRows:l,branchProbability:t.branchProbability,seed:t.seed}):L({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),r=F(r,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){let e=/* @__PURE__ */new Map,n=t.valueAccessor??(a?"value":void 0);return r.forEach((a,r)=>{let l=(C(a,r,t.categoryAccessor??"category")??"unknown")+"",i=n?k(C(a,r,n)):1;e.set(l,(e.get(l)??0)+Math.max(0,i??0))}),{generated:a,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){let e=r.map((e,a)=>k(C(e,a,t.valueAccessor??"value"))).filter(e=>null!=e),i=a?[0,l]:M(t.valueExtent),o=i?.[0]??(e.length?Math.min(...e):0),s=i?.[1]??(e.length?Math.max(...e):1),c=o===s?1:s-o,u=Array.from({length:n},(e,t)=>({label:t+1+"",value:0}));for(let t of e)u[Math.max(0,Math.min(n-1,Math.floor((t-o)/c*n)))].value+=1;return{generated:a,rows:u}}if("CollisionSwarmChart"===e){let e=/* @__PURE__ */new Map;return r.forEach((a,r)=>{if(null==k(C(a,r,t.xAccessor??"x")))return;let n=t.groupAccessor?(C(a,r,t.groupAccessor)??"All")+"":"All";e.set(n,(e.get(n)??0)+1)}),{generated:a,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){let e=k(t.windows?.size??10);if(null==e||0>=e)return null;let{events:n}=j({data:r,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),l=n.map(e=>e.eventTime),i=l.length?Math.min(...l):0,o=l.length?Math.max(...l):i+e,s=Math.min(k(t.timeExtent?.[0])??i,i),c=Math.max(k(t.timeExtent?.[1])??o,o),u=Math.floor(s/e)*e,h=Math.max(1,Math.ceil((c-u+e)/e)),d=Array.from({length:h},(t,a)=>({label:`${u+a*e}-${u+(a+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(let t of n){let a=d[Math.max(0,Math.min(h-1,Math.floor((t.eventTime-u)/e)))];t.late?a.secondary+=1:a.value+=1}return{generated:a,rows:d}}return null}function N(e){let t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function T(e,t){let a=e.physics&&"object"==typeof e.physics?e.physics:null,r=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,l=[e.settledProjectionRows,e.projectionRows,r?.rows,a?.settledProjectionRows,a?.projectionRows,a?.settledProjection&&"object"==typeof a.settledProjection?a.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(l)?l.map((e,a)=>{if(!e||"object"!=typeof e)return null;let r=e,l=N(r.count??r.value??r.total??r.bodies??r.events);if(null==l)return null;let i=r.label??r.id??r.name??"container "+(a+1),o=N(r.secondary??r.secondaryCount),s=N(r.observed??r.observedCount);return{label:n(i,t),count:l,...null!=o?{secondary:o}:{},..."string"==typeof r.secondaryLabel&&r.secondaryLabel?{secondaryLabel:r.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}function R(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}function I(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}function G(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}function E(e,t){if(0>=t)return"0%";let a=e/t*100;return(10>a?Math.round(10*a)/10:Math.round(a))+"%"}function z(e,t,a,r,n,l,i=null){let o=R(e),s=i&&"EventDropChart"===e?"accepted event":I(e),c=i?i.generated?"The generated sample projection":"The source projection":"The settled projection";if(n.has("l1")&&(r.l1=G(e,t)),!n.has("l2")&&!n.has("l3"))return;if(!a||0===a.length)return void(n.has("l2")&&(r.l2=i?"No valid source records are available.":"No settled projection is loaded yet."));let u=a.reduce((e,t)=>e+t.count,0),h=a.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),d=h[0]??a.slice().sort((e,t)=>t.count-e.count)[0];if(!d)return;let m=a.reduce((e,t)=>e+(t.secondary??0),0),f=a.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(n.has("l2"))if(i&&"EventDropChart"===e)r.l2=`${c} classifies ${l(u+m)} ${O(u+m,"event")} across ${a.length} ${O(a.length,o)}: ${l(u)} accepted and ${l(m)} late.`;else if(0===h.length)r.l2=`${c} contains ${l(u)} ${O(u,s)} across ${a.length} ${O(a.length,o)}; no ${O(2,o)} are non-empty yet.`;else{let e=m>0?` ${l(m)} ${O(m,s)} ${1===m?"is":"are"} marked ${f}.`:"";r.l2=`${c} contains ${l(u)} ${O(u,s)} across ${a.length} ${O(a.length,o)}; ${h.length} ${O(h.length,o)} ${1===h.length?"is":"are"} non-empty. The largest ${o} is ${d.label} with ${l(d.count)} ${O(d.count,s)}.${e}`}if(n.has("l3")&&u>0&&h.length>0){let e=h.find(e=>e!==d),t=E(d.count,u);r.l3=e?`${c} is most concentrated in ${d.label}, which holds ${l(d.count)} ${O(d.count,s)} (${t}); ${e.label} follows with ${l(e.count)} ${O(e.count,s)}.`:`${c} is concentrated in ${d.label}, which holds all ${l(d.count)} ${O(d.count,s)}.`}}function O(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function U(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()}function H(e){return tt[e]||U(e)+" chart"}function V(e){let t,a=0;for(let[r,n]of Object.entries(e))if("number"==typeof n&&n>0){if(n>a){t=r,a=n;continue}if(n===a&&void 0!==t){let e=ot.indexOf(r),a=ot.indexOf(t);-1!==e&&(-1===a||a>e)&&(t=r)}}return t}function q(e){return"BumpChart"===e?"ranking":Je.has(e)||"StackedAreaChart"===e?"apportioning":nt.has(e)?"relating":_e.has(e)?"comparing":Ye.has(e)?"characterizing":Ze.has(e)?"tracking":at.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}function W(e){if(e){if("fits"in e||"buildProps"in e){let t=e,a={};for(let[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(a[e]=r);return{family:t.family,intentScores:Object.keys(a).length?a:void 0}}return e}}function Q(e,t){let a=W(t);if(a?.act)return a.act;if(a?.intentScores){let e=V(a.intentScores);if(e&&lt[e]&&(a.intentScores[e]??0)>=3)return lt[e]}return a?.family?it[a.family]:q(e)}function K(e){let t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;let t=e;if("string"!=typeof t.type||!ct.has(t.type))return!1;let a=t.provenance;return!(!a||"object"!=typeof a)&&(ut.has(a.authorKind)||ht.has(a.source)||dt.has(a.basis))})}function X(e="en"){let t,a;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?a.format(e):t.format(e):e+""}function Z(e,t,a,r){let l=0,i=0,o=1/0,s=-1/0,c=null,u=null,h=0,d=0,m=null,f=null,p=NaN,g=NaN;for(let a of e){let e=t(a);Number.isFinite(e)&&(0===l&&(p=e,m=a),g=e,f=a,o>e&&(o=e,c=a,h=l),e>s&&(s=e,u=a,d=l),l++,i+=e)}return 0===l?null:{count:l,min:o,max:s,mean:i/l,minLabel:n(null!=c?a(c):null,r),maxLabel:n(null!=u?a(u):null,r),first:p,last:g,firstLabel:n(null!=m?a(m):null,r),lastLabel:n(null!=f?a(f):null,r),minIndex:h,maxIndex:d}}function _(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}function J(e){let t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,a=t?.authorKind??t?.source??t?.basis;return"watcher"===a?"a watcher-flagged ":"agent"===a||"ai"===a||"llm-inference"===a?"an AI-suggested ":""}function Y(e){let t=mt["string"==typeof e.type?e.type:"annotation"]||"an annotation",a=J(e),r=a?a+t.replace(/^an? /,""):t,n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return n?`${r} labeled "${n}"`:r}function ee(e){let t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;let a=l(t.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return;let r=a.map(Y),n=r.slice(0,5),i=r.length-n.length,o=_(n)+(i>0?`, and ${i} more`:""),s=a.length;return`The author has marked ${1===s?"one feature":s+" features"} on this chart: ${o}.`}function te(n,l,i={}){let o=void 0!==i.levels,s=new Set(i.levels??["l1","l2","l3"]);!o&&(i.capability||K(l))&&s.add("l4");let c=m(n,l,i.recipe);if(c){let e=["l1","l2","l3","l4"].filter(e=>s.has(e));!o&&!e.includes("l4")&&e.push("l4");let t=w(c,l,{levels:e,locale:i.locale,audience:i.audience,includeCaveats:i.includeCaveats}),a=ee(l);return{...t,text:a?`${a} ${t.text}`.trim():t.text,...a?{annotations:a}:{}}}let u=X(i.locale??"en"),h=H(n),d=Array.isArray(l.data)?l.data:null,f=r(l),p=rt.has(n)?T(l,u):null,g=rt.has(n)&&null===p?B(n,l):null,{measure:$,measureFallback:b,dimension:v,dimensionFallback:y}=a(n,l),C="string"==typeof $&&$?$:b,k="string"==typeof v&&v?v:y,A={};if(rt.has(n)&&z(n,h,p??(g?T({projectionRows:g.rows},u):null),A,s,u,g),s.has("l1")&&!rt.has(n))if("BumpChart"===n)A.l1=`A ${h} ranking ${f??"series"} by ${C} across ${k}.`;else if(Ze.has(n)||_e.has(n))A.l1=`A ${h} of ${C} by ${k}`+(f?`, split by ${f}.`:".");else if(Je.has(n))A.l1=`A ${h} showing ${C} across ${k} categories.`;else if(Ye.has(n))A.l1=`A ${h} of the distribution of ${C}`+(f?` by ${f}.`:".");else if(at.has(n)){let e=Array.isArray(l.nodes)?l.nodes.length:void 0,t=Array.isArray(l.edges)?l.edges.length:void 0,a=[null!=e?`${e} ${ue(e,"node")}`:null,null!=t?`${t} ${ue(t,"edge")}`:null].filter(Boolean);A.l1=`A ${h}${a.length?" with "+a.join(" and "):""}.`}else if("BigNumber"===n){let e="string"==typeof l.label?l.label:C;A.l1=`A single value${e?" for "+e:""}.`}else A.l1=`A ${h}.`;let x=Ze.has(n)||"BumpChart"===n||_e.has(n)||Je.has(n)||Ye.has(n),M=null;if((s.has("l2")||s.has("l3")||s.has("l4"))&&x&&d&&d.length>0&&(M=Z(d,e($,b),t(v,y),u)),s.has("l2")&&x&&(d&&0!==d.length?M&&(A.l2=Je.has(n)?`${M.count} segments totaling ${u(ae(M))}. Largest is ${M.maxLabel} at ${u(M.max)}; smallest is ${M.minLabel} at ${u(M.min)}.`:`${C} ranges from ${u(M.min)} (${M.minLabel}) to ${u(M.max)} (${M.maxLabel}), with a mean of ${u(M.mean)} across ${M.count} points.`):A.l2="No data is loaded yet."),s.has("l3")&&M&&!f&&Ze.has(n)?A.l3=re(M,C,u):s.has("l3")&&M&&!f&&_e.has(n)&&(A.l3=`The highest ${k} is ${M.maxLabel} and the lowest is ${M.minLabel}.`),s.has("l4")){let e=K(l)?"alerting":Q(n,i.capability);e&&(A.l4=ne(e,n,l,f?null:M,C,k,u,i.audience))}let S=["l1","l2","l3","l4"].filter(e=>s.has(e)&&A[e]).map(e=>A[e]).join(" "),F=ee(l);return{text:F?`${F} ${S}`.trim():S,levels:A,...F?{annotations:F}:{}}}function ae(e){return e.mean*e.count}function re(e,t,a){let{first:r,last:n,min:l,max:i,maxLabel:o,minLabel:s,firstLabel:c,lastLabel:u,minIndex:h,maxIndex:d,count:m}=e,f=i-l,p=n-r;if(0===f)return`${ce(t)} is constant at ${a(r)} across the series.`;if(.04>f/(Math.abs(e.mean)||1))return`${ce(t)} ends roughly where it started (${a(r)} at ${c} to ${a(n)} at ${u}), ranging between ${a(l)} and ${a(i)}.`;let g=d>0&&m-1>d,$=h>0&&m-1>h,b=(i-Math.max(r,n))/f,v=(Math.min(r,n)-l)/f;return g&&b>.15?`Overall ${t} climbs to a peak of ${a(i)} (${o}), then falls to ${a(n)} (${u}).`:$&&v>.15?`Overall ${t} drops to a low of ${a(l)} (${s}), then recovers to ${a(n)} (${u}).`:.05>Math.abs(p)/f?`${ce(t)} ends roughly where it started (${a(r)} at ${c} to ${a(n)} at ${u}), ranging between ${a(l)} and ${a(i)}.`:p>0?d===m-1?`Overall ${t} rises from ${a(r)} (${c}) to a peak of ${a(n)} (${u}).`:`Overall ${t} rises from ${a(r)} (${c}) to ${a(n)} (${u}), after peaking at ${a(i)} (${o}).`:h===m-1?`Overall ${t} falls from ${a(r)} (${c}) to a low of ${a(n)} (${u}).`:`Overall ${t} falls from ${a(r)} (${c}) to ${a(n)} (${u}), after dipping to ${a(l)} (${s}).`}function ne(e,t,a,r,n,l,i,o){let s,c,u=st[e],h=/^[aeiou]/i.test(u)?"an":"a";switch(e){case"locating":s="This is a map",c="read values by location";break;case"presenting":s="This is a single-value display",c=`read ${"string"==typeof a.label&&a.label?a.label:n} as the headline number`;break;case"tracing":s=`This is ${h} ${u} chart`,c="follow the movement between states";break;case"nesting":s=`This is ${h} ${u} chart`,c="read it for nested structure and how children sum into their parents";break;case"relating":s=`This is ${h} ${u} chart`,c=`read it for whether ${l} and ${n} move together`;break;default:s=`This is ${h} ${u} chart`,c=le(e,r,n,l,i,t)}return`${s}; ${c}.${se(t,o)}`}function le(e,t,a,r,n,l){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+a;case"comparing":return`compare ${a} across ${r}`;case"ranking":return"read it top to bottom by "+a;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+a;default:return"read the highlighted features"}switch(e){case"alerting":return ie(t,n,l);case"tracking":return`read it for the trajectory of ${a}, which ${oe(t)} from ${n(t.first)} (${t.firstLabel}) to ${n(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${a} across ${r}; ${t.maxLabel} leads at ${n(t.max)}`;case"ranking":return`read it top to bottom by ${a}; ${t.maxLabel} ranks highest at ${n(t.max)}`;case"apportioning":{let e=t.mean*t.count,a=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${n(e)} total; ${t.maxLabel} is the largest at ${n(t.max)}${null!=a?` (${a}%)`:""}`}case"characterizing":return`read it for the spread of ${a}, from ${n(t.min)} to ${n(t.max)}`;default:return"read the highlighted features"}}function ie(e,t,a){if(_e.has(a)||Je.has(a))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;let{first:r,last:n,min:l,max:i,minLabel:o,maxLabel:s,lastLabel:c,minIndex:u,maxIndex:h,count:d}=e,m=i-l;if(m>0){let e=h>0&&d-1>h,a=u>0&&d-1>u,f=(i-Math.max(r,n))/m,p=(Math.min(r,n)-l)/m;if(e&&f>.15)return`the peak of ${t(i)} at ${s} is the point to investigate`;if(a&&p>.15)return`the dip to ${t(l)} at ${o} is the point to investigate`;if(n>=i)return`the climb to ${t(n)} at ${c} warrants a closer look`;if(l>=n)return`the drop to ${t(n)} at ${c} warrants a closer look`}return`the extremes — ${s} (${t(i)}) and ${o} (${t(l)}) — are the points to check`}function oe(e){let t=e.max-e.min,a=e.last-e.first;return 0===t||.05>Math.abs(a)/t?"holds roughly steady":a>0?"rises":"falls"}function se(e,t){if(!t)return"";let a=t.familiarity?.[e];return"number"!=typeof a||a>2?"":` This ${H(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}function ce(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function ue(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function he(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function de(e){return!!e&&"object"==typeof e}function me(e,t,a,r){let n=g(t,["nominal","ordinal"]),l=t.dataRoles.filter(e=>"quantitative"===e.semanticType),i=n?f(n,a,r):void 0,o=[];i&&null!=e[i]&&o.push(e[i]+"");for(let t of l){let n=f(t,a,r);n&&null!=e[n]&&o.push(`${t.role}: ${e[n]+""}`)}return o.length>0?o.join(", "):"Data item"}function fe(e,t,a={}){let r=d(t),n=h(t),l=Math.max(1,a.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:r,config:n,locale:a.locale??"en"});let i=de(e.navigation)?e.navigation:void 0,o=(i?.groupByRole?p(e,i.groupByRole):void 0)??(i?.groupBy?.[0]?p(e,i.groupBy[0])??e.dataRoles.find(e=>e.field===i.groupBy?.[0]):void 0)??g(e,["nominal","ordinal"]),s=o?f(o,n,r):void 0,c=(i?.idRole?p(e,i.idRole):void 0)??g(e,["identifier"]),u=c?f(c,n,r):void 0,m={id:"root",role:"chart",label:i?.summaryTemplate?$(i.summaryTemplate,void 0,e,n,r,{count:r.length}):`${e.name}: ${r.length} ${1===r.length?"item":"items"} represented.`,level:1,children:[]},b=0,v=(t,a,l)=>{let o=u?t[u]:void 0,s=i?.itemLabelTemplate?$(i.itemLabelTemplate,t,e,n,r,{count:r.length}):me(t,e,n,r);return{id:"datum-"+he(o??a),role:"datum",label:s,level:l,datum:t}};if(s){let e=/* @__PURE__ */new Map;for(let t of r){let a=(t[s]??"Uncategorized")+"",r=e.get(a);r?r.push(t):e.set(a,[t])}m.children=[...e].map(([e,t],a)=>{let r=t.slice(0,Math.max(0,l-b));b+=r.length;let n=r.map((e,t)=>v(e,1e5*a+t,3));return t.length>r.length&&n.push({id:"more-"+he(e),role:"datum",label:`…and ${t.length-r.length} more items`,level:3}),{id:"group-"+he(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:n}})}else{let e=r.slice(0,l);m.children=e.map((e,t)=>v(e,t,2)),r.length>e.length&&m.children.push({id:"more",role:"datum",label:`…and ${r.length-e.length} more items`,level:2})}return m}function pe(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function ge(e,t="—"){return null==e||""===e?t:"object"==typeof e?ge(e.id??e.name??e.label,t):e+""}function $e(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function be(e){return ge(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function ve(e,t){let a=pe(e,t,"children");return Array.isArray(a)?a:[]}function ye(e,t,a){return`${e} ${1===e?t:a}`}function we(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?", leaf total "+t(e.leafTotal):`, known leaf total ${t(e.leafTotal)} across ${ye(e.numericLeaves,"valued leaf","valued leaves")}`}function Ce(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function ke(e,t,a,r){let n=t.data&&"object"==typeof t.data?t.data:null,l=t.childrenAccessor??"children",i=t.valueAccessor??"value",o=t.nodeLabel??t.nodeIdAccessor,s=/* @__PURE__ */new WeakMap,c=/* @__PURE__ */new WeakSet,u=e=>{let t=s.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);let a,r=ve(e,l);if(0===r.length){let t=$e(pe(e,i,"value"));a={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else a=r.reduce((e,t)=>{let a=u(t);return{descendants:e.descendants+1+a.descendants,depth:Math.max(e.depth,a.depth+1),leaves:e.leaves+a.leaves,numericLeaves:e.numericLeaves+a.numericLeaves,leafTotal:e.leafTotal+a.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),s.set(e,a),a},h=0,d=(e,t,n,s)=>{let c=ge(pe(e,o,"name"),"item "+n);if(s.has(e))return{id:`hierarchy-${be(n)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};let m=ve(e,l),f=u(e);if(0===m.length){if(h>=a)return null;h+=1;let l=$e(pe(e,i,"value"));return{id:`hierarchy-${be(n)}-${be(c)}`,role:"datum",level:t,label:`${c}${null==l?"":": "+r(l)}.`,...null==l?{}:{value:l},datum:e}}let p=new Set(s);p.add(e);let g=[],$=0;for(let[e,r]of m.entries()){if(h>=a){$+=u(r).leaves;continue}let l=d(r,t+1,`${n}-${e}`,p);l&&g.push(l)}return $>0&&g.push({id:`hierarchy-${be(n)}-more`,role:"datum",level:t+1,label:`${ye($,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${a}.`}),{id:`hierarchy-${be(n)}-${be(c)}`,role:"series",level:t,label:`${c}: ${ye(m.length,"direct child","direct children")}, ${ye(f.descendants,"total descendant","total descendants")}, ${ye(f.leaves,"leaf","leaves")}${we(f,r)}.`,datum:e,children:g}},m=n?u(n):null,f={id:"root",role:"chart",level:1,label:n?`A ${Ce(e)} chart with ${ye(m.leaves,"leaf","leaves")} and ${ye(m.descendants,"total descendant","total descendants")} across ${ye(m.depth,"hierarchy level","hierarchy levels")}${we(m,r)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(n){let e=d(n,2,"root",/* @__PURE__ */new Set);if(e){let t=ge(pe(n,o,"name"),"");f.children="series"===e.role&&""===t?e.children:[e]}}return f}function Ae(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function xe(e,t="—"){return null==e||""===e?t:"object"==typeof e?xe(e.id??e.name??e.label,t):e+""}function Me(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Se(e){return xe(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Fe(e){let t=[];return(e.linkedHover||e.selection||e.linkedBrush)&&t.push("Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&t.push("Hover or focus a mark for its details."),t.length>0?" "+t.join(" "):""}function Le(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];let t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}function Pe(e,t,a){let r=Ae(e,t,a);if(void 0!==r)return r;let n=e.properties;return n&&"object"==typeof n?Ae(n,t,a):void 0}function De(e,t,a){return xe(Pe(e,t,"id")??Pe(e,"name","name")??Pe(e,"NAME","NAME")??Pe(e,"label","label"),a)}function je(e){let t=0,a=1/0,r=-1/0,n=0;for(let l of e)null!=l.value&&(t+=1,a=Math.min(a,l.value),r=Math.max(r,l.value),n+=l.value);return 0===t?null:{count:t,min:a,max:r,total:n,average:n/t}}function Be(e,t){let a=je(e);return a?`range ${t(a.min)} to ${t(a.max)}, average ${t(a.average)}, total ${t(a.total)}`:"no numeric values"}function Ne(e){let t=e.filter(e=>null!=e.value),a=e.filter(e=>null==e.value),r=[],n=je(t);if(n)if(n.min===n.max)r.push({id:"equal",label:"Equal values",rows:t});else{let e=n.min+(n.max-n.min)/3,a=n.min+2*(n.max-n.min)/3,l=t.filter(e=>e.value>=a),i=t.filter(t=>t.value>=e&&a>t.value),o=t.filter(t=>e>t.value);l.length>0&&r.push({id:"highest",label:"Highest values",rows:l}),i.length>0&&r.push({id:"middle",label:"Middle values",rows:i}),o.length>0&&r.push({id:"lowest",label:"Lowest values",rows:o})}return a.length>0&&r.push({id:"missing",label:"No numeric value",rows:a}),r}function Te(e,t,a){let r,n=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),l=/* @__PURE__ */new Map,i=0;for(let[e,t]of n.entries())r!==t.value&&(i=e+1,r=t.value),l.set(t.index,i);let o=0;return Ne(e).map(e=>{let r=e.rows.slice(0,Math.max(0,t-o));o+=r.length;let i=r.map(e=>{let t=l.get(e.index),r=null==t||2>n.length?"":`, rank ${t} of ${n.length}`;return{id:`geo-${Se(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?e.label+": no numeric value.":`${e.label}: ${a(e.value)}${r}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),s=e.rows.length-r.length;return s>0&&i.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${s} more ${1===s?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:"regions-"+e.id,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${Be(e.rows,a)}.`,children:i}})}function Re(e,t,a,r){let n=Le(t.areas),l="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],i=Array.isArray(t.flows)?t.flows:[],o=Array.isArray(t.lines)?t.lines:[],s=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?n:l).map((a,r)=>({datum:a,index:r,label:De(a,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${r+1}`),value:Me(Pe(a,s,"value"))})),h=u.filter(e=>null!=e.value),d={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${n.length} regions.${h.length>0?` Values are available for ${h.length} of ${n.length} regions; ${Be(h,r)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${i.length} flows and ${l.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${l.length} locations and ${o.length} routes.`:`A proportional-symbol map with ${l.length} locations.`}${Fe(t)}`,children:[]};if("ChoroplethMap"===e)d.children=Te(u,a,r);else if(u.length>0){let e=u.slice(0,a).map(e=>({id:`geo-${Se(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":": "+r(e.value)}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>a&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-a} more locations.`}),d.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}let m="FlowMap"===e?i:o;if(m.length>0){let e=m.slice(0,a).map((e,t)=>{let a=xe(e.source,"unknown"),n=xe(e.target,"unknown"),l=Me(Ae(e,s,"value"));return{id:`route-${Se(a)}-${Se(n)}-${t}`,role:"datum",level:3,label:`${a} to ${n}${null==l?"":": "+r(l)}.`,...null==l?{}:{value:l},datum:e}});d.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${m.length} ${1===m.length?"route":"routes"}.`,children:e})}return d}function Ie(e,t={},a={}){return!!m(e,t,a.recipe)||ft.has(e)||pt.has(e)||gt.has(e)||Ze.has(e)||_e.has(e)||Je.has(e)||Ye.has(e)}function Ge(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function Ee(e,t="—"){return null==e||""===e?t:"object"==typeof e?Ee(e.id??e.name??e.label,t):e+""}function ze(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Oe(e){return Ee(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Ue(e,t){let a=[];return(e.linkedHover||e.selection||e.linkedBrush)&&a.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&a.push("Hover or focus a mark for its details."),a.length>0?" "+a.join(" "):""}function He(e,t){t&&e.children?.push(t)}function Ve(e,t,a,r){let n=Array.isArray(t.nodes)?t.nodes:[],l=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],i=t.nodeIdAccessor??t.nodeIDAccessor,o=t.sourceAccessor??"source",s=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>Ee(Ge(e,i,"id"),"unknown"),h=(e,t)=>Ee(Ge(e,t,""),"unknown"),d=/* @__PURE__ */new Set;for(let e of l)d.add(h(e,o)),d.add(h(e,s));let m=n.length>0?n:[...d].map(e=>({id:e})),f=/* @__PURE__ */new Map;for(let e of m)f.set(u(e),{links:0,value:0});for(let e of l){let t=h(e,o),a=h(e,s),r=ze(Ge(e,c,"value"))??0;for(let e of[t,a]){let t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=r,f.set(e,t)}}let p={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${m.length} nodes and ${l.length} links.${Ue(t,"network")}`,children:[]},g=0,$=/* @__PURE__ */new Map,b=t.colorBy??"group";for(let e of m){let t=Ee(Ge(e,b,"group"),"Ungrouped"),a=$.get(t);a?a.push(e):$.set(t,[e])}let v=[...$].map(([e,t],n)=>{let l=[];for(let[e,i]of t.entries()){if(g>=a)break;g+=1;let t=u(i),o=f.get(t)??{links:0,value:0},s=o.value>0?`, ${r(o.value)} total flow`:"";l.push({id:`node-${n}-${e}-${Oe(t)}`,role:"datum",level:3,label:`${t}: ${o.links} ${1===o.links?"link":"links"}${s}.`,value:o.value>0?o.value:void 0,datum:i})}return{id:`nodes-${n}-${Oe(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:l}});v.length>0&&p.children?.push(...v);let y=l.slice(0,a).map((e,t)=>{let a=h(e,o),n=h(e,s),l=ze(Ge(e,c,"value"));return{id:`link-${Oe(a)}-${Oe(n)}-${t}`,role:"datum",level:3,label:`${a} to ${n}${null==l?"":": "+r(l)}.`,value:l,datum:e}});return l.length>a&&y.push({id:"links-more",role:"datum",level:3,label:`…and ${l.length-a} more links.`,value:void 0}),y.length>0&&p.children?.push({id:"links",role:"series",level:2,label:`Links: ${l.length} ${1===l.length?"connection":"connections"}.`,children:y}),p}function qe(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function We(e,t){let a=Array.isArray(e.annotations)?e.annotations:null;if(!a)return null;let r=l(a.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let n=0,i=r.slice(0,t).map(e=>{let t=e.lifecycle?.status,a=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+n++,role:"annotation",level:3,label:`${qe(Y(e))}${a}.`,datum:e}});r.length>t&&i.push({id:"annotation-"+n++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});let o=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===o?"one marked feature":o+" marked features"}.`,children:i}}function Qe(l,i,o={}){let s=o.locale??"en",c=Math.max(1,o.maxLeaves??200),u=X(s),h=m(l,i,o.recipe);if(h)return fe(h,i,{maxLeaves:c,locale:s});let d={id:"root",role:"chart",label:te(l,i,{locale:s}).text||"Chart.",level:1,children:[]},f=We(i,c);if(ft.has(l)){let e=Ve(l,i,c,u);return He(e,f),e}if(pt.has(l)){let e=ke(l,i,c,u);return He(e,f),e}if(gt.has(l)){let e=Re(l,i,c,u);return He(e,f),e}let p=Array.isArray(i.data)?i.data:null,g=Ie(l,i,o);if(!p||0===p.length||!g)return f&&(d.children=[f]),d;let{measure:$,measureFallback:b,dimension:v,dimensionFallback:y}=a(l,i),w=e($,b),C=t(v,y),k="string"==typeof $&&$?$:b,A="string"==typeof v&&v?v:y,x=r(i),M=0,S=e=>`${e}-${M++}`,F=(e,t)=>{let a=w(e),r=n(C(e),u);return{id:S("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(a)?u(a):"—"}`,value:Number.isFinite(a)?a:void 0,datum:e}},L=(e,t)=>{let a=e.slice(0,c).map(e=>F(e,t));return e.length>c&&a.push({id:S("more"),role:"datum",level:t,label:`…and ${e.length-c} more points`}),a},P=[];if(Ze.has(l)||_e.has(l)){let e=1/0,t=-1/0,a=1/0,r=-1/0,i=[],o=!0;for(let n of p){let l=w(n);Number.isFinite(l)&&(e>l&&(e=l),l>t&&(t=l));let s=C(n);i.push(s),"number"==typeof s&&Number.isFinite(s)?(a>s&&(a=s),s>r&&(r=s)):o=!1}let s=/* @__PURE__ */new Set,c=[];for(let e of i){let t=e+"";s.has(t)||(s.add(t),c.push(e))}let h=o?`${u(a)} to ${u(r)}`:`${n(c[0],u)} to ${n(c[c.length-1],u)} (${_e.has(l)?c.length+" categories":p.length+" points"})`;P.push({id:S("axis"),role:"axis",level:2,label:`${_e.has(l)?"Category axis":"X axis"}: ${A}, ${h}.`}),t>=e&&P.push({id:S("axis"),role:"axis",level:2,label:`Value axis: ${k}, ${u(e)} to ${u(t)}.`})}if(x){let e=t(x,x),a=/* @__PURE__ */new Map;for(let t of p){let r=(e(t)??"—")+"",n=a.get(r);n?n.push(t):a.set(r,[t])}let r=[];for(let[e,t]of a){let a=te(l,{...i,data:t},{levels:["l2","l3"],locale:s}).text;r.push({id:S("series"),role:"series",level:2,label:`Series ${e}: ${a}`,children:L(t,3)})}d.children=[...P,...r]}else d.children=[...P,...L(p,2)];return f&&d.children.push(f),d}function Ke(e){return bt.has(e)}function Xe(e,t){return Ke(e)&&!vt[t].includes(e)}var Ze=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),_e=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),Je=/* @__PURE__ */new Set(["PieChart","DonutChart","FunnelChart"]),Ye=/* @__PURE__ */new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),et=/* @__PURE__ */Symbol.for("semiotic.chartRecipeRegistry"),tt={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",BumpChart:"bump chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},at=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),rt=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),nt=/* @__PURE__ */new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),lt={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},it={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},ot=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],st={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},ct=/* @__PURE__ */new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),ut=/* @__PURE__ */new Set(["system","agent","watcher"]),ht=/* @__PURE__ */new Set(["ai","agent","system","computed","dbt","great-expectations"]),dt=/* @__PURE__ */new Set(["rule","statistical-test","llm-inference","computed"]),mt={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"},ft=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),pt=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),gt=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),$t=["MotifBraidChart","DependencyForestChart","FlowCircuitChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"],bt=new Set($t),vt={title:["BigNumber"],description:[],summary:[]};export{o as a,s as b,c,u as d,k as e,F as f,L as g,P as h,Q as i,te as j,Ie as k,Qe as l,$t as m,Ke as n,Xe as o};
@@ -0,0 +1 @@
1
+ function t(t){return"string"==typeof t?{type:t}:t}export{t as a};
@@ -0,0 +1 @@
1
+ function n(n){return 0!==n.fontfaces?.length}export{n as a};
@@ -0,0 +1 @@
1
+ function l(l){return!(!l._pulseIntensity||0>=l._pulseIntensity)}function t(t,e,n=.3){l(e)&&(t.globalAlpha=e._pulseIntensity*n,t.fillStyle=e._pulseColor||"rgba(255,255,255,0.6)",t.fillRect(e.x,e.y,e.w,e.h))}function e(t,e,n=.6){if(!l(e))return;let s=e.r+(e._pulseGlowRadius??4)*e._pulseIntensity,i=e.cx??e.x??0,a=e.cy??e.y??0;t.beginPath(),t.arc(i,a,s,0,2*Math.PI),t.strokeStyle=e._pulseColor||"rgba(255,255,255,0.6)",t.lineWidth=2*e._pulseIntensity,t.globalAlpha=e._pulseIntensity*n,t.stroke()}function n(t,e,n,s=.35){l(e)&&(t.globalAlpha=e._pulseIntensity*s,t.fillStyle=e._pulseColor||"rgba(255,255,255,0.6)",n?t.fill(n):t.fill())}export{l as a,t as b,e as c,n as d};