semiotic 3.13.1 → 3.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/README.md +48 -48
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/dist/mcp-server.js +4 -4
  4. package/ai/reference.md +23 -12
  5. package/ai/schema.json +258 -96
  6. package/ai/surface-manifest.json +1 -1
  7. package/ai/task-packets/compare-category-totals.json +5 -5
  8. package/ai/task-packets/compare-category-totals.md +2 -2
  9. package/ai/task-packets/correct-published-chart.json +5 -5
  10. package/ai/task-packets/correct-published-chart.md +2 -2
  11. package/ai/task-packets/index.json +6 -6
  12. package/ai/task-packets/update-live-chart.json +5 -5
  13. package/ai/task-packets/update-live-chart.md +2 -2
  14. package/dist/c-2YFVDRU4.min.js +1 -0
  15. package/dist/c-4OVDIXAR.min.js +1 -0
  16. package/dist/c-57IIWW46.min.js +1 -0
  17. package/dist/c-5HTUQRJT.min.js +1 -0
  18. package/dist/c-5NAU4JAY.min.js +1 -0
  19. package/dist/c-62UTMRQE.min.js +1 -0
  20. package/dist/c-6QV6F3U7.min.js +1 -0
  21. package/dist/c-73ORHEHO.min.js +1 -0
  22. package/dist/c-7S46KBYD.min.js +2 -0
  23. package/dist/c-AJSS332Z.min.js +2 -0
  24. package/dist/{c-ZWJDTDEV.min.js → c-AMQAAW7G.min.js} +1 -1
  25. package/dist/c-B3X2IJRQ.min.js +1 -0
  26. package/dist/c-BLLDBVFK.min.js +38 -0
  27. package/dist/c-BQWX6NBX.min.js +1 -0
  28. package/dist/c-C7TT4J7K.min.js +1 -0
  29. package/dist/c-CJ5GA7DM.min.js +1 -0
  30. package/dist/c-D7YDFHLY.min.js +1 -0
  31. package/dist/c-DHNROAXY.min.js +1 -0
  32. package/dist/c-DMDFJQU4.min.js +1 -0
  33. package/dist/{c-RAIBDXDV.min.js → c-FRVHZIGR.min.js} +1 -1
  34. package/dist/{c-I54V24WG.min.js → c-HAZCVHI7.min.js} +1 -1
  35. package/dist/c-HN5U72U7.min.js +1 -0
  36. package/dist/c-JA5F7ITS.min.js +1 -0
  37. package/dist/{c-VZNIIKL6.min.js → c-JDI7HKEM.min.js} +1 -1
  38. package/dist/{c-ISHYKYII.min.js → c-JVZRD4GL.min.js} +1 -1
  39. package/dist/{c-HGWITEJI.min.js → c-KJGJEOSV.min.js} +1 -1
  40. package/dist/c-LDGV6TDQ.min.js +1 -0
  41. package/dist/c-LW3GP7RY.min.js +1 -0
  42. package/dist/c-M2TPZE7P.min.js +1 -0
  43. package/dist/{c-XOGN3524.min.js → c-NBBYSAQY.min.js} +2 -2
  44. package/dist/c-OA6RJZ7S.min.js +1 -0
  45. package/dist/c-OBBSIOYU.min.js +1 -0
  46. package/dist/c-OMTJIC3P.min.js +1 -0
  47. package/dist/{c-SQQZPFVY.min.js → c-QPHM7AWW.min.js} +1 -1
  48. package/dist/{c-XZJWL7UL.min.js → c-QSEAAHEU.min.js} +1 -1
  49. package/dist/c-RQWI623R.min.js +1 -0
  50. package/dist/{c-62JIVHK5.min.js → c-RWFADOKS.min.js} +1 -1
  51. package/dist/c-TFESQSWE.min.js +1 -0
  52. package/dist/{c-SDGGMIYI.min.js → c-TJGC5JEM.min.js} +1 -1
  53. package/dist/{c-4P2EM44G.min.js → c-TOXWQRXS.min.js} +3 -3
  54. package/dist/c-TX53234M.min.js +1 -0
  55. package/dist/c-TZBEQ5UY.min.js +1 -0
  56. package/dist/c-UALVQIIJ.min.js +1 -0
  57. package/dist/c-VBDWHTC7.min.js +1 -0
  58. package/dist/c-VBIPDCE7.min.js +1 -0
  59. package/dist/c-WTNRBWZZ.min.js +51 -0
  60. package/dist/{c-3GIPT46Z.min.js → c-XG4LL2VI.min.js} +1 -1
  61. package/dist/c-XPNBS3W2.min.js +1 -0
  62. package/dist/c-XT3G3YWU.min.js +1 -0
  63. package/dist/c-YCBCZFOC.min.js +1 -0
  64. package/dist/c-ZBSL4Y32.min.js +1 -0
  65. package/dist/c-ZP6O6UHV.min.js +1 -0
  66. package/dist/c-ZVL7ULNH.min.js +1 -0
  67. package/dist/components/ChartErrorBoundary.d.ts +5 -1
  68. package/dist/components/ai/intentWeights.d.ts +22 -0
  69. package/dist/components/ai/streamSchema.d.ts +98 -0
  70. package/dist/components/ai/streamingTypes.d.ts +27 -4
  71. package/dist/components/ai/suggestCharts.d.ts +10 -2
  72. package/dist/components/ai/suggestStreamCharts.d.ts +60 -13
  73. package/dist/components/ai/suggestStreamDashboard.d.ts +9 -1
  74. package/dist/components/charts/network/processSankey/frameMargins.d.ts +1 -1
  75. package/dist/components/charts/network/processSankey/labelPlacement.d.ts +1 -1
  76. package/dist/components/charts/physics/physicsHocUtils.d.ts +1 -1
  77. package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +7 -0
  78. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +9 -2
  79. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +13 -1
  80. package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +5 -1
  81. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +5 -1
  82. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +7 -1
  83. package/dist/components/charts/realtime/TemporalHistogram.capability.d.ts +5 -3
  84. package/dist/components/charts/realtime/aggregate.d.ts +11 -12
  85. package/dist/components/charts/realtime/defaultRealtimeTooltip.d.ts +9 -0
  86. package/dist/components/charts/realtime/eventTime.d.ts +7 -1
  87. package/dist/components/charts/realtime/useRealtimeLineIngestion.d.ts +13 -0
  88. package/dist/components/charts/shared/ChartError.d.ts +4 -6
  89. package/dist/components/charts/shared/GaugeReadout.d.ts +39 -4
  90. package/dist/components/charts/shared/axisExtent.d.ts +2 -1
  91. package/dist/components/charts/shared/chartMode.d.ts +2 -2
  92. package/dist/components/charts/shared/gaugeLayout.d.ts +69 -0
  93. package/dist/components/charts/shared/types.d.ts +4 -1
  94. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +3 -0
  95. package/dist/components/charts/shared/useStreamStatus.d.ts +2 -2
  96. package/dist/components/charts/shared/withChartErrorBoundary.d.ts +14 -0
  97. package/dist/components/charts/xy/Scatterplot.streamCapability.d.ts +2 -0
  98. package/dist/components/charts/xy/WaterfallChart.d.ts +2 -0
  99. package/dist/components/charts/xy/WaterfallIndex.d.ts +12 -0
  100. package/dist/components/charts/xy/lineGapStrategy.d.ts +15 -3
  101. package/dist/components/legendGeometry.d.ts +148 -0
  102. package/dist/components/legendLayout.d.ts +20 -38
  103. package/dist/components/realtime/ReorderBuffer.d.ts +14 -0
  104. package/dist/components/realtime/SlidingExtent.d.ts +18 -0
  105. package/dist/components/realtime/WindowAccumulator.d.ts +5 -1
  106. package/dist/components/realtime/renderers/types.d.ts +1 -0
  107. package/dist/components/realtime/renderers/waterfallRenderer.d.ts +1 -1
  108. package/dist/components/recipes/atlas/resolution/appearance.d.ts +1 -1
  109. package/dist/components/recipes/atlas/resolution/scene.d.ts +1 -1
  110. package/dist/components/recipes/compositional/edgeRouting.d.ts +9 -0
  111. package/dist/components/recipes/compositional/metrics.d.ts +2 -2
  112. package/dist/components/recipes/compositional/projection.d.ts +3 -1
  113. package/dist/components/recipes/compositional/routing.d.ts +3 -1
  114. package/dist/components/recipes/compositional/testFixtures.d.ts +4 -0
  115. package/dist/components/recipes/compositional/topology.d.ts +2 -0
  116. package/dist/components/recipes/compositional/types.d.ts +10 -1
  117. package/dist/components/recipes/compositional/useCompositionalInterfaces.d.ts +20 -0
  118. package/dist/components/semiotic-ai-core.d.ts +3 -2
  119. package/dist/components/semiotic-ai-stream.d.ts +3 -2
  120. package/dist/components/semiotic-network-zoom.d.ts +1 -1
  121. package/dist/components/semiotic-recipes-react.d.ts +2 -0
  122. package/dist/components/semiotic-utils-core.d.ts +2 -0
  123. package/dist/components/server/serverChartConfigHeatmap.d.ts +13 -0
  124. package/dist/components/server/staticLegend.d.ts +5 -0
  125. package/dist/components/server/staticLegendText.d.ts +13 -0
  126. package/dist/components/server/staticSVGChrome.d.ts +2 -2
  127. package/dist/components/store/ThemeStore.d.ts +4 -1
  128. package/dist/components/store/themeCore.d.ts +2 -0
  129. package/dist/components/stream/DataSourceAdapter.d.ts +15 -62
  130. package/dist/components/stream/FrameRuntime.d.ts +3 -0
  131. package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
  132. package/dist/components/stream/IngestActivity.d.ts +9 -0
  133. package/dist/components/stream/NetworkPipelineStore.d.ts +3 -1
  134. package/dist/components/stream/OrdinalPipelineStore.d.ts +5 -2
  135. package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
  136. package/dist/components/stream/PipelineStore.d.ts +8 -3
  137. package/dist/components/stream/accessibleDataRows.d.ts +1 -0
  138. package/dist/components/stream/axisTickUtils.d.ts +25 -5
  139. package/dist/components/stream/frameDefaultMargins.d.ts +26 -4
  140. package/dist/components/stream/frameKeyboardNavigation.d.ts +8 -1
  141. package/dist/components/stream/geoTypes.d.ts +2 -0
  142. package/dist/components/stream/graphKeyboardNavigation.d.ts +4 -2
  143. package/dist/components/stream/hitTestUtils.d.ts +7 -0
  144. package/dist/components/stream/keyboardNav.d.ts +3 -1
  145. package/dist/components/stream/mediaQuery.d.ts +2 -0
  146. package/dist/components/stream/navigationGraph.d.ts +10 -3
  147. package/dist/components/stream/networkEdgeHitIndex.d.ts +6 -2
  148. package/dist/components/stream/networkFrameKeyboardNavigation.d.ts +2 -0
  149. package/dist/components/stream/networkNavGroups.d.ts +3 -0
  150. package/dist/components/stream/networkPipelineConfig.d.ts +1 -0
  151. package/dist/components/stream/networkSceneTypes.d.ts +10 -0
  152. package/dist/components/stream/networkSpatialNavigation.d.ts +3 -0
  153. package/dist/components/stream/networkTypes.d.ts +2 -0
  154. package/dist/components/stream/networkZoom/ZoomableNetworkCustomChart.d.ts +6 -4
  155. package/dist/components/stream/networkZoom/gestures.d.ts +5 -0
  156. package/dist/components/stream/networkZoom/types.d.ts +10 -0
  157. package/dist/components/stream/ordinalAxisTicks.d.ts +27 -0
  158. package/dist/components/stream/ordinalSceneBuilders/pieScene.d.ts +10 -0
  159. package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -0
  160. package/dist/components/stream/ordinalTypes.d.ts +11 -2
  161. package/dist/components/stream/pipelineBufferUtils.d.ts +9 -0
  162. package/dist/components/stream/pipelineConfig.d.ts +7 -0
  163. package/dist/components/stream/pipelineDomainResolution.d.ts +3 -2
  164. package/dist/components/stream/pipelineTransitionTypes.d.ts +3 -5
  165. package/dist/components/stream/pipelineTransitionUtils.d.ts +4 -0
  166. package/dist/components/stream/pipelineTransitions.d.ts +1 -13
  167. package/dist/components/stream/renderers/networkArcRenderer.d.ts +1 -3
  168. package/dist/components/stream/renderers/networkCircleRenderer.d.ts +1 -3
  169. package/dist/components/stream/renderers/networkPrimitiveRenderer.d.ts +5 -0
  170. package/dist/components/stream/renderers/networkRectRenderer.d.ts +1 -3
  171. package/dist/components/stream/renderers/renderPulse.d.ts +8 -14
  172. package/dist/components/stream/roundScaleDomain.d.ts +9 -0
  173. package/dist/components/stream/sceneToSVGShared.d.ts +9 -0
  174. package/dist/components/stream/shallowEqual.d.ts +2 -0
  175. package/dist/components/stream/stalenessBands.d.ts +1 -1
  176. package/dist/components/stream/svgOverlayUtils.d.ts +12 -0
  177. package/dist/components/stream/types.d.ts +10 -2
  178. package/dist/components/stream/useFrame.d.ts +7 -4
  179. package/dist/components/stream/useMediaPreferences.d.ts +1 -4
  180. package/dist/components/stream/useOrdinalFrameHandle.d.ts +4 -14
  181. package/dist/components/stream/useStalenessCheck.d.ts +5 -3
  182. package/dist/components/stream/useStreamingDataHandle.d.ts +24 -0
  183. package/dist/components/stream/useXYFrameHandle.d.ts +4 -14
  184. package/dist/components/stream/xyDateTicks.d.ts +33 -4
  185. package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
  186. package/dist/components/stream/xyPlugins/registry.d.ts +7 -0
  187. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +11 -2
  188. package/dist/components/stream/xySceneBuilders/types.d.ts +4 -0
  189. package/dist/components/types/legendTypes.d.ts +12 -1
  190. package/dist/geo.min.js +155 -152
  191. package/dist/geo.module.min.js +1 -1
  192. package/dist/network.module.min.js +1 -1
  193. package/dist/ordinal.module.min.js +1 -1
  194. package/dist/physics.module.min.js +1 -1
  195. package/dist/processSankeyLayoutWorker.js +1 -1
  196. package/dist/semiotic-ai-core.d.ts +3 -2
  197. package/dist/semiotic-ai-core.min.js +5 -5
  198. package/dist/semiotic-ai-core.module.min.js +4 -4
  199. package/dist/semiotic-ai.module.min.js +2 -2
  200. package/dist/semiotic-artifact.min.js +6 -6
  201. package/dist/semiotic-artifact.module.min.js +5 -5
  202. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  203. package/dist/semiotic-atlas.module.min.js +1 -1
  204. package/dist/semiotic-client-cjs-shared.min.js +1021 -1024
  205. package/dist/semiotic-client-compositional.module.min.js +1 -1
  206. package/dist/semiotic-client-shared.module.min.js +1 -1
  207. package/dist/semiotic-experimental-auxiliary.module.min.js +2 -2
  208. package/dist/semiotic-experimental-network-resolution-react.module.min.js +1 -1
  209. package/dist/semiotic-experimental-node-auxiliary.module.min.js +3 -3
  210. package/dist/semiotic-line.module.min.js +1 -1
  211. package/dist/semiotic-network-zoom.d.ts +1 -1
  212. package/dist/semiotic-network-zoom.min.js +7 -7
  213. package/dist/semiotic-network-zoom.module.min.js +1 -1
  214. package/dist/semiotic-realtime-core.module.min.js +1 -1
  215. package/dist/semiotic-realtime-react.module.min.js +1 -1
  216. package/dist/semiotic-recipes-core-cjs-base.min.js +101 -101
  217. package/dist/semiotic-recipes-core.module.min.js +1 -1
  218. package/dist/semiotic-recipes-react.d.ts +2 -0
  219. package/dist/semiotic-recipes-react.min.js +8 -8
  220. package/dist/semiotic-server-edge-node.module.min.js +3 -3
  221. package/dist/semiotic-server-edge.min.js +399 -397
  222. package/dist/semiotic-server-edge.module.min.js +3 -3
  223. package/dist/semiotic-server-node.min.js +399 -397
  224. package/dist/semiotic-themes-core.min.js +2 -2
  225. package/dist/semiotic-themes-core.module.min.js +1 -1
  226. package/dist/semiotic-themes.min.js +2 -2
  227. package/dist/semiotic-themes.module.min.js +1 -1
  228. package/dist/semiotic-utils-core.d.ts +2 -0
  229. package/dist/semiotic-utils-core.min.js +11 -11
  230. package/dist/semiotic-utils-core.module.min.js +3 -3
  231. package/dist/semiotic-value.module.min.js +1 -1
  232. package/dist/semiotic.module.min.js +1 -1
  233. package/dist/server.min.js +399 -397
  234. package/dist/server.module.min.js +3 -3
  235. package/dist/xy.module.min.js +1 -1
  236. package/package.json +11 -11
  237. package/dist/c-2M2OPWVA.min.js +0 -37
  238. package/dist/c-2N7IU2NY.min.js +0 -1
  239. package/dist/c-3UXQGCQT.min.js +0 -1
  240. package/dist/c-4RVDKSMQ.min.js +0 -1
  241. package/dist/c-4YPPVFZH.min.js +0 -1
  242. package/dist/c-6WJKNYIG.min.js +0 -1
  243. package/dist/c-7UN2WUMI.min.js +0 -1
  244. package/dist/c-AQUX6L2O.min.js +0 -1
  245. package/dist/c-BR5QDUCR.min.js +0 -1
  246. package/dist/c-C3YQVUB6.min.js +0 -1
  247. package/dist/c-COP4OISO.min.js +0 -1
  248. package/dist/c-ENRZPF5E.min.js +0 -1
  249. package/dist/c-FAOZZE77.min.js +0 -1
  250. package/dist/c-HBLICBM6.min.js +0 -1
  251. package/dist/c-I4BEWAKT.min.js +0 -1
  252. package/dist/c-IDCFMBA4.min.js +0 -2
  253. package/dist/c-KLJDKRD5.min.js +0 -1
  254. package/dist/c-LEICSI5V.min.js +0 -1
  255. package/dist/c-MOK4RWNO.min.js +0 -1
  256. package/dist/c-N2TVSOYL.min.js +0 -2
  257. package/dist/c-NHZ2E3CI.min.js +0 -1
  258. package/dist/c-OIJL2WZH.min.js +0 -1
  259. package/dist/c-OSLNYZ3Q.min.js +0 -51
  260. package/dist/c-OWRVBUSL.min.js +0 -1
  261. package/dist/c-QIVKWHDL.min.js +0 -1
  262. package/dist/c-QUAEYF34.min.js +0 -1
  263. package/dist/c-RDFFLRKC.min.js +0 -1
  264. package/dist/c-RTU5425Z.min.js +0 -1
  265. package/dist/c-SIQVOV6A.min.js +0 -1
  266. package/dist/c-SU6Z75M2.min.js +0 -1
  267. package/dist/c-SWVXFUDL.min.js +0 -1
  268. package/dist/c-TC47SNSI.min.js +0 -1
  269. package/dist/c-VLWWXOM5.min.js +0 -1
  270. package/dist/c-VNFIRKU5.min.js +0 -1
  271. package/dist/c-W5ATXREF.min.js +0 -1
  272. package/dist/c-WFX456JK.min.js +0 -5
  273. package/dist/c-WSWMQDFZ.min.js +0 -1
  274. package/dist/c-XORVM6C5.min.js +0 -1
  275. package/dist/c-YGTMWEEF.min.js +0 -1
  276. package/dist/c-ZDCTFRA6.min.js +0 -1
@@ -1 +1 @@
1
- function t(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function e(t){return t.y0-t.y1>0?"up":"down"}function r(t,e){return e(t.source)==e(t.target)}function a(t){return t.target.x0-t.source.x1}function i(t,r){var i=c(t),n=a(r)/Math.tan(i);return"up"==e(t)?t.y1-n:t.y1+n}function n(t,r){var i=c(t),n=a(r)/Math.tan(i);return"up"==e(t)?t.y1+n:t.y1-n}function c(t){var e=Math.abs(t.y1-t.y0),r=Math.abs(t.target.x0-t.source.x1);return Math.atan(r/e)}function l(t){return u(t.source)}function o(t){return u(t.target)}function u(t){return(t.y0+t.y1)/2}function s(t){return t.virtual?0:t.value}function f(t,e){var a=0;t.sourceLinks.forEach(function(t){a=t.circular&&!r(t,e)?a+1:a});var i=0;return t.targetLinks.forEach(function(t){i=t.circular&&!r(t,e)?i+1:i}),a+i}function h(t){return t.target.depth}function d(t,e){return t.sourceLinks.length?t.depth:e-1}function y(t,e){return t.y0-e.y0}function g(t,e){return e.y0-t.y0}function p(t,e){return t.y1-e.y1}function m(t,e){return e.y1-t.y1}function x(t,e){return L(t.source,e.source)||t.index-e.index}function k(t,e){return L(t.target,e.target)||t.index-e.index}function L(t,e){return t.partOfCycle===e.partOfCycle?t.y0-e.y0:"top"===t.circularLinkType||"bottom"===e.circularLinkType?-1:1}function v(t,e){return b(t)==b(e)?"bottom"==t.circularLinkType?g(t,e):y(t,e):b(e)-b(t)}function b(t){return t.target.column-t.source.column}function D(t,e){return P(t)==P(e)}function P(t){return t.y0-t.y1>0?"up":"down"}function E(t,e,a,i,n){let c=t;c.links.forEach(function(t){t.circular&&(t._circularWidth=t.width,t._circularStub=!1)});var l=yt(c.links,function(t){return t.source.y0});c.links.forEach(function(t){t.circular&&(t.circularPathData={})});var o=c.links.filter(function(t){return t.circular}),u=new Map,s=new Map;o.forEach(function(t){u.set(t.source,(u.get(t.source)||0)+1),s.set(t.target,(s.get(t.target)||0)+1)});var f=new Set(o.filter(function(t){return r(t,e)&&1===u.get(t.source)&&1===s.get(t.target)}));return["top","bottom"].forEach(function(t){var e=o.filter(function(e){return e.circularLinkType===t});(function(t,e,r){if(0!==t.length){t.sort(v);var a=Array.from(new Set(t.flatMap(function(t){return[t.source.column,t.target.column]}))).sort(function(t,e){return t-e}),i=new Map(a.map(function(t,e){return[t,e]})),n=new zt(a.length);t.forEach(function(t){var a=i.get(t.source.column),c=i.get(t.target.column),l=Math.min(a,c),o=Math.max(a,c),u=e.has(t)?0:n.query(l,o);t.circularPathData.verticalBuffer=u+t._circularWidth/2,n.reserve(l,o,u+t._circularWidth+r)})}})(e.slice(),f,a),["source","target"].forEach(function(r){var n=new Map;e.forEach(function(t){var e=t[r].column;n.has(e)||n.set(e,[]),n.get(e).push(t)}),n.forEach(function(e){e.sort("source"===r?"bottom"===t?g:y:"bottom"===t?m:p);var n=0,c="source"===r?"right":"left";e.forEach(function(t,e){t.circularPathData[c+"SmallArcRadius"]=i+t._circularWidth/2+n,t.circularPathData[c+"LargeArcRadius"]=i+t._circularWidth/2+e*a+n,n+=t._circularWidth})})})}),c.links.forEach(function(t){t.circular&&(t.circularPathData.arcRadius=t._circularWidth+i,t.circularPathData.rightNodeBuffer=5,t.circularPathData.leftNodeBuffer=5,t.circularPathData.sourceWidth=t.source.x1-t.source.x0,t.circularPathData.sourceX=t.source.x0+t.circularPathData.sourceWidth,t.circularPathData.targetX=t.target.x0,t.circularPathData.sourceY=t.y0,t.circularPathData.targetY=t.y1,f.has(t)?(t.circularPathData.rightSmallArcRadius=i+t._circularWidth/2,t.circularPathData.rightLargeArcRadius=i+t._circularWidth/2,t.circularPathData.leftSmallArcRadius=i+t._circularWidth/2,t.circularPathData.leftLargeArcRadius=i+t._circularWidth/2,"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=t.source.y1+n+t.circularPathData.verticalBuffer,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius):(t.circularPathData.verticalFullExtent=t.source.y0-n-t.circularPathData.verticalBuffer,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius)):"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=Math.max(c.y1,t.source.y1,t.target.y1)+n+t.circularPathData.verticalBuffer,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius):(t.circularPathData.verticalFullExtent=l-n-t.circularPathData.verticalBuffer,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius),t.circularPathData.rightInnerExtent=t.circularPathData.sourceX+t.circularPathData.rightNodeBuffer,t.circularPathData.leftInnerExtent=t.circularPathData.targetX-t.circularPathData.leftNodeBuffer,t.circularPathData.rightFullExtent=t.circularPathData.sourceX+t.circularPathData.rightLargeArcRadius+t.circularPathData.rightNodeBuffer,t.circularPathData.leftFullExtent=t.circularPathData.targetX-t.circularPathData.leftLargeArcRadius-t.circularPathData.leftNodeBuffer),t.circular?t.path=function(t){return"top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.rightSmallArcRadius)+" L"+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" L"+t.circularPathData.leftFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.leftSmallArcRadius)+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.rightSmallArcRadius)+" L"+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" L"+t.circularPathData.leftFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.leftSmallArcRadius)+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY}(t):t.path=function(t){var e=t.source.x1,r=t.y0,a=t.target.x0,i=t.y1,n=(e+a)/2;return"M"+e+","+r+"C"+n+","+r+" "+n+","+i+" "+a+","+i}(t)}),c}function M(t){return function(){return t}}function S(t){return t.index}function w(t){return t.nodes}function A(t){return t.links}function $(t,e,r){var a=mt(t.nodes,function(t){return t.column}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]});a.forEach(function(i,n){var c=i.length;if(e)i.sort(e);else if(n>0){var l=new Map;i.forEach(function(t,e){var r,a,i,n=(a=0,i=0,(r=t).targetLinks.forEach(function(t){if(!t.circular){var e=t.value||1;i+=u(t.source)*e,a+=e}}),r.sourceLinks.forEach(function(t){if(!t.circular){var e=t.value||1;i+=u(t.target)*e,a+=e}}),a>0?i/a:NaN);l.set(t,{bc:n,idx:e})}),i.sort(function(t,e){var r=l.get(t),a=l.get(e),i=r.bc,n=a.bc;if(t.circularLinkType!==e.circularLinkType){if("top"==t.circularLinkType&&"bottom"==e.circularLinkType)return-1;if("bottom"==t.circularLinkType&&"top"==e.circularLinkType)return 1;if("top"==t.circularLinkType)return-1;if("top"==e.circularLinkType||"bottom"==t.circularLinkType)return 1;if("bottom"==e.circularLinkType)return-1}return isNaN(i)||isNaN(n)?isNaN(i)?isNaN(n)?r.idx-a.idx:1:-1:i-n})}else i.sort(function(t,e){return t.circularLinkType==e.circularLinkType?f(e,r)-f(t,r):"top"==t.circularLinkType&&"bottom"==e.circularLinkType||"top"==t.circularLinkType&&0==e.partOfCycle||0==t.partOfCycle&&"bottom"==e.circularLinkType?-1:0});i.forEach(function(e,i){e.depth==a.length-1&&1==c||0==e.depth&&1==c?(e.y0=t.y1/2-e.value*t.ky,e.y1=e.y0+e.value*t.ky):e.partOfCycle?0==f(e,r)?(e.y0=t.y1/2+i,e.y1=e.y0+e.value*t.ky):"top"==e.circularLinkType?(e.y0=t.y0+i,e.y1=e.y0+e.value*t.ky):(e.y0=t.y1-e.value*t.ky-i,e.y1=e.y0+e.value*t.ky):0==t.y0||0==t.y1?(e.y0=(t.y1-t.y0)/c*i,e.y1=e.y0+e.value*t.ky):(e.y0=(t.y1-t.y0)/2-c/2+i,e.y1=e.y0+e.value*t.ky)})})}function T(t,e,r,a,i,n){function c(e,r){var a=h.length;h.forEach(function(i){var n=i.length,c=i[0].depth;i.forEach(function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&f(i,r)>0){var h=kt(i.sourceLinks,o),d=kt(i.targetLinks,l),y=h&&d?(h+d)/2:h||d;if(y){var g=(y-u(i))*e*.3;i.y0+=g,i.y1+=g}}else if(0==c&&1==n)s=i.y1-i.y0,i.y0=t.y1/2-s/2,i.y1=t.y1/2+s/2;else if(c==a-1&&1==n)s=i.y1-i.y0,i.y0=t.y1/2-s/2,i.y1=t.y1/2+s/2;else if(1==i.targetLinks.length&&1==i.targetLinks[0].source.sourceLinks.length)s=i.y1-i.y0,i.y0=i.targetLinks[0].source.y0,i.y1=i.y0+s;else{var p=kt(i.sourceLinks,o),m=kt(i.targetLinks,l),x=((p&&m?(p+m)/2:p||m)-u(i))*e;i.y0+=x,i.y1+=x}})})}function s(){h.forEach(function(r){var n,c,l,o=t.y0,u=r.length;for(e?r.sort(e):r.sort(L),l=0;l<u;++l)(c=o-(n=r[l]).y0)>0&&(n.y0+=c,n.y1+=c),o=n.y1+a;if((c=o-a-t.y1)>0)for(o=n.y0-=c,n.y1-=c,l=u-2;l>=0;--l)(c=(n=r[l]).y1+i-o)>0&&(n.y0-=c,n.y1-=c),o=n.y0})}var h=mt(t.nodes,function(t){return t.column}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]});s();for(var d=1,y=n;y>0;--y)c(d*=.99,r),s()}function R(t){t.nodes.forEach(function(t){t.sourceLinks.sort(k),t.targetLinks.sort(x)}),t.nodes.forEach(function(t){var e=t.y0,r=e,a=t.y1,i=a;t.sourceLinks.forEach(function(t){t.circular?(t.y0=a-t.width/2,a-=t.width):(t.y0=e+t.width/2,e+=t.width)}),t.targetLinks.forEach(function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)})})}function _(t){let{sx:e,sTop:r,sBot:a,tx:i,tTop:n,tBot:c,cp1X:l,cp2X:o}=t,u=(r+a)/2,s=(n+c)/2;return{pathD:[`M${e},${r}`,`C${l},${r} ${o},${n} ${i},${n}`,`L${i},${c}`,`C${o},${c} ${l},${a} ${e},${a}`,"Z"].join(" "),bezier:{circular:!1,points:[{x:e,y:u},{x:l,y:u},{x:o,y:s},{x:i,y:s}],halfWidth:(a-r)/2}}}function I(t){let e=t.circularPathData;if(!e)return null;let r=t.sankeyWidth/2,a="bottom"===t.circularLinkType?1:-1,i=1===a?1:0,n="down"===t.direction,c=(t,e)=>n?`${e},${t}`:`${t},${e}`,l=(t,e,r,a,i)=>`A${n?e:t},${n?t:e} 0 0 ${n?1-r:r} ${c(a,i)}`,{sourceX:o,sourceY:u,targetX:s,targetY:f,rightInnerExtent:h,leftInnerExtent:d,rightFullExtent:y,leftFullExtent:g,verticalFullExtent:p,verticalRightInnerExtent:m,verticalLeftInnerExtent:x,rightLargeArcRadius:k,rightSmallArcRadius:L,leftLargeArcRadius:v,leftSmallArcRadius:b}=e;return`M${c(o,u-a*r)}L${c(h,u-a*r)}`+l(k+r,L+r,i,y+r,u+a*L)+`L${c(y+r,m)}`+l(k+r,k+r,i,h,p+a*r)+`L${c(d,p+a*r)}`+l(v+r,v+r,i,g-r,x)+`L${c(g-r,f+a*b)}`+l(v+r,b+r,i,d,f-a*r)+`L${c(s,f-a*r)}L${c(s,f+a*r)}L${c(d,f+a*r)}`+l(v-r,b-r,1-i,g+r,f+a*b)+`L${c(g+r,x)}`+l(v-r,v-r,1-i,d,p-a*r)+`L${c(h,p-a*r)}`+l(k-r,k-r,1-i,y-r,m)+`L${c(y-r,u+a*L)}`+l(k-r,L-r,1-i,h,u+a*r)+`L${c(o,u+a*r)}Z`}function W(t,e){if("production"===process.env.NODE_ENV||!t||!t.data||"object"!=typeof t.data)return t;let r=Bt.get(t);if(r){let t=r.get(e);if(t)return t}else r=new Map,Bt.set(t,r);let a=new Proxy(t,{get(t,r,a){if("string"==typeof r&&!(r in t)&&t.data&&r in t.data){let t=`${e}:${r}`;jt.has(t)||(jt.add(t),console.warn(`[Semiotic] "${e}" callback accessed "${r}" on the wrapper object, but it only exists on ".data". Use d.data.${r} (or d.data?.${r}) instead. Frame callbacks receive RealtimeNode/RealtimeEdge wrappers, not your raw data.`))}return Reflect.get(t,r,a)}});return r.set(e,a),a}function F(t,e,r){let a=[];for(let i of e){let e=ut(i.source),n=ut(i.target),c=null;if(e===t?c=n:n===t&&(c=e),c){let t=r.get(c);t&&(0!==t.x||0!==t.y)&&a.push({x:t.x,y:t.y})}}return a}function N(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r)|0;return Math.abs(e)}function C(t,e,r){let a=t.match(/[a-zA-Z]|[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?/g);if(!a)return t;let i=[],n=0;for(;n<a.length;){let t=a[n];if("M"===t||"L"===t||"C"===t||"Q"===t)for(i.push(t),n++;n<a.length&&!isNaN(Number(a[n]));)i.push(String(Number(a[n])+e)),n++,n<a.length&&!isNaN(Number(a[n]))&&(i.push(String(Number(a[n])+r)),n++);else if("A"===t)for(i.push(t),n++;n<a.length&&!isNaN(Number(a[n]));)i.push(a[n++]),n<a.length&&i.push(a[n++]),n<a.length&&i.push(a[n++]),n<a.length&&i.push(a[n++]),n<a.length&&i.push(a[n++]),n<a.length&&(i.push(String(Number(a[n])+e)),n++),n<a.length&&(i.push(String(Number(a[n])+r)),n++);else"Z"===t||"z"===t?(i.push(t),n++):(i.push(a[n]),n++)}return i.join(" ")}function z(t){let[e,r,a]=function(t){if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6===e.length)return[0,2,4].map(t=>parseInt(e.slice(t,t+2),16))}let e=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return e?[+e[1],+e[2],+e[3]]:[128,128,128]}(t);return.299*e+.587*r+.114*a>150?"#222":"#fff"}function O(t){if(t)return"function"==typeof t?t:e=>e[t]}function j(t){if(!t)return null;if("function"==typeof t){let e=t;return t=>e(t.data??t)}return e=>e.data?.[t]||e[t]||e.id}function B(t){let e=new Map(t.map(t=>[t,0]));return t.map(t=>{let r=e.get(t),a=t;for(;r>0&&e.has(a);)a=`${t}__${r++}`;return e.set(t,r||1),e.set(a,1),a})}function X(t,e,r){if(e.colorByDepth&&void 0!==t.depth){let r=function(t){return Array.isArray(t.colorScheme)?t.colorScheme:t.themeCategorical&&t.themeCategorical.length>0?t.themeCategorical:Gt}(e);return r[t.depth%r.length]}return r||function(t){return Array.isArray(t.colorScheme)&&t.colorScheme.length>0?t.colorScheme[0]:t.themeSemantic?.primary?t.themeSemantic.primary:t.themeCategorical&&t.themeCategorical.length>0?t.themeCategorical[0]:"#4d430c"}(e)}function Y(t,e,r){return{fill:X(t,e,r.fill),stroke:r.stroke||e.themeSemantic?.surface||"#fff",strokeWidth:r.strokeWidth??1,opacity:r.opacity,cursor:r.cursor}}function q(t){return!t.__hierarchyNode?.children?.length}function K(t,e,r,a,i){let n=(t+r)/2,c=(e+a)/2;return"horizontal"===i?`M ${t},${e} C ${n},${e} ${n},${a} ${r},${a}`:"radial"===i?`M ${t},${e} Q ${n},${e} ${n},${c} T ${r},${a}`:`M ${t},${e} C ${t},${c} ${r},${c} ${r},${a}`}function Z(t,e,r){let a=r.treeOrientation||"vertical";if("radial"===a){let r=e.x,a=e.y;t.x=a*Math.cos(r-Math.PI/2),t.y=a*Math.sin(r-Math.PI/2)}else"horizontal"===a?(t.x=e.y,t.y=e.x):(t.x=e.x,t.y=e.y);Q(t,5)}function G(t,e){t.x0=e.x0,t.y0=e.y0,t.x1=t.value?e.x1:e.x0,t.y1=t.value?e.y1:e.y0,t.x=(t.x0+t.x1)/2,t.y=(t.y0+t.y1)/2,t.width=t.x1-t.x0,t.height=t.y1-t.y0}function V(t,e){let r=e.r??0;t.x=e.x,t.y=e.y,Q(t,r),t.__radius=r}function Q(t,e){t.x0=t.x-e,t.x1=t.x+e,t.y0=t.y-e,t.y1=t.y+e,t.width=2*e,t.height=2*e}function H(t){return t.data&&"object"==typeof t.data?t.data:t}function J(t,e,r){if(e)return r?.selectedStyle&&Object.assign(t,r.selectedStyle),t;let a=r?.unselectedOpacity??ft;return t.opacity=a,t.fillOpacity=a,t.strokeOpacity=a,r?.unselectedStyle&&Object.assign(t,r.unselectedStyle),t}function U(t,e,r){if(t)return e?a=>{let i={...t(a)};return e.isActive?J(i,e.predicate(H(a)),r):i}:t}function tt(t,e,r){if(t)return e?a=>{let i={...t(a)};if(!e.isActive)return i;let n=H(a),c="object"==typeof a.source?H(a.source):null,l="object"==typeof a.target?H(a.target):null;return J(i,c||l?!!c&&e.predicate(c)||!!l&&e.predicate(l):e.predicate(n),r)}:t}function et(t,e){if(!t)return[];let r=[],a=t=>{r.push(t);let i="function"==typeof e?e(t):t[e];i&&Array.isArray(i)&&i.forEach(a)};return a(t),r}function rt(t,e,r,a){if(t&&t.length>0)return t;let i=new Set;return e.forEach(t=>{let e="function"==typeof r?r(t):t[r],n="function"==typeof a?a(t):t[a];i.add(e),i.add(n)}),Array.from(i).map(t=>({id:t}))}function at({edgeColorBy:t,colorBy:e,colorScale:r,nodeStyleFn:a,edgeOpacity:i,baseStyle:n={}}){return c=>{let l={fillOpacity:i,...n};if("function"==typeof t)l.fill=t(c);else if("source"===t){let t="object"==typeof c.source?c.source:null;e&&t?l.fill=dt(t.data||t,e,r):t&&(l.fill=a(t,t.index).fill)}else if("target"===t){let t="object"==typeof c.target?c.target:null;e&&t?l.fill=dt(t.data||t,e,r):t&&(l.fill=a(t,t.index).fill)}else"gradient"===t&&(l.fill="#999",l.fillOpacity=.7*i);return l}}function it(t){return nt(t,"orbit",()=>({metaMap:new Map,startTime:typeof performance<"u"?performance.now():Date.now()}))}import{a as nt}from"./c-DEWMXCOF.min.js";import{a as ct,b as lt}from"./c-LHVHGQRW.min.js";import{e as ot,f as ut}from"./c-YLZIV3VS.min.js";import{a as st,e as ft}from"./c-KLJDKRD5.min.js";import{a as ht,r as dt}from"./c-WPL6PGP3.min.js";import{min as yt,group as gt,sum as pt,groups as mt,max as xt,mean as kt}from"d3-array";import{interpolateNumber as Lt}from"d3-interpolate";import{forceLink as vt,forceSimulation as bt,forceManyBody as Dt,forceCollide as Pt,forceCenter as Et,forceX as Mt,forceY as St}from"d3-force";import{ribbon as wt,chord as At}from"d3-chord";import{arc as $t,pie as Tt}from"d3-shape";import{hierarchy as Rt,cluster as _t,tree as It,treemap as Wt,treemapBinary as Ft,partition as Nt,pack as Ct}from"d3-hierarchy";var zt=class{constructor(t){this.size=t,this.maximum=new Float64Array(4*t),this.floor=new Float64Array(4*t)}query(t,e){let r=(a,i,n)=>{if(t<=i&&n<=e)return this.maximum[a];let c=i+n>>>1;return Math.max(this.floor[a],t<=c?r(2*a,i,c):0,e>c?r(2*a+1,c+1,n):0)};return r(1,0,this.size-1)}reserve(t,e,r){let a=(i,n,c)=>{if(this.maximum[i]=Math.max(this.maximum[i],r),t<=n&&c<=e)return void(this.floor[i]=Math.max(this.floor[i],r));let l=n+c>>>1;t<=l&&a(2*i,n,l),e>l&&a(2*i+1,l+1,c)};a(1,0,this.size-1)}},Ot=t=>{let{source:e,target:r}=t;if("string"==typeof e||"string"==typeof r)return null;if("down"===t.direction){let a=t.y0-t.sankeyWidth/2,i=t.y1-t.sankeyWidth/2,n=t.y1+t.sankeyWidth/2,c=t.y0+t.sankeyWidth/2,l=e.x1,o=r.x0,u=Lt(l,o),s=u(.5),f=u(.5);return`M${a},${l}C${a},${s} ${i},${f} ${i},${o}L${n},${o}C${n},${f} ${c},${s} ${c},${l}Z`}let a=t.sankeyWidth/2,i=Lt(e.x1,r.x0),{pathD:n}=_({sx:e.x1,sTop:t.y0-a,sBot:t.y0+a,tx:r.x0,tTop:t.y1-a,tBot:t.y1+a,cp1X:i(.5),cp2X:i(.5)});return n},jt=/*#__PURE__*/new Set,Bt=/*#__PURE__*/new WeakMap,Xt={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Math.min.apply(Math,t.sourceLinks.map(h))-1:0},justify:d},Yt={supportsStreaming:!0,hierarchical:!1,computeLayout(e,a,c,l){let o="vertical"===c.orientation?"down":"right",u=c.nodeAlign||"justify",f=c.nodeWidth??15,h=c.nodePaddingRatio??.05,y=c.iterations??300;for(let t of a)t.sankeyWidth=0,t.circular=!1,delete t.circularPathData,delete t._circularWidth,delete t._circularStub;for(let t of e)t.value=0,t.width=t.height=0,t.x0=t.x1=t.y0=t.y1=0,t.sourceLinks=[],t.targetLinks=[];let g=new Set(e.map(t=>t.id)),p=new Set,m=a.filter(t=>{let e=ut(t.source),r=ut(t.target);return!(!Number.isFinite(t.value)||t.value<=0||!g.has(e)||!g.has(r)||(p.add(e),p.add(r),0))}).map(t=>({...t,source:ut(t.source),target:ut(t.target)}));if(0===m.length)return;let x,k=e.filter(t=>p.has(t.id)).map(t=>({...t}));x="down"===o?[[0,0],[l[1],l[0]]]:[[0,0],[l[0],l[1]]];let L=function(){function e(){var e={nodes:k.apply(null,arguments),links:L.apply(null,arguments)};return function(e){e.x0=a,e.y0=c,e.x1=l,e.y1=o,e.py=0,function(e,r){e.nodes.forEach(function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]});var a=function(t,e){var r=new Map;return gt(t,e).forEach(function(t,e){r.set(e,t[0])}),r}(e.nodes,r);e.links.forEach(function(e,r){e.index=r;var i=e.source,n=e.target;"object"!=typeof i&&(i=e.source=t(a,i)),"object"!=typeof n&&(n=e.target=t(a,n)),i.sourceLinks.push(e),n.targetLinks.push(e)})}(e,y),function(t,e,r){var a=0,i=null==e?function(t,e,r){let a=t.length,i=Array.from({length:a},()=>[]),n=Array.from({length:a},()=>[]),c=new Int32Array(a),l=new Int32Array(a),o=new Float64Array(a),u=new Float64Array(e.length),s=new Int32Array(a),f=t.map(t=>{let e=r(t);return`${typeof e}:${String(e)}`}),h=0;for(let t of e)t.source.index!==t.target.index&&Number.isFinite(t.value)&&(h=Math.max(h,t.value));let d=(t,e)=>f[t]<f[e]?-1:f[t]>f[e]?1:0;e.map((t,e)=>e).sort((t,r)=>d(e[t].source.index,e[r].source.index)||d(e[t].target.index,e[r].target.index)||e[t].value-e[r].value).forEach(t=>{let r=e[t],a=r.source.index,s=r.target.index;if(a===s)return;let f=Number.isFinite(r.value)&&h>0?Math.max(0,r.value)/h:0;u[t]=f,n[a].push(t),i[s].push(t),l[a]++,c[s]++,o[a]+=f,o[s]-=f});let y=t.map(t=>t.index),g=Int32Array.from(y),p=t=>0===l[t]?2:0===c[t]?1:0,m=(t,e)=>{let r=p(t),a=p(e);return r!==a?r>a:0===r&&o[t]!==o[e]?o[t]>o[e]:f[t]<f[e]||f[t]===f[e]&&t<e},x=(t,e)=>{let r=y[t];y[t]=y[e],y[e]=r,g[y[t]]=t,g[r]=e},k=(t,e=!1)=>{let r=g[t];for(;!e&&r>0;){let e=r-1>>>1;if(!m(t,y[e]))break;x(r,e),r=e}for(;2*r+1<y.length;){let e=2*r+1;if(e+1<y.length&&m(y[e+1],y[e])&&e++,!m(y[e],t))break;x(r,e),r=e}};for(let t=(y.length>>>1)-1;t>=0;t--)k(y[t],!0);let L=0,v=a-1;for(;y.length;){let t=y[0];s[t]=0===l[t]?v--:L++;let r=y.pop();g[t]=-1,y.length&&(y[0]=r,g[r]=0,k(r));for(let r of n[t]){let t=e[r].target.index;g[t]<0||(c[t]--,o[t]+=u[r],k(t))}for(let r of i[t]){let t=e[r].source.index;g[t]<0||(l[t]--,o[t]-=u[r],k(t))}}return s}(t.nodes,t.links,r):null;t.nodes.forEach(function(t){delete t.circularLinkType}),t.links.forEach(function(t){delete t.circularLinkID,delete t.circularLinkType,delete t.circularPathData,delete t._circularWidth,delete t._circularStub,t.circular=i?i[t.source.index]>=i[t.target.index]:!(e(t.source)<e(t.target)),t.circular&&(t.circularLinkID=a++)})}(e,p,y),function(t,e){var a=0,i=0;t.links.forEach(function(t){t.circular&&(t.source.circularLinkType||t.target.circularLinkType?t.circularLinkType=t.source.circularLinkType?t.source.circularLinkType:t.target.circularLinkType:t.circularLinkType=a<i?"top":"bottom","top"==t.circularLinkType?a++:i++,t.source.circularLinkType=t.circularLinkType,t.target.circularLinkType=t.circularLinkType)}),t.links.forEach(function(t){t.circular&&(t.source.circularLinkType==t.target.circularLinkType&&(t.circularLinkType=t.source.circularLinkType),r(t,e)&&(t.circularLinkType=t.source.circularLinkType))})}(e,y),function(t){t.nodes.forEach(function(t){t.partOfCycle=!1,t.value=Math.max(pt(t.sourceLinks,s),pt(t.targetLinks,s)),t.sourceLinks.forEach(function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)}),t.targetLinks.forEach(function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)})})}(e),function(t,e,r){if(null!=e&&t.nodes.length){t.nodes.sort(function(t,r){return e(t)<e(r)?-1:1});var a=0,i=e(t.nodes[0]);t.nodes.forEach(function(t){a=e(t)==i?a:a+1,i=e(t)==i?i:e(t),t.column=a})}var n=new Int32Array(t.nodes.length),c=[],l=1;t.nodes.forEach(function(t){t.depth=t.height=0,t.targetLinks.forEach(function(e){e.circular||n[t.index]++}),0===n[t.index]&&c.push(t)});for(var o=0;o<c.length;o++){var u=c[o];l=Math.max(l,u.depth+1),u.sourceLinks.forEach(function(t){t.circular||(t.target.depth=Math.max(t.target.depth,u.depth+1),0===--n[t.target.index]&&c.push(t.target))})}for(o=c.length-1;o>=0;o--)(u=c[o]).sourceLinks.forEach(function(t){t.circular||(u.height=Math.max(u.height,t.target.height+1))});t.nodes.forEach(function(t){t.column=null==e?r(t,l):t.column})}(e,p,g);var d=f;if(null!==h){var k=mt(e.nodes,function(t){return t.column}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]}),L=xt(k,function(t){return t.length});L>1&&(d=Math.max(1,(o-c)*h/(L-1)))}(function(t,e,r){var a=mt(t.nodes,function(t){return t.column}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]});t.py=e;var i=yt(a,function(e){return(t.y1-t.y0-(e.length-1)*t.py)/pt(e,function(t){return t.value})});t.ky=i,t.links.forEach(function(e){e.width=e.value*t.ky});var n=xt(t.nodes,function(t){return t.column});n>0?t.nodes.forEach(function(e){e.x0=t.x0+e.column*((t.x1-t.x0-r)/n),e.x1=e.x0+r}):t.nodes.forEach(function(e){e.x0=t.x0,e.x1=e.x0+r})})(e,d,u),$(e,p,y),T(e,p,y,d,d,m),R(e),$(e,p,y),T(e,p,y,d,d,m),R(e),function(t){let e=t;e.nodes.forEach(function(t){t.y+(t.y1-t.y0)>e.y1&&(t.y=t.y-(t.y+(t.y1-t.y0)-e.y1));var r=t.sourceLinks.slice().sort(function(t,e){return t.index-e.index});r.length>1&&r.sort(function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!D(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=i(e,t);return t.y1-r}if(e.target.column>t.target.column)return i(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0});var a=t.y0;r.forEach(function(t){t.y0=a+t.width/2,a+=t.width});for(var n=0,c=r.length-1;c>=0;c--){var l=r[c];"bottom"==l.circularLinkType&&(l.y0=t.y1-n-l.width/2),n+=l.width}})}(e),e.nodes.forEach(function(t){var e=t.targetLinks.slice().sort(function(t,e){return t.index-e.index});e.length>1&&e.sort(function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!D(t,e))return t.y0-e.y0;if(e.source.column<t.source.column){var r=n(e,t);return t.y0-r}if(t.source.column<e.source.column)return n(t,e)-e.y0}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:t.source.column-e.source.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:e.source.column-t.source.column:"top"==t.circularLinkType?-1:1:void 0});var r=t.y0;e.forEach(function(t){t.y1=r+t.width/2,r+=t.width});for(var a=0,i=e.length-1;i>=0;i--){var c=e[i];"bottom"==c.circularLinkType&&(c.y1=t.y1-a-c.width/2),a+=c.width}}),function(t){var e=t.nodes,r=t.links,a=!1,i=!1;if(r.forEach(function(t){"top"==t.circularLinkType?a=!0:"bottom"==t.circularLinkType&&(i=!0)}),0==a||0==i){let a=function(e){return(e-n)/(c-n)*(t.y1-t.y0)+t.y0};var n=yt(e,function(t){return t.y0}),c=xt(e,function(t){return t.y1}),l=c-n,o=(t.y1-t.y0)/l;o<1?(e.forEach(function(t){t.y0=a(t.y0),t.y1=a(t.y1)}),r.forEach(function(t){t.y0=a(t.y0),t.y1=a(t.y1),t.width=t.width*o})):e.forEach(function(t){var e=t.y1-t.y0,r=a(t.y0)-t.y0;t.y0=a(t.y0),t.y1=t.y0+e,t.sourceLinks.forEach(function(t){t.y0=t.y0+r}),t.targetLinks.forEach(function(t){t.y1=t.y1+r})})}}(e),E(e,y,x,10,8)}(e),e}var a=0,c=0,l=1,o=1,u=24,f=8,h=null,y=S,g=d,p=void 0,m=32,x=2,k=w,L=A;return e.update=function(t){return R(t),E(t,y,x,10,8),t},e.nodeWidth=function(t){return arguments.length?(u=+t,e):u},e.nodePadding=function(t){return arguments.length?(f=+t,e):f},e.nodePaddingRatio=function(t){return arguments.length?(h=+t,e):h},e.nodes=function(t){return arguments.length?(k="function"==typeof t?t:M(t),e):k},e.links=function(t){return arguments.length?(L="function"==typeof t?t:M(t),e):L},e.nodeId=function(t){return arguments.length?(y="function"==typeof t?t:M(t),e):y},e.nodeAlign=function(t){return arguments.length?(g="function"==typeof t?t:M(t),e):g},e.nodeSort=function(t){return arguments.length?(p=t,e):p},e.iterations=function(t){return arguments.length?(m=+t,e):m},e.circularLinkGap=function(t){return arguments.length?(x=+t,e):x},e.extent=function(t){return arguments.length?(a=+t[0][0],c=+t[0][1],l=+t[1][0],o=+t[1][1],e):[[a,c],[l,o]]},e.size=function(t){return arguments.length?(a=c=0,l=+t[0],o=+t[1],e):[l-a,o-c]},e}().extent(x).links(m).nodes(k).nodeAlign(Xt[u]||d).nodeId(t=>t.id).nodeWidth(f).iterations(y);L.nodePaddingRatio&&L.nodePaddingRatio(h),L();{let t=1/0,e=-1/0,r=1/0,a=-1/0;for(let i of k)i.x0<t&&(t=i.x0),i.x1>e&&(e=i.x1),i.y0<r&&(r=i.y0),i.y1>a&&(a=i.y1);for(let i of m){if(!i.circular||!i.circularPathData)continue;let n=i.circularPathData,c=(i._circularWidth??i.width??0)/2;n.leftFullExtent-c<t&&(t=n.leftFullExtent-c),n.rightFullExtent+c>e&&(e=n.rightFullExtent+c),n.verticalFullExtent-c<r&&(r=n.verticalFullExtent-c),n.verticalFullExtent+c>a&&(a=n.verticalFullExtent+c)}let i=e-t,n=a-r,c=x[1][0],l=x[1][1];if(i>0&&n>0&&(t<0||r<0||e>c||a>l)){let e=c/i,a=l/n,o=Math.min(e,a),u=-t*o+(c-i*o)/2,s=-r*o+(l-n*o)/2;for(let t of k)t.x0=t.x0*o+u,t.x1=t.x1*o+u,t.y0=t.y0*o+s,t.y1=t.y1*o+s;for(let t of m)if(t.y0=t.y0*o+s,t.y1=t.y1*o+s,t.width=(t.width??0)*o,t._circularWidth&&(t._circularWidth*=o),t.circular&&t.circularPathData){let e=t.circularPathData;e.sourceX=e.sourceX*o+u,e.targetX=e.targetX*o+u,e.sourceY=e.sourceY*o+s,e.targetY=e.targetY*o+s,e.rightFullExtent=e.rightFullExtent*o+u,e.leftFullExtent=e.leftFullExtent*o+u,e.verticalFullExtent=e.verticalFullExtent*o+s,e.rightInnerExtent=e.rightInnerExtent*o+u,e.leftInnerExtent=e.leftInnerExtent*o+u,e.verticalRightInnerExtent=e.verticalRightInnerExtent*o+s,e.verticalLeftInnerExtent=e.verticalLeftInnerExtent*o+s,e.rightSmallArcRadius*=o,e.rightLargeArcRadius*=o,e.leftSmallArcRadius*=o,e.leftLargeArcRadius*=o,e.sourceWidth*=o,e.rightNodeBuffer*=o,e.leftNodeBuffer*=o,e.arcRadius*=o}}}let v=new Map;for(let t of e)v.set(t.id,t);for(let t of k){let e=v.get(t.id);e&&(e.x0=t.x0,e.x1=t.x1,e.y0=t.y0,e.y1=t.y1,e.value=t.value,e.depth=t.depth,e.sourceLinks=t.sourceLinks,e.targetLinks=t.targetLinks,e.width=t.x1-t.x0,e.height=t.y1-t.y0,e.x=t.x0+(t.x1-t.x0)/2,e.y=t.y0+(t.y1-t.y0)/2)}let b=new Map;for(let t of a)if(t._edgeKey)b.set(t._edgeKey,t);else{let e=ut(t.source),r=ut(t.target);b.set(`${e}\0${r}`,t)}for(let t of m){let e=ut(t.source),r=ut(t.target),a=t._edgeKey?b.get(t._edgeKey):b.get(`${e}\0${r}`);if(a){a.y0=t.y0,a.y1=t.y1,a.sankeyWidth=t.width??0,a.circular=!!t.circular,a.circularPathData=t.circularPathData,a._circularWidth=t._circularWidth,a._circularStub=t._circularStub,a.path=t.path,a.circularLinkType=t.circularLinkType,a.direction=o;let i=v.get(e),n=v.get(r);i&&(a.source=i),n&&(a.target=n)}}},buildScene(t,e,r,a){let i="vertical"===r.orientation?"down":"right",n=r.nodeStyle,c=r.edgeStyle,l=r.edgeOpacity??.5,o=r.edgeColorBy||"source",u=Array.isArray(r.colorScheme)?r.colorScheme:r.themeCategorical&&r.themeCategorical.length>0?r.themeCategorical:ht,s=new Map;t.forEach((t,e)=>{s.set(t.id,u[e%u.length])});let f=[],h=[],d=[],y=new Map;for(let e of t){let t=e.x1-e.x0,r=e.y1-e.y0;if(e.value<=0||t<=0||r<=0)continue;let a=n?n(W(e,"nodeStyle")):{},c={fill:a.fill||s.get(e.id)||"#4d430c",stroke:a.stroke,strokeWidth:a.strokeWidth,opacity:a.opacity,cursor:a.cursor};y.set(e.id,("string"==typeof c.fill?c.fill:null)||s.get(e.id)||"#4d430c");let l={...e.data,value:e.data?.value??e.value};"down"===i?f.push({type:"rect",x:e.y0,y:e.x0,w:r,h:t,style:c,accessibleDatum:l,datum:e,id:e.id,label:e.id}):f.push({type:"rect",x:e.x0,y:e.y0,w:t,h:r,style:c,accessibleDatum:l,datum:e,id:e.id,label:e.id})}let g=[...e].sort((t,e)=>(e.sankeyWidth||0)-(t.sankeyWidth||0));for(let t of g){if(!(t.value>0)||!t.sankeyWidth||t.sankeyWidth<=0)continue;let e="object"==typeof t.source?t.source:null,a="object"==typeof t.target?t.target:null;if(!e||!a)continue;let i=r.themeSemantic?.border||r.themeSemantic?.secondary||"#999";i="function"==typeof o?o(t)||i:"target"===o?y.get(a.id)||s.get(a.id)||i:y.get(e.id)||s.get(e.id)||i;let n,u=c?c(W(t,"edgeStyle")):{};if(n=t.circular&&t.circularPathData?I(t):Ot(t),!n)continue;let f={fill:u.fill||i,fillOpacity:u.fillOpacity??l,stroke:u.stroke||"none",strokeWidth:u.strokeWidth,strokeOpacity:u.strokeOpacity,opacity:u.opacity,cursor:u.cursor};h.push({type:"bezier",pathD:n,bezierCache:t.bezier,style:f,accessibleDatum:t.data,datum:t})}if(!1!==r.showLabels){let e=ot(r.nodeLabel);for(let r of t){let t=r.x1-r.x0,n=r.y1-r.y0;if(r.value<=0||t<=0||n<=0)continue;let c,l,o,u=e?e(r):r.id;if(u){if("down"===i)c=r.y0+(r.y1-r.y0)/2,l=r.x1+14,o="start";else{let e=a[0]/2;r.x0+t/2<e?(c=r.x0-6,o="end"):(c=r.x1+6,o="start"),l=r.y0+n/2}d.push({x:c,y:l,text:String(u),anchor:"down"===i?"middle":o,baseline:"middle",fontSize:11})}}}return{sceneNodes:f,sceneEdges:h,labels:d}}},qt={supportsStreaming:!0,hierarchical:!1,computeLayout(t,e,r,a){if(0===t.length)return;let i=r.forceStrength??.1,n=a[0]/2,c=a[1]/2,l=Math.max(.1,Math.min(1,Math.min(a[0],a[1])/200)),o=Math.min(.5,.06+1.8*(1-l)),u=r.__previousPositions,s=0,f=[];for(let e of t){let t=!1!==e.__hasPosition&&Number.isFinite(e.x)&&Number.isFinite(e.y),r=u?.get(e.id);t?s++:r?(e.x=r.x,e.y=r.y,s++):f.push(e)}let h=t.length>0?f.length/t.length:1,d=s>0&&h<=.3;if(d){let r=new Map;for(let e of t)r.set(e.id,e);for(let t of f){let a=F(t.id,e,r);if(a.length>0){let e=0,r=0;for(let t of a)e+=t.x,r+=t.y;let i=N(t.id),n=i%360*(Math.PI/180),c=(10+i%20)*l;t.x=e/a.length+c*Math.cos(n),t.y=r/a.length+c*Math.sin(n)}else{let e=N(t.id),r=e%360*(Math.PI/180),a=(15+e%30)*l;t.x=n+a*Math.cos(r),t.y=c+a*Math.sin(r)}}}else{let e=Math.PI*(3-Math.sqrt(5));for(let r=0;r<t.length;r++){let a=t[r];if(!1===a.__hasPosition||!Number.isFinite(a.x)||!Number.isFinite(a.y)){let t=10*Math.sqrt(r+.5)*l,i=r*e;a.x=n+t*Math.cos(i),a.y=c+t*Math.sin(i)}}}for(let e of t)e.__hasPosition=!0;let y=t.length,g=r.iterations??Math.max(50,Math.min(300,Math.floor(300-2*(y-30)))),p=r.__skipForceSimulation||0===r.iterations?0:d?40:g,m=ct(r.nodeSize,r.nodeSizeRange,t);if(p>0){let u=new Map,s=new Map;for(let e of t)u.set(e.id,0),s.set(e.id,e);for(let t of e){let e=ut(t.source),r=ut(t.target);u.set(e,(u.get(e)??0)+1),u.set(r,(u.get(r)??0)+1)}let f=vt().strength(t=>{let e=lt(t),r=ut(t.source),a=ut(t.target),n=Math.max(1,Math.min(u.get(r)??1,u.get(a)??1)),c=e&&e>0?Math.sqrt(e):1;return Math.min(2.5,c*i/(.1*n))}).distance(t=>{let e="string"==typeof t.source?s.get(t.source):t.source,r="string"==typeof t.target?s.get(t.target):t.target,a=(e?m(e):0)+(r?m(r):0)+Math.max(6,12*l);return Math.max(16,40*l,a)}).id(t=>t.id),h=bt();if((void 0!==r.random||void 0!==r.seed)&&h.randomSource(r.random??st(r.seed)),h.force("charge",Dt().strength(t=>{let e=u.get(t.id)??0;return-15*l*m(t)*Math.sqrt(e+1)})).force("collide",Pt(t=>m(t)+3*l).strength(.9).iterations(2)).force("center",Et(n,c).strength(.8)).force("x",Mt(n).strength(o)).force("y",St(c).strength(o)).force("bounds",function(t,e,r=2,a=.6){let i=[],n=n=>{let c=a*Math.max(n,.2);for(let a of i){let i=a.x??t[0]/2,n=a.y??t[1]/2,l=a.vx??0,o=a.vy??0,u=e(a)+r,s=Math.min(t[0]/2,u),f=Math.max(t[0]/2,t[0]-u),h=Math.min(t[1]/2,u),d=Math.max(t[1]/2,t[1]-u),y=i+l,g=n+o;y<s?a.vx=l+(s-y)*c:y>f&&(a.vx=l+(f-y)*c),g<h?a.vy=o+(h-g)*c:g>d&&(a.vy=o+(d-g)*c)}};return n.initialize=t=>{i=t},n}(a,m)),h.nodes(t),e.length>0){let t=e.map(t=>({...t,source:ut(t.source),target:ut(t.target)}));f.links(t),h.force("link",f)}d?h.alpha(.3):h.alpha()<.1&&h.alpha(1),h.stop();for(let t=0;t<p;++t)h.tick()}for(let e of t){if(null==e.x||null==e.y)continue;let t=m(e),r=p>0?2:0,i=Math.min(a[0]/2,t+r),n=Math.min(a[1]/2,t+r);e.x=Math.max(i,Math.min(a[0]-i,e.x)),e.y=Math.max(n,Math.min(a[1]-n,e.y)),e.x0=0,e.x1=0,e.y0=0,e.y1=0}let x=new Map;for(let e of t)x.set(e.id,e);for(let t of e){if("string"==typeof t.source){let e=x.get(t.source);e&&(t.source=e)}if("string"==typeof t.target){let e=x.get(t.target);e&&(t.target=e)}}},buildScene(t,e,r,a){let i=r.nodeStyle,n=r.edgeStyle,c=ct(r.nodeSize,r.nodeSizeRange,t),l=Array.isArray(r.colorScheme)?r.colorScheme:r.themeCategorical&&r.themeCategorical.length>0?r.themeCategorical:ht,o=new Map;t.forEach((t,e)=>{o.set(t.id,l[e%l.length])});let u=[],s=[],f=[];for(let e of t){if(null==e.x||null==e.y)continue;let t=c(W(e,"nodeSize")),a=i?i(W(e,"nodeStyle")):{},n={fill:a.fill||o.get(e.id)||r.themeSemantic?.primary||"#007bff",stroke:a.stroke||r.themeSemantic?.surface||"#fff",strokeWidth:a.strokeWidth??2,opacity:a.opacity,cursor:a.cursor};u.push({type:"circle",cx:e.x,cy:e.y,r:t,style:n,accessibleDatum:e.data,datum:e,id:e.id,label:e.id})}let h=new Map;for(let e of t)h.set(e.id,e);for(let t of e){let e="object"==typeof t.source?t.source:h.get(t.source),a="object"==typeof t.target?t.target:h.get(t.target);if(!e||!a||null==e.x||null==e.y||null==a.x||null==a.y)continue;let i=n?n(W(t,"edgeStyle")):{},c={stroke:i.stroke||r.themeSemantic?.border||r.themeSemantic?.secondary||"#999",strokeWidth:i.strokeWidth??1,opacity:i.opacity??.6,cursor:i.cursor};s.push({type:"line",x1:e.x,y1:e.y,x2:a.x,y2:a.y,style:c,accessibleDatum:t.data,datum:t})}if(!1!==r.showLabels){let e=ot(r.nodeLabel);for(let r of t){if(null==r.x||null==r.y)continue;let t=e?e(r):r.id;if(!t)continue;let a=c(W(r,"nodeSize"));f.push({x:r.x,y:r.y-a-4,text:String(t),anchor:"middle",baseline:"auto",fontSize:11,anchorPoint:[r.x,r.y]})}}return{sceneNodes:u,sceneEdges:s,labels:f}}},Kt=ht,Zt={supportsStreaming:!1,hierarchical:!1,computeLayout(t,e,r,a){for(let e of t)delete e.__arcData;for(let t of e)delete t.__chordData,delete t.__chordEdges;if(0===t.length)return;let{padAngle:i=.01,groupWidth:n=20,sortGroups:c}=r,l=Math.min(a[0],a[1])/2,o=l-n,u=a[0]/2,s=a[1]/2,f=new Map(t.map(t=>[t.id,t])),h=new Set,d=e.filter(t=>{let e=ut(t.source),r=ut(t.target);return!(!Number.isFinite(t.value)||t.value<=0||!f.has(e)||!f.has(r)||(h.add(e),h.add(r),0))}),y=t.filter(t=>h.has(t.id)),g=y.length;if(0===g)return;let p=new Map(y.map((t,e)=>[t.id,e])),m=Array.from({length:g},()=>new Array(g).fill(0)),x=new Map;for(let t of d){let e=ut(t.source),r=ut(t.target),a=p.get(e),i=p.get(r);m[a][i]+=t.value;let n=a<=i?`${a}\0${i}`:`${i}\0${a}`,c=x.get(n);c?c.push(t):x.set(n,[t])}let k=Math.min(Number.isFinite(i)?Math.max(0,i):.01,Math.PI/g),L=At().padAngle(k);c&&L.sortGroups(c);let v=L(m),b=v.groups,D=$t().innerRadius(o).outerRadius(l);for(let t of b){let e=y[t.index],r={innerRadius:o,outerRadius:l,startAngle:t.startAngle,endAngle:t.endAngle},a=D.centroid(r);e.x=a[0]+u,e.y=a[1]+s,e.__arcData={startAngle:t.startAngle,endAngle:t.endAngle}}for(let t of e){let e=ut(t.source),r=ut(t.target),a=f.get(e),i=f.get(r);a&&(t.source=a),i&&(t.target=i)}for(let t of v){let e=t.source.index,r=t.target.index,a=e<=r?`${e}\0${r}`:`${r}\0${e}`,i=x.get(a);for(let e of i)e.__chordData=t,e.__chordEdges=i}},buildScene(t,e,r,a){let{groupWidth:i=20,edgeOpacity:n=.5}=r,c=Math.min(a[0],a[1])/2,l=c-i,o=a[0]/2,u=a[1]/2,s=r.nodeStyle,f=r.edgeStyle,h=r.edgeColorBy||"source",d=Array.isArray(r.colorScheme)?r.colorScheme:r.themeCategorical&&r.themeCategorical.length>0?r.themeCategorical:Kt,y=new Map;t.forEach((t,e)=>{y.set(t.id,d[e%d.length])});let g=wt().radius(l),p=[],m=[],x=[];for(let e=0;e<t.length;e++){let r=t[e],a=r.__arcData;if(!a)continue;let i=s?s(W(r,"nodeStyle")):{},n={fill:("string"==typeof i.fill?i.fill:void 0)||y.get(r.id)||d[e%d.length],stroke:i.stroke||"black",strokeWidth:i.strokeWidth??1,opacity:i.opacity,cursor:i.cursor};p.push({type:"arc",cx:o,cy:u,innerR:l,outerR:c,startAngle:a.startAngle-Math.PI/2,endAngle:a.endAngle-Math.PI/2,style:n,accessibleDatum:r.data,datum:r,id:r.id,label:r.id})}let k=new Set,L=t.filter(t=>t.__arcData);for(let t of e){let e=t.__chordData;if(!e||k.has(e))continue;k.add(e);let a=L[e.source.index].id;for(let e of t.__chordEdges||[])ut(e.source)===a&&(t=e);let i=g(e);if(!i)continue;let c=C(i,o,u),l=r.themeSemantic?.border||r.themeSemantic?.secondary||"#999",s=f?f(W(t,"edgeStyle")):{};if(f)l=("string"==typeof s.fill?s.fill:void 0)||l;else{let e="object"==typeof t.source?t.source:null,r="object"==typeof t.target?t.target:null;"target"===h&&r?l=y.get(r.id)||l:e&&(l=y.get(e.id)||l)}let d={fill:l,fillOpacity:s.fillOpacity??n,stroke:s.stroke||"none",strokeWidth:s.strokeWidth,strokeOpacity:s.strokeOpacity,opacity:s.opacity,cursor:s.cursor};m.push({type:"ribbon",pathD:c,style:d,accessibleDatum:t.data,datum:t})}if(!1!==r.showLabels){let e=ot(r.nodeLabel),a=c+12;for(let r of t){let t=r.__arcData;if(!t)continue;let i=e?e(r):r.id;if(!i)continue;let n=(t.startAngle+t.endAngle)/2,c=n-Math.PI/2,l=o+Math.cos(c)*a,s=u+Math.sin(c)*a,f=n>Math.PI?"end":"start";x.push({x:l,y:s,text:String(i),anchor:f,baseline:"middle",fontSize:11})}}return{sceneNodes:p,sceneEdges:m,labels:x}}},Gt=["#e8d5b7","#b8d4e3","#d4e3b8","#e3c4d4","#d4d4e3","#e3d4b8","#b8e3d4","#e3b8b8"],Vt={supportsStreaming:!1,hierarchical:!0,computeLayout(t,e,r,a){let i=r.__hierarchyRoot;if(!i)return;let n=r.chartType,c=O(r.childrenAccessor),l=Rt(i,c),o=[];l.eachBefore(t=>o.push(t));let u=B(o.map((t,e)=>function(t,e,r){let a=e.nodeIDAccessor,i=t.data;return String("function"==typeof a?a(i):"string"==typeof a&&void 0!==i[a]?i[a]:void 0!==i.name?i.name:void 0!==i.id?i.id:`node-${r}`)}(t,r,e)));l.sum(function(t="value"){let e="function"==typeof t?t:e=>e[t];return t=>{let r=e(t),a="string"==typeof r?Number(r):r;return Number.isFinite(a)&&a>0?a:0}}(r.hierarchySum)).sort((t,e)=>e.value-t.value);let[s,f]=a;switch(n){case"tree":case"cluster":!function(t,e,r,a){let i=e.treeOrientation||"vertical",n="cluster"===e.chartType?_t():It();if("horizontal"===i)n.size([a,r]);else if("radial"===i){let t=Math.min(r,a)/2;n.size([2*Math.PI,.8*t])}else n.size([r,a]);n(t)}(l,r,s,f);break;case"treemap":case"partition":!function(t,e,r,a){let i="treemap"===e.chartType,n=i?Wt().tile(Ft):Nt();n.size([r,a]).padding(e.padding??(i?4:1)),"paddingTop"in n&&e.paddingTop>0&&n.paddingTop(e.paddingTop),n(t)}(l,r,s,f);break;case"circlepack":!function(t,e,r,a){let i=e.padding??4,n=Ct().size([r,a]).padding(i);t.leaves().some(t=>t.value)||n.radius(()=>0).padding(0),n(t)}(l,r,s,f)}let h=l.descendants();t.length=0,e.length=0;let d=new Map(o.map((t,e)=>[t,{id:u[e],x:0,y:0,x0:0,x1:0,y0:0,y1:0,width:0,height:0,value:t.value,depth:t.depth,data:t.data,createdByFrame:!0}]));for(let e of h){let a=d.get(e);"tree"===n||"cluster"===n?Z(a,e,r):"treemap"===n||"partition"===n?G(a,e):"circlepack"===n&&V(a,e),a.__hierarchyNode=e,t.push(a)}if("tree"===n||"cluster"===n)for(let t of h)if(t.parent){let r=d.get(t.parent),a=d.get(t);e.push({source:r,target:a,value:1,y0:0,y1:0,sankeyWidth:0,data:{depth:t.depth}})}},buildScene(t,e,r,a){let i=r.chartType,n=r.nodeStyle||(()=>({})),c=r.edgeStyle||(()=>({}));switch(i){case"tree":case"cluster":return function(t,e,r,a,i,n){let c=[],l=[],o=[],u=r.treeOrientation||"vertical",s="radial"===u,f=a[0]/2,h=a[1]/2,{nodeSize:d}=r,y="number"==typeof d?d:5;for(let e of t){let t=e.x,a=e.y;s&&(t+=f,a+=h);let n=Y(e,r,i(W(e,"nodeStyle")));c.push({type:"circle",cx:t,cy:a,r:y,style:n,accessibleDatum:{...e.data,value:e.data?.value??e.value},datum:e,id:e.id,label:e.id,depth:e.depth})}let g=r.edgeOpacity??.5;for(let t of e){let e="object"==typeof t.source?t.source:null,a="object"==typeof t.target?t.target:null;if(!e||!a)continue;let i=e.x,c=e.y,o=a.x,d=a.y;s&&(i+=f,c+=h,o+=f,d+=h);let y=K(i,c,o,d,u),p=n(W(t,"edgeStyle")),m={fill:"none",stroke:p.stroke||r.themeSemantic?.border||r.themeSemantic?.secondary||"#999",strokeWidth:p.strokeWidth??1.5,opacity:p.opacity??g,cursor:p.cursor};l.push({type:"curved",pathD:y,style:m,datum:t})}if(!1!==r.showLabels){let e=j(r.nodeLabel);for(let r of t){let t=e?e(r):r.id;if(!t)continue;let a,i,n,c=r.x,l=r.y;if(s&&(c+=f,l+=h),s){let t=c-f,e=l-h,r=Math.sqrt(t*t+e*e);r>0?(a=c+t/r*10,i=l+e/r*10,n=t>=0?"start":"end"):(a=c,i=l-12,n="middle")}else"horizontal"===u?(q(r)?(a=c+y+6,n="start"):(a=c-y-6,n="end"),i=l):(a=c,i=l+y+14,n="middle");o.push({x:a,y:i,text:String(t),anchor:n,baseline:"middle",fontSize:11,anchorPoint:[c,l]})}}return{sceneNodes:c,sceneEdges:l,labels:o}}(t,e,r,a,n,c);case"treemap":case"partition":return function(t,e,r){let a=[],i=[];for(let i of t){let t=i.x1-i.x0,n=i.y1-i.y0;if(t<=0||n<=0)continue;let c=r(W(i,"nodeStyle")),l=Y(i,e,c);l.fillOpacity=c.fillOpacity,l.strokeOpacity=c.strokeOpacity,a.push({type:"rect",x:i.x0,y:i.y0,w:t,h:n,style:l,accessibleDatum:{...i.data,value:i.data?.value??i.value},datum:i,id:i.id,label:i.id,depth:i.depth})}if(!1!==e.showLabels){let a=j(e.nodeLabel),n=e.labelMode||"leaf",c="partition"===e.chartType;for(let l of t){let t=l.x1-l.x0,o=l.y1-l.y0;if(t<=0||o<=0)continue;let u=q(l);if(!c&&("leaf"===n&&!u||"parent"===n&&u))continue;let s=a?a(l):l.id;if(!s)continue;if(t<(u?30:40)||o<(u?16:14))continue;let f=X(l,e,r(W(l,"nodeStyle")).fill),h="string"==typeof f?z(f):e.themeSemantic?.text??"#000";u?i.push({x:l.x0+t/2,y:l.y0+o/2,text:String(s),anchor:"middle",baseline:"middle",fontSize:Math.min(11,Math.max(8,Math.min(t,o)/6)),fill:h}):i.push({x:l.x0+4,y:l.y0+12,text:String(s),anchor:"start",baseline:"auto",fontSize:11,fontWeight:600,fill:h})}}return{sceneNodes:a,sceneEdges:[],labels:i}}(t,r,n);case"circlepack":return function(t,e,r){let a=[],i=[];for(let i of t){let t=i.__radius??5;if(t<=0)continue;let n=Y(i,e,r(W(i,"nodeStyle")));n.opacity??(n.opacity=.7),a.push({type:"circle",cx:i.x,cy:i.y,r:t,style:n,accessibleDatum:{...i.data,value:i.data?.value??i.value},datum:i,id:i.id,label:i.id,depth:i.depth})}if(!1!==e.showLabels){let a=j(e.nodeLabel);for(let n of t){let t=n.__radius??5,c=a?a(n):n.id;if(!c||t<15)continue;let l=q(n),o=X(n,e,r(W(n,"nodeStyle")).fill);if(l){let r="string"==typeof o?z(o):e.themeSemantic?.text??"#000";i.push({x:n.x,y:n.y,text:String(c),anchor:"middle",baseline:"middle",fontSize:Math.min(11,Math.max(8,t/3)),fill:r})}else i.push({x:n.x,y:n.y-t+14,text:String(c),anchor:"middle",baseline:"hanging",fontSize:Math.min(11,Math.max(8,t/3)),fill:e.themeSemantic?.text||"#000",stroke:e.themeSemantic?.surface||"#fff",strokeWidth:3,paintOrder:"stroke"})}}return{sceneNodes:a,sceneEdges:[],labels:i}}(t,r,n);default:return{sceneNodes:[],sceneEdges:[],labels:[]}}}},Qt={supportsStreaming:!1,hierarchical:!0,supportsAnimation:!0,computeLayout(t,e,r,a){let i=r.__hierarchyRoot;i&&function(t,e,r,a,i){let n=O(r.childrenAccessor||"children"),c=function(t){if("function"==typeof t)return t;let e=t||"name";return t=>String(t[e]??"")}(r.nodeIDAccessor),l=function(t){if(Array.isArray(t))return t;switch(t){case"solar":return[1];case"atomic":return[2,8];default:return[9999]}}(r.orbitMode),o=r.orbitSize??2.95,u=r.orbitEccentricity??1,s="number"==typeof o?()=>o:o,f="number"==typeof u?()=>u:u,h=it(r);h.metaMap.clear(),a.length=0,i.length=0;let d=B(et(t,n).map(t=>String(c(t)))),y=0,g=e[0]/2,p=e[1]/2,m=Math.min(e[0],e[1])/2*.85,x=d[y++],k={id:x,x:g,y:p,x0:g,x1:g,y0:p,y1:p,width:0,height:0,value:0,depth:0,data:t};a.push(k),h.metaMap.set(x,{ring:m,angle:0,depth:0,parentId:null,eccentricity:1}),function t(e,r,c,o,u,g,p){let m=n(e);if(!m?.length)return;let x=m.length,k=0,L=0,v=0;for(;L<x;)L+=l[Math.min(v,l.length-1)],v++,k++;let b=0;for(let x=0;x<k;x++){let L=l[Math.min(x,l.length-1)],v=m.slice(b,b+L);if(!v.length)break;let D=(x+1)/k,P={id:r,depth:g,data:e,parentId:r},E=p?u/s(P)*D:u*D,M=Tt().value(t=>n(t)?.length?4:1).sort(null)(v),S=f(P);for(let e=0;e<v.length;e++){let n=(M[e].startAngle+M[e].endAngle)/2,l=v[e],u=d[y++],s=c+E*Math.sin(n),f=o+E*Math.cos(n)*S,p={id:u,x:s,y:f,x0:s,x1:s,y0:f,y1:f,width:0,height:0,value:0,depth:g,data:l};a.push(p),h.metaMap.set(u,{ring:E,angle:n,depth:g,parentId:r,eccentricity:S}),i.push({source:r,target:u,value:1,y0:0,y1:0,sankeyWidth:0,data:{source:r,target:u}}),t(l,u,s,f,E,g+1,!0)}b+=L}}(t,x,g,p,m,1,!1)}(i,a,r,t,e)},buildScene(t,e,r,a){let i=r.nodeStyle,n=r.edgeStyle,c=r.nodeSize,l="number"==typeof c?()=>c:"function"==typeof c?c:()=>6,o=[],u=[],s=[];if(!1!==r.orbitShowRings){let e=it(r),a=new Map;for(let e of t)a.set(e.id,e);let i=new Map;for(let[,t]of e.metaMap){if(!t.parentId)continue;let e=a.get(t.parentId);if(!e)continue;let r=`${t.parentId}:${t.ring}`;i.has(r)||i.set(r,{parentX:e.x,parentY:e.y,ring:t.ring,ecc:t.eccentricity})}let n=48,c={stroke:"rgba(128,128,128,0.35)",strokeWidth:.5,opacity:1};for(let[,{parentX:t,parentY:e,ring:r,ecc:a}]of i)for(let i=0;i<n;i++){let l=i/n*Math.PI*2,o=(i+1)/n*Math.PI*2;u.push({type:"line",x1:t+r*Math.sin(l),y1:e+r*Math.cos(l)*a,x2:t+r*Math.sin(o),y2:e+r*Math.cos(o)*a,style:c,interactive:!1,datum:null})}}for(let e of t){if(null==e.x||null==e.y)continue;let t=l(W(e,"nodeSize")),a=i?i(W(e,"nodeStyle")):{},n={fill:a.fill||r.themeSemantic?.primary||"#6366f1",stroke:a.stroke||r.themeSemantic?.surface||"#fff",strokeWidth:a.strokeWidth??1,opacity:a.opacity??(0===(e.depth??0)?1:.85),cursor:a.cursor};o.push({type:"circle",cx:e.x,cy:e.y,r:t,style:n,accessibleDatum:e.data,datum:e,id:e.id,label:e.id,depth:e.depth})}let f=new Map;for(let e of t)f.set(e.id,e);for(let t of e){let e="object"==typeof t.source?t.source:f.get(t.source),r="object"==typeof t.target?t.target:f.get(t.target);if(!e||!r||null==e.x||null==r.x)continue;let a=n?n(W(t,"edgeStyle")):{},i={stroke:a.stroke||"rgba(128,128,128,0.35)",strokeWidth:a.strokeWidth??.5,opacity:a.opacity??1,cursor:a.cursor};u.push({type:"line",x1:e.x,y1:e.y,x2:r.x,y2:r.y,style:i,datum:t})}if(r.showLabels){let e=r.nodeLabel;for(let r of t){let t=l(W(r,"nodeSize"));if(t<=4)continue;let a="function"==typeof e?e(r):e?r.data?.[e]??r.id:r.id;s.push({x:r.x,y:r.y+t+12,text:String(a),anchor:"middle",fontSize:10,fill:"currentColor",anchorPoint:[r.x,r.y]})}}return{sceneNodes:o,sceneEdges:u,labels:s}},tick:(t,e,r,a,i)=>!1!==r.orbitAnimated&&(function(t,e){let r=it(e),a=e.orbitSpeed??.25,i=e.orbitRevolution??function(t){switch(t){case"decay":return t=>Math.pow(.6,t.depth??0);case"alternate":return t=>{let e=t.depth??0;return(e%2==0?1:-1)/(e+1)};default:return t=>1/((t.depth??0)+1)}}(e.orbitRevolutionStyle),n=((typeof performance<"u"?performance.now():Date.now())-r.startTime)/1e3,c=a*(Math.PI/6),l=new Map;for(let e of t)l.set(e.id,e);for(let e of t){let t=r.metaMap.get(e.id);if(!t||!t.parentId)continue;let a=l.get(t.parentId);if(!a)continue;let o={id:e.id,depth:t.depth,data:e.data,parentId:t.parentId},u=t.angle+n*c*i(o);e.x=a.x+t.ring*Math.sin(u),e.y=a.y+t.ring*Math.cos(u)*t.eccentricity,e.x0=e.x,e.x1=e.x,e.y0=e.y,e.y1=e.y}}(t,r),!0)};export{_ as a,Yt as b,qt as c,Zt as d,Vt as e,U as f,tt as g,et as h,rt as i,at as j,Qt as k};
1
+ function t(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function e(t){return t.y0-t.y1>0?"up":"down"}function r(t,e){return e(t.source)==e(t.target)}function a(t){return t.target.x0-t.source.x1}function i(t,r){var i=c(t),n=a(r)/Math.tan(i);return"up"==e(t)?t.y1-n:t.y1+n}function n(t,r){var i=c(t),n=a(r)/Math.tan(i);return"up"==e(t)?t.y1+n:t.y1-n}function c(t){var e=Math.abs(t.y1-t.y0),r=Math.abs(t.target.x0-t.source.x1);return Math.atan(r/e)}function l(t){return u(t.source)}function o(t){return u(t.target)}function u(t){return(t.y0+t.y1)/2}function s(t){return t.virtual?0:t.value}function f(t,e){var a=0;t.sourceLinks.forEach(function(t){a=t.circular&&!r(t,e)?a+1:a});var i=0;return t.targetLinks.forEach(function(t){i=t.circular&&!r(t,e)?i+1:i}),a+i}function h(t){return t.target.depth}function d(t,e){return t.sourceLinks.length?t.depth:e-1}function y(t,e){return t.y0-e.y0}function g(t,e){return e.y0-t.y0}function p(t,e){return t.y1-e.y1}function m(t,e){return e.y1-t.y1}function x(t,e){return L(t.source,e.source)||t.index-e.index}function k(t,e){return L(t.target,e.target)||t.index-e.index}function L(t,e){return t.partOfCycle===e.partOfCycle?t.y0-e.y0:"top"===t.circularLinkType||"bottom"===e.circularLinkType?-1:1}function v(t,e){return b(t)==b(e)?"bottom"==t.circularLinkType?g(t,e):y(t,e):b(e)-b(t)}function b(t){return t.target.column-t.source.column}function D(t,e){return P(t)==P(e)}function P(t){return t.y0-t.y1>0?"up":"down"}function E(t,e,a,i,n){let c=t;c.links.forEach(function(t){t.circular&&(t._circularWidth=t.width,t._circularStub=!1)});var l=yt(c.links,function(t){return t.source.y0});c.links.forEach(function(t){t.circular&&(t.circularPathData={})});var o=c.links.filter(function(t){return t.circular}),u=new Map,s=new Map;o.forEach(function(t){u.set(t.source,(u.get(t.source)||0)+1),s.set(t.target,(s.get(t.target)||0)+1)});var f=new Set(o.filter(function(t){return r(t,e)&&1===u.get(t.source)&&1===s.get(t.target)}));return["top","bottom"].forEach(function(t){var e=o.filter(function(e){return e.circularLinkType===t});(function(t,e,r){if(0!==t.length){t.sort(v);var a=Array.from(new Set(t.flatMap(function(t){return[t.source.column,t.target.column]}))).sort(function(t,e){return t-e}),i=new Map(a.map(function(t,e){return[t,e]})),n=new zt(a.length);t.forEach(function(t){var a=i.get(t.source.column),c=i.get(t.target.column),l=Math.min(a,c),o=Math.max(a,c),u=e.has(t)?0:n.query(l,o);t.circularPathData.verticalBuffer=u+t._circularWidth/2,n.reserve(l,o,u+t._circularWidth+r)})}})(e.slice(),f,a),["source","target"].forEach(function(r){var n=new Map;e.forEach(function(t){var e=t[r].column;n.has(e)||n.set(e,[]),n.get(e).push(t)}),n.forEach(function(e){e.sort("source"===r?"bottom"===t?g:y:"bottom"===t?m:p);var n=0,c="source"===r?"right":"left";e.forEach(function(t,e){t.circularPathData[c+"SmallArcRadius"]=i+t._circularWidth/2+n,t.circularPathData[c+"LargeArcRadius"]=i+t._circularWidth/2+e*a+n,n+=t._circularWidth})})})}),c.links.forEach(function(t){t.circular&&(t.circularPathData.arcRadius=t._circularWidth+i,t.circularPathData.rightNodeBuffer=5,t.circularPathData.leftNodeBuffer=5,t.circularPathData.sourceWidth=t.source.x1-t.source.x0,t.circularPathData.sourceX=t.source.x0+t.circularPathData.sourceWidth,t.circularPathData.targetX=t.target.x0,t.circularPathData.sourceY=t.y0,t.circularPathData.targetY=t.y1,f.has(t)?(t.circularPathData.rightSmallArcRadius=i+t._circularWidth/2,t.circularPathData.rightLargeArcRadius=i+t._circularWidth/2,t.circularPathData.leftSmallArcRadius=i+t._circularWidth/2,t.circularPathData.leftLargeArcRadius=i+t._circularWidth/2,"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=t.source.y1+n+t.circularPathData.verticalBuffer,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius):(t.circularPathData.verticalFullExtent=t.source.y0-n-t.circularPathData.verticalBuffer,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius)):"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=Math.max(c.y1,t.source.y1,t.target.y1)+n+t.circularPathData.verticalBuffer,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius):(t.circularPathData.verticalFullExtent=l-n-t.circularPathData.verticalBuffer,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius),t.circularPathData.rightInnerExtent=t.circularPathData.sourceX+t.circularPathData.rightNodeBuffer,t.circularPathData.leftInnerExtent=t.circularPathData.targetX-t.circularPathData.leftNodeBuffer,t.circularPathData.rightFullExtent=t.circularPathData.sourceX+t.circularPathData.rightLargeArcRadius+t.circularPathData.rightNodeBuffer,t.circularPathData.leftFullExtent=t.circularPathData.targetX-t.circularPathData.leftLargeArcRadius-t.circularPathData.leftNodeBuffer),t.circular?t.path=function(t){return"top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.rightSmallArcRadius)+" L"+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" L"+t.circularPathData.leftFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.leftSmallArcRadius)+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.rightSmallArcRadius)+" L"+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" L"+t.circularPathData.leftFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.leftSmallArcRadius)+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY}(t):t.path=function(t){var e=t.source.x1,r=t.y0,a=t.target.x0,i=t.y1,n=(e+a)/2;return"M"+e+","+r+"C"+n+","+r+" "+n+","+i+" "+a+","+i}(t)}),c}function S(t){return function(){return t}}function M(t){return t.index}function w(t){return t.nodes}function A(t){return t.links}function $(t,e,r){var a=mt(t.nodes,function(t){return t.column}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]});a.forEach(function(i,n){var c=i.length;if(e)i.sort(e);else if(n>0){var l=new Map;i.forEach(function(t,e){var r,a,i,n=(a=0,i=0,(r=t).targetLinks.forEach(function(t){if(!t.circular){var e=t.value||1;i+=u(t.source)*e,a+=e}}),r.sourceLinks.forEach(function(t){if(!t.circular){var e=t.value||1;i+=u(t.target)*e,a+=e}}),a>0?i/a:NaN);l.set(t,{bc:n,idx:e})}),i.sort(function(t,e){var r=l.get(t),a=l.get(e),i=r.bc,n=a.bc;if(t.circularLinkType!==e.circularLinkType){if("top"==t.circularLinkType&&"bottom"==e.circularLinkType)return-1;if("bottom"==t.circularLinkType&&"top"==e.circularLinkType)return 1;if("top"==t.circularLinkType)return-1;if("top"==e.circularLinkType||"bottom"==t.circularLinkType)return 1;if("bottom"==e.circularLinkType)return-1}return isNaN(i)||isNaN(n)?isNaN(i)?isNaN(n)?r.idx-a.idx:1:-1:i-n})}else i.sort(function(t,e){return t.circularLinkType==e.circularLinkType?f(e,r)-f(t,r):"top"==t.circularLinkType&&"bottom"==e.circularLinkType||"top"==t.circularLinkType&&0==e.partOfCycle||0==t.partOfCycle&&"bottom"==e.circularLinkType?-1:0});i.forEach(function(e,i){e.depth==a.length-1&&1==c||0==e.depth&&1==c?(e.y0=t.y1/2-e.value*t.ky,e.y1=e.y0+e.value*t.ky):e.partOfCycle?0==f(e,r)?(e.y0=t.y1/2+i,e.y1=e.y0+e.value*t.ky):"top"==e.circularLinkType?(e.y0=t.y0+i,e.y1=e.y0+e.value*t.ky):(e.y0=t.y1-e.value*t.ky-i,e.y1=e.y0+e.value*t.ky):0==t.y0||0==t.y1?(e.y0=(t.y1-t.y0)/c*i,e.y1=e.y0+e.value*t.ky):(e.y0=(t.y1-t.y0)/2-c/2+i,e.y1=e.y0+e.value*t.ky)})})}function T(t,e,r,a,i,n){function c(e,r){var a=h.length;h.forEach(function(i){var n=i.length,c=i[0].depth;i.forEach(function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&f(i,r)>0){var h=kt(i.sourceLinks,o),d=kt(i.targetLinks,l),y=h&&d?(h+d)/2:h||d;if(y){var g=(y-u(i))*e*.3;i.y0+=g,i.y1+=g}}else if(0==c&&1==n)s=i.y1-i.y0,i.y0=t.y1/2-s/2,i.y1=t.y1/2+s/2;else if(c==a-1&&1==n)s=i.y1-i.y0,i.y0=t.y1/2-s/2,i.y1=t.y1/2+s/2;else if(1==i.targetLinks.length&&1==i.targetLinks[0].source.sourceLinks.length)s=i.y1-i.y0,i.y0=i.targetLinks[0].source.y0,i.y1=i.y0+s;else{var p=kt(i.sourceLinks,o),m=kt(i.targetLinks,l),x=((p&&m?(p+m)/2:p||m)-u(i))*e;i.y0+=x,i.y1+=x}})})}function s(){h.forEach(function(r){var n,c,l,o=t.y0,u=r.length;for(e?r.sort(e):r.sort(L),l=0;l<u;++l)(c=o-(n=r[l]).y0)>0&&(n.y0+=c,n.y1+=c),o=n.y1+a;if((c=o-a-t.y1)>0)for(o=n.y0-=c,n.y1-=c,l=u-2;l>=0;--l)(c=(n=r[l]).y1+i-o)>0&&(n.y0-=c,n.y1-=c),o=n.y0})}var h=mt(t.nodes,function(t){return t.column}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]});s();for(var d=1,y=n;y>0;--y)c(d*=.99,r),s()}function R(t){t.nodes.forEach(function(t){t.sourceLinks.sort(k),t.targetLinks.sort(x)}),t.nodes.forEach(function(t){var e=t.y0,r=e,a=t.y1,i=a;t.sourceLinks.forEach(function(t){t.circular?(t.y0=a-t.width/2,a-=t.width):(t.y0=e+t.width/2,e+=t.width)}),t.targetLinks.forEach(function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)})})}function _(t){let{sx:e,sTop:r,sBot:a,tx:i,tTop:n,tBot:c,cp1X:l,cp2X:o}=t,u=(r+a)/2,s=(n+c)/2;return{pathD:[`M${e},${r}`,`C${l},${r} ${o},${n} ${i},${n}`,`L${i},${c}`,`C${o},${c} ${l},${a} ${e},${a}`,"Z"].join(" "),bezier:{circular:!1,points:[{x:e,y:u},{x:l,y:u},{x:o,y:s},{x:i,y:s}],halfWidth:(a-r)/2}}}function I(t){let e=t.circularPathData;if(!e)return null;let r=t.sankeyWidth/2,a="bottom"===t.circularLinkType?1:-1,i=1===a?1:0,n="down"===t.direction,c=(t,e)=>n?`${e},${t}`:`${t},${e}`,l=(t,e,r,a,i)=>`A${n?e:t},${n?t:e} 0 0 ${n?1-r:r} ${c(a,i)}`,{sourceX:o,sourceY:u,targetX:s,targetY:f,rightInnerExtent:h,leftInnerExtent:d,rightFullExtent:y,leftFullExtent:g,verticalFullExtent:p,verticalRightInnerExtent:m,verticalLeftInnerExtent:x,rightLargeArcRadius:k,rightSmallArcRadius:L,leftLargeArcRadius:v,leftSmallArcRadius:b}=e;return`M${c(o,u-a*r)}L${c(h,u-a*r)}`+l(k+r,L+r,i,y+r,u+a*L)+`L${c(y+r,m)}`+l(k+r,k+r,i,h,p+a*r)+`L${c(d,p+a*r)}`+l(v+r,v+r,i,g-r,x)+`L${c(g-r,f+a*b)}`+l(v+r,b+r,i,d,f-a*r)+`L${c(s,f-a*r)}L${c(s,f+a*r)}L${c(d,f+a*r)}`+l(v-r,b-r,1-i,g+r,f+a*b)+`L${c(g+r,x)}`+l(v-r,v-r,1-i,d,p-a*r)+`L${c(h,p-a*r)}`+l(k-r,k-r,1-i,y-r,m)+`L${c(y-r,u+a*L)}`+l(k-r,L-r,1-i,h,u+a*r)+`L${c(o,u+a*r)}Z`}function W(t,e){if("production"===process.env.NODE_ENV||!t||!t.data||"object"!=typeof t.data)return t;let r=Bt.get(t);if(r){let t=r.get(e);if(t)return t}else r=new Map,Bt.set(t,r);let a=new Proxy(t,{get(t,r,a){if("string"==typeof r&&!(r in t)&&t.data&&r in t.data){let t=`${e}:${r}`;jt.has(t)||(jt.add(t),console.warn(`[Semiotic] "${e}" callback accessed "${r}" on the wrapper object, but it only exists on ".data". Use d.data.${r} (or d.data?.${r}) instead. Frame callbacks receive RealtimeNode/RealtimeEdge wrappers, not your raw data.`))}return Reflect.get(t,r,a)}});return r.set(e,a),a}function F(t,e,r){let a=[];for(let i of e){let e=ut(i.source),n=ut(i.target),c=null;if(e===t?c=n:n===t&&(c=e),c){let t=r.get(c);t&&(0!==t.x||0!==t.y)&&a.push({x:t.x,y:t.y})}}return a}function N(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r)|0;return Math.abs(e)}function C(t,e,r){let a=t.match(/[a-zA-Z]|[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?/g);if(!a)return t;let i=[],n=0;for(;n<a.length;){let t=a[n];if("M"===t||"L"===t||"C"===t||"Q"===t)for(i.push(t),n++;n<a.length&&!isNaN(Number(a[n]));)i.push(String(Number(a[n])+e)),n++,n<a.length&&!isNaN(Number(a[n]))&&(i.push(String(Number(a[n])+r)),n++);else if("A"===t)for(i.push(t),n++;n<a.length&&!isNaN(Number(a[n]));)i.push(a[n++]),n<a.length&&i.push(a[n++]),n<a.length&&i.push(a[n++]),n<a.length&&i.push(a[n++]),n<a.length&&i.push(a[n++]),n<a.length&&(i.push(String(Number(a[n])+e)),n++),n<a.length&&(i.push(String(Number(a[n])+r)),n++);else"Z"===t||"z"===t?(i.push(t),n++):(i.push(a[n]),n++)}return i.join(" ")}function z(t){let[e,r,a]=function(t){if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6===e.length)return[0,2,4].map(t=>parseInt(e.slice(t,t+2),16))}let e=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return e?[+e[1],+e[2],+e[3]]:[128,128,128]}(t);return.299*e+.587*r+.114*a>150?"#222":"#fff"}function O(t){if(t)return"function"==typeof t?t:e=>e[t]}function j(t){if(!t)return null;if("function"==typeof t){let e=t;return t=>e(t.data??t)}return e=>e.data?.[t]||e[t]||e.id}function B(t){let e=new Map(t.map(t=>[t,0]));return t.map(t=>{let r=e.get(t),a=t;for(;r>0&&e.has(a);)a=`${t}__${r++}`;return e.set(t,r||1),e.set(a,1),a})}function X(t,e,r){if(e.colorByDepth&&void 0!==t.depth){let r=function(t){return Array.isArray(t.colorScheme)?t.colorScheme:t.themeCategorical&&t.themeCategorical.length>0?t.themeCategorical:Kt}(e);return r[t.depth%r.length]}return r||function(t){return Array.isArray(t.colorScheme)&&t.colorScheme.length>0?t.colorScheme[0]:t.themeSemantic?.primary?t.themeSemantic.primary:t.themeCategorical&&t.themeCategorical.length>0?t.themeCategorical[0]:"#4d430c"}(e)}function Y(t,e,r){return{fill:X(t,e,r.fill),stroke:r.stroke||e.themeSemantic?.surface||"#fff",strokeWidth:r.strokeWidth??1,opacity:r.opacity,cursor:r.cursor}}function q(t){return!t.__hierarchyNode?.children?.length}function Z(t,e,r,a,i){let n=(t+r)/2,c=(e+a)/2;return"horizontal"===i?`M ${t},${e} C ${n},${e} ${n},${a} ${r},${a}`:"radial"===i?`M ${t},${e} Q ${n},${e} ${n},${c} T ${r},${a}`:`M ${t},${e} C ${t},${c} ${r},${c} ${r},${a}`}function G(t,e,r){let a=r.treeOrientation||"vertical";if("radial"===a){let r=e.x,a=e.y;t.x=a*Math.cos(r-Math.PI/2),t.y=a*Math.sin(r-Math.PI/2)}else"horizontal"===a?(t.x=e.y,t.y=e.x):(t.x=e.x,t.y=e.y);Q(t,5)}function K(t,e){t.x0=e.x0,t.y0=e.y0,t.x1=t.value?e.x1:e.x0,t.y1=t.value?e.y1:e.y0,t.x=(t.x0+t.x1)/2,t.y=(t.y0+t.y1)/2,t.width=t.x1-t.x0,t.height=t.y1-t.y0}function V(t,e){let r=e.r??0;t.x=e.x,t.y=e.y,Q(t,r),t.__radius=r}function Q(t,e){t.x0=t.x-e,t.x1=t.x+e,t.y0=t.y-e,t.y1=t.y+e,t.width=2*e,t.height=2*e}function H(t){return t.data&&"object"==typeof t.data?t.data:t}function J(t,e,r){if(e)return r?.selectedStyle&&Object.assign(t,r.selectedStyle),t;let a=r?.unselectedOpacity??ft;return t.opacity=a,t.fillOpacity=a,t.strokeOpacity=a,r?.unselectedStyle&&Object.assign(t,r.unselectedStyle),t}function U(t,e,r){if(t)return e?a=>{let i={...t(a)};return e.isActive?J(i,e.predicate(H(a)),r):i}:t}function tt(t,e,r){if(t)return e?a=>{let i={...t(a)};if(!e.isActive)return i;let n=H(a),c="object"==typeof a.source?H(a.source):null,l="object"==typeof a.target?H(a.target):null;return J(i,c||l?!!c&&e.predicate(c)||!!l&&e.predicate(l):e.predicate(n),r)}:t}function et(t,e){if(!t)return[];let r=[],a=t=>{r.push(t);let i="function"==typeof e?e(t):t[e];i&&Array.isArray(i)&&i.forEach(a)};return a(t),r}function rt(t,e,r,a){if(t&&t.length>0)return t;let i=new Set;return e.forEach(t=>{let e="function"==typeof r?r(t):t[r],n="function"==typeof a?a(t):t[a];i.add(e),i.add(n)}),Array.from(i).map(t=>({id:t}))}function at({edgeColorBy:t,colorBy:e,colorScale:r,nodeStyleFn:a,edgeOpacity:i,baseStyle:n={}}){return c=>{let l={fillOpacity:i,...n};if("function"==typeof t)l.fill=t(c);else if("source"===t){let t="object"==typeof c.source?c.source:null;e&&t?l.fill=dt(t.data||t,e,r):t&&(l.fill=a(t,t.index).fill)}else if("target"===t){let t="object"==typeof c.target?c.target:null;e&&t?l.fill=dt(t.data||t,e,r):t&&(l.fill=a(t,t.index).fill)}else"gradient"===t&&(l.fill="#999",l.fillOpacity=.7*i);return l}}function it(t){return nt(t,"orbit",()=>({metaMap:new Map,startTime:typeof performance<"u"?performance.now():Date.now()}))}import{a as nt}from"./c-DEWMXCOF.min.js";import{a as ct,b as lt}from"./c-LHVHGQRW.min.js";import{e as ot,f as ut}from"./c-YLZIV3VS.min.js";import{a as st,e as ft}from"./c-C7TT4J7K.min.js";import{a as ht,r as dt}from"./c-WPL6PGP3.min.js";import{min as yt,group as gt,sum as pt,groups as mt,max as xt,mean as kt}from"d3-array";import{interpolateNumber as Lt}from"d3-interpolate";import{forceLink as vt,forceSimulation as bt,forceManyBody as Dt,forceCollide as Pt,forceCenter as Et,forceX as St,forceY as Mt}from"d3-force";import{ribbon as wt,chord as At}from"d3-chord";import{arc as $t,pie as Tt}from"d3-shape";import{hierarchy as Rt,cluster as _t,tree as It,treemap as Wt,treemapBinary as Ft,partition as Nt,pack as Ct}from"d3-hierarchy";var zt=class{constructor(t){this.size=t,this.maximum=new Float64Array(4*t),this.floor=new Float64Array(4*t)}query(t,e){let r=(a,i,n)=>{if(t<=i&&n<=e)return this.maximum[a];let c=i+n>>>1;return Math.max(this.floor[a],t<=c?r(2*a,i,c):0,e>c?r(2*a+1,c+1,n):0)};return r(1,0,this.size-1)}reserve(t,e,r){let a=(i,n,c)=>{if(this.maximum[i]=Math.max(this.maximum[i],r),t<=n&&c<=e)return void(this.floor[i]=Math.max(this.floor[i],r));let l=n+c>>>1;t<=l&&a(2*i,n,l),e>l&&a(2*i+1,l+1,c)};a(1,0,this.size-1)}},Ot=t=>{let{source:e,target:r}=t;if("string"==typeof e||"string"==typeof r)return null;if("down"===t.direction){let a=t.y0-t.sankeyWidth/2,i=t.y1-t.sankeyWidth/2,n=t.y1+t.sankeyWidth/2,c=t.y0+t.sankeyWidth/2,l=e.x1,o=r.x0,u=Lt(l,o),s=u(.5),f=u(.5);return`M${a},${l}C${a},${s} ${i},${f} ${i},${o}L${n},${o}C${n},${f} ${c},${s} ${c},${l}Z`}let a=t.sankeyWidth/2,i=Lt(e.x1,r.x0),{pathD:n}=_({sx:e.x1,sTop:t.y0-a,sBot:t.y0+a,tx:r.x0,tTop:t.y1-a,tBot:t.y1+a,cp1X:i(.5),cp2X:i(.5)});return n},jt=/*#__PURE__*/new Set,Bt=/*#__PURE__*/new WeakMap,Xt={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Math.min.apply(Math,t.sourceLinks.map(h))-1:0},justify:d},Yt={supportsStreaming:!0,hierarchical:!1,computeLayout(e,a,c,l){let o="vertical"===c.orientation?"down":"right",u=c.nodeAlign||"justify",f=c.nodeWidth??15,h=c.nodePaddingRatio??.05,y=c.iterations??300;for(let t of a)t.sankeyWidth=0,t.circular=!1,delete t.circularPathData,delete t._circularWidth,delete t._circularStub;for(let t of e)t.value=0,t.width=t.height=0,t.x0=t.x1=t.y0=t.y1=0,t.sourceLinks=[],t.targetLinks=[];let g=new Set(e.map(t=>t.id)),p=new Set,m=a.filter(t=>{let e=ut(t.source),r=ut(t.target);return!(!Number.isFinite(t.value)||t.value<=0||!g.has(e)||!g.has(r)||(p.add(e),p.add(r),0))}).map(t=>({...t,source:ut(t.source),target:ut(t.target)}));if(0===m.length)return;let x,k=e.filter(t=>p.has(t.id)).map(t=>({...t}));x="down"===o?[[0,0],[l[1],l[0]]]:[[0,0],[l[0],l[1]]];let L=function(){function e(){var e={nodes:k.apply(null,arguments),links:L.apply(null,arguments)};return function(e){e.x0=a,e.y0=c,e.x1=l,e.y1=o,e.py=0,function(e,r){e.nodes.forEach(function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]});var a=function(t,e){var r=new Map;return gt(t,e).forEach(function(t,e){r.set(e,t[0])}),r}(e.nodes,r);e.links.forEach(function(e,r){e.index=r;var i=e.source,n=e.target;"object"!=typeof i&&(i=e.source=t(a,i)),"object"!=typeof n&&(n=e.target=t(a,n)),i.sourceLinks.push(e),n.targetLinks.push(e)})}(e,y),function(t,e,r){var a=0,i=null==e?function(t,e,r){let a=t.length,i=Array.from({length:a},()=>[]),n=Array.from({length:a},()=>[]),c=new Int32Array(a),l=new Int32Array(a),o=new Float64Array(a),u=new Float64Array(e.length),s=new Int32Array(a),f=t.map(t=>{let e=r(t);return`${typeof e}:${String(e)}`}),h=0;for(let t of e)t.source.index!==t.target.index&&Number.isFinite(t.value)&&(h=Math.max(h,t.value));let d=(t,e)=>f[t]<f[e]?-1:f[t]>f[e]?1:0;e.map((t,e)=>e).sort((t,r)=>d(e[t].source.index,e[r].source.index)||d(e[t].target.index,e[r].target.index)||e[t].value-e[r].value).forEach(t=>{let r=e[t],a=r.source.index,s=r.target.index;if(a===s)return;let f=Number.isFinite(r.value)&&h>0?Math.max(0,r.value)/h:0;u[t]=f,n[a].push(t),i[s].push(t),l[a]++,c[s]++,o[a]+=f,o[s]-=f});let y=t.map(t=>t.index),g=Int32Array.from(y),p=t=>0===l[t]?2:0===c[t]?1:0,m=(t,e)=>{let r=p(t),a=p(e);return r!==a?r>a:0===r&&o[t]!==o[e]?o[t]>o[e]:f[t]<f[e]||f[t]===f[e]&&t<e},x=(t,e)=>{let r=y[t];y[t]=y[e],y[e]=r,g[y[t]]=t,g[r]=e},k=(t,e=!1)=>{let r=g[t];for(;!e&&r>0;){let e=r-1>>>1;if(!m(t,y[e]))break;x(r,e),r=e}for(;2*r+1<y.length;){let e=2*r+1;if(e+1<y.length&&m(y[e+1],y[e])&&e++,!m(y[e],t))break;x(r,e),r=e}};for(let t=(y.length>>>1)-1;t>=0;t--)k(y[t],!0);let L=0,v=a-1;for(;y.length;){let t=y[0];s[t]=0===l[t]?v--:L++;let r=y.pop();g[t]=-1,y.length&&(y[0]=r,g[r]=0,k(r));for(let r of n[t]){let t=e[r].target.index;g[t]<0||(c[t]--,o[t]+=u[r],k(t))}for(let r of i[t]){let t=e[r].source.index;g[t]<0||(l[t]--,o[t]-=u[r],k(t))}}return s}(t.nodes,t.links,r):null;t.nodes.forEach(function(t){delete t.circularLinkType}),t.links.forEach(function(t){delete t.circularLinkID,delete t.circularLinkType,delete t.circularPathData,delete t._circularWidth,delete t._circularStub,t.circular=i?i[t.source.index]>=i[t.target.index]:!(e(t.source)<e(t.target)),t.circular&&(t.circularLinkID=a++)})}(e,p,y),function(t,e){var a=0,i=0;t.links.forEach(function(t){t.circular&&(t.source.circularLinkType||t.target.circularLinkType?t.circularLinkType=t.source.circularLinkType?t.source.circularLinkType:t.target.circularLinkType:t.circularLinkType=a<i?"top":"bottom","top"==t.circularLinkType?a++:i++,t.source.circularLinkType=t.circularLinkType,t.target.circularLinkType=t.circularLinkType)}),t.links.forEach(function(t){t.circular&&(t.source.circularLinkType==t.target.circularLinkType&&(t.circularLinkType=t.source.circularLinkType),r(t,e)&&(t.circularLinkType=t.source.circularLinkType))})}(e,y),function(t){t.nodes.forEach(function(t){t.partOfCycle=!1,t.value=Math.max(pt(t.sourceLinks,s),pt(t.targetLinks,s)),t.sourceLinks.forEach(function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)}),t.targetLinks.forEach(function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)})})}(e),function(t,e,r){if(null!=e&&t.nodes.length){t.nodes.sort(function(t,r){return e(t)<e(r)?-1:1});var a=0,i=e(t.nodes[0]);t.nodes.forEach(function(t){a=e(t)==i?a:a+1,i=e(t)==i?i:e(t),t.column=a})}var n=new Int32Array(t.nodes.length),c=[],l=1;t.nodes.forEach(function(t){t.depth=t.height=0,t.targetLinks.forEach(function(e){e.circular||n[t.index]++}),0===n[t.index]&&c.push(t)});for(var o=0;o<c.length;o++){var u=c[o];l=Math.max(l,u.depth+1),u.sourceLinks.forEach(function(t){t.circular||(t.target.depth=Math.max(t.target.depth,u.depth+1),0===--n[t.target.index]&&c.push(t.target))})}for(o=c.length-1;o>=0;o--)(u=c[o]).sourceLinks.forEach(function(t){t.circular||(u.height=Math.max(u.height,t.target.height+1))});t.nodes.forEach(function(t){t.column=null==e?r(t,l):t.column})}(e,p,g);var d=f;if(null!==h){var k=mt(e.nodes,function(t){return t.column}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]}),L=xt(k,function(t){return t.length});L>1&&(d=Math.max(1,(o-c)*h/(L-1)))}(function(t,e,r){var a=mt(t.nodes,function(t){return t.column}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]});t.py=e;var i=yt(a,function(e){return(t.y1-t.y0-(e.length-1)*t.py)/pt(e,function(t){return t.value})});t.ky=i,t.links.forEach(function(e){e.width=e.value*t.ky});var n=xt(t.nodes,function(t){return t.column});n>0?t.nodes.forEach(function(e){e.x0=t.x0+e.column*((t.x1-t.x0-r)/n),e.x1=e.x0+r}):t.nodes.forEach(function(e){e.x0=t.x0,e.x1=e.x0+r})})(e,d,u),$(e,p,y),T(e,p,y,d,d,m),R(e),$(e,p,y),T(e,p,y,d,d,m),R(e),function(t){let e=t;e.nodes.forEach(function(t){t.y+(t.y1-t.y0)>e.y1&&(t.y=t.y-(t.y+(t.y1-t.y0)-e.y1));var r=t.sourceLinks.slice().sort(function(t,e){return t.index-e.index});r.length>1&&r.sort(function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!D(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=i(e,t);return t.y1-r}if(e.target.column>t.target.column)return i(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0});var a=t.y0;r.forEach(function(t){t.y0=a+t.width/2,a+=t.width});for(var n=0,c=r.length-1;c>=0;c--){var l=r[c];"bottom"==l.circularLinkType&&(l.y0=t.y1-n-l.width/2),n+=l.width}})}(e),e.nodes.forEach(function(t){var e=t.targetLinks.slice().sort(function(t,e){return t.index-e.index});e.length>1&&e.sort(function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!D(t,e))return t.y0-e.y0;if(e.source.column<t.source.column){var r=n(e,t);return t.y0-r}if(t.source.column<e.source.column)return n(t,e)-e.y0}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:t.source.column-e.source.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:e.source.column-t.source.column:"top"==t.circularLinkType?-1:1:void 0});var r=t.y0;e.forEach(function(t){t.y1=r+t.width/2,r+=t.width});for(var a=0,i=e.length-1;i>=0;i--){var c=e[i];"bottom"==c.circularLinkType&&(c.y1=t.y1-a-c.width/2),a+=c.width}}),function(t){var e=t.nodes,r=t.links,a=!1,i=!1;if(r.forEach(function(t){"top"==t.circularLinkType?a=!0:"bottom"==t.circularLinkType&&(i=!0)}),0==a||0==i){let a=function(e){return(e-n)/(c-n)*(t.y1-t.y0)+t.y0};var n=yt(e,function(t){return t.y0}),c=xt(e,function(t){return t.y1}),l=c-n,o=(t.y1-t.y0)/l;o<1?(e.forEach(function(t){t.y0=a(t.y0),t.y1=a(t.y1)}),r.forEach(function(t){t.y0=a(t.y0),t.y1=a(t.y1),t.width=t.width*o})):e.forEach(function(t){var e=t.y1-t.y0,r=a(t.y0)-t.y0;t.y0=a(t.y0),t.y1=t.y0+e,t.sourceLinks.forEach(function(t){t.y0=t.y0+r}),t.targetLinks.forEach(function(t){t.y1=t.y1+r})})}}(e),E(e,y,x,10,8)}(e),e}var a=0,c=0,l=1,o=1,u=24,f=8,h=null,y=M,g=d,p=void 0,m=32,x=2,k=w,L=A;return e.update=function(t){return R(t),E(t,y,x,10,8),t},e.nodeWidth=function(t){return arguments.length?(u=+t,e):u},e.nodePadding=function(t){return arguments.length?(f=+t,e):f},e.nodePaddingRatio=function(t){return arguments.length?(h=+t,e):h},e.nodes=function(t){return arguments.length?(k="function"==typeof t?t:S(t),e):k},e.links=function(t){return arguments.length?(L="function"==typeof t?t:S(t),e):L},e.nodeId=function(t){return arguments.length?(y="function"==typeof t?t:S(t),e):y},e.nodeAlign=function(t){return arguments.length?(g="function"==typeof t?t:S(t),e):g},e.nodeSort=function(t){return arguments.length?(p=t,e):p},e.iterations=function(t){return arguments.length?(m=+t,e):m},e.circularLinkGap=function(t){return arguments.length?(x=+t,e):x},e.extent=function(t){return arguments.length?(a=+t[0][0],c=+t[0][1],l=+t[1][0],o=+t[1][1],e):[[a,c],[l,o]]},e.size=function(t){return arguments.length?(a=c=0,l=+t[0],o=+t[1],e):[l-a,o-c]},e}().extent(x).links(m).nodes(k).nodeAlign(Xt[u]||d).nodeId(t=>t.id).nodeWidth(f).iterations(y);L.nodePaddingRatio&&L.nodePaddingRatio(h),L();{let t=1/0,e=-1/0,r=1/0,a=-1/0;for(let i of k)i.x0<t&&(t=i.x0),i.x1>e&&(e=i.x1),i.y0<r&&(r=i.y0),i.y1>a&&(a=i.y1);for(let i of m){if(!i.circular||!i.circularPathData)continue;let n=i.circularPathData,c=(i._circularWidth??i.width??0)/2;n.leftFullExtent-c<t&&(t=n.leftFullExtent-c),n.rightFullExtent+c>e&&(e=n.rightFullExtent+c),n.verticalFullExtent-c<r&&(r=n.verticalFullExtent-c),n.verticalFullExtent+c>a&&(a=n.verticalFullExtent+c)}let i=e-t,n=a-r,c=x[1][0],l=x[1][1];if(i>0&&n>0&&(t<0||r<0||e>c||a>l)){let e=c/i,a=l/n,o=Math.min(e,a),u=-t*o+(c-i*o)/2,s=-r*o+(l-n*o)/2;for(let t of k)t.x0=t.x0*o+u,t.x1=t.x1*o+u,t.y0=t.y0*o+s,t.y1=t.y1*o+s;for(let t of m)if(t.y0=t.y0*o+s,t.y1=t.y1*o+s,t.width=(t.width??0)*o,t._circularWidth&&(t._circularWidth*=o),t.circular&&t.circularPathData){let e=t.circularPathData;e.sourceX=e.sourceX*o+u,e.targetX=e.targetX*o+u,e.sourceY=e.sourceY*o+s,e.targetY=e.targetY*o+s,e.rightFullExtent=e.rightFullExtent*o+u,e.leftFullExtent=e.leftFullExtent*o+u,e.verticalFullExtent=e.verticalFullExtent*o+s,e.rightInnerExtent=e.rightInnerExtent*o+u,e.leftInnerExtent=e.leftInnerExtent*o+u,e.verticalRightInnerExtent=e.verticalRightInnerExtent*o+s,e.verticalLeftInnerExtent=e.verticalLeftInnerExtent*o+s,e.rightSmallArcRadius*=o,e.rightLargeArcRadius*=o,e.leftSmallArcRadius*=o,e.leftLargeArcRadius*=o,e.sourceWidth*=o,e.rightNodeBuffer*=o,e.leftNodeBuffer*=o,e.arcRadius*=o}}}let v=new Map;for(let t of e)v.set(t.id,t);for(let t of k){let e=v.get(t.id);e&&(e.x0=t.x0,e.x1=t.x1,e.y0=t.y0,e.y1=t.y1,e.value=t.value,e.depth=t.depth,e.sourceLinks=t.sourceLinks,e.targetLinks=t.targetLinks,e.width=t.x1-t.x0,e.height=t.y1-t.y0,e.x=t.x0+(t.x1-t.x0)/2,e.y=t.y0+(t.y1-t.y0)/2)}let b=new Map;for(let t of a)if(t._edgeKey)b.set(t._edgeKey,t);else{let e=ut(t.source),r=ut(t.target);b.set(`${e}\0${r}`,t)}for(let t of m){let e=ut(t.source),r=ut(t.target),a=t._edgeKey?b.get(t._edgeKey):b.get(`${e}\0${r}`);if(a){a.y0=t.y0,a.y1=t.y1,a.sankeyWidth=t.width??0,a.circular=!!t.circular,a.circularPathData=t.circularPathData,a._circularWidth=t._circularWidth,a._circularStub=t._circularStub,a.path=t.path,a.circularLinkType=t.circularLinkType,a.direction=o;let i=v.get(e),n=v.get(r);i&&(a.source=i),n&&(a.target=n)}}},buildScene(t,e,r,a){let i="vertical"===r.orientation?"down":"right",n=r.nodeStyle,c=r.edgeStyle,l=r.edgeOpacity??.5,o=r.edgeColorBy||"source",u=Array.isArray(r.colorScheme)?r.colorScheme:r.themeCategorical&&r.themeCategorical.length>0?r.themeCategorical:ht,s=new Map;t.forEach((t,e)=>{s.set(t.id,u[e%u.length])});let f=[],h=[],d=[],y=new Map;for(let e of t){let t=e.x1-e.x0,r=e.y1-e.y0;if(e.value<=0||t<=0||r<=0)continue;let a=n?n(W(e,"nodeStyle")):{},c={fill:a.fill||s.get(e.id)||"#4d430c",stroke:a.stroke,strokeWidth:a.strokeWidth,opacity:a.opacity,cursor:a.cursor};y.set(e.id,("string"==typeof c.fill?c.fill:null)||s.get(e.id)||"#4d430c");let l={...e.data,value:e.data?.value??e.value};"down"===i?f.push({type:"rect",x:e.y0,y:e.x0,w:r,h:t,style:c,accessibleDatum:l,datum:e,id:e.id,label:e.id}):f.push({type:"rect",x:e.x0,y:e.y0,w:t,h:r,style:c,accessibleDatum:l,datum:e,id:e.id,label:e.id})}let g=[...e].sort((t,e)=>(e.sankeyWidth||0)-(t.sankeyWidth||0));for(let t of g){if(!(t.value>0)||!t.sankeyWidth||t.sankeyWidth<=0)continue;let e="object"==typeof t.source?t.source:null,a="object"==typeof t.target?t.target:null;if(!e||!a)continue;let i=r.themeSemantic?.border||r.themeSemantic?.secondary||"#999";i="function"==typeof o?o(t)||i:"target"===o?y.get(a.id)||s.get(a.id)||i:y.get(e.id)||s.get(e.id)||i;let n,u=c?c(W(t,"edgeStyle")):{};if(n=t.circular&&t.circularPathData?I(t):Ot(t),!n)continue;let f={fill:u.fill||i,fillOpacity:u.fillOpacity??l,stroke:u.stroke||"none",strokeWidth:u.strokeWidth,strokeOpacity:u.strokeOpacity,opacity:u.opacity,cursor:u.cursor};h.push({type:"bezier",pathD:n,bezierCache:t.bezier,style:f,accessibleDatum:t.data,datum:t})}if(!1!==r.showLabels){let e=ot(r.nodeLabel);for(let r of t){let t=r.x1-r.x0,n=r.y1-r.y0;if(r.value<=0||t<=0||n<=0)continue;let c,l,o,u=e?e(r):r.id;if(u){if("down"===i)c=r.y0+(r.y1-r.y0)/2,l=r.x0+t/2<a[1]/2?r.x1+14:r.x0-14,o="start";else{let e=a[0]/2;r.x0+t/2<e?(c=r.x1+6,o="start"):(c=r.x0-6,o="end"),l=r.y0+n/2}d.push({x:c,y:l,text:String(u),anchor:"down"===i?"middle":o,baseline:"middle",fontSize:11})}}}return{sceneNodes:f,sceneEdges:h,labels:d}}},qt={supportsStreaming:!0,hierarchical:!1,computeLayout(t,e,r,a){if(0===t.length)return;let i=r.forceStrength??.1,n=a[0]/2,c=a[1]/2,l=Math.max(.1,Math.min(1,Math.min(a[0],a[1])/200)),o=Math.min(.5,.06+1.8*(1-l)),u=r.__previousPositions,s=0,f=[];for(let e of t){let t=!1!==e.__hasPosition&&Number.isFinite(e.x)&&Number.isFinite(e.y),r=u?.get(e.id);t?s++:r?(e.x=r.x,e.y=r.y,s++):f.push(e)}let h=t.length>0?f.length/t.length:1,d=s>0&&h<=.3;if(d){let r=new Map;for(let e of t)r.set(e.id,e);for(let t of f){let a=F(t.id,e,r);if(a.length>0){let e=0,r=0;for(let t of a)e+=t.x,r+=t.y;let i=N(t.id),n=i%360*(Math.PI/180),c=(10+i%20)*l;t.x=e/a.length+c*Math.cos(n),t.y=r/a.length+c*Math.sin(n)}else{let e=N(t.id),r=e%360*(Math.PI/180),a=(15+e%30)*l;t.x=n+a*Math.cos(r),t.y=c+a*Math.sin(r)}}}else{let e=Math.PI*(3-Math.sqrt(5));for(let r=0;r<t.length;r++){let a=t[r];if(!1===a.__hasPosition||!Number.isFinite(a.x)||!Number.isFinite(a.y)){let t=10*Math.sqrt(r+.5)*l,i=r*e;a.x=n+t*Math.cos(i),a.y=c+t*Math.sin(i)}}}for(let e of t)e.__hasPosition=!0;let y=t.length,g=r.iterations??Math.max(50,Math.min(300,Math.floor(300-2*(y-30)))),p=r.__skipForceSimulation||0===r.iterations?0:d?40:g,m=ct(r.nodeSize,r.nodeSizeRange,t);if(p>0){let u=new Map,s=new Map;for(let e of t)u.set(e.id,0),s.set(e.id,e);for(let t of e){let e=ut(t.source),r=ut(t.target);u.set(e,(u.get(e)??0)+1),u.set(r,(u.get(r)??0)+1)}let f=vt().strength(t=>{let e=lt(t),r=ut(t.source),a=ut(t.target),n=Math.max(1,Math.min(u.get(r)??1,u.get(a)??1)),c=e&&e>0?Math.sqrt(e):1;return Math.min(2.5,c*i/(.1*n))}).distance(t=>{let e="string"==typeof t.source?s.get(t.source):t.source,r="string"==typeof t.target?s.get(t.target):t.target,a=(e?m(e):0)+(r?m(r):0)+Math.max(6,12*l);return Math.max(16,40*l,a)}).id(t=>t.id),h=bt();if((void 0!==r.random||void 0!==r.seed)&&h.randomSource(r.random??st(r.seed)),h.force("charge",Dt().strength(t=>{let e=u.get(t.id)??0;return-15*l*m(t)*Math.sqrt(e+1)})).force("collide",Pt(t=>m(t)+3*l).strength(.9).iterations(2)).force("center",Et(n,c).strength(.8)).force("x",St(n).strength(o)).force("y",Mt(c).strength(o)).force("bounds",function(t,e,r=2,a=.6){let i=[],n=n=>{let c=a*Math.max(n,.2);for(let a of i){let i=a.x??t[0]/2,n=a.y??t[1]/2,l=a.vx??0,o=a.vy??0,u=e(a)+r,s=Math.min(t[0]/2,u),f=Math.max(t[0]/2,t[0]-u),h=Math.min(t[1]/2,u),d=Math.max(t[1]/2,t[1]-u),y=i+l,g=n+o;y<s?a.vx=l+(s-y)*c:y>f&&(a.vx=l+(f-y)*c),g<h?a.vy=o+(h-g)*c:g>d&&(a.vy=o+(d-g)*c)}};return n.initialize=t=>{i=t},n}(a,m)),h.nodes(t),e.length>0){let t=e.map(t=>({...t,source:ut(t.source),target:ut(t.target)}));f.links(t),h.force("link",f)}d?h.alpha(.3):h.alpha()<.1&&h.alpha(1),h.stop();for(let t=0;t<p;++t)h.tick()}for(let e of t){if(null==e.x||null==e.y)continue;let t=m(e),r=p>0?2:0,i=Math.min(a[0]/2,t+r),n=Math.min(a[1]/2,t+r);e.x=Math.max(i,Math.min(a[0]-i,e.x)),e.y=Math.max(n,Math.min(a[1]-n,e.y)),e.x0=0,e.x1=0,e.y0=0,e.y1=0}let x=new Map;for(let e of t)x.set(e.id,e);for(let t of e){if("string"==typeof t.source){let e=x.get(t.source);e&&(t.source=e)}if("string"==typeof t.target){let e=x.get(t.target);e&&(t.target=e)}}},buildScene(t,e,r,a){let i=r.nodeStyle,n=r.edgeStyle,c=ct(r.nodeSize,r.nodeSizeRange,t),l=Array.isArray(r.colorScheme)?r.colorScheme:r.themeCategorical&&r.themeCategorical.length>0?r.themeCategorical:ht,o=new Map;t.forEach((t,e)=>{o.set(t.id,l[e%l.length])});let u=[],s=[],f=[];for(let e of t){if(null==e.x||null==e.y)continue;let t=c(W(e,"nodeSize")),a=i?i(W(e,"nodeStyle")):{},n={fill:a.fill||o.get(e.id)||r.themeSemantic?.primary||"#007bff",stroke:a.stroke||r.themeSemantic?.surface||"#fff",strokeWidth:a.strokeWidth??2,opacity:a.opacity,cursor:a.cursor};u.push({type:"circle",cx:e.x,cy:e.y,r:t,style:n,accessibleDatum:e.data,datum:e,id:e.id,label:e.id})}let h=new Map;for(let e of t)h.set(e.id,e);for(let t of e){let e="object"==typeof t.source?t.source:h.get(t.source),a="object"==typeof t.target?t.target:h.get(t.target);if(!e||!a||null==e.x||null==e.y||null==a.x||null==a.y)continue;let i=n?n(W(t,"edgeStyle")):{},c={stroke:i.stroke||r.themeSemantic?.border||r.themeSemantic?.secondary||"#999",strokeWidth:i.strokeWidth??1,opacity:i.opacity??.6,cursor:i.cursor};s.push({type:"line",x1:e.x,y1:e.y,x2:a.x,y2:a.y,style:c,accessibleDatum:t.data,datum:t})}if(!1!==r.showLabels){let e=ot(r.nodeLabel);for(let r of t){if(null==r.x||null==r.y)continue;let t=e?e(r):r.id;if(!t)continue;let a=c(W(r,"nodeSize"));f.push({x:r.x,y:r.y-a-4,text:String(t),anchor:"middle",baseline:"auto",fontSize:11,anchorPoint:[r.x,r.y]})}}return{sceneNodes:u,sceneEdges:s,labels:f}}},Zt=ht,Gt={supportsStreaming:!1,hierarchical:!1,computeLayout(t,e,r,a){for(let e of t)delete e.__arcData;for(let t of e)delete t.__chordData,delete t.__chordEdges;if(0===t.length)return;let{padAngle:i=.01,groupWidth:n=20,sortGroups:c}=r,l=Math.min(a[0],a[1])/2,o=l-n,u=a[0]/2,s=a[1]/2,f=new Map(t.map(t=>[t.id,t])),h=new Set,d=e.filter(t=>{let e=ut(t.source),r=ut(t.target);return!(!Number.isFinite(t.value)||t.value<=0||!f.has(e)||!f.has(r)||(h.add(e),h.add(r),0))}),y=t.filter(t=>h.has(t.id)),g=y.length;if(0===g)return;let p=new Map(y.map((t,e)=>[t.id,e])),m=Array.from({length:g},()=>new Array(g).fill(0)),x=new Map;for(let t of d){let e=ut(t.source),r=ut(t.target),a=p.get(e),i=p.get(r);m[a][i]+=t.value;let n=a<=i?`${a}\0${i}`:`${i}\0${a}`,c=x.get(n);c?c.push(t):x.set(n,[t])}let k=Math.min(Number.isFinite(i)?Math.max(0,i):.01,Math.PI/g),L=At().padAngle(k);c&&L.sortGroups(c);let v=L(m),b=v.groups,D=$t().innerRadius(o).outerRadius(l);for(let t of b){let e=y[t.index],r={innerRadius:o,outerRadius:l,startAngle:t.startAngle,endAngle:t.endAngle},a=D.centroid(r);e.x=a[0]+u,e.y=a[1]+s,e.__arcData={startAngle:t.startAngle,endAngle:t.endAngle}}for(let t of e){let e=ut(t.source),r=ut(t.target),a=f.get(e),i=f.get(r);a&&(t.source=a),i&&(t.target=i)}for(let t of v){let e=t.source.index,r=t.target.index,a=e<=r?`${e}\0${r}`:`${r}\0${e}`,i=x.get(a);for(let e of i)e.__chordData=t,e.__chordEdges=i}},buildScene(t,e,r,a){let{groupWidth:i=20,edgeOpacity:n=.5}=r,c=Math.min(a[0],a[1])/2,l=c-i,o=a[0]/2,u=a[1]/2,s=r.nodeStyle,f=r.edgeStyle,h=r.edgeColorBy||"source",d=Array.isArray(r.colorScheme)?r.colorScheme:r.themeCategorical&&r.themeCategorical.length>0?r.themeCategorical:Zt,y=new Map;t.forEach((t,e)=>{y.set(t.id,d[e%d.length])});let g=wt().radius(l),p=[],m=[],x=[];for(let e=0;e<t.length;e++){let r=t[e],a=r.__arcData;if(!a)continue;let i=s?s(W(r,"nodeStyle")):{},n={fill:("string"==typeof i.fill?i.fill:void 0)||y.get(r.id)||d[e%d.length],stroke:i.stroke||"black",strokeWidth:i.strokeWidth??1,opacity:i.opacity,cursor:i.cursor};p.push({type:"arc",cx:o,cy:u,innerR:l,outerR:c,startAngle:a.startAngle-Math.PI/2,endAngle:a.endAngle-Math.PI/2,style:n,accessibleDatum:r.data,datum:r,id:r.id,label:r.id})}let k=new Set,L=t.filter(t=>t.__arcData);for(let t of e){let e=t.__chordData;if(!e||k.has(e))continue;k.add(e);let a=L[e.source.index].id;for(let e of t.__chordEdges||[])ut(e.source)===a&&(t=e);let i=g(e);if(!i)continue;let c=C(i,o,u),l=r.themeSemantic?.border||r.themeSemantic?.secondary||"#999",s=f?f(W(t,"edgeStyle")):{};if(f)l=("string"==typeof s.fill?s.fill:void 0)||l;else{let e="object"==typeof t.source?t.source:null,r="object"==typeof t.target?t.target:null;"target"===h&&r?l=y.get(r.id)||l:e&&(l=y.get(e.id)||l)}let d={fill:l,fillOpacity:s.fillOpacity??n,stroke:s.stroke||"none",strokeWidth:s.strokeWidth,strokeOpacity:s.strokeOpacity,opacity:s.opacity,cursor:s.cursor};m.push({type:"ribbon",pathD:c,style:d,accessibleDatum:t.data,datum:t})}if(!1!==r.showLabels){let e=ot(r.nodeLabel),a=c+12;for(let r of t){let t=r.__arcData;if(!t)continue;let i=e?e(r):r.id;if(!i)continue;let n=(t.startAngle+t.endAngle)/2,c=n-Math.PI/2,l=o+Math.cos(c)*a,s=u+Math.sin(c)*a,f=n>Math.PI?"end":"start";x.push({x:l,y:s,text:String(i),anchor:f,baseline:"middle",fontSize:11})}}return{sceneNodes:p,sceneEdges:m,labels:x}}},Kt=["#e8d5b7","#b8d4e3","#d4e3b8","#e3c4d4","#d4d4e3","#e3d4b8","#b8e3d4","#e3b8b8"],Vt={supportsStreaming:!1,hierarchical:!0,computeLayout(t,e,r,a){let i=r.__hierarchyRoot;if(!i)return;let n=r.chartType,c=O(r.childrenAccessor),l=Rt(i,c),o=[];l.eachBefore(t=>o.push(t));let u=B(o.map((t,e)=>function(t,e,r){let a=e.nodeIDAccessor,i=t.data;return String("function"==typeof a?a(i):"string"==typeof a&&void 0!==i[a]?i[a]:void 0!==i.name?i.name:void 0!==i.id?i.id:`node-${r}`)}(t,r,e)));l.sum(function(t="value"){let e="function"==typeof t?t:e=>e[t];return t=>{let r=e(t),a="string"==typeof r?Number(r):r;return Number.isFinite(a)&&a>0?a:0}}(r.hierarchySum)).sort((t,e)=>e.value-t.value);let[s,f]=a;switch(n){case"tree":case"cluster":!function(t,e,r,a){let i=e.treeOrientation||"vertical",n="cluster"===e.chartType?_t():It();if("horizontal"===i)n.size([a,r]);else if("radial"===i){let t=Math.min(r,a)/2;n.size([2*Math.PI,.8*t])}else n.size([r,a]);n(t)}(l,r,s,f);break;case"treemap":case"partition":!function(t,e,r,a){let i="treemap"===e.chartType,n=i?Wt().tile(Ft):Nt();n.size([r,a]).padding(e.padding??(i?4:1)),"paddingTop"in n&&e.paddingTop>0&&n.paddingTop(e.paddingTop),n(t)}(l,r,s,f);break;case"circlepack":!function(t,e,r,a){let i=e.padding??4,n=Ct().size([r,a]).padding(i);t.leaves().some(t=>t.value)||n.radius(()=>0).padding(0),n(t)}(l,r,s,f)}let h=l.descendants();t.length=0,e.length=0;let d=new Map(o.map((t,e)=>[t,{id:u[e],x:0,y:0,x0:0,x1:0,y0:0,y1:0,width:0,height:0,value:t.value,depth:t.depth,data:t.data,createdByFrame:!0}]));for(let e of h){let a=d.get(e);"tree"===n||"cluster"===n?G(a,e,r):"treemap"===n||"partition"===n?K(a,e):"circlepack"===n&&V(a,e),a.__hierarchyNode=e,t.push(a)}if("tree"===n||"cluster"===n)for(let t of h)if(t.parent){let r=d.get(t.parent),a=d.get(t);e.push({source:r,target:a,value:1,y0:0,y1:0,sankeyWidth:0,data:{depth:t.depth}})}},buildScene(t,e,r,a){let i=r.chartType,n=r.nodeStyle||(()=>({})),c=r.edgeStyle||(()=>({}));switch(i){case"tree":case"cluster":return function(t,e,r,a,i,n){let c=[],l=[],o=[],u=r.treeOrientation||"vertical",s="radial"===u,f=a[0]/2,h=a[1]/2,{nodeSize:d}=r,y="number"==typeof d?d:5;for(let e of t){let t=e.x,a=e.y;s&&(t+=f,a+=h);let n=Y(e,r,i(W(e,"nodeStyle")));c.push({type:"circle",cx:t,cy:a,r:y,style:n,accessibleDatum:{...e.data,value:e.data?.value??e.value},datum:e,id:e.id,label:e.id,depth:e.depth})}let g=r.edgeOpacity??.5;for(let t of e){let e="object"==typeof t.source?t.source:null,a="object"==typeof t.target?t.target:null;if(!e||!a)continue;let i=e.x,c=e.y,o=a.x,d=a.y;s&&(i+=f,c+=h,o+=f,d+=h);let y=Z(i,c,o,d,u),p=n(W(t,"edgeStyle")),m={fill:"none",stroke:p.stroke||r.themeSemantic?.border||r.themeSemantic?.secondary||"#999",strokeWidth:p.strokeWidth??1.5,opacity:p.opacity??g,cursor:p.cursor};l.push({type:"curved",pathD:y,style:m,datum:t})}if(!1!==r.showLabels){let e=j(r.nodeLabel);for(let r of t){let t=e?e(r):r.id;if(!t)continue;let i,n,c,l=r.x,d=r.y;if(s&&(l+=f,d+=h),s){let t=l-f,e=d-h,r=Math.sqrt(t*t+e*e);r>0?(i=l+t/r*10,n=d+e/r*10,c=t>=0?"start":"end"):(i=l,n=d-12,c="middle")}else if("horizontal"===u){let e=q(r),o=11*String(t).length*.6,u=y+6;(e?l+u+o<=a[0]:l-u-o<0)?(i=l+y+6,c="start"):(i=l-y-6,c="end"),n=d}else{i=l;let t=y+14;n=d+t+6<=a[1]?d+t:d-t,c="middle"}let g=11*String(t).length*.6,p=i-("end"===c?g:"middle"===c?g/2:0);p<0?c="start":p+g>a[0]&&(c="end"),o.push({x:i,y:n,text:String(t),anchor:c,baseline:"middle",fontSize:11,anchorPoint:[l,d]})}}return{sceneNodes:c,sceneEdges:l,labels:o}}(t,e,r,a,n,c);case"treemap":case"partition":return function(t,e,r){let a=[],i=[];for(let i of t){let t=i.x1-i.x0,n=i.y1-i.y0;if(t<=0||n<=0)continue;let c=r(W(i,"nodeStyle")),l=Y(i,e,c);l.fillOpacity=c.fillOpacity,l.strokeOpacity=c.strokeOpacity,a.push({type:"rect",x:i.x0,y:i.y0,w:t,h:n,style:l,accessibleDatum:{...i.data,value:i.data?.value??i.value},datum:i,id:i.id,label:i.id,depth:i.depth})}if(!1!==e.showLabels){let a=j(e.nodeLabel),n=e.labelMode||"leaf",c="partition"===e.chartType;for(let l of t){let t=l.x1-l.x0,o=l.y1-l.y0;if(t<=0||o<=0)continue;let u=q(l);if(!c&&("leaf"===n&&!u||"parent"===n&&u))continue;let s=a?a(l):l.id;if(!s)continue;if(t<(u?30:40)||o<(u?16:14))continue;let f=X(l,e,r(W(l,"nodeStyle")).fill),h="string"==typeof f?z(f):e.themeSemantic?.text??"#000";u?i.push({x:l.x0+t/2,y:l.y0+o/2,text:String(s),anchor:"middle",baseline:"middle",fontSize:Math.min(11,Math.max(8,Math.min(t,o)/6)),fill:h}):i.push({x:l.x0+4,y:l.y0+12,text:String(s),anchor:"start",baseline:"auto",fontSize:11,fontWeight:600,fill:h})}}return{sceneNodes:a,sceneEdges:[],labels:i}}(t,r,n);case"circlepack":return function(t,e,r){let a=[],i=[];for(let i of t){let t=i.__radius??5;if(t<=0)continue;let n=Y(i,e,r(W(i,"nodeStyle")));n.opacity??(n.opacity=.7),a.push({type:"circle",cx:i.x,cy:i.y,r:t,style:n,accessibleDatum:{...i.data,value:i.data?.value??i.value},datum:i,id:i.id,label:i.id,depth:i.depth})}if(!1!==e.showLabels){let a=j(e.nodeLabel);for(let n of t){let t=n.__radius??5,c=a?a(n):n.id;if(!c||t<15)continue;let l=q(n),o=X(n,e,r(W(n,"nodeStyle")).fill);if(l){let r="string"==typeof o?z(o):e.themeSemantic?.text??"#000";i.push({x:n.x,y:n.y,text:String(c),anchor:"middle",baseline:"middle",fontSize:Math.min(11,Math.max(8,t/3)),fill:r})}else i.push({x:n.x,y:n.y-t+14,text:String(c),anchor:"middle",baseline:"hanging",fontSize:Math.min(11,Math.max(8,t/3)),fill:e.themeSemantic?.text||"#000",stroke:e.themeSemantic?.surface||"#fff",strokeWidth:3,paintOrder:"stroke"})}}return{sceneNodes:a,sceneEdges:[],labels:i}}(t,r,n);default:return{sceneNodes:[],sceneEdges:[],labels:[]}}}},Qt={supportsStreaming:!1,hierarchical:!0,supportsAnimation:!0,computeLayout(t,e,r,a){let i=r.__hierarchyRoot;i&&function(t,e,r,a,i){let n=O(r.childrenAccessor||"children"),c=function(t){if("function"==typeof t)return t;let e=t||"name";return t=>String(t[e]??"")}(r.nodeIDAccessor),l=function(t){if(Array.isArray(t))return t;switch(t){case"solar":return[1];case"atomic":return[2,8];default:return[9999]}}(r.orbitMode),o=r.orbitSize??2.95,u=r.orbitEccentricity??1,s="number"==typeof o?()=>o:o,f="number"==typeof u?()=>u:u,h=it(r);h.metaMap.clear(),a.length=0,i.length=0;let d=B(et(t,n).map(t=>String(c(t)))),y=0,g=e[0]/2,p=e[1]/2,m=Math.min(e[0],e[1])/2*.85,x=d[y++],k={id:x,x:g,y:p,x0:g,x1:g,y0:p,y1:p,width:0,height:0,value:0,depth:0,data:t};a.push(k),h.metaMap.set(x,{ring:m,angle:0,depth:0,parentId:null,eccentricity:1}),function t(e,r,c,o,u,g,p){let m=n(e);if(!m?.length)return;let x=m.length,k=0,L=0,v=0;for(;L<x;)L+=l[Math.min(v,l.length-1)],v++,k++;let b=0;for(let x=0;x<k;x++){let L=l[Math.min(x,l.length-1)],v=m.slice(b,b+L);if(!v.length)break;let D=(x+1)/k,P={id:r,depth:g,data:e,parentId:r},E=p?u/s(P)*D:u*D,S=Tt().value(t=>n(t)?.length?4:1).sort(null)(v),M=f(P);for(let e=0;e<v.length;e++){let n=(S[e].startAngle+S[e].endAngle)/2,l=v[e],u=d[y++],s=c+E*Math.sin(n),f=o+E*Math.cos(n)*M,p={id:u,x:s,y:f,x0:s,x1:s,y0:f,y1:f,width:0,height:0,value:0,depth:g,data:l};a.push(p),h.metaMap.set(u,{ring:E,angle:n,depth:g,parentId:r,eccentricity:M}),i.push({source:r,target:u,value:1,y0:0,y1:0,sankeyWidth:0,data:{source:r,target:u}}),t(l,u,s,f,E,g+1,!0)}b+=L}}(t,x,g,p,m,1,!1)}(i,a,r,t,e)},buildScene(t,e,r,a){let i=r.nodeStyle,n=r.edgeStyle,c=r.nodeSize,l="number"==typeof c?()=>c:"function"==typeof c?c:()=>6,o=[],u=[],s=[];if(!1!==r.orbitShowRings){let e=it(r),a=new Map;for(let e of t)a.set(e.id,e);let i=new Map;for(let[,t]of e.metaMap){if(!t.parentId)continue;let e=a.get(t.parentId);if(!e)continue;let r=`${t.parentId}:${t.ring}`;i.has(r)||i.set(r,{parentX:e.x,parentY:e.y,ring:t.ring,ecc:t.eccentricity})}let n=48,c={stroke:"rgba(128,128,128,0.35)",strokeWidth:.5,opacity:1};for(let[,{parentX:t,parentY:e,ring:r,ecc:a}]of i)for(let i=0;i<n;i++){let l=i/n*Math.PI*2,o=(i+1)/n*Math.PI*2;u.push({type:"line",x1:t+r*Math.sin(l),y1:e+r*Math.cos(l)*a,x2:t+r*Math.sin(o),y2:e+r*Math.cos(o)*a,style:c,interactive:!1,datum:null})}}for(let e of t){if(null==e.x||null==e.y)continue;let t=l(W(e,"nodeSize")),a=i?i(W(e,"nodeStyle")):{},n={fill:a.fill||r.themeSemantic?.primary||"#6366f1",stroke:a.stroke||r.themeSemantic?.surface||"#fff",strokeWidth:a.strokeWidth??1,opacity:a.opacity??(0===(e.depth??0)?1:.85),cursor:a.cursor};o.push({type:"circle",cx:e.x,cy:e.y,r:t,style:n,accessibleDatum:e.data,datum:e,id:e.id,label:e.id,depth:e.depth})}let f=new Map;for(let e of t)f.set(e.id,e);for(let t of e){let e="object"==typeof t.source?t.source:f.get(t.source),r="object"==typeof t.target?t.target:f.get(t.target);if(!e||!r||null==e.x||null==r.x)continue;let a=n?n(W(t,"edgeStyle")):{},i={stroke:a.stroke||"rgba(128,128,128,0.35)",strokeWidth:a.strokeWidth??.5,opacity:a.opacity??1,cursor:a.cursor};u.push({type:"line",x1:e.x,y1:e.y,x2:r.x,y2:r.y,style:i,datum:t})}if(r.showLabels){let e=r.nodeLabel;for(let r of t){let t=l(W(r,"nodeSize"));if(t<=4)continue;let a="function"==typeof e?e(r):e?r.data?.[e]??r.id:r.id;s.push({x:r.x,y:r.y+t+12,text:String(a),anchor:"middle",fontSize:10,fill:"currentColor",anchorPoint:[r.x,r.y]})}}return{sceneNodes:o,sceneEdges:u,labels:s}},tick:(t,e,r,a,i)=>!1!==r.orbitAnimated&&(function(t,e){let r=it(e),a=e.orbitSpeed??.25,i=e.orbitRevolution??function(t){switch(t){case"decay":return t=>Math.pow(.6,t.depth??0);case"alternate":return t=>{let e=t.depth??0;return(e%2==0?1:-1)/(e+1)};default:return t=>1/((t.depth??0)+1)}}(e.orbitRevolutionStyle),n=((typeof performance<"u"?performance.now():Date.now())-r.startTime)/1e3,c=a*(Math.PI/6),l=new Map;for(let e of t)l.set(e.id,e);for(let e of t){let t=r.metaMap.get(e.id);if(!t||!t.parentId)continue;let a=l.get(t.parentId);if(!a)continue;let o={id:e.id,depth:t.depth,data:e.data,parentId:t.parentId},u=t.angle+n*c*i(o);e.x=a.x+t.ring*Math.sin(u),e.y=a.y+t.ring*Math.cos(u)*t.eccentricity,e.x0=e.x,e.x1=e.x,e.y0=e.y,e.y1=e.y}}(t,r),!0)};export{_ as a,Yt as b,qt as c,Gt as d,Vt as e,U as f,tt as g,et as h,rt as i,at as j,Qt as k};
@@ -1 +1 @@
1
- function e(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};let t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}function t(t){let o=a(null);return n(t.imperativeRef,{variant:t.imperativeVariant,frameRef:o}),{frameRef:o,resolved:r(t.mode,{width:t.width,height:t.height,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}),normalizedMargin:l(()=>e(t.margin),[t.margin])}}function o(e){let o=t(e),{resolved:n,normalizedMargin:r}=o,a=i({responsive:e.responsive,data:e.data??[],rawData:e.data,colorBy:e.colorBy,colorScheme:e.colorScheme,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,frameLegend:e.frameLegend,selection:e.selection,linkedHover:e.linkedHover,hoverHighlight:e.hoverHighlight,fallbackFields:"string"==typeof e.colorBy?[e.colorBy]:[],unwrapData:e.unwrapData,onObservation:e.onObservation,onClick:e.onClick,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:e.chartTypeLabel,chartId:e.chartId,showLegend:n.showLegend,legend:e.legend,userMargin:r,marginDefaults:n.marginDefaults,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,width:n.width,height:n.height});return{...o,safeData:a.data,setup:a,earlyReturn:a.earlyReturn}}import{c as n,b as i}from"./c-C3YQVUB6.min.js";import{bH as r}from"./c-SU6Z75M2.min.js";import{useRef as a,useMemo as l}from"react";export{e as a,t as b,o as c};
1
+ function e(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};let t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}function t(t){let o=a(null);return n(t.imperativeRef,{variant:t.imperativeVariant,frameRef:o}),{frameRef:o,resolved:r(t.mode,{width:t.width,height:t.height,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}),normalizedMargin:l(()=>e(t.margin),[t.margin])}}function o(e){let o=t(e),{resolved:n,normalizedMargin:r}=o,a=i({responsive:e.responsive,data:e.data??[],rawData:e.data,colorBy:e.colorBy,colorScheme:e.colorScheme,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,frameLegend:e.frameLegend,selection:e.selection,linkedHover:e.linkedHover,hoverHighlight:e.hoverHighlight,fallbackFields:"string"==typeof e.colorBy?[e.colorBy]:[],unwrapData:e.unwrapData,onObservation:e.onObservation,onClick:e.onClick,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:e.chartTypeLabel,chartId:e.chartId,showLegend:n.showLegend,legend:e.legend,userMargin:r,marginDefaults:n.marginDefaults,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,width:n.width,height:n.height});return{...o,safeData:a.data,setup:a,earlyReturn:a.earlyReturn}}import{c as n,b as i}from"./c-DMDFJQU4.min.js";import{bK as r}from"./c-62UTMRQE.min.js";import{useRef as a,useMemo as l}from"react";export{e as a,t as b,o as c};
@@ -0,0 +1 @@
1
+ function e(e){let a={};if(null==e||"object"!=typeof e)return a;for(let[t,r]of Object.entries(e))t.startsWith("_")||null==r||""===r||("number"==typeof r?Number.isFinite(r)&&(a[t]=r):"string"==typeof r?a[t]=r:"boolean"==typeof r?a[t]=String(r):r instanceof Date&&(a[t]=r.toISOString().slice(0,10)));return a}function a(e){return e&&"object"==typeof e?e:{}}function t(e){return a(e.accessibility).tableFields??e.accessibleDatum??e.datum}function r(r,i){let o=a(r.accessibility);return{label:"string"==typeof o.label&&o.label.length>0?o.label:"string"==typeof r.label&&r.label.length>0?r.label:i,values:{...r.navParentId?{group:r.navParentId}:{},...e(t(r))}}}function i(e){let a= new Set;if(!e.some(e=>e&&("point"===e.type||"symbol"===e.type||"glyph"===e.type)))return a;for(let t of e)if(t&&["line","area","boxplot","violin"].includes(String(t.type))&&Array.isArray(t.datum))for(let e of t.datum)a.add(e);return a}function o(e){if(!Array.isArray(e))return 0;let a=i(e),r=0;for(let i of e)if(i&&"object"==typeof i&&null!==i.datum)switch(i.type){case"point":case"symbol":case"glyph":a.has(i.datum)||r++;break;case"line":case"area":{let e=t(i);r+=Array.isArray(e)?e.length:null!=e&&"object"==typeof e?1:0;break}case"boxplot":case"violin":{let e=t(i);r+=Array.isArray(e)?e.length+1:1;break}case"rect":case"heatcell":case"wedge":case"circle":case"arc":case"candlestick":case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":case"geoarea":r++}return r}function l(r){let o=[];if(!Array.isArray(r))return o;let l=i(r);for(let i of r)if(i&&"object"==typeof i&&null!==i.datum)try{switch(i.type){case"point":case"symbol":case"glyph":if(l.has(i.datum))break;o.push({label:"Point",values:e(t(i))});break;case"line":case"area":{let a=t(i),r=Array.isArray(a)?a:null!=a&&"object"==typeof a?[a]:[],l="line"===i.type?"Line point":"Area point";for(let a of r)o.push({label:l,values:e(a)});break}case"boxplot":case"violin":{let a=t(i),r="boxplot"===i.type?"Boxplot":"Distribution",l="string"==typeof i.category?{category:i.category}:{};if(Array.isArray(a)){o.push({label:r,values:{...l,...e(i.stats)}});for(let t of a)o.push({label:`${r} observation`,values:{...l,...e(t)}})}else o.push({label:r,values:{...l,...e(a)}});break}case"rect":{let a=t(i),r=null!=a&&"object"==typeof a?a:{},l=r.category??i.group??"",s=r.value??r.__aggregateValue??r.total,c=e(r);null==c.category&&""!==l&&(c.category=String(l)),null==c.value&&null!=s&&(c.value="number"==typeof s||"string"==typeof s?s:String(s)),o.push({label:"Bar",values:c});break}case"heatcell":{let a=e(t(i));null==a.value&&"number"==typeof i.value&&Number.isFinite(i.value)&&(a.value=i.value),o.push({label:"Cell",values:a});break}case"wedge":{let r=t(i),l=e(r);if(null==l.category){let e=a(r),t=e.category??e.label;null!=t&&(l.category=String(t))}o.push({label:"Wedge",values:l});break}case"circle":o.push({label:"Node",values:e(t(i))});break;case"arc":o.push({label:"Arc",values:e(t(i))});break;case"candlestick":o.push({label:"Candlestick",values:e(t(i))});break;case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":o.push({label:"Connection",values:e(t(i))});break;case"geoarea":{let r=a(t(i)),l={...e(r.properties),...e(r)};o.push({label:"Region",values:l});break}}}catch{}return o}function s(e,a,t=`${a}s`){return`${e} ${1===e?a:t}`}var c="semiotic-accessible-data-table",n=`${c} semiotic-accessible-data-table-hidden`,b=`${c} semiotic-accessible-data-table-visible`,d=`${b} semiotic-accessible-data-table-network`,u={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},p={position:"absolute",top:0,left:0,right:0,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",padding:"14px 16px 12px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontFamily:"var(--semiotic-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)",fontSize:13,lineHeight:1.5,color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",borderRadius:"var(--semiotic-border-radius, 0px) var(--semiotic-border-radius, 0px) 0 0"},f={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},m={position:"absolute",top:10,right:10,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",cursor:"pointer",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:13,lineHeight:1,padding:0,borderRadius:"var(--semiotic-border-radius, 4px)"},v={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},g={textAlign:"left",padding:"5px 10px",borderBottom:"2px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))"},y={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},x={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},h={marginTop:8,padding:"4px 10px",fontSize:12,cursor:"pointer",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",borderRadius:"var(--semiotic-border-radius, 4px)",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",fontFamily:"inherit"};export{e as a,t as b,r as c,o as d,l as e,n as f,b as g,d as h,u as i,p as j,f as k,m as l,v as m,g as n,y as o,x as p,h as q,s as r};
@@ -0,0 +1 @@
1
+ import{e as l}from"./c-YSMCBJOI.min.js";import{c,b as u}from"./c-DMDFJQU4.min.js";import{a as f,g as m,f as p}from"./c-4OVDIXAR.min.js";import{e as y,j as d,l as h,m as g}from"./c-AMQAAW7G.min.js";import{j as v}from"./c-ZYMXDR42.min.js";import{T as b,J as A,G as x,I as S,R as k}from"./c-OBBSIOYU.min.js";import{bQ as w,an as D,bW as B,bK as L,b as C,be as O,v as R,bM as G,aP as j,aR as P,ba as _}from"./c-62UTMRQE.min.js";import{f as F}from"./c-C7TT4J7K.min.js";import{e as H}from"./c-ZP6O6UHV.min.js";import{r as M,n as W}from"./c-WPL6PGP3.min.js";import{E as I,D as T}from"./c-B3X2IJRQ.min.js";import{d as N}from"./c-5PCO2P5Q.min.js";import{useMemo as E,useState as K,useEffect as Q,forwardRef as U,useRef as X,useCallback as z}from"react";import{jsx as J}from"react/jsx-runtime";function Y(){y(d),y(h),y(g)}function $(e){let{colorBy:t,colorScale:o,color:r,pointRadius:a=5,radiusFn:i,fillOpacity:n=1,fallbackFill:s,baseStyleExtras:l,stroke:c,strokeWidth:u,opacity:f,effectiveSelectionHook:m,resolvedSelection:p,colorDatumAccessor:y,selectionDatumAccessor:d,styleRules:h,ruleContext:g}=e,v=E(()=>e=>{let c="function"==typeof l?l(e):l,u=c?{...c}:{};if(void 0===u.fillOpacity&&(u.fillOpacity=n),void 0===u.fill)if(t){if(o){let r=y?y(e):e;u.fill=M(r,t,o)}}else u.fill=s?s(e):r||W;return void 0===u.r&&(u.r=i?i(e):a),h&&h.length>0&&Object.assign(u,w(e,h,g?g(e):{value:void 0})),u},[t,o,r,a,i,n,s,l,y,h,g]),A=E(()=>b(v,{stroke:c,strokeWidth:u,opacity:f}),[v,c,u,f]);return E(()=>F(A,m??null,p,d),[A,m,p,d])}function q(e){let{lineWidth:t=2,colorBy:o,colorScale:r,color:a,resolveStroke:i,fillArea:n,areaOpacity:s=.3,stroke:l,strokeWidth:c,opacity:u,effectiveSelectionHook:f,resolvedSelection:m,styleRules:p,ruleContext:y}=e,d=E(()=>function(e){let{lineWidth:t=2,colorBy:o,colorScale:r,color:a,resolveStroke:i,fillArea:n,areaOpacity:s=.3,styleRules:l,ruleContext:c}=e;return(e,u)=>{let f,m={strokeWidth:t},p=!0===n||Array.isArray(n)&&null!=u&&n.includes(u);return i?f=i(e,u):o?r&&(f=M(e,o,r)):f=a||W,void 0!==f&&(m.stroke=f,p&&(m.fill=f,m.fillOpacity=s)),l?.length&&Object.assign(m,w(e,l,c?c(e,u):{value:void 0,category:u})),m}}({lineWidth:t,colorBy:o,colorScale:r,color:a,resolveStroke:i,fillArea:n,areaOpacity:s,styleRules:p,ruleContext:y}),[t,o,r,a,i,n,s,p,y]),h=E(()=>b(d,{stroke:l,strokeWidth:c,opacity:u}),[d,l,c,u]);return E(()=>F(h,f??null,m),[h,f,m])}async function V(){return t||(t=await(import("./c-PX2XTYMN.min.js"))),t}function Z(e){let{data:t,xAccessor:i,yAccessor:n,groupBy:s}=e,l=D(e.forecast),c=D(e.anomaly),u="string"==typeof i?i:r,f="string"==typeof n?n:a,m=E(()=>{if(!l&&!c)return t;let e="function"==typeof i,o="function"==typeof n;return e||o?t.map(t=>{let s={...t};return e&&(s[r]=i(t)),o&&(s[a]=n(t)),s}):t},[t,l,c,i,n]),p=E(()=>({overlayData:m,forecast:l,anomaly:c,xAccessorKey:u,yAccessorKey:f,groupBy:s}),[m,l,c,u,f,s]),[y,d]=K(null);Q(()=>{if(!l&&!c)return void d(null);let e=!1;return(l?async function(...e){return(await V()).buildForecast(...e)}(m,u,f,s?{...l,_groupBy:s}:l,c):async function(...e){return(await V()).buildAnomalyAnnotations(...e)}(c).then(e=>({processedData:m,annotations:e}))).then(t=>{e||d({request:p,result:t,hasForecast:!!l})}).catch(t=>{e||("production"!==process.env.NODE_ENV&&console.warn("[Semiotic] Unable to compute statistical overlays:",t),d(null))}),()=>{e=!0}},[p,m,l,c,u,f,s]);let h=y?.request===p?y:null;return{effectiveData:h?.result.processedData??t,statisticalAnnotations:h?.result.annotations??o,hasForecast:h?.hasForecast??!1,xAccessorKey:u,yAccessorKey:f}}function ee(e,{lineDataAccessor:t,groupAccessor:o,lineBy:r,segmentField:a}){let i=new Map;for(let n of e){let e="function"==typeof o?o(n):n[o],s=String(e),l=i.get(s);l||(l={[t]:[]},"string"==typeof o&&(l[o]=e),a&&(l[a]=n[a],"string"==typeof r&&(l[r]=n[r])),i.set(s,l)),l[t].push(n)}return[...i.values()]}function te(e,t){if(!t)return e;let o=new Set(e),r=[];for(let[e,a]of t.seriesOf)o.has(a)&&r.push(e);return r}function oe(e,t){if(!t)return e;let o=e.tooltipContent,r=e=>{let r=e?.allSeries;return o(Array.isArray(r)?{...e,allSeries:r.map(e=>({...e,group:t.seriesOf.get(e.group)??e.group}))}:e)};return{...e,tooltipContent:I(o)?T(r):r}}var e="__forecastSegment",t=null,o=[],r="__semiotic_resolvedX",a="__semiotic_resolvedY",i="__lineObjectSeries",n=e=>e.parentLine||e,s=/*#__PURE__*/B(/*#__PURE__*/U(function(t,o){Y();let r=X(null);c(o,{variant:"xy",frameRef:r});let a=L(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:s,margin:y,className:d,xFormat:h,yFormat:g,axisExtent:b,xAccessor:w="x",yAccessor:D="y",lineBy:B,lineDataAccessor:F="coordinates",colorBy:M,colorScheme:I,styleRules:T,curve:U="linear",showPoints:re=!1,pointRadius:ae=3,fillArea:ie=!1,areaOpacity:ne=.3,lineWidth:se=2,lineGradient:le,tooltip:ce,pointIdAccessor:ue,annotations:fe,directLabel:me,gapStrategy:pe="break",anomaly:ye,forecast:de,band:he,xExtent:ge,yExtent:ve,frameProps:be={},selection:Ae,linkedHover:xe,linkedBrush:Se,brush:ke,onBrush:we,onObservation:De,onClick:Be,hoverHighlight:Le,hoverRadius:Ce,chartId:Oe,loading:Re,loadingContent:Ge,emptyContent:je,legendInteraction:Pe,legendPosition:_e,legend:Fe,xScaleType:He,yScaleType:Me,color:We,stroke:Ie,strokeWidth:Te,opacity:Ne}=t,{legend:Ee,...Ke}=be,Qe=E(()=>H(Ee,Fe),[Ee,Fe]),{width:Ue,height:Xe,enableHover:ze,showGrid:Je,showLegend:Ye,title:$e,description:qe,summary:Ve,accessibleTable:Ze,xLabel:et,yLabel:tt}=a,ot=E(()=>C(s),[s]),rt=Array.isArray(ot[0]?.[F])?ot[0][F]:ot;O("LineChart",rt,"xAccessor",w),O("LineChart",rt,"yAccessor",D);let{effectiveData:at,statisticalAnnotations:it,hasForecast:nt,xAccessorKey:st,yAccessorKey:lt}=Z({data:ot,xAccessor:w,yAccessor:D,forecast:de,anomaly:ye,groupBy:B}),ct=nt?st:w,ut=nt?lt:D,ft="__compoundGroup",mt=!(!de||!B),pt=mt?ft:de?e:B,yt=E(()=>{if(!mt)return at;let t="function"==typeof B?B:e=>e[B];return at.map(o=>{let r={...o};return r[ft]=`${t(o)}__${o[e]||"observed"}`,r})},[at,mt,B]),dt=mt?yt:at,ht=M||B,gt=E(()=>function(e,t,o){if(!o)return;let r=[t,o.upperBounds??"__forecastUpper",o.lowerBounds??"__forecastLower"].map(e=>"function"==typeof e?e:t=>t[e]),a=!(!o.upperBounds&&!o.lowerBounds),i=1/0,n=-1/0;for(let t of e){let e=r[1](t),o=r[2](t);(null!=e||null!=o)&&(a=!0);for(let a of[Number(r[0](t)),e,o])"number"==typeof a&&Number.isFinite(a)&&(i=Math.min(i,a),n=Math.max(n,a))}return a&&i<=n?[i,n]:void 0}(at,ut,de),[de,at,ut]),vt=z(e=>{let t="function"==typeof ct?ct(e):e[ct],o="function"==typeof ut?ut(e):e[ut];return null==t||null==o||Number.isNaN(t)||Number.isNaN(o)},[ct,ut]),bt=void 0!==dt[0]?.[F],At=bt?i:pt,xt=E(()=>bt?dt.map((e,t)=>{let o="function"==typeof B?B(e):"string"==typeof B?e[B]:void 0,r=null==o?`line-${t}`:String(o),a=Array.isArray(e[F])?e[F]:[];return{...e,[i]:r,[F]:a.map(t=>({...t,[i]:r,parentLine:e,..."string"==typeof B&&void 0!==e[B]?{[B]:e[B]}:{}}))}}):pt?ee(dt,{lineDataAccessor:F,groupAccessor:pt,lineBy:B,segmentField:mt?e:void 0}):[{[F]:dt}],[bt,pt,F,dt,B,mt]),{lines:St,hasGaps:kt,segments:wt}=E(()=>function({lineData:e,strategy:t,lineDataAccessor:o,isGap:r,yField:a,seriesOfLine:i}){let n=e=>e[o]||[];if("interpolate"===t){let t=!1,a=[];for(let i of e){let e=n(i).filter(e=>!r(e)||(t=!0,!1));e.length>0&&a.push({...i,[o]:e})}return{lines:a,hasGaps:t}}if("zero"===t){if(!a)return{lines:e,hasGaps:e.some(e=>n(e).some(r))};let t=!1;return{lines:e.map(e=>({...e,[o]:n(e).map(e=>r(e)?(t=!0,{...e,[a]:0}):e)})),hasGaps:t}}if(!e.some(e=>n(e).some(r)))return{lines:e,hasGaps:!1};let s=[],l=new WeakMap,c=new Map;return e.forEach((e,t)=>{let a=i(e),u=[],f=0,m=()=>{if(0===u.length)return;let r={...e,[o]:u},i=`seg:${t}:${f}`;l.set(r,i),c.set(i,a),s.push(r),u=[],f++};for(let t of n(e))r(t)?m():u.push(t);m()}),{lines:s,hasGaps:!0,segments:{keyOf:l,seriesOf:c}}}({lineData:xt,strategy:pe,lineDataAccessor:F,isGap:vt,yField:"string"==typeof ut?ut:void 0,seriesOfLine:e=>{if(!At)return"";let t=e[F]?.[0],o="string"==typeof At?e[At]:t?At(t):void 0;return null==o?"":String(o)}}),[xt,pe,F,vt,At,ut]),Dt=E(()=>"zero"===pe&&"function"==typeof ut?e=>vt(e)?0:ut(e):ut,[ut,pe,vt]),Bt="object"==typeof me?me:{},Lt=Bt.position||"end",Ct=Bt.fontSize||11,Ot=(!me||void 0!==Ye)&&Ye,Rt=u({responsive:t,data:at,rawData:s,colorBy:ht,colorScheme:I,legendInteraction:Pe,legendPosition:_e,frameLegend:Ke,selection:Ae,linkedHover:xe,fallbackFields:ht?["string"==typeof ht?ht:""]:[],unwrapData:!1,onObservation:De,onClick:Be,hoverHighlight:Le,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"LineChart",chartId:Oe,showLegend:Ot,legend:Qe,userMargin:y,marginDefaults:a.marginDefaults,loading:Re,loadingContent:Ge,emptyContent:je,width:Ue,height:Xe,hasTitle:!!$e,axisChrome:R(be,{showAxes:a.showAxes,xLabel:et,yLabel:tt})}),Gt=Rt.categoryColorScale,jt=Rt.effectiveSelectionHook,Pt=Rt.resolvedSelection,_t=Rt.customHoverBehavior,Ft=Rt.customClickBehavior,Ht=Rt.crosshairProps,Mt=E(()=>{if(ht)return bt?e=>{let t=e.parentLine||e;return"function"==typeof ht?ht(t):t[ht]}:ht},[ht,bt]),Wt=E(()=>G(ct,Dt),[ct,Dt]),It=q({lineWidth:se,colorBy:Mt,colorScale:Gt,color:We,fillArea:ie,areaOpacity:ne,stroke:Ie,strokeWidth:Te,opacity:Ne,effectiveSelectionHook:jt,resolvedSelection:Pt,styleRules:T,ruleContext:Wt}),[Tt,Nt]=K(null);Q(()=>{if(!de)return void Nt(null);let e=!1;return async function(...e){return(await V()).createSegmentLineStyle(...e)}(It,de).then(t=>{e||Nt(()=>t)}).catch(()=>{e||Nt(null)}),()=>{e=!0}},[It,de]);let Et=Tt||It,Kt=$({colorBy:ht,colorScale:Gt,color:We,pointRadius:ae,colorDatumAccessor:n,selectionDatumAccessor:N,effectiveSelectionHook:jt,resolvedSelection:Pt}),Qt=Array.isArray(ie)?"mixed":ie?"area":"line",Ut=E(()=>{if(!me||!ht)return[];let e={position:Lt,fontSize:Ct,colorBy:ht,color:e=>Gt?.(e)??W};return void 0===s?[{type:"text",_directLabelRequest:e}]:f(St.flatMap(e=>(e[F]||[]).map(t=>({...t,parentLine:t.parentLine||e}))),e,ct,Dt)},[s,me,ht,Gt,St,F,ct,Dt,Lt,Ct]),Xt=E(()=>{if(!me)return Rt.margin;let e="end"===Lt?"right":"left";if("number"==typeof y||"number"==typeof y?.[e])return Rt.margin;let t=(void 0===s?Rt.allCategories:Ut.map(e=>String(e.label))).reduce((e,t)=>Math.max(e,Array.from(t).length*Ct*.65),0);return{...Rt.margin,[e]:Math.max(Rt.margin[e],t+10)}},[s,me,Ut,Lt,Ct,y,Rt.margin,Rt.allCategories]),zt=B||M,Jt=E(()=>A([{label:et||x(w),accessor:ct,role:"x",format:h},{label:tt||x(D),accessor:Dt,role:"y",format:g},...zt?[{label:x(zt),accessor:zt,role:"group"}]:[],...S(he,g)]),[ct,Dt,w,D,et,tt,zt,h,g,he]),Yt=bt?at[0]?.[F]||[]:s,$t=l({componentName:"LineChart",data:Yt,accessors:{xAccessor:w,yAccessor:D}}),{brushStreamProps:qt}=m({brush:ke,onBrush:we,linkedBrush:Se,xAccessor:ct,yAccessor:Dt,defaultDimension:"x"}),{flattenedData:Vt,segmentGroupAccessor:Zt}=E(()=>{if(!(bt||At||kt))return{flattenedData:dt,segmentGroupAccessor:void 0};let e=wt?new WeakMap:void 0;return{flattenedData:St.flatMap(t=>{let o=t[F]||[],r=At&&"string"==typeof At?o.map(e=>({...e,[At]:e[At]??t[At]})):o,a=wt?.keyOf.get(t);if(e&&void 0!==a)for(let t of r)e.set(t,a);return r}),segmentGroupAccessor:e?t=>e.get(t)??"":void 0}},[St,F,bt,At,dt,kt,wt]),eo=E(()=>function(e,t){return t?(o,r)=>e(o,void 0===r?r:t.seriesOf.get(r)??r):e}(Et,wt),[Et,wt]),to=v(le),oo={chartType:Qt,...Array.isArray(ie)&&{areaGroups:te(ie,wt)},...to&&{lineGradient:to},...null!=s&&{data:Vt},xAccessor:ct,yAccessor:Dt,xScaleType:He,yScaleType:Me,...ge&&{xExtent:ge},...!ve||null==ve[0]&&null==ve[1]?gt?{yExtent:gt}:{}:{yExtent:ve},groupAccessor:Zt??(At||void 0),...he&&{band:he},curve:U,lineStyle:eo,...re&&{pointStyle:Kt},size:[Ue,Xe],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,...void 0!==t.maxDevicePixelRatio&&{maxDevicePixelRatio:t.maxDevicePixelRatio},margin:Xt,showAxes:a.showAxes,xLabel:et,yLabel:tt,xFormat:h,yFormat:g,...void 0!==b&&{axisExtent:b},...void 0!==t.autoPlaceAnnotations&&{autoPlaceAnnotations:t.autoPlaceAnnotations},enableHover:ze,showGrid:Je,...Rt.legendBehaviorProps,...$e&&{title:$e},...qe&&{description:qe},...Ve&&{summary:Ve},...void 0!==Ze&&{accessibleTable:Ze},...d&&{className:d},...null!=t.animate&&{animate:t.animate},...oe(j({tooltip:ce,defaultTooltipContent:Jt,multiDefaultContent:P({xFormat:h,yFormat:g})}),wt),...k({linkedHover:xe,selection:Ae,onObservation:De,onClick:Be,hoverRadius:Ce,hoverHighlight:Le,mobileInteraction:Rt.mobileInteraction,customHoverBehavior:_t,customClickBehavior:Ft}),...ue&&{pointIdAccessor:ue},...(fe?.length||it.length||Ut.length)&&{annotations:[...fe||[],...it,...Ut]},...Ht,...qt,...Ke};return Rt.earlyReturn?Rt.earlyReturn:$t?J(_,{componentName:"LineChart",message:$t,width:Ue,height:Xe}):J(p,{ref:r,...oo})}),"LineChart");export{$ as a,Z as b,Y as c,q as d,ee as e,s as f};
@@ -1 +1 @@
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(n={},r){let i,{background:a="transparent",stroke:l="#000",lineWidth:o=1.5,spacing:s=6,angle:u=45,lineOpacity:c=1}=n,f={background:a,stroke:l,lineWidth:o,spacing:s,angle:u,lineOpacity:c},d=t(s),p=function(){let t=typeof window<"u"&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,t))}(),h=Math.max(1,Math.round(d.width*p)),m=Math.max(1,Math.round(d.height*p));try{y=h,g=m,i=typeof OffscreenCanvas<"u"?new OffscreenCanvas(y,g):(B||(B=document.createElement("canvas")),B.width=y,B.height=g,B)}catch{return e(f)}var y,g;let b=i.getContext("2d");if(!b)return e(f);!function(t,e,n,r){e&&"transparent"!==e&&"none"!==e?(t.fillStyle=e,t.fillRect(0,0,n,r)):t.clearRect(0,0,n,r)}(b,a,h,m);let v=m/d.height,k=Math.max(0,o)*v;b.save(),b.globalAlpha=Math.min(1,Math.max(0,c)),b.fillStyle=l,b.fillRect(0,d.lineY*v-k/2,h,k),b.restore();let w=(r||b).createPattern(i,"repeat");if(!w)return w;let M=u*Math.PI/180,x=Math.cos(M),O=Math.sin(M),S=d.width/h,W=d.height/m;return w.setTransform?.({a:x*S,b:O*S,c:-O*W,d:x*W,e:0,f:0}),w}function r(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 i(t){let e=typeof document>"u"?void 0:document.fonts;if(!e||"function"!=typeof e.addEventListener)return()=>{};let n=e=>{(function(t){return 0!==t.fontfaces?.length})(e)&&t()};return e.addEventListener("loadingdone",n),()=>e.removeEventListener("loadingdone",n)}function a(){if(G||typeof window>"u"||typeof document>"u")return;G=!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 J){let i=r.getElement();i&&(!t||t.some(t=>e(t,i)))&&n.push(r)}if(!t||0!==n.length){q++;for(let t of n)t.listener()}};if(typeof MutationObserver<"u"&&document.documentElement&&(U=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{X=window.matchMedia("(prefers-color-scheme: dark)"),D=()=>n(),"function"==typeof X.addEventListener?X.addEventListener("change",D):"function"==typeof X.addListener&&X.addListener(D)}catch{}H=i(()=>n())}function l(t,e){a();let n={getElement:t,listener:e};return J.add(n),()=>{J.delete(n)&&0===J.size&&(U?.disconnect(),U=null,X&&D&&("function"==typeof X.removeEventListener?X.removeEventListener("change",D):"function"==typeof X.removeListener&&X.removeListener(D)),X=null,D=null,H?.(),H=null,G=!1)}}function o(t,e){if(!e)return e;let n=function(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}(e);if(!n)return e;let r=()=>n.fallback?o(t,n.fallback):e,i=t.canvas;if(!i)return r();let a=T.get(i);(!a||a.version!==q)&&(a={version:q,map:new Map},T.set(i,a));let l=a.map.get(e);if(void 0!==l)return l;let s=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||e;return a.map.set(e,s),s}function s(t){q++}function u(){return q}function c(t){return"object"==typeof t&&null!==t&&"hatch"===t.type}function f(t){return["hatch",t.background??"transparent",t.stroke??"#000",t.lineWidth??1.5,t.spacing??6,t.angle??45,t.lineOpacity??1].join("|")}function d(t,e){return`${t}-hatch-${r(f(e)).toString(36)}`}function p(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);return E("pattern",{id:n,width:u.width,height:u.height,patternUnits:"userSpaceOnUse",patternTransform:0!==o?`rotate(${o})`:void 0,children:[r&&"transparent"!==r&&"none"!==r&&C("rect",{width:u.width,height:u.height,fill:r}),C("line",{x1:0,y1:u.lineY,x2:u.width,y2:u.lineY,stroke:i,strokeWidth:a,...1!==s?{strokeOpacity:s}:{}})]},n)}function h(t,e,n="#4e79a7"){if(c(t)){let n=d(e,t);return{fill:`url(#${n})`,def:p(t,n)}}return t&&"string"==typeof t?{fill:t}:{fill:n}}function m(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 y(t,e,n,r){let i=m(t,n,r);if(!i)return;let{direction:a,stops:l}=i,o=`${e}-gradient`;return{fill:`url(#${o})`,def:C("linearGradient",{id:o,x1:0,y1:0,x2:"horizontal"===a?"100%":0,y2:"vertical"===a?"100%":0,children:l.map((t,e)=>C("stop",{offset:100*t.offset+"%",stopColor:t.color,stopOpacity:t.opacity},`${t.offset}-${e}`))},o)}}function g(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 b(t){switch(t){case"monotoneX":return I;case"monotoneY":return z;case"cardinal":return V;case"catmullRom":return Y;case"step":return F;case"stepBefore":return R;case"stepAfter":return P;case"basis":return N;case"natural":return j;default:return null}}function v(t){return"string"==typeof t&&"none"===t.trim().toLowerCase()}function k(t,e,r){return v(e)?Q:null==e?r:c(e)?function(t,e){let r=t.background??"transparent",i=t.stroke??"#000",a="transparent"===r||"none"===r?r:o(e,r)||r,l=o(e,i)||i||"#000",s=typeof window<"u"&&window.devicePixelRatio||1,u=`${f(t)}|${a}|${l}@${s}`,d=K.get(u);if(void 0!==d)return d;let p=n({background:a,stroke:l,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle,lineOpacity:t.lineOpacity},e),h=c(p)?null:p;return K.set(u,h),h}(e,t)||e.background&&o(t,e.background)||r:"string"!=typeof e?e:o(t,e)||r}function w(t,e,n){let r=k(t,e,n);if("string"==typeof r&&r.trim().startsWith("var(")){let e=o(t,n);return e&&!e.trim().startsWith("var(")?e:n}return r}function M(t,e){if(null==e)return;let n=k(t,e,"");return""===n?void 0:n}function x(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)),O(t,e,n));return s}function O(t,e,n){let r=e.color??n,i=o(t,r)||r;if(null==e.opacity)return i;let a=Math.max(0,Math.min(1,e.opacity)),[l,s,u]=g(t,i);return`rgba(${l},${s},${u},${a})`}function S(t,e=0){return!(e>0||0!==t.opacity&&(t.fill&&"transparent"!==t.fill||t.stroke&&"none"!==t.stroke&&"transparent"!==t.stroke))}function W(t,e,n,r){if(!e.fill||v(e.fill))return;let i=t.globalAlpha;t.fillStyle=k(t,e.fill,n),void 0!==e.fillOpacity&&(t.globalAlpha=(e.opacity??i)*e.fillOpacity),r(),t.globalAlpha=i}function $(t,e,n){if(!e.stroke||v(e.stroke))return;let r=t.globalAlpha;t.strokeStyle=o(t,e.stroke)||e.stroke,t.lineWidth=e.strokeWidth??1,t.globalAlpha=(e.opacity??r)*(e.strokeOpacity??1),n(),t.globalAlpha=r}function A(t){return(t.tl??0)>0||(t.tr??0)>0||(t.br??0)>0||(t.bl??0)>0}function L(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)}}import{jsxs as E,jsx as C}from"react/jsx-runtime";import{curveNatural as j,curveBasis as N,curveStepAfter as P,curveStepBefore as R,curveStep as F,curveCatmullRom as Y,curveCardinal as V,curveMonotoneY as z,curveMonotoneX as I}from"d3-shape";var B=null,T=/*#__PURE__*/new WeakMap,q=0,G=!1,U=null,X=null,D=null,H=null,J=/*#__PURE__*/new Set,K=/*#__PURE__*/new Map,Q="rgba(0,0,0,0)";export{i as a,l as b,o as c,s as d,u as e,g as f,r as g,n as h,c as i,d as j,p as k,h as l,m,y as n,b as o,v as p,k as q,w as r,M as s,x as t,S as u,W as v,$ as w,A as x,L as y};
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(n={},r){let i,{background:a="transparent",stroke:l="#000",lineWidth:o=1.5,spacing:s=6,angle:u=45,lineOpacity:c=1}=n,f={background:a,stroke:l,lineWidth:o,spacing:s,angle:u,lineOpacity:c},d=t(s),p=function(){let t=typeof window<"u"&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,t))}(),h=Math.max(1,Math.round(d.width*p)),m=Math.max(1,Math.round(d.height*p));try{y=h,g=m,i=typeof OffscreenCanvas<"u"?new OffscreenCanvas(y,g):(B||(B=document.createElement("canvas")),B.width=y,B.height=g,B)}catch{return e(f)}var y,g;let b=i.getContext("2d");if(!b)return e(f);!function(t,e,n,r){e&&"transparent"!==e&&"none"!==e?(t.fillStyle=e,t.fillRect(0,0,n,r)):t.clearRect(0,0,n,r)}(b,a,h,m);let v=m/d.height,k=Math.max(0,o)*v;b.save(),b.globalAlpha=Math.min(1,Math.max(0,c)),b.fillStyle=l,b.fillRect(0,d.lineY*v-k/2,h,k),b.restore();let w=(r||b).createPattern(i,"repeat");if(!w)return w;let M=u*Math.PI/180,x=Math.cos(M),O=Math.sin(M),S=d.width/h,W=d.height/m;return w.setTransform?.({a:x*S,b:O*S,c:-O*W,d:x*W,e:0,f:0}),w}function r(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 i(t){let e=typeof document>"u"?void 0:document.fonts;if(!e||"function"!=typeof e.addEventListener)return()=>{};let n=e=>{(function(t){return 0!==t.fontfaces?.length})(e)&&t()};return e.addEventListener("loadingdone",n),()=>e.removeEventListener("loadingdone",n)}function a(){if(G||typeof window>"u"||typeof document>"u")return;G=!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 J){let i=r.getElement();i&&(!t||t.some(t=>e(t,i)))&&n.push(r)}if(!t||0!==n.length){q++;for(let t of n)t.listener()}};if(typeof MutationObserver<"u"&&document.documentElement&&(U=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{X=window.matchMedia("(prefers-color-scheme: dark)"),D=()=>n(),"function"==typeof X.addEventListener?X.addEventListener("change",D):"function"==typeof X.addListener&&X.addListener(D)}catch{}H=i(()=>n())}function l(t,e){a();let n={getElement:t,listener:e};return J.add(n),()=>{J.delete(n)&&0===J.size&&(U?.disconnect(),U=null,X&&D&&("function"==typeof X.removeEventListener?X.removeEventListener("change",D):"function"==typeof X.removeListener&&X.removeListener(D)),X=null,D=null,H?.(),H=null,G=!1)}}function o(t,e){if(!e)return e;let n=function(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}(e);if(!n)return e;let r=()=>n.fallback?o(t,n.fallback):e,i=t.canvas;if(!i)return r();let a=T.get(i);(!a||a.version!==q)&&(a={version:q,map:new Map},T.set(i,a));let l=a.map.get(e);if(void 0!==l)return l;let s=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||e;return a.map.set(e,s),s}function s(t){q++}function u(){return q}function c(t){return"object"==typeof t&&null!==t&&"hatch"===t.type}function f(t){return["hatch",t.background??"transparent",t.stroke??"#000",t.lineWidth??1.5,t.spacing??6,t.angle??45,t.lineOpacity??1].join("|")}function d(t,e){return`${t}-hatch-${r(f(e)).toString(36)}`}function p(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);return E("pattern",{id:n,width:u.width,height:u.height,patternUnits:"userSpaceOnUse",patternTransform:0!==o?`rotate(${o})`:void 0,children:[r&&"transparent"!==r&&"none"!==r&&C("rect",{width:u.width,height:u.height,fill:r}),C("line",{x1:0,y1:u.lineY,x2:u.width,y2:u.lineY,stroke:i,strokeWidth:a,...1!==s?{strokeOpacity:s}:{}})]},n)}function h(t,e,n="#4e79a7"){if(c(t)){let n=d(e,t);return{fill:`url(#${n})`,def:p(t,n)}}return t&&"string"==typeof t?{fill:t}:{fill:n}}function m(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 y(t,e,n,r){let i=m(t,n,r);if(!i)return;let{direction:a,stops:l}=i,o=`${e}-gradient`;return{fill:`url(#${o})`,def:C("linearGradient",{id:o,x1:0,y1:0,x2:"horizontal"===a?"100%":0,y2:"vertical"===a?"100%":0,children:l.map((t,e)=>C("stop",{offset:100*t.offset+"%",stopColor:t.color,stopOpacity:t.opacity},`${t.offset}-${e}`))},o)}}function g(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 b(t){switch(t){case"monotoneX":return I;case"monotoneY":return z;case"cardinal":return V;case"catmullRom":return Y;case"step":return F;case"stepBefore":return R;case"stepAfter":return P;case"basis":return N;case"natural":return j;default:return null}}function v(t){return"string"==typeof t&&"none"===t.trim().toLowerCase()}function k(t,e,r){return v(e)?Q:null==e?r:c(e)?function(t,e){let r=t.background??"transparent",i=t.stroke??"#000",a="transparent"===r||"none"===r?r:o(e,r)||r,l=o(e,i)||i||"#000",s=typeof window<"u"&&window.devicePixelRatio||1,u=`${f(t)}|${a}|${l}@${s}`,d=K.get(u);if(void 0!==d)return d;let p=n({background:a,stroke:l,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle,lineOpacity:t.lineOpacity},e),h=c(p)?null:p;return K.set(u,h),h}(e,t)||e.background&&o(t,e.background)||r:"string"!=typeof e?e:o(t,e)||r}function w(t,e,n){let r=k(t,e,n);if("string"==typeof r&&r.trim().startsWith("var(")){let e=o(t,n);return e&&!e.trim().startsWith("var(")?e:n}return r}function M(t,e){if(null==e)return;let n=k(t,e,"");return""===n?void 0:n}function x(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)),O(t,e,n));return s}function O(t,e,n){let r=e.color??n,i=o(t,r)||r;if(null==e.opacity)return i;let a=Math.max(0,Math.min(1,e.opacity)),[l,s,u]=g(t,i);return`rgba(${l},${s},${u},${a})`}function S(t,e=0){return!(e>0||0!==t.opacity&&(t.fill&&"transparent"!==t.fill||t.stroke&&"none"!==t.stroke&&"transparent"!==t.stroke))}function W(t,e,n,r){if(!e.fill||v(e.fill))return;let i=t.globalAlpha;t.fillStyle=k(t,e.fill,n),t.globalAlpha=i*(e.opacity??1)*(e.fillOpacity??1),r(),t.globalAlpha=i}function $(t,e,n){if(!e.stroke||v(e.stroke))return;let r=t.globalAlpha;t.strokeStyle=o(t,e.stroke)||e.stroke,t.lineWidth=e.strokeWidth??1,t.globalAlpha=r*(e.opacity??1)*(e.strokeOpacity??1),n(),t.globalAlpha=r}function A(t){return(t.tl??0)>0||(t.tr??0)>0||(t.br??0)>0||(t.bl??0)>0}function L(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)}}import{jsxs as E,jsx as C}from"react/jsx-runtime";import{curveNatural as j,curveBasis as N,curveStepAfter as P,curveStepBefore as R,curveStep as F,curveCatmullRom as Y,curveCardinal as V,curveMonotoneY as z,curveMonotoneX as I}from"d3-shape";var B=null,T=/*#__PURE__*/new WeakMap,q=0,G=!1,U=null,X=null,D=null,H=null,J=/*#__PURE__*/new Set,K=/*#__PURE__*/new Map,Q="rgba(0,0,0,0)";export{i as a,l as b,o as c,s as d,u as e,g as f,r as g,n as h,c as i,d as j,p as k,h as l,m,y as n,b as o,v as p,k as q,w as r,M as s,x as t,S as u,W as v,$ as w,A as x,L as y};
@@ -1 +1 @@
1
- function i({remaining:i,kind:e="row",onClick:o}){return i<=0?null:t("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:o,style:n,children:["Show ",Math.min(25,i)," more ",e,1===i?"":"s"," (",i," remaining)"]})}import{q as n}from"./c-7UN2WUMI.min.js";import{jsxs as t}from"react/jsx-runtime";export{i as a};
1
+ function i({remaining:i,kind:e="row",onClick:o}){return i<=0?null:t("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:o,style:n,children:["Show ",Math.min(25,i)," more ",e,1===i?"":"s"," (",i," remaining)"]})}import{q as n}from"./c-HN5U72U7.min.js";import{jsxs as t}from"react/jsx-runtime";export{i as a};
@@ -1 +1 @@
1
- import{a as e}from"./c-RI7UJTEY.min.js";import{bI as t,bN as i}from"./c-SU6Z75M2.min.js";function r(e){return{...e,bySource:Object.fromEntries(Object.entries(e.bySource).map(([e,t])=>[e,{...t}]))}}var a=class{constructor(e,t={},i=[]){if(this.windowSize=e,this.policy=t,this.windows=new Map,this.openWindows=new Set,this.sources=new Map,this.latest=-1/0,this.frontier=-1/0,this.value=-1/0,this.pending=[],!Number.isFinite(e)||e<=0)throw new RangeError("EventDrop windows.size must be a finite positive number");for(let e of i)this.sources.set(e,{latest:-1/0,arrival:-1/0,idle:!1});this.validatePolicy(t)}validatePolicy(e){if("function"!=typeof e){for(let t of["delay","idleTimeout","allowedLateness"]){let i=e[t];if(null!=i&&(!Number.isFinite(i)||i<0))throw new RangeError(`watermark.${t} must be finite and nonnegative`)}if(null!=e.value&&!Number.isFinite(e.value))throw new RangeError("watermark.value must be finite")}}setWatermark(e){this.validatePolicy(e),this.policy=e}getWatermark(){return this.value}getLatestEventTime(){return this.latest}getArrivalFrontier(){return this.frontier}getLedger(){return Array.from(this.windows.values(),r).sort((e,t)=>e.start-t.start)}drainEvents(){let e=this.pending;return this.pending=[],e}snapshot(){return this.state(this.getLedger())}drainDelta(){let e=Array.from(this.changedWindows??[],e=>r(this.windows.get(e)));return this.changedWindows=new Set,this.state(e)}state(e){return{windows:e,sources:Array.from(this.sources,([e,t])=>[e,{...t}]),latest:this.latest,frontier:this.frontier,value:this.value,heldBy:this.heldBy}}restore(e){this.applySnapshot(e,!0)}applyDelta(e){this.applySnapshot(e,!1)}applySnapshot(e,t){let i=e=>Number.isFinite(e)||e===-1/0,a=e=>Number.isSafeInteger(e)&&e>=0;if(![e.latest,e.frontier,e.value].every(i)||new Set(e.windows.map(e=>e.windowId)).size!==e.windows.length||new Set(e.sources.map(([e])=>e)).size!==e.sources.length||e.sources.some(([,e])=>!i(e.latest)||!i(e.arrival))||e.windows.some(e=>!Number.isFinite(e.start)||!Number.isFinite(e.end)||e.end<=e.start||!a(e.accepted)||!a(e.late)||Object.values(e.bySource).some(e=>!a(e.accepted)||!a(e.late))||Object.values(e.bySource).reduce((e,t)=>e+t.accepted,0)!==e.accepted||Object.values(e.bySource).reduce((e,t)=>e+t.late,0)!==e.late))throw new RangeError("Invalid EventDrop ledger snapshot");t&&(this.windows.clear(),this.openWindows.clear());for(let t of e.windows){let e=this.windows.get(t.windowId);e&&this.openWindows.delete(e);let i=r(t);Object.setPrototypeOf(i.bySource,null),this.windows.set(t.windowId,i),i.open&&this.openWindows.add(i)}this.changedWindows?.clear(),this.sources=new Map(e.sources.map(([e,t])=>[e,{...t}])),this.latest=e.latest,this.frontier=e.frontier,this.value=e.value,this.heldBy=e.heldBy,this.pending=[]}advance(e,t="external"){if(!Number.isFinite(e))return;this.frontier=Math.max(this.frontier,e);let i,r=this.policy;if("function"==typeof r)i=r(this.latest);else if(r.external)i=r.external();else if(null!=r.value)i=r.value;else{let t=this.latest;if(r.perSource){let i;t=1/0;for(let[a,n]of this.sources){Number.isFinite(n.arrival)||(n.arrival=e);let s=null!=r.idleTimeout&&e-n.arrival>=r.idleTimeout;s&&!n.idle&&this.pending.push({type:"physics-source-idle",sourceId:a}),n.idle=s,!s&&n.latest<t&&(t=n.latest,i=a)}i&&i!==this.heldBy&&t<this.latest&&this.pending.push({type:"physics-watermark-held",sourceId:i}),this.heldBy=i,t===1/0&&(t=this.latest)}i=t-(r.delay??this.windowSize)}if(!Number.isFinite(i)||i<=this.value)return;let a=this.value;this.value=i,this.pending.push({type:"physics-watermark-advance",from:a,to:i,cause:t});for(let t of this.openWindows)t.end<=this.value&&this.close(t,e)}close(e,t){this.changedWindows?.add(e.windowId),e.open=!1,e.closedAt=t,e.watermarkAtClose=this.value,this.openWindows.delete(e),this.pending.push({type:"physics-window-close",...r(e),watermark:this.value})}append(e){var t;let{eventTime:i,arrivalTime:a,source:n=""}=e;if(!Number.isFinite(i)||!Number.isFinite(a))throw new RangeError("Event and arrival times must be finite");if(a<this.frontier)throw new RangeError("Incremental admissions require nondecreasing arrival times");this.latest=Math.max(this.latest,i);let s=this.sources.get(n);this.sources.set(n,{latest:Math.max(s?.latest??-1/0,i),arrival:a,idle:!1}),this.advance(a,"arrival");let l=Math.floor(i/this.windowSize)*this.windowSize,o=l+this.windowSize,u=`${l}-${o}`,h=this.windows.get(u);h||(h={windowId:u,start:l,end:o,accepted:0,late:0,bySource:Object.create(null),open:!0},this.windows.set(u,h),this.openWindows.add(h),this.pending.push({type:"physics-window-open",windowId:u,start:l,end:o}));let d=e.watermarkAtArrival??this.value,c=o+("function"==typeof this.policy?0:this.policy.allowedLateness??0)<=d,p=(t=h.bySource)[n]??(t[n]={accepted:0,late:0}),m=c?"late":"accepted";return h[m]++,this.changedWindows?.add(u),p[m]++,!h.open&&!c&&this.pending.push({type:"physics-window-update",windowId:u,accepted:h.accepted,late:h.late,bySource:r(h).bySource,watermark:this.value,retractions:1}),h.open&&o<=this.value&&this.close(h,a),{windowId:u,start:l,end:o,late:c,watermarkAtArrival:d}}};function n(e){let[t,i]=e,r=t<160||i<116,a=r?Math.min(12,Math.max(2,.08*t)):32,n=r?Math.min(8,Math.max(2,.12*i)):24,s=r?n:34;return{width:t,height:i,plot:{x:a,y:n,width:Math.max(1,t-2*a),height:Math.max(1,i-n-s)}}}function s(e){let t=String(e??"");if(!t)return"#4e79a7";let i=["#4e79a7","#59a14f","#e15759","#f28e2b","#76b7b2","#edc948","#b07aa1","#ff9da7"],r=0;for(let e=0;e<t.length;e+=1)r=31*r+t.charCodeAt(e)>>>0;return i[r%i.length]}function l(e,t){return t?(i,r)=>({..."function"==typeof e?e(i,r):e,..."function"==typeof t?t(i,r):t}):e}function o(e,r="#4e79a7",a){let n=a?.styleRules,l=!!n&&n.length>0,o=l?t(a?.valueAccessor):void 0;return t=>{let a=t.datum,u=a&&e?"function"==typeof e?e(a,0):a[e]:void 0,h={fill:null==u?r:s(u),stroke:"#111827",strokeWidth:1,opacity:.9};return l&&a&&Object.assign(h,i(a,n,{value:o?o(a):void 0,category:null==u?void 0:String(u)})),h}}function u(e,t,i,r){return{fixedDt:1/120,maxSubsteps:8,colliders:t,observation:{chartType:i},kernel:{seed:e,gravity:{x:0,y:760},cellSize:36,collisionIterations:6,velocityDamping:.995,restitution:.08,friction:.4,sleepSpeed:8,sleepAfter:.6,...r}}}function h(e,t,i){if(!e.length)return[];let r=n(t),a=r.plot.width/Math.max(1,e.length),s=e.reduce((e,t)=>Math.max(e,t.value),1),l=.62*r.plot.height,o=r.plot.y+r.plot.height;return e.map((e,t)=>{let n=Math.max(8,e.value/s*l),u=r.plot.x+(t+.5)*a,h=o-n/2,d=null==e.secondary?"":`, ${e.secondary} secondary`,c=`${i} ${e.label}: ${e.value}${d}`;return{id:`${i}-${e.label}`,label:c,description:c,datum:e,x:u,y:h,shape:"rect",width:Math.max(12,.58*a),height:n,group:i}})}function d(e,t,i){return"function"==typeof i?i(e,t):e[i]}function c(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function p(e,t,i){return Math.max(t,Math.min(i,e))}function m(e,t){let i=c(e);return null!=i&&i>0?i:t}function w(e){if(!e)return;let t=c(e[0]),i=c(e[1]);return null!=t&&null!=i?t<=i?[t,i]:[i,t]:void 0}function f(e){return String(e??"unknown").trim().replace(/[^A-Za-z0-9_-]+/g,"_")||"unknown"}function v(e,t,i=0){let r=new Set(e.filter(e=>null!=e.id).map(e=>String(e.id))),a=new Map;for(let n of e){let e=null==n.id?`${t}-${i++}`:String(n.id);for(;null==n.id&&r.has(e);)e=`${t}-${i++}`;r.add(e),a.set(e,null==n.id?{...n,id:e}:n)}return{seed:e,rows:Array.from(a.values()),nextId:i}}function g(t={}){let i=(t.categories?.length?t.categories:["Intake","Review","Build","Ship"]).map(e=>String(e).trim()).filter(Boolean),r=i.length?i:["Intake"],a=Math.max(r.length,Math.round(t.count??Math.max(48,12*r.length))),n=m(t.unitValue,1),s=e(t.seed??1),l=t.idPrefix??"mechanical-pile",o=r.map(()=>.65+.9*s()),u=o.reduce((e,t)=>e+t,0)||1,h=a-r.length,d=o.map(e=>e/u*h),c=d.map(e=>1+Math.floor(e)),p=a-c.reduce((e,t)=>e+t,0),w=d.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;p>0;e=(e+1)%w.length)c[w[e].index]+=1,p-=1;return r.map((e,t)=>({id:`${l}-${t}`,category:e,value:c[t]*n,mechanical:!0,unitCount:c[t],unitValue:n,share:c[t]/a}))}function y(e,t){let i=e/t,r=Math.round(i);return Math.ceil(r>0&&Math.abs(i-r)<=Number.EPSILON*i*4?r:i)}function b(t){let i=Math.max(2,Math.round(t.bins)),r=Math.max(1,Math.round(t.pegRows??i-1)),a=Math.max(1,Math.round(t.count??Math.max(64,4*i))),n=p(Number.isFinite(t.branchProbability)?t.branchProbability??.5:.5,0,1),s=e(t.seed??1),l=t.idPrefix??"mechanical";return Array.from({length:a},(e,t)=>{let i=0;for(let e=0;e<r;e+=1)s()<n&&(i+=1);let a=r/2;return{id:`${l}-${t}`,value:i,mechanical:!0,pegRows:r,branchProbability:n,pathRights:i,side:i<a?"left":i>a?"right":"center"}})}function S(e){let{windowSize:t,watermark:i,watermarkAtArrivalAccessor:r}=e;if(!(Number.isFinite(t)&&t>0))throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:n}=v(e.data,"event"),s=n.flatMap((t,i)=>{let r=c(d(t,i,e.timeAccessor));return null==r?[]:[{datum:t,index:i,eventTime:r,arrivalTime:c(d(t,i,e.arrivalAccessor))??r,watermarkAtArrival:0,late:!1}]}),l="function"==typeof i?null:c(i?.value),o="function"==typeof i?t:c(i?.delay)??t,u=new a(t,i,e.sourceIds);for(let t of s.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){let i=r?c(d(t.datum,t.index,r)):null,a=u.append({eventTime:t.eventTime,arrivalTime:t.arrivalTime,source:String(d(t.datum,t.index,e.sourceAccessor??"source")??""),watermarkAtArrival:i??void 0});t.watermarkAtArrival=a.watermarkAtArrival,t.late=a.late}return{events:s,watermarkValue:s.length?u.getWatermark():l??-o,ledger:u.getLedger(),lifecycleEvents:u.drainEvents()}}export{n as a,l as b,o as c,u as d,h as e,d as f,c as g,p as h,m as i,w as j,f as k,v as l,g as m,y as n,b as o,a as p,S as q};
1
+ import{a as e}from"./c-RI7UJTEY.min.js";import{bL as t,bQ as i}from"./c-62UTMRQE.min.js";function r(e){return{...e,bySource:Object.fromEntries(Object.entries(e.bySource).map(([e,t])=>[e,{...t}]))}}var a=class{constructor(e,t={},i=[]){if(this.windowSize=e,this.policy=t,this.windows=new Map,this.openWindows=new Set,this.sources=new Map,this.latest=-1/0,this.frontier=-1/0,this.value=-1/0,this.pending=[],!Number.isFinite(e)||e<=0)throw new RangeError("EventDrop windows.size must be a finite positive number");for(let e of i)this.sources.set(e,{latest:-1/0,arrival:-1/0,idle:!1});this.validatePolicy(t)}validatePolicy(e){if("function"!=typeof e){for(let t of["delay","idleTimeout","allowedLateness"]){let i=e[t];if(null!=i&&(!Number.isFinite(i)||i<0))throw new RangeError(`watermark.${t} must be finite and nonnegative`)}if(null!=e.value&&!Number.isFinite(e.value))throw new RangeError("watermark.value must be finite")}}setWatermark(e){this.validatePolicy(e),this.policy=e}getWatermark(){return this.value}getLatestEventTime(){return this.latest}getArrivalFrontier(){return this.frontier}getLedger(){return Array.from(this.windows.values(),r).sort((e,t)=>e.start-t.start)}drainEvents(){let e=this.pending;return this.pending=[],e}snapshot(){return this.state(this.getLedger())}drainDelta(){let e=Array.from(this.changedWindows??[],e=>r(this.windows.get(e)));return this.changedWindows=new Set,this.state(e)}state(e){return{windows:e,sources:Array.from(this.sources,([e,t])=>[e,{...t}]),latest:this.latest,frontier:this.frontier,value:this.value,heldBy:this.heldBy}}restore(e){this.applySnapshot(e,!0)}applyDelta(e){this.applySnapshot(e,!1)}applySnapshot(e,t){let i=e=>Number.isFinite(e)||e===-1/0,a=e=>Number.isSafeInteger(e)&&e>=0;if(![e.latest,e.frontier,e.value].every(i)||new Set(e.windows.map(e=>e.windowId)).size!==e.windows.length||new Set(e.sources.map(([e])=>e)).size!==e.sources.length||e.sources.some(([,e])=>!i(e.latest)||!i(e.arrival))||e.windows.some(e=>!Number.isFinite(e.start)||!Number.isFinite(e.end)||e.end<=e.start||!a(e.accepted)||!a(e.late)||Object.values(e.bySource).some(e=>!a(e.accepted)||!a(e.late))||Object.values(e.bySource).reduce((e,t)=>e+t.accepted,0)!==e.accepted||Object.values(e.bySource).reduce((e,t)=>e+t.late,0)!==e.late))throw new RangeError("Invalid EventDrop ledger snapshot");t&&(this.windows.clear(),this.openWindows.clear());for(let t of e.windows){let e=this.windows.get(t.windowId);e&&this.openWindows.delete(e);let i=r(t);Object.setPrototypeOf(i.bySource,null),this.windows.set(t.windowId,i),i.open&&this.openWindows.add(i)}this.changedWindows?.clear(),this.sources=new Map(e.sources.map(([e,t])=>[e,{...t}])),this.latest=e.latest,this.frontier=e.frontier,this.value=e.value,this.heldBy=e.heldBy,this.pending=[]}advance(e,t="external"){if(!Number.isFinite(e))return;this.frontier=Math.max(this.frontier,e);let i,r=this.policy;if("function"==typeof r)i=r(this.latest);else if(r.external)i=r.external();else if(null!=r.value)i=r.value;else{let t=this.latest;if(r.perSource){let i;t=1/0;for(let[a,n]of this.sources){Number.isFinite(n.arrival)||(n.arrival=e);let s=null!=r.idleTimeout&&e-n.arrival>=r.idleTimeout;s&&!n.idle&&this.pending.push({type:"physics-source-idle",sourceId:a}),n.idle=s,!s&&n.latest<t&&(t=n.latest,i=a)}i&&i!==this.heldBy&&t<this.latest&&this.pending.push({type:"physics-watermark-held",sourceId:i}),this.heldBy=i,t===1/0&&(t=this.latest)}i=t-(r.delay??this.windowSize)}if(!Number.isFinite(i)||i<=this.value)return;let a=this.value;this.value=i,this.pending.push({type:"physics-watermark-advance",from:a,to:i,cause:t});for(let t of this.openWindows)t.end<=this.value&&this.close(t,e)}close(e,t){this.changedWindows?.add(e.windowId),e.open=!1,e.closedAt=t,e.watermarkAtClose=this.value,this.openWindows.delete(e),this.pending.push({type:"physics-window-close",...r(e),watermark:this.value})}append(e){var t;let{eventTime:i,arrivalTime:a,source:n=""}=e;if(!Number.isFinite(i)||!Number.isFinite(a))throw new RangeError("Event and arrival times must be finite");if(a<this.frontier)throw new RangeError("Incremental admissions require nondecreasing arrival times");this.latest=Math.max(this.latest,i);let s=this.sources.get(n);this.sources.set(n,{latest:Math.max(s?.latest??-1/0,i),arrival:a,idle:!1}),this.advance(a,"arrival");let l=Math.floor(i/this.windowSize)*this.windowSize,o=l+this.windowSize,u=`${l}-${o}`,h=this.windows.get(u);h||(h={windowId:u,start:l,end:o,accepted:0,late:0,bySource:Object.create(null),open:!0},this.windows.set(u,h),this.openWindows.add(h),this.pending.push({type:"physics-window-open",windowId:u,start:l,end:o}));let d=e.watermarkAtArrival??this.value,c=o+("function"==typeof this.policy?0:this.policy.allowedLateness??0)<=d,p=(t=h.bySource)[n]??(t[n]={accepted:0,late:0}),m=c?"late":"accepted";return h[m]++,this.changedWindows?.add(u),p[m]++,!h.open&&!c&&this.pending.push({type:"physics-window-update",windowId:u,accepted:h.accepted,late:h.late,bySource:r(h).bySource,watermark:this.value,retractions:1}),h.open&&o<=this.value&&this.close(h,a),{windowId:u,start:l,end:o,late:c,watermarkAtArrival:d}}};function n(e){let[t,i]=e,r=t<160||i<116,a=r?Math.min(12,Math.max(2,.08*t)):32,n=r?Math.min(8,Math.max(2,.12*i)):24,s=r?n:34;return{width:t,height:i,plot:{x:a,y:n,width:Math.max(1,t-2*a),height:Math.max(1,i-n-s)}}}function s(e){let t=String(e??"");if(!t)return"#4e79a7";let i=["#4e79a7","#59a14f","#e15759","#f28e2b","#76b7b2","#edc948","#b07aa1","#ff9da7"],r=0;for(let e=0;e<t.length;e+=1)r=31*r+t.charCodeAt(e)>>>0;return i[r%i.length]}function l(e,t){return t?(i,r)=>({..."function"==typeof e?e(i,r):e,..."function"==typeof t?t(i,r):t}):e}function o(e,r="#4e79a7",a){let n=a?.styleRules,l=!!n&&n.length>0,o=l?t(a?.valueAccessor):void 0;return t=>{let a=t.datum,u=a&&e?"function"==typeof e?e(a,0):a[e]:void 0,h={fill:null==u?r:s(u),stroke:"#111827",strokeWidth:1,opacity:.9};return l&&a&&Object.assign(h,i(a,n,{value:o?o(a):void 0,category:null==u?void 0:String(u)})),h}}function u(e,t,i,r){return{fixedDt:1/120,maxSubsteps:8,colliders:t,observation:{chartType:i},kernel:{seed:e,gravity:{x:0,y:760},cellSize:36,collisionIterations:6,velocityDamping:.995,restitution:.08,friction:.4,sleepSpeed:8,sleepAfter:.6,...r}}}function h(e,t,i){if(!e.length)return[];let r=n(t),a=r.plot.width/Math.max(1,e.length),s=e.reduce((e,t)=>Math.max(e,t.value),1),l=.62*r.plot.height,o=r.plot.y+r.plot.height;return e.map((e,t)=>{let n=Math.max(8,e.value/s*l),u=r.plot.x+(t+.5)*a,h=o-n/2,d=null==e.secondary?"":`, ${e.secondary} secondary`,c=`${i} ${e.label}: ${e.value}${d}`;return{id:`${i}-${e.label}`,label:c,description:c,datum:e,x:u,y:h,shape:"rect",width:Math.max(12,.58*a),height:n,group:i}})}function d(e,t,i){return"function"==typeof i?i(e,t):e[i]}function c(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function p(e,t,i){return Math.max(t,Math.min(i,e))}function m(e,t){let i=c(e);return null!=i&&i>0?i:t}function w(e){if(!e)return;let t=c(e[0]),i=c(e[1]);return null!=t&&null!=i?t<=i?[t,i]:[i,t]:void 0}function f(e){return String(e??"unknown").trim().replace(/[^A-Za-z0-9_-]+/g,"_")||"unknown"}function v(e,t,i=0){let r=new Set(e.filter(e=>null!=e.id).map(e=>String(e.id))),a=new Map;for(let n of e){let e=null==n.id?`${t}-${i++}`:String(n.id);for(;null==n.id&&r.has(e);)e=`${t}-${i++}`;r.add(e),a.set(e,null==n.id?{...n,id:e}:n)}return{seed:e,rows:Array.from(a.values()),nextId:i}}function g(t={}){let i=(t.categories?.length?t.categories:["Intake","Review","Build","Ship"]).map(e=>String(e).trim()).filter(Boolean),r=i.length?i:["Intake"],a=Math.max(r.length,Math.round(t.count??Math.max(48,12*r.length))),n=m(t.unitValue,1),s=e(t.seed??1),l=t.idPrefix??"mechanical-pile",o=r.map(()=>.65+.9*s()),u=o.reduce((e,t)=>e+t,0)||1,h=a-r.length,d=o.map(e=>e/u*h),c=d.map(e=>1+Math.floor(e)),p=a-c.reduce((e,t)=>e+t,0),w=d.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;p>0;e=(e+1)%w.length)c[w[e].index]+=1,p-=1;return r.map((e,t)=>({id:`${l}-${t}`,category:e,value:c[t]*n,mechanical:!0,unitCount:c[t],unitValue:n,share:c[t]/a}))}function y(e,t){let i=e/t,r=Math.round(i);return Math.ceil(r>0&&Math.abs(i-r)<=Number.EPSILON*i*4?r:i)}function b(t){let i=Math.max(2,Math.round(t.bins)),r=Math.max(1,Math.round(t.pegRows??i-1)),a=Math.max(1,Math.round(t.count??Math.max(64,4*i))),n=p(Number.isFinite(t.branchProbability)?t.branchProbability??.5:.5,0,1),s=e(t.seed??1),l=t.idPrefix??"mechanical";return Array.from({length:a},(e,t)=>{let i=0;for(let e=0;e<r;e+=1)s()<n&&(i+=1);let a=r/2;return{id:`${l}-${t}`,value:i,mechanical:!0,pegRows:r,branchProbability:n,pathRights:i,side:i<a?"left":i>a?"right":"center"}})}function x(e){let{windowSize:t,watermark:i,watermarkAtArrivalAccessor:r}=e;if(!(Number.isFinite(t)&&t>0))throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:n}=v(e.data,"event"),s=n.flatMap((t,i)=>{let r=c(d(t,i,e.timeAccessor));return null==r?[]:[{datum:t,index:i,eventTime:r,arrivalTime:c(d(t,i,e.arrivalAccessor))??r,watermarkAtArrival:0,late:!1}]}),l="function"==typeof i?null:c(i?.value),o="function"==typeof i?t:c(i?.delay)??t,u=new a(t,i,e.sourceIds);for(let t of s.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){let i=r?c(d(t.datum,t.index,r)):null,a=u.append({eventTime:t.eventTime,arrivalTime:t.arrivalTime,source:String(d(t.datum,t.index,e.sourceAccessor??"source")??""),watermarkAtArrival:i??void 0});t.watermarkAtArrival=a.watermarkAtArrival,t.late=a.late}return{events:s,watermarkValue:s.length?u.getWatermark():l??-o,ledger:u.getLedger(),lifecycleEvents:u.drainEvents()}}export{n as a,l as b,o as c,u as d,h as e,d as f,c as g,p as h,m as i,w as j,f as k,v as l,g as m,y as n,b as o,a as p,x as q};
@@ -0,0 +1 @@
1
+ import{q as t}from"./c-JDI7HKEM.min.js";import{d as l,h as e,j as a}from"./c-ELGOCAEY.min.js";function o(o,r,i,s,n){if(r.size<=0)return;let c=r.glyph;if(!c||!c.parts?.length)return;let f=l(c,r.size);if(f.scale<=0)return;let p=r._decayOpacity??1,y=(r.style.opacity??1)*p;if(y<=0)return;let h=l=>{let e=t(o,l,l);return"string"==typeof e?e:l},g=r.color??("string"==typeof r.style.fill?r.style.fill:void 0);o.save(),o.translate(i,s),r.rotation&&o.rotate(r.rotation),o.translate(f.offsetX,f.offsetY),o.scale(f.scale,f.scale),o.globalAlpha=n*y*(r.style.fillOpacity??1);let u=e(c,r.fraction??1,r.fractionStart??0,r.fractionDirection??"horizontal");u&&r.ghostColor&&a(o,c,g,r.accent,r.ghostColor,h),u&&(o.beginPath(),o.rect(u.x,u.y,u.width,u.height),o.clip()),a(o,c,g,r.accent,void 0,h),o.restore()}var r=(t,l)=>i(t,l.filter(t=>"glyph"===t.type));function i(t,l){let e=t.globalAlpha;for(let a of l){let l=a;o(t,l,l.x,l.y,e)}t.globalAlpha=e}function s(t,l){let e=t.globalAlpha;for(let a of l)"glyph"===a.type&&o(t,a,a.cx,a.cy,e);t.globalAlpha=e}export{r as a,i as b,s as c};
@@ -0,0 +1 @@
1
+ function e(e,a="dark"===e.mode){let{colorBlindSafe:r,highContrast:o}=e.accessibility??{};return r||o?{...e,colors:{...e.colors,...r&&{categorical:l},...o&&{text:a?"#ffffff":"#000000",textSecondary:a?"#cccccc":"#333333",grid:a?"#666666":"#999999",border:a?"#888888":"#000000"}}}:e}function a(e){let a=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(a)&&(a=a.split("").map(e=>e+e).join(""));let r=a.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!r)return null;let[o,t,i]=[parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255],c=e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4);return.2126*c(o)+.7152*c(t)+.0722*c(i)}function r(e,r){let o=a(e),t=a(r);return null===o||null===t?null:(Math.max(o,t)+.05)/(Math.min(o,t)+.05)}function o(e){return Array.isArray(e)?e.map(o):null!==e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,a])=>[e,o(a)])):e}function t(e){if(!e?.colors)return;let a=e.colors;return{primary:a.primary,secondary:a.secondary||a.primary,surface:a.surface||a.background,success:a.success,danger:a.danger,warning:a.warning,error:a.error,info:a.info,text:a.text,textSecondary:a.textSecondary,border:a.border,grid:a.grid}}function i(e,a){let r={...e,...a};for(let[o,t]of Object.entries(e))t&&"object"==typeof t&&!Array.isArray(t)&&(r[o]=i(t,a[o]??{}));return r}function c(e){return Object.prototype.hasOwnProperty.call(j,e)?o(j[e]):void 0}function f(e,a){("string"!=typeof e||function(e){for(let a=0;a<e.length;a++){let r=e.charCodeAt(a);if(r<32||127===r)return!0}return!1}(e)||e.includes("<"))&&a();let r="",o="";for(let t=0;t<e.length;t++){let i=e[t];r?"\\"===i?++t===e.length&&a():i===r&&(r=""):'"'===i||"'"===i?(r=i,o+=" "):o+=i}return r&&a(),o}function s(e,a){let r=f(e,()=>{throw new TypeError(`Unsafe theme CSS in ${a}`)});if(/[>{};\\]|\/\*|\*\/|(?:url|expression)\s*\(/i.test(r))throw new TypeError(`Unsafe theme CSS in ${a}`)}function n(e){let a=f(e,()=>{throw new TypeError("Unsafe theme CSS selector")});if(!e.trim()||/[{};\\]|\/\*|\*\//.test(a))throw new TypeError("Unsafe theme CSS selector")}function d(e){let a={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,r)=>{a[`--semiotic-category-${r+1}`]=e});for(let[r,o]of[["focus",e.colors.focus],["selection-color",e.colors.selection],["selection-opacity",null==e.colors.selectionOpacity?void 0:String(e.colors.selectionOpacity)],["diverging",e.colors.diverging],["annotation-color",e.colors.annotation],["success",e.colors.success],["danger",e.colors.danger],["warning",e.colors.warning],["error",e.colors.error],["info",e.colors.info],["tooltip-bg",e.tooltip?.background],["tooltip-text",e.tooltip?.text],["tooltip-radius",e.tooltip?.borderRadius],["tooltip-font-size",e.tooltip?.fontSize],["tooltip-shadow",e.tooltip?.shadow],["border-radius",e.borderRadius]])o&&(a[`--semiotic-${r}`]=o);for(let[r,o,t=""]of[["legend-font-size",e.typography.legendSize??e.typography.labelSize,"px"],["legend-font-family",e.typography.legendFontFamily],["legend-font-weight",e.typography.legendFontWeight],["title-font-size",e.typography.titleFontSize??e.typography.titleSize,"px"],["title-font-family",e.typography.titleFontFamily],["title-font-weight",e.typography.titleFontWeight],["tick-font-family",e.typography.tickFontFamily],["tick-font-size",e.typography.tickSize,"px"],["axis-label-font-size",e.typography.labelSize,"px"]])null!=o&&(a[`--semiotic-${r}`]=`${o}${t}`);for(let[e,r]of Object.entries(a))s(r,e);return a}var l=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],b={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},u={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},g={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:l,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},p={mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},y={mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},x={mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},m={mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},S={mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},h={mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},k={mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},z={mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},w={mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},F={mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},R={mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},v={mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},q=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],B={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},A={mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},C={mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"},j={light:b,dark:u,"high-contrast":g,pastels:p,"pastels-dark":y,"bi-tool":x,"bi-tool-dark":m,italian:S,"italian-dark":h,tufte:k,"tufte-dark":z,journalist:w,"journalist-dark":F,playful:R,"playful-dark":v,carbon:A,"carbon-dark":C};export{o as a,e as b,r as c,l as d,b as e,u as f,g,t as h,i,p as j,y as k,x as l,m,S as n,h as o,k as p,z as q,w as r,F as s,R as t,v as u,q as v,B as w,A as x,C as y,j as z,c as A,n as B,d as C};
@@ -0,0 +1 @@
1
+ export{a as registerBuiltInXYPlugins}from"./c-XPNBS3W2.min.js";import"./c-ZVL7ULNH.min.js";import"./c-5NAU4JAY.min.js";