semiotic 3.12.0 → 3.12.1

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 (256) hide show
  1. package/README.md +50 -46
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/behaviorContracts.cjs +1 -1
  4. package/ai/dist/diagnose-operation.js +3 -3
  5. package/ai/dist/mcp-server.js +1 -1
  6. package/ai/reference.md +15 -3
  7. package/ai/schema.json +908 -96
  8. package/ai/surface-manifest.json +1 -1
  9. package/ai/task-packets/compare-category-totals.json +5 -5
  10. package/ai/task-packets/compare-category-totals.md +2 -2
  11. package/ai/task-packets/correct-published-chart.json +5 -5
  12. package/ai/task-packets/correct-published-chart.md +2 -2
  13. package/ai/task-packets/index.json +6 -6
  14. package/ai/task-packets/update-live-chart.json +5 -5
  15. package/ai/task-packets/update-live-chart.md +2 -2
  16. package/dist/c-27DCB5T6.min.js +7 -7
  17. package/dist/c-2CKIGFD2.min.js +1 -1
  18. package/dist/c-3FATLOH4.min.js +1 -0
  19. package/dist/{c-STVM6CBI.min.js → c-4SCJKAWZ.min.js} +200 -200
  20. package/dist/c-5FUOKMH6.min.js +7 -0
  21. package/dist/c-AAIPWVQ5.min.js +6 -6
  22. package/dist/{c-2RG4WOVX.min.js → c-ALLF3Y77.min.js} +1 -1
  23. package/dist/{c-QMKQVCCZ.min.js → c-C5GXUHUO.min.js} +6 -6
  24. package/dist/c-C67QDKTU.min.js +34 -0
  25. package/dist/c-F76M77YC.min.js +1 -0
  26. package/dist/c-FEVXPKQH.min.js +1 -1
  27. package/dist/c-G42WVQO2.min.js +1 -0
  28. package/dist/c-G5A3YWTN.min.js +66 -0
  29. package/dist/c-H4HVKBU3.min.js +1 -0
  30. package/dist/c-HU3ASFKT.min.js +1 -0
  31. package/dist/c-I4FYCVJB.min.js +391 -0
  32. package/dist/{c-5L7JGWQW.min.js → c-IATPZOL7.min.js} +28 -28
  33. package/dist/c-IE5EBBP6.min.js +110 -0
  34. package/dist/c-IGONIKZL.min.js +1 -0
  35. package/dist/c-IKPM53JH.min.js +1 -0
  36. package/dist/c-IU4QZ7Y5.min.js +1 -1
  37. package/dist/{c-2ACLVPKF.min.js → c-K5VE57OI.min.js} +1 -1
  38. package/dist/c-KWJIBJ4R.min.js +1 -0
  39. package/dist/c-LIMFU6RD.min.js +1 -0
  40. package/dist/c-M4T43G76.min.js +1 -0
  41. package/dist/c-M7QUZZCE.min.js +1 -1
  42. package/dist/c-NVSINXE5.min.js +1 -0
  43. package/dist/{c-FAF6EV4E.min.js → c-NWRYV6ZF.min.js} +1 -1
  44. package/dist/c-O5GU2R5W.min.js +1 -0
  45. package/dist/c-OC7GNXGZ.min.js +1 -0
  46. package/dist/c-OV5F3DQP.min.js +1 -0
  47. package/dist/{c-5TAXHW7I.min.js → c-PJ5CAYAW.min.js} +1 -1
  48. package/dist/c-Q5LZRQGD.min.js +1 -0
  49. package/dist/c-QP3PXK3N.min.js +1 -0
  50. package/dist/c-SGZ7ZD2I.min.js +51 -0
  51. package/dist/c-SSKV5JPW.min.js +1 -1
  52. package/dist/c-THWTHWXU.min.js +37 -0
  53. package/dist/c-TRMNDRC4.min.js +41 -0
  54. package/dist/c-UP656CST.min.js +1 -1
  55. package/dist/c-USYOK5OX.min.js +1 -0
  56. package/dist/c-VI753KBO.min.js +1 -0
  57. package/dist/{c-TT4CTEBR.min.js → c-VLAAAFST.min.js} +1 -1
  58. package/dist/c-VSOQPII4.min.js +5 -5
  59. package/dist/c-WGDM4ZRP.min.js +26 -0
  60. package/dist/c-XCV7VUU3.min.js +87 -0
  61. package/dist/c-XGDZPYBI.min.js +1 -0
  62. package/dist/c-XI6CLZII.min.js +1 -0
  63. package/dist/{c-L4Q2YMXO.min.js → c-XLC7PKM7.min.js} +1 -1
  64. package/dist/{c-3YAGKCPU.min.js → c-YEB6Z35F.min.js} +1 -1
  65. package/dist/c-YWZBFG63.min.js +1 -0
  66. package/dist/c-ZMYO3NZU.min.js +2 -0
  67. package/dist/c-ZO36H5VH.min.js +48 -0
  68. package/dist/components/LinkedCharts.d.ts +6 -1
  69. package/dist/components/Tooltip/Tooltip.d.ts +11 -1
  70. package/dist/components/Tooltip/tooltipChrome.d.ts +8 -2
  71. package/dist/components/bundling/semioticVite.d.ts +24 -0
  72. package/dist/components/charts/physics/cruciblePhysics.d.ts +2 -2
  73. package/dist/components/charts/physics/gauntletPhysics.d.ts +2 -6
  74. package/dist/components/charts/physics/physicsHocUtils.d.ts +8 -1
  75. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
  76. package/dist/components/charts/shared/chartSize.d.ts +58 -0
  77. package/dist/components/charts/shared/chartSizeDefaults.d.ts +189 -0
  78. package/dist/components/charts/shared/chartSizeDefaultsAtlas.d.ts +9 -0
  79. package/dist/components/charts/shared/chartSizeDefaultsNetwork.d.ts +29 -0
  80. package/dist/components/charts/shared/chartSizeDefaultsOrdinal.d.ts +13 -0
  81. package/dist/components/charts/shared/chartSizeDefaultsPhysics.d.ts +41 -0
  82. package/dist/components/charts/shared/chartSizeDefaultsValue.d.ts +19 -0
  83. package/dist/components/charts/shared/chartSizeDefaultsXY.d.ts +10 -0
  84. package/dist/components/charts/shared/networkPerspectiveWireSchema.d.ts +3 -0
  85. package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
  86. package/dist/components/charts/shared/useCustomChartSetup.d.ts +4 -0
  87. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +2 -0
  88. package/dist/components/charts/shared/withChartWrapper.d.ts +6 -2
  89. package/dist/components/charts/value/BigNumber.d.ts +0 -8
  90. package/dist/components/charts/xy/minimapLayout.d.ts +10 -0
  91. package/dist/components/realtime/BinAccumulator.d.ts +5 -2
  92. package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +4 -4
  93. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +177 -1
  94. package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +3 -0
  95. package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +2 -0
  96. package/dist/components/recipes/atlas/resolution/BoundaryLoomChart.d.ts +3 -0
  97. package/dist/components/recipes/atlas/resolution/ComponentCutaway.d.ts +16 -0
  98. package/dist/components/recipes/atlas/resolution/ResolutionAtlasChart.d.ts +3 -0
  99. package/dist/components/recipes/atlas/resolution/ResolutionGlyphs.d.ts +15 -0
  100. package/dist/components/recipes/atlas/resolution/ResolutionReader.d.ts +5 -0
  101. package/dist/components/recipes/atlas/resolution/appearance.d.ts +58 -0
  102. package/dist/components/recipes/atlas/resolution/boundaryLoomLayout.d.ts +4 -0
  103. package/dist/components/recipes/atlas/resolution/chartProps.d.ts +75 -0
  104. package/dist/components/recipes/atlas/resolution/componentCutawayLayout.d.ts +12 -0
  105. package/dist/components/recipes/atlas/resolution/cutawayContext.d.ts +23 -0
  106. package/dist/components/recipes/atlas/resolution/cutawayGraph.d.ts +4 -0
  107. package/dist/components/recipes/atlas/resolution/cycles.d.ts +7 -0
  108. package/dist/components/recipes/atlas/resolution/evidence.d.ts +43 -0
  109. package/dist/components/recipes/atlas/resolution/glyphs.d.ts +40 -0
  110. package/dist/components/recipes/atlas/resolution/identity.d.ts +4 -0
  111. package/dist/components/recipes/atlas/resolution/indexGraph.d.ts +32 -0
  112. package/dist/components/recipes/atlas/resolution/ownership.d.ts +25 -0
  113. package/dist/components/recipes/atlas/resolution/plan.d.ts +12 -0
  114. package/dist/components/recipes/atlas/resolution/ports.d.ts +44 -0
  115. package/dist/components/recipes/atlas/resolution/prepare.d.ts +4 -0
  116. package/dist/components/recipes/atlas/resolution/project.d.ts +70 -0
  117. package/dist/components/recipes/atlas/resolution/queries.d.ts +23 -0
  118. package/dist/components/recipes/atlas/resolution/resolutionAtlasLayout.d.ts +9 -0
  119. package/dist/components/recipes/atlas/resolution/rules.d.ts +14 -0
  120. package/dist/components/recipes/atlas/resolution/scene.d.ts +52 -0
  121. package/dist/components/recipes/atlas/resolution/selection.d.ts +3 -0
  122. package/dist/components/recipes/atlas/resolution/sets.d.ts +10 -0
  123. package/dist/components/recipes/atlas/resolution/types.d.ts +401 -0
  124. package/dist/components/recipes/atlas/resolution/validate.d.ts +4 -0
  125. package/dist/components/recipes/atlas/resolution/witnesses.d.ts +18 -0
  126. package/dist/components/recipes/atlas/resolution/worker.d.ts +34 -0
  127. package/dist/components/recipes/lineageDag.d.ts +4 -0
  128. package/dist/components/recipes/recipeUtils.d.ts +2 -0
  129. package/dist/components/recipes/transitDiagram.d.ts +2 -61
  130. package/dist/components/recipes/transitDiagramTypes.d.ts +65 -0
  131. package/dist/components/semiotic-ai.d.ts +2 -0
  132. package/dist/components/semiotic-experimental-network-resolution-react.d.ts +12 -0
  133. package/dist/components/semiotic-experimental-network-resolution.d.ts +13 -0
  134. package/dist/components/semiotic-geo.d.ts +1 -1
  135. package/dist/components/semiotic-network-perspective-core.d.ts +6 -0
  136. package/dist/components/semiotic-network.d.ts +1 -1
  137. package/dist/components/semiotic-ordinal.d.ts +1 -1
  138. package/dist/components/semiotic-physics.d.ts +1 -1
  139. package/dist/components/semiotic-realtime-core.d.ts +1 -1
  140. package/dist/components/semiotic-realtime-react.d.ts +2 -0
  141. package/dist/components/semiotic-utils-core.d.ts +3 -1
  142. package/dist/components/semiotic-vite.d.ts +2 -0
  143. package/dist/components/semiotic-xy.d.ts +3 -1
  144. package/dist/components/semiotic.d.ts +3 -1
  145. package/dist/components/server/renderToStaticSVG.d.ts +2 -1
  146. package/dist/components/server/serverChartConfigShared.d.ts +2 -0
  147. package/dist/components/store/LinkedCrosshairStore.d.ts +43 -11
  148. package/dist/components/store/themeCore.d.ts +2 -0
  149. package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -1
  150. package/dist/components/stream/hoverUtils.d.ts +5 -0
  151. package/dist/components/stream/networkCustomLayout.d.ts +3 -0
  152. package/dist/components/stream/networkPerspective.d.ts +2 -0
  153. package/dist/components/stream/networkPerspectiveFit.d.ts +12 -1
  154. package/dist/components/stream/networkPerspectiveSolid.d.ts +1 -1
  155. package/dist/components/stream/networkSceneTypes.d.ts +4 -0
  156. package/dist/components/stream/networkTypes.d.ts +2 -0
  157. package/dist/components/stream/pipelineConfig.d.ts +2 -0
  158. package/dist/components/stream/pipelineDomainResolution.d.ts +4 -1
  159. package/dist/components/stream/types.d.ts +2 -0
  160. package/dist/components/stream/useFrame.d.ts +2 -0
  161. package/dist/components/stream/xySceneBuilders/types.d.ts +2 -0
  162. package/dist/controls.module.min.js +31 -31
  163. package/dist/geo.min.js +150 -150
  164. package/dist/geo.module.min.js +31 -31
  165. package/dist/network.module.min.js +1 -1
  166. package/dist/ordinal.module.min.js +1 -1
  167. package/dist/physics.module.min.js +1 -1
  168. package/dist/rough.module.min.js +1 -1
  169. package/dist/semiotic-ai-core.min.js +1 -1
  170. package/dist/semiotic-ai-core.module.min.js +1 -1
  171. package/dist/semiotic-ai.d.ts +2 -0
  172. package/dist/semiotic-ai.module.min.js +13 -13
  173. package/dist/semiotic-artifact-react.module.min.js +4 -4
  174. package/dist/semiotic-artifact.min.js +1 -1
  175. package/dist/semiotic-artifact.module.min.js +1 -1
  176. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  177. package/dist/semiotic-atlas.module.min.js +10 -12
  178. package/dist/semiotic-client-cjs-shared.min.js +1078 -925
  179. package/dist/semiotic-client-glyph.module.min.js +2 -2
  180. package/dist/semiotic-client-shared.module.min.js +1 -1
  181. package/dist/semiotic-experimental-auxiliary.module.min.js +8 -9
  182. package/dist/semiotic-experimental-network-resolution-react.d.ts +12 -0
  183. package/dist/semiotic-experimental-network-resolution-react.min.js +2 -0
  184. package/dist/semiotic-experimental-network-resolution-react.module.min.js +89 -0
  185. package/dist/semiotic-experimental-network-resolution.d.ts +13 -0
  186. package/dist/semiotic-experimental-network-resolution.min.js +2 -0
  187. package/dist/semiotic-experimental-network-resolution.module.min.js +2 -0
  188. package/dist/semiotic-experimental-node-auxiliary.module.min.js +9 -10
  189. package/dist/semiotic-geo.d.ts +1 -1
  190. package/dist/semiotic-line.module.min.js +1 -1
  191. package/dist/semiotic-network-perspective-core.d.ts +6 -0
  192. package/dist/semiotic-network-perspective-core.min.js +1 -0
  193. package/dist/semiotic-network-perspective-core.module.min.js +1 -0
  194. package/dist/semiotic-network-perspective.module.min.js +1 -1
  195. package/dist/semiotic-network-placement.min.js +4 -0
  196. package/dist/semiotic-network-placement.module.min.js +4 -0
  197. package/dist/semiotic-network-zoom.module.min.js +1 -1
  198. package/dist/semiotic-network.d.ts +1 -1
  199. package/dist/semiotic-ordinal.d.ts +1 -1
  200. package/dist/semiotic-physics.d.ts +1 -1
  201. package/dist/semiotic-realtime-core.d.ts +1 -1
  202. package/dist/semiotic-realtime-core.module.min.js +1 -1
  203. package/dist/semiotic-realtime-react.d.ts +2 -0
  204. package/dist/semiotic-realtime-react.module.min.js +1 -1
  205. package/dist/semiotic-recipes-core-cjs-base.min.js +101 -106
  206. package/dist/semiotic-recipes-core.module.min.js +75 -76
  207. package/dist/semiotic-server-edge-node.module.min.js +391 -392
  208. package/dist/semiotic-server-edge.min.js +387 -388
  209. package/dist/semiotic-server-edge.module.min.js +371 -371
  210. package/dist/semiotic-server-node.min.js +387 -388
  211. package/dist/semiotic-server-node.module.min.js +1 -1
  212. package/dist/semiotic-utils-core.d.ts +3 -1
  213. package/dist/semiotic-utils-core.min.js +12 -11
  214. package/dist/semiotic-utils-core.module.min.js +12 -11
  215. package/dist/semiotic-value.module.min.js +4 -4
  216. package/dist/semiotic-vite.d.ts +2 -0
  217. package/dist/semiotic-vite.min.js +1 -0
  218. package/dist/semiotic-vite.module.min.js +1 -0
  219. package/dist/semiotic-xy.d.ts +3 -1
  220. package/dist/semiotic.d.ts +3 -1
  221. package/dist/semiotic.module.min.js +12 -12
  222. package/dist/server.min.js +387 -388
  223. package/dist/server.module.min.js +1 -1
  224. package/dist/xy.module.min.js +1 -1
  225. package/package.json +42 -13
  226. package/dist/c-2AB65V3L.min.js +0 -1
  227. package/dist/c-2U5JMOPN.min.js +0 -88
  228. package/dist/c-3DCTIRW4.min.js +0 -1
  229. package/dist/c-3OKFRTYM.min.js +0 -1
  230. package/dist/c-3VZHOPFW.min.js +0 -1
  231. package/dist/c-4ZSQIBC7.min.js +0 -1
  232. package/dist/c-5M4RUS7V.min.js +0 -34
  233. package/dist/c-6O5WWP7F.min.js +0 -1
  234. package/dist/c-73TOIYIW.min.js +0 -48
  235. package/dist/c-AE4M7BWH.min.js +0 -1
  236. package/dist/c-AEIK2NFW.min.js +0 -30
  237. package/dist/c-AFQSEIZ4.min.js +0 -4
  238. package/dist/c-BBX7DVVB.min.js +0 -51
  239. package/dist/c-CNYFCSG4.min.js +0 -5
  240. package/dist/c-E6QH2WYE.min.js +0 -1
  241. package/dist/c-GOMQWQJR.min.js +0 -1
  242. package/dist/c-GTYG4PDT.min.js +0 -1
  243. package/dist/c-H23GIKTK.min.js +0 -1
  244. package/dist/c-HQLUUSRJ.min.js +0 -1
  245. package/dist/c-HXUOFDSD.min.js +0 -64
  246. package/dist/c-L3LKYOLK.min.js +0 -1
  247. package/dist/c-MIKDFGKH.min.js +0 -1
  248. package/dist/c-OYSPTIAG.min.js +0 -1
  249. package/dist/c-PWPJNYQP.min.js +0 -1
  250. package/dist/c-QZ5SWKHC.min.js +0 -392
  251. package/dist/c-RXJH4IRX.min.js +0 -41
  252. package/dist/c-SN2D6QMH.min.js +0 -1
  253. package/dist/c-U5YGK6HL.min.js +0 -1
  254. package/dist/c-VIN5ASK2.min.js +0 -37
  255. package/dist/c-XZ3GASUJ.min.js +0 -1
  256. package/dist/c-ZLZZTH4I.min.js +0 -118
package/dist/geo.min.js CHANGED
@@ -1,233 +1,233 @@
1
1
  "use client";
2
- "use strict";function e(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[n,r]of Object.entries(e))n.startsWith("_")||null!=r&&""!==r&&("number"==typeof r?Number.isFinite(r)&&(t[n]=r):"string"==typeof r?t[n]=r:"boolean"==typeof r?t[n]=String(r):r instanceof Date&&(t[n]=r.toISOString().slice(0,10)));return t}function t(e){return e&&"object"==typeof e?e:{}}function n(e){return t(e.accessibility).tableFields??e.accessibleDatum??e.datum}function r(e){const t=/* @__PURE__ */new Set;if(!e.some(e=>e&&("point"===e.type||"symbol"===e.type||"glyph"===e.type)))return t;for(const n of e)if(n&&["line","area","boxplot","violin"].includes(String(n.type))&&Array.isArray(n.datum))for(const e of n.datum)t.add(e);return t}function i(e){if(!Array.isArray(e))return 0;const t=r(e);let i=0;for(const r of e)if(r&&"object"==typeof r&&null!==r.datum)switch(r.type){case"point":case"symbol":case"glyph":t.has(r.datum)||i++;break;case"line":case"area":{const e=n(r);i+=Array.isArray(e)?e.length:null!=e&&"object"==typeof e?1:0;break}case"boxplot":case"violin":{const e=n(r);i+=Array.isArray(e)?e.length+1:1;break}case"rect":case"heatcell":case"wedge":case"circle":case"arc":case"candlestick":case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":case"geoarea":i++}return i}function o(i){const o=[];if(!Array.isArray(i))return o;const a=r(i);for(const r of i)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":case"symbol":case"glyph":if(a.has(r.datum))break;o.push({label:"Point",values:e(n(r))});break;case"line":case"area":{const t=n(r),i=Array.isArray(t)?t:null!=t&&"object"==typeof t?[t]:[],a="line"===r.type?"Line point":"Area point";for(const t of i)o.push({label:a,values:e(t)});break}case"boxplot":case"violin":{const t=n(r),i="boxplot"===r.type?"Boxplot":"Distribution",a="string"==typeof r.category?{category:r.category}:{};if(Array.isArray(t)){o.push({label:i,values:{...a,...e(r.stats)}});for(const n of t)o.push({label:`${i} observation`,values:{...a,...e(n)}})}else o.push({label:i,values:{...a,...e(t)}});break}case"rect":{const t=n(r),i=null!=t&&"object"==typeof t?t:{},a=i.category??r.group??"",s=i.value??i.__aggregateValue??i.total,l=e(i);null==l.category&&""!==a&&(l.category=String(a)),null==l.value&&null!=s&&(l.value="number"==typeof s||"string"==typeof s?s:String(s)),o.push({label:"Bar",values:l});break}case"heatcell":{const t=e(n(r));null==t.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(t.value=r.value),o.push({label:"Cell",values:t});break}case"wedge":{const i=n(r),a=e(i);if(null==a.category){const e=t(i),n=e.category??e.label;null!=n&&(a.category=String(n))}o.push({label:"Wedge",values:a});break}case"circle":o.push({label:"Node",values:e(n(r))});break;case"arc":o.push({label:"Arc",values:e(n(r))});break;case"candlestick":o.push({label:"Candlestick",values:e(n(r))});break;case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":o.push({label:"Connection",values:e(n(r))});break;case"geoarea":{const i=t(n(r)),a=e(i);if(null==a.name){const e=t(i.properties).name??i.name;null!=e&&(a.name=String(e))}o.push({label:"Region",values:a});break}}}catch{}return o}function a(e){return"string"==typeof e?document.getElementById(e):"function"==typeof e?e():e}function s({target:e,children:t}){const[n,r]=Ic.useState({requestedTarget:e,resolved:!1,target:null});return Ic.useEffect(()=>{const t=a(e);"production"!==process.env.NODE_ENV&&null==t&&"string"==typeof e&&console.warn(`[Semiotic] accessibleTable portal target "${e}" was not found. Rendering the data-summary controls inline instead.`),r({requestedTarget:e,resolved:!0,target:t})},[e]),n.requestedTarget===e&&n.resolved?n.target?(0,Tc.createPortal)(t,n.target):/* @__PURE__ */ /* @__PURE__ */(0,zc.jsx)(zc.Fragment,{children:t}):null}function l(e){return null==e||""===e?"—":"number"==typeof e?Number.isNaN(e)?"—":Xc(e):"boolean"==typeof e?e?"true":"false":"object"==typeof e?"—":String(e)}function c(e){const t=/* @__PURE__ */new Map;for(const n of e??[])for(const[e,r]of Object.entries(n?.values??{})){if(null==r||""===r)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:/* @__PURE__ */new Set},t.set(e,n)),"number"==typeof r){if(!Number.isFinite(r))continue;n.count++,n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r)}else"object"!=typeof r&&"function"!=typeof r&&n.strings.add(String(r))}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};const n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}function u(e,t){const n=[`${e} data points.`];for(const e of t)if(e.numeric)n.push(`${e.name}: ${Xc(e.min)} to ${Xc(e.max)}, mean ${Xc(e.mean)}.`);else{const t=e.uniqueValues,r=t.length<=3?t.join(", "):`${t.slice(0,3).join(", ")}… (${e.count} unique)`;n.push(`${e.name}: ${r}.`)}return n.join(" ")}function d({rows:e,label:t,caption:n,typeLabel:r,labelRows:i=!1,className:o="semiotic-accessible-data-table-table",style:a,extraColumns:s=[]}){const c=Array.from(new Set(e.flatMap(e=>Object.keys(e.values))));/* @__PURE__ */ /* @__PURE__ */
3
- return(0,Zc.jsxs)("table",{className:o,role:"table","aria-label":t,style:a??Rc,children:[
2
+ "use strict";function e(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[n,r]of Object.entries(e))n.startsWith("_")||null!=r&&""!==r&&("number"==typeof r?Number.isFinite(r)&&(t[n]=r):"string"==typeof r?t[n]=r:"boolean"==typeof r?t[n]=String(r):r instanceof Date&&(t[n]=r.toISOString().slice(0,10)));return t}function t(e){return e&&"object"==typeof e?e:{}}function n(e){return t(e.accessibility).tableFields??e.accessibleDatum??e.datum}function r(e){const t=/* @__PURE__ */new Set;if(!e.some(e=>e&&("point"===e.type||"symbol"===e.type||"glyph"===e.type)))return t;for(const n of e)if(n&&["line","area","boxplot","violin"].includes(String(n.type))&&Array.isArray(n.datum))for(const e of n.datum)t.add(e);return t}function i(e){if(!Array.isArray(e))return 0;const t=r(e);let i=0;for(const r of e)if(r&&"object"==typeof r&&null!==r.datum)switch(r.type){case"point":case"symbol":case"glyph":t.has(r.datum)||i++;break;case"line":case"area":{const e=n(r);i+=Array.isArray(e)?e.length:null!=e&&"object"==typeof e?1:0;break}case"boxplot":case"violin":{const e=n(r);i+=Array.isArray(e)?e.length+1:1;break}case"rect":case"heatcell":case"wedge":case"circle":case"arc":case"candlestick":case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":case"geoarea":i++}return i}function o(i){const o=[];if(!Array.isArray(i))return o;const a=r(i);for(const r of i)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":case"symbol":case"glyph":if(a.has(r.datum))break;o.push({label:"Point",values:e(n(r))});break;case"line":case"area":{const t=n(r),i=Array.isArray(t)?t:null!=t&&"object"==typeof t?[t]:[],a="line"===r.type?"Line point":"Area point";for(const t of i)o.push({label:a,values:e(t)});break}case"boxplot":case"violin":{const t=n(r),i="boxplot"===r.type?"Boxplot":"Distribution",a="string"==typeof r.category?{category:r.category}:{};if(Array.isArray(t)){o.push({label:i,values:{...a,...e(r.stats)}});for(const n of t)o.push({label:`${i} observation`,values:{...a,...e(n)}})}else o.push({label:i,values:{...a,...e(t)}});break}case"rect":{const t=n(r),i=null!=t&&"object"==typeof t?t:{},a=i.category??r.group??"",s=i.value??i.__aggregateValue??i.total,l=e(i);null==l.category&&""!==a&&(l.category=String(a)),null==l.value&&null!=s&&(l.value="number"==typeof s||"string"==typeof s?s:String(s)),o.push({label:"Bar",values:l});break}case"heatcell":{const t=e(n(r));null==t.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(t.value=r.value),o.push({label:"Cell",values:t});break}case"wedge":{const i=n(r),a=e(i);if(null==a.category){const e=t(i),n=e.category??e.label;null!=n&&(a.category=String(n))}o.push({label:"Wedge",values:a});break}case"circle":o.push({label:"Node",values:e(n(r))});break;case"arc":o.push({label:"Arc",values:e(n(r))});break;case"candlestick":o.push({label:"Candlestick",values:e(n(r))});break;case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":o.push({label:"Connection",values:e(n(r))});break;case"geoarea":{const i=t(n(r)),a=e(i);if(null==a.name){const e=t(i.properties).name??i.name;null!=e&&(a.name=String(e))}o.push({label:"Region",values:a});break}}}catch{}return o}function a(e){return"string"==typeof e?document.getElementById(e):"function"==typeof e?e():e}function s({target:e,children:t}){const[n,r]=Dc.useState({requestedTarget:e,resolved:!1,target:null});return Dc.useEffect(()=>{const t=a(e);"production"!==process.env.NODE_ENV&&null==t&&"string"==typeof e&&console.warn(`[Semiotic] accessibleTable portal target "${e}" was not found. Rendering the data-summary controls inline instead.`),r({requestedTarget:e,resolved:!0,target:t})},[e]),n.requestedTarget===e&&n.resolved?n.target?(0,_c.createPortal)(t,n.target):/* @__PURE__ */ /* @__PURE__ */(0,Fc.jsx)(Fc.Fragment,{children:t}):null}function l(e){return null==e||""===e?"—":"number"==typeof e?Number.isNaN(e)?"—":Jc(e):"boolean"==typeof e?e?"true":"false":"object"==typeof e?"—":String(e)}function c(e){const t=/* @__PURE__ */new Map;for(const n of e??[])for(const[e,r]of Object.entries(n?.values??{})){if(null==r||""===r)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:/* @__PURE__ */new Set},t.set(e,n)),"number"==typeof r){if(!Number.isFinite(r))continue;n.count++,n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r)}else"object"!=typeof r&&"function"!=typeof r&&n.strings.add(String(r))}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};const n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}function u(e,t){const n=[`${e} data points.`];for(const e of t)if(e.numeric)n.push(`${e.name}: ${Jc(e.min)} to ${Jc(e.max)}, mean ${Jc(e.mean)}.`);else{const t=e.uniqueValues,r=t.length<=3?t.join(", "):`${t.slice(0,3).join(", ")}… (${e.count} unique)`;n.push(`${e.name}: ${r}.`)}return n.join(" ")}function d({rows:e,label:t,caption:n,typeLabel:r,labelRows:i=!1,className:o="semiotic-accessible-data-table-table",style:a,extraColumns:s=[]}){const c=Array.from(new Set(e.flatMap(e=>Object.keys(e.values))));/* @__PURE__ */ /* @__PURE__ */
3
+ return(0,eu.jsxs)("table",{className:o,role:"table","aria-label":t,style:a??Ec,children:[
4
4
  /* @__PURE__ */
5
- /* @__PURE__ */(0,Zc.jsx)("caption",{className:"semiotic-accessible-data-table-caption",style:Nc,children:n}),
5
+ /* @__PURE__ */(0,eu.jsx)("caption",{className:"semiotic-accessible-data-table-caption",style:zc,children:n}),
6
6
  /* @__PURE__ */
7
- /* @__PURE__ */(0,Zc.jsx)("thead",{children:/* @__PURE__ */ /* @__PURE__ */(0,Zc.jsx)("tr",{children:[r,...c,...s.map(e=>e.label)].map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Zc.jsx)("th",{style:Lc,children:e},t))})}),
7
+ /* @__PURE__ */(0,eu.jsx)("thead",{children:/* @__PURE__ */ /* @__PURE__ */(0,eu.jsx)("tr",{children:[r,...c,...s.map(e=>e.label)].map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,eu.jsx)("th",{style:Ic,children:e},t))})}),
8
8
  /* @__PURE__ */
9
- /* @__PURE__ */(0,Zc.jsx)("tbody",{children:e.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Zc.jsxs)("tr",{tabIndex:-1,"aria-label":i?e.label:void 0,children:[
9
+ /* @__PURE__ */(0,eu.jsx)("tbody",{children:e.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,eu.jsxs)("tr",{tabIndex:-1,"aria-label":i?e.label:void 0,children:[
10
10
  /* @__PURE__ */
11
- /* @__PURE__ */(0,Zc.jsx)("td",{style:Pc,children:e.label}),c.map(t=>/* @__PURE__ */ /* @__PURE__ */(0,Zc.jsx)("td",{style:Pc,children:l(e.values[t])},t)),s.map((e,n)=>/* @__PURE__ */ /* @__PURE__ */(0,Zc.jsx)("td",{style:Pc,children:l(e.values[t])},n))]},t))})]})}function h({remaining:e,kind:t="row",onClick:n}){return e<=0?null:/* @__PURE__ */ /* @__PURE__ */(0,Kc.jsxs)("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:n,style:Ec,children:["Show ",Math.min(wc,e)," more ",t,1===e?"":"s"," (",e," remaining)"]})}function f({scene:e,sceneRevision:t,chartType:n,revealRows:r}){const[i,a]=Qc.useState(xc),s=t??e,{allRows:l,summary:f}=Qc.useMemo(()=>{const t=o(e);return{allRows:t,summary:u(t.length,c(t))}},[s]),p=Math.min(i,l.length),m=l.length-p;/* @__PURE__ */ /* @__PURE__ */
12
- return(0,Jc.jsxs)(Jc.Fragment,{children:[
11
+ /* @__PURE__ */(0,eu.jsx)("td",{style:Tc,children:e.label}),c.map(t=>/* @__PURE__ */ /* @__PURE__ */(0,eu.jsx)("td",{style:Tc,children:l(e.values[t])},t)),s.map((e,n)=>/* @__PURE__ */ /* @__PURE__ */(0,eu.jsx)("td",{style:Tc,children:l(e.values[t])},n))]},t))})]})}function h({remaining:e,kind:t="row",onClick:n}){return e<=0?null:/* @__PURE__ */ /* @__PURE__ */(0,tu.jsxs)("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:n,style:$c,children:["Show ",Math.min(jc,e)," more ",t,1===e?"":"s"," (",e," remaining)"]})}function f({scene:e,sceneRevision:t,chartType:n,revealRows:r}){const[i,a]=nu.useState(Mc),s=t??e,{allRows:l,summary:f}=nu.useMemo(()=>{const t=o(e);return{allRows:t,summary:u(t.length,c(t))}},[s]),p=Math.min(i,l.length),m=l.length-p;/* @__PURE__ */ /* @__PURE__ */
12
+ return(0,ru.jsxs)(ru.Fragment,{children:[
13
13
  /* @__PURE__ */
14
- /* @__PURE__ */(0,Jc.jsx)("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Ac,children:f}),
14
+ /* @__PURE__ */(0,ru.jsx)("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Pc,children:f}),
15
15
  /* @__PURE__ */
16
- /* @__PURE__ */(0,Jc.jsx)(d,{rows:l.slice(0,p),label:`Sample data for ${n}`,typeLabel:"type",caption:m>0?`First ${p} of ${l.length} data points`:`All ${l.length} data points`}),
16
+ /* @__PURE__ */(0,ru.jsx)(d,{rows:l.slice(0,p),label:`Sample data for ${n}`,typeLabel:"type",caption:m>0?`First ${p} of ${l.length} data points`:`All ${l.length} data points`}),
17
17
  /* @__PURE__ */
18
- /* @__PURE__ */(0,Jc.jsx)(h,{remaining:m,onClick:e=>{r(e.currentTarget,p,Math.min(p+wc,l.length),l.length),a(e=>e+wc)},kind:"row"})]})}function p(e){return e>1?Lu:e<-1?-Lu:Math.asin(e)}function m(e){return(e=Bu(e/2))*e}function g(){}function y(e,t){e&&Vu.hasOwnProperty(e.type)&&Vu[e.type](e,t)}function b(e,t,n){var r,i=-1,o=e.length-n;for(t.lineStart();++i<o;)r=e[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function v(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)b(e[n],t,1);t.polygonEnd()}function x(e,t){e&&Gu.hasOwnProperty(e.type)?Gu[e.type](e,t):y(e,t)}function w(){Xu.point=S}function k(){M(lu,cu)}function S(e,t){Xu.point=M,lu=e,cu=t,uu=e*=Iu,du=Du(t=(t*=Iu)/2+Pu),hu=Bu(t)}function M(e,t){var n=(e*=Iu)-uu,r=n>=0?1:-1,i=r*n,o=Du(t=(t*=Iu)/2+Pu),a=Bu(t),s=hu*a,l=du*o+s*Du(i),c=s*r*Bu(i);Yu.add($u(c,l)),uu=e,du=o,hu=a}function j(e){return[$u(e[1],e[0]),p(e[2])]}function A(e){var t=e[0],n=e[1],r=Du(n);return[r*Du(t),r*Bu(t),Bu(n)]}function C(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function R(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function L(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function P(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function N(e){var t=Hu(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function E(e,t){ku.push(Su=[fu=e,mu=e]),t<pu&&(pu=t),t>gu&&(gu=t)}function I(e,t){var n=A([e*Iu,t*Iu]);if(xu){var r=R(xu,n),i=R([r[1],-r[0],0],r);N(i),i=j(i);var o,a=e-yu,s=a>0?1:-1,l=i[0]*Eu*s,c=Tu(a)>180;c^(s*yu<l&&l<s*e)?(o=i[1]*Eu)>gu&&(gu=o):c^(s*yu<(l=(l+360)%360-180)&&l<s*e)?(o=-i[1]*Eu)<pu&&(pu=o):(t<pu&&(pu=t),t>gu&&(gu=t)),c?e<yu?F(fu,e)>F(fu,mu)&&(mu=e):F(e,mu)>F(fu,mu)&&(fu=e):mu>=fu?(e<fu&&(fu=e),e>mu&&(mu=e)):e>yu?F(fu,e)>F(fu,mu)&&(mu=e):F(e,mu)>F(fu,mu)&&(fu=e)}else ku.push(Su=[fu=e,mu=e]);t<pu&&(pu=t),t>gu&&(gu=t),xu=n,yu=e}function T(){Ku.point=I}function z(){Su[0]=fu,Su[1]=mu,Ku.point=E,xu=null}function $(e,t){if(xu){var n=e-yu;wu.add(Tu(n)>180?n+(n>0?360:-360):n)}else bu=e,vu=t;Xu.point(e,t),I(e,t)}function D(){Xu.lineStart()}function _(){$(bu,vu),Xu.lineEnd(),Tu(wu)>Au&&(fu=-(mu=180)),Su[0]=fu,Su[1]=mu,xu=null}function F(e,t){return(t-=e)<0?t+360:t}function O(e,t){return e[0]-t[0]}function B(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function W(e){var t,n,r,i,o,a,s;if(gu=mu=-(fu=pu=1/0),ku=[],x(e,Ku),n=ku.length){for(ku.sort(O),t=1,o=[r=ku[0]];t<n;++t)B(r,(i=ku[t])[0])||B(r,i[1])?(F(r[0],i[1])>F(r[0],r[1])&&(r[1]=i[1]),F(i[0],r[1])>F(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=F(r[1],i[0]))>a&&(a=s,fu=i[0],mu=r[1])}return ku=Su=null,fu===1/0||pu===1/0?[[NaN,NaN],[NaN,NaN]]:[[fu,pu],[mu,gu]]}function H(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function q(e,t){return Tu(e)>Ru&&(e-=Math.round(e/Nu)*Nu),[e,t]}function G(e,t,n){return(e%=Nu)?t||n?H(Y(e),U(t,n)):Y(e):t||n?U(t,n):q}function V(e){return function(t,n){return Tu(t+=e)>Ru&&(t-=Math.round(t/Nu)*Nu),[t,n]}}function Y(e){var t=V(e);return t.invert=V(-e),t}function U(e,t){function n(e,t){var n=Du(t),s=Du(e)*n,l=Bu(e)*n,c=Bu(t),u=c*r+s*i;return[$u(l*o-u*a,s*r-c*i),p(u*o+l*a)]}var r=Du(e),i=Bu(e),o=Du(t),a=Bu(t);return n.invert=function(e,t){var n=Du(t),s=Du(e)*n,l=Bu(e)*n,c=Bu(t),u=c*o-l*a;return[$u(l*o+c*a,s*r+u*i),p(u*r-s*i)]},n}function X(e){function t(t){return(t=e(t[0]*Iu,t[1]*Iu))[0]*=Eu,t[1]*=Eu,t}return e=G(e[0]*Iu,e[1]*Iu,e.length>2?e[2]*Iu:0),t.invert=function(t){return(t=e.invert(t[0]*Iu,t[1]*Iu))[0]*=Eu,t[1]*=Eu,t},t}function Z(e,t,n,r,i,o){if(n){var a=Du(t),s=Bu(t),l=r*n;null==i?(i=t+r*Nu,o=t-l/2):(i=K(a,i),o=K(a,o),(r>0?i<o:i>o)&&(i+=r*Nu));for(var c,u=i;r>0?u>o:u<o;u-=l)c=j([a,-s*Du(u),-s*Bu(u)]),e.point(c[0],c[1])}}function K(e,t){(t=A(t))[0]-=e,N(t);var n,r=(n=-t[1])>1?0:n<-1?Ru:Math.acos(n);return((-t[2]<0?-r:r)+Nu-Au)%Nu}function Q(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:g,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function J(e,t){return Tu(e[0]-t[0])<Au&&Tu(e[1]-t[1])<Au}function ee(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function te(e,t,n,r,i){var o,a,s=[],l=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n,r=e[0],a=e[t];if(J(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<t;++o)i.point((r=e[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}s.push(n=new ee(r,e,null,!0)),l.push(n.o=new ee(r,null,n,!1)),s.push(n=new ee(a,e,null,!1)),l.push(n.o=new ee(a,null,n,!0))}}),s.length){for(l.sort(t),ne(s),ne(l),o=0,a=l.length;o<a;++o)l[o].e=n=!n;for(var c,u,d=s[0];;){for(var h=d,f=!0;h.v;)if((h=h.n)===d)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,a=c.length;o<a;++o)i.point((u=c[o])[0],u[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(c=h.p.z,o=c.length-1;o>=0;--o)i.point((u=c[o])[0],u[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,f=!f}while(!h.v);i.lineEnd()}}}function ne(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r<t;)i.n=n=e[r],n.p=i,i=n;i.n=n=e[0],n.p=i}}function re(e){return Tu(e[0])<=Ru?e[0]:Wu(e[0])*((Tu(e[0])+Ru)%Nu-Ru)}function ie(e,t){var n=re(t),r=t[1],i=Bu(r),o=[Bu(n),-Du(n),0],a=0,s=0,l=new ud.Adder;1===i?r=Lu+Au:-1===i&&(r=-Lu-Au);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],m=re(f),g=f[1]/2+Pu,y=Bu(g),b=Du(g),v=0;v<h;++v,m=w,y=S,b=M,f=x){var x=d[v],w=re(x),k=x[1]/2+Pu,S=Bu(k),M=Du(k),j=w-m,C=j>=0?1:-1,L=C*j,P=L>Ru,E=y*S;if(l.add($u(E*C*Bu(L),b*M+E*Du(L))),a+=P?j+C*Nu:j,P^m>=n^w>=n){var I=R(A(f),A(x));N(I);var T=R(o,I);N(T);var z=(P^j>=0?-1:1)*p(T[2]);(r>z||r===z&&(I[0]||I[1]))&&(s+=P^j>=0?1:-1)}}return(a<-Au||a<Au&&l<-1e-12)^1&s}function oe(e,t,n,r){return function(i){function o(t,n){e(t,n)&&i.point(t,n)}function a(e,t){m.point(e,t)}function s(){v.point=a,m.lineStart()}function l(){v.point=o,m.lineEnd()}function c(e,t){p.push([e,t]),y.point(e,t)}function u(){y.lineStart(),p=[]}function d(){c(p[0][0],p[0][1]),y.lineEnd();var e,t,n,r,o=y.clean(),a=g.result(),s=a.length;if(p.pop(),h.push(p),p=null,s)if(1&o){if((t=(n=a[0]).length-1)>0){for(b||(i.polygonStart(),b=!0),i.lineStart(),e=0;e<t;++e)i.point((r=n[e])[0],r[1]);i.lineEnd()}}else s>1&&2&o&&a.push(a.pop().concat(a.shift())),f.push(a.filter(ae))}var h,f,p,m=t(i),g=Q(),y=t(g),b=!1,v={point:o,lineStart:s,lineEnd:l,polygonStart:function(){v.point=c,v.lineStart=u,v.lineEnd=d,f=[],h=[]},polygonEnd:function(){v.point=o,v.lineStart=s,v.lineEnd=l,f=(0,dd.merge)(f);var e=ie(h,r);f.length?(b||(i.polygonStart(),b=!0),te(f,se,e,n,i)):e&&(b||(i.polygonStart(),b=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),f=h=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};return v}}function ae(e){return e.length>1}function se(e,t){return((e=e.x)[0]<0?e[1]-Lu-Au:Lu-e[1])-((t=t.x)[0]<0?t[1]-Lu-Au:Lu-t[1])}function le(e,t,n,r){var i,o,a=Bu(e-n);return Tu(a)>Au?zu((Bu(t)*(o=Du(r))*Bu(n)-Bu(r)*(i=Du(t))*Bu(e))/(i*o*a)):(t+r)/2}function ce(e){function t(e,t){return Du(e)*Du(t)>i}function n(e,t,n){var r=[1,0,0],o=R(A(e),A(t)),a=C(o,o),s=o[0],l=a-s*s;if(!l)return!n&&e;var c=i*a/l,u=-i*s/l,d=R(r,o),h=P(r,c);L(h,P(o,u));var f=d,p=C(h,f),m=C(f,f),g=p*p-m*(C(h,h)-1);if(!(g<0)){var y=Hu(g),b=P(f,(-p-y)/m);if(L(b,h),b=j(b),!n)return b;var v,x=e[0],w=t[0],k=e[1],S=t[1];w<x&&(v=x,x=w,w=v);var M=w-x,N=Tu(M-Ru)<Au;if(!N&&S<k&&(v=k,k=S,S=v),N||M<Au?N?k+S>0^b[1]<(Tu(b[0]-x)<Au?k:S):k<=b[1]&&b[1]<=S:M>Ru^(x<=b[0]&&b[0]<=w)){var E=P(f,(-p+y)/m);return L(E,h),[b,j(E)]}}}function r(t,n){var r=a?e:Ru-e,i=0;return t<-r?i|=1:t>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var i=Du(e),o=2*Iu,a=i>0,s=Tu(i)>Au;return oe(t,function(e){var i,o,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(d,h){var f,p=[d,h],m=t(d,h),g=a?m?0:r(d,h):m?r(d+(d<0?Ru:-Ru),h):0;if(!i&&(c=l=m)&&e.lineStart(),m!==l&&(!(f=n(i,p))||J(i,f)||J(p,f))&&(p[2]=1),m!==l)u=0,m?(e.lineStart(),f=n(p,i),e.point(f[0],f[1])):(f=n(i,p),e.point(f[0],f[1],2),e.lineEnd()),i=f;else if(s&&i&&a^m){var y;g&o||!(y=n(p,i,!0))||(u=0,a?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!m||i&&J(i,p)||e.point(p[0],p[1]),i=p,l=m,o=g},lineEnd:function(){l&&e.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},function(t,n,r,i){Z(i,e,o,r,t,n)},a?[0,-e]:[-Ru,e-Ru])}function ue(e,t,n,r,i,o){var a,s=e[0],l=e[1],c=0,u=1,d=t[0]-s,h=t[1]-l;if(a=n-s,d||!(a>0)){if(a/=d,d<0){if(a<c)return;a<u&&(u=a)}else if(d>0){if(a>u)return;a>c&&(c=a)}if(a=i-s,d||!(a<0)){if(a/=d,d<0){if(a>u)return;a>c&&(c=a)}else if(d>0){if(a<c)return;a<u&&(u=a)}if(a=r-l,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<u&&(u=a)}else if(h>0){if(a>u)return;a>c&&(c=a)}if(a=o-l,h||!(a<0)){if(a/=h,h<0){if(a>u)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<u&&(u=a)}return c>0&&(e[0]=s+c*d,e[1]=l+c*h),u<1&&(t[0]=s+u*d,t[1]=l+u*h),!0}}}}}function de(e,t,n,r){function i(i,o){return e<=i&&i<=n&&t<=o&&o<=r}function o(i,o,s,c){var u=0,d=0;if(null==i||(u=a(i,s))!==(d=a(o,s))||l(i,o)<0^s>0)do{c.point(0===u||3===u?e:n,u>1?r:t)}while((u=(u+s+4)%4)!==d);else c.point(o[0],o[1])}function a(r,i){return Tu(r[0]-e)<Au?i>0?0:3:Tu(r[0]-n)<Au?i>0?2:1:Tu(r[1]-t)<Au?i>0?1:0:i>0?3:2}function s(e,t){return l(e.x,t.x)}function l(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){function l(e,t){i(e,t)&&k.point(e,t)}function c(){for(var t=0,n=0,i=h.length;n<i;++n)for(var o,a,s=h[n],l=1,c=s.length,u=s[0],d=u[0],f=u[1];l<c;++l)o=d,a=f,d=(u=s[l])[0],f=u[1],a<=r?f>r&&(d-o)*(r-a)>(f-a)*(e-o)&&++t:f<=r&&(d-o)*(r-a)<(f-a)*(e-o)&&--t;return t}function u(o,a){var s=i(o,a);if(h&&f.push([o,a]),x)p=o,m=a,g=s,x=!1,s&&(k.lineStart(),k.point(o,a));else if(s&&v)k.point(o,a);else{var l=[y=Math.max(md,Math.min(pd,y)),b=Math.max(md,Math.min(pd,b))],c=[o=Math.max(md,Math.min(pd,o)),a=Math.max(md,Math.min(pd,a))];ue(l,c,e,t,n,r)?(v||(k.lineStart(),k.point(l[0],l[1])),k.point(c[0],c[1]),s||k.lineEnd(),w=!1):s&&(k.lineStart(),k.point(o,a),w=!1)}y=o,b=a,v=s}var d,h,f,p,m,g,y,b,v,x,w,k=a,S=Q(),M={point:l,lineStart:function(){M.point=u,h&&h.push(f=[]),x=!0,v=!1,y=b=NaN},lineEnd:function(){d&&(u(p,m),g&&v&&S.rejoin(),d.push(S.result())),M.point=l,v&&k.lineEnd()},polygonStart:function(){k=S,d=[],h=[],w=!0},polygonEnd:function(){var e=c(),t=w&&e,n=(d=(0,fd.merge)(d)).length;(t||n)&&(a.polygonStart(),t&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),n&&te(d,s,e,o,a),a.polygonEnd()),k=a,d=h=f=null}};return M}}function he(){yd.point=yd.lineEnd=g}function fe(e,t){Ju=e*=Iu,ed=Bu(t*=Iu),td=Du(t),yd.point=pe}function pe(e,t){e*=Iu;var n=Bu(t*=Iu),r=Du(t),i=Tu(e-Ju),o=Du(i),a=r*Bu(i),s=td*n-ed*r*o,l=ed*n+td*r*o;Qu.add($u(Hu(a*a+s*s),l)),Ju=e,ed=n,td=r}function me(e,t){return bd[0]=e,bd[1]=t,n=vd,Qu=new gd.Adder,x(n,yd),+Qu;var n}function ge(e,t){return!(!e||!wd.hasOwnProperty(e.type))&&wd[e.type](e,t)}function ye(e,t){return 0===me(e,t)}function be(e,t){for(var n,r,i,o=0,a=e.length;o<a;o++){if(0===(r=me(e[o],t)))return!0;if(o>0&&(i=me(e[o],e[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<Cu*i)return!0;n=r}return!1}function ve(e,t){return!!ie(e.map(xe),we(t))}function xe(e){return(e=e.map(we)).pop(),e}function we(e){return[e[0]*Iu,e[1]*Iu]}function ke(e,t){return(e&&xd.hasOwnProperty(e.type)?xd[e.type]:ge)(e,t)}function Se(e,t,n){var r=(0,kd.range)(e,t-Au,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function Me(e,t,n){var r=(0,kd.range)(e,t-Au,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function je(){function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return(0,kd.range)(_u(o/g)*g,i,g).map(h).concat((0,kd.range)(_u(c/y)*y,l,y).map(f)).concat((0,kd.range)(_u(r/p)*p,n,p).filter(function(e){return Tu(e%g)>Au}).map(u)).concat((0,kd.range)(_u(s/m)*m,a,m).filter(function(e){return Tu(e%y)>Au}).map(d))}var n,r,i,o,a,s,l,c,u,d,h,f,p=10,m=p,g=90,y=360,b=2.5;return e.lines=function(){return t().map(function(e){return{type:"LineString",coordinates:e}})},e.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(f(l).slice(1),h(i).reverse().slice(1),f(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(o=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],o>i&&(t=o,o=i,i=t),c>l&&(t=c,c=l,l=t),e.precision(b)):[[o,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),e.precision(b)):[[r,s],[n,a]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(g=+t[0],y=+t[1],e):[g,y]},e.stepMinor=function(t){return arguments.length?(p=+t[0],m=+t[1],e):[p,m]},e.precision=function(t){return arguments.length?(b=+t,u=Se(s,a,90),d=Me(r,n,b),h=Se(c,l,90),f=Me(o,i,b),e):b},e.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Ae(e,t){var n=e[0]*Iu,r=e[1]*Iu,i=t[0]*Iu,o=t[1]*Iu,a=Du(r),s=Bu(r),l=Du(o),c=Bu(o),u=a*Du(n),d=a*Bu(n),h=l*Du(i),f=l*Bu(i),g=2*p(Hu(m(o-r)+a*l*m(i-n))),y=Bu(g),b=g?function(e){var t=Bu(e*=g)/y,n=Bu(g-e)/y,r=n*u+t*h,i=n*d+t*f,o=n*s+t*c;return[$u(i,r)*Eu,$u(o,Hu(r*r+i*i))*Eu]}:function(){return[n*Eu,r*Eu]};return b.distance=g,b}function Ce(){Cd.point=Re}function Re(e,t){Cd.point=Le,nd=id=e,rd=od=t}function Le(e,t){Ad.add(od*e-id*t),id=e,od=t}function Pe(){Le(nd,rd)}function Ne(e,t){Td+=e,zd+=t,++$d}function Ee(){Hd.point=Ie}function Ie(e,t){Hd.point=Te,Ne(ld=e,cd=t)}function Te(e,t){var n=e-ld,r=t-cd,i=Hu(n*n+r*r);Dd+=i*(ld+e)/2,_d+=i*(cd+t)/2,Fd+=i,Ne(ld=e,cd=t)}function ze(){Hd.point=Ne}function $e(){Hd.point=_e}function De(){Fe(ad,sd)}function _e(e,t){Hd.point=Fe,Ne(ad=ld=e,sd=cd=t)}function Fe(e,t){var n=e-ld,r=t-cd,i=Hu(n*n+r*r);Dd+=i*(ld+e)/2,_d+=i*(cd+t)/2,Fd+=i,Od+=(i=cd*e-ld*t)*(ld+e),Bd+=i*(cd+t),Wd+=3*i,Ne(ld=e,cd=t)}function Oe(e){this._context=e}function Be(e,t){nh.point=We,Vd=Ud=e,Yd=Xd=t}function We(e,t){Ud-=e,Xd-=t,th.add(Hu(Ud*Ud+Xd*Xd)),Ud=e,Xd=t}function He(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function qe(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return He;if(t!==Zd){const e=10**t;Zd=t,Kd=function(t){let n=1;this._+=t[0];for(const r=t.length;n<r;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}return Kd}function Ge(e,t){function n(e){return e&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),x(e,r(i))),i.result()}let r,i,o=3,a=4.5;return n.area=function(e){return x(e,r(Rd)),Rd.result()},n.measure=function(e){return x(e,r(rh)),rh.result()},n.bounds=function(e){return x(e,r(Id)),Id.result()},n.centroid=function(e){return x(e,r(qd)),qd.result()},n.projection=function(t){return arguments.length?(r=null==t?(e=null,Sd):(e=t).stream,n):e},n.context=function(e){return arguments.length?(i=null==e?(t=null,new ih(o)):new Oe(t=e),"function"!=typeof a&&i.pointRadius(a),n):t},n.pointRadius=function(e){return arguments.length?(a="function"==typeof e?e:(i.pointRadius(+e),+e),n):a},n.digits=function(e){if(!arguments.length)return o;if(null==e)o=null;else{const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);o=t}return null===t&&(i=new ih(o)),n},n.projection(e).digits(o).context(t)}function Ve(e){return function(t){var n=new Ye;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Ye(){}function Ue(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),x(n,e.stream(Id)),t(Id.result()),null!=r&&e.clipExtent(r),e}function Xe(e,t,n){return Ue(e,function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])},n)}function Ze(e,t,n){return Xe(e,[[0,0],t],n)}function Ke(e,t,n){return Ue(e,function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])},n)}function Qe(e,t,n){return Ue(e,function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])},n)}function Je(e,t){return+t?tt(e,t):et(e)}function et(e){return Ve({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function tt(e,t){function n(r,i,o,a,s,l,c,u,d,h,f,m,g,y){var b=c-r,v=u-i,x=b*b+v*v;if(x>4*t&&g--){var w=a+h,k=s+f,S=l+m,M=Hu(w*w+k*k+S*S),j=p(S/=M),A=Tu(Tu(S)-1)<Au||Tu(o-d)<Au?(o+d)/2:$u(k,w),C=e(A,j),R=C[0],L=C[1],P=R-r,N=L-i,E=v*P-b*N;(E*E/x>t||Tu((b*P+v*N)/x-.5)>.3||a*h+s*f+l*m<oh)&&(n(r,i,o,a,s,l,R,L,A,w/=M,k/=M,S,g,y),y.point(R,L),n(R,L,A,w,k,S,c,u,d,h,f,m,g,y))}}return function(t){function r(n,r){n=e(n,r),t.point(n[0],n[1])}function i(){y=NaN,k.point=o,t.lineStart()}function o(r,i){var o=A([r,i]),a=e(r,i);n(y,b,g,v,x,w,y=a[0],b=a[1],g=r,v=o[0],x=o[1],w=o[2],16,t),t.point(y,b)}function a(){k.point=r,t.lineEnd()}function s(){i(),k.point=l,k.lineEnd=c}function l(e,t){o(u=e,t),d=y,h=b,f=v,p=x,m=w,k.point=o}function c(){n(y,b,g,v,x,w,d,h,u,f,p,m,16,t),k.lineEnd=a,a()}var u,d,h,f,p,m,g,y,b,v,x,w,k={point:r,lineStart:i,lineEnd:a,polygonStart:function(){t.polygonStart(),k.lineStart=s},polygonEnd:function(){t.polygonEnd(),k.lineStart=i}};return k}}function nt(e){return Ve({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function rt(e,t,n,r,i){function o(o,a){return[t+e*(o*=r),n-e*(a*=i)]}return o.invert=function(o,a){return[(o-t)/e*r,(n-a)/e*i]},o}function it(e,t,n,r,i,o){function a(e,o){return[c*(e*=r)-u*(o*=i)+t,n-u*e-c*o]}if(!o)return rt(e,t,n,r,i);var s=Du(o),l=Bu(o),c=s*e,u=l*e,d=s/e,h=l/e,f=(l*n-s*t)/e,p=(l*t+s*n)/e;return a.invert=function(e,t){return[r*(d*e-h*t+f),i*(p-h*e-d*t)]},a}function ot(e){return at(function(){return e})()}function at(e){function t(e){return h(e[0]*Iu,e[1]*Iu)}function n(e){return(e=h.invert(e[0],e[1]))&&[e[0]*Eu,e[1]*Eu]}function r(){var e=it(m,0,0,M,j,S).apply(null,o(b,v)),t=it(m,g-e[0],y-e[1],M,j,S);return a=G(x,w,k),d=H(o,t),h=H(a,d),u=Je(d,P),i()}function i(){return f=p=null,t}var o,a,s,l,c,u,d,h,f,p,m=150,g=480,y=250,b=0,v=0,x=0,w=0,k=0,S=0,M=1,j=1,A=null,C=hd,R=null,L=Sd,P=.5;return t.stream=function(e){return f&&p===e?f:f=ah(nt(a)(C(u(L(p=e)))))},t.preclip=function(e){return arguments.length?(C=e,A=void 0,i()):C},t.postclip=function(e){return arguments.length?(L=e,R=s=l=c=null,i()):L},t.clipAngle=function(e){return arguments.length?(C=+e?ce(A=e*Iu):(A=null,hd),i()):A*Eu},t.clipExtent=function(e){return arguments.length?(L=null==e?(R=s=l=c=null,Sd):de(R=+e[0][0],s=+e[0][1],l=+e[1][0],c=+e[1][1]),i()):null==R?null:[[R,s],[l,c]]},t.scale=function(e){return arguments.length?(m=+e,r()):m},t.translate=function(e){return arguments.length?(g=+e[0],y=+e[1],r()):[g,y]},t.center=function(e){return arguments.length?(b=e[0]%360*Iu,v=e[1]%360*Iu,r()):[b*Eu,v*Eu]},t.rotate=function(e){return arguments.length?(x=e[0]%360*Iu,w=e[1]%360*Iu,k=e.length>2?e[2]%360*Iu:0,r()):[x*Eu,w*Eu,k*Eu]},t.angle=function(e){return arguments.length?(S=e%360*Iu,r()):S*Eu},t.reflectX=function(e){return arguments.length?(M=e?-1:1,r()):M<0},t.reflectY=function(e){return arguments.length?(j=e?-1:1,r()):j<0},t.precision=function(e){return arguments.length?(u=Je(d,P=e*e),i()):Hu(P)},t.fitExtent=function(e,n){return Xe(t,e,n)},t.fitSize=function(e,n){return Ze(t,e,n)},t.fitWidth=function(e,n){return Ke(t,e,n)},t.fitHeight=function(e,n){return Qe(t,e,n)},function(){return o=e.apply(this,arguments),t.invert=o.invert&&n,r()}}function st(e){function t(e,t){return[e*n,Bu(t)/n]}var n=Du(e);return t.invert=function(e,t){return[e/n,p(t*n)]},t}function lt(e,t){function n(e,t){var n=Hu(o-2*i*Bu(t))/i;return[n*Bu(e*=i),a-n*Du(e)]}var r=Bu(e),i=(r+Bu(t))/2;if(Tu(i)<Au)return st(e);var o=1+r*(2*i-r),a=Hu(o)/i;return n.invert=function(e,t){var n=a-t,r=$u(e,Tu(n))*Wu(n);return n*i<0&&(r-=Ru*Wu(e)*Wu(n)),[r/i,p((o-(e*e+n*n)*i*i)/(2*i))]},n}function ct(){return(e=lt,t=0,n=Ru/3,r=at(e),i=r(t,n),i.parallels=function(e){return arguments.length?r(t=e[0]*Iu,n=e[1]*Iu):[t*Eu,n*Eu]},i).scale(155.424).center([0,33.6442]);var e,t,n,r,i}function ut(e,t){return[e,Ou(qu((Lu+t)/2))]}function dt(e){function t(){var t=Ru*s(),a=o(X(o.rotate()).invert([0,0]));return c(null==u?[[a[0]-t,a[1]-t],[a[0]+t,a[1]+t]]:e===ut?[[Math.max(a[0]-t,u),n],[Math.min(a[0]+t,r),i]]:[[u,Math.max(a[1]-t,n)],[r,Math.min(a[1]+t,i)]])}var n,r,i,o=ot(e),a=o.center,s=o.scale,l=o.translate,c=o.clipExtent,u=null;return o.scale=function(e){return arguments.length?(s(e),t()):s()},o.translate=function(e){return arguments.length?(l(e),t()):l()},o.center=function(e){return arguments.length?(a(e),t()):a()},o.clipExtent=function(e){return arguments.length?(null==e?u=n=r=i=null:(u=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),t()):null==u?null:[[u,n],[r,i]]},t()}function ht(e,t){return[e,t]}function ft(e,t){var n=p(hh*Bu(t)),r=n*n,i=r*r*r;return[e*Du(n)/(hh*(lh+3*ch*r+i*(7*uh+9*dh*r))),n*(lh+ch*r+i*(uh+dh*r))]}function pt(){return ot(ft).scale(177.158)}function mt(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),t*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function gt(e,t){return[Du(t)*Bu(e),Bu(t)]}function yt(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}function bt(e,t){const n=e-t.startTime;return Math.min(n/t.duration,1)}function vt(e,t,n){return e+(t-e)*n}function xt(e,t){if(!1===e)return{transition:void 0,introEnabled:!1};const n="undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;return{transition:e?!0===e?{duration:300}:{duration:e.duration??300,easing:"linear"===e.easing?"linear":"ease-out"}:t,introEnabled:!(n||!e||!0!==e&&!1===e.intro)}}function wt(e,t,n={}){if(!Number.isFinite(t)||t<=0)return"fresh";if(Number.isNaN(e))return"fresh";if(e===1/0)return"expired";if(e<0)return"fresh";const r=n.fresh??yh,i=n.aging??bh,o=n.stale??vh;return e<t*r?"fresh":e<t*i?"aging":e<t*o?"stale":"expired"}function kt(e){const t=Math.max(0,Math.min(1,e.minOpacity??.1));if(Number.isNaN(e.age))return 1;if(e.age===1/0)return t;if(!Number.isFinite(e.extent)||e.extent<=0)return 1;const n=Math.max(0,e.age);if("step"===e.type)return n<(e.threshold??.5*e.extent)?1:t;if("exponential"===e.type){const r=e.halfLife??e.extent/2,i=r>0?r:e.extent/2;return t+Math.pow(.5,n/i)*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function St(e,t,n){if(n<=1)return 1;const r=n-1;return kt({age:r-t,extent:r,type:e.type,halfLife:e.halfLife??n/2,threshold:e.stepThreshold??.5*n,minOpacity:e.minOpacity??.1})}function Mt(e,t,n){const r=e.duration??500,i=n-t;return i>=r?0:1-i/r}function jt(e,t,n,r){let i=!1;return t>0?(e._pulseIntensity!==t&&(e._pulseIntensity=t,i=!0),e._pulseColor!==n&&(e._pulseColor=n,i=!0),e._pulseGlowRadius!==r&&(e._pulseGlowRadius=r,i=!0),i):(0!==e._pulseIntensity&&(e._pulseIntensity=0,i=!0),void 0!==e._pulseColor&&(e._pulseColor=void 0,i=!0),void 0!==e._pulseGlowRadius&&(e._pulseGlowRadius=void 0,i=!0),i)}function At(e,t,n=("undefined"!=typeof performance?performance.now():Date.now())){if(!t||0===t.size)return!1;const r=e.duration??500,i=t.peek();return null!=i&&n-i<r}function Ct(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function Rt(e,t,n){const r=e=>e.toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function Lt(e){const t=e.map(Ct),n=t.length-1;return e=>{if(Number.isNaN(e)&&(e=0),e<=0){const[e,n,r]=t[0];return Rt(e,n,r)}if(e>=1){const[e,r,i]=t[n];return Rt(e,r,i)}const r=e*n,i=Math.floor(r),o=r-i,[a,s,l]=t[i],[c,u,d]=t[i+1];return Rt(Math.round(a+(c-a)*o),Math.round(s+(u-s)*o),Math.round(l+(d-l)*o))}}function Pt(e){return e&&Object.prototype.hasOwnProperty.call(Rh,e)?Rh[e]:kh}function Nt(e,t,n=Ph){if(e&&"object"==typeof e&&!Array.isArray(e)){const t=Object.values(e).filter(e=>"string"==typeof e&&e.length>0);if(t.length>0)return t}if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e){const t=Object.prototype.hasOwnProperty.call(Lh,e)?Lh[e]:void 0;if(Array.isArray(t)&&t.length>0)return t}return t&&t.length>0?t:n}function Et(e){const t=e.toLowerCase();return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||Ih.has(t)}function It(e,t,n){if("function"==typeof t){const r=t(e);return n&&r&&"string"==typeof r&&!Et(r)?n(r):r}const r=String(e?.[t]);return n?n(r):Ph[Math.abs($t(r))%Ph.length]}function Tt(e,t){if(null==t||!Object.prototype.hasOwnProperty.call(e,t))return;const n=e[t];return"string"==typeof n&&n.length>0?n:void 0}function zt(e,t,n="category10"){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;return t=>Tt(e,t)??"#999"}const r=Array.from(new Set(e.map(e=>e?.[t]).filter(e=>null!=e).map(e=>String(e)))),i=r.every(e=>!isNaN(Number(e)));if(Array.isArray(n))return(0,xh.scaleOrdinal)().domain(r).range(n).unknown("#999");const o=Object.prototype.hasOwnProperty.call(Lh,n)?Lh[n]:Lh.category10;if(i&&"function"==typeof o){let e=-1/0;for(const t of r){const n=Number(t);n>e&&(e=n)}return t=>o(0===e?0:Number(t)/e)}{const e=Array.isArray(o)?o:Ph;return(0,xh.scaleOrdinal)().domain(r).range(e).unknown("#999")}}function $t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}function Dt(e,t,n=[3,20],r){let i;if(i="function"==typeof t?t(e):e?.[t],!r)return i;const[o,a]=r,[s,l]=n;if(a===o)return(s+l)/2;let c=(i-o)/(a-o);return c<0?c=0:c>1&&(c=1),s+c*(l-s)}function _t(e,t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:void 0;return 0===e.length?e=>n&&Tt(n,e)||"#4e79a7":t=>{if(n){const e=Tt(n,t);if(e)return e}let r=0;for(let e=0;e<t.length;e++)r=31*r+t.charCodeAt(e)|0;return e[Math.abs(r)%e.length]??"#4e79a7"}}function Ft(e){if("production"===process.env.NODE_ENV)return;const{label:t,nodes:n,overlays:r,warned:i}=e;Ot(r)&&0===n.length&&Bt(i,"overlay-only",`[semiotic] ${t} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),n.length>0&&n.every(e=>null==e.datum)&&Bt(i,"null-datums",`[semiotic] ${t} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function Ot(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(Ot))}function Bt(e,t,n){e.has(t)||(e.add(t),console.warn(n))}function Wt(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message||"Custom layout threw."};if("string"==typeof e)return{name:"Error",message:e};if(null==e)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:String(e)}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}function Ht(e,t,n,r){const i=Wt(t),o="network"===e?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:e,source:o,message:`Semiotic ${e} ${o} failed: ${i.message}`,error:i,recovery:n?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:n,affectedRevision:r}}function qt(e){try{return{kind:"success",result:e.run()}}catch(t){const n=e.hasPreviousResult,r=Ht(e.family,t,n,e.revision);"production"!==process.env.NODE_ENV&&console.error(`[semiotic] ${e.logLabel} threw:`,t);try{e.onLayoutError?.(r)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:r,preservedLastGoodScene:n}}}function Gt(e){if(!e)return pt();if("string"==typeof e){const t=Th[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),pt())}if("object"==typeof e&&"type"in e){const t=Th[e.type],n=t?t():pt();return e.rotate&&"rotate"in n&&n.rotate(e.rotate),e.center&&"center"in n&&n.center(e.center),n}return e}function Vt(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function Yt(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function Ut(e,t,n){return e?"function"==typeof e?{...n,...e(t)}:{...n,...e}:{...n}}function Xt(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}function Zt(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}function Kt(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}function Qt(e,t){if(e.length<2)return[e];const n=.4*t,r=[];let i=[e[0]];for(let t=1;t<e.length;t++){const o=e[t-1],a=e[t];Math.abs(a[0]-o[0])>n?(i.length>=2&&r.push(i),i=[a]):i.push(a)}return i.length>=2&&r.push(i),r}function Jt(e,t,n=24){const r=t[0]-e[0],i=t[1]-e[1],o=Math.sqrt(r*r+i*i);if(0===o)return[e,t];const a=-i/o,s=r/o,l=Math.min(.3*o,80),c=(e[0]+t[0])/2+a*l,u=(e[1]+t[1])/2+s*l,d=[];for(let r=0;r<=n;r++){const i=r/n,o=1-i,a=o*o*e[0]+2*o*i*c+i*i*t[0],s=o*o*e[1]+2*o*i*u+i*i*t[1];d.push([a,s])}return d}function en(e,t){if(e.length<2)return e;const n=t/2+1,r=[];for(let t=0;t<e.length;t++){const i=e[t];let o,a;0===t?(o=e[1][0]-i[0],a=e[1][1]-i[1]):t===e.length-1?(o=i[0]-e[t-1][0],a=i[1]-e[t-1][1]):(o=e[t+1][0]-e[t-1][0],a=e[t+1][1]-e[t-1][1]);const s=Math.sqrt(o*o+a*a)||1,l=a/s,c=-o/s;r.push([i[0]+l*n,i[1]+c*n])}return r}function tn(e,t,n,r,i){const o=t[0]-e[0],a=t[1]-e[1],s=Math.sqrt(o*o+a*a);if(0===s)return[e,t];const l=a/s,c=-o/s,u=i/2+1;return[[e[0]+l*u,e[1]+c*u],[t[0]+l*u,t[1]+c*u]]}function nn(e){let t=1/0,n=-1/0;for(const r of e)r<t&&(t=r),r>n&&(n=r);return[t,n]}function rn(e,t=-1/0){let n=t;for(const t of e)t>n&&(n=t);return n}function on(e,t,n,r){const i=e.filter(e=>"point"===e.type);if(i.length<2)return null;const o=t.strength??1,a=Number.isFinite(o)?Math.max(0,Math.min(1,o)):1,s="strip"===t.layout?"strip":"radial";if("radial"===s&&0===a)return null;const l=t.centerAccessor?"function"==typeof t.centerAccessor?t.centerAccessor:e=>e[t.centerAccessor]:e=>e.id,c="function"==typeof t.costAccessor?t.costAccessor:e=>e[t.costAccessor],u=i.find(e=>e.datum&&String(l(e.datum))===String(t.center));if(!u)return"production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Distance cartogram center "${t.center}" not found in point data`),null;const d=rn(i.map(e=>e.datum?Number(c(e.datum)):NaN).filter(e=>isFinite(e)&&e>=0),1);r>0&&"production"!==process.env.NODE_ENV&&console.warn("GeoFrame: Distance cartogram does not support area rendering. Areas will be ignored. Remove areas or set projectionTransform to null to render them.");for(let t=e.length-1;t>=0;t--){const n=e[t];"geoarea"===n.type&&n.interactive&&e.splice(t,1)}const h="strip"===s?sn(i,u,c,d,n):an(i,u,c,d,a,n),f=e.filter(e=>"line"===e.type);if(f.length>0){const e=/* @__PURE__ */new Map;for(const t of i)null!=t.pointId&&e.set(String(t.pointId),[t.x,t.y]);for(const n of f){const r=n.datum?.source,i=n.datum?.target;if(null!=r&&null!=i){const o=e.get(String(r)),a=e.get(String(i));if(o&&a)if("fractional"===t.lineMode&&n.path.length>2){const e=n.path[0],t=n.path[n.path.length-1],r=[o[0]-e[0],o[1]-e[1]],i=[a[0]-t[0],a[1]-t[1]],s=[0];for(let e=1;e<n.path.length;e++)s.push(s[e-1]+Math.hypot(n.path[e][0]-n.path[e-1][0],n.path[e][1]-n.path[e-1][1]));const l=s[s.length-1];n.path=n.path.map((e,t)=>{const o=l>0?s[t]/l:t/(n.path.length-1);return[e[0]+r[0]*(1-o)+i[0]*o,e[1]+r[1]*(1-o)+i[1]*o]})}else n.path=[o,a]}}}return h}function an(e,t,n,r,i,o){const a=t.x,s=t.y,l=o.width/2,c=o.height/2,u=Math.min(o.width,o.height)/2,d=(0,zh.scaleLinear)().domain([0,r]).range([0,u]);for(const o of e){if(o===t)continue;if(!o.datum)continue;const e=o.x,u=o.y,h=Math.atan2(u-s,e-a),f=Math.hypot(e-a,u-s),p=Number(n(o.datum)),m=isFinite(p)&&p>=0?r>0?d(p):0:f,g=l+Math.cos(h)*m,y=c+Math.sin(h)*m;o.x=e+(g-e)*i,o.y=u+(y-u)*i}return t.x=a+(l-a)*i,t.y=s+(c-s)*i,{cx:t.x,cy:t.y,maxCost:r,availableRadius:u,layout:"radial"}}function sn(e,t,n,r,i){const o=Math.max(3,Math.min(8,.35*i.height)),a=Math.max(1,i.width-2*o),s=i.height/2,l=(0,zh.scaleLinear)().domain([0,r]).range([0,a]);t.x=o,t.y=s;const c=[];for(const i of e){if(i===t)continue;if(!i.datum){i.x=o,i.y=s;continue}const e=Number(n(i.datum)),a=o+(isFinite(e)&&e>=0&&r>0?l(e):0);i.x=a,i.y=s,c.push({node:i,x:a})}c.sort((e,t)=>e.x-t.x);const u=Math.max(0,Math.min(i.height/2-1,6));let d=0;for(;d<c.length;){let e=d+1;for(;e<c.length&&Math.abs(c[e].x-c[d].x)<3;)e++;const t=e-d;if(t>1&&u>0)for(let e=0;e<t;e++){const n=e-(t-1)/2,r=Math.min(2.5,2*u/Math.max(1,t-1));c[d+e].node.y=s+n*r}d=e}return{cx:o,cy:s,maxCost:r,availableRadius:a,layout:"strip"}}function ln(e,t,n,r){const i=e.push(t);return n&&n.push(r),i}function cn(e,t,n){if(!t||0===t.size)return;const r=/* @__PURE__ */new Set;if(e.forEach((e,t)=>{n(e)&&r.add(t)}),0===r.size)return;const i=t.toArray();t.clear();for(let e=0;e<i.length;e++)r.has(e)||t.push(i[e])}function un(e,t){const n={...e};for(const e of t)n[$h[e]]++;return n}function dn(e,t,n){const r=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:r,revisions:un(n,r)}}function hn(e){let t="preserve";const n=/* @__PURE__ */new Set;for(const r of e){const e=Uh[r]??Xh;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)n.add(t)}return{retainedData:t,invalidations:n}}function fn({config:e,projection:t,path:n,areas:r,points:i,lines:o,layout:a}){const s=Vt(e.xAccessor,"lon"),l=Vt(e.yAccessor,"lat"),c=[],u=Xt(e),d=Kt(e),h=Zt(e);if(e.graticule){const t=!0===e.graticule?{}:e.graticule,r=je();t.step&&r.step(t.step);const i=n(r())||"";i&&c.push({type:"geoarea",pathData:i,centroid:[a.width/2,a.height/2],bounds:[[0,0],[a.width,a.height]],screenArea:0,style:{fill:"none",stroke:t.stroke||"#e0e0e0",strokeWidth:t.strokeWidth??.5,strokeDasharray:t.strokeDasharray||"2,2"},datum:null,interactive:!1})}for(const t of r){const r=n(t);if(!r)continue;const i=n.centroid(t),o=n.bounds(t),a=n.area(t);c.push({type:"geoarea",pathData:r,centroid:i,bounds:o,screenArea:a,style:Ut(e.areaStyle,t,u),datum:t,interactive:!0})}const f=Yt(e.lineDataAccessor);for(const n of o){const r=f(n);if(!r||r.length<2)continue;let i=[];if("geo"===e.lineType){const e=new Array(r.length);for(let t=0;t<r.length;t++)e[t]=[s(r[t]),l(r[t])];for(let n=0;n<e.length-1;n++){const r=e[n],o=e[n+1],a=me(r,o)||0,s=Math.max(2,Math.ceil(a/(Math.PI/180))),l=Ae(r,o);for(let e=0;e<=s;e++){if(n>0&&0===e)continue;const r=t(l(e/s));null!=r&&i.push(r)}}}else for(let e=0;e<r.length;e++){const n=r[e],o=t([s(n),l(n)]);null!=o&&i.push(o)}if(i.length<2)continue;const o=Ut(e.lineStyle,n,d),u="number"==typeof o.strokeWidth?o.strokeWidth:1;2===r.length&&i.length>=2&&"arc"===e.flowStyle?i=Jt(i[0],i[i.length-1]):2===r.length&&i.length>=2&&"offset"===e.flowStyle&&(i="geo"===e.lineType?en(i,u):tn(i[0],i[i.length-1],0,0,u));const h=Qt(i,a.width);if(h.length<=1)c.push({type:"line",path:i.length>=2?i:h[0]||i,style:o,datum:n});else for(const e of h)e.length<2||c.push({type:"line",path:e,style:{...o,_edgeFade:!0},datum:n})}const p=e.pointIdAccessor?"function"==typeof e.pointIdAccessor?e.pointIdAccessor:t=>t[e.pointIdAccessor]:null,m=t.clipAngle?t.clipAngle()??0:0,g=m>0?m*Math.PI/180:null,y=t.rotate?t.rotate():[0,0,0],b="function"==typeof t.center?t.center():[0,0],v=[(b[0]??0)-y[0],(b[1]??0)-y[1]];for(const n of i){const r=s(n),i=l(n);if(null!=g&&me([r,i],v)>g)continue;const o=t([r,i]);if(!o)continue;const a=e.pointStyle?e.pointStyle(n):{...h},u={type:"point",x:o[0],y:o[1],r:a.r||4,style:a,datum:n,pointId:p?String(p(n)):void 0};c.push(u)}return c}function pn(e){if(null==e)return 0;if("number"==typeof e&&Number.isFinite(e)&&e>=0&&e<.5)return e;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${String(e)}.`)}function mn(e){return{...e,fitPadding:pn(e.fitPadding)}}function gn(e){return"fitPadding"in e?{...e,fitPadding:pn(e.fitPadding)}:e}function yn(e){if(!e)return rf;let t=!1;for(let n=0;n<e.length;n++){const r=e[n];if(null==r||"object"!=typeof r){t=!0;break}}if(!t)return e;const n=[];for(const t of e)null!=t&&"object"==typeof t&&n.push(t);return n}function bn(e,{storeRef:t,dirtyRef:n,scheduleRender:r,zoomTransformRef:i,containerRef:o,zoomBehaviorRef:a}){const s=(0,ef.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushPoint(e),n.current=!0,r())},[t,n,r]),l=(0,ef.useCallback)(e=>{const i=yn(e);0!==i.length&&(t.current?.pushMany(i),n.current=!0,r())},[t,n,r]),c=(0,ef.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushLine(e),n.current=!0,r())},[t,n,r]),u=(0,ef.useCallback)(e=>{const i=yn(e);0!==i.length&&(t.current?.pushManyLines(i),n.current=!0,r())},[t,n,r]),d=(0,ef.useCallback)(()=>{t.current?.clear(),n.current=!0,r()},[t,n,r]);(0,ef.useImperativeHandle)(e,()=>({push:s,pushMany:l,removePoint:e=>{const i=t.current?.removePoint(e)??[];return i.length>0&&(n.current=!0,r()),i},pushLine:c,pushManyLines:u,removeLine:e=>{const i=t.current?.removeLine(e)??[];return i.length>0&&(n.current=!0,r()),i},getLines:()=>t.current?.getLines()??[],clear:d,getProjection:()=>t.current?.scales?.projection??null,getGeoPath:()=>t.current?.scales?.geoPath??null,getCartogramLayout:()=>t.current?.cartogramLayout??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null,getZoom:()=>i.current.k,resetZoom:()=>{const e=o.current;e&&a.current&&(0,tf.select)(e).call(a.current.transform,nf.zoomIdentity)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,d,r,t,n,i,o,a])}function vn(e){const{domain:t,layout:n,sceneGeometry:r}=e.revisions;return{domain:t,layout:n,sceneGeometry:r}}function xn(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}function wn(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 kn(e,t,n,r){const i=r.current,o=!0===e.lastCustomLayoutFailure?.preservedLastGoodScene,a=!o&&e.hasActivePulsesAt(t),s=!(n||o||!a&&!i)&&e.refreshPulse(t);return r.current=a,{changed:s,pending:a}}function Sn(e,t,n,r,i,o){const a=i-n,s=o-r,l=a*a+s*s;if(0===l)return Math.sqrt((e-n)**2+(t-r)**2);let c=((e-n)*a+(t-r)*s)/l;c=Math.max(0,Math.min(1,c));const u=n+c*a,d=r+c*s;return Math.sqrt((e-u)**2+(t-d)**2)}function Mn(e,t=30){return Math.max((e??4)+5,12,t)}function jn(e,t,n,r,i,o=e=>e.x,a=e=>e.y,s=e=>e.r,l){const c=Math.max(r,i+5,12),u=t-c,d=t+c,h=n-c,f=n+c;let p=null,m=1/0;return e.visit((e,i,c,g,y)=>{if(i>d||g<u||c>f||y<h)return!0;const b=e;if(!b.length){let e=b;do{const i=e.data,c=o(i)-t,u=a(i)-n,d=Math.sqrt(c*c+u*u);d<=Mn(s(i),r)&&(d<m||d===m&&null!==p&&l?.(i,p))&&(p=i,m=d),e=e.next}while(e)}return!1}),p?{node:p,distance:m}:null}function An(e,t){const[n,r]=e.viewBox??df,[i,o]=e.anchor??hf,a=r>0?r:1,s=Math.max(0,t)/a,l=(n>0?n:a)*s,c=a*s;return{width:l,height:c,scale:s,offsetX:-i*l,offsetY:-o*c}}function Cn(e,t){const n=An(e,t),r=[[n.offsetX,n.offsetY],[n.offsetX+n.width,n.offsetY],[n.offsetX,n.offsetY+n.height],[n.offsetX+n.width,n.offsetY+n.height]];let i=0;for(const[e,t]of r){const n=Math.sqrt(e*e+t*t);n>i&&(i=n)}return i}function Rn(e,t,n,r){if("none"!==e)return"color"===e||null==e?t??r:"accent"===e?n:e}function Ln(e){if("undefined"==typeof Path2D)return null;ff||(ff=/* @__PURE__ */new Map);const t=ff.get(e);if(t)return t;const n=new Path2D(e);return ff.size>1024&&ff.clear(),ff.set(e,n),n}function Pn(e,t,n=0,r="horizontal"){const[i,o]=e.viewBox??df,a=Math.min(1,Math.max(0,n)),s=Math.min(1,Math.max(0,t));return s<=a?{x:0,y:0,width:0,height:0}:a<=0&&s>=1?null:"vertical"===r?{x:0,y:o*(1-s),width:i,height:o*(s-a)}:{x:i*a,y:0,width:i*(s-a),height:o}}function Nn(e,t){const n=An(e,t);return{centerDx:n.offsetX+n.width/2,centerDy:n.offsetY+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2,radius:Math.hypot(n.width,n.height)/2}}function En(e,t,n,r,i,o=e=>e){for(const a of t.parts){const t=Ln(a.d);if(!t)continue;const s=a.opacity??1,l=e.globalAlpha;1!==s&&(e.globalAlpha=l*s);const c=i?"none"===a.fill?void 0:i:Rn(a.fill,n,r);c&&(e.fillStyle=o(c),e.fill(t));const u=i?a.stroke&&"none"!==a.stroke?i:void 0:Rn(a.stroke??"none",n,r);u&&(e.strokeStyle=o(u),e.lineWidth=a.strokeWidth??1,e.lineCap=a.strokeLinecap??"butt",e.lineJoin=a.strokeLinejoin??"miter",e.stroke(t)),1!==s&&(e.globalAlpha=l)}}function In(e,t,n,r,i,o,a=0,s=r){if(o){const e=jn(o,t,n,r,a);if(e&&!1!==e.node.interactive)return e}else{let i=null,o=1/0;for(const a of e){if("point"!==a.type)continue;if(!1===a.interactive)continue;const e=a.x-t,s=a.y-n,l=Math.sqrt(e*e+s*s);l<=Mn(a.r,r)&&l<o&&(i=a,o=l)}if(i)return{node:i,distance:o}}let l=null,c=1/0;for(const i of e){if("glyph"!==i.type)continue;if(null==i.datum)continue;const e=Nn(i.glyph,i.size),o=i.x+e.centerDx-t,a=i.y+e.centerDy-n,s=Math.sqrt(o*o+a*a);s<=Mn(e.radius,r)&&s<c&&(l=i,c=s)}if(l)return{node:l,distance:c};for(let r=e.length-1;r>=0;r--){const o=e[r];if("geoarea"!==o.type)continue;const a=o;if(!1===a.interactive)continue;const[[s,l],[c,u]]=a.bounds;if(!(t<s||t>c||n<l||n>u)&&(a._cachedPath2D||(a._cachedPath2D=new Path2D(a.pathData)),i.isPointInPath(a._cachedPath2D,t,n)))return{node:a,distance:0}}let u=null,d=1/0;for(const r of e){if("line"!==r.type)continue;const e=r,{path:i}=e,o=Math.max((e.style.strokeWidth??2)+4,5,s),a=t-o,l=t+o,c=n-o,h=n+o;for(let r=0;r<i.length-1;r++){const s=i[r],f=i[r+1],p=s[0],m=s[1],g=f[0],y=f[1];if(p<a&&g<a||p>l&&g>l||m<c&&y<c||m>h&&y>h)continue;const b=Sn(t,n,p,m,g,y);b<=o&&b<d&&(u=e,d=b)}}return u?{node:u,distance:d}:null}function Tn(e,t){return"function"==typeof e?.addEventListener?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e?.addListener?.(t),()=>e?.removeListener?.(t))}function zn(){const[e,t]=(0,yf.useState)(()=>!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,yf.useEffect)(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),Tn(e,e=>t(e.matches))},[]),e}function $n(e,t=0,n=1/0,r=0){const i=Number.isFinite(t)?t:0,o=Number.isFinite(n)?Math.max(i,n):1/0,a=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(o,a));return r>0&&Number.isFinite(r)?Math.max(i,Math.min(o,Math.round(s/r)*r)):s}function Dn(e,t,n,r={}){const i=(0,bf.useRef)(null),[o,a]=(0,bf.useState)(null);vf(()=>{if(!t&&!n)return;const e=i.current;if(!e||"undefined"==typeof ResizeObserver)return;const o=(e,t)=>({w:$n(e,r.minWidth,r.maxWidth,r.widthStep),h:$n(t,r.minHeight,r.maxHeight,r.heightStep)}),s=e.getBoundingClientRect();(s.width>0||s.height>0)&&a(o(s.width,s.height));const l=new ResizeObserver(e=>{for(const t of e){const{width:e,height:n}=t.contentRect,r=o(e,n);a(e=>e&&e.w===r.w&&e.h===r.h?e:r)}});return l.observe(e),()=>l.disconnect()},[t,n,r.minWidth,r.maxWidth,r.widthStep,r.minHeight,r.maxHeight,r.heightStep]);const s=[t&&o?o.w:e[0],n&&o?o.h:e[1]];return[i,s]}function _n(e){return 0!==e.fontfaces?.length}function Fn(e){const t="undefined"==typeof document?void 0:document.fonts;if(!t||"function"!=typeof t.addEventListener)return()=>{};const n=t=>{_n(t)&&e()};return t.addEventListener("loadingdone",n),()=>t.removeEventListener("loadingdone",n)}function On(e){const t=e.trim();if(!t.startsWith("var(")||!t.endsWith(")"))return null;const n=t.slice(4,-1),r=n.indexOf(",");if(-1===r){const e=n.trim();return e.startsWith("--")?{name:e}:null}const i=n.slice(0,r).trim(),o=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:o||void 0}:null}function Bn(){if(kf)return;if("undefined"==typeof window||"undefined"==typeof document)return;kf=!0;const e=e=>{if(!e?.includes("--"))return"";const t=document.createElement("span").style;return t.cssText=e,Array.from(t).filter(e=>e.startsWith("--")).sort().map(e=>`${e}:${t.getPropertyValue(e)}!${t.getPropertyPriority(e)}`).join(";")},t=(t,n)=>{const r=t.target;if(!(r instanceof Element))return!1;if(r===n||r.contains(n))return!0;if(!n.contains(r))return!1;const i="CANVAS"===r.tagName;return!(!i&&!r.querySelector("canvas")||i&&"style"===t.attributeName&&e(t.oldValue)===e(r.getAttribute("style")))},n=e=>{const n=[];for(const r of Cf){const i=r.getElement();i&&(!e||e.some(e=>t(e,i)))&&n.push(r)}if(!e||0!==n.length){wf++;for(const e of n)e.listener()}};if("undefined"!=typeof MutationObserver&&document.documentElement&&(Sf=new MutationObserver(e=>{n(e)})).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme","data-semiotic-theme-mode"],attributeOldValue:!0,subtree:!0}),"function"==typeof window.matchMedia)try{Mf=window.matchMedia("(prefers-color-scheme: dark)"),jf=()=>n(),"function"==typeof Mf.addEventListener?Mf.addEventListener("change",jf):"function"==typeof Mf.addListener&&Mf.addListener(jf)}catch{}Af=Fn(()=>n())}function Wn(e,t){Bn();const n={getElement:e,listener:t};return Cf.add(n),()=>{Cf.delete(n)&&0===Cf.size&&(Sf?.disconnect(),Sf=null,Mf&&jf&&("function"==typeof Mf.removeEventListener?Mf.removeEventListener("change",jf):"function"==typeof Mf.removeListener&&Mf.removeListener(jf)),Mf=null,jf=null,Af?.(),Af=null,kf=!1)}}function Hn(e,t){if(!t)return t;const n=On(t);if(!n)return t;const r=()=>n.fallback?Hn(e,n.fallback):t,i=e.canvas;if(!i)return r();let o=xf.get(i);o&&o.version===wf||(o={version:wf,map:/* @__PURE__ */new Map},xf.set(i,o));const a=o.map.get(t);if(void 0!==a)return a;const s=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||t;return o.map.set(t,s),s}function qn(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 Gn(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}function Vn(e,t){const n=e();return Number.isFinite(n)?n:t}function Yn(e,t){const n=t?36:0;return e.top>=n?e:{...e,top:n}}function Un(e){let t=6;for(let n=1;n<e.length;n++){const r=Math.abs(e[n]-e[n-1]);if(r>0&&Number.isFinite(r)){const i=Math.max(Math.abs(e[n]),Math.abs(e[n-1]));t=Math.max(t,Math.ceil(Math.log10(i/r))+1)}}const n=Math.min(17,t);return e=>Number.isInteger(e)?String(e):String(Number(e.toPrecision(n)))}function Xn(...e){let t;for(const n of e)n&&(t=Zn(t)&&Zn(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function Zn(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function Kn(e){return"object"==typeof e&&null!==e&&"gradient"in e}function Qn(e,t,n,r,i=8){const o="left"===r||"right"===r,a=r,s="left"===r?"right":"right"===r?"left":"top"===r?"bottom":"top",l=Math.max(0,(o?n[0]:n[1])-i),c=Math.max(t[a],l-e[s]);e[a]>c&&(e[a]=c)}function Jn(e){return Math.ceil(7*e.length)}function er(e,t){if(Zn(e)){const n=cr(t);let r=100;for(const t of e.legendGroups){t.label&&(r=Math.max(r,Jn(t.label)));for(const e of t.items)r=Math.max(r,n.swatchSize+n.labelGap+Jn(e.label))}return r}if(Kn(e)){const{gradient:t}=e,n=t.format||Un(t.domain),r=Math.max(Jn(n(t.domain[0])),Jn(n(t.domain[1]))),i=t.label?Jn(t.label):0;return Math.max(100,19+r,i)}return 100}function tr(e){return(Zn(e)||Kn(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function nr(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?Nf:Pf:0}function rr(e){return Math.max(0,e?.edgeGutter??3)}function ir(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?64:46:22:0}function or(e,t,n){if(Kn(e))return e.gradient.label?46:26;if(!Zn(e))return 20;const r=cr(n),i=Math.max(1,n?.maxWidth??t);let o=r.rowHeight;for(const t of e.legendGroups){let e=0,n=0;for(const o of t.items){const t=r.swatchSize+r.labelGap+Jn(o.label),a=0===n?t:n+r.itemGap+t;n>0&&a>i?(e+=1,n=t):n=a}t.items.length>0&&(e+=1),o=Math.max(o,e*r.rowHeight,t.label?Jn(t.label):0)}return o+(e.legendGroups.length>1?16:0)}function ar(e,t,n){return er(e,t)+tr(e)+nr(t,n)+rr(t)}function sr(e,t){const{legend:n}=t;if(!n)return;const r=t.position??"right",i=or(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+tr(n)+ir("bottom"===r?t.axisChrome:"top"===r?t.axisChrome?.topAxis:void 0,t.legendLayout)+("top"===r&&t.hasTitle?24:0),o=Math.max(t.minimumMargin??0,"top"===r?t.hasTitle?58:34:0);"right"===r?e.right=Math.max(e.right,o,ar(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===r?e.left=Math.max(e.left,o,ar(n,t.legendLayout,t.axisChrome?.leftAxis)):"top"===r?e.top=Math.max(e.top,o,i):e.bottom=Math.max(e.bottom,o,i)}function lr(e,t){const n=t.position??"right",r="top"===n||"bottom"===n,i=Math.max(0,t.totalWidth-t.margin.left-t.margin.right),o=Math.max(1,r?t.legendLayout?.maxWidth??i:t.reservedWidth??er(e,t.legendLayout)),a=tr(e),s=nr(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),l=rr(t.legendLayout),c=or(e,i,t.legendLayout),u=ir(t.axisChrome,t.legendLayout),d=ir(t.axisChrome?.topAxis,t.legendLayout);if("left"===n)return{x:Math.max(l,t.margin.left-s-o-a),y:t.margin.top,width:o,height:c};if("top"===n)return{x:t.margin.left,y:t.margin.top-d-a-c,width:o,height:c};if("bottom"===n){const e=t.totalHeight-t.margin.bottom;return{x:t.margin.left,y:Math.max(e+a,Math.min(e+u+a,t.totalHeight-c)),width:o,height:c}}return{x:Math.min(t.totalWidth-o-l,t.totalWidth-t.margin.right+s+a),y:t.margin.top,width:o,height:c}}function cr(e){const t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function ur(e,t){let n=24;return e.map(({hasLabel:e,itemCount:r})=>{n+=5;const i=n;let o;n+=8,e&&(n+=16,o=n,n+=8);const a=n;return n+=r*t+8,{lineY:i,labelY:o,itemsY:a,endY:n}})}function dr(e,t,n=!1){const r={...e};for(const e of t??[])!1!==e.visible||"top"===e.orient&&n||(r[e.orient]=0);return r}function hr(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function fr(e){const t=zn(),n=(0,mf.useRef)(t);n.current=t;const[r,i]=Dn(e.sizeProp,e.responsiveWidth,e.responsiveHeight),o=i[0],a=i[1],s=(0,mf.useMemo)(()=>[o,a],[o,a]),l=Boolean(e.title),c=(0,mf.useMemo)(()=>{const t=Yn({...e.marginDefault,...e.userMargin},l);if(e.legend&&!e.legendMarginReserved){const n={...t},r=e.legendPosition??"right";sr(t,{legend:e.legend,position:r,size:s,hasTitle:l,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),Qn(t,n,s,r)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,l,s]),u=Math.max(1,i[0]-c.left-c.right),d=Math.max(1,i[1]-c.top-c.bottom),h=hr(e.foregroundGraphics,i,c),f=hr(e.backgroundGraphics,i,c),p=(0,gf.useThemeSelector)(e=>e.theme),{transition:m,introEnabled:g}=xt(e.animate,e.transitionProp),y=`semiotic-table-${pf.useId()}`,b=(0,mf.useRef)(null);if(!b.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;b.current=new Lf({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const v=b.current;v.configure({clock:e.clock,random:e.random,seed:e.seed});const x=(0,mf.useRef)(null),w=(0,mf.useRef)(e.frameScheduler??If);w.current=e.frameScheduler??If;const k=(0,mf.useRef)(null),S=(0,mf.useRef)(!1),M=(0,mf.useRef)(()=>{}),j=(0,mf.useCallback)(()=>{if(null!==x.current||S.current)return;const e=w.current;let t=!1,n=!1;const r=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(S.current=!0),x.current=null,k.current=null;try{M.current()}finally{e&&(S.current=!1)}});n=!0,t||(x.current=r,k.current=e)},[]),A=(0,mf.useCallback)(()=>{null!==x.current&&((k.current??w.current).cancelAnimationFrame(x.current),x.current=null,k.current=null)},[]);Ef(()=>{v.setPaused(!0===e.paused)},[v,e.paused]),(0,mf.useEffect)(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void v.setVisible(!0);const t=()=>v.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[v,e.suspendWhenHidden]),(0,mf.useEffect)(()=>()=>{A()},[A]);const C=(0,mf.useRef)(()=>{}),R=(0,mf.useRef)(()=>{}),L=(0,mf.useRef)({inside:!1,clientX:0,clientY:0,pointerType:void 0}),P=(0,mf.useRef)(null),N=(0,mf.useRef)(null),E=(0,mf.useRef)(null),I=(0,mf.useCallback)(()=>{const e=P.current;P.current=null,e&&C.current(e)},[]),T=(0,mf.useCallback)(e=>{const t=L.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,P.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===N.current){const e=w.current;let t=!1;const n=e.requestAnimationFrame(()=>{t=!0,N.current=null,E.current=null,I()});t||(N.current=n,E.current=e)}},[I]),z=(0,mf.useCallback)(()=>{L.current.inside=!1,P.current=null,null!==N.current&&((E.current??w.current).cancelAnimationFrame(N.current),N.current=null,E.current=null),R.current()},[]);(0,mf.useEffect)(()=>()=>{P.current=null,null!==N.current&&((E.current??w.current).cancelAnimationFrame(N.current),N.current=null,E.current=null)},[]);const $=e.themeDirtyRef,D=(0,mf.useRef)(!1);return Ef(()=>{if(!$)return;const t=!D.current;D.current=!0,t&&e.skipInitialThemeInvalidation||(wf++,$.current=!0,j())},[p,e.skipInitialThemeInvalidation,j,$]),(0,mf.useEffect)(()=>{if($)return Wn(()=>r.current,()=>{$.current=!0,j()})},[r,j,$]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:r,size:i,margin:c,adjustedWidth:u,adjustedHeight:d,resolvedForeground:h,resolvedBackground:f,currentTheme:p,transition:m,introEnabled:g,tableId:y,frameRuntime:v,rafRef:x,renderFnRef:M,scheduleRender:j,cancelRender:A,hoverHandlerRef:C,hoverLeaveRef:R,onPointerMove:T,onPointerLeave:z,pointerStateRef:L}}function pr(e,t,n,r){(0,Tf.useEffect)(()=>{e.current?.updateConfig(t),n.current=!0,r()},[t,r,e,n])}function mr(e,t,n,r){const i=(0,Tf.useRef)(null);(0,Tf.useEffect)(()=>{const o=e.current;if(!o)return;const a=t??null;i.current!==a&&(i.current=a,o.setLayoutSelection(a),o.hasCustomRestyle?o.restyleScene(a):n.current=!0,r())},[t,r,e,n])}function gr(e){if(!e?.colors)return;const t=e.colors;return{primary:t.primary,secondary:t.secondary||t.primary,surface:t.surface||t.background,success:t.success,danger:t.danger,warning:t.warning,error:t.error,info:t.info,text:t.text,textSecondary:t.textSecondary,border:t.border,grid:t.grid}}function yr(e,t){const n=e?.state??(e?.settling?"settling":void 0);if("live"===n)return Df;if("stopped"===n||"failed"===n||"stale"===n)return{alpha:e?.dimOpacity??.5,band:"stale",isStale:!0};if("settling"===n)return{alpha:.85,band:"aging",isStale:!1};if(!(e&&t>0))return Df;const r=null!=e.threshold&&e.threshold>0?e.threshold:5e3,i=e.graded;if(i){const e="object"==typeof i?i:{},n=wt(t,r,e.thresholds);return{alpha:{...$f,...e.opacities??{}}[n],band:n,isStale:"fresh"!==n}}return t>r?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:Df}function br(e,t,n,r,i,o,a){const s=(0,zf.useRef)("fresh");(0,zf.useEffect)(()=>{if(!e)return void(s.current="fresh");const l=setInterval(()=>{const l=t.current;if(!l||0===l.lastIngestTime)return;const c=yr(e,i()-l.lastIngestTime);c.band===s.current&&c.isStale===o||(s.current=c.band,c.isStale!==o&&a(c.isStale),n.current=!0,r())},1e3);return()=>clearInterval(l)},[e,o,r,i,t,a,n])}function vr(e,t,n){return t||(n?"settling":e?"stale":"live")}function xr({isStale:e,position:t,state:n,settling:r}){const i=vr(e,n,r),o=Ff[i]??Ff.live,a=Object.hasOwn(Ff,i)?i.toUpperCase():"LIVE";/* @__PURE__ */ /* @__PURE__ */
19
- return(0,_f.jsx)("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===t?{top:4,left:4}:"bottom-left"===t?{bottom:4,left:4}:"bottom-right"===t?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:o,color:"white"},children:a})}function wr(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:String(n)}function kr(e){const t=(0,Bf.useObservationSelector)(e=>e.pushObservation),n=Of.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return Of.useMemo(()=>({...e,onObservation:n}),[n,e])}function Sr(e){const t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}function Mr(e,t={}){const n=wr(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(r){const i=Sr(r);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:i}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:i,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function jr(e){return"string"==typeof e&&e.includes("var(")}function Ar(e){const t=Hf.exec(e);if(!t)return jr(e)?void 0:e;const n=t[1]?.trim();return n?Ar(n):void 0}function Cr(e,t){return String(e).length*t*.6}function Rr(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 Lr(e){const{x:t,y:n,text:r,fill:i,fontSize:o=12,fontWeight:a,fontFamily:s,textAnchor:l="start",dominantBaseline:c,background:u,className:d}=e,h=Rr(u),f=e=>/* @__PURE__ */ /* @__PURE__ */(0,qf.jsx)("text",{x:t,y:n,textAnchor:l,dominantBaseline:c,fill:i,fontSize:o,fontWeight:a,fontFamily:s,className:d,...e?{style:{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}}:{},children:r});if(!h)return f();if("halo"===h.type)return f({stroke:h.fill??Gf,strokeWidth:h.haloWidth??3});const p=h.padding??{x:6,y:3},m="number"==typeof p?p:p.x,g="number"==typeof p?p:p.y,y=Cr(r,o),b=y+2*m,v=o+2*g;let x,w;x="middle"===l?t-y/2-m:"end"===l?t-y-m:t-m,w="middle"===c||"central"===c?n-v/2:"hanging"===c||"text-before-edge"===c?n-g:n-.8*o-g;const k=h.fill??Gf,S={};return jr(k)&&(S.fill=k),jr(h.stroke)&&(S.stroke=h.stroke),/* @__PURE__ */ /* @__PURE__ */(0,qf.jsxs)("g",{className:d,children:[
18
+ /* @__PURE__ */(0,ru.jsx)(h,{remaining:m,onClick:e=>{r(e.currentTarget,p,Math.min(p+jc,l.length),l.length),a(e=>e+jc)},kind:"row"})]})}function p(e){return e>1?Iu:e<-1?-Iu:Math.asin(e)}function m(e){return(e=Gu(e/2))*e}function g(){}function y(e,t){e&&Zu.hasOwnProperty(e.type)&&Zu[e.type](e,t)}function v(e,t,n){var r,i=-1,o=e.length-n;for(t.lineStart();++i<o;)r=e[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function b(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)v(e[n],t,1);t.polygonEnd()}function x(e,t){e&&Xu.hasOwnProperty(e.type)?Xu[e.type](e,t):y(e,t)}function w(){Ju.point=S}function k(){M(hu,fu)}function S(e,t){Ju.point=M,hu=e,fu=t,pu=e*=Du,mu=Bu(t=(t*=Du)/2+Tu),gu=Gu(t)}function M(e,t){var n=(e*=Du)-pu,r=n>=0?1:-1,i=r*n,o=Bu(t=(t*=Du)/2+Tu),a=Gu(t),s=gu*a,l=mu*o+s*Bu(i),c=s*r*Gu(i);Ku.add(Ou(c,l)),pu=e,mu=o,gu=a}function j(e){return[Ou(e[1],e[0]),p(e[2])]}function A(e){var t=e[0],n=e[1],r=Bu(n);return[r*Bu(t),r*Gu(t),Gu(n)]}function C(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function R(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function L(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function P(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function N(e){var t=Yu(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function E(e,t){Au.push(Cu=[yu=e,bu=e]),t<vu&&(vu=t),t>xu&&(xu=t)}function I(e,t){var n=A([e*Du,t*Du]);if(Mu){var r=R(Mu,n),i=R([r[1],-r[0],0],r);N(i),i=j(i);var o,a=e-wu,s=a>0?1:-1,l=i[0]*$u*s,c=_u(a)>180;c^(s*wu<l&&l<s*e)?(o=i[1]*$u)>xu&&(xu=o):c^(s*wu<(l=(l+360)%360-180)&&l<s*e)?(o=-i[1]*$u)<vu&&(vu=o):(t<vu&&(vu=t),t>xu&&(xu=t)),c?e<wu?F(yu,e)>F(yu,bu)&&(bu=e):F(e,bu)>F(yu,bu)&&(yu=e):bu>=yu?(e<yu&&(yu=e),e>bu&&(bu=e)):e>wu?F(yu,e)>F(yu,bu)&&(bu=e):F(e,bu)>F(yu,bu)&&(yu=e)}else Au.push(Cu=[yu=e,bu=e]);t<vu&&(vu=t),t>xu&&(xu=t),Mu=n,wu=e}function T(){td.point=I}function z(){Cu[0]=yu,Cu[1]=bu,td.point=E,Mu=null}function $(e,t){if(Mu){var n=e-wu;ju.add(_u(n)>180?n+(n>0?360:-360):n)}else ku=e,Su=t;Ju.point(e,t),I(e,t)}function D(){Ju.lineStart()}function _(){$(ku,Su),Ju.lineEnd(),_u(ju)>Pu&&(yu=-(bu=180)),Cu[0]=yu,Cu[1]=bu,Mu=null}function F(e,t){return(t-=e)<0?t+360:t}function O(e,t){return e[0]-t[0]}function B(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function W(e){var t,n,r,i,o,a,s;if(xu=bu=-(yu=vu=1/0),Au=[],x(e,td),n=Au.length){for(Au.sort(O),t=1,o=[r=Au[0]];t<n;++t)B(r,(i=Au[t])[0])||B(r,i[1])?(F(r[0],i[1])>F(r[0],r[1])&&(r[1]=i[1]),F(i[0],r[1])>F(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=F(r[1],i[0]))>a&&(a=s,yu=i[0],bu=r[1])}return Au=Cu=null,yu===1/0||vu===1/0?[[NaN,NaN],[NaN,NaN]]:[[yu,vu],[bu,xu]]}function H(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function q(e,t){return _u(e)>Eu&&(e-=Math.round(e/zu)*zu),[e,t]}function G(e,t,n){return(e%=zu)?t||n?H(Y(e),U(t,n)):Y(e):t||n?U(t,n):q}function V(e){return function(t,n){return _u(t+=e)>Eu&&(t-=Math.round(t/zu)*zu),[t,n]}}function Y(e){var t=V(e);return t.invert=V(-e),t}function U(e,t){function n(e,t){var n=Bu(t),s=Bu(e)*n,l=Gu(e)*n,c=Gu(t),u=c*r+s*i;return[Ou(l*o-u*a,s*r-c*i),p(u*o+l*a)]}var r=Bu(e),i=Gu(e),o=Bu(t),a=Gu(t);return n.invert=function(e,t){var n=Bu(t),s=Bu(e)*n,l=Gu(e)*n,c=Gu(t),u=c*o-l*a;return[Ou(l*o+c*a,s*r+u*i),p(u*r-s*i)]},n}function X(e){function t(t){return(t=e(t[0]*Du,t[1]*Du))[0]*=$u,t[1]*=$u,t}return e=G(e[0]*Du,e[1]*Du,e.length>2?e[2]*Du:0),t.invert=function(t){return(t=e.invert(t[0]*Du,t[1]*Du))[0]*=$u,t[1]*=$u,t},t}function Z(e,t,n,r,i,o){if(n){var a=Bu(t),s=Gu(t),l=r*n;null==i?(i=t+r*zu,o=t-l/2):(i=K(a,i),o=K(a,o),(r>0?i<o:i>o)&&(i+=r*zu));for(var c,u=i;r>0?u>o:u<o;u-=l)c=j([a,-s*Bu(u),-s*Gu(u)]),e.point(c[0],c[1])}}function K(e,t){(t=A(t))[0]-=e,N(t);var n,r=(n=-t[1])>1?0:n<-1?Eu:Math.acos(n);return((-t[2]<0?-r:r)+zu-Pu)%zu}function Q(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:g,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function J(e,t){return _u(e[0]-t[0])<Pu&&_u(e[1]-t[1])<Pu}function ee(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function te(e,t,n,r,i){var o,a,s=[],l=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n,r=e[0],a=e[t];if(J(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<t;++o)i.point((r=e[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}s.push(n=new ee(r,e,null,!0)),l.push(n.o=new ee(r,null,n,!1)),s.push(n=new ee(a,e,null,!1)),l.push(n.o=new ee(a,null,n,!0))}}),s.length){for(l.sort(t),ne(s),ne(l),o=0,a=l.length;o<a;++o)l[o].e=n=!n;for(var c,u,d=s[0];;){for(var h=d,f=!0;h.v;)if((h=h.n)===d)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,a=c.length;o<a;++o)i.point((u=c[o])[0],u[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(c=h.p.z,o=c.length-1;o>=0;--o)i.point((u=c[o])[0],u[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,f=!f}while(!h.v);i.lineEnd()}}}function ne(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r<t;)i.n=n=e[r],n.p=i,i=n;i.n=n=e[0],n.p=i}}function re(e){return _u(e[0])<=Eu?e[0]:Vu(e[0])*((_u(e[0])+Eu)%zu-Eu)}function ie(e,t){var n=re(t),r=t[1],i=Gu(r),o=[Gu(n),-Bu(n),0],a=0,s=0,l=new pd.Adder;1===i?r=Iu+Pu:-1===i&&(r=-Iu-Pu);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],m=re(f),g=f[1]/2+Tu,y=Gu(g),v=Bu(g),b=0;b<h;++b,m=w,y=S,v=M,f=x){var x=d[b],w=re(x),k=x[1]/2+Tu,S=Gu(k),M=Bu(k),j=w-m,C=j>=0?1:-1,L=C*j,P=L>Eu,E=y*S;if(l.add(Ou(E*C*Gu(L),v*M+E*Bu(L))),a+=P?j+C*zu:j,P^m>=n^w>=n){var I=R(A(f),A(x));N(I);var T=R(o,I);N(T);var z=(P^j>=0?-1:1)*p(T[2]);(r>z||r===z&&(I[0]||I[1]))&&(s+=P^j>=0?1:-1)}}return(a<-Pu||a<Pu&&l<-1e-12)^1&s}function oe(e,t,n,r){return function(i){function o(t,n){e(t,n)&&i.point(t,n)}function a(e,t){m.point(e,t)}function s(){b.point=a,m.lineStart()}function l(){b.point=o,m.lineEnd()}function c(e,t){p.push([e,t]),y.point(e,t)}function u(){y.lineStart(),p=[]}function d(){c(p[0][0],p[0][1]),y.lineEnd();var e,t,n,r,o=y.clean(),a=g.result(),s=a.length;if(p.pop(),h.push(p),p=null,s)if(1&o){if((t=(n=a[0]).length-1)>0){for(v||(i.polygonStart(),v=!0),i.lineStart(),e=0;e<t;++e)i.point((r=n[e])[0],r[1]);i.lineEnd()}}else s>1&&2&o&&a.push(a.pop().concat(a.shift())),f.push(a.filter(ae))}var h,f,p,m=t(i),g=Q(),y=t(g),v=!1,b={point:o,lineStart:s,lineEnd:l,polygonStart:function(){b.point=c,b.lineStart=u,b.lineEnd=d,f=[],h=[]},polygonEnd:function(){b.point=o,b.lineStart=s,b.lineEnd=l,f=(0,md.merge)(f);var e=ie(h,r);f.length?(v||(i.polygonStart(),v=!0),te(f,se,e,n,i)):e&&(v||(i.polygonStart(),v=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),v&&(i.polygonEnd(),v=!1),f=h=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};return b}}function ae(e){return e.length>1}function se(e,t){return((e=e.x)[0]<0?e[1]-Iu-Pu:Iu-e[1])-((t=t.x)[0]<0?t[1]-Iu-Pu:Iu-t[1])}function le(e,t,n,r){var i,o,a=Gu(e-n);return _u(a)>Pu?Fu((Gu(t)*(o=Bu(r))*Gu(n)-Gu(r)*(i=Bu(t))*Gu(e))/(i*o*a)):(t+r)/2}function ce(e){function t(e,t){return Bu(e)*Bu(t)>i}function n(e,t,n){var r=[1,0,0],o=R(A(e),A(t)),a=C(o,o),s=o[0],l=a-s*s;if(!l)return!n&&e;var c=i*a/l,u=-i*s/l,d=R(r,o),h=P(r,c);L(h,P(o,u));var f=d,p=C(h,f),m=C(f,f),g=p*p-m*(C(h,h)-1);if(!(g<0)){var y=Yu(g),v=P(f,(-p-y)/m);if(L(v,h),v=j(v),!n)return v;var b,x=e[0],w=t[0],k=e[1],S=t[1];w<x&&(b=x,x=w,w=b);var M=w-x,N=_u(M-Eu)<Pu;if(!N&&S<k&&(b=k,k=S,S=b),N||M<Pu?N?k+S>0^v[1]<(_u(v[0]-x)<Pu?k:S):k<=v[1]&&v[1]<=S:M>Eu^(x<=v[0]&&v[0]<=w)){var E=P(f,(-p+y)/m);return L(E,h),[v,j(E)]}}}function r(t,n){var r=a?e:Eu-e,i=0;return t<-r?i|=1:t>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var i=Bu(e),o=2*Du,a=i>0,s=_u(i)>Pu;return oe(t,function(e){var i,o,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(d,h){var f,p=[d,h],m=t(d,h),g=a?m?0:r(d,h):m?r(d+(d<0?Eu:-Eu),h):0;if(!i&&(c=l=m)&&e.lineStart(),m!==l&&(!(f=n(i,p))||J(i,f)||J(p,f))&&(p[2]=1),m!==l)u=0,m?(e.lineStart(),f=n(p,i),e.point(f[0],f[1])):(f=n(i,p),e.point(f[0],f[1],2),e.lineEnd()),i=f;else if(s&&i&&a^m){var y;g&o||!(y=n(p,i,!0))||(u=0,a?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!m||i&&J(i,p)||e.point(p[0],p[1]),i=p,l=m,o=g},lineEnd:function(){l&&e.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},function(t,n,r,i){Z(i,e,o,r,t,n)},a?[0,-e]:[-Eu,e-Eu])}function ue(e,t,n,r,i,o){var a,s=e[0],l=e[1],c=0,u=1,d=t[0]-s,h=t[1]-l;if(a=n-s,d||!(a>0)){if(a/=d,d<0){if(a<c)return;a<u&&(u=a)}else if(d>0){if(a>u)return;a>c&&(c=a)}if(a=i-s,d||!(a<0)){if(a/=d,d<0){if(a>u)return;a>c&&(c=a)}else if(d>0){if(a<c)return;a<u&&(u=a)}if(a=r-l,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<u&&(u=a)}else if(h>0){if(a>u)return;a>c&&(c=a)}if(a=o-l,h||!(a<0)){if(a/=h,h<0){if(a>u)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<u&&(u=a)}return c>0&&(e[0]=s+c*d,e[1]=l+c*h),u<1&&(t[0]=s+u*d,t[1]=l+u*h),!0}}}}}function de(e,t,n,r){function i(i,o){return e<=i&&i<=n&&t<=o&&o<=r}function o(i,o,s,c){var u=0,d=0;if(null==i||(u=a(i,s))!==(d=a(o,s))||l(i,o)<0^s>0)do{c.point(0===u||3===u?e:n,u>1?r:t)}while((u=(u+s+4)%4)!==d);else c.point(o[0],o[1])}function a(r,i){return _u(r[0]-e)<Pu?i>0?0:3:_u(r[0]-n)<Pu?i>0?2:1:_u(r[1]-t)<Pu?i>0?1:0:i>0?3:2}function s(e,t){return l(e.x,t.x)}function l(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){function l(e,t){i(e,t)&&k.point(e,t)}function c(){for(var t=0,n=0,i=h.length;n<i;++n)for(var o,a,s=h[n],l=1,c=s.length,u=s[0],d=u[0],f=u[1];l<c;++l)o=d,a=f,d=(u=s[l])[0],f=u[1],a<=r?f>r&&(d-o)*(r-a)>(f-a)*(e-o)&&++t:f<=r&&(d-o)*(r-a)<(f-a)*(e-o)&&--t;return t}function u(o,a){var s=i(o,a);if(h&&f.push([o,a]),x)p=o,m=a,g=s,x=!1,s&&(k.lineStart(),k.point(o,a));else if(s&&b)k.point(o,a);else{var l=[y=Math.max(bd,Math.min(vd,y)),v=Math.max(bd,Math.min(vd,v))],c=[o=Math.max(bd,Math.min(vd,o)),a=Math.max(bd,Math.min(vd,a))];ue(l,c,e,t,n,r)?(b||(k.lineStart(),k.point(l[0],l[1])),k.point(c[0],c[1]),s||k.lineEnd(),w=!1):s&&(k.lineStart(),k.point(o,a),w=!1)}y=o,v=a,b=s}var d,h,f,p,m,g,y,v,b,x,w,k=a,S=Q(),M={point:l,lineStart:function(){M.point=u,h&&h.push(f=[]),x=!0,b=!1,y=v=NaN},lineEnd:function(){d&&(u(p,m),g&&b&&S.rejoin(),d.push(S.result())),M.point=l,b&&k.lineEnd()},polygonStart:function(){k=S,d=[],h=[],w=!0},polygonEnd:function(){var e=c(),t=w&&e,n=(d=(0,yd.merge)(d)).length;(t||n)&&(a.polygonStart(),t&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),n&&te(d,s,e,o,a),a.polygonEnd()),k=a,d=h=f=null}};return M}}function he(){wd.point=wd.lineEnd=g}function fe(e,t){rd=e*=Du,id=Gu(t*=Du),od=Bu(t),wd.point=pe}function pe(e,t){e*=Du;var n=Gu(t*=Du),r=Bu(t),i=_u(e-rd),o=Bu(i),a=r*Gu(i),s=od*n-id*r*o,l=id*n+od*r*o;nd.add(Ou(Yu(a*a+s*s),l)),rd=e,id=n,od=r}function me(e,t){return kd[0]=e,kd[1]=t,n=Sd,nd=new xd.Adder,x(n,wd),+nd;var n}function ge(e,t){return!(!e||!jd.hasOwnProperty(e.type))&&jd[e.type](e,t)}function ye(e,t){return 0===me(e,t)}function ve(e,t){for(var n,r,i,o=0,a=e.length;o<a;o++){if(0===(r=me(e[o],t)))return!0;if(o>0&&(i=me(e[o],e[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<Nu*i)return!0;n=r}return!1}function be(e,t){return!!ie(e.map(xe),we(t))}function xe(e){return(e=e.map(we)).pop(),e}function we(e){return[e[0]*Du,e[1]*Du]}function ke(e,t){return(e&&Md.hasOwnProperty(e.type)?Md[e.type]:ge)(e,t)}function Se(e,t,n){var r=(0,Ad.range)(e,t-Pu,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function Me(e,t,n){var r=(0,Ad.range)(e,t-Pu,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function je(){function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return(0,Ad.range)(Wu(o/g)*g,i,g).map(h).concat((0,Ad.range)(Wu(c/y)*y,l,y).map(f)).concat((0,Ad.range)(Wu(r/p)*p,n,p).filter(function(e){return _u(e%g)>Pu}).map(u)).concat((0,Ad.range)(Wu(s/m)*m,a,m).filter(function(e){return _u(e%y)>Pu}).map(d))}var n,r,i,o,a,s,l,c,u,d,h,f,p=10,m=p,g=90,y=360,v=2.5;return e.lines=function(){return t().map(function(e){return{type:"LineString",coordinates:e}})},e.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(f(l).slice(1),h(i).reverse().slice(1),f(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(o=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],o>i&&(t=o,o=i,i=t),c>l&&(t=c,c=l,l=t),e.precision(v)):[[o,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),e.precision(v)):[[r,s],[n,a]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(g=+t[0],y=+t[1],e):[g,y]},e.stepMinor=function(t){return arguments.length?(p=+t[0],m=+t[1],e):[p,m]},e.precision=function(t){return arguments.length?(v=+t,u=Se(s,a,90),d=Me(r,n,v),h=Se(c,l,90),f=Me(o,i,v),e):v},e.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Ae(e,t){var n=e[0]*Du,r=e[1]*Du,i=t[0]*Du,o=t[1]*Du,a=Bu(r),s=Gu(r),l=Bu(o),c=Gu(o),u=a*Bu(n),d=a*Gu(n),h=l*Bu(i),f=l*Gu(i),g=2*p(Yu(m(o-r)+a*l*m(i-n))),y=Gu(g),v=g?function(e){var t=Gu(e*=g)/y,n=Gu(g-e)/y,r=n*u+t*h,i=n*d+t*f,o=n*s+t*c;return[Ou(i,r)*$u,Ou(o,Yu(r*r+i*i))*$u]}:function(){return[n*$u,r*$u]};return v.distance=g,v}function Ce(){Nd.point=Re}function Re(e,t){Nd.point=Le,ad=ld=e,sd=cd=t}function Le(e,t){Pd.add(cd*e-ld*t),ld=e,cd=t}function Pe(){Le(ad,sd)}function Ne(e,t){_d+=e,Fd+=t,++Od}function Ee(){Yd.point=Ie}function Ie(e,t){Yd.point=Te,Ne(hd=e,fd=t)}function Te(e,t){var n=e-hd,r=t-fd,i=Yu(n*n+r*r);Bd+=i*(hd+e)/2,Wd+=i*(fd+t)/2,Hd+=i,Ne(hd=e,fd=t)}function ze(){Yd.point=Ne}function $e(){Yd.point=_e}function De(){Fe(ud,dd)}function _e(e,t){Yd.point=Fe,Ne(ud=hd=e,dd=fd=t)}function Fe(e,t){var n=e-hd,r=t-fd,i=Yu(n*n+r*r);Bd+=i*(hd+e)/2,Wd+=i*(fd+t)/2,Hd+=i,qd+=(i=fd*e-hd*t)*(hd+e),Gd+=i*(fd+t),Vd+=3*i,Ne(hd=e,fd=t)}function Oe(e){this._context=e}function Be(e,t){ah.point=We,Zd=Qd=e,Kd=Jd=t}function We(e,t){Qd-=e,Jd-=t,oh.add(Yu(Qd*Qd+Jd*Jd)),Qd=e,Jd=t}function He(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function qe(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return He;if(t!==eh){const e=10**t;eh=t,th=function(t){let n=1;this._+=t[0];for(const r=t.length;n<r;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}return th}function Ge(e,t){function n(e){return e&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),x(e,r(i))),i.result()}let r,i,o=3,a=4.5;return n.area=function(e){return x(e,r(Ed)),Ed.result()},n.measure=function(e){return x(e,r(sh)),sh.result()},n.bounds=function(e){return x(e,r(Dd)),Dd.result()},n.centroid=function(e){return x(e,r(Ud)),Ud.result()},n.projection=function(t){return arguments.length?(r=null==t?(e=null,Cd):(e=t).stream,n):e},n.context=function(e){return arguments.length?(i=null==e?(t=null,new lh(o)):new Oe(t=e),"function"!=typeof a&&i.pointRadius(a),n):t},n.pointRadius=function(e){return arguments.length?(a="function"==typeof e?e:(i.pointRadius(+e),+e),n):a},n.digits=function(e){if(!arguments.length)return o;if(null==e)o=null;else{const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);o=t}return null===t&&(i=new lh(o)),n},n.projection(e).digits(o).context(t)}function Ve(e){return function(t){var n=new Ye;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Ye(){}function Ue(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),x(n,e.stream(Dd)),t(Dd.result()),null!=r&&e.clipExtent(r),e}function Xe(e,t,n){return Ue(e,function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])},n)}function Ze(e,t,n){return Xe(e,[[0,0],t],n)}function Ke(e,t,n){return Ue(e,function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])},n)}function Qe(e,t,n){return Ue(e,function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])},n)}function Je(e,t){return+t?tt(e,t):et(e)}function et(e){return Ve({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function tt(e,t){function n(r,i,o,a,s,l,c,u,d,h,f,m,g,y){var v=c-r,b=u-i,x=v*v+b*b;if(x>4*t&&g--){var w=a+h,k=s+f,S=l+m,M=Yu(w*w+k*k+S*S),j=p(S/=M),A=_u(_u(S)-1)<Pu||_u(o-d)<Pu?(o+d)/2:Ou(k,w),C=e(A,j),R=C[0],L=C[1],P=R-r,N=L-i,E=b*P-v*N;(E*E/x>t||_u((v*P+b*N)/x-.5)>.3||a*h+s*f+l*m<ch)&&(n(r,i,o,a,s,l,R,L,A,w/=M,k/=M,S,g,y),y.point(R,L),n(R,L,A,w,k,S,c,u,d,h,f,m,g,y))}}return function(t){function r(n,r){n=e(n,r),t.point(n[0],n[1])}function i(){y=NaN,k.point=o,t.lineStart()}function o(r,i){var o=A([r,i]),a=e(r,i);n(y,v,g,b,x,w,y=a[0],v=a[1],g=r,b=o[0],x=o[1],w=o[2],16,t),t.point(y,v)}function a(){k.point=r,t.lineEnd()}function s(){i(),k.point=l,k.lineEnd=c}function l(e,t){o(u=e,t),d=y,h=v,f=b,p=x,m=w,k.point=o}function c(){n(y,v,g,b,x,w,d,h,u,f,p,m,16,t),k.lineEnd=a,a()}var u,d,h,f,p,m,g,y,v,b,x,w,k={point:r,lineStart:i,lineEnd:a,polygonStart:function(){t.polygonStart(),k.lineStart=s},polygonEnd:function(){t.polygonEnd(),k.lineStart=i}};return k}}function nt(e){return Ve({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function rt(e,t,n,r,i){function o(o,a){return[t+e*(o*=r),n-e*(a*=i)]}return o.invert=function(o,a){return[(o-t)/e*r,(n-a)/e*i]},o}function it(e,t,n,r,i,o){function a(e,o){return[c*(e*=r)-u*(o*=i)+t,n-u*e-c*o]}if(!o)return rt(e,t,n,r,i);var s=Bu(o),l=Gu(o),c=s*e,u=l*e,d=s/e,h=l/e,f=(l*n-s*t)/e,p=(l*t+s*n)/e;return a.invert=function(e,t){return[r*(d*e-h*t+f),i*(p-h*e-d*t)]},a}function ot(e){return at(function(){return e})()}function at(e){function t(e){return h(e[0]*Du,e[1]*Du)}function n(e){return(e=h.invert(e[0],e[1]))&&[e[0]*$u,e[1]*$u]}function r(){var e=it(m,0,0,M,j,S).apply(null,o(v,b)),t=it(m,g-e[0],y-e[1],M,j,S);return a=G(x,w,k),d=H(o,t),h=H(a,d),u=Je(d,P),i()}function i(){return f=p=null,t}var o,a,s,l,c,u,d,h,f,p,m=150,g=480,y=250,v=0,b=0,x=0,w=0,k=0,S=0,M=1,j=1,A=null,C=gd,R=null,L=Cd,P=.5;return t.stream=function(e){return f&&p===e?f:f=uh(nt(a)(C(u(L(p=e)))))},t.preclip=function(e){return arguments.length?(C=e,A=void 0,i()):C},t.postclip=function(e){return arguments.length?(L=e,R=s=l=c=null,i()):L},t.clipAngle=function(e){return arguments.length?(C=+e?ce(A=e*Du):(A=null,gd),i()):A*$u},t.clipExtent=function(e){return arguments.length?(L=null==e?(R=s=l=c=null,Cd):de(R=+e[0][0],s=+e[0][1],l=+e[1][0],c=+e[1][1]),i()):null==R?null:[[R,s],[l,c]]},t.scale=function(e){return arguments.length?(m=+e,r()):m},t.translate=function(e){return arguments.length?(g=+e[0],y=+e[1],r()):[g,y]},t.center=function(e){return arguments.length?(v=e[0]%360*Du,b=e[1]%360*Du,r()):[v*$u,b*$u]},t.rotate=function(e){return arguments.length?(x=e[0]%360*Du,w=e[1]%360*Du,k=e.length>2?e[2]%360*Du:0,r()):[x*$u,w*$u,k*$u]},t.angle=function(e){return arguments.length?(S=e%360*Du,r()):S*$u},t.reflectX=function(e){return arguments.length?(M=e?-1:1,r()):M<0},t.reflectY=function(e){return arguments.length?(j=e?-1:1,r()):j<0},t.precision=function(e){return arguments.length?(u=Je(d,P=e*e),i()):Yu(P)},t.fitExtent=function(e,n){return Xe(t,e,n)},t.fitSize=function(e,n){return Ze(t,e,n)},t.fitWidth=function(e,n){return Ke(t,e,n)},t.fitHeight=function(e,n){return Qe(t,e,n)},function(){return o=e.apply(this,arguments),t.invert=o.invert&&n,r()}}function st(e){function t(e,t){return[e*n,Gu(t)/n]}var n=Bu(e);return t.invert=function(e,t){return[e/n,p(t*n)]},t}function lt(e,t){function n(e,t){var n=Yu(o-2*i*Gu(t))/i;return[n*Gu(e*=i),a-n*Bu(e)]}var r=Gu(e),i=(r+Gu(t))/2;if(_u(i)<Pu)return st(e);var o=1+r*(2*i-r),a=Yu(o)/i;return n.invert=function(e,t){var n=a-t,r=Ou(e,_u(n))*Vu(n);return n*i<0&&(r-=Eu*Vu(e)*Vu(n)),[r/i,p((o-(e*e+n*n)*i*i)/(2*i))]},n}function ct(){return(e=lt,t=0,n=Eu/3,r=at(e),i=r(t,n),i.parallels=function(e){return arguments.length?r(t=e[0]*Du,n=e[1]*Du):[t*$u,n*$u]},i).scale(155.424).center([0,33.6442]);var e,t,n,r,i}function ut(e,t){return[e,qu(Uu((Iu+t)/2))]}function dt(e){function t(){var t=Eu*s(),a=o(X(o.rotate()).invert([0,0]));return c(null==u?[[a[0]-t,a[1]-t],[a[0]+t,a[1]+t]]:e===ut?[[Math.max(a[0]-t,u),n],[Math.min(a[0]+t,r),i]]:[[u,Math.max(a[1]-t,n)],[r,Math.min(a[1]+t,i)]])}var n,r,i,o=ot(e),a=o.center,s=o.scale,l=o.translate,c=o.clipExtent,u=null;return o.scale=function(e){return arguments.length?(s(e),t()):s()},o.translate=function(e){return arguments.length?(l(e),t()):l()},o.center=function(e){return arguments.length?(a(e),t()):a()},o.clipExtent=function(e){return arguments.length?(null==e?u=n=r=i=null:(u=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),t()):null==u?null:[[u,n],[r,i]]},t()}function ht(e,t){return[e,t]}function ft(e,t){var n=p(gh*Gu(t)),r=n*n,i=r*r*r;return[e*Bu(n)/(gh*(hh+3*fh*r+i*(7*ph+9*mh*r))),n*(hh+fh*r+i*(ph+mh*r))]}function pt(){return ot(ft).scale(177.158)}function mt(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),t*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function gt(e,t){return[Bu(t)*Gu(e),Gu(t)]}function yt(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}function vt(e,t){const n=e-t.startTime;return Math.min(n/t.duration,1)}function bt(e,t,n){return e+(t-e)*n}function xt(e,t){if(!1===e)return{transition:void 0,introEnabled:!1};const n="undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;return{transition:e?!0===e?{duration:300}:{duration:e.duration??300,easing:"linear"===e.easing?"linear":"ease-out"}:t,introEnabled:!(n||!e||!0!==e&&!1===e.intro)}}function wt(e,t,n={}){if(!Number.isFinite(t)||t<=0)return"fresh";if(Number.isNaN(e))return"fresh";if(e===1/0)return"expired";if(e<0)return"fresh";const r=n.fresh??wh,i=n.aging??kh,o=n.stale??Sh;return e<t*r?"fresh":e<t*i?"aging":e<t*o?"stale":"expired"}function kt(e){const t=Math.max(0,Math.min(1,e.minOpacity??.1));if(Number.isNaN(e.age))return 1;if(e.age===1/0)return t;if(!Number.isFinite(e.extent)||e.extent<=0)return 1;const n=Math.max(0,e.age);if("step"===e.type)return n<(e.threshold??.5*e.extent)?1:t;if("exponential"===e.type){const r=e.halfLife??e.extent/2,i=r>0?r:e.extent/2;return t+Math.pow(.5,n/i)*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function St(e,t,n){if(n<=1)return 1;const r=n-1;return kt({age:r-t,extent:r,type:e.type,halfLife:e.halfLife??n/2,threshold:e.stepThreshold??.5*n,minOpacity:e.minOpacity??.1})}function Mt(e,t,n){const r=e.duration??500,i=n-t;return i>=r?0:1-i/r}function jt(e,t,n,r){let i=!1;return t>0?(e._pulseIntensity!==t&&(e._pulseIntensity=t,i=!0),e._pulseColor!==n&&(e._pulseColor=n,i=!0),e._pulseGlowRadius!==r&&(e._pulseGlowRadius=r,i=!0),i):(0!==e._pulseIntensity&&(e._pulseIntensity=0,i=!0),void 0!==e._pulseColor&&(e._pulseColor=void 0,i=!0),void 0!==e._pulseGlowRadius&&(e._pulseGlowRadius=void 0,i=!0),i)}function At(e,t,n=("undefined"!=typeof performance?performance.now():Date.now())){if(!t||0===t.size)return!1;const r=e.duration??500,i=t.peek();return null!=i&&n-i<r}function Ct(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function Rt(e,t,n){const r=e=>e.toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function Lt(e){const t=e.map(Ct),n=t.length-1;return e=>{if(Number.isNaN(e)&&(e=0),e<=0){const[e,n,r]=t[0];return Rt(e,n,r)}if(e>=1){const[e,r,i]=t[n];return Rt(e,r,i)}const r=e*n,i=Math.floor(r),o=r-i,[a,s,l]=t[i],[c,u,d]=t[i+1];return Rt(Math.round(a+(c-a)*o),Math.round(s+(u-s)*o),Math.round(l+(d-l)*o))}}function Pt(e){return e&&Object.prototype.hasOwnProperty.call(Eh,e)?Eh[e]:Ah}function Nt(e,t,n=Th){if(e&&"object"==typeof e&&!Array.isArray(e)){const t=Object.values(e).filter(e=>"string"==typeof e&&e.length>0);if(t.length>0)return t}if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e){const t=Object.prototype.hasOwnProperty.call(Ih,e)?Ih[e]:void 0;if(Array.isArray(t)&&t.length>0)return t}return t&&t.length>0?t:n}function Et(e){const t=e.toLowerCase();return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||Dh.has(t)}function It(e,t,n){if("function"==typeof t){const r=t(e);return n&&r&&"string"==typeof r&&!Et(r)?n(r):r}const r=String(e?.[t]);return n?n(r):Th[Math.abs($t(r))%Th.length]}function Tt(e,t){if(null==t||!Object.prototype.hasOwnProperty.call(e,t))return;const n=e[t];return"string"==typeof n&&n.length>0?n:void 0}function zt(e,t,n="category10"){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;return t=>Tt(e,t)??"#999"}const r=Array.from(new Set(e.map(e=>e?.[t]).filter(e=>null!=e).map(e=>String(e)))),i=r.every(e=>!isNaN(Number(e)));if(Array.isArray(n))return(0,Mh.scaleOrdinal)().domain(r).range(n).unknown("#999");const o=Object.prototype.hasOwnProperty.call(Ih,n)?Ih[n]:Ih.category10;if(i&&"function"==typeof o){let e=-1/0;for(const t of r){const n=Number(t);n>e&&(e=n)}return t=>o(0===e?0:Number(t)/e)}{const e=Array.isArray(o)?o:Th;return(0,Mh.scaleOrdinal)().domain(r).range(e).unknown("#999")}}function $t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}function Dt(e,t,n=[3,20],r){let i;if(i="function"==typeof t?t(e):e?.[t],!r)return i;const[o,a]=r,[s,l]=n;if(a===o)return(s+l)/2;let c=(i-o)/(a-o);return c<0?c=0:c>1&&(c=1),s+c*(l-s)}function _t(e,t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:void 0;return 0===e.length?e=>n&&Tt(n,e)||"#4e79a7":t=>{if(n){const e=Tt(n,t);if(e)return e}let r=0;for(let e=0;e<t.length;e++)r=31*r+t.charCodeAt(e)|0;return e[Math.abs(r)%e.length]??"#4e79a7"}}function Ft(e){if("production"===process.env.NODE_ENV)return;const{label:t,nodes:n,overlays:r,warned:i}=e;Ot(r)&&0===n.length&&Bt(i,"overlay-only",`[semiotic] ${t} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),n.length>0&&n.every(e=>null==e.datum)&&Bt(i,"null-datums",`[semiotic] ${t} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function Ot(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(Ot))}function Bt(e,t,n){e.has(t)||(e.add(t),console.warn(n))}function Wt(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message||"Custom layout threw."};if("string"==typeof e)return{name:"Error",message:e};if(null==e)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:String(e)}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}function Ht(e,t,n,r){const i=Wt(t),o="network"===e?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:e,source:o,message:`Semiotic ${e} ${o} failed: ${i.message}`,error:i,recovery:n?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:n,affectedRevision:r}}function qt(e){try{return{kind:"success",result:e.run()}}catch(t){const n=e.hasPreviousResult,r=Ht(e.family,t,n,e.revision);"production"!==process.env.NODE_ENV&&console.error(`[semiotic] ${e.logLabel} threw:`,t);try{e.onLayoutError?.(r)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:r,preservedLastGoodScene:n}}}function Gt(e){if(!e)return pt();if("string"==typeof e){const t=_h[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),pt())}if("object"==typeof e&&"type"in e){const t=_h[e.type],n=t?t():pt();return e.rotate&&"rotate"in n&&n.rotate(e.rotate),e.center&&"center"in n&&n.center(e.center),n}return e}function Vt(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function Yt(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function Ut(e,t,n){return e?"function"==typeof e?{...n,...e(t)}:{...n,...e}:{...n}}function Xt(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}function Zt(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}function Kt(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}function Qt(e,t){if(e.length<2)return[e];const n=.4*t,r=[];let i=[e[0]];for(let t=1;t<e.length;t++){const o=e[t-1],a=e[t];Math.abs(a[0]-o[0])>n?(i.length>=2&&r.push(i),i=[a]):i.push(a)}return i.length>=2&&r.push(i),r}function Jt(e,t,n=24){const r=t[0]-e[0],i=t[1]-e[1],o=Math.sqrt(r*r+i*i);if(0===o)return[e,t];const a=-i/o,s=r/o,l=Math.min(.3*o,80),c=(e[0]+t[0])/2+a*l,u=(e[1]+t[1])/2+s*l,d=[];for(let r=0;r<=n;r++){const i=r/n,o=1-i,a=o*o*e[0]+2*o*i*c+i*i*t[0],s=o*o*e[1]+2*o*i*u+i*i*t[1];d.push([a,s])}return d}function en(e,t){if(e.length<2)return e;const n=t/2+1,r=[];for(let t=0;t<e.length;t++){const i=e[t];let o,a;0===t?(o=e[1][0]-i[0],a=e[1][1]-i[1]):t===e.length-1?(o=i[0]-e[t-1][0],a=i[1]-e[t-1][1]):(o=e[t+1][0]-e[t-1][0],a=e[t+1][1]-e[t-1][1]);const s=Math.sqrt(o*o+a*a)||1,l=a/s,c=-o/s;r.push([i[0]+l*n,i[1]+c*n])}return r}function tn(e,t,n,r,i){const o=t[0]-e[0],a=t[1]-e[1],s=Math.sqrt(o*o+a*a);if(0===s)return[e,t];const l=a/s,c=-o/s,u=i/2+1;return[[e[0]+l*u,e[1]+c*u],[t[0]+l*u,t[1]+c*u]]}function nn(e){let t=1/0,n=-1/0;for(const r of e)r<t&&(t=r),r>n&&(n=r);return[t,n]}function rn(e,t=-1/0){let n=t;for(const t of e)t>n&&(n=t);return n}function on(e,t,n,r){const i=e.filter(e=>"point"===e.type);if(i.length<2)return null;const o=t.strength??1,a=Number.isFinite(o)?Math.max(0,Math.min(1,o)):1,s="strip"===t.layout?"strip":"radial";if("radial"===s&&0===a)return null;const l=t.centerAccessor?"function"==typeof t.centerAccessor?t.centerAccessor:e=>e[t.centerAccessor]:e=>e.id,c="function"==typeof t.costAccessor?t.costAccessor:e=>e[t.costAccessor],u=i.find(e=>e.datum&&String(l(e.datum))===String(t.center));if(!u)return"production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Distance cartogram center "${t.center}" not found in point data`),null;const d=rn(i.map(e=>e.datum?Number(c(e.datum)):NaN).filter(e=>isFinite(e)&&e>=0),1);r>0&&"production"!==process.env.NODE_ENV&&console.warn("GeoFrame: Distance cartogram does not support area rendering. Areas will be ignored. Remove areas or set projectionTransform to null to render them.");for(let t=e.length-1;t>=0;t--){const n=e[t];"geoarea"===n.type&&n.interactive&&e.splice(t,1)}const h="strip"===s?sn(i,u,c,d,n):an(i,u,c,d,a,n),f=e.filter(e=>"line"===e.type);if(f.length>0){const e=/* @__PURE__ */new Map;for(const t of i)null!=t.pointId&&e.set(String(t.pointId),[t.x,t.y]);for(const n of f){const r=n.datum?.source,i=n.datum?.target;if(null!=r&&null!=i){const o=e.get(String(r)),a=e.get(String(i));if(o&&a)if("fractional"===t.lineMode&&n.path.length>2){const e=n.path[0],t=n.path[n.path.length-1],r=[o[0]-e[0],o[1]-e[1]],i=[a[0]-t[0],a[1]-t[1]],s=[0];for(let e=1;e<n.path.length;e++)s.push(s[e-1]+Math.hypot(n.path[e][0]-n.path[e-1][0],n.path[e][1]-n.path[e-1][1]));const l=s[s.length-1];n.path=n.path.map((e,t)=>{const o=l>0?s[t]/l:t/(n.path.length-1);return[e[0]+r[0]*(1-o)+i[0]*o,e[1]+r[1]*(1-o)+i[1]*o]})}else n.path=[o,a]}}}return h}function an(e,t,n,r,i,o){const a=t.x,s=t.y,l=o.width/2,c=o.height/2,u=Math.min(o.width,o.height)/2,d=(0,Fh.scaleLinear)().domain([0,r]).range([0,u]);for(const o of e){if(o===t)continue;if(!o.datum)continue;const e=o.x,u=o.y,h=Math.atan2(u-s,e-a),f=Math.hypot(e-a,u-s),p=Number(n(o.datum)),m=isFinite(p)&&p>=0?r>0?d(p):0:f,g=l+Math.cos(h)*m,y=c+Math.sin(h)*m;o.x=e+(g-e)*i,o.y=u+(y-u)*i}return t.x=a+(l-a)*i,t.y=s+(c-s)*i,{cx:t.x,cy:t.y,maxCost:r,availableRadius:u,layout:"radial"}}function sn(e,t,n,r,i){const o=Math.max(3,Math.min(8,.35*i.height)),a=Math.max(1,i.width-2*o),s=i.height/2,l=(0,Fh.scaleLinear)().domain([0,r]).range([0,a]);t.x=o,t.y=s;const c=[];for(const i of e){if(i===t)continue;if(!i.datum){i.x=o,i.y=s;continue}const e=Number(n(i.datum)),a=o+(isFinite(e)&&e>=0&&r>0?l(e):0);i.x=a,i.y=s,c.push({node:i,x:a})}c.sort((e,t)=>e.x-t.x);const u=Math.max(0,Math.min(i.height/2-1,6));let d=0;for(;d<c.length;){let e=d+1;for(;e<c.length&&Math.abs(c[e].x-c[d].x)<3;)e++;const t=e-d;if(t>1&&u>0)for(let e=0;e<t;e++){const n=e-(t-1)/2,r=Math.min(2.5,2*u/Math.max(1,t-1));c[d+e].node.y=s+n*r}d=e}return{cx:o,cy:s,maxCost:r,availableRadius:a,layout:"strip"}}function ln(e,t,n,r){const i=e.push(t);return n&&n.push(r),i}function cn(e,t,n){if(!t||0===t.size)return;const r=/* @__PURE__ */new Set;if(e.forEach((e,t)=>{n(e)&&r.add(t)}),0===r.size)return;const i=t.toArray();t.clear();for(let e=0;e<i.length;e++)r.has(e)||t.push(i[e])}function un(e,t){const n={...e};for(const e of t)n[Oh[e]]++;return n}function dn(e,t,n){const r=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:r,revisions:un(n,r)}}function hn(e){let t="preserve";const n=/* @__PURE__ */new Set;for(const r of e){const e=Qh[r]??Jh;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)n.add(t)}return{retainedData:t,invalidations:n}}function fn({config:e,projection:t,path:n,areas:r,points:i,lines:o,layout:a}){const s=Vt(e.xAccessor,"lon"),l=Vt(e.yAccessor,"lat"),c=[],u=Xt(e),d=Kt(e),h=Zt(e);if(e.graticule){const t=!0===e.graticule?{}:e.graticule,r=je();t.step&&r.step(t.step);const i=n(r())||"";i&&c.push({type:"geoarea",pathData:i,centroid:[a.width/2,a.height/2],bounds:[[0,0],[a.width,a.height]],screenArea:0,style:{fill:"none",stroke:t.stroke||"#e0e0e0",strokeWidth:t.strokeWidth??.5,strokeDasharray:t.strokeDasharray||"2,2"},datum:null,interactive:!1})}for(const t of r){const r=n(t);if(!r)continue;const i=n.centroid(t),o=n.bounds(t),a=n.area(t);c.push({type:"geoarea",pathData:r,centroid:i,bounds:o,screenArea:a,style:Ut(e.areaStyle,t,u),datum:t,interactive:!0})}const f=Yt(e.lineDataAccessor);for(const n of o){const r=f(n);if(!r||r.length<2)continue;let i=[];if("geo"===e.lineType){const e=new Array(r.length);for(let t=0;t<r.length;t++)e[t]=[s(r[t]),l(r[t])];for(let n=0;n<e.length-1;n++){const r=e[n],o=e[n+1],a=me(r,o)||0,s=Math.max(2,Math.ceil(a/(Math.PI/180))),l=Ae(r,o);for(let e=0;e<=s;e++){if(n>0&&0===e)continue;const r=t(l(e/s));null!=r&&i.push(r)}}}else for(let e=0;e<r.length;e++){const n=r[e],o=t([s(n),l(n)]);null!=o&&i.push(o)}if(i.length<2)continue;const o=Ut(e.lineStyle,n,d),u="number"==typeof o.strokeWidth?o.strokeWidth:1;2===r.length&&i.length>=2&&"arc"===e.flowStyle?i=Jt(i[0],i[i.length-1]):2===r.length&&i.length>=2&&"offset"===e.flowStyle&&(i="geo"===e.lineType?en(i,u):tn(i[0],i[i.length-1],0,0,u));const h=Qt(i,a.width);if(h.length<=1)c.push({type:"line",path:i.length>=2?i:h[0]||i,style:o,datum:n});else for(const e of h)e.length<2||c.push({type:"line",path:e,style:{...o,_edgeFade:!0},datum:n})}const p=e.pointIdAccessor?"function"==typeof e.pointIdAccessor?e.pointIdAccessor:t=>t[e.pointIdAccessor]:null,m=t.clipAngle?t.clipAngle()??0:0,g=m>0?m*Math.PI/180:null,y=t.rotate?t.rotate():[0,0,0],v="function"==typeof t.center?t.center():[0,0],b=[(v[0]??0)-y[0],(v[1]??0)-y[1]];for(const n of i){const r=s(n),i=l(n);if(null!=g&&me([r,i],b)>g)continue;const o=t([r,i]);if(!o)continue;const a=e.pointStyle?e.pointStyle(n):{...h},u={type:"point",x:o[0],y:o[1],r:a.r||4,style:a,datum:n,pointId:p?String(p(n)):void 0};c.push(u)}return c}function pn(e){if(null==e)return 0;if("number"==typeof e&&Number.isFinite(e)&&e>=0&&e<.5)return e;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${String(e)}.`)}function mn(e){return{...e,fitPadding:pn(e.fitPadding)}}function gn(e){return"fitPadding"in e?{...e,fitPadding:pn(e.fitPadding)}:e}function yn(e){if(!e)return lf;let t=!1;for(let n=0;n<e.length;n++){const r=e[n];if(null==r||"object"!=typeof r){t=!0;break}}if(!t)return e;const n=[];for(const t of e)null!=t&&"object"==typeof t&&n.push(t);return n}function vn(e,{storeRef:t,dirtyRef:n,scheduleRender:r,zoomTransformRef:i,containerRef:o,zoomBehaviorRef:a}){const s=(0,of.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushPoint(e),n.current=!0,r())},[t,n,r]),l=(0,of.useCallback)(e=>{const i=yn(e);0!==i.length&&(t.current?.pushMany(i),n.current=!0,r())},[t,n,r]),c=(0,of.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushLine(e),n.current=!0,r())},[t,n,r]),u=(0,of.useCallback)(e=>{const i=yn(e);0!==i.length&&(t.current?.pushManyLines(i),n.current=!0,r())},[t,n,r]),d=(0,of.useCallback)(()=>{t.current?.clear(),n.current=!0,r()},[t,n,r]);(0,of.useImperativeHandle)(e,()=>({push:s,pushMany:l,removePoint:e=>{const i=t.current?.removePoint(e)??[];return i.length>0&&(n.current=!0,r()),i},pushLine:c,pushManyLines:u,removeLine:e=>{const i=t.current?.removeLine(e)??[];return i.length>0&&(n.current=!0,r()),i},getLines:()=>t.current?.getLines()??[],clear:d,getProjection:()=>t.current?.scales?.projection??null,getGeoPath:()=>t.current?.scales?.geoPath??null,getCartogramLayout:()=>t.current?.cartogramLayout??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null,getZoom:()=>i.current.k,resetZoom:()=>{const e=o.current;e&&a.current&&(0,af.select)(e).call(a.current.transform,sf.zoomIdentity)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,d,r,t,n,i,o,a])}function bn(e){const{domain:t,layout:n,sceneGeometry:r}=e.revisions;return{domain:t,layout:n,sceneGeometry:r}}function xn(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}function wn(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 kn(e,t,n,r){const i=r.current,o=!0===e.lastCustomLayoutFailure?.preservedLastGoodScene,a=!o&&e.hasActivePulsesAt(t),s=!(n||o||!a&&!i)&&e.refreshPulse(t);return r.current=a,{changed:s,pending:a}}function Sn(e,t,n,r,i,o){const a=i-n,s=o-r,l=a*a+s*s;if(0===l)return Math.sqrt((e-n)**2+(t-r)**2);let c=((e-n)*a+(t-r)*s)/l;c=Math.max(0,Math.min(1,c));const u=n+c*a,d=r+c*s;return Math.sqrt((e-u)**2+(t-d)**2)}function Mn(e,t=30){return Math.max((e??4)+5,12,t)}function jn(e,t,n,r,i,o=e=>e.x,a=e=>e.y,s=e=>e.r,l){const c=Math.max(r,i+5,12),u=t-c,d=t+c,h=n-c,f=n+c;let p=null,m=1/0;return e.visit((e,i,c,g,y)=>{if(i>d||g<u||c>f||y<h)return!0;const v=e;if(!v.length){let e=v;do{const i=e.data,c=o(i)-t,u=a(i)-n,d=Math.sqrt(c*c+u*u);d<=Mn(s(i),r)&&(d<m||d===m&&null!==p&&l?.(i,p))&&(p=i,m=d),e=e.next}while(e)}return!1}),p?{node:p,distance:m}:null}function An(e,t){const[n,r]=e.viewBox??mf,[i,o]=e.anchor??gf,a=r>0?r:1,s=Math.max(0,t)/a,l=(n>0?n:a)*s,c=a*s;return{width:l,height:c,scale:s,offsetX:-i*l,offsetY:-o*c}}function Cn(e,t){const n=An(e,t),r=[[n.offsetX,n.offsetY],[n.offsetX+n.width,n.offsetY],[n.offsetX,n.offsetY+n.height],[n.offsetX+n.width,n.offsetY+n.height]];let i=0;for(const[e,t]of r){const n=Math.sqrt(e*e+t*t);n>i&&(i=n)}return i}function Rn(e,t,n,r){if("none"!==e)return"color"===e||null==e?t??r:"accent"===e?n:e}function Ln(e){if("undefined"==typeof Path2D)return null;yf||(yf=/* @__PURE__ */new Map);const t=yf.get(e);if(t)return t;const n=new Path2D(e);return yf.size>1024&&yf.clear(),yf.set(e,n),n}function Pn(e,t,n=0,r="horizontal"){const[i,o]=e.viewBox??mf,a=Math.min(1,Math.max(0,n)),s=Math.min(1,Math.max(0,t));return s<=a?{x:0,y:0,width:0,height:0}:a<=0&&s>=1?null:"vertical"===r?{x:0,y:o*(1-s),width:i,height:o*(s-a)}:{x:i*a,y:0,width:i*(s-a),height:o}}function Nn(e,t){const n=An(e,t);return{centerDx:n.offsetX+n.width/2,centerDy:n.offsetY+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2,radius:Math.hypot(n.width,n.height)/2}}function En(e,t,n,r,i,o=e=>e){for(const a of t.parts){const t=Ln(a.d);if(!t)continue;const s=a.opacity??1,l=e.globalAlpha;1!==s&&(e.globalAlpha=l*s);const c=i?"none"===a.fill?void 0:i:Rn(a.fill,n,r);c&&(e.fillStyle=o(c),e.fill(t));const u=i?a.stroke&&"none"!==a.stroke?i:void 0:Rn(a.stroke??"none",n,r);u&&(e.strokeStyle=o(u),e.lineWidth=a.strokeWidth??1,e.lineCap=a.strokeLinecap??"butt",e.lineJoin=a.strokeLinejoin??"miter",e.stroke(t)),1!==s&&(e.globalAlpha=l)}}function In(e,t,n,r,i,o,a=0,s=r){if(o){const e=jn(o,t,n,r,a);if(e&&!1!==e.node.interactive)return e}else{let i=null,o=1/0;for(const a of e){if("point"!==a.type)continue;if(!1===a.interactive)continue;const e=a.x-t,s=a.y-n,l=Math.sqrt(e*e+s*s);l<=Mn(a.r,r)&&l<o&&(i=a,o=l)}if(i)return{node:i,distance:o}}let l=null,c=1/0;for(const i of e){if("glyph"!==i.type)continue;if(null==i.datum)continue;const e=Nn(i.glyph,i.size),o=i.x+e.centerDx-t,a=i.y+e.centerDy-n,s=Math.sqrt(o*o+a*a);s<=Mn(e.radius,r)&&s<c&&(l=i,c=s)}if(l)return{node:l,distance:c};for(let r=e.length-1;r>=0;r--){const o=e[r];if("geoarea"!==o.type)continue;const a=o;if(!1===a.interactive)continue;const[[s,l],[c,u]]=a.bounds;if(!(t<s||t>c||n<l||n>u)&&(a._cachedPath2D||(a._cachedPath2D=new Path2D(a.pathData)),i.isPointInPath(a._cachedPath2D,t,n)))return{node:a,distance:0}}let u=null,d=1/0;for(const r of e){if("line"!==r.type)continue;const e=r,{path:i}=e,o=Math.max((e.style.strokeWidth??2)+4,5,s),a=t-o,l=t+o,c=n-o,h=n+o;for(let r=0;r<i.length-1;r++){const s=i[r],f=i[r+1],p=s[0],m=s[1],g=f[0],y=f[1];if(p<a&&g<a||p>l&&g>l||m<c&&y<c||m>h&&y>h)continue;const v=Sn(t,n,p,m,g,y);v<=o&&v<d&&(u=e,d=v)}}return u?{node:u,distance:d}:null}function Tn(e,t){return"function"==typeof e?.addEventListener?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e?.addListener?.(t),()=>e?.removeListener?.(t))}function zn(){const[e,t]=(0,wf.useState)(()=>!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,wf.useEffect)(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),Tn(e,e=>t(e.matches))},[]),e}function $n(e,t=0,n=1/0,r=0){const i=Number.isFinite(t)?t:0,o=Number.isFinite(n)?Math.max(i,n):1/0,a=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(o,a));return r>0&&Number.isFinite(r)?Math.max(i,Math.min(o,Math.round(s/r)*r)):s}function Dn(e,t,n,r={}){const i=(0,kf.useRef)(null),[o,a]=(0,kf.useState)(null);Sf(()=>{if(!t&&!n)return;const e=i.current;if(!e||"undefined"==typeof ResizeObserver)return;const o=(e,t)=>({w:$n(e,r.minWidth,r.maxWidth,r.widthStep),h:$n(t,r.minHeight,r.maxHeight,r.heightStep)}),s=e.getBoundingClientRect();(s.width>0||s.height>0)&&a(o(s.width,s.height));const l=new ResizeObserver(e=>{for(const t of e){const{width:e,height:n}=t.contentRect,r=o(e,n);a(e=>e&&e.w===r.w&&e.h===r.h?e:r)}});return l.observe(e),()=>l.disconnect()},[t,n,r.minWidth,r.maxWidth,r.widthStep,r.minHeight,r.maxHeight,r.heightStep]);const s=[t&&o?o.w:e[0],n&&o?o.h:e[1]];return[i,s]}function _n(e){return 0!==e.fontfaces?.length}function Fn(e){const t="undefined"==typeof document?void 0:document.fonts;if(!t||"function"!=typeof t.addEventListener)return()=>{};const n=t=>{_n(t)&&e()};return t.addEventListener("loadingdone",n),()=>t.removeEventListener("loadingdone",n)}function On(e){const t=e.trim();if(!t.startsWith("var(")||!t.endsWith(")"))return null;const n=t.slice(4,-1),r=n.indexOf(",");if(-1===r){const e=n.trim();return e.startsWith("--")?{name:e}:null}const i=n.slice(0,r).trim(),o=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:o||void 0}:null}function Bn(){if(Af)return;if("undefined"==typeof window||"undefined"==typeof document)return;Af=!0;const e=e=>{if(!e?.includes("--"))return"";const t=document.createElement("span").style;return t.cssText=e,Array.from(t).filter(e=>e.startsWith("--")).sort().map(e=>`${e}:${t.getPropertyValue(e)}!${t.getPropertyPriority(e)}`).join(";")},t=(t,n)=>{const r=t.target;if(!(r instanceof Element))return!1;if(r===n||r.contains(n))return!0;if(!n.contains(r))return!1;const i="CANVAS"===r.tagName;return!(!i&&!r.querySelector("canvas")||i&&"style"===t.attributeName&&e(t.oldValue)===e(r.getAttribute("style")))},n=e=>{const n=[];for(const r of Nf){const i=r.getElement();i&&(!e||e.some(e=>t(e,i)))&&n.push(r)}if(!e||0!==n.length){jf++;for(const e of n)e.listener()}};if("undefined"!=typeof MutationObserver&&document.documentElement&&(Cf=new MutationObserver(e=>{n(e)})).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme","data-semiotic-theme-mode"],attributeOldValue:!0,subtree:!0}),"function"==typeof window.matchMedia)try{Rf=window.matchMedia("(prefers-color-scheme: dark)"),Lf=()=>n(),"function"==typeof Rf.addEventListener?Rf.addEventListener("change",Lf):"function"==typeof Rf.addListener&&Rf.addListener(Lf)}catch{}Pf=Fn(()=>n())}function Wn(e,t){Bn();const n={getElement:e,listener:t};return Nf.add(n),()=>{Nf.delete(n)&&0===Nf.size&&(Cf?.disconnect(),Cf=null,Rf&&Lf&&("function"==typeof Rf.removeEventListener?Rf.removeEventListener("change",Lf):"function"==typeof Rf.removeListener&&Rf.removeListener(Lf)),Rf=null,Lf=null,Pf?.(),Pf=null,Af=!1)}}function Hn(e,t){if(!t)return t;const n=On(t);if(!n)return t;const r=()=>n.fallback?Hn(e,n.fallback):t,i=e.canvas;if(!i)return r();let o=Mf.get(i);o&&o.version===jf||(o={version:jf,map:/* @__PURE__ */new Map},Mf.set(i,o));const a=o.map.get(t);if(void 0!==a)return a;const s=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||t;return o.map.set(t,s),s}function qn(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 Gn(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}function Vn(e,t){const n=e();return Number.isFinite(n)?n:t}function Yn(e,t){const n=t?36:0;return e.top>=n?e:{...e,top:n}}function Un(e){let t=6;for(let n=1;n<e.length;n++){const r=Math.abs(e[n]-e[n-1]);if(r>0&&Number.isFinite(r)){const i=Math.max(Math.abs(e[n]),Math.abs(e[n-1]));t=Math.max(t,Math.ceil(Math.log10(i/r))+1)}}const n=Math.min(17,t);return e=>Number.isInteger(e)?String(e):String(Number(e.toPrecision(n)))}function Xn(...e){let t;for(const n of e)n&&(t=Zn(t)&&Zn(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function Zn(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function Kn(e){return"object"==typeof e&&null!==e&&"gradient"in e}function Qn(e,t,n,r,i=8){const o="left"===r||"right"===r,a=r,s="left"===r?"right":"right"===r?"left":"top"===r?"bottom":"top",l=Math.max(0,(o?n[0]:n[1])-i),c=Math.max(t[a],l-e[s]);e[a]>c&&(e[a]=c)}function Jn(e){return Math.ceil(7*e.length)}function er(e,t){if(Zn(e)){const n=cr(t);let r=100;for(const t of e.legendGroups){t.label&&(r=Math.max(r,Jn(t.label)));for(const e of t.items)r=Math.max(r,n.swatchSize+n.labelGap+Jn(e.label))}return r}if(Kn(e)){const{gradient:t}=e,n=t.format||Un(t.domain),r=Math.max(Jn(n(t.domain[0])),Jn(n(t.domain[1]))),i=t.label?Jn(t.label):0;return Math.max(100,19+r,i)}return 100}function tr(e){return(Zn(e)||Kn(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function nr(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?zf:Tf:0}function rr(e){return Math.max(0,e?.edgeGutter??3)}function ir(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?64:46:22:0}function or(e,t,n){if(Kn(e))return e.gradient.label?46:26;if(!Zn(e))return 20;const r=cr(n),i=Math.max(1,n?.maxWidth??t);let o=r.rowHeight;for(const t of e.legendGroups){let e=0,n=0;for(const o of t.items){const t=r.swatchSize+r.labelGap+Jn(o.label),a=0===n?t:n+r.itemGap+t;n>0&&a>i?(e+=1,n=t):n=a}t.items.length>0&&(e+=1),o=Math.max(o,e*r.rowHeight,t.label?Jn(t.label):0)}return o+(e.legendGroups.length>1?16:0)}function ar(e,t,n){return er(e,t)+tr(e)+nr(t,n)+rr(t)}function sr(e,t){const{legend:n}=t;if(!n)return;const r=t.position??"right",i=or(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+tr(n)+ir("bottom"===r?t.axisChrome:"top"===r?t.axisChrome?.topAxis:void 0,t.legendLayout)+("top"===r&&t.hasTitle?24:0),o=Math.max(t.minimumMargin??0,"top"===r?t.hasTitle?58:34:0);"right"===r?e.right=Math.max(e.right,o,ar(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===r?e.left=Math.max(e.left,o,ar(n,t.legendLayout,t.axisChrome?.leftAxis)):"top"===r?e.top=Math.max(e.top,o,i):e.bottom=Math.max(e.bottom,o,i)}function lr(e,t){const n=t.position??"right",r="top"===n||"bottom"===n,i=Math.max(0,t.totalWidth-t.margin.left-t.margin.right),o=Math.max(1,r?t.legendLayout?.maxWidth??i:t.reservedWidth??er(e,t.legendLayout)),a=tr(e),s=nr(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),l=rr(t.legendLayout),c=or(e,i,t.legendLayout),u=ir(t.axisChrome,t.legendLayout),d=ir(t.axisChrome?.topAxis,t.legendLayout);if("left"===n)return{x:Math.max(l,t.margin.left-s-o-a),y:t.margin.top,width:o,height:c};if("top"===n)return{x:t.margin.left,y:t.margin.top-d-a-c,width:o,height:c};if("bottom"===n){const e=t.totalHeight-t.margin.bottom;return{x:t.margin.left,y:Math.max(e+a,Math.min(e+u+a,t.totalHeight-c)),width:o,height:c}}return{x:Math.min(t.totalWidth-o-l,t.totalWidth-t.margin.right+s+a),y:t.margin.top,width:o,height:c}}function cr(e){const t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function ur(e,t){let n=24;return e.map(({hasLabel:e,itemCount:r})=>{n+=5;const i=n;let o;n+=8,e&&(n+=16,o=n,n+=8);const a=n;return n+=r*t+8,{lineY:i,labelY:o,itemsY:a,endY:n}})}function dr(e,t,n=!1){const r={...e};for(const e of t??[])!1!==e.visible||"top"===e.orient&&n||(r[e.orient]=0);return r}function hr(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function fr(e){const t=zn(),n=(0,bf.useRef)(t);n.current=t;const[r,i]=Dn(e.sizeProp,e.responsiveWidth,e.responsiveHeight),o=i[0],a=i[1],s=(0,bf.useMemo)(()=>[o,a],[o,a]),l=Boolean(e.title),c=(0,bf.useMemo)(()=>{const t=Yn({...e.marginDefault,...e.userMargin},l);if(e.legend&&!e.legendMarginReserved){const n={...t},r=e.legendPosition??"right";sr(t,{legend:e.legend,position:r,size:s,hasTitle:l,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),Qn(t,n,s,r)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,l,s]),u=Math.max(1,i[0]-c.left-c.right),d=Math.max(1,i[1]-c.top-c.bottom),h=hr(e.foregroundGraphics,i,c),f=hr(e.backgroundGraphics,i,c),p=(0,xf.useThemeSelector)(e=>e.theme),{transition:m,introEnabled:g}=xt(e.animate,e.transitionProp),y=`semiotic-table-${vf.useId()}`,v=(0,bf.useRef)(null);if(!v.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;v.current=new If({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const b=v.current;b.configure({clock:e.clock,random:e.random,seed:e.seed});const x=(0,bf.useRef)(null),w=(0,bf.useRef)(e.frameScheduler??Df);w.current=e.frameScheduler??Df;const k=(0,bf.useRef)(null),S=(0,bf.useRef)(!1),M=(0,bf.useRef)(()=>{}),j=(0,bf.useCallback)(()=>{if(null!==x.current||S.current)return;const e=w.current;let t=!1,n=!1;const r=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(S.current=!0),x.current=null,k.current=null;try{M.current()}finally{e&&(S.current=!1)}});n=!0,t||(x.current=r,k.current=e)},[]),A=(0,bf.useCallback)(()=>{null!==x.current&&((k.current??w.current).cancelAnimationFrame(x.current),x.current=null,k.current=null)},[]);$f(()=>{b.setPaused(!0===e.paused)},[b,e.paused]),(0,bf.useEffect)(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void b.setVisible(!0);const t=()=>b.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[b,e.suspendWhenHidden]),(0,bf.useEffect)(()=>()=>{A()},[A]);const C=(0,bf.useRef)(()=>{}),R=(0,bf.useRef)(()=>{}),L=(0,bf.useRef)({inside:!1,clientX:0,clientY:0,pointerType:void 0}),P=(0,bf.useRef)(null),N=(0,bf.useRef)(null),E=(0,bf.useRef)(null),I=(0,bf.useCallback)(()=>{const e=P.current;P.current=null,e&&C.current(e)},[]),T=(0,bf.useCallback)(e=>{const t=L.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,P.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===N.current){const e=w.current;let t=!1;const n=e.requestAnimationFrame(()=>{t=!0,N.current=null,E.current=null,I()});t||(N.current=n,E.current=e)}},[I]),z=(0,bf.useCallback)(()=>{null!==N.current&&((E.current??w.current).cancelAnimationFrame(N.current),N.current=null,E.current=null),I()},[I]),$=(0,bf.useCallback)(()=>{L.current.inside=!1,P.current=null,z(),R.current()},[z]);(0,bf.useEffect)(()=>()=>{P.current=null,null!==N.current&&((E.current??w.current).cancelAnimationFrame(N.current),N.current=null,E.current=null)},[]);const D=e.themeDirtyRef,_=(0,bf.useRef)(!1);return $f(()=>{if(!D)return;const t=!_.current;_.current=!0,t&&e.skipInitialThemeInvalidation||(jf++,D.current=!0,j())},[p,e.skipInitialThemeInvalidation,j,D]),(0,bf.useEffect)(()=>{if(D)return Wn(()=>r.current,()=>{D.current=!0,j()})},[r,j,D]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:r,size:i,margin:c,adjustedWidth:u,adjustedHeight:d,resolvedForeground:h,resolvedBackground:f,currentTheme:p,transition:m,introEnabled:g,tableId:y,frameRuntime:b,rafRef:x,renderFnRef:M,scheduleRender:j,cancelRender:A,hoverHandlerRef:C,hoverLeaveRef:R,onPointerMove:T,flushPointerMove:z,onPointerLeave:$,pointerStateRef:L}}function pr(e,t,n,r){(0,_f.useEffect)(()=>{e.current?.updateConfig(t),n.current=!0,r()},[t,r,e,n])}function mr(e,t,n,r){const i=(0,_f.useRef)(null);(0,_f.useEffect)(()=>{const o=e.current;if(!o)return;const a=t??null;i.current!==a&&(i.current=a,o.setLayoutSelection(a),o.hasCustomRestyle?o.restyleScene(a):n.current=!0,r())},[t,r,e,n])}function gr(e){if(!e?.colors)return;const t=e.colors;return{primary:t.primary,secondary:t.secondary||t.primary,surface:t.surface||t.background,success:t.success,danger:t.danger,warning:t.warning,error:t.error,info:t.info,text:t.text,textSecondary:t.textSecondary,border:t.border,grid:t.grid}}function yr(e,t){const n=e?.state??(e?.settling?"settling":void 0);if("live"===n)return Bf;if("stopped"===n||"failed"===n||"stale"===n)return{alpha:e?.dimOpacity??.5,band:"stale",isStale:!0};if("settling"===n)return{alpha:.85,band:"aging",isStale:!1};if(!(e&&t>0))return Bf;const r=null!=e.threshold&&e.threshold>0?e.threshold:5e3,i=e.graded;if(i){const e="object"==typeof i?i:{},n=wt(t,r,e.thresholds);return{alpha:{...Of,...e.opacities??{}}[n],band:n,isStale:"fresh"!==n}}return t>r?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:Bf}function vr(e,t,n,r,i,o,a){const s=(0,Ff.useRef)("fresh");(0,Ff.useEffect)(()=>{if(!e)return void(s.current="fresh");const l=setInterval(()=>{const l=t.current;if(!l||0===l.lastIngestTime)return;const c=yr(e,i()-l.lastIngestTime);c.band===s.current&&c.isStale===o||(s.current=c.band,c.isStale!==o&&a(c.isStale),n.current=!0,r())},1e3);return()=>clearInterval(l)},[e,o,r,i,t,a,n])}function br(e,t,n){return t||(n?"settling":e?"stale":"live")}function xr({isStale:e,position:t,state:n,settling:r}){const i=br(e,n,r),o=Hf[i]??Hf.live,a=Object.hasOwn(Hf,i)?i.toUpperCase():"LIVE";/* @__PURE__ */ /* @__PURE__ */
19
+ return(0,Wf.jsx)("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===t?{top:4,left:4}:"bottom-left"===t?{bottom:4,left:4}:"bottom-right"===t?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:o,color:"white"},children:a})}function wr(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:String(n)}function kr(e){const t=(0,Gf.useObservationSelector)(e=>e.pushObservation),n=qf.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return qf.useMemo(()=>({...e,onObservation:n}),[n,e])}function Sr(e){const t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}function Mr(e,t={}){const n=wr(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(r){const i=Sr(r);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:i}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:i,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function jr(e){return"string"==typeof e&&e.includes("var(")}function Ar(e){const t=Yf.exec(e);if(!t)return jr(e)?void 0:e;const n=t[1]?.trim();return n?Ar(n):void 0}function Cr(e,t){return String(e).length*t*.6}function Rr(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 Lr(e){const{x:t,y:n,text:r,fill:i,fontSize:o=12,fontWeight:a,fontFamily:s,textAnchor:l="start",dominantBaseline:c,background:u,className:d}=e,h=Rr(u),f=e=>/* @__PURE__ */ /* @__PURE__ */(0,Uf.jsx)("text",{x:t,y:n,textAnchor:l,dominantBaseline:c,fill:i,fontSize:o,fontWeight:a,fontFamily:s,className:d,...e?{style:{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}}:{},children:r});if(!h)return f();if("halo"===h.type)return f({stroke:h.fill??Xf,strokeWidth:h.haloWidth??3});const p=h.padding??{x:6,y:3},m="number"==typeof p?p:p.x,g="number"==typeof p?p:p.y,y=Cr(r,o),v=y+2*m,b=o+2*g;let x,w;x="middle"===l?t-y/2-m:"end"===l?t-y-m:t-m,w="middle"===c||"central"===c?n-b/2:"hanging"===c||"text-before-edge"===c?n-g:n-.8*o-g;const k=h.fill??Xf,S={};return jr(k)&&(S.fill=k),jr(h.stroke)&&(S.stroke=h.stroke),/* @__PURE__ */ /* @__PURE__ */(0,Uf.jsxs)("g",{className:d,children:[
20
20
  /* @__PURE__ */
21
- /* @__PURE__ */(0,qf.jsx)("rect",{x:x,y:w,width:b,height:v,rx:h.radius??3,ry:h.radius??3,fill:jr(k)?Ar(k):k,fillOpacity:h.opacity??.85,stroke:jr(h.stroke)?Ar(h.stroke):h.stroke,strokeWidth:h.strokeWidth,...S.fill||S.stroke?{style:S}:{}}),f()]})}function Pr(e,t,n){if(!e)return null;const r="object"==typeof e?e:{};/* @__PURE__ */ /* @__PURE__ */
22
- return(0,Vf.jsx)("circle",{className:"semiotic-threshold-end-cap",cx:t[0],cy:t[1],r:Math.max(0,r.radius??4),fill:r.fill??n})}function Nr({ann:e,position:t,vertical:n,width:r,height:i,color:o,fontSize:a=12,fontFamily:s,bold:l,background:c,dash:u="6,3",labelGap:d=4}){const h=e.labelPosition,f=t>.6*r,p=n?t+(f?-4:4):"left"===h?4:"center"===h?r/2:r-4,m=n?"bottom"===h?i-4:"center"===h?i/2:16:t<20?Math.min(i-4,t+16):t-d,g=n?f?"end":"start":"left"===h?"start":"center"===h?"middle":"end",y=n?[t,0]:[0,t],b=n?[t,i]:[r,t];/* @__PURE__ */ /* @__PURE__ */
23
- return(0,Yf.jsxs)("g",{opacity:e.opacity,children:[
21
+ /* @__PURE__ */(0,Uf.jsx)("rect",{x:x,y:w,width:v,height:b,rx:h.radius??3,ry:h.radius??3,fill:jr(k)?Ar(k):k,fillOpacity:h.opacity??.85,stroke:jr(h.stroke)?Ar(h.stroke):h.stroke,strokeWidth:h.strokeWidth,...S.fill||S.stroke?{style:S}:{}}),f()]})}function Pr(e,t,n){if(!e)return null;const r="object"==typeof e?e:{};/* @__PURE__ */ /* @__PURE__ */
22
+ return(0,Zf.jsx)("circle",{className:"semiotic-threshold-end-cap",cx:t[0],cy:t[1],r:Math.max(0,r.radius??4),fill:r.fill??n})}function Nr({ann:e,position:t,vertical:n,width:r,height:i,color:o,fontSize:a=12,fontFamily:s,bold:l,background:c,dash:u="6,3",labelGap:d=4}){const h=e.labelPosition,f=t>.6*r,p=n?t+(f?-4:4):"left"===h?4:"center"===h?r/2:r-4,m=n?"bottom"===h?i-4:"center"===h?i/2:16:t<20?Math.min(i-4,t+16):t-d,g=n?f?"end":"start":"left"===h?"start":"center"===h?"middle":"end",y=n?[t,0]:[0,t],v=n?[t,i]:[r,t];/* @__PURE__ */ /* @__PURE__ */
23
+ return(0,Kf.jsxs)("g",{opacity:e.opacity,children:[
24
24
  /* @__PURE__ */
25
- /* @__PURE__ */(0,Yf.jsx)("line",{x1:y[0],y1:y[1],x2:b[0],y2:b[1],stroke:o,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||u}),Pr(e.endCap,y,o),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Yf.jsx)(Lr,{x:p,y:m,text:e.label,textAnchor:g,fill:e.labelColor??o,fontSize:a,fontFamily:s,fontWeight:l?"bold":void 0,background:c??e.labelBackground??"halo"})]})}function Er(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 Ir(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function Tr(e,t,n){if(!e)return[];const r=Math.max(1,Math.floor(t/n)),i=[];let o="";for(const t of e.split(/\s+/))t&&(o&&o.length+1+t.length>r?(i.push(o),o=t):o=o?`${o} ${t}`:t);return o&&i.push(o),i}function zr(e,t,n,r){return"curly"===e?r?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:r?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function $r(e,t,n,r){if(!e)/* @__PURE__ */ /* @__PURE__ */return(0,Xf.jsx)("g",{className:"annotation-note"});const{label:i,title:o,orientation:a,align:s,wrap:l=120,noWrap:c}=e;if(!i&&!o)/* @__PURE__ */ /* @__PURE__ */return(0,Xf.jsx)("g",{className:"annotation-note"});let u=a;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");const d="topBottom"===u,h="leftRight"===u;let f=s;f&&"dynamic"!==f||(f=d?t>=0?"left":"right":n>=0?"top":"bottom");let p="start";d?"right"===f?p="end":"middle"===f&&(p="middle"):p=t>=0?"start":"end";const m=e.useHTML||e.html,g=m?void 0:Ir(e),y=g?.lineHeight??16,b=g?.titleLines??(o?c?[o]:Tr(o,l,8):[]),v=g?.labelLines??(i?c?[i]:Tr(i,l,8):[]),x=b.length+v.length,w=h?"end"===p?-4:4:0,k=[],S=r||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";if(m){const e=l,t=Math.max(y,x*y+(o&&i?2:0)),n="end"===p?w-e:"middle"===p?w-e/2:w,r="end"===p?"right":"middle"===p?"center":"left";k.push(
25
+ /* @__PURE__ */(0,Kf.jsx)("line",{x1:y[0],y1:y[1],x2:v[0],y2:v[1],stroke:o,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||u}),Pr(e.endCap,y,o),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Kf.jsx)(Lr,{x:p,y:m,text:e.label,textAnchor:g,fill:e.labelColor??o,fontSize:a,fontFamily:s,fontWeight:l?"bold":void 0,background:c??e.labelBackground??"halo"})]})}function Er(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 Ir(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function Tr(e,t,n){if(!e)return[];const r=Math.max(1,Math.floor(t/n)),i=[];let o="";for(const t of e.split(/\s+/))t&&(o&&o.length+1+t.length>r?(i.push(o),o=t):o=o?`${o} ${t}`:t);return o&&i.push(o),i}function zr(e,t,n,r){return"curly"===e?r?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:r?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function $r(e,t,n,r){if(!e)/* @__PURE__ */ /* @__PURE__ */return(0,Jf.jsx)("g",{className:"annotation-note"});const{label:i,title:o,orientation:a,align:s,wrap:l=120,noWrap:c}=e;if(!i&&!o)/* @__PURE__ */ /* @__PURE__ */return(0,Jf.jsx)("g",{className:"annotation-note"});let u=a;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");const d="topBottom"===u,h="leftRight"===u;let f=s;f&&"dynamic"!==f||(f=d?t>=0?"left":"right":n>=0?"top":"bottom");let p="start";d?"right"===f?p="end":"middle"===f&&(p="middle"):p=t>=0?"start":"end";const m=e.useHTML||e.html,g=m?void 0:Ir(e),y=g?.lineHeight??16,v=g?.titleLines??(o?c?[o]:Tr(o,l,8):[]),b=g?.labelLines??(i?c?[i]:Tr(i,l,8):[]),x=v.length+b.length,w=h?"end"===p?-4:4:0,k=[],S=r||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";if(m){const e=l,t=Math.max(y,x*y+(o&&i?2:0)),n="end"===p?w-e:"middle"===p?w-e/2:w,r="end"===p?"right":"middle"===p?"center":"left";k.push(
26
26
  /* @__PURE__ */
27
- /* @__PURE__ */(0,Xf.jsx)("foreignObject",{className:"annotation-note-html",x:n,y:-y,width:e,height:t+y,style:{overflow:"visible"},children:/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsxs)("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:S,fontSize:"12px",lineHeight:`${y}px`,overflow:"visible",textAlign:r,whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[o&&/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:o}),i&&/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("div",{className:"annotation-note-label",children:i})]})},"annotation-note-html"))}else for(const e of[!0,!1]){const t=e?b:v;if(0===t.length)continue;const n="annotation-note-"+(e?"title":"label");k.push(
27
+ /* @__PURE__ */(0,Jf.jsx)("foreignObject",{className:"annotation-note-html",x:n,y:-y,width:e,height:t+y,style:{overflow:"visible"},children:/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsxs)("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:S,fontSize:"12px",lineHeight:`${y}px`,overflow:"visible",textAlign:r,whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[o&&/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:o}),i&&/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("div",{className:"annotation-note-label",children:i})]})},"annotation-note-html"))}else for(const e of[!0,!1]){const t=e?v:b;if(0===t.length)continue;const n="annotation-note-"+(e?"title":"label");k.push(
28
28
  /* @__PURE__ */
29
- /* @__PURE__ */(0,Xf.jsx)("text",{className:n,fill:S,textAnchor:p,fontWeight:e?g?.titleFontWeight??"bold":void 0,y:e?void 0:b.length*y,children:t.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("tspan",{x:w,dy:0===t?0:y,children:e},t))},n))}let M=null;if((o||i)&&(0!==t||0!==n)){const e=d?g?g.width:Math.min(l,120):(b.length+v.length+(v.length>0?1:0))*y,t=d?p:f,n="end"===t||"bottom"===t?-e:"middle"===t?-e/2:0;M=/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("line",{className:"note-line",x1:d?n:0,x2:d?n+e:0,y1:d?0:n,y2:d?0:n+e,stroke:r||"var(--semiotic-text-secondary, currentColor)"})}const j=Math.max(0,x-1)*y,A=v.length>0&&b.length>0?2:0;let C=0;(d||h)&&(C=h&&"middle"===f?-(j+y+A)/2+y/2:n<0||h&&"bottom"===f?-(j+2):2+y);const R=0!==C?`translate(0,${C})`:void 0;/* @__PURE__ */ /* @__PURE__ */
30
- return(0,Xf.jsxs)("g",{className:"annotation-note",transform:`translate(${t},${n})`,...g?.textProps,children:[
29
+ /* @__PURE__ */(0,Jf.jsx)("text",{className:n,fill:S,textAnchor:p,fontWeight:e?g?.titleFontWeight??"bold":void 0,y:e?void 0:v.length*y,children:t.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("tspan",{x:w,dy:0===t?0:y,children:e},t))},n))}let M=null;if((o||i)&&(0!==t||0!==n)){const e=d?g?g.width:Math.min(l,120):(v.length+b.length+(b.length>0?1:0))*y,t=d?p:f,n="end"===t||"bottom"===t?-e:"middle"===t?-e/2:0;M=/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("line",{className:"note-line",x1:d?n:0,x2:d?n+e:0,y1:d?0:n,y2:d?0:n+e,stroke:r||"var(--semiotic-text-secondary, currentColor)"})}const j=Math.max(0,x-1)*y,A=b.length>0&&v.length>0?2:0;let C=0;(d||h)&&(C=h&&"middle"===f?-(j+y+A)/2+y/2:n<0||h&&"bottom"===f?-(j+2):2+y);const R=0!==C?`translate(0,${C})`:void 0;/* @__PURE__ */ /* @__PURE__ */
30
+ return(0,Jf.jsxs)("g",{className:"annotation-note",transform:`translate(${t},${n})`,...g?.textProps,children:[
31
31
  /* @__PURE__ */
32
- /* @__PURE__ */(0,Xf.jsx)("g",{className:"annotation-note-content",transform:R,children:k}),M]})}function Dr(e,t,n,r,i){let o=null;const a=n||"var(--semiotic-text-secondary, currentColor)";switch(e){case"callout-circle":{const e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&(o=/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("circle",{r:e,fill:"none",stroke:a},"subject-circle"));break}case"callout-rect":{const e=t?.width||0,n=t?.height||0;(e>0||n>0)&&(o=/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("rect",{width:e,height:n,fill:"none",stroke:a},"subject-rect"));break}case"callout-custom":o=t?.custom;break;case"xy-threshold":{const e=r||0,n=i||0;let s=0,l=0,c=0,u=0;if(void 0!==t?.x)s=l=(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,s=(t.x1||0)-e,l=(t.x2||0)-e;else if(void 0!==t?.x1||void 0!==t?.x2)s=(t.x1||0)-e,l=(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}o=/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("line",{x1:s,y1:c,x2:l,y2:u,stroke:a,strokeDasharray:"5,5"},"threshold-line");break}case"bracket":{const e=t?.type||"curly",n=t?.width??t?.height,r=t?.depth||30,i=void 0===t?.width;void 0!==n&&(o=/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("path",{d:zr(e,n,r,i),fill:"none",stroke:a},"bracket-path"));break}}/* @__PURE__ */ /* @__PURE__ */
33
- return(0,Xf.jsx)("g",{className:"annotation-subject",children:o})}function _r(e,t,n,r,i,o){let a,s,l=0,c=0;if("callout-circle"!==i&&"label"!==i||!o?.radius){if("callout-rect"===i&&o){const n=o.width||0,r=o.height||0;if(n>0||r>0){const i=n/2,o=r/2,a=e-i,s=t-o;if(0!==a||0!==s){const e=Math.abs(a),t=Math.abs(s),u=n/2,d=r/2,h=e*d>t*u?u/e:d/t;l=i+a*h,c=o+s*h}}}else if("bracket"===i&&o){const e=o.width,t=o.height,n=o.depth||30;void 0!==e?(l=e/2,c=n):void 0!==t&&(l=n,c=t/2)}}else{const n=(o.radius||0)+(o.radiusPadding||0);if(n>0&&(0!==e||0!==t)){const r=Math.atan2(t,e);l=Math.cos(r)*n,c=Math.sin(r)*n}}const u=e-l,d=t-c,h=Math.hypot(u,d);if(h>.5){const i=r||"var(--semiotic-text-secondary, currentColor)",o="curve"===n?.type;let f=Math.atan2(d,u);if(o){const r=(l+e)/2,o=(c+t)/2,s=-d/h,p=u/h,m=(n?.curve??.25)*h,g=r+s*m,y=o+p*m;a=/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("path",{className:"connector-curve",d:`M${l},${c}Q${g},${y} ${e},${t}`,fill:"none",stroke:i},"connector-line"),f=Math.atan2(y-c,g-l)}else a=/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("line",{x1:l,y1:c,x2:e,y2:t,stroke:i},"connector-line");if("arrow"===n?.end){const e=10,t=16/180*Math.PI,n=l+e*Math.cos(f+t),r=c+e*Math.sin(f+t),o=l+e*Math.cos(f-t),a=c+e*Math.sin(f-t);s=/* @__PURE__ */ /* @__PURE__ */(0,Xf.jsx)("path",{d:`M${l},${c}L${n},${r}L${o},${a}Z`,fill:i,stroke:"none"},"connector-arrow")}}/* @__PURE__ */ /* @__PURE__ */
34
- return(0,Xf.jsxs)("g",{className:"annotation-connector",children:[a,s]})}function Fr(e){const{x:t=0,y:n=0,dx:r,dy:i,nx:o,ny:a,note:s,connector:l,subject:c,type:u,color:d,className:h,disable:f,opacity:p,strokeDasharray:m,events:g={},"data-testid":y}=e,b=Array.isArray(t)?t[0]??0:t,v=Array.isArray(n)?n[0]??0:n,x=Array.isArray(f)?f:[];let w=r||0,k=i||0;null!=o&&(w=o-b),null!=a&&(k=a-v);const S="string"==typeof u?u:"label";if("bracket"===S&&c&&0===w&&0===k)if(void 0!==c.width){w=c.width/2;const e=c.depth||30;k=e+(e>=0?5:-5)}else if(void 0!==c.height){const e=c.depth||30;w=e+(e>=0?5:-5),k=c.height/2}/* @__PURE__ */ /* @__PURE__ */
35
- return(0,Xf.jsxs)("g",{className:`annotation ${h||""}`.trim(),transform:`translate(${b},${v})`,"data-testid":y,...null!=p&&{opacity:p},...m&&{strokeDasharray:m},...g,children:[!x.includes("connector")&&_r(w,k,l,d,S,c),!x.includes("subject")&&Dr(S,c,d,b,v),!x.includes("note")&&$r(s,w,k,d)]})}function Or(e){const{noteData:t}=e,{screenCoordinates:n}=t,r="string"==typeof t.type?t.type:"label",i=t.eventListeners||t.events||{};if(t.coordinates&&n){const e=t.nx||n[0][0]+(t.dx??0),i=t.ny||n[0][1]+(t.dy??0),o=n.map((n,o)=>{const a=Object.assign({},t,{note:0===o?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:i});/* @__PURE__ */ /* @__PURE__ */
36
- return(0,Xf.jsx)(Fr,{"data-testid":"semiotic-annotation",...a,type:r},`multi-annotation-${o}`)});/* @__PURE__ */ /* @__PURE__ */
37
- return(0,Xf.jsx)("g",{children:o})}const o=t.note||{title:"none",label:t.label},a=`${o.label}-${o.title}-${t.i}`;/* @__PURE__ */ /* @__PURE__ */
38
- return(0,Xf.jsx)(Fr,{"data-testid":"semiotic-annotation",events:i,...t,type:r},a)}function Br(e){return e instanceof Date&&(e=e.getTime()),"string"==typeof e&&""!==e.trim()&&(e=Number(e)),"number"==typeof e&&Number.isFinite(e)?e:null}function Wr(e){const t=[];for(const[n,r]of e){const e=Br(n),i=Br(r);null!==e&&null!==i&&t.push([e,i])}return t.sort((e,t)=>e[0]-t[0])}function Hr(){return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN}}function qr(e){const t=Wr(e);if(!t.length)return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN};const n=t[0][0],r=t.reduce((e,[r])=>e+(r-n)/t.length,0),i=t.reduce((e,[,n])=>e+n/t.length,0);let o=0,a=0;for(const[e,s]of t){const t=e-n-r;o+=t*t,a+=t*(s-i)}const s=0===o?0:a/o,l=e=>i+s*(e-n-r);return{points:t.map(([e])=>[e,l(e)]),parameterCount:2,leverage:e=>1/t.length+(o>0?(e-n-r)**2/o:0),predict:l}}function Gr(e,t=2){const n=Wr(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN};const r=n[0][0]/2+n[n.length-1][0]/2,i=Math.max(Math.abs(n[0][0]-r),Math.abs(n[n.length-1][0]-r))||1,o=n.map(([e])=>(e-r)/i),a=[],s=Array.from({length:t+1},()=>Array(t+1).fill(0));for(let e=0;e<=t;e++){const t=o.map(t=>t**e);for(let n=0;n<2;n++)for(let n=0;n<e;n++){const r=t.reduce((e,t,r)=>e+t*a[n][r],0);s[n][e]+=r;for(let e=0;e<t.length;e++)t[e]-=r*a[n][e]}const r=Math.sqrt(t.reduce((e,t)=>e+t*t,0));if(!Number.isFinite(r)||r<=Number.EPSILON*n.length)return Hr();s[e][e]=r,a.push(t.map(e=>e/r))}const l=a.map(e=>e.reduce((e,t,r)=>e+t*n[r][1],0));for(let e=t;e>=0;e--){for(let n=e+1;n<=t;n++)l[e]-=s[e][n]*l[n];l[e]/=s[e][e]}const c=e=>{const n=(e-r)/i;let o=0;for(let e=t;e>=0;e--)o=o*n+l[e];return o};return{points:n.map(([e])=>[e,c(e)]),parameterCount:t+1,predict:c,leverage:e=>{const n=(e-r)/i,o=[];for(let e=0;e<=t;e++){let t=n**e;for(let n=0;n<e;n++)t-=s[n][e]*o[n];o.push(t/s[e][e])}return o.reduce((e,t)=>e+t*t,0)}}}function Vr(e,t,n=2){const r=e.length,i=e.reduce((e,[n,r])=>e+(r-t(n))**2,0);return{se:Math.sqrt(i/Math.max(r-n,1))}}function Yr(e,t=.3){if(!Number.isFinite(t)||t<0||t>1)return[];const n=Wr(e),r=n.length;if(r<2)return n;const i=n.map(e=>e[0]),o=n.map(e=>e[1]);let a=0,s=Math.min(r,Math.max(2,Math.ceil(t*r)))-1;const l=[];for(let e=0;e<r;e++){const t=i[e];let n=0,c=r-1;for(;s<r-1&&Math.abs(i[s+1]-t)<=Math.abs(i[a]-t);)a++,s++;const u=Math.max(Math.abs(i[a]-t),Math.abs(i[s]-t)),d=u||1;u>0&&(n=a,c=s);let h=0,f=0,p=0,m=0,g=0;for(let e=n;e<=c;e++){const n=Math.abs(i[e]-t)/d,r=n<1?Math.pow(1-Math.pow(n,3),3):0;if(0===r)continue;h+=r;const a=(i[e]-t)/d;f+=r*a,p+=r*o[e],m+=r*a*a,g+=r*a*o[e]}if(0===h){l.push([t,o[e]]);continue}const y=h*m-f*f;if(Math.abs(y)<1e-12)l.push([t,p/h]);else{const e=(p-(h*g-f*p)/y*f)/h;l.push([t,e])}}return l}function Ur(e,t=.3){const n=new Map(Yr(e,t));return n.size<2?null:(0,Qf.scaleLinear)().domain([...n.keys()]).range([...n.values()])}function Xr(e,t){if(e.length<3||e[0][0]===e[e.length-1][0])return null;const n="polynomial"===t.method?Gr(e,t.order??2):qr(e);if(!n.points.length)return null;const r="loess"===t.method?Ur(e,t.bandwidth):n.predict;if(!r)return null;const{se:i}=Vr(e,r,n.parameterCount),o=(a=t.confidence??.95)>=.99?2.576:a>=.95?1.96:a>=.9?1.645:1;var a;const s=e[e.length-1][0],l=(s-e[0][0])/(e.length-1);return{predict:r,forecast:(e,t=s)=>!Number.isInteger(e)||e<=0?[]:Array.from({length:e},(e,a)=>{const s=t+(a+1)*l,c=r(s),u=i*o*Math.sqrt(1+n.leverage(s));return{x:s,y:c,upper:c+u,lower:c-u}})}}function Zr(e,t){const n=t.scales?.x??t.scales?.time,r=t.scales?.y??t.scales?.value;if(!n||!r)return[];const i=t.data||[];let o=t.xAccessor||"x",a=t.yAccessor||"y";const s="horizontal"===t.projection,l="ordinal"===t.frameType;l&&s&&([o,a]=[a,o]);const c=n,u=r,d=s?u:c,h=l?t.scales?.o?.domain().map(String)??[...new Set(i.filter(e=>null!=e[o]).map(e=>String(e[o])))].sort((e,t)=>d(e)-d(t)):[],f=new Map(h.map((e,t)=>[e,t])),p=Wr(i.map(e=>[l?null==e[o]?void 0:f.get(String(e[o])):e[o],e[a]]));return p.length<2?[]:("loess"===e.method?Yr(p,e.bandwidth??.3):("polynomial"===e.method?Gr(p,e.order??2):qr(p)).points).map(([e,t])=>{if(!l)return[c(e),u(t)];const n=d(h[e]);return s?[c(t),n]:[n,u(t)]}).filter(([e,t])=>Number.isFinite(e)&&Number.isFinite(t))}function Kr(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function Qr(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function Jr(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],r=e.scales?.x??e.scales?.time,i=e.scales?.y??e.scales?.value;if(!r||!i)return null;const o=e.xAccessor||"x",a=e.yAccessor||"y",s=n[o],l=n[a];return null==s||null==l?null:{x:r(s),y:i(l)}}function ei(e){return null==e?null:String(e)}function ti(e){return ei(e.provenance?.stableId??e.stableId)}function ni(e){return ei(e.stableId??e.id??e.provenance?.stableId)}function ri(e,t,n){return t.stickyPositionCache?.set(e,n),n}function ii(e,t,n){const r=ti(e);if(!r)return null;const i=n.pointNodes?.find(e=>ei(e.pointId)===r);if(i)return ri(t,n,{x:i.x,y:i.y});const o=n.data?.find(e=>ni(e)===r);if(!o)return null;const a=Kr(o,n),s=Qr(o,n);return null==a||null==s?null:ri(t,n,{x:a,y:s})}function oi(e,t,n){const r=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===r){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let r=n.pointNodes.length-1;r>=0;r--){const i=n.pointNodes[r];if(i.pointId===e.pointId)return ri(t,n,{x:i.x,y:i.y})}const r=Jr(n);return r?ri(t,n,r):null}if("semantic"===r){const r=ii(e,t,n);if(r)return r}let i=null,o=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(i=t.x,o=t.y)}if(null!=i&&null!=o||(i=Kr(e,n),o=Qr(e,n)),null!=i&&null!=o)return ri(t,n,{x:i,y:o});if("sticky"===r){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function ai(e,t,n,r=50){const i=n.width||0,o=n.height||0;return e>=-r&&e<=i+r&&t>=-r&&t<=o+r}function si(e,t=2166136261){let n=t;for(let t=0;t<e.length;t++)n^=e.charCodeAt(t),n=Math.imul(n,16777619);return n>>>0}function li(e){const t=Number.isFinite(e)&&e>0?e:6;return{width:Math.max(8,t),height:t,lineY:t/2}}function ci(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,...1!==e.lineOpacity?{lineOpacity:e.lineOpacity}:{}}}function ui(){const e="undefined"!=typeof window&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,e))}function di(e,t,n,r){t&&"transparent"!==t&&"none"!==t?(e.fillStyle=t,e.fillRect(0,0,n,r)):e.clearRect(0,0,n,r)}function hi(e={},t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l={background:n,stroke:r,lineWidth:i,spacing:o,angle:a,lineOpacity:s},c=li(o),u=ui(),d=Math.max(1,Math.round(c.width*u)),h=Math.max(1,Math.round(c.height*u));let f;try{p=d,m=h,f="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(p,m):(Jf||(Jf=document.createElement("canvas")),Jf.width=p,Jf.height=m,Jf)}catch{return ci(l)}var p,m;const g=f.getContext("2d");if(!g)return ci(l);di(g,n,d,h);const y=h/c.height,b=Math.max(0,i)*y;g.save(),g.globalAlpha=Math.min(1,Math.max(0,s)),g.fillStyle=r,g.fillRect(0,c.lineY*y-b/2,d,b),g.restore();const v=(t||g).createPattern(f,"repeat");if(!v)return v;const x=a*Math.PI/180,w=Math.cos(x),k=Math.sin(x),S=c.width/d,M=c.height/h;return v.setTransform?.({a:w*S,b:k*S,c:-k*M,d:w*M,e:0,f:0}),v}function fi(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function pi(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function mi(e,t){return`${e}-hatch-${si(pi(t)).toString(36)}`}function gi(e,t){const n=e.background??"transparent",r=e.stroke??"#000",i="transparent"===n||"none"===n?n:Hn(t,n)||n,o=Hn(t,r)||r||"#000",a="undefined"!=typeof window&&window.devicePixelRatio||1,s=`${pi(e)}|${i}|${o}@${a}`,l=tp.get(s);if(void 0!==l)return l;const c=hi({background:i,stroke:o,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,lineOpacity:e.lineOpacity},t),u=fi(c)?null:c;return tp.set(s,u),u}function yi(e,t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l=li(o);/* @__PURE__ */ /* @__PURE__ */
39
- return(0,ep.jsxs)("pattern",{id:t,width:l.width,height:l.height,patternUnits:"userSpaceOnUse",patternTransform:0!==a?`rotate(${a})`:void 0,children:[n&&"transparent"!==n&&"none"!==n&&/* @__PURE__ */ /* @__PURE__ */(0,ep.jsx)("rect",{width:l.width,height:l.height,fill:n}),
32
+ /* @__PURE__ */(0,Jf.jsx)("g",{className:"annotation-note-content",transform:R,children:k}),M]})}function Dr(e,t,n,r,i){let o=null;const a=n||"var(--semiotic-text-secondary, currentColor)";switch(e){case"callout-circle":{const e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&(o=/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("circle",{r:e,fill:"none",stroke:a},"subject-circle"));break}case"callout-rect":{const e=t?.width||0,n=t?.height||0;(e>0||n>0)&&(o=/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("rect",{width:e,height:n,fill:"none",stroke:a},"subject-rect"));break}case"callout-custom":o=t?.custom;break;case"xy-threshold":{const e=r||0,n=i||0;let s=0,l=0,c=0,u=0;if(void 0!==t?.x)s=l=(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,s=(t.x1||0)-e,l=(t.x2||0)-e;else if(void 0!==t?.x1||void 0!==t?.x2)s=(t.x1||0)-e,l=(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}o=/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("line",{x1:s,y1:c,x2:l,y2:u,stroke:a,strokeDasharray:"5,5"},"threshold-line");break}case"bracket":{const e=t?.type||"curly",n=t?.width??t?.height,r=t?.depth||30,i=void 0===t?.width;void 0!==n&&(o=/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("path",{d:zr(e,n,r,i),fill:"none",stroke:a},"bracket-path"));break}}/* @__PURE__ */ /* @__PURE__ */
33
+ return(0,Jf.jsx)("g",{className:"annotation-subject",children:o})}function _r(e,t,n,r,i,o){let a,s,l=0,c=0;if("callout-circle"!==i&&"label"!==i||!o?.radius){if("callout-rect"===i&&o){const n=o.width||0,r=o.height||0;if(n>0||r>0){const i=n/2,o=r/2,a=e-i,s=t-o;if(0!==a||0!==s){const e=Math.abs(a),t=Math.abs(s),u=n/2,d=r/2,h=e*d>t*u?u/e:d/t;l=i+a*h,c=o+s*h}}}else if("bracket"===i&&o){const e=o.width,t=o.height,n=o.depth||30;void 0!==e?(l=e/2,c=n):void 0!==t&&(l=n,c=t/2)}}else{const n=(o.radius||0)+(o.radiusPadding||0);if(n>0&&(0!==e||0!==t)){const r=Math.atan2(t,e);l=Math.cos(r)*n,c=Math.sin(r)*n}}const u=e-l,d=t-c,h=Math.hypot(u,d);if(h>.5){const i=r||"var(--semiotic-text-secondary, currentColor)",o="curve"===n?.type;let f=Math.atan2(d,u);if(o){const r=(l+e)/2,o=(c+t)/2,s=-d/h,p=u/h,m=(n?.curve??.25)*h,g=r+s*m,y=o+p*m;a=/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("path",{className:"connector-curve",d:`M${l},${c}Q${g},${y} ${e},${t}`,fill:"none",stroke:i},"connector-line"),f=Math.atan2(y-c,g-l)}else a=/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("line",{x1:l,y1:c,x2:e,y2:t,stroke:i},"connector-line");if("arrow"===n?.end){const e=10,t=16/180*Math.PI,n=l+e*Math.cos(f+t),r=c+e*Math.sin(f+t),o=l+e*Math.cos(f-t),a=c+e*Math.sin(f-t);s=/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("path",{d:`M${l},${c}L${n},${r}L${o},${a}Z`,fill:i,stroke:"none"},"connector-arrow")}}/* @__PURE__ */ /* @__PURE__ */
34
+ return(0,Jf.jsxs)("g",{className:"annotation-connector",children:[a,s]})}function Fr(e){const{x:t=0,y:n=0,dx:r,dy:i,nx:o,ny:a,note:s,connector:l,subject:c,type:u,color:d,className:h,disable:f,opacity:p,strokeDasharray:m,events:g={},"data-testid":y}=e,v=Array.isArray(t)?t[0]??0:t,b=Array.isArray(n)?n[0]??0:n,x=Array.isArray(f)?f:[];let w=r||0,k=i||0;null!=o&&(w=o-v),null!=a&&(k=a-b);const S="string"==typeof u?u:"label";if("bracket"===S&&c&&0===w&&0===k)if(void 0!==c.width){w=c.width/2;const e=c.depth||30;k=e+(e>=0?5:-5)}else if(void 0!==c.height){const e=c.depth||30;w=e+(e>=0?5:-5),k=c.height/2}/* @__PURE__ */ /* @__PURE__ */
35
+ return(0,Jf.jsxs)("g",{className:`annotation ${h||""}`.trim(),transform:`translate(${v},${b})`,"data-testid":y,...null!=p&&{opacity:p},...m&&{strokeDasharray:m},...g,children:[!x.includes("connector")&&_r(w,k,l,d,S,c),!x.includes("subject")&&Dr(S,c,d,v,b),!x.includes("note")&&$r(s,w,k,d)]})}function Or(e){const{noteData:t}=e,{screenCoordinates:n}=t,r="string"==typeof t.type?t.type:"label",i=t.eventListeners||t.events||{};if(t.coordinates&&n){const e=t.nx||n[0][0]+(t.dx??0),i=t.ny||n[0][1]+(t.dy??0),o=n.map((n,o)=>{const a=Object.assign({},t,{note:0===o?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:i});/* @__PURE__ */ /* @__PURE__ */
36
+ return(0,Jf.jsx)(Fr,{"data-testid":"semiotic-annotation",...a,type:r},`multi-annotation-${o}`)});/* @__PURE__ */ /* @__PURE__ */
37
+ return(0,Jf.jsx)("g",{children:o})}const o=t.note||{title:"none",label:t.label},a=`${o.label}-${o.title}-${t.i}`;/* @__PURE__ */ /* @__PURE__ */
38
+ return(0,Jf.jsx)(Fr,{"data-testid":"semiotic-annotation",events:i,...t,type:r},a)}function Br(e){return e instanceof Date&&(e=e.getTime()),"string"==typeof e&&""!==e.trim()&&(e=Number(e)),"number"==typeof e&&Number.isFinite(e)?e:null}function Wr(e){const t=[];for(const[n,r]of e){const e=Br(n),i=Br(r);null!==e&&null!==i&&t.push([e,i])}return t.sort((e,t)=>e[0]-t[0])}function Hr(){return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN}}function qr(e){const t=Wr(e);if(!t.length)return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN};const n=t[0][0],r=t.reduce((e,[r])=>e+(r-n)/t.length,0),i=t.reduce((e,[,n])=>e+n/t.length,0);let o=0,a=0;for(const[e,s]of t){const t=e-n-r;o+=t*t,a+=t*(s-i)}const s=0===o?0:a/o,l=e=>i+s*(e-n-r);return{points:t.map(([e])=>[e,l(e)]),parameterCount:2,leverage:e=>1/t.length+(o>0?(e-n-r)**2/o:0),predict:l}}function Gr(e,t=2){const n=Wr(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN};const r=n[0][0]/2+n[n.length-1][0]/2,i=Math.max(Math.abs(n[0][0]-r),Math.abs(n[n.length-1][0]-r))||1,o=n.map(([e])=>(e-r)/i),a=[],s=Array.from({length:t+1},()=>Array(t+1).fill(0));for(let e=0;e<=t;e++){const t=o.map(t=>t**e);for(let n=0;n<2;n++)for(let n=0;n<e;n++){const r=t.reduce((e,t,r)=>e+t*a[n][r],0);s[n][e]+=r;for(let e=0;e<t.length;e++)t[e]-=r*a[n][e]}const r=Math.sqrt(t.reduce((e,t)=>e+t*t,0));if(!Number.isFinite(r)||r<=Number.EPSILON*n.length)return Hr();s[e][e]=r,a.push(t.map(e=>e/r))}const l=a.map(e=>e.reduce((e,t,r)=>e+t*n[r][1],0));for(let e=t;e>=0;e--){for(let n=e+1;n<=t;n++)l[e]-=s[e][n]*l[n];l[e]/=s[e][e]}const c=e=>{const n=(e-r)/i;let o=0;for(let e=t;e>=0;e--)o=o*n+l[e];return o};return{points:n.map(([e])=>[e,c(e)]),parameterCount:t+1,predict:c,leverage:e=>{const n=(e-r)/i,o=[];for(let e=0;e<=t;e++){let t=n**e;for(let n=0;n<e;n++)t-=s[n][e]*o[n];o.push(t/s[e][e])}return o.reduce((e,t)=>e+t*t,0)}}}function Vr(e,t,n=2){const r=e.length,i=e.reduce((e,[n,r])=>e+(r-t(n))**2,0);return{se:Math.sqrt(i/Math.max(r-n,1))}}function Yr(e,t=.3){if(!Number.isFinite(t)||t<0||t>1)return[];const n=Wr(e),r=n.length;if(r<2)return n;const i=n.map(e=>e[0]),o=n.map(e=>e[1]);let a=0,s=Math.min(r,Math.max(2,Math.ceil(t*r)))-1;const l=[];for(let e=0;e<r;e++){const t=i[e];let n=0,c=r-1;for(;s<r-1&&Math.abs(i[s+1]-t)<=Math.abs(i[a]-t);)a++,s++;const u=Math.max(Math.abs(i[a]-t),Math.abs(i[s]-t)),d=u||1;u>0&&(n=a,c=s);let h=0,f=0,p=0,m=0,g=0;for(let e=n;e<=c;e++){const n=Math.abs(i[e]-t)/d,r=n<1?Math.pow(1-Math.pow(n,3),3):0;if(0===r)continue;h+=r;const a=(i[e]-t)/d;f+=r*a,p+=r*o[e],m+=r*a*a,g+=r*a*o[e]}if(0===h){l.push([t,o[e]]);continue}const y=h*m-f*f;if(Math.abs(y)<1e-12)l.push([t,p/h]);else{const e=(p-(h*g-f*p)/y*f)/h;l.push([t,e])}}return l}function Ur(e,t=.3){const n=new Map(Yr(e,t));return n.size<2?null:(0,np.scaleLinear)().domain([...n.keys()]).range([...n.values()])}function Xr(e,t){if(e.length<3||e[0][0]===e[e.length-1][0])return null;const n="polynomial"===t.method?Gr(e,t.order??2):qr(e);if(!n.points.length)return null;const r="loess"===t.method?Ur(e,t.bandwidth):n.predict;if(!r)return null;const{se:i}=Vr(e,r,n.parameterCount),o=(a=t.confidence??.95)>=.99?2.576:a>=.95?1.96:a>=.9?1.645:1;var a;const s=e[e.length-1][0],l=(s-e[0][0])/(e.length-1);return{predict:r,forecast:(e,t=s)=>!Number.isInteger(e)||e<=0?[]:Array.from({length:e},(e,a)=>{const s=t+(a+1)*l,c=r(s),u=i*o*Math.sqrt(1+n.leverage(s));return{x:s,y:c,upper:c+u,lower:c-u}})}}function Zr(e,t){const n=t.scales?.x??t.scales?.time,r=t.scales?.y??t.scales?.value;if(!n||!r)return[];const i=t.data||[];let o=t.xAccessor||"x",a=t.yAccessor||"y";const s="horizontal"===t.projection,l="ordinal"===t.frameType;l&&s&&([o,a]=[a,o]);const c=n,u=r,d=s?u:c,h=l?t.scales?.o?.domain().map(String)??[...new Set(i.filter(e=>null!=e[o]).map(e=>String(e[o])))].sort((e,t)=>d(e)-d(t)):[],f=new Map(h.map((e,t)=>[e,t])),p=Wr(i.map(e=>[l?null==e[o]?void 0:f.get(String(e[o])):e[o],e[a]]));return p.length<2?[]:("loess"===e.method?Yr(p,e.bandwidth??.3):("polynomial"===e.method?Gr(p,e.order??2):qr(p)).points).map(([e,t])=>{if(!l)return[c(e),u(t)];const n=d(h[e]);return s?[c(t),n]:[n,u(t)]}).filter(([e,t])=>Number.isFinite(e)&&Number.isFinite(t))}function Kr(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function Qr(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function Jr(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],r=e.scales?.x??e.scales?.time,i=e.scales?.y??e.scales?.value;if(!r||!i)return null;const o=e.xAccessor||"x",a=e.yAccessor||"y",s=n[o],l=n[a];return null==s||null==l?null:{x:r(s),y:i(l)}}function ei(e){return null==e?null:String(e)}function ti(e){return ei(e.provenance?.stableId??e.stableId)}function ni(e){return ei(e.stableId??e.id??e.provenance?.stableId)}function ri(e,t,n){return t.stickyPositionCache?.set(e,n),n}function ii(e,t,n){const r=ti(e);if(!r)return null;const i=n.pointNodes?.find(e=>ei(e.pointId)===r);if(i)return ri(t,n,{x:i.x,y:i.y});const o=n.data?.find(e=>ni(e)===r);if(!o)return null;const a=Kr(o,n),s=Qr(o,n);return null==a||null==s?null:ri(t,n,{x:a,y:s})}function oi(e,t,n){const r=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===r){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let r=n.pointNodes.length-1;r>=0;r--){const i=n.pointNodes[r];if(i.pointId===e.pointId)return ri(t,n,{x:i.x,y:i.y})}const r=Jr(n);return r?ri(t,n,r):null}if("semantic"===r){const r=ii(e,t,n);if(r)return r}let i=null,o=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(i=t.x,o=t.y)}if(null!=i&&null!=o||(i=Kr(e,n),o=Qr(e,n)),null!=i&&null!=o)return ri(t,n,{x:i,y:o});if("sticky"===r){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function ai(e,t,n,r=50){const i=n.width||0,o=n.height||0;return e>=-r&&e<=i+r&&t>=-r&&t<=o+r}function si(e,t=2166136261){let n=t;for(let t=0;t<e.length;t++)n^=e.charCodeAt(t),n=Math.imul(n,16777619);return n>>>0}function li(e){const t=Number.isFinite(e)&&e>0?e:6;return{width:Math.max(8,t),height:t,lineY:t/2}}function ci(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,...1!==e.lineOpacity?{lineOpacity:e.lineOpacity}:{}}}function ui(){const e="undefined"!=typeof window&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,e))}function di(e,t,n,r){t&&"transparent"!==t&&"none"!==t?(e.fillStyle=t,e.fillRect(0,0,n,r)):e.clearRect(0,0,n,r)}function hi(e={},t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l={background:n,stroke:r,lineWidth:i,spacing:o,angle:a,lineOpacity:s},c=li(o),u=ui(),d=Math.max(1,Math.round(c.width*u)),h=Math.max(1,Math.round(c.height*u));let f;try{p=d,m=h,f="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(p,m):(rp||(rp=document.createElement("canvas")),rp.width=p,rp.height=m,rp)}catch{return ci(l)}var p,m;const g=f.getContext("2d");if(!g)return ci(l);di(g,n,d,h);const y=h/c.height,v=Math.max(0,i)*y;g.save(),g.globalAlpha=Math.min(1,Math.max(0,s)),g.fillStyle=r,g.fillRect(0,c.lineY*y-v/2,d,v),g.restore();const b=(t||g).createPattern(f,"repeat");if(!b)return b;const x=a*Math.PI/180,w=Math.cos(x),k=Math.sin(x),S=c.width/d,M=c.height/h;return b.setTransform?.({a:w*S,b:k*S,c:-k*M,d:w*M,e:0,f:0}),b}function fi(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function pi(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function mi(e,t){return`${e}-hatch-${si(pi(t)).toString(36)}`}function gi(e,t){const n=e.background??"transparent",r=e.stroke??"#000",i="transparent"===n||"none"===n?n:Hn(t,n)||n,o=Hn(t,r)||r||"#000",a="undefined"!=typeof window&&window.devicePixelRatio||1,s=`${pi(e)}|${i}|${o}@${a}`,l=op.get(s);if(void 0!==l)return l;const c=hi({background:i,stroke:o,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,lineOpacity:e.lineOpacity},t),u=fi(c)?null:c;return op.set(s,u),u}function yi(e,t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l=li(o);/* @__PURE__ */ /* @__PURE__ */
39
+ return(0,ip.jsxs)("pattern",{id:t,width:l.width,height:l.height,patternUnits:"userSpaceOnUse",patternTransform:0!==a?`rotate(${a})`:void 0,children:[n&&"transparent"!==n&&"none"!==n&&/* @__PURE__ */ /* @__PURE__ */(0,ip.jsx)("rect",{width:l.width,height:l.height,fill:n}),
40
40
  /* @__PURE__ */
41
- /* @__PURE__ */(0,ep.jsx)("line",{x1:0,y1:l.lineY,x2:l.width,y2:l.lineY,stroke:r,strokeWidth:i,...1!==s?{strokeOpacity:s}:{}})]},t)}function bi(e,t,n="#4e79a7"){if(fi(e)){const n=mi(t,e);return{fill:`url(#${n})`,def:yi(e,n)}}return e&&"string"==typeof e?{fill:e}:{fill:n}}function vi(e,t,n){if(!e||"object"!=typeof e)return;const r=e;if(!Array.isArray(r.stops))return;const i=r.stops.flatMap(e=>{if(!e||"object"!=typeof e)return[];const{offset:t,color:r,opacity:i}=e;return"number"==typeof t&&Number.isFinite(t)?[{offset:Math.max(0,Math.min(1,t)),color:"string"==typeof r&&r?r:n,opacity:"number"==typeof i&&Number.isFinite(i)?Math.max(0,Math.min(1,i)):void 0}]:[]}).sort((e,t)=>e.offset-t.offset);return i.length?{direction:"horizontal"===r.direction?"horizontal":"vertical"===r.direction?"vertical":t,stops:i}:void 0}function xi(e,t,n,r){const i=vi(e,n,r);if(!i)return;const{direction:o,stops:a}=i,s=`${t}-gradient`;return{fill:`url(#${s})`,def:/* @__PURE__ */ /* @__PURE__ */(0,ep.jsx)("linearGradient",{id:s,x1:0,y1:0,x2:"horizontal"===o?"100%":0,y2:"vertical"===o?"100%":0,children:a.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,ep.jsx)("stop",{offset:100*e.offset+"%",stopColor:e.color,stopOpacity:e.opacity},`${e.offset}-${t}`))},s)}}function wi(e,t,n,r){const i=bi(e.fill??e.color,t,r),o="string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:r;return xi(e.gradient,t,n,o)??i}function ki(e,t,n){const r=e.position,i="string"==typeof r&&np.has(r)?r:"bottom-left",o=i.endsWith("left")?"left":i.endsWith("right")?"right":"center",a=i.startsWith("top")?"top":i.startsWith("bottom")?"bottom":"middle",s="top"===a?0:"bottom"===a?n:n/2;return{x:("left"===o?0:"right"===o?t:t/2)+("number"==typeof e.dx&&Number.isFinite(e.dx)?e.dx:0),y:s+("number"==typeof e.dy&&Number.isFinite(e.dy)?e.dy:0),textAnchor:"start"===e.textAnchor||"middle"===e.textAnchor||"end"===e.textAnchor?e.textAnchor:"left"===o?"start":"right"===o?"end":"middle",dominantBaseline:"auto"===e.dominantBaseline||"middle"===e.dominantBaseline||"hanging"===e.dominantBaseline?e.dominantBaseline:"top"===a?"hanging":"bottom"===a?"auto":"middle"}}function Si(e,t,n,r){return{...ki(e,t,n),fill:e.fill??e.color??r.fill,fontSize:e.fontSize??r.fontSize,fontFamily:e.fontFamily??r.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,letterSpacing:e.letterSpacing,opacity:e.opacity,className:e.className,style:{pointerEvents:"none"}}}function Mi({annotation:e,width:t,height:n,defaults:r=ip}){const i=e.label??e.text;return null==i?null:/* @__PURE__ */ /* @__PURE__ */(0,rp.jsx)("text",{...Si(e,t,n,r),children:i})}function ji(e){return!0===e?._annotationDeferred}function Ai(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function Ci(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function Ri(e){return Math.max(.72,.95-.06*e)}function Li(e){const t=e.map((e,t)=>{return{p:e,i:t,emphasis:(n=e.annotation,"primary"===n?.emphasis||"secondary"===n?.emphasis?n.emphasis:null),confidence:Ci(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),r=e.some(e=>ji(e.annotation)),i=e.some(e=>null!=Ai(e.annotation)),o=e.some(e=>"layer"===Ai(e.annotation));if(!n&&!r&&!i)return e.map(e=>e.node);const a=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);a.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,a.length)});for(const e of t)e.emphasis&&(e.rank=ap[e.emphasis]);const s=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{const{p:t,i:n,emphasis:r,readingOrder:i}=e,o=ji(t.annotation);let a=t.node;if("primary"===r||"secondary"===r||null!=i){const e=null==r&&null!=i,o=e?"annotation-emphasis annotation-emphasis--inferred":`annotation-emphasis annotation-emphasis--${r}`;a=/* @__PURE__ */ /* @__PURE__ */(0,op.jsx)("g",{className:o,..."secondary"===r?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:Ri(i),"data-annotation-reading-order":i}:{},children:t.node},`annotation-emphasis-${n}`)}const s=Ai(t.annotation);return s&&(a=/* @__PURE__ */ /* @__PURE__ */(0,op.jsx)("g",{className:`annotation-cohesion--${s}`,children:a},`annotation-cohesion-${n}`)),o&&(a=/* @__PURE__ */ /* @__PURE__ */(0,op.jsx)("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:a},`annotation-deferred-${n}`)),a});return r&&s.unshift(
41
+ /* @__PURE__ */(0,ip.jsx)("line",{x1:0,y1:l.lineY,x2:l.width,y2:l.lineY,stroke:r,strokeWidth:i,...1!==s?{strokeOpacity:s}:{}})]},t)}function vi(e,t,n="#4e79a7"){if(fi(e)){const n=mi(t,e);return{fill:`url(#${n})`,def:yi(e,n)}}return e&&"string"==typeof e?{fill:e}:{fill:n}}function bi(e,t,n){if(!e||"object"!=typeof e)return;const r=e;if(!Array.isArray(r.stops))return;const i=r.stops.flatMap(e=>{if(!e||"object"!=typeof e)return[];const{offset:t,color:r,opacity:i}=e;return"number"==typeof t&&Number.isFinite(t)?[{offset:Math.max(0,Math.min(1,t)),color:"string"==typeof r&&r?r:n,opacity:"number"==typeof i&&Number.isFinite(i)?Math.max(0,Math.min(1,i)):void 0}]:[]}).sort((e,t)=>e.offset-t.offset);return i.length?{direction:"horizontal"===r.direction?"horizontal":"vertical"===r.direction?"vertical":t,stops:i}:void 0}function xi(e,t,n,r){const i=bi(e,n,r);if(!i)return;const{direction:o,stops:a}=i,s=`${t}-gradient`;return{fill:`url(#${s})`,def:/* @__PURE__ */ /* @__PURE__ */(0,ip.jsx)("linearGradient",{id:s,x1:0,y1:0,x2:"horizontal"===o?"100%":0,y2:"vertical"===o?"100%":0,children:a.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,ip.jsx)("stop",{offset:100*e.offset+"%",stopColor:e.color,stopOpacity:e.opacity},`${e.offset}-${t}`))},s)}}function wi(e,t,n,r){const i=vi(e.fill??e.color,t,r),o="string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:r;return xi(e.gradient,t,n,o)??i}function ki(e,t,n){const r=e.position,i="string"==typeof r&&ap.has(r)?r:"bottom-left",o=i.endsWith("left")?"left":i.endsWith("right")?"right":"center",a=i.startsWith("top")?"top":i.startsWith("bottom")?"bottom":"middle",s="top"===a?0:"bottom"===a?n:n/2;return{x:("left"===o?0:"right"===o?t:t/2)+("number"==typeof e.dx&&Number.isFinite(e.dx)?e.dx:0),y:s+("number"==typeof e.dy&&Number.isFinite(e.dy)?e.dy:0),textAnchor:"start"===e.textAnchor||"middle"===e.textAnchor||"end"===e.textAnchor?e.textAnchor:"left"===o?"start":"right"===o?"end":"middle",dominantBaseline:"auto"===e.dominantBaseline||"middle"===e.dominantBaseline||"hanging"===e.dominantBaseline?e.dominantBaseline:"top"===a?"hanging":"bottom"===a?"auto":"middle"}}function Si(e,t,n,r){return{...ki(e,t,n),fill:e.fill??e.color??r.fill,fontSize:e.fontSize??r.fontSize,fontFamily:e.fontFamily??r.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,letterSpacing:e.letterSpacing,opacity:e.opacity,className:e.className,style:{pointerEvents:"none"}}}function Mi({annotation:e,width:t,height:n,defaults:r=lp}){const i=e.label??e.text;return null==i?null:/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("text",{...Si(e,t,n,r),children:i})}function ji(e){return!0===e?._annotationDeferred}function Ai(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function Ci(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function Ri(e){return Math.max(.72,.95-.06*e)}function Li(e){const t=e.map((e,t)=>{return{p:e,i:t,emphasis:(n=e.annotation,"primary"===n?.emphasis||"secondary"===n?.emphasis?n.emphasis:null),confidence:Ci(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),r=e.some(e=>ji(e.annotation)),i=e.some(e=>null!=Ai(e.annotation)),o=e.some(e=>"layer"===Ai(e.annotation));if(!n&&!r&&!i)return e.map(e=>e.node);const a=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);a.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,a.length)});for(const e of t)e.emphasis&&(e.rank=up[e.emphasis]);const s=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{const{p:t,i:n,emphasis:r,readingOrder:i}=e,o=ji(t.annotation);let a=t.node;if("primary"===r||"secondary"===r||null!=i){const e=null==r&&null!=i,o=e?"annotation-emphasis annotation-emphasis--inferred":`annotation-emphasis annotation-emphasis--${r}`;a=/* @__PURE__ */ /* @__PURE__ */(0,cp.jsx)("g",{className:o,..."secondary"===r?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:Ri(i),"data-annotation-reading-order":i}:{},children:t.node},`annotation-emphasis-${n}`)}const s=Ai(t.annotation);return s&&(a=/* @__PURE__ */ /* @__PURE__ */(0,cp.jsx)("g",{className:`annotation-cohesion--${s}`,children:a},`annotation-cohesion-${n}`)),o&&(a=/* @__PURE__ */ /* @__PURE__ */(0,cp.jsx)("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:a},`annotation-deferred-${n}`)),a});return r&&s.unshift(
42
42
  /* @__PURE__ */
43
- /* @__PURE__ */(0,op.jsx)("style",{children:".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}}"},"annotation-disclosure-style")),o&&s.unshift(
43
+ /* @__PURE__ */(0,cp.jsx)("style",{children:".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}}"},"annotation-disclosure-style")),o&&s.unshift(
44
44
  /* @__PURE__ */
45
- /* @__PURE__ */(0,op.jsx)("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),s}function Pi(e,t,n,r){return Ni(e,t,n,r).nodes}function Ni(e,t,n,r){const i=[];return e.forEach((e,o)=>{let a;if(n){const i=n(e,o,r);a=null!=i?i:t(e,o,r)}else a=t(e,o,r);a&&i.push({node:a,annotation:e})}),{nodes:Li(i),renderedAnnotations:i.map(e=>e.annotation)}}function Ei(e,t={},n=!1){return function(e,r,i){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{const t=oi(e,r,i);if(!t)return null;const{x:n,y:o}=t;if(!ai(n,o,i))return null;const a="callout"===e.type?"callout-circle":e.type,s="callout-circle"===a?{radius:e.radius??12,radiusPadding:e.radiusPadding}:"callout-rect"===a?{width:e.width,height:e.height}:void 0;/* @__PURE__ */ /* @__PURE__ */
46
- return(0,sp.jsx)(Or,{noteData:{x:n,y:o,dx:e.dx??30,dy:e.dy??-30,note:Er(e),type:a,...s?{subject:s}:{},connector:e.connector||{end:"arrow"},color:e.color,disable:e.disable,opacity:e.opacity,strokeDasharray:e.strokeDasharray,className:e.className}},`ann-${r}`)}case"x-threshold":case"y-threshold":{const t="x-threshold"===e.type,n=null!=e.value?{...e,[t?"x":"y"]:e.value}:e,o=t?Kr(n,i):Qr(n,i);return null==o?null:/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)(Nr,{ann:e,position:o,vertical:t,width:i.width||0,height:i.height||0,color:e.color||"#f97316",bold:!0},`ann-${r}`)}case"enclose":{const t=(e.coordinates||[]).map(e=>({x:Kr({...e,type:"point"},i),y:Qr({...e,type:"point"},i),r:1})).filter(e=>null!=e.x&&null!=e.y);if(t.length<2)return null;const n=(0,Zf.packEnclose)(t),o=e.padding||10;/* @__PURE__ */ /* @__PURE__ */
47
- return(0,sp.jsxs)("g",{children:[
45
+ /* @__PURE__ */(0,cp.jsx)("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),s}function Pi(e,t,n,r){return Ni(e,t,n,r).nodes}function Ni(e,t,n,r){const i=[];return e.forEach((e,o)=>{let a;if(n){const i=n(e,o,r);a=null!=i?i:t(e,o,r)}else a=t(e,o,r);a&&i.push({node:a,annotation:e})}),{nodes:Li(i),renderedAnnotations:i.map(e=>e.annotation)}}function Ei(e,t={},n=!1){return function(e,r,i){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{const t=oi(e,r,i);if(!t)return null;const{x:n,y:o}=t;if(!ai(n,o,i))return null;const a="callout"===e.type?"callout-circle":e.type,s="callout-circle"===a?{radius:e.radius??12,radiusPadding:e.radiusPadding}:"callout-rect"===a?{width:e.width,height:e.height}:void 0;/* @__PURE__ */ /* @__PURE__ */
46
+ return(0,dp.jsx)(Or,{noteData:{x:n,y:o,dx:e.dx??30,dy:e.dy??-30,note:Er(e),type:a,...s?{subject:s}:{},connector:e.connector||{end:"arrow"},color:e.color,disable:e.disable,opacity:e.opacity,strokeDasharray:e.strokeDasharray,className:e.className}},`ann-${r}`)}case"x-threshold":case"y-threshold":{const t="x-threshold"===e.type,n=null!=e.value?{...e,[t?"x":"y"]:e.value}:e,o=t?Kr(n,i):Qr(n,i);return null==o?null:/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)(Nr,{ann:e,position:o,vertical:t,width:i.width||0,height:i.height||0,color:e.color||"#f97316",bold:!0},`ann-${r}`)}case"enclose":{const t=(e.coordinates||[]).map(e=>({x:Kr({...e,type:"point"},i),y:Qr({...e,type:"point"},i),r:1})).filter(e=>null!=e.x&&null!=e.y);if(t.length<2)return null;const n=(0,ep.packEnclose)(t),o=e.padding||10;/* @__PURE__ */ /* @__PURE__ */
47
+ return(0,dp.jsxs)("g",{children:[
48
48
  /* @__PURE__ */
49
- /* @__PURE__ */(0,sp.jsx)("circle",{cx:n.x,cy:n.y,r:n.r+o,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)(Lr,{x:n.x,y:n.y-n.r-o-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},`ann-${r}`)}case"rect-enclose":{const t=(e.coordinates||[]).map(e=>({x:Kr({...e,type:"point"},i),y:Qr({...e,type:"point"},i)})).filter(e=>null!=e.x&&null!=e.y);if(t.length<2)return null;const n=e.padding||10,o=t.map(e=>e.x),a=t.map(e=>e.y),[s,l]=nn(o),[c,u]=nn(a),d=s-n,h=l+n,f=c-n,p=u+n;/* @__PURE__ */ /* @__PURE__ */
50
- return(0,sp.jsxs)("g",{children:[
49
+ /* @__PURE__ */(0,dp.jsx)("circle",{cx:n.x,cy:n.y,r:n.r+o,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)(Lr,{x:n.x,y:n.y-n.r-o-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},`ann-${r}`)}case"rect-enclose":{const t=(e.coordinates||[]).map(e=>({x:Kr({...e,type:"point"},i),y:Qr({...e,type:"point"},i)})).filter(e=>null!=e.x&&null!=e.y);if(t.length<2)return null;const n=e.padding||10,o=t.map(e=>e.x),a=t.map(e=>e.y),[s,l]=nn(o),[c,u]=nn(a),d=s-n,h=l+n,f=c-n,p=u+n;/* @__PURE__ */ /* @__PURE__ */
50
+ return(0,dp.jsxs)("g",{children:[
51
51
  /* @__PURE__ */
52
- /* @__PURE__ */(0,sp.jsx)("rect",{x:d,y:f,width:h-d,height:p-f,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__ */ /* @__PURE__ */(0,sp.jsx)(Lr,{x:(d+h)/2,y:f-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},`ann-${r}`)}case"highlight":{const t=i.data||[],n="function"==typeof e.filter?t.filter(e.filter):e.field&&null!=e.value?t.filter(t=>t[e.field]===e.value):[],o={stroke:e.color||"#f97316",strokeWidth:2,fill:"none"};/* @__PURE__ */ /* @__PURE__ */
53
- return(0,sp.jsx)("g",{children:n.map((t,n)=>{const r=Kr(t,i),a=Qr(t,i);if(null==r||null==a)return null;const s="function"==typeof e.r?e.r(t):e.r||6,l="function"==typeof e.style?e.style(t):e.style||o;/* @__PURE__ */ /* @__PURE__ */
54
- return(0,sp.jsx)("circle",{cx:r,cy:a,r:s,...l},`hl-${n}`)})},`ann-${r}`)}case"bracket":{const t=Kr(e,i),n=Qr(e,i);/* @__PURE__ */ /* @__PURE__ */
55
- return(0,sp.jsx)(Or,{noteData:{x:t??0,y:n??0,dx:e.dx||0,dy:e.dy||0,note:Er(e),type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth||30},color:e.color}},`ann-${r}`)}case"trend":{const t=Zr(e,i);if(t.length<2)return null;const n=t.map(([e,t])=>`${e},${t}`).join(" "),o=e.color||"#6366f1",[a,s]=t[t.length-1];/* @__PURE__ */ /* @__PURE__ */
56
- return(0,sp.jsxs)("g",{children:[
52
+ /* @__PURE__ */(0,dp.jsx)("rect",{x:d,y:f,width:h-d,height:p-f,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__ */ /* @__PURE__ */(0,dp.jsx)(Lr,{x:(d+h)/2,y:f-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},`ann-${r}`)}case"highlight":{const t=i.data||[],n="function"==typeof e.filter?t.filter(e.filter):e.field&&null!=e.value?t.filter(t=>t[e.field]===e.value):[],o={stroke:e.color||"#f97316",strokeWidth:2,fill:"none"};/* @__PURE__ */ /* @__PURE__ */
53
+ return(0,dp.jsx)("g",{children:n.map((t,n)=>{const r=Kr(t,i),a=Qr(t,i);if(null==r||null==a)return null;const s="function"==typeof e.r?e.r(t):e.r||6,l="function"==typeof e.style?e.style(t):e.style||o;/* @__PURE__ */ /* @__PURE__ */
54
+ return(0,dp.jsx)("circle",{cx:r,cy:a,r:s,...l},`hl-${n}`)})},`ann-${r}`)}case"bracket":{const t=Kr(e,i),n=Qr(e,i);/* @__PURE__ */ /* @__PURE__ */
55
+ return(0,dp.jsx)(Or,{noteData:{x:t??0,y:n??0,dx:e.dx||0,dy:e.dy||0,note:Er(e),type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth||30},color:e.color}},`ann-${r}`)}case"trend":{const t=Zr(e,i);if(t.length<2)return null;const n=t.map(([e,t])=>`${e},${t}`).join(" "),o=e.color||"#6366f1",[a,s]=t[t.length-1];/* @__PURE__ */ /* @__PURE__ */
56
+ return(0,dp.jsxs)("g",{children:[
57
57
  /* @__PURE__ */
58
- /* @__PURE__ */(0,sp.jsx)("polyline",{points:n,fill:"none",stroke:o,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("text",{x:a+4,y:s-4,fill:o,fontSize:11,children:e.label})]},`ann-${r}`)}case"band":{const t=i.scales?.y??i.scales?.value,s=t?.domain?.(),l=e.y0??s?.[0],c=e.y1??s?.[1],u=null!=l&&t?t(l):0,d=null!=c&&t?t(c):i.height||0,h=wi(e,`ann-${r}`,"vertical","var(--semiotic-primary, #6366f1)"),f=n&&"under"===e.layer;/* @__PURE__ */ /* @__PURE__ */
59
- return(0,sp.jsxs)("g",{opacity:e.opacity,children:[!f&&h.def&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("defs",{children:h.def}),!f&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("rect",{x:0,y:Math.min(u,d),width:i.width||0,height:Math.abs(d-u),fill:h.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)(Lr,{x:(i.width||0)-4,y:(o=u,a=d,Math.max(Math.min(o,a),0)+16),textAnchor:"end",fill:e.labelColor??(e.color||"var(--semiotic-primary, #6366f1)"),fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},`ann-${r}`)}case"x-band":{const t=i.scales?.x??i.scales?.time,o=t?.domain?.(),a=e.x0??o?.[0],s=e.x1??o?.[1],l=null!=a&&t?t(a):null,c=null!=s&&t?t(s):null;if(null==l||null==c)return null;const u=wi(e,`ann-${r}`,"horizontal","var(--semiotic-primary, #6366f1)"),d=n&&"under"===e.layer;/* @__PURE__ */ /* @__PURE__ */
60
- return(0,sp.jsxs)("g",{opacity:e.opacity,children:[!d&&u.def&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("defs",{children:u.def}),!d&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("rect",{x:Math.min(l,c),y:0,width:Math.abs(c-l),height:i.height||0,fill:u.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)(Lr,{x:Math.min(l,c)+4,y:16,textAnchor:"start",fill:e.labelColor??(e.color||"var(--semiotic-primary, #6366f1)"),fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},`ann-${r}`)}case"envelope":{const t=i.data||[];if(t.length<2)return null;const n=i.xAccessor||"x",o=i.scales?.x??i.scales?.time,a=i.scales?.y??i.scales?.value;if(!o||!a)return null;const s=e.upperAccessor||"upperBounds",l=e.lowerAccessor||"lowerBounds",c=e.filter,u=t.filter(e=>null!=e[s]&&null!=e[l]&&!(c&&!c(e))).sort((e,t)=>e[n]-t[n]);if(u.length<2)return null;const d=lp[i.curve||"linear"]||Kf.curveLinear,h=(0,Kf.area)().x(e=>o(e[n])).y0(e=>a(e[l])).y1(e=>a(e[s])).curve(d)(u);if(!h)return null;const f=e.fill||"#6366f1";/* @__PURE__ */ /* @__PURE__ */
61
- return(0,sp.jsxs)("g",{children:[
58
+ /* @__PURE__ */(0,dp.jsx)("polyline",{points:n,fill:"none",stroke:o,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("text",{x:a+4,y:s-4,fill:o,fontSize:11,children:e.label})]},`ann-${r}`)}case"band":{const t=i.scales?.y??i.scales?.value,s=t?.domain?.(),l=e.y0??s?.[0],c=e.y1??s?.[1],u=null!=l&&t?t(l):0,d=null!=c&&t?t(c):i.height||0,h=wi(e,`ann-${r}`,"vertical","var(--semiotic-primary, #6366f1)"),f=n&&"under"===e.layer;/* @__PURE__ */ /* @__PURE__ */
59
+ return(0,dp.jsxs)("g",{opacity:e.opacity,children:[!f&&h.def&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("defs",{children:h.def}),!f&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("rect",{x:0,y:Math.min(u,d),width:i.width||0,height:Math.abs(d-u),fill:h.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)(Lr,{x:(i.width||0)-4,y:(o=u,a=d,Math.max(Math.min(o,a),0)+16),textAnchor:"end",fill:e.labelColor??(e.color||"var(--semiotic-primary, #6366f1)"),fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},`ann-${r}`)}case"x-band":{const t=i.scales?.x??i.scales?.time,o=t?.domain?.(),a=e.x0??o?.[0],s=e.x1??o?.[1],l=null!=a&&t?t(a):null,c=null!=s&&t?t(s):null;if(null==l||null==c)return null;const u=wi(e,`ann-${r}`,"horizontal","var(--semiotic-primary, #6366f1)"),d=n&&"under"===e.layer;/* @__PURE__ */ /* @__PURE__ */
60
+ return(0,dp.jsxs)("g",{opacity:e.opacity,children:[!d&&u.def&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("defs",{children:u.def}),!d&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("rect",{x:Math.min(l,c),y:0,width:Math.abs(c-l),height:i.height||0,fill:u.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)(Lr,{x:Math.min(l,c)+4,y:16,textAnchor:"start",fill:e.labelColor??(e.color||"var(--semiotic-primary, #6366f1)"),fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},`ann-${r}`)}case"envelope":{const t=i.data||[];if(t.length<2)return null;const n=i.xAccessor||"x",o=i.scales?.x??i.scales?.time,a=i.scales?.y??i.scales?.value;if(!o||!a)return null;const s=e.upperAccessor||"upperBounds",l=e.lowerAccessor||"lowerBounds",c=e.filter,u=t.filter(e=>null!=e[s]&&null!=e[l]&&!(c&&!c(e))).sort((e,t)=>e[n]-t[n]);if(u.length<2)return null;const d=hp[i.curve||"linear"]||tp.curveLinear,h=(0,tp.area)().x(e=>o(e[n])).y0(e=>a(e[l])).y1(e=>a(e[s])).curve(d)(u);if(!h)return null;const f=e.fill||"#6366f1";/* @__PURE__ */ /* @__PURE__ */
61
+ return(0,dp.jsxs)("g",{children:[
62
62
  /* @__PURE__ */
63
- /* @__PURE__ */(0,sp.jsx)("path",{d:h,fill:f,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&u.length>0&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("text",{x:o(u[u.length-1][n])+4,y:a(u[u.length-1][s])-4,fill:f,fontSize:11,children:e.label})]},`ann-${r}`)}case"anomaly-band":{const t=(i.data||[]).filter(t=>!e.filter||e.filter(t));if(t.length<2)return null;const n=i.yAccessor||"y",o=i.scales?.x??i.scales?.time,a=i.scales?.y??i.scales?.value;if(!o||!a)return null;const s=t.map(e=>Br(e[n])).filter(e=>null!==e);if(s.length<2)return null;const l=s.reduce((e,t)=>e+t,0)/s.length,c=s.reduce((e,t)=>e+(t-l)**2,0)/s.length,u=Math.sqrt(c),d=e.threshold??2,h=l+d*u,f=l-d*u,p=!1!==e.showBand,m=e.fill||"#6366f1",g=e.fillOpacity??.1,y=e.anomalyColor||"#ef4444",b=e.anomalyRadius??6,v=a(h),x=a(f),w=t.filter(e=>{const t=Br(e[n]);return null!=t&&Math.abs(t-l)>d*u});/* @__PURE__ */ /* @__PURE__ */
64
- return(0,sp.jsxs)("g",{children:[p&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("rect",{x:0,y:Math.min(v,x),width:i.width||0,height:Math.abs(x-v),fill:m,fillOpacity:g}),w.map((e,t)=>{const n=Kr(e,i),r=Qr(e,i);return null==n||null==r?null:/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("circle",{cx:n,cy:r,r:b,fill:y,fillOpacity:.7,stroke:y,strokeWidth:1.5},`anomaly-${t}`)}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("text",{x:(i.width||0)-4,y:Math.min(v,x)-4,textAnchor:"end",fill:m,fontSize:11,children:e.label})]},`ann-${r}`)}case"forecast":{const t=i.data||[],n=i.xAccessor||"x",o=i.yAccessor||"y",a=i.scales?.x??i.scales?.time,s=i.scales?.y??i.scales?.value;if(!a||!s)return null;const l=Wr(t.map(e=>[e[n],e[o]])),c=Xr(l,e);if(!c)return null;const{predict:u}=c,d=l[l.length-1][0],h=c.forecast(e.steps??5);if(!h.length)return null;const f=(0,Kf.area)().x(e=>a(e.x)).y0(e=>s(e.lower)).y1(e=>s(e.upper))(h);if(!f)return null;const p=h.map(e=>`${a(e.x)},${s(e.y)}`).join(" "),m=`${a(d)},${s(u(d))}`,g=e.fill||"#6366f1",y=e.strokeColor||"#6366f1";/* @__PURE__ */ /* @__PURE__ */
65
- return(0,sp.jsxs)("g",{children:[
63
+ /* @__PURE__ */(0,dp.jsx)("path",{d:h,fill:f,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&u.length>0&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("text",{x:o(u[u.length-1][n])+4,y:a(u[u.length-1][s])-4,fill:f,fontSize:11,children:e.label})]},`ann-${r}`)}case"anomaly-band":{const t=(i.data||[]).filter(t=>!e.filter||e.filter(t));if(t.length<2)return null;const n=i.yAccessor||"y",o=i.scales?.x??i.scales?.time,a=i.scales?.y??i.scales?.value;if(!o||!a)return null;const s=t.map(e=>Br(e[n])).filter(e=>null!==e);if(s.length<2)return null;const l=s.reduce((e,t)=>e+t,0)/s.length,c=s.reduce((e,t)=>e+(t-l)**2,0)/s.length,u=Math.sqrt(c),d=e.threshold??2,h=l+d*u,f=l-d*u,p=!1!==e.showBand,m=e.fill||"#6366f1",g=e.fillOpacity??.1,y=e.anomalyColor||"#ef4444",v=e.anomalyRadius??6,b=a(h),x=a(f),w=t.filter(e=>{const t=Br(e[n]);return null!=t&&Math.abs(t-l)>d*u});/* @__PURE__ */ /* @__PURE__ */
64
+ return(0,dp.jsxs)("g",{children:[p&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("rect",{x:0,y:Math.min(b,x),width:i.width||0,height:Math.abs(x-b),fill:m,fillOpacity:g}),w.map((e,t)=>{const n=Kr(e,i),r=Qr(e,i);return null==n||null==r?null:/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("circle",{cx:n,cy:r,r:v,fill:y,fillOpacity:.7,stroke:y,strokeWidth:1.5},`anomaly-${t}`)}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("text",{x:(i.width||0)-4,y:Math.min(b,x)-4,textAnchor:"end",fill:m,fontSize:11,children:e.label})]},`ann-${r}`)}case"forecast":{const t=i.data||[],n=i.xAccessor||"x",o=i.yAccessor||"y",a=i.scales?.x??i.scales?.time,s=i.scales?.y??i.scales?.value;if(!a||!s)return null;const l=Wr(t.map(e=>[e[n],e[o]])),c=Xr(l,e);if(!c)return null;const{predict:u}=c,d=l[l.length-1][0],h=c.forecast(e.steps??5);if(!h.length)return null;const f=(0,tp.area)().x(e=>a(e.x)).y0(e=>s(e.lower)).y1(e=>s(e.upper))(h);if(!f)return null;const p=h.map(e=>`${a(e.x)},${s(e.y)}`).join(" "),m=`${a(d)},${s(u(d))}`,g=e.fill||"#6366f1",y=e.strokeColor||"#6366f1";/* @__PURE__ */ /* @__PURE__ */
65
+ return(0,dp.jsxs)("g",{children:[
66
66
  /* @__PURE__ */
67
- /* @__PURE__ */(0,sp.jsx)("path",{d:f,fill:g,fillOpacity:e.fillOpacity??.15,stroke:"none"}),
67
+ /* @__PURE__ */(0,dp.jsx)("path",{d:f,fill:g,fillOpacity:e.fillOpacity??.15,stroke:"none"}),
68
68
  /* @__PURE__ */
69
- /* @__PURE__ */(0,sp.jsx)("polyline",{points:`${m} ${p}`,fill:"none",stroke:y,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&h.length>0&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("text",{x:a(h[h.length-1].x)+4,y:s(h[h.length-1].y)-4,fill:y,fontSize:11,children:e.label})]},`ann-${r}`)}case"widget":{let n,o;if(null!=e.px&&null!=e.py)n=e.px,o=e.py;else{const t=oi(e,r,i);if(!t)return null;n=t.x,o=t.y}if(!ai(n,o,i))return null;const a=e.dx??0,s=e.dy??0,l=e.width??32,c=e.height??32,u=e.content??/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});/* @__PURE__ */ /* @__PURE__ */
70
- return(0,sp.jsx)("foreignObject",{x:n+a-l/2,y:o+s-c/2,width:l,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("div",{...Mr(e,t),style:{width:l,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},`ann-${r}`)}case"text":{const t=oi(e,r,i);if(!t)return null;const{x:n,y:o}=t,a=n+(e.dx||0),s=o+(e.dy||0),l=e.color||"var(--semiotic-text, #333)",c=/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("text",{x:a,y:s,fill:l,fontSize:e.fontSize||11,opacity:e.opacity,strokeDasharray:e.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:e.label});return!0!==e._redundantConnector?Uf.cloneElement(c,{key:`ann-text-${r}`}):/* @__PURE__ */ /* @__PURE__ */(0,sp.jsxs)("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[
69
+ /* @__PURE__ */(0,dp.jsx)("polyline",{points:`${m} ${p}`,fill:"none",stroke:y,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&h.length>0&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("text",{x:a(h[h.length-1].x)+4,y:s(h[h.length-1].y)-4,fill:y,fontSize:11,children:e.label})]},`ann-${r}`)}case"widget":{let n,o;if(null!=e.px&&null!=e.py)n=e.px,o=e.py;else{const t=oi(e,r,i);if(!t)return null;n=t.x,o=t.y}if(!ai(n,o,i))return null;const a=e.dx??0,s=e.dy??0,l=e.width??32,c=e.height??32,u=e.content??/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});/* @__PURE__ */ /* @__PURE__ */
70
+ return(0,dp.jsx)("foreignObject",{x:n+a-l/2,y:o+s-c/2,width:l,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("div",{...Mr(e,t),style:{width:l,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},`ann-${r}`)}case"text":{const t=oi(e,r,i);if(!t)return null;const{x:n,y:o}=t,a=n+(e.dx||0),s=o+(e.dy||0),l=e.color||"var(--semiotic-text, #333)",c=/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)("text",{x:a,y:s,fill:l,fontSize:e.fontSize||11,opacity:e.opacity,strokeDasharray:e.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:e.label});return!0!==e._redundantConnector?Qf.cloneElement(c,{key:`ann-text-${r}`}):/* @__PURE__ */ /* @__PURE__ */(0,dp.jsxs)("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[
71
71
  /* @__PURE__ */
72
- /* @__PURE__ */(0,sp.jsx)("line",{x1:n,y1:o,x2:a,y2:s,stroke:l,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),Uf.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},`ann-text-${r}`)}case"frame-text":/* @__PURE__ */ /* @__PURE__ */
73
- return(0,sp.jsx)(Mi,{annotation:e,width:i.width||0,height:i.height||0},`ann-frame-text-${r}`);case"category-highlight":{const t=e.category;if(null==t)return null;const n=e=>"function"==typeof e&&"function"==typeof e.bandwidth,o=i.scales?.o,a=i.scales?.x,s=i.scales?.y,l=n(o)?o:n(a)?a:n(s)?s:null;if(!l)return null;const c=l(String(t));if(null==c)return null;const u=l.bandwidth(),d=i.projection?"vertical"===i.projection:l===a,h=e.color||"var(--semiotic-primary, #4589ff)",f=e.opacity??.15,p=e.label;return d?/* @__PURE__ */ /* @__PURE__ */(0,sp.jsxs)("g",{children:[
72
+ /* @__PURE__ */(0,dp.jsx)("line",{x1:n,y1:o,x2:a,y2:s,stroke:l,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),Qf.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},`ann-text-${r}`)}case"frame-text":/* @__PURE__ */ /* @__PURE__ */
73
+ return(0,dp.jsx)(Mi,{annotation:e,width:i.width||0,height:i.height||0},`ann-frame-text-${r}`);case"category-highlight":{const t=e.category;if(null==t)return null;const n=e=>"function"==typeof e&&"function"==typeof e.bandwidth,o=i.scales?.o,a=i.scales?.x,s=i.scales?.y,l=n(o)?o:n(a)?a:n(s)?s:null;if(!l)return null;const c=l(String(t));if(null==c)return null;const u=l.bandwidth(),d=i.projection?"vertical"===i.projection:l===a,h=e.color||"var(--semiotic-primary, #4589ff)",f=e.opacity??.15,p=e.label;return d?/* @__PURE__ */ /* @__PURE__ */(0,dp.jsxs)("g",{children:[
74
74
  /* @__PURE__ */
75
- /* @__PURE__ */(0,sp.jsx)("rect",{x:c,y:0,width:u,height:i.height||0,fill:h,fillOpacity:f}),p&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)(Lr,{x:c+u/2,y:16,textAnchor:"middle",fill:h,fontSize:12,fontWeight:"bold",text:p,background:e.labelBackground??"none"})]},`ann-${r}`):/* @__PURE__ */ /* @__PURE__ */(0,sp.jsxs)("g",{children:[
75
+ /* @__PURE__ */(0,dp.jsx)("rect",{x:c,y:0,width:u,height:i.height||0,fill:h,fillOpacity:f}),p&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)(Lr,{x:c+u/2,y:16,textAnchor:"middle",fill:h,fontSize:12,fontWeight:"bold",text:p,background:e.labelBackground??"none"})]},`ann-${r}`):/* @__PURE__ */ /* @__PURE__ */(0,dp.jsxs)("g",{children:[
76
76
  /* @__PURE__ */
77
- /* @__PURE__ */(0,sp.jsx)("rect",{x:0,y:c,width:i.width||0,height:u,fill:h,fillOpacity:f}),p&&/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)(Lr,{x:12,y:c+u/2,dominantBaseline:"middle",fill:h,fontSize:12,fontWeight:"bold",text:p,background:e.labelBackground??"none"})]},`ann-${r}`)}default:return null}var o,a}}function Ii(e){return"string"==typeof e?.type?e.type:""}function Ti(e){return!!e&&"object"==typeof e&&cp.has(Ii(e))}function zi(e,t,n){return Math.max(t,Math.min(n,e))}function $i(e){return"primary"===e?.emphasis||!0===e?.defensive}function Di(e,t,n={}){if("number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations))return Math.max(0,Math.floor(n.maxAnnotations));if(!(e>0&&t>0))return 1/0;const r=n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4;return Math.max(1,Math.round(e*t/r))}function _i(e){let t;const n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;const r=e?.provenance?.confidence;switch("number"==typeof r&&Number.isFinite(r)&&(t+=15*zi(r,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 Fi(e){const{annotations:t,width:n,height:r}=e,i=Math.max(0,e.minVisible??1),o=Di(n,r,e),a=t.map((e,t)=>{return{annotation:e,index:t,note:(n=e,Ti(n))};var n}),s=a.filter(e=>e.note);if(0===s.length||s.length<=o)return{visible:t.slice(),deferred:[],budget:o};const l=s.filter(e=>$i(e.annotation)),c=s.filter(e=>!$i(e.annotation)).sort((e,t)=>_i(t.annotation)-_i(e.annotation)||e.index-t.index),u=Math.max(0,o-l.length),d=Math.max(0,i-l.length),h=Math.min(c.length,Math.max(u,d)),f=/* @__PURE__ */new Set([...l.map(e=>e.index),...c.slice(0,h).map(e=>e.index)]),p=[],m=[];for(const{annotation:e,index:t,note:n}of a)!n||f.has(t)?p.push(e):m.push(e);return{visible:p,deferred:m,budget:o}}function Oi(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}function Bi(e){const t=e?.familiarity;if(!t)return 3;const n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}function Wi(e){if(!e)return 1;const t=Bi(e);return t<=2?1.5:t>=4?.6:1}function Hi(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(mp,t.source)?mp[t.source]:t.source:null,r="number"==typeof t.confidence&&Number.isFinite(t.confidence)?`${Math.round(100*Math.max(0,Math.min(1,t.confidence)))}%`:null;if(!n&&!r)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const i=[n,r].filter(Boolean).join(" · "),o="string"==typeof e.label?e.label:"";return o.includes(`(${i})`)?e:{...e,label:o?`${o} (${i})`:`(${i})`}}function qi(e,t){let n=!1;const r=e.map(e=>Yi(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?r:e}function Gi(e){if(!Yi(e))return e;const t="string"==typeof e.mobileText?e.mobileText:void 0,n="string"==typeof e.shortText?e.shortText:void 0,r=t??n;return!r||"string"!=typeof e.label&&null!=e.label?e:{...e,label:r}}function Vi(e){if("text"!==e.type||"string"!=typeof e.color)return e;const t="number"==typeof e.dx?e.dx:0,n="number"==typeof e.dy?e.dy:0;return Math.hypot(t,n)<8?e:{...e,_redundantConnector:!0}}function Yi(e){return Ti(e)}function Ui(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t=Ir(e);if(t)return{width:Math.max(24,t.width+10),height:Math.max(18,t.height+6)};const n="number"==typeof e.wrap?e.wrap:120,r=[...Tr("string"==typeof e.title?e.title:void 0,n,7),...Tr("string"==typeof e.label?e.label:void 0,n,7)],i=r.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(n,7*i)+10),height:Math.max(18,16*r.length+6)}}function Xi(e,t,n,r,i){const o=e+n,a=t+r;return Math.abs(n)>Math.abs(r)?{x:n>=0?o+4:o-i.width-4,y:r<0?a-i.height:a,width:i.width,height:i.height}:{x:n>=0?o:o-i.width,y:r<0?a-i.height-4:a+4,width:i.width,height:i.height}}function Zi(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function Ki(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 Qi(e,t,n,r){const i=Math.max(0,r-e.x),o=Math.max(0,r-e.y),a=Math.max(0,e.x+e.width-(t-r)),s=Math.max(0,e.y+e.height-(n-r));return(i+a)*e.height+(o+s)*e.width}function Ji(e){const t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}function eo(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}function to(e,t,n,r,i,o,a,s){const l=Zi(e,a);let c=.4*Math.hypot(t.dx,t.dy)+80*Qi(l,i,o,s);for(const e of n)c+=12*Ki(l,e);for(const e of r)c+=4*Ki(l,e);return c}function no(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const r=e.pointId??e.nodeId;if(null!=r&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===r);if(e)return{x:e.x,y:e.y}}const i=e.coordinates,o=n.scales?.geoProjection;if(Array.isArray(i)&&i.length>=2&&o){const e=i[0],t=i[1];if("number"==typeof e&&"number"==typeof t){const n=o([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?oi(e,t,n):{x:e.x,y:e.y}}function ro(e){const{annotations:t,context:n,defaultOffset:r=up,notePadding:i=dp,markPadding:o=hp,edgePadding:a=fp,preserveManualOffsets:s=!0,routeLongConnectors:l=!0,connectorThreshold:c=pp,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:p,cohesion:m,audience:g}=e,y=n.width||0,b=n.height||0,v="object"==typeof p?p:{},x=v.breakpoint??480,w=!!p&&y<=x,k=w&&!1!==v.preferShortText?t.map(Gi):t,S=w&&!u?{maxAnnotations:v.maxAnnotations??("callout-list"===v.strategy?1:2),minVisible:v.minVisible??1}:u,M=d||w&&(!1!==v.progressiveDisclosure||"callout-list"===v.strategy),j=w&&!f?v.responsive??{minWidth:x}:f,A=w&&!m?v.cohesion:m;if(0===k.length||y<=0||b<=0)return k.slice();const C=[],R=eo(n,o);let L=!1;const P=k.map((e,t)=>{if(!Yi(e))return e;const o=no(e,t,n);if(!o)return e;const u=Ui(!0===e.defensive?Hi(e):e);if(s&&("number"==typeof(d=e).dx||"number"==typeof d.dy)){const t=Oi(e),n="number"==typeof e.dx?e.dx:t.dx,r="number"==typeof e.dy?e.dy:t.dy;return C.push(Zi(Xi(o.x,o.y,n,r,u),i)),e}var d;let h=null,f=1/0;for(const e of Ji(r)){const t=to(Xi(o.x,o.y,e.dx,e.dy,u),e,C,R,y,b,i,a);t<f&&(h=e,f=t)}if(!h)return e;const p=Zi(Xi(o.x,o.y,h.dx,h.dy,u),i);C.push(p);const m=Math.hypot(h.dx,h.dy),g=l&&m>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return L=!0,{...e,dx:h.dx,dy:h.dy,...g?{connector:g}:{}}}),N=L?P:k.slice();let E=N;if(h){let e=!1;const t=N.map(t=>{const n=Vi(t);return n!==t&&(e=!0),n});E=e?t:N}{let e=!1;const t=E.map(t=>{if(!0!==t?.defensive)return t;const n=Hi(t);return n!==t&&(e=!0),n});E=e?t:E}const I=/* @__PURE__ */new Set;if(S){const e="object"==typeof S?S:{},t=Wi(g),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??Di(y,b,e))*t))},{deferred:r}=Fi({annotations:E,width:y,height:b,...n});for(const e of r)I.add(e)}if(j){const e="object"==typeof j&&"number"==typeof j.minWidth?j.minWidth:480;if(y<=e)for(const e of E)Yi(e)&&"secondary"===e.emphasis&&I.add(e)}if(I.size>0)for(const e of E)!0===e?.defensive&&I.delete(e);let T;return T=0===I.size?E:M?E.map(e=>I.has(e)?{...e,_annotationDeferred:!0}:e):E.filter(e=>!I.has(e)),A?qi(T,A):T}function io(e,t={}){const n=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,i=/* @__PURE__ */new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!n)return!1;const t=e?.provenance?.stableId;return!(t&&i.has(t)&&!r)})}function oo({config:e,orientation:t="vertical",width:n=100,customClickBehavior:r,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:a,legendInteraction:s}){const{colorFn:l,domain:c,label:u,format:d}=e,h="horizontal"===t,f=d||Un(c),p=`grad-legend-${vp.useId()}`,m=!(!r&&!i),g="isolate"===s||void 0===s&&null!=a,[y,b]=vp.useState(0),[v,x]=vp.useState(null),w=vp.useRef([]),k=e=>{const t=h?e:5-e-1,n=c[0]+t/5*(c[1]-c[0]),r=c[0]+(t+1)/5*(c[1]-c[0]);return{label:`${f(n)} – ${f(r)}`,valueRange:[n,r],interactionKey:`${n}:${r}`}},S=(e,n,s)=>{const l="string"==typeof e.interactionKey?e.interactionKey:e.label,c=a?.has(l)??!1,u=o===l,d=v===s,h=a?.size&&!c||null!=o&&!u,f=e=>{const t=(e+5)%5;b(t),w.current[t]?.focus()};/* @__PURE__ */ /* @__PURE__ */
78
- return(0,xp.jsx)("rect",{ref:e=>{w.current[s]=e},className:"semiotic-gradient-legend-bin",...n,fill:h?"rgba(255,255,255,0.65)":"transparent",stroke:d||c||u?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:d?3:2,tabIndex:s===y?0:-1,role:"option","aria-label":e.label,"aria-selected":g?c:void 0,"aria-current":!(g||!u)||void 0,onClick:r?()=>r(e):void 0,onMouseEnter:i?()=>i(e):void 0,onMouseLeave:i?()=>i(null):void 0,onFocus:()=>{b(s),x(s),i?.(e)},onBlur:()=>{x(null),i?.(null)},onKeyDown:n=>{if(("Enter"===n.key||" "===n.key)&&r)return n.preventDefault(),void r(e);const i="horizontal"===t?"ArrowLeft":"ArrowUp",o="horizontal"===t?"ArrowRight":"ArrowDown";n.key===i||n.key===o?(n.preventDefault(),f(s+(n.key===o?1:-1))):"Home"!==n.key&&"End"!==n.key||(n.preventDefault(),f("Home"===n.key?0:4))},style:{cursor:"pointer",pointerEvents:"all"}},`gradient-interaction-${s}`)},[M,j]=c,A=vp.useMemo(()=>Array.from({length:65},(e,t)=>{const n=t/64,r=h?M+n*(j-M):j-n*(j-M);/* @__PURE__ */ /* @__PURE__ */
79
- return(0,xp.jsx)("stop",{offset:n,stopColor:l(r)},t)}),[l,M,j,h]),C=h?Math.min(n,200):14,R=h?12:100,L=h?Math.max(0,(n-C)/2):0,P=u?18:0;/* @__PURE__ */ /* @__PURE__ */
80
- return(0,xp.jsxs)("g",{"aria-label":u||"Gradient legend",role:m?"listbox":void 0,"aria-orientation":m?t:void 0,"aria-multiselectable":!(!m||!g)||void 0,style:yp,children:[
77
+ /* @__PURE__ */(0,dp.jsx)("rect",{x:0,y:c,width:i.width||0,height:u,fill:h,fillOpacity:f}),p&&/* @__PURE__ */ /* @__PURE__ */(0,dp.jsx)(Lr,{x:12,y:c+u/2,dominantBaseline:"middle",fill:h,fontSize:12,fontWeight:"bold",text:p,background:e.labelBackground??"none"})]},`ann-${r}`)}default:return null}var o,a}}function Ii(e){return"string"==typeof e?.type?e.type:""}function Ti(e){return!!e&&"object"==typeof e&&fp.has(Ii(e))}function zi(e,t,n){return Math.max(t,Math.min(n,e))}function $i(e){return"primary"===e?.emphasis||!0===e?.defensive}function Di(e,t,n={}){if("number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations))return Math.max(0,Math.floor(n.maxAnnotations));if(!(e>0&&t>0))return 1/0;const r=n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4;return Math.max(1,Math.round(e*t/r))}function _i(e){let t;const n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;const r=e?.provenance?.confidence;switch("number"==typeof r&&Number.isFinite(r)&&(t+=15*zi(r,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 Fi(e){const{annotations:t,width:n,height:r}=e,i=Math.max(0,e.minVisible??1),o=Di(n,r,e),a=t.map((e,t)=>{return{annotation:e,index:t,note:(n=e,Ti(n))};var n}),s=a.filter(e=>e.note);if(0===s.length||s.length<=o)return{visible:t.slice(),deferred:[],budget:o};const l=s.filter(e=>$i(e.annotation)),c=s.filter(e=>!$i(e.annotation)).sort((e,t)=>_i(t.annotation)-_i(e.annotation)||e.index-t.index),u=Math.max(0,o-l.length),d=Math.max(0,i-l.length),h=Math.min(c.length,Math.max(u,d)),f=/* @__PURE__ */new Set([...l.map(e=>e.index),...c.slice(0,h).map(e=>e.index)]),p=[],m=[];for(const{annotation:e,index:t,note:n}of a)!n||f.has(t)?p.push(e):m.push(e);return{visible:p,deferred:m,budget:o}}function Oi(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}function Bi(e){const t=e?.familiarity;if(!t)return 3;const n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}function Wi(e){if(!e)return 1;const t=Bi(e);return t<=2?1.5:t>=4?.6:1}function Hi(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(bp,t.source)?bp[t.source]:t.source:null,r="number"==typeof t.confidence&&Number.isFinite(t.confidence)?`${Math.round(100*Math.max(0,Math.min(1,t.confidence)))}%`:null;if(!n&&!r)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const i=[n,r].filter(Boolean).join(" · "),o="string"==typeof e.label?e.label:"";return o.includes(`(${i})`)?e:{...e,label:o?`${o} (${i})`:`(${i})`}}function qi(e,t){let n=!1;const r=e.map(e=>Yi(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?r:e}function Gi(e){if(!Yi(e))return e;const t="string"==typeof e.mobileText?e.mobileText:void 0,n="string"==typeof e.shortText?e.shortText:void 0,r=t??n;return!r||"string"!=typeof e.label&&null!=e.label?e:{...e,label:r}}function Vi(e){if("text"!==e.type||"string"!=typeof e.color)return e;const t="number"==typeof e.dx?e.dx:0,n="number"==typeof e.dy?e.dy:0;return Math.hypot(t,n)<8?e:{...e,_redundantConnector:!0}}function Yi(e){return Ti(e)}function Ui(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t=Ir(e);if(t)return{width:Math.max(24,t.width+10),height:Math.max(18,t.height+6)};const n="number"==typeof e.wrap?e.wrap:120,r=[...Tr("string"==typeof e.title?e.title:void 0,n,7),...Tr("string"==typeof e.label?e.label:void 0,n,7)],i=r.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(n,7*i)+10),height:Math.max(18,16*r.length+6)}}function Xi(e,t,n,r,i){const o=e+n,a=t+r;return Math.abs(n)>Math.abs(r)?{x:n>=0?o+4:o-i.width-4,y:r<0?a-i.height:a,width:i.width,height:i.height}:{x:n>=0?o:o-i.width,y:r<0?a-i.height-4:a+4,width:i.width,height:i.height}}function Zi(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function Ki(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 Qi(e,t,n,r){const i=Math.max(0,r-e.x),o=Math.max(0,r-e.y),a=Math.max(0,e.x+e.width-(t-r)),s=Math.max(0,e.y+e.height-(n-r));return(i+a)*e.height+(o+s)*e.width}function Ji(e){const t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}function eo(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}function to(e,t,n,r,i,o,a,s){const l=Zi(e,a);let c=.4*Math.hypot(t.dx,t.dy)+80*Qi(l,i,o,s);for(const e of n)c+=12*Ki(l,e);for(const e of r)c+=4*Ki(l,e);return c}function no(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const r=e.pointId??e.nodeId;if(null!=r&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===r);if(e)return{x:e.x,y:e.y}}const i=e.coordinates,o=n.scales?.geoProjection;if(Array.isArray(i)&&i.length>=2&&o){const e=i[0],t=i[1];if("number"==typeof e&&"number"==typeof t){const n=o([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?oi(e,t,n):{x:e.x,y:e.y}}function ro(e){const{annotations:t,context:n,defaultOffset:r=pp,notePadding:i=mp,markPadding:o=gp,edgePadding:a=yp,preserveManualOffsets:s=!0,routeLongConnectors:l=!0,connectorThreshold:c=vp,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:p,cohesion:m,audience:g}=e,y=n.width||0,v=n.height||0,b="object"==typeof p?p:{},x=b.breakpoint??480,w=!!p&&y<=x,k=w&&!1!==b.preferShortText?t.map(Gi):t,S=w&&!u?{maxAnnotations:b.maxAnnotations??("callout-list"===b.strategy?1:2),minVisible:b.minVisible??1}:u,M=d||w&&(!1!==b.progressiveDisclosure||"callout-list"===b.strategy),j=w&&!f?b.responsive??{minWidth:x}:f,A=w&&!m?b.cohesion:m;if(0===k.length||y<=0||v<=0)return k.slice();const C=[],R=eo(n,o);let L=!1;const P=k.map((e,t)=>{if(!Yi(e))return e;const o=no(e,t,n);if(!o)return e;const u=Ui(!0===e.defensive?Hi(e):e);if(s&&("number"==typeof(d=e).dx||"number"==typeof d.dy)){const t=Oi(e),n="number"==typeof e.dx?e.dx:t.dx,r="number"==typeof e.dy?e.dy:t.dy;return C.push(Zi(Xi(o.x,o.y,n,r,u),i)),e}var d;let h=null,f=1/0;for(const e of Ji(r)){const t=to(Xi(o.x,o.y,e.dx,e.dy,u),e,C,R,y,v,i,a);t<f&&(h=e,f=t)}if(!h)return e;const p=Zi(Xi(o.x,o.y,h.dx,h.dy,u),i);C.push(p);const m=Math.hypot(h.dx,h.dy),g=l&&m>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return L=!0,{...e,dx:h.dx,dy:h.dy,...g?{connector:g}:{}}}),N=L?P:k.slice();let E=N;if(h){let e=!1;const t=N.map(t=>{const n=Vi(t);return n!==t&&(e=!0),n});E=e?t:N}{let e=!1;const t=E.map(t=>{if(!0!==t?.defensive)return t;const n=Hi(t);return n!==t&&(e=!0),n});E=e?t:E}const I=/* @__PURE__ */new Set;if(S){const e="object"==typeof S?S:{},t=Wi(g),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??Di(y,v,e))*t))},{deferred:r}=Fi({annotations:E,width:y,height:v,...n});for(const e of r)I.add(e)}if(j){const e="object"==typeof j&&"number"==typeof j.minWidth?j.minWidth:480;if(y<=e)for(const e of E)Yi(e)&&"secondary"===e.emphasis&&I.add(e)}if(I.size>0)for(const e of E)!0===e?.defensive&&I.delete(e);let T;return T=0===I.size?E:M?E.map(e=>I.has(e)?{...e,_annotationDeferred:!0}:e):E.filter(e=>!I.has(e)),A?qi(T,A):T}function io(e,t={}){const n=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,i=/* @__PURE__ */new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!n)return!1;const t=e?.provenance?.stableId;return!(t&&i.has(t)&&!r)})}function oo({config:e,orientation:t="vertical",width:n=100,customClickBehavior:r,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:a,legendInteraction:s}){const{colorFn:l,domain:c,label:u,format:d}=e,h="horizontal"===t,f=d||Un(c),p=`grad-legend-${Sp.useId()}`,m=!(!r&&!i),g="isolate"===s||void 0===s&&null!=a,[y,v]=Sp.useState(0),[b,x]=Sp.useState(null),w=Sp.useRef([]),k=e=>{const t=h?e:5-e-1,n=c[0]+t/5*(c[1]-c[0]),r=c[0]+(t+1)/5*(c[1]-c[0]);return{label:`${f(n)} – ${f(r)}`,valueRange:[n,r],interactionKey:`${n}:${r}`}},S=(e,n,s)=>{const l="string"==typeof e.interactionKey?e.interactionKey:e.label,c=a?.has(l)??!1,u=o===l,d=b===s,h=a?.size&&!c||null!=o&&!u,f=e=>{const t=(e+5)%5;v(t),w.current[t]?.focus()};/* @__PURE__ */ /* @__PURE__ */
78
+ return(0,Mp.jsx)("rect",{ref:e=>{w.current[s]=e},className:"semiotic-gradient-legend-bin",...n,fill:h?"rgba(255,255,255,0.65)":"transparent",stroke:d||c||u?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:d?3:2,tabIndex:s===y?0:-1,role:"option","aria-label":e.label,"aria-selected":g?c:void 0,"aria-current":!(g||!u)||void 0,onClick:r?()=>r(e):void 0,onMouseEnter:i?()=>i(e):void 0,onMouseLeave:i?()=>i(null):void 0,onFocus:()=>{v(s),x(s),i?.(e)},onBlur:()=>{x(null),i?.(null)},onKeyDown:n=>{if(("Enter"===n.key||" "===n.key)&&r)return n.preventDefault(),void r(e);const i="horizontal"===t?"ArrowLeft":"ArrowUp",o="horizontal"===t?"ArrowRight":"ArrowDown";n.key===i||n.key===o?(n.preventDefault(),f(s+(n.key===o?1:-1))):"Home"!==n.key&&"End"!==n.key||(n.preventDefault(),f("Home"===n.key?0:4))},style:{cursor:"pointer",pointerEvents:"all"}},`gradient-interaction-${s}`)},[M,j]=c,A=Sp.useMemo(()=>Array.from({length:65},(e,t)=>{const n=t/64,r=h?M+n*(j-M):j-n*(j-M);/* @__PURE__ */ /* @__PURE__ */
79
+ return(0,Mp.jsx)("stop",{offset:n,stopColor:l(r)},t)}),[l,M,j,h]),C=h?Math.min(n,200):14,R=h?12:100,L=h?Math.max(0,(n-C)/2):0,P=u?18:0;/* @__PURE__ */ /* @__PURE__ */
80
+ return(0,Mp.jsxs)("g",{"aria-label":u||"Gradient legend",role:m?"listbox":void 0,"aria-orientation":m?t:void 0,"aria-multiselectable":!(!m||!g)||void 0,style:wp,children:[
81
81
  /* @__PURE__ */
82
- /* @__PURE__ */(0,xp.jsx)("defs",{children:/* @__PURE__ */ /* @__PURE__ */(0,xp.jsx)("linearGradient",{id:p,x1:"0%",y1:"0%",x2:h?"100%":"0%",y2:h?"0%":"100%",children:A})}),u&&/* @__PURE__ */ /* @__PURE__ */(0,xp.jsx)("text",{x:h?L+C/2:0,y:12,textAnchor:h?"middle":"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),
82
+ /* @__PURE__ */(0,Mp.jsx)("defs",{children:/* @__PURE__ */ /* @__PURE__ */(0,Mp.jsx)("linearGradient",{id:p,x1:"0%",y1:"0%",x2:h?"100%":"0%",y2:h?"0%":"100%",children:A})}),u&&/* @__PURE__ */ /* @__PURE__ */(0,Mp.jsx)("text",{x:h?L+C/2:0,y:12,textAnchor:h?"middle":"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),
83
83
  /* @__PURE__ */
84
- /* @__PURE__ */(0,xp.jsx)("rect",{x:L,y:P,width:C,height:R,fill:`url(#${p})`,rx:2}),m&&Array.from({length:5},(e,t)=>S(k(t),{x:h?L+t*C/5:0,y:h?P:P+t*R/5,width:h?C/5:C,height:h?R:R/5},t)),[0,1].map(e=>/* @__PURE__ */ /* @__PURE__ */(0,xp.jsx)("text",{x:h?L+e*C:C+5,y:P+(h?R+12:e?R: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 ao(e,t,n,r,i){if("function"==typeof n)return n(e);const o=r(e,t);return"fill"===n?/* @__PURE__ */ /* @__PURE__ */(0,wp.jsx)("rect",{style:o,width:i,height:i}):/* @__PURE__ */ /* @__PURE__ */(0,wp.jsx)("line",{style:o,x1:0,y1:0,x2:i,y2:i})}function so({swatchSize:e}){/* @__PURE__ */ /* @__PURE__ */
85
- return(0,wp.jsx)("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 lo(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function co(e,t,n,r,i,o){const{legendGroup:{type:a="fill",styleFn:s,items:l},customClickBehavior:c,customHoverBehavior:u,highlightedCategory:d,isolatedCategories:h,focusedGroupIndex:f,focusedItemIndex:p,groupIndex:m,onFocusedIndexChange:g,interactive:y,useIsolateAria:b,metrics:{swatchSize:v,labelGap:x}}=e,w=!!h?.size&&h.has(t.label),k=null!=d&&t.label===d;/* @__PURE__ */ /* @__PURE__ */
86
- return(0,wp.jsxs)("g",{transform:r,onClick:c?()=>c(t):void 0,onMouseEnter:u?()=>u(t):void 0,onMouseLeave:u?()=>u(null):void 0,tabIndex:y?m===f&&n===p?0:-1:void 0,role:y?"option":void 0,"aria-selected":y&&b?w:void 0,"aria-current":!(!y||b||!k)||void 0,"aria-label":t.label,onKeyDown:y?e=>{if("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c?.(t)),e.key===i||e.key===o){e.preventDefault();const t=(n+(e.key===o?1:-1)+l.length)%l.length;g(m,t);const r=e.currentTarget.parentElement?.children[t];r instanceof SVGElement&&r.focus()}}:void 0,onFocus:y?e=>{g(m,n),u?.(t),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","visible")}:void 0,onBlur:y?e=>{u?.(null),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","hidden")}:void 0,style:{cursor:y?"pointer":"default",opacity:lo(t,d,h),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[y&&/* @__PURE__ */ /* @__PURE__ */(0,wp.jsx)("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:v+x+2+7*t.label.length,height:v+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),ao(t,n,a,s,v),w&&/* @__PURE__ */ /* @__PURE__ */(0,wp.jsx)(so,{swatchSize:v}),
84
+ /* @__PURE__ */(0,Mp.jsx)("rect",{x:L,y:P,width:C,height:R,fill:`url(#${p})`,rx:2}),m&&Array.from({length:5},(e,t)=>S(k(t),{x:h?L+t*C/5:0,y:h?P:P+t*R/5,width:h?C/5:C,height:h?R:R/5},t)),[0,1].map(e=>/* @__PURE__ */ /* @__PURE__ */(0,Mp.jsx)("text",{x:h?L+e*C:C+5,y:P+(h?R+12:e?R: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 ao(e,t,n,r,i){if("function"==typeof n)return n(e);const o=r(e,t);return"fill"===n?/* @__PURE__ */ /* @__PURE__ */(0,jp.jsx)("rect",{style:o,width:i,height:i}):/* @__PURE__ */ /* @__PURE__ */(0,jp.jsx)("line",{style:o,x1:0,y1:0,x2:i,y2:i})}function so({swatchSize:e}){/* @__PURE__ */ /* @__PURE__ */
85
+ return(0,jp.jsx)("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 lo(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function co(e,t,n,r,i,o){const{legendGroup:{type:a="fill",styleFn:s,items:l},customClickBehavior:c,customHoverBehavior:u,highlightedCategory:d,isolatedCategories:h,focusedGroupIndex:f,focusedItemIndex:p,groupIndex:m,onFocusedIndexChange:g,interactive:y,useIsolateAria:v,metrics:{swatchSize:b,labelGap:x}}=e,w=!!h?.size&&h.has(t.label),k=null!=d&&t.label===d;/* @__PURE__ */ /* @__PURE__ */
86
+ return(0,jp.jsxs)("g",{transform:r,onClick:c?()=>c(t):void 0,onMouseEnter:u?()=>u(t):void 0,onMouseLeave:u?()=>u(null):void 0,tabIndex:y?m===f&&n===p?0:-1:void 0,role:y?"option":void 0,"aria-selected":y&&v?w:void 0,"aria-current":!(!y||v||!k)||void 0,"aria-label":t.label,onKeyDown:y?e=>{if("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c?.(t)),e.key===i||e.key===o){e.preventDefault();const t=(n+(e.key===o?1:-1)+l.length)%l.length;g(m,t);const r=e.currentTarget.parentElement?.children[t];r instanceof SVGElement&&r.focus()}}:void 0,onFocus:y?e=>{g(m,n),u?.(t),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","visible")}:void 0,onBlur:y?e=>{u?.(null),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","hidden")}:void 0,style:{cursor:y?"pointer":"default",opacity:lo(t,d,h),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[y&&/* @__PURE__ */ /* @__PURE__ */(0,jp.jsx)("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:b+x+2+7*t.label.length,height:b+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),ao(t,n,a,s,b),w&&/* @__PURE__ */ /* @__PURE__ */(0,jp.jsx)(so,{swatchSize:b}),
87
87
  /* @__PURE__ */
88
- /* @__PURE__ */(0,wp.jsx)("text",{y:v/2,x:v+x,dominantBaseline:"central",fontSize:12,style:bp,fill:"var(--semiotic-text, #333)",children:t.label})]},`legend-item-${n}`)}function uo(e){const{legendGroups:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,legendInteraction:a,title:s="Legend",width:l=100,height:c=20,orientation:u="vertical",legendLayout:d}=e,h=cr(d),[f,p]=gp.useState(0),[m,g]=gp.useState(0),y=gp.useCallback((e,t)=>{p(e),g(t)},[]),b="vertical"===u?Mp({legendGroups:t||[],width:l,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:m,onFocusedIndexChange:y,legendInteraction:a,metrics:h}):jp({legendGroups:t||[],title:s,height:c,width:l,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:m,onFocusedIndexChange:y,legendInteraction:a,metrics:h}),v=Boolean(n||r);/* @__PURE__ */ /* @__PURE__ */
89
- return(0,wp.jsxs)("g",{role:v?"listbox":void 0,"aria-multiselectable":!(!v||"isolate"!==a&&(void 0!==a||null==o))||void 0,"aria-label":"Chart legend",style:yp,children:[void 0!==s&&""!==s&&"vertical"===u&&/* @__PURE__ */ /* @__PURE__ */(0,wp.jsx)("text",{className:"legend-title",y:16,x:l/2,textAnchor:"middle",fontSize:12,style:bp,fill:"var(--semiotic-text, #333)",children:s}),b]})}function ho(e){const{legend:t,totalWidth:n,totalHeight:r,margin:i,legendPosition:o="right",legendLayout:a,legendHoverBehavior:s,legendClickBehavior:l,legendHighlightedCategory:c,legendIsolatedCategories:u,legendInteraction:d}=e;if(!t)return null;const{x:h,y:f,width:p}=lr(t,{totalWidth:n,totalHeight:r,margin:i,position:o,legendLayout:a,axisChrome:e.axisChrome}),m="top"===o||"bottom"===o;/* @__PURE__ */ /* @__PURE__ */
90
- return(0,Ap.jsx)("g",{transform:`translate(${h}, ${f})`,children:Kn(t)?/* @__PURE__ */ /* @__PURE__ */(0,Ap.jsx)(oo,{config:t.gradient,orientation:m?"horizontal":"vertical",width:p,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):Zn(t)?/* @__PURE__ */ /* @__PURE__ */(0,Ap.jsx)(uo,{legendGroups:t.legendGroups,title:"",width:p,orientation:m?"horizontal":"vertical",legendLayout:a,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}function fo({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?/* @__PURE__ */ /* @__PURE__ */(0,Cp.jsx)("foreignObject",{x:0,y:0,width:t,height:n,children:e}):/* @__PURE__ */ /* @__PURE__ */(0,Cp.jsx)("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 po(e,t){return"string"==typeof e&&e.length>0?e:t}function mo(e,t,n){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${n.familyPhrase})`:n.fallback}function go(e){const t=String(e).replace(/[^a-zA-Z0-9_-]/g,"_"),n=/^[A-Za-z_]/.test(t)?t:`c${t}`,r=`${n}-semiotic-title`,i=`${n}-semiotic-desc`;return{titleId:r,descId:i,labelledBy:`${r} ${i}`}}function yo(e){const{width:t,height:n,totalWidth:r,totalHeight:i,margin:o,showAxes:a,title:s,description:l,idPrefix:c,legend:u,legendHoverBehavior:d,legendClickBehavior:h,legendHighlightedCategory:f,legendIsolatedCategories:p,legendPosition:m,legendLayout:g,foregroundGraphics:y,annotations:b,onAnnotationActivate:v,onObservation:x,chartId:w,chartType:k,autoPlaceAnnotations:S,svgAnnotationRules:M,pointNodes:j,geoProjection:A}=e,C=kr({onAnnotationActivate:v,onObservation:x,chartId:w,chartType:k}),R=(0,Wf.useRef)([b?.length??0,/* @__PURE__ */new Map]),L=b?.length??0;R.current[0]!==L&&(R.current=[L,/* @__PURE__ */new Map]);const P=(0,Wf.useMemo)(()=>{if(!b||0===b.length)return null;const e=io(b),r=A?e.map(e=>{if(!Array.isArray(e.coordinates)||e.coordinates.length<2)return e;const t=A(Number(e.coordinates[0]),Number(e.coordinates[1]));return t?{...e,x:t[0],y:t[1]}:e}):e,i={scales:{x:e=>Number(e),y:e=>Number(e)},timeAxis:"x",width:t,height:n,frameType:"xy",pointNodes:j,stickyPositionCache:R.current[1]};return Pi(S?ro({annotations:r,context:i,..."object"==typeof S?S:{}}):r,Ei(0,C),M,i)},[b,S,M,t,n,j,C,A]),N=a||s||l||u||y||P&&P.length>0,E=(0,Wf.useId)(),{titleId:I,descId:T,labelledBy:z}=go(c||w||E);return N?/* @__PURE__ */ /* @__PURE__ */(0,Rp.jsxs)("svg",{role:"img","aria-labelledby":z,width:r,height:i,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[
88
+ /* @__PURE__ */(0,jp.jsx)("text",{y:b/2,x:b+x,dominantBaseline:"central",fontSize:12,style:kp,fill:"var(--semiotic-text, #333)",children:t.label})]},`legend-item-${n}`)}function uo(e){const{legendGroups:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,legendInteraction:a,title:s="Legend",width:l=100,height:c=20,orientation:u="vertical",legendLayout:d}=e,h=cr(d),[f,p]=xp.useState(0),[m,g]=xp.useState(0),y=xp.useCallback((e,t)=>{p(e),g(t)},[]),v="vertical"===u?Rp({legendGroups:t||[],width:l,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:m,onFocusedIndexChange:y,legendInteraction:a,metrics:h}):Lp({legendGroups:t||[],title:s,height:c,width:l,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:m,onFocusedIndexChange:y,legendInteraction:a,metrics:h}),b=Boolean(n||r);/* @__PURE__ */ /* @__PURE__ */
89
+ return(0,jp.jsxs)("g",{role:b?"listbox":void 0,"aria-multiselectable":!(!b||"isolate"!==a&&(void 0!==a||null==o))||void 0,"aria-label":"Chart legend",style:wp,children:[void 0!==s&&""!==s&&"vertical"===u&&/* @__PURE__ */ /* @__PURE__ */(0,jp.jsx)("text",{className:"legend-title",y:16,x:l/2,textAnchor:"middle",fontSize:12,style:kp,fill:"var(--semiotic-text, #333)",children:s}),v]})}function ho(e){const{legend:t,totalWidth:n,totalHeight:r,margin:i,legendPosition:o="right",legendLayout:a,legendHoverBehavior:s,legendClickBehavior:l,legendHighlightedCategory:c,legendIsolatedCategories:u,legendInteraction:d}=e;if(!t)return null;const{x:h,y:f,width:p}=lr(t,{totalWidth:n,totalHeight:r,margin:i,position:o,legendLayout:a,axisChrome:e.axisChrome}),m="top"===o||"bottom"===o;/* @__PURE__ */ /* @__PURE__ */
90
+ return(0,Pp.jsx)("g",{transform:`translate(${h}, ${f})`,children:Kn(t)?/* @__PURE__ */ /* @__PURE__ */(0,Pp.jsx)(oo,{config:t.gradient,orientation:m?"horizontal":"vertical",width:p,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):Zn(t)?/* @__PURE__ */ /* @__PURE__ */(0,Pp.jsx)(uo,{legendGroups:t.legendGroups,title:"",width:p,orientation:m?"horizontal":"vertical",legendLayout:a,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}function fo({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?/* @__PURE__ */ /* @__PURE__ */(0,Np.jsx)("foreignObject",{x:0,y:0,width:t,height:n,children:e}):/* @__PURE__ */ /* @__PURE__ */(0,Np.jsx)("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 po(e,t){return"string"==typeof e&&e.length>0?e:t}function mo(e,t,n){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${n.familyPhrase})`:n.fallback}function go(e){const t=String(e).replace(/[^a-zA-Z0-9_-]/g,"_"),n=/^[A-Za-z_]/.test(t)?t:`c${t}`,r=`${n}-semiotic-title`,i=`${n}-semiotic-desc`;return{titleId:r,descId:i,labelledBy:`${r} ${i}`}}function yo(e){const{width:t,height:n,totalWidth:r,totalHeight:i,margin:o,showAxes:a,title:s,description:l,idPrefix:c,legend:u,legendHoverBehavior:d,legendClickBehavior:h,legendHighlightedCategory:f,legendIsolatedCategories:p,legendPosition:m,legendLayout:g,foregroundGraphics:y,annotations:v,onAnnotationActivate:b,onObservation:x,chartId:w,chartType:k,autoPlaceAnnotations:S,svgAnnotationRules:M,pointNodes:j,geoProjection:A}=e,C=kr({onAnnotationActivate:b,onObservation:x,chartId:w,chartType:k}),R=(0,Vf.useRef)([v?.length??0,/* @__PURE__ */new Map]),L=v?.length??0;R.current[0]!==L&&(R.current=[L,/* @__PURE__ */new Map]);const P=(0,Vf.useMemo)(()=>{if(!v||0===v.length)return null;const e=io(v),r=A?e.map(e=>{if(!Array.isArray(e.coordinates)||e.coordinates.length<2)return e;const t=A(Number(e.coordinates[0]),Number(e.coordinates[1]));return t?{...e,x:t[0],y:t[1]}:e}):e,i={scales:{x:e=>Number(e),y:e=>Number(e)},timeAxis:"x",width:t,height:n,frameType:"xy",pointNodes:j,stickyPositionCache:R.current[1]};return Pi(S?ro({annotations:r,context:i,..."object"==typeof S?S:{}}):r,Ei(0,C),M,i)},[v,S,M,t,n,j,C,A]),N=a||s||l||u||y||P&&P.length>0,E=(0,Vf.useId)(),{titleId:I,descId:T,labelledBy:z}=go(c||w||E);return N?/* @__PURE__ */ /* @__PURE__ */(0,Ep.jsxs)("svg",{role:"img","aria-labelledby":z,width:r,height:i,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[
91
91
  /* @__PURE__ */
92
- /* @__PURE__ */(0,Rp.jsx)("title",{id:I,children:po(s,"Geographic chart")}),
92
+ /* @__PURE__ */(0,Ep.jsx)("title",{id:I,children:po(s,"Geographic chart")}),
93
93
  /* @__PURE__ */
94
- /* @__PURE__ */(0,Rp.jsx)("desc",{id:T,children:mo(s,l,{familyPhrase:"geographic data visualization",fallback:"geographic data visualization"})}),
94
+ /* @__PURE__ */(0,Ep.jsx)("desc",{id:T,children:mo(s,l,{familyPhrase:"geographic data visualization",fallback:"geographic data visualization"})}),
95
95
  /* @__PURE__ */
96
- /* @__PURE__ */(0,Rp.jsxs)("g",{transform:"translate("+o.left+","+o.top+")",children:[P,y]}),
96
+ /* @__PURE__ */(0,Ep.jsxs)("g",{transform:"translate("+o.left+","+o.top+")",children:[P,y]}),
97
97
  /* @__PURE__ */
98
- /* @__PURE__ */(0,Rp.jsx)(fo,{title:s,totalWidth:r,marginTop:o.top}),ho({legend:u,totalWidth:r,totalHeight:i,margin:o,legendPosition:m,title:s,legendLayout:g,legendHoverBehavior:d,legendClickBehavior:h,legendHighlightedCategory:f,legendIsolatedCategories:p})]}):null}function bo(e,t="#4e79a7"){return fi(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function vo(e){const t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?`s_${t}`:t}function xo(e,t,n,r){const i=e.glyph;if(!i?.parts?.length||e.size<=0)return null;const o=An(i,e.size);if(o.scale<=0)return null;const a=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${o.offsetX},${o.offsetY}) scale(${o.scale})`,s=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),l=Pn(i,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=l?vo(`${r}-clip`):void 0,u=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),d=t=>i.parts.map((n,r)=>{const i=t?"none"===n.fill?void 0:t:Rn(n.fill,s,e.accent),o=t?n.stroke&&"none"!==n.stroke?t:void 0:Rn(n.stroke??"none",s,e.accent);return i||o?/* @__PURE__ */ /* @__PURE__ */(0,Pp.jsx)("path",{d:n.d,fill:i??"none",stroke:o,strokeWidth:o?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},r):null});/* @__PURE__ */ /* @__PURE__ */
99
- return(0,Pp.jsxs)("g",{transform:a,opacity:1===u?void 0:u,children:[l&&c&&/* @__PURE__ */ /* @__PURE__ */(0,Pp.jsx)("clipPath",{id:c,children:/* @__PURE__ */ /* @__PURE__ */(0,Pp.jsx)("rect",{x:l.x,y:l.y,width:l.width,height:l.height})}),l&&e.ghostColor?/* @__PURE__ */ /* @__PURE__ */(0,Pp.jsx)("g",{children:d(e.ghostColor)}):null,l&&c?/* @__PURE__ */ /* @__PURE__ */(0,Pp.jsx)("g",{clipPath:`url(#${c})`,children:d()}):d()]},r)}function wo(e){if(!1!==e?.interactive)return e?.style?.cursor}function ko(e){if(!e)return!1;for(const t of e)if(wo(t))return!0;return!1}function So(e,t){if(!e)return;const n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function Mo(e){const t=Np.useRef(null);Np.useEffect(()=>{e.current&&(t.current=e.current)}),Np.useEffect(()=>()=>So(t.current),[])}function jo(e,t,n){const r=wo(t);return r&&null!=e&&!1!==e?/* @__PURE__ */ /* @__PURE__ */(0,Ep.jsx)("g",{style:{cursor:r},"data-semiotic-mark-cursor":r,children:e},n):e}function Ao(e,t){return jo(Co(e,t),e,`geo-cursor-${t}`)}function Co(e,t){switch(e.type){case"geoarea":{const n=e;if(!n.pathData)return null;const r=fi(n.style.fill)?yi(n.style.fill,`geoarea-${t}-hatch`):void 0;/* @__PURE__ */ /* @__PURE__ */
100
- return(0,Ip.jsxs)(Lp.Fragment,{children:[r&&/* @__PURE__ */ /* @__PURE__ */(0,Ip.jsx)("defs",{children:r}),
98
+ /* @__PURE__ */(0,Ep.jsx)(fo,{title:s,totalWidth:r,marginTop:o.top}),ho({legend:u,totalWidth:r,totalHeight:i,margin:o,legendPosition:m,title:s,legendLayout:g,legendHoverBehavior:d,legendClickBehavior:h,legendHighlightedCategory:f,legendIsolatedCategories:p})]}):null}function vo(e,t="#4e79a7"){return fi(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function bo(e){const t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?`s_${t}`:t}function xo(e,t,n,r){const i=e.glyph;if(!i?.parts?.length||e.size<=0)return null;const o=An(i,e.size);if(o.scale<=0)return null;const a=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${o.offsetX},${o.offsetY}) scale(${o.scale})`,s=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),l=Pn(i,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=l?bo(`${r}-clip`):void 0,u=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),d=t=>i.parts.map((n,r)=>{const i=t?"none"===n.fill?void 0:t:Rn(n.fill,s,e.accent),o=t?n.stroke&&"none"!==n.stroke?t:void 0:Rn(n.stroke??"none",s,e.accent);return i||o?/* @__PURE__ */ /* @__PURE__ */(0,Tp.jsx)("path",{d:n.d,fill:i??"none",stroke:o,strokeWidth:o?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},r):null});/* @__PURE__ */ /* @__PURE__ */
99
+ return(0,Tp.jsxs)("g",{transform:a,opacity:1===u?void 0:u,children:[l&&c&&/* @__PURE__ */ /* @__PURE__ */(0,Tp.jsx)("clipPath",{id:c,children:/* @__PURE__ */ /* @__PURE__ */(0,Tp.jsx)("rect",{x:l.x,y:l.y,width:l.width,height:l.height})}),l&&e.ghostColor?/* @__PURE__ */ /* @__PURE__ */(0,Tp.jsx)("g",{children:d(e.ghostColor)}):null,l&&c?/* @__PURE__ */ /* @__PURE__ */(0,Tp.jsx)("g",{clipPath:`url(#${c})`,children:d()}):d()]},r)}function wo(e){if(!1!==e?.interactive)return e?.style?.cursor}function ko(e){if(!e)return!1;for(const t of e)if(wo(t))return!0;return!1}function So(e,t){if(!e)return;const n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function Mo(e){const t=zp.useRef(null);zp.useEffect(()=>{e.current&&(t.current=e.current)}),zp.useEffect(()=>()=>So(t.current),[])}function jo(e,t,n){const r=wo(t);return r&&null!=e&&!1!==e?/* @__PURE__ */ /* @__PURE__ */(0,$p.jsx)("g",{style:{cursor:r},"data-semiotic-mark-cursor":r,children:e},n):e}function Ao(e,t){return jo(Co(e,t),e,`geo-cursor-${t}`)}function Co(e,t){switch(e.type){case"geoarea":{const n=e;if(!n.pathData)return null;const r=fi(n.style.fill)?yi(n.style.fill,`geoarea-${t}-hatch`):void 0;/* @__PURE__ */ /* @__PURE__ */
100
+ return(0,Dp.jsxs)(Ip.Fragment,{children:[r&&/* @__PURE__ */ /* @__PURE__ */(0,Dp.jsx)("defs",{children:r}),
101
101
  /* @__PURE__ */
102
- /* @__PURE__ */(0,Ip.jsx)("path",{d:n.pathData,fill:r?`url(#geoarea-${t}-hatch)`:bo(n.style.fill,"#e0e0e0"),fillOpacity:n.style.fillOpacity??1,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth??.5,strokeDasharray:n.style.strokeDasharray,opacity:(n.style.opacity??1)*(n._decayOpacity??1)})]},`geoarea-${t}`)}case"point":{const n=e,r=fi(n.style.fill)?yi(n.style.fill,`geopoint-${t}-hatch`):void 0;/* @__PURE__ */ /* @__PURE__ */
103
- return(0,Ip.jsxs)(Lp.Fragment,{children:[r&&/* @__PURE__ */ /* @__PURE__ */(0,Ip.jsx)("defs",{children:r}),
102
+ /* @__PURE__ */(0,Dp.jsx)("path",{d:n.pathData,fill:r?`url(#geoarea-${t}-hatch)`:vo(n.style.fill,"#e0e0e0"),fillOpacity:n.style.fillOpacity??1,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth??.5,strokeDasharray:n.style.strokeDasharray,opacity:(n.style.opacity??1)*(n._decayOpacity??1)})]},`geoarea-${t}`)}case"point":{const n=e,r=fi(n.style.fill)?yi(n.style.fill,`geopoint-${t}-hatch`):void 0;/* @__PURE__ */ /* @__PURE__ */
103
+ return(0,Dp.jsxs)(Ip.Fragment,{children:[r&&/* @__PURE__ */ /* @__PURE__ */(0,Dp.jsx)("defs",{children:r}),
104
104
  /* @__PURE__ */
105
- /* @__PURE__ */(0,Ip.jsx)("circle",{cx:n.x,cy:n.y,r:n.r,fill:r?`url(#geopoint-${t}-hatch)`:bo(n.style.fill),fillOpacity:n.style.fillOpacity??.8,stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,opacity:n._decayOpacity??n.style.opacity??1})]},`point-${t}`)}case"line":{const n=e;if(n.path.length<2)return null;const r="M"+n.path.map(e=>`${e[0]},${e[1]}`).join("L");/* @__PURE__ */ /* @__PURE__ */
106
- return(0,Ip.jsx)("path",{d:r,fill:"none",stroke:n.style.stroke||"#4e79a7",strokeWidth:n.style.strokeWidth??1.5,strokeDasharray:n.style.strokeDasharray,opacity:n.style.opacity??1},`line-${t}`)}case"glyph":{const n=e;return xo(n,n.x,n.y,`geo-glyph-${n.pointId??t}`)}default:return null}}function Ro(){const[e,t]=(0,zp.useState)(!1);return $p(()=>{t(!0)},[]),e}function Lo(){const e=(0,zp.useSyncExternalStore)(Dp,_p,Fp);return(0,zp.useRef)(e).current}function Po(e){const{hydrated:t,wasHydratingFromSSR:n,storeRef:r,dirtyRef:i,renderFnRef:o,cancelRender:a,cleanup:s}=e;$p(()=>{if(!t)return;const e=r.current;t&&n&&e?.cancelIntroAnimation?.();const s=!!e?.sceneNodes&&e.sceneNodes.length>0;!n&&s&&e?.markStylePaintPending?e.markStylePaintPending():i.current=!0,a?.(),o.current()},[t,n]);const l=(0,zp.useRef)(s);l.current=s,(0,zp.useEffect)(()=>()=>l.current?.(),[])}function No(e,t,n){const r=Math.round(t[0]*n),i=Math.round(t[1]*n),o=0===t[0]?n:r/t[0],a=0===t[1]?n:i/t[1],s=`${t[0]}px`,l=`${t[1]}px`;e.style.width!==s&&(e.style.width=s),e.style.height!==l&&(e.style.height=l);const c=e.width!==r||e.height!==i;return e.width!==r&&(e.width=r),e.height!==i&&(e.height=i),{effectiveDprX:o,effectiveDprY:a,resized:c}}function Eo(){if("undefined"!=typeof window&&"function"==typeof window.matchMedia)return ph!==window.matchMedia&&(ph=window.matchMedia,fh=window.matchMedia("(pointer: coarse)")),fh}function Io(e,t,n,r){const i=e.getContext("2d");if(!i)return null;const{effectiveDprX:o,effectiveDprY:a}=No(e,t,r);return i.setTransform(o,0,0,a,0,0),i.translate(n.left,n.top),i}function To(e,t){if("undefined"==typeof window)return 1;const n=window.devicePixelRatio||1,r="undefined"!=typeof window&&(!0===Eo()?.matches||Math.min(window.innerWidth||1/0,window.innerHeight||1/0)<768)?2:3,i="number"==typeof e&&e>0?e:r;if(!t)return Math.max(1,Math.min(n,i));const[o,a]=t,s=Math.min(Math.sqrt(8388608/(o*a)),16384/Math.max(o,a));return Math.max(s<1?0:1,Math.min(n,i,s))}function zo(e){function t(){r||(n(),i=To(),e(),queueMicrotask(()=>{r||o()}))}if("undefined"==typeof window)return()=>{};let n=()=>{},r=!1,i=0;const o=()=>{if("function"!=typeof window.matchMedia)return;const e=`(resolution: ${window.devicePixelRatio||1}dppx)`,r=window.matchMedia(e);r.media.includes("resolution")&&(n=Tn(r,t))};o(),i=To();const a=Eo(),s=()=>{if(r)return;const t=To();t!==i&&(i=t,e())};window.addEventListener("resize",s);const l=Tn(a,s);return()=>{r=!0,window.removeEventListener("resize",s),l(),n()}}function $o(e){const{cancelRender:t,dirtyRef:n,frameRuntime:r,manageFrameRuntime:i,maxDevicePixelRatio:o,scheduleRender:a}=e,s=(0,Op.useRef)(null),l=(0,Op.useRef)(null),c=(0,Op.useRef)(!1),u=(0,Op.useRef)(!1),d=(0,Op.useRef)(!1);return Wp(()=>{!u.current&&(u.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),Po({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),(0,Op.useEffect)(()=>{if(!1!==i)return r.subscribe(()=>{r.isActive?(n.current=!0,a()):t()})},[t,n,r,i,a]),(0,Op.useEffect)(()=>zo(()=>{c.current=!0,a()}),[a]),(0,Op.useEffect)(()=>{d.current?(c.current=!0,a()):d.current=!0},[o,a]),{canvasRef:s,interactionCanvasRef:l,resolutionDirtyRef:c}}function Do(e,t){return $o({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}function _o({children:e,size:t,margin:n,backdropFill:r,overflowVisible:i=!1}){return e||r?/* @__PURE__ */ /* @__PURE__ */(0,Bp.jsxs)("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:i?"visible":void 0},children:[r&&"transparent"!==r?/* @__PURE__ */ /* @__PURE__ */(0,Bp.jsx)("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:r}):null,
105
+ /* @__PURE__ */(0,Dp.jsx)("circle",{cx:n.x,cy:n.y,r:n.r,fill:r?`url(#geopoint-${t}-hatch)`:vo(n.style.fill),fillOpacity:n.style.fillOpacity??.8,stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,opacity:n._decayOpacity??n.style.opacity??1})]},`point-${t}`)}case"line":{const n=e;if(n.path.length<2)return null;const r="M"+n.path.map(e=>`${e[0]},${e[1]}`).join("L");/* @__PURE__ */ /* @__PURE__ */
106
+ return(0,Dp.jsx)("path",{d:r,fill:"none",stroke:n.style.stroke||"#4e79a7",strokeWidth:n.style.strokeWidth??1.5,strokeDasharray:n.style.strokeDasharray,opacity:n.style.opacity??1},`line-${t}`)}case"glyph":{const n=e;return xo(n,n.x,n.y,`geo-glyph-${n.pointId??t}`)}default:return null}}function Ro(){const[e,t]=(0,Fp.useState)(!1);return Op(()=>{t(!0)},[]),e}function Lo(){const e=(0,Fp.useSyncExternalStore)(Bp,Wp,Hp);return(0,Fp.useRef)(e).current}function Po(e){const{hydrated:t,wasHydratingFromSSR:n,storeRef:r,dirtyRef:i,renderFnRef:o,cancelRender:a,cleanup:s}=e;Op(()=>{if(!t)return;const e=r.current;t&&n&&e?.cancelIntroAnimation?.();const s=!!e?.sceneNodes&&e.sceneNodes.length>0;!n&&s&&e?.markStylePaintPending?e.markStylePaintPending():i.current=!0,a?.(),o.current()},[t,n]);const l=(0,Fp.useRef)(s);l.current=s,(0,Fp.useEffect)(()=>()=>l.current?.(),[])}function No(e,t,n){const r=Math.round(t[0]*n),i=Math.round(t[1]*n),o=0===t[0]?n:r/t[0],a=0===t[1]?n:i/t[1],s=`${t[0]}px`,l=`${t[1]}px`;e.style.width!==s&&(e.style.width=s),e.style.height!==l&&(e.style.height=l);const c=e.width!==r||e.height!==i;return e.width!==r&&(e.width=r),e.height!==i&&(e.height=i),{effectiveDprX:o,effectiveDprY:a,resized:c}}function Eo(){if("undefined"!=typeof window&&"function"==typeof window.matchMedia)return vh!==window.matchMedia&&(vh=window.matchMedia,yh=window.matchMedia("(pointer: coarse)")),yh}function Io(e,t,n,r){const i=e.getContext("2d");if(!i)return null;const{effectiveDprX:o,effectiveDprY:a}=No(e,t,r);return i.setTransform(o,0,0,a,0,0),i.translate(n.left,n.top),i}function To(e,t){if("undefined"==typeof window)return 1;const n=window.devicePixelRatio||1,r="undefined"!=typeof window&&(!0===Eo()?.matches||Math.min(window.innerWidth||1/0,window.innerHeight||1/0)<768)?2:3,i="number"==typeof e&&e>0?e:r;if(!t)return Math.max(1,Math.min(n,i));const[o,a]=t,s=Math.min(Math.sqrt(8388608/(o*a)),16384/Math.max(o,a));return Math.max(s<1?0:1,Math.min(n,i,s))}function zo(e){function t(){r||(n(),i=To(),e(),queueMicrotask(()=>{r||o()}))}if("undefined"==typeof window)return()=>{};let n=()=>{},r=!1,i=0;const o=()=>{if("function"!=typeof window.matchMedia)return;const e=`(resolution: ${window.devicePixelRatio||1}dppx)`,r=window.matchMedia(e);r.media.includes("resolution")&&(n=Tn(r,t))};o(),i=To();const a=Eo(),s=()=>{if(r)return;const t=To();t!==i&&(i=t,e())};window.addEventListener("resize",s);const l=Tn(a,s);return()=>{r=!0,window.removeEventListener("resize",s),l(),n()}}function $o(e){const{cancelRender:t,dirtyRef:n,frameRuntime:r,manageFrameRuntime:i,maxDevicePixelRatio:o,scheduleRender:a}=e,s=(0,qp.useRef)(null),l=(0,qp.useRef)(null),c=(0,qp.useRef)(!1),u=(0,qp.useRef)(!1),d=(0,qp.useRef)(!1);return Vp(()=>{!u.current&&(u.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),Po({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),(0,qp.useEffect)(()=>{if(!1!==i)return r.subscribe(()=>{r.isActive?(n.current=!0,a()):t()})},[t,n,r,i,a]),(0,qp.useEffect)(()=>zo(()=>{c.current=!0,a()}),[a]),(0,qp.useEffect)(()=>{d.current?(c.current=!0,a()):d.current=!0},[o,a]),{canvasRef:s,interactionCanvasRef:l,resolutionDirtyRef:c}}function Do(e,t){return $o({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}function _o({children:e,size:t,margin:n,backdropFill:r,overflowVisible:i=!1}){return e||r?/* @__PURE__ */ /* @__PURE__ */(0,Gp.jsxs)("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:i?"visible":void 0},children:[r&&"transparent"!==r?/* @__PURE__ */ /* @__PURE__ */(0,Gp.jsx)("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:r}):null,
107
107
  /* @__PURE__ */
108
- /* @__PURE__ */(0,Bp.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function Fo(e,t,n){if(Object.is(e,t))return!0;if(0===n)return!1;if(Array.isArray(e)&&Array.isArray(t))return Oo(e,t);if(!Bo(e)||!Bo(t))return!1;const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const i of r){if(!Object.prototype.hasOwnProperty.call(t,i))return!1;if(!Fo(e[i],t[i],n-1))return!1}return!0}function Oo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function Bo(e){if(null===e||"object"!=typeof e)return!1;if(Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function Wo(e){const t=(0,Hp.useRef)(e);return Fo(t.current,e,2)||(t.current=e),t.current}function Ho(e){const{background:t,hasBackgroundGraphics:n=!1,themeBackground:r=""}=e;return"transparent"===t?null:n?t||null:t||(r&&"transparent"!==r?r:"")||null}function qo(e){const{background:t,hasBackgroundGraphics:n=!1,themeBackground:r=""}=e;return"transparent"===t||n?null:t||(r&&"transparent"!==r?r:"")||null}function Go(e,t){const{background:n,hasBackgroundGraphics:r=!1,themeBackground:i="",x:o=0,y:a=0,width:s,height:l}=t,c=qo({background:n,hasBackgroundGraphics:r,themeBackground:i});if(!c)return!1;const u=Hn(e,c);return!(!u||"transparent"===u.trim().toLowerCase()||(e.fillStyle=u,e.fillRect(o,a,s,l),0))}function Vo({hoverPoint:t,scene:r,active:i=!0}){let o="";if(i&&t){const i=t.data??t,a="stats"in t?t.stats:void 0,s=a&&r?.find(e=>e.stats===a)||r?.find(e=>e.datum===i)||r?.find(e=>Array.isArray(e.datum)&&e.datum.includes(i)),l=s?n(s):i,c=a&&s&&("boxplot"===s.type||"violin"===s.type)&&Array.isArray(l)?{category:s.category,...e(s.stats)}:l;if(null!=c&&"object"==typeof c){const t=(Array.isArray(c)?c:[c]).map(t=>Object.entries(e(t)).map(([e,t])=>`${e}: ${t}`).join(", ")).filter(Boolean);o=t.length>0?`Data point: ${t.join("; ")}`:""}else o=`Data point: ${String(c)}`}/* @__PURE__ */ /* @__PURE__ */
109
- return(0,Up.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:Vp,children:o})}function Yo({interaction:e,tableId:t,regionLabel:n,countLabel:r,summary:i,children:o,className:a=Sc}){const{isExpanded:s,containerRef:l,triggerRef:c,open:u,handleFocus:d,handleBlur:h,dismiss:f,announcement:p}=e,[m,g]=Gp.useState(!1);/* @__PURE__ */ /* @__PURE__ */
110
- return(0,Xp.jsx)("div",{ref:l,id:t,className:s?a:kc,tabIndex:-1,onFocus:s?void 0:d,onBlur:s?h:void 0,style:s?jc:m?Yp:Vp,role:"region","aria-label":n,children:s?/* @__PURE__ */ /* @__PURE__ */(0,Xp.jsxs)(Xp.Fragment,{children:[
108
+ /* @__PURE__ */(0,Gp.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function Fo(e,t,n){if(Object.is(e,t))return!0;if(0===n)return!1;if(Array.isArray(e)&&Array.isArray(t))return Oo(e,t);if(!Bo(e)||!Bo(t))return!1;const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const i of r){if(!Object.prototype.hasOwnProperty.call(t,i))return!1;if(!Fo(e[i],t[i],n-1))return!1}return!0}function Oo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function Bo(e){if(null===e||"object"!=typeof e)return!1;if(Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function Wo(e){const t=(0,Yp.useRef)(e);return Fo(t.current,e,2)||(t.current=e),t.current}function Ho(e){const{background:t,hasBackgroundGraphics:n=!1,themeBackground:r=""}=e;return"transparent"===t?null:n?t||null:t||(r&&"transparent"!==r?r:"")||null}function qo(e){const{background:t,hasBackgroundGraphics:n=!1,themeBackground:r=""}=e;return"transparent"===t||n?null:t||(r&&"transparent"!==r?r:"")||null}function Go(e,t){const{background:n,hasBackgroundGraphics:r=!1,themeBackground:i="",x:o=0,y:a=0,width:s,height:l}=t,c=qo({background:n,hasBackgroundGraphics:r,themeBackground:i});if(!c)return!1;const u=Hn(e,c);return!(!u||"transparent"===u.trim().toLowerCase()||(e.fillStyle=u,e.fillRect(o,a,s,l),0))}function Vo({hoverPoint:t,scene:r,active:i=!0}){let o="";if(i&&t){const i=t.data??t,a="stats"in t?t.stats:void 0,s=a&&r?.find(e=>e.stats===a)||r?.find(e=>e.datum===i)||r?.find(e=>Array.isArray(e.datum)&&e.datum.includes(i)),l=s?n(s):i,c=a&&s&&("boxplot"===s.type||"violin"===s.type)&&Array.isArray(l)?{category:s.category,...e(s.stats)}:l;if(null!=c&&"object"==typeof c){const t=(Array.isArray(c)?c:[c]).map(t=>Object.entries(e(t)).map(([e,t])=>`${e}: ${t}`).join(", ")).filter(Boolean);o=t.length>0?`Data point: ${t.join("; ")}`:""}else o=`Data point: ${String(c)}`}/* @__PURE__ */ /* @__PURE__ */
109
+ return(0,Qp.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:Zp,children:o})}function Yo({interaction:e,tableId:t,regionLabel:n,countLabel:r,summary:i,children:o,className:a=Cc}){const{isExpanded:s,containerRef:l,triggerRef:c,open:u,handleFocus:d,handleBlur:h,dismiss:f,announcement:p}=e,[m,g]=Xp.useState(!1);/* @__PURE__ */ /* @__PURE__ */
110
+ return(0,Jp.jsx)("div",{ref:l,id:t,className:s?a:Ac,tabIndex:-1,onFocus:s?void 0:d,onBlur:s?h:void 0,style:s?Lc:m?Kp:Zp,role:"region","aria-label":n,children:s?/* @__PURE__ */ /* @__PURE__ */(0,Jp.jsxs)(Jp.Fragment,{children:[
111
111
  /* @__PURE__ */
112
- /* @__PURE__ */(0,Xp.jsx)("div",{role:"status","aria-atomic":"true",style:Vp,children:p}),
112
+ /* @__PURE__ */(0,Jp.jsx)("div",{role:"status","aria-atomic":"true",style:Zp,children:p}),
113
113
  /* @__PURE__ */
114
- /* @__PURE__ */(0,Xp.jsx)("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:f,"aria-label":"Close data summary",style:Cc,children:"×"}),i&&/* @__PURE__ */ /* @__PURE__ */(0,Xp.jsx)("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Ac,children:i}),o]}):/* @__PURE__ */ /* @__PURE__ */(0,Xp.jsxs)("button",{ref:c,type:"button",onClick:u,onFocus:()=>g(!0),onBlur:()=>g(!1),style:Mc,children:["View data summary (",r,")"]})})}function Uo(){const[e,t]=Zp.useState(!1),[n,r]=Zp.useState(""),i=Kp.useContext(Qp),o=i?.visible??!1,a=e||o,s=Zp.useRef(null),l=Zp.useRef(null),c=Zp.useRef(null),u=Zp.useRef(!1),d=Zp.useRef(!1),h=Zp.useRef(null);Jp(()=>{if(a&&!d.current){const e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&!s.current?.contains(e)&&(c.current=e),s.current?.focus()}else if(!a&&d.current){if(u.current){const e=c.current?.isConnected?c.current:l.current;e?.focus()}u.current=!1,c.current=null,h.current=null,r("")}d.current=a;const e=h.current;if(a&&e){const t=e.table.querySelectorAll("tbody tr");t[e.index]?.focus(),h.current=null}});const f=()=>t(!0);return{isExpanded:a,containerRef:s,triggerRef:l,open:f,handleFocus:e=>{e.target!==e.currentTarget||a||(e.relatedTarget instanceof HTMLElement&&(c.current=e.relatedTarget),f())},handleBlur:e=>{o||s.current?.contains(e.relatedTarget)||t(!1)},dismiss:()=>{u.current=!0,o&&i?.setVisible(!1),t(!1)},revealRows:(e,t,n,i,o="rows")=>{const a=e.previousElementSibling;a&&(h.current={table:a,index:t}),r(`${n} of ${i} ${o} shown.`)},announcement:n}}function Xo({accessibleTable:e,children:t}){const n=Ro();return"object"!=typeof e?t:n?/* @__PURE__ */ /* @__PURE__ */(0,tm.jsx)(qp.Suspense,{fallback:null,children:/* @__PURE__ */ /* @__PURE__ */(0,tm.jsx)(nm,{target:e.portalTarget,children:t})}):null}function Zo(e,t){if(!e||0===e.length)return`${t}, empty`;const n={};for(const t of e){if(null===t?.datum)continue;const e=String(t.type);n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return`${t}, empty`;const r=[],i={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},o=Object.keys(i),a=Object.keys(n).sort((e,t)=>{const n=o.indexOf(e),r=o.indexOf(t);return(-1===n?999:n)-(-1===r?999:r)});for(const e of a){const t=i[e]||e;r.push(`${n[e]} ${t}`)}return`${t}, ${r.join(", ")}`}function Ko({accessibleTable:e,...t}){return e?/* @__PURE__ */ /* @__PURE__ */(0,tm.jsxs)(Xo,{accessibleTable:e,children:[
114
+ /* @__PURE__ */(0,Jp.jsx)("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:f,"aria-label":"Close data summary",style:Nc,children:"×"}),i&&/* @__PURE__ */ /* @__PURE__ */(0,Jp.jsx)("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Pc,children:i}),o]}):/* @__PURE__ */ /* @__PURE__ */(0,Jp.jsxs)("button",{ref:c,type:"button",onClick:u,onFocus:()=>g(!0),onBlur:()=>g(!1),style:Rc,children:["View data summary (",r,")"]})})}function Uo(){const[e,t]=em.useState(!1),[n,r]=em.useState(""),i=tm.useContext(nm),o=i?.visible??!1,a=e||o,s=em.useRef(null),l=em.useRef(null),c=em.useRef(null),u=em.useRef(!1),d=em.useRef(!1),h=em.useRef(null);rm(()=>{if(a&&!d.current){const e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&!s.current?.contains(e)&&(c.current=e),s.current?.focus()}else if(!a&&d.current){if(u.current){const e=c.current?.isConnected?c.current:l.current;e?.focus()}u.current=!1,c.current=null,h.current=null,r("")}d.current=a;const e=h.current;if(a&&e){const t=e.table.querySelectorAll("tbody tr");t[e.index]?.focus(),h.current=null}});const f=()=>t(!0);return{isExpanded:a,containerRef:s,triggerRef:l,open:f,handleFocus:e=>{e.target!==e.currentTarget||a||(e.relatedTarget instanceof HTMLElement&&(c.current=e.relatedTarget),f())},handleBlur:e=>{o||s.current?.contains(e.relatedTarget)||t(!1)},dismiss:()=>{u.current=!0,o&&i?.setVisible(!1),t(!1)},revealRows:(e,t,n,i,o="rows")=>{const a=e.previousElementSibling;a&&(h.current={table:a,index:t}),r(`${n} of ${i} ${o} shown.`)},announcement:n}}function Xo({accessibleTable:e,children:t}){const n=Ro();return"object"!=typeof e?t:n?/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)(Up.Suspense,{fallback:null,children:/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)(am,{target:e.portalTarget,children:t})}):null}function Zo(e,t){if(!e||0===e.length)return`${t}, empty`;const n={};for(const t of e){if(null===t?.datum)continue;const e=String(t.type);n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return`${t}, empty`;const r=[],i={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},o=Object.keys(i),a=Object.keys(n).sort((e,t)=>{const n=o.indexOf(e),r=o.indexOf(t);return(-1===n?999:n)-(-1===r?999:r)});for(const e of a){const t=i[e]||e;r.push(`${n[e]} ${t}`)}return`${t}, ${r.join(", ")}`}function Ko({accessibleTable:e,...t}){return e?/* @__PURE__ */ /* @__PURE__ */(0,om.jsxs)(Xo,{accessibleTable:e,children:[
115
115
  /* @__PURE__ */
116
- /* @__PURE__ */(0,tm.jsx)(ea,{tableId:t.tableId}),
116
+ /* @__PURE__ */(0,om.jsx)(ea,{tableId:t.tableId}),
117
117
  /* @__PURE__ */
118
- /* @__PURE__ */(0,tm.jsx)(Qo,{...t})]}):null}function Qo(e){const{scene:t,chartType:n,tableId:r,chartTitle:o}=e,a=Uo(),s=o?`Data summary for ${o}`:r?`Data summary for ${n} ${r}`:`Data summary for ${n}`;return t&&0!==t.length?/* @__PURE__ */ /* @__PURE__ */(0,tm.jsx)(Yo,{interaction:a,tableId:r,regionLabel:s,countLabel:`${i(t)} elements`,children:a.isExpanded&&/* @__PURE__ */ /* @__PURE__ */(0,tm.jsx)(qp.Suspense,{fallback:/* @__PURE__ */ /* @__PURE__ */(0,tm.jsx)("div",{role:"status",children:"Loading data summary…"}),children:/* @__PURE__ */ /* @__PURE__ */(0,tm.jsx)(rm,{...e,revealRows:a.revealRows})})}):r?/* @__PURE__ */ /* @__PURE__ */(0,tm.jsx)("span",{id:r,tabIndex:-1,style:Vp}):null}function Jo({summary:e}){return e?/* @__PURE__ */ /* @__PURE__ */(0,tm.jsx)("div",{role:"note",style:Vp,children:e}):null}function ea({tableId:e}){const[t,n]=qp.useState(!1);/* @__PURE__ */ /* @__PURE__ */
119
- return(0,tm.jsx)("a",{href:`#${e}`,style:t?Yp:Vp,onClick:t=>{t.preventDefault();const n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:()=>n(!0),onBlur:()=>n(!1),children:"Skip to data table"})}function ta(e,t){if(!t)return[];const n=/* @__PURE__ */new Set,r=[];for(const i of e){if(!i||"object"!=typeof i)continue;const e="function"==typeof t?t(i):i[t],o=String(e);n.has(o)||(n.add(o),r.push(o))}return r}function na(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ra(e,t,n,r){const i=(0,im.useRef)({accessor:t,onChange:n,readData:r}),o=(0,im.useRef)([]);i.current={accessor:t,onChange:n,readData:r};const a=(0,im.useCallback)(()=>{const{accessor:t,onChange:n,readData:r}=i.current;if(!n||!t)return;const a=ta(e.current?r(e.current):[],t);na(a,o.current)||(o.current=a,n(a))},[e]);return(0,im.useEffect)(()=>{o.current=[],a()},[t,a,n]),a}function ia({active:e,hoverPoint:t,margin:n,size:r,shape:i="circle",width:o,height:a,pathData:s}){if(!e||!t)return null;const l=t.x+n.left,c=t.y+n.top;let u;if("geoarea"!==i&&"path"!==i||!s)if("rect"===i&&null!=o&&null!=a){const e=Math.max(o,4),t=Math.max(a,4);u=/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)("rect",{x:l-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:am,strokeWidth:2,strokeDasharray:"4,2"})}else u="wedge"===i?/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)("circle",{cx:l,cy:c,r:12,fill:"none",stroke:am,strokeWidth:2.5,strokeDasharray:"6,3"}):/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)("circle",{cx:l,cy:c,r:8,fill:"none",stroke:am,strokeWidth:2,strokeDasharray:"4,2"});else u=/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)("path",{d:s,fill:"none",stroke:am,strokeWidth:2.5,strokeDasharray:"6,3"})});/* @__PURE__ */ /* @__PURE__ */
120
- return(0,om.jsx)("svg",{style:{position:"absolute",left:0,top:0,width:r[0],height:r[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:u})}function oa(e){return null!=e&&"boolean"!=typeof e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.some(oa):!lm.isValidElement(e)||e.type!==lm.Fragment||oa(e.props.children))}function aa(e){return e.ownsChrome=!0,e}function sa(e){if("string"!=typeof e)return null!=e;const t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function la(e){if("function"==typeof e)return!0===e.ownsChrome;if(!lm.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const n=e.props,r=n["data-semiotic-tooltip-chrome"];if(null!=r&&!1!==r&&"false"!==r)return!0;const i=n.style;if(i&&"object"==typeof i){if(sa(i.background))return!0;if(sa(i.backgroundColor))return!0}return!1}function ca({x:e,y:t,containerWidth:n,containerHeight:r,margin:i,children:o,contentOwnsChrome:a=!1,className:s="stream-frame-tooltip",zIndex:l=1}){const c=Number.isFinite(e)&&Number.isFinite(t),u=oa(o),d=sm.useRef(null),[h,f]=sm.useState(null);sm.useLayoutEffect(()=>{const e=d.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();Number.isFinite(t.width)&&Number.isFinite(t.height)&&f(e=>e&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5?e:{width:t.width,height:t.height})};if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[s,n,r,c,u]);const p=sm.useRef(null);let m,g=e,y=t,b=!1,v=!1;if(h){const i=r-t;b=n-e<h.width+12,v=i<h.height+12,g=Math.max(0,Math.min(e+(b?-h.width-12:12),n-h.width)),y=Math.max(0,Math.min(t+(v?-h.height-4:4),r-h.height)),m="none"}else m=`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${t<.3*r?"4px":"calc(-100% - 4px)"})`;const x=h?{flipX:b,flipY:v}:null,w=p.current,k=!x||!w||w.flipX!==x.flipX||w.flipY!==x.flipY;sm.useLayoutEffect(()=>{p.current=x});const S=a||la(o),M=S?null:um,j=S?s:`${s} semiotic-tooltip`.trim();return c&&u?/* @__PURE__ */ /* @__PURE__ */(0,hm.jsx)("div",{ref:d,className:j,"data-placement":x?"placed":"pending","data-flip-x":b?"true":"false","data-flip-y":v?"true":"false",style:{...M||{},position:"absolute",left:i.left+g,top:i.top+y,transform:m,...k&&{transition:"none"},pointerEvents:"none",zIndex:l,width:"max-content",maxWidth:S?n:`min(${n}px, ${um.maxWidth})`,boxSizing:"border-box"},children:o}):null}function ua(e,t){const n=e.fillStyle,r="#010203";try{e.fillStyle=r,e.fillStyle=t}catch{return e.fillStyle=n,[78,121,167]}const i=e.fillStyle;if(e.fillStyle=n,"string"!=typeof i)return[78,121,167];if(i.toLowerCase()===r&&t.trim().toLowerCase()!==r)return[78,121,167];if(i.startsWith("#"))return[parseInt(i.slice(1,3),16),parseInt(i.slice(3,5),16),parseInt(i.slice(5,7),16)];const o=i.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return o?[+o[1],+o[2],+o[3]]:[78,121,167]}function da(e){switch(e){case"monotoneX":return mm.curveMonotoneX;case"monotoneY":return mm.curveMonotoneY;case"cardinal":return mm.curveCardinal;case"catmullRom":return mm.curveCatmullRom;case"step":return mm.curveStep;case"stepBefore":return mm.curveStepBefore;case"stepAfter":return mm.curveStepAfter;case"basis":return mm.curveBasis;case"natural":return mm.curveNatural;default:return null}}function ha(e,t,n){return null==t?n:fi(t)?gi(t,e)||t.background&&Hn(e,t.background)||n:"string"!=typeof t?t:Hn(e,t)||n}function fa(e,t){if(null==t)return;const n=ha(e,t,"");return""===n?void 0:n}function pa(e,t,n,r,i,o,a){const s=t.stops.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity)));if(s.length<2)return null;const l=e.createLinearGradient(r,i,o,a);for(const t of s)l.addColorStop(Math.max(0,Math.min(1,t.offset)),ma(e,t,n));return l}function ma(e,t,n){const r=t.color??n,i=Hn(e,r)||r;if(null==t.opacity)return i;const o=Math.max(0,Math.min(1,t.opacity)),[a,s,l]=ua(e,i);return`rgba(${a},${s},${l},${o})`}function ga(e){return!!(e._pulseIntensity&&e._pulseIntensity>0)}function ya(e,t,n=.6){if(!ga(t))return;const r=t._pulseGlowRadius??4,i=t.r+r*t._pulseIntensity,o=t.cx??t.x??0,a=t.cy??t.y??0;e.beginPath(),e.arc(o,a,i,0,2*Math.PI),e.strokeStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=2*t._pulseIntensity,e.globalAlpha=t._pulseIntensity*n,e.stroke()}function ba(e,t,n,r=.35){ga(t)&&(e.globalAlpha=t._pulseIntensity*r,e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",n?e.fill(n):e.fill())}function va(e,t,n,r){const i=t.filter(e=>"geoarea"===e.type);for(const t of i){if(!t.pathData)continue;t._cachedPath2D||(t._cachedPath2D=new Path2D(t.pathData));const n=t._cachedPath2D,r=fa(e,t.style.fill)||"#e0e0e0";"none"!==r&&(e.fillStyle=r,e.globalAlpha=(t._decayOpacity??1)*(t.style.fillOpacity??1),e.fill(n));const i=t.style.strokeWidth??.5;if(t.style.stroke&&"none"!==t.style.stroke&&i>0){if(e.strokeStyle=Hn(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.globalAlpha=t._decayOpacity??1,t.style.strokeDasharray){const n=t.style.strokeDasharray.split(",").map(Number);e.setLineDash(n)}else e.setLineDash([]);e.stroke(n)}ba(e,t,n),e.globalAlpha=1,e.setLineDash([])}}function xa(e,t,n){let r=n;for(const n of t)"lesser"===n.thresholdType?e<n.value&&(r=n.color):e>n.value&&(r=n.color);return r}function wa(e,t,n,r){if(e.length<2||t.length!==e.length||0===n.length)return[];const i=[],o=(e,t,n)=>{const r=i[i.length-1];r?.color===e?r.path.push(n):i.push({color:e,path:[t,n]})};for(let i=1;i<e.length;i++){const[a,s]=e[i-1],[l,c]=e[i],u=t[i-1],d=t[i]-u,h=[0,...0===d?[]:n.map(({value:e})=>(e-u)/d).filter(e=>e>0&&e<1&&Number.isFinite(e)).sort((e,t)=>e-t).filter((e,t,n)=>0===t||e!==n[t-1]),1];for(let e=1;e<h.length;e++){const t=h[e-1],i=h[e];o(xa(u+d*((t+i)/2),n,r),[a+(l-a)*t,s+(c-s)*t],[a+(l-a)*i,s+(c-s)*i])}}return i}function ka(e,t,n,r,i,o){if(t.length<2)return;const a=[0];for(let e=1;e<t.length;e++){const n=t[e][0]-t[e-1][0],r=t[e][1]-t[e-1][1];a.push(a[e-1]+Math.sqrt(n*n+r*r))}const s=a[a.length-1];if(0===s)return;const l=Math.min(.2*s,40);e.strokeStyle=n,e.lineWidth=r,e.lineCap=o;for(let n=0;n<t.length-1;n++){const r=(a[n]+a[n+1])/2;let o=i;r<l&&(o*=r/l),s-r<l&&(o*=(s-r)/l),e.globalAlpha=Math.max(0,o),e.beginPath(),e.moveTo(t[n][0],t[n][1]),e.lineTo(t[n+1][0],t[n+1][1]),e.stroke()}}function Sa(e,t,n,r,i){if(t.size<=0)return;const o=t.glyph;if(!o||!o.parts?.length)return;const a=An(o,t.size);if(a.scale<=0)return;const s=t._decayOpacity??1,l=(t.style.opacity??1)*s;if(l<=0)return;const c=t=>{const n=ha(e,t,t);return"string"==typeof n?n:t},u=t.color??("string"==typeof t.style.fill?t.style.fill:void 0);e.save(),e.translate(n,r),t.rotation&&e.rotate(t.rotation),e.translate(a.offsetX,a.offsetY),e.scale(a.scale,a.scale),e.globalAlpha=i*l*(t.style.fillOpacity??1);const d=Pn(o,t.fraction??1,t.fractionStart??0,t.fractionDirection??"horizontal");d&&t.ghostColor&&En(e,o,u,t.accent,t.ghostColor,c),d&&(e.beginPath(),e.rect(d.x,d.y,d.width,d.height),e.clip()),En(e,o,u,t.accent,void 0,c),e.restore()}function Ma(e){const{size:t,scale:n,translate:r,clampX:i=!0,clampY:o=!0}=e,a=Math.max(Math.log(n)/Math.LN2-8,0),s=Math.round(a),l=1<<s,c=Math.pow(2,a-s+8),u=r[0]-n/2,d=r[1]-n/2,h=Math.max(i?0:-1/0,Math.floor((0-u)/c)),f=Math.min(i?l:1/0,Math.ceil((t[0]-u)/c)),p=Math.max(o?0:-1/0,Math.floor((0-d)/c)),m=Math.min(o?l:1/0,Math.ceil((t[1]-d)/c)),g=[];for(let e=p;e<m;++e)for(let t=h;t<f;++t)g.push([t,e,s]);return{tiles:g,translate:[u/c,d/c],scale:c}}function ja([e,t,n]){const r=1<<n;return[e-Math.floor(e/r)*r,t,n]}function Aa(e,t,n,r,i){return"function"==typeof e?e(t,n,r,i):e.replace("{z}",String(t)).replace("{x}",String(n)).replace("{y}",String(r)).replace("{r}",i>1?"@2x":"")}function Ca(e){if("string"==typeof e)return`template:${e}`;const t=e;let n=xm.get(t);return null==n&&(n=wm++,xm.set(t,n)),`provider:${n}`}function Ra(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}function La(e,t){const{tileURL:n,projection:r,width:i,height:o,tileCache:a,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),u=r.translate(),d=Ma({size:[i,o],scale:2*c*Math.PI,translate:u}),h=To(l,[i,o]),f=Ca(n);let p=!0;for(const t of d.tiles){const[r,i,o]=ja(t),l=Aa(n,o,r,i,h),c=`${f}|dpr:${h}|${o}/${r}/${i}|${l}`;let u=a.get(c);if(!u){const e=new Image;e.crossOrigin="anonymous";const t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now()};a.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,s?.()},e.src=l,u=t}if(!u.loaded){p=!1;continue}if(u.failed)continue;const m=d.scale,g=d.translate[0],y=d.translate[1],b=(t[0]+g)*m,v=(t[1]+y)*m;e.drawImage(u.img,b-.5,v-.5,m+1,m+1)}return p}function Pa(e){let t=0;for(let n=1;n<e.length;n++){const r=e[n][0]-e[n-1][0],i=e[n][1]-e[n-1][1];t+=Math.sqrt(r*r+i*i)}return t}function Na(e,t){let n=0;for(let r=1;r<e.length;r++){const i=e[r][0]-e[r-1][0],o=e[r][1]-e[r-1][1],a=Math.sqrt(i*i+o*o);if(n+a>=t||r===e.length-1){const s=a>0?(t-n)/a:0,l=a>.001?a:1;return{x:e[r-1][0]+i*s,y:e[r-1][1]+o*s,nx:-o/l,ny:i/l}}n+=a}const r=e[e.length-1];return{x:r[0],y:r[1],nx:0,ny:0}}function Ea(e,t){return"touch"===t?Math.max(e,24):e}function Ia(e){return Array.isArray(e)?e[0]:e}function Ta(e){if(!e)return null;if("heatcell"===e.type)return e.fill||null;if("candlestick"===e.type)return e.isUp?e.upColor:e.downColor;const{style:t}=e;if(!t)return null;const n="string"==typeof t.fill?t.fill:null;return"line"===e.type||"area"===e.type?t.stroke||n||null:n||t.stroke||null}function za(...e){const t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:Mm.createElement(Mm.Fragment,null,...t)}function $a({value:e,children:t}){const n=(em??(em=jm.createContext(null)),em);/* @__PURE__ */ /* @__PURE__ */
121
- return(0,Am.jsx)(n.Provider,{value:e,children:t})}function Da(e,t){return null!=e?/* @__PURE__ */ /* @__PURE__ */(0,Am.jsx)($a,{value:t,children:e}):e}function _a(e){if(!e||"object"!=typeof e)return!1;const t=e;return"string"==typeof t.id&&"function"==typeof t.cacheKey&&"function"==typeof t.drawCanvas&&"function"==typeof t.renderStaticSVG}function Fa(e,t){const n="function"==typeof e?e(t.datum??null,t):e;return _a(n)?n:void 0}function Oa(e,t){if("production"===process.env.NODE_ENV)return;const n=`${e}:${t}`;Cm.has(n)||(Cm.add(n),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function Ba(e){const{context:t,nodes:n,renderMode:r,pixelRatio:i,paintBuiltIn:o}=e;if(!r||"sketchy"===r)return void o(n);let a=[];const s=()=>{a.length&&(o(a),a=[])};for(const e of n){const n=Fa(r,e);if(!n){a.push(e);continue}let l;s(),t.save();try{l=n.drawCanvas({context:t,node:e,style:e.style??{},pixelRatio:i})}finally{t.restore()}l||(Oa(n.id,e.type??"unknown"),o([e]))}s()}function Wa(e){const{node:t,index:n,renderMode:r,fallback:i}=e,o=Fa(r,t);if(!o)return{element:i(),renderedByBackend:!1};const a=o.renderStaticSVG({node:t,style:t.style??{},key:`${o.id}-${n}`});return null!=a?{element:jo(a,t,`${o.id}-${n}-cursor`),renderedByBackend:!0}:(Oa(o.id,t.type??"unknown"),{element:i(),renderedByBackend:!1})}function Ha(e){if(!e)return;const t=[];for(const n of e)if("point"===n.type)t.push(n);else if("glyph"===n.type){const e=n,r=Nn(e.glyph,e.size);t.push({pointId:e.pointId,x:e.x+r.centerDx,y:e.y+r.centerDy,r:r.radius})}return t}function qa(e){if(!Number.isFinite(e))return String(e);const t=Number.isInteger(e)?e:Number(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():String(t)}function Ga(e,t){return t?.length?(Object.defineProperty(e,Rm,{configurable:!0,enumerable:!1,value:t}),e):e}function Va(e){return e?.[Rm]}function Ya(e){return e.parentLine?Ga({...e.parentLine,...e},Va(e)):e}function Ua(e,t){const n=Ya(e),r={};for(const i of t){const t=n[i];if(void 0!==t){r[i]=[t];continue}const o=Va(e)?.map(e=>Ya(e)[i]).filter(e=>void 0!==e);o?.length&&(r[i]=[...new Set(o)])}return r}function Xa(e){const t=!0===e?.__semioticHoverData,n=e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),r=t||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&n;let i=Ia(r?e.data??{}:e);if(!i)return null;if(("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(r&&(void 0!==e.allSeries||void 0!==e.xValue)){const t=Ga({...i},Va(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}return i}function Za(e){return e.getHours()||e.getMinutes()||e.getSeconds()||e.getMilliseconds()?e.toLocaleString():e.toLocaleDateString()}function Ka(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}function Qa(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const n=t.maxEntries??6,r=!1!==t.skipPositional,i=[];for(const[t,n]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;const e=t.toLowerCase();if(r&&Em.has(e))continue;if(null==n)continue;const o=typeof n;("string"===o||"number"===o||"boolean"===o||n instanceof Date)&&i.push({key:t,lower:e,value:n})}if(0===i.length)return{entries:[]};let o=i.findIndex(e=>Lm.includes(e.lower));const a=o>=0;o<0&&(o=i.findIndex(e=>"id"===e.lower)),o<0&&(o=i.findIndex(e=>"string"==typeof e.value));const s=o>=0?i[o]:void 0,l=i.filter((e,t)=>t!==o&&(!a||"id"!==e.lower)),c=Ka(l,Pm),u=Ka(l,Nm),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(const e of l){if(d.length>=n)break;Pm.includes(e.lower)||Nm.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function Ja(e,t){return"function"==typeof t?t(e):e[t]}function es(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?qa(e):String(e);if(e instanceof Date)return Za(e);if("object"==typeof e&&null!==e){const t=e;if(void 0!==t.id)return String(t.id);if(void 0!==t.name)return String(t.name);try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return String(e)}function ts(e={}){const{fields:t,title:n,format:r,style:i={},className:o=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let a;const s=[];if(n){const t=Ja(e,n);a=es(t,r)}if(t&&t.length>0)t.forEach(t=>{let n,i,o;"string"==typeof t?(n=t,i=t,o=r):(n=t.label,i=t.accessor||t.key||"",o=t.format||r);const a=Ja(e,i);s.push({label:n,value:es(a,o)})});else if(!n){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){a=es(e[n],r);break}if(!a){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(a=es(e[t[0]],r))}}/* @__PURE__ */ /* @__PURE__ */
122
- return(0,Im.jsxs)(dm,{className:o,style:i,children:[a&&/* @__PURE__ */ /* @__PURE__ */(0,Im.jsx)("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:a}),s.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Im.jsxs)("div",{style:{marginTop:0===t&&a?"4px":0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Im.jsxs)("span",{children:[e.label,": "]}),e.value]},t))]})}}function ns(e={}){const{fields:t=[],title:n,format:r,style:i={},className:o="",showLabels:a=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const l=[];if(n){const t=Ja(e,n);l.push({value:es(t,r)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let n,i,o;"string"==typeof t?(n=t,i=t,o=r):(n=t.label,i=t.accessor||t.key||"",o=t.format||r);const s=es(Ja(e,i),o);l.push({label:a?n:void 0,value:s})});else{const t=Qa(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:es(t.title,r),bold:!0}),t.entries.forEach(e=>{l.push({label:a?e.key:void 0,value:es(e.value,r)})})}return Array.isArray(l)&&0!==l.length?/* @__PURE__ */ /* @__PURE__ */(0,Im.jsx)(dm,{className:`semiotic-tooltip-multiline ${o}`.trim(),style:i,children:l.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Im.jsxs)("div",{style:{marginBottom:t<l.length-1?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Im.jsxs)("strong",{children:[e.label,s]}),e.value]},t))}):null}}function rs(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function is(e){if(!0!==e){if("function"==typeof e){const t=e,n=e=>{const n=Xa(e);if(!n)return null;const r=t(n);return oa(r)?la(t)||la(r)?r:/* @__PURE__ */ /* @__PURE__ */(0,Im.jsx)(dm,{children:r}):null};return la(t)?aa(n):n}if(!1===e||void 0===e)return!1;if(rs(e)){if("function"==typeof e.content)return Tm||"production"===process.env.NODE_ENV||(Tm=!0,console.warn('[semiotic] tooltip={{ mode: "multi", content }} reached a chart without multi-series hover. content receives one datum and no allSeries.')),is(e.content);"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');const t=ns();return is(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){const t=ts(e);return is(e=>t(e))}if("multi"===e){"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');const e=ns();return is(t=>e(t))}return ts()}}function os(){if(null!==_m)return _m;if("undefined"==typeof window)return!1;const e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t="undefined"!=typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=4,n="undefined"!=typeof navigator&&"number"==typeof navigator.deviceMemory&&navigator.deviceMemory<=4;return _m=e||t||n}function as(){return os()?12:30}function ss(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function ls(e){return e?e.getContext("2d"):null}function cs(e){const t=e.pointer.clientX-e.canvasRect.left-e.margin.left,n=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(t<0||t>e.width||n<0||n>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const r=ls(e.hitCanvasRef.current);if(!r)return{kind:"unavailable"};const i=In(e.scene,t,n,Ea(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,Ea(6,e.pointer.pointerType));if(!i)return{kind:"miss"};const{node:o}=i,a=o.datum,s=Array.isArray(a)?null:a?.properties?a:a?.data||a,l="point"===o.type?o.x:"geoarea"===o.type?o.centroid[0]:t,c="point"===o.type?o.y:"geoarea"===o.type?o.centroid[1]:n;return{kind:"hit",node:o,hover:{...s,...s?.properties||{},data:s,properties:s?.properties,__semioticHoverData:!0,x:l,y:c}}}function us(e){const t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function ds(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"focus"===s?.type&&t({type:"focus",datum:n,inputType:"touch"===s.inputType?"pointer":s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"hover-end",timestamp:l,chartType:o,chartId:a}))}function hs(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"activate"===s?.type&&t({type:"activate",datum:n,inputType:s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"click-end",timestamp:l,chartType:o,chartId:a}))}function fs({customHoverBehavior:e,customClickBehavior:t,onObservation:n,chartId:r,chartType:i}){const o=Boolean(e||n),a=Boolean(t||n),s=(0,Om.useCallback)((t,o)=>{e?.(t,o),ds({onObservation:n,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:i,chartId:r,context:o})},[r,i,e,n]),l=(0,Om.useCallback)((e,o)=>{t?.(e,o),hs({onObservation:n,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:i,chartId:r,context:o})},[r,i,t,n]);return{customHoverBehavior:o?s:void 0,customClickBehavior:a?l:void 0,hasClickBehavior:a}}function ps(e){const t=[];for(const n of e)if("point"===n.type&&null!=n.x&&!1!==n.interactive)t.push({x:n.x,y:n.y,datum:n.datum,shape:"circle"});else if("glyph"===n.type){if(n.size<=0||null==n.datum)continue;const e=Nn(n.glyph,n.size);t.push({x:n.x+e.centerDx,y:n.y+e.centerDy,datum:n.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else if("line"===n.type){if(null==n.datum||n.path.length<2)continue;const e=n.path.slice(1).map((e,t)=>Math.hypot(e[0]-n.path[t][0],e[1]-n.path[t][1]));let r=e.reduce((e,t)=>e+t,0)/2;if(!Number.isFinite(r)||r<=0)continue;for(let i=0;i<e.length;i++){const o=e[i];if(o>0&&r<=o){const e=n.path[i],a=n.path[i+1],s=r/o;t.push({x:e[0]+(a[0]-e[0])*s,y:e[1]+(a[1]-e[1])*s,datum:Ia(n.datum),shape:"path",pathData:`M${n.path.map(e=>e.join(",")).join("L")}`});break}r-=o}}else"geoarea"===n.type&&n.centroid&&!1!==n.interactive&&t.push({x:n.centroid[0],y:n.centroid[1],datum:n.datum,shape:"geoarea",pathData:n.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function ms(e,t,n){switch(e){case"ArrowRight":case"ArrowDown":return t<n-1?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":{const e=Math.max(1,Math.floor(.1*n));return Math.min(t+e,n-1)}case"PageUp":{const e=Math.max(1,Math.floor(.1*n));return Math.max(t-e,0)}case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function gs(e,t,n,r,i,o){const a=n.current;if(t.current<0||!a)return;const s=e=>(e.datum===a.datum||void 0!==a.semanticKey&&e.semanticKey===a.semanticKey)&&e.group===a.group&&e.shape===a.shape,l=e[t.current]&&s(e[t.current])?t.current:e.findIndex(s),c=e[l];if(t.current=l,n.current=c??null,c&&c.datum===a.datum&&c.x===a.x&&c.y===a.y&&c.w===a.w&&c.h===a.h&&c.pathData===a.pathData&&c.stats===a.stats)return;const u=c?o(c):null;r.current=u,i(u)}function ys(e){const t=e.datum;return{...t||{},...t?.properties||{},data:t,properties:t?.properties,x:e.x,y:e.y,__semioticHoverData:!0}}function bs({storeRef:e,hoverRef:t,hoveredNodeRef:n,setHoverPoint:r,customHoverBehavior:i,customClickBehavior:o,scheduleRender:a}){const s=(0,Bm.useRef)(-1),l=(0,Bm.useRef)(null),c=(0,Bm.useCallback)(()=>{const i=e.current;!i||s.current<0||(gs(ps(i.scene),s,l,t,r,ys),s.current<0&&n&&(n.current=null))},[t,n,r,e]),u=(0,Bm.useCallback)(c=>{if(us(c))return;const u=e.current;if(!u)return;const d=()=>{s.current=-1,l.current=null,t.current=null,n&&(n.current=null),r(null),i?.(null),a()};if(0===u.scene.length)return void(s.current>=0&&d());const h=ps(u.scene);if(0===h.length)return void(s.current>=0&&d());let f=s.current;if(f>=h.length&&(d(),f=-1),("Enter"===c.key||" "===c.key)&&f>=0)return c.preventDefault(),void o?.(ys(h[f]),{type:"activate",inputType:"keyboard"});const p=ms(c.key,f<0?-1:f,h.length);if(null===p)return;if(c.preventDefault(),p<0)return void d();const m=f<0?0:p;s.current=m;const g=h[m];l.current=g;const y=ys(g);t.current=y,r(y),i?.(y,{type:"focus",inputType:"keyboard"}),a()},[o,i,t,n,a,r,e]);return{kbFocusIndexRef:s,focusedNavPointRef:l,onKeyDown:u,refreshKeyboardFocus:c}}function vs(e,t,n,r){return"function"==typeof e?e({size:t,margin:n,scales:r}):e}function xs({foregroundGraphics:e,backgroundGraphics:t,size:n,margin:r,scales:i,background:o,themeBackgroundColor:a,resolveScaleAwareGraphics:s=!0}){const l=`var(--semiotic-bg, ${a})`;return{resolvedForeground:s||"function"!=typeof e?vs(e,n,r,i):null,resolvedBackground:s||"function"!=typeof t?vs(t,n,r,i):null,themeBackground:l,surfaceBackground:Ho({background:o,hasBackgroundGraphics:Boolean(t),themeBackground:l})}}function ws(e){const t=/* @__PURE__ */new Set;let n=0,r=e;return{subscribe:e=>(t.add(e),()=>t.delete(e)),getSnapshot:()=>n,sync(e){if(e!==r){r=e,n+=1;for(const e of t)e()}}}}function ks({graphics:e,size:t,margin:n,readScales:r,tracker:i}){return(0,Hm.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot),Wm.createElement(Wm.Fragment,null,vs(e,t,n,r()))}function Ss({tracker:e,readScales:t,...n}){const r=r=>"function"==typeof r?Wm.createElement(ks,{graphics:r,size:n.size,margin:n.margin,readScales:t,tracker:e}):r;return{...xs({...n,resolveScaleAwareGraphics:!1}),resolvedForeground:r(n.foregroundGraphics),resolvedBackground:r(n.backgroundGraphics)}}function Ms(e,t,n){const r=e.current;r.inside=!0,r.clientX=t.clientX,r.clientY=t.clientY,r.pointerType=t.pointerType??n}function js(e){var t,n,r;t=e.canvas,n=e.pointer,r=t=>{const n=cs({pointer:t,canvasRect:e.canvas.getBoundingClientRect(),margin:e.margin,width:e.width,height:e.height,scene:e.store.scene,pointQuadtree:e.geometryMoved?null:e.store.quadtree,maxPointRadius:e.store.maxPointRadius,hitCanvasRef:e.hitCanvasRef});return"hit"===n.kind?wo(n.node):void 0},t&&(n.inside&&"touch"!==n.pointerType?So(t,r(n)):So(t))}function As(e,t){return e.displayName=t,e}function Cs(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 Rs(e,t,n,r){if(!t)return e;const i=(i,...o)=>{const a={...e(i,...o)};if(t.isActive)if(t.predicate(r?r(i):i))n?.selectedStyle&&Object.assign(a,n.selectedStyle);else{const e=n?.unselectedOpacity??.5;a.opacity=e,a.fillOpacity=e,a.strokeOpacity=e,n?.unselectedStyle&&Object.assign(a,n.unselectedStyle)}return a};return Ga(i,[i])}function Ls(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Ps(e){if(!("number"!=typeof e.height||e.height<=0))return e.width>=e.height?"landscape":"portrait"}function Ns(e){if(!("number"!=typeof e.height||e.height<=0))return e.width/e.height}function Es(e,t){const{when:n}=e,r=t.width,i=t.height,o=Ns(t),a=Ps(t);return!("number"==typeof n.minWidth&&r<n.minWidth||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof i||i<n.minHeight)||"number"==typeof n.maxHeight&&("number"!=typeof i||i>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||o<n.minAspectRatio)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function Is(e,t){const n={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])Ls(e[r])&&Ls(t[r])&&(n[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}function Ts(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const r=n.map((e,t)=>({rule:e,index:t})).filter(e=>Es(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:r.reduce((e,t)=>Is(e,t.rule.transform),e),matches:r}}function zs(e,t={}){const n=t.mobileSemantics?.interaction,r="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,i="mobile"===t.mode||"number"==typeof t.width&&t.width<=480,o=!!n||void 0!==r,a=e&&"object"==typeof e?e:void 0;if(!1===e||!1===a?.enabled||void 0===e&&!i&&!o)return Jm;const s=a??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??r??44,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??44,standardControls:s.standardControls??!1}}function $s(e,t,n){const r=eg[e||"primary"],i=e&&"primary"!==e||!n?.width?r.width:n.width,o=e&&"primary"!==e||!n?.height?r.height:n.height,a=Ts({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=a.mode||e||"primary",l=eg[s],c="context"===s||"sparkline"===s,u="primary"===s&&n?.width?n.width:l.width,d="primary"===s&&n?.height?n.height:l.height;return{mode:s,width:a.width??u,height:a.height??d,showAxes:a.showAxes??l.showAxes,showGrid:a.showGrid??l.showGrid,enableHover:a.enableHover??(!!a.linkedHover||l.enableHover),showLegend:a.showLegend??l.showLegend,showLabels:a.showLabels??l.showLabels,title:c?void 0:a.title,description:a.description,summary:a.summary,accessibleTable:a.accessibleTable,xLabel:c?void 0:a.xLabel,yLabel:c?void 0:a.yLabel,categoryLabel:c?void 0:a.categoryLabel,valueLabel:c?void 0:a.valueLabel,marginDefaults:_s(l.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:zs(a.mobileInteraction,{mode:s,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}function Ds(e){return e.compactMode?e.marginDefaults:tg}function _s(e,t,n){if(!1!==t)return e;const r={...e};return"horizontal"===n?r.left=Math.min(r.left,15):r.bottom=Math.min(r.bottom,15),r}function Fs(e,t,n){const r=e.xValue??t?.[n];if(null==r)return null;const i=Number(r);return Number.isFinite(i)?i:null}function Os(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?Ga({...t,xValue:e.xValue},Va(t)):t||{}}function Bs(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function Ws(e){const t=/* @__PURE__ */new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function Hs(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function qs(e,t){const n=(0,rg.useContext)(og),r=(0,rg.useId)(),i=Ws(e),o=i.map(e=>t?.(e)),a=(0,rg.useRef)({categories:[],colors:[]});Hs(a.current.categories,i)&&Hs(a.current.colors,o)||(a.current={categories:i,colors:o});const s=a.current;ag(()=>{if(n)return()=>n.unregisterCategories(r)},[n,r]),ag(()=>{n&&n.registerCategories(r,s)},[n,r,s])}function Gs({data:e,colorBy:t,colorScale:n,getColor:r,strokeColor:i,strokeWidth:o,categories:a}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==i&&(n.stroke=i),void 0!==o&&(n.strokeWidth=o),n},type:"fill",items:(void 0!==a?a:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((i,o)=>{const a="function"==typeof t?e.find(e=>t(e)===i):e.find(e=>e[t]===i),s=a?r(a,t,n):n?n(i):Eh[o%Eh.length];return{label:String(i),color:s,__semioticCategory:!0}}),label:""}]}}function Vs(e,t){if(!t)return[];const n=/* @__PURE__ */new Set;for(const r of e){const e="function"==typeof t?t(r):r[t];null!=e&&n.add(String(e))}return Array.from(n)}function Ys(e,t){return null!=e&&Object.hasOwn(e,t)}function Us(e,t,n){const r=Ys(n,"legendPosition"),i=Ys(n,"legendLayout");return{legendPosition:r?n?.legendPosition??"right":e??"right",legendLayout:i?n?.legendLayout:t}}function Xs({data:e,colorBy:t,colorScale:n,showLegend:r,legendPosition:i,userMargin:o,defaults:a={top:50,bottom:60,left:70,right:40},categories:s,additionalLegend:l,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:p}){const{legendPosition:m,legendLayout:g}=Us(i,d,h),y=Ys(h,"legend"),b=(0,rg.useContext)(ig),v=null!==(0,rg.useContext)(og),x=void 0!==r?r:!b&&!!t,w=!!t&&(x||v),k=(0,ng.useMemo)(()=>w?void 0!==s?s:Vs(e,t):[],[s,t,e,w]);qs(v&&t?k:[],n);const S=(0,ng.useMemo)(()=>{if(!x||!t)return;const r=Gs({data:e,colorBy:t,colorScale:n,getColor:It,categories:k});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[x,t,e,n,k]),M=(0,ng.useMemo)(()=>y?h?.legend:Xn(S,l),[S,l,h?.legend,y]),{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:R,leftAxis:L,rightAxis:P}=p??{},N=void 0!==R,E=void 0!==L,I=void 0!==P,{hasAxis:T,hasAxisLabel:z,rotatedTicks:$}=R??{},{hasAxis:D,hasAxisLabel:_}=L??{},{hasAxis:F,hasAxisLabel:O}=P??{},B=(0,ng.useMemo)(()=>{const e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=dr(a,h?.axes,f),n=n=>{const r=e[n];return"number"==typeof r?r:t[n]},r={top:n("top"),right:n("right"),bottom:n("bottom"),left:n("left")},i={...r};return M&&(sr(r,{legend:M,position:m,size:[c??600,u??400],hasTitle:f,legendLayout:g,minimumMargin:"bottom"===m?80:"top"===m?50:0,axisChrome:void 0===j?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:N?{hasAxis:T,hasAxisLabel:z,rotatedTicks:$}:void 0,leftAxis:E?{hasAxis:D,hasAxisLabel:_}:void 0,rightAxis:I?{hasAxis:F,hasAxisLabel:O}:void 0}}),null!=c&&null!=u&&Qn(r,i,[c,u],m)),r},[a,h?.axes,o,M,m,c,u,g,f,j,A,C,N,T,z,$,E,D,_,I,F,O]);return{legend:M,margin:B,legendPosition:m,legendLayout:g,legendMarginReserved:void 0!==M&&!Ys(h,"margin"),hasAutomaticLegend:void 0!==S}}function Zs(e){const t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function Ks(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function Qs(e,t,n,r=!0,i=!1){const[o,a]=(0,ng.useState)(null),[s,l]=(0,ng.useState)(
123
- /* @__PURE__ */new Set),c=(0,ng.useMemo)(()=>/* @__PURE__ */new Set,[]),u=(0,ng.useMemo)(()=>new Set(n),[n]),d=null!=o&&u.has(o)?o:null,h=(0,ng.useMemo)(()=>{if(0===s.size)return s;const e=new Set(Array.from(s).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===s.size?s:e},[u,c,s]);(0,ng.useEffect)(()=>{r&&t&&e&&"none"!==e||(a(null),l(e=>0===e.size?e:/* @__PURE__ */new Set))},[t,r,e]),(0,ng.useEffect)(()=>{a(e=>null==e||u.has(e)?e:null),l(e=>{if(0===e.size)return e;const t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?/* @__PURE__ */new Set:t.size===e.size?e:t})},[u]);const f=(0,ng.useCallback)(t=>{r&&"highlight"===e&&a(!t||!u.has(t.label)||i&&!0!==t.__semioticCategory?null:t.label)},[u,r,e,i]),p=(0,ng.useCallback)(t=>{!r||"isolate"!==e||!u.has(t.label)||i&&!0!==t.__semioticCategory||l(e=>{const n=new Set(Array.from(e).filter(e=>u.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===u.size?/* @__PURE__ */new Set:n})},[u,r,e,i]),m=(0,ng.useMemo)(()=>{if(!r||!e||"none"===e||!t)return null;const n=e=>{const n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:String(n)};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,r,e,d,h]);return{highlightedCategory:r&&"highlight"===e?d:null,isolatedCategories:r&&"isolate"===e?h:c,onLegendHover:f,onLegendClick:p,legendSelectionHook:m}}function Js(e,t,n,r=5){const[i,o]=n,[a,s]=(0,ng.useState)(null),[l,c]=(0,ng.useState)(/* @__PURE__ */new Map),u=(0,ng.useMemo)(()=>/* @__PURE__ */new Set,[]);(0,ng.useEffect)(()=>{s(null),c(/* @__PURE__ */new Map)},[i,o,r,e]);const d=(0,ng.useCallback)(t=>{if("highlight"!==e||!t)return void("highlight"===e&&s(null));const n=Zs(t);n&&s({key:Ks(t,n),range:n})},[e]),h=(0,ng.useCallback)(t=>{if("isolate"!==e)return;const n=Zs(t);n&&c(e=>{const i=new Map(e),o=Ks(t,n);return i.has(o)?i.delete(o):i.set(o,n),i.size===r?/* @__PURE__ */new Map:i})},[r,e]),f=(0,ng.useMemo)(()=>{const n="highlight"===e&&a?[a.range]:"isolate"===e?[...l.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{const r=t(e);return Number.isFinite(r)&&n.some(([e,t])=>r>=Math.min(e,t)&&r<=Math.max(e,t))}}},[a,l,e,t]);return{highlightedCategory:"highlight"===e?a?.key??null:null,isolatedCategories:"isolate"===e?new Set(l.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}function el(){const e=(0,Qm.useTheme)(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function tl(){const e=(0,Qm.useTheme)();return e?.colors?.sequential||void 0}function nl(e,t,n){const r=(0,Um.useChartCategoryColors)(null!=n),i=el();return(0,Ym.useMemo)(()=>{if(!t)return;const o=r??void 0,a=n??(i&&i.length>0?i:void 0)??"category10";if(0!==e.length){if("function"==typeof t){const n=Array.from(new Set(e.map(e=>String(t(e)))));if(o&&Bs(o)){const e=zt(n.map(e=>({_cat:e})),"_cat",a);return t=>Tt(o,t)??e(t)}return zt(n.map(e=>({_cat:e})),"_cat",a)}if(o&&Bs(o)){const n=zt(e,t,a);return e=>Tt(o,e)??n(e)}return zt(e,t,a)}if(o&&Bs(o)){const e=zt([{_:"a"}],"_",a);return t=>Tt(o,t)??e(t)}},[e,t,n,r,i])}function rl({selection:e,linkedHover:t,fallbackFields:n=sg,unwrapData:r=!1,onObservation:i,chartType:o,chartId:a,onClick:s,hoverHighlight:l,hoverHighlightField:c,colorByField:u,mobileInteraction:d,emitObservations:h=!0}){const f=(0,Ym.useId)(),p=(0,Ym.useMemo)(()=>Cs(t,n),[t,n]),m=(0,Ym.useMemo)(()=>"series"===p?.mode?[p.seriesField||u||n[0]].filter(e=>!!e):p?.fields||n,[p,u,n]),g=(0,Xm.useSelection)({name:e?.name||"__unused__",fields:m}),y=(0,Xm.useLinkedHover)({name:p?.name||"hover",fields:m}),b=(0,Km.useObservationSelector)(e=>e.pushObservation),v=(0,Ym.useCallback)(e=>{i?.(e),b?.(e)},[i,b]),x=e?{isActive:g.isActive,predicate:g.predicate}:null,[w,k]=(0,Ym.useState)(null),S=(0,Ym.useRef)(!1),M=c||u||n[0],j=(0,Ym.useMemo)(()=>{if(!l||null==w||!M)return null;const e=w,t=M;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:String(n[t]??""))===e}},[l,w,M]),A=(0,Ym.useCallback)((e,n)=>{const r=!e&&S.current&&!!d?.enabled&&d.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===p?.mode&&p.xField){const n=Fs(e,t,p.xField);null!=n&&(0,Zm.setCrosshairPosition)(p.name||"hover",n,f)}"x-position"!==p?.mode&&y.onHover(t)}else"x-position"!==p?.mode||r||(0,Zm.clearCrosshairPosition)(p.name||"hover",f),"x-position"===p?.mode||r||y.onHover(null);if(l&&M)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[M];k(null!=n?String(n):null)}else r||k(null);h&&(i||b)&&ds({onObservation:v,datum:e?Os(e):null,x:e?.x,y:e?.y,chartType:o||"unknown",chartId:a,context:n})},[t,y,p,f,i,o,a,b,v,h,l,M,d]),C=(0,Ym.useCallback)((n=!0)=>{S.current=!1,t&&"x-position"!==p?.mode&&y.onHover(null),e&&d?.tapToSelect&&g.clear(),n&&l&&k(null),"x-position"===p?.mode&&((0,Zm.unlockCrosshair)(p.name||"hover",f),(0,Zm.clearCrosshairPosition)(p.name||"hover",f))},[t,p,y,e,d,g,l,f]),R=(0,Ym.useCallback)((n,r)=>{const c=!!d?.enabled&&(d.tapToLockTooltip||d.tapToSelect),u=!!d?.enabled&&"backgroundTap"===d.clearSelection;if("x-position"===p?.mode&&p.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=Fs(n,e,p.xField);null!=t&&(0,Zm.toggleCrosshairLock)(p.name||"hover",t,f)}if(c)if(n){S.current=!0;const r=Os(n);if(t&&"x-position"!==p?.mode&&y.onHover(r),e&&d?.tapToSelect&&m.length>0){const e=Ua(r,m);Bs(e)&&g.selectPoints(e)}if(l&&M){const e=r?.[M];k(null!=e?String(e):null)}}else u&&C();if(n||u){if(n&&s){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),s(e,{x:n.x??0,y:n.y??0})}h&&(i||b)&&hs({onObservation:v,datum:n?Os(n):null,x:n?.x,y:n?.y,chartType:o||"unknown",chartId:a,context:r})}},[s,h,i,b,v,o,a,p,f,d,t,y,e,g,m,l,M,C]);(0,Ym.useEffect)(()=>{if(!d?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&S.current&&C()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.enabled,C]);const L=(0,Ym.useRef)(C);return L.current=C,(0,Ym.useEffect)(()=>()=>{S.current&&L.current(!1)},[]),(0,Ym.useEffect)(()=>{if("x-position"!==p?.mode)return;const e=p.name||"hover";return()=>{(0,Zm.unlockCrosshair)(e,f),(0,Zm.clearCrosshairPosition)(e,f)}},[p?.mode,p?.name,f]),{activeSelectionHook:x,hoverSelectionHook:j,customHoverBehavior:A,customClickBehavior:R,crosshairSourceId:f}}function il(e,t){const n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function ol(e,t,n){return $s(e,t,n)}function al(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function sl(e,t){if(!al(t))return e??((...e)=>({}));const n={};return void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(n.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...n}):(...e)=>({...n})}function ll(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>ul(t(e))}function cl(e,t){const n=ll(t??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=r?r(e):void 0;return{value:n(e),category:null==t?void 0:String(t)}}}function ul(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function dl(e,t,n){const r=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&r!==e.eq)return!1;if(void 0!==e.ne&&r===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(r))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;const i=ul(r);if(void 0===i)return!1;if(void 0!==e.gt&&!(i>e.gt))return!1;if(void 0!==e.gte&&!(i>=e.gte))return!1;if(void 0!==e.lt&&!(i<e.lt))return!1;if(void 0!==e.lte&&!(i<=e.lte))return!1;if(void 0!==e.within){const[t,n]=e.within;if(!(i>=t&&i<=n))return!1}if(void 0!==e.outside){const[t,n]=e.outside;if(!(i<t||i>n))return!1}return!0}function hl(e,t,n){const r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,n):dl(r,t,n))}function fl(e,t,n){if(!t||0===t.length)return{};let r={};for(const i of t){if(!hl(i,e,n))continue;const t="function"==typeof i.style?i.style(e,n):i.style;t&&(r={...r,...t})}return r}function pl(e,t,n,r=e=>e){const i=e??(()=>({}));return t&&0!==t.length?(e,o)=>{const a=r(e),s={...i(e,o)};return Object.assign(s,fl(a,t,n(a,o))),s}:i}function ml({componentName:e,message:t,diagnosticHint:n,width:r,height:i}){/* @__PURE__ */ /* @__PURE__ */
124
- return(0,lg.jsx)("div",{role:"alert",style:{width:r,height:Math.max(i,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:/* @__PURE__ */ /* @__PURE__ */(0,lg.jsxs)("div",{style:{textAlign:"center",maxWidth:400},children:[
118
+ /* @__PURE__ */(0,om.jsx)(Qo,{...t})]}):null}function Qo(e){const{scene:t,chartType:n,tableId:r,chartTitle:o}=e,a=Uo(),s=o?`Data summary for ${o}`:r?`Data summary for ${n} ${r}`:`Data summary for ${n}`;return t&&0!==t.length?/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)(Yo,{interaction:a,tableId:r,regionLabel:s,countLabel:`${i(t)} elements`,children:a.isExpanded&&/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)(Up.Suspense,{fallback:/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)("div",{role:"status",children:"Loading data summary…"}),children:/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)(sm,{...e,revealRows:a.revealRows})})}):r?/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)("span",{id:r,tabIndex:-1,style:Zp}):null}function Jo({summary:e}){return e?/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)("div",{role:"note",style:Zp,children:e}):null}function ea({tableId:e}){const[t,n]=Up.useState(!1);/* @__PURE__ */ /* @__PURE__ */
119
+ return(0,om.jsx)("a",{href:`#${e}`,style:t?Kp:Zp,onClick:t=>{t.preventDefault();const n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:()=>n(!0),onBlur:()=>n(!1),children:"Skip to data table"})}function ta(e,t){if(!t)return[];const n=/* @__PURE__ */new Set,r=[];for(const i of e){if(!i||"object"!=typeof i)continue;const e="function"==typeof t?t(i):i[t],o=String(e);n.has(o)||(n.add(o),r.push(o))}return r}function na(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ra(e,t,n,r){const i=(0,lm.useRef)({accessor:t,onChange:n,readData:r}),o=(0,lm.useRef)([]);i.current={accessor:t,onChange:n,readData:r};const a=(0,lm.useCallback)(()=>{const{accessor:t,onChange:n,readData:r}=i.current;if(!n||!t)return;const a=ta(e.current?r(e.current):[],t);na(a,o.current)||(o.current=a,n(a))},[e]);return(0,lm.useEffect)(()=>{o.current=[],a()},[t,a,n]),a}function ia({active:e,hoverPoint:t,margin:n,size:r,shape:i="circle",width:o,height:a,pathData:s}){if(!e||!t)return null;const l=t.x+n.left,c=t.y+n.top;let u;if("geoarea"!==i&&"path"!==i||!s)if("rect"===i&&null!=o&&null!=a){const e=Math.max(o,4),t=Math.max(a,4);u=/* @__PURE__ */ /* @__PURE__ */(0,cm.jsx)("rect",{x:l-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:um,strokeWidth:2,strokeDasharray:"4,2"})}else u="wedge"===i?/* @__PURE__ */ /* @__PURE__ */(0,cm.jsx)("circle",{cx:l,cy:c,r:12,fill:"none",stroke:um,strokeWidth:2.5,strokeDasharray:"6,3"}):/* @__PURE__ */ /* @__PURE__ */(0,cm.jsx)("circle",{cx:l,cy:c,r:8,fill:"none",stroke:um,strokeWidth:2,strokeDasharray:"4,2"});else u=/* @__PURE__ */ /* @__PURE__ */(0,cm.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:/* @__PURE__ */ /* @__PURE__ */(0,cm.jsx)("path",{d:s,fill:"none",stroke:um,strokeWidth:2.5,strokeDasharray:"6,3"})});/* @__PURE__ */ /* @__PURE__ */
120
+ return(0,cm.jsx)("svg",{style:{position:"absolute",left:0,top:0,width:r[0],height:r[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:u})}function oa(e){return null!=e&&"boolean"!=typeof e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.some(oa):!hm.isValidElement(e)||e.type!==hm.Fragment||oa(e.props.children))}function aa(){const e=globalThis;return e[mm]??(e[mm]=hm.createContext(void 0))}function sa(){return hm.useContext(aa())}function la(e){return e.ownsChrome=!0,e}function ca(e){if("string"!=typeof e)return null!=e;const t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function ua(e){if("function"==typeof e)return!0===e.ownsChrome;if(!hm.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const n=e.props,r=n["data-semiotic-tooltip-chrome"];if(null!=r&&!1!==r&&"false"!==r)return!0;const i=n.style;if(i&&"object"==typeof i){if(ca(i.background))return!0;if(ca(i.backgroundColor))return!0}return!1}function da({x:e,y:t,containerWidth:n,containerHeight:r,margin:i,children:o,contentOwnsChrome:a=!1,className:s="stream-frame-tooltip",zIndex:l=1}){const c=sa(),u=Number.isFinite(e)&&Number.isFinite(t),d=oa(o),h=dm.useRef(null),[f,p]=dm.useState(null);dm.useLayoutEffect(()=>{const e=h.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();Number.isFinite(t.width)&&Number.isFinite(t.height)&&p(e=>e&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5?e:{width:t.width,height:t.height})};if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[s,n,r,u,d]);const m=dm.useRef(null);let g,y=e,v=t,b=!1,x=!1;if(f){const i=r-t;b=n-e<f.width+12,x=i<f.height+12,y=Math.max(0,Math.min(e+(b?-f.width-12:12),n-f.width)),v=Math.max(0,Math.min(t+(x?-f.height-4:4),r-f.height)),g="none"}else g=`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${t<.3*r?"4px":"calc(-100% - 4px)"})`;const w=f?{flipX:b,flipY:x}:null,k=m.current,S=!w||!k||k.flipX!==w.flipX||k.flipY!==w.flipY;dm.useLayoutEffect(()=>{m.current=w});const M="none"===c||a||ua(o),j=M?null:pm,A=M?s:`${s} semiotic-tooltip`.trim();return u&&d?/* @__PURE__ */ /* @__PURE__ */(0,ym.jsx)("div",{ref:h,className:A,"data-placement":w?"placed":"pending","data-flip-x":b?"true":"false","data-flip-y":x?"true":"false",style:{...j||{},position:"absolute",left:i.left+y,top:i.top+v,transform:g,...S&&{transition:"none"},pointerEvents:"none",zIndex:l,width:"max-content",maxWidth:M?n:`min(${n}px, ${pm.maxWidth})`,boxSizing:"border-box"},children:o}):null}function ha(e,t){const n=e.fillStyle,r="#010203";try{e.fillStyle=r,e.fillStyle=t}catch{return e.fillStyle=n,[78,121,167]}const i=e.fillStyle;if(e.fillStyle=n,"string"!=typeof i)return[78,121,167];if(i.toLowerCase()===r&&t.trim().toLowerCase()!==r)return[78,121,167];if(i.startsWith("#"))return[parseInt(i.slice(1,3),16),parseInt(i.slice(3,5),16),parseInt(i.slice(5,7),16)];const o=i.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return o?[+o[1],+o[2],+o[3]]:[78,121,167]}function fa(e){switch(e){case"monotoneX":return xm.curveMonotoneX;case"monotoneY":return xm.curveMonotoneY;case"cardinal":return xm.curveCardinal;case"catmullRom":return xm.curveCatmullRom;case"step":return xm.curveStep;case"stepBefore":return xm.curveStepBefore;case"stepAfter":return xm.curveStepAfter;case"basis":return xm.curveBasis;case"natural":return xm.curveNatural;default:return null}}function pa(e,t,n){return null==t?n:fi(t)?gi(t,e)||t.background&&Hn(e,t.background)||n:"string"!=typeof t?t:Hn(e,t)||n}function ma(e,t){if(null==t)return;const n=pa(e,t,"");return""===n?void 0:n}function ga(e,t,n,r,i,o,a){const s=t.stops.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity)));if(s.length<2)return null;const l=e.createLinearGradient(r,i,o,a);for(const t of s)l.addColorStop(Math.max(0,Math.min(1,t.offset)),ya(e,t,n));return l}function ya(e,t,n){const r=t.color??n,i=Hn(e,r)||r;if(null==t.opacity)return i;const o=Math.max(0,Math.min(1,t.opacity)),[a,s,l]=ha(e,i);return`rgba(${a},${s},${l},${o})`}function va(e){return!!(e._pulseIntensity&&e._pulseIntensity>0)}function ba(e,t,n=.6){if(!va(t))return;const r=t._pulseGlowRadius??4,i=t.r+r*t._pulseIntensity,o=t.cx??t.x??0,a=t.cy??t.y??0;e.beginPath(),e.arc(o,a,i,0,2*Math.PI),e.strokeStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=2*t._pulseIntensity,e.globalAlpha=t._pulseIntensity*n,e.stroke()}function xa(e,t,n,r=.35){va(t)&&(e.globalAlpha=t._pulseIntensity*r,e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",n?e.fill(n):e.fill())}function wa(e,t,n,r){const i=t.filter(e=>"geoarea"===e.type);for(const t of i){if(!t.pathData)continue;t._cachedPath2D||(t._cachedPath2D=new Path2D(t.pathData));const n=t._cachedPath2D,r=ma(e,t.style.fill)||"#e0e0e0";"none"!==r&&(e.fillStyle=r,e.globalAlpha=(t._decayOpacity??1)*(t.style.fillOpacity??1),e.fill(n));const i=t.style.strokeWidth??.5;if(t.style.stroke&&"none"!==t.style.stroke&&i>0){if(e.strokeStyle=Hn(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.globalAlpha=t._decayOpacity??1,t.style.strokeDasharray){const n=t.style.strokeDasharray.split(",").map(Number);e.setLineDash(n)}else e.setLineDash([]);e.stroke(n)}xa(e,t,n),e.globalAlpha=1,e.setLineDash([])}}function ka(e,t,n){let r=n;for(const n of t)"lesser"===n.thresholdType?e<n.value&&(r=n.color):e>n.value&&(r=n.color);return r}function Sa(e,t,n,r){if(e.length<2||t.length!==e.length||0===n.length)return[];const i=[],o=(e,t,n)=>{const r=i[i.length-1];r?.color===e?r.path.push(n):i.push({color:e,path:[t,n]})};for(let i=1;i<e.length;i++){const[a,s]=e[i-1],[l,c]=e[i],u=t[i-1],d=t[i]-u,h=[0,...0===d?[]:n.map(({value:e})=>(e-u)/d).filter(e=>e>0&&e<1&&Number.isFinite(e)).sort((e,t)=>e-t).filter((e,t,n)=>0===t||e!==n[t-1]),1];for(let e=1;e<h.length;e++){const t=h[e-1],i=h[e];o(ka(u+d*((t+i)/2),n,r),[a+(l-a)*t,s+(c-s)*t],[a+(l-a)*i,s+(c-s)*i])}}return i}function Ma(e,t,n,r,i,o){if(t.length<2)return;const a=[0];for(let e=1;e<t.length;e++){const n=t[e][0]-t[e-1][0],r=t[e][1]-t[e-1][1];a.push(a[e-1]+Math.sqrt(n*n+r*r))}const s=a[a.length-1];if(0===s)return;const l=Math.min(.2*s,40);e.strokeStyle=n,e.lineWidth=r,e.lineCap=o;for(let n=0;n<t.length-1;n++){const r=(a[n]+a[n+1])/2;let o=i;r<l&&(o*=r/l),s-r<l&&(o*=(s-r)/l),e.globalAlpha=Math.max(0,o),e.beginPath(),e.moveTo(t[n][0],t[n][1]),e.lineTo(t[n+1][0],t[n+1][1]),e.stroke()}}function ja(e,t,n,r,i){if(t.size<=0)return;const o=t.glyph;if(!o||!o.parts?.length)return;const a=An(o,t.size);if(a.scale<=0)return;const s=t._decayOpacity??1,l=(t.style.opacity??1)*s;if(l<=0)return;const c=t=>{const n=pa(e,t,t);return"string"==typeof n?n:t},u=t.color??("string"==typeof t.style.fill?t.style.fill:void 0);e.save(),e.translate(n,r),t.rotation&&e.rotate(t.rotation),e.translate(a.offsetX,a.offsetY),e.scale(a.scale,a.scale),e.globalAlpha=i*l*(t.style.fillOpacity??1);const d=Pn(o,t.fraction??1,t.fractionStart??0,t.fractionDirection??"horizontal");d&&t.ghostColor&&En(e,o,u,t.accent,t.ghostColor,c),d&&(e.beginPath(),e.rect(d.x,d.y,d.width,d.height),e.clip()),En(e,o,u,t.accent,void 0,c),e.restore()}function Aa(e){const{size:t,scale:n,translate:r,clampX:i=!0,clampY:o=!0}=e,a=Math.max(Math.log(n)/Math.LN2-8,0),s=Math.round(a),l=1<<s,c=Math.pow(2,a-s+8),u=r[0]-n/2,d=r[1]-n/2,h=Math.max(i?0:-1/0,Math.floor((0-u)/c)),f=Math.min(i?l:1/0,Math.ceil((t[0]-u)/c)),p=Math.max(o?0:-1/0,Math.floor((0-d)/c)),m=Math.min(o?l:1/0,Math.ceil((t[1]-d)/c)),g=[];for(let e=p;e<m;++e)for(let t=h;t<f;++t)g.push([t,e,s]);return{tiles:g,translate:[u/c,d/c],scale:c}}function Ca([e,t,n]){const r=1<<n;return[e-Math.floor(e/r)*r,t,n]}function Ra(e,t,n,r,i){return"function"==typeof e?e(t,n,r,i):e.replace("{z}",String(t)).replace("{x}",String(n)).replace("{y}",String(r)).replace("{r}",i>1?"@2x":"")}function La(e){if("string"==typeof e)return`template:${e}`;const t=e;let n=jm.get(t);return null==n&&(n=Am++,jm.set(t,n)),`provider:${n}`}function Pa(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}function Na(e,t){const{tileURL:n,projection:r,width:i,height:o,tileCache:a,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),u=r.translate(),d=Aa({size:[i,o],scale:2*c*Math.PI,translate:u}),h=To(l,[i,o]),f=La(n);let p=!0;for(const t of d.tiles){const[r,i,o]=Ca(t),l=Ra(n,o,r,i,h),c=`${f}|dpr:${h}|${o}/${r}/${i}|${l}`;let u=a.get(c);if(!u){const e=new Image;e.crossOrigin="anonymous";const t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now()};a.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,s?.()},e.src=l,u=t}if(!u.loaded){p=!1;continue}if(u.failed)continue;const m=d.scale,g=d.translate[0],y=d.translate[1],v=(t[0]+g)*m,b=(t[1]+y)*m;e.drawImage(u.img,v-.5,b-.5,m+1,m+1)}return p}function Ea(e){let t=0;for(let n=1;n<e.length;n++){const r=e[n][0]-e[n-1][0],i=e[n][1]-e[n-1][1];t+=Math.sqrt(r*r+i*i)}return t}function Ia(e,t){let n=0;for(let r=1;r<e.length;r++){const i=e[r][0]-e[r-1][0],o=e[r][1]-e[r-1][1],a=Math.sqrt(i*i+o*o);if(n+a>=t||r===e.length-1){const s=a>0?(t-n)/a:0,l=a>.001?a:1;return{x:e[r-1][0]+i*s,y:e[r-1][1]+o*s,nx:-o/l,ny:i/l}}n+=a}const r=e[e.length-1];return{x:r[0],y:r[1],nx:0,ny:0}}function Ta(e,t){return"touch"===t?Math.max(e,24):e}function za(e){return Array.isArray(e)?e[0]:e}function $a(e){if(!e)return null;if("heatcell"===e.type)return e.fill||null;if("candlestick"===e.type)return e.isUp?e.upColor:e.downColor;const{style:t}=e;if(!t)return null;const n="string"==typeof t.fill?t.fill:null;return"line"===e.type||"area"===e.type?t.stroke||n||null:n||t.stroke||null}function Da(...e){const t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:Lm.createElement(Lm.Fragment,null,...t)}function _a({value:e,children:t}){const n=(im??(im=Pm.createContext(null)),im);/* @__PURE__ */ /* @__PURE__ */
121
+ return(0,Nm.jsx)(n.Provider,{value:e,children:t})}function Fa(e,t){return null!=e?/* @__PURE__ */ /* @__PURE__ */(0,Nm.jsx)(_a,{value:t,children:e}):e}function Oa(e){if(!e||"object"!=typeof e)return!1;const t=e;return"string"==typeof t.id&&"function"==typeof t.cacheKey&&"function"==typeof t.drawCanvas&&"function"==typeof t.renderStaticSVG}function Ba(e,t){const n="function"==typeof e?e(t.datum??null,t):e;return Oa(n)?n:void 0}function Wa(e,t){if("production"===process.env.NODE_ENV)return;const n=`${e}:${t}`;Em.has(n)||(Em.add(n),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function Ha(e){const{context:t,nodes:n,renderMode:r,pixelRatio:i,paintBuiltIn:o}=e;if(!r||"sketchy"===r)return void o(n);let a=[];const s=()=>{a.length&&(o(a),a=[])};for(const e of n){const n=Ba(r,e);if(!n){a.push(e);continue}let l;s(),t.save();try{l=n.drawCanvas({context:t,node:e,style:e.style??{},pixelRatio:i})}finally{t.restore()}l||(Wa(n.id,e.type??"unknown"),o([e]))}s()}function qa(e){const{node:t,index:n,renderMode:r,fallback:i}=e,o=Ba(r,t);if(!o)return{element:i(),renderedByBackend:!1};const a=o.renderStaticSVG({node:t,style:t.style??{},key:`${o.id}-${n}`});return null!=a?{element:jo(a,t,`${o.id}-${n}-cursor`),renderedByBackend:!0}:(Wa(o.id,t.type??"unknown"),{element:i(),renderedByBackend:!1})}function Ga(e){if(!e)return;const t=[];for(const n of e)if("point"===n.type)t.push(n);else if("glyph"===n.type){const e=n,r=Nn(e.glyph,e.size);t.push({pointId:e.pointId,x:e.x+r.centerDx,y:e.y+r.centerDy,r:r.radius})}return t}function Va(e){if(!Number.isFinite(e))return String(e);const t=Number.isInteger(e)?e:Number(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():String(t)}function Ya(e,t){return t?.length?(Object.defineProperty(e,Im,{configurable:!0,enumerable:!1,value:t}),e):e}function Ua(e){return e?.[Im]}function Xa(e){return e.parentLine?Ya({...e.parentLine,...e},Ua(e)):e}function Za(e,t){const n=Xa(e),r={};for(const i of t){const t=n[i];if(void 0!==t){r[i]=[t];continue}const o=Ua(e)?.map(e=>Xa(e)[i]).filter(e=>void 0!==e);o?.length&&(r[i]=[...new Set(o)])}return r}function Ka(e){const t=!0===e?.__semioticHoverData,n=e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),r=t||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&n;let i=za(r?e.data??{}:e);if(!i)return null;if(("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(r&&(void 0!==e.allSeries||void 0!==e.xValue)){const t=Ya({...i},Ua(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}return i}function Qa(e){return e.getHours()||e.getMinutes()||e.getSeconds()||e.getMilliseconds()?e.toLocaleString():e.toLocaleDateString()}function Ja(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}function es(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const n=t.maxEntries??6,r=!1!==t.skipPositional,i=[];for(const[t,n]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;const e=t.toLowerCase();if(r&&Dm.has(e))continue;if(null==n)continue;const o=typeof n;("string"===o||"number"===o||"boolean"===o||n instanceof Date)&&i.push({key:t,lower:e,value:n})}if(0===i.length)return{entries:[]};let o=i.findIndex(e=>Tm.includes(e.lower));const a=o>=0;o<0&&(o=i.findIndex(e=>"id"===e.lower)),o<0&&(o=i.findIndex(e=>"string"==typeof e.value));const s=o>=0?i[o]:void 0,l=i.filter((e,t)=>t!==o&&(!a||"id"!==e.lower)),c=Ja(l,zm),u=Ja(l,$m),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(const e of l){if(d.length>=n)break;zm.includes(e.lower)||$m.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function ts(e,t){return"function"==typeof t?t(e):e[t]}function ns(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?Va(e):String(e);if(e instanceof Date)return Qa(e);if("object"==typeof e&&null!==e){const t=e;if(void 0!==t.id)return String(t.id);if(void 0!==t.name)return String(t.name);try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return String(e)}function rs(e,t,n){const r="string"==typeof t?t:t.accessor||t.key||"";return{label:"string"==typeof t?t:t.label,value:ns(ts(e,r),"string"==typeof t?n:t.format||n)}}function is(e={}){const{fields:t,chrome:n,title:r,format:i,style:o={},className:a=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let s;const l=[];if(r){const t=ts(e,r);s=ns(t,i)}if(t&&t.length>0)l.push(...t.map(t=>rs(e,t,i)));else if(!r){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){s=ns(e[n],i);break}if(!s){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(s=ns(e[t[0]],i))}}/* @__PURE__ */ /* @__PURE__ */
122
+ return(0,_m.jsxs)(gm,{chrome:n,className:a,style:o,children:[s&&/* @__PURE__ */ /* @__PURE__ */(0,_m.jsx)("div",{style:{fontWeight:l.length>0?"bold":"normal"},children:s}),l.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,_m.jsxs)("div",{style:{marginTop:0===t&&s?"4px":0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,_m.jsxs)("span",{children:[e.label,": "]}),e.value]},t))]})}}function os(e={}){const{fields:t=[],chrome:n,title:r,format:i,style:o={},className:a="",showLabels:s=!0,separator:l=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const c=[];if(r){const t=ts(e,r);c.push({value:ns(t,i)})}if(t&&Array.isArray(t)&&t.length>0)for(const n of t){const t=rs(e,n,i);c.push({...t,label:s?t.label:void 0})}else{const t=es(e,{skipPositional:!1});null!=t.title&&c.push({label:void 0,value:ns(t.title,i),bold:!0}),t.entries.forEach(e=>{c.push({label:s?e.key:void 0,value:ns(e.value,i)})})}return Array.isArray(c)&&0!==c.length?/* @__PURE__ */ /* @__PURE__ */(0,_m.jsx)(gm,{chrome:n,className:`semiotic-tooltip-multiline ${a}`.trim(),style:o,children:c.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,_m.jsxs)("div",{style:{marginBottom:t<c.length-1?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,_m.jsxs)("strong",{children:[e.label,l]}),e.value]},t))}):null}}function as(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function ss(e){if(!0!==e){if("function"==typeof e||"object"==typeof e&&null!==e&&"content"in e&&"function"==typeof e.content&&!as(e)){const t="function"==typeof e?e:e.content,n="function"==typeof e?void 0:e.chrome,r=e=>{const r=Ka(e);if(!r)return null;const i=t(r);return oa(i)?void 0===n&&(ua(t)||ua(i))?i:/* @__PURE__ */ /* @__PURE__ */(0,_m.jsx)(gm,{chrome:n,children:i}):null};return void 0===n&&ua(t)?la(r):r}if(!1===e||void 0===e)return!1;if(as(e)){if("function"==typeof e.content)return Fm||"production"===process.env.NODE_ENV||(Fm=!0,console.warn('[semiotic] tooltip={{ mode: "multi", content }} reached a chart without multi-series hover. content receives one datum and no allSeries.')),ss(void 0===e.chrome?e.content:{content:e.content,chrome:e.chrome});"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');const t=os({chrome:e.chrome});return ss(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e||"chrome"in e)){const t=is(e);return ss(e=>t(e))}if("multi"===e){"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');const e=os();return ss(t=>e(t))}return is()}}function ls(){if(null!==Hm)return Hm;if("undefined"==typeof window)return!1;const e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t="undefined"!=typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=4,n="undefined"!=typeof navigator&&"number"==typeof navigator.deviceMemory&&navigator.deviceMemory<=4;return Hm=e||t||n}function cs(){return ls()?12:30}function us(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function ds(e){return e?e.getContext("2d"):null}function hs(e){const t=e.pointer.clientX-e.canvasRect.left-e.margin.left,n=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(t<0||t>e.width||n<0||n>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const r=ds(e.hitCanvasRef.current);if(!r)return{kind:"unavailable"};const i=In(e.scene,t,n,Ta(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,Ta(6,e.pointer.pointerType));if(!i)return{kind:"miss"};const{node:o}=i,a=o.datum,s=Array.isArray(a)?null:a?.properties?a:a?.data||a,l="point"===o.type?o.x:"geoarea"===o.type?o.centroid[0]:t,c="point"===o.type?o.y:"geoarea"===o.type?o.centroid[1]:n;return{kind:"hit",node:o,hover:{...s,...s?.properties||{},data:s,properties:s?.properties,__semioticHoverData:!0,x:l,y:c}}}function fs(e){const t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function ps(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"focus"===s?.type&&t({type:"focus",datum:n,inputType:"touch"===s.inputType?"pointer":s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"hover-end",timestamp:l,chartType:o,chartId:a}))}function ms(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"activate"===s?.type&&t({type:"activate",datum:n,inputType:s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"click-end",timestamp:l,chartType:o,chartId:a}))}function gs({customHoverBehavior:e,customClickBehavior:t,onObservation:n,chartId:r,chartType:i}){const o=Boolean(e||n),a=Boolean(t||n),s=(0,Gm.useCallback)((t,o)=>{e?.(t,o),ps({onObservation:n,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:i,chartId:r,context:o})},[r,i,e,n]),l=(0,Gm.useCallback)((e,o)=>{t?.(e,o),ms({onObservation:n,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:i,chartId:r,context:o})},[r,i,t,n]);return{customHoverBehavior:o?s:void 0,customClickBehavior:a?l:void 0,hasClickBehavior:a}}function ys(e){const t=[];for(const n of e)if("point"===n.type&&null!=n.x&&!1!==n.interactive)t.push({x:n.x,y:n.y,datum:n.datum,shape:"circle"});else if("glyph"===n.type){if(n.size<=0||null==n.datum)continue;const e=Nn(n.glyph,n.size);t.push({x:n.x+e.centerDx,y:n.y+e.centerDy,datum:n.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else if("line"===n.type){if(null==n.datum||n.path.length<2)continue;const e=n.path.slice(1).map((e,t)=>Math.hypot(e[0]-n.path[t][0],e[1]-n.path[t][1]));let r=e.reduce((e,t)=>e+t,0)/2;if(!Number.isFinite(r)||r<=0)continue;for(let i=0;i<e.length;i++){const o=e[i];if(o>0&&r<=o){const e=n.path[i],a=n.path[i+1],s=r/o;t.push({x:e[0]+(a[0]-e[0])*s,y:e[1]+(a[1]-e[1])*s,datum:za(n.datum),shape:"path",pathData:`M${n.path.map(e=>e.join(",")).join("L")}`});break}r-=o}}else"geoarea"===n.type&&n.centroid&&!1!==n.interactive&&t.push({x:n.centroid[0],y:n.centroid[1],datum:n.datum,shape:"geoarea",pathData:n.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function vs(e,t,n){switch(e){case"ArrowRight":case"ArrowDown":return t<n-1?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":{const e=Math.max(1,Math.floor(.1*n));return Math.min(t+e,n-1)}case"PageUp":{const e=Math.max(1,Math.floor(.1*n));return Math.max(t-e,0)}case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function bs(e,t,n,r,i,o){const a=n.current;if(t.current<0||!a)return;const s=e=>(e.datum===a.datum||void 0!==a.semanticKey&&e.semanticKey===a.semanticKey)&&e.group===a.group&&e.shape===a.shape,l=e[t.current]&&s(e[t.current])?t.current:e.findIndex(s),c=e[l];if(t.current=l,n.current=c??null,c&&c.datum===a.datum&&c.x===a.x&&c.y===a.y&&c.w===a.w&&c.h===a.h&&c.pathData===a.pathData&&c.stats===a.stats)return;const u=c?o(c):null;r.current=u,i(u)}function xs(e){const t=e.datum;return{...t||{},...t?.properties||{},data:t,properties:t?.properties,x:e.x,y:e.y,__semioticHoverData:!0}}function ws({clearPointerHover:e,storeRef:t,hoverRef:n,hoveredNodeRef:r,setHoverPoint:i,customHoverBehavior:o,customClickBehavior:a,scheduleRender:s}){const l=(0,Vm.useRef)(-1),c=(0,Vm.useRef)(null),u=(0,Vm.useCallback)(()=>{const e=t.current;!e||l.current<0||(bs(ys(e.scene),l,c,n,i,xs),l.current<0&&r&&(r.current=null))},[n,r,i,t]),d=(0,Vm.useCallback)(u=>{if(fs(u))return;const d=t.current;if(!d)return;const h=()=>{const e=null!==n.current;l.current=-1,c.current=null,n.current=null,r&&(r.current=null),i(null),e&&o?.(null),s()};if("Escape"===u.key)return u.preventDefault(),e?.(),void h();if(0===d.scene.length)return void(l.current>=0&&h());const f=ys(d.scene);if(0===f.length)return void(l.current>=0&&h());let p=l.current;if(p>=f.length&&(h(),p=-1),("Enter"===u.key||" "===u.key)&&p>=0)return u.preventDefault(),void a?.(xs(f[p]),{type:"activate",inputType:"keyboard"});const m=vs(u.key,p<0?-1:p,f.length);if(null===m)return;if(u.preventDefault(),m<0)return void h();const g=p<0?0:m;l.current=g;const y=f[g];c.current=y;const v=xs(y);n.current=v,i(v),o?.(v,{type:"focus",inputType:"keyboard"}),s()},[e,a,o,n,r,s,i,t]);return{kbFocusIndexRef:l,focusedNavPointRef:c,onKeyDown:d,refreshKeyboardFocus:u}}function ks(e,t,n,r){return"function"==typeof e?e({size:t,margin:n,scales:r}):e}function Ss({foregroundGraphics:e,backgroundGraphics:t,size:n,margin:r,scales:i,background:o,themeBackgroundColor:a,resolveScaleAwareGraphics:s=!0}){const l=`var(--semiotic-bg, ${a})`;return{resolvedForeground:s||"function"!=typeof e?ks(e,n,r,i):null,resolvedBackground:s||"function"!=typeof t?ks(t,n,r,i):null,themeBackground:l,surfaceBackground:Ho({background:o,hasBackgroundGraphics:Boolean(t),themeBackground:l})}}function Ms(e){const t=/* @__PURE__ */new Set;let n=0,r=e;return{subscribe:e=>(t.add(e),()=>t.delete(e)),getSnapshot:()=>n,sync(e){if(e!==r){r=e,n+=1;for(const e of t)e()}}}}function js({graphics:e,size:t,margin:n,readScales:r,tracker:i}){return(0,Um.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot),Ym.createElement(Ym.Fragment,null,ks(e,t,n,r()))}function As({tracker:e,readScales:t,...n}){const r=r=>"function"==typeof r?Ym.createElement(js,{graphics:r,size:n.size,margin:n.margin,readScales:t,tracker:e}):r;return{...Ss({...n,resolveScaleAwareGraphics:!1}),resolvedForeground:r(n.foregroundGraphics),resolvedBackground:r(n.backgroundGraphics)}}function Cs(e,t,n){const r=e.current;r.inside=!0,r.clientX=t.clientX,r.clientY=t.clientY,r.pointerType=t.pointerType??n}function Rs(e){var t,n,r;t=e.canvas,n=e.pointer,r=t=>{const n=hs({pointer:t,canvasRect:e.canvas.getBoundingClientRect(),margin:e.margin,width:e.width,height:e.height,scene:e.store.scene,pointQuadtree:e.geometryMoved?null:e.store.quadtree,maxPointRadius:e.store.maxPointRadius,hitCanvasRef:e.hitCanvasRef});return"hit"===n.kind?wo(n.node):void 0},t&&(n.inside&&"touch"!==n.pointerType?So(t,r(n)):So(t))}function Ls(e,t){return e.displayName=t,e}function Ps(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 Ns(e,t,n,r){if(!t)return e;const i=(i,...o)=>{const a={...e(i,...o)};if(t.isActive)if(t.predicate(r?r(i):i))n?.selectedStyle&&Object.assign(a,n.selectedStyle);else{const e=n?.unselectedOpacity??.5;a.opacity=e,a.fillOpacity=e,a.strokeOpacity=e,n?.unselectedStyle&&Object.assign(a,n.unselectedStyle)}return a};return Ya(i,[i])}function Es(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Is(e){if(!("number"!=typeof e.height||e.height<=0))return e.width>=e.height?"landscape":"portrait"}function Ts(e){if(!("number"!=typeof e.height||e.height<=0))return e.width/e.height}function zs(e,t){const{when:n}=e,r=t.width,i=t.height,o=Ts(t),a=Is(t);return!("number"==typeof n.minWidth&&r<n.minWidth||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof i||i<n.minHeight)||"number"==typeof n.maxHeight&&("number"!=typeof i||i>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||o<n.minAspectRatio)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function $s(e,t){const n={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])Es(e[r])&&Es(t[r])&&(n[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}function Ds(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const r=n.map((e,t)=>({rule:e,index:t})).filter(e=>zs(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:r.reduce((e,t)=>$s(e,t.rule.transform),e),matches:r}}function _s(e,t={}){const n=t.mobileSemantics?.interaction,r="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,i="mobile"===t.mode||"number"==typeof t.width&&t.width<=480,o=!!n||void 0!==r,a=e&&"object"==typeof e?e:void 0;if(!1===e||!1===a?.enabled||void 0===e&&!i&&!o)return ig;const s=a??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??r??44,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??44,standardControls:s.standardControls??!1}}function Fs(e,t,n){const r=og[e||"primary"],i=e&&"primary"!==e||!n?.width?r.width:n.width,o=e&&"primary"!==e||!n?.height?r.height:n.height,a=Ds({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=a.mode||e||"primary",l=og[s],c="context"===s||"sparkline"===s,u="primary"===s&&n?.width?n.width:l.width,d="primary"===s&&n?.height?n.height:l.height;return{mode:s,width:a.width??u,height:a.height??d,showAxes:a.showAxes??l.showAxes,showGrid:a.showGrid??l.showGrid,enableHover:a.enableHover??(!!a.linkedHover||l.enableHover),showLegend:a.showLegend??l.showLegend,showLabels:a.showLabels??l.showLabels,title:c?void 0:a.title,description:a.description,summary:a.summary,accessibleTable:a.accessibleTable,xLabel:c?void 0:a.xLabel,yLabel:c?void 0:a.yLabel,categoryLabel:c?void 0:a.categoryLabel,valueLabel:c?void 0:a.valueLabel,marginDefaults:Bs(l.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:_s(a.mobileInteraction,{mode:s,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}function Os(e){return e.compactMode?e.marginDefaults:ag}function Bs(e,t,n){if(!1!==t)return e;const r={...e};return"horizontal"===n?r.left=Math.min(r.left,15):r.bottom=Math.min(r.bottom,15),r}function Ws(e,t,n){const r=e.xValue??t?.[n];if(null==r)return null;const i=Number(r);return Number.isFinite(i)?i:null}function Hs(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?Ya({...t,xValue:e.xValue},Ua(t)):t||{}}function qs(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function Gs(e){const t=/* @__PURE__ */new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function Vs(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ys(e,t){const n=(0,lg.useContext)(ug),r=(0,lg.useId)(),i=Gs(e),o=i.map(e=>t?.(e)),a=(0,lg.useRef)({categories:[],colors:[]});Vs(a.current.categories,i)&&Vs(a.current.colors,o)||(a.current={categories:i,colors:o});const s=a.current;dg(()=>{if(n)return()=>n.unregisterCategories(r)},[n,r]),dg(()=>{n&&n.registerCategories(r,s)},[n,r,s])}function Us({data:e,colorBy:t,colorScale:n,getColor:r,strokeColor:i,strokeWidth:o,categories:a}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==i&&(n.stroke=i),void 0!==o&&(n.strokeWidth=o),n},type:"fill",items:(void 0!==a?a:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((i,o)=>{const a="function"==typeof t?e.find(e=>t(e)===i):e.find(e=>e[t]===i),s=a?r(a,t,n):n?n(i):$h[o%$h.length];return{label:String(i),color:s,__semioticCategory:!0}}),label:""}]}}function Xs(e,t){if(!t)return[];const n=/* @__PURE__ */new Set;for(const r of e){const e="function"==typeof t?t(r):r[t];null!=e&&n.add(String(e))}return Array.from(n)}function Zs(e,t){return null!=e&&Object.hasOwn(e,t)}function Ks(e,t,n){const r=Zs(n,"legendPosition"),i=Zs(n,"legendLayout");return{legendPosition:r?n?.legendPosition??"right":e??"right",legendLayout:i?n?.legendLayout:t}}function Qs({data:e,colorBy:t,colorScale:n,showLegend:r,legendPosition:i,userMargin:o,defaults:a={top:50,bottom:60,left:70,right:40},categories:s,additionalLegend:l,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:p}){const{legendPosition:m,legendLayout:g}=Ks(i,d,h),y=Zs(h,"legend"),v=(0,lg.useContext)(cg),b=null!==(0,lg.useContext)(ug),x=void 0!==r?r:!v&&!!t,w=!!t&&(x||b),k=(0,sg.useMemo)(()=>w?void 0!==s?s:Xs(e,t):[],[s,t,e,w]);Ys(b&&t?k:[],n);const S=(0,sg.useMemo)(()=>{if(!x||!t)return;const r=Us({data:e,colorBy:t,colorScale:n,getColor:It,categories:k});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[x,t,e,n,k]),M=(0,sg.useMemo)(()=>y?h?.legend:Xn(S,l),[S,l,h?.legend,y]),{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:R,leftAxis:L,rightAxis:P}=p??{},N=void 0!==R,E=void 0!==L,I=void 0!==P,{hasAxis:T,hasAxisLabel:z,rotatedTicks:$}=R??{},{hasAxis:D,hasAxisLabel:_}=L??{},{hasAxis:F,hasAxisLabel:O}=P??{},B=(0,sg.useMemo)(()=>{const e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=dr(a,h?.axes,f),n=n=>{const r=e[n];return"number"==typeof r?r:t[n]},r={top:n("top"),right:n("right"),bottom:n("bottom"),left:n("left")},i={...r};return M&&(sr(r,{legend:M,position:m,size:[c??600,u??400],hasTitle:f,legendLayout:g,minimumMargin:"bottom"===m?80:"top"===m?50:0,axisChrome:void 0===j?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:N?{hasAxis:T,hasAxisLabel:z,rotatedTicks:$}:void 0,leftAxis:E?{hasAxis:D,hasAxisLabel:_}:void 0,rightAxis:I?{hasAxis:F,hasAxisLabel:O}:void 0}}),null!=c&&null!=u&&Qn(r,i,[c,u],m)),r},[a,h?.axes,o,M,m,c,u,g,f,j,A,C,N,T,z,$,E,D,_,I,F,O]);return{legend:M,margin:B,legendPosition:m,legendLayout:g,legendMarginReserved:void 0!==M&&!Zs(h,"margin"),hasAutomaticLegend:void 0!==S}}function Js(e){const t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function el(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function tl(e,t,n,r=!0,i=!1){const[o,a]=(0,sg.useState)(null),[s,l]=(0,sg.useState)(
123
+ /* @__PURE__ */new Set),c=(0,sg.useMemo)(()=>/* @__PURE__ */new Set,[]),u=(0,sg.useMemo)(()=>new Set(n),[n]),d=null!=o&&u.has(o)?o:null,h=(0,sg.useMemo)(()=>{if(0===s.size)return s;const e=new Set(Array.from(s).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===s.size?s:e},[u,c,s]);(0,sg.useEffect)(()=>{r&&t&&e&&"none"!==e||(a(null),l(e=>0===e.size?e:/* @__PURE__ */new Set))},[t,r,e]),(0,sg.useEffect)(()=>{a(e=>null==e||u.has(e)?e:null),l(e=>{if(0===e.size)return e;const t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?/* @__PURE__ */new Set:t.size===e.size?e:t})},[u]);const f=(0,sg.useCallback)(t=>{r&&"highlight"===e&&a(!t||!u.has(t.label)||i&&!0!==t.__semioticCategory?null:t.label)},[u,r,e,i]),p=(0,sg.useCallback)(t=>{!r||"isolate"!==e||!u.has(t.label)||i&&!0!==t.__semioticCategory||l(e=>{const n=new Set(Array.from(e).filter(e=>u.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===u.size?/* @__PURE__ */new Set:n})},[u,r,e,i]),m=(0,sg.useMemo)(()=>{if(!r||!e||"none"===e||!t)return null;const n=e=>{const n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:String(n)};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,r,e,d,h]);return{highlightedCategory:r&&"highlight"===e?d:null,isolatedCategories:r&&"isolate"===e?h:c,onLegendHover:f,onLegendClick:p,legendSelectionHook:m}}function nl(e,t,n,r=5){const[i,o]=n,[a,s]=(0,sg.useState)(null),[l,c]=(0,sg.useState)(/* @__PURE__ */new Map),u=(0,sg.useMemo)(()=>/* @__PURE__ */new Set,[]);(0,sg.useEffect)(()=>{s(null),c(/* @__PURE__ */new Map)},[i,o,r,e]);const d=(0,sg.useCallback)(t=>{if("highlight"!==e||!t)return void("highlight"===e&&s(null));const n=Js(t);n&&s({key:el(t,n),range:n})},[e]),h=(0,sg.useCallback)(t=>{if("isolate"!==e)return;const n=Js(t);n&&c(e=>{const i=new Map(e),o=el(t,n);return i.has(o)?i.delete(o):i.set(o,n),i.size===r?/* @__PURE__ */new Map:i})},[r,e]),f=(0,sg.useMemo)(()=>{const n="highlight"===e&&a?[a.range]:"isolate"===e?[...l.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{const r=t(e);return Number.isFinite(r)&&n.some(([e,t])=>r>=Math.min(e,t)&&r<=Math.max(e,t))}}},[a,l,e,t]);return{highlightedCategory:"highlight"===e?a?.key??null:null,isolatedCategories:"isolate"===e?new Set(l.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}function rl(){const e=(0,rg.useTheme)(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function il(){const e=(0,rg.useTheme)();return e?.colors?.sequential||void 0}function ol(e,t,n){const r=(0,Jm.useChartCategoryColors)(null!=n),i=rl();return(0,Qm.useMemo)(()=>{if(!t)return;const o=r??void 0,a=n??(i&&i.length>0?i:void 0)??"category10";if(0!==e.length){if("function"==typeof t){const n=Array.from(new Set(e.map(e=>String(t(e)))));if(o&&qs(o)){const e=zt(n.map(e=>({_cat:e})),"_cat",a);return t=>Tt(o,t)??e(t)}return zt(n.map(e=>({_cat:e})),"_cat",a)}if(o&&qs(o)){const n=zt(e,t,a);return e=>Tt(o,e)??n(e)}return zt(e,t,a)}if(o&&qs(o)){const e=zt([{_:"a"}],"_",a);return t=>Tt(o,t)??e(t)}},[e,t,n,r,i])}function al({selection:e,linkedHover:t,fallbackFields:n=hg,unwrapData:r=!1,onObservation:i,chartType:o,chartId:a,onClick:s,hoverHighlight:l,hoverHighlightField:c,colorByField:u,mobileInteraction:d,emitObservations:h=!0}){const f=(0,Qm.useId)(),p=(0,tg.useCrosshairActions)(),{setCrosshairPosition:m,clearCrosshairPosition:g,toggleCrosshairLock:y,unlockCrosshair:v}=p,b=(0,Qm.useRef)(p);b.current=p;const x=(0,Qm.useMemo)(()=>Ps(t,n),[t,n]),w=(0,Qm.useMemo)(()=>"series"===x?.mode?[x.seriesField||u||n[0]].filter(e=>!!e):x?.fields||n,[x,u,n]),k=(0,eg.useSelection)({name:e?.name||"__unused__",fields:w}),S=(0,eg.useLinkedHover)({name:x?.name||"hover",fields:w}),M=(0,ng.useObservationSelector)(e=>e.pushObservation),j=(0,Qm.useCallback)(e=>{i?.(e),M?.(e)},[i,M]),A=e?{isActive:k.isActive,predicate:k.predicate}:null,[C,R]=(0,Qm.useState)(null),L=(0,Qm.useRef)(!1),P=c||u||n[0],N=(0,Qm.useMemo)(()=>{if(!l||null==C||!P)return null;const e=C,t=P;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:String(n[t]??""))===e}},[l,C,P]),E=(0,Qm.useCallback)((e,n)=>{const r=!e&&L.current&&!!d?.enabled&&d.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===x?.mode&&x.xField){const n=Ws(e,t,x.xField);null!=n&&m(x.name||"hover",n,f)}"x-position"!==x?.mode&&S.onHover(t)}else"x-position"!==x?.mode||r||g(x.name||"hover",f),"x-position"===x?.mode||r||S.onHover(null);if(l&&P)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[P];R(null!=n?String(n):null)}else r||R(null);h&&(i||M)&&ps({onObservation:j,datum:e?Hs(e):null,x:e?.x,y:e?.y,chartType:o||"unknown",chartId:a,context:n})},[t,S,x,f,i,o,a,M,j,h,l,P,d,m,g]),I=(0,Qm.useCallback)((n=!0)=>{L.current=!1,t&&"x-position"!==x?.mode&&S.onHover(null),e&&d?.tapToSelect&&k.clear(),n&&l&&R(null),"x-position"===x?.mode&&(v(x.name||"hover",f),g(x.name||"hover",f))},[t,x,S,e,d,k,l,f,g,v]),T=(0,Qm.useCallback)((n,r)=>{const c=!!d?.enabled&&(d.tapToLockTooltip||d.tapToSelect),u=!!d?.enabled&&"backgroundTap"===d.clearSelection;if("x-position"===x?.mode&&x.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=Ws(n,e,x.xField);null!=t&&y(x.name||"hover",t,f)}if(c)if(n){L.current=!0;const r=Hs(n);if(t&&"x-position"!==x?.mode&&S.onHover(r),e&&d?.tapToSelect&&w.length>0){const e=Za(r,w);qs(e)&&k.selectPoints(e)}if(l&&P){const e=r?.[P];R(null!=e?String(e):null)}}else u&&I();if(n||u){if(n&&s){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),s(e,{x:n.x??0,y:n.y??0})}h&&(i||M)&&ms({onObservation:j,datum:n?Hs(n):null,x:n?.x,y:n?.y,chartType:o||"unknown",chartId:a,context:r})}},[s,h,i,M,j,o,a,x,f,d,t,S,e,k,w,l,P,I,y]);(0,Qm.useEffect)(()=>{if(!d?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&L.current&&I()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.enabled,I]);const z=(0,Qm.useRef)(I);return z.current=I,(0,Qm.useEffect)(()=>()=>{L.current&&z.current(!1)},[]),(0,Qm.useEffect)(()=>{if("x-position"!==x?.mode)return;const e=x.name||"hover";return()=>{b.current.releaseCrosshair(e,f)}},[x?.mode,x?.name,f]),{activeSelectionHook:A,hoverSelectionHook:N,customHoverBehavior:E,customClickBehavior:T,crosshairSourceId:f}}function sl(e,t){const n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function ll(e,t,n){return Fs(e,t,n)}function cl(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function ul(e,t){if(!cl(t))return e??((...e)=>({}));const n={};return void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(n.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...n}):(...e)=>({...n})}function dl(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>fl(t(e))}function hl(e,t){const n=dl(t??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=r?r(e):void 0;return{value:n(e),category:null==t?void 0:String(t)}}}function fl(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function pl(e,t,n){const r=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&r!==e.eq)return!1;if(void 0!==e.ne&&r===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(r))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;const i=fl(r);if(void 0===i)return!1;if(void 0!==e.gt&&!(i>e.gt))return!1;if(void 0!==e.gte&&!(i>=e.gte))return!1;if(void 0!==e.lt&&!(i<e.lt))return!1;if(void 0!==e.lte&&!(i<=e.lte))return!1;if(void 0!==e.within){const[t,n]=e.within;if(!(i>=t&&i<=n))return!1}if(void 0!==e.outside){const[t,n]=e.outside;if(!(i<t||i>n))return!1}return!0}function ml(e,t,n){const r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,n):pl(r,t,n))}function gl(e,t,n){if(!t||0===t.length)return{};let r={};for(const i of t){if(!ml(i,e,n))continue;const t="function"==typeof i.style?i.style(e,n):i.style;t&&(r={...r,...t})}return r}function yl(e,t,n,r=e=>e){const i=e??(()=>({}));return t&&0!==t.length?(e,o)=>{const a=r(e),s={...i(e,o)};return Object.assign(s,gl(a,t,n(a,o))),s}:i}function vl({componentName:e,message:t,diagnosticHint:n,width:r,height:i}){/* @__PURE__ */ /* @__PURE__ */
124
+ return(0,fg.jsx)("div",{role:"alert",style:{width:r,height:Math.max(i,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:/* @__PURE__ */ /* @__PURE__ */(0,fg.jsxs)("div",{style:{textAlign:"center",maxWidth:400},children:[
125
125
  /* @__PURE__ */
126
- /* @__PURE__ */(0,lg.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),
126
+ /* @__PURE__ */(0,fg.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),
127
127
  /* @__PURE__ */
128
- /* @__PURE__ */(0,lg.jsx)("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&/* @__PURE__ */ /* @__PURE__ */(0,lg.jsx)("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 gl({componentName:e,width:t,height:n,children:r}){/* @__PURE__ */ /* @__PURE__ */
129
- return(0,hg.jsx)(dg,{fallback:r=>/* @__PURE__ */ /* @__PURE__ */(0,hg.jsx)(ml,{componentName:e,message:r.message,width:t,height:n}),children:r})}function yl(e,t,n,r){return!1===r||null==e||Array.isArray(e)&&e.length>0?null:Array.isArray(e)?/* @__PURE__ */ /* @__PURE__ */(0,hg.jsx)("div",{style:{...fg,width:t,height:n},children:r||"No data available"}):null}function bl(e,t,n,r){if(!e)return null;if(!1===r)return null;if(null!=r)/* @__PURE__ */ /* @__PURE__ */
130
- return(0,hg.jsx)("div",{style:{width:t,height:n,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:r});const i=Math.min(5,Math.floor(n/40)),o=Math.max(8,Math.floor(n/(3*i))),a=Math.max(6,Math.floor(n/(2.5*i))),s=Math.floor((n-(i*(o+a)-a))/2);/* @__PURE__ */ /* @__PURE__ */
131
- return(0,hg.jsx)("div",{style:{width:t,height:n,position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:Array.from({length:i},(e,n)=>/* @__PURE__ */ /* @__PURE__ */(0,hg.jsx)("div",{className:"semiotic-loading-bar",style:{...pg,position:"absolute",top:s+n*(o+a),left:Math.floor(.1*t),width:30+(37*n+13)%50+"%",height:o,opacity:.5+n%2*.2}},n))})}function vl(e,t,n,r){if("production"===process.env.NODE_ENV)return;if(!t||0===t.length)return;if("string"!=typeof r)return;const i=t[0];if(!i||"object"!=typeof i)return;if(r in i)return;const o=Object.keys(i).join(", ");console.warn(`[semiotic] ${e}: ${n} "${r}" not found in data. Available keys: ${o}`)}function xl(e){const t=(0,gg.useThemeSelector)(e=>e.theme.colors.selectionOpacity);return(0,mg.useMemo)(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}function wl(e){return"default"in e?e.default:e}async function kl(e){try{switch(e){case"world-110m":return{topology:wl(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:wl(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:wl(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:wl(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw new Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){const n=t instanceof Error?t.message:String(t);if(/Cannot find module|Failed to resolve|world-atlas/i.test(n))throw new Error(`resolveReferenceGeography("${e}"): ${wg}`,{cause:t});throw t}}async function Sl(e){const t=xg.get(e);if(t)return t;const{topology:n,objectName:r}=await kl(e);if(!n||!n.objects)throw new Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof n} with keys: ${n?Object.keys(n).join(", "):"none"}`);const i=(0,vg.feature)(n,n.objects[r]),o="features"in i?i.features:[i];return xg.set(e,o),o}function Ml(e){const t=(0,bg.useMemo)(()=>Array.isArray(e)?e:void 0,[e]),[n,r]=(0,bg.useState)(null);return(0,bg.useEffect)(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return r(null),Sl(e).then(e=>{t||r(e)}),()=>{t=!0}}var t;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),r(null)}else r(null)},[e]),void 0!==t?t:n}function jl(e){const{title:t,description:n,summary:r,accessibleTable:i,className:o,animate:a,maxDevicePixelRatio:s,axisExtent:l,autoPlaceAnnotations:c}=e,u={};return t&&(u.title=t),n&&(u.description=n),r&&(u.summary=r),void 0!==i&&(u.accessibleTable=i),o&&(u.className=o),null!=a&&(u.animate=a),void 0!==s&&(u.maxDevicePixelRatio=s),void 0!==l&&(u.axisExtent=l),void 0!==c&&(u.autoPlaceAnnotations=c),u}function Al(e){const{linkedHover:t,selection:n,onObservation:r,onClick:i,hoverRadius:o,hoverHighlight:a,forceHoverBehavior:s,forceClickBehavior:l,mobileInteraction:c,customHoverBehavior:u,customClickBehavior:d,linkedHoverInClickPredicate:h=!0}=e,f={};r&&(f.annotationObservationCallback=r);const p=c?.enabled?Math.max(o??30,Math.ceil((c.targetSize||44)/2),24):o;(s||t||r||i||a)&&(f.customHoverBehavior=u);const m=h?r||i||t:r||i,g=c?.enabled&&(c.tapToSelect||c.tapToLockTooltip)&&(t||a||n);return d&&(l||m||g)&&(f.customClickBehavior=d),null!=p&&(f.hoverRadius=p),f}function Cl(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function Rl(e){const{data:t,rawData:n,colorBy:r,colorScheme:i,legendInteraction:o,legendPosition:a,selection:s,linkedHover:l,fallbackFields:c,unwrapData:u=!1,onObservation:d,chartType:h,chartId:f,showLegend:p,legend:m,legendLayout:g,frameLegend:y,userMargin:b,marginDefaults:v,onClick:x,hoverHighlight:w,mobileInteraction:k,mobileSemantics:S,loading:M,loadingContent:j,emptyContent:A,width:C,height:R,hasTitle:L,axisChrome:P}=e,N=void 0===n,E=(0,jg.useMemo)(()=>yn(t),[t]),[I,T]=(0,jg.useState)([]),z=(0,jg.useCallback)(e=>{T(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[]),$="string"==typeof r?r:void 0,D=(0,jg.useMemo)(()=>zs(k,{width:C,mobileSemantics:S}),[k,C,S]),{activeSelectionHook:_,hoverSelectionHook:F,customHoverBehavior:O,customClickBehavior:B,crosshairSourceId:W}=rl({selection:s,linkedHover:l,fallbackFields:c,unwrapData:u,onObservation:d,chartType:h,chartId:f,onClick:x,hoverHighlight:w,colorByField:$,mobileInteraction:D}),H=il(l,W),q=nl(E,r,i),G=(0,jg.useMemo)(()=>Vs(E,r),[E,r]),V=(0,jg.useMemo)(()=>N&&I.length>0?I:G,[N,I,G]),Y=Qs(o,r,V),U=(0,jg.useMemo)(()=>F||(Y.legendSelectionHook?Y.legendSelectionHook:_),[F,Y.legendSelectionHook,_]),X=xl(s),Z=el(),K=(0,Ag.useChartCategoryColors)(null!=i),Q=(0,jg.useMemo)(()=>{if(q&&(!N||0===V.length))return q;if(!r||0===V.length)return;const e=Array.isArray(i)&&i.length>0||"string"==typeof i&&i.length>0?i:Z&&Z.length>0?Z:Eh,t="__streamCat",n=zt(V.map(e=>({[t]:e})),t,e);return e=>(K?Tt(K,e):void 0)??(i&&"object"==typeof i&&!Array.isArray(i)?Tt(i,e):void 0)??n(e)??"#999"},[q,N,r,V,i,Z,K]),{legend:J,margin:ee,legendPosition:te,legendLayout:ne,legendMarginReserved:re}=Xs({data:E,colorBy:r,colorScale:Q,showLegend:p,legendPosition:a,userMargin:b,defaults:v,categories:V,additionalLegend:m,chartWidth:C,chartHeight:R,legendLayout:g,frameLegend:y,hasTitle:L,axisChrome:P}),ie=(0,jg.useMemo)(()=>{const e={};return J&&(e.legend=J,e.legendPosition=te,re&&(e.__legendMarginReservedFor=J),ne&&(e.legendLayout=ne)),o&&"none"!==o&&(e.legendHoverBehavior=Y.onLegendHover,e.legendClickBehavior=Y.onLegendClick,e.legendHighlightedCategory=Y.highlightedCategory,e.legendIsolatedCategories=Y.isolatedCategories),N&&r&&(e.legendCategoryAccessor=r,e.onCategoriesChange=z),e},[J,te,ne,re,o,Y.onLegendHover,Y.onLegendClick,Y.highlightedCategory,Y.isolatedCategories,N,r,z]),oe=Array.isArray(n)?yn(n):n,ae=bl(M,C,R,j),se=ae?null:yl(oe,C,R,A);return{data:E,colorScale:Q,categoryColorScale:Q,allCategories:V,legendState:Y,effectiveSelectionHook:U,activeSelectionHook:_,customHoverBehavior:O,customClickBehavior:B,mobileInteraction:D,legend:J,margin:ee,legendPosition:te,earlyReturn:ae||se||null,legendBehaviorProps:ie,crosshairProps:H,resolvedSelection:X}}function Ll(e,t){const{variant:n,frameRef:r,overrides:i}=t,o=(0,Cg.useRef)(i);o.current=i,(0,Cg.useImperativeHandle)(e,()=>{const e=Pl(n,r);return new Proxy(e,{get(e,t,n){if("string"==typeof t){const e=o.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,n)},has:(e,t)=>!("string"!=typeof t||!o.current||!(t in o.current))||Reflect.has(e,t)})},[])}function Pl(e,t){if("xy"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,n)=>e.current?.update(t,n)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{const n=Array.isArray(t)?t:[t];if(e.current?.removeNodes)return e.current.removeNodes(n);const r=e.current?.getTopology()?.nodes??[],i=[];for(const t of n){const n=r.find(e=>e.id===t);n&&i.push({...n.data??{},id:t}),e.current?.removeNode(t)}return i},update:(t,n)=>{const r=Array.isArray(t)?t:[t];return e.current?.updateNodes?e.current.updateNodes(r,n):r.flatMap(t=>{const r=e.current?.updateNode(t,n);return r?[{...r,id:t}]:[]})},clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,n)=>{const r=e.current?.removePoint(t)??[];for(const t of r)e.current?.push(n(t));return r},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const n=t;return{push:e=>n.current?.pushLine(e),pushMany:e=>n.current?.pushManyLines(e),remove:e=>n.current?.removeLine(e)??[],update:(e,t)=>{const r=n.current?.removeLine(e)??[];for(const e of r)n.current?.pushLine(t(e));return r},clear:()=>n.current?.clear(),getData:()=>n.current?.getLines()??[],getCustomLayout:()=>n.current?.getCustomLayout?.()??null,getLayoutFailure:()=>n.current?.getLayoutFailure?.()??null}}function Nl(e,t,n){const[r,i]=n;if(!t)return r;const[o,a]=t,s=a>o?a-o:0,l=Number(e),c=Number.isFinite(l)?l:o,u=s>0?(c-o)/s:0;return r+Math.max(0,Math.min(1,u))*(i-r)}function El(e){const{valueAccessor:t,valueDomain:n,edgeWidthRange:r,resolveStroke:i,edgeOpacity:o,edgeLinecap:a,styleRules:s}=e,l=ll(t);return pl(e=>({stroke:i(e),strokeWidth:Nl(e[t],n,r),strokeLinecap:a,opacity:o,fillOpacity:0}),s,e=>({value:l(e)}))}function Il({bottomMargin:e,costLabel:t,layout:{cx:n,cy:r,maxCost:i,availableRadius:o,layout:a},ringStyle:s,ringValues:l,showNorth:c,showRingLabels:u,showRings:d}){const h="strip"===a,f={stroke:h?"var(--semiotic-border, #999)":"#999",strokeWidth:h?1:.8,strokeDasharray:h?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:h?8:10,...s};return h?/* @__PURE__ */ /* @__PURE__ */(0,Bg.jsxs)("g",{children:[
128
+ /* @__PURE__ */(0,fg.jsx)("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&/* @__PURE__ */ /* @__PURE__ */(0,fg.jsx)("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 bl(e,t,n){return{width:n?.responsiveWidth?"100%":e,height:n?.responsiveHeight?"100%":t}}function xl({componentName:e,width:t,height:n,children:r}){/* @__PURE__ */ /* @__PURE__ */
129
+ return(0,yg.jsx)(gg,{fallback:r=>/* @__PURE__ */ /* @__PURE__ */(0,yg.jsx)(vl,{componentName:e,message:r.message,width:t,height:n}),children:r})}function wl(e,t,n,r,i){return!1===r||null==e?null:Array.isArray(e)?e.some(e=>null!=e&&"object"==typeof e)?null:/* @__PURE__ */ /* @__PURE__ */(0,yg.jsx)("div",{style:{...vg,...bl(t,n,i)},children:r||"No data available"}):null}function kl(e,t,n,r,i){if(!e)return null;if(!1===r)return null;if(null!=r)/* @__PURE__ */ /* @__PURE__ */
130
+ return(0,yg.jsx)("div",{style:{...bl(t,n,i),display:"flex",flexDirection:"column",alignItems:"stretch",textAlign:"center",justifyContent:"center",boxSizing:"border-box"},children:r});const o=Math.max(1,Math.min(5,Math.floor(n/40))),a=Math.max(8,Math.floor(n/(3*o))),s=Math.max(6,Math.floor(n/(2.5*o))),l=Math.floor((n-(o*(a+s)-s))/2),c=e=>i?.responsiveHeight?100*e/Math.max(1,n)+"%":e,u=Array.from({length:o},(e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,yg.jsx)("div",{className:"semiotic-loading-bar",style:{...bg,position:"absolute",top:c(l+t*(a+s)),left:"10%",width:30+(37*t+13)%50+"%",height:c(a),opacity:.5+t%2*.2}},t));/* @__PURE__ */ /* @__PURE__ */
131
+ return(0,yg.jsx)("div",{style:{...bl(t,n,i),position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:u})}function Sl(e,t,n,r){if("production"===process.env.NODE_ENV)return;if(!t||0===t.length)return;if("string"!=typeof r)return;const i=t[0];if(!i||"object"!=typeof i)return;if(r in i)return;const o=Object.keys(i).join(", ");console.warn(`[semiotic] ${e}: ${n} "${r}" not found in data. Available keys: ${o}`)}function Ml(e){const t=(0,wg.useThemeSelector)(e=>e.theme.colors.selectionOpacity);return(0,xg.useMemo)(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}function jl(e){return"default"in e?e.default:e}async function Al(e){try{switch(e){case"world-110m":return{topology:jl(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:jl(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:jl(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:jl(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw new Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){const n=t instanceof Error?t.message:String(t);if(/Cannot find module|Failed to resolve|world-atlas/i.test(n))throw new Error(`resolveReferenceGeography("${e}"): ${Ag}`,{cause:t});throw t}}async function Cl(e){const t=jg.get(e);if(t)return t;const{topology:n,objectName:r}=await Al(e);if(!n||!n.objects)throw new Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof n} with keys: ${n?Object.keys(n).join(", "):"none"}`);const i=(0,Mg.feature)(n,n.objects[r]),o="features"in i?i.features:[i];return jg.set(e,o),o}function Rl(e){const t=(0,Sg.useMemo)(()=>Array.isArray(e)?e:void 0,[e]),[n,r]=(0,Sg.useState)(null);return(0,Sg.useEffect)(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return r(null),Cl(e).then(e=>{t||r(e)}),()=>{t=!0}}var t;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),r(null)}else r(null)},[e]),void 0!==t?t:n}function Ll(e){const{title:t,description:n,summary:r,accessibleTable:i,className:o,animate:a,maxDevicePixelRatio:s,axisExtent:l,autoPlaceAnnotations:c}=e,u={};return t&&(u.title=t),n&&(u.description=n),r&&(u.summary=r),void 0!==i&&(u.accessibleTable=i),o&&(u.className=o),null!=a&&(u.animate=a),void 0!==s&&(u.maxDevicePixelRatio=s),void 0!==l&&(u.axisExtent=l),void 0!==c&&(u.autoPlaceAnnotations=c),u}function Pl(e){const{linkedHover:t,selection:n,onObservation:r,onClick:i,hoverRadius:o,hoverHighlight:a,forceHoverBehavior:s,forceClickBehavior:l,mobileInteraction:c,customHoverBehavior:u,customClickBehavior:d,linkedHoverInClickPredicate:h=!0}=e,f={};r&&(f.annotationObservationCallback=r);const p=c?.enabled?Math.max(o??30,Math.ceil((c.targetSize||44)/2),24):o;(s||t||r||i||a)&&(f.customHoverBehavior=u);const m=h?r||i||t:r||i,g=c?.enabled&&(c.tapToSelect||c.tapToLockTooltip)&&(t||a||n);return d&&(l||m||g)&&(f.customClickBehavior=d),null!=p&&(f.hoverRadius=p),f}function Nl(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function El(e){const{data:t,rawData:n,colorBy:r,colorScheme:i,legendInteraction:o,legendPosition:a,selection:s,linkedHover:l,fallbackFields:c,unwrapData:u=!1,onObservation:d,chartType:h,chartId:f,showLegend:p,legend:m,legendLayout:g,frameLegend:y,userMargin:v,marginDefaults:b,onClick:x,hoverHighlight:w,mobileInteraction:k,mobileSemantics:S,loading:M,loadingContent:j,emptyContent:A,width:C,height:R,hasTitle:L,axisChrome:P}=e,N=void 0===n,E=(0,Pg.useMemo)(()=>yn(t),[t]),[I,T]=(0,Pg.useState)([]),z=(0,Pg.useCallback)(e=>{T(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[]),$="string"==typeof r?r:void 0,D=(0,Pg.useMemo)(()=>_s(k,{width:C,mobileSemantics:S}),[k,C,S]),{activeSelectionHook:_,hoverSelectionHook:F,customHoverBehavior:O,customClickBehavior:B,crosshairSourceId:W}=al({selection:s,linkedHover:l,fallbackFields:c,unwrapData:u,onObservation:d,chartType:h,chartId:f,onClick:x,hoverHighlight:w,colorByField:$,mobileInteraction:D}),H=sl(l,W),q=ol(E,r,i),G=(0,Pg.useMemo)(()=>Xs(E,r),[E,r]),V=(0,Pg.useMemo)(()=>N&&I.length>0?I:G,[N,I,G]),Y=tl(o,r,V),U=(0,Pg.useMemo)(()=>F||(Y.legendSelectionHook?Y.legendSelectionHook:_),[F,Y.legendSelectionHook,_]),X=Ml(s),Z=rl(),K=(0,Ng.useChartCategoryColors)(null!=i),Q=(0,Pg.useMemo)(()=>{if(q&&(!N||0===V.length))return q;if(!r||0===V.length)return;const e=Array.isArray(i)&&i.length>0||"string"==typeof i&&i.length>0?i:Z&&Z.length>0?Z:$h,t="__streamCat",n=zt(V.map(e=>({[t]:e})),t,e);return e=>(K?Tt(K,e):void 0)??(i&&"object"==typeof i&&!Array.isArray(i)?Tt(i,e):void 0)??n(e)??"#999"},[q,N,r,V,i,Z,K]),{legend:J,margin:ee,legendPosition:te,legendLayout:ne,legendMarginReserved:re}=Qs({data:E,colorBy:r,colorScale:Q,showLegend:p,legendPosition:a,userMargin:v,defaults:b,categories:V,additionalLegend:m,chartWidth:C,chartHeight:R,legendLayout:g,frameLegend:y,hasTitle:L,axisChrome:P}),ie=(0,Pg.useMemo)(()=>{const e={};return J&&(e.legend=J,e.legendPosition=te,re&&(e.__legendMarginReservedFor=J),ne&&(e.legendLayout=ne)),o&&"none"!==o&&(e.legendHoverBehavior=Y.onLegendHover,e.legendClickBehavior=Y.onLegendClick,e.legendHighlightedCategory=Y.highlightedCategory,e.legendIsolatedCategories=Y.isolatedCategories),N&&r&&(e.legendCategoryAccessor=r,e.onCategoriesChange=z),e},[J,te,ne,re,o,Y.onLegendHover,Y.onLegendClick,Y.highlightedCategory,Y.isolatedCategories,N,r,z]),oe=kl(M,C,R,j,e.responsive),ae=oe?null:wl(n,C,R,A,e.responsive);return{data:E,colorScale:Q,categoryColorScale:Q,allCategories:V,legendState:Y,effectiveSelectionHook:U,activeSelectionHook:_,customHoverBehavior:O,customClickBehavior:B,mobileInteraction:D,legend:J,margin:ee,legendPosition:te,earlyReturn:oe||ae||null,legendBehaviorProps:ie,crosshairProps:H,resolvedSelection:X}}function Il(e,t){const{variant:n,frameRef:r,overrides:i}=t,o=(0,Eg.useRef)(i);o.current=i,(0,Eg.useImperativeHandle)(e,()=>{const e=Tl(n,r);return new Proxy(e,{get(e,t,n){if("string"==typeof t){const e=o.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,n)},has:(e,t)=>!("string"!=typeof t||!o.current||!(t in o.current))||Reflect.has(e,t)})},[])}function Tl(e,t){if("xy"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,n)=>e.current?.update(t,n)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{const n=Array.isArray(t)?t:[t];if(e.current?.removeNodes)return e.current.removeNodes(n);const r=e.current?.getTopology()?.nodes??[],i=[];for(const t of n){const n=r.find(e=>e.id===t);n&&i.push({...n.data??{},id:t}),e.current?.removeNode(t)}return i},update:(t,n)=>{const r=Array.isArray(t)?t:[t];return e.current?.updateNodes?e.current.updateNodes(r,n):r.flatMap(t=>{const r=e.current?.updateNode(t,n);return r?[{...r,id:t}]:[]})},clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,n)=>{const r=e.current?.removePoint(t)??[];for(const t of r)e.current?.push(n(t));return r},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const n=t;return{push:e=>n.current?.pushLine(e),pushMany:e=>n.current?.pushManyLines(e),remove:e=>n.current?.removeLine(e)??[],update:(e,t)=>{const r=n.current?.removeLine(e)??[];for(const e of r)n.current?.pushLine(t(e));return r},clear:()=>n.current?.clear(),getData:()=>n.current?.getLines()??[],getCustomLayout:()=>n.current?.getCustomLayout?.()??null,getLayoutFailure:()=>n.current?.getLayoutFailure?.()??null}}function zl(e,t,n){const[r,i]=n;if(!t)return r;const[o,a]=t,s=a>o?a-o:0,l=Number(e),c=Number.isFinite(l)?l:o,u=s>0?(c-o)/s:0;return r+Math.max(0,Math.min(1,u))*(i-r)}function $l(e){const{valueAccessor:t,valueDomain:n,edgeWidthRange:r,resolveStroke:i,edgeOpacity:o,edgeLinecap:a,styleRules:s}=e,l=dl(t);return yl(e=>({stroke:i(e),strokeWidth:zl(e[t],n,r),strokeLinecap:a,opacity:o,fillOpacity:0}),s,e=>({value:l(e)}))}function Dl({bottomMargin:e,costLabel:t,layout:{cx:n,cy:r,maxCost:i,availableRadius:o,layout:a},ringStyle:s,ringValues:l,showNorth:c,showRingLabels:u,showRings:d}){const h="strip"===a,f={stroke:h?"var(--semiotic-border, #999)":"#999",strokeWidth:h?1:.8,strokeDasharray:h?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:h?8:10,...s};return h?/* @__PURE__ */ /* @__PURE__ */(0,Vg.jsxs)("g",{children:[
132
132
  /* @__PURE__ */
133
- /* @__PURE__ */(0,Bg.jsx)("line",{x1:n,y1:r,x2:n+o,y2:r,stroke:f.stroke,strokeWidth:f.strokeWidth,strokeLinecap:"round",opacity:.85}),
133
+ /* @__PURE__ */(0,Vg.jsx)("line",{x1:n,y1:r,x2:n+o,y2:r,stroke:f.stroke,strokeWidth:f.strokeWidth,strokeLinecap:"round",opacity:.85}),
134
134
  /* @__PURE__ */
135
- /* @__PURE__ */(0,Bg.jsx)("line",{x1:n,y1:r-3.5,x2:n,y2:r+3.5,stroke:f.stroke,strokeWidth:f.strokeWidth,opacity:.9}),d&&l.map(a=>{const s=n+(i>0?a/i*o:0);/* @__PURE__ */ /* @__PURE__ */
136
- return(0,Bg.jsxs)("g",{children:[
135
+ /* @__PURE__ */(0,Vg.jsx)("line",{x1:n,y1:r-3.5,x2:n,y2:r+3.5,stroke:f.stroke,strokeWidth:f.strokeWidth,opacity:.9}),d&&l.map(a=>{const s=n+(i>0?a/i*o:0);/* @__PURE__ */ /* @__PURE__ */
136
+ return(0,Vg.jsxs)("g",{children:[
137
137
  /* @__PURE__ */
138
- /* @__PURE__ */(0,Bg.jsx)("line",{x1:s,y1:r-2.5,x2:s,y2:r+2.5,stroke:f.stroke,strokeWidth:.9,opacity:.65}),u&&/* @__PURE__ */ /* @__PURE__ */(0,Bg.jsxs)("text",{x:s,y:r+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:f.labelSize,fill:f.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?` ${t}`:""]})]},a)})]}):/* @__PURE__ */ /* @__PURE__ */(0,Bg.jsxs)("g",{children:[l.map(e=>{const a=e/i*o;/* @__PURE__ */ /* @__PURE__ */
139
- return(0,Bg.jsxs)("g",{children:[
138
+ /* @__PURE__ */(0,Vg.jsx)("line",{x1:s,y1:r-2.5,x2:s,y2:r+2.5,stroke:f.stroke,strokeWidth:.9,opacity:.65}),u&&/* @__PURE__ */ /* @__PURE__ */(0,Vg.jsxs)("text",{x:s,y:r+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:f.labelSize,fill:f.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?` ${t}`:""]})]},a)})]}):/* @__PURE__ */ /* @__PURE__ */(0,Vg.jsxs)("g",{children:[l.map(e=>{const a=e/i*o;/* @__PURE__ */ /* @__PURE__ */
139
+ return(0,Vg.jsxs)("g",{children:[
140
140
  /* @__PURE__ */
141
- /* @__PURE__ */(0,Bg.jsx)("circle",{cx:n,cy:r,r:a,fill:"none",stroke:f.stroke,strokeWidth:f.strokeWidth,strokeDasharray:f.strokeDasharray,opacity:.5}),u&&/* @__PURE__ */ /* @__PURE__ */(0,Bg.jsxs)("text",{x:n+a+3,y:r-2,fontSize:f.labelSize,fill:f.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?` ${t}`:""]})]},e)}),c&&/* @__PURE__ */ /* @__PURE__ */(0,Bg.jsxs)("g",{transform:"translate(24, 24)",children:[
141
+ /* @__PURE__ */(0,Vg.jsx)("circle",{cx:n,cy:r,r:a,fill:"none",stroke:f.stroke,strokeWidth:f.strokeWidth,strokeDasharray:f.strokeDasharray,opacity:.5}),u&&/* @__PURE__ */ /* @__PURE__ */(0,Vg.jsxs)("text",{x:n+a+3,y:r-2,fontSize:f.labelSize,fill:f.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?` ${t}`:""]})]},e)}),c&&/* @__PURE__ */ /* @__PURE__ */(0,Vg.jsxs)("g",{transform:"translate(24, 24)",children:[
142
142
  /* @__PURE__ */
143
- /* @__PURE__ */(0,Bg.jsx)("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),
143
+ /* @__PURE__ */(0,Vg.jsx)("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),
144
144
  /* @__PURE__ */
145
- /* @__PURE__ */(0,Bg.jsx)("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),
145
+ /* @__PURE__ */(0,Vg.jsx)("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),
146
146
  /* @__PURE__ */
147
- /* @__PURE__ */(0,Bg.jsx)("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),
147
+ /* @__PURE__ */(0,Vg.jsx)("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),
148
148
  /* @__PURE__ */
149
- /* @__PURE__ */(0,Bg.jsx)("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),
149
+ /* @__PURE__ */(0,Vg.jsx)("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),
150
150
  /* @__PURE__ */
151
- /* @__PURE__ */(0,Bg.jsx)("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),
151
+ /* @__PURE__ */(0,Vg.jsx)("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),
152
152
  /* @__PURE__ */
153
- /* @__PURE__ */(0,Bg.jsx)("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function Tl(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}function zl(e){const t=(0,Gg.useRef)(null);return Ll(e.imperativeRef,{variant:e.imperativeVariant,frameRef:t}),{frameRef:t,resolved:ol(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),normalizedMargin:(0,Gg.useMemo)(()=>Tl(e.margin),[e.margin])}}function $l(e){return null==e?void 0:String(e)}function Dl(e){const t=$l(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??Xg,style:{...Ug,cursor:e.cursor},datum:e.datum,pointId:t,_transitionKey:t}}function _l(e){return Dl(e)}function Fl(e){const[[t,n],[r,i]]=e.bounds;return{type:"geoarea",pathData:e.pathData,centroid:e.centroid,bounds:e.bounds,screenArea:e.screenArea??Math.abs((r-t)*(i-n)),style:{...Ug,cursor:e.cursor},datum:e.datum,group:e.group,interactive:!0}}function Ol(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function Bl(e){let t=1/0,n=-1/0;for(const r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,0]:[t,n]}function Wl(e,t){const n=t[1]-t[0];return 0===n?.5:(e-t[0])/n}function Hl(e,t={}){const n=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===n.length)return[];const r=zi(Number.isFinite(t.occupancy)?Number(t.occupancy):Qg,.2,1),i=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):Jg;let o=Ol(t.columns)??Math.max(1,Math.ceil(Math.sqrt(n.length*i/r))),a=Ol(t.rows)??Math.max(1,Math.ceil(n.length/(o*r)));o*a<n.length&&(null!=t.columns&&null==t.rows?a=Math.ceil(n.length/o):null!=t.rows&&null==t.columns?o=Math.ceil(n.length/a):a=Math.ceil(n.length/o));const s=Bl(n.map(e=>e.x)),l=Bl(n.map(e=>e.y)),c=n.map(e=>({...e,desiredColumn:Wl(e.x,s)*Math.max(0,o-1),desiredRow:Wl(e.y,l)*Math.max(0,a-1)})),u=(o-1)/2,d=(a-1)/2;c.sort((e,t)=>{const n=(e.desiredColumn-u)**2+(e.desiredRow-d)**2;return(t.desiredColumn-u)**2+(t.desiredRow-d)**2-n||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index});const h=/* @__PURE__ */new Set;for(let e=0;e<a;e+=1)for(let t=0;t<o;t+=1)h.add(e*o+t);const f=[];for(const e of c){let t=-1,n=1/0;for(const r of h){const i=Math.floor(r/o),a=(r%o-e.desiredColumn)**2+(i-e.desiredRow)**2;(a<n||a===n&&r<t)&&(t=r,n=a)}t<0||(h.delete(t),f.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/o),column:t%o,index:e.index}))}return f.sort((e,t)=>e.index-t.index),f.map(({index:e,...t})=>t)}function ql(e,t,n=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(const t of n)if(null!=e[t])return e[t]}function Gl(e,t){const n=e.properties&&"object"==typeof e.properties?e.properties:{},r=e.id??n.id??n.name??`area-${t}`;return{...n,id:String(r)}}function Vl(e){return`${e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")}Z`}function Yl(e,t,n){const r=[];for(let i=0;i<6;i+=1){const o=-Math.PI/2+i*(Math.PI/3);r.push([e+Math.cos(o)*n,t+Math.sin(o)*n])}return Vl(r)}function Ul(e){return e.areas.map((t,n)=>{const r=Gl(t,n),i=e.scales.geoPath.centroid(t),o=Number.isFinite(i[0])&&Number.isFinite(i[1])?e.scales.invertedPoint(i[0],i[1]):null;return{datum:{...r,gridLongitude:o?.[0],gridLatitude:o?.[1]},x:i[0],y:i[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function Xl(e){return e.points.map(t=>{const n=Number(ql(t,e.config.longitudeAccessor,["lon","longitude"])),r=Number(ql(t,e.config.latitudeAccessor,["lat","latitude"])),i=Number.isFinite(n)&&Number.isFinite(r)?e.scales.projectedPoint(n,r):null;return{datum:t,x:i?.[0]??NaN,y:i?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function Zl(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;const n=e.map(e=>({datum:e,x:Number(ql(e,t.columnAccessor)),y:Number(ql(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return n.length!==e.length?null:n.map(e=>({...e,row:e.y,column:e.x}))}function Kl({marks:e,color:t,fontSize:n,fontFamily:r,fontWeight:i}){const o=(0,Zg.useCustomLayoutSelection)();/* @__PURE__ */ /* @__PURE__ */
154
- return(0,Kg.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{const a=!o.isActive||o.predicate(e.datum);/* @__PURE__ */ /* @__PURE__ */
155
- return(0,Kg.jsx)("text",{x:e.x,y:e.y,fill:t,fontFamily:r,fontSize:n,fontWeight:i,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function Ql(e){if(Number.isFinite(e)&&!(Number(e)<=0))return Number(e)}function Jl(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function ec(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function tc(e,t){const n=ec(e);return String(e.id??n.id??n.name??`feature-${t}`)}function nc(e,t){if(0===e.length)return null;const n={type:"FeatureCollection",features:e},r=t.bounds(n);return Number.isFinite(r[0][0])&&Number.isFinite(r[0][1])&&Number.isFinite(r[1][0])&&Number.isFinite(r[1][1])?r:null}function rc(e,t,n,r){return[Math.ceil((e-n)/r-.5),Math.floor((t-n)/r-.5)]}function ic(e){if(!e)return 0;const t=ay.get(e);if(t)return t;const n=sy;return sy+=1,ay.set(e,n),n}function oc(e){return e.map((e,t)=>{if(oy.has(e))return{feature:e,index:t,bounds:oy.get(e)??null};try{const n=W(e);return oy.set(e,n),{feature:e,index:t,bounds:n}}catch{return oy.set(e,null),{feature:e,index:t,bounds:null}}})}function ac(e,t){return!t||e[1]>=t[0][1]&&e[1]<=t[1][1]&&(n=e[0],(r=t[0][0])<=(i=t[1][0])?n>=r&&n<=i:n>=r||n<=i);var n,r,i}function sc(e,t){for(const n of e){const{feature:e,index:r}=n;if(e.geometry&&ac(t,n.bounds))try{if(ke(e,t))return{feature:e,index:r}}catch{}}return null}function lc(e,t,n,r={}){const i=e.filter((e,t)=>e.geometry&&(!r.featureFilter||r.featureFilter(e,t))),o=nc(i,t.geoPath);if(!o)return{dots:[],cellSize:ny,features:i};const a=Math.max(0,r.layoutPadding??0),s=[[zi(o[0][0],a,Math.max(a,n.width-a)),zi(o[0][1],a,Math.max(a,n.height-a))],[zi(o[1][0],a,Math.max(a,n.width-a)),zi(o[1][1],a,Math.max(a,n.height-a))]],l=Math.max(0,s[1][0]-s[0][0]),c=Math.max(0,s[1][1]-s[0][1]);if(0===l||0===c)return{dots:[],cellSize:ny,features:i};const u=Ql(r.columns);let d=Math.max(2,u?l/u:Ql(r.cellSize)??ny);const h=Math.max(100,Math.round(Ql(r.maxSamples)??ry)),f=Math.ceil(l/d)*Math.ceil(c/d);f>h&&(d*=Math.sqrt(f/h));const p=r.gridOrigin?.[0]??0,m=r.gridOrigin?.[1]??0,[g,y]=rc(s[0][0],s[1][0],p,d),[b,v]=rc(s[0][1],s[1][1],m,d),x=[],w=oc(i);for(let e=b;e<=v;e+=1){const n=m+(e+.5)*d;for(let i=g;i<=y;i+=1){const o=p+(i+.5)*d,a=t.invertedPoint(o,n);if(!a||!Number.isFinite(a[0])||!Number.isFinite(a[1]))continue;const s=sc(w,a);if(!s)continue;const l={...ec(s.feature),featureId:tc(s.feature,s.index),featureIndex:s.index,gridRow:e,gridColumn:i,longitude:a[0],latitude:a[1],dotIndex:x.length};r.dotFilter&&!r.dotFilter(l,x.length)||x.push(l)}}return{dots:x,cellSize:d,features:i}}function cc(e){return Math.round(1e4*e)/1e4}function uc(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${cc(Number(e[0]))},${cc(Number(e[1]))}`:"null"}function dc(e,t){const n=e[t];return"function"==typeof n?n.call(e):void 0}function hc(e){return"number"==typeof e&&Number.isFinite(e)?String(cc(e)):null===e?"null":"unavailable"}function fc(e){const t=e.scales.projection;return[hc(dc(t,"scale")),uc(dc(t,"translate")),uc(dc(t,"center")),(n=dc(t,"rotate"),Array.isArray(n)&&n.every(Number.isFinite)?n.map(e=>cc(Number(e))).join(","):"unavailable"),hc(dc(t,"clipAngle")),hc(dc(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,n])=>uc(e.scales.projectedPoint(t,n)))].join("|");var n}function pc(e){const t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",ic(t.featureFilter),ic(t.dotFilter),fc(e)].join("::")}function mc(e){let t=iy.get(e.areas);t||(t=/* @__PURE__ */new Map,iy.set(e.areas,t));const n=pc(e),r=t.get(n);if(r)return r;const i=lc(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){const e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(n,i),i}function gc(e){return`${e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")}Z`}function yc(e,t,n){return gc([[e-n,t-n],[e+n,t-n],[e+n,t+n],[e-n,t+n]])}function bc(e,t,n){return gc(Array.from({length:6},(r,i)=>{const o=-Math.PI/2+i*(Math.PI/3);return[e+Math.cos(o)*n,t+Math.sin(o)*n]}))}function vc(e,t,n){const{featureKey:r,dataKey:i}=n,o=/* @__PURE__ */new Map;for(const e of t){const t=String(Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0);o.set(t,e)}const a=e=>{const t=r.split(".");let n=e;for(const e of t)n=null!==n&&"object"==typeof n&&Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0;return String(n??"")};return e.map(e=>{const t=a(e),n=o.get(t);return n?{...e,properties:{...e.properties,...n}}:e})}var xc,wc,kc,Sc,Mc,jc,Ac,Cc,Rc,Lc,Pc,Nc,Ec,Ic,Tc,zc,$c=Object.create,Dc=Object.defineProperty,_c=Object.getOwnPropertyDescriptor,Fc=Object.getOwnPropertyNames,Oc=Object.getPrototypeOf,Bc=Object.prototype.hasOwnProperty,Wc=(e,t,n)=>function(){if(n)throw n[0];try{return e&&(t=(0,e[Fc(e)[0]])(e=0)),t}catch(e){throw n=[e],e}},Hc=(e,t)=>{for(var n in t)Dc(e,n,{get:t[n],enumerable:!0})},qc=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Fc(t))Bc.call(e,i)||i===n||Dc(e,i,{get:()=>t[i],enumerable:!(r=_c(t,i))||r.enumerable});return e},Gc=(e,t,n)=>(n=null!=e?$c(Oc(e)):{},qc(!t&&e&&e.__esModule?n:Dc(n,"default",{value:e,enumerable:!0}),e)),Vc=Wc({"src/components/stream/accessibleDataRows.ts"(){}}),Yc=Wc({"src/components/stream/accessibleTableStyles.ts"(){xc=5,wc=25,kc="semiotic-accessible-data-table semiotic-accessible-data-table-hidden",Sc="semiotic-accessible-data-table semiotic-accessible-data-table-visible",Mc={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},jc={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"},Ac={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},Cc={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)"},Rc={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},Lc={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))"},Pc={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},Nc={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},Ec={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"}}}),Uc={};Hc(Uc,{default:()=>s});var Xc,Zc,Kc,Qc,Jc,eu=Wc({"src/components/stream/AccessibleTablePortalImpl.tsx"(){Ic=Gc(require("react")),Tc=require("react-dom"),zc=require("react/jsx-runtime")}}),tu=Wc({"src/components/stream/accessibleDataTableModel.ts"(){Xc=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":String(t)}}}),nu=Wc({"src/components/stream/AccessibleDataRowsTable.tsx"(){tu(),Yc(),Zc=require("react/jsx-runtime")}}),ru=Wc({"src/components/stream/AccessibleTableMoreRows.tsx"(){Yc(),Kc=require("react/jsx-runtime")}}),iu={};Hc(iu,{default:()=>f});var ou,au=Wc({"src/components/stream/AccessibleDataTableContent.tsx"(){Qc=Gc(require("react")),nu(),ru(),Yc(),Vc(),tu(),Jc=require("react/jsx-runtime")}}),su={};Hc(su,{ChoroplethMap:()=>Sg,DEFAULT_HIT_RADIUS:()=>Xg,DistanceCartogram:()=>Hg,FlowMap:()=>Fg,GeoCustomChart:()=>Yg,MultiLineTooltip:()=>ns,ProportionalSymbolMap:()=>Eg,StreamGeoFrame:()=>Gm,Tooltip:()=>ts,TooltipRoot:()=>dm,composeStyleRules:()=>pl,geoAreaHitTarget:()=>Fl,geoHitTarget:()=>_l,geographicDotGridLayout:()=>ly,geographicGridLayout:()=>ey,glyphExtent:()=>Cn,glyphPlacement:()=>An,gridifyGeographicPoints:()=>Hl,hasOwnTooltipChrome:()=>la,hasTooltipContent:()=>oa,hatchFillId:()=>mi,hatchPatternDef:()=>yi,hitTargetPoint:()=>Dl,isHatchFill:()=>fi,makeNodeRuleContext:()=>cl,makeRuleValueResolver:()=>ll,markTooltipChrome:()=>aa,matchesThreshold:()=>dl,mergeData:()=>vc,resolveReferenceGeography:()=>Sl,resolveResponsiveRules:()=>Ts,resolveStyleRules:()=>fl,resolveSvgFill:()=>bi,responsiveRuleMatches:()=>Es,ruleMatches:()=>hl,sampleGeographicDotGrid:()=>lc}),module.exports=(ou=su,qc(Dc({},"__esModule",{value:!0}),ou));var lu,cu,uu,du,hu,fu,pu,mu,gu,yu,bu,vu,xu,wu,ku,Su,Mu=require("react"),ju=require("d3-array"),Au=1e-6,Cu=1e-12,Ru=Math.PI,Lu=Ru/2,Pu=Ru/4,Nu=2*Ru,Eu=180/Ru,Iu=Ru/180,Tu=Math.abs,zu=Math.atan,$u=Math.atan2,Du=Math.cos,_u=Math.ceil,Fu=Math.exp,Ou=Math.log,Bu=Math.sin,Wu=Math.sign||function(e){return e>0?1:e<0?-1:0},Hu=Math.sqrt,qu=Math.tan,Gu={Feature:function(e,t){y(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)y(n[r].geometry,t)}},Vu={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){b(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)b(n[r],t,0)},Polygon:function(e,t){v(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)v(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)y(n[r],t)}},Yu=new ju.Adder,Uu=new ju.Adder,Xu={point:g,lineStart:g,lineEnd:g,polygonStart:function(){Yu=new ju.Adder,Xu.lineStart=w,Xu.lineEnd=k},polygonEnd:function(){var e=+Yu;Uu.add(e<0?Nu+e:e),this.lineStart=this.lineEnd=this.point=g},sphere:function(){Uu.add(Nu)}},Zu=require("d3-array"),Ku={point:E,lineStart:T,lineEnd:z,polygonStart:function(){Ku.point=$,Ku.lineStart=D,Ku.lineEnd=_,wu=new Zu.Adder,Xu.polygonStart()},polygonEnd:function(){Xu.polygonEnd(),Ku.point=E,Ku.lineStart=T,Ku.lineEnd=z,Yu<0?(fu=-(mu=180),pu=-(gu=90)):wu>Au?gu=90:wu<-Au&&(pu=-90),Su[0]=fu,Su[1]=mu},sphere:function(){fu=-(mu=180),pu=-(gu=90)}};q.invert=q;var Qu,Ju,ed,td,nd,rd,id,od,ad,sd,ld,cd,ud=require("d3-array"),dd=require("d3-array"),hd=oe(function(){return!0},function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?Ru:-Ru,l=Tu(o-n);Tu(l-Ru)<Au?(e.point(n,r=(r+a)/2>0?Lu:-Lu),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&l>=Ru&&(Tu(n-i)<Au&&(n-=i*Au),Tu(o-s)<Au&&(o-=s*Au),r=le(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}},function(e,t,n,r){var i;if(null==e)i=n*Lu,r.point(-Ru,i),r.point(0,i),r.point(Ru,i),r.point(Ru,0),r.point(Ru,-i),r.point(0,-i),r.point(-Ru,-i),r.point(-Ru,0),r.point(-Ru,i);else if(Tu(e[0]-t[0])>Au){var o=e[0]<t[0]?Ru:-Ru;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])},[-Ru,-Lu]),fd=require("d3-array"),pd=1e9,md=-pd,gd=require("d3-array"),yd={sphere:g,point:g,lineStart:function(){yd.point=fe,yd.lineEnd=he},lineEnd:g,polygonStart:g,polygonEnd:g},bd=[null,null],vd={type:"LineString",coordinates:bd},xd={Feature:function(e,t){return ge(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(ge(n[r].geometry,t))return!0;return!1}},wd={Sphere:function(){return!0},Point:function(e,t){return ye(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(ye(n[r],t))return!0;return!1},LineString:function(e,t){return be(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(be(n[r],t))return!0;return!1},Polygon:function(e,t){return ve(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(ve(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(ge(n[r],t))return!0;return!1}},kd=require("d3-array"),Sd=e=>e,Md=require("d3-array"),jd=new Md.Adder,Ad=new Md.Adder,Cd={point:g,lineStart:g,lineEnd:g,polygonStart:function(){Cd.lineStart=Ce,Cd.lineEnd=Pe},polygonEnd:function(){Cd.lineStart=Cd.lineEnd=Cd.point=g,jd.add(Tu(Ad)),Ad=new Md.Adder},result:function(){var e=jd/2;return jd=new Md.Adder,e}},Rd=Cd,Ld=1/0,Pd=Ld,Nd=-Ld,Ed=Nd,Id={point:function(e,t){e<Ld&&(Ld=e),e>Nd&&(Nd=e),t<Pd&&(Pd=t),t>Ed&&(Ed=t)},lineStart:g,lineEnd:g,polygonStart:g,polygonEnd:g,result:function(){var e=[[Ld,Pd],[Nd,Ed]];return Nd=Ed=-(Pd=Ld=1/0),e}},Td=0,zd=0,$d=0,Dd=0,_d=0,Fd=0,Od=0,Bd=0,Wd=0,Hd={point:Ne,lineStart:Ee,lineEnd:ze,polygonStart:function(){Hd.lineStart=$e,Hd.lineEnd=De},polygonEnd:function(){Hd.point=Ne,Hd.lineStart=Ee,Hd.lineEnd=ze},result:function(){var e=Wd?[Od/Wd,Bd/Wd]:Fd?[Dd/Fd,_d/Fd]:$d?[Td/$d,zd/$d]:[NaN,NaN];return Td=zd=$d=Dd=_d=Fd=Od=Bd=Wd=0,e}},qd=Hd;Oe.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Nu)}},result:g};var Gd,Vd,Yd,Ud,Xd,Zd,Kd,Qd,Jd,eh=require("d3-array"),th=new eh.Adder,nh={point:g,lineStart:function(){nh.point=Be},lineEnd:function(){Gd&&We(Vd,Yd),nh.point=g},polygonStart:function(){Gd=!0},polygonEnd:function(){Gd=null},result:function(){var e=+th;return th=new eh.Adder,e}},rh=nh,ih=class{constructor(e){this._append=null==e?He:qe(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(e,t){switch(this._point){case 0:this._append`M${e},${t}`,this._point=1;break;case 1:this._append`L${e},${t}`;break;default:if(this._append`M${e},${t}`,this._radius!==Qd||this._append!==Kd){const e=this._radius,t=this._;this._="",this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,Qd=e,Kd=this._append,Jd=this._,this._=t}this._+=Jd}}result(){const e=this._;return this._="",e.length?e:null}};Ye.prototype={constructor:Ye,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var oh=Du(30*Iu),ah=Ve({point:function(e,t){this.stream.point(e*Iu,t*Iu)}});ut.invert=function(e,t){return[e,2*zu(Fu(t))-Lu]},ht.invert=ht;var sh,lh=1.340264,ch=-.081106,uh=893e-6,dh=.003796,hh=Hu(3)/2;ft.invert=function(e,t){for(var n,r=t,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(lh+ch*i+o*(uh+dh*i))-t)/(lh+3*ch*i+o*(7*uh+9*dh*i)))*r)*i*i,!(Tu(n)<Cu));++a);return[hh*e*(lh+3*ch*i+o*(7*uh+9*dh*i))/Du(r),p(Bu(r)/hh)]},mt.invert=function(e,t){var n,r=t,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-t)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Tu(n)>Au&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},gt.invert=(sh=p,function(e,t){var n=Hu(e*e+t*t),r=sh(n),i=Bu(r),o=Du(r);return[$u(e*i,n*o),p(n&&t*i/n)]});var fh,ph,mh=require("d3-quadtree"),gh=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,e<1)throw new Error("RingBuffer capacity must be at least 1");this.buffer=new Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const n of e){const e=this.push(n);void 0!==e&&t.push(e)}return t}get(e){if(e<0||e>=this._size)return;const t=(this.head-this._size+e+this._capacity)%this._capacity;return this.buffer[t]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>e>=this._size?{done:!0,value:void 0}:{done:!1,value:this.get(e++)}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;n<this._size;n++)e(this.buffer[(t+n)%this._capacity],n)}toArray(){const e=new Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;n<this._size;n++)e[n]=this.buffer[(t+n)%this._capacity];return e}resize(e){if(e<1)throw new Error("RingBuffer capacity must be at least 1");const t=this.toArray();let n=0,r=[];t.length>e&&(n=t.length-e,r=t.slice(0,n)),this._capacity=e,this.buffer=new Array(e),this.head=0,this._size=0;for(let e=n;e<t.length;e++)this.push(t[e]);return r}update(e,t){const n=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;i<this._size;i++){const o=(r+i)%this._capacity,a=this.buffer[o];if(e(a)){let e;e="object"!=typeof a||null===a?a:Array.isArray(a)?[...a]:{...a},n.push(e),this.buffer[o]=t(a)}}return n}remove(e){const t=[],n=[];if(this.forEach(r=>{e(r)?n.push(r):t.push(r)}),0===n.length)return n;this.buffer=new Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return n}clear(){this.buffer=new Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},yh=1,bh=1.5,vh=3,xh=require("d3-scale"),wh=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],kh=/* @__PURE__ */Lt(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),Sh=/* @__PURE__ */Lt(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),Mh=/* @__PURE__ */Lt(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),jh=/* @__PURE__ */Lt(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),Ah=/* @__PURE__ */Lt(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),Ch=/* @__PURE__ */Lt(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),Rh={blues:kh,reds:Sh,greens:Mh,viridis:/* @__PURE__ */Lt(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),oranges:jh,purples:Ah,greys:Ch,plasma:/* @__PURE__ */Lt(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),inferno:/* @__PURE__ */Lt(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),magma:/* @__PURE__ */Lt(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),cividis:/* @__PURE__ */Lt(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),turbo:/* @__PURE__ */Lt(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"])},Lh={category10:wh,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],...Rh},Ph=wh,Nh="#007bff",Eh=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],Ih=/* @__PURE__ */new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),Th={mercator:function(){return dt(ut).scale(961/Nu)},equalEarth:pt,albersUsa:function(){function e(e){var t=e[0],n=e[1];return s=null,i.point(t,n),s||(o.point(t,n),s)||(a.point(t,n),s)}function t(){return n=r=null,e}var n,r,i,o,a,s,l=ct().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7]),c=ct().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=ct().rotate([157,0]).center([-3,19.9]).parallels([8,18]),d={point:function(e,t){s=[e,t]}};return e.invert=function(e){var t=l.scale(),n=l.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?c:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:l).invert(e)},e.stream=function(e){return n&&r===e?n:(t=[l.stream(r=e),c.stream(e),u.stream(e)],i=t.length,n={point:function(e,n){for(var r=-1;++r<i;)t[r].point(e,n)},sphere:function(){for(var e=-1;++e<i;)t[e].sphere()},lineStart:function(){for(var e=-1;++e<i;)t[e].lineStart()},lineEnd:function(){for(var e=-1;++e<i;)t[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<i;)t[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<i;)t[e].polygonEnd()}});var t,i},e.precision=function(e){return arguments.length?(l.precision(e),c.precision(e),u.precision(e),t()):l.precision()},e.scale=function(t){return arguments.length?(l.scale(t),c.scale(.35*t),u.scale(t),e.translate(l.translate())):l.scale()},e.translate=function(e){if(!arguments.length)return l.translate();var n=l.scale(),r=+e[0],s=+e[1];return i=l.translate(e).clipExtent([[r-.455*n,s-.238*n],[r+.455*n,s+.238*n]]).stream(d),o=c.translate([r-.307*n,s+.201*n]).clipExtent([[r-.425*n+Au,s+.12*n+Au],[r-.214*n-Au,s+.234*n-Au]]).stream(d),a=u.translate([r-.205*n,s+.212*n]).clipExtent([[r-.214*n+Au,s+.166*n+Au],[r-.115*n-Au,s+.234*n-Au]]).stream(d),t()},e.fitExtent=function(t,n){return Xe(e,t,n)},e.fitSize=function(t,n){return Ze(e,t,n)},e.fitWidth=function(t,n){return Ke(e,t,n)},e.fitHeight=function(t,n){return Qe(e,t,n)},e.scale(1070)},orthographic:function(){return ot(gt).scale(249.5).clipAngle(90.000001)},naturalEarth:function(){return ot(mt).scale(175.295)},equirectangular:function(){return ot(ht).scale(152.63)}},zh=require("d3-scale"),$h={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},Dh=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=dn({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){const n=dn(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}},_h=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Fh=["scene-style","data-paint","accessibility","evidence"],Oh=(e,t)=>({retainedData:e,invalidations:t}),Bh=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Wh=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Hh=["scene-geometry","data-paint","accessibility","evidence"],qh=["scene-style","data-paint","accessibility","evidence"],Gh=["scene-geometry","scene-style","data-paint","accessibility","evidence"],Vh=["overlay","accessibility","evidence"],Yh=[],Uh={xAccessor:/* @__PURE__ */Oh("rebuild",Bh),yAccessor:/* @__PURE__ */Oh("rebuild",Bh),lineDataAccessor:/* @__PURE__ */Oh("rebuild",Bh),pointIdAccessor:/* @__PURE__ */Oh("rebuild",Hh),lineIdAccessor:/* @__PURE__ */Oh("rebuild",Hh),windowSize:/* @__PURE__ */Oh("rebuild",Bh),projection:/* @__PURE__ */Oh("preserve",Wh),projectionExtent:/* @__PURE__ */Oh("preserve",Wh),fitPadding:/* @__PURE__ */Oh("preserve",Wh),lineType:/* @__PURE__ */Oh("preserve",Wh),flowStyle:/* @__PURE__ */Oh("preserve",Wh),graticule:/* @__PURE__ */Oh("preserve",Wh),projectionTransform:/* @__PURE__ */Oh("preserve",Wh),customLayout:/* @__PURE__ */Oh("preserve",Wh),layoutConfig:/* @__PURE__ */Oh("preserve",Wh),layoutMargin:/* @__PURE__ */Oh("preserve",Wh),areaStyle:/* @__PURE__ */Oh("preserve",qh),pointStyle:/* @__PURE__ */Oh("preserve",Gh),lineStyle:/* @__PURE__ */Oh("preserve",qh),colorScheme:/* @__PURE__ */Oh("preserve",qh),themeCategorical:/* @__PURE__ */Oh("preserve",qh),themeDiverging:/* @__PURE__ */Oh("preserve",qh),themeSemantic:/* @__PURE__ */Oh("preserve",qh),themeSequential:/* @__PURE__ */Oh("preserve",qh),decay:/* @__PURE__ */Oh("preserve",qh),pulse:/* @__PURE__ */Oh("preserve",qh),layoutSelection:/* @__PURE__ */Oh("preserve",qh),annotations:/* @__PURE__ */Oh("preserve",Vh),autoPlaceAnnotations:/* @__PURE__ */Oh("preserve",Vh),clock:/* @__PURE__ */Oh("preserve",Yh),transition:/* @__PURE__ */Oh("preserve",Yh),introAnimation:/* @__PURE__ */Oh("preserve",Yh),onLayoutError:/* @__PURE__ */Oh("preserve",Yh)},Xh=/* @__PURE__ */Oh("preserve",Wh),Zh=class{constructor(){this.tracker=new Dh}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},_h)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Fh):this.recordNoop("restyle")}recordConfig(e,t={}){const n=hn(e),r=new Set(n.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}},Kh=/* @__PURE__ */new WeakMap,Qh=class{getLastUpdateResult(){return this.updateResults.last}getUpdateSnapshot(){return this.updateResults.last}subscribeUpdateResult(e){return this.updateResults.subscribe(e)}setLayoutSelection(e){this.config.layoutSelection=e}markStylePaintPending(){Kh.set(this,!0)}consumeStylePaintPending(){const e=!0===Kh.get(this);return Kh.delete(this),e}},Jh=class extends Qh{constructor(e){super(),this.updateResults=new Zh,this.scene=[],this.scales=null,this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutDiagnosticsWarned=/* @__PURE__ */new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this._customLayoutFailedThisBuild=!1,this._quadtree=null,this._maxPointRadius=0,this.projection=null,this.geoPath=null,this.baseScale=0,this.baseTranslate=[0,0],this.baseRotation=[0,0,0],this.currentZoom=1,this.cartogramLayout=null,this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.streaming=!1,this.lastIngestTime=0,this.timestampBuffer=null,this.activeTransition=null,this.prevPositions=null,this._hasRenderedOnce=!1,this.config=mn(e)}currentTime(){return this.config.clock?.()??("undefined"!=typeof performance?performance.now():Date.now())}getConfiguredWindowSize(){const e=this.config.windowSize??500;if(!Number.isInteger(e)||e<1)throw new Error("GeoPipelineStore windowSize must be a positive integer");return e}retainNewestLines(e=this.getConfiguredWindowSize()){this.lineData.length>e&&(this.lineData=this.lineData.slice(-e))}resizeStreamingWindow(e){if(this.pointBuffer){const t=this.pointBuffer.toArray(),n=this.timestampBuffer?.toArray()??[],r=t.slice(-e),i=n.slice(-r.length),o=this.currentTime();this.pointBuffer=new gh(e),this.timestampBuffer=new gh(e),r.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(i[t]??o)})}this.retainNewestLines(e)}updateConfig(e){const t=gn(e),n=this.config,r=this.getConfiguredWindowSize(),i=Object.keys(t).filter(e=>t[e]!==n[e]);this.config={...this.config,...t};const o=this.getConfiguredWindowSize(),a=this.streaming&&o!==r;a&&(this.resizeStreamingWindow(o),this.version++),"customLayout"in t&&!t.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(i,{retainedDataChanged:a})}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}setAreas(e){this.areas=e,this.updateResults.recordData("replace",e.length)}setAreasWithResult(e){return this.setAreas(e),this.updateResults.last}setPoints(e){this.pointData=e.slice(),this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.updateResults.recordData("replace",e.length)}setPointsWithResult(e){return this.setPoints(e),this.updateResults.last}setLines(e){this.lineData=e.slice(),this.streaming&&this.retainNewestLines(),this.updateResults.recordData("replace",e.length)}setLinesWithResult(e){return this.setLines(e),this.updateResults.last}initStreaming(e){void 0!==e&&e!==this.config.windowSize&&(this.config={...this.config,windowSize:e});const t=this.getConfiguredWindowSize(),n=this.pointBuffer?this.pointBuffer.toArray():this.pointData,r=this.timestampBuffer?.toArray()??[],i=n.slice(-t),o=r.slice(-i.length),a=this.currentTime();this.pointBuffer=new gh(t),this.timestampBuffer=new gh(t),i.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(o[t]??a)}),this.pointData=[],this.retainNewestLines(t),this.streaming=!0}pushPoint(e){this.pointBuffer||this.initStreaming();const t=this.currentTime();ln(this.pointBuffer,e,this.timestampBuffer,t),this.lastIngestTime=t,this.updateResults.recordData("ingest",1)}pushPointWithResult(e){return this.pushPoint(e),this.updateResults.last}pushMany(e){this.pointBuffer||this.initStreaming();const t=this.currentTime();for(const n of e)ln(this.pointBuffer,n,this.timestampBuffer,t);this.lastIngestTime=t,this.updateResults.recordData("ingest",e.length)}pushManyWithResult(e){return this.pushMany(e),this.updateResults.last}pushLine(e){null!=e&&"object"==typeof e?(this.streaming||this.initStreaming(),this.lineData.push(e),this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",1)):this.updateResults.recordNoop("ingest")}pushManyLines(e){if(!Array.isArray(e)||0===e.length)return void this.updateResults.recordNoop("ingest");const t=e.filter(e=>null!=e&&"object"==typeof e);if(0!==t.length){this.streaming||this.initStreaming();for(const e of t)this.lineData.push(e);this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",t.length)}else this.updateResults.recordNoop("ingest")}removeLine(e){const{lineIdAccessor:t}=this.config;if(!t)throw new Error("removeLine() requires lineIdAccessor to be configured");const n="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]),i=[];return this.lineData=this.lineData.filter(e=>!r.has(String(n(e)))||(i.push(e),!1)),i.length>0?(this.version++,this.updateResults.recordData("remove",i.length)):this.updateResults.recordNoop("remove"),i}getLines(){return this.lineData.slice()}removePoint(e){const{pointIdAccessor:t}=this.config;if(!t)throw new Error("removePoint() requires pointIdAccessor to be configured");const n="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]);if(this.streaming&&this.pointBuffer){const e=e=>r.has(String(n(e)));cn(this.pointBuffer,this.timestampBuffer,e);const t=this.pointBuffer.remove(e);return t.length>0?(this.version++,this.updateResults.recordData("remove",t.length)):this.updateResults.recordNoop("remove"),t}{const e=[];return this.pointData=this.pointData.filter(t=>!r.has(String(n(t)))||(e.push(t),!1)),e.length>0?(this.version++,this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}}clear(){this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.scene=[],this.scales=null,this._hasRenderedOnce=!1,this.activeTransition=null,this.prevPositions=null,this._quadtree=null,this._maxPointRadius=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this._customLayoutFailedThisBuild=!1,this.version++,this.updateResults.recordData("clear")}restyleScene(e){const t=this._customRestyle;if(t){for(const n of this.scene){const r=this._baseStyles.get(n)??n.style,i=t(n,e);n.style=i?{...r,...i}:r}this.markStylePaintPending(),this.updateResults.recordRestyle(!0)}else this.updateResults.recordRestyle(!1)}computeScene(e){const{config:t}=this,n=this.projection,r=this.geoPath,i=this.scales,o=this.baseScale,a=[...this.baseTranslate],s=[...this.baseRotation],l=this.scene;this.projection=Gt(t.projection),this.geoPath=Ge(this.projection),this.fitProjection(e),this.geoPath=Ge(this.projection);const c=this.projection;this.scales={projection:c,geoPath:this.geoPath,projectedPoint:(e,t)=>c([e,t]),invertedPoint:(e,t)=>c.invert?c.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const u=this.buildSceneNodes(e);if(this._customLayoutFailedThisBuild)!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.projection=n,this.geoPath=r,this.scales=i,this.baseScale=o,this.baseTranslate=a,this.baseRotation=s):(this.scene=[],this.rebuildQuadtree());else{if(this.scene=u,this.rebuildQuadtree(),t.projectionTransform&&this.applyCartogramTransform(t.projectionTransform,e),t.decay&&this.streaming&&this.applyDecay(),t.pulse&&this.streaming&&this.applyPulse(),t.transition&&!this._hasRenderedOnce&&this.scene.length>0&&t.introAnimation){const t=e.width/2,n=e.height/2,r=this.scene.filter(e=>"point"===e.type).map(e=>({...e,x:t,y:n}));r.length>0&&this.startTransition(r)}this._hasRenderedOnce=!0,t.transition&&l.length>0&&this.startTransition(l),this.version++}}fitProjection(e){const t=this.projection,n=this.config,r=[...this.areas],i=Vt(n.xAccessor,"lon"),o=Vt(n.yAccessor,"lat"),a=this.getPoints();if(a.length>0){const e=a.map(e=>[i(e),o(e)]);r.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}const s=Yt(n.lineDataAccessor);for(const e of this.lineData){const t=s(e);if(t&&t.length>0){const e=t.map(e=>[i(e),o(e)]);r.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}})}}if(0!==r.length){if(n.projectionExtent){const[[r,i],[o,a]]=n.projectionExtent,s={type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[r,i],[r,a],[o,a],[o,i],[r,i]]]}};t.fitExtent([[0,0],[e.width,e.height]],s)}else if(t.clipAngle&&(t.clipAngle()??0)>0){const r=n.fitPadding??0,i=Math.min(e.width,e.height),o=i/2-i*r;t.scale(o),t.translate([e.width/2,e.height/2])}else{const i={type:"FeatureCollection",features:r},o=n.fitPadding??0,a=e.width*o,s=e.height*o;t.fitExtent([[a,s],[e.width-a,e.height-s]],i)}this.baseScale=t.scale(),this.baseTranslate=t.translate(),this.baseRotation=t.rotate?.()??[0,0,0]}}applyZoomTransform(e,t){const n=this.projection;if(!n)return;const r=this.geoPath,i=this.scales,o=n.scale(),a=[...n.translate()],s=this.currentZoom;n.scale(this.baseScale*e.k),n.translate([this.baseTranslate[0]*e.k+e.x,this.baseTranslate[1]*e.k+e.y]),this.currentZoom=e.k,this.geoPath=Ge(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyZoomScale(e,t){const n=this.projection;if(!n)return;const r=this.geoPath,i=this.scales,o=n.scale(),a=[...n.translate()],s=this.currentZoom;n.scale(this.baseScale*e),n.translate(this.baseTranslate),this.currentZoom=e,this.geoPath=Ge(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyRotation(e,t){const n=this.projection;if(!n||!n.rotate)return;const r=this.geoPath,i=this.scales,o=[...n.rotate()];n.rotate(e),this.geoPath=Ge(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const a=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.rotate(o),this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=a,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}setRotation(e){const t=this.projection;t&&t.rotate&&t.rotate(e)}hasProjection(){return null!=this.projection}getRotation(){return this.projection?.rotate?.()??this.baseRotation}getBaseProjectionState(){return{scale:this.baseScale,translate:[...this.baseTranslate]}}getPoints(){return this.streaming&&this.pointBuffer?this.pointBuffer.toArray():this.pointData}rebuildQuadtree(){let e=0,t=0;for(const n of this.scene)"point"===n.type&&!1!==n.interactive&&(t++,n.r>e&&(e=n.r));if(this._maxPointRadius=e,t<=500)return void(this._quadtree=null);const n=new Array(t);let r=0;for(const e of this.scene)"point"===e.type&&!1!==e.interactive&&(n[r++]=e);this._quadtree=(0,mh.quadtree)().x(e=>e.x).y(e=>e.y).addAll(n)}get quadtree(){return this._quadtree}get maxPointRadius(){return this._maxPointRadius}buildSceneNodes(e){this._customLayoutFailedThisBuild=!1;const{config:t}=this,n=this.projection,r=this.geoPath;if(t.customLayout&&this.scales){const n=t.layoutMargin??{top:0,right:0,bottom:0,left:0},r=Nt(t.colorScheme,t.themeCategorical,Eh),i={areas:this.areas.slice(),points:this.getPoints().slice(),lines:this.lineData.slice(),scales:this.scales,dimensions:{width:e.width,height:e.height,margin:n,plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:t.themeSemantic??{},categorical:[...r]},resolveColor:_t(r,t.colorScheme),config:t.layoutConfig??{},selection:t.layoutSelection??null},o=qt({family:"geo",logLabel:"geo customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:t.onLayoutError,run:()=>t.customLayout(i)});if("failure"===o.kind)return this.lastCustomLayoutFailure=o.diagnostic,this._customLayoutFailedThisBuild=!0,o.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,[]);const a=o.result,s=a.nodes??[];if(this.customLayoutOverlays=a.overlays??null,this.lastCustomLayoutResult=a,this.lastCustomLayoutFailure=null,this._customRestyle=a.restyle,this.hasCustomRestyle=!!a.restyle,this._baseStyles=/* @__PURE__ */new WeakMap,this.hasCustomRestyle)for(const e of s){this._baseStyles.set(e,e.style);const n=a.restyle?.(e,t.layoutSelection??null);n&&(e.style={...e.style,...n})}return Ft({label:"geo customLayout",nodes:s,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),s}return this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,fn({config:t,projection:n,path:r,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:e})}applyCartogramTransform(e,t){const n=on(this.scene,e,t,this.areas.length);n&&(this.cartogramLayout=n)}applyDecay(){const e=this.config.decay;if(!e||!this.pointBuffer)return;const t=this.pointBuffer.size;if(0===t)return;const n=this.scene.filter(e=>"point"===e.type);for(let r=0;r<n.length;r++){const i=St(e,r,t);n[r]._decayOpacity=i,n[r].style={...n[r].style,opacity:i}}}applyPulse(e=this.currentTime()){const t=this.config.pulse;if(!t||!this.timestampBuffer)return!1;const n=this.scene.filter(e=>"point"===e.type),r=this.timestampBuffer.toArray(),i=t.color||"rgba(255,255,255,0.6)",o=t.glowRadius??4;let a=!1;for(let s=0;s<n.length&&s<r.length;s++){const l=Mt(t,r[s],e);a=jt(n[s],l,i,o)||a}return a}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(e)}hasActivePulsesAt(e){return!!this.config.pulse&&At(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(e){const t=this.config.transition?.duration??300;if(t<=0)return;const n=/* @__PURE__ */new Map;for(const t of e)"point"===t.type&&t.pointId&&n.set(t.pointId,[t.x,t.y]);const r=this.scene.filter(e=>"point"===e.type);let i=!1;for(const e of r)if(e.pointId){const t=n.get(e.pointId);t&&(e._targetX=e.x,e._targetY=e.y,e.x=t[0],e.y=t[1],(Math.abs(t[0]-e._targetX)>.5||Math.abs(t[1]-e._targetY)>.5)&&(i=!0))}for(const e of r)e.pointId&&!n.has(e.pointId)&&(e._targetOpacity=e.style?.opacity??e.style?.fillOpacity??1,e.style={...e.style,opacity:0},i=!0);i&&(this.activeTransition={startTime:this.currentTime(),duration:t})}cancelIntroAnimation(){this.activeTransition=null;for(const e of this.scene)"point"===e.type&&(null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0),null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0))}advanceTransition(e){if(!this.activeTransition)return!1;const t=bt(e,this.activeTransition),n=yt(t),r=this.scene.filter(e=>"point"===e.type);for(const e of r){if(null!=e._targetX&&null!=e._targetY){const t=e.x,r=e.y;e.x=vt(t,e._targetX,n),e.y=vt(r,e._targetY,n)}null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity*n})}if(t>=1){for(const e of r)null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0),null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0);return this.activeTransition=null,!1}return!0}},ef=require("react"),tf=require("d3-selection"),nf=require("d3-zoom"),rf=Object.freeze([]),of=require("react"),af={sceneGeometry:0,layout:0,domain:0},sf="production"!==process.env.NODE_ENV,lf={revisions:af,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},cf=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=af,this.lastObserved=af,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){sf&&(this.lastObserved=wn(this.lastObserved,vn(e)))}beforeCompute(e,t){if(!sf)return lf;const n=wn(vn(e),this.lastObserved),r=xn(n),i=(o=n,a=this.lastConsumed,!(o.sceneGeometry===a.sceneGeometry&&o.layout===a.layout&&o.domain===a.domain));var o,a;return{revisions:n,signature:r,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:i,warnUnconsumed:!t&&i&&this.lastUnconsumedWarning!==r}}afterCompute(e,t,n){if(sf){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="")}}},uf=/* @__PURE__ */ /* @__PURE__ */(0,of.memo)(function({store:e,diagnostics:t}){return(0,of.useEffect)(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null}),df=[40,40],hf=[.5,.5],ff=null,pf=Gc(require("react")),mf=require("react"),gf=require("./semiotic-client-cjs-shared.min.js"),yf=require("react"),bf=require("react"),vf="undefined"==typeof window?bf.useEffect:bf.useLayoutEffect,xf=/* @__PURE__ */new WeakMap,wf=0,kf=!1,Sf=null,Mf=null,jf=null,Af=null,Cf=/* @__PURE__ */new Set,Rf=()=>"undefined"!=typeof performance?performance.now():Date.now(),Lf=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=/* @__PURE__ */new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??Rf,this.lastWallTime=Vn(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=Vn(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??Rf;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=Vn(t,this.lastWallTime))}setRandomSource(e,t){const n=Gn(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:qn(n)))}},Pf=34,Nf=70,Ef="undefined"==typeof window?mf.useEffect:mf.useLayoutEffect,If={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)},Tf=require("react"),zf=require("react"),$f={fresh:1,aging:.7,stale:.45,expired:.25},Df={alpha:1,band:"fresh",isStale:!1},_f=require("react/jsx-runtime"),Ff={live:"#28a745",stale:"#dc3545",stopped:"#6c757d",failed:"#842029",settling:"#fd7e14"},Of=Gc(require("react")),Bf=require("./semiotic-client-cjs-shared.min.js"),Wf=require("react"),Hf=/^\s*var\(\s*--[^,)\s]+\s*(?:,\s*([\s\S]*))?\)\s*$/,qf=require("react/jsx-runtime"),Gf="var(--semiotic-bg, #ffffff)",Vf=require("react/jsx-runtime"),Yf=require("react/jsx-runtime"),Uf=Gc(require("react")),Xf=require("react/jsx-runtime"),Zf=require("d3-hierarchy"),Kf=require("d3-shape"),Qf=require("d3-scale"),Jf=null,ep=require("react/jsx-runtime"),tp=/* @__PURE__ */new Map,np=/* @__PURE__ */new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]),rp=require("react/jsx-runtime"),ip={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"},op=require("react/jsx-runtime"),ap={secondary:0,primary:3},sp=require("react/jsx-runtime"),lp={linear:Kf.curveLinear,monotoneX:Kf.curveMonotoneX,monotoneY:Kf.curveMonotoneY,step:Kf.curveStep,stepAfter:Kf.curveStepAfter,stepBefore:Kf.curveStepBefore,basis:Kf.curveBasis,cardinal:Kf.curveCardinal,catmullRom:Kf.curveCatmullRom},cp=/* @__PURE__ */new Set(["label","callout","callout-circle","callout-rect","text","widget"]),up=32,dp=6,hp=4,fp=8,pp=72,mp={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"},gp=Gc(require("react")),yp={fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},bp={fontSize:"var(--semiotic-legend-font-size, 12px)"},vp=Gc(require("react")),xp=require("react/jsx-runtime"),wp=require("react/jsx-runtime"),kp=(e,t,n,r,i,o,a,s,l,c,u)=>{const{items:d}=e,h=[];let f=0;const p={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=i,metrics:u};return d.forEach((e,t)=>{h.push(co(p,e,t,`translate(0,${f})`,"ArrowUp","ArrowDown")),f+=u.rowHeight}),h},Sp=(e,t,n,r,i,o,a,s,l,c,u,d)=>{const{items:h}=e,f=[],{swatchSize:p,labelGap:m,itemGap:g,rowHeight:y,align:b}=u,v={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=i,metrics:u},x=h.map(e=>p+m+7*e.label.length),w=[];let k=0,S=0;x.forEach((e,t)=>{const n=0===S?e:S+g+e;d&&d>0&&S>0&&n>d?(w.push({start:k,end:t,width:S}),k=t,S=e):S=n}),h.length>0&&w.push({start:k,end:h.length,width:S}),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 r=e.start;r<e.end;r++)f.push(co(v,h[r],r,`translate(${n},${t*y})`,"ArrowLeft","ArrowRight")),n+=x[r]+g});const M=w.reduce((e,t)=>Math.max(e,t.width),0),j=w.length;return{items:f,offset:M,totalRows:j,totalHeight:j*y}},Mp=({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:a,focusedItemIndex:s,onFocusedIndexChange:l,legendInteraction:c,metrics:u})=>{const d=[],h=ur(e.map(e=>({hasLabel:Boolean(e.label),itemCount:e.items.length})),u.rowHeight);return e.forEach((e,f)=>{const p=h[f];d.push(
153
+ /* @__PURE__ */(0,Vg.jsx)("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function _l(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}function Fl(e){const t=(0,Zg.useRef)(null);return Il(e.imperativeRef,{variant:e.imperativeVariant,frameRef:t}),{frameRef:t,resolved:ll(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),normalizedMargin:(0,Zg.useMemo)(()=>_l(e.margin),[e.margin])}}function Ol(e){return null==e?void 0:String(e)}function Bl(e){const t=Ol(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??ey,style:{...Jg,cursor:e.cursor},datum:e.datum,pointId:t,_transitionKey:t}}function Wl(e){return Bl(e)}function Hl(e){const[[t,n],[r,i]]=e.bounds;return{type:"geoarea",pathData:e.pathData,centroid:e.centroid,bounds:e.bounds,screenArea:e.screenArea??Math.abs((r-t)*(i-n)),style:{...Jg,cursor:e.cursor},datum:e.datum,group:e.group,interactive:!0}}function ql(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function Gl(e){let t=1/0,n=-1/0;for(const r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,0]:[t,n]}function Vl(e,t){const n=t[1]-t[0];return 0===n?.5:(e-t[0])/n}function Yl(e,t={}){const n=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===n.length)return[];const r=zi(Number.isFinite(t.occupancy)?Number(t.occupancy):ry,.2,1),i=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):iy;let o=ql(t.columns)??Math.max(1,Math.ceil(Math.sqrt(n.length*i/r))),a=ql(t.rows)??Math.max(1,Math.ceil(n.length/(o*r)));o*a<n.length&&(null!=t.columns&&null==t.rows?a=Math.ceil(n.length/o):null!=t.rows&&null==t.columns?o=Math.ceil(n.length/a):a=Math.ceil(n.length/o));const s=Gl(n.map(e=>e.x)),l=Gl(n.map(e=>e.y)),c=n.map(e=>({...e,desiredColumn:Vl(e.x,s)*Math.max(0,o-1),desiredRow:Vl(e.y,l)*Math.max(0,a-1)})),u=(o-1)/2,d=(a-1)/2;c.sort((e,t)=>{const n=(e.desiredColumn-u)**2+(e.desiredRow-d)**2;return(t.desiredColumn-u)**2+(t.desiredRow-d)**2-n||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index});const h=/* @__PURE__ */new Set;for(let e=0;e<a;e+=1)for(let t=0;t<o;t+=1)h.add(e*o+t);const f=[];for(const e of c){let t=-1,n=1/0;for(const r of h){const i=Math.floor(r/o),a=(r%o-e.desiredColumn)**2+(i-e.desiredRow)**2;(a<n||a===n&&r<t)&&(t=r,n=a)}t<0||(h.delete(t),f.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/o),column:t%o,index:e.index}))}return f.sort((e,t)=>e.index-t.index),f.map(({index:e,...t})=>t)}function Ul(e,t,n=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(const t of n)if(null!=e[t])return e[t]}function Xl(e,t){const n=e.properties&&"object"==typeof e.properties?e.properties:{},r=e.id??n.id??n.name??`area-${t}`;return{...n,id:String(r)}}function Zl(e){return`${e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")}Z`}function Kl(e,t,n){const r=[];for(let i=0;i<6;i+=1){const o=-Math.PI/2+i*(Math.PI/3);r.push([e+Math.cos(o)*n,t+Math.sin(o)*n])}return Zl(r)}function Ql(e){return e.areas.map((t,n)=>{const r=Xl(t,n),i=e.scales.geoPath.centroid(t),o=Number.isFinite(i[0])&&Number.isFinite(i[1])?e.scales.invertedPoint(i[0],i[1]):null;return{datum:{...r,gridLongitude:o?.[0],gridLatitude:o?.[1]},x:i[0],y:i[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function Jl(e){return e.points.map(t=>{const n=Number(Ul(t,e.config.longitudeAccessor,["lon","longitude"])),r=Number(Ul(t,e.config.latitudeAccessor,["lat","latitude"])),i=Number.isFinite(n)&&Number.isFinite(r)?e.scales.projectedPoint(n,r):null;return{datum:t,x:i?.[0]??NaN,y:i?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function ec(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;const n=e.map(e=>({datum:e,x:Number(Ul(e,t.columnAccessor)),y:Number(Ul(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return n.length!==e.length?null:n.map(e=>({...e,row:e.y,column:e.x}))}function tc({marks:e,color:t,fontSize:n,fontFamily:r,fontWeight:i}){const o=(0,ty.useCustomLayoutSelection)();/* @__PURE__ */ /* @__PURE__ */
154
+ return(0,ny.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{const a=!o.isActive||o.predicate(e.datum);/* @__PURE__ */ /* @__PURE__ */
155
+ return(0,ny.jsx)("text",{x:e.x,y:e.y,fill:t,fontFamily:r,fontSize:n,fontWeight:i,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function nc(e){if(Number.isFinite(e)&&!(Number(e)<=0))return Number(e)}function rc(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function ic(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function oc(e,t){const n=ic(e);return String(e.id??n.id??n.name??`feature-${t}`)}function ac(e,t){if(0===e.length)return null;const n={type:"FeatureCollection",features:e},r=t.bounds(n);return Number.isFinite(r[0][0])&&Number.isFinite(r[0][1])&&Number.isFinite(r[1][0])&&Number.isFinite(r[1][1])?r:null}function sc(e,t,n,r){return[Math.ceil((e-n)/r-.5),Math.floor((t-n)/r-.5)]}function lc(e){if(!e)return 0;const t=dy.get(e);if(t)return t;const n=hy;return hy+=1,dy.set(e,n),n}function cc(e){return e.map((e,t)=>{if(uy.has(e))return{feature:e,index:t,bounds:uy.get(e)??null};try{const n=W(e);return uy.set(e,n),{feature:e,index:t,bounds:n}}catch{return uy.set(e,null),{feature:e,index:t,bounds:null}}})}function uc(e,t){return!t||e[1]>=t[0][1]&&e[1]<=t[1][1]&&(n=e[0],(r=t[0][0])<=(i=t[1][0])?n>=r&&n<=i:n>=r||n<=i);var n,r,i}function dc(e,t){for(const n of e){const{feature:e,index:r}=n;if(e.geometry&&uc(t,n.bounds))try{if(ke(e,t))return{feature:e,index:r}}catch{}}return null}function hc(e,t,n,r={}){const i=e.filter((e,t)=>e.geometry&&(!r.featureFilter||r.featureFilter(e,t))),o=ac(i,t.geoPath);if(!o)return{dots:[],cellSize:sy,features:i};const a=Math.max(0,r.layoutPadding??0),s=[[zi(o[0][0],a,Math.max(a,n.width-a)),zi(o[0][1],a,Math.max(a,n.height-a))],[zi(o[1][0],a,Math.max(a,n.width-a)),zi(o[1][1],a,Math.max(a,n.height-a))]],l=Math.max(0,s[1][0]-s[0][0]),c=Math.max(0,s[1][1]-s[0][1]);if(0===l||0===c)return{dots:[],cellSize:sy,features:i};const u=nc(r.columns);let d=Math.max(2,u?l/u:nc(r.cellSize)??sy);const h=Math.max(100,Math.round(nc(r.maxSamples)??ly)),f=Math.ceil(l/d)*Math.ceil(c/d);f>h&&(d*=Math.sqrt(f/h));const p=r.gridOrigin?.[0]??0,m=r.gridOrigin?.[1]??0,[g,y]=sc(s[0][0],s[1][0],p,d),[v,b]=sc(s[0][1],s[1][1],m,d),x=[],w=cc(i);for(let e=v;e<=b;e+=1){const n=m+(e+.5)*d;for(let i=g;i<=y;i+=1){const o=p+(i+.5)*d,a=t.invertedPoint(o,n);if(!a||!Number.isFinite(a[0])||!Number.isFinite(a[1]))continue;const s=dc(w,a);if(!s)continue;const l={...ic(s.feature),featureId:oc(s.feature,s.index),featureIndex:s.index,gridRow:e,gridColumn:i,longitude:a[0],latitude:a[1],dotIndex:x.length};r.dotFilter&&!r.dotFilter(l,x.length)||x.push(l)}}return{dots:x,cellSize:d,features:i}}function fc(e){return Math.round(1e4*e)/1e4}function pc(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${fc(Number(e[0]))},${fc(Number(e[1]))}`:"null"}function mc(e,t){const n=e[t];return"function"==typeof n?n.call(e):void 0}function gc(e){return"number"==typeof e&&Number.isFinite(e)?String(fc(e)):null===e?"null":"unavailable"}function yc(e){const t=e.scales.projection;return[gc(mc(t,"scale")),pc(mc(t,"translate")),pc(mc(t,"center")),(n=mc(t,"rotate"),Array.isArray(n)&&n.every(Number.isFinite)?n.map(e=>fc(Number(e))).join(","):"unavailable"),gc(mc(t,"clipAngle")),gc(mc(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,n])=>pc(e.scales.projectedPoint(t,n)))].join("|");var n}function vc(e){const t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",lc(t.featureFilter),lc(t.dotFilter),yc(e)].join("::")}function bc(e){let t=cy.get(e.areas);t||(t=/* @__PURE__ */new Map,cy.set(e.areas,t));const n=vc(e),r=t.get(n);if(r)return r;const i=hc(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){const e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(n,i),i}function xc(e){return`${e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")}Z`}function wc(e,t,n){return xc([[e-n,t-n],[e+n,t-n],[e+n,t+n],[e-n,t+n]])}function kc(e,t,n){return xc(Array.from({length:6},(r,i)=>{const o=-Math.PI/2+i*(Math.PI/3);return[e+Math.cos(o)*n,t+Math.sin(o)*n]}))}function Sc(e,t,n){const{featureKey:r,dataKey:i}=n,o=/* @__PURE__ */new Map;for(const e of t){const t=String(Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0);o.set(t,e)}const a=e=>{const t=r.split(".");let n=e;for(const e of t)n=null!==n&&"object"==typeof n&&Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0;return String(n??"")};return e.map(e=>{const t=a(e),n=o.get(t);return n?{...e,properties:{...e.properties,...n}}:e})}var Mc,jc,Ac,Cc,Rc,Lc,Pc,Nc,Ec,Ic,Tc,zc,$c,Dc,_c,Fc,Oc=Object.create,Bc=Object.defineProperty,Wc=Object.getOwnPropertyDescriptor,Hc=Object.getOwnPropertyNames,qc=Object.getPrototypeOf,Gc=Object.prototype.hasOwnProperty,Vc=(e,t,n)=>function(){if(n)throw n[0];try{return e&&(t=(0,e[Hc(e)[0]])(e=0)),t}catch(e){throw n=[e],e}},Yc=(e,t)=>{for(var n in t)Bc(e,n,{get:t[n],enumerable:!0})},Uc=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Hc(t))Gc.call(e,i)||i===n||Bc(e,i,{get:()=>t[i],enumerable:!(r=Wc(t,i))||r.enumerable});return e},Xc=(e,t,n)=>(n=null!=e?Oc(qc(e)):{},Uc(!t&&e&&e.__esModule?n:Bc(n,"default",{value:e,enumerable:!0}),e)),Zc=Vc({"src/components/stream/accessibleDataRows.ts"(){}}),Kc=Vc({"src/components/stream/accessibleTableStyles.ts"(){Mc=5,jc=25,Ac="semiotic-accessible-data-table semiotic-accessible-data-table-hidden",Cc="semiotic-accessible-data-table semiotic-accessible-data-table-visible",Rc={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Lc={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"},Pc={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},Nc={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)"},Ec={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},Ic={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))"},Tc={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},zc={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},$c={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"}}}),Qc={};Yc(Qc,{default:()=>s});var Jc,eu,tu,nu,ru,iu=Vc({"src/components/stream/AccessibleTablePortalImpl.tsx"(){Dc=Xc(require("react")),_c=require("react-dom"),Fc=require("react/jsx-runtime")}}),ou=Vc({"src/components/stream/accessibleDataTableModel.ts"(){Jc=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":String(t)}}}),au=Vc({"src/components/stream/AccessibleDataRowsTable.tsx"(){ou(),Kc(),eu=require("react/jsx-runtime")}}),su=Vc({"src/components/stream/AccessibleTableMoreRows.tsx"(){Kc(),tu=require("react/jsx-runtime")}}),lu={};Yc(lu,{default:()=>f});var cu,uu=Vc({"src/components/stream/AccessibleDataTableContent.tsx"(){nu=Xc(require("react")),au(),su(),Kc(),Zc(),ou(),ru=require("react/jsx-runtime")}}),du={};Yc(du,{ChoroplethMap:()=>Rg,DEFAULT_HIT_RADIUS:()=>ey,DistanceCartogram:()=>Ug,FlowMap:()=>qg,GeoCustomChart:()=>Qg,MultiLineTooltip:()=>os,ProportionalSymbolMap:()=>Dg,StreamGeoFrame:()=>Zm,Tooltip:()=>is,TooltipRoot:()=>gm,composeStyleRules:()=>yl,geoAreaHitTarget:()=>Hl,geoHitTarget:()=>Wl,geographicDotGridLayout:()=>fy,geographicGridLayout:()=>oy,glyphExtent:()=>Cn,glyphPlacement:()=>An,gridifyGeographicPoints:()=>Yl,hasOwnTooltipChrome:()=>ua,hasTooltipContent:()=>oa,hatchFillId:()=>mi,hatchPatternDef:()=>yi,hitTargetPoint:()=>Bl,isHatchFill:()=>fi,makeNodeRuleContext:()=>hl,makeRuleValueResolver:()=>dl,markTooltipChrome:()=>la,matchesThreshold:()=>pl,mergeData:()=>Sc,resolveReferenceGeography:()=>Cl,resolveResponsiveRules:()=>Ds,resolveStyleRules:()=>gl,resolveSvgFill:()=>vi,responsiveRuleMatches:()=>zs,ruleMatches:()=>ml,sampleGeographicDotGrid:()=>hc}),module.exports=(cu=du,Uc(Bc({},"__esModule",{value:!0}),cu));var hu,fu,pu,mu,gu,yu,vu,bu,xu,wu,ku,Su,Mu,ju,Au,Cu,Ru=require("react"),Lu=require("d3-array"),Pu=1e-6,Nu=1e-12,Eu=Math.PI,Iu=Eu/2,Tu=Eu/4,zu=2*Eu,$u=180/Eu,Du=Eu/180,_u=Math.abs,Fu=Math.atan,Ou=Math.atan2,Bu=Math.cos,Wu=Math.ceil,Hu=Math.exp,qu=Math.log,Gu=Math.sin,Vu=Math.sign||function(e){return e>0?1:e<0?-1:0},Yu=Math.sqrt,Uu=Math.tan,Xu={Feature:function(e,t){y(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)y(n[r].geometry,t)}},Zu={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){v(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)v(n[r],t,0)},Polygon:function(e,t){b(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)b(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)y(n[r],t)}},Ku=new Lu.Adder,Qu=new Lu.Adder,Ju={point:g,lineStart:g,lineEnd:g,polygonStart:function(){Ku=new Lu.Adder,Ju.lineStart=w,Ju.lineEnd=k},polygonEnd:function(){var e=+Ku;Qu.add(e<0?zu+e:e),this.lineStart=this.lineEnd=this.point=g},sphere:function(){Qu.add(zu)}},ed=require("d3-array"),td={point:E,lineStart:T,lineEnd:z,polygonStart:function(){td.point=$,td.lineStart=D,td.lineEnd=_,ju=new ed.Adder,Ju.polygonStart()},polygonEnd:function(){Ju.polygonEnd(),td.point=E,td.lineStart=T,td.lineEnd=z,Ku<0?(yu=-(bu=180),vu=-(xu=90)):ju>Pu?xu=90:ju<-Pu&&(vu=-90),Cu[0]=yu,Cu[1]=bu},sphere:function(){yu=-(bu=180),vu=-(xu=90)}};q.invert=q;var nd,rd,id,od,ad,sd,ld,cd,ud,dd,hd,fd,pd=require("d3-array"),md=require("d3-array"),gd=oe(function(){return!0},function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?Eu:-Eu,l=_u(o-n);_u(l-Eu)<Pu?(e.point(n,r=(r+a)/2>0?Iu:-Iu),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&l>=Eu&&(_u(n-i)<Pu&&(n-=i*Pu),_u(o-s)<Pu&&(o-=s*Pu),r=le(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}},function(e,t,n,r){var i;if(null==e)i=n*Iu,r.point(-Eu,i),r.point(0,i),r.point(Eu,i),r.point(Eu,0),r.point(Eu,-i),r.point(0,-i),r.point(-Eu,-i),r.point(-Eu,0),r.point(-Eu,i);else if(_u(e[0]-t[0])>Pu){var o=e[0]<t[0]?Eu:-Eu;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])},[-Eu,-Iu]),yd=require("d3-array"),vd=1e9,bd=-vd,xd=require("d3-array"),wd={sphere:g,point:g,lineStart:function(){wd.point=fe,wd.lineEnd=he},lineEnd:g,polygonStart:g,polygonEnd:g},kd=[null,null],Sd={type:"LineString",coordinates:kd},Md={Feature:function(e,t){return ge(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(ge(n[r].geometry,t))return!0;return!1}},jd={Sphere:function(){return!0},Point:function(e,t){return ye(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(ye(n[r],t))return!0;return!1},LineString:function(e,t){return ve(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(ve(n[r],t))return!0;return!1},Polygon:function(e,t){return be(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(be(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(ge(n[r],t))return!0;return!1}},Ad=require("d3-array"),Cd=e=>e,Rd=require("d3-array"),Ld=new Rd.Adder,Pd=new Rd.Adder,Nd={point:g,lineStart:g,lineEnd:g,polygonStart:function(){Nd.lineStart=Ce,Nd.lineEnd=Pe},polygonEnd:function(){Nd.lineStart=Nd.lineEnd=Nd.point=g,Ld.add(_u(Pd)),Pd=new Rd.Adder},result:function(){var e=Ld/2;return Ld=new Rd.Adder,e}},Ed=Nd,Id=1/0,Td=Id,zd=-Id,$d=zd,Dd={point:function(e,t){e<Id&&(Id=e),e>zd&&(zd=e),t<Td&&(Td=t),t>$d&&($d=t)},lineStart:g,lineEnd:g,polygonStart:g,polygonEnd:g,result:function(){var e=[[Id,Td],[zd,$d]];return zd=$d=-(Td=Id=1/0),e}},_d=0,Fd=0,Od=0,Bd=0,Wd=0,Hd=0,qd=0,Gd=0,Vd=0,Yd={point:Ne,lineStart:Ee,lineEnd:ze,polygonStart:function(){Yd.lineStart=$e,Yd.lineEnd=De},polygonEnd:function(){Yd.point=Ne,Yd.lineStart=Ee,Yd.lineEnd=ze},result:function(){var e=Vd?[qd/Vd,Gd/Vd]:Hd?[Bd/Hd,Wd/Hd]:Od?[_d/Od,Fd/Od]:[NaN,NaN];return _d=Fd=Od=Bd=Wd=Hd=qd=Gd=Vd=0,e}},Ud=Yd;Oe.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,zu)}},result:g};var Xd,Zd,Kd,Qd,Jd,eh,th,nh,rh,ih=require("d3-array"),oh=new ih.Adder,ah={point:g,lineStart:function(){ah.point=Be},lineEnd:function(){Xd&&We(Zd,Kd),ah.point=g},polygonStart:function(){Xd=!0},polygonEnd:function(){Xd=null},result:function(){var e=+oh;return oh=new ih.Adder,e}},sh=ah,lh=class{constructor(e){this._append=null==e?He:qe(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(e,t){switch(this._point){case 0:this._append`M${e},${t}`,this._point=1;break;case 1:this._append`L${e},${t}`;break;default:if(this._append`M${e},${t}`,this._radius!==nh||this._append!==th){const e=this._radius,t=this._;this._="",this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,nh=e,th=this._append,rh=this._,this._=t}this._+=rh}}result(){const e=this._;return this._="",e.length?e:null}};Ye.prototype={constructor:Ye,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ch=Bu(30*Du),uh=Ve({point:function(e,t){this.stream.point(e*Du,t*Du)}});ut.invert=function(e,t){return[e,2*Fu(Hu(t))-Iu]},ht.invert=ht;var dh,hh=1.340264,fh=-.081106,ph=893e-6,mh=.003796,gh=Yu(3)/2;ft.invert=function(e,t){for(var n,r=t,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(hh+fh*i+o*(ph+mh*i))-t)/(hh+3*fh*i+o*(7*ph+9*mh*i)))*r)*i*i,!(_u(n)<Nu));++a);return[gh*e*(hh+3*fh*i+o*(7*ph+9*mh*i))/Bu(r),p(Gu(r)/gh)]},mt.invert=function(e,t){var n,r=t,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-t)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(_u(n)>Pu&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},gt.invert=(dh=p,function(e,t){var n=Yu(e*e+t*t),r=dh(n),i=Gu(r),o=Bu(r);return[Ou(e*i,n*o),p(n&&t*i/n)]});var yh,vh,bh=require("d3-quadtree"),xh=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,e<1)throw new Error("RingBuffer capacity must be at least 1");this.buffer=new Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const n of e){const e=this.push(n);void 0!==e&&t.push(e)}return t}get(e){if(e<0||e>=this._size)return;const t=(this.head-this._size+e+this._capacity)%this._capacity;return this.buffer[t]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>e>=this._size?{done:!0,value:void 0}:{done:!1,value:this.get(e++)}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;n<this._size;n++)e(this.buffer[(t+n)%this._capacity],n)}toArray(){const e=new Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;n<this._size;n++)e[n]=this.buffer[(t+n)%this._capacity];return e}resize(e){if(e<1)throw new Error("RingBuffer capacity must be at least 1");const t=this.toArray();let n=0,r=[];t.length>e&&(n=t.length-e,r=t.slice(0,n)),this._capacity=e,this.buffer=new Array(e),this.head=0,this._size=0;for(let e=n;e<t.length;e++)this.push(t[e]);return r}update(e,t){const n=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;i<this._size;i++){const o=(r+i)%this._capacity,a=this.buffer[o];if(e(a)){let e;e="object"!=typeof a||null===a?a:Array.isArray(a)?[...a]:{...a},n.push(e),this.buffer[o]=t(a)}}return n}remove(e){const t=[],n=[];if(this.forEach(r=>{e(r)?n.push(r):t.push(r)}),0===n.length)return n;this.buffer=new Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return n}clear(){this.buffer=new Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},wh=1,kh=1.5,Sh=3,Mh=require("d3-scale"),jh=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Ah=/* @__PURE__ */Lt(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),Ch=/* @__PURE__ */Lt(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),Rh=/* @__PURE__ */Lt(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),Lh=/* @__PURE__ */Lt(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),Ph=/* @__PURE__ */Lt(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),Nh=/* @__PURE__ */Lt(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),Eh={blues:Ah,reds:Ch,greens:Rh,viridis:/* @__PURE__ */Lt(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),oranges:Lh,purples:Ph,greys:Nh,plasma:/* @__PURE__ */Lt(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),inferno:/* @__PURE__ */Lt(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),magma:/* @__PURE__ */Lt(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),cividis:/* @__PURE__ */Lt(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),turbo:/* @__PURE__ */Lt(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"])},Ih={category10:jh,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],...Eh},Th=jh,zh="#007bff",$h=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],Dh=/* @__PURE__ */new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),_h={mercator:function(){return dt(ut).scale(961/zu)},equalEarth:pt,albersUsa:function(){function e(e){var t=e[0],n=e[1];return s=null,i.point(t,n),s||(o.point(t,n),s)||(a.point(t,n),s)}function t(){return n=r=null,e}var n,r,i,o,a,s,l=ct().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7]),c=ct().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=ct().rotate([157,0]).center([-3,19.9]).parallels([8,18]),d={point:function(e,t){s=[e,t]}};return e.invert=function(e){var t=l.scale(),n=l.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?c:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:l).invert(e)},e.stream=function(e){return n&&r===e?n:(t=[l.stream(r=e),c.stream(e),u.stream(e)],i=t.length,n={point:function(e,n){for(var r=-1;++r<i;)t[r].point(e,n)},sphere:function(){for(var e=-1;++e<i;)t[e].sphere()},lineStart:function(){for(var e=-1;++e<i;)t[e].lineStart()},lineEnd:function(){for(var e=-1;++e<i;)t[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<i;)t[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<i;)t[e].polygonEnd()}});var t,i},e.precision=function(e){return arguments.length?(l.precision(e),c.precision(e),u.precision(e),t()):l.precision()},e.scale=function(t){return arguments.length?(l.scale(t),c.scale(.35*t),u.scale(t),e.translate(l.translate())):l.scale()},e.translate=function(e){if(!arguments.length)return l.translate();var n=l.scale(),r=+e[0],s=+e[1];return i=l.translate(e).clipExtent([[r-.455*n,s-.238*n],[r+.455*n,s+.238*n]]).stream(d),o=c.translate([r-.307*n,s+.201*n]).clipExtent([[r-.425*n+Pu,s+.12*n+Pu],[r-.214*n-Pu,s+.234*n-Pu]]).stream(d),a=u.translate([r-.205*n,s+.212*n]).clipExtent([[r-.214*n+Pu,s+.166*n+Pu],[r-.115*n-Pu,s+.234*n-Pu]]).stream(d),t()},e.fitExtent=function(t,n){return Xe(e,t,n)},e.fitSize=function(t,n){return Ze(e,t,n)},e.fitWidth=function(t,n){return Ke(e,t,n)},e.fitHeight=function(t,n){return Qe(e,t,n)},e.scale(1070)},orthographic:function(){return ot(gt).scale(249.5).clipAngle(90.000001)},naturalEarth:function(){return ot(mt).scale(175.295)},equirectangular:function(){return ot(ht).scale(152.63)}},Fh=require("d3-scale"),Oh={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},Bh=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=dn({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){const n=dn(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}},Wh=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Hh=["scene-style","data-paint","accessibility","evidence"],qh=(e,t)=>({retainedData:e,invalidations:t}),Gh=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Vh=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Yh=["scene-geometry","data-paint","accessibility","evidence"],Uh=["scene-style","data-paint","accessibility","evidence"],Xh=["scene-geometry","scene-style","data-paint","accessibility","evidence"],Zh=["overlay","accessibility","evidence"],Kh=[],Qh={xAccessor:/* @__PURE__ */qh("rebuild",Gh),yAccessor:/* @__PURE__ */qh("rebuild",Gh),lineDataAccessor:/* @__PURE__ */qh("rebuild",Gh),pointIdAccessor:/* @__PURE__ */qh("rebuild",Yh),lineIdAccessor:/* @__PURE__ */qh("rebuild",Yh),windowSize:/* @__PURE__ */qh("rebuild",Gh),projection:/* @__PURE__ */qh("preserve",Vh),projectionExtent:/* @__PURE__ */qh("preserve",Vh),fitPadding:/* @__PURE__ */qh("preserve",Vh),lineType:/* @__PURE__ */qh("preserve",Vh),flowStyle:/* @__PURE__ */qh("preserve",Vh),graticule:/* @__PURE__ */qh("preserve",Vh),projectionTransform:/* @__PURE__ */qh("preserve",Vh),customLayout:/* @__PURE__ */qh("preserve",Vh),layoutConfig:/* @__PURE__ */qh("preserve",Vh),layoutMargin:/* @__PURE__ */qh("preserve",Vh),areaStyle:/* @__PURE__ */qh("preserve",Uh),pointStyle:/* @__PURE__ */qh("preserve",Xh),lineStyle:/* @__PURE__ */qh("preserve",Uh),colorScheme:/* @__PURE__ */qh("preserve",Uh),themeCategorical:/* @__PURE__ */qh("preserve",Uh),themeDiverging:/* @__PURE__ */qh("preserve",Uh),themeSemantic:/* @__PURE__ */qh("preserve",Uh),themeSequential:/* @__PURE__ */qh("preserve",Uh),decay:/* @__PURE__ */qh("preserve",Uh),pulse:/* @__PURE__ */qh("preserve",Uh),layoutSelection:/* @__PURE__ */qh("preserve",Uh),annotations:/* @__PURE__ */qh("preserve",Zh),autoPlaceAnnotations:/* @__PURE__ */qh("preserve",Zh),clock:/* @__PURE__ */qh("preserve",Kh),transition:/* @__PURE__ */qh("preserve",Kh),introAnimation:/* @__PURE__ */qh("preserve",Kh),onLayoutError:/* @__PURE__ */qh("preserve",Kh)},Jh=/* @__PURE__ */qh("preserve",Vh),ef=class{constructor(){this.tracker=new Bh}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},Wh)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Hh):this.recordNoop("restyle")}recordConfig(e,t={}){const n=hn(e),r=new Set(n.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}},tf=/* @__PURE__ */new WeakMap,nf=class{getLastUpdateResult(){return this.updateResults.last}getUpdateSnapshot(){return this.updateResults.last}subscribeUpdateResult(e){return this.updateResults.subscribe(e)}setLayoutSelection(e){this.config.layoutSelection=e}markStylePaintPending(){tf.set(this,!0)}consumeStylePaintPending(){const e=!0===tf.get(this);return tf.delete(this),e}},rf=class extends nf{constructor(e){super(),this.updateResults=new ef,this.scene=[],this.scales=null,this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutDiagnosticsWarned=/* @__PURE__ */new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this._customLayoutFailedThisBuild=!1,this._quadtree=null,this._maxPointRadius=0,this.projection=null,this.geoPath=null,this.baseScale=0,this.baseTranslate=[0,0],this.baseRotation=[0,0,0],this.currentZoom=1,this.cartogramLayout=null,this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.streaming=!1,this.lastIngestTime=0,this.timestampBuffer=null,this.activeTransition=null,this.prevPositions=null,this._hasRenderedOnce=!1,this.config=mn(e)}currentTime(){return this.config.clock?.()??("undefined"!=typeof performance?performance.now():Date.now())}getConfiguredWindowSize(){const e=this.config.windowSize??500;if(!Number.isInteger(e)||e<1)throw new Error("GeoPipelineStore windowSize must be a positive integer");return e}retainNewestLines(e=this.getConfiguredWindowSize()){this.lineData.length>e&&(this.lineData=this.lineData.slice(-e))}resizeStreamingWindow(e){if(this.pointBuffer){const t=this.pointBuffer.toArray(),n=this.timestampBuffer?.toArray()??[],r=t.slice(-e),i=n.slice(-r.length),o=this.currentTime();this.pointBuffer=new xh(e),this.timestampBuffer=new xh(e),r.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(i[t]??o)})}this.retainNewestLines(e)}updateConfig(e){const t=gn(e),n=this.config,r=this.getConfiguredWindowSize(),i=Object.keys(t).filter(e=>t[e]!==n[e]);this.config={...this.config,...t};const o=this.getConfiguredWindowSize(),a=this.streaming&&o!==r;a&&(this.resizeStreamingWindow(o),this.version++),"customLayout"in t&&!t.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(i,{retainedDataChanged:a})}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}setAreas(e){this.areas=e,this.updateResults.recordData("replace",e.length)}setAreasWithResult(e){return this.setAreas(e),this.updateResults.last}setPoints(e){this.pointData=e.slice(),this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.updateResults.recordData("replace",e.length)}setPointsWithResult(e){return this.setPoints(e),this.updateResults.last}setLines(e){this.lineData=e.slice(),this.streaming&&this.retainNewestLines(),this.updateResults.recordData("replace",e.length)}setLinesWithResult(e){return this.setLines(e),this.updateResults.last}initStreaming(e){void 0!==e&&e!==this.config.windowSize&&(this.config={...this.config,windowSize:e});const t=this.getConfiguredWindowSize(),n=this.pointBuffer?this.pointBuffer.toArray():this.pointData,r=this.timestampBuffer?.toArray()??[],i=n.slice(-t),o=r.slice(-i.length),a=this.currentTime();this.pointBuffer=new xh(t),this.timestampBuffer=new xh(t),i.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(o[t]??a)}),this.pointData=[],this.retainNewestLines(t),this.streaming=!0}pushPoint(e){this.pointBuffer||this.initStreaming();const t=this.currentTime();ln(this.pointBuffer,e,this.timestampBuffer,t),this.lastIngestTime=t,this.updateResults.recordData("ingest",1)}pushPointWithResult(e){return this.pushPoint(e),this.updateResults.last}pushMany(e){this.pointBuffer||this.initStreaming();const t=this.currentTime();for(const n of e)ln(this.pointBuffer,n,this.timestampBuffer,t);this.lastIngestTime=t,this.updateResults.recordData("ingest",e.length)}pushManyWithResult(e){return this.pushMany(e),this.updateResults.last}pushLine(e){null!=e&&"object"==typeof e?(this.streaming||this.initStreaming(),this.lineData.push(e),this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",1)):this.updateResults.recordNoop("ingest")}pushManyLines(e){if(!Array.isArray(e)||0===e.length)return void this.updateResults.recordNoop("ingest");const t=e.filter(e=>null!=e&&"object"==typeof e);if(0!==t.length){this.streaming||this.initStreaming();for(const e of t)this.lineData.push(e);this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",t.length)}else this.updateResults.recordNoop("ingest")}removeLine(e){const{lineIdAccessor:t}=this.config;if(!t)throw new Error("removeLine() requires lineIdAccessor to be configured");const n="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]),i=[];return this.lineData=this.lineData.filter(e=>!r.has(String(n(e)))||(i.push(e),!1)),i.length>0?(this.version++,this.updateResults.recordData("remove",i.length)):this.updateResults.recordNoop("remove"),i}getLines(){return this.lineData.slice()}removePoint(e){const{pointIdAccessor:t}=this.config;if(!t)throw new Error("removePoint() requires pointIdAccessor to be configured");const n="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]);if(this.streaming&&this.pointBuffer){const e=e=>r.has(String(n(e)));cn(this.pointBuffer,this.timestampBuffer,e);const t=this.pointBuffer.remove(e);return t.length>0?(this.version++,this.updateResults.recordData("remove",t.length)):this.updateResults.recordNoop("remove"),t}{const e=[];return this.pointData=this.pointData.filter(t=>!r.has(String(n(t)))||(e.push(t),!1)),e.length>0?(this.version++,this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}}clear(){this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.scene=[],this.scales=null,this._hasRenderedOnce=!1,this.activeTransition=null,this.prevPositions=null,this._quadtree=null,this._maxPointRadius=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this._customLayoutFailedThisBuild=!1,this.version++,this.updateResults.recordData("clear")}restyleScene(e){const t=this._customRestyle;if(t){for(const n of this.scene){const r=this._baseStyles.get(n)??n.style,i=t(n,e);n.style=i?{...r,...i}:r}this.markStylePaintPending(),this.updateResults.recordRestyle(!0)}else this.updateResults.recordRestyle(!1)}computeScene(e){const{config:t}=this,n=this.projection,r=this.geoPath,i=this.scales,o=this.baseScale,a=[...this.baseTranslate],s=[...this.baseRotation],l=this.scene;this.projection=Gt(t.projection),this.geoPath=Ge(this.projection),this.fitProjection(e),this.geoPath=Ge(this.projection);const c=this.projection;this.scales={projection:c,geoPath:this.geoPath,projectedPoint:(e,t)=>c([e,t]),invertedPoint:(e,t)=>c.invert?c.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const u=this.buildSceneNodes(e);if(this._customLayoutFailedThisBuild)!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.projection=n,this.geoPath=r,this.scales=i,this.baseScale=o,this.baseTranslate=a,this.baseRotation=s):(this.scene=[],this.rebuildQuadtree());else{if(this.scene=u,this.rebuildQuadtree(),t.projectionTransform&&this.applyCartogramTransform(t.projectionTransform,e),t.decay&&this.streaming&&this.applyDecay(),t.pulse&&this.streaming&&this.applyPulse(),t.transition&&!this._hasRenderedOnce&&this.scene.length>0&&t.introAnimation){const t=e.width/2,n=e.height/2,r=this.scene.filter(e=>"point"===e.type).map(e=>({...e,x:t,y:n}));r.length>0&&this.startTransition(r)}this._hasRenderedOnce=!0,t.transition&&l.length>0&&this.startTransition(l),this.version++}}fitProjection(e){const t=this.projection,n=this.config,r=[...this.areas],i=Vt(n.xAccessor,"lon"),o=Vt(n.yAccessor,"lat"),a=this.getPoints();if(a.length>0){const e=a.map(e=>[i(e),o(e)]);r.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}const s=Yt(n.lineDataAccessor);for(const e of this.lineData){const t=s(e);if(t&&t.length>0){const e=t.map(e=>[i(e),o(e)]);r.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}})}}if(0!==r.length){if(n.projectionExtent){const[[r,i],[o,a]]=n.projectionExtent,s={type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[r,i],[r,a],[o,a],[o,i],[r,i]]]}};t.fitExtent([[0,0],[e.width,e.height]],s)}else if(t.clipAngle&&(t.clipAngle()??0)>0){const r=n.fitPadding??0,i=Math.min(e.width,e.height),o=i/2-i*r;t.scale(o),t.translate([e.width/2,e.height/2])}else{const i={type:"FeatureCollection",features:r},o=n.fitPadding??0,a=e.width*o,s=e.height*o;t.fitExtent([[a,s],[e.width-a,e.height-s]],i)}this.baseScale=t.scale(),this.baseTranslate=t.translate(),this.baseRotation=t.rotate?.()??[0,0,0]}}applyZoomTransform(e,t){const n=this.projection;if(!n)return;const r=this.geoPath,i=this.scales,o=n.scale(),a=[...n.translate()],s=this.currentZoom;n.scale(this.baseScale*e.k),n.translate([this.baseTranslate[0]*e.k+e.x,this.baseTranslate[1]*e.k+e.y]),this.currentZoom=e.k,this.geoPath=Ge(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyZoomScale(e,t){const n=this.projection;if(!n)return;const r=this.geoPath,i=this.scales,o=n.scale(),a=[...n.translate()],s=this.currentZoom;n.scale(this.baseScale*e),n.translate(this.baseTranslate),this.currentZoom=e,this.geoPath=Ge(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyRotation(e,t){const n=this.projection;if(!n||!n.rotate)return;const r=this.geoPath,i=this.scales,o=[...n.rotate()];n.rotate(e),this.geoPath=Ge(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const a=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.rotate(o),this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=a,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}setRotation(e){const t=this.projection;t&&t.rotate&&t.rotate(e)}hasProjection(){return null!=this.projection}getRotation(){return this.projection?.rotate?.()??this.baseRotation}getBaseProjectionState(){return{scale:this.baseScale,translate:[...this.baseTranslate]}}getPoints(){return this.streaming&&this.pointBuffer?this.pointBuffer.toArray():this.pointData}rebuildQuadtree(){let e=0,t=0;for(const n of this.scene)"point"===n.type&&!1!==n.interactive&&(t++,n.r>e&&(e=n.r));if(this._maxPointRadius=e,t<=500)return void(this._quadtree=null);const n=new Array(t);let r=0;for(const e of this.scene)"point"===e.type&&!1!==e.interactive&&(n[r++]=e);this._quadtree=(0,bh.quadtree)().x(e=>e.x).y(e=>e.y).addAll(n)}get quadtree(){return this._quadtree}get maxPointRadius(){return this._maxPointRadius}buildSceneNodes(e){this._customLayoutFailedThisBuild=!1;const{config:t}=this,n=this.projection,r=this.geoPath;if(t.customLayout&&this.scales){const n=t.layoutMargin??{top:0,right:0,bottom:0,left:0},r=Nt(t.colorScheme,t.themeCategorical,$h),i={areas:this.areas.slice(),points:this.getPoints().slice(),lines:this.lineData.slice(),scales:this.scales,dimensions:{width:e.width,height:e.height,margin:n,plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:t.themeSemantic??{},categorical:[...r]},resolveColor:_t(r,t.colorScheme),config:t.layoutConfig??{},selection:t.layoutSelection??null},o=qt({family:"geo",logLabel:"geo customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:t.onLayoutError,run:()=>t.customLayout(i)});if("failure"===o.kind)return this.lastCustomLayoutFailure=o.diagnostic,this._customLayoutFailedThisBuild=!0,o.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,[]);const a=o.result,s=a.nodes??[];if(this.customLayoutOverlays=a.overlays??null,this.lastCustomLayoutResult=a,this.lastCustomLayoutFailure=null,this._customRestyle=a.restyle,this.hasCustomRestyle=!!a.restyle,this._baseStyles=/* @__PURE__ */new WeakMap,this.hasCustomRestyle)for(const e of s){this._baseStyles.set(e,e.style);const n=a.restyle?.(e,t.layoutSelection??null);n&&(e.style={...e.style,...n})}return Ft({label:"geo customLayout",nodes:s,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),s}return this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,fn({config:t,projection:n,path:r,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:e})}applyCartogramTransform(e,t){const n=on(this.scene,e,t,this.areas.length);n&&(this.cartogramLayout=n)}applyDecay(){const e=this.config.decay;if(!e||!this.pointBuffer)return;const t=this.pointBuffer.size;if(0===t)return;const n=this.scene.filter(e=>"point"===e.type);for(let r=0;r<n.length;r++){const i=St(e,r,t);n[r]._decayOpacity=i,n[r].style={...n[r].style,opacity:i}}}applyPulse(e=this.currentTime()){const t=this.config.pulse;if(!t||!this.timestampBuffer)return!1;const n=this.scene.filter(e=>"point"===e.type),r=this.timestampBuffer.toArray(),i=t.color||"rgba(255,255,255,0.6)",o=t.glowRadius??4;let a=!1;for(let s=0;s<n.length&&s<r.length;s++){const l=Mt(t,r[s],e);a=jt(n[s],l,i,o)||a}return a}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(e)}hasActivePulsesAt(e){return!!this.config.pulse&&At(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(e){const t=this.config.transition?.duration??300;if(t<=0)return;const n=/* @__PURE__ */new Map;for(const t of e)"point"===t.type&&t.pointId&&n.set(t.pointId,[t.x,t.y]);const r=this.scene.filter(e=>"point"===e.type);let i=!1;for(const e of r)if(e.pointId){const t=n.get(e.pointId);t&&(e._targetX=e.x,e._targetY=e.y,e.x=t[0],e.y=t[1],(Math.abs(t[0]-e._targetX)>.5||Math.abs(t[1]-e._targetY)>.5)&&(i=!0))}for(const e of r)e.pointId&&!n.has(e.pointId)&&(e._targetOpacity=e.style?.opacity??e.style?.fillOpacity??1,e.style={...e.style,opacity:0},i=!0);i&&(this.activeTransition={startTime:this.currentTime(),duration:t})}cancelIntroAnimation(){this.activeTransition=null;for(const e of this.scene)"point"===e.type&&(null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0),null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0))}advanceTransition(e){if(!this.activeTransition)return!1;const t=vt(e,this.activeTransition),n=yt(t),r=this.scene.filter(e=>"point"===e.type);for(const e of r){if(null!=e._targetX&&null!=e._targetY){const t=e.x,r=e.y;e.x=bt(t,e._targetX,n),e.y=bt(r,e._targetY,n)}null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity*n})}if(t>=1){for(const e of r)null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0),null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0);return this.activeTransition=null,!1}return!0}},of=require("react"),af=require("d3-selection"),sf=require("d3-zoom"),lf=Object.freeze([]),cf=require("react"),uf={sceneGeometry:0,layout:0,domain:0},df="production"!==process.env.NODE_ENV,hf={revisions:uf,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},ff=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=uf,this.lastObserved=uf,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){df&&(this.lastObserved=wn(this.lastObserved,bn(e)))}beforeCompute(e,t){if(!df)return hf;const n=wn(bn(e),this.lastObserved),r=xn(n),i=(o=n,a=this.lastConsumed,!(o.sceneGeometry===a.sceneGeometry&&o.layout===a.layout&&o.domain===a.domain));var o,a;return{revisions:n,signature:r,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:i,warnUnconsumed:!t&&i&&this.lastUnconsumedWarning!==r}}afterCompute(e,t,n){if(df){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="")}}},pf=/* @__PURE__ */ /* @__PURE__ */(0,cf.memo)(function({store:e,diagnostics:t}){return(0,cf.useEffect)(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null}),mf=[40,40],gf=[.5,.5],yf=null,vf=Xc(require("react")),bf=require("react"),xf=require("./semiotic-client-cjs-shared.min.js"),wf=require("react"),kf=require("react"),Sf="undefined"==typeof window?kf.useEffect:kf.useLayoutEffect,Mf=/* @__PURE__ */new WeakMap,jf=0,Af=!1,Cf=null,Rf=null,Lf=null,Pf=null,Nf=/* @__PURE__ */new Set,Ef=()=>"undefined"!=typeof performance?performance.now():Date.now(),If=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=/* @__PURE__ */new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??Ef,this.lastWallTime=Vn(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=Vn(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??Ef;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=Vn(t,this.lastWallTime))}setRandomSource(e,t){const n=Gn(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:qn(n)))}},Tf=34,zf=70,$f="undefined"==typeof window?bf.useEffect:bf.useLayoutEffect,Df={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)},_f=require("react"),Ff=require("react"),Of={fresh:1,aging:.7,stale:.45,expired:.25},Bf={alpha:1,band:"fresh",isStale:!1},Wf=require("react/jsx-runtime"),Hf={live:"#28a745",stale:"#dc3545",stopped:"#6c757d",failed:"#842029",settling:"#fd7e14"},qf=Xc(require("react")),Gf=require("./semiotic-client-cjs-shared.min.js"),Vf=require("react"),Yf=/^\s*var\(\s*--[^,)\s]+\s*(?:,\s*([\s\S]*))?\)\s*$/,Uf=require("react/jsx-runtime"),Xf="var(--semiotic-bg, #ffffff)",Zf=require("react/jsx-runtime"),Kf=require("react/jsx-runtime"),Qf=Xc(require("react")),Jf=require("react/jsx-runtime"),ep=require("d3-hierarchy"),tp=require("d3-shape"),np=require("d3-scale"),rp=null,ip=require("react/jsx-runtime"),op=/* @__PURE__ */new Map,ap=/* @__PURE__ */new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]),sp=require("react/jsx-runtime"),lp={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"},cp=require("react/jsx-runtime"),up={secondary:0,primary:3},dp=require("react/jsx-runtime"),hp={linear:tp.curveLinear,monotoneX:tp.curveMonotoneX,monotoneY:tp.curveMonotoneY,step:tp.curveStep,stepAfter:tp.curveStepAfter,stepBefore:tp.curveStepBefore,basis:tp.curveBasis,cardinal:tp.curveCardinal,catmullRom:tp.curveCatmullRom},fp=/* @__PURE__ */new Set(["label","callout","callout-circle","callout-rect","text","widget"]),pp=32,mp=6,gp=4,yp=8,vp=72,bp={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"},xp=Xc(require("react")),wp={fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},kp={fontSize:"var(--semiotic-legend-font-size, 12px)"},Sp=Xc(require("react")),Mp=require("react/jsx-runtime"),jp=require("react/jsx-runtime"),Ap=(e,t,n,r,i,o,a,s,l,c,u)=>{const{items:d}=e,h=[];let f=0;const p={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=i,metrics:u};return d.forEach((e,t)=>{h.push(co(p,e,t,`translate(0,${f})`,"ArrowUp","ArrowDown")),f+=u.rowHeight}),h},Cp=(e,t,n,r,i,o,a,s,l,c,u,d)=>{const{items:h}=e,f=[],{swatchSize:p,labelGap:m,itemGap:g,rowHeight:y,align:v}=u,b={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=i,metrics:u},x=h.map(e=>p+m+7*e.label.length),w=[];let k=0,S=0;x.forEach((e,t)=>{const n=0===S?e:S+g+e;d&&d>0&&S>0&&n>d?(w.push({start:k,end:t,width:S}),k=t,S=e):S=n}),h.length>0&&w.push({start:k,end:h.length,width:S}),w.forEach((e,t)=>{let n="center"===v?Math.max(0,((d??e.width)-e.width)/2):"end"===v?Math.max(0,(d??e.width)-e.width):0;for(let r=e.start;r<e.end;r++)f.push(co(b,h[r],r,`translate(${n},${t*y})`,"ArrowLeft","ArrowRight")),n+=x[r]+g});const M=w.reduce((e,t)=>Math.max(e,t.width),0),j=w.length;return{items:f,offset:M,totalRows:j,totalHeight:j*y}},Rp=({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:a,focusedItemIndex:s,onFocusedIndexChange:l,legendInteraction:c,metrics:u})=>{const d=[],h=ur(e.map(e=>({hasLabel:Boolean(e.label),itemCount:e.items.length})),u.rowHeight);return e.forEach((e,f)=>{const p=h[f];d.push(
156
156
  /* @__PURE__ */
157
- /* @__PURE__ */(0,wp.jsx)("line",{stroke:"gray",x1:0,y1:p.lineY,x2:t,y2:p.lineY},`legend-top-line legend-symbol-${f}`)),e.label&&null!=p.labelY&&d.push(
157
+ /* @__PURE__ */(0,jp.jsx)("line",{stroke:"gray",x1:0,y1:p.lineY,x2:t,y2:p.lineY},`legend-top-line legend-symbol-${f}`)),e.label&&null!=p.labelY&&d.push(
158
158
  /* @__PURE__ */
159
- /* @__PURE__ */(0,wp.jsx)("text",{y:p.labelY,className:"legend-group-label",fontSize:12,style:bp,fill:"var(--semiotic-text, #333)",children:e.label},`legend-text-${f}`)),d.push(
159
+ /* @__PURE__ */(0,jp.jsx)("text",{y:p.labelY,className:"legend-group-label",fontSize:12,style:kp,fill:"var(--semiotic-text, #333)",children:e.label},`legend-text-${f}`)),d.push(
160
160
  /* @__PURE__ */
161
- /* @__PURE__ */(0,wp.jsx)("g",{className:"legend-item",transform:`translate(0,${p.itemsY})`,children:kp(e,n,r,i,o,a,s,f,l,c,u)},`legend-group-${f}`))}),d},jp=({legendGroups:e,title:t,height:n,width:r,customClickBehavior:i,customHoverBehavior:o,highlightedCategory:a,isolatedCategories:s,focusedGroupIndex:l,focusedItemIndex:c,onFocusedIndexChange:u,legendInteraction:d,metrics:h})=>{let f=0;const p=[];e.forEach((e,t)=>{let n=0;e.label&&(n+=16);const m=Sp(e,i,o,a,s,l,c,t,u,d,h,h.maxWidth??r);n+=m.offset+5,p.push({label:e.label,...m,offset:n,totalRows:m.totalRows,totalHeight:m.totalHeight}),f+=n+12});const m=h.maxWidth??r;let g=f>m?0:"center"===h.align?Math.max(0,(m-f)/2):"end"===h.align?Math.max(0,m-f):0;const y=[];return p.forEach((t,r)=>{const i=e[r];if(i.label&&(y.push(
161
+ /* @__PURE__ */(0,jp.jsx)("g",{className:"legend-item",transform:`translate(0,${p.itemsY})`,children:Ap(e,n,r,i,o,a,s,f,l,c,u)},`legend-group-${f}`))}),d},Lp=({legendGroups:e,title:t,height:n,width:r,customClickBehavior:i,customHoverBehavior:o,highlightedCategory:a,isolatedCategories:s,focusedGroupIndex:l,focusedItemIndex:c,onFocusedIndexChange:u,legendInteraction:d,metrics:h})=>{let f=0;const p=[];e.forEach((e,t)=>{let n=0;e.label&&(n+=16);const m=Cp(e,i,o,a,s,l,c,t,u,d,h,h.maxWidth??r);n+=m.offset+5,p.push({label:e.label,...m,offset:n,totalRows:m.totalRows,totalHeight:m.totalHeight}),f+=n+12});const m=h.maxWidth??r;let g=f>m?0:"center"===h.align?Math.max(0,(m-f)/2):"end"===h.align?Math.max(0,m-f):0;const y=[];return p.forEach((t,r)=>{const i=e[r];if(i.label&&(y.push(
162
162
  /* @__PURE__ */
163
- /* @__PURE__ */(0,wp.jsx)("text",{transform:`translate(${g},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",fontSize:12,style:bp,fill:"var(--semiotic-text, #333)",children:i.label},`legend-text-${r}`)),g+=16),y.push(
163
+ /* @__PURE__ */(0,jp.jsx)("text",{transform:`translate(${g},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",fontSize:12,style:kp,fill:"var(--semiotic-text, #333)",children:i.label},`legend-text-${r}`)),g+=16),y.push(
164
164
  /* @__PURE__ */
165
- /* @__PURE__ */(0,wp.jsx)("g",{className:"legend-item",transform:`translate(${g},0)`,children:t.items},`legend-group-${r}`)),g+=t.offset+5,e[r+1]){const e=t.totalHeight||n;y.push(
165
+ /* @__PURE__ */(0,jp.jsx)("g",{className:"legend-item",transform:`translate(${g},0)`,children:t.items},`legend-group-${r}`)),g+=t.offset+5,e[r+1]){const e=t.totalHeight||n;y.push(
166
166
  /* @__PURE__ */
167
- /* @__PURE__ */(0,wp.jsx)("line",{stroke:"gray",x1:g,y1:-8,x2:g,y2:e+0+8},`legend-top-line legend-symbol-${r}`))}g+=12}),/* @__PURE__ */ /* @__PURE__ */(0,wp.jsx)("g",{children:y})},Ap=require("react/jsx-runtime"),Cp=require("react/jsx-runtime"),Rp=require("react/jsx-runtime"),Lp=Gc(require("react")),Pp=(Gc(require("react")),require("react/jsx-runtime")),Np=Gc(require("react")),Ep=require("react/jsx-runtime"),Ip=require("react/jsx-runtime"),Tp="undefined"==typeof window||"undefined"==typeof document,zp=require("react"),$p="undefined"!=typeof window?zp.useLayoutEffect:zp.useEffect,Dp=()=>()=>{},_p=()=>!1,Fp=()=>!0,Op=require("react"),Bp=require("react/jsx-runtime"),Wp="undefined"==typeof window?Op.useEffect:Op.useLayoutEffect,Hp=require("react"),qp=Gc(require("react")),Gp=Gc(require("react")),Vp={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},Yp={position:"absolute",top:4,left:4,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",width:"auto",height:"auto",maxWidth:"calc(100% - 8px)",overflow:"visible",whiteSpace:"normal",padding:"4px 8px",fontSize:12,background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:4};Vc();var Up=require("react/jsx-runtime");Yc();var Xp=require("react/jsx-runtime"),Zp=Gc(require("react")),Kp=Gc(require("react")),Qp=(/* @__PURE__ */require("react/jsx-runtime"),Kp.createContext(null)),Jp="undefined"==typeof window?Zp.useEffect:Zp.useLayoutEffect;Vc();var em,tm=require("react/jsx-runtime"),nm=/* @__PURE__ */qp.lazy(()=>Promise.resolve().then(()=>(eu(),Uc))),rm=/* @__PURE__ */qp.lazy(()=>Promise.resolve().then(()=>(au(),iu))),im=require("react"),om=require("react/jsx-runtime"),am="var(--semiotic-focus, #005fcc)",sm=Gc(require("react")),lm=Gc(require("react")),cm=require("react/jsx-runtime"),um={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"},dm=/* @__PURE__ */aa(function({chrome:e="default",className:t="",style:n,children:r,...i}){const o="default"===e?{...um,...n}:n;/* @__PURE__ */ /* @__PURE__ */
168
- return(0,cm.jsx)("div",{...i,"data-semiotic-tooltip-chrome":!0,className:`semiotic-tooltip ${t}`.trim(),style:o,children:r})}),hm=require("react/jsx-runtime"),fm=require("d3-zoom"),pm=require("d3-selection"),mm=require("d3-shape"),gm=require("d3-shape"),ym=(e,t,n,r)=>{const i=t.filter(e=>"line"===e.type);for(const t of i){if(t.path.length<2)continue;const n=t._introClipFraction;void 0!==n&&n<1&&(e.save(),e.beginPath(),e.rect(0,0,r.width*n,r.height),e.clip());const i=t.style.stroke||"#007bff",o=Hn(e,i)||i,a=t.style.strokeWidth??2,s=t.colorThresholds,l=t.rawValues;if(t.style.strokeDasharray?e.setLineDash(t.style.strokeDasharray.split(/[\s,]+/).map(Number)):e.setLineDash([]),null!=t.style.opacity&&(e.globalAlpha=t.style.opacity),a>0&&(e.lineWidth=a),e.lineCap=t.style.strokeLinecap||"butt",t.style._edgeFade&&a>0){const n=t.style.opacity??1;ka(e,t.path,o,a,n,t.style.strokeLinecap||"butt"),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt";continue}const c=da(t.curve),u=s&&s.length>0&&l&&l.length===t.path.length,d=t._decayOpacities;if(a>0&&d&&d.length===t.path.length&&!u){e.strokeStyle=o;const n=t.style.opacity??1;for(let r=0;r<t.path.length-1;r++){const i=.5*(d[r]+d[r+1])*n;e.globalAlpha=i,e.beginPath(),e.moveTo(t.path[r][0],t.path[r][1]),e.lineTo(t.path[r+1][0],t.path[r+1][1]),e.stroke()}}else if(a>0&&!u){e.beginPath();const n=t.strokeGradient&&t.path.length>=2?pa(e,t.strokeGradient,o,t.path[0][0],0,t.path[t.path.length-1][0],0):null;if(e.strokeStyle=n||o,c)(0,gm.line)().x(e=>e[0]).y(e=>e[1]).curve(c).context(e)(t.path);else{const[n,r]=t.path[0];e.moveTo(n,r);for(let n=1;n<t.path.length;n++)e.lineTo(t.path[n][0],t.path[n][1])}e.stroke()}else if(a>0){const n=wa(t.path,l,s,o);for(const t of n){e.beginPath(),e.strokeStyle=Hn(e,t.color)||t.color,e.moveTo(t.path[0][0],t.path[0][1]);for(let n=1;n<t.path.length;n++)e.lineTo(t.path[n][0],t.path[n][1]);e.stroke()}}if(t.style.fill&&t.style.fillOpacity&&t.style.fillOpacity>0){if(e.beginPath(),e.globalAlpha=t.style.fillOpacity,e.fillStyle=ha(e,t.style.fill,t.style.fill),c&&!u)(0,gm.line)().x(e=>e[0]).y(e=>e[1]).curve(c).context(e)(t.path);else{const[n,r]=t.path[0];e.moveTo(n,r);for(let n=1;n<t.path.length;n++)e.lineTo(t.path[n][0],t.path[n][1])}const n=t.path[t.path.length-1][0],i=t.path[0][0];e.lineTo(n,r.height),e.lineTo(i,r.height),e.closePath(),e.fill()}void 0!==n&&n<1&&e.restore(),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt"}},bm=(e,t,n,r)=>{const i=t.filter(e=>"point"===e.type);if(0!==i.length){e.save();try{const t=e.globalAlpha;let n=[],r="";const o=n=>{e.beginPath(),e.arc(n.x,n.y,n.r,0,2*Math.PI);const r=n.style.opacity??n.style.fillOpacity??1;e.globalAlpha=t*r,e.fillStyle=ha(e,n.style.fill,"#4e79a7"),e.fill();const i=n.style.strokeWidth??1;n.style.stroke&&"none"!==n.style.stroke&&i>0&&(e.strokeStyle=ha(e,n.style.stroke,n.style.stroke),e.lineWidth=i,e.stroke()),ya(e,n)},a=()=>{if(0===n.length)return;if(1===n.length)return o(n[0]),n=[],void(r="");const i=n[0],a=i.style.opacity??i.style.fillOpacity??1;e.globalAlpha=t*a,e.beginPath();for(const t of n)e.moveTo(t.x+t.r,t.y),e.arc(t.x,t.y,t.r,0,2*Math.PI);e.fillStyle=ha(e,i.style.fill,"#4e79a7"),e.fill();const s=i.style.strokeWidth??1;i.style.stroke&&"none"!==i.style.stroke&&s>0&&(e.strokeStyle=ha(e,i.style.stroke,i.style.stroke),e.lineWidth=s,e.stroke()),n=[],r=""};for(const e of i){const t=e.style.opacity??e.style.fillOpacity??1,i=e.style.fill;if(ga(e)||null!=i&&"string"!=typeof i||t<1){a(),o(e);continue}const s=e.style.strokeWidth??1,l=`${i??"#4e79a7"}\0${e.style.stroke&&"none"!==e.style.stroke&&s>0?String(e.style.stroke):""}\0${s}\0${e.r}\0${t}`;n.length>0&&l!==r&&a(),r=l,n.push(e),n.length>=2048&&a()}a()}finally{e.restore()}}},vm=(e,t)=>{const n=e.globalAlpha;for(const r of t){if("glyph"!==r.type)continue;const t=r;Sa(e,t,t.x,t.y,n)}e.globalAlpha=n},xm=/* @__PURE__ */new WeakMap,wm=1,km=class{constructor(e=256){this.cache=/* @__PURE__ */new Map,this.limit=Ra(e)}setLimit(e){this.limit=Ra(e),this.cache.size>this.limit&&this.evict()}get(e){const t=this.cache.get(e);return t&&(t.lastUsed=performance.now()),t}set(e,t){this.cache.set(e,t),this.cache.size>this.limit&&this.evict()}evict(){for(;this.cache.size>this.limit;){let e,t=1/0;for(const[n,r]of this.cache)r.lastUsed<t&&(t=r.lastUsed,e=n);if(!e)break;{const t=this.cache.get(e);t&&(t.img.onload=null,t.img.onerror=null,t.img.src=""),this.cache.delete(e)}}}clear(){for(const e of this.cache.values())e.img.onload=null,e.img.onerror=null,e.img.src="";this.cache.clear()}},Sm=class{constructor(e){this.capacity=e,this.particles=new Array(e);for(let t=0;t<e;t++)this.particles[t]={t:0,offset:0,lineIndex:0,active:!1,x:0,y:0}}spawn(e,t=Math.random){for(let n=0;n<this.capacity;n++){const r=this.particles[n];if(!r.active)return r.active=!0,r.t=0,r.offset=.6*(t()-.5),r.lineIndex=e,r.x=0,r.y=0,r}return null}step(e,t,n,r){for(let i=0;i<this.capacity;i++){const o=this.particles[i];if(!o.active)continue;const a=n[o.lineIndex];if(!a||a.length<2){o.active=!1;continue}if(o.t+=e*t,o.t>=1){o.active=!1;continue}const s=Pa(a),l=Na(a,o.t*s),c=(r[o.lineIndex]||2)/2;o.x=l.x+l.nx*o.offset*c*2,o.y=l.y+l.ny*o.offset*c*2}}countForLine(e){let t=0;for(let n=0;n<this.capacity;n++)this.particles[n].active&&this.particles[n].lineIndex===e&&t++;return t}clear(){for(let e=0;e<this.capacity;e++)this.particles[e].active=!1}},Mm=Gc(require("react")),jm=Gc(require("react")),Am=require("react/jsx-runtime"),Cm=/* @__PURE__ */new Set,Rm="__semioticSelectionData",Lm=["name","label","title"],Pm=["type","kind","category","group","class","status","role","shape"],Nm=["value","amount","total","count","weight","score"],Em=/* @__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"]),Im=require("react/jsx-runtime"),Tm=!1,zm=(require("react/jsx-runtime"),require("react/jsx-runtime")),$m=/* @__PURE__ */aa(function({data:e}){if(!e)return null;if(e.properties){const t=e.properties.name||e.properties.NAME||e.properties.id||"Feature";/* @__PURE__ */ /* @__PURE__ */
169
- return(0,zm.jsx)("div",{className:"semiotic-tooltip",style:um,children:/* @__PURE__ */ /* @__PURE__ */(0,zm.jsx)("div",{style:{fontWeight:600},children:t})})}const t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;const n=Qa(t),r=null!=n.title?String(n.title):null;return null==r&&0===n.entries.length?null:/* @__PURE__ */ /* @__PURE__ */(0,zm.jsxs)("div",{className:"semiotic-tooltip",style:um,children:[null!=r&&/* @__PURE__ */ /* @__PURE__ */(0,zm.jsx)("div",{style:{fontWeight:600,marginBottom:n.entries.length?2:0},children:r}),n.entries.map(e=>{/* @__PURE__ */ /* @__PURE__ */return(0,zm.jsxs)("div",{children:[
167
+ /* @__PURE__ */(0,jp.jsx)("line",{stroke:"gray",x1:g,y1:-8,x2:g,y2:e+0+8},`legend-top-line legend-symbol-${r}`))}g+=12}),/* @__PURE__ */ /* @__PURE__ */(0,jp.jsx)("g",{children:y})},Pp=require("react/jsx-runtime"),Np=require("react/jsx-runtime"),Ep=require("react/jsx-runtime"),Ip=Xc(require("react")),Tp=(Xc(require("react")),require("react/jsx-runtime")),zp=Xc(require("react")),$p=require("react/jsx-runtime"),Dp=require("react/jsx-runtime"),_p="undefined"==typeof window||"undefined"==typeof document,Fp=require("react"),Op="undefined"!=typeof window?Fp.useLayoutEffect:Fp.useEffect,Bp=()=>()=>{},Wp=()=>!1,Hp=()=>!0,qp=require("react"),Gp=require("react/jsx-runtime"),Vp="undefined"==typeof window?qp.useEffect:qp.useLayoutEffect,Yp=require("react"),Up=Xc(require("react")),Xp=Xc(require("react")),Zp={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},Kp={position:"absolute",top:4,left:4,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",width:"auto",height:"auto",maxWidth:"calc(100% - 8px)",overflow:"visible",whiteSpace:"normal",padding:"4px 8px",fontSize:12,background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:4};Zc();var Qp=require("react/jsx-runtime");Kc();var Jp=require("react/jsx-runtime"),em=Xc(require("react")),tm=Xc(require("react")),nm=(/* @__PURE__ */require("react/jsx-runtime"),tm.createContext(null)),rm="undefined"==typeof window?em.useEffect:em.useLayoutEffect;Zc();var im,om=require("react/jsx-runtime"),am=/* @__PURE__ */Up.lazy(()=>Promise.resolve().then(()=>(iu(),Qc))),sm=/* @__PURE__ */Up.lazy(()=>Promise.resolve().then(()=>(uu(),lu))),lm=require("react"),cm=require("react/jsx-runtime"),um="var(--semiotic-focus, #005fcc)",dm=Xc(require("react")),hm=Xc(require("react")),fm=require("react/jsx-runtime"),pm={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"},mm=/* @__PURE__ */Symbol.for("semiotic.tooltipChromeContext"),gm=/* @__PURE__ */la(function({chrome:e,className:t="",style:n,children:r,...i}){const o=sa(),a="default"===(e??o??"default")?{...pm,...n}:n;/* @__PURE__ */ /* @__PURE__ */
168
+ return(0,fm.jsx)("div",{...i,"data-semiotic-tooltip-chrome":!0,className:`semiotic-tooltip ${t}`.trim(),style:a,children:r})}),ym=require("react/jsx-runtime"),vm=require("d3-zoom"),bm=require("d3-selection"),xm=require("d3-shape"),wm=require("d3-shape"),km=(e,t,n,r)=>{const i=t.filter(e=>"line"===e.type);for(const t of i){if(t.path.length<2)continue;const n=t._introClipFraction;void 0!==n&&n<1&&(e.save(),e.beginPath(),e.rect(0,0,r.width*n,r.height),e.clip());const i=t.style.stroke||"#007bff",o=Hn(e,i)||i,a=t.style.strokeWidth??2,s=t.colorThresholds,l=t.rawValues;if(t.style.strokeDasharray?e.setLineDash(t.style.strokeDasharray.split(/[\s,]+/).map(Number)):e.setLineDash([]),null!=t.style.opacity&&(e.globalAlpha=t.style.opacity),a>0&&(e.lineWidth=a),e.lineCap=t.style.strokeLinecap||"butt",t.style._edgeFade&&a>0){const n=t.style.opacity??1;Ma(e,t.path,o,a,n,t.style.strokeLinecap||"butt"),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt";continue}const c=fa(t.curve),u=s&&s.length>0&&l&&l.length===t.path.length,d=t._decayOpacities;if(a>0&&d&&d.length===t.path.length&&!u){e.strokeStyle=o;const n=t.style.opacity??1;for(let r=0;r<t.path.length-1;r++){const i=.5*(d[r]+d[r+1])*n;e.globalAlpha=i,e.beginPath(),e.moveTo(t.path[r][0],t.path[r][1]),e.lineTo(t.path[r+1][0],t.path[r+1][1]),e.stroke()}}else if(a>0&&!u){e.beginPath();const n=t.strokeGradient&&t.path.length>=2?ga(e,t.strokeGradient,o,t.path[0][0],0,t.path[t.path.length-1][0],0):null;if(e.strokeStyle=n||o,c)(0,wm.line)().x(e=>e[0]).y(e=>e[1]).curve(c).context(e)(t.path);else{const[n,r]=t.path[0];e.moveTo(n,r);for(let n=1;n<t.path.length;n++)e.lineTo(t.path[n][0],t.path[n][1])}e.stroke()}else if(a>0){const n=Sa(t.path,l,s,o);for(const t of n){e.beginPath(),e.strokeStyle=Hn(e,t.color)||t.color,e.moveTo(t.path[0][0],t.path[0][1]);for(let n=1;n<t.path.length;n++)e.lineTo(t.path[n][0],t.path[n][1]);e.stroke()}}if(t.style.fill&&t.style.fillOpacity&&t.style.fillOpacity>0){if(e.beginPath(),e.globalAlpha=t.style.fillOpacity,e.fillStyle=pa(e,t.style.fill,t.style.fill),c&&!u)(0,wm.line)().x(e=>e[0]).y(e=>e[1]).curve(c).context(e)(t.path);else{const[n,r]=t.path[0];e.moveTo(n,r);for(let n=1;n<t.path.length;n++)e.lineTo(t.path[n][0],t.path[n][1])}const n=t.path[t.path.length-1][0],i=t.path[0][0];e.lineTo(n,r.height),e.lineTo(i,r.height),e.closePath(),e.fill()}void 0!==n&&n<1&&e.restore(),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt"}},Sm=(e,t,n,r)=>{const i=t.filter(e=>"point"===e.type);if(0!==i.length){e.save();try{const t=e.globalAlpha;let n=[],r="";const o=n=>{e.beginPath(),e.arc(n.x,n.y,n.r,0,2*Math.PI);const r=n.style.opacity??n.style.fillOpacity??1;e.globalAlpha=t*r,e.fillStyle=pa(e,n.style.fill,"#4e79a7"),e.fill();const i=n.style.strokeWidth??1;n.style.stroke&&"none"!==n.style.stroke&&i>0&&(e.strokeStyle=pa(e,n.style.stroke,n.style.stroke),e.lineWidth=i,e.stroke()),ba(e,n)},a=()=>{if(0===n.length)return;if(1===n.length)return o(n[0]),n=[],void(r="");const i=n[0],a=i.style.opacity??i.style.fillOpacity??1;e.globalAlpha=t*a,e.beginPath();for(const t of n)e.moveTo(t.x+t.r,t.y),e.arc(t.x,t.y,t.r,0,2*Math.PI);e.fillStyle=pa(e,i.style.fill,"#4e79a7"),e.fill();const s=i.style.strokeWidth??1;i.style.stroke&&"none"!==i.style.stroke&&s>0&&(e.strokeStyle=pa(e,i.style.stroke,i.style.stroke),e.lineWidth=s,e.stroke()),n=[],r=""};for(const e of i){const t=e.style.opacity??e.style.fillOpacity??1,i=e.style.fill;if(va(e)||null!=i&&"string"!=typeof i||t<1){a(),o(e);continue}const s=e.style.strokeWidth??1,l=`${i??"#4e79a7"}\0${e.style.stroke&&"none"!==e.style.stroke&&s>0?String(e.style.stroke):""}\0${s}\0${e.r}\0${t}`;n.length>0&&l!==r&&a(),r=l,n.push(e),n.length>=2048&&a()}a()}finally{e.restore()}}},Mm=(e,t)=>{const n=e.globalAlpha;for(const r of t){if("glyph"!==r.type)continue;const t=r;ja(e,t,t.x,t.y,n)}e.globalAlpha=n},jm=/* @__PURE__ */new WeakMap,Am=1,Cm=class{constructor(e=256){this.cache=/* @__PURE__ */new Map,this.limit=Pa(e)}setLimit(e){this.limit=Pa(e),this.cache.size>this.limit&&this.evict()}get(e){const t=this.cache.get(e);return t&&(t.lastUsed=performance.now()),t}set(e,t){this.cache.set(e,t),this.cache.size>this.limit&&this.evict()}evict(){for(;this.cache.size>this.limit;){let e,t=1/0;for(const[n,r]of this.cache)r.lastUsed<t&&(t=r.lastUsed,e=n);if(!e)break;{const t=this.cache.get(e);t&&(t.img.onload=null,t.img.onerror=null,t.img.src=""),this.cache.delete(e)}}}clear(){for(const e of this.cache.values())e.img.onload=null,e.img.onerror=null,e.img.src="";this.cache.clear()}},Rm=class{constructor(e){this.capacity=e,this.particles=new Array(e);for(let t=0;t<e;t++)this.particles[t]={t:0,offset:0,lineIndex:0,active:!1,x:0,y:0}}spawn(e,t=Math.random){for(let n=0;n<this.capacity;n++){const r=this.particles[n];if(!r.active)return r.active=!0,r.t=0,r.offset=.6*(t()-.5),r.lineIndex=e,r.x=0,r.y=0,r}return null}step(e,t,n,r){for(let i=0;i<this.capacity;i++){const o=this.particles[i];if(!o.active)continue;const a=n[o.lineIndex];if(!a||a.length<2){o.active=!1;continue}if(o.t+=e*t,o.t>=1){o.active=!1;continue}const s=Ea(a),l=Ia(a,o.t*s),c=(r[o.lineIndex]||2)/2;o.x=l.x+l.nx*o.offset*c*2,o.y=l.y+l.ny*o.offset*c*2}}countForLine(e){let t=0;for(let n=0;n<this.capacity;n++)this.particles[n].active&&this.particles[n].lineIndex===e&&t++;return t}clear(){for(let e=0;e<this.capacity;e++)this.particles[e].active=!1}},Lm=Xc(require("react")),Pm=Xc(require("react")),Nm=require("react/jsx-runtime"),Em=/* @__PURE__ */new Set,Im="__semioticSelectionData",Tm=["name","label","title"],zm=["type","kind","category","group","class","status","role","shape"],$m=["value","amount","total","count","weight","score"],Dm=/* @__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"]),_m=require("react/jsx-runtime"),Fm=!1,Om=(require("react/jsx-runtime"),require("react/jsx-runtime")),Bm=/* @__PURE__ */la(function({data:e}){if(!e)return null;if(e.properties){const t=e.properties.name||e.properties.NAME||e.properties.id||"Feature";/* @__PURE__ */ /* @__PURE__ */
169
+ return(0,Om.jsx)("div",{className:"semiotic-tooltip",style:pm,children:/* @__PURE__ */ /* @__PURE__ */(0,Om.jsx)("div",{style:{fontWeight:600},children:t})})}const t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;const n=es(t),r=null!=n.title?String(n.title):null;return null==r&&0===n.entries.length?null:/* @__PURE__ */ /* @__PURE__ */(0,Om.jsxs)("div",{className:"semiotic-tooltip",style:pm,children:[null!=r&&/* @__PURE__ */ /* @__PURE__ */(0,Om.jsx)("div",{style:{fontWeight:600,marginBottom:n.entries.length?2:0},children:r}),n.entries.map(e=>{/* @__PURE__ */ /* @__PURE__ */return(0,Om.jsxs)("div",{children:[
170
170
  /* @__PURE__ */
171
- /* @__PURE__ */(0,zm.jsxs)("span",{style:{opacity:.7},children:[e.key,": "]}),
171
+ /* @__PURE__ */(0,Om.jsxs)("span",{style:{opacity:.7},children:[e.key,": "]}),
172
172
  /* @__PURE__ */
173
- /* @__PURE__ */(0,zm.jsx)("span",{style:{fontWeight:600},children:(t=e.value,null==t?"–":"number"==typeof t?qa(t):t instanceof Date?Za(t):String(t))})]},e.key);var t})]})}),Dm={top:10,right:10,bottom:10,left:10},_m=null,Fm={width:28,height:28,border:"1px solid rgba(0,0,0,0.2)",borderRadius:4,background:"rgba(255,255,255,0.9)",color:"#333",fontSize:16,fontWeight:600,lineHeight:1,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},Om=require("react"),Bm=require("react"),Wm=Gc(require("react")),Hm=require("react"),qm=require("react/jsx-runtime"),Gm=/* @__PURE__ */As(/* @__PURE__ */ /* @__PURE__ */(0,Mu.memo)(
173
+ /* @__PURE__ */(0,Om.jsx)("span",{style:{fontWeight:600},children:(t=e.value,null==t?"–":"number"==typeof t?Va(t):t instanceof Date?Qa(t):String(t))})]},e.key);var t})]})}),Wm={top:10,right:10,bottom:10,left:10},Hm=null,qm={width:28,height:28,border:"1px solid rgba(0,0,0,0.2)",borderRadius:4,background:"rgba(255,255,255,0.9)",color:"#333",fontSize:16,fontWeight:600,lineHeight:1,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},Gm=require("react"),Vm=require("react"),Ym=Xc(require("react")),Um=require("react"),Xm=require("react/jsx-runtime"),Zm=/* @__PURE__ */Ls(/* @__PURE__ */ /* @__PURE__ */(0,Ru.memo)(
174
174
  /* @__PURE__ */
175
- /* @__PURE__ */(0,Mu.forwardRef)(function(e,t){const{projection:n,projectionExtent:r,fitPadding:i,projectionTransform:o,areas:a,points:s,lines:l,customLayout:c,layoutConfig:u,layoutSelection:d,onLayoutError:h,xAccessor:f,yAccessor:p,lineDataAccessor:m,pointIdAccessor:g,lineIdAccessor:y,lineType:b="geo",flowStyle:v="basic",graticule:x,zoomable:w,zoomExtent:k,onZoom:S,dragRotate:M,showParticles:j,particleStyle:A,tileURL:C,tileAttribution:R,tileCacheSize:L,size:P,width:N,height:E,responsiveWidth:I,responsiveHeight:T,margin:z,className:$,background:D,maxDevicePixelRatio:_,runtimeMode:F,windowSize:O=500,renderMode:B,areaStyle:W,pointStyle:H,lineStyle:q,colorScheme:G,enableHover:V=!0,hoverAnnotation:Y,tooltipContent:U,allowTooltipOverflow:X=!1,customClickBehavior:Z,customHoverBehavior:K,onObservation:Q,annotationObservationCallback:J,chartId:ee,annotations:te,onAnnotationActivate:ne,autoPlaceAnnotations:re,svgAnnotationRules:ie,decay:oe,pulse:ae,transition:se,animate:le,staleness:ce,frameScheduler:ue,clock:de,random:he,seed:fe,paused:pe=!1,suspendWhenHidden:me=!0,backgroundGraphics:ge,foregroundGraphics:ye,title:be,legend:ve,legendPosition:xe,legendLayout:we,legendHoverBehavior:ke,legendClickBehavior:Se,legendHighlightedCategory:Me,legendIsolatedCategories:je,legendCategoryAccessor:Ae,onCategoriesChange:Ce,showAxes:Re,accessibleTable:Le=!0,description:Pe,summary:Ne}=e,{customHoverBehavior:Ee,customClickBehavior:Ie,hasClickBehavior:Te}=fs({customHoverBehavior:K,customClickBehavior:Z,onObservation:Q,chartId:ee,chartType:"StreamGeoFrame"}),ze=P||[N||600,E||400],$e=(0,Mu.useRef)(!0),De=fr({sizeProp:ze,responsiveWidth:I,responsiveHeight:T,userMargin:z,marginDefault:Dm,title:be,legend:ve,legendPosition:xe,legendLayout:we,legendMarginReserved:e.__legendMarginReservedFor===ve,animate:le,transitionProp:se,frameScheduler:ue,clock:de,random:he,seed:fe,paused:pe,suspendWhenHidden:me,themeDirtyRef:$e}),{reducedMotionRef:_e,responsiveRef:Fe,size:Oe,margin:Be,adjustedWidth:We,adjustedHeight:He,transition:qe,introEnabled:Ge,tableId:Ve,frameRuntime:Ye,rafRef:Ue,renderFnRef:Xe,scheduleRender:Ze,currentTheme:Ke}=De,Qe=Ro(),Je=Lo(),et=(0,Mu.useMemo)(()=>Array.isArray(a)?yn(a):a,[a]),tt=(0,Mu.useMemo)(()=>yn(s),[s]),nt=(0,Mu.useMemo)(()=>yn(l),[l]),rt=M??"orthographic"===ss(n),it=Wo((0,Mu.useMemo)(()=>({projection:n,projectionExtent:r,fitPadding:i,xAccessor:f,yAccessor:p,lineDataAccessor:m,lineType:b,flowStyle:v,areaStyle:W,pointStyle:H,lineStyle:q,colorScheme:G,themeSemantic:gr(Ke),themeSequential:Ke?.colors?.sequential,themeDiverging:Ke?.colors?.diverging,themeCategorical:Ke?.colors?.categorical,graticule:x,projectionTransform:o,windowSize:O,clock:Ye.now,decay:oe,pulse:ae,transition:qe,introAnimation:Ge,annotations:te,pointIdAccessor:g,lineIdAccessor:y,customLayout:c,layoutConfig:u,onLayoutError:h,layoutMargin:Be}),[n,r,i,f,p,m,b,v,W,H,q,G,Ke,x,o,O,Ye.now,oe,ae,qe,Ge,te,g,y,c,u,h,Be])),ot=(0,Mu.useRef)(null);ot.current||(ot.current=new Jh(it));const at=ot.current,st=(0,Mu.useRef)(null),lt=st.current??(st.current=ws(at.scales)),ct=Tp||!Qe&&Je;ct&&(et||s||l)&&(et&&at.setAreas(et),s&&at.setPoints(tt),l&&at.setLines(nt),at.computeScene({width:We,height:He}),at.cancelIntroAnimation());const{resolvedForeground:ut,resolvedBackground:dt,themeBackground:ht,surfaceBackground:ft}=Ss({foregroundGraphics:ye,backgroundGraphics:ge,size:Oe,margin:Be,scales:at.scales,background:D,themeBackgroundColor:Ke.colors.background,tracker:lt,readScales:()=>at.scales}),pt=(0,Mu.useRef)(null),mt=(0,Mu.useRef)(null),gt=(0,Mu.useRef)(null);C&&!gt.current&&(gt.current=new km(L??256)),gt.current?.setLimit(L??256);const yt=(0,Mu.useRef)(te),bt=(0,Mu.useRef)(null),vt=(0,Mu.useRef)(fm.zoomIdentity),xt=(0,Mu.useRef)(!1),wt=(0,Mu.useRef)(null),kt=(0,Mu.useCallback)(e=>{wt.current=e,Fe&&"object"==typeof Fe&&(Fe.current=e)},[Fe]),St=(0,Mu.useRef)(null),Mt=(0,Mu.useRef)(null),jt=(0,Mu.useRef)(null),At=(0,Mu.useRef)(0);if(j&&!jt.current){const e=A?.maxPerLine??as();jt.current=new Sm(50*e)}const Ct=(0,Mu.useRef)(null),Rt=(0,Mu.useRef)(!1),Lt=(0,Mu.useRef)(null),Pt=(0,Mu.useRef)(!1),Nt=(0,Mu.useRef)(!1),Et=(0,of.useRef)(new cf("StreamGeoFrame")),It=(0,Mu.useRef)(void 0),[Tt,zt]=(0,Mu.useState)(null),[,$t]=(0,Mu.useState)(0),Dt=(0,Mu.useRef)(0),[_t,Ft]=(0,Mu.useState)(!1),Ot=ra(ot,Ae,Ce,e=>e.getPoints());pr(ot,it,$e,Ze),mr(ot,d,$e,Ze),(0,Mu.useEffect)(()=>{const e=ot.current;e&&(et&&e.setAreas(et),s&&e.setPoints(tt),l&&e.setLines(nt),$e.current=!0,Ze())},[et,s,tt,l,nt,Ze]),bn(t,{storeRef:ot,dirtyRef:$e,scheduleRender:Ze,zoomTransformRef:vt,containerRef:wt,zoomBehaviorRef:bt});const{hoverHandlerRef:Bt,onPointerMove:Wt,onPointerLeave:Ht,pointerStateRef:qt}=De,{canvasRef:Gt,interactionCanvasRef:Vt,resolutionDirtyRef:Yt}=Do(De,{hydrated:Qe,wasHydratingFromSSR:Je,storeRef:ot,dirtyRef:$e,cleanup:()=>gt.current?.clear(),maxDevicePixelRatio:_,canvasPaintDependencies:[We,He,D,ge,B,C,L,Ze]});(0,Mu.useEffect)(()=>{Bt.current=e=>{const t=Gt.current;if(!t)return;const n=ot.current;if(!n||!n.scene.length)return void So(t);const r=cs({pointer:e,canvasRect:t.getBoundingClientRect(),margin:Be,width:We,height:He,scene:n.scene,pointQuadtree:n.quadtree,maxPointRadius:n.maxPointRadius,hitCanvasRef:mt});So(t,"hit"===r.kind?wo(r.node):void 0),V&&!1!==Y&&("hit"===r.kind?(Ct.current=r.hover,Lt.current=r.node,zt(r.hover),Ee?.(r.hover),Ze()):("outside"===r.kind||"miss"===r.kind&&Ct.current)&&(Ct.current=null,Lt.current=null,zt(null),Ee?.(null),Ze()))}},[V,Y,We,He,Be,Ee,Ze,Bt,Gt]),De.hoverLeaveRef.current=()=>{So(Gt.current),V&&!1!==Y&&(Ct.current=null,Lt.current=null,zt(null),Ee?.(null),Ze())},Mo(Gt);const Ut=(0,Mu.useCallback)(e=>{if((t=e.target)instanceof Element&&null!=t.closest("[data-semiotic-annotation-widget]"))return;var t;if(!Ie)return;const n=ot.current;if(!n||!n.scene.length)return void Ie(null);const r=e.currentTarget.getBoundingClientRect(),i=e.clientX-r.left-Be.left,o=e.clientY-r.top-Be.top;if(i<0||i>We||o<0||o>He)return void Ie(null);mt.current||("undefined"!=typeof OffscreenCanvas?mt.current=new OffscreenCanvas(1,1):mt.current=document.createElement("canvas"));const a=ls(mt.current);if(!a)return void Ie(null);const s=Ea(30,It.current),l=Ea(6,It.current),c=In(n.scene,i,o,s,a,n.quadtree,n.maxPointRadius,l);if(c){const e=c.node.datum,t=Array.isArray(e)?null:e?.properties?e:e?.data||e,n=t?.properties?{...t,...t.properties}:t;return void Ie({...n,data:t,properties:t?.properties,__semioticHoverData:!0,x:i,y:o,time:i,value:o},{type:"activate",inputType:(u=It.current,"touch"===u?"touch":"pointer")})}var u;Ie(null)},[He,We,Ie,Be]),{kbFocusIndexRef:Xt,focusedNavPointRef:Zt,onKeyDown:Kt,refreshKeyboardFocus:Qt}=bs({storeRef:ot,hoverRef:Ct,hoveredNodeRef:Lt,setHoverPoint:zt,customHoverBehavior:Ee,customClickBehavior:Ie,scheduleRender:Ze}),Jt=(0,Mu.useCallback)(e=>{var t,n,r,i,o;t=qt,n=e,r=V&&!1!==Y,i=Rt.current,o=Gt.current,Ms(t,n,void 0),(r||i)&&(r||"touch"!==t.current.pointerType||(So(o),0))&&(It.current=e.pointerType,Xt.current=-1,Zt.current=null,Wt(e))},[Gt,V,Y,Zt,Xt,Wt,qt]),en=(0,Mu.useCallback)(e=>{It.current=e.pointerType},[]);Xe.current=()=>{if(Ue.current=null,lt.sync(ot.current?.scales??null),!Ye.isActive)return;const e=Gt.current,t=ot.current;if(!e||!t)return;const n=Ye.now();let r=!1;const i=Mt.current;let o=!1;if(i){Mt.current=null;const e={width:We,height:He};t.applyRotation(i,e),o=!0}const a=null!=t.activeTransition,s=t.advanceTransition(_e.current?n+1e6:n),l=!_e.current&&s,c=Et.current.beforeCompute(t.getLastUpdateResult(),l);let u=!1;if($e.current&&!s){const e={width:We,height:He},n=t.hasProjection(),r=rt&&n?t.getRotation():null;t.computeScene(e);const i=vt.current,o=1!==i.k||0!==i.x||0!==i.y;rt&&r?o?(t.setRotation(r),t.applyZoomScale(i.k,e)):t.applyRotation(r,e):o&&t.applyZoomTransform(i,e),Qt(),$e.current=!1,u=!0,Ot()}lt.sync(t.scales),Et.current.afterCompute(c,u,!1);const d=To(_,Oe),h=Vt.current;h&&No(h,Oe,d);const f=j&&!_e.current&&!!jt.current,p=t.consumeStylePaintPending();(u||o||p)&&(Rt.current=ko(t.scene),Rt.current||So(e)),Rt.current&&(a||u||o||p)&&js({canvas:e,pointer:qt.current,store:t,margin:Be,width:We,height:He,hitCanvasRef:mt,geometryMoved:a||u||o});const m=kn(t,n,u,Nt),g=Yt.current,y=(b={dirtyOrRebuilt:u,transitioning:a,continuous:f,liveEncoding:m.changed,forced:o||p||g},Boolean(b.dirtyOrRebuilt||b.transitioning||b.animationTicked||b.continuous||b.liveEncoding||b.forced));var b;if(Yt.current=!1,C&&gt.current){const e=pt.current;if(e&&t.scales?.projection){const n=Io(e,Oe,Be,d);n&&(n.clearRect(-Be.left,-Be.top,Oe[0],Oe[1]),n.save(),n.beginPath(),n.rect(0,0,We,He),n.clip(),La(n,{tileURL:C,projection:t.scales.projection,width:We,height:He,tileCache:gt.current,maxDevicePixelRatio:_,onTileLoad:()=>Ze()}),n.restore())}}if(y){const i=Io(e,Oe,Be,d);if(!i)return;i.clearRect(-Be.left,-Be.top,Oe[0],Oe[1]),C||Go(i,{background:D,themeBackground:ht,hasBackgroundGraphics:Boolean(ge),x:-Be.left,y:-Be.top,width:Oe[0],height:Oe[1]}),i.save(),i.beginPath(),i.rect(0,0,We,He),i.clip();const o=t.scene,a=(t.scales,{width:We,height:He});if(Ba({context:i,nodes:o,renderMode:B,pixelRatio:d,paintBuiltIn:e=>{va(i,e),ym(i,e,0,a),bm(i,e),vm(i,e)}}),f&&jt.current){const e=jt.current,t=o.filter(e=>"line"===e.type);if(t.length>0){const o=A||{},a=.3*(o.speedMultiplier??1),s=o.maxPerLine??as(),l=o.spawnRate??(os()?.06:.15),c=o.radius??2,u=o.opacity??.7,d=n/1e3,h=At.current>0?Math.min(d-At.current,.1):.016;At.current=d;const f=t.map(e=>e.path),p=t.map(e=>e.style.strokeWidth??2);for(let n=0;n<t.length;n++)Ye.random()<l&&e.countForLine(n)<s&&e.spawn(n,Ye.random);e.step(h,a,f,p),i.globalAlpha=u;for(let n=0;n<e.particles.length;n++){const r=e.particles[n];if(!r.active)continue;const a=t[r.lineIndex],s="function"==typeof o.color?o.color(a?.datum??{}):"source"!==o.color&&o.color?o.color:a?.style.stroke||"#fff";i.beginPath(),i.arc(r.x,r.y,c,0,2*Math.PI),i.fillStyle=s,i.fill()}i.globalAlpha=1,r=!0}}i.restore()}(u||a&&!s)&&e.setAttribute("aria-label",Zo(t.scene,"Geographic chart"));const v=Lt.current,x=Boolean(v&&("geoarea"===v.type||"point"===v.type)),w=(k=x,S=Pt.current,k||S);var k,S;const M=Vt.current;if(M&&w){const e=Io(M,Oe,Be,d);if(e){if(e.clearRect(-Be.left,-Be.top,Oe[0],Oe[1]),v&&"geoarea"===v.type){const t=new Path2D(v.pathData);e.fillStyle="rgba(255, 255, 255, 0.3)",e.fill(t),e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke(t)}if(v&&"point"===v.type){const t=v,n="object"==typeof Y?Y:void 0,r=n?.pointColor||Ta(v);e.beginPath(),e.arc(t.x,t.y,t.r+3,0,2*Math.PI),r?(e.save(),e.globalAlpha=.4,e.fillStyle=r,e.fill(),e.restore()):(e.fillStyle="rgba(255, 255, 255, 0.4)",e.fill()),e.strokeStyle=r||"rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke()}}Pt.current=x}const R=te!==yt.current;R&&(yt.current=te),(u||R||a&&te&&te.length>0)&&(u||R||a&&!s||n-Dt.current>=33)&&($t(e=>e+1),Dt.current=n),(l||null!=t.activeTransition||m.pending||r)&&Ze()},br(ce,ot,$e,Ze,Ye.now,_t,Ft),(0,Mu.useEffect)(()=>{if("production"!==process.env.NODE_ENV&&C){const e=ss(n);e&&"mercator"!==e&&console.warn(`[StreamGeoFrame] tileURL is set but projection is "${e}". Raster tiles use Web Mercator and will not align with other projections.`)}},[C,n]),(0,Mu.useEffect)(()=>{const e=wt.current;if(!w||!e)return bt.current&&e&&((0,pm.select)(e).on(".zoom",null),bt.current=null),void(e&&(0,pm.select)(e).on("mousedown.rotate",null).on("touchstart.rotate",null));const[t,n]=k||[1,8],r={width:We,height:He};if(rt){let i=vt.current.k;const o=e=>{i=Math.max(t,Math.min(n,e)),vt.current=fm.zoomIdentity.scale(i);const o=ot.current;o&&(o.applyZoomScale(i,r),$e.current=!1,Ze(),o.scales?.projection&&S?.({projection:o.scales.projection,zoom:o.currentZoom}))};bt.current={scaleBy:(e,t)=>o(i*t),transform:(e,t)=>o(t?.k??1)};const a=e=>{e.preventDefault();const t=e.deltaY<0?1.1:1/1.1;o(i*t)},s=e=>{const t=e.target;t&&(t.closest("button")||t.closest(".stream-geo-zoom-controls"))||(e.preventDefault(),o(1.5*i))};e.addEventListener("wheel",a,{passive:!1}),e.addEventListener("dblclick",s);const l=.4,c=t=>{if(0!==t.button)return;const n=t.target;if(n.closest("button")||n.closest(".stream-geo-zoom-controls"))return;const r=ot.current;if(!r)return;const i=r.getRotation();St.current={x:t.clientX,y:t.clientY,rotation:[...i]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{const t=St.current;if(!t)return;const n=e.clientX-t.x,r=e.clientY-t.y,i=[t.rotation[0]+n*l,Math.max(-90,Math.min(90,t.rotation[1]-r*l)),t.rotation[2]];Mt.current=i,Ze()},d=t=>{if(!St.current)return;St.current=null,e.releasePointerCapture(t.pointerId);const n=Mt.current;if(n){Mt.current=null;const e=ot.current;e&&(e.applyRotation(n,r),Ze())}const i=ot.current;i?.scales?.projection&&S?.({projection:i.scales.projection,zoom:i.currentZoom})};return e.addEventListener("pointerdown",c),e.addEventListener("pointermove",u),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("wheel",a),e.removeEventListener("dblclick",s),e.removeEventListener("pointerdown",c),e.removeEventListener("pointermove",u),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d),bt.current=null}}const i=(0,fm.zoom)().scaleExtent([t,n]).extent([[0,0],[Oe[0],Oe[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{const t=e.transform;vt.current=t,xt.current=!0;const n=ot.current;n&&(n.applyZoomTransform(t,r),$e.current=!1,Ze())}).on("end",e=>{vt.current=e.transform,xt.current=!1;const t=ot.current;t?.scales?.projection&&S?.({projection:t.scales.projection,zoom:t.currentZoom})});return bt.current=i,(0,pm.select)(e).call(i),()=>{(0,pm.select)(e).on(".zoom",null)}},[w,k,rt,Oe,We,He,Be,S,Ze]);const tn=V&&!1!==Y,nn=tn&&Tt?U?U(Tt):/* @__PURE__ */ /* @__PURE__ */(0,qm.jsx)($m,{data:Tt}):null,rn=oa(nn)?/* @__PURE__ */ /* @__PURE__ */(0,qm.jsx)(ca,{contentOwnsChrome:la(U),x:Tt.x,y:Tt.y,containerWidth:We,containerHeight:He,margin:Be,className:"stream-frame-tooltip",zIndex:10,children:nn}):null;if(ct){const e=at.scene;/* @__PURE__ */ /* @__PURE__ */
176
- return(0,qm.jsxs)("div",{ref:kt,className:"stream-geo-frame"+($?` ${$}`:""),role:Le?"group":"img","aria-label":Pe||("string"==typeof be?be:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:I?"100%":Oe[0],height:T?"100%":Oe[1]},children:[
175
+ /* @__PURE__ */(0,Ru.forwardRef)(function(e,t){const{projection:n,projectionExtent:r,fitPadding:i,projectionTransform:o,areas:a,points:s,lines:l,customLayout:c,layoutConfig:u,layoutSelection:d,onLayoutError:h,xAccessor:f,yAccessor:p,lineDataAccessor:m,pointIdAccessor:g,lineIdAccessor:y,lineType:v="geo",flowStyle:b="basic",graticule:x,zoomable:w,zoomExtent:k,onZoom:S,dragRotate:M,showParticles:j,particleStyle:A,tileURL:C,tileAttribution:R,tileCacheSize:L,size:P,width:N,height:E,responsiveWidth:I,responsiveHeight:T,margin:z,className:$,background:D,maxDevicePixelRatio:_,runtimeMode:F,windowSize:O=500,renderMode:B,areaStyle:W,pointStyle:H,lineStyle:q,colorScheme:G,enableHover:V=!0,hoverAnnotation:Y,tooltipContent:U,allowTooltipOverflow:X=!1,customClickBehavior:Z,customHoverBehavior:K,onObservation:Q,annotationObservationCallback:J,chartId:ee,annotations:te,onAnnotationActivate:ne,autoPlaceAnnotations:re,svgAnnotationRules:ie,decay:oe,pulse:ae,transition:se,animate:le,staleness:ce,frameScheduler:ue,clock:de,random:he,seed:fe,paused:pe=!1,suspendWhenHidden:me=!0,backgroundGraphics:ge,foregroundGraphics:ye,title:ve,legend:be,legendPosition:xe,legendLayout:we,legendHoverBehavior:ke,legendClickBehavior:Se,legendHighlightedCategory:Me,legendIsolatedCategories:je,legendCategoryAccessor:Ae,onCategoriesChange:Ce,showAxes:Re,accessibleTable:Le=!0,description:Pe,summary:Ne}=e,{customHoverBehavior:Ee,customClickBehavior:Ie,hasClickBehavior:Te}=gs({customHoverBehavior:K,customClickBehavior:Z,onObservation:Q,chartId:ee,chartType:"StreamGeoFrame"}),ze=P||[N||600,E||400],$e=(0,Ru.useRef)(!0),De=fr({sizeProp:ze,responsiveWidth:I,responsiveHeight:T,userMargin:z,marginDefault:Wm,title:ve,legend:be,legendPosition:xe,legendLayout:we,legendMarginReserved:e.__legendMarginReservedFor===be,animate:le,transitionProp:se,frameScheduler:ue,clock:de,random:he,seed:fe,paused:pe,suspendWhenHidden:me,themeDirtyRef:$e}),{reducedMotionRef:_e,responsiveRef:Fe,size:Oe,margin:Be,adjustedWidth:We,adjustedHeight:He,transition:qe,introEnabled:Ge,tableId:Ve,frameRuntime:Ye,rafRef:Ue,renderFnRef:Xe,scheduleRender:Ze,currentTheme:Ke}=De,Qe=Ro(),Je=Lo(),et=(0,Ru.useMemo)(()=>Array.isArray(a)?yn(a):a,[a]),tt=(0,Ru.useMemo)(()=>yn(s),[s]),nt=(0,Ru.useMemo)(()=>yn(l),[l]),rt=M??"orthographic"===us(n),it=Wo((0,Ru.useMemo)(()=>({projection:n,projectionExtent:r,fitPadding:i,xAccessor:f,yAccessor:p,lineDataAccessor:m,lineType:v,flowStyle:b,areaStyle:W,pointStyle:H,lineStyle:q,colorScheme:G,themeSemantic:gr(Ke),themeSequential:Ke?.colors?.sequential,themeDiverging:Ke?.colors?.diverging,themeCategorical:Ke?.colors?.categorical,graticule:x,projectionTransform:o,windowSize:O,clock:Ye.now,decay:oe,pulse:ae,transition:qe,introAnimation:Ge,annotations:te,pointIdAccessor:g,lineIdAccessor:y,customLayout:c,layoutConfig:u,onLayoutError:h,layoutMargin:Be}),[n,r,i,f,p,m,v,b,W,H,q,G,Ke,x,o,O,Ye.now,oe,ae,qe,Ge,te,g,y,c,u,h,Be])),ot=(0,Ru.useRef)(null);ot.current||(ot.current=new rf(it));const at=ot.current,st=(0,Ru.useRef)(null),lt=st.current??(st.current=Ms(at.scales)),ct=_p||!Qe&&Je;ct&&(et||s||l)&&(et&&at.setAreas(et),s&&at.setPoints(tt),l&&at.setLines(nt),at.computeScene({width:We,height:He}),at.cancelIntroAnimation());const{resolvedForeground:ut,resolvedBackground:dt,themeBackground:ht,surfaceBackground:ft}=As({foregroundGraphics:ye,backgroundGraphics:ge,size:Oe,margin:Be,scales:at.scales,background:D,themeBackgroundColor:Ke.colors.background,tracker:lt,readScales:()=>at.scales}),pt=(0,Ru.useRef)(null),mt=(0,Ru.useRef)(null),gt=(0,Ru.useRef)(null);C&&!gt.current&&(gt.current=new Cm(L??256)),gt.current?.setLimit(L??256);const yt=(0,Ru.useRef)(te),vt=(0,Ru.useRef)(null),bt=(0,Ru.useRef)(vm.zoomIdentity),xt=(0,Ru.useRef)(!1),wt=(0,Ru.useRef)(null),kt=(0,Ru.useCallback)(e=>{wt.current=e,Fe&&"object"==typeof Fe&&(Fe.current=e)},[Fe]),St=(0,Ru.useRef)(null),Mt=(0,Ru.useRef)(null),jt=(0,Ru.useRef)(null),At=(0,Ru.useRef)(0);if(j&&!jt.current){const e=A?.maxPerLine??cs();jt.current=new Rm(50*e)}const Ct=(0,Ru.useRef)(null),Rt=(0,Ru.useRef)(!1),Lt=(0,Ru.useRef)(null),Pt=(0,Ru.useRef)(!1),Nt=(0,Ru.useRef)(!1),Et=(0,cf.useRef)(new ff("StreamGeoFrame")),It=(0,Ru.useRef)(void 0),[Tt,zt]=(0,Ru.useState)(null),[,$t]=(0,Ru.useState)(0),Dt=(0,Ru.useRef)(0),[_t,Ft]=(0,Ru.useState)(!1),Ot=ra(ot,Ae,Ce,e=>e.getPoints());pr(ot,it,$e,Ze),mr(ot,d,$e,Ze),(0,Ru.useEffect)(()=>{const e=ot.current;e&&(et&&e.setAreas(et),s&&e.setPoints(tt),l&&e.setLines(nt),$e.current=!0,Ze())},[et,s,tt,l,nt,Ze]),vn(t,{storeRef:ot,dirtyRef:$e,scheduleRender:Ze,zoomTransformRef:bt,containerRef:wt,zoomBehaviorRef:vt});const{hoverHandlerRef:Bt,onPointerMove:Wt,onPointerLeave:Ht,flushPointerMove:qt,pointerStateRef:Gt}=De,{canvasRef:Vt,interactionCanvasRef:Yt,resolutionDirtyRef:Ut}=Do(De,{hydrated:Qe,wasHydratingFromSSR:Je,storeRef:ot,dirtyRef:$e,cleanup:()=>gt.current?.clear(),maxDevicePixelRatio:_,canvasPaintDependencies:[We,He,D,ge,B,C,L,Ze]});(0,Ru.useEffect)(()=>{Bt.current=e=>{const t=Vt.current;if(!t)return;const n=ot.current;if(!n||!n.scene.length)return void So(t);const r=hs({pointer:e,canvasRect:t.getBoundingClientRect(),margin:Be,width:We,height:He,scene:n.scene,pointQuadtree:n.quadtree,maxPointRadius:n.maxPointRadius,hitCanvasRef:mt});So(t,"hit"===r.kind?wo(r.node):void 0),V&&!1!==Y&&("hit"===r.kind?(Ct.current=r.hover,Lt.current=r.node,zt(r.hover),Ee?.(r.hover),Ze()):("outside"===r.kind||"miss"===r.kind&&Ct.current)&&(Ct.current=null,Lt.current=null,zt(null),Ee?.(null),Ze()))}},[V,Y,We,He,Be,Ee,Ze,Bt,Vt]),De.hoverLeaveRef.current=()=>{So(Vt.current),V&&!1!==Y&&(Ct.current=null,Lt.current=null,zt(null),Ee?.(null),Ze())},Mo(Vt);const Xt=(0,Ru.useCallback)(e=>{if((t=e.target)instanceof Element&&null!=t.closest("[data-semiotic-annotation-widget]"))return;var t;if(!Ie)return;qt();const n=ot.current;if(!n||!n.scene.length)return void Ie(null);const r=e.currentTarget.getBoundingClientRect(),i=e.clientX-r.left-Be.left,o=e.clientY-r.top-Be.top;if(i<0||i>We||o<0||o>He)return void Ie(null);mt.current||("undefined"!=typeof OffscreenCanvas?mt.current=new OffscreenCanvas(1,1):mt.current=document.createElement("canvas"));const a=ds(mt.current);if(!a)return void Ie(null);const s=Ta(30,It.current),l=Ta(6,It.current),c=In(n.scene,i,o,s,a,n.quadtree,n.maxPointRadius,l);if(c){const e=c.node.datum,t=Array.isArray(e)?null:e?.properties?e:e?.data||e,n=t?.properties?{...t,...t.properties}:t;return void Ie({...n,data:t,properties:t?.properties,__semioticHoverData:!0,x:i,y:o,time:i,value:o},{type:"activate",inputType:(u=It.current,"touch"===u?"touch":"pointer")})}var u;Ie(null)},[He,We,Ie,Be,qt]),{kbFocusIndexRef:Zt,focusedNavPointRef:Kt,onKeyDown:Qt,refreshKeyboardFocus:Jt}=ws({clearPointerHover:Ht,storeRef:ot,hoverRef:Ct,hoveredNodeRef:Lt,setHoverPoint:zt,customHoverBehavior:Ee,customClickBehavior:Ie,scheduleRender:Ze}),en=(0,Ru.useCallback)(e=>{var t,n,r,i,o;t=Gt,n=e,r=V&&!1!==Y,i=Rt.current,o=Vt.current,Cs(t,n,void 0),(r||i)&&(r||"touch"!==t.current.pointerType||(So(o),0))&&(It.current=e.pointerType,Zt.current=-1,Kt.current=null,Wt(e))},[Vt,V,Y,Kt,Zt,Wt,Gt]),tn=(0,Ru.useCallback)(e=>{It.current=e.pointerType},[]);Xe.current=()=>{if(Ue.current=null,lt.sync(ot.current?.scales??null),!Ye.isActive)return;const e=Vt.current,t=ot.current;if(!e||!t)return;const n=Ye.now();let r=!1;const i=Mt.current;let o=!1;if(i){Mt.current=null;const e={width:We,height:He};t.applyRotation(i,e),o=!0}const a=null!=t.activeTransition,s=t.advanceTransition(_e.current?n+1e6:n),l=!_e.current&&s,c=Et.current.beforeCompute(t.getLastUpdateResult(),l);let u=!1;if($e.current&&!s){const e={width:We,height:He},n=t.hasProjection(),r=rt&&n?t.getRotation():null;t.computeScene(e);const i=bt.current,o=1!==i.k||0!==i.x||0!==i.y;rt&&r?o?(t.setRotation(r),t.applyZoomScale(i.k,e)):t.applyRotation(r,e):o&&t.applyZoomTransform(i,e),Jt(),$e.current=!1,u=!0,Ot()}lt.sync(t.scales),Et.current.afterCompute(c,u,!1);const d=To(_,Oe),h=Yt.current;h&&No(h,Oe,d);const f=j&&!_e.current&&!!jt.current,p=t.consumeStylePaintPending();(u||o||p)&&(Rt.current=ko(t.scene),Rt.current||So(e)),Rt.current&&(a||u||o||p)&&Rs({canvas:e,pointer:Gt.current,store:t,margin:Be,width:We,height:He,hitCanvasRef:mt,geometryMoved:a||u||o});const m=kn(t,n,u,Nt),g=Ut.current,y=(v={dirtyOrRebuilt:u,transitioning:a,continuous:f,liveEncoding:m.changed,forced:o||p||g},Boolean(v.dirtyOrRebuilt||v.transitioning||v.animationTicked||v.continuous||v.liveEncoding||v.forced));var v;if(Ut.current=!1,C&&gt.current){const e=pt.current;if(e&&t.scales?.projection){const n=Io(e,Oe,Be,d);n&&(n.clearRect(-Be.left,-Be.top,Oe[0],Oe[1]),n.save(),n.beginPath(),n.rect(0,0,We,He),n.clip(),Na(n,{tileURL:C,projection:t.scales.projection,width:We,height:He,tileCache:gt.current,maxDevicePixelRatio:_,onTileLoad:()=>Ze()}),n.restore())}}if(y){const i=Io(e,Oe,Be,d);if(!i)return;i.clearRect(-Be.left,-Be.top,Oe[0],Oe[1]),C||Go(i,{background:D,themeBackground:ht,hasBackgroundGraphics:Boolean(ge),x:-Be.left,y:-Be.top,width:Oe[0],height:Oe[1]}),i.save(),i.beginPath(),i.rect(0,0,We,He),i.clip();const o=t.scene,a=(t.scales,{width:We,height:He});if(Ha({context:i,nodes:o,renderMode:B,pixelRatio:d,paintBuiltIn:e=>{wa(i,e),km(i,e,0,a),Sm(i,e),Mm(i,e)}}),f&&jt.current){const e=jt.current,t=o.filter(e=>"line"===e.type);if(t.length>0){const o=A||{},a=.3*(o.speedMultiplier??1),s=o.maxPerLine??cs(),l=o.spawnRate??(ls()?.06:.15),c=o.radius??2,u=o.opacity??.7,d=n/1e3,h=At.current>0?Math.min(d-At.current,.1):.016;At.current=d;const f=t.map(e=>e.path),p=t.map(e=>e.style.strokeWidth??2);for(let n=0;n<t.length;n++)Ye.random()<l&&e.countForLine(n)<s&&e.spawn(n,Ye.random);e.step(h,a,f,p),i.globalAlpha=u;for(let n=0;n<e.particles.length;n++){const r=e.particles[n];if(!r.active)continue;const a=t[r.lineIndex],s="function"==typeof o.color?o.color(a?.datum??{}):"source"!==o.color&&o.color?o.color:a?.style.stroke||"#fff";i.beginPath(),i.arc(r.x,r.y,c,0,2*Math.PI),i.fillStyle=s,i.fill()}i.globalAlpha=1,r=!0}}i.restore()}(u||a&&!s)&&e.setAttribute("aria-label",Zo(t.scene,"Geographic chart"));const b=Lt.current,x=Boolean(b&&("geoarea"===b.type||"point"===b.type)),w=(k=x,S=Pt.current,k||S);var k,S;const M=Yt.current;if(M&&w){const e=Io(M,Oe,Be,d);if(e){if(e.clearRect(-Be.left,-Be.top,Oe[0],Oe[1]),b&&"geoarea"===b.type){const t=new Path2D(b.pathData);e.fillStyle="rgba(255, 255, 255, 0.3)",e.fill(t),e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke(t)}if(b&&"point"===b.type){const t=b,n="object"==typeof Y?Y:void 0,r=n?.pointColor||$a(b);e.beginPath(),e.arc(t.x,t.y,t.r+3,0,2*Math.PI),r?(e.save(),e.globalAlpha=.4,e.fillStyle=r,e.fill(),e.restore()):(e.fillStyle="rgba(255, 255, 255, 0.4)",e.fill()),e.strokeStyle=r||"rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke()}}Pt.current=x}const R=te!==yt.current;R&&(yt.current=te),(u||R||a&&te&&te.length>0)&&(u||R||a&&!s||n-Dt.current>=33)&&($t(e=>e+1),Dt.current=n),(l||null!=t.activeTransition||m.pending||r)&&Ze()},vr(ce,ot,$e,Ze,Ye.now,_t,Ft),(0,Ru.useEffect)(()=>{if("production"!==process.env.NODE_ENV&&C){const e=us(n);e&&"mercator"!==e&&console.warn(`[StreamGeoFrame] tileURL is set but projection is "${e}". Raster tiles use Web Mercator and will not align with other projections.`)}},[C,n]),(0,Ru.useEffect)(()=>{const e=wt.current;if(!w||!e)return vt.current&&e&&((0,bm.select)(e).on(".zoom",null),vt.current=null),void(e&&(0,bm.select)(e).on("mousedown.rotate",null).on("touchstart.rotate",null));const[t,n]=k||[1,8],r={width:We,height:He};if(rt){let i=bt.current.k;const o=e=>{i=Math.max(t,Math.min(n,e)),bt.current=vm.zoomIdentity.scale(i);const o=ot.current;o&&(o.applyZoomScale(i,r),$e.current=!1,Ze(),o.scales?.projection&&S?.({projection:o.scales.projection,zoom:o.currentZoom}))};vt.current={scaleBy:(e,t)=>o(i*t),transform:(e,t)=>o(t?.k??1)};const a=e=>{e.preventDefault();const t=e.deltaY<0?1.1:1/1.1;o(i*t)},s=e=>{const t=e.target;t&&(t.closest("button")||t.closest(".stream-geo-zoom-controls"))||(e.preventDefault(),o(1.5*i))};e.addEventListener("wheel",a,{passive:!1}),e.addEventListener("dblclick",s);const l=.4,c=t=>{if(0!==t.button)return;const n=t.target;if(n.closest("button")||n.closest(".stream-geo-zoom-controls"))return;const r=ot.current;if(!r)return;const i=r.getRotation();St.current={x:t.clientX,y:t.clientY,rotation:[...i]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{const t=St.current;if(!t)return;const n=e.clientX-t.x,r=e.clientY-t.y,i=[t.rotation[0]+n*l,Math.max(-90,Math.min(90,t.rotation[1]-r*l)),t.rotation[2]];Mt.current=i,Ze()},d=t=>{if(!St.current)return;St.current=null,e.releasePointerCapture(t.pointerId);const n=Mt.current;if(n){Mt.current=null;const e=ot.current;e&&(e.applyRotation(n,r),Ze())}const i=ot.current;i?.scales?.projection&&S?.({projection:i.scales.projection,zoom:i.currentZoom})};return e.addEventListener("pointerdown",c),e.addEventListener("pointermove",u),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("wheel",a),e.removeEventListener("dblclick",s),e.removeEventListener("pointerdown",c),e.removeEventListener("pointermove",u),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d),vt.current=null}}const i=(0,vm.zoom)().scaleExtent([t,n]).extent([[0,0],[Oe[0],Oe[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{const t=e.transform;bt.current=t,xt.current=!0;const n=ot.current;n&&(n.applyZoomTransform(t,r),$e.current=!1,Ze())}).on("end",e=>{bt.current=e.transform,xt.current=!1;const t=ot.current;t?.scales?.projection&&S?.({projection:t.scales.projection,zoom:t.currentZoom})});return vt.current=i,(0,bm.select)(e).call(i),()=>{(0,bm.select)(e).on(".zoom",null)}},[w,k,rt,Oe,We,He,Be,S,Ze]);const nn=V&&!1!==Y,rn=nn&&Tt?U?U(Tt):/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsx)(Bm,{data:Tt}):null,on=oa(rn)?/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsx)(da,{contentOwnsChrome:ua(U),x:Tt.x,y:Tt.y,containerWidth:We,containerHeight:He,margin:Be,className:"stream-frame-tooltip",zIndex:10,children:rn}):null;if(ct){const e=at.scene;/* @__PURE__ */ /* @__PURE__ */
176
+ return(0,Xm.jsxs)("div",{ref:kt,className:"stream-geo-frame"+($?` ${$}`:""),role:Le?"group":"img","aria-label":Pe||("string"==typeof ve?ve:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:I?"100%":Oe[0],height:T?"100%":Oe[1]},children:[
177
177
  /* @__PURE__ */
178
- /* @__PURE__ */(0,qm.jsx)(Ko,{accessibleTable:Le,scene:e,chartType:"Geographic chart",tableId:Ve,chartTitle:"string"==typeof be?be:void 0}),
178
+ /* @__PURE__ */(0,Xm.jsx)(Ko,{accessibleTable:Le,scene:e,chartType:"Geographic chart",tableId:Ve,chartTitle:"string"==typeof ve?ve:void 0}),
179
179
  /* @__PURE__ */
180
- /* @__PURE__ */(0,qm.jsx)(Jo,{summary:Ne}),
180
+ /* @__PURE__ */(0,Xm.jsx)(Jo,{summary:Ne}),
181
181
  /* @__PURE__ */
182
- /* @__PURE__ */(0,qm.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:Oe[0],height:Oe[1],style:{position:"absolute",left:0,top:0},children:[ft?/* @__PURE__ */ /* @__PURE__ */(0,qm.jsx)("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:Oe[0],height:Oe[1],fill:ft}):null,
182
+ /* @__PURE__ */(0,Xm.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:Oe[0],height:Oe[1],style:{position:"absolute",left:0,top:0},children:[ft?/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsx)("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:Oe[0],height:Oe[1],fill:ft}):null,
183
183
  /* @__PURE__ */
184
- /* @__PURE__ */(0,qm.jsx)("g",{transform:`translate(${Be.left},${Be.top})`,children:dt}),
184
+ /* @__PURE__ */(0,Xm.jsx)("g",{transform:`translate(${Be.left},${Be.top})`,children:dt}),
185
185
  /* @__PURE__ */
186
- /* @__PURE__ */(0,qm.jsx)("g",{transform:`translate(${Be.left},${Be.top})`,children:e.map((e,t)=>Wa({node:e,index:t,renderMode:B,fallback:()=>Ao(e,t)}).element)})]}),
186
+ /* @__PURE__ */(0,Xm.jsx)("g",{transform:`translate(${Be.left},${Be.top})`,children:e.map((e,t)=>qa({node:e,index:t,renderMode:B,fallback:()=>Ao(e,t)}).element)})]}),
187
187
  /* @__PURE__ */
188
- /* @__PURE__ */(0,qm.jsx)(yo,{width:We,height:He,totalWidth:Oe[0],totalHeight:Oe[1],margin:Be,showAxes:!1,title:be,description:Pe,legend:ve,legendPosition:xe,legendLayout:we,legendHoverBehavior:ke,legendClickBehavior:Se,legendHighlightedCategory:Me,legendIsolatedCategories:je,foregroundGraphics:za(ut,Da(ot.current?.customLayoutOverlays,d??null)),annotations:te,onAnnotationActivate:ne,onObservation:J??Q,chartId:ee,chartType:"StreamGeoFrame",autoPlaceAnnotations:re,svgAnnotationRules:ie,pointNodes:Ha(e),geoProjection:ot.current?.scales?.projectedPoint})]})}/* @__PURE__ */ /* @__PURE__ */
189
- return(0,qm.jsxs)("div",{ref:kt,className:"stream-geo-frame"+($?` ${$}`:""),role:"group","aria-label":Pe||("string"==typeof be?be:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:I?"100%":Oe[0],height:T?"100%":Oe[1],overflow:X?"visible":"hidden",...w?{touchAction:"none"}:{}},onKeyDown:Kt,children:["production"!==process.env.NODE_ENV&&ot.current&&/* @__PURE__ */ /* @__PURE__ */(0,qm.jsx)(uf,{store:ot.current,diagnostics:Et.current}),
188
+ /* @__PURE__ */(0,Xm.jsx)(yo,{width:We,height:He,totalWidth:Oe[0],totalHeight:Oe[1],margin:Be,showAxes:!1,title:ve,description:Pe,legend:be,legendPosition:xe,legendLayout:we,legendHoverBehavior:ke,legendClickBehavior:Se,legendHighlightedCategory:Me,legendIsolatedCategories:je,foregroundGraphics:Da(ut,Fa(ot.current?.customLayoutOverlays,d??null)),annotations:te,onAnnotationActivate:ne,onObservation:J??Q,chartId:ee,chartType:"StreamGeoFrame",autoPlaceAnnotations:re,svgAnnotationRules:ie,pointNodes:Ga(e),geoProjection:ot.current?.scales?.projectedPoint})]})}/* @__PURE__ */ /* @__PURE__ */
189
+ return(0,Xm.jsxs)("div",{ref:kt,className:"stream-geo-frame"+($?` ${$}`:""),role:"group","aria-label":Pe||("string"==typeof ve?ve:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:I?"100%":Oe[0],height:T?"100%":Oe[1],overflow:X?"visible":"hidden",...w?{touchAction:"none"}:{}},onKeyDown:Qt,children:["production"!==process.env.NODE_ENV&&ot.current&&/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsx)(pf,{store:ot.current,diagnostics:Et.current}),
190
190
  /* @__PURE__ */
191
- /* @__PURE__ */(0,qm.jsx)(Ko,{accessibleTable:Le,sceneRevision:ot.current?.getUpdateSnapshot().revisions.accessibility,scene:ot.current?.scene??[],chartType:"Geographic chart",tableId:Ve,chartTitle:"string"==typeof be?be:void 0}),
191
+ /* @__PURE__ */(0,Xm.jsx)(Ko,{accessibleTable:Le,sceneRevision:ot.current?.getUpdateSnapshot().revisions.accessibility,scene:ot.current?.scene??[],chartType:"Geographic chart",tableId:Ve,chartTitle:"string"==typeof ve?ve:void 0}),
192
192
  /* @__PURE__ */
193
- /* @__PURE__ */(0,qm.jsx)(Jo,{summary:Ne}),
193
+ /* @__PURE__ */(0,Xm.jsx)(Jo,{summary:Ne}),
194
194
  /* @__PURE__ */
195
- /* @__PURE__ */(0,qm.jsx)(Vo,{active:Xt.current>=0,hoverPoint:Tt}),
195
+ /* @__PURE__ */(0,Xm.jsx)(Vo,{active:Zt.current>=0,hoverPoint:Tt}),
196
196
  /* @__PURE__ */
197
- /* @__PURE__ */(0,qm.jsxs)("div",{role:"img","aria-label":Pe||("string"==typeof be?be:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Jt,onPointerLeave:Ht,onPointerDown:tn||Te?en:void 0,onClick:Te?Ut:void 0,children:[
197
+ /* @__PURE__ */(0,Xm.jsxs)("div",{role:"img","aria-label":Pe||("string"==typeof ve?ve:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:en,onPointerLeave:Ht,onPointerDown:nn||Te?tn:void 0,onClick:Te?Xt:void 0,children:[
198
198
  /* @__PURE__ */
199
- /* @__PURE__ */(0,qm.jsx)(_o,{size:Oe,margin:Be,backdropFill:ft??void 0,children:dt}),C&&/* @__PURE__ */ /* @__PURE__ */(0,qm.jsx)("canvas",{ref:pt,style:{position:"absolute",left:0,top:0,width:Oe[0],height:Oe[1],pointerEvents:"none"}}),
199
+ /* @__PURE__ */(0,Xm.jsx)(_o,{size:Oe,margin:Be,backdropFill:ft??void 0,children:dt}),C&&/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsx)("canvas",{ref:pt,style:{position:"absolute",left:0,top:0,width:Oe[0],height:Oe[1],pointerEvents:"none"}}),
200
200
  /* @__PURE__ */
201
- /* @__PURE__ */(0,qm.jsx)("canvas",{ref:Gt,"aria-label":Zo(ot.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0,width:Oe[0],height:Oe[1]}}),
201
+ /* @__PURE__ */(0,Xm.jsx)("canvas",{ref:Vt,"aria-label":Zo(ot.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0,width:Oe[0],height:Oe[1]}}),
202
202
  /* @__PURE__ */
203
- /* @__PURE__ */(0,qm.jsx)("canvas",{ref:Vt,style:{position:"absolute",left:0,top:0,width:Oe[0],height:Oe[1],pointerEvents:"none"}}),
203
+ /* @__PURE__ */(0,Xm.jsx)("canvas",{ref:Yt,style:{position:"absolute",left:0,top:0,width:Oe[0],height:Oe[1],pointerEvents:"none"}}),
204
204
  /* @__PURE__ */
205
- /* @__PURE__ */(0,qm.jsx)(yo,{width:We,height:He,totalWidth:Oe[0],totalHeight:Oe[1],margin:Be,showAxes:Re,title:be,description:Pe,legend:ve,legendPosition:xe,legendLayout:we,legendHoverBehavior:ke,legendClickBehavior:Se,legendHighlightedCategory:Me,legendIsolatedCategories:je,foregroundGraphics:za(ut,Da(ot.current?.customLayoutOverlays,d??null)),annotations:te,onAnnotationActivate:ne,onObservation:J??Q,chartId:ee,chartType:"StreamGeoFrame",autoPlaceAnnotations:re,svgAnnotationRules:ie,pointNodes:Ha(ot.current?.scene),geoProjection:ot.current?.scales?.projectedPoint}),ce?.showBadge&&/* @__PURE__ */ /* @__PURE__ */(0,qm.jsx)(xr,{isStale:_t,position:ce.badgePosition,state:ce.state,settling:ce.settling}),w&&/* @__PURE__ */ /* @__PURE__ */(0,qm.jsxs)("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:Be.bottom+8,left:Be.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[
205
+ /* @__PURE__ */(0,Xm.jsx)(yo,{width:We,height:He,totalWidth:Oe[0],totalHeight:Oe[1],margin:Be,showAxes:Re,title:ve,description:Pe,legend:be,legendPosition:xe,legendLayout:we,legendHoverBehavior:ke,legendClickBehavior:Se,legendHighlightedCategory:Me,legendIsolatedCategories:je,foregroundGraphics:Da(ut,Fa(ot.current?.customLayoutOverlays,d??null)),annotations:te,onAnnotationActivate:ne,onObservation:J??Q,chartId:ee,chartType:"StreamGeoFrame",autoPlaceAnnotations:re,svgAnnotationRules:ie,pointNodes:Ga(ot.current?.scene),geoProjection:ot.current?.scales?.projectedPoint}),ce?.showBadge&&/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsx)(xr,{isStale:_t,position:ce.badgePosition,state:ce.state,settling:ce.settling}),w&&/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsxs)("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:Be.bottom+8,left:Be.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[
206
206
  /* @__PURE__ */
207
- /* @__PURE__ */(0,qm.jsx)("button",{type:"button","aria-label":"Zoom in",onClick:e=>{e.stopPropagation();const t=wt.current,n=bt.current;t&&n?.scaleBy&&n.scaleBy((0,pm.select)(t),1.5)},style:Fm,children:"+"}),
207
+ /* @__PURE__ */(0,Xm.jsx)("button",{type:"button","aria-label":"Zoom in",onClick:e=>{e.stopPropagation();const t=wt.current,n=vt.current;t&&n?.scaleBy&&n.scaleBy((0,bm.select)(t),1.5)},style:qm,children:"+"}),
208
208
  /* @__PURE__ */
209
- /* @__PURE__ */(0,qm.jsx)("button",{type:"button","aria-label":"Zoom out",onClick:e=>{e.stopPropagation();const t=wt.current,n=bt.current;t&&n?.scaleBy&&n.scaleBy((0,pm.select)(t),1/1.5)},style:Fm,children:"−"})]}),R&&/* @__PURE__ */ /* @__PURE__ */(0,qm.jsx)("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:Be.bottom+2,right:Be.right+4,fontSize:10,color:"rgba(0,0,0,0.6)",background:"rgba(255,255,255,0.7)",padding:"1px 4px",borderRadius:2,pointerEvents:"none",zIndex:2},children:R}),
209
+ /* @__PURE__ */(0,Xm.jsx)("button",{type:"button","aria-label":"Zoom out",onClick:e=>{e.stopPropagation();const t=wt.current,n=vt.current;t&&n?.scaleBy&&n.scaleBy((0,bm.select)(t),1/1.5)},style:qm,children:"−"})]}),R&&/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsx)("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:Be.bottom+2,right:Be.right+4,fontSize:10,color:"rgba(0,0,0,0.6)",background:"rgba(255,255,255,0.7)",padding:"1px 4px",borderRadius:2,pointerEvents:"none",zIndex:2},children:R}),
210
210
  /* @__PURE__ */
211
- /* @__PURE__ */(0,qm.jsx)(ia,{active:Xt.current>=0,hoverPoint:Tt,margin:Be,size:Oe,shape:Zt.current?.shape,width:Zt.current?.w,height:Zt.current?.h,pathData:Zt.current?.pathData}),rn]})]})})),"StreamGeoFrame"),Vm=require("react"),Ym=require("react"),Um=require("./semiotic-client-cjs-shared.min.js"),Xm=require("./semiotic-client-cjs-shared.min.js"),Zm=require("./semiotic-client-cjs-shared.min.js"),Km=require("./semiotic-client-cjs-shared.min.js"),Qm=require("./semiotic-client-cjs-shared.min.js"),Jm={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},eg={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}}},tg={top:10,bottom:10,left:10,right:10},ng=require("react"),rg=require("react"),ig=(/* @__PURE__ */ /* @__PURE__ */require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("react/jsx-runtime"),(0,rg.createContext)(!1)),og=/* @__PURE__ */ /* @__PURE__ */(0,rg.createContext)(null),ag="undefined"==typeof window?rg.useEffect:rg.useLayoutEffect,sg=[],lg=require("react/jsx-runtime"),cg=require("react"),ug=require("react/jsx-runtime"),dg=class extends cg.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:/* @__PURE__ */ /* @__PURE__ */(0,ug.jsx)(ml,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}},hg=require("react/jsx-runtime"),fg={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"},pg={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2},mg=require("react"),gg=require("./semiotic-client-cjs-shared.min.js"),yg=require("d3-scale"),bg=require("react"),vg=require("topojson-client"),xg=/* @__PURE__ */new Map,wg="Install the optional peer dependency `world-atlas` (`npm install world-atlas`) to use built-in reference geographies, or pass GeoJSON Feature[] to `areas`.",kg=require("react/jsx-runtime"),Sg=/* @__PURE__ */As(function(e){const t=ol(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=tl(),{areas:r,valueAccessor:i,styleRules:o,colorScheme:a,projection:s="equalEarth",graticule:l,fitPadding:c,zoomable:u,zoomExtent:d,onZoom:h,dragRotate:f,tileURL:p,tileAttribution:m,tileCacheSize:g,tooltip:y,areaOpacity:b=1,annotations:v,legendInteraction:x,legendPosition:w,margin:k,className:S,selection:M,linkedHover:j,onObservation:A,onClick:C,chartId:R,loading:L,loadingContent:P,emptyContent:N,frameProps:E={},stroke:I,strokeWidth:T,opacity:z}=e,$=u??!!p,D=Ml(r),_=(0,Vm.useMemo)(()=>D?yn(D):D,[D]),F=(0,Vm.useMemo)(()=>"function"==typeof i?i:e=>e?.properties?.[i]??e?.[i],[i]),O=a??n??"blues",B=(0,Vm.useMemo)(()=>{if(!_)return(0,yg.scaleSequential)(Pt(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(const n of _){const r=F(n);null!=r&&isFinite(r)&&(r<e&&(e=r),r>t&&(t=r))}const n=Pt(O);return(0,yg.scaleSequential)(n).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[_,F,O]),W=(0,Vm.useMemo)(()=>{const e=B.domain();return[e[0]??0,e[1]??1]},[B]),H=Js(x,F,W),{activeSelectionHook:q,hoverSelectionHook:G,customHoverBehavior:V,customClickBehavior:Y}=rl({selection:M,linkedHover:j,onObservation:A,onClick:C,chartType:"ChoroplethMap",chartId:R,mobileInteraction:t.mobileInteraction}),U=xl(M),X=G||H.legendSelectionHook||q,Z=(0,Vm.useMemo)(()=>{const e=sl(pl(e=>{const t=F(e);return{fill:null!=t&&isFinite(t)?B(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:b}},o,e=>({value:F(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),{stroke:I,strokeWidth:T,opacity:z});return X?Rs(e,X,U,Cl):e},[F,B,X,U,b,I,T,z,o]),K=(0,Vm.useMemo)(()=>e=>{const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",n=F(e);/* @__PURE__ */ /* @__PURE__ */
212
- return(0,kg.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
211
+ /* @__PURE__ */(0,Xm.jsx)(ia,{active:Zt.current>=0,hoverPoint:Tt,margin:Be,size:Oe,shape:Kt.current?.shape,width:Kt.current?.w,height:Kt.current?.h,pathData:Kt.current?.pathData}),on]})]})})),"StreamGeoFrame"),Km=require("react"),Qm=require("react"),Jm=require("./semiotic-client-cjs-shared.min.js"),eg=require("./semiotic-client-cjs-shared.min.js"),tg=require("./semiotic-client-cjs-shared.min.js"),ng=require("./semiotic-client-cjs-shared.min.js"),rg=require("./semiotic-client-cjs-shared.min.js"),ig={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},og={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}}},ag={top:10,bottom:10,left:10,right:10},sg=require("react"),lg=require("react"),cg=(/* @__PURE__ */ /* @__PURE__ */require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("react/jsx-runtime"),(0,lg.createContext)(!1)),ug=/* @__PURE__ */ /* @__PURE__ */(0,lg.createContext)(null),dg="undefined"==typeof window?lg.useEffect:lg.useLayoutEffect,hg=[],fg=require("react/jsx-runtime"),pg=require("react"),mg=require("react/jsx-runtime"),gg=class extends pg.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:/* @__PURE__ */ /* @__PURE__ */(0,mg.jsx)(vl,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}},yg=require("react/jsx-runtime"),vg={display:"flex",alignItems:"stretch",flexDirection:"column",textAlign:"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"},bg={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2},xg=require("react"),wg=require("./semiotic-client-cjs-shared.min.js"),kg=require("d3-scale"),Sg=require("react"),Mg=require("topojson-client"),jg=/* @__PURE__ */new Map,Ag="Install the optional peer dependency `world-atlas` (`npm install world-atlas`) to use built-in reference geographies, or pass GeoJSON Feature[] to `areas`.",Cg=require("react/jsx-runtime"),Rg=/* @__PURE__ */Ls(function(e){const t=ll(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=il(),{areas:r,valueAccessor:i,styleRules:o,colorScheme:a,projection:s="equalEarth",graticule:l,fitPadding:c,zoomable:u,zoomExtent:d,onZoom:h,dragRotate:f,tileURL:p,tileAttribution:m,tileCacheSize:g,tooltip:y,areaOpacity:v=1,annotations:b,legendInteraction:x,legendPosition:w,margin:k,className:S,selection:M,linkedHover:j,onObservation:A,onClick:C,chartId:R,loading:L,loadingContent:P,emptyContent:N,frameProps:E={},stroke:I,strokeWidth:T,opacity:z}=e,$=u??!!p,D=Rl(r),_=(0,Km.useMemo)(()=>D?yn(D):D,[D]),F=(0,Km.useMemo)(()=>"function"==typeof i?i:e=>e?.properties?.[i]??e?.[i],[i]),O=a??n??"blues",B=(0,Km.useMemo)(()=>{if(!_)return(0,kg.scaleSequential)(Pt(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(const n of _){const r=F(n);null!=r&&isFinite(r)&&(r<e&&(e=r),r>t&&(t=r))}const n=Pt(O);return(0,kg.scaleSequential)(n).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[_,F,O]),W=(0,Km.useMemo)(()=>{const e=B.domain();return[e[0]??0,e[1]??1]},[B]),H=nl(x,F,W),{activeSelectionHook:q,hoverSelectionHook:G,customHoverBehavior:V,customClickBehavior:Y}=al({selection:M,linkedHover:j,onObservation:A,onClick:C,chartType:"ChoroplethMap",chartId:R,mobileInteraction:t.mobileInteraction}),U=Ml(M),X=G||H.legendSelectionHook||q,Z=(0,Km.useMemo)(()=>{const e=ul(yl(e=>{const t=F(e);return{fill:null!=t&&isFinite(t)?B(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:v}},o,e=>({value:F(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),{stroke:I,strokeWidth:T,opacity:z});return X?Ns(e,X,U,Nl):e},[F,B,X,U,v,I,T,z,o]),K=(0,Km.useMemo)(()=>e=>{const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",n=F(e);/* @__PURE__ */ /* @__PURE__ */
212
+ return(0,Cg.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
213
213
  /* @__PURE__ */
214
- /* @__PURE__ */(0,kg.jsx)("div",{style:{fontWeight:600},children:t}),null!=n&&/* @__PURE__ */ /* @__PURE__ */(0,kg.jsx)("div",{style:{opacity:.7},children:(r=n,"number"==typeof r&&isFinite(r)?Number.isInteger(r)?r.toLocaleString():r.toLocaleString(void 0,{maximumFractionDigits:2}):String(r??""))})]});var r},[F]),Q=Ds(t),J=(0,Vm.useMemo)(()=>{if(!1!==t.showLegend)return{gradient:{colorFn:e=>B(e),domain:W,label:"string"==typeof i?i:"value"}}},[B,t.showLegend,i,W]),{legend:ee,margin:te,legendPosition:ne,legendMarginReserved:re}=Xs({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:w,userMargin:k,defaults:Q,additionalLegend:J,chartWidth:t.width,chartHeight:t.height,legendLayout:E.legendLayout,frameLegend:E,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),ie=bl(L,t.width,t.height,P)||(_?null:bl(!0,t.width,t.height,P)),oe=ie?null:yl(_,t.width,t.height,N);if(Array.isArray(_)&&_.length>0){const e=_[0];if(!e||"object"!=typeof e||!e.geometry)/* @__PURE__ */ /* @__PURE__ */
215
- return(0,kg.jsx)(ml,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}const ae={projection:s,areas:_,areaStyle:Z,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:te,enableHover:t.enableHover,...ee&&{legend:ee,legendPosition:ne},...re&&{__legendMarginReservedFor:ee},legendHoverBehavior:H.onLegendHover,legendClickBehavior:H.onLegendClick,legendHighlightedCategory:H.highlightedCategory,legendIsolatedCategories:"isolate"===x?H.isolatedCategories:void 0,tooltipContent:!1===y?()=>null:!0===y?K:is(y)||K,...null!=l&&{graticule:l},...null!=c&&{fitPadding:c},...$&&{zoomable:!0},...d&&{zoomExtent:d},...h&&{onZoom:h},...null!=f&&{dragRotate:f},...p&&{tileURL:p},...m&&{tileAttribution:m},...g&&{tileCacheSize:g},...Al({linkedHover:j,selection:M,onObservation:A,onClick:C,mobileInteraction:t.mobileInteraction,customHoverBehavior:V,customClickBehavior:Y,linkedHoverInClickPredicate:!1}),...v&&v.length>0&&{annotations:v},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...S&&{className:S},...null!=e.animate&&{animate:e.animate},...E};return ie||oe||/* @__PURE__ */ /* @__PURE__ */(0,kg.jsx)(gl,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:/* @__PURE__ */ /* @__PURE__ */(0,kg.jsx)(Gm,{...ae})})},"ChoroplethMap"),Mg=require("react"),jg=require("react"),Ag=require("./semiotic-client-cjs-shared.min.js"),Cg=require("react"),Rg={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5},Lg=require("react/jsx-runtime"),Pg=[3,30],Ng=[1,4],Eg=/* @__PURE__ */As(/* @__PURE__ */ /* @__PURE__ */(0,Mg.forwardRef)(function(e,t){const n=(0,Mg.useRef)(null);Ll(t,{variant:"geo-points",frameRef:n});const r=ol(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:i,xAccessor:o="lon",yAccessor:a="lat",sizeBy:s,sizeRange:l,colorBy:c,styleRules:u,colorScheme:d,projection:h="equalEarth",graticule:f,fitPadding:p,zoomable:m,zoomExtent:g,onZoom:y,dragRotate:b,tileURL:v,tileAttribution:x,tileCacheSize:w,areas:k,areaStyle:S=Rg,tooltip:M,annotations:j,margin:A,className:C,selection:R,linkedHover:L,onObservation:P,onClick:N,chartId:E,loading:I,loadingContent:T,emptyContent:z,legendInteraction:$,legendPosition:D,frameProps:_={},stroke:F,strokeWidth:O,opacity:B}=e,W=l??("sparkline"===r.mode?Ng:Pg),H="sparkline"===r.mode?1.5:6,q=m??!!v,G=Ml(k),V=Rl({data:i??rf,rawData:i,colorBy:c,colorScheme:d,legendInteraction:$,legendPosition:D,frameLegend:_,selection:R,linkedHover:L,fallbackFields:c?["string"==typeof c?c:""]:[],unwrapData:!1,onObservation:P,onClick:N,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:E,showLegend:r.showLegend,userMargin:A,marginDefaults:Ds(r),loading:I,loadingContent:T,emptyContent:z,width:r.width,height:r.height,hasTitle:!!r.title}),Y=V.data,U=(0,Mg.useMemo)(()=>{if(!s)return;const e="function"==typeof s?s:e=>e?.[s],t=Y.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?nn(t):void 0},[Y,s]),X=(0,Mg.useMemo)(()=>{const e=sl(pl(e=>({fill:c?It(e,c,V.colorScale):Nh,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Dt(e,s,W,U):H}),u,cl(c,s)),{stroke:F,strokeWidth:O,opacity:B});return V.effectiveSelectionHook?Rs(e,V.effectiveSelectionHook,V.resolvedSelection):e},[c,V.colorScale,V.effectiveSelectionHook,V.resolvedSelection,s,W,U,H,F,O,B,u]),Z=(0,Mg.useMemo)(()=>e=>{const t=e?.name||e?.label||e?.NAME||e?.id,n="string"==typeof s?s:null,r=("function"==typeof s?s:e=>e[s])(e),i=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):String(e??""),o="string"==typeof c?c:null,a=o?e?.[o]:null;/* @__PURE__ */ /* @__PURE__ */
216
- return(0,Lg.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&/* @__PURE__ */ /* @__PURE__ */(0,Lg.jsx)("div",{style:{fontWeight:600,marginBottom:2},children:t}),n&&null!=r&&/* @__PURE__ */ /* @__PURE__ */(0,Lg.jsxs)("div",{children:[
214
+ /* @__PURE__ */(0,Cg.jsx)("div",{style:{fontWeight:600},children:t}),null!=n&&/* @__PURE__ */ /* @__PURE__ */(0,Cg.jsx)("div",{style:{opacity:.7},children:(r=n,"number"==typeof r&&isFinite(r)?Number.isInteger(r)?r.toLocaleString():r.toLocaleString(void 0,{maximumFractionDigits:2}):String(r??""))})]});var r},[F]),Q=Os(t),J=(0,Km.useMemo)(()=>{if(!1!==t.showLegend)return{gradient:{colorFn:e=>B(e),domain:W,label:"string"==typeof i?i:"value"}}},[B,t.showLegend,i,W]),{legend:ee,margin:te,legendPosition:ne,legendMarginReserved:re}=Qs({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:w,userMargin:k,defaults:Q,additionalLegend:J,chartWidth:t.width,chartHeight:t.height,legendLayout:E.legendLayout,frameLegend:E,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),ie=kl(L,t.width,t.height,P,e)||(_?null:kl(!0,t.width,t.height,P,e)),oe=ie?null:wl(_,t.width,t.height,N,e);if(Array.isArray(_)&&_.length>0){const e=_[0];if(!e||"object"!=typeof e||!e.geometry)/* @__PURE__ */ /* @__PURE__ */
215
+ return(0,Cg.jsx)(vl,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}const ae={projection:s,areas:_,areaStyle:Z,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:te,enableHover:t.enableHover,...ee&&{legend:ee,legendPosition:ne},...re&&{__legendMarginReservedFor:ee},legendHoverBehavior:H.onLegendHover,legendClickBehavior:H.onLegendClick,legendHighlightedCategory:H.highlightedCategory,legendIsolatedCategories:"isolate"===x?H.isolatedCategories:void 0,tooltipContent:!1===y?()=>null:!0===y?K:ss(y)||K,...null!=l&&{graticule:l},...null!=c&&{fitPadding:c},...$&&{zoomable:!0},...d&&{zoomExtent:d},...h&&{onZoom:h},...null!=f&&{dragRotate:f},...p&&{tileURL:p},...m&&{tileAttribution:m},...g&&{tileCacheSize:g},...Pl({linkedHover:j,selection:M,onObservation:A,onClick:C,mobileInteraction:t.mobileInteraction,customHoverBehavior:V,customClickBehavior:Y,linkedHoverInClickPredicate:!1}),...b&&b.length>0&&{annotations:b},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...S&&{className:S},...null!=e.animate&&{animate:e.animate},...E};return ie||oe||/* @__PURE__ */ /* @__PURE__ */(0,Cg.jsx)(xl,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:/* @__PURE__ */ /* @__PURE__ */(0,Cg.jsx)(Zm,{...ae})})},"ChoroplethMap"),Lg=require("react"),Pg=require("react"),Ng=require("./semiotic-client-cjs-shared.min.js"),Eg=require("react"),Ig={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5},Tg=require("react/jsx-runtime"),zg=[3,30],$g=[1,4],Dg=/* @__PURE__ */Ls(/* @__PURE__ */ /* @__PURE__ */(0,Lg.forwardRef)(function(e,t){const n=(0,Lg.useRef)(null);Il(t,{variant:"geo-points",frameRef:n});const r=ll(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:i,xAccessor:o="lon",yAccessor:a="lat",sizeBy:s,sizeRange:l,colorBy:c,styleRules:u,colorScheme:d,projection:h="equalEarth",graticule:f,fitPadding:p,zoomable:m,zoomExtent:g,onZoom:y,dragRotate:v,tileURL:b,tileAttribution:x,tileCacheSize:w,areas:k,areaStyle:S=Ig,tooltip:M,annotations:j,margin:A,className:C,selection:R,linkedHover:L,onObservation:P,onClick:N,chartId:E,loading:I,loadingContent:T,emptyContent:z,legendInteraction:$,legendPosition:D,frameProps:_={},stroke:F,strokeWidth:O,opacity:B}=e,W=l??("sparkline"===r.mode?$g:zg),H="sparkline"===r.mode?1.5:6,q=m??!!b,G=Rl(k),V=El({responsive:e,data:i??lf,rawData:i,colorBy:c,colorScheme:d,legendInteraction:$,legendPosition:D,frameLegend:_,selection:R,linkedHover:L,fallbackFields:c?["string"==typeof c?c:""]:[],unwrapData:!1,onObservation:P,onClick:N,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:E,showLegend:r.showLegend,userMargin:A,marginDefaults:Os(r),loading:I,loadingContent:T,emptyContent:z,width:r.width,height:r.height,hasTitle:!!r.title}),Y=V.data,U=(0,Lg.useMemo)(()=>{if(!s)return;const e="function"==typeof s?s:e=>e?.[s],t=Y.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?nn(t):void 0},[Y,s]),X=(0,Lg.useMemo)(()=>{const e=ul(yl(e=>({fill:c?It(e,c,V.colorScale):zh,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Dt(e,s,W,U):H}),u,hl(c,s)),{stroke:F,strokeWidth:O,opacity:B});return V.effectiveSelectionHook?Ns(e,V.effectiveSelectionHook,V.resolvedSelection):e},[c,V.colorScale,V.effectiveSelectionHook,V.resolvedSelection,s,W,U,H,F,O,B,u]),Z=(0,Lg.useMemo)(()=>e=>{const t=e?.name||e?.label||e?.NAME||e?.id,n="string"==typeof s?s:null,r=("function"==typeof s?s:e=>e[s])(e),i=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):String(e??""),o="string"==typeof c?c:null,a=o?e?.[o]:null;/* @__PURE__ */ /* @__PURE__ */
216
+ return(0,Tg.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&/* @__PURE__ */ /* @__PURE__ */(0,Tg.jsx)("div",{style:{fontWeight:600,marginBottom:2},children:t}),n&&null!=r&&/* @__PURE__ */ /* @__PURE__ */(0,Tg.jsxs)("div",{children:[
217
217
  /* @__PURE__ */
218
- /* @__PURE__ */(0,Lg.jsxs)("span",{style:{opacity:.7},children:[n,": "]}),i(r)]}),o&&null!=a&&/* @__PURE__ */ /* @__PURE__ */(0,Lg.jsxs)("div",{children:[
218
+ /* @__PURE__ */(0,Tg.jsxs)("span",{style:{opacity:.7},children:[n,": "]}),i(r)]}),o&&null!=a&&/* @__PURE__ */ /* @__PURE__ */(0,Tg.jsxs)("div",{children:[
219
219
  /* @__PURE__ */
220
- /* @__PURE__ */(0,Lg.jsxs)("span",{style:{opacity:.7},children:[o,": "]}),String(a)]}),!t&&!n&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>/* @__PURE__ */ /* @__PURE__ */(0,Lg.jsxs)("div",{children:[
220
+ /* @__PURE__ */(0,Tg.jsxs)("span",{style:{opacity:.7},children:[o,": "]}),String(a)]}),!t&&!n&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>/* @__PURE__ */ /* @__PURE__ */(0,Tg.jsxs)("div",{children:[
221
221
  /* @__PURE__ */
222
- /* @__PURE__ */(0,Lg.jsxs)("span",{style:{opacity:.7},children:[e,": "]}),i(t)]},e))]})},[s,c]);if(V.earlyReturn)return V.earlyReturn;vl("ProportionalSymbolMap",Y,"xAccessor",o),vl("ProportionalSymbolMap",Y,"yAccessor",a);const K={projection:h,...null!=i&&{points:Y},xAccessor:o,yAccessor:a,pointStyle:X,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...G&&{areas:G,areaStyle:S},...null!=f&&{graticule:f},...null!=p&&{fitPadding:p},...q&&{zoomable:!0},...g&&{zoomExtent:g},...y&&{onZoom:y},...null!=b&&{dragRotate:b},...v&&{tileURL:v},...x&&{tileAttribution:x},...w&&{tileCacheSize:w},size:[r.width,r.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:V.margin,enableHover:r.enableHover,tooltipContent:!1===M?()=>null:is(M)||Z,...V.legendBehaviorProps,...Al({linkedHover:L,selection:R,onObservation:P,onClick:N,mobileInteraction:V.mobileInteraction,customHoverBehavior:V.customHoverBehavior,customClickBehavior:V.customClickBehavior,linkedHoverInClickPredicate:!1}),...j&&j.length>0&&{annotations:j},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...r.title&&{title:r.title},...r.description&&{description:r.description},...r.summary&&{summary:r.summary},...void 0!==r.accessibleTable&&{accessibleTable:r.accessibleTable},...C&&{className:C},...null!=e.animate&&{animate:e.animate},..._};/* @__PURE__ */ /* @__PURE__ */
223
- return(0,Lg.jsx)(gl,{componentName:"ProportionalSymbolMap",width:r.width,height:r.height,children:/* @__PURE__ */ /* @__PURE__ */(0,Lg.jsx)(Gm,{ref:n,...K})})}),"ProportionalSymbolMap"),Ig=require("react"),Tg=require("./semiotic-client-cjs-shared.min.js"),zg=require("./semiotic-client-cjs-shared.min.js"),$g=require("react/jsx-runtime"),Dg="__semiotic_x",_g="__semiotic_y",Fg=/* @__PURE__ */As(/* @__PURE__ */ /* @__PURE__ */(0,Ig.forwardRef)(function(e,t){const n=ol(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:r,nodes:i,nodeIdAccessor:o="id",xAccessor:a="lon",yAccessor:s="lat",valueAccessor:l="value",projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:h,zoomExtent:f,onZoom:p,dragRotate:m,tileURL:g,tileAttribution:y,tileCacheSize:b,lineType:v="geo",flowStyle:x="basic",areas:w,areaStyle:k=Rg,edgeColorBy:S,edgeOpacity:M=.6,edgeWidthRange:j=[1,8],pointRadius:A,edgeLinecap:C="round",colorScheme:R,styleRules:L,showParticles:P,particleStyle:N,tooltip:E,annotations:I,margin:T,className:z,selection:$,linkedHover:D,onObservation:_,onClick:F,chartId:O,loading:B,loadingContent:W,emptyContent:H,frameProps:q={},legendInteraction:G,legendPosition:V,stroke:Y,strokeWidth:U,opacity:X,lineIdAccessor:Z}=e,K=h??!!g,Q=Ml(w),J=(0,Ig.useMemo)(()=>yn(i),[i]),ee=Rl({data:r??rf,rawData:r,colorBy:S,colorScheme:R,legendInteraction:G,legendPosition:V,frameLegend:q,selection:$,linkedHover:D,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:_,onClick:F,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"FlowMap",chartId:O,showLegend:n.showLegend,userMargin:T,marginDefaults:Ds(n),loading:B,loadingContent:W,emptyContent:H,width:n.width,height:n.height,hasTitle:!!n.title}),te=ee.data,ne=Cs(D),re=(0,Tg.useLinkedHover)({name:ne?.name||"hover",fields:ne?.fields||[]}),ie=(0,zg.useObservationSelector)(e=>e.pushObservation),oe=(0,Ig.useMemo)(()=>{const e=/* @__PURE__ */new Map;for(const t of J)e.set(String(t[o]),t);return e},[J,o]),ae=(0,Ig.useRef)(null),se=(0,Ig.useRef)(oe);se.current=oe;const le=(0,Ig.useRef)(a);le.current=a;const ce=(0,Ig.useRef)(s);ce.current=s;const ue=(0,Ig.useCallback)(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;const t=se.current,n=t.get(String(e.source)),r=t.get(String(e.target));if(!n||!r)return null;const i="function"==typeof le.current?le.current:e=>e[le.current],o="function"==typeof ce.current?ce.current:e=>e[ce.current];return{...e,coordinates:[{[Dg]:i(n),[_g]:o(n)},{[Dg]:i(r),[_g]:o(r)}]}},[]);Ll(t,{variant:"geo-lines",frameRef:ae,overrides:{push:e=>{const t=ue(e);t&&ae.current?.pushLine(t)},pushMany:e=>{const t=[];for(const n of e){const e=ue(n);e&&t.push(e)}t.length>0&&ae.current?.pushManyLines(t)}}});const de=(0,Ig.useMemo)(()=>{const e=/* @__PURE__ */new Map;for(const t of te)t&&"object"==typeof t&&(null==t.source||e.has(t.source)||e.set(t.source,t),null==t.target||e.has(t.target)||e.set(t.target,t));return e},[te]),he=(0,Ig.useCallback)(e=>{if(D)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){const e=String(t[o]),n=de.get(e);n&&re.onHover(n)}else re.onHover(t)}else re.onHover(null);if(_||ie){const t={timestamp:Date.now(),chartType:"FlowMap",chartId:O};if(e){let n=e.data||e.datum||e;Array.isArray(n)&&(n=n[0]);const r={...t,type:"hover",datum:n||{},x:e.x??0,y:e.y??0};_&&_(r),ie&&ie(r)}else{const e={...t,type:"hover-end"};_&&_(e),ie&&ie(e)}}},[D,re,o,de,_,O,ie]),fe=ee.customClickBehavior,pe=(0,Ig.useMemo)(()=>{const e="function"==typeof a?a:e=>e[a],t="function"==typeof s?s:e=>e[s];return te.map(n=>{if(!n||"object"!=typeof n||null==n.source||null==n.target)return null;const r=oe.get(String(n.source)),i=oe.get(String(n.target));return r&&i?{...n,coordinates:[{[Dg]:e(r),[_g]:t(r)},{[Dg]:e(i),[_g]:t(i)}]}:null}).filter(Boolean)},[te,oe,a,s]),me=(0,Ig.useMemo)(()=>{const e="function"==typeof a?a:e=>e[a];return t=>null!=t&&"object"==typeof t&&Dg in t?t[Dg]:e(t)},[a]),ge=(0,Ig.useMemo)(()=>{const e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&_g in t?t[_g]:e(t)},[s]),ye=(0,Ig.useMemo)(()=>{const e=te.filter(e=>e&&"object"==typeof e).map(e=>Number(e[l]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return nn(e)},[te,l]),be=(0,Ig.useMemo)(()=>El({valueAccessor:l,valueDomain:ye,edgeWidthRange:j,resolveStroke:e=>S?It(e,S,ee.colorScale):Nh,edgeOpacity:M,edgeLinecap:C,styleRules:L}),[l,ye,j,S,ee.colorScale,M,C,L]),ve=(0,Ig.useMemo)(()=>{const e=sl(be,{stroke:Y,strokeWidth:U,opacity:X});if(!ee.effectiveSelectionHook)return e;const t={...ee.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return Rs(e,ee.effectiveSelectionHook,{...ee.resolvedSelection||{},unselectedStyle:t})},[be,ee.effectiveSelectionHook,ee.resolvedSelection,Y,U,X]),xe=A??("sparkline"===n.mode?1.5:5),we=(0,Ig.useMemo)(()=>sl(()=>({fill:"#333",r:xe,fillOpacity:.8}),{stroke:Y,strokeWidth:U,opacity:X}),[xe,Y,U,X]),ke=(0,Ig.useMemo)(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)/* @__PURE__ */ /* @__PURE__ */
224
- return(0,$g.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */ /* @__PURE__ */(0,$g.jsx)("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){const t=e[l];/* @__PURE__ */ /* @__PURE__ */
225
- return(0,$g.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
222
+ /* @__PURE__ */(0,Tg.jsxs)("span",{style:{opacity:.7},children:[e,": "]}),i(t)]},e))]})},[s,c]);if(V.earlyReturn)return V.earlyReturn;Sl("ProportionalSymbolMap",Y,"xAccessor",o),Sl("ProportionalSymbolMap",Y,"yAccessor",a);const K={projection:h,...null!=i&&{points:Y},xAccessor:o,yAccessor:a,pointStyle:X,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...G&&{areas:G,areaStyle:S},...null!=f&&{graticule:f},...null!=p&&{fitPadding:p},...q&&{zoomable:!0},...g&&{zoomExtent:g},...y&&{onZoom:y},...null!=v&&{dragRotate:v},...b&&{tileURL:b},...x&&{tileAttribution:x},...w&&{tileCacheSize:w},size:[r.width,r.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:V.margin,enableHover:r.enableHover,tooltipContent:!1===M?()=>null:ss(M)||Z,...V.legendBehaviorProps,...Pl({linkedHover:L,selection:R,onObservation:P,onClick:N,mobileInteraction:V.mobileInteraction,customHoverBehavior:V.customHoverBehavior,customClickBehavior:V.customClickBehavior,linkedHoverInClickPredicate:!1}),...j&&j.length>0&&{annotations:j},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...r.title&&{title:r.title},...r.description&&{description:r.description},...r.summary&&{summary:r.summary},...void 0!==r.accessibleTable&&{accessibleTable:r.accessibleTable},...C&&{className:C},...null!=e.animate&&{animate:e.animate},..._};/* @__PURE__ */ /* @__PURE__ */
223
+ return(0,Tg.jsx)(xl,{componentName:"ProportionalSymbolMap",width:r.width,height:r.height,children:/* @__PURE__ */ /* @__PURE__ */(0,Tg.jsx)(Zm,{ref:n,...K})})}),"ProportionalSymbolMap"),_g=require("react"),Fg=require("./semiotic-client-cjs-shared.min.js"),Og=require("./semiotic-client-cjs-shared.min.js"),Bg=require("react/jsx-runtime"),Wg="__semiotic_x",Hg="__semiotic_y",qg=/* @__PURE__ */Ls(/* @__PURE__ */ /* @__PURE__ */(0,_g.forwardRef)(function(e,t){const n=ll(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:r,nodes:i,nodeIdAccessor:o="id",xAccessor:a="lon",yAccessor:s="lat",valueAccessor:l="value",projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:h,zoomExtent:f,onZoom:p,dragRotate:m,tileURL:g,tileAttribution:y,tileCacheSize:v,lineType:b="geo",flowStyle:x="basic",areas:w,areaStyle:k=Ig,edgeColorBy:S,edgeOpacity:M=.6,edgeWidthRange:j=[1,8],pointRadius:A,edgeLinecap:C="round",colorScheme:R,styleRules:L,showParticles:P,particleStyle:N,tooltip:E,annotations:I,margin:T,className:z,selection:$,linkedHover:D,onObservation:_,onClick:F,chartId:O,loading:B,loadingContent:W,emptyContent:H,frameProps:q={},legendInteraction:G,legendPosition:V,stroke:Y,strokeWidth:U,opacity:X,lineIdAccessor:Z}=e,K=h??!!g,Q=Rl(w),J=(0,_g.useMemo)(()=>yn(i),[i]),ee=El({responsive:e,data:r??lf,rawData:r,colorBy:S,colorScheme:R,legendInteraction:G,legendPosition:V,frameLegend:q,selection:$,linkedHover:D,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:_,onClick:F,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"FlowMap",chartId:O,showLegend:n.showLegend,userMargin:T,marginDefaults:Os(n),loading:B,loadingContent:W,emptyContent:H,width:n.width,height:n.height,hasTitle:!!n.title}),te=ee.data,ne=Ps(D),re=(0,Fg.useLinkedHover)({name:ne?.name||"hover",fields:ne?.fields||[]}),ie=(0,Og.useObservationSelector)(e=>e.pushObservation),oe=(0,_g.useMemo)(()=>{const e=/* @__PURE__ */new Map;for(const t of J)e.set(String(t[o]),t);return e},[J,o]),ae=(0,_g.useRef)(null),se=(0,_g.useRef)(oe);se.current=oe;const le=(0,_g.useRef)(a);le.current=a;const ce=(0,_g.useRef)(s);ce.current=s;const ue=(0,_g.useCallback)(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;const t=se.current,n=t.get(String(e.source)),r=t.get(String(e.target));if(!n||!r)return null;const i="function"==typeof le.current?le.current:e=>e[le.current],o="function"==typeof ce.current?ce.current:e=>e[ce.current];return{...e,coordinates:[{[Wg]:i(n),[Hg]:o(n)},{[Wg]:i(r),[Hg]:o(r)}]}},[]);Il(t,{variant:"geo-lines",frameRef:ae,overrides:{push:e=>{const t=ue(e);t&&ae.current?.pushLine(t)},pushMany:e=>{const t=[];for(const n of e){const e=ue(n);e&&t.push(e)}t.length>0&&ae.current?.pushManyLines(t)}}});const de=(0,_g.useMemo)(()=>{const e=/* @__PURE__ */new Map;for(const t of te)t&&"object"==typeof t&&(null==t.source||e.has(t.source)||e.set(t.source,t),null==t.target||e.has(t.target)||e.set(t.target,t));return e},[te]),he=(0,_g.useCallback)(e=>{if(D)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){const e=String(t[o]),n=de.get(e);n&&re.onHover(n)}else re.onHover(t)}else re.onHover(null);if(_||ie){const t={timestamp:Date.now(),chartType:"FlowMap",chartId:O};if(e){let n=e.data||e.datum||e;Array.isArray(n)&&(n=n[0]);const r={...t,type:"hover",datum:n||{},x:e.x??0,y:e.y??0};_&&_(r),ie&&ie(r)}else{const e={...t,type:"hover-end"};_&&_(e),ie&&ie(e)}}},[D,re,o,de,_,O,ie]),fe=ee.customClickBehavior,pe=(0,_g.useMemo)(()=>{const e="function"==typeof a?a:e=>e[a],t="function"==typeof s?s:e=>e[s];return te.map(n=>{if(!n||"object"!=typeof n||null==n.source||null==n.target)return null;const r=oe.get(String(n.source)),i=oe.get(String(n.target));return r&&i?{...n,coordinates:[{[Wg]:e(r),[Hg]:t(r)},{[Wg]:e(i),[Hg]:t(i)}]}:null}).filter(Boolean)},[te,oe,a,s]),me=(0,_g.useMemo)(()=>{const e="function"==typeof a?a:e=>e[a];return t=>null!=t&&"object"==typeof t&&Wg in t?t[Wg]:e(t)},[a]),ge=(0,_g.useMemo)(()=>{const e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&Hg in t?t[Hg]:e(t)},[s]),ye=(0,_g.useMemo)(()=>{const e=te.filter(e=>e&&"object"==typeof e).map(e=>Number(e[l]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return nn(e)},[te,l]),ve=(0,_g.useMemo)(()=>$l({valueAccessor:l,valueDomain:ye,edgeWidthRange:j,resolveStroke:e=>S?It(e,S,ee.colorScale):zh,edgeOpacity:M,edgeLinecap:C,styleRules:L}),[l,ye,j,S,ee.colorScale,M,C,L]),be=(0,_g.useMemo)(()=>{const e=ul(ve,{stroke:Y,strokeWidth:U,opacity:X});if(!ee.effectiveSelectionHook)return e;const t={...ee.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return Ns(e,ee.effectiveSelectionHook,{...ee.resolvedSelection||{},unselectedStyle:t})},[ve,ee.effectiveSelectionHook,ee.resolvedSelection,Y,U,X]),xe=A??("sparkline"===n.mode?1.5:5),we=(0,_g.useMemo)(()=>ul(()=>({fill:"#333",r:xe,fillOpacity:.8}),{stroke:Y,strokeWidth:U,opacity:X}),[xe,Y,U,X]),ke=(0,_g.useMemo)(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)/* @__PURE__ */ /* @__PURE__ */
224
+ return(0,Bg.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */ /* @__PURE__ */(0,Bg.jsx)("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){const t=e[l];/* @__PURE__ */ /* @__PURE__ */
225
+ return(0,Bg.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
226
226
  /* @__PURE__ */
227
- /* @__PURE__ */(0,$g.jsxs)("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&/* @__PURE__ */ /* @__PURE__ */(0,$g.jsx)("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}const t=e?.name||e?.label||e?.[o];return null!=t?/* @__PURE__ */ /* @__PURE__ */(0,$g.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */ /* @__PURE__ */(0,$g.jsx)("div",{style:{fontWeight:600},children:t})}):null},[l,o]);if(ee.earlyReturn)return ee.earlyReturn;const Se={projection:c,...null!=r&&{lines:pe},points:J,xAccessor:me,yAccessor:ge,lineDataAccessor:"coordinates",...null!=Z&&{lineIdAccessor:Z},lineType:v,flowStyle:x,lineStyle:ve,pointStyle:we,...Q&&{areas:Q,areaStyle:k},...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...K&&{zoomable:!0},...f&&{zoomExtent:f},...p&&{onZoom:p},...null!=m&&{dragRotate:m},...P&&{showParticles:P},...N&&{particleStyle:N},...g&&{tileURL:g},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},size:[n.width,n.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ee.margin,enableHover:n.enableHover,tooltipContent:!1===E?()=>null:is(E)||ke,...ee.legendBehaviorProps,...Al({linkedHover:D,selection:$,onObservation:_,onClick:F,mobileInteraction:ee.mobileInteraction,customHoverBehavior:he,customClickBehavior:fe,linkedHoverInClickPredicate:!1}),...I&&I.length>0&&{annotations:I},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...n.title&&{title:n.title},...n.description&&{description:n.description},...n.summary&&{summary:n.summary},...void 0!==n.accessibleTable&&{accessibleTable:n.accessibleTable},...z&&{className:z},...null!=e.animate&&{animate:e.animate},...q};/* @__PURE__ */ /* @__PURE__ */
228
- return(0,$g.jsx)(gl,{componentName:"FlowMap",width:n.width,height:n.height,children:/* @__PURE__ */ /* @__PURE__ */(0,$g.jsx)(Gm,{ref:ae,...Se})})}),"FlowMap"),Og=require("react"),Bg=require("react/jsx-runtime"),Wg=require("react/jsx-runtime"),Hg=/* @__PURE__ */As(/* @__PURE__ */ /* @__PURE__ */(0,Og.forwardRef)(function(e,t){const n=ol(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:r,lines:i,xAccessor:o="lon",yAccessor:a="lat",nodeIdAccessor:s="id",center:l,costAccessor:c,strength:u=1,lineMode:d="straight",projection:h="mercator",graticule:f,fitPadding:p,zoomable:m,zoomExtent:g,onZoom:y,dragRotate:b,tileURL:v,tileAttribution:x,tileCacheSize:w,transition:k,colorBy:S,styleRules:M,colorScheme:j,pointRadius:A,tooltip:C,showRings:R,showRingLabels:L,ringStyle:P,showNorth:N,costLabel:E,cartogramLayout:I,annotations:T,margin:z,className:$,selection:D,linkedHover:_,onObservation:F,onClick:O,chartId:B,loading:W,loadingContent:H,emptyContent:q,legendPosition:G,frameProps:V={},stroke:Y,strokeWidth:U,opacity:X}=e,Z="sparkline"===n.mode,K=I??(Z?"strip":"radial"),Q=A??(Z?1.5:5),J=R??!0,ee=L??("strip"!==K&&!n.compactMode),te=N??("strip"!==K&&!Z),ne=m??!!v,re=(0,Og.useMemo)(()=>yn(r),[r]),ie=Rl({data:re,rawData:r,colorBy:S,colorScheme:j,legendInteraction:void 0,legendPosition:G,frameLegend:V,selection:D,linkedHover:_,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:F,onClick:O,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DistanceCartogram",chartId:B,showLegend:n.showLegend,userMargin:z,marginDefaults:Ds(n),loading:W,loadingContent:H,emptyContent:q,width:n.width,height:n.height,hasTitle:!!n.title}),oe=(0,Og.useMemo)(()=>{const e=sl(pl(e=>{const t=e?.[s],n=null!=t&&String(t)===String(l);return{fill:S?It(e,S,ie.colorScale):Nh,fillOpacity:n?1:.8,stroke:n?"var(--semiotic-text, #222)":"#fff",strokeWidth:n?1.25:1,r:n?1.35*Q:Q}},M,cl(S)),{stroke:Y,strokeWidth:U,opacity:X});return ie.effectiveSelectionHook?Rs(e,ie.effectiveSelectionHook,ie.resolvedSelection):e},[S,ie.colorScale,ie.effectiveSelectionHook,ie.resolvedSelection,Q,Y,U,X,M,l,s]),ae=(0,Og.useMemo)(()=>({center:l,centerAccessor:s,costAccessor:c,strength:u,lineMode:d,layout:K}),[l,s,c,u,d,K]),se=(0,Og.useMemo)(()=>{if(!i)return;const e="function"==typeof o?o:e=>e[o],t="function"==typeof a?a:e=>e[a],n=/* @__PURE__ */new Map;for(const e of re)n.set(String(e[s]),e);return i.map(r=>{if(r.coordinates)return r;const i=n.get(String(r.source)),s=n.get(String(r.target));return i&&s?{...r,coordinates:[{[o]:e(i),[a]:t(i)},{[o]:e(s),[a]:t(s)}]}:null}).filter(Boolean)},[i,re,o,a,s]),le=(0,Og.useMemo)(()=>e=>{const t=("function"==typeof c?c:e=>e[c])(e),n=e[s]||e.name||e.id||"Point";/* @__PURE__ */ /* @__PURE__ */
229
- return(0,Wg.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
227
+ /* @__PURE__ */(0,Bg.jsxs)("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&/* @__PURE__ */ /* @__PURE__ */(0,Bg.jsx)("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}const t=e?.name||e?.label||e?.[o];return null!=t?/* @__PURE__ */ /* @__PURE__ */(0,Bg.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */ /* @__PURE__ */(0,Bg.jsx)("div",{style:{fontWeight:600},children:t})}):null},[l,o]);if(ee.earlyReturn)return ee.earlyReturn;const Se={projection:c,...null!=r&&{lines:pe},points:J,xAccessor:me,yAccessor:ge,lineDataAccessor:"coordinates",...null!=Z&&{lineIdAccessor:Z},lineType:b,flowStyle:x,lineStyle:be,pointStyle:we,...Q&&{areas:Q,areaStyle:k},...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...K&&{zoomable:!0},...f&&{zoomExtent:f},...p&&{onZoom:p},...null!=m&&{dragRotate:m},...P&&{showParticles:P},...N&&{particleStyle:N},...g&&{tileURL:g},...y&&{tileAttribution:y},...v&&{tileCacheSize:v},size:[n.width,n.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ee.margin,enableHover:n.enableHover,tooltipContent:!1===E?()=>null:ss(E)||ke,...ee.legendBehaviorProps,...Pl({linkedHover:D,selection:$,onObservation:_,onClick:F,mobileInteraction:ee.mobileInteraction,customHoverBehavior:he,customClickBehavior:fe,linkedHoverInClickPredicate:!1}),...I&&I.length>0&&{annotations:I},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...n.title&&{title:n.title},...n.description&&{description:n.description},...n.summary&&{summary:n.summary},...void 0!==n.accessibleTable&&{accessibleTable:n.accessibleTable},...z&&{className:z},...null!=e.animate&&{animate:e.animate},...q};/* @__PURE__ */ /* @__PURE__ */
228
+ return(0,Bg.jsx)(xl,{componentName:"FlowMap",width:n.width,height:n.height,children:/* @__PURE__ */ /* @__PURE__ */(0,Bg.jsx)(Zm,{ref:ae,...Se})})}),"FlowMap"),Gg=require("react"),Vg=require("react/jsx-runtime"),Yg=require("react/jsx-runtime"),Ug=/* @__PURE__ */Ls(/* @__PURE__ */ /* @__PURE__ */(0,Gg.forwardRef)(function(e,t){const n=ll(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:r,lines:i,xAccessor:o="lon",yAccessor:a="lat",nodeIdAccessor:s="id",center:l,costAccessor:c,strength:u=1,lineMode:d="straight",projection:h="mercator",graticule:f,fitPadding:p,zoomable:m,zoomExtent:g,onZoom:y,dragRotate:v,tileURL:b,tileAttribution:x,tileCacheSize:w,transition:k,colorBy:S,styleRules:M,colorScheme:j,pointRadius:A,tooltip:C,showRings:R,showRingLabels:L,ringStyle:P,showNorth:N,costLabel:E,cartogramLayout:I,annotations:T,margin:z,className:$,selection:D,linkedHover:_,onObservation:F,onClick:O,chartId:B,loading:W,loadingContent:H,emptyContent:q,legendPosition:G,frameProps:V={},stroke:Y,strokeWidth:U,opacity:X}=e,Z="sparkline"===n.mode,K=I??(Z?"strip":"radial"),Q=A??(Z?1.5:5),J=R??!0,ee=L??("strip"!==K&&!n.compactMode),te=N??("strip"!==K&&!Z),ne=m??!!b,re=(0,Gg.useMemo)(()=>yn(r),[r]),ie=El({responsive:e,data:re,rawData:r,colorBy:S,colorScheme:j,legendInteraction:void 0,legendPosition:G,frameLegend:V,selection:D,linkedHover:_,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:F,onClick:O,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DistanceCartogram",chartId:B,showLegend:n.showLegend,userMargin:z,marginDefaults:Os(n),loading:W,loadingContent:H,emptyContent:q,width:n.width,height:n.height,hasTitle:!!n.title}),oe=(0,Gg.useMemo)(()=>{const e=ul(yl(e=>{const t=e?.[s],n=null!=t&&String(t)===String(l);return{fill:S?It(e,S,ie.colorScale):zh,fillOpacity:n?1:.8,stroke:n?"var(--semiotic-text, #222)":"#fff",strokeWidth:n?1.25:1,r:n?1.35*Q:Q}},M,hl(S)),{stroke:Y,strokeWidth:U,opacity:X});return ie.effectiveSelectionHook?Ns(e,ie.effectiveSelectionHook,ie.resolvedSelection):e},[S,ie.colorScale,ie.effectiveSelectionHook,ie.resolvedSelection,Q,Y,U,X,M,l,s]),ae=(0,Gg.useMemo)(()=>({center:l,centerAccessor:s,costAccessor:c,strength:u,lineMode:d,layout:K}),[l,s,c,u,d,K]),se=(0,Gg.useMemo)(()=>{if(!i)return;const e="function"==typeof o?o:e=>e[o],t="function"==typeof a?a:e=>e[a],n=/* @__PURE__ */new Map;for(const e of re)n.set(String(e[s]),e);return i.map(r=>{if(r.coordinates)return r;const i=n.get(String(r.source)),s=n.get(String(r.target));return i&&s?{...r,coordinates:[{[o]:e(i),[a]:t(i)},{[o]:e(s),[a]:t(s)}]}:null}).filter(Boolean)},[i,re,o,a,s]),le=(0,Gg.useMemo)(()=>e=>{const t=("function"==typeof c?c:e=>e[c])(e),n=e[s]||e.name||e.id||"Point";/* @__PURE__ */ /* @__PURE__ */
229
+ return(0,Yg.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
230
230
  /* @__PURE__ */
231
- /* @__PURE__ */(0,Wg.jsx)("div",{style:{fontWeight:600},children:n}),null!=t&&/* @__PURE__ */ /* @__PURE__ */(0,Wg.jsxs)("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[c,s]),ce=(0,Og.useRef)(null);Ll(t,{variant:"geo-points",frameRef:ce});const[ue,de]=(0,Og.useState)(null),he=(0,Og.useCallback)(()=>{const e=ce.current?.getCartogramLayout?.();e&&de(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius&&t.layout===(e.layout??"radial")?t:{cx:e.cx,cy:e.cy,maxCost:e.maxCost,availableRadius:e.availableRadius,layout:e.layout??"radial"})},[]);(0,Og.useEffect)(()=>{const e=requestAnimationFrame(he);return()=>cancelAnimationFrame(e)},[he,u,l,n.width,n.height,re,K]);const fe=(0,Og.useMemo)(()=>{if(!J||!ue)return[];const{maxCost:e}=ue;if(e<=0)return[];if(Array.isArray(J))return J.filter(t=>t>0&&t<=e);const t="strip"===ue.layout?3:5,n="number"==typeof J?J:Math.min(t,Math.max(2,Math.ceil(e/5))),r=e/n,i=[];for(let e=1;e<=n;e++)i.push(Math.round(r*e*10)/10);return i},[J,ue]),pe=(0,Og.useMemo)(()=>{if(!ue)return V.foregroundGraphics||null;const e=/* @__PURE__ */ /* @__PURE__ */(0,Wg.jsx)(Il,{bottomMargin:ie.margin.bottom,costLabel:E,layout:ue,ringStyle:P,ringValues:fe,showNorth:te,showRingLabels:ee,showRings:J}),t=V.foregroundGraphics;return"function"==typeof t?n=>/* @__PURE__ */ /* @__PURE__ */(0,Wg.jsxs)(Wg.Fragment,{children:[e,t(n)]}):/* @__PURE__ */ /* @__PURE__ */(0,Wg.jsxs)(Wg.Fragment,{children:[e,t]})},[ue,fe,J,ee,te,E,P,ie.margin.bottom,V.foregroundGraphics]);if(ie.earlyReturn)return ie.earlyReturn;vl("DistanceCartogram",re,"xAccessor",o),vl("DistanceCartogram",re,"yAccessor",a);const me={projection:h,...null!=r&&{points:re},...se&&{lines:se,lineDataAccessor:"coordinates"},xAccessor:o,yAccessor:a,pointIdAccessor:s,pointStyle:oe,projectionTransform:ae,...k&&{transition:{duration:k}},...null!=f&&{graticule:f},...null!=p&&{fitPadding:p},...ne&&{zoomable:!0},...g&&{zoomExtent:g},...y&&{onZoom:y},...null!=b&&{dragRotate:b},...v&&{tileURL:v},...x&&{tileAttribution:x},...w&&{tileCacheSize:w},size:[n.width,n.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ie.margin,enableHover:n.enableHover,tooltipContent:!1===C?()=>null:is(C)||le,...ie.legendBehaviorProps,...Al({linkedHover:_,selection:D,onObservation:F,onClick:O,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior,linkedHoverInClickPredicate:!1}),...T&&T.length>0&&{annotations:T},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...n.title&&{title:n.title},...n.description&&{description:n.description},...n.summary&&{summary:n.summary},...void 0!==n.accessibleTable&&{accessibleTable:n.accessibleTable},...$&&{className:$},...null!=e.animate&&{animate:e.animate},...V,foregroundGraphics:pe};/* @__PURE__ */ /* @__PURE__ */
232
- return(0,Wg.jsx)(gl,{componentName:"DistanceCartogram",width:n.width,height:n.height,children:/* @__PURE__ */ /* @__PURE__ */(0,Wg.jsx)(Gm,{ref:ce,...me})})}),"DistanceCartogram"),qg=require("react"),Gg=require("react"),Vg=require("react/jsx-runtime"),Yg=/* @__PURE__ */As(/* @__PURE__ */ /* @__PURE__ */(0,qg.forwardRef)(function(e,t){const{points:n,areas:r,lines:i,layout:o,layoutConfig:a,onLayoutError:s,projection:l="equirectangular",xAccessor:c="lon",yAccessor:u="lat",lineDataAccessor:d,colorBy:h,colorScheme:f,tooltip:p,annotations:m,margin:g,selection:y,linkedHover:b,onObservation:v,onClick:x,chartId:w,loading:k,loadingContent:S,emptyContent:M,className:j,frameProps:A={}}=e,{frameRef:C,resolved:R,normalizedMargin:L}=zl({imperativeRef:t,imperativeVariant:"geo-points",margin:g,width:e.width,height:e.height,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),P=(0,qg.useMemo)(()=>yn(n),[n]),N=(0,qg.useMemo)(()=>yn(r),[r]),E=(0,qg.useMemo)(()=>yn(i),[i]),I=(0,qg.useMemo)(()=>[...P,...E,...N],[P,E,N]),T=Rl({data:I,rawData:void 0!==n||void 0!==i||void 0!==r?I:void 0,colorBy:h,colorScheme:f,legendInteraction:void 0,selection:y,linkedHover:b,fallbackFields:"string"==typeof h?[h]:[],unwrapData:!1,onObservation:v,onClick:x,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:"GeoCustomChart",chartId:w,showLegend:!1,userMargin:L,marginDefaults:R.marginDefaults,loading:k,loadingContent:S,emptyContent:M,width:R.width,height:R.height,hasTitle:!!R.title}),z=T.effectiveSelectionHook,$=(0,qg.useMemo)(()=>z?.isActive?{isActive:!0,predicate:z.predicate}:null,[z?.isActive,z?.predicate]);if(T.earlyReturn)return T.earlyReturn;const{width:D,height:_,enableHover:F,title:O,description:B,summary:W,accessibleTable:H}=R,q=is(p),G={projection:l,...null!=n&&{points:P},...null!=r&&{areas:N},...null!=i&&{lines:E},xAccessor:c,yAccessor:u,...null!=d&&{lineDataAccessor:d},customLayout:o,layoutConfig:a,onLayoutError:s,layoutSelection:$,colorBy:h,colorScheme:f,size:[D,_],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:T.margin,enableHover:F,...jl({title:O,description:B,summary:W,accessibleTable:H,className:j,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===p?{tooltipContent:()=>null}:q?{tooltipContent:q}:{},...Al({linkedHover:b,selection:y,onObservation:v,onClick:x,hoverHighlight:!1,mobileInteraction:T.mobileInteraction,customHoverBehavior:T.customHoverBehavior,customClickBehavior:T.customClickBehavior,linkedHoverInClickPredicate:!1}),...m&&m.length>0&&{annotations:m},...A};/* @__PURE__ */ /* @__PURE__ */
233
- return(0,Vg.jsx)(gl,{componentName:"GeoCustomChart",width:D,height:_,children:/* @__PURE__ */ /* @__PURE__ */(0,Vg.jsx)(Gm,{ref:C,...G})})}),"GeoCustomChart"),Ug={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},Xg=8,Zg=require("./semiotic-custom-layout-selection-cjs-shared.min.js"),Kg=require("react/jsx-runtime"),Qg=.72,Jg=1.8,ey=e=>{const t=e.config,n=t.source??"auto",r="areas"===n||"auto"===n&&e.areas.length>0,i=(r?Ul(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,n)=>!t.filter||t.filter(e.datum,n)),o=Zl(i.map(e=>e.datum),t),a=r?i:Xl({...e,points:i.map(e=>e.datum)}),s=o??Hl(a,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===s.length)return{nodes:[]};const l=Bl(s.map(e=>e.row)),c=Bl(s.map(e=>e.column)),u=Math.max(1,Math.round(l[1]-l[0])+1),d=Math.max(1,Math.round(c[1]-c[0])+1),h=Math.max(0,t.layoutPadding??8),f=Math.max(1,e.dimensions.width-2*h),p=Math.max(1,e.dimensions.height-2*h),m=f/d,g=p/u,y=m*d,b=g*u,v=(e.dimensions.width-y)/2,x=(e.dimensions.height-b)/2,w=zi(t.cellPadding??.12,0,.8),k=Math.max(1,.5*Math.min(m,g)*(1-w)),S=t.sizeAccessor?s.map(e=>Number(ql(e.datum,t.sizeAccessor))):[],M=t.sizeDomain??Bl(S),j=t.sizeRange??[.36,1],A=zi(Math.min(j[0],j[1]),.05,1),C=zi(Math.max(j[0],j[1]),A,1),R=s.map((n,r)=>{const i={...n.datum,gridRow:n.row,gridColumn:n.column},o=String(ql(i,t.idAccessor,["id","key","name"])??`grid-${r}`),a=String(ql(i,t.labelAccessor,["abbr","code","label","name","id"])??o),s=Math.max(1,t.maxLabelLength??4),u=a.length>s?a.slice(0,s):a,d=ql(i,t.categoryAccessor),h=null==d?void 0:String(d),f=ql(i,t.fillAccessor),p=null!=f?String(f):h?e.resolveColor(h):e.theme.categorical[0]??"#4f86c6",y=t.sizeAccessor?Number(ql(i,t.sizeAccessor)):NaN,b=t.sizeAccessor&&Number.isFinite(y)?Math.sqrt(zi(Wl(y,M),0,1)):1,w=k*(A+b*(C-A)),S="function"==typeof t.markStyle?t.markStyle(i,r):t.markStyle;return{datum:i,id:o,label:u,category:h,row:n.row,column:n.column,x:v+(n.column-c[0]+.5)*m,y:x+(n.row-l[0]+.5)*g,radius:w,style:{fill:p,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...S}}}),L=t.shape??"circle";return{nodes:R.map(e=>{return"circle"===L?{type:"point",x:e.x,y:e.y,r:e.radius,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},pointId:e.id,_transitionKey:e.id}:{type:"geoarea",pathData:"hexagon"===L?Yl(e.x,e.y,e.radius):(t=e.x,n=e.y,r=e.radius,Vl([[t-r,n-r],[t+r,n-r],[t+r,n+r],[t-r,n+r]])),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===L?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0};var t,n,r}),overlays:!1===t.showLabels?null:/* @__PURE__ */ /* @__PURE__ */(0,Kg.jsx)(Kl,{marks:R,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??zi(.23*Math.min(m,g),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}},ty=require("react/jsx-runtime"),ny=10,ry=25e3,iy=/* @__PURE__ */new WeakMap,oy=/* @__PURE__ */new WeakMap,ay=/* @__PURE__ */new WeakMap,sy=1,ly=e=>{const t=mc(e),n=e.config,r=n.shape??"circle",i=Math.max(.5,Ql(n.dotRadius)??t.cellSize*zi(n.radiusRatio??.24,.05,.5)),o=n.gridOrigin?.[0]??0,a=n.gridOrigin?.[1]??0;return{nodes:t.dots.map((s,l)=>{const c=o+(s.gridColumn+.5)*t.cellSize,u=a+(s.gridRow+.5)*t.cellSize,d=Jl(s,n.categoryAccessor),h=Jl(s,n.fillAccessor),f={fill:null!=h?String(h):null!=d?e.resolveColor(String(d)):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof n.markStyle?n.markStyle(s,l):n.markStyle},p=`dot-${s.gridRow}-${s.gridColumn}`;return"circle"===r?{type:"point",x:c,y:u,r:i,style:f,datum:s,interactive:!1,pointId:p,_transitionKey:p}:{type:"geoarea",pathData:"hexagon"===r?bc(c,u,i):yc(c,u,i),centroid:[c,u],bounds:[[c-i,u-i],[c+i,u+i]],screenArea:"hexagon"===r?3*Math.sqrt(3)*i*i/2:(2*i)**2,style:f,datum:s,group:s.featureId,interactive:!1}}),overlays:n.showOutline?/* @__PURE__ */ /* @__PURE__ */(0,ty.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,r)=>{const i=e.scales.geoPath(t);return i?/* @__PURE__ */ /* @__PURE__ */(0,ty.jsx)("path",{d:i,fill:"none",stroke:n.outlineStyle?.stroke??"currentColor",strokeOpacity:n.outlineStyle?.opacity??n.outlineStyle?.fillOpacity??.22,strokeWidth:n.outlineStyle?.strokeWidth??.7,strokeDasharray:n.outlineStyle?.strokeDasharray,strokeLinecap:n.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},tc(t,r)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};
231
+ /* @__PURE__ */(0,Yg.jsx)("div",{style:{fontWeight:600},children:n}),null!=t&&/* @__PURE__ */ /* @__PURE__ */(0,Yg.jsxs)("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[c,s]),ce=(0,Gg.useRef)(null);Il(t,{variant:"geo-points",frameRef:ce});const[ue,de]=(0,Gg.useState)(null),he=(0,Gg.useCallback)(()=>{const e=ce.current?.getCartogramLayout?.();e&&de(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius&&t.layout===(e.layout??"radial")?t:{cx:e.cx,cy:e.cy,maxCost:e.maxCost,availableRadius:e.availableRadius,layout:e.layout??"radial"})},[]);(0,Gg.useEffect)(()=>{const e=requestAnimationFrame(he);return()=>cancelAnimationFrame(e)},[he,u,l,n.width,n.height,re,K]);const fe=(0,Gg.useMemo)(()=>{if(!J||!ue)return[];const{maxCost:e}=ue;if(e<=0)return[];if(Array.isArray(J))return J.filter(t=>t>0&&t<=e);const t="strip"===ue.layout?3:5,n="number"==typeof J?J:Math.min(t,Math.max(2,Math.ceil(e/5))),r=e/n,i=[];for(let e=1;e<=n;e++)i.push(Math.round(r*e*10)/10);return i},[J,ue]),pe=(0,Gg.useMemo)(()=>{if(!ue)return V.foregroundGraphics||null;const e=/* @__PURE__ */ /* @__PURE__ */(0,Yg.jsx)(Dl,{bottomMargin:ie.margin.bottom,costLabel:E,layout:ue,ringStyle:P,ringValues:fe,showNorth:te,showRingLabels:ee,showRings:J}),t=V.foregroundGraphics;return"function"==typeof t?n=>/* @__PURE__ */ /* @__PURE__ */(0,Yg.jsxs)(Yg.Fragment,{children:[e,t(n)]}):/* @__PURE__ */ /* @__PURE__ */(0,Yg.jsxs)(Yg.Fragment,{children:[e,t]})},[ue,fe,J,ee,te,E,P,ie.margin.bottom,V.foregroundGraphics]);if(ie.earlyReturn)return ie.earlyReturn;Sl("DistanceCartogram",re,"xAccessor",o),Sl("DistanceCartogram",re,"yAccessor",a);const me={projection:h,...null!=r&&{points:re},...se&&{lines:se,lineDataAccessor:"coordinates"},xAccessor:o,yAccessor:a,pointIdAccessor:s,pointStyle:oe,projectionTransform:ae,...k&&{transition:{duration:k}},...null!=f&&{graticule:f},...null!=p&&{fitPadding:p},...ne&&{zoomable:!0},...g&&{zoomExtent:g},...y&&{onZoom:y},...null!=v&&{dragRotate:v},...b&&{tileURL:b},...x&&{tileAttribution:x},...w&&{tileCacheSize:w},size:[n.width,n.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ie.margin,enableHover:n.enableHover,tooltipContent:!1===C?()=>null:ss(C)||le,...ie.legendBehaviorProps,...Pl({linkedHover:_,selection:D,onObservation:F,onClick:O,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior,linkedHoverInClickPredicate:!1}),...T&&T.length>0&&{annotations:T},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...n.title&&{title:n.title},...n.description&&{description:n.description},...n.summary&&{summary:n.summary},...void 0!==n.accessibleTable&&{accessibleTable:n.accessibleTable},...$&&{className:$},...null!=e.animate&&{animate:e.animate},...V,foregroundGraphics:pe};/* @__PURE__ */ /* @__PURE__ */
232
+ return(0,Yg.jsx)(xl,{componentName:"DistanceCartogram",width:n.width,height:n.height,children:/* @__PURE__ */ /* @__PURE__ */(0,Yg.jsx)(Zm,{ref:ce,...me})})}),"DistanceCartogram"),Xg=require("react"),Zg=require("react"),Kg=require("react/jsx-runtime"),Qg=/* @__PURE__ */Ls(/* @__PURE__ */ /* @__PURE__ */(0,Xg.forwardRef)(function(e,t){const{points:n,areas:r,lines:i,layout:o,layoutConfig:a,onLayoutError:s,projection:l="equirectangular",xAccessor:c="lon",yAccessor:u="lat",lineDataAccessor:d,colorBy:h,colorScheme:f,tooltip:p,annotations:m,margin:g,selection:y,linkedHover:v,onObservation:b,onClick:x,chartId:w,loading:k,loadingContent:S,emptyContent:M,className:j,frameProps:A={}}=e,{frameRef:C,resolved:R,normalizedMargin:L}=Fl({responsive:e,imperativeRef:t,imperativeVariant:"geo-points",margin:g,width:e.width,height:e.height,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),P=(0,Xg.useMemo)(()=>yn(n),[n]),N=(0,Xg.useMemo)(()=>yn(r),[r]),E=(0,Xg.useMemo)(()=>yn(i),[i]),I=(0,Xg.useMemo)(()=>[...P,...E,...N],[P,E,N]),T=El({responsive:e,data:I,rawData:void 0!==n||void 0!==i||void 0!==r?I:void 0,colorBy:h,colorScheme:f,legendInteraction:void 0,selection:y,linkedHover:v,fallbackFields:"string"==typeof h?[h]:[],unwrapData:!1,onObservation:b,onClick:x,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:"GeoCustomChart",chartId:w,showLegend:!1,userMargin:L,marginDefaults:R.marginDefaults,loading:k,loadingContent:S,emptyContent:M,width:R.width,height:R.height,hasTitle:!!R.title}),z=T.effectiveSelectionHook,$=(0,Xg.useMemo)(()=>z?.isActive?{isActive:!0,predicate:z.predicate}:null,[z?.isActive,z?.predicate]);if(T.earlyReturn)return T.earlyReturn;const{width:D,height:_,enableHover:F,title:O,description:B,summary:W,accessibleTable:H}=R,q=ss(p),G={projection:l,...null!=n&&{points:P},...null!=r&&{areas:N},...null!=i&&{lines:E},xAccessor:c,yAccessor:u,...null!=d&&{lineDataAccessor:d},customLayout:o,layoutConfig:a,onLayoutError:s,layoutSelection:$,colorBy:h,colorScheme:f,size:[D,_],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:T.margin,enableHover:F,...Ll({title:O,description:B,summary:W,accessibleTable:H,className:j,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===p?{tooltipContent:()=>null}:q?{tooltipContent:q}:{},...Pl({linkedHover:v,selection:y,onObservation:b,onClick:x,hoverHighlight:!1,mobileInteraction:T.mobileInteraction,customHoverBehavior:T.customHoverBehavior,customClickBehavior:T.customClickBehavior,linkedHoverInClickPredicate:!1}),...m&&m.length>0&&{annotations:m},...A};/* @__PURE__ */ /* @__PURE__ */
233
+ return(0,Kg.jsx)(xl,{componentName:"GeoCustomChart",width:D,height:_,children:/* @__PURE__ */ /* @__PURE__ */(0,Kg.jsx)(Zm,{ref:C,...G})})}),"GeoCustomChart"),Jg={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},ey=8,ty=require("./semiotic-custom-layout-selection-cjs-shared.min.js"),ny=require("react/jsx-runtime"),ry=.72,iy=1.8,oy=e=>{const t=e.config,n=t.source??"auto",r="areas"===n||"auto"===n&&e.areas.length>0,i=(r?Ql(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,n)=>!t.filter||t.filter(e.datum,n)),o=ec(i.map(e=>e.datum),t),a=r?i:Jl({...e,points:i.map(e=>e.datum)}),s=o??Yl(a,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===s.length)return{nodes:[]};const l=Gl(s.map(e=>e.row)),c=Gl(s.map(e=>e.column)),u=Math.max(1,Math.round(l[1]-l[0])+1),d=Math.max(1,Math.round(c[1]-c[0])+1),h=Math.max(0,t.layoutPadding??8),f=Math.max(1,e.dimensions.width-2*h),p=Math.max(1,e.dimensions.height-2*h),m=f/d,g=p/u,y=m*d,v=g*u,b=(e.dimensions.width-y)/2,x=(e.dimensions.height-v)/2,w=zi(t.cellPadding??.12,0,.8),k=Math.max(1,.5*Math.min(m,g)*(1-w)),S=t.sizeAccessor?s.map(e=>Number(Ul(e.datum,t.sizeAccessor))):[],M=t.sizeDomain??Gl(S),j=t.sizeRange??[.36,1],A=zi(Math.min(j[0],j[1]),.05,1),C=zi(Math.max(j[0],j[1]),A,1),R=s.map((n,r)=>{const i={...n.datum,gridRow:n.row,gridColumn:n.column},o=String(Ul(i,t.idAccessor,["id","key","name"])??`grid-${r}`),a=String(Ul(i,t.labelAccessor,["abbr","code","label","name","id"])??o),s=Math.max(1,t.maxLabelLength??4),u=a.length>s?a.slice(0,s):a,d=Ul(i,t.categoryAccessor),h=null==d?void 0:String(d),f=Ul(i,t.fillAccessor),p=null!=f?String(f):h?e.resolveColor(h):e.theme.categorical[0]??"#4f86c6",y=t.sizeAccessor?Number(Ul(i,t.sizeAccessor)):NaN,v=t.sizeAccessor&&Number.isFinite(y)?Math.sqrt(zi(Vl(y,M),0,1)):1,w=k*(A+v*(C-A)),S="function"==typeof t.markStyle?t.markStyle(i,r):t.markStyle;return{datum:i,id:o,label:u,category:h,row:n.row,column:n.column,x:b+(n.column-c[0]+.5)*m,y:x+(n.row-l[0]+.5)*g,radius:w,style:{fill:p,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...S}}}),L=t.shape??"circle";return{nodes:R.map(e=>{return"circle"===L?{type:"point",x:e.x,y:e.y,r:e.radius,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},pointId:e.id,_transitionKey:e.id}:{type:"geoarea",pathData:"hexagon"===L?Kl(e.x,e.y,e.radius):(t=e.x,n=e.y,r=e.radius,Zl([[t-r,n-r],[t+r,n-r],[t+r,n+r],[t-r,n+r]])),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===L?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0};var t,n,r}),overlays:!1===t.showLabels?null:/* @__PURE__ */ /* @__PURE__ */(0,ny.jsx)(tc,{marks:R,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??zi(.23*Math.min(m,g),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}},ay=require("react/jsx-runtime"),sy=10,ly=25e3,cy=/* @__PURE__ */new WeakMap,uy=/* @__PURE__ */new WeakMap,dy=/* @__PURE__ */new WeakMap,hy=1,fy=e=>{const t=bc(e),n=e.config,r=n.shape??"circle",i=Math.max(.5,nc(n.dotRadius)??t.cellSize*zi(n.radiusRatio??.24,.05,.5)),o=n.gridOrigin?.[0]??0,a=n.gridOrigin?.[1]??0;return{nodes:t.dots.map((s,l)=>{const c=o+(s.gridColumn+.5)*t.cellSize,u=a+(s.gridRow+.5)*t.cellSize,d=rc(s,n.categoryAccessor),h=rc(s,n.fillAccessor),f={fill:null!=h?String(h):null!=d?e.resolveColor(String(d)):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof n.markStyle?n.markStyle(s,l):n.markStyle},p=`dot-${s.gridRow}-${s.gridColumn}`;return"circle"===r?{type:"point",x:c,y:u,r:i,style:f,datum:s,interactive:!1,pointId:p,_transitionKey:p}:{type:"geoarea",pathData:"hexagon"===r?kc(c,u,i):wc(c,u,i),centroid:[c,u],bounds:[[c-i,u-i],[c+i,u+i]],screenArea:"hexagon"===r?3*Math.sqrt(3)*i*i/2:(2*i)**2,style:f,datum:s,group:s.featureId,interactive:!1}}),overlays:n.showOutline?/* @__PURE__ */ /* @__PURE__ */(0,ay.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,r)=>{const i=e.scales.geoPath(t);return i?/* @__PURE__ */ /* @__PURE__ */(0,ay.jsx)("path",{d:i,fill:"none",stroke:n.outlineStyle?.stroke??"currentColor",strokeOpacity:n.outlineStyle?.opacity??n.outlineStyle?.fillOpacity??.22,strokeWidth:n.outlineStyle?.strokeWidth??.7,strokeDasharray:n.outlineStyle?.strokeDasharray,strokeLinecap:n.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},oc(t,r)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};