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
@@ -0,0 +1,51 @@
1
+ function e(e){let{accessor:t,data:o,isPushMode:i}=e,a=qt(null),[r,n]=Zt(0),l=Kt(e=>{if(!i||!t)return;let o=!1;for(let i of e){let e="function"==typeof t?t(i):i[t];if(null==e)continue;let r="number"==typeof e?e:Number(e);Number.isFinite(r)&&(a.current?(r<a.current[0]&&(a.current[0]=r,o=!0),r>a.current[1]&&(a.current[1]=r,o=!0)):(a.current=[r,r],o=!0))}o&&n(e=>e+1)},[i,t]),s=Kt(()=>{i&&(a.current=null,n(e=>e+1))},[i]);return{domain:Qt(()=>{if(i)return a.current??void 0;if(!t||0===o.length)return;let e="function"==typeof t?t:e=>e[t],r=1/0,n=-1/0;for(let t of o){let o=e(t);if(null==o)continue;let i="number"==typeof o?o:Number(o);Number.isFinite(i)&&(i<r&&(r=i),i>n&&(n=i))}return Number.isFinite(r)&&Number.isFinite(n)?[r,n]:void 0},[o,t,i,r]),trackPushed:l,reset:s}}function t(e,t){return Lt(1===t?.5:e/(t-1))}function o(e){return e instanceof Date?`date:${e.getTime()}`:`${typeof e}:${String(e)}`}function i(e,t){let o=t=>e[Math.max(0,Math.min(e.length-1,Math.round(Number(t))))],i=e.every(e=>"number"==typeof e||e instanceof Date),r=t?void 0:a(e);return(a,n,l)=>{if(0===e.length)return"";let s=o(a);return t?t(s,n,l&&i?l.map(e=>Number(o(e).valueOf())):void 0):s instanceof Date&&r?r(s):String(s)}}function a(e){let t=e.filter(e=>e instanceof Date&&Number.isFinite(e.valueOf()));if(0===t.length)return;let o=t.every(e=>e.valueOf()%864e5==0),i=o&&t.every(e=>1===e.getUTCDate());if(i&&t.every(e=>0===e.getUTCMonth()))return e=>String(e.getUTCFullYear());if(i)return e=>`${xe(e).split(" ")[0]} ${e.getUTCFullYear()}`;let a=t.map(e=>e.valueOf()),r=[Math.min(...a),Math.max(...a)];if(o){let e=new Date(r[0]).getUTCFullYear()===new Date(r[1]).getUTCFullYear();return t=>e?xe(t):`${xe(t)}, ${t.getUTCFullYear()}`}return ve(r)}function r(e,t,o){return"function"==typeof e?e(t,o):t[e]}function n(e,t){if(!e?.length)return;let i=new Map(t.map((e,t)=>[o(e),t]));return e.map(e=>{let t={...e},a=a=>{if(!(a in e))return;let r=i.get(o(e[a]));void 0!==r&&(t[a]=r)};return a("x"),a("x0"),a("x1"),"string"==typeof e.type&&("x-threshold"===e.type||"x"===e.type)&&a("value"),t})}function l(e){let t="number"==typeof e?e:"string"==typeof e&&""!==e.trim()?Number(e):NaN;return Number.isFinite(t)?Math.max(0,Math.floor(t)):void 0}function s(e){return"string"==typeof e&&""!==e.trim()?e:void 0}function c(e){let{seriesOrder:t,overallOrder:o,highlightTop:i,color:a,colorScheme:r,neutralColor:n,themeCategorical:l,themeNeutral:s}=e;if(null==i&&null==a)return r;let c="string"==typeof r?[...It(r,l)]:r,h=null==i?o.length:Math.max(0,Math.floor(i)),m=new Set(o.slice(0,h)),d=/* @__PURE__ */new Map,u={};for(let e of t)Object.defineProperty(u,e,{configurable:!0,enumerable:!0,writable:!0,value:a??(m.has(e)?Mt(void 0,l,c,e,d):n??s??"#b8bec8")});return u}function h(e,t={}){let i=t.xAccessor??"x",a=t.yAccessor??"y",n=t.lineBy??"series",l=t.rankDirection??"descending",s=[],c=/* @__PURE__ */new Map,h=/* @__PURE__ */new Map,m=[],d=/* @__PURE__ */new Map,u=1/0,p=-1/0;e.forEach((e,t)=>{let l=r(i,e,t),f=o(l),y=c.get(f);null==y&&(y=s.length,c.set(f,y),s.push(l),h.set(y,[]));let g=String(r(n,e,t));d.has(g)||(d.set(g,m.length),m.push(g));let b=Number(r(a,e,t));Number.isFinite(b)&&(u=Math.min(u,b),p=Math.max(p,b),h.get(y)?.push({datum:e,inputIndex:t,series:g,value:b}))});let f=[],y=/* @__PURE__ */new Map,g=/* @__PURE__ */new Map;for(let e=0;e<s.length;e++){let t=h.get(e)??[];t.sort((e,t)=>("descending"===l?t.value-e.value:e.value-t.value)||(d.get(e.series)??0)-(d.get(t.series)??0)),t.forEach((t,o)=>{let i=o+1;f.push({datum:t.datum,xIndex:e,xValue:s[e],series:t.series,value:t.value,rank:i}),y.set(t.series,(y.get(t.series)??0)+i),g.set(t.series,(g.get(t.series)??0)+1)})}let b=m.length+1,x=[...m].sort((e,t)=>{let o=g.get(e)??0,i=g.get(t)??0;return((y.get(e)??0)+(s.length-o)*b)/Math.max(1,s.length)-((y.get(t)??0)+(s.length-i)*b)/Math.max(1,s.length)||(d.get(e)??0)-(d.get(t)??0)}),v=null==t.highlightTop?x.length:Math.max(0,Math.floor(t.highlightTop)),w=new Set(x.slice(0,v));return{data:f.map(e=>{let t=w.has(e.series);return{...e.datum,x:e.xIndex,y:e.rank,__bumpRaw:e.datum,__bumpSeries:e.series,__bumpColorGroup:t?e.series:"Other",__bumpValue:e.value,__bumpRank:e.rank,__bumpXValue:e.xValue,__bumpHighlighted:t}}),xValues:s,seriesOrder:m,overallOrder:x,valueExtent:u===1/0?[0,0]:[u,p]}}function m({tooltip:e,xValues:t,xFormat:o,yFormat:a}){let r=fo(()=>i(t,o),[o,t]),n=po(e=>a?a(e):e.toLocaleString(),[a]),l=qe(e),s=fo(()=>l?void 0:it(e),[l,e]),c=po(t=>{let o=t?.data??t;return o&&!1!==e?s?s({...t,data:o.__bumpRaw,__semioticHoverData:!0}):/* @__PURE__ */go(Wt,{children:[
2
+ /* @__PURE__ */yo("div",{style:{fontWeight:700},children:o.__bumpSeries}),
3
+ /* @__PURE__ */go("div",{children:[r(o.x)," · Rank ",o.__bumpRank]}),
4
+ /* @__PURE__ */go("div",{children:["Value: ",n(o.__bumpValue)]})]}):null},[n,r,s,e]),h=po(t=>{let o=(Array.isArray(t.allSeries)?t.allSeries:[]).map(e=>{let t=e.datum;return{...e,value:t?.__bumpValue??e.value,rank:t?.__bumpRank,datum:t?.__bumpRaw??e.datum}}),i=t?.data??t,a={...i?.__bumpRaw??{},xValue:i?.__bumpXValue??t.xValue,allSeries:o};if(Je(e)&&"function"==typeof e.content)return e.content(a);let l=t.xValue??i?.x;/* */
5
+ return go(Wt,{children:[null!=l&&/* @__PURE__ */yo("div",{style:{fontWeight:700,marginBottom:4},children:r(l)}),o.map((e,t)=>/* @__PURE__ */go("div",{style:{display:"flex",alignItems:"center",gap:6},children:[
6
+ /* @__PURE__ */yo("span",{style:{width:8,height:8,borderRadius:"50%",background:e.color,flexShrink:0}}),
7
+ /* @__PURE__ */yo("span",{style:{flex:1},children:e.group}),
8
+ /* @__PURE__ */go("span",{children:[null!=e.rank?`Rank ${e.rank} · `:"",n(e.value)]})]},`${e.group}-${t}`))]})},[n,r,e]);return{tooltip:fo(()=>{if(!1===e)return!1;let t=l?h:c,o=(l?Je(e)&&jt(e.content):jt(s))?Et(t):t;return l?{mode:"multi",content:o,chrome:Je(e)?e.chrome:void 0}:o},[l,h,s,c,e]),formatX:r}}function d(e,t,o,i,a){let r=1-a;return r*r*r*e+3*r*r*a*t+3*r*a*a*o+a*a*a*i}function u(e,t,o,i,a){let r=1-a;return 3*r*r*(t-e)+6*r*a*(o-t)+3*a*a*(i-o)}function p(e,t,o,i,a){let r=[],n=(e.x+t.x)/2;for(let l=0;l<=a;l++){let s,c,h,m,p=l/a;"linear"===i?(s=e.x+(t.x-e.x)*p,c=e.y+(t.y-e.y)*p,h=t.x-e.x,m=t.y-e.y):(s=d(e.x,n,n,t.x,p),c=d(e.y,e.y,t.y,t.y,p),h=u(e.x,n,n,t.x,p),m=u(e.y,e.y,t.y,t.y,p)),r.push({x:s,y:c,dx:h,dy:m,radius:e.radius+(t.radius-e.radius)*p,datumIndex:p<.5?o:o+1})}return r}function f(e,t){let o=e.length-1,i=Math.sign(e[o][0]-e[t][0])||1,a=i*e[o][0],r=i*e[t][0];for(let n=t+1;n<o;n++){let t=Math.max(r,Math.min(a,i*e[n][0]));e[n][0]=i*t,r=t}for(let i=t;i<o;i++){let t=i;for(;t<o&&e[t+1][0]===e[i][0];)t++;for(let o=i+1;o<t;o++)e[o][1]=e[i][1]+(e[t][1]-e[i][1])*(o-i)/(t-i);i=t}let n=1e-6*(a-i*e[t][0])/(o-t);r=i*e[t][0];for(let l=t+1;l<o;l++){let t=Math.max(r+n,Math.min(i*e[l][0],a-(o-l)*n));e[l][0]=i*t,r=t}}function y(e,t={}){let o=[],i=[],a=[];if(e.length<2)return{topPath:o,bottomPath:i,datumIndices:a};let r=t.curve??"smooth",n=Math.max(2,Math.floor(t.samplesPerSegment??12));for(let t=0;t<e.length-1;t++){let l=Math.max(0,o.length-1),s=p(e[t],e[t+1],t,r,n);for(let e=0===t?0:1;e<s.length;e++){let t=s[e],r=Math.hypot(t.dx,t.dy)||1,n=-t.dy/r,l=t.dx/r,c=Math.max(0,t.radius);o.push([t.x+n*c,t.y+l*c]),i.push([t.x-n*c,t.y-l*c]),a.push(t.datumIndex)}f(o,l),f(i,l)}return{topPath:o,bottomPath:i,datumIndices:a}}function g(e,t){let o=0;for(let t of e)o+=(t.codePointAt(0)??0)>=11904?1.1:xo.find(([e])=>e.test(t))?.[1]??(t.toLowerCase()!==t?.75:.62);return o*t*1.05}function b(e){let t=e.fontSize??12,o=!0===e.showLabels?"end":e.showLabels,i="end"===o||"both"===o||"auto"===o,a="start"===o||"both"===o,r=e.labels.reduce((e,o)=>Math.max(e,g(o,t)),0),n=Math.round(e.width*(e.maxSideFraction??.38)),l=g(String(Math.max(1,e.rankCount)),t),s=e.showAxes?8+l+6:8,c={start:s+4+(e.showAxes&&e.yLabel?24:0),end:12},h=e.legendSide?xt({legendGroups:[{label:"",styleFn:()=>({}),items:e.labels.map(e=>({label:e}))}]},{sideGutter:0}):0,m=g("MMM",t),d=(t,o)=>Math.min(o+r,e.legendSide===t?Math.max(o+m,n-h):n),u={start:a?d("left",c.start):0,end:i?d("right",c.end):0},p=!1===e.showLabels?24:110;return{margin:{...bo,right:Math.max(p,u.end),left:Math.max(bo.left,u.start)},startLabelOffset:s,chrome:c,room:u,labelWidth:r,fontSize:t,hasStart:a,hasEnd:i}}function x(e,t){let o={start:t.hasStart?Math.max(0,Math.min(e.left,t.room.start)-t.chrome.start):0,end:t.hasEnd?Math.max(0,Math.min(e.right,t.room.end)-t.chrome.end):0};return{budget:o,sideGutter:{...t.hasStart&&{left:t.chrome.start+Math.min(o.start,t.labelWidth)},...t.hasEnd&&{right:t.chrome.end+Math.min(o.end,t.labelWidth)}}}}function v(e,t,o){if(g(e,o)<=t)return{text:e,truncated:!1};let i=Array.from(e),a=i.length-1;for(;a>0&&g(`${i.slice(0,a).join("")}…`,o)>t;)a--;return{text:`${i.slice(0,a).join("").trimEnd()}…`,truncated:!0}}function w(e,t,o,i){let a=Math.max(1,Math.floor(t/18)),r="auto"===o?Number.isFinite(i)&&(i??0)>=0?Math.min(a,Math.floor(i)):a:1/0,n=e.map((e,t)=>({candidate:e,index:t})).sort((e,t)=>{let o=e.candidate.priority??0;return(t.candidate.priority??0)-o||Number(t.candidate.highlighted)-Number(e.candidate.highlighted)||e.candidate.rank-t.candidate.rank||e.index-t.index}),l=[];for(let{candidate:e}of n){if(l.length>=r)break;l.some(t=>t.side===e.side&&Math.abs(t.y-e.y)<14)||l.push(e)}return new Set(l.map(e=>e.id))}function A({datum:e,x:t,y:o,side:i,color:a,highlighted:r,labelStyle:n,offset:l,budget:s,fontSize:c}){let h=Ee(),m=h.isActive&&!h.predicate(e),d="function"==typeof n?n(e.__bumpRaw):n,u=null==s?{text:e.__bumpSeries,truncated:!1}:v(e.__bumpSeries,s,c);/* */
9
+ return wo("text",{className:"semiotic-bump-label",x:t+("end"===i?l:-l),y:o,dy:"0.35em",textAnchor:"end"===i?"start":"end",fill:a,fillOpacity:m?.16:1,fontWeight:r?650:450,fontSize:12,style:{pointerEvents:"none",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-axis-label-font-size, 12px)",...d},children:[u.truncated&&/* @__PURE__ */vo("title",{children:e.__bumpSeries}),u.text]})}function S(e){let t=Array.isArray(e.datum)?e.datum[0]:e.datum;return t&&"object"==typeof t&&"__bumpSeries"in t?t:void 0}function k(e,t,o){let[i,a]=t,[r,n]=o;return a===i?(r+n)/2:r+(n-r)*Math.max(0,Math.min(1,(e-i)/(a-i)))}function C(e){let t=e.__bumpXValue instanceof Date?e.__bumpXValue.getTime():Number(e.__bumpXValue);return{value:e.__bumpValue,x:Number.isFinite(t)?t:void 0,y:e.__bumpValue,category:e.__bumpSeries}}function L(e){let t=e.config,o=/* @__PURE__ */new Map;for(let t of e.data){let e=o.get(t.__bumpSeries)??[];e.push(t),o.set(t.__bumpSeries,e)}let i=t.seriesOrder.filter(e=>o.has(e)).sort((e,i)=>(o.get(e)?.[0]?.__bumpHighlighted?1:0)-(o.get(i)?.[0]?.__bumpHighlighted?1:0)||t.seriesOrder.indexOf(e)-t.seriesOrder.indexOf(i)),a=[],r=[],n=[];for(let r of i){let i=(o.get(r)??[]).sort((e,t)=>e.x-t.x);if(i.length<2)continue;let l=i[0].__bumpHighlighted,s=(t.colorMap&&Pt(t.colorMap,r))??e.resolveColor(i[0].__bumpSeries,i[0]),c=t.color??(l?s:t.neutralColor??e.theme.semantic.textSecondary??e.theme.semantic.border??s),h=i.map(o=>({x:e.scales.x(o.x),y:e.scales.y(o.y),radius:t.ribbon?k(o.__bumpValue,t.valueExtent,t.ribbonSizeRange)/2:Math.max(.5,t.lineWidth/2)})),m=y(h,{curve:t.curve,samplesPerSegment:t.samplesPerSegment}),d={fill:c,fillOpacity:1,opacity:l?t.ribbon?t.ribbonOpacity:t.lineOpacity:Math.min(t.ribbon?t.ribbonOpacity:t.lineOpacity,.58)};t.styleRules?.length&&Object.assign(d,Ze(i[0].__bumpRaw,t.styleRules,C(i[0]))),t.areaStyle&&Object.assign(d,t.areaStyle(i[0].__bumpRaw)??{}),void 0!==t.stroke&&(d.stroke=t.stroke),void 0!==t.strokeWidth&&(d.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(d.opacity=t.opacity),a.push({type:"area",topPath:m.topPath,bottomPath:m.bottomPath,_hitArea:!0,style:d,datum:m.datumIndices.map(e=>i[e]),accessibleDatum:i.map(e=>e.__bumpRaw),accessibility:{label:`${r} ranking trajectory`,tableFields:i.map(e=>e.__bumpRaw)},group:r,interactive:!0}),t.showPoints&&i.forEach((e,o)=>{let i={fill:c,stroke:"none",opacity:l?1:.75};t.styleRules?.length&&Object.assign(i,Ze(e.__bumpRaw,t.styleRules,C(e))),t.pointStyle&&Object.assign(i,t.pointStyle(e.__bumpRaw)??{}),void 0!==t.stroke&&(i.stroke=t.stroke),void 0!==t.strokeWidth&&(i.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(i.opacity=t.opacity),a.push({type:"point",x:h[o].x,y:h[o].y,r:i.r??t.pointRadius,style:i,datum:e,accessibleDatum:e.__bumpRaw,accessibility:{label:`${r}, rank ${e.__bumpRank}, value ${e.__bumpValue}`},pointId:`${r}:${e.x}`})});let u=!0===t.showLabels?"end":t.showLabels,p=(e,o,i)=>{let a=null==t.labelPriorityAccessor?void 0:"function"==typeof t.labelPriorityAccessor?t.labelPriorityAccessor(e.__bumpRaw):Number(e.__bumpRaw[t.labelPriorityAccessor]);n.push({id:`${r}\0${i}`,datum:e,x:h[o].x,y:h[o].y,side:i,rank:e.__bumpRank,highlighted:l,priority:Number.isFinite(a)?a:void 0,color:"string"==typeof d.fill?d.fill:c})};("start"===u||"both"===u)&&p(i[0],0,"start"),("end"===u||"both"===u||"auto"===u)&&p(i.at(-1),i.length-1,"end")}let l=!0===t.showLabels?"end":t.showLabels,s=w(n,e.dimensions.plot.height,"auto"!==l||"auto",t.maxLabels);for(let e of n)s.has(e.id)&&r.push(
10
+ /* @__PURE__ */vo(A,{datum:e.datum,x:e.x,y:e.y,side:e.side,color:e.color,highlighted:e.highlighted,labelStyle:t.labelStyle,offset:"end"===e.side?8:t.startLabelOffset??8,budget:t.labelBudget?.[e.side],fontSize:t.labelFontSize??12},e.id));return{nodes:a,overlays:r.length?/* @__PURE__ */vo("g",{className:"semiotic-bump-labels",children:r}):void 0,restyle:(e,t)=>{let o=S(e);if(t?.isActive&&o&&!t.predicate(o))return{opacity:.14}}}}function R({data:e,safeData:t,areaBy:o,lineDataAccessor:i}){if(null==e)return[];let a,r=void 0!==t[0]?.[i];if(!r&&!o)return t;if(r)a=t;else{let e=t.reduce((e,t)=>{let a="function"==typeof o?o(t):t[o],r=String(a);if(!e[r]){let t={[i]:[]};"string"==typeof o&&(t[o]=a),e[r]=t}return e[r][i].push(t),e},{});a=Object.values(e)}return a.flatMap(e=>{let t=Array.isArray(e[i])?e[i]:[];return"string"==typeof o?t.map(t=>({...t,[o]:t[o]??e[o]})):t})}function _(e){let{safeData:t,data:o,areaBy:i,lineDataAccessor:a,colorBy:r,colorScale:n,color:l,stroke:s,strokeWidth:c,opacity:h,effectiveSelectionHook:m,resolvedSelection:d,areaOpacity:u,showLine:p,lineWidth:f,showPoints:y,pointRadius:g,xAccessor:b,yAccessor:x,xLabel:v,yLabel:w,xFormat:A,yFormat:S,groupField:k,styleRules:C,ruleContext:L}=e,_=Ro(()=>R({data:o,safeData:t,areaBy:i,lineDataAccessor:a}),[o,t,i,a]),H=Ro(()=>e=>{let t={};if(r){if(n){let o=Ft(e,r,n);t.fill=o,p?(t.stroke=o,t.strokeWidth=f):t.stroke="none"}}else{let e=l||Ht;t.fill=e,p?(t.stroke=e,t.strokeWidth=f):t.stroke="none"}return t.fillOpacity=u,C&&C.length>0&&Object.assign(t,Ze(e,C,L?L(e):{value:void 0})),t},[r,n,l,u,p,f,C,L]),I=Ro(()=>We(H,{stroke:s,strokeWidth:c,opacity:h}),[H,s,c,h]);return{flattenedData:_,lineStyle:Ro(()=>Ct(I,m??null,d),[I,m,d]),pointStyle:Ro(()=>{if(y)return e=>{let t={r:g,fillOpacity:1};return r?n&&(t.fill=Ft(e.parentLine||e,r,n)):t.fill=l||Ht,t}},[y,g,r,n,l]),defaultTooltipContent:Ro(()=>De([{label:v||Be(b),accessor:b,role:"x",format:A},{label:w||Be(x),accessor:x,role:"y",format:S},...k?[{label:Be(k),accessor:k,role:"group"}]:[],...Me(e.band,S)]),[b,x,v,w,k,A,S,e.band])}}function H(e,t,o,i){if(!e.length)return[];let a=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[],n=0,l=null,s=null,c=[],h=(e,t)=>e>t?"A":t>e?"B":null,m=e=>`seg-${n}-${e}`,d=e=>r.push(e),u=(e,t)=>{d({__x:e.x,__y:e.y,__y0:e.y,__diffSegment:m(t),__diffWinner:t,__valA:e.y,__valB:e.y,__sourceDatum:e.datum})};for(let e=0;e<a.length;e++){let r=a[e],p=t(r),f=o(r),y=i(r);if(!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(y))continue;let g=h(f,y);if(null!==g){if(null==l){l=g;for(let e of c)u(e,l);c=[],d({__x:p,__y:f>=y?f:y,__y0:f>=y?y:f,__diffSegment:m(l),__diffWinner:l,__valA:f,__valB:y,__sourceDatum:r}),s={x:p,a:f,b:y,w:g};continue}if(s&&s.w!==g){let e,t;if(c.length>0)e=c[0].x,t=c[0].y;else{let o=f-s.a-(y-s.b);if(0!==o){let i=(s.b-s.a)/o,a=Math.max(0,Math.min(1,i));e=s.x+a*(p-s.x),t=s.a+a*(f-s.a)}else e=s.x,t=s.a}d({__x:e,__y:t,__y0:t,__diffSegment:m(l),__diffWinner:l,__valA:t,__valB:t}),n++,l=g,d({__x:e,__y:t,__y0:t,__diffSegment:m(l),__diffWinner:l,__valA:t,__valB:t});for(let e=1;e<c.length;e++)u(c[e],l)}else for(let e of c)u(e,l);c=[],d({__x:p,__y:f>=y?f:y,__y0:f>=y?y:f,__diffSegment:m(l),__diffWinner:l,__valA:f,__valB:y,__sourceDatum:r}),s={x:p,a:f,b:y,w:g}}else c.push({x:p,y:f,datum:r})}for(let e of c)u(e,l??"A");return r}function I(e){if("A"===e.__diffWinner||"B"===e.__diffWinner)return e.__diffWinner;let t=String(e.__diffSegment??"");return"line-A"===t||t.endsWith("-A")?"A":"B"}function F(e,t){return et(e,t,e=>{let t=Number(e.__x),o=Number(e.__y);return{value:Number.isFinite(o)?o:void 0,x:Number.isFinite(t)?t:void 0,y:Number.isFinite(o)?o:void 0,category:I(e)}},e=>e.__sourceDatum?{...e.__sourceDatum,...e}:e)}function P(e){let{seriesAColor:t,seriesBColor:o,areaOpacity:i,styleRules:a}=e;return F(e=>({fill:"A"===I(e)?t:o,stroke:"none",fillOpacity:i}),a)}function B(e){let{seriesAColor:t,seriesBColor:o,lineWidth:i,styleRules:a}=e;return F(e=>({stroke:"A"===I(e)?t:o,strokeWidth:i,fill:"none"}),a)}function M(e){let{seriesAColor:t,seriesBColor:o,pointRadius:i,styleRules:a}=e;return F(e=>({fill:"A"===I(e)?t:o,r:i}),a)}function D(e){if(null==e)return NaN;if("number"==typeof e)return e;if(e instanceof Date)return e.getTime();if("string"==typeof e){if(""===e.trim())return NaN;let t=+e;return Number.isFinite(t)?t:NaN}return NaN}function T(e,t,o,i){if(!e.length)return[];let a=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];for(let e of a){let a=t(e),n=o(e),l=i(e);Number.isFinite(n)&&r.push({__x:a,__y:n,__diffSegment:"line-A",__diffWinner:"A",__sourceDatum:e}),Number.isFinite(l)&&r.push({__x:a,__y:l,__diffSegment:"line-B",__diffWinner:"B",__sourceDatum:e})}return r}function N(e){let[t,o]=mi.useState(()=>ui);return mi.useEffect(()=>{if(t)return;let e=!1;return(ui?Promise.resolve(ui):(pi||(pi=import("./c-MXKN7S3R.min.js").then(e=>ui=e.ScatterplotMatrixBrushOverlay).catch(e=>{throw pi=null,e})),pi)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?/* @__PURE__ */di(t,{...e}):null}function O({data:e,xField:t,yField:o,fieldLabels:i,cellSize:a,pointRadius:r,pointOpacity:n,styleRules:l,colorBy:s,colorScale:c,brushSelectionName:h,hoverSelectionName:m,unselectedOpacity:d,showGrid:u,maxDevicePixelRatio:p,mobileInteraction:f,mode:y,onPointHover:g,onPointClick:b}){ke(de);let x=hi(null),v=ht({name:h,clientId:`splom-${t}-${o}`,fields:[t,o]}),w=mt({name:h,xField:t,yField:o}),A=ht({name:m,clientId:"splom-hover-source",fields:[gi]}),S=A.selectPoints,k=ci(e=>{e?w.brushInteraction.during(e):w.brushInteraction.end(null)},[w.brushInteraction]),C=ci(e=>{if(!e)return void g?.(null);let t=e.data,o=t?.[gi];void 0!==o&&(S({[gi]:[o]}),g?.(t,e.x+bi.left,e.y+bi.top))},[S,g]),L=ci(e=>{if(!e)return void b?.(null);let t=e.data;t&&b?.(t,e.x+bi.left,e.y+bi.top)},[b]),R=si(()=>Qe(t,o),[t,o]),_=si(()=>et(e=>({opacity:n,r:r,fill:s?Ft(e,s,c):Ht}),l,R),[n,r,s,c,l,R]),H=ci(e=>{let t={..._(e)};return"hover"===y?A.isActive&&A.predicate(e)?(t.opacity=1,t.r=2.5*r,t.stroke="#333",t.strokeWidth=1.5):A.isActive&&(t.opacity=.6*("number"==typeof t.opacity?t.opacity:n)):v.isActive&&!v.predicate(e)&&(t.opacity=d),t},[_,y,A,v,d,r,n]);/* */
11
+ return yi("div",{style:{position:"relative",width:a,height:a},children:[
12
+ /* @__PURE__ */fi(Ae,{ref:x,chartType:"scatter",data:e,size:[a,a],xAccessor:t,yAccessor:o,pointStyle:H,margin:bi,showAxes:!1,maxDevicePixelRatio:p,enableHover:"hover"===y,accessibleTable:!1,description:`${Pt(i,t)??t} versus ${Pt(i,o)??o} scatterplot`,...Ne({forceHoverBehavior:"hover"===y,forceClickBehavior:!!b,mobileInteraction:f,customHoverBehavior:C,customClickBehavior:L}),tooltipContent:"hover"===y?()=>null:void 0}),"brush"===y&&/* @__PURE__ */fi(N,{frameRef:x,cellSize:a,onBrush:k})]})}function W({data:e,field:t,label:o,cellSize:i,bins:a,colorBy:r,colorScale:n,brushSelectionName:l,hoverSelectionName:s,unselectedOpacity:c,mode:h}){let m=ht({name:l,clientId:`splom-diag-${t}`,fields:[t]}),d=ht({name:s,clientId:`splom-diag-${t}-hover`,fields:[gi]}),u="hover"===h?d:m,p=u.isActive,f=u.predicate,y=si(()=>{let o="string"==typeof r?r:null,n=[],l=/* @__PURE__ */new Set;for(let i of e){let e=i[t];if(null!=e&&!isNaN(e)&&n.push(Number(e)),o){let e=i[o];null!=e&&l.add(String(e))}}if(0===n.length)return{bars:[],selectedBars:[],categoryBars:[],selectedCategoryBars:[],max:0,categories:[]};let[s,c]=Gt(n),h=(c-s)/a||1,m=Array.from(l),d=new Map(m.map((e,t)=>[e,t])),u=new Array(a).fill(0),y=new Array(a).fill(0),g=Array.from({length:a},()=>new Array(m.length).fill(0)),b=Array.from({length:a},()=>new Array(m.length).fill(0));for(let i of e){let e=i[t];if(null==e||isNaN(e))continue;let r=Math.min(Math.floor((e-s)/h),a-1);if(u[r]++,(!p||f(i))&&y[r]++,o){let e=d.get(String(i[o]));void 0!==e&&(g[r][e]++,(!p||f(i))&&b[r][e]++)}}let x=$t(u,1),v=g.map((e,t)=>{let o=0;return e.map((e,r)=>{let n=e/x*(i-24),l={x:t/a*i,w:i/a-1,h:n,y0:o,category:m[r]};return o+=n,l})}),w=b.map((e,t)=>{let o=0;return e.map((e,r)=>{let n=e/x*(i-24),l={x:t/a*i,w:i/a-1,h:n,y0:o,category:m[r]};return o+=n,l})});return{bars:u.map((e,t)=>({x:t/a*i,w:i/a-1,h:e/x*(i-24),count:e})),selectedBars:y.map((e,t)=>({x:t/a*i,w:i/a-1,h:e/x*(i-24),count:e})),categoryBars:v,selectedCategoryBars:w,max:x,categories:m}},[e,t,a,i,p,f,r]);/* */
13
+ return yi("svg",{width:i,height:i,style:{overflow:"hidden"},children:[
14
+ /* @__PURE__ */fi("text",{x:i/2,y:14,textAnchor:"middle",fontSize:11,fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)",children:o}),y.categories.length>0?y.categoryBars.map((e,t)=>e.map((e,o)=>/* @__PURE__ */fi("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:n?n(e.category):Ht,opacity:p?.3:.6},`bg-${t}-${o}`))):y.bars.map((e,t)=>/* @__PURE__ */fi("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:Ht,opacity:p?.3:.6},`bg-${t}`)),p&&(y.categories.length>0?y.selectedCategoryBars.map((e,t)=>e.map((e,o)=>/* @__PURE__ */fi("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:n?n(e.category):Ht,opacity:.7},`sel-${t}-${o}`))):y.selectedBars.map((e,t)=>/* @__PURE__ */fi("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:Ht,opacity:.7},`sel-${t}`)))]})}function E({label:e,cellSize:t}){/* */
15
+ return fi("svg",{width:t,height:t,children:/* @__PURE__ */fi("text",{x:t/2,y:t/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:12,fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)",children:e})})}function j(e){let{data:t,fields:o,fieldLabels:i={},colorBy:a,colorScheme:r,cellSize:n=ii.cellSize,cellGap:l=ii.cellGap,pointRadius:s=2,pointOpacity:c=.5,diagonal:h="histogram",histogramBins:m=20,brushMode:d="crossfilter",hoverMode:u=!0,unselectedOpacity:p=.1,showGrid:f=!1,maxDevicePixelRatio:y,tooltip:g,showLegend:b,idAccessor:x,styleRules:v,width:w,height:A,className:S,title:k,description:C,summary:L,accessibleTable:R=!0,onObservation:_,onClick:H,chartId:I}=e,F="splom",P="splom-hover",B=dt(e.mobileInteraction,{mode:e.mode,width:w??o.length*n,mobileSemantics:e.mobileSemantics}),M=u?"hover":d?"brush":"hover",D=zt(e=>e.clearSelection),[T,N]=li(null),j=ni(()=>{D(P),N(null)},[D,P]),z=ri(()=>(t||[]).map((e,t)=>void 0!==e[gi]?e:{...e,[gi]:t}),[t]),G=Ve(z,a,r),$=`${ai.useId().replace(/:/g,"")}-data-table`,V=ri(()=>(t||[]).map(e=>({type:"point",datum:e})),[t]),X=ri(()=>it(g),[g]),Y=(o.length,ii.labelWidth),U=ni((e,t,o,i)=>[Y+l+e*(n+l)+(o??0),t*(n+l)+(i??0)],[Y,n,l]),K=void 0!==b?b:!!a,Q=ri(()=>{if(!K||!a)return null;let e="string"==typeof a?a:null;return e?Array.from(new Set(z.map(t=>t[e]).filter(e=>null!=e))).map(e=>({label:String(e),color:G?G(String(e)):Ht})):null},[K,a,z,G]),q=ri(()=>({display:"grid",gridTemplateColumns:`${Y}px ${o.map(()=>`${n}px`).join(" ")}`,gridTemplateRows:`${o.map(()=>`${n}px`).join(" ")} ${Y}px`,gap:`${l}px`,width:"fit-content"}),[o,n,l,Y]);/* */
16
+ return vi("div",{className:S,style:{position:"relative",color:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)"},role:"group","aria-label":C||k||`Scatterplot matrix comparing ${o.length} fields`,children:[k&&/* @__PURE__ */xi("div",{className:"semiotic-chart-title",style:{fontWeight:600,marginBottom:8},children:k}),R&&/* @__PURE__ */xi(ft,{accessibleTable:R,children:/* @__PURE__ */xi(At,{tableId:$})}),
17
+ /* @__PURE__ */xi(vt,{summary:L}),Q&&/* @__PURE__ */xi("div",{style:{display:"flex",gap:12,marginBottom:8,flexWrap:"wrap"},children:Q.map(e=>/* @__PURE__ */vi("div",{style:{display:"flex",alignItems:"center",gap:4},children:[
18
+ /* @__PURE__ */xi("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",backgroundColor:e.color}}),
19
+ /* @__PURE__ */xi("span",{style:{fontSize:11},children:e.label})]},e.label))}),
20
+ /* @__PURE__ */vi("div",{style:{position:"relative",width:"fit-content"},children:[
21
+ /* @__PURE__ */vi("div",{style:q,onMouseLeave:"hover"===M?j:void 0,children:[o.map((e,t)=>/* @__PURE__ */vi(ai.Fragment,{children:[
22
+ /* @__PURE__ */xi("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:11,fontWeight:"bold",color:"var(--semiotic-text, #333)"},children:Pt(i,e)??e}),o.map((o,r)=>t===r?"label"===h?/* @__PURE__ */xi(E,{label:Pt(i,e)??e,cellSize:n},`diag-${e}`):/* @__PURE__ */xi(W,{data:z,field:e,label:Pt(i,e)??e,cellSize:n,bins:m,colorBy:a,colorScale:G,brushSelectionName:F,hoverSelectionName:P,unselectedOpacity:p,mode:M},`diag-${e}`):/* @__PURE__ */xi(O,{data:z,xField:o,yField:e,fieldLabels:i,cellSize:n,pointRadius:s,pointOpacity:c,styleRules:v,colorBy:a,colorScale:G,brushSelectionName:F,hoverSelectionName:P,unselectedOpacity:p,showGrid:f,maxDevicePixelRatio:y,mobileInteraction:B,mode:M,onPointHover:"hover"===M?(i,a,n)=>{if(i){if(N({datum:i,xField:o,yField:e,colIndex:r,rowIndex:t,px:a??0,py:n??0}),_){let[e,o]=U(r,t,a,n);_({type:"hover",datum:i,x:e,y:o,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:I})}}else N(null),_&&_({type:"hover-end",timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:I})}:void 0,onPointClick:H||_?(e,o,i)=>{if(!e)return;let[a,n]=U(r,t,o,i);H&&H(e,{x:a,y:n}),_&&_({type:"click",datum:e,x:a,y:n,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:I})}:void 0},`cell-${e}-${o}`))]},`row-${e}`)),
23
+ /* @__PURE__ */xi("div",{})," ",o.map(e=>/* @__PURE__ */xi("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:"bold",color:"#333"},children:Pt(i,e)??e},`col-label-${e}`))]}),T&&"hover"===M&&!1!==g&&(()=>{let e=T.datum,t=Pt(i,T.xField)??T.xField,r=Pt(i,T.yField)??T.yField,s=a?"function"==typeof a?a(e):e[a]:null,c=x?"function"==typeof x?x(e):e[x]:`Row ${e[gi]}`,h=Y+l+T.colIndex*(n+l),m=T.rowIndex*(n+l),d=h+T.px,u=m+T.py,p={...e};delete p[gi];let f="function"==typeof X,y=f?X(p):null,g=/* @__PURE__ */vi(Wt,{style:{color:"var(--semiotic-tooltip-text, #333)",background:"var(--semiotic-tooltip-bg, rgba(255,255,255,0.95))",border:"1px solid var(--semiotic-border, #ddd)",borderRadius:3,padding:"4px 8px",fontSize:11,lineHeight:1.4,whiteSpace:"nowrap",boxShadow:"none"},children:[
24
+ /* @__PURE__ */xi("div",{style:{fontWeight:"bold",marginBottom:2},children:String(c)}),
25
+ /* @__PURE__ */vi("div",{children:[t,": ",null!=e[T.xField]?Number(e[T.xField]).toFixed(1):"–"]}),
26
+ /* @__PURE__ */vi("div",{children:[r,": ",null!=e[T.yField]?Number(e[T.yField]).toFixed(1):"–"]}),null!=s&&/* @__PURE__ */vi("div",{style:{opacity:.8},children:["string"==typeof a?a:"group",": ",String(s)]})]}),b=f?y:g;return Nt(b)?/* @__PURE__ */xi(ze,{contentOwnsChrome:jt(X),x:d,y:u,containerWidth:Y+o.length*n+o.length*l,containerHeight:o.length*n+Y+o.length*l,margin:{top:0,right:0,bottom:0,left:0},className:"scatterplot-matrix-tooltip",zIndex:10,children:b}):null})()]}),R&&/* @__PURE__ */xi(ft,{accessibleTable:R,children:/* @__PURE__ */xi(bt,{scene:V,chartType:"scatterplot matrix",tableId:$,chartTitle:k})})]})}function z(e){let[t,o]=Ri.useState(()=>Hi);return Ri.useEffect(()=>{if(t)return;let e=!1;return(Hi?Promise.resolve(Hi):(Ii||(Ii=import("./c-VSOQPII4.min.js").then(e=>Hi=e.MinimapBrush).catch(e=>{throw Ii=null,e})),Ii)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?/* @__PURE__ */_i(t,{...e}):null}function G(e){let t=$(e);return(e.height||60)+(e.margin?.top??t.top)+(e.margin?.bottom??t.bottom)}function $(e){let t=e.handles&&"object"==typeof e.handles?e.handles:e.handles?{}:null,o="number"==typeof t?.size&&Number.isFinite(t.size)?t.size:12;return{top:t?.move?Math.ceil(q(o)/2)+2:0,bottom:e.showExtentLabels?34:20}}function V(e,t){return{label:t?.label??e.label,color:t?.color??e.color,opacity:t?.opacity??e.opacity}}function X(e,t,o){let i=It(t,o,_t),a=t&&"object"==typeof t&&!Array.isArray(t)?t:null;return e.map((e,t)=>{if("string"==typeof e.color&&e.color.length>0)return e.color;let o=e.label||`Series ${t+1}`,r=a?.[o];return"string"==typeof r&&r.length>0?r:i[t%i.length]})}function Y(e,t){let o=Ke(e),i=t.map((e,t)=>({label:e.label||`Series ${t+1}`,readY:Ke(e.yAccessor)}));return(e,t)=>{let a=String(e[Ki]??t??""),r=(i.find(e=>e.label===a)??i[0])?.readY(e);return{value:r,x:o(e),y:r,category:a||void 0}}}function U(e,t){let o=1/0,i=-1/0,a="function"==typeof t?t:e=>e[t];for(let t of e){let e=a(t);null!=e&&isFinite(e)&&(e<o&&(o=e),e>i&&(i=e))}if(!isFinite(o)||!isFinite(i))return[0,1];if(o===i){let e=0===o?1:.1*Math.abs(o);return[o-e,i+e]}return[o,i]}function K(e,t){let o=t[1]-t[0];return 0===o?.5:(e-t[0])/o}function Q(e,t){return t[0]+e*(t[1]-t[0])}import{a as q}from"./c-XN6FERBN.min.js";import{a as Z}from"./c-27DCB5T6.min.js";import{a as J,b as ee,c as te,d as oe}from"./c-IKPM53JH.min.js";import{a as ie}from"./c-PDQHLOKU.min.js";import{a as ae,c as re}from"./c-QP3PXK3N.min.js";import{c as ne}from"./c-CZI7G7G2.min.js";import{a as le,b as se,c as ce}from"./c-XI6CLZII.min.js";import{a as he}from"./c-ALLF3Y77.min.js";import{a as me,b as de,c as ue,d as pe,g as fe,h as ye}from"./c-F76M77YC.min.js";import{e as ge}from"./c-UZJAWWAI.min.js";import{b as be,c as xe,d as ve,e as we,f as Ae,g as Se}from"./c-G5A3YWTN.min.js";import{a as ke,i as Ce,k as Le,l as Re}from"./c-VLAAAFST.min.js";import{j as _e,k as He,l as Ie,m as Fe,n as Pe}from"./c-BSLJZUTD.min.js";import{F as Be,H as Me,I as De,V as Te,W as Ne,X as Oe,Y as We}from"./c-C5GXUHUO.min.js";import{b as Ee}from"./c-IU4QZ7Y5.min.js";import{$a as je,Aa as ze,Ab as Ge,Bb as $e,Db as Ve,Fb as Xe,Gb as Ye,Hb as Ue,Ib as Ke,Jb as Qe,Na as qe,Nb as Ze,Oa as Je,Ob as et,Pa as tt,Ra as ot,Sa as it,Xa as at,Ya as rt,_a as nt,ab as lt,b as st,bb as ct,fb as ht,ib as mt,mb as dt,nb as ut,r as pt,sa as ft,ub as yt,v as gt,wa as bt,x as xt,xa as vt,xb as wt,ya as At,yb as St}from"./c-XCV7VUU3.min.js";import{e as kt,f as Ct}from"./c-2OZMC2MZ.min.js";import{b as Lt,d as Rt,m as _t,n as Ht,o as It,r as Ft,s as Pt,u as Bt,v as Mt}from"./c-ZOE7TAR3.min.js";import{c as Dt}from"./c-SSKV5JPW.min.js";import{D as Tt,k as Nt,l as Ot,o as Wt,p as Et,q as jt,w as zt}from"./c-5FUOKMH6.min.js";import{a as Gt,c as $t}from"./c-3PFVJFBK.min.js";import{useMemo as Vt,useCallback as Xt,forwardRef as Yt,useRef as Ut}from"react";import{useCallback as Kt,useMemo as Qt,useRef as qt,useState as Zt}from"react";import{jsx as Jt}from"react/jsx-runtime";var eo=/* @__PURE__ */at(/* @__PURE__ */Yt(function(t,o){be(Z),ke(de);let i=Ut(null),a=Ue(t.mode,{width:t.width,height:t.height,showAxes:t.showAxes,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,description:t.description,summary:t.summary,accessibleTable:t.accessibleTable,xLabel:t.xLabel,yLabel:t.yLabel,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),{data:r,margin:n,className:l,xFormat:s,yFormat:c,xAccessor:h="x",yAccessor:m="y",xScaleType:d,yScaleType:u,colorBy:p,colorScheme:f,styleRules:y,sizeBy:g,sizeRange:b=[3,15],symbolBy:x,symbolMap:v,pointRadius:w=5,pointOpacity:A=.8,tooltip:S,marginalGraphics:k,pointIdAccessor:C,annotations:L,regression:R,forecast:_,anomaly:H,xExtent:I,yExtent:F,pulse:P,decay:B,staleness:M,frameProps:D={},selection:T,linkedHover:N,linkedBrush:O,brush:W,onBrush:E,onObservation:j,onClick:z,hoverHighlight:G,chartId:$,loading:V,loadingContent:X,emptyContent:Y,legendInteraction:U,legendPosition:K,color:Q,stroke:q,strokeWidth:te,opacity:oe}=t,{width:ae,height:re,enableHover:le,showGrid:he,showLegend:me,title:ue,description:pe,summary:fe,accessibleTable:ye,xLabel:ge,yLabel:xe}=a,ve=Vt(()=>st(r),[r]),we=void 0===r,{domain:Ce,trackPushed:Le,reset:Re}=e({accessor:g,data:ve,isPushMode:we}),_e=Xt(e=>{Le([e]),i.current?.push(e)},[Le]),He=Xt(e=>{Le(e),i.current?.pushMany(e)},[Le]);ce(o,{variant:"xy",frameRef:i,overrides:{push:_e,pushMany:He,clear:()=>{Re(),i.current?.clear()}}});let Ie=se({responsive:t,data:ve,rawData:r,colorBy:p,colorScheme:f,legendInteraction:U,legendPosition:K,frameLegend:D,selection:T,linkedHover:N,fallbackFields:p?["string"==typeof p?p:""]:[],unwrapData:!1,onObservation:j,onClick:z,hoverHighlight:G,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"Scatterplot",chartId:$,showLegend:me,userMargin:n,marginDefaults:a.marginDefaults,loading:V,loadingContent:X,emptyContent:Y,width:ae,height:re,hasTitle:!!ue,axisChrome:gt(D,{showAxes:a.showAxes,xLabel:ge,yLabel:xe})}),{brushStreamProps:Fe}=Se({brush:W,onBrush:E,linkedBrush:O,xAccessor:h,yAccessor:m,defaultDimension:"xy"});ct("Scatterplot",ve,"xAccessor",h),ct("Scatterplot",ve,"yAccessor",m);let Pe=Vt(()=>g?Ce??[0,1]:void 0,[g,Ce]),Me=Vt(()=>g?e=>Bt(e,g,b,Pe):void 0,[g,b,Pe]),We=Vt(()=>Qe(h,m),[h,m]),Ee=J({colorBy:p,colorScale:Ie.colorScale,color:Q,pointRadius:w,fillOpacity:A,radiusFn:Me,stroke:q,strokeWidth:te,opacity:oe,styleRules:y,ruleContext:We,effectiveSelectionHook:Ie.effectiveSelectionHook,resolvedSelection:Ie.resolvedSelection}),{effectiveData:je,statisticalAnnotations:ze,hasForecast:Ge,xAccessorKey:$e,yAccessorKey:Ve}=ee({data:ve,xAccessor:h,yAccessor:m,forecast:_,anomaly:H}),Xe=Ge?$e:h,Ye=Ge?Ve:m,Ke=Vt(()=>De([{label:ge||Be(h),accessor:Xe,role:"x",format:s},{label:xe||Be(m),accessor:Ye,role:"y",format:c},...p?[{label:Be(p),accessor:p,role:"color"}]:[],...g?[{label:Be(g),accessor:g,role:"size"}]:[]]),[h,m,Xe,Ye,ge,xe,p,g,s,c]),qe=Vt(()=>{let e=ie(R),t=L||[];return e||0!==ze.length?[...e?[e]:[],...t,...ze]:L},[R,L,ze]);if(Ie.earlyReturn)return Ie.earlyReturn;let Ze=ne({componentName:"Scatterplot",data:r,accessors:{xAccessor:h,yAccessor:m}});if(Ze)/* */return Jt(rt,{componentName:"Scatterplot",message:Ze,width:ae,height:re});let Je={chartType:"scatter",...null!=r&&{data:je},xAccessor:Xe,yAccessor:Ye,xScaleType:d,yScaleType:u,colorAccessor:p||void 0,sizeAccessor:g||void 0,...x&&{symbolAccessor:x},...v&&{symbolMap:v},sizeRange:b,pointStyle:Ee,colorScheme:f,size:[ae,re],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:Ie.margin,showAxes:a.showAxes,xLabel:ge,yLabel:xe,xFormat:s,yFormat:c,enableHover:le,showGrid:he,...Ie.legendBehaviorProps,...Te({title:ue,description:pe,summary:fe,accessibleTable:ye,className:l,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...Oe({tooltip:S,defaultTooltipContent:Ke}),...Ne({linkedHover:N,selection:T,onObservation:j,onClick:z,hoverHighlight:G,hoverRadius:t.hoverRadius,mobileInteraction:Ie.mobileInteraction,customHoverBehavior:Ie.customHoverBehavior,customClickBehavior:Ie.customClickBehavior}),...k&&{marginalGraphics:k},...C&&{pointIdAccessor:C},...P&&{pulse:P},...B&&{decay:B},...M&&{staleness:M},...qe&&qe.length>0&&{annotations:qe},...I&&{xExtent:I},...F&&{yExtent:F},...Fe,...Ie.crosshairProps,...D};/* */
27
+ return Jt(nt,{componentName:"Scatterplot",width:ae,height:re,children:/* @__PURE__ */Jt(Ae,{ref:i,...Je})})}),"Scatterplot");import{useMemo as to,forwardRef as oo,useRef as io}from"react";import{Fragment as ao,jsx as ro}from"react/jsx-runtime";var no=/* @__PURE__ */at(/* @__PURE__ */oo(function(e,o){ke(de);let i=io(null);ce(o,{variant:"xy",frameRef:i});let a=Ue(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,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}),{data:r,margin:n,className:l,xFormat:s,yFormat:c,xAccessor:h="x",yAccessor:m="y",orderAccessor:d,orderLabel:u,styleRules:p,pointRadius:f=4,tooltip:y,pointIdAccessor:g,annotations:b,regression:x,forecast:v,anomaly:w,xExtent:A,yExtent:S,pulse:k,decay:C,staleness:L,frameProps:R={},selection:_,linkedHover:H,onObservation:I,onClick:F,hoverHighlight:P,chartId:B,loading:M,loadingContent:D,emptyContent:T,legendInteraction:N,stroke:O,strokeWidth:W,opacity:E}=e,{width:j,height:z,enableHover:G,showGrid:$,title:V,description:X,summary:Y,accessibleTable:U,xLabel:K,yLabel:Q}=a,{safeData:q,orderMap:Z}=to(()=>{let e=r||[],t="function"==typeof h?h:e=>e[h],o="function"==typeof m?m:e=>e[m],i=e;if(d&&e.length>0){let t="function"==typeof d?d:e=>e[d];i=[...e].sort((e,o)=>{let i=t(e),a=t(o);return(i instanceof Date?i.getTime():+i)-(a instanceof Date?a.getTime():+a)})}let a=/* @__PURE__ */new WeakMap,n=0;for(let e of i){let i=t(e),a=o(e);null!=i&&null!=a&&isFinite(i)&&isFinite(a)&&n++}let l=0;for(let e of i){let i=t(e),r=o(e);null!=i&&null!=r&&isFinite(i)&&isFinite(r)&&a.set(e,{idx:l++,total:n})}return{safeData:i,orderMap:a}},[r,d,h,m]);ct("ConnectedScatterplot",q,"xAccessor",h),ct("ConnectedScatterplot",q,"yAccessor",m);let te=se({responsive:e,data:q,rawData:r,colorBy:void 0,colorScheme:void 0,legendInteraction:N,selection:_,linkedHover:H,fallbackFields:[],unwrapData:!1,onObservation:I,onClick:F,hoverHighlight:P,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"ConnectedScatterplot",chartId:B,showLegend:void 0,userMargin:n,marginDefaults:a.marginDefaults,loading:M,loadingContent:D,emptyContent:T,width:j,height:z,hasTitle:!!V,axisChrome:gt(R,{showAxes:a.showAxes,xLabel:K,yLabel:Q})}),oe=te.resolvedSelection?.unselectedOpacity??kt,ae=to(()=>(e,o)=>{let i=o.filter(e=>"point"===e.type);if(i.length<2)return;let a=te.effectiveSelectionHook?.isActive,r=te.effectiveSelectionHook?.predicate,n=i.length<100,l=i.length;e.lineCap="round";for(let o=0;o<l-1;o++){let s=i[o],c=i[o+1],h=t(o,l),m=!a||!r||r(s.datum??s)||r(c.datum??c),d=a?m?1:oe:1;n&&(e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(c.x,c.y),e.strokeStyle="white",e.lineWidth=f+2,e.globalAlpha=.5*d,e.stroke()),e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(c.x,c.y),e.strokeStyle=h,e.lineWidth=f,e.globalAlpha=d,e.stroke()}e.globalAlpha=1},[f,te.effectiveSelectionHook,oe]),re=to(()=>[ae],[ae]),le=to(()=>(e,o,i)=>{let a=e.filter(e=>"point"===e.type);if(a.length<2)return null;let r=a.length,n=r<100,l=[];for(let e=0;e<r-1;e++){let o=a[e],i=a[e+1],s=t(e,r),c="number"==typeof o.style?.opacity?o.style.opacity:1,h="number"==typeof i.style?.opacity?i.style.opacity:1,m=Math.min(c,h);n&&l.push(
28
+ /* @__PURE__ */ro("line",{x1:o.x,y1:o.y,x2:i.x,y2:i.y,stroke:"white",strokeWidth:f+2,strokeLinecap:"round",opacity:.5*m},`halo-${e}`)),l.push(
29
+ /* @__PURE__ */ro("line",{x1:o.x,y1:o.y,x2:i.x,y2:i.y,stroke:s,strokeWidth:f,strokeLinecap:"round",opacity:m},`seg-${e}`))}/* */
30
+ return ro(ao,{children:l})},[f]),he=to(()=>[le],[le]),me=to(()=>e=>{let o=Z.get(e),i=o?.idx??0,a=o?.total??1;return{fill:a>0?t(i,a):"#6366f1",stroke:"white",strokeWidth:1,r:f,fillOpacity:1}},[f,Z]),ue=to(()=>Qe(h,m),[h,m]),pe=J({colorScale:void 0,baseStyleExtras:me,stroke:O,strokeWidth:W,opacity:E,styleRules:p,ruleContext:ue,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection}),fe=u||("string"==typeof d?d:"Order"),{effectiveData:ye,statisticalAnnotations:ge,hasForecast:be,xAccessorKey:xe,yAccessorKey:ve}=ee({data:q,xAccessor:h,yAccessor:m,forecast:v,anomaly:w}),we=be?xe:h,Se=be?ve:m,Ce=to(()=>De([{label:K||Be(h),accessor:we,role:"x",format:s},{label:Q||Be(m),accessor:Se,role:"y",format:c},...d?[{label:fe,accessor:d,role:"group"}]:[]]),[h,m,we,Se,K,Q,d,fe,s,c]),Le=ne({componentName:"ConnectedScatterplot",data:r,accessors:{xAccessor:h,yAccessor:m}});if(te.earlyReturn)return te.earlyReturn;let Re=ie(x),_e=b||[],He=Re||ge.length>0?[...Re?[Re]:[],..._e,...ge]:b,Ie={chartType:"scatter",...null!=r&&{data:ye},xAccessor:we,yAccessor:Se,pointStyle:pe,size:[j,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,showAxes:a.showAxes,xLabel:K,yLabel:Q,xFormat:s,yFormat:c,enableHover:G,showGrid:$,...Te({title:V,description:X,summary:Y,accessibleTable:U,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Oe({tooltip:y,defaultTooltipContent:Ce}),...Ne({linkedHover:H,selection:_,onObservation:I,onClick:F,hoverHighlight:P,hoverRadius:e.hoverRadius,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...g&&{pointIdAccessor:g},...k&&{pulse:k},...C&&{decay:C},...L&&{staleness:L},canvasPreRenderers:re,svgPreRenderers:he,...He&&He.length>0&&{annotations:He},...A&&{xExtent:A},...S&&{yExtent:S},...te.crosshairProps,...R};return Le?/* @__PURE__ */ro(rt,{componentName:"ConnectedScatterplot",message:Le,width:j,height:z}):/* @__PURE__ */ro(nt,{componentName:"ConnectedScatterplot",width:j,height:z,children:/* @__PURE__ */ro(Ae,{ref:i,...Ie})})}),"ConnectedScatterplot");import{forwardRef as lo,useMemo as so}from"react";import{jsx as co}from"react/jsx-runtime";var ho=/* @__PURE__ */at(/* @__PURE__ */lo(function(e,t){ke(ge);let{data:o,layout:i,layoutConfig:a,onLayoutError:r,xExtent:n,yExtent:l,showAxes:s=!1,margin:c,className:h,annotations:m,onObservation:d,onClick:u,selection:p,linkedHover:f,hoverHighlight:y,chartId:g,loading:b,loadingContent:x,emptyContent:v,colorBy:w,colorScheme:A,legend:S,legendInteraction:k,legendPosition:C,frameProps:L={}}=e,{legend:R,..._}=L,H=so(()=>pt(R,S),[R,S]),{frameRef:I,resolved:F,safeData:P,setup:B,earlyReturn:M}=re({responsive:e,imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"XYCustomChart",unwrapData:!1,data:o,colorBy:w,colorScheme:A,legend:H,legendInteraction:k,legendPosition:C,frameLegend:_,selection:p,linkedHover:f,hoverHighlight:y,onObservation:d,onClick:u,chartId:g,loading:b,loadingContent:x,emptyContent:v,margin:c,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,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules,xLabel:e.xLabel,yLabel:e.yLabel}),D=B.effectiveSelectionHook,T=so(()=>D?.isActive?{isActive:!0,predicate:D.predicate}:null,[D?.isActive,D?.predicate]),N=so(()=>tt({tooltip:e.tooltip,defaultTooltipContent:e=>/* @__PURE__ */co(we,{hover:e})}),[e.tooltip]);if(M)return M;let{width:O,height:W,enableHover:E,showGrid:j,title:z,description:G,summary:$,accessibleTable:V,xLabel:X,yLabel:Y}=F,U={chartType:"custom",...null!=o&&{data:P},customLayout:i,layoutConfig:a,onLayoutError:r,...T&&{layoutSelection:T},xExtent:n,yExtent:l,colorAccessor:w,colorScheme:A,size:[O,W],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:B.margin,showAxes:s,xLabel:X,yLabel:Y,enableHover:E,showGrid:j,...B.legendBehaviorProps,...Te({title:z,description:G,summary:$,accessibleTable:V,className:h,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N,...Ne({linkedHover:f,selection:p,onObservation:d,onClick:u,hoverRadius:e.hoverRadius,hoverHighlight:y,mobileInteraction:B.mobileInteraction,customHoverBehavior:B.customHoverBehavior,customClickBehavior:B.customClickBehavior}),...m&&m.length>0&&{annotations:m},...B.crosshairProps,..._};/* */
31
+ return co(nt,{componentName:"XYCustomChart",width:O,height:W,children:/* @__PURE__ */co(Ae,{ref:I,...U})})}),"XYCustomChart");import{forwardRef as mo,useMemo as uo}from"react";import{useCallback as po,useMemo as fo}from"react";import{jsx as yo,jsxs as go}from"react/jsx-runtime";var bo={top:20,bottom:48,left:48},xo=[[/[mwMW@%…]/,.95],[/[ijlI'.,|\s]/,.28],[/[frt():;/[\]{}*`!\\-]/,.39]];import{jsx as vo,jsxs as wo}from"react/jsx-runtime";import{jsx as Ao}from"react/jsx-runtime";var So=/* @__PURE__ */at(/* @__PURE__ */mo(function(e,t){let o=Ge(),i=Tt(),{data:a,xAccessor:r,yAccessor:d,lineBy:u,rankDirection:p="descending",ribbon:f=!1,curve:y="smooth",ribbonSizeRange:g=[4,28],samplesPerSegment:v=12,lineWidth:w=3,highlightTop:A,neutralColor:S,styleRules:k,labelStyle:C,colorScheme:R,ribbonOpacity:_=.82,lineOpacity:H=.9,showPoints:I=!1,pointRadius:F=3,showLabels:P=!0,labelPriorityAccessor:B,maxLabels:M,showGrid:D=!0,showLegend:T=!1,enableHover:N=!0,hoverHighlight:O=!0,tooltip:W,frameProps:E={},xFormat:j,yFormat:z,onClick:G}=e,$=l(A),V=s(S),X=s(e.color),Y=Ue(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,responsiveRules:e.responsiveRules}),U=uo(()=>h(a,{xAccessor:r,yAccessor:d,lineBy:u,rankDirection:p,highlightTop:$}),[a,r,d,u,p,$]),{axes:K,areaStyle:Q,pointStyle:q,margin:Z,...J}=E,ee="object"==typeof C&&"number"==typeof C?.fontSize?C.fontSize:12,te=e.legendPosition??"right",oe=!T||"left"!==te&&"right"!==te?void 0:te,ie=uo(()=>b({labels:U.seriesOrder,showLabels:P,width:Y.width,showAxes:Y.showAxes,rankCount:U.seriesOrder.length,yLabel:e.yLabel??"Rank",fontSize:ee,legendSide:oe}),[U.seriesOrder,P,Y.width,Y.showAxes,e.yLabel,ee,oe]),re=e.margin??Z,ne=uo(()=>({...ie.margin,...ae(re)}),[ie,re]),le=uo(()=>x(ne,ie),[ne,ie]),se=oe?le.sideGutter[oe]:void 0,ce=uo(()=>c({seriesOrder:U.seriesOrder,overallOrder:U.overallOrder,highlightTop:$,color:X,colorScheme:R,neutralColor:V,themeCategorical:o,themeNeutral:i.colors.textSecondary}),[U.seriesOrder,U.overallOrder,$,X,R,V,o,i.colors.textSecondary]),he=uo(()=>({ribbon:f,curve:y,samplesPerSegment:v,ribbonSizeRange:g,valueExtent:U.valueExtent,seriesOrder:U.seriesOrder,lineWidth:w,ribbonOpacity:_,lineOpacity:H,neutralColor:V,color:X,colorMap:ce&&"object"==typeof ce&&!Array.isArray(ce)?ce:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,styleRules:k,areaStyle:Q,pointStyle:q,labelStyle:C,showPoints:I,pointRadius:F,showLabels:P,labelPriorityAccessor:B,maxLabels:M,startLabelOffset:ie.startLabelOffset,labelBudget:le.budget,labelFontSize:ee}),[f,y,v,g,U.valueExtent,U.seriesOrder,w,_,H,V,ce,X,e.stroke,e.strokeWidth,e.opacity,k,Q,q,C,I,F,P,B,M,ie.startLabelOffset,le.budget,ee]),{tooltip:me,formatX:de}=m({tooltip:W,xValues:U.xValues,xFormat:j,yFormat:z}),ue=uo(()=>{if(G)return(e,t)=>{G(e.__bumpRaw??e,t)}},[G]),pe=Math.max(1,U.seriesOrder.length),fe=U.xValues.map((e,t)=>t),ye=Array.from({length:pe},(e,t)=>t+1),ge=K??[{orient:"left",tickValues:ye,tickFormat:e=>String(e),label:e.yLabel??"Rank",baseline:!1},{orient:"bottom",tickValues:fe,tickFormat:de,label:e.xLabel,tickAnchor:"edges"}],be=uo(()=>n(e.annotations,U.xValues),[e.annotations,U.xValues]);/* */
32
+ return Ao(ho,{ref:t,data:U.data,layout:L,layoutConfig:he,xExtent:[0,Math.max(1,U.xValues.length-1)],yExtent:[pe+.5,.5],showAxes:Y.showAxes,showGrid:D,showLegend:T,enableHover:N,hoverHighlight:O,colorBy:"__bumpSeries",colorScheme:ce,tooltip:me,onClick:ue,hoverRadius:e.hoverRadius,width:e.width,height:e.height,responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,responsiveRules:e.responsiveRules,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,mode:e.mode,margin:ne,className:e.className,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,selection:e.selection,linkedHover:e.linkedHover,legend:e.legend,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,onObservation:e.onObservation,chartId:e.chartId,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,animate:e.animate,autoPlaceAnnotations:e.autoPlaceAnnotations,annotations:be,xLabel:e.xLabel,yLabel:e.yLabel??"Rank",frameProps:{axes:ge,axisExtent:"exact",...J,...null!=se&&null==J.legendLayout?.sideGutter&&{legendLayout:{...J.legendLayout,sideGutter:se}}}})}),"BumpChart");import{useMemo as ko,forwardRef as Co,useRef as Lo}from"react";import{useMemo as Ro}from"react";import{jsx as _o}from"react/jsx-runtime";var Ho=/* @__PURE__ */at(/* @__PURE__ */Co(function(e,t){ke(Le);let o=Lo(null);ce(t,{variant:"xy",frameRef:o});let i=Ue(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,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}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",areaBy:m,y0Accessor:d,gradientFill:u=!1,semanticGradient:p,semanticLine:f=!0,lineDataAccessor:y="coordinates",colorBy:g,colorScheme:b,styleRules:x,curve:v="monotoneX",areaOpacity:w=.7,lineGradient:A,showLine:S=!0,lineWidth:k=2,showPoints:C=!1,pointRadius:L=3,tooltip:R,annotations:H,forecast:I,anomaly:F,band:P,xExtent:B,yExtent:M,frameProps:D={},selection:T,linkedHover:N,onObservation:O,onClick:W,hoverHighlight:E,chartId:j,loading:z,loadingContent:G,emptyContent:$,legendInteraction:V,legendPosition:X,color:Y,stroke:U,strokeWidth:K,opacity:Q}=e,{width:q,height:Z,enableHover:J,showGrid:te,showLegend:oe,title:ie,description:ae,summary:re,accessibleTable:le,xLabel:he,yLabel:me}=i,de=ko(()=>st(a),[a]),ue=g||m,pe=ko(()=>Ie(p),[p]),fe=ko(()=>pe?.stops.length?Pe(pe):_e(u),[pe,u]),ye=ko(()=>He(A),[A]),ge=ko(()=>f?Fe(pe):void 0,[pe,f]);ct("AreaChart",de,"xAccessor",c),ct("AreaChart",de,"yAccessor",h);let be=se({responsive:e,data:de,rawData:a,colorBy:ue,colorScheme:b,legendInteraction:V,legendPosition:X,frameLegend:D,selection:T,linkedHover:N,fallbackFields:ue?["string"==typeof ue?ue:""]:[],unwrapData:!1,onObservation:O,onClick:W,hoverHighlight:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"AreaChart",chartId:j,showLegend:oe,userMargin:r,marginDefaults:i.marginDefaults,loading:z,loadingContent:G,emptyContent:$,width:q,height:Z,hasTitle:!!ie,axisChrome:gt(D,{showAxes:i.showAxes,xLabel:he,yLabel:me})}),{effectiveData:xe,statisticalAnnotations:ve,hasForecast:we,xAccessorKey:Se,yAccessorKey:Ce}=ee({data:de,xAccessor:c,yAccessor:h,forecast:I,anomaly:F,groupBy:m}),Re=we?Se:c,Me=we?Ce:h,De=ko(()=>Qe(c,h),[c,h]),{flattenedData:Oe,lineStyle:We,pointStyle:Ee,defaultTooltipContent:je}=_({safeData:xe,data:a,areaBy:m,lineDataAccessor:y,colorBy:ue,colorScale:be.colorScale,color:Y,stroke:U,strokeWidth:K,opacity:Q,effectiveSelectionHook:be.effectiveSelectionHook,resolvedSelection:be.resolvedSelection,areaOpacity:w,showLine:S,lineWidth:k,showPoints:C,pointRadius:L,xAccessor:Re,yAccessor:Me,xLabel:he||Be(c),yLabel:me||Be(h),xFormat:l,yFormat:s,groupField:m||g,band:P,styleRules:x,ruleContext:De}),ze=ne({componentName:"AreaChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),Ge={chartType:"area",...null!=a&&{data:Oe},xAccessor:Re,yAccessor:Me,groupAccessor:m||void 0,...d&&{y0Accessor:d},...P&&{band:P},...fe&&{gradientFill:fe},...ye&&{lineGradient:ye},...ge&&{semanticLineStops:ge},curve:v,lineStyle:We,...C&&Ee&&{pointStyle:Ee},size:[q,Z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be.margin,showAxes:i.showAxes,xLabel:he,yLabel:me,xFormat:l,yFormat:s,enableHover:J,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:te,...be.legendBehaviorProps,...Te({title:ie,description:ae,summary:re,accessibleTable:le,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...tt({tooltip:R,defaultTooltipContent:je,multiDefaultContent:ot({xFormat:l,yFormat:s})}),...Ne({linkedHover:N,selection:T,onObservation:O,onClick:W,hoverHighlight:E,hoverRadius:e.hoverRadius,mobileInteraction:be.mobileInteraction,customHoverBehavior:be.customHoverBehavior,customClickBehavior:be.customClickBehavior}),...(H&&H.length>0||ve.length>0)&&{annotations:[...H||[],...ve]},...B&&{xExtent:B},...M&&{yExtent:M},...be.crosshairProps,...D};return be.earlyReturn?be.earlyReturn:ze?/* @__PURE__ */_o(rt,{componentName:"AreaChart",message:ze,width:q,height:Z}):/* @__PURE__ */_o(nt,{componentName:"AreaChart",width:q,height:Z,children:/* @__PURE__ */_o(Ae,{ref:o,...Ge})})}),"AreaChart");import{useMemo as Io,forwardRef as Fo,useRef as Po,useState as Bo,useImperativeHandle as Mo,useCallback as Do}from"react";import{jsx as To,jsxs as No}from"react/jsx-runtime";var Oo=/* @__PURE__ */at(/* @__PURE__ */Fo(function(e,t){ke(Re);let o=Po(null),i=Ue(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,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}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",seriesAAccessor:h="a",seriesBAccessor:m="b",seriesALabel:d="A",seriesBLabel:u="B",seriesAColor:p="var(--semiotic-danger, #dc2626)",seriesBColor:f="var(--semiotic-info, #2563eb)",showLines:y=!0,lineWidth:g=1.5,showPoints:b=!1,pointRadius:x=3,curve:v="linear",areaOpacity:w=.6,gradientFill:A,styleRules:S,tooltip:k,annotations:C,xExtent:L,yExtent:R,frameProps:_={},selection:I,linkedHover:F,onObservation:N,onClick:O,hoverHighlight:W,chartId:E,loading:j,loadingContent:z,emptyContent:G,legendInteraction:$,legendPosition:V,pointIdAccessor:X,windowSize:Y}=e,{width:U,height:K,enableHover:Q,showGrid:q,showLegend:Z,title:J,description:ee,summary:te,accessibleTable:oe,xLabel:ie,yLabel:ae}=i,re=Io(()=>"function"==typeof c?e=>D(c(e)):e=>D(e[c]),[c]),ne=Io(()=>"function"==typeof h?e=>D(h(e)):e=>D(e[h]),[h]),le=Io(()=>"function"==typeof m?e=>D(m(e)):e=>D(e[m]),[m]),[ce,he]=Bo([]),me=Po([]),de=null==a,ue=Io(()=>st(de?ce:a),[de,ce,a]),pe=Io(()=>H(ue,re,ne,le),[ue,re,ne,le]),fe=Io(()=>y?T(ue,re,ne,le):[],[y,ue,re,ne,le]),ye=Io(()=>[...pe,...fe],[pe,fe]),ge=Io(()=>{let e=/* @__PURE__ */new Set;for(let t of pe)e.add(t.__diffSegment);return Array.from(e)},[pe]);Mo(t,()=>{let e=e=>{let t=Y&&e.length>Y?e.slice(e.length-Y):e;me.current=t,he(t)},t=X?"function"==typeof X?X:e=>e[X]:null;return{push:t=>e([...me.current,t]),pushMany:t=>e([...me.current,...t]),remove:o=>{if(!t)return[];let i=Array.isArray(o)?o:[o],a=[],r=[];for(let e of me.current)i.includes(t(e))?a.push(e):r.push(e);return e(r),a},update:(o,i)=>{if(!t)return[];let a=Array.isArray(o)?o:[o],r=[],n=me.current.map(e=>{if(a.includes(t(e))){let t=i(e);return r.push(t),t}return e});return e(n),r},clear:()=>e([]),getData:()=>de?me.current:ue,getScales:()=>o.current?.getScales()??null}},[de,ue,X,Y]);let be=Io(()=>!1===Z?void 0:{legendGroups:[{label:"",type:"fill",styleFn:e=>({fill:e.color||"currentColor"}),items:[{label:d,color:p},{label:u,color:f}]}]},[Z,d,u,p,f]),xe=Object.hasOwn(_,"legend")?_:{..._,legend:be},ve=se({responsive:e,data:ue,rawData:a,colorBy:"__diffWinner",colorScheme:[p,f],legendInteraction:$,legendPosition:V,frameLegend:xe,selection:I,linkedHover:F,fallbackFields:["__diffWinner"],unwrapData:!1,onObservation:N,onClick:O,hoverHighlight:W,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DifferenceChart",chartId:E,showLegend:Z,userMargin:r,marginDefaults:i.marginDefaults,loading:j,loadingContent:z,emptyContent:G,width:U,height:K,hasTitle:!!J,axisChrome:gt(_,{showAxes:i.showAxes,xLabel:ie,yLabel:ae})}),we=Io(()=>P({seriesAColor:p,seriesBColor:f,areaOpacity:w,styleRules:S}),[p,f,w,S]),Se=Io(()=>B({seriesAColor:p,seriesBColor:f,lineWidth:g,styleRules:S}),[p,f,g,S]),Ce=Io(()=>M({seriesAColor:p,seriesBColor:f,pointRadius:x,styleRules:S}),[p,f,x,S]),[Le,He,Ie]=Io(()=>[we,Se,Ce].map(e=>Ct(e,ve.effectiveSelectionHook,ve.resolvedSelection)),[we,Se,Ce,ve.effectiveSelectionHook,ve.resolvedSelection]),Fe=Do(e=>{let t=e.data,o=e.allSeries,i=e.xValue??t?.__x,a=t?.__valA,r=t?.__valB;if(o&&o.length>0){let e=o.find(e=>"line-A"===e.group),t=o.find(e=>"line-B"===e.group);null!=e?.value&&Number.isFinite(e.value)&&(a=e.value),null!=t?.value&&Number.isFinite(t.value)&&(r=t.value)}if(null!=i&&(null==a||null==r)){let e=ue.find(e=>re(e)===i);e&&(null==a&&(a=ne(e)),null==r&&(r=le(e)))}let n=e=>null!=e&&Number.isFinite(e)?(Math.round(100*e)/100).toString():"—",s=l&&null!=i?l(i):null!=i?String(i):"";/* */
33
+ return No("div",{className:"semiotic-tooltip",style:Ot,children:[s&&/* @__PURE__ */To("div",{style:{fontWeight:600,marginBottom:4},children:s}),
34
+ /* @__PURE__ */No("div",{style:{display:"flex",alignItems:"center",gap:6},children:[
35
+ /* @__PURE__ */To("span",{style:{width:10,height:10,background:p,display:"inline-block",borderRadius:2}}),
36
+ /* @__PURE__ */No("span",{children:[d,": ",n(a)]})]}),
37
+ /* @__PURE__ */No("div",{style:{display:"flex",alignItems:"center",gap:6},children:[
38
+ /* @__PURE__ */To("span",{style:{width:10,height:10,background:f,display:"inline-block",borderRadius:2}}),
39
+ /* @__PURE__ */No("span",{children:[u,": ",n(r)]})]}),null!=a&&null!=r&&Number.isFinite(a)&&Number.isFinite(r)&&/* @__PURE__ */No("div",{style:{marginTop:4,opacity:.7},children:["Δ = ",n(a-r)]})]})},[ue,re,ne,le,l,p,f,d,u]),{tooltipContent:Pe,tooltipMode:Be}=Io(()=>tt({tooltip:k,defaultTooltipContent:Fe,multiDefaultContent:Fe}),[k,Fe]),Me=Io(()=>_e(A,{stops:[{offset:0,opacity:.85},{offset:1,opacity:.15}]}),[A]);if(ve.earlyReturn)return ve.earlyReturn;let De={chartType:"mixed",data:ye,xAccessor:"__x",yAccessor:"__y",y0Accessor:"__y0",groupAccessor:"__diffSegment",areaGroups:ge,curve:v,areaStyle:Le,lineStyle:He,...b&&{pointStyle:Ie},size:[U,K],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ve.margin,showAxes:i.showAxes,xLabel:ie,yLabel:ae,xFormat:l,yFormat:s,enableHover:Q,showGrid:q,...Me&&{gradientFill:Me},...ve.legendBehaviorProps,...Te({title:J,description:ee,summary:te,accessibleTable:oe,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),tooltipContent:Pe,..."multi"===Be&&{tooltipMode:"multi"},...Ne({linkedHover:F,selection:I,onObservation:N,onClick:O,hoverHighlight:W,hoverRadius:e.hoverRadius,mobileInteraction:ve.mobileInteraction,customHoverBehavior:ve.customHoverBehavior,customClickBehavior:ve.customClickBehavior}),...C&&C.length>0&&{annotations:C},...L&&{xExtent:L},...R&&{yExtent:R},...ve.crosshairProps,..._};/* */
40
+ return To(nt,{componentName:"DifferenceChart",width:U,height:K,children:/* @__PURE__ */To(Ae,{ref:o,...De})})}),"DifferenceChart");import{useMemo as Wo,forwardRef as Eo,useRef as jo}from"react";import{jsx as zo}from"react/jsx-runtime";var Go=/* @__PURE__ */at(/* @__PURE__ */Eo(function(e,t){ke(me);let o=jo(null),i=Ue(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,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}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",areaBy:m,lineDataAccessor:d="coordinates",colorBy:u,colorScheme:p,styleRules:f,curve:y="monotoneX",areaOpacity:g=.7,showLine:b=!0,lineWidth:x=2,showPoints:v=!1,pointRadius:w=3,normalize:A=!1,baseline:S="zero",stackOrder:k,tooltip:C,annotations:L,xExtent:R,yExtent:H,frameProps:I={},selection:F,linkedHover:P,onObservation:B,onClick:M,hoverHighlight:D,chartId:T,loading:N,loadingContent:O,emptyContent:W,legendInteraction:E,legendPosition:j,color:z,stroke:G,strokeWidth:$,opacity:V}=e,{width:X,height:Y,enableHover:U,showGrid:K,showLegend:Q,title:q,description:Z,summary:J,accessibleTable:ee,xLabel:te,yLabel:oe}=i,ie=Wo(()=>st(a),[a]),ae=u||m;ce(t,{variant:"xy",frameRef:o});let re=se({responsive:e,data:ie,rawData:a,colorBy:ae,colorScheme:p,legendInteraction:E,legendPosition:j,frameLegend:I,selection:F,linkedHover:P,fallbackFields:ae?["string"==typeof ae?ae:""]:[],unwrapData:!1,onObservation:B,onClick:M,hoverHighlight:D,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"StackedAreaChart",chartId:T,showLegend:Q,userMargin:r,marginDefaults:i.marginDefaults,loading:N,loadingContent:O,emptyContent:W,width:X,height:Y,hasTitle:!!q,axisChrome:gt(I,{showAxes:i.showAxes,xLabel:te,yLabel:oe})}),le=Wo(()=>Qe(c,h),[c,h]),{flattenedData:he,lineStyle:de,pointStyle:ue,defaultTooltipContent:pe}=_({safeData:ie,data:a,areaBy:m,lineDataAccessor:d,colorBy:ae,colorScale:re.colorScale,color:z,stroke:G,strokeWidth:$,opacity:V,effectiveSelectionHook:re.effectiveSelectionHook,resolvedSelection:re.resolvedSelection,areaOpacity:g,showLine:b,lineWidth:x,showPoints:v,pointRadius:w,xAccessor:c,yAccessor:h,xLabel:te,yLabel:oe,xFormat:l,yFormat:s,groupField:m||u,styleRules:f,ruleContext:le}),fe=ne({componentName:"StackedAreaChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),ye={chartType:"stackedarea",...null!=a&&{data:he},xAccessor:c,yAccessor:h,groupAccessor:m||void 0,curve:y,normalize:A,baseline:A?"zero":S,stackOrder:k,lineStyle:de,...v&&ue&&{pointStyle:ue},size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:re.margin,showAxes:i.showAxes,xLabel:te,yLabel:oe,xFormat:l,yFormat:s,enableHover:U,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:K,...re.legendBehaviorProps,...Te({title:q,description:Z,summary:J,accessibleTable:ee,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...tt({tooltip:C,defaultTooltipContent:pe,multiDefaultContent:ot({xFormat:l,yFormat:s})}),...Ne({linkedHover:P,selection:F,onObservation:B,onClick:M,hoverHighlight:D,hoverRadius:e.hoverRadius,mobileInteraction:re.mobileInteraction,customHoverBehavior:re.customHoverBehavior,customClickBehavior:re.customClickBehavior}),...L&&L.length>0&&{annotations:L},...R&&{xExtent:R},...H&&{yExtent:H},...re.crosshairProps,...I};return re.earlyReturn?re.earlyReturn:fe?/* @__PURE__ */zo(rt,{componentName:"StackedAreaChart",message:fe,width:X,height:Y}):/* @__PURE__ */zo(nt,{componentName:"StackedAreaChart",width:X,height:Y,children:/* @__PURE__ */zo(Ae,{ref:o,...ye})})}),"StackedAreaChart");import{useMemo as $o,forwardRef as Vo,useRef as Xo}from"react";import{scaleSequential as Yo}from"d3-scale";import{jsx as Uo}from"react/jsx-runtime";var Ko=/* @__PURE__ */at(/* @__PURE__ */Vo(function(e,t){ke(pe);let o=Xo(null);ce(t,{variant:"xy",frameRef:o});let i=Ue(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:void 0,enableHover:e.enableHover,showLegend:void 0,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}),{data:a,margin:r,className:n,xAccessor:l="x",yAccessor:s="y",valueAccessor:c="value",xFormat:h,yFormat:m,colorScheme:d,customColorScale:u,showValues:p=!1,valueFormat:f,cellBorderColor:y="#fff",cellBorderWidth:g=1,tooltip:b,annotations:x,heatmapAggregation:v,heatmapXBins:w,heatmapYBins:A,styleRules:S,xExtent:k,yExtent:C,frameProps:L={},selection:R,linkedHover:_,onObservation:H,onClick:I,hoverHighlight:F,chartId:P,loading:B,loadingContent:M,emptyContent:D,showLegend:T,legendPosition:N,legend:O,legendInteraction:W,stroke:E,strokeWidth:j,opacity:z}=e,{width:G,height:$,enableHover:V,title:X,description:Y,summary:U,accessibleTable:K,xLabel:Q,yLabel:q}=i,Z=lt(B,G,$,M,e),J=Z?null:je(a,G,$,D,e),ee=$o(()=>st(a),[a]),te=$e(),oe=d??te??"blues",ie=("string"==typeof L.colorScheme?L.colorScheme:void 0)??oe,ae="function"==typeof L.heatmapColorScale?L.heatmapColorScale:"custom"===ie&&"function"==typeof u?u:void 0,re=T??!1,se=N??"right",{activeSelectionHook:me,customHoverBehavior:de,customClickBehavior:ue,crosshairSourceId:fe}=Xe({selection:R,linkedHover:_,fallbackFields:[],onObservation:H,onClick:I,chartType:"Heatmap",chartId:P,hoverHighlight:F,colorByField:void 0,mobileInteraction:i.mobileInteraction}),ye=le(R),ge=Ye(_,fe);St(W,void 0,[]);let be=$o(()=>"function"==typeof c?e=>c(e):e=>e[c],[c]),xe=$o(()=>{let e=ee.map(be);return Gt(e)},[ee,be]),ve=$o(()=>{if(ae)return ae;let e=Rt(ie);return Yo(e).domain(xe)},[ie,ae,xe]),we=$o(()=>{let e=Number.isFinite(g)?Math.max(0,g):1;return()=>({stroke:y,strokeWidth:e})},[y,g]),Se=$o(()=>he(l,s,c),[l,s,c]),Ce=$o(()=>et(we,S,Se),[we,S,Se]),Le=$o(()=>Ct(Ce,me,ye),[me,Ce,ye]),Re=$o(()=>De([{label:Q||Be(l),accessor:l,role:"x",format:h},{label:q||Be(s),accessor:s,role:"y",format:m},{label:Be(c),accessor:c,role:"value",format:f}]),[l,s,Q,q,c,h,m,f]),_e=ne({componentName:"Heatmap",data:a,accessors:{xAccessor:l,yAccessor:s,valueAccessor:c}}),He=$o(()=>re?{gradient:{colorFn:e=>ve(e),domain:xe,label:"string"==typeof c?c:"value",format:f},legendDistance:O?.legendDistance}:void 0,[re,ve,xe,c,f,O?.legendDistance]),{margin:Ie,legend:Fe,legendPosition:Pe,legendMarginReserved:Me}=wt({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:se,userMargin:r,defaults:i.marginDefaults,additionalLegend:He,chartWidth:G,chartHeight:$,legendLayout:L.legendLayout,frameLegend:L,hasTitle:!!X,axisChrome:gt(L,{showAxes:i.showAxes,xLabel:Q,yLabel:q})}),We={chartType:"heatmap",...null!=a&&{data:ee},xAccessor:l,yAccessor:s,valueAccessor:c,colorScheme:"custom"!==ie?ie:void 0,...ae&&{heatmapColorScale:ae},areaStyle:Le,showValues:p,heatmapValueFormat:f,size:[G,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Ie,showAxes:i.showAxes,xLabel:Q,yLabel:q,xFormat:h,yFormat:m,enableHover:V,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Fe&&{legend:Fe,legendPosition:Pe},...Me&&{__legendMarginReservedFor:Fe},...Te({title:X,description:Y,summary:U,accessibleTable:K,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Oe({tooltip:b,defaultTooltipContent:Re}),...Ne({linkedHover:_,selection:R,onObservation:H,onClick:I,hoverHighlight:F,hoverRadius:e.hoverRadius,mobileInteraction:i.mobileInteraction,customHoverBehavior:de,customClickBehavior:ue}),...x&&x.length>0&&{annotations:x},...v&&{heatmapAggregation:v},...null!=w&&{heatmapXBins:w},...null!=A&&{heatmapYBins:A},...k&&{xExtent:k},...C&&{yExtent:C},...ge,...L};return Z||J||(_e?/* @__PURE__ */Uo(rt,{componentName:"Heatmap",message:_e,width:G,height:$}):/* @__PURE__ */Uo(nt,{componentName:"Heatmap",width:G,height:$,children:/* @__PURE__ */Uo(Ae,{ref:o,...We})}))}),"Heatmap");import{useMemo as Qo,useCallback as qo,forwardRef as Zo,useRef as Jo}from"react";import{jsx as ei}from"react/jsx-runtime";var ti=/* @__PURE__ */at(/* @__PURE__ */Zo(function(t,o){be(Z),ke(ue);let i=Jo(null),a=Ue(t.mode,{width:t.width,height:t.height,showAxes:t.showAxes,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,description:t.description,summary:t.summary,accessibleTable:t.accessibleTable,xLabel:t.xLabel,yLabel:t.yLabel,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),{data:r,margin:n,className:l,xFormat:s,yFormat:c,xAccessor:h="x",yAccessor:m="y",sizeBy:d,sizeRange:u=[5,40],colorBy:p,colorScheme:f,styleRules:y,bubbleOpacity:g=.6,bubbleStrokeWidth:b=1,bubbleStrokeColor:x="white",tooltip:v,marginalGraphics:w,pointIdAccessor:A,annotations:S,regression:k,xExtent:C,yExtent:L,pulse:R,decay:_,staleness:H,frameProps:I={},selection:F,linkedHover:P,linkedBrush:B,brush:M,onBrush:D,onObservation:T,onClick:N,hoverHighlight:O,chartId:W,loading:E,loadingContent:j,emptyContent:z,legendInteraction:G,legendPosition:$,color:V,stroke:X,strokeWidth:Y,opacity:U}=t,{width:K,height:Q,enableHover:q,showGrid:ee,showLegend:te,title:oe,description:ae,summary:re,accessibleTable:le,xLabel:he,yLabel:me}=a,de=Qo(()=>st(r),[r]),pe=void 0===r,fe=se({responsive:t,data:de,rawData:r,colorBy:p,colorScheme:f,legendInteraction:G,legendPosition:$,frameLegend:I,selection:F,linkedHover:P,fallbackFields:p?["string"==typeof p?p:""]:[],unwrapData:!1,onObservation:T,onClick:N,hoverHighlight:O,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"BubbleChart",chartId:W,showLegend:te,userMargin:n,marginDefaults:a.marginDefaults,loading:E,loadingContent:j,emptyContent:z,width:K,height:Q,hasTitle:!!oe,axisChrome:gt(I,{showAxes:a.showAxes,xLabel:he,yLabel:me})}),{domain:ye,trackPushed:ge,reset:xe}=e({accessor:d,data:de,isPushMode:pe}),ve=qo(e=>{ge([e]),i.current?.push(e)},[ge]),we=qo(e=>{ge(e),i.current?.pushMany(e)},[ge]);ce(o,{variant:"xy",frameRef:i,overrides:{push:ve,pushMany:we,clear:()=>{xe(),i.current?.clear()}}});let{brushStreamProps:Ce}=Se({brush:M,onBrush:D,linkedBrush:B,xAccessor:h,yAccessor:m,defaultDimension:"xy"}),Le=Qo(()=>({stroke:x,strokeWidth:b}),[x,b]),Re=Qo(()=>ye??[0,1],[ye]),_e=qo(e=>Bt(e,d,u,Re),[d,u,Re]),He=Qo(()=>Qe(h,m),[h,m]),Ie=J({colorBy:p,colorScale:fe.colorScale,color:V,fillOpacity:g,radiusFn:_e,baseStyleExtras:Le,stroke:X,strokeWidth:Y,opacity:U,styleRules:y,ruleContext:He,effectiveSelectionHook:fe.effectiveSelectionHook,resolvedSelection:fe.resolvedSelection}),Fe=Qo(()=>De([{label:he||Be(h),accessor:h,role:"x",format:s},{label:me||Be(m),accessor:m,role:"y",format:c},{label:Be(d),accessor:d,role:"size"},...p?[{label:Be(p),accessor:p,role:"color"}]:[]]),[h,m,he,me,d,p,s,c]);if(fe.earlyReturn)return fe.earlyReturn;let Pe=ne({componentName:"BubbleChart",data:r,accessors:{xAccessor:h,yAccessor:m},requiredProps:{sizeBy:d}});if(Pe)/* */return ei(rt,{componentName:"BubbleChart",message:Pe,width:K,height:Q});let Me=ie(k),We=Me?[Me,...S||[]]:S,Ee={chartType:"bubble",...null!=r&&{data:de},xAccessor:h,yAccessor:m,colorAccessor:p||void 0,sizeAccessor:d,sizeRange:u,pointStyle:Ie,colorScheme:f,size:[K,Q],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:fe.margin,showAxes:a.showAxes,xLabel:he,yLabel:me,xFormat:s,yFormat:c,enableHover:q,showGrid:ee,...fe.legendBehaviorProps,...Te({title:oe,description:ae,summary:re,accessibleTable:le,className:l,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...Oe({tooltip:v,defaultTooltipContent:Fe}),...Ne({linkedHover:P,selection:F,onObservation:T,onClick:N,hoverHighlight:O,hoverRadius:t.hoverRadius,mobileInteraction:fe.mobileInteraction,customHoverBehavior:fe.customHoverBehavior,customClickBehavior:fe.customClickBehavior}),...w&&{marginalGraphics:w},...A&&{pointIdAccessor:A},...R&&{pulse:R},..._&&{decay:_},...H&&{staleness:H},...We&&We.length>0&&{annotations:We},...C&&{xExtent:C},...L&&{yExtent:L},...fe.crosshairProps,...Ce,...I};/* */
41
+ return ei(nt,{componentName:"BubbleChart",width:K,height:Q,children:/* @__PURE__ */ei(Ae,{ref:i,...Ee})})}),"BubbleChart"),oi={width:800,height:400},ii={cellSize:150,cellGap:4,labelWidth:40};import*as ai from"react";import{useMemo as ri,useCallback as ni,useState as li}from"react";import{useMemo as si,useCallback as ci,useRef as hi}from"react";import*as mi from"react";import{jsx as di}from"react/jsx-runtime";var ui=null,pi=null;import{jsx as fi,jsxs as yi}from"react/jsx-runtime";var gi="__splomIdx",bi={top:4,bottom:4,left:4,right:4};import{jsx as xi,jsxs as vi}from"react/jsx-runtime";var wi=/* @__PURE__ */at(function(e){let{brushMode:t="crossfilter",hoverMode:o=!0}=e,i={};return!o&&t&&(i.splom={resolution:t}),o&&(i["splom-hover"]={resolution:"union"}),/* @__PURE__ */xi(yt,{selections:i,children:/* @__PURE__ */xi(j,{...e})})},"ScatterplotMatrix");import{useState as Ai,useRef as Si,useEffect as ki,useMemo as Ci,useCallback as Li}from"react";import*as Ri from"react";import{jsx as _i}from"react/jsx-runtime";var Hi=null,Ii=null;import{jsx as Fi,jsxs as Pi}from"react/jsx-runtime";var Bi=/* @__PURE__ */at(function(e){te();let t=ut(void 0,{}),{data:o,width:i=t.width,height:a=t.height,margin:r,className:n,title:l,description:s,summary:c,xLabel:h,yLabel:m,xFormat:d,yFormat:u,xAccessor:p="x",yAccessor:f="y",lineBy:y,lineDataAccessor:g="coordinates",colorBy:b,colorScheme:x,curve:v="linear",lineWidth:w=2,styleRules:A,fillArea:S=!1,areaOpacity:k=.3,showPoints:C=!1,pointRadius:L=3,enableHover:R=!0,showAxes:_=!0,showGrid:H=!1,showLegend:I,legendPosition:F,tooltip:P,minimap:B={},renderBefore:M=!1,onBrush:D,onBrushEnd:T,onObservation:N,chartId:O,brushExtent:W,yExtent:E,frameProps:j={},loading:V,loadingContent:X,emptyContent:Y}=e,U=a+G(B),K=lt(V,i,U,X,e),Q=K?null:je(o,i,U,Y,e),q=Ci(()=>st(o),[o]),[Z,J]=Ai(null),ee=W??Z,ie=Si(null),[ae,re]=Ai(null),le=void 0!==q[0]?.[g],se=Ci(()=>{if(le)return q;if(y){let e=q.reduce((e,t)=>{let o="function"==typeof y?y(t):t[y];if(!e[o]){let t={[g]:[]};"string"==typeof y&&(t[y]=o),e[o]=t}return e[o][g].push(t),e},{});return Object.values(e)}return[{[g]:q}]},[q,y,g,le]),ce=Ci(()=>le||y?se.flatMap(e=>{let t=e[g]||[];return y&&"string"==typeof y?t.map(t=>({...t,[y]:e[y]})):t}):q,[se,g,le,y,q]),he=Ve(q,b,x),me=Ci(()=>Qe(p,f),[p,f]),de=oe({lineWidth:w,colorBy:b,colorScale:he,fillArea:S,areaOpacity:k,styleRules:A,ruleContext:me}),ue=Ci(()=>{if(B.lineStyle)return B.lineStyle},[B.lineStyle]),pe=oe({lineWidth:1,colorBy:b,colorScale:he,styleRules:A,ruleContext:me}),fe=ue??pe,ye=Ci(()=>C?et(e=>{let t={r:L,fillOpacity:1};return t.fill=b?Ft(e.parentLine||e,b,he):Ht,t},A,me,e=>e.parentLine||e):void 0,[C,L,b,he,A,me]),{legend:ge,margin:be,legendPosition:xe,legendMarginReserved:ve}=wt({data:se,colorBy:b,colorScale:he,showLegend:I,legendPosition:F,userMargin:r,chartWidth:i,chartHeight:a,frameLegend:j,hasTitle:!!l,axisChrome:gt(j,{showAxes:_,xLabel:h,yLabel:m})}),we=B.height||60,Se=$(B),ke=Ci(()=>({top:B.margin?.top??Se.top,bottom:B.margin?.bottom??Se.bottom,left:B.margin?.left??be.left,right:B.margin?.right??be.right}),[B.margin,Se.top,Se.bottom,be]),Ce=B.brushDirection||"x",Le=Math.max(0,i-ke.left-ke.right),Re=E?.[0],_e=E?.[1];ki(()=>{let e=0,t=!1,o=0,i=()=>{if(t)return;let a=ie.current?.getScales?.(),r=(e,t)=>Math.abs(Math.max(...e)-Math.min(...e)-t)<.5;a&&(o>=60||r(a.x.range(),Le)&&r(a.y.range(),we))?re(a):(o++,e=requestAnimationFrame(i))};return e=requestAnimationFrame(i),()=>{t=!0,e&&cancelAnimationFrame(e)}},[o,Le,we,ke.top,ke.bottom,Re,_e]);let He=Li(e=>{if(W||J(e),D?.(e),!N)return;if(!e)return void N({type:"brush-end",timestamp:Date.now(),chartType:"MinimapChart",chartId:O});let t=ae?.["x"===Ce?"y":"x"].domain().map(Number)??[e[0],e[1]];N({type:"brush",extent:"x"===Ce?{x:e,y:t}:{x:t,y:e},timestamp:Date.now(),chartType:"MinimapChart",chartId:O})},[W,D,N,O,ae,Ce]),Ie=Ci(()=>De([{label:h||Be(p),accessor:p,role:"x",format:d},{label:m||Be(f),accessor:f,role:"y",format:u}]),[p,f,h,m,d,u]),Fe=ne({componentName:"MinimapChart",data:o,accessors:{xAccessor:p,yAccessor:f}}),Pe=S?"area":"line",Me={chartType:Pe,data:ce,xAccessor:p,yAccessor:f,groupAccessor:y||void 0,curve:v,lineStyle:de,...C&&{pointStyle:ye},size:[i,a],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:be,showAxes:_,xLabel:h,yLabel:m,xFormat:d,yFormat:u,enableHover:R,showGrid:H,...ge&&{legend:ge,legendPosition:xe},...ve&&{__legendMarginReservedFor:ge},...l&&{title:l},...s&&{description:s},...c&&{summary:c},...void 0!==e.accessibleTable&&{accessibleTable:e.accessibleTable},...void 0!==e.animate&&{animate:e.animate},...void 0!==e.hoverRadius&&{hoverRadius:e.hoverRadius},...tt({tooltip:P,defaultTooltipContent:Ie}),...ee&&"x"===Ce&&{xExtent:ee},...E&&{yExtent:E},...ee&&"y"===Ce&&{yExtent:ee},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...j},Te={chartType:Pe,data:ce,xAccessor:p,yAccessor:f,groupAccessor:y||void 0,curve:v,lineStyle:fe,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},size:[i,we+ke.top+ke.bottom],margin:ke,showAxes:B.showAxes??!1,background:B.background,enableHover:!1,accessibleTable:!1,description:`${s||l||"Chart"} overview minimap`,animate:!1,...E&&{yExtent:E}},Ne=!!B.handles||!!B.showExtentLabels||!!B.renderHandle,Oe=/* @__PURE__ */Pi("div",{style:{position:"relative",width:i,overflow:Ne?"visible":"hidden"},children:[
42
+ /* @__PURE__ */Fi(Ae,{ref:ie,...Te}),
43
+ /* @__PURE__ */Fi(z,{config:B,scales:ae,margin:ke,plotWidth:Le,plotHeight:we,brushDirection:Ce,extent:ee,axisFormat:"x"===Ce?d:u,onBrush:He,onBrushEnd:T,onObservation:N,chartId:O})]},"minimap"),We=/* @__PURE__ */Fi("div",{style:{overflow:"hidden"},children:/* @__PURE__ */Fi(Ae,{...Me})},"main");return K||Q||(Fe?/* @__PURE__ */Fi(rt,{componentName:"MinimapChart",message:Fe,width:i,height:U}):/* @__PURE__ */Fi(nt,{componentName:"MinimapChart",width:i,height:a,children:/* @__PURE__ */Pi("div",{className:"minimap-chart"+(n?` ${n}`:""),role:"group","aria-label":s||l||"Chart with overview minimap",children:[M?Oe:We,M?We:Oe]})}))},"MinimapChart");import{useMemo as Mi,forwardRef as Di,useRef as Ti}from"react";var Ni={topLeft:{label:"Low / High",color:"#E9C46A",opacity:.08},topRight:{label:"High / High",color:"#2A9D8F",opacity:.08},bottomLeft:{label:"Low / Low",color:"#E76F51",opacity:.08},bottomRight:{label:"High / Low",color:"#86BBD8",opacity:.08}};import{Fragment as Oi,jsx as Wi,jsxs as Ei}from"react/jsx-runtime";var ji=/* @__PURE__ */at(/* @__PURE__ */Di(function(e,t){ke(de);let o=Ti(null);ce(t,{variant:"xy",frameRef:o});let i=Ue(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,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}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",xCenter:m,yCenter:d,quadrants:u,centerlineStyle:p={},showQuadrantLabels:f=!0,quadrantLabelSize:y=12,colorBy:g,colorScheme:b,styleRules:x,sizeBy:v,sizeRange:w=[3,15],pointRadius:A=5,pointOpacity:S=.8,tooltip:k,pointIdAccessor:C,annotations:L,frameProps:R={},selection:_,linkedHover:H,onObservation:I,onClick:F,hoverHighlight:P,chartId:B,loading:M,loadingContent:D,emptyContent:T,legendInteraction:N,legendPosition:O,color:W,stroke:E,strokeWidth:j,opacity:z}=e,{width:G,height:$,enableHover:X,showGrid:Y,showLegend:U,title:K,description:Q,summary:q,accessibleTable:Z,xLabel:ee,yLabel:te}=i,oe=Mi(()=>({topLeft:V(Ni.topLeft,u?.topLeft),topRight:V(Ni.topRight,u?.topRight),bottomLeft:V(Ni.bottomLeft,u?.bottomLeft),bottomRight:V(Ni.bottomRight,u?.bottomRight)}),[u]),ie=Mi(()=>st(a),[a]),ae=se({responsive:e,data:ie,rawData:a,colorBy:g,colorScheme:b,legendInteraction:N,legendPosition:O,frameLegend:R,selection:_,linkedHover:H,fallbackFields:"string"==typeof g?[g]:[],unwrapData:!1,onObservation:I,onClick:F,hoverHighlight:P,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"QuadrantChart",chartId:B,showLegend:U,userMargin:r,marginDefaults:i.marginDefaults,loading:M,loadingContent:D,emptyContent:T,width:G,height:$,hasTitle:!!K,axisChrome:gt(R,{showAxes:i.showAxes,xLabel:ee,yLabel:te})});ct("QuadrantChart",ie,"xAccessor",c),ct("QuadrantChart",ie,"yAccessor",h);let re=Mi(()=>{if(!ie.length)return;let e="function"==typeof c?c:e=>+e[c],t="function"==typeof h?h:e=>+e[h],o=1/0,i=-1/0,a=1/0,r=-1/0;for(let n of ie){let l=e(n),s=t(n);isFinite(l)&&(l<o&&(o=l),l>i&&(i=l)),isFinite(s)&&(s<a&&(a=s),s>r&&(r=s))}if(null!=m&&isFinite(m)&&(m<o&&(o=m),m>i&&(i=m)),null!=d&&isFinite(d)&&(d<a&&(a=d),d>r&&(r=d)),o===1/0)return;let n=.1*(i-o)||1,l=.1*(r-a)||1;return{xExtent:[o-n,i+n],yExtent:[a-l,r+l]}},[ie,c,h,m,d]),le=Mi(()=>{if(!v||0===ie.length)return;let e=ie.map(e=>"function"==typeof v?v(e):e[v]).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0!==e.length?Gt(e):void 0},[ie,v]),he=Mi(()=>"function"==typeof c?c:e=>+e[c],[c]),me=Mi(()=>"function"==typeof h?h:e=>+e[h],[h]),ue=Mi(()=>e=>{let t=he(e),o=me(e),i=null!=m?t>=m:void 0,a=null!=d?o>=d:void 0;return void 0===a||void 0===i?W||Ht:a&&i?oe.topRight.color:a&&!i?oe.topLeft.color:!a&&i?oe.bottomRight.color:oe.bottomLeft.color},[he,me,m,d,oe,W]),pe=Mi(()=>v?e=>Bt(e,v,w,le):void 0,[v,w,le]),fe=Mi(()=>Qe(c,h),[c,h]),ye=J({colorBy:g,colorScale:ae.colorScale,color:W,pointRadius:A,fillOpacity:S,radiusFn:pe,fallbackFill:ue,stroke:E,strokeWidth:j,opacity:z,styleRules:x,ruleContext:fe,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection}),ge=Mi(()=>{if(!ie.length)return;let e=/* @__PURE__ */new Set;"string"==typeof c&&e.add(c),"string"==typeof h&&e.add(h),"string"==typeof g&&e.add(g),"string"==typeof v&&e.add(v);let t=ie[0];for(let o of Object.keys(t))if(!o.startsWith("_")&&!e.has(o)&&"string"==typeof t[o])return o},[ie,c,h,g,v]),be=Mi(()=>De([...ge?[{label:ge,accessor:ge,role:"title"}]:[],{label:ee||Be(c),accessor:c,role:"x",format:l},{label:te||Be(h),accessor:h,role:"y",format:s},...g?[{label:Be(g),accessor:g,role:"color"}]:[],...v?[{label:Be(v),accessor:v,role:"size"}]:[]]),[ge,c,h,ee,te,g,v,l,s]),xe=ne({componentName:"QuadrantChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),ve=Mi(()=>{let e={stroke:p.stroke||"#999",strokeWidth:p.strokeWidth??1,dashArray:p.strokeDasharray||[]};return[(t,o,i,a)=>{if(!i?.x||!i?.y)return;let r=a.width,n=a.height,l=null!=m?i.x(m):r/2,s=null!=d?i.y(d):n/2;if(null!=m&&!isFinite(l)||null!=d&&!isFinite(s))return;let c=Math.max(0,Math.min(r,l)),h=Math.max(0,Math.min(n,s)),u=[{config:oe.topLeft,x:0,y:0,w:c,h:h},{config:oe.topRight,x:c,y:0,w:r-c,h:h},{config:oe.bottomLeft,x:0,y:h,w:c,h:n-h},{config:oe.bottomRight,x:c,y:h,w:r-c,h:n-h}];for(let e of u)e.w<=0||e.h<=0||(t.fillStyle=e.config.color,t.globalAlpha=e.config.opacity??.08,t.fillRect(e.x,e.y,e.w,e.h));t.globalAlpha=1,t.strokeStyle=e.stroke,t.lineWidth=e.strokeWidth,e.dashArray.length>0&&t.setLineDash(e.dashArray),t.beginPath(),t.moveTo(c,0),t.lineTo(c,n),t.stroke(),t.beginPath(),t.moveTo(0,h),t.lineTo(r,h),t.stroke(),t.setLineDash([])}]},[m,d,oe,p]),we=Mi(()=>f?[...ve,(e,t,o,i)=>{if(!o?.x||!o?.y)return;let a=i.width,r=i.height,n=null!=m?o.x(m):a/2,l=null!=d?o.y(d):r/2;if(null!=m&&!isFinite(n)||null!=d&&!isFinite(l))return;Math.max(0,Math.min(a,n)),Math.max(0,Math.min(r,l));let s=Dt(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif";e.font=`600 ${y}px ${s}`,e.globalAlpha=.5,e.fillStyle=oe.topLeft.color,e.textAlign="left",e.textBaseline="top",e.fillText(oe.topLeft.label,8,8),e.fillStyle=oe.topRight.color,e.textAlign="right",e.textBaseline="top",e.fillText(oe.topRight.label,a-8,8),e.fillStyle=oe.bottomLeft.color,e.textAlign="left",e.textBaseline="bottom",e.fillText(oe.bottomLeft.label,8,r-8),e.fillStyle=oe.bottomRight.color,e.textAlign="right",e.textBaseline="bottom",e.fillText(oe.bottomRight.label,a-8,r-8),e.globalAlpha=1}]:ve,[ve,f,y,oe,m,d]),Se=Mi(()=>{let e=R.canvasPreRenderers||[];return[...we,...e]},[we,R.canvasPreRenderers]),Ce=Mi(()=>{let e={stroke:p.stroke||"#999",strokeWidth:p.strokeWidth??1,dashArray:p.strokeDasharray?Array.isArray(p.strokeDasharray)?p.strokeDasharray.join(","):p.strokeDasharray:void 0};return[(t,o,i)=>{if(!o?.x||!o?.y)return null;let a=i.width,r=i.height,n=null!=m?o.x(m):a/2,l=null!=d?o.y(d):r/2;if(null!=m&&!isFinite(n)||null!=d&&!isFinite(l))return null;let s=Math.max(0,Math.min(a,n)),c=Math.max(0,Math.min(r,l)),h=[{config:oe.topLeft,x:0,y:0,w:s,h:c},{config:oe.topRight,x:s,y:0,w:a-s,h:c},{config:oe.bottomLeft,x:0,y:c,w:s,h:r-c},{config:oe.bottomRight,x:s,y:c,w:a-s,h:r-c}];/* */
44
+ return Ei(Oi,{children:[h.map((e,t)=>e.w>0&&e.h>0?/* @__PURE__ */Wi("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:e.config.color,opacity:e.config.opacity??.08},`qf-${t}`):null),
45
+ /* @__PURE__ */Wi("line",{x1:s,y1:0,x2:s,y2:r,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),
46
+ /* @__PURE__ */Wi("line",{x1:0,y1:c,x2:a,y2:c,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),f&&/* @__PURE__ */Ei(Oi,{children:[
47
+ /* @__PURE__ */Wi("text",{x:8,y:8+y,fill:oe.topLeft.color,fontWeight:600,fontSize:y,opacity:.5,children:oe.topLeft.label}),
48
+ /* @__PURE__ */Wi("text",{x:a-8,y:8+y,fill:oe.topRight.color,fontWeight:600,fontSize:y,opacity:.5,textAnchor:"end",children:oe.topRight.label}),
49
+ /* @__PURE__ */Wi("text",{x:8,y:r-8,fill:oe.bottomLeft.color,fontWeight:600,fontSize:y,opacity:.5,children:oe.bottomLeft.label}),
50
+ /* @__PURE__ */Wi("text",{x:a-8,y:r-8,fill:oe.bottomRight.color,fontWeight:600,fontSize:y,opacity:.5,textAnchor:"end",children:oe.bottomRight.label})]})]})}]},[m,d,oe,p,f,y]);if(ae.earlyReturn)return ae.earlyReturn;let Le={chartType:"scatter",...null!=a&&{data:ie},xAccessor:c,yAccessor:h,colorAccessor:g||void 0,sizeAccessor:v||void 0,sizeRange:w,pointStyle:ye,colorScheme:b,size:[G,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:ae.margin,showAxes:i.showAxes,xLabel:ee,yLabel:te,xFormat:l,yFormat:s,enableHover:X,showGrid:Y,...re&&{xExtent:re.xExtent,yExtent:re.yExtent},...ae.legendBehaviorProps,...K&&{title:K},...Q&&{description:Q},...q&&{summary:q},...void 0!==Z&&{accessibleTable:Z},...n&&{className:n},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===k?()=>null:!0===k||void 0===k?be:it(k)||be,...Ne({linkedHover:H,selection:_,onObservation:I,onClick:F,hoverHighlight:P,hoverRadius:e.hoverRadius,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...C&&{pointIdAccessor:C},...L&&L.length>0&&{annotations:L},canvasPreRenderers:Se,...ae.crosshairProps,...R,...Se.length>0&&{canvasPreRenderers:Se},svgPreRenderers:Ce};return xe?/* @__PURE__ */Wi(rt,{componentName:"QuadrantChart",message:xe,width:G,height:$}):/* @__PURE__ */Wi(nt,{componentName:"QuadrantChart",width:G,height:$,children:/* @__PURE__ */Wi(Ae,{ref:o,...Le})})}),"QuadrantChart");import*as zi from"react";import{useMemo as Gi,useCallback as $i,forwardRef as Vi,useRef as Xi,useImperativeHandle as Yi}from"react";var Ui="__ma_unitized",Ki="__ma_series";import{jsx as Qi}from"react/jsx-runtime";var qi=/* @__PURE__ */at(/* @__PURE__ */Vi(function(e,t){ke(Ce);let o=Xi(null),i=Xi([]),a=Xi(e.series);a.current=e.series,Yi(t,()=>{let e=()=>(a.current??[]).filter(e=>null!=e&&"object"==typeof e);return{push:t=>{if(!o.current)return;let a=e(),r=t;for(let e=0;e<a.length&&e<2;e++){let t=a[e],n=t.extent||i.current[e];if(!n)continue;let l=("function"==typeof t.yAccessor?t.yAccessor:e=>e[t.yAccessor])(r);null==l||!isFinite(l)||o.current.push({...r,[Ui]:K(l,n),[Ki]:t.label||`Series ${e+1}`})}},pushMany:t=>{if(!o.current)return;let a=e(),r=[];for(let e of t)for(let t=0;t<a.length&&t<2;t++){let o=a[t],n=o.extent||i.current[t];if(!n)continue;let l=("function"==typeof o.yAccessor?o.yAccessor:e=>e[o.yAccessor])(e);null==l||!isFinite(l)||r.push({...e,[Ui]:K(l,n),[Ki]:o.label||`Series ${t+1}`})}o.current.pushMany(r)},remove:e=>o.current?.remove(e)??[],update:(e,t)=>o.current?.update(e,t)??[],clear:()=>o.current?.clear(),getData:()=>o.current?.getData()??[],getScales:()=>o.current?.getScales()??null}},[]);let r=Ue(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,xLabel:e.xLabel,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},oi),{data:n,margin:l,className:s,xFormat:c,xAccessor:h="x",series:m,colorScheme:d,curve:u="monotoneX",lineWidth:p=2,styleRules:f,tooltip:y,annotations:g,frameProps:b={},selection:x,linkedHover:v,onObservation:w,onClick:A,hoverHighlight:S,chartId:k,loading:C,loadingContent:L,emptyContent:R,legendInteraction:_,legendPosition:H,stroke:I,strokeWidth:F,opacity:P}=e,{width:B,height:M,enableHover:D,showGrid:T,showLegend:N=!0,title:O,description:W,summary:E,accessibleTable:j,xLabel:z}=r,G=Gi(()=>st(n),[n]),$=Gi(()=>st(m),[m]),V=$,q=2===$.length,Z=Gi(()=>q?{...b.legendLayout,sideGutter:b.legendLayout?.sideGutter??70}:b.legendLayout,[b.legendLayout,q]);"production"!==process.env.NODE_ENV&&!q&&console.warn(`[MultiAxisLineChart] Expected exactly 2 series for dual-axis mode, got ${$.length}. Rendering as a standard multi-line chart.`);let J=lt(C,B,M,L,e),ee=J?null:je(n,B,M,R,e),te=Ge(),ie=Gi(()=>X(V,d,te),[V,d,te]),ae=Gi(()=>$.map((e,t)=>e.label||`Series ${t+1}`),[$]),{unitizedData:re,extents:le}=Gi(()=>{if(0===G.length){let e=$.map(e=>e.extent||null).filter(Boolean);return e.length===$.length&&(i.current=e),{unitizedData:[],extents:e.length===$.length?e:[]}}let e=$.map(e=>e.extent||U(G,e.yAccessor));if(i.current=e,!q){let t=[];for(let e of G)for(let o=0;o<$.length;o++){let i=$[o],a=("function"==typeof i.yAccessor?i.yAccessor:e=>e[i.yAccessor])(e);null!=a&&t.push({...e,[Ui]:a,[Ki]:ae[o]})}return{unitizedData:t,extents:e}}let t=[];for(let o of G)for(let i=0;i<2;i++){let a=$[i],r=("function"==typeof a.yAccessor?a.yAccessor:e=>e[a.yAccessor])(o);null!=r&&t.push({...o,[Ui]:K(r,e[i]),[Ki]:ae[i]})}return{unitizedData:t,extents:e}},[G,$,q,ae]),ce=Gi(()=>{if(!q||le.length<2)return;let e=e=>t=>{let o=Q(t,le[e]),i=$[e]?.format;return"function"==typeof i?i(o):Number.isInteger(o)?String(o):o.toFixed(1)},t=e(0),o=e(1);return[{orient:"left",label:ae[0],tickFormat:t},{orient:"right",label:ae[1],tickFormat:o},{orient:"bottom"}]},[q,le,$,ae]),he=Gi(()=>re.length>0?re:ae.map(e=>({[Ki]:e})),[re,ae]),me=se({responsive:e,data:he,rawData:n,colorBy:Ki,colorScheme:ie,legendInteraction:_,legendPosition:H,frameLegend:{...b,legendLayout:Z},selection:x,linkedHover:v,fallbackFields:[Ki],unwrapData:!1,onObservation:w,onClick:A,hoverHighlight:S,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"MultiAxisLineChart",chartId:k,showLegend:N,legendLayout:Z,userMargin:l,marginDefaults:q?{...r.marginDefaults,left:70,right:70}:r.marginDefaults,loading:C,loadingContent:L,emptyContent:R,width:B,height:M,hasTitle:!!O,axisChrome:gt(b,{showAxes:r.showAxes,xLabel:z,yLabel:ae[0],yLabelRight:ae[1],axes:ce})}),de=Gi(()=>{let e=/* @__PURE__ */new Map;return ae.forEach((t,o)=>e.set(t,ie[o])),e},[ae,ie]),ue=$i(e=>de.get(e[Ki])||ie[0],[de,ie]),pe=Gi(()=>Y(h,$),[h,$]),fe=oe({lineWidth:p,resolveStroke:ue,stroke:I,strokeWidth:F,opacity:P,effectiveSelectionHook:me.effectiveSelectionHook,resolvedSelection:me.resolvedSelection,styleRules:f,ruleContext:pe}),ye=Gi(()=>e=>{let t=e.data||e,o=t[Ki],i=ae.indexOf(o),a=t[Ui],r=q&&i>=0&&le[i]?Q(a,le[i]):a,n=i>=0&&$[i]?.format?$[i].format:e=>Number.isInteger(e)?String(e):e.toFixed(2),l="function"==typeof h?h(t):t[h];return zi.createElement("div",{style:{padding:"6px 10px",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-tooltip-font-size, 13px)"}},zi.createElement("div",{style:{fontWeight:600,marginBottom:4,color:ie[i]||"inherit"}},o),zi.createElement("div",null,`${"string"==typeof h?h:"x"}: `,c?c(l):String(l)),zi.createElement("div",null,`${o}: ${n(r)}`))},[ae,ie,le,q,$,h,c]),ge=$i(e=>{let t=(Array.isArray(e.allSeries)?e.allSeries:[]).map(e=>{let t=ae.indexOf(e.group),o=q&&t>=0&&le[t]?Q(e.value,le[t]):e.value,i=e.datum;return i&&(i={...i},delete i[Ui],delete i[Ki]),{...e,value:o,datum:i}}),o=e.data&&"object"==typeof e.data&&!Array.isArray(e.data)?{...e.data}:e.data;o&&"object"==typeof o&&!Array.isArray(o)&&(delete o[Ui],delete o[Ki]);let i={...e,data:o,allSeries:t};return delete i[Ui],delete i[Ki],i},[le,q,ae]),be=Gi(()=>ot({xFormat:c,yFormat:(e,t)=>$[ae.indexOf(t??"")]?.format?.(e)}),[c,$,ae]),xe=$i(e=>be(ge(e)),[be,ge]),ve=Gi(()=>{if(!Je(y)||"function"!=typeof y.content)return y;let e=e=>y.content(ge(e));return{mode:"multi",content:jt(y.content)?Et(e):e}},[ge,y]),we=Gi(()=>tt({tooltip:ve,defaultTooltipContent:ye,multiDefaultContent:xe}),[ye,xe,ve]);if(me.earlyReturn)return me.earlyReturn;let Se=ne({componentName:"MultiAxisLineChart",data:n,accessors:{xAccessor:h}}),Le=q?[0,1]:void 0,Re={chartType:"line",...null!=n&&{data:re},xAccessor:h,yAccessor:Ui,groupAccessor:Ki,lineStyle:fe,colorScheme:ie,size:[B,M],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:me.margin,showAxes:r.showAxes,...ce&&{axes:ce},xLabel:z,...q?{}:{yLabel:ae[0]},xFormat:c,...q&&Le&&{yExtent:Le},enableHover:D,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:T,curve:u,...me.legendBehaviorProps,...O&&{title:O},...W&&{description:W},...E&&{summary:E},...void 0!==j&&{accessibleTable:j},...s&&{className:s},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...we,...g&&{annotations:g},...Ne({linkedHover:v,selection:x,onObservation:w,onClick:A,hoverHighlight:S,hoverRadius:e.hoverRadius,mobileInteraction:me.mobileInteraction,customHoverBehavior:me.customHoverBehavior,customClickBehavior:me.customClickBehavior}),...me.crosshairProps,...b,...Z&&{legendLayout:Z}};return J||ee||(Se?/* @__PURE__ */Qi(rt,{componentName:"MultiAxisLineChart",message:Se,width:B,height:M}):/* @__PURE__ */Qi(nt,{componentName:"MultiAxisLineChart",width:B,height:M,children:/* @__PURE__ */Qi(Ae,{ref:o,...Re})}))}),"MultiAxisLineChart");import{useMemo as Zi,forwardRef as Ji,useRef as ea}from"react";import{jsx as ta}from"react/jsx-runtime";var oa=/* @__PURE__ */at(/* @__PURE__ */Ji(function(e,t){ke(ye);let o=ea(null);ce(t,{variant:"xy",frameRef:o});let i=Ue(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",highAccessor:h="high",lowAccessor:m="low",openAccessor:d,closeAccessor:u,candlestickStyle:p,styleRules:f,tooltip:y,annotations:g,xExtent:b,yExtent:x,frameProps:v={},selection:w,linkedHover:A,onObservation:S,onClick:k,chartId:C,loading:L,loadingContent:R,emptyContent:_}=e,{width:H,height:I,enableHover:F,showGrid:P,title:B,description:M,summary:D,accessibleTable:T,xLabel:N,yLabel:O}=i,W=Zi(()=>st(a),[a]),E=Zi(()=>{let e=i.marginDefaults;return"sparkline"===i.mode?{...e,top:0,bottom:0}:e},[i.marginDefaults,i.mode]),j=se({responsive:e,data:W,rawData:a,colorBy:void 0,colorScheme:void 0,legendInteraction:void 0,selection:w,linkedHover:A,fallbackFields:[],onObservation:S,onClick:k,chartType:"CandlestickChart",chartId:C,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,showLegend:!1,userMargin:r,marginDefaults:E,loading:L,loadingContent:R,emptyContent:_,width:H,height:I}),{activeSelectionHook:z,resolvedSelection:G,customHoverBehavior:$,customClickBehavior:V,margin:X}=j,Y=null==d||null==u;ct("CandlestickChart",W,"xAccessor",c),ct("CandlestickChart",W,"highAccessor",h),ct("CandlestickChart",W,"lowAccessor",m),Y||(ct("CandlestickChart",W,"openAccessor",d),ct("CandlestickChart",W,"closeAccessor",u));let U=Zi(()=>Qe(c,Y?h:u),[c,h,u,Y]),K=Zi(()=>Ct(et(void 0,f,U),z,G),[f,U,z,G]),Q=Zi(()=>{let e=[{label:N||Be(c),accessor:c,role:"x",format:l}];return Y?(e.push({label:"High",accessor:h,role:"y",format:s}),e.push({label:"Low",accessor:m,format:s})):(e.push({label:"Open",accessor:d,format:s}),e.push({label:"High",accessor:h,format:s}),e.push({label:"Low",accessor:m,format:s}),e.push({label:"Close",accessor:u,format:s})),De(e)},[c,N,l,s,h,m,d,u,Y]),q=ne({componentName:"CandlestickChart",data:a,accessors:{xAccessor:c,highAccessor:h,lowAccessor:m,...!Y&&{openAccessor:d,closeAccessor:u}}}),Z=Math.max(2,Math.min(12,Math.round(H/40))),J=H<=200?.02:.1,ee={chartType:"candlestick",...null!=a&&{data:W},xAccessor:c,yAccessor:h,highAccessor:h,lowAccessor:m,...!Y&&{openAccessor:d,closeAccessor:u},...p&&{candlestickStyle:p},...(z||f?.length)&&{pointStyle:K},scalePadding:Z,extentPadding:J,size:[H,I],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:X,showAxes:i.showAxes,xLabel:N,yLabel:O,xFormat:l,yFormat:s,enableHover:F,showGrid:P,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Te({title:B,description:M,summary:D,accessibleTable:T,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Oe({tooltip:y,defaultTooltipContent:Q}),...Ne({linkedHover:A,selection:w,onObservation:S,onClick:k,hoverRadius:e.hoverRadius,mobileInteraction:i.mobileInteraction,customHoverBehavior:$,customClickBehavior:V}),...g&&g.length>0&&{annotations:g},...b&&{xExtent:b},...x&&{yExtent:x},...j.crosshairProps,...v};return j.earlyReturn?j.earlyReturn:q?/* @__PURE__ */ta(rt,{componentName:"CandlestickChart",message:q,width:H,height:I}):/* @__PURE__ */ta(nt,{componentName:"CandlestickChart",width:H,height:I,children:/* @__PURE__ */ta(Ae,{ref:o,...ee})})}),"CandlestickChart");import{useMemo as ia,forwardRef as aa,useRef as ra}from"react";import{jsx as na}from"react/jsx-runtime";var la=/* @__PURE__ */at(/* @__PURE__ */aa(function(e,t){ke(fe);let o=ra(null);ce(t,{variant:"xy",frameRef:o});let i=Ue(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,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}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",pointIdAccessor:m,xScaleType:d,positiveColor:u,negativeColor:p,connectorStroke:f,connectorWidth:y,gap:g,styleRules:b,tooltip:x,annotations:v,xExtent:w,yExtent:A,frameProps:S={},selection:k,linkedHover:C,onObservation:L,onClick:R,hoverHighlight:_,chartId:H,loading:I,loadingContent:F,emptyContent:P,legendInteraction:B,legendPosition:M}=e,{areaStyle:D,...T}=S,{width:N,height:O,enableHover:W,showGrid:E,showLegend:j,title:z,description:G,summary:$,accessibleTable:V,xLabel:X,yLabel:Y}=i,U=ia(()=>st(a),[a]),K=ra({next:0,indexOf:/* @__PURE__ */new WeakMap,idOf:/* @__PURE__ */new Map,labels:/* @__PURE__ */new Map}),{plotData:Q,plotXAccessor:q,plotXFormat:Z,usesIndex:J}=ia(()=>{let e="function"==typeof c?c:e=>e[c],t=m?"function"==typeof m?m:e=>e[m]:void 0,o=e=>"number"==typeof e&&Number.isFinite(e)||e instanceof Date,i=(e,t)=>{let o=e??t;return l?l(o):String(o)};if(null!=a&&!U.some((t,i)=>!o(e(t,i))))return{plotData:U,plotXAccessor:c,plotXFormat:l,usesIndex:!1};if(null!=a){let t=U.map((t,o)=>e(t,o));return{plotData:U.map((e,t)=>({...e,__waterfallX:t})),plotXAccessor:"__waterfallX",plotXFormat:e=>i(t[Number(e)],e),usesIndex:!0}}let r=K.current,n=(e,t,o,i)=>{e&&"object"==typeof e&&(r.indexOf.set(e,t),!Object.isFrozen(e)&&!Object.isSealed(e)&&(e.__waterfallX=t)),o&&r.idOf.set(o,t),r.labels.set(t,i)};return{plotData:U,plotXAccessor:(i,a)=>{let l=e(i,a);if(o(l))return l;let s=t?String(t(i,a)??""):"",c=i&&"object"==typeof i?i.__waterfallX:void 0,h="number"==typeof c&&Number.isFinite(c)?c:(i&&"object"==typeof i?r.indexOf.get(i):void 0)??(s?r.idOf.get(s):void 0);if("number"==typeof h)return n(i,h,s,l),h;let m="number"==typeof a?a:r.next;return r.next=Math.max(r.next,m+1),n(i,m,s,l),m},plotXFormat:e=>i(r.labels.get(Number(e)),e),usesIndex:!0}},[a,U,c,l,m]),ee=ia(()=>{if(J&&null!=a)return[{orient:"bottom",tickValues:Q.map((e,t)=>t)}]},[a,Q,J]),te=se({responsive:e,data:Q,rawData:a,colorBy:void 0,colorScheme:void 0,legendInteraction:B,legendPosition:M,frameLegend:S,selection:k,linkedHover:C,fallbackFields:["string"==typeof c?c:"x"],unwrapData:!1,onObservation:L,onClick:R,hoverHighlight:_,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"WaterfallChart",chartId:H,showLegend:j,userMargin:r,marginDefaults:i.marginDefaults,loading:I,loadingContent:F,emptyContent:P,width:N,height:O,hasTitle:!!z,axisChrome:gt(S,{showAxes:i.showAxes,xLabel:X,yLabel:Y,axes:S.axes??ee})}),oe=ia(()=>({positiveColor:u,negativeColor:p,connectorStroke:f,connectorWidth:y,gap:g,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity}),[u,p,f,y,g,e.stroke,e.strokeWidth,e.opacity]),ie=ia(()=>Qe(c,h),[c,h]),ae=ia(()=>et(void 0,b,ie),[b,ie]),re=ia(()=>Ct(e=>{let t=ae(e);if(!D)return t;let o="function"==typeof D?D(e):D;return o?{...t,...o}:t},te.effectiveSelectionHook,te.resolvedSelection),[ae,D,te.effectiveSelectionHook,te.resolvedSelection]),le=ia(()=>De([{label:X||Be(c),accessor:c,role:"x",format:l},{label:Y||"Change",accessor:h,role:"y",format:s}]),[c,h,X,Y,l,s]);if(te.earlyReturn)return te.earlyReturn;let he=ne({componentName:"WaterfallChart",data:a,accessors:{xAccessor:c,yAccessor:h}});if(he)/* */return na(rt,{componentName:"WaterfallChart",message:he,width:N,height:O});let me={chartType:"waterfall",...null!=a&&{data:Q},xAccessor:q,yAccessor:h,xScaleType:null!=a&&J?"linear":d,waterfallStyle:oe,areaStyle:re,size:[N,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,showAxes:i.showAxes,xLabel:X,yLabel:Y,xFormat:Z,yFormat:s,enableHover:W,showGrid:E,...ee&&{axes:ee},...te.legendBehaviorProps,...Te({title:z,description:G,summary:$,accessibleTable:V,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Oe({tooltip:x,defaultTooltipContent:le}),...Ne({linkedHover:C,selection:k,onObservation:L,onClick:R,hoverHighlight:_,hoverRadius:e.hoverRadius,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...m&&{pointIdAccessor:m},...v&&v.length>0&&{annotations:v},...w&&{xExtent:w},...A&&{yExtent:A},...T};/* */
51
+ return na(nt,{componentName:"WaterfallChart",width:N,height:O,children:/* @__PURE__ */na(Ae,{ref:o,...me})})}),"WaterfallChart");export{eo as a,no as b,ho as c,o as d,h as e,So as f,Ho as g,Oo as h,Go as i,Ko as j,ti as k,wi as l,Bi as m,Ni as n,ji as o,qi as p,oa as q,la as r};
@@ -1,3 +1,3 @@
1
- function t(t){let e=Number.isFinite(t)&&t>0?t:6;return{width:Math.max(8,e),height:e,lineY:e/2}}function e(t){return{type:"hatch",background:t.background,stroke:t.stroke,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle,...1!==t.lineOpacity?{lineOpacity:t.lineOpacity}:{}}}function n(t,e){return typeof OffscreenCanvas<"u"?new OffscreenCanvas(t,e):(P||(P=document.createElement("canvas")),P.width=t,P.height=e,P)}function r(){let t=typeof window<"u"&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,t))}function i(t,e,n,r){e&&"transparent"!==e&&"none"!==e?(t.fillStyle=e,t.fillRect(0,0,n,r)):t.clearRect(0,0,n,r)}function a(a={},l){let o,{background:s="transparent",stroke:u="#000",lineWidth:c=1.5,spacing:f=6,angle:d=45,lineOpacity:h=1}=a,p={background:s,stroke:u,lineWidth:c,spacing:f,angle:d,lineOpacity:h},m=t(f),y=r(),g=Math.max(1,Math.round(m.width*y)),v=Math.max(1,Math.round(m.height*y));try{o=n(g,v)}catch{return e(p)}let b=o.getContext("2d");if(!b)return e(p);i(b,s,g,v);let M=v/m.height,k=Math.max(0,c)*M;b.save(),b.globalAlpha=Math.min(1,Math.max(0,h)),b.fillStyle=u,b.fillRect(0,m.lineY*M-k/2,g,k),b.restore();let w=(l||b).createPattern(o,"repeat");if(!w)return w;let x=d*Math.PI/180,O=Math.cos(x),S=Math.sin(x),W=m.width/g,$=m.height/v;return w.setTransform?.({a:O*W,b:S*W,c:-S*$,d:O*$,e:0,f:0}),w}function l(t,e=2166136261){let n=e;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n>>>0}function o(t){return 0!==t.fontfaces?.length}function s(t){let e=typeof document>"u"?void 0:document.fonts;if(!e||"function"!=typeof e.addEventListener)return()=>{};let n=e=>{o(e)&&t()};return e.addEventListener("loadingdone",n),()=>e.removeEventListener("loadingdone",n)}function u(t){let e=t.trim();if(!e.startsWith("var(")||!e.endsWith(")"))return null;let n=e.slice(4,-1),r=n.indexOf(",");if(-1===r){let t=n.trim();return t.startsWith("--")?{name:t}:null}let i=n.slice(0,r).trim(),a=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:a||void 0}:null}function c(){if(Y||typeof window>"u"||typeof document>"u")return;Y=!0;let t=t=>{if(!t?.includes("--"))return"";let e=document.createElement("span").style;return e.cssText=t,Array.from(e).filter(t=>t.startsWith("--")).sort().map(t=>`${t}:${e.getPropertyValue(t)}!${e.getPropertyPriority(t)}`).join(";")},e=(e,n)=>{let r=e.target;if(!(r instanceof Element))return!1;if(r===n||r.contains(n))return!0;if(!n.contains(r))return!1;let i="CANVAS"===r.tagName;return!(!i&&!r.querySelector("canvas")||i&&"style"===e.attributeName&&t(e.oldValue)===t(r.getAttribute("style")))},n=t=>{let n=[];for(let r of T){let i=r.getElement();i&&(!t||t.some(t=>e(t,i)))&&n.push(r)}if(!t||0!==n.length){F++;for(let t of n)t.listener()}};if(typeof MutationObserver<"u"&&document.documentElement&&(V=new MutationObserver(t=>{n(t)})).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{z=window.matchMedia("(prefers-color-scheme: dark)"),I=()=>n(),"function"==typeof z.addEventListener?z.addEventListener("change",I):"function"==typeof z.addListener&&z.addListener(I)}catch{}B=s(()=>n())}function f(t,e){c();let n={getElement:t,listener:e};return T.add(n),()=>{T.delete(n)&&0===T.size&&(V?.disconnect(),V=null,z&&I&&("function"==typeof z.removeEventListener?z.removeEventListener("change",I):"function"==typeof z.removeListener&&z.removeListener(I)),z=null,I=null,B?.(),B=null,Y=!1)}}function d(t,e){if(!e)return e;let n=u(e);if(!n)return e;let r=()=>n.fallback?d(t,n.fallback):e,i=t.canvas;if(!i)return r();let a=R.get(i);(!a||a.version!==F)&&(a={version:F,map:/* @__PURE__ */new Map},R.set(i,a));let l=a.map.get(e);if(void 0!==l)return l;let o=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||e;return a.map.set(e,o),o}function h(t){F++}function p(){return F}function m(t){return"object"==typeof t&&null!==t&&"hatch"===t.type}function y(t){return["hatch",t.background??"transparent",t.stroke??"#000",t.lineWidth??1.5,t.spacing??6,t.angle??45,t.lineOpacity??1].join("|")}function g(t,e){return`${t}-hatch-${l(y(e)).toString(36)}`}function v(t,e){let n=t.background??"transparent",r=t.stroke??"#000",i="transparent"===n||"none"===n?n:d(e,n)||n,l=d(e,r)||r||"#000",o=typeof window<"u"&&window.devicePixelRatio||1,s=`${y(t)}|${i}|${l}@${o}`,u=U.get(s);if(void 0!==u)return u;let c=a({background:i,stroke:l,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle,lineOpacity:t.lineOpacity},e),f=m(c)?null:c;return U.set(s,f),f}function b(e,n){let{background:r="transparent",stroke:i="#000",lineWidth:a=1.5,spacing:l=6,angle:o=45,lineOpacity:s=1}=e,u=t(l);/* @__PURE__ */
1
+ function t(t){let e=Number.isFinite(t)&&t>0?t:6;return{width:Math.max(8,e),height:e,lineY:e/2}}function e(t){return{type:"hatch",background:t.background,stroke:t.stroke,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle,...1!==t.lineOpacity?{lineOpacity:t.lineOpacity}:{}}}function n(t,e){return typeof OffscreenCanvas<"u"?new OffscreenCanvas(t,e):(P||(P=document.createElement("canvas")),P.width=t,P.height=e,P)}function r(){let t=typeof window<"u"&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,t))}function i(t,e,n,r){e&&"transparent"!==e&&"none"!==e?(t.fillStyle=e,t.fillRect(0,0,n,r)):t.clearRect(0,0,n,r)}function a(a={},l){let o,{background:s="transparent",stroke:u="#000",lineWidth:c=1.5,spacing:f=6,angle:d=45,lineOpacity:h=1}=a,p={background:s,stroke:u,lineWidth:c,spacing:f,angle:d,lineOpacity:h},m=t(f),y=r(),g=Math.max(1,Math.round(m.width*y)),v=Math.max(1,Math.round(m.height*y));try{o=n(g,v)}catch{return e(p)}let b=o.getContext("2d");if(!b)return e(p);i(b,s,g,v);let M=v/m.height,k=Math.max(0,c)*M;b.save(),b.globalAlpha=Math.min(1,Math.max(0,h)),b.fillStyle=u,b.fillRect(0,m.lineY*M-k/2,g,k),b.restore();let w=(l||b).createPattern(o,"repeat");if(!w)return w;let x=d*Math.PI/180,O=Math.cos(x),S=Math.sin(x),W=m.width/g,$=m.height/v;return w.setTransform?.({a:O*W,b:S*W,c:-S*$,d:O*$,e:0,f:0}),w}function l(t,e=2166136261){let n=e;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n>>>0}function o(t){return 0!==t.fontfaces?.length}function s(t){let e=typeof document>"u"?void 0:document.fonts;if(!e||"function"!=typeof e.addEventListener)return()=>{};let n=e=>{o(e)&&t()};return e.addEventListener("loadingdone",n),()=>e.removeEventListener("loadingdone",n)}function u(t){let e=t.trim();if(!e.startsWith("var(")||!e.endsWith(")"))return null;let n=e.slice(4,-1),r=n.indexOf(",");if(-1===r){let t=n.trim();return t.startsWith("--")?{name:t}:null}let i=n.slice(0,r).trim(),a=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:a||void 0}:null}function c(){if(Y||typeof window>"u"||typeof document>"u")return;Y=!0;let t=t=>{if(!t?.includes("--"))return"";let e=document.createElement("span").style;return e.cssText=t,Array.from(e).filter(t=>t.startsWith("--")).sort().map(t=>`${t}:${e.getPropertyValue(t)}!${e.getPropertyPriority(t)}`).join(";")},e=(e,n)=>{let r=e.target;if(!(r instanceof Element))return!1;if(r===n||r.contains(n))return!0;if(!n.contains(r))return!1;let i="CANVAS"===r.tagName;return!(!i&&!r.querySelector("canvas")||i&&"style"===e.attributeName&&t(e.oldValue)===t(r.getAttribute("style")))},n=t=>{let n=[];for(let r of T){let i=r.getElement();i&&(!t||t.some(t=>e(t,i)))&&n.push(r)}if(!t||0!==n.length){F++;for(let t of n)t.listener()}};if(typeof MutationObserver<"u"&&document.documentElement&&(V=new MutationObserver(t=>{n(t)})).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{z=window.matchMedia("(prefers-color-scheme: dark)"),I=()=>n(),"function"==typeof z.addEventListener?z.addEventListener("change",I):"function"==typeof z.addListener&&z.addListener(I)}catch{}B=s(()=>n())}function f(t,e){c();let n={getElement:t,listener:e};return T.add(n),()=>{T.delete(n)&&0===T.size&&(V?.disconnect(),V=null,z&&I&&("function"==typeof z.removeEventListener?z.removeEventListener("change",I):"function"==typeof z.removeListener&&z.removeListener(I)),z=null,I=null,B?.(),B=null,Y=!1)}}function d(t,e){if(!e)return e;let n=u(e);if(!n)return e;let r=()=>n.fallback?d(t,n.fallback):e,i=t.canvas;if(!i)return r();let a=R.get(i);(!a||a.version!==F)&&(a={version:F,map:/* @__PURE__ */new Map},R.set(i,a));let l=a.map.get(e);if(void 0!==l)return l;let o=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||e;return a.map.set(e,o),o}function h(t){F++}function p(){return F}function m(t){return"object"==typeof t&&null!==t&&"hatch"===t.type}function y(t){return["hatch",t.background??"transparent",t.stroke??"#000",t.lineWidth??1.5,t.spacing??6,t.angle??45,t.lineOpacity??1].join("|")}function g(t,e){return`${t}-hatch-${l(y(e)).toString(36)}`}function v(t,e){let n=t.background??"transparent",r=t.stroke??"#000",i="transparent"===n||"none"===n?n:d(e,n)||n,l=d(e,r)||r||"#000",o=typeof window<"u"&&window.devicePixelRatio||1,s=`${y(t)}|${i}|${l}@${o}`,u=U.get(s);if(void 0!==u)return u;let c=a({background:i,stroke:l,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle,lineOpacity:t.lineOpacity},e),f=m(c)?null:c;return U.set(s,f),f}function b(e,n){let{background:r="transparent",stroke:i="#000",lineWidth:a=1.5,spacing:l=6,angle:o=45,lineOpacity:s=1}=e,u=t(l);/* */
2
2
  return G("pattern",{id:n,width:u.width,height:u.height,patternUnits:"userSpaceOnUse",patternTransform:0!==o?`rotate(${o})`:void 0,children:[r&&"transparent"!==r&&"none"!==r&&/* @__PURE__ */q("rect",{width:u.width,height:u.height,fill:r}),
3
3
  /* @__PURE__ */q("line",{x1:0,y1:u.lineY,x2:u.width,y2:u.lineY,stroke:i,strokeWidth:a,...1!==s?{strokeOpacity:s}:{}})]},n)}function M(t,e,n="#4e79a7"){if(m(t)){let n=g(e,t);return{fill:`url(#${n})`,def:b(t,n)}}return t&&"string"==typeof t?{fill:t}:{fill:n}}function k(t,e,n){if(!t||"object"!=typeof t)return;let r=t;if(!Array.isArray(r.stops))return;let i=r.stops.flatMap(t=>{if(!t||"object"!=typeof t)return[];let{offset:e,color:r,opacity:i}=t;return"number"==typeof e&&Number.isFinite(e)?[{offset:Math.max(0,Math.min(1,e)),color:"string"==typeof r&&r?r:n,opacity:"number"==typeof i&&Number.isFinite(i)?Math.max(0,Math.min(1,i)):void 0}]:[]}).sort((t,e)=>t.offset-e.offset);return i.length?{direction:"horizontal"===r.direction?"horizontal":"vertical"===r.direction?"vertical":e,stops:i}:void 0}function w(t,e,n,r){let i=k(t,n,r);if(!i)return;let{direction:a,stops:l}=i,o=`${e}-gradient`;return{fill:`url(#${o})`,def:/* @__PURE__ */q("linearGradient",{id:o,x1:0,y1:0,x2:"horizontal"===a?"100%":0,y2:"vertical"===a?"100%":0,children:l.map((t,e)=>/* @__PURE__ */q("stop",{offset:100*t.offset+"%",stopColor:t.color,stopOpacity:t.opacity},`${t.offset}-${e}`))},o)}}function x(t,e){let n=t.fillStyle,r="#010203";try{t.fillStyle=r,t.fillStyle=e}catch{return t.fillStyle=n,[78,121,167]}let i=t.fillStyle;if(t.fillStyle=n,"string"!=typeof i)return[78,121,167];if(i.toLowerCase()===r&&e.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)];let a=i.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return a?[+a[1],+a[2],+a[3]]:[78,121,167]}function O(t){switch(t){case"monotoneX":return X;case"monotoneY":return D;case"cardinal":return H;case"catmullRom":return J;case"step":return K;case"stepBefore":return Q;case"stepAfter":return Z;case"basis":return _;case"natural":return tt;default:return null}}function S(t,e,n){return null==e?n:m(e)?v(e,t)||e.background&&d(t,e.background)||n:"string"!=typeof e?e:d(t,e)||n}function W(t,e,n){let r=S(t,e,n);if("string"==typeof r&&r.trim().startsWith("var(")){let e=d(t,n);return e&&!e.trim().startsWith("var(")?e:n}return r}function $(t,e){if(null==e)return;let n=S(t,e,"");return""===n?void 0:n}function A(t,e,n,r,i,a,l){let o=e.stops.filter(t=>Number.isFinite(t.offset)&&(null==t.opacity||Number.isFinite(t.opacity)));if(o.length<2)return null;let s=t.createLinearGradient(r,i,a,l);for(let e of o)s.addColorStop(Math.max(0,Math.min(1,e.offset)),E(t,e,n));return s}function E(t,e,n){let r=e.color??n,i=d(t,r)||r;if(null==e.opacity)return i;let a=Math.max(0,Math.min(1,e.opacity)),[l,o,s]=x(t,i);return`rgba(${l},${o},${s},${a})`}function L(t,e,n,r){if(!e.fill)return;let i=t.globalAlpha;t.fillStyle=S(t,e.fill,n),void 0!==e.fillOpacity&&(t.globalAlpha=(e.opacity??i)*e.fillOpacity),r(),t.globalAlpha=i}function C(t,e,n){if(!e.stroke||"none"===e.stroke)return;let r=t.globalAlpha;t.strokeStyle=d(t,e.stroke)||e.stroke,t.lineWidth=e.strokeWidth??1,t.globalAlpha=(e.opacity??r)*(e.strokeOpacity??1),n(),t.globalAlpha=r}function j(t){return(t.tl??0)>0||(t.tr??0)>0||(t.br??0)>0||(t.bl??0)>0}function N(t){let e=t.cornerRadii;if(!e)return{tl:0,tr:0,br:0,bl:0};let n=Math.min(t.w,t.h)/2,r=t=>Math.max(0,Math.min(t??0,n));return{tl:r(e.tl),tr:r(e.tr),br:r(e.br),bl:r(e.bl)}}var P=null,R=/* @__PURE__ */new WeakMap,F=0,Y=!1,V=null,z=null,I=null,B=null,T=/* @__PURE__ */new Set;import{jsx as q,jsxs as G}from"react/jsx-runtime";var U=/* @__PURE__ */new Map;import{curveMonotoneX as X,curveMonotoneY as D,curveCardinal as H,curveCatmullRom as J,curveStep as K,curveStepBefore as Q,curveStepAfter as Z,curveBasis as _,curveNatural as tt}from"d3-shape";export{s as a,f as b,d as c,h as d,p as e,x as f,l as g,a as h,m as i,g as j,b as k,M as l,k as m,w as n,O as o,S as p,W as q,$ as r,A as s,L as t,C as u,j as v,N as w};
@@ -0,0 +1,37 @@
1
+ function e(e){let t=ye(e);return t^=t>>>16,t=Math.imul(t,2146121005),t^=t>>>15,t=Math.imul(t,2221713035),t^=t>>>16,t>>>0}function t(e){let t=Math.round(1e3*e)/10;return`p${String(t).replace(".","_")}`}function i(e,t,i){let n=e.length;for(e.push(t);n>0;){let s=n-1>>>1;if(i(e[s],t)<=0)break;e[n]=e[s],n=s}e[n]=t}function n(e,t){let i=e[0],n=e.pop();if(e.length>0){let i=0;for(;2*i+1<e.length;){let s=2*i+1;if(s+1<e.length&&t(e[s+1],e[s])<0&&s++,t(n,e[s])<=0)break;e[i]=e[s],i=s}e[i]=n}return i}function s(e,t){switch(t){case"distinct":return e.distinct??0;case"p50":case"p95":case"p99":return e.percentiles?.[t]??Number.NaN;default:return e[t]??e.mean}}function o(e,t,i,n=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];let o=s(e,i),r=e.stddev*n;return[o-r,o+r]}function r(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;let t=e.trim();if(""===t)return null;Te.lastIndex=0;let i,n=0,s=0;for(;null!==(i=Te.exec(t));){let e=parseFloat(i[1]),t=Pe[i[2]];if(null==t||!Number.isFinite(e))return null;n+=e*t,s+=i[0].length}return s!==t.length?null:n>0?n:null}function a(e,t){return e.time-t.time||e.order-t.order}function l(e,t){let i=[new Date(e),new Date(t)],n=Math.max(...i.map(e=>e.getUTCMilliseconds()?23:e.getUTCSeconds()?19:16)),[s,o]=i.map(e=>e.toISOString()),r=s.slice(0,10)===o.slice(0,10)?"":`${D(t)} `;return`${D(e)} ${s.slice(11,n)}–${r}${o.slice(11,n)}`}function c(e,t,i){return i?`${i(e)}–${i(t)}`:e>=1e11&&t<=864e13?l(e,t):`${h(e)}–${h(t)}`}function u(e,t,i){return null==e?void 0:"function"==typeof t?t(e):e["string"==typeof t?t:i]}function h(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?String(e):e.toFixed(2):e instanceof Date?e.toLocaleString():String(e)}function m(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:n="x",yLabel:s="y"}=e;return e=>{let o=e?.data??null,r=u(o,t,"time"),a=u(o,i,"value");/* */
2
+ return je("div",{className:"semiotic-tooltip",style:Ee,children:[
3
+ /* @__PURE__ */je("div",{children:[
4
+ /* @__PURE__ */je("span",{style:We,children:[n,":"]}),h(r)]}),
5
+ /* @__PURE__ */je("div",{children:[
6
+ /* @__PURE__ */je("span",{style:We,children:[s,":"]}),h(a)]})]})}}function d(e={}){let t=p(e);return i=>{let n=i?.allSeries,s=i?.data??null;return n?.length&&null!=s?.binStart&&null!=s.binEnd?/* @__PURE__ */je("div",{className:"semiotic-tooltip",style:Ee,children:[
7
+ /* @__PURE__ */je("div",{children:[
8
+ /* @__PURE__ */Le("span",{style:We,children:"range:"}),c(s.binStart,s.binEnd,e.formatTime)]}),n.map((e,t)=>""!==e.group&&/* @__PURE__ */je("div",{children:[
9
+ /* @__PURE__ */Le("span",{style:{...Ve,backgroundColor:e.color}}),
10
+ /* @__PURE__ */je("span",{style:We,children:[e.group,":"]}),h(e.value)]},t)),null!=s.total&&/* @__PURE__ */je("div",{children:[
11
+ /* @__PURE__ */Le("span",{style:We,children:"count:"}),h(s.total)]})]}):t(i)}}function g(e={}){let{timeAccessor:t,valueAccessor:i}=e;return e=>{let n=e?.data??null,s=u(n,t,"time"),o=n?.delta??u(n,i,"value"),r=n?.cumEnd,a="number"==typeof o&&o>=0?`+${h(o)}`:h(o);/* */
12
+ return je("div",{className:"semiotic-tooltip",style:Ee,children:[
13
+ /* @__PURE__ */je("div",{children:[
14
+ /* @__PURE__ */Le("span",{style:We,children:"x:"}),h(s)]}),
15
+ /* @__PURE__ */je("div",{children:[
16
+ /* @__PURE__ */Le("span",{style:We,children:"Δ:"}),a]}),null!=r&&/* @__PURE__ */je("div",{children:[
17
+ /* @__PURE__ */Le("span",{style:We,children:"total:"}),h(r)]})]})}}function p(e={}){let{timeAccessor:t,valueAccessor:i,formatTime:n}=e;return e=>{let s=e?.data??null;if(null==s?.binStart||null==s?.binEnd){let e=u(s,t,"time"),n=u(s,i,"value");/* */
18
+ return je("div",{className:"semiotic-tooltip",style:Ee,children:[
19
+ /* @__PURE__ */je("div",{children:[
20
+ /* @__PURE__ */Le("span",{style:We,children:"x:"}),h(e)]}),
21
+ /* @__PURE__ */je("div",{children:[
22
+ /* @__PURE__ */Le("span",{style:We,children:"y:"}),h(n)]})]})}/* */
23
+ return je("div",{className:"semiotic-tooltip",style:Ee,children:[
24
+ /* @__PURE__ */je("div",{children:[
25
+ /* @__PURE__ */Le("span",{style:We,children:"range:"}),c(s.binStart,s.binEnd,n)]}),null!=s.total&&/* @__PURE__ */je("div",{children:[
26
+ /* @__PURE__ */Le("span",{style:We,children:"count:"}),h(s.total)]}),null!=s.category&&/* @__PURE__ */je("div",{children:[
27
+ /* @__PURE__ */Le("span",{style:We,children:"category:"}),h(s.category)]}),null!=s.category&&null!=s.categoryValue&&/* @__PURE__ */je("div",{children:[
28
+ /* @__PURE__ */Le("span",{style:We,children:"category count:"}),h(s.categoryValue)]})]})}}function f(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:n="x",yLabel:s="y"}=e;return e=>{let o=e?.data??null,r=o?.xCenter??u(o,t,"time"),a=o?.yCenter??u(o,i,"value"),l=o?.count,c=o?.sum,m=o?.value,d=o?.agg??"count";/* */
29
+ return je("div",{className:"semiotic-tooltip",style:Ee,children:[
30
+ /* @__PURE__ */je("div",{children:[
31
+ /* @__PURE__ */je("span",{style:We,children:[n,":"]}),h(r)]}),
32
+ /* @__PURE__ */je("div",{children:[
33
+ /* @__PURE__ */je("span",{style:We,children:[s,":"]}),h(a)]}),null!=l&&/* @__PURE__ */je("div",{children:[
34
+ /* @__PURE__ */Le("span",{style:We,children:"count:"}),h(l)]}),"sum"===d&&null!=c&&/* @__PURE__ */je("div",{children:[
35
+ /* @__PURE__ */Le("span",{style:We,children:"sum:"}),h(c)]}),"mean"===d&&null!=m&&/* @__PURE__ */je("div",{children:[
36
+ /* @__PURE__ */Le("span",{style:We,children:"mean:"}),h(m)]})]})}}function v(e,t,i){return e??i??Math.max(t?.length??0,200)}function w(e){let t=e.window??"tumbling",i=r("session"===t?e.gap??e.size:e.size);if(null==i)return null;let n=null!=e.hop?r(e.hop):void 0,s=null!=e.gap?r(e.gap):void 0;return new Me({window:t,size:i,hop:n??void 0,gap:s??void 0,retain:e.retain,percentiles:e.percentiles,distinct:e.distinct})}function y(e,t){let i=t.stat??"mean",n=t.band??"none",r=t.sigma??1;return e.emit().map(e=>{let t={[$e]:(e.start+e.end)/2,[Ue]:s(e,i),[Xe]:e.count,[Ke]:e.partial,[qe]:e.start,[Ze]:e.end},a=o(e,n,i,r);return a&&(t[Ge]=a[0],t[Ye]=a[1]),t})}function b(e,t,i){let n="function"==typeof t?t(e):e[String(t??i)];if(null==n||"string"==typeof n&&""===n.trim())return null;let s=Number(n);return Number.isFinite(s)?s:null}function x(e){if(null==e||"string"==typeof e&&""===e.trim())return NaN;if(e instanceof Date)return e.getTime();if("string"==typeof e){let t=V(e);if(Number.isFinite(t))return t}return Number(e)}function A(e,t,i){let n="function"==typeof t?t(e):e[String(t??i)];if(null==n||"string"==typeof n&&""===n.trim())return null;if(n instanceof Date)return Number.isFinite(n.getTime())?n:null;if("string"==typeof n){let e=V(n);if(Number.isFinite(e))return new Date(e)}let s=Number(n);return Number.isFinite(s)?s:null}function k(e,t){let i=r(e.lateness);return null==i?null:new Ie({lateness:i,getTime:t,latePolicy:e.latePolicy??"drop"})}function S(e){return{...Z(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showGrid:e.showGrid,showLegend:e.showLegend,enableHover:null==e.enableHover?void 0:!!e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight}}function C(e,t){et.useImperativeHandle(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,i)=>t.current?.update(e,e=>i(e))??[],clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t])}function _(e,t,i,n){let s=t.find(Boolean)??null;return et.useMemo(()=>s?ge(e??tt,s,i,n):e,[s,e,i,n])}function H(e,t,i){return{responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,legendHoverBehavior:t.onLegendHover,legendClickBehavior:t.onLegendClick,legendHighlightedCategory:t.highlightedCategory,legendIsolatedCategories:"isolate"===i?t.isolatedCategories:void 0}}function M(e){return t=>"number"!=typeof t.binStart||"number"!=typeof t.binEnd?t:Ae(be({...t},xe(t)),{ranges:{[e]:[t.binStart,t.binEnd]},toNumber:x})}function P(e){if(!e.axes)return[{orient:"bottom",visible:!1!==e.showTimeAxis},{orient:"left",visible:!1!==e.showValueAxis}];let t=(...t)=>e.axes.some(e=>t.includes(e.orient)),i=!1===e.showTimeAxis&&!t("bottom","top"),n=!1===e.showValueAxis&&!t("left","right");return i||n?[...e.axes,...i?[{orient:"bottom",visible:!1}]:[],...n?[{orient:"left",visible:!1}]:[]]:e.axes}function T(e,t,i,n=!1){let s=ce({axes:t,showAxes:i});return{...me(e,t,n),...!s.hasAxis&&{bottom:0},...!s.leftAxis?.hasAxis&&{left:0}}}function I({enabled:e,categories:t,colors:i,fallbackColor:n,order:s="discovery",domainKey:o}){let r=oe(!0),a=re(),l=le(),c=K(),u="function"==typeof o?mt:o,h=ht(null),m=ut(()=>{let e=h.current,n=e&&Object.is(e.domainKey,u)?new Map(e.indexes):/* @__PURE__ */new Map,o=new Set(t),r="explicit-then-alpha"===s?[...Object.keys(i??{}).filter(e=>o.has(e)),...t.filter(e=>!Object.prototype.hasOwnProperty.call(i??{},e)).sort()]:t;for(let e of r)ae(n,e);return{domainKey:u,indexes:n}},[t,i,s,u]);dt(()=>{h.current=m},[m]);let d=m.indexes,g=ut(()=>{if(!e)return;let t=c&&c.length>0?c:l?fe:ve;return e=>{let s=ae(d,e);return(r?we(r,e):void 0)||(i?we(i,e):void 0)||n||(a?we(a,e):void 0)||t[s%t.length]}},[d,i,e,n,l,a,r,c]),p=ut(()=>{if(!e||!g)return i;let n=Object.keys(i??{}),o=new Set(n),r=t.filter(e=>!o.has(e));"explicit-then-alpha"===s&&r.sort();let a=[...n,...r];if(0===a.length)return;let l=new Set(t),c=[];for(let e of a){if(l.has(e)){c.push([e,g(e)]);continue}let t=i?we(i,e):void 0;t&&c.push([e,t])}return c.length>0?Object.fromEntries(c):void 0},[t,g,i,e,s]);return{colorScale:g,colorMap:p}}import{a as N}from"./c-ALLF3Y77.min.js";import{d as R,e as F,f as z,g as B}from"./c-F76M77YC.min.js";import{c as D,f as O,g as L}from"./c-G5A3YWTN.min.js";import{a as j,i as E}from"./c-VLAAAFST.min.js";import{a as W}from"./c-OV5F3DQP.min.js";import{a as V}from"./c-W3OOPUWV.min.js";import{A as $,W as U,Y as G}from"./c-C5GXUHUO.min.js";import{$a as Y,Ab as K,Fb as X,Gb as q,Hb as Z,Jb as J,Ob as Q,Pa as ee,Qa as te,Ra as ie,Xa as ne,ab as se,cb as oe,eb as re,pb as ae,rb as le,u as ce,xb as ue,yb as he,z as me,zb as de}from"./c-XCV7VUU3.min.js";import{f as ge}from"./c-2OZMC2MZ.min.js";import{d as pe,m as fe,p as ve,s as we}from"./c-ZOE7TAR3.min.js";import{g as ye}from"./c-SSKV5JPW.min.js";import{a as be,b as xe,g as Ae}from"./c-ODSUDNB4.min.js";var ke=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;let t=e-this._mean;this._mean+=t/this._count;let i=e-this._mean;this._m2+=t*i,e<this._min&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);let t=this._count+e._count,i=e._mean-this._mean;this._mean+=i*e._count/t,this._m2+=e._m2+i*i*this._count*e._count/t,this._count=t,e._min<this._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){let t=new e;return t.merge(this),t}get count(){return this._count}get mean(){return this._mean}get sum(){return this._mean*this._count}get variance(){return this._count<2?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return this._count<2?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},Se=class t{constructor(e=10){let t=Math.max(4,Math.min(16,Math.floor(e)));this.p=t,this.m=1<<t,this.registers=new Uint8Array(this.m),this.alpha=.7213/(1+1.079/this.m),this.harmonicSum=this.m,this.zeros=this.m}add(t){let i=e(String(t)),n=i>>>32-this.p,s=Math.min(Math.clz32(i<<this.p),32-this.p)+1;this.updateRegister(n,s)}updateRegister(e,t){let i=this.registers[e];t<=i||(this.registers[e]=t,this.harmonicSum+=2**-t-2**-i,0===i&&this.zeros--)}merge(e){if(e.m===this.m)for(let t=0;t<this.m;t++)this.updateRegister(t,e.registers[t])}clone(){let e=new t(this.p);return e.registers.set(this.registers),e.harmonicSum=this.harmonicSum,e.zeros=this.zeros,e}count(){let e=this.alpha*this.m*this.m/this.harmonicSum;return e<=2.5*this.m&&this.zeros>0?Math.round(this.m*Math.log(this.m/this.zeros)):Math.round(e)}},Ce=class e{constructor(e=100){this.centroids=[],this.total=0,this.pending=0,this.compression=Math.max(20,e)}push(e){Number.isFinite(e)&&(this.centroids.push({mean:e,weight:1}),this.total+=1,this.pending++,this.pending>=2*this.compression&&this.compress())}merge(e){if(0===e.total)return;let t=0===this.total,i=e.centroids.length;for(let t=0;t<i;t++)this.centroids.push({...e.centroids[t]});this.total+=e.total,this.pending=t&&this.compression===e.compression?e.pending:this.pending+i,t||this.compress()}clone(){let t=new e(this.compression);return t.merge(this),t}quantile(e){if(0===this.total||Number.isNaN(e))return Number.NaN;let t=Math.min(1,Math.max(0,e));this.compress();let i=t*this.total,n=this.centroids[0].weight/2;if(i<=n)return this.centroids[0].mean;for(let e=1;e<this.centroids.length;e++){let t=this.centroids[e-1],s=this.centroids[e],o=(t.weight+s.weight)/2,r=n+o;if(i<=r){let e=(i-n)/o;return t.mean+(s.mean-t.mean)*e}n=r}return this.centroids[this.centroids.length-1].mean}get count(){return this.total}compress(){if(0===this.pending||(this.pending=0,this.centroids.length<=1))return;this.centroids.sort((e,t)=>e.mean-t.mean);let e=0,t=0,i=this.total,n=this.compression;for(let s=1;s<this.centroids.length;s++){let o=this.centroids[e],r=this.centroids[s],a=(t+o.weight/2)/i,l=4*i*a*(1-a)/n;if(o.weight+r.weight<=Math.max(1,l)){let e=o.weight+r.weight;o.mean=(o.mean*o.weight+r.mean*r.weight)/e,o.weight=e}else t+=o.weight,this.centroids[++e]=r}this.centroids.length=e+1}},_e=(e,t)=>e-t,He=class{constructor(e,t){this.stats=new ke,this.digest=e?new Ce:null,this.hll=t?new Se:null}push(e,t){this.stats.push(e),this.digest?.push(e),this.hll&&this.hll.add(t??e)}merge(e){this.stats.merge(e.stats),this.digest?.merge(e.digest),this.hll?.merge(e.hll)}},Me=class{constructor(e){this.windows=/* @__PURE__ */new Map,this.starts=[],this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;let t=e.hop??e.size;this.hop=t>0&&t<=e.size?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0,this.percentiles=e.percentiles??[],this.wantDistinct=!0===e.distinct}newBucket(){return new He(this.percentiles.length>0,this.wantDistinct)}push(e,t,i){!Number.isFinite(e)||!Number.isFinite(t)||(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t,i):this.pushFixed(e,t,i),this.prune())}pushFixed(e,t,i){if("tumbling"===this.type||this.hop>=this.size){let n=Math.floor(e/this.size)*this.size;return void this.bump(n,t,i)}let n=this.hop,s=Math.floor(e/n);for(let o=Math.floor((e-this.size)/n)+1;o<=s;o++)this.bump(o*n,t,i)}bump(e,t,n){let s=this.windows.get(e);if(!s){if(this.windows.size>=this.retain&&e<this.starts[0])return;s=this.newBucket(),this.windows.set(e,s),this.retain!==1/0&&i(this.starts,e,_e)}s.push(t,n)}pushSession(e,t,i){let n=e-this.gap,s=e+this.gap,o=0,r=this.sessions.length,a=this.sessions[r-1];if(!a||e>=a.end)o=r,a&&a.end>=n&&a.start<=s&&o--;else for(;o<r;){let e=o+r>>>1;this.sessions[e].end<n?o=e+1:r=e}let l=this.sessions[o];if(!l||l.start>s){let n=this.newBucket();return n.push(t,i),void this.sessions.splice(o,0,{start:e,end:e,bucket:n})}l.bucket.push(t,i),l.start=Math.min(l.start,e),l.end=Math.max(l.end,e);let c=o+1;for(;c<this.sessions.length&&this.sessions[c].start<=s;){let e=this.sessions[c++];l.bucket.merge(e.bucket),l.end=Math.max(l.end,e.end)}c>o+1&&this.sessions.splice(o+1,c-o-1)}prune(){if(this.retain!==1/0){if("session"===this.type)return void(this.sessions.length>this.retain&&this.sessions.splice(0,this.sessions.length-this.retain));for(;this.windows.size>this.retain;)this.windows.delete(n(this.starts,_e))}}emit(){if("session"===this.type)return this.sessions.map(e=>{let t=this.latest-e.end<this.gap;return this.row(e.start,e.end,e.bucket,t)});let e=[];for(let[t,i]of this.windows){let n=t+this.size;e.push(this.row(t,n,i,this.latest<n))}return e.sort((e,t)=>e.start-t.start),e}row(e,i,n,s){let o=n.stats,r={start:e,end:i,count:o.count,mean:o.mean,sum:o.sum,min:o.min,max:o.max,stddev:o.stddev,partial:s};if(n.digest){let e={};for(let i of this.percentiles)e[t(i)]=n.digest.quantile(i);r.percentiles=e}return n.hll&&(r.distinct=n.hll.count()),r}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.starts=[],this.sessions=[],this.latest=-1/0}},Pe={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},Te=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g,Ie=class{constructor(e){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){let t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};let n=[],s=Math.max(this._watermark-this.lateness,this._releasedThrough);return this._watermark!==-1/0&&t<s?(this._lateCount+=1,n.push(e),"drop"===this.latePolicy?{released:[],late:n}:{released:[e],late:n}):(t>this._watermark&&(this._watermark=t),i(this.held,{item:e,time:t,order:this.nextOrder++},a),{released:this.drain(this._watermark-this.lateness),late:n})}drain(e){let t=[],i=this.held[0];for(;i&&i.time<=e;)n(this.held,a),t.push(i.item),this._releasedThrough=Math.max(this._releasedThrough,i.time),i=this.held[0];return t}flush(){return this.drain(1/0)}clear(){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}};import{useRef as Ne,useImperativeHandle as Re,forwardRef as Fe,useCallback as ze,useState as Be,useEffect as De,useMemo as Oe}from"react";import{jsx as Le,jsxs as je}from"react/jsx-runtime";var Ee={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},We={opacity:.7,marginRight:4},Ve={display:"inline-block",width:8,height:8,borderRadius:"50%",marginRight:6},$e="time",Ue="value",Ge="__aggLower",Ye="__aggUpper",Ke="__aggPartial",Xe="count",qe="__aggStart",Ze="__aggEnd",Je="__aggSeries",Qe=class{constructor(e,t){this.config=e,this.seriesAccessor=t,this.groups=/* @__PURE__ */new Map}push(e,t,i){let n=A(e,t,"time"),s=b(e,i,"value");if(null==n||null==s)return;let o=null==this.seriesAccessor?"":String("function"==typeof this.seriesAccessor?this.seriesAccessor(e):e[this.seriesAccessor]),r=this.groups.get(o);if(!r){if(r=w(this.config),!r)return;this.groups.set(o,r)}r.push(+n,s)}emit(e){let t=[];for(let[i,n]of this.groups)for(let s of y(n,e))t.push(null==this.seriesAccessor?s:{...s,[Je]:i});return t}clear(){this.groups.clear()}};import*as et from"react";var tt=()=>({});import{jsx as it}from"react/jsx-runtime";var nt=/* @__PURE__ */ne(/* @__PURE__ */Fe(function(e,t){j(E);let i=S(e),{size:n,margin:s,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,seriesAccessor:h,data:d,timeAccessor:g,valueAccessor:p,timeExtent:f,valueExtent:w,extentPadding:y,stroke:b,strokeWidth:x,strokeDasharray:C,opacity:M,cursor:P,styleRules:T,background:I,tooltipContent:N,tooltip:R,onHover:F,annotations:z,autoPlaceAnnotations:B,svgAnnotationRules:D,tickFormatTime:L,tickFormatValue:W,decay:V,pulse:$,staleness:K,transition:Z,linkedHover:te,selection:ne,onObservation:oe,chartId:re,loading:ae,loadingContent:le,emptyContent:ce,emphasis:me,legendPosition:de,aggregate:ge,eventTime:pe}=e,fe=i.showAxes,ve=i.enableHover,we=n??[i.width,i.height],ye=b??"#007bff",be=x??2,xe="string"==typeof p?p:"Value",Ae=Oe(()=>{if(i.showLegend)return{legendGroups:[{label:"Series",type:"line",items:[{label:xe,color:ye}],styleFn:e=>({stroke:e.color||"var(--semiotic-primary, #007bff)",strokeWidth:be??2})}]}},[i.showLegend,xe,ye,be]),ke=he(e.legendInteraction,()=>xe,[xe]),{legend:Se,margin:Ce,legendPosition:_e}=ue({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:de,userMargin:s,defaults:i.marginDefaults,additionalLegend:Ae,chartWidth:we[0],chartHeight:we[1],axisChrome:{hasAxis:!1!==i.showAxes}}),He=m({timeAccessor:g,valueAccessor:p}),Me=ie(),Pe=ee({tooltip:R,defaultTooltipContent:He,customFunctionContext:"hover",multiDefaultContent:e=>Me({...e,allSeries:Array.isArray(e.allSeries)?e.allSeries.map(e=>({...e,group:e.group||("string"==typeof p?p:"value")})):e.allSeries})}),Te=N??Pe.tooltipContent,Ie=Ne(null),{activeSelectionHook:Fe,customHoverBehavior:Le,customClickBehavior:je,crosshairSourceId:Ee}=X({selection:ne,linkedHover:te,unwrapData:!0,onObservation:oe,chartType:"RealtimeLineChart",chartId:re,mobileInteraction:i.mobileInteraction}),We=ze(e=>{F&&F(e),Le(e)},[F,Le]),Ve=null!=ge,[Ke,Xe]=Be([]),qe=Ne(null),Ze=Ne(ge);Ze.current=ge;let et=Ne(Ve);et.current=Ve;let tt=Ne(Ke),nt=ze(e=>{tt.current=e,Xe(e)},[]),st=Ne({timeAccessor:g,valueAccessor:p});st.current={timeAccessor:g,valueAccessor:p};let ot=Ve?[ge.window??"tumbling",ge.size,ge.hop??"",ge.gap??"",ge.retain??"",(ge.percentiles??[]).join(","),!0===ge.distinct?"1":"0"].join("|"):"";De(()=>{if(!Ve)return void(qe.current=null);let e=Ze.current,t=new Qe(e,h);if(qe.current=t,d){let{timeAccessor:e,valueAccessor:i}=st.current;for(let n of d)t.push(n,e,i)}nt(t.emit(e))},[ot,Ve,d,g,p,h,nt]),De(()=>{Ve&&qe.current&&nt(qe.current.emit(Ze.current))},[ge?.stat,ge?.band,ge?.sigma]);let rt=ze(e=>{let t=qe.current,i=Ze.current;if(!t||!i)return;let{timeAccessor:n,valueAccessor:s}=st.current;for(let i of e)t.push(i,n,s);nt(t.emit(i))},[nt]),at=null!=pe,lt=Ne(null),ct=Ne(pe);ct.current=pe;let ut=Ne(at);ut.current=at;let ht=Ne(oe);ht.current=oe;let mt=Ne(re);mt.current=re;let dt=at?`${pe.lateness}|${pe.latePolicy??"drop"}`:"",gt=ze(e=>{0!==e.length&&(et.current?rt(e):Ie.current?.pushMany(e))},[rt]);De(()=>{let e=lt.current;if(e&&gt(e.flush()),!at)return void(lt.current=null);let t=g;lt.current=k(ct.current,e=>Number(A(e,t,"time")??NaN))},[dt,at,gt,g]);let pt=ze(e=>{let t=lt.current;if(!ut.current||!t)return void gt(e);let i=[];for(let n of e){let e=t.push(n);for(let t of e.released)i.push(t);if(e.late.length){let i=ht.current;if(i){let{timeAccessor:n}=st.current,s=ct.current?.latePolicy??"drop";for(let o of e.late)i({type:"late-data",datum:o,eventTime:Number(A(o,n,"time")??NaN),watermark:t.watermark,policy:s,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:mt.current})}}}gt(i)},[gt]),ft=ze(()=>{let e=lt.current;!ut.current||!e||gt(e.flush())},[gt]);Re(t,()=>({push:e=>pt([e]),pushMany:e=>pt(e),flush:ft,remove:e=>et.current?[]:Ie.current?.remove(e)??[],update:(e,t)=>et.current?[]:Ie.current?.update(e,t)??[],clear:()=>{lt.current?.clear(),et.current?(qe.current?.clear(),nt([])):Ie.current?.clear()},getData:()=>et.current?tt.current:Ie.current?.getData()??[],getScales:()=>Ie.current?.getScales()??null}),[ft,pt,nt]);let vt=se(ae,we[0],we[1],le,e),wt=vt?null:Y(Ve?void 0:d,we[0],we[1],ce,e),yt=Oe(()=>()=>({stroke:"#007bff",strokeWidth:2}),[]),bt=Oe(()=>J(Ve?$e:g??"time",Ve?Ue:p??"value"),[Ve,g,p]),xt=Oe(()=>Q(yt,T,bt),[yt,T,bt]),At=Oe(()=>{let e=G(xt,{stroke:b,strokeWidth:x,opacity:M});return t=>({...e(t),...null!=C&&{strokeDasharray:C},...null!=P&&{cursor:P}})},[xt,b,x,M,C,P]),kt=_(At,[Fe],ne),St=a??l??"sliding",Ct=v(c,d,u),_t=me?`${o||""} semiotic-emphasis-${me}`.trim():o,Ht=Ve?Ke:d,Mt=Ve?$e:g,Pt=Ve?Ue:p,Tt=Ve?"growing":St,It=ge?.retain??Math.max(Ke.length,600),Nt=Ve?Math.max(1,It):Ct,Rt=Ve&&ge&&"none"!==(ge.band??"none")?{y0Accessor:Ge,y1Accessor:Ye,perSeries:null!=h}:void 0;return vt||wt||/* @__PURE__ */it(O,{ref:Ie,...q(te,Ee),chartType:"line",runtimeMode:"streaming",size:we,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Ce,className:_t,...H(i,ke,e.legendInteraction),arrowOfTime:r,windowMode:Tt,windowSize:Nt,data:Ht,timeAccessor:Mt,valueAccessor:Pt,groupAccessor:Ve&&null!=h?Je:h,xExtent:f,yExtent:w,extentPadding:y,band:Rt,lineStyle:kt??At,showAxes:fe,background:I,hoverAnnotation:ve,tooltipContent:Te,tooltipMode:Pe.tooltipMode,...U({linkedHover:te,selection:ne,onObservation:oe,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:We,customClickBehavior:je}),annotations:z,legend:Se,legendPosition:_e,autoPlaceAnnotations:B,svgAnnotationRules:D,tickFormatTime:L,tickFormatValue:W,decay:V,pulse:$,staleness:K,transition:Z,pointIdAccessor:e.pointIdAccessor})}),"RealtimeLineChart");import{useRef as st,forwardRef as ot,useCallback as rt,useMemo as at}from"react";import{useEffect as lt,useLayoutEffect as ct,useMemo as ut,useRef as ht}from"react";var mt=/* @__PURE__ */Symbol("realtime-function-category-domain"),dt=typeof window>"u"?lt:ct;import{jsx as gt}from"react/jsx-runtime";var pt=[],ft=/* @__PURE__ */ne(/* @__PURE__ */ot(function(e,t){j(F);let i=S(e),{binSize:n,binAlign:s,size:o,margin:r,className:a,arrowOfTime:l="right",windowMode:c,capacityMode:u,windowSize:h,capacity:m,data:g,timeAccessor:f,valueAccessor:w,direction:y="up",timeExtent:x,valueExtent:k,extentPadding:N,categoryAccessor:R,colors:z,fill:B,stroke:D,strokeWidth:E,opacity:V,cursor:G,styleRules:K,valueBands:Z,gap:J,background:te,tooltipContent:ie,tooltip:ne,onHover:oe,annotations:re,autoPlaceAnnotations:ae,svgAnnotationRules:le,tickFormatTime:me,tickFormatValue:de,linkedHover:ge,selection:pe,decay:fe,pulse:ve,staleness:we,transition:ye,onObservation:be,chartId:xe,loading:Ae,loadingContent:ke,emptyContent:Se,emphasis:Ce,legendPosition:_e,legend:He,brush:Me,onBrush:Pe,linkedBrush:Te}=e,Ie=i.showAxes,Ne=at(()=>P({axes:e.axes,showTimeAxis:e.showTimeAxis,showValueAxis:e.showValueAxis}),[e.axes,e.showTimeAxis,e.showValueAxis]),Re=ce({showAxes:Ie,axes:Ne}),Fe=T(i.marginDefaults,Ne,Ie,!!i.title),ze=i.enableHover,Be=!1!==i.showLegend,De=o??[i.width,i.height],Oe=W({isPushMode:void 0===g,colorBy:R,colorScheme:z,showLegend:!1,legendPosition:_e,trackCategoryDomain:Be,registerLinkedCategories:!1}),Le=at(()=>$(g??[],R),[g,R]),je=void 0===g?Oe.categories:Le,{colorScale:Ee,colorMap:We}=I({enabled:!!R,categories:je,colors:z,fallbackColor:B,order:"explicit-then-alpha",domainKey:R}),Ve=at(()=>{if(!We)return je;let e=new Set(je);return Object.keys(We).filter(t=>e.has(t))},[je,We]),$e=rt(e=>{if(null!=e.category)return String(e.category);let t="function"==typeof R?R(e):R?e[R]:"";return String(t)},[R]),{legend:Ue,margin:Ge,legendPosition:Ye,hasAutomaticLegend:Ke}=ue({data:pt,colorBy:R,colorScale:Ee,showLegend:i.showLegend,legendPosition:_e,userMargin:r,defaults:Fe,categories:Ve,additionalLegend:He,chartWidth:De[0],chartHeight:De[1],axisChrome:Re}),Xe=he(e.legendInteraction,R?$e:void 0,Ve,Ke,!0),qe=ee({tooltip:ne,defaultTooltipContent:p({timeAccessor:f,valueAccessor:w,formatTime:me}),multiDefaultContent:d({timeAccessor:f,valueAccessor:w,formatTime:me}),customFunctionContext:"hover"}),Ze=ie??qe.tooltipContent,Je=st(null),{activeSelectionHook:Qe,hoverSelectionHook:et,customHoverBehavior:tt,customClickBehavior:it,crosshairSourceId:nt}=X({selection:pe,linkedHover:ge,hoverHighlight:e.hoverHighlight,hoverHighlightField:"binStart",unwrapData:!0,onObservation:be,chartType:"RealtimeHistogram",chartId:xe,mobileInteraction:i.mobileInteraction}),ot=rt(e=>{oe&&oe(e),tt(e)},[oe,tt]),lt=!0===Me?{dimension:"x",snap:"bin"}:"x"===Me?{dimension:"x"}:"object"==typeof Me?Me:void 0,ct=rt(e=>{Pe&&Pe(e),be&&be(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:xe}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:xe})},[Pe,be,xe]),{brushStreamProps:ut}=L({linkedBrush:Te,xAccessor:"string"==typeof f?f:"time",defaultDimension:"x",onBrush:ct});C(t,Je);let ht=se(Ae,De[0],De[1],ke,e),mt=ht?null:Y(g,De[0],De[1],Se,e),dt={};null!=B&&(dt.fill=B),null!=D&&(dt.stroke=D),null!=E&&(dt.strokeWidth=E),null!=V&&(dt.opacity=V),null!=G&&(dt.cursor=G),null!=J&&(dt.gap=J),null!=Z&&(dt.valueBands=Z);let ft=at(()=>{if(R&&Ee)return e=>null==e.category?{}:{fill:Ee(String(e.category))}},[R,Ee]),vt=at(()=>e=>{let t=e.categoryValue??e.total,i="number"==typeof t&&Number.isFinite(t)?t:void 0,n=Number(e.binStart),s=Number(e.binEnd);return{value:i,x:Number.isFinite(n)&&Number.isFinite(s)?(n+s)/2:void 0,y:i,category:null==e.category?void 0:String(e.category)}},[]),wt=at(()=>Q(ft,K,vt),[ft,K,vt]),yt=at(()=>e=>({...wt(e),...!R&&null!=B&&{fill:B},...null!=D&&{stroke:D},...null!=E&&{strokeWidth:E},...null!=V&&{opacity:V},...null!=G&&{cursor:G}}),[wt,R,B,D,E,V,G]),bt=et||Xe.legendSelectionHook||Qe,xt="string"==typeof f?f:"time",At=_(yt,[bt],pe,at(()=>M(xt),[xt])),kt=Ce?`${a||""} semiotic-emphasis-${Ce}`.trim():a,St=rt(e=>A(e,f,"time")??NaN,[f]),Ct=rt(e=>b(e,w,"value")??NaN,[w]),_t=c??u??"sliding",Ht=v(h,g,m);return ht||mt||/* @__PURE__ */gt(O,{ref:Je,...q(ge,nt),chartType:"bar",runtimeMode:"streaming",size:De,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Ge,className:kt,...H(i,Xe,e.legendInteraction),arrowOfTime:l,windowMode:_t,windowSize:Ht,data:g,timeAccessor:St,valueAccessor:Ct,xExtent:x,yExtent:k,invertY:"down"===y,extentPadding:N,binSize:n,binAlign:s,categoryAccessor:R,barColors:We,barStyle:dt,areaStyle:At,showAxes:Ie,showGrid:i.showGrid,axes:Ne,background:te,hoverAnnotation:ze,tooltipContent:Ze,tooltipMode:qe.tooltipMode,...U({linkedHover:ge,selection:pe,hoverHighlight:e.hoverHighlight,onObservation:be,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:ot,customClickBehavior:it}),annotations:re,autoPlaceAnnotations:ae,svgAnnotationRules:le,tickFormatTime:me,tickFormatValue:de,decay:fe,pulse:ve,staleness:we,transition:ye,pointIdAccessor:e.pointIdAccessor,legend:Ue,legendPosition:Ye,...Oe.categoryDomainProps,brush:lt||(Te?ut.brush:void 0),onBrush:lt||Te?ut.onBrush:void 0})}),"RealtimeHistogram"),vt=/* @__PURE__ */ne(function(e){/* */
37
+ return gt(ft,{...e,windowMode:"growing"})},"TemporalHistogram"),wt=ft;import{useRef as yt,forwardRef as bt,useCallback as xt,useMemo as At}from"react";import{jsx as kt}from"react/jsx-runtime";var St=[],Ct=/* @__PURE__ */ne(/* @__PURE__ */bt(function(e,t){j(z);let i=S(e),{size:n,margin:s,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:d,valueAccessor:g,timeExtent:p,valueExtent:f,yScaleType:w,extentPadding:y,decay:b,pulse:x,staleness:A,transition:k,categoryAccessor:M,colors:P,radius:T,fill:N,opacity:R,stroke:F,strokeWidth:B,cursor:D,pointStyle:L,styleRules:E,background:V,tooltipContent:G,tooltip:K,onHover:Z,annotations:ee,autoPlaceAnnotations:ie,svgAnnotationRules:ne,tickFormatTime:oe,tickFormatValue:re,linkedHover:ae,selection:le,onObservation:ce,chartId:me,loading:de,loadingContent:ge,emptyContent:pe,emphasis:fe,legendPosition:ve}=e,we=i.showAxes,ye=i.enableHover,be=!0===i.showLegend,xe=n??[i.width,i.height],Ae=W({isPushMode:void 0===h,colorBy:M,colorScheme:P,showLegend:!1,legendPosition:ve,trackCategoryDomain:be,registerLinkedCategories:!1}),ke=At(()=>$(h??[],M),[h,M]),Se=void 0===h?Ae.categories:ke,{colorScale:Ce}=I({enabled:!!M,categories:Se,colors:P,fallbackColor:N,domainKey:M}),{legend:_e,margin:He,legendPosition:Me,hasAutomaticLegend:Pe}=ue({data:St,colorBy:M,colorScale:Ce,showLegend:be,legendPosition:ve,userMargin:s,defaults:i.marginDefaults,categories:Se,chartWidth:xe[0],chartHeight:xe[1],axisChrome:{hasAxis:!1!==i.showAxes}}),Te=he(e.legendInteraction,M,Se,Pe,!0),Ie=G??te({tooltip:K,defaultTooltipContent:m({timeAccessor:d,valueAccessor:g}),customFunctionContext:"hover"}).tooltipContent,Ne=yt(null),{activeSelectionHook:Re,hoverSelectionHook:Fe,customHoverBehavior:ze,customClickBehavior:Be,crosshairSourceId:De}=X({selection:le,linkedHover:ae,unwrapData:!0,onObservation:ce,chartType:"RealtimeSwarmChart",chartId:me,mobileInteraction:i.mobileInteraction}),Oe=xt(e=>{Z&&Z(e),ze(e)},[Z,ze]);C(t,Ne);let Le=se(de,xe[0],xe[1],ge,e),je=Le?null:Y(h,xe[0],xe[1],pe,e),Ee={};null!=T&&(Ee.radius=T),null!=N&&(Ee.fill=N),null!=R&&(Ee.opacity=R),null!=F&&(Ee.stroke=F),null!=B&&(Ee.strokeWidth=B),null!=D&&(Ee.cursor=D);let We=L,Ve=At(()=>{if(M)return e=>{let t="function"==typeof M?M(e):M?e[M]:void 0;return{...M&&Ce?{fill:Ce(String(t))}:void 0}}},[M,Ce]),$e=At(()=>{let e=J(d??"time",g??"value");return t=>{let i="function"==typeof M?M(t):M?t[M]:void 0;return e(t,null==i?void 0:String(i))}},[d,g,M]),Ue=At(()=>Q(Ve,E,$e),[Ve,E,$e]),Ge=_(At(()=>e=>({...Ue(e),...We?.(e)}),[Ue,We]),[Fe||Te.legendSelectionHook||Re],le),Ye=fe?`${o||""} semiotic-emphasis-${fe}`.trim():o,Ke=a??l??"sliding",Xe=v(c,h,u);return Le||je||/* @__PURE__ */kt(O,{ref:Ne,...q(ae,De),chartType:"swarm",runtimeMode:"streaming",size:xe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:He,className:Ye,...H(i,Te,e.legendInteraction),arrowOfTime:r,windowMode:Ke,windowSize:Xe,data:h,timeAccessor:d,valueAccessor:g,xExtent:p,yExtent:f,yScaleType:w,extentPadding:y,decay:b,pulse:x,staleness:A,transition:k,categoryAccessor:M,swarmStyle:Ee,pointStyle:Ge,showAxes:we,background:V,hoverAnnotation:ye,tooltipContent:Ie,...U({linkedHover:ae,selection:le,onObservation:ce,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Oe,customClickBehavior:Be}),annotations:ee,autoPlaceAnnotations:ie,svgAnnotationRules:ne,tickFormatTime:oe,tickFormatValue:re,legend:_e,legendPosition:Me,...Ae.categoryDomainProps,pointIdAccessor:e.pointIdAccessor})}),"RealtimeSwarmChart");import{useRef as _t,forwardRef as Ht,useCallback as Mt,useMemo as Pt}from"react";import{jsx as Tt}from"react/jsx-runtime";var It=/* @__PURE__ */ne(/* @__PURE__ */Ht(function(e,t){j(B);let i=S(e),{size:n,margin:s,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:m,valueAccessor:d,timeExtent:p,valueExtent:f,extentPadding:w,decay:y,pulse:b,staleness:x,transition:A,positiveColor:k,negativeColor:M,connectorStroke:P,connectorWidth:T,gap:I,stroke:N,strokeWidth:R,opacity:F,cursor:z,styleRules:D,background:L,tooltipContent:E,tooltip:W,onHover:V,annotations:$,autoPlaceAnnotations:G,svgAnnotationRules:K,tickFormatTime:Z,tickFormatValue:ee,linkedHover:ie,selection:ne,onObservation:oe,chartId:re,loading:ae,loadingContent:le,emptyContent:ce,emphasis:me,legendPosition:de}=e,ge=i.showAxes,pe=i.enableHover,fe=n??[i.width,i.height],ve=Pt(()=>{if(i.showLegend)return{legendGroups:[{label:"Change",type:"fill",items:[{label:"Positive",color:k},{label:"Negative",color:M}],styleFn:e=>({fill:e.color||("Positive"===e.label?"var(--semiotic-success, #28a745)":"var(--semiotic-danger, #dc3545)")})}]}},[M,k,i.showLegend]),we=Mt(e=>{let t=e.delta??("function"==typeof d?d(e):e[d??"value"]);return Number(t)>=0?"Positive":"Negative"},[d]),ye=he(e.legendInteraction,we,["Positive","Negative"]),{legend:be,margin:xe,legendPosition:Ae}=ue({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:de,userMargin:s,defaults:i.marginDefaults,additionalLegend:ve,chartWidth:fe[0],chartHeight:fe[1],axisChrome:{hasAxis:!1!==i.showAxes}}),ke=E??te({tooltip:W,defaultTooltipContent:g({timeAccessor:m,valueAccessor:d}),customFunctionContext:"hover"}).tooltipContent,Se=_t(null),{activeSelectionHook:Ce,hoverSelectionHook:_e,customHoverBehavior:He,customClickBehavior:Me,crosshairSourceId:Pe}=X({selection:ne,linkedHover:ie,unwrapData:!0,onObservation:oe,chartType:"RealtimeWaterfallChart",chartId:re,mobileInteraction:i.mobileInteraction}),Te=Mt(e=>{V&&V(e),He(e)},[V,He]);C(t,Se);let Ie=se(ae,fe[0],fe[1],le,e),Ne=Ie?null:Y(h,fe[0],fe[1],ce,e),Re={};null!=k&&(Re.positiveColor=k),null!=M&&(Re.negativeColor=M),null!=P&&(Re.connectorStroke=P),null!=T&&(Re.connectorWidth=T),null!=I&&(Re.gap=I),null!=N&&(Re.stroke=N),null!=R&&(Re.strokeWidth=R),null!=F&&(Re.opacity=F),null!=z&&(Re.cursor=z);let Fe=_e||ye.legendSelectionHook||Ce,ze=Pt(()=>J(m??"time",d??"value"),[m,d]),Be=Pt(()=>Q(void 0,D,ze),[D,ze]),De=_(Pt(()=>e=>({...Be(e),...null!=N&&{stroke:N},...null!=R&&{strokeWidth:R},...null!=F&&{opacity:F},...null!=z&&{cursor:z}}),[Be,N,R,F,z]),[Fe],ne),Oe=me?`${o||""} semiotic-emphasis-${me}`.trim():o,Le=a??l??"sliding",je=v(c,h,u);return Ie||Ne||/* @__PURE__ */Tt(O,{ref:Se,...q(ie,Pe),chartType:"waterfall",runtimeMode:"streaming",size:fe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:xe,className:Oe,...H(i,ye,e.legendInteraction),arrowOfTime:r,windowMode:Le,windowSize:je,data:h,timeAccessor:m,valueAccessor:d,xExtent:p,yExtent:f,extentPadding:w,decay:y,pulse:b,staleness:x,transition:A,waterfallStyle:Re,areaStyle:De,showAxes:ge,background:L,hoverAnnotation:pe,tooltipContent:ke,...U({linkedHover:ie,selection:ne,onObservation:oe,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Te,customClickBehavior:Me}),annotations:$,autoPlaceAnnotations:G,svgAnnotationRules:K,tickFormatTime:Z,tickFormatValue:ee,legend:be,legendPosition:Ae,pointIdAccessor:e.pointIdAccessor})}),"RealtimeWaterfallChart");import{useRef as Nt,forwardRef as Rt,useCallback as Ft,useMemo as zt,useState as Bt}from"react";import{jsx as Dt}from"react/jsx-runtime";var Ot=/* @__PURE__ */ne(/* @__PURE__ */Rt(function(e,t){j(R);let i=S(e),{size:n,margin:s,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:m,valueAccessor:d,categoryAccessor:g,timeExtent:p,valueExtent:w,extentPadding:y,heatmapXBins:b=20,heatmapYBins:x=20,aggregation:A="count",colorScheme:k,customColorScale:M,cursor:P,styleRules:T,background:I,tooltipContent:F,tooltip:z,onHover:B,annotations:D,autoPlaceAnnotations:L,svgAnnotationRules:E,tickFormatTime:W,tickFormatValue:V,decay:$,pulse:G,staleness:K,linkedHover:Z,selection:J,onObservation:ee,chartId:ie,loading:ne,loadingContent:oe,emptyContent:re,emphasis:ae,legendPosition:le}=e,ce=i.showAxes,he=i.enableHover,me=n??[i.width,i.height],[ge,fe]=Bt(null),ve=zt(()=>ge??[0,1],[ge]),we=zt(()=>{if("custom"===k&&M)return M;let e=pe(k||"blues");return t=>{let i=ve[1]-ve[0]||1;return e(Math.max(0,Math.min(1,(t-ve[0])/i)))}},[k,M,ve]),ye=de(e.legendInteraction,e=>Number(e.value),ve),be=zt(()=>i.showLegend?{gradient:{colorFn:we,domain:ve,label:A}}:void 0,[A,we,i.showLegend,ve]),{legend:xe,margin:Ae,legendPosition:ke}=ue({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:le,userMargin:s,defaults:i.marginDefaults,additionalLegend:be,chartWidth:me[0],chartHeight:me[1],axisChrome:{hasAxis:!1!==i.showAxes}}),Se=F??te({tooltip:z,defaultTooltipContent:f({timeAccessor:m,valueAccessor:d}),customFunctionContext:"hover"}).tooltipContent,Ce=Nt(null),{activeSelectionHook:_e,hoverSelectionHook:He,customHoverBehavior:Me,customClickBehavior:Pe,crosshairSourceId:Te}=X({selection:J,linkedHover:Z,unwrapData:!0,onObservation:ee,chartType:"RealtimeHeatmap",chartId:ie,mobileInteraction:i.mobileInteraction}),Ie=Ft(e=>{B&&B(e),Me(e)},[B,Me]);C(t,Ce);let Ne=se(ne,me[0],me[1],oe,e),Re=Ne?null:Y(h,me[0],me[1],re,e),Fe=ae?`${o||""} semiotic-emphasis-${ae}`.trim():o,ze=a??l??"sliding",Be=v(c,h,u),De=zt(()=>{if(null==P)return;let e={cursor:P};return()=>e},[P]),Oe=zt(()=>N(m??"time",d??"value",d??"value"),[m,d]),Le=_(zt(()=>Q(De,T,Oe),[De,T,Oe]),[He,ye.legendSelectionHook,_e],J);return Ne||Re||/* @__PURE__ */Dt(O,{ref:Ce,...q(Z,Te),chartType:"heatmap",runtimeMode:"streaming",size:me,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Ae,className:Fe,...H(i,ye,e.legendInteraction),arrowOfTime:r,windowMode:ze,windowSize:Be,data:h,timeAccessor:m,valueAccessor:d,categoryAccessor:g,xExtent:p,yExtent:w,extentPadding:y,heatmapXBins:b,heatmapYBins:x,heatmapAggregation:A,colorScheme:"custom"!==k?k:void 0,heatmapColorScale:"custom"===k&&"function"==typeof M?M:void 0,onColorDomainChange:fe,areaStyle:Le,showAxes:ce,background:I,hoverAnnotation:he,tooltipContent:Se,...U({linkedHover:Z,selection:J,onObservation:ee,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ie,customClickBehavior:Pe}),annotations:D,autoPlaceAnnotations:L,svgAnnotationRules:E,tickFormatTime:W,tickFormatValue:V,decay:$,pulse:G,staleness:K,legend:xe,legendPosition:ke,pointIdAccessor:e.pointIdAccessor})}),"RealtimeHeatmap");export{ke as a,Se as b,Ce as c,Me as d,s as e,o as f,r as g,Ie as h,nt as i,M as j,ft as k,vt as l,wt as m,Ct as n,It as o,Ot as p};