@lunora/studio 1.0.0-alpha.59 → 1.0.0-alpha.60

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 (381) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -43
  3. package/dist/mount.js +1 -27
  4. package/dist/packem_chunks/ApiTab.js +1 -251
  5. package/dist/packem_chunks/AuditPanel.js +1 -200
  6. package/dist/packem_chunks/DeploymentHealthPanel.js +1 -664
  7. package/dist/packem_chunks/ExportImportPanel.js +3 -198
  8. package/dist/packem_chunks/FileBrowser.js +4 -2955
  9. package/dist/packem_chunks/FunctionRunner.js +1 -326
  10. package/dist/packem_chunks/FunctionStatsPanel.js +1 -377
  11. package/dist/packem_chunks/HealthPanel.js +1 -648
  12. package/dist/packem_chunks/InsightsPanel.js +1 -462
  13. package/dist/packem_chunks/LogsPanel.js +1 -1303
  14. package/dist/packem_chunks/MailPanel.js +2 -353
  15. package/dist/packem_chunks/MetricsPanel.js +1 -1960
  16. package/dist/packem_chunks/MigrationsPanel.js +1 -239
  17. package/dist/packem_chunks/NotificationsPanel.js +1 -306
  18. package/dist/packem_chunks/PitrPanel.js +1 -252
  19. package/dist/packem_chunks/SchemaViewer.js +1 -2512
  20. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -95
  21. package/dist/packem_chunks/SettingsPanel.js +1 -391
  22. package/dist/packem_chunks/SqlEditorPanel.js +4 -2340
  23. package/dist/packem_chunks/TableEditor.js +1 -290
  24. package/dist/packem_chunks/agents-panel.js +1 -326
  25. package/dist/packem_chunks/analytics-panel.js +1 -261
  26. package/dist/packem_chunks/auth-audit-panel.js +1 -247
  27. package/dist/packem_chunks/auth-config-panel.js +1 -365
  28. package/dist/packem_chunks/auth-sessions-panel.js +1 -175
  29. package/dist/packem_chunks/containers-panel.js +1 -261
  30. package/dist/packem_chunks/dashboards-panel.js +1 -781
  31. package/dist/packem_chunks/fanout-panel.js +1 -482
  32. package/dist/packem_chunks/flags-panel.js +1 -176
  33. package/dist/packem_chunks/issues-panel.js +1 -427
  34. package/dist/packem_chunks/kv-browser.js +1 -1896
  35. package/dist/packem_chunks/log-drains-panel.js +4 -273
  36. package/dist/packem_chunks/organizations-panel.js +1 -3209
  37. package/dist/packem_chunks/payments-panel.js +1 -213
  38. package/dist/packem_chunks/permissions-panel.js +1 -805
  39. package/dist/packem_chunks/queues-panel.js +1 -1075
  40. package/dist/packem_chunks/rls-panel.js +1 -315
  41. package/dist/packem_chunks/schedule-panel.js +1 -831
  42. package/dist/packem_chunks/sparkline.js +1 -79
  43. package/dist/packem_chunks/storage-rules-panel.js +1 -140
  44. package/dist/packem_chunks/subscriptions-panel.js +1 -238
  45. package/dist/packem_chunks/sync-client-panel.js +1 -0
  46. package/dist/packem_chunks/traces-panel.js +1 -747
  47. package/dist/packem_chunks/users-panel.js +1 -1731
  48. package/dist/packem_chunks/vector-browser.js +1 -281
  49. package/dist/packem_chunks/workflows-panel.js +1 -562
  50. package/dist/packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js +1 -0
  51. package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
  52. package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
  53. package/dist/packem_shared/CommandPalette-CVIaY3j8.js +1 -0
  54. package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
  55. package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
  56. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
  57. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
  58. package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
  59. package/dist/packem_shared/DataBrowser-B8J5lHjP.js +1 -0
  60. package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
  61. package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
  62. package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
  63. package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
  64. package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
  65. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
  66. package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
  67. package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
  68. package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
  69. package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
  70. package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
  71. package/dist/packem_shared/advisor-view-DaCX9Jy5.js +1 -0
  72. package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
  73. package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
  74. package/dist/packem_shared/badge-BbuuAio7.js +1 -0
  75. package/dist/packem_shared/bar-chart-AryFCeoa.js +9 -0
  76. package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
  77. package/dist/packem_shared/button-BkCrNcAs.js +1 -0
  78. package/dist/packem_shared/card-CIDGUN6K.js +1 -0
  79. package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
  80. package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
  81. package/dist/packem_shared/data-grid-BMBKzMEJ.js +1 -0
  82. package/dist/packem_shared/data-view-params-C8T3bW1z.js +1 -0
  83. package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
  84. package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
  85. package/dist/packem_shared/error-alert-B59DnrDI.js +1 -0
  86. package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
  87. package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
  88. package/dist/packem_shared/input-JHu63lTv.js +1 -0
  89. package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
  90. package/dist/packem_shared/label-6uP1obNF.js +1 -0
  91. package/dist/packem_shared/live-status-CGW2JHf_.js +1 -0
  92. package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
  93. package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
  94. package/dist/packem_shared/reference-view-KvhektwF.js +12 -0
  95. package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -0
  96. package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
  97. package/dist/packem_shared/select-Bul-DeII.js +2 -0
  98. package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
  99. package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
  100. package/dist/packem_shared/sparkline-DtcZoU48.js +1 -0
  101. package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
  102. package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
  103. package/dist/packem_shared/table-DdJBrClo.js +2 -0
  104. package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +1 -0
  105. package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
  106. package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
  107. package/dist/packem_shared/use-admin-query-Di3fLE8H.js +1 -0
  108. package/dist/packem_shared/use-async-submit-H68GHPz8.js +1 -0
  109. package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
  110. package/dist/packem_shared/utils-bhneXptQ.js +1 -0
  111. package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
  112. package/dist/standalone/chunk-23HKRH5H.js +13 -0
  113. package/dist/standalone/chunk-2A4RKII2.js +1 -0
  114. package/dist/standalone/chunk-3DTM4GI5.js +1 -0
  115. package/dist/standalone/chunk-3MHKT76P.js +1 -0
  116. package/dist/standalone/chunk-46IB4C4Q.js +1 -0
  117. package/dist/standalone/chunk-4AYEV5UN.js +1 -0
  118. package/dist/standalone/chunk-4FNHHFWR.js +1 -0
  119. package/dist/standalone/chunk-6CLVIOCB.js +1 -0
  120. package/dist/standalone/chunk-6I62RSI5.js +1 -0
  121. package/dist/standalone/chunk-6OKDCV7J.js +1 -0
  122. package/dist/standalone/chunk-6P7HIPUE.js +1 -0
  123. package/dist/standalone/chunk-6UYILUSX.js +1 -0
  124. package/dist/standalone/chunk-725RLB7D.js +1 -0
  125. package/dist/standalone/chunk-7AZZ7OJO.js +1 -0
  126. package/dist/standalone/chunk-7CRLAMGB.js +1 -0
  127. package/dist/standalone/chunk-7Z5QEFR4.js +2 -0
  128. package/dist/standalone/chunk-AGVJJQFL.js +1 -0
  129. package/dist/standalone/chunk-AKTGRZXN.js +1 -0
  130. package/dist/standalone/chunk-BAIN7UJ4.js +1 -0
  131. package/dist/standalone/chunk-BHWSIIDT.js +1 -0
  132. package/dist/standalone/{chunk-L7SK4ZZD.js → chunk-C4O5UR4Y.js} +1 -1
  133. package/dist/standalone/chunk-C4VURT57.js +1 -0
  134. package/dist/standalone/chunk-CKO3F55C.js +4 -0
  135. package/dist/standalone/chunk-CVMRZUF5.js +4 -0
  136. package/dist/standalone/chunk-CWWGDW4V.js +1 -0
  137. package/dist/standalone/chunk-CYET4BRZ.js +1 -0
  138. package/dist/standalone/chunk-CZEUVNCQ.js +1 -0
  139. package/dist/standalone/chunk-FXFK4M4E.js +1 -0
  140. package/dist/standalone/chunk-FYAJPWE7.js +1 -0
  141. package/dist/standalone/chunk-GS7OBQO5.js +1 -0
  142. package/dist/standalone/chunk-GTXVH7I5.js +1 -0
  143. package/dist/standalone/chunk-H6SIM4BT.js +1 -0
  144. package/dist/standalone/chunk-H6WOFY6A.js +8 -0
  145. package/dist/standalone/chunk-HA34GYEX.js +1 -0
  146. package/dist/standalone/chunk-HMIOF5GV.js +1 -0
  147. package/dist/standalone/chunk-HY46NTNW.js +6 -0
  148. package/dist/standalone/chunk-IBCKC2BO.js +1 -0
  149. package/dist/standalone/chunk-ICKBVXPP.js +1 -0
  150. package/dist/standalone/chunk-IE4ROTQD.js +1 -0
  151. package/dist/standalone/chunk-IYYTWZ2E.js +2 -0
  152. package/dist/standalone/chunk-J2LMP2A7.js +1 -0
  153. package/dist/standalone/chunk-JC6WYIHM.js +1 -0
  154. package/dist/standalone/chunk-JKPK25JO.js +1 -0
  155. package/dist/standalone/chunk-JLFCXBNQ.js +1 -0
  156. package/dist/standalone/chunk-JRWBGR5B.js +1 -0
  157. package/dist/standalone/chunk-K5PFWU5J.js +1 -0
  158. package/dist/standalone/chunk-KJTLW5W2.js +11 -0
  159. package/dist/standalone/{chunk-HBGS4SEX.js → chunk-KLLYGWNF.js} +9 -9
  160. package/dist/standalone/chunk-KNN3ZEQ7.js +1 -0
  161. package/dist/standalone/{chunk-4QHKBC77.js → chunk-KOC5KV3E.js} +1 -1
  162. package/dist/standalone/chunk-KSRXMTBV.js +1 -0
  163. package/dist/standalone/chunk-KYCAYNXM.js +1 -0
  164. package/dist/standalone/chunk-KZ2YUNMR.js +1 -0
  165. package/dist/standalone/chunk-LKHUVEHX.js +1 -0
  166. package/dist/standalone/chunk-LPOKAJT4.js +4 -0
  167. package/dist/standalone/chunk-MZEK4SGD.js +1 -0
  168. package/dist/standalone/chunk-NCCUM26H.js +1 -0
  169. package/dist/standalone/chunk-O62HJZV3.js +1 -0
  170. package/dist/standalone/chunk-OTJOI23O.js +62 -0
  171. package/dist/standalone/chunk-P2NBOUGZ.js +1 -0
  172. package/dist/standalone/chunk-P4J6XNG3.js +1 -0
  173. package/dist/standalone/chunk-PGDWFWH5.js +1 -0
  174. package/dist/standalone/chunk-PR2SE2MD.js +1 -0
  175. package/dist/standalone/chunk-PTTDIYGP.js +1 -0
  176. package/dist/standalone/chunk-PWDMXMRD.js +1 -0
  177. package/dist/standalone/chunk-Q34MSC2F.js +1 -0
  178. package/dist/standalone/chunk-Q5WXTZWX.js +1 -0
  179. package/dist/standalone/chunk-QC5HCNJZ.js +4 -0
  180. package/dist/standalone/chunk-QJKRHZYV.js +1 -0
  181. package/dist/standalone/chunk-R43KHQDA.js +1 -0
  182. package/dist/standalone/chunk-RC2K5RBE.js +1 -0
  183. package/dist/standalone/chunk-RE6UWCMG.js +1 -0
  184. package/dist/standalone/chunk-RUP3M2GF.js +3 -0
  185. package/dist/standalone/chunk-SA6MBPBL.js +1 -0
  186. package/dist/standalone/{chunk-BJGBHGK3.js → chunk-SEDZDNQF.js} +1 -1
  187. package/dist/standalone/chunk-SKHEGARW.js +1 -0
  188. package/dist/standalone/chunk-SKJZDOHG.js +1 -0
  189. package/dist/standalone/chunk-SNDYNCAA.js +1 -0
  190. package/dist/standalone/chunk-SZUHZ2OG.js +1 -0
  191. package/dist/standalone/chunk-TAE2H7PU.js +1 -0
  192. package/dist/standalone/chunk-TEIBKU46.js +1 -0
  193. package/dist/standalone/chunk-TO6NLVFD.js +1 -0
  194. package/dist/standalone/chunk-TYTJDFX2.js +1 -0
  195. package/dist/standalone/{chunk-LXULVPEM.js → chunk-UDZY7MKE.js} +3 -3
  196. package/dist/standalone/chunk-UHHTEBC3.js +1 -0
  197. package/dist/standalone/chunk-UNDFOYRI.js +1 -0
  198. package/dist/standalone/chunk-UNN4CESU.js +1 -0
  199. package/dist/standalone/chunk-UNXX5GQH.js +1 -0
  200. package/dist/standalone/{chunk-ZHVTQ37P.js → chunk-UREY4GLG.js} +1 -1
  201. package/dist/standalone/chunk-UWF5DOGV.js +1 -0
  202. package/dist/standalone/chunk-UY2Y5CXB.js +1 -0
  203. package/dist/standalone/{chunk-VLXV72QE.js → chunk-UZYGEOWY.js} +1 -1
  204. package/dist/standalone/chunk-V66TSUKV.js +1 -0
  205. package/dist/standalone/chunk-VEFNSN7P.js +1 -0
  206. package/dist/standalone/chunk-VUJGR4PB.js +1 -0
  207. package/dist/standalone/chunk-VUXJER3D.js +1 -0
  208. package/dist/standalone/chunk-W572365D.js +1 -0
  209. package/dist/standalone/chunk-WYFLGXZ3.js +3 -0
  210. package/dist/standalone/chunk-XDKFPBIL.js +1 -0
  211. package/dist/standalone/chunk-XRKCGQM2.js +1 -0
  212. package/dist/standalone/chunk-YNBJ6ICE.js +1 -0
  213. package/dist/standalone/chunk-YQ5PILIJ.js +1 -0
  214. package/dist/standalone/chunk-YT7VXQVX.js +1 -0
  215. package/dist/standalone/chunk-Z7MUQMLE.js +1 -0
  216. package/dist/standalone/chunk-ZFWEPGWG.js +1 -0
  217. package/dist/standalone/chunk-ZMFZRGAN.js +1 -0
  218. package/dist/standalone/studio.js +9 -214
  219. package/package.json +4 -4
  220. package/dist/packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js +0 -62
  221. package/dist/packem_shared/ApiDocsPanel-DNDpeR5O.js +0 -842
  222. package/dist/packem_shared/ApiReferencePanel-ChlRsAXU.js +0 -230
  223. package/dist/packem_shared/CommandPalette-BpkopP5f.js +0 -373
  224. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  225. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  226. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  227. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  228. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  229. package/dist/packem_shared/DataBrowser-obTn4sKX.js +0 -4493
  230. package/dist/packem_shared/DataFilters-B1Q7mrt7.js +0 -253
  231. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  232. package/dist/packem_shared/GlobalDataBrowser-BCaohHZ5.js +0 -293
  233. package/dist/packem_shared/HomePanel-DCRj3hGB.js +0 -14
  234. package/dist/packem_shared/OpenRpcReferencePanel-CIeQE1aE.js +0 -192
  235. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  236. package/dist/packem_shared/ScheduledJobs-BQzQo84k.js +0 -262
  237. package/dist/packem_shared/ShardInput-CZnpHILL.js +0 -107
  238. package/dist/packem_shared/Studio-DnlPCbID.js +0 -16
  239. package/dist/packem_shared/StudioApp-CzqlB4zO.js +0 -708
  240. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  241. package/dist/packem_shared/advisor-view-D95sN-wO.js +0 -159
  242. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  243. package/dist/packem_shared/alert-CdAET2K_.js +0 -68
  244. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  245. package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
  246. package/dist/packem_shared/browser-storage-L4gOP5gJ.js +0 -105
  247. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  248. package/dist/packem_shared/card-F2vH_aj2.js +0 -175
  249. package/dist/packem_shared/cf-links-SIbyi4Y1.js +0 -8
  250. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  251. package/dist/packem_shared/data-grid-BywzWfek.js +0 -183
  252. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
  253. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  254. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  255. package/dist/packem_shared/error-alert-D9uIFJUS.js +0 -114
  256. package/dist/packem_shared/grid-features-ZOLhHKrR.js +0 -809
  257. package/dist/packem_shared/home-panel-BRAA2UlM.js +0 -1889
  258. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  259. package/dist/packem_shared/internal-DzHCc2Rq.js +0 -131
  260. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  261. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  262. package/dist/packem_shared/log-fields-jEH83H2G.js +0 -18
  263. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
  264. package/dist/packem_shared/reference-view-DfXN7oWP.js +0 -2127
  265. package/dist/packem_shared/result-chart-Bf9mbCIo.js +0 -119
  266. package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
  267. package/dist/packem_shared/select-D9OwHEch.js +0 -273
  268. package/dist/packem_shared/shard-history-AxiJ1WPP.js +0 -16
  269. package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
  270. package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
  271. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  272. package/dist/packem_shared/studio-8QSXbZ98.js +0 -4192
  273. package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
  274. package/dist/packem_shared/table-list-sidebar-gCE17v9B.js +0 -842
  275. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  276. package/dist/packem_shared/trace-handoff-CGolF3KS.js +0 -38
  277. package/dist/packem_shared/use-admin-query-C7JNuQp-.js +0 -106
  278. package/dist/packem_shared/use-async-submit-rnSk_jXl.js +0 -91
  279. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  280. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  281. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
  282. package/dist/standalone/chunk-2K47A3P6.js +0 -1
  283. package/dist/standalone/chunk-2MLA6WFH.js +0 -1
  284. package/dist/standalone/chunk-2NGUNNGW.js +0 -1
  285. package/dist/standalone/chunk-2TJVFKD2.js +0 -1
  286. package/dist/standalone/chunk-2YTF6LJ6.js +0 -1
  287. package/dist/standalone/chunk-3GXGLNKW.js +0 -1
  288. package/dist/standalone/chunk-3HGNPZBN.js +0 -1
  289. package/dist/standalone/chunk-3LJEGSMK.js +0 -11
  290. package/dist/standalone/chunk-3OA7PECS.js +0 -6
  291. package/dist/standalone/chunk-4PC7IXNY.js +0 -1
  292. package/dist/standalone/chunk-56XQYNUJ.js +0 -1
  293. package/dist/standalone/chunk-5OIBXYZM.js +0 -1
  294. package/dist/standalone/chunk-5QT5JRXD.js +0 -3
  295. package/dist/standalone/chunk-6RLPR7PL.js +0 -1
  296. package/dist/standalone/chunk-6V74EUPK.js +0 -1
  297. package/dist/standalone/chunk-7EE33WLB.js +0 -1
  298. package/dist/standalone/chunk-7TJJXVSE.js +0 -1
  299. package/dist/standalone/chunk-AHILM3ZP.js +0 -1
  300. package/dist/standalone/chunk-AN4RKMKW.js +0 -1
  301. package/dist/standalone/chunk-APSSZB6Z.js +0 -1
  302. package/dist/standalone/chunk-AXNGWSBM.js +0 -1
  303. package/dist/standalone/chunk-AXZILWRM.js +0 -1
  304. package/dist/standalone/chunk-C7RHEBOH.js +0 -1
  305. package/dist/standalone/chunk-CKSHCYGC.js +0 -2
  306. package/dist/standalone/chunk-CSWIYOB3.js +0 -1
  307. package/dist/standalone/chunk-D3VAON25.js +0 -1
  308. package/dist/standalone/chunk-DDLQN67F.js +0 -1
  309. package/dist/standalone/chunk-DGHW5JG5.js +0 -1
  310. package/dist/standalone/chunk-DMCSOTAE.js +0 -3
  311. package/dist/standalone/chunk-E3BKETAS.js +0 -1
  312. package/dist/standalone/chunk-E3OXNN6O.js +0 -1
  313. package/dist/standalone/chunk-E6BOGDIS.js +0 -1
  314. package/dist/standalone/chunk-F2YMCQ6B.js +0 -1
  315. package/dist/standalone/chunk-F7GE4X2U.js +0 -1
  316. package/dist/standalone/chunk-FAVUOGJR.js +0 -1
  317. package/dist/standalone/chunk-FXP6256Q.js +0 -1
  318. package/dist/standalone/chunk-G6CTAYHJ.js +0 -1
  319. package/dist/standalone/chunk-GTM65MVX.js +0 -1
  320. package/dist/standalone/chunk-H42W62SE.js +0 -1
  321. package/dist/standalone/chunk-HTF5ZX4I.js +0 -8
  322. package/dist/standalone/chunk-HV7G6DFP.js +0 -5
  323. package/dist/standalone/chunk-I2PS4L74.js +0 -1
  324. package/dist/standalone/chunk-IYHPYY4A.js +0 -1
  325. package/dist/standalone/chunk-J6J54MBP.js +0 -1
  326. package/dist/standalone/chunk-J7OGP4NN.js +0 -1
  327. package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
  328. package/dist/standalone/chunk-JZLGLG4T.js +0 -1
  329. package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
  330. package/dist/standalone/chunk-KZ6INM5M.js +0 -1
  331. package/dist/standalone/chunk-L2LN3MK4.js +0 -4
  332. package/dist/standalone/chunk-LT3FH6MW.js +0 -1
  333. package/dist/standalone/chunk-LZUWZBPE.js +0 -1
  334. package/dist/standalone/chunk-M4JM3TOY.js +0 -1
  335. package/dist/standalone/chunk-MLA5ZAEB.js +0 -1
  336. package/dist/standalone/chunk-MRBI5HNQ.js +0 -1
  337. package/dist/standalone/chunk-N5XX4HOL.js +0 -6
  338. package/dist/standalone/chunk-N7SVJOHN.js +0 -1
  339. package/dist/standalone/chunk-NKFXMDOD.js +0 -1
  340. package/dist/standalone/chunk-NPSNKFHE.js +0 -1
  341. package/dist/standalone/chunk-O3NAGRTR.js +0 -1
  342. package/dist/standalone/chunk-O7FVPUCO.js +0 -1
  343. package/dist/standalone/chunk-OKQXTLFX.js +0 -1
  344. package/dist/standalone/chunk-OXHHSUXO.js +0 -1
  345. package/dist/standalone/chunk-QAFAJBAW.js +0 -1
  346. package/dist/standalone/chunk-QAIM6KWT.js +0 -1
  347. package/dist/standalone/chunk-QCPMTB6W.js +0 -1
  348. package/dist/standalone/chunk-QQ2LOSZL.js +0 -1
  349. package/dist/standalone/chunk-QVIPA6UJ.js +0 -1
  350. package/dist/standalone/chunk-QVUQXJCT.js +0 -4
  351. package/dist/standalone/chunk-R2GMHLJY.js +0 -1
  352. package/dist/standalone/chunk-RD5UG2YL.js +0 -1
  353. package/dist/standalone/chunk-RJTIP3WF.js +0 -1
  354. package/dist/standalone/chunk-RRCPZMC2.js +0 -22
  355. package/dist/standalone/chunk-SHERR7ZP.js +0 -1
  356. package/dist/standalone/chunk-SOC5CY3F.js +0 -1
  357. package/dist/standalone/chunk-SS7JLF2I.js +0 -4
  358. package/dist/standalone/chunk-SWWYUGPL.js +0 -2
  359. package/dist/standalone/chunk-TAD43CG5.js +0 -1
  360. package/dist/standalone/chunk-TTXRHJUP.js +0 -4
  361. package/dist/standalone/chunk-UK64ZSUW.js +0 -1
  362. package/dist/standalone/chunk-UKDHGVOC.js +0 -1
  363. package/dist/standalone/chunk-UPNTMJFF.js +0 -1
  364. package/dist/standalone/chunk-V43BLH4J.js +0 -1
  365. package/dist/standalone/chunk-VL23Y44O.js +0 -4
  366. package/dist/standalone/chunk-VXM5H542.js +0 -4
  367. package/dist/standalone/chunk-WMDH2CIZ.js +0 -1
  368. package/dist/standalone/chunk-WVTPZ6CM.js +0 -1
  369. package/dist/standalone/chunk-XN6QYJQ6.js +0 -13
  370. package/dist/standalone/chunk-XNJNSCLM.js +0 -1
  371. package/dist/standalone/chunk-Y4U6CC22.js +0 -1
  372. package/dist/standalone/chunk-Y572GMZE.js +0 -1
  373. package/dist/standalone/chunk-Y7PD5KP4.js +0 -76
  374. package/dist/standalone/chunk-YFIPHCEC.js +0 -1
  375. package/dist/standalone/chunk-YJXOWLFJ.js +0 -1
  376. package/dist/standalone/chunk-YNN6NFRZ.js +0 -1
  377. package/dist/standalone/chunk-YUGHRVPD.js +0 -1
  378. package/dist/standalone/chunk-ZIGWVHCS.js +0 -1
  379. package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
  380. package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
  381. /package/dist/standalone/{chunk-TEWVD66F.js → chunk-GXZAXNZI.js} +0 -0
@@ -1,3246 +0,0 @@
1
- 'use client';
2
- import { c } from 'react/compiler-runtime';
3
- import { LunoraError } from '@lunora/errors';
4
- import { useMotionValue, useSpring, useTransform, useMotionValueEvent, motion, useReducedMotion } from 'motion/react';
5
- import * as React from 'react';
6
- import { useId, useEffect, useState, use, createContext, useRef } from 'react';
7
- import * as RechartsPrimitive from 'recharts';
8
- import { ZIndexLayer, ResponsiveContainer, LineChart, Line, BarChart, Bar as Bar$1, AreaChart, Area, ReferenceLine, Rectangle, XAxis as XAxis$1 } from 'recharts';
9
- import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
10
- import { c as cn } from './utils-B05Dmz_H.js';
11
-
12
- const DotsPattern = (t0) => {
13
- const $ = c(3);
14
- const {
15
- id
16
- } = t0;
17
- let t1;
18
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
19
- t1 = /* @__PURE__ */ jsxDEV("circle", {
20
- className: "text-border dark:text-border",
21
- cx: "2",
22
- cy: "2",
23
- fill: "currentColor",
24
- r: "1"
25
- }, void 0, false);
26
- $[0] = t1;
27
- } else {
28
- t1 = $[0];
29
- }
30
- let t2;
31
- if ($[1] !== id) {
32
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
33
- height: "20",
34
- id,
35
- patternUnits: "userSpaceOnUse",
36
- width: "20",
37
- x: "0",
38
- y: "0",
39
- children: t1
40
- }, void 0, false);
41
- $[1] = id;
42
- $[2] = t2;
43
- } else {
44
- t2 = $[2];
45
- }
46
- return t2;
47
- };
48
- const GridPattern = (t0) => {
49
- const $ = c(3);
50
- const {
51
- id
52
- } = t0;
53
- let t1;
54
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
55
- t1 = /* @__PURE__ */ jsxDEV("path", {
56
- className: "text-border dark:text-border",
57
- d: "M 20 0 L 0 0 0 20",
58
- fill: "none",
59
- stroke: "currentColor",
60
- strokeWidth: "0.5"
61
- }, void 0, false);
62
- $[0] = t1;
63
- } else {
64
- t1 = $[0];
65
- }
66
- let t2;
67
- if ($[1] !== id) {
68
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
69
- height: "20",
70
- id,
71
- patternUnits: "userSpaceOnUse",
72
- width: "20",
73
- x: "0",
74
- y: "0",
75
- children: t1
76
- }, void 0, false);
77
- $[1] = id;
78
- $[2] = t2;
79
- } else {
80
- t2 = $[2];
81
- }
82
- return t2;
83
- };
84
- const CrossHatchPattern = (t0) => {
85
- const $ = c(3);
86
- const {
87
- id
88
- } = t0;
89
- let t1;
90
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
91
- t1 = /* @__PURE__ */ jsxDEV("path", {
92
- className: "text-border/60 dark:text-border/50",
93
- d: "M 0 0 L 20 20 M 20 0 L 0 20",
94
- fill: "none",
95
- stroke: "currentColor",
96
- strokeWidth: "0.5"
97
- }, void 0, false);
98
- $[0] = t1;
99
- } else {
100
- t1 = $[0];
101
- }
102
- let t2;
103
- if ($[1] !== id) {
104
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
105
- height: "20",
106
- id,
107
- patternUnits: "userSpaceOnUse",
108
- width: "20",
109
- x: "0",
110
- y: "0",
111
- children: t1
112
- }, void 0, false);
113
- $[1] = id;
114
- $[2] = t2;
115
- } else {
116
- t2 = $[2];
117
- }
118
- return t2;
119
- };
120
- const DiagonalLinesPattern = (t0) => {
121
- const $ = c(3);
122
- const {
123
- id
124
- } = t0;
125
- let t1;
126
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
127
- t1 = /* @__PURE__ */ jsxDEV("line", {
128
- className: "text-border dark:text-border",
129
- stroke: "currentColor",
130
- strokeWidth: "0.5",
131
- x1: "0",
132
- x2: "0",
133
- y1: "0",
134
- y2: "6"
135
- }, void 0, false);
136
- $[0] = t1;
137
- } else {
138
- t1 = $[0];
139
- }
140
- let t2;
141
- if ($[1] !== id) {
142
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
143
- height: "6",
144
- id,
145
- patternTransform: "rotate(45)",
146
- patternUnits: "userSpaceOnUse",
147
- width: "6",
148
- x: "0",
149
- y: "0",
150
- children: t1
151
- }, void 0, false);
152
- $[1] = id;
153
- $[2] = t2;
154
- } else {
155
- t2 = $[2];
156
- }
157
- return t2;
158
- };
159
- const PlusPattern = (t0) => {
160
- const $ = c(3);
161
- const {
162
- id
163
- } = t0;
164
- let t1;
165
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
166
- t1 = /* @__PURE__ */ jsxDEV("path", {
167
- className: "text-border dark:text-border",
168
- d: "M 8 4 L 8 12 M 4 8 L 12 8",
169
- fill: "none",
170
- stroke: "currentColor",
171
- strokeLinecap: "round",
172
- strokeWidth: "0.5"
173
- }, void 0, false);
174
- $[0] = t1;
175
- } else {
176
- t1 = $[0];
177
- }
178
- let t2;
179
- if ($[1] !== id) {
180
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
181
- height: "16",
182
- id,
183
- patternUnits: "userSpaceOnUse",
184
- width: "16",
185
- x: "0",
186
- y: "0",
187
- children: t1
188
- }, void 0, false);
189
- $[1] = id;
190
- $[2] = t2;
191
- } else {
192
- t2 = $[2];
193
- }
194
- return t2;
195
- };
196
- const FallingTrianglesPattern = (t0) => {
197
- const $ = c(3);
198
- const {
199
- id
200
- } = t0;
201
- let t1;
202
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
203
- t1 = /* @__PURE__ */ jsxDEV("path", {
204
- className: "text-border dark:text-border",
205
- d: "M2 6h12L8 18 2 6zm18 36h12l-6 12-6-12z",
206
- fill: "currentColor",
207
- fillOpacity: "0.4",
208
- transform: "scale(0.5)"
209
- }, void 0, false);
210
- $[0] = t1;
211
- } else {
212
- t1 = $[0];
213
- }
214
- let t2;
215
- if ($[1] !== id) {
216
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
217
- height: "36",
218
- id,
219
- patternUnits: "userSpaceOnUse",
220
- width: "18",
221
- x: "0",
222
- y: "0",
223
- children: t1
224
- }, void 0, false);
225
- $[1] = id;
226
- $[2] = t2;
227
- } else {
228
- t2 = $[2];
229
- }
230
- return t2;
231
- };
232
- const FourPointedStarPattern = (t0) => {
233
- const $ = c(3);
234
- const {
235
- id
236
- } = t0;
237
- let t1;
238
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
239
- t1 = /* @__PURE__ */ jsxDEV("polygon", {
240
- className: "text-border dark:text-border",
241
- fill: "currentColor",
242
- fillOpacity: "0.4",
243
- fillRule: "evenodd",
244
- points: "5 3 8 4 5 5 4 8 3 5 0 4 3 3 4 0 5 3"
245
- }, void 0, false);
246
- $[0] = t1;
247
- } else {
248
- t1 = $[0];
249
- }
250
- let t2;
251
- if ($[1] !== id) {
252
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
253
- height: "16",
254
- id,
255
- patternUnits: "userSpaceOnUse",
256
- width: "16",
257
- x: "0",
258
- y: "0",
259
- children: t1
260
- }, void 0, false);
261
- $[1] = id;
262
- $[2] = t2;
263
- } else {
264
- t2 = $[2];
265
- }
266
- return t2;
267
- };
268
- const TinyCheckersPattern = (t0) => {
269
- const $ = c(3);
270
- const {
271
- id
272
- } = t0;
273
- let t1;
274
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
275
- t1 = /* @__PURE__ */ jsxDEV("path", {
276
- className: "text-border dark:text-border",
277
- d: "M0 0h4v4H0V0zm4 4h4v4H4V4z",
278
- fill: "currentColor",
279
- fillOpacity: "0.2",
280
- fillRule: "evenodd"
281
- }, void 0, false);
282
- $[0] = t1;
283
- } else {
284
- t1 = $[0];
285
- }
286
- let t2;
287
- if ($[1] !== id) {
288
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
289
- height: "8",
290
- id,
291
- patternUnits: "userSpaceOnUse",
292
- width: "8",
293
- x: "0",
294
- y: "0",
295
- children: t1
296
- }, void 0, false);
297
- $[1] = id;
298
- $[2] = t2;
299
- } else {
300
- t2 = $[2];
301
- }
302
- return t2;
303
- };
304
- const OverlappingCirclesPattern = (t0) => {
305
- const $ = c(3);
306
- const {
307
- id
308
- } = t0;
309
- let t1;
310
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
311
- t1 = /* @__PURE__ */ jsxDEV("path", {
312
- className: "text-border dark:text-border",
313
- d: "M25 25c0-2.762 2.238-5 5-5s5 2.238 5 5-2.238 5-5 5c0 2.762-2.238 5-5 5s-5-2.238-5-5 2.238-5 5-5zM5 5c0-2.762 2.238-5 5-5s5 2.238 5 5-2.238 5-5 5c0 2.762-2.238 5-5 5S0 12.762 0 10s2.238-5 5-5zm5 4c2.209 0 4-1.791 4-4s-1.791-4-4-4-4 1.791-4 4 1.791 4 4 4zm20 20c2.209 0 4-1.791 4-4s-1.791-4-4-4-4 1.791-4 4 1.791 4 4 4z",
314
- fill: "currentColor",
315
- fillOpacity: "0.4",
316
- fillRule: "evenodd"
317
- }, void 0, false);
318
- $[0] = t1;
319
- } else {
320
- t1 = $[0];
321
- }
322
- let t2;
323
- if ($[1] !== id) {
324
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
325
- height: "40",
326
- id,
327
- patternUnits: "userSpaceOnUse",
328
- width: "40",
329
- x: "0",
330
- y: "0",
331
- children: t1
332
- }, void 0, false);
333
- $[1] = id;
334
- $[2] = t2;
335
- } else {
336
- t2 = $[2];
337
- }
338
- return t2;
339
- };
340
- const WiggleLinesPattern = (t0) => {
341
- const $ = c(3);
342
- const {
343
- id
344
- } = t0;
345
- let t1;
346
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
347
- t1 = /* @__PURE__ */ jsxDEV("path", {
348
- className: "text-border dark:text-border",
349
- d: "M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z",
350
- fill: "currentColor",
351
- fillOpacity: "0.4"
352
- }, void 0, false);
353
- $[0] = t1;
354
- } else {
355
- t1 = $[0];
356
- }
357
- let t2;
358
- if ($[1] !== id) {
359
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
360
- height: "26",
361
- id,
362
- patternTransform: "scale(0.6)",
363
- patternUnits: "userSpaceOnUse",
364
- width: "52",
365
- x: "0",
366
- y: "0",
367
- children: t1
368
- }, void 0, false);
369
- $[1] = id;
370
- $[2] = t2;
371
- } else {
372
- t2 = $[2];
373
- }
374
- return t2;
375
- };
376
- const BubblesPattern = (t0) => {
377
- const $ = c(3);
378
- const {
379
- id
380
- } = t0;
381
- let t1;
382
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
383
- t1 = /* @__PURE__ */ jsxDEV("path", {
384
- className: "text-border dark:text-border",
385
- d: "M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z",
386
- fill: "currentColor",
387
- fillOpacity: "0.4",
388
- fillRule: "evenodd"
389
- }, void 0, false);
390
- $[0] = t1;
391
- } else {
392
- t1 = $[0];
393
- }
394
- let t2;
395
- if ($[1] !== id) {
396
- t2 = /* @__PURE__ */ jsxDEV("pattern", {
397
- height: "100",
398
- id,
399
- patternTransform: "scale(0.6667)",
400
- patternUnits: "userSpaceOnUse",
401
- width: "100",
402
- x: "0",
403
- y: "0",
404
- children: t1
405
- }, void 0, false);
406
- $[1] = id;
407
- $[2] = t2;
408
- } else {
409
- t2 = $[2];
410
- }
411
- return t2;
412
- };
413
- const PATTERN_MAP = {
414
- dots: DotsPattern,
415
- grid: GridPattern,
416
- plus: PlusPattern,
417
- bubbles: BubblesPattern,
418
- "cross-hatch": CrossHatchPattern,
419
- "diagonal-lines": DiagonalLinesPattern,
420
- "falling-triangles": FallingTrianglesPattern,
421
- "4-pointed-star": FourPointedStarPattern,
422
- "tiny-checkers": TinyCheckersPattern,
423
- "overlapping-circles": OverlappingCirclesPattern,
424
- "wiggle-lines": WiggleLinesPattern
425
- };
426
- const ChartBackground = (t0) => {
427
- const $ = c(23);
428
- const {
429
- variant
430
- } = t0;
431
- const t1 = useId();
432
- let t2;
433
- if ($[0] !== t1) {
434
- t2 = t1.replaceAll(":", "");
435
- $[0] = t1;
436
- $[1] = t2;
437
- } else {
438
- t2 = $[1];
439
- }
440
- const baseId = t2;
441
- const patternId = `${baseId}-bg-${variant}`;
442
- const maskId = `${baseId}-bg-edge-fade`;
443
- const filterId = `${baseId}-bg-blur`;
444
- const PatternComponent = PATTERN_MAP[variant];
445
- let t3;
446
- if ($[2] !== PatternComponent || $[3] !== patternId) {
447
- t3 = /* @__PURE__ */ jsxDEV(PatternComponent, {
448
- id: patternId
449
- }, void 0, false);
450
- $[2] = PatternComponent;
451
- $[3] = patternId;
452
- $[4] = t3;
453
- } else {
454
- t3 = $[4];
455
- }
456
- let t4;
457
- if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
458
- t4 = /* @__PURE__ */ jsxDEV("feGaussianBlur", {
459
- stdDeviation: "25"
460
- }, void 0, false);
461
- $[5] = t4;
462
- } else {
463
- t4 = $[5];
464
- }
465
- let t5;
466
- if ($[6] !== filterId) {
467
- t5 = /* @__PURE__ */ jsxDEV("filter", {
468
- id: filterId,
469
- children: t4
470
- }, void 0, false);
471
- $[6] = filterId;
472
- $[7] = t5;
473
- } else {
474
- t5 = $[7];
475
- }
476
- const t6 = `url(#${filterId})`;
477
- let t7;
478
- if ($[8] !== t6) {
479
- t7 = /* @__PURE__ */ jsxDEV("rect", {
480
- fill: "white",
481
- filter: t6,
482
- height: "60%",
483
- width: "85%",
484
- x: "8%",
485
- y: "20%"
486
- }, void 0, false);
487
- $[8] = t6;
488
- $[9] = t7;
489
- } else {
490
- t7 = $[9];
491
- }
492
- let t8;
493
- if ($[10] !== maskId || $[11] !== t7) {
494
- t8 = /* @__PURE__ */ jsxDEV("mask", {
495
- id: maskId,
496
- maskUnits: "userSpaceOnUse",
497
- children: t7
498
- }, void 0, false);
499
- $[10] = maskId;
500
- $[11] = t7;
501
- $[12] = t8;
502
- } else {
503
- t8 = $[12];
504
- }
505
- let t9;
506
- if ($[13] !== t3 || $[14] !== t5 || $[15] !== t8) {
507
- t9 = /* @__PURE__ */ jsxDEV("defs", {
508
- children: [t3, t5, t8]
509
- }, void 0, true);
510
- $[13] = t3;
511
- $[14] = t5;
512
- $[15] = t8;
513
- $[16] = t9;
514
- } else {
515
- t9 = $[16];
516
- }
517
- const t10 = `url(#${patternId})`;
518
- const t11 = `url(#${maskId})`;
519
- let t12;
520
- if ($[17] !== t10 || $[18] !== t11) {
521
- t12 = /* @__PURE__ */ jsxDEV("rect", {
522
- fill: t10,
523
- height: "100%",
524
- mask: t11,
525
- width: "100%"
526
- }, void 0, false);
527
- $[17] = t10;
528
- $[18] = t11;
529
- $[19] = t12;
530
- } else {
531
- t12 = $[19];
532
- }
533
- let t13;
534
- if ($[20] !== t12 || $[21] !== t9) {
535
- t13 = /* @__PURE__ */ jsxDEV(ZIndexLayer, {
536
- zIndex: -1,
537
- children: [t9, t12]
538
- }, void 0, true);
539
- $[20] = t12;
540
- $[21] = t9;
541
- $[22] = t13;
542
- } else {
543
- t13 = $[22];
544
- }
545
- return t13;
546
- };
547
-
548
- const THEMES = {
549
- light: "",
550
- dark: ".dark"
551
- };
552
- const VALID_THEME_KEYS = Object.keys(THEMES);
553
- function validateChartConfigColors(config) {
554
- for (const [key, value] of Object.entries(config)) {
555
- if (value.colors) {
556
- const hasValidThemeKey = VALID_THEME_KEYS.some((themeKey) => value.colors?.[themeKey] !== void 0);
557
- if (!hasValidThemeKey) {
558
- throw new LunoraError("INTERNAL", `[EvilCharts] Invalid chart config for "${key}": colors object must have at least one theme key (${VALID_THEME_KEYS.join(", ")}). Received empty object or invalid keys.`);
559
- }
560
- }
561
- }
562
- }
563
- const ChartContext = /* @__PURE__ */ React.createContext(null);
564
- function useChart() {
565
- const context = React.useContext(ChartContext);
566
- if (!context) {
567
- throw new LunoraError("INTERNAL", "useChart must be used within a <ChartContainer />");
568
- }
569
- return context;
570
- }
571
- const ChartContainer = ({
572
- id,
573
- config,
574
- initialDimension = {
575
- width: 320,
576
- height: 200
577
- },
578
- className,
579
- children,
580
- footer,
581
- ...props
582
- }) => {
583
- const uniqueId = React.useId();
584
- const chartId = `chart-${id ?? uniqueId.replaceAll(":", "")}`;
585
- validateChartConfigColors(config);
586
- return /* @__PURE__ */ jsxDEV(ChartContext.Provider, {
587
- value: {
588
- config
589
- },
590
- children: /* @__PURE__ */ jsxDEV("div", {
591
- className: cn("min-h-0 w-full flex-1", "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-axis-tick_text]:font-mono [&_.recharts-cartesian-axis-tick_text]:text-[11px] [&_.recharts-cartesian-axis-tick_text]:tracking-wide [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border relative flex flex-col justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", !footer && "aspect-video", className),
592
- "data-chart": chartId,
593
- "data-slot": "chart",
594
- ...props,
595
- children: [/* @__PURE__ */ jsxDEV(ChartStyle, {
596
- config,
597
- id: chartId
598
- }, void 0, false), /* @__PURE__ */ jsxDEV(RechartsPrimitive.ResponsiveContainer, {
599
- className: "min-h-0 w-full flex-1",
600
- initialDimension,
601
- children
602
- }, void 0, false), footer]
603
- }, void 0, true)
604
- }, void 0, false);
605
- };
606
- const LoadingIndicator = (t0) => {
607
- const $ = c(1);
608
- const {
609
- isLoading
610
- } = t0;
611
- if (!isLoading) {
612
- return null;
613
- }
614
- let t1;
615
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
616
- t1 = /* @__PURE__ */ jsxDEV("div", {
617
- className: "pointer-events-none absolute inset-0 z-20 flex items-center justify-center",
618
- children: /* @__PURE__ */ jsxDEV("div", {
619
- className: "text-primary bg-background flex items-center justify-center gap-2 rounded-md border px-2 py-0.5 text-sm",
620
- children: [/* @__PURE__ */ jsxDEV("div", {
621
- className: "border-border border-t-primary h-3 w-3 animate-spin rounded-full border"
622
- }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
623
- children: "Loading"
624
- }, void 0, false)]
625
- }, void 0, true)
626
- }, void 0, false);
627
- $[0] = t1;
628
- } else {
629
- t1 = $[0];
630
- }
631
- return t1;
632
- };
633
- function distributeColors(colorsArray, maxCount) {
634
- const availableCount = colorsArray.length;
635
- if (availableCount >= maxCount) {
636
- return colorsArray.slice(0, maxCount);
637
- }
638
- const result = [];
639
- const baseSlots = Math.floor(maxCount / availableCount);
640
- const extraSlots = maxCount % availableCount;
641
- for (let colorIndex = 0; colorIndex < availableCount; colorIndex++) {
642
- const isExtraColor = colorIndex >= availableCount - extraSlots;
643
- const slotsForThisColor = baseSlots + (isExtraColor ? 1 : 0);
644
- for (let j = 0; j < slotsForThisColor; j++) {
645
- result.push(colorsArray[colorIndex]);
646
- }
647
- }
648
- return result;
649
- }
650
- const ChartStyle = (t0) => {
651
- const $ = c(6);
652
- const {
653
- id,
654
- config
655
- } = t0;
656
- let t1;
657
- let t2;
658
- if ($[0] !== config || $[1] !== id) {
659
- t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
660
- bb0: {
661
- const colorConfig = Object.entries(config).filter(_temp$1);
662
- if (colorConfig.length === 0) {
663
- t2 = null;
664
- break bb0;
665
- }
666
- const generateCssVariables = (theme) => colorConfig.flatMap((t32) => {
667
- const [key, itemConfig] = t32;
668
- const colorsArray = itemConfig.colors?.[theme];
669
- if (!colorsArray || !Array.isArray(colorsArray) || colorsArray.length === 0) {
670
- return [];
671
- }
672
- const maxCount = getColorsCount(itemConfig);
673
- const distributedColors = distributeColors(colorsArray, maxCount);
674
- return distributedColors.map((color, index) => ` --color-${key}-${index}: ${color};`);
675
- }).filter(Boolean).join("\n");
676
- t1 = Object.entries(THEMES).map((t4) => {
677
- const [theme_0, prefix] = t4;
678
- return `${prefix} [data-chart=${id}] {
679
- ${generateCssVariables(theme_0)}
680
- }`;
681
- });
682
- }
683
- $[0] = config;
684
- $[1] = id;
685
- $[2] = t1;
686
- $[3] = t2;
687
- } else {
688
- t1 = $[2];
689
- t2 = $[3];
690
- }
691
- if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
692
- return t2;
693
- }
694
- const css = t1.join("\n");
695
- let t3;
696
- if ($[4] !== css) {
697
- t3 = /* @__PURE__ */ jsxDEV("style", {
698
- dangerouslySetInnerHTML: {
699
- __html: css
700
- }
701
- }, void 0, false);
702
- $[4] = css;
703
- $[5] = t3;
704
- } else {
705
- t3 = $[5];
706
- }
707
- return t3;
708
- };
709
- function getPayloadConfigFromPayload(config, payload, key) {
710
- if (typeof payload !== "object" || payload === null) {
711
- return void 0;
712
- }
713
- const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
714
- let configLabelKey = key;
715
- if (key in payload && typeof payload[key] === "string") {
716
- configLabelKey = payload[key];
717
- } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
718
- configLabelKey = payloadPayload[key];
719
- }
720
- return configLabelKey in config ? config[configLabelKey] : config[key];
721
- }
722
- function getColorsCount(config) {
723
- if (!config.colors) {
724
- return 1;
725
- }
726
- const counts = VALID_THEME_KEYS.map((theme) => config.colors?.[theme]?.length ?? 0);
727
- return Math.max(...counts, 1);
728
- }
729
- const getLoadingData = (points = 10, min = 0, max = 70) => {
730
- const range = max - min;
731
- return Array.from({
732
- length: points
733
- }, () => {
734
- return {
735
- loading: Math.floor(Math.random() * range) + min
736
- };
737
- });
738
- };
739
- function _temp$1(t0) {
740
- const [, config_0] = t0;
741
- return config_0.colors;
742
- }
743
-
744
- const SPRING_CONFIG = {
745
- stiffness: 300,
746
- damping: 35,
747
- mass: 0.8
748
- };
749
- function useBrushDrag(t0) {
750
- const $ = c(16);
751
- const {
752
- range,
753
- totalPoints,
754
- containerRef,
755
- commit
756
- } = t0;
757
- const dragRef = React.useRef(null);
758
- const [isDragging, setIsDragging] = React.useState(false);
759
- let t1;
760
- if ($[0] !== containerRef || $[1] !== totalPoints) {
761
- t1 = (px) => {
762
- if (!containerRef.current || totalPoints <= 1) {
763
- return 0;
764
- }
765
- return Math.round(px / containerRef.current.getBoundingClientRect().width * (totalPoints - 1));
766
- };
767
- $[0] = containerRef;
768
- $[1] = totalPoints;
769
- $[2] = t1;
770
- } else {
771
- t1 = $[2];
772
- }
773
- const toIndexDelta = t1;
774
- let t2;
775
- if ($[3] !== range) {
776
- t2 = (e, type) => {
777
- e.preventDefault();
778
- e.target.setPointerCapture(e.pointerId);
779
- dragRef.current = {
780
- type,
781
- originX: e.clientX,
782
- originRange: {
783
- ...range
784
- }
785
- };
786
- setIsDragging(true);
787
- };
788
- $[3] = range;
789
- $[4] = t2;
790
- } else {
791
- t2 = $[4];
792
- }
793
- const onPointerDown = t2;
794
- let t3;
795
- if ($[5] !== commit || $[6] !== toIndexDelta || $[7] !== totalPoints) {
796
- t3 = (e_0) => {
797
- const d = dragRef.current;
798
- if (!d) {
799
- return;
800
- }
801
- const delta = toIndexDelta(e_0.clientX - d.originX);
802
- const {
803
- type: type_0,
804
- originRange: o
805
- } = d;
806
- if (type_0 === "left") {
807
- commit({
808
- startIndex: o.startIndex + delta,
809
- endIndex: o.endIndex
810
- }, "left");
811
- } else {
812
- if (type_0 === "right") {
813
- commit({
814
- startIndex: o.startIndex,
815
- endIndex: o.endIndex + delta
816
- }, "right");
817
- } else {
818
- const span = o.endIndex - o.startIndex;
819
- let s = o.startIndex + delta;
820
- let e2 = s + span;
821
- if (s < 0) {
822
- s = 0;
823
- e2 = span;
824
- }
825
- if (e2 > totalPoints - 1) {
826
- e2 = totalPoints - 1;
827
- s = Math.max(0, e2 - span);
828
- }
829
- commit({
830
- startIndex: s,
831
- endIndex: e2
832
- }, "middle");
833
- }
834
- }
835
- };
836
- $[5] = commit;
837
- $[6] = toIndexDelta;
838
- $[7] = totalPoints;
839
- $[8] = t3;
840
- } else {
841
- t3 = $[8];
842
- }
843
- const onPointerMove = t3;
844
- let t4;
845
- if ($[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
846
- t4 = (e_1) => {
847
- e_1.target.releasePointerCapture(e_1.pointerId);
848
- dragRef.current = null;
849
- setIsDragging(false);
850
- };
851
- $[9] = t4;
852
- } else {
853
- t4 = $[9];
854
- }
855
- const onPointerUp = t4;
856
- let t5;
857
- if ($[10] !== onPointerDown || $[11] !== onPointerMove) {
858
- t5 = (type_1) => ({
859
- onPointerDown: (e_2) => {
860
- onPointerDown(e_2, type_1);
861
- },
862
- onPointerMove,
863
- onPointerUp
864
- });
865
- $[10] = onPointerDown;
866
- $[11] = onPointerMove;
867
- $[12] = t5;
868
- } else {
869
- t5 = $[12];
870
- }
871
- const bind = t5;
872
- let t6;
873
- if ($[13] !== bind || $[14] !== isDragging) {
874
- t6 = {
875
- isDragging,
876
- bind
877
- };
878
- $[13] = bind;
879
- $[14] = isDragging;
880
- $[15] = t6;
881
- } else {
882
- t6 = $[15];
883
- }
884
- return t6;
885
- }
886
- const EvilBrush = ({
887
- data,
888
- chartConfig,
889
- dataKeys,
890
- xDataKey,
891
- variant = "area",
892
- height = 56,
893
- className,
894
- stacked = false,
895
- strokeVariant = "solid",
896
- connectNulls = false,
897
- barRadius,
898
- startIndex: controlledStart,
899
- endIndex: controlledEnd,
900
- defaultStartIndex = 0,
901
- defaultEndIndex,
902
- onChange,
903
- formatLabel,
904
- curveType = "monotone",
905
- minSpan = 2,
906
- showLabels = true,
907
- skipStyle = false
908
- }) => {
909
- const containerRef = React.useRef(null);
910
- const keys = dataKeys ?? Object.keys(chartConfig);
911
- const totalPoints = data.length;
912
- const chartId = React.useId().replaceAll(":", "");
913
- const isControlled = controlledStart !== void 0 && controlledEnd !== void 0;
914
- const [internalRange, setInternalRange] = React.useState(() => {
915
- return {
916
- startIndex: Math.max(0, Math.min(defaultStartIndex, totalPoints - 1)),
917
- endIndex: Math.max(0, Math.min(defaultEndIndex ?? totalPoints - 1, totalPoints - 1))
918
- };
919
- });
920
- const lastCommittedRef = React.useRef(internalRange);
921
- useEffect(() => {
922
- if (!isControlled) {
923
- setInternalRange((previous) => {
924
- const adjusted = {
925
- startIndex: Math.min(previous.startIndex, Math.max(0, totalPoints - 1)),
926
- endIndex: Math.min(previous.endIndex, Math.max(0, totalPoints - 1))
927
- };
928
- lastCommittedRef.current = adjusted;
929
- return adjusted;
930
- });
931
- }
932
- }, [totalPoints, isControlled]);
933
- const clampRange = (range, mode) => {
934
- let {
935
- startIndex,
936
- endIndex
937
- } = range;
938
- const maxIndex = Math.max(0, totalPoints - 1);
939
- startIndex = Math.max(0, Math.min(startIndex, maxIndex));
940
- endIndex = Math.max(0, Math.min(endIndex, maxIndex));
941
- if (mode === "left") {
942
- const maxStart = Math.max(0, endIndex - minSpan);
943
- startIndex = Math.min(startIndex, maxStart);
944
- return {
945
- startIndex,
946
- endIndex
947
- };
948
- }
949
- if (mode === "right") {
950
- const minEnd = Math.min(maxIndex, startIndex + minSpan);
951
- endIndex = Math.max(endIndex, minEnd);
952
- return {
953
- startIndex,
954
- endIndex
955
- };
956
- }
957
- if (endIndex - startIndex < minSpan) {
958
- endIndex = Math.min(startIndex + minSpan, maxIndex);
959
- if (endIndex - startIndex < minSpan) {
960
- startIndex = Math.max(0, endIndex - minSpan);
961
- }
962
- }
963
- return {
964
- startIndex,
965
- endIndex
966
- };
967
- };
968
- const commit = (next, mode_0) => {
969
- const clamped = clampRange(next, mode_0);
970
- const last = lastCommittedRef.current;
971
- if (last.startIndex === clamped.startIndex && last.endIndex === clamped.endIndex) {
972
- return;
973
- }
974
- lastCommittedRef.current = clamped;
975
- setInternalRange(clamped);
976
- React.startTransition(() => {
977
- onChange?.(clamped);
978
- });
979
- };
980
- const {
981
- isDragging,
982
- bind
983
- } = useBrushDrag({
984
- range: internalRange,
985
- totalPoints,
986
- containerRef,
987
- commit
988
- });
989
- const range_0 = internalRange;
990
- useEffect(() => {
991
- if (isControlled && !isDragging) {
992
- const syncedRange = {
993
- startIndex: controlledStart,
994
- endIndex: controlledEnd
995
- };
996
- setInternalRange(syncedRange);
997
- lastCommittedRef.current = syncedRange;
998
- }
999
- }, [isControlled, controlledStart, controlledEnd, isDragging]);
1000
- const leftPct = totalPoints > 1 ? range_0.startIndex / (totalPoints - 1) * 100 : 0;
1001
- const rightPct = totalPoints > 1 ? range_0.endIndex / (totalPoints - 1) * 100 : 100;
1002
- const leftTarget = useMotionValue(leftPct);
1003
- const rightTarget = useMotionValue(rightPct);
1004
- if (leftTarget.get() !== leftPct) {
1005
- leftTarget.set(leftPct);
1006
- }
1007
- if (rightTarget.get() !== rightPct) {
1008
- rightTarget.set(rightPct);
1009
- }
1010
- const leftSpring = useSpring(leftTarget, SPRING_CONFIG);
1011
- const rightSpring = useSpring(rightTarget, SPRING_CONFIG);
1012
- const leftPosition = useTransform(leftSpring, (v) => `${v}%`);
1013
- const rightPosition = useTransform(rightSpring, (v_0) => `${v_0}%`);
1014
- const leftOverlayWidth = useTransform(leftSpring, (v_1) => `${v_1}%`);
1015
- const rightOverlayWidth = useTransform(rightSpring, (v_2) => `${Math.max(0, 100 - v_2)}%`);
1016
- const selectedWidth = useMotionValue(`${Math.max(0, rightPct - leftPct)}%`);
1017
- const updateSelectedWidth = () => {
1018
- selectedWidth.set(`${Math.max(0, rightSpring.get() - leftSpring.get())}%`);
1019
- };
1020
- useMotionValueEvent(leftSpring, "change", updateSelectedWidth);
1021
- useMotionValueEvent(rightSpring, "change", updateSelectedWidth);
1022
- const getLabel = (index) => {
1023
- if (!xDataKey) {
1024
- return String(index);
1025
- }
1026
- const v_3 = data[index]?.[xDataKey];
1027
- return formatLabel ? formatLabel(v_3, index) : String(v_3 ?? index);
1028
- };
1029
- if (totalPoints === 0) {
1030
- return null;
1031
- }
1032
- return /* @__PURE__ */ jsxDEV("div", {
1033
- className: cn("group relative select-none", className),
1034
- "data-chart": skipStyle ? void 0 : chartId,
1035
- ref: containerRef,
1036
- style: {
1037
- height
1038
- },
1039
- children: [!skipStyle && /* @__PURE__ */ jsxDEV(ChartStyle, {
1040
- config: chartConfig,
1041
- id: chartId
1042
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
1043
- className: "absolute inset-0 overflow-hidden rounded-md",
1044
- children: /* @__PURE__ */ jsxDEV(MiniChart, {
1045
- barRadius,
1046
- chartConfig,
1047
- chartId,
1048
- connectNulls,
1049
- curveType,
1050
- data,
1051
- keys,
1052
- stacked,
1053
- strokeVariant: strokeVariant === "animated-dashed" ? "dashed" : strokeVariant,
1054
- variant
1055
- }, void 0, false)
1056
- }, void 0, false), /* @__PURE__ */ jsxDEV(motion.div, {
1057
- className: "bg-background pointer-events-none absolute inset-y-0 start-0 rounded-s-md",
1058
- style: {
1059
- width: leftOverlayWidth
1060
- }
1061
- }, void 0, false), /* @__PURE__ */ jsxDEV(motion.div, {
1062
- className: "bg-background pointer-events-none absolute inset-y-0 end-0 rounded-e-md",
1063
- style: {
1064
- width: rightOverlayWidth
1065
- }
1066
- }, void 0, false), /* @__PURE__ */ jsxDEV(motion.div, {
1067
- className: "absolute inset-y-0 cursor-grab touch-none rounded-sm border active:cursor-grabbing",
1068
- style: {
1069
- left: leftPosition,
1070
- width: selectedWidth
1071
- },
1072
- ...bind("middle")
1073
- }, void 0, false), /* @__PURE__ */ jsxDEV(BrushHandle, {
1074
- bind: bind("left"),
1075
- label: showLabels ? getLabel(range_0.startIndex) : void 0,
1076
- position: leftPosition,
1077
- side: "left"
1078
- }, void 0, false), /* @__PURE__ */ jsxDEV(BrushHandle, {
1079
- bind: bind("right"),
1080
- label: showLabels ? getLabel(range_0.endIndex) : void 0,
1081
- position: rightPosition,
1082
- side: "right"
1083
- }, void 0, false)]
1084
- }, void 0, true);
1085
- };
1086
- const BrushHandle = (t0) => {
1087
- const $ = c(20);
1088
- const {
1089
- side,
1090
- position,
1091
- label,
1092
- bind
1093
- } = t0;
1094
- const isLeft = side === "left";
1095
- let t1;
1096
- if ($[0] !== position) {
1097
- t1 = {
1098
- left: position
1099
- };
1100
- $[0] = position;
1101
- $[1] = t1;
1102
- } else {
1103
- t1 = $[1];
1104
- }
1105
- const t2 = isLeft ? "" : "-translate-x-full rtl:translate-x-full";
1106
- let t3;
1107
- if ($[2] !== t2) {
1108
- t3 = cn("group absolute inset-y-0 flex w-3 cursor-ew-resize touch-none items-center justify-center after:absolute after:inset-y-0 after:-start-4 after:w-11 after:content-['']", t2);
1109
- $[2] = t2;
1110
- $[3] = t3;
1111
- } else {
1112
- t3 = $[3];
1113
- }
1114
- const t4 = isLeft ? "-start-[5.5px]" : "-end-[5.5px]";
1115
- let t5;
1116
- if ($[4] !== t4) {
1117
- t5 = cn("bg-muted-foreground group-hover:bg-foreground relative flex h-4 w-1.5 items-center justify-center rounded-md transition-colors", t4);
1118
- $[4] = t4;
1119
- $[5] = t5;
1120
- } else {
1121
- t5 = $[5];
1122
- }
1123
- let t6;
1124
- if ($[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1125
- t6 = /* @__PURE__ */ jsxDEV("div", {
1126
- className: "flex flex-col gap-[2px]",
1127
- children: [/* @__PURE__ */ jsxDEV("div", {
1128
- className: "bg-background h-[2px] w-[2px] rounded-full"
1129
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
1130
- className: "bg-background h-[2px] w-[2px] rounded-full"
1131
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
1132
- className: "bg-background h-[2px] w-[2px] rounded-full"
1133
- }, void 0, false)]
1134
- }, void 0, true);
1135
- $[6] = t6;
1136
- } else {
1137
- t6 = $[6];
1138
- }
1139
- let t7;
1140
- if ($[7] !== t5) {
1141
- t7 = /* @__PURE__ */ jsxDEV("div", {
1142
- className: t5,
1143
- children: t6
1144
- }, void 0, false);
1145
- $[7] = t5;
1146
- $[8] = t7;
1147
- } else {
1148
- t7 = $[8];
1149
- }
1150
- let t8;
1151
- if ($[9] !== bind || $[10] !== t3 || $[11] !== t7) {
1152
- t8 = /* @__PURE__ */ jsxDEV("div", {
1153
- className: t3,
1154
- ...bind,
1155
- children: t7
1156
- }, void 0, false);
1157
- $[9] = bind;
1158
- $[10] = t3;
1159
- $[11] = t7;
1160
- $[12] = t8;
1161
- } else {
1162
- t8 = $[12];
1163
- }
1164
- let t9;
1165
- if ($[13] !== isLeft || $[14] !== label) {
1166
- t9 = label && /* @__PURE__ */ jsxDEV("div", {
1167
- className: cn("bg-foreground text-background pointer-events-none absolute -bottom-3 -translate-y-1/2 rounded-[3px] px-1 py-px text-[8px] leading-tight font-medium whitespace-nowrap opacity-0 group-hover:opacity-100", isLeft ? "start-1.5" : "end-1.5"),
1168
- children: label
1169
- }, void 0, false);
1170
- $[13] = isLeft;
1171
- $[14] = label;
1172
- $[15] = t9;
1173
- } else {
1174
- t9 = $[15];
1175
- }
1176
- let t10;
1177
- if ($[16] !== t1 || $[17] !== t8 || $[18] !== t9) {
1178
- t10 = /* @__PURE__ */ jsxDEV(motion.div, {
1179
- className: "absolute inset-y-0 z-10",
1180
- style: t1,
1181
- children: [t8, t9]
1182
- }, void 0, true);
1183
- $[16] = t1;
1184
- $[17] = t8;
1185
- $[18] = t9;
1186
- $[19] = t10;
1187
- } else {
1188
- t10 = $[19];
1189
- }
1190
- return t10;
1191
- };
1192
- const MiniChart = ({
1193
- data,
1194
- keys,
1195
- chartConfig,
1196
- variant,
1197
- curveType,
1198
- chartId,
1199
- stacked,
1200
- strokeVariant = "solid",
1201
- connectNulls = false,
1202
- barRadius
1203
- }) => {
1204
- const gradients = Object.entries(chartConfig).filter(([key]) => keys.includes(key)).map(([dataKey, config]) => {
1205
- return {
1206
- dataKey,
1207
- colorsCount: getColorsCount(config)
1208
- };
1209
- });
1210
- const dashArray = strokeVariant === "dashed" || strokeVariant === "animated-dashed" ? "4 4" : void 0;
1211
- const defsContent = /* @__PURE__ */ jsxDEV(Fragment, {
1212
- children: [variant === "area" && /* @__PURE__ */ jsxDEV("linearGradient", {
1213
- id: `${chartId}-zm-vertical-fade`,
1214
- x1: "0",
1215
- x2: "0",
1216
- y1: "0",
1217
- y2: "1",
1218
- children: [/* @__PURE__ */ jsxDEV("stop", {
1219
- offset: "0%",
1220
- stopColor: "white",
1221
- stopOpacity: 0.15
1222
- }, void 0, false), /* @__PURE__ */ jsxDEV("stop", {
1223
- offset: "100%",
1224
- stopColor: "white",
1225
- stopOpacity: 0
1226
- }, void 0, false)]
1227
- }, void 0, true), gradients.map(({
1228
- dataKey: dataKey_0,
1229
- colorsCount
1230
- }) => {
1231
- const colorStops = colorsCount === 1 ? /* @__PURE__ */ jsxDEV(Fragment, {
1232
- children: [/* @__PURE__ */ jsxDEV("stop", {
1233
- offset: "0%",
1234
- stopColor: `var(--color-${dataKey_0}-0)`
1235
- }, void 0, false), /* @__PURE__ */ jsxDEV("stop", {
1236
- offset: "100%",
1237
- stopColor: `var(--color-${dataKey_0}-0)`
1238
- }, void 0, false)]
1239
- }, void 0, true) : Array.from({
1240
- length: colorsCount
1241
- }, (_, i) => /* @__PURE__ */ jsxDEV("stop", {
1242
- offset: `${i / (colorsCount - 1) * 100}%`,
1243
- stopColor: `var(--color-${dataKey_0}-${i}, var(--color-${dataKey_0}-0))`
1244
- }, i, false));
1245
- return /* @__PURE__ */ jsxDEV(React.Fragment, {
1246
- children: [/* @__PURE__ */ jsxDEV("linearGradient", {
1247
- id: `${chartId}-zm-${dataKey_0}`,
1248
- x1: "0",
1249
- x2: "0",
1250
- y1: "0",
1251
- y2: "1",
1252
- children: colorStops
1253
- }, void 0, false), variant === "area" && /* @__PURE__ */ jsxDEV(Fragment, {
1254
- children: [/* @__PURE__ */ jsxDEV("mask", {
1255
- id: `${chartId}-zm-fill-mask-${dataKey_0}`,
1256
- children: /* @__PURE__ */ jsxDEV("rect", {
1257
- fill: `url(#${chartId}-zm-vertical-fade)`,
1258
- height: "100%",
1259
- width: "100%"
1260
- }, void 0, false)
1261
- }, void 0, false), /* @__PURE__ */ jsxDEV("pattern", {
1262
- height: "100%",
1263
- id: `${chartId}-zm-fill-${dataKey_0}`,
1264
- patternUnits: "userSpaceOnUse",
1265
- width: "100%",
1266
- children: /* @__PURE__ */ jsxDEV("rect", {
1267
- fill: `url(#${chartId}-zm-${dataKey_0})`,
1268
- height: "100%",
1269
- mask: `url(#${chartId}-zm-fill-mask-${dataKey_0})`,
1270
- width: "100%"
1271
- }, void 0, false)
1272
- }, void 0, false)]
1273
- }, void 0, true)]
1274
- }, dataKey_0, true);
1275
- })]
1276
- }, void 0, true);
1277
- if (variant === "line") {
1278
- return /* @__PURE__ */ jsxDEV(ResponsiveContainer, {
1279
- height: "100%",
1280
- width: "100%",
1281
- children: /* @__PURE__ */ jsxDEV(LineChart, {
1282
- data,
1283
- margin: {
1284
- top: 4,
1285
- right: 0,
1286
- bottom: 0,
1287
- left: 0
1288
- },
1289
- children: [/* @__PURE__ */ jsxDEV("defs", {
1290
- children: defsContent
1291
- }, void 0, false), keys.map((dk) => /* @__PURE__ */ jsxDEV(Line, {
1292
- activeDot: false,
1293
- connectNulls,
1294
- dataKey: dk,
1295
- dot: false,
1296
- isAnimationActive: false,
1297
- stroke: `url(#${chartId}-zm-${dk})`,
1298
- strokeDasharray: dashArray,
1299
- strokeOpacity: 0.5,
1300
- strokeWidth: 1,
1301
- type: curveType
1302
- }, dk, false))]
1303
- }, void 0, true)
1304
- }, void 0, false);
1305
- }
1306
- if (variant === "bar") {
1307
- const r = barRadius ?? 3;
1308
- return /* @__PURE__ */ jsxDEV(ResponsiveContainer, {
1309
- height: "100%",
1310
- width: "100%",
1311
- children: /* @__PURE__ */ jsxDEV(BarChart, {
1312
- barGap: 2,
1313
- barSize: 14,
1314
- data,
1315
- margin: {
1316
- top: 2,
1317
- right: 0,
1318
- bottom: 0,
1319
- left: 0
1320
- },
1321
- children: [/* @__PURE__ */ jsxDEV("defs", {
1322
- children: defsContent
1323
- }, void 0, false), keys.map((dk_0) => /* @__PURE__ */ jsxDEV(Bar$1, {
1324
- dataKey: dk_0,
1325
- fill: `url(#${chartId}-zm-${dk_0})`,
1326
- fillOpacity: 0.35,
1327
- isAnimationActive: false,
1328
- radius: [r, r, r, r],
1329
- stackId: stacked ? "zm-stack" : void 0
1330
- }, dk_0, false))]
1331
- }, void 0, true)
1332
- }, void 0, false);
1333
- }
1334
- return /* @__PURE__ */ jsxDEV(ResponsiveContainer, {
1335
- height: "100%",
1336
- width: "100%",
1337
- children: /* @__PURE__ */ jsxDEV(AreaChart, {
1338
- data,
1339
- margin: {
1340
- top: 4,
1341
- right: 0,
1342
- bottom: 0,
1343
- left: 0
1344
- },
1345
- children: [/* @__PURE__ */ jsxDEV("defs", {
1346
- children: defsContent
1347
- }, void 0, false), keys.map((dk_1) => /* @__PURE__ */ jsxDEV(Area, {
1348
- activeDot: false,
1349
- connectNulls,
1350
- dataKey: dk_1,
1351
- dot: false,
1352
- fill: `url(#${chartId}-zm-fill-${dk_1})`,
1353
- fillOpacity: 1,
1354
- isAnimationActive: false,
1355
- stackId: stacked ? "zm-stack" : void 0,
1356
- stroke: `url(#${chartId}-zm-${dk_1})`,
1357
- strokeDasharray: dashArray,
1358
- strokeOpacity: 0.5,
1359
- strokeWidth: 1,
1360
- type: curveType
1361
- }, dk_1, false))]
1362
- }, void 0, true)
1363
- }, void 0, false);
1364
- };
1365
- function useEvilBrush({
1366
- data,
1367
- defaultStartIndex = 0,
1368
- defaultEndIndex
1369
- }) {
1370
- const [range, setRange] = React.useState({
1371
- startIndex: defaultStartIndex,
1372
- endIndex: defaultEndIndex ?? Math.max(0, data.length - 1)
1373
- });
1374
- const deferredRange = React.useDeferredValue(range);
1375
- useEffect(() => {
1376
- setRange({
1377
- startIndex: 0,
1378
- endIndex: Math.max(0, data.length - 1)
1379
- });
1380
- }, [data.length]);
1381
- const visibleData = data.slice(deferredRange.startIndex, deferredRange.endIndex + 1);
1382
- return {
1383
- range,
1384
- visibleData,
1385
- brushProps: {
1386
- startIndex: range.startIndex,
1387
- endIndex: range.endIndex,
1388
- onChange: setRange
1389
- }
1390
- };
1391
- }
1392
-
1393
- const roundnessMap = {
1394
- sm: "rounded-sm",
1395
- md: "rounded-md",
1396
- lg: "rounded-lg",
1397
- xl: "rounded-xl"
1398
- };
1399
- const variantMap = {
1400
- default: "bg-background",
1401
- "frosted-glass": "bg-background"
1402
- };
1403
- const ChartTooltipContent = ({
1404
- active,
1405
- payload,
1406
- className,
1407
- indicator = "dot",
1408
- hideLabel = false,
1409
- hideIndicator = false,
1410
- label,
1411
- labelFormatter,
1412
- labelClassName,
1413
- formatter,
1414
- nameKey,
1415
- labelKey,
1416
- selected,
1417
- roundness = "lg",
1418
- variant = "default"
1419
- }) => {
1420
- const {
1421
- config
1422
- } = useChart();
1423
- const tooltipLabel = React.useMemo(() => {
1424
- if (hideLabel || !payload?.length) {
1425
- return null;
1426
- }
1427
- const [item] = payload;
1428
- const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`;
1429
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
1430
- const value = !labelKey && typeof label === "string" ? config[label]?.label ?? label : itemConfig?.label;
1431
- if (labelFormatter) {
1432
- return /* @__PURE__ */ jsxDEV("div", {
1433
- className: cn("font-medium", labelClassName),
1434
- children: labelFormatter(value, payload)
1435
- }, void 0, false);
1436
- }
1437
- if (!value) {
1438
- return null;
1439
- }
1440
- return /* @__PURE__ */ jsxDEV("div", {
1441
- className: cn("font-medium", labelClassName),
1442
- children: value
1443
- }, void 0, false);
1444
- }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
1445
- if (!active || !payload?.length) {
1446
- return /* @__PURE__ */ jsxDEV("span", {
1447
- className: "p-4"
1448
- }, void 0, false);
1449
- }
1450
- const nestLabel = payload.length === 1 && indicator !== "dot";
1451
- return /* @__PURE__ */ jsxDEV("div", {
1452
- className: cn("border-border/50 grid min-w-32 items-start gap-1.5 border px-2.5 py-1.5 text-xs", roundnessMap[roundness], variantMap[variant], className),
1453
- children: [nestLabel ? null : tooltipLabel, /* @__PURE__ */ jsxDEV("div", {
1454
- className: "grid gap-1.5",
1455
- children: payload.filter((item_0) => item_0.type !== "none").map((item_1, index) => {
1456
- const payloadName = nameKey && item_1.payload ? item_1.payload[nameKey] : void 0;
1457
- const key_0 = `${payloadName ?? item_1.name ?? item_1.dataKey ?? "value"}`;
1458
- const itemConfig_0 = getPayloadConfigFromPayload(config, item_1, key_0);
1459
- const colorsCount = itemConfig_0 ? getColorsCount(itemConfig_0) : 1;
1460
- return /* @__PURE__ */ jsxDEV("div", {
1461
- className: cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", indicator === "dot" && "items-center", selected != null && selected !== item_1.dataKey && "opacity-30"),
1462
- children: formatter && item_1?.value !== void 0 && item_1.name ? formatter(item_1.value, item_1.name, item_1, index, item_1.payload) : /* @__PURE__ */ jsxDEV(Fragment, {
1463
- children: [itemConfig_0?.icon ? /* @__PURE__ */ jsxDEV(itemConfig_0.icon, {}, void 0, false) : !hideIndicator && /* @__PURE__ */ jsxDEV("div", {
1464
- className: cn("shrink-0 rounded-[2px]", {
1465
- "h-2.5 w-2.5": indicator === "dot",
1466
- "w-1": indicator === "line",
1467
- "w-0 border-[1.5px] border-dashed bg-transparent!": indicator === "dashed",
1468
- "my-0.5": nestLabel && indicator === "dashed"
1469
- }),
1470
- style: getIndicatorColorStyle(key_0, colorsCount)
1471
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
1472
- className: cn("flex flex-1 justify-between gap-4 leading-none", nestLabel ? "items-end" : "items-center"),
1473
- children: [/* @__PURE__ */ jsxDEV("div", {
1474
- className: "grid gap-1.5",
1475
- children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsxDEV("span", {
1476
- className: "text-muted-foreground",
1477
- children: itemConfig_0?.label ?? item_1.name
1478
- }, void 0, false)]
1479
- }, void 0, true), item_1.value != null && /* @__PURE__ */ jsxDEV("span", {
1480
- className: "text-foreground font-mono font-medium tabular-nums",
1481
- children: typeof item_1.value === "number" ? item_1.value.toLocaleString() : String(item_1.value)
1482
- }, void 0, false)]
1483
- }, void 0, true)]
1484
- }, void 0, true)
1485
- }, index, false);
1486
- })
1487
- }, void 0, false)]
1488
- }, void 0, true);
1489
- };
1490
- function getIndicatorColorStyle(dataKey, colorsCount) {
1491
- if (colorsCount <= 1) {
1492
- return {
1493
- background: `var(--color-${dataKey}-0)`
1494
- };
1495
- }
1496
- const stops = Array.from({
1497
- length: colorsCount
1498
- }, (_, index) => {
1499
- const offset = index / (colorsCount - 1) * 100;
1500
- return `var(--color-${dataKey}-${index}) ${offset}%`;
1501
- }).join(", ");
1502
- return {
1503
- background: `linear-gradient(to right, ${stops})`
1504
- };
1505
- }
1506
- const ChartTooltip = ({
1507
- animationDuration = 200,
1508
- ...props
1509
- }) => /* @__PURE__ */ jsxDEV(RechartsPrimitive.Tooltip, {
1510
- animationDuration,
1511
- ...props
1512
- }, void 0, false);
1513
-
1514
- const DEFAULT_BAR_RADIUS = 2;
1515
- const LOADING_BAR_DATA_KEY = "loading";
1516
- const LOADING_ANIMATION_DURATION = 2e3;
1517
- const STACK_ID = "evil-stacked";
1518
- const BAR_GROW_DURATION = 0.5;
1519
- const BAR_STAGGER = 0.05;
1520
- const REVEAL_EASE = [0, 0.7, 0.5, 1];
1521
- const BarChartContext = /* @__PURE__ */ createContext(null);
1522
- function useBarChart() {
1523
- const context = use(BarChartContext);
1524
- if (!context) {
1525
- throw new LunoraError("INTERNAL", "Bar chart parts (<Bar />, <XAxis />, …) must be used within <EvilBarChart />");
1526
- }
1527
- return context;
1528
- }
1529
- const EvilBarChart = ({
1530
- config,
1531
- data,
1532
- children,
1533
- className,
1534
- chartProps,
1535
- stackType = "default",
1536
- layout = "vertical",
1537
- barRadius = DEFAULT_BAR_RADIUS,
1538
- animationType = "left-to-right",
1539
- barGap,
1540
- barCategoryGap,
1541
- backgroundVariant,
1542
- defaultSelectedDataKey = null,
1543
- onSelectionChange,
1544
- isLoading = false,
1545
- loadingBars,
1546
- showBrush = false,
1547
- xDataKey,
1548
- brushHeight,
1549
- brushFormatLabel,
1550
- onBrushChange
1551
- }) => {
1552
- const chartId = useId().replaceAll(":", "");
1553
- const [introStartedAt] = useState(() => Date.now());
1554
- const [selectedDataKey, setSelectedDataKey] = useState(defaultSelectedDataKey);
1555
- const [isMouseInChart, setIsMouseInChart] = useState(false);
1556
- const {
1557
- loadingData,
1558
- onShimmerExit
1559
- } = useLoadingData(isLoading, loadingBars);
1560
- const {
1561
- visibleData,
1562
- brushProps
1563
- } = useEvilBrush({
1564
- data
1565
- });
1566
- const isStacked = stackType === "stacked" || stackType === "percent";
1567
- const isHorizontal = layout === "horizontal";
1568
- const displayData = showBrush && !isLoading ? visibleData : data;
1569
- const selectDataKey = (newSelectedDataKey) => {
1570
- setSelectedDataKey(newSelectedDataKey);
1571
- onSelectionChange?.(newSelectedDataKey);
1572
- };
1573
- const contextValue = {
1574
- config,
1575
- isStacked,
1576
- isHorizontal,
1577
- isLoading,
1578
- barRadius,
1579
- animationType,
1580
- introStartedAt,
1581
- dataLength: displayData.length,
1582
- selectedDataKey,
1583
- selectDataKey,
1584
- isMouseInChart
1585
- };
1586
- return /* @__PURE__ */ jsxDEV(BarChartContext, {
1587
- value: contextValue,
1588
- children: /* @__PURE__ */ jsxDEV(ChartContainer, {
1589
- className,
1590
- config,
1591
- footer: showBrush && !isLoading && /* @__PURE__ */ jsxDEV(EvilBrush, {
1592
- barRadius,
1593
- chartConfig: config,
1594
- className: "mt-1",
1595
- data,
1596
- formatLabel: brushFormatLabel,
1597
- height: brushHeight,
1598
- skipStyle: true,
1599
- stacked: isStacked,
1600
- variant: "bar",
1601
- xDataKey,
1602
- ...brushProps,
1603
- onChange: (range) => {
1604
- brushProps.onChange(range);
1605
- onBrushChange?.(range);
1606
- }
1607
- }, void 0, false),
1608
- children: [/* @__PURE__ */ jsxDEV(LoadingIndicator, {
1609
- isLoading
1610
- }, void 0, false), /* @__PURE__ */ jsxDEV(BarChart, {
1611
- accessibilityLayer: true,
1612
- barCategoryGap,
1613
- barGap,
1614
- data: isLoading ? loadingData : displayData,
1615
- id: chartId,
1616
- layout: isHorizontal ? "vertical" : "horizontal",
1617
- onMouseEnter: () => {
1618
- setIsMouseInChart(true);
1619
- },
1620
- onMouseLeave: () => {
1621
- setIsMouseInChart(false);
1622
- },
1623
- stackOffset: stackType === "percent" ? "expand" : void 0,
1624
- ...chartProps,
1625
- children: [backgroundVariant && /* @__PURE__ */ jsxDEV(ChartBackground, {
1626
- variant: backgroundVariant
1627
- }, void 0, false), /* @__PURE__ */ jsxDEV(ReferenceLine, {
1628
- stroke: "var(--border)"
1629
- }, void 0, false), children, isLoading && /* @__PURE__ */ jsxDEV(LoadingBar, {
1630
- chartId,
1631
- onShimmerExit
1632
- }, void 0, false)]
1633
- }, void 0, true)]
1634
- }, void 0, true)
1635
- }, void 0, false);
1636
- };
1637
- const Bar = ({
1638
- dataKey,
1639
- variant = "default",
1640
- radius,
1641
- animationType,
1642
- isClickable = false,
1643
- enableHoverHighlight = false,
1644
- glowing = false,
1645
- bufferBar = false,
1646
- barProps
1647
- }) => {
1648
- const {
1649
- config,
1650
- isStacked,
1651
- isHorizontal,
1652
- isLoading,
1653
- barRadius: defaultRadius,
1654
- animationType: defaultAnimation,
1655
- introStartedAt,
1656
- dataLength,
1657
- selectedDataKey,
1658
- selectDataKey,
1659
- isMouseInChart
1660
- } = useBarChart();
1661
- const id = useId().replaceAll(":", "");
1662
- const shouldReduceMotion = useReducedMotion();
1663
- if (isLoading) {
1664
- return null;
1665
- }
1666
- const resolvedRadius = radius ?? defaultRadius;
1667
- const isSelected = selectedDataKey === dataKey;
1668
- const revealType = shouldReduceMotion ? "none" : animationType ?? defaultAnimation;
1669
- const customBarProps = {
1670
- id,
1671
- dataKey,
1672
- variant,
1673
- barRadius: resolvedRadius,
1674
- glowing,
1675
- bufferBar,
1676
- isClickable,
1677
- enableHoverHighlight,
1678
- isMouseInChart,
1679
- isHorizontal,
1680
- introStartedAt,
1681
- selectedDataKey,
1682
- dataLength,
1683
- onClick: () => {
1684
- if (!isClickable) {
1685
- return;
1686
- }
1687
- selectDataKey(isSelected ? null : dataKey);
1688
- }
1689
- };
1690
- return /* @__PURE__ */ jsxDEV(Fragment, {
1691
- children: [/* @__PURE__ */ jsxDEV(Bar$1, {
1692
- activeBar: (props) => (
1693
- // The active (hovered) bar must never re-run the grow-in animation
1694
- /* @__PURE__ */ jsxDEV(CustomBar, {
1695
- ...props,
1696
- ...customBarProps,
1697
- animationType: "none"
1698
- }, void 0, false)
1699
- ),
1700
- dataKey,
1701
- fill: `url(#${id}-colors-${dataKey})`,
1702
- isAnimationActive: false,
1703
- radius: resolvedRadius,
1704
- shape: (props_0) => /* @__PURE__ */ jsxDEV(CustomBar, {
1705
- ...props_0,
1706
- ...customBarProps,
1707
- animationType: revealType
1708
- }, void 0, false),
1709
- stackId: isStacked ? STACK_ID : void 0,
1710
- style: isClickable || enableHoverHighlight ? {
1711
- cursor: "pointer"
1712
- } : void 0,
1713
- ...barProps
1714
- }, void 0, false), /* @__PURE__ */ jsxDEV("defs", {
1715
- children: [/* @__PURE__ */ jsxDEV(ColorGradient, {
1716
- config,
1717
- dataKey,
1718
- id
1719
- }, void 0, false), variant === "hatched" && /* @__PURE__ */ jsxDEV(HatchedPattern, {
1720
- dataKey,
1721
- id
1722
- }, void 0, false), variant === "duotone" && /* @__PURE__ */ jsxDEV(DuotonePattern, {
1723
- config,
1724
- dataKey,
1725
- id
1726
- }, void 0, false), variant === "duotone-reverse" && /* @__PURE__ */ jsxDEV(DuotoneReversePattern, {
1727
- config,
1728
- dataKey,
1729
- id
1730
- }, void 0, false), variant === "gradient" && /* @__PURE__ */ jsxDEV(GradientPattern, {
1731
- dataKey,
1732
- id
1733
- }, void 0, false), variant === "stripped" && /* @__PURE__ */ jsxDEV(StrippedPattern, {
1734
- dataKey,
1735
- id
1736
- }, void 0, false), bufferBar && /* @__PURE__ */ jsxDEV(BufferHatchedPattern, {
1737
- dataKey,
1738
- id
1739
- }, void 0, false), glowing && /* @__PURE__ */ jsxDEV(GlowFilter, {
1740
- dataKey,
1741
- id
1742
- }, void 0, false)]
1743
- }, void 0, true)]
1744
- }, void 0, true);
1745
- };
1746
- const XAxis = ({
1747
- tickLine = false,
1748
- axisLine = false,
1749
- tickMargin = 8,
1750
- minTickGap = 8,
1751
- type,
1752
- ...props
1753
- }) => {
1754
- const {
1755
- isLoading,
1756
- isHorizontal
1757
- } = useBarChart();
1758
- if (isLoading) {
1759
- return null;
1760
- }
1761
- return /* @__PURE__ */ jsxDEV(XAxis$1, {
1762
- axisLine,
1763
- minTickGap,
1764
- tickLine,
1765
- tickMargin,
1766
- type: type ?? (isHorizontal ? "number" : "category"),
1767
- ...props
1768
- }, void 0, false);
1769
- };
1770
- const Tooltip = (t0) => {
1771
- const $ = c(7);
1772
- const {
1773
- variant,
1774
- roundness,
1775
- defaultIndex
1776
- } = t0;
1777
- const {
1778
- isLoading,
1779
- selectedDataKey
1780
- } = useBarChart();
1781
- if (isLoading) {
1782
- return null;
1783
- }
1784
- let t1;
1785
- if ($[0] !== roundness || $[1] !== selectedDataKey || $[2] !== variant) {
1786
- t1 = /* @__PURE__ */ jsxDEV(ChartTooltipContent, {
1787
- roundness,
1788
- selected: selectedDataKey,
1789
- variant
1790
- }, void 0, false);
1791
- $[0] = roundness;
1792
- $[1] = selectedDataKey;
1793
- $[2] = variant;
1794
- $[3] = t1;
1795
- } else {
1796
- t1 = $[3];
1797
- }
1798
- let t2;
1799
- if ($[4] !== defaultIndex || $[5] !== t1) {
1800
- t2 = /* @__PURE__ */ jsxDEV(ChartTooltip, {
1801
- content: t1,
1802
- cursor: false,
1803
- defaultIndex
1804
- }, void 0, false);
1805
- $[4] = defaultIndex;
1806
- $[5] = t1;
1807
- $[6] = t2;
1808
- } else {
1809
- t2 = $[6];
1810
- }
1811
- return t2;
1812
- };
1813
- const CustomBar = (props) => {
1814
- const {
1815
- x = 0,
1816
- y = 0,
1817
- width = 0,
1818
- height = 0,
1819
- id,
1820
- dataKey,
1821
- variant,
1822
- barRadius,
1823
- glowing,
1824
- bufferBar,
1825
- isClickable,
1826
- enableHoverHighlight,
1827
- isMouseInChart,
1828
- isHorizontal = false,
1829
- animationType = "none",
1830
- introStartedAt = 0,
1831
- selectedDataKey,
1832
- isActive,
1833
- dataLength = 0,
1834
- onClick
1835
- } = props;
1836
- const index = typeof props.index === "number" ? props.index : -1;
1837
- const isLastBar = bufferBar && dataLength > 0 && index === dataLength - 1;
1838
- const isStripped = variant === "stripped";
1839
- const grow = getBarGrowAnimation(animationType, index, dataLength, isHorizontal, introStartedAt);
1840
- const fill = isLastBar ? `url(#${id}-buffer-hatched-${dataKey})` : getVariantFill(variant, id, dataKey);
1841
- const filter = glowing ? `url(#${id}-bar-glow-${dataKey})` : void 0;
1842
- const fillOpacity = getBarOpacity({
1843
- isClickable,
1844
- selectedDataKey,
1845
- dataKey,
1846
- enableHoverHighlight,
1847
- isMouseInChart,
1848
- isActive
1849
- });
1850
- const cursorStyle = isClickable || enableHoverHighlight ? {
1851
- cursor: "pointer"
1852
- } : void 0;
1853
- const radius = isStripped ? [barRadius, barRadius, 0, 0] : barRadius;
1854
- const visibleBar = /* @__PURE__ */ jsxDEV(Fragment, {
1855
- children: [/* @__PURE__ */ jsxDEV(Rectangle, {
1856
- fill,
1857
- filter,
1858
- height: Math.max(0, height - 3),
1859
- opacity: fillOpacity,
1860
- radius,
1861
- stroke: isLastBar ? `url(#${id}-colors-${dataKey})` : void 0,
1862
- strokeWidth: isLastBar ? 1 : void 0,
1863
- width,
1864
- x,
1865
- y
1866
- }, void 0, false), isStripped && /* @__PURE__ */ jsxDEV(Rectangle, {
1867
- fill: `url(#${id}-colors-${dataKey})`,
1868
- height: 2,
1869
- radius: 1,
1870
- width,
1871
- x,
1872
- y: y - 4
1873
- }, void 0, false)]
1874
- }, void 0, true);
1875
- return /* @__PURE__ */ jsxDEV("g", {
1876
- onClick,
1877
- style: cursorStyle,
1878
- children: [/* @__PURE__ */ jsxDEV(Rectangle, {
1879
- ...props,
1880
- fill: "transparent"
1881
- }, void 0, false), grow ? /* @__PURE__ */ jsxDEV(motion.g, {
1882
- animate: grow.animate,
1883
- initial: grow.initial,
1884
- style: grow.style,
1885
- transition: grow.transition,
1886
- children: visibleBar
1887
- }, void 0, false) : visibleBar]
1888
- }, void 0, true);
1889
- };
1890
- const getBarGrowAnimation = (animationType, index, dataLength, isHorizontal, introStartedAt) => {
1891
- if (animationType === "none" || index < 0 || dataLength <= 0) {
1892
- return null;
1893
- }
1894
- const lastIndex = dataLength - 1;
1895
- const center = lastIndex / 2;
1896
- let step;
1897
- switch (animationType) {
1898
- case "center-out": {
1899
- step = Math.abs(index - center);
1900
- break;
1901
- }
1902
- case "edges-in": {
1903
- step = center - Math.abs(index - center);
1904
- break;
1905
- }
1906
- case "right-to-left": {
1907
- step = lastIndex - index;
1908
- break;
1909
- }
1910
- default: {
1911
- step = index;
1912
- }
1913
- }
1914
- const startMs = step * BAR_STAGGER * 1e3;
1915
- const durationMs = BAR_GROW_DURATION * 1e3;
1916
- const endMs = startMs + durationMs;
1917
- const elapsed = Date.now() - introStartedAt;
1918
- if (elapsed >= endMs) {
1919
- return null;
1920
- }
1921
- const from = elapsed <= startMs ? 0 : (elapsed - startMs) / durationMs;
1922
- const transition = {
1923
- duration: (endMs - Math.max(elapsed, startMs)) / 1e3,
1924
- ease: REVEAL_EASE,
1925
- delay: Math.max(0, startMs - elapsed) / 1e3
1926
- };
1927
- return isHorizontal ? {
1928
- initial: {
1929
- scaleX: from
1930
- },
1931
- animate: {
1932
- scaleX: 1
1933
- },
1934
- transition,
1935
- style: {
1936
- originX: 0
1937
- }
1938
- } : {
1939
- initial: {
1940
- scaleY: from
1941
- },
1942
- animate: {
1943
- scaleY: 1
1944
- },
1945
- transition,
1946
- style: {
1947
- originY: 1
1948
- }
1949
- };
1950
- };
1951
- const getVariantFill = (variant, id, dataKey) => {
1952
- switch (variant) {
1953
- case "duotone": {
1954
- return `url(#${id}-duotone-${dataKey})`;
1955
- }
1956
- case "duotone-reverse": {
1957
- return `url(#${id}-duotone-reverse-${dataKey})`;
1958
- }
1959
- case "gradient": {
1960
- return `url(#${id}-gradient-${dataKey})`;
1961
- }
1962
- case "hatched": {
1963
- return `url(#${id}-hatched-${dataKey})`;
1964
- }
1965
- case "stripped": {
1966
- return `url(#${id}-stripped-${dataKey})`;
1967
- }
1968
- default: {
1969
- return `url(#${id}-colors-${dataKey})`;
1970
- }
1971
- }
1972
- };
1973
- const getBarOpacity = ({
1974
- isClickable,
1975
- selectedDataKey,
1976
- dataKey,
1977
- enableHoverHighlight,
1978
- isMouseInChart,
1979
- isActive
1980
- }) => {
1981
- const isSelectedDataKey = selectedDataKey === null || selectedDataKey === dataKey;
1982
- const clickOpacity = isClickable && selectedDataKey !== null ? isSelectedDataKey ? 1 : 0.3 : 1;
1983
- if (enableHoverHighlight && isMouseInChart) {
1984
- return isActive ? clickOpacity : clickOpacity * 0.3;
1985
- }
1986
- return clickOpacity;
1987
- };
1988
- const ColorGradient = (t0) => {
1989
- const $ = c(16);
1990
- const {
1991
- id,
1992
- dataKey,
1993
- config
1994
- } = t0;
1995
- let t1;
1996
- let t2;
1997
- let t3;
1998
- let t4;
1999
- let t5;
2000
- let t6;
2001
- if ($[0] !== config || $[1] !== dataKey || $[2] !== id) {
2002
- const colorsCount = getColorsCount(config[dataKey] ?? {});
2003
- t1 = `${id}-colors-${dataKey}`;
2004
- t2 = "0";
2005
- t3 = "0";
2006
- t4 = "0";
2007
- t5 = "1";
2008
- t6 = colorsCount === 1 ? /* @__PURE__ */ jsxDEV(Fragment, {
2009
- children: [/* @__PURE__ */ jsxDEV("stop", {
2010
- offset: "0%",
2011
- stopColor: `var(--color-${dataKey}-0)`
2012
- }, void 0, false), /* @__PURE__ */ jsxDEV("stop", {
2013
- offset: "100%",
2014
- stopColor: `var(--color-${dataKey}-0)`
2015
- }, void 0, false)]
2016
- }, void 0, true) : Array.from({
2017
- length: colorsCount
2018
- }, (_, index) => {
2019
- const offset = `${index / (colorsCount - 1) * 100}%`;
2020
- return /* @__PURE__ */ jsxDEV("stop", {
2021
- offset,
2022
- stopColor: `var(--color-${dataKey}-${index}, var(--color-${dataKey}-0))`
2023
- }, offset, false);
2024
- });
2025
- $[0] = config;
2026
- $[1] = dataKey;
2027
- $[2] = id;
2028
- $[3] = t1;
2029
- $[4] = t2;
2030
- $[5] = t3;
2031
- $[6] = t4;
2032
- $[7] = t5;
2033
- $[8] = t6;
2034
- } else {
2035
- t1 = $[3];
2036
- t2 = $[4];
2037
- t3 = $[5];
2038
- t4 = $[6];
2039
- t5 = $[7];
2040
- t6 = $[8];
2041
- }
2042
- let t7;
2043
- if ($[9] !== t1 || $[10] !== t2 || $[11] !== t3 || $[12] !== t4 || $[13] !== t5 || $[14] !== t6) {
2044
- t7 = /* @__PURE__ */ jsxDEV("linearGradient", {
2045
- id: t1,
2046
- x1: t2,
2047
- x2: t3,
2048
- y1: t4,
2049
- y2: t5,
2050
- children: t6
2051
- }, void 0, false);
2052
- $[9] = t1;
2053
- $[10] = t2;
2054
- $[11] = t3;
2055
- $[12] = t4;
2056
- $[13] = t5;
2057
- $[14] = t6;
2058
- $[15] = t7;
2059
- } else {
2060
- t7 = $[15];
2061
- }
2062
- return t7;
2063
- };
2064
- const HatchedPattern = (t0) => {
2065
- const $ = c(19);
2066
- const {
2067
- id,
2068
- dataKey
2069
- } = t0;
2070
- const t1 = `${id}-hatched-mask-pattern`;
2071
- let t2;
2072
- let t3;
2073
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2074
- t2 = /* @__PURE__ */ jsxDEV("rect", {
2075
- fill: "white",
2076
- fillOpacity: 0.3,
2077
- height: "5",
2078
- width: "5"
2079
- }, void 0, false);
2080
- t3 = /* @__PURE__ */ jsxDEV("rect", {
2081
- fill: "white",
2082
- fillOpacity: 1,
2083
- height: "5",
2084
- width: "1.5"
2085
- }, void 0, false);
2086
- $[0] = t2;
2087
- $[1] = t3;
2088
- } else {
2089
- t2 = $[0];
2090
- t3 = $[1];
2091
- }
2092
- let t4;
2093
- if ($[2] !== t1) {
2094
- t4 = /* @__PURE__ */ jsxDEV("pattern", {
2095
- height: "5",
2096
- id: t1,
2097
- patternTransform: "rotate(-45)",
2098
- patternUnits: "userSpaceOnUse",
2099
- width: "5",
2100
- x: "0",
2101
- y: "0",
2102
- children: [t2, t3]
2103
- }, void 0, true);
2104
- $[2] = t1;
2105
- $[3] = t4;
2106
- } else {
2107
- t4 = $[3];
2108
- }
2109
- const t5 = `${id}-hatched-mask-${dataKey}`;
2110
- const t6 = `url(#${id}-hatched-mask-pattern)`;
2111
- let t7;
2112
- if ($[4] !== t6) {
2113
- t7 = /* @__PURE__ */ jsxDEV("rect", {
2114
- fill: t6,
2115
- height: "100%",
2116
- width: "100%"
2117
- }, void 0, false);
2118
- $[4] = t6;
2119
- $[5] = t7;
2120
- } else {
2121
- t7 = $[5];
2122
- }
2123
- let t8;
2124
- if ($[6] !== t5 || $[7] !== t7) {
2125
- t8 = /* @__PURE__ */ jsxDEV("mask", {
2126
- id: t5,
2127
- children: t7
2128
- }, void 0, false);
2129
- $[6] = t5;
2130
- $[7] = t7;
2131
- $[8] = t8;
2132
- } else {
2133
- t8 = $[8];
2134
- }
2135
- const t9 = `${id}-hatched-${dataKey}`;
2136
- const t10 = `url(#${id}-colors-${dataKey})`;
2137
- const t11 = `url(#${id}-hatched-mask-${dataKey})`;
2138
- let t12;
2139
- if ($[9] !== t10 || $[10] !== t11) {
2140
- t12 = /* @__PURE__ */ jsxDEV("rect", {
2141
- fill: t10,
2142
- height: "100%",
2143
- mask: t11,
2144
- width: "100%"
2145
- }, void 0, false);
2146
- $[9] = t10;
2147
- $[10] = t11;
2148
- $[11] = t12;
2149
- } else {
2150
- t12 = $[11];
2151
- }
2152
- let t13;
2153
- if ($[12] !== t12 || $[13] !== t9) {
2154
- t13 = /* @__PURE__ */ jsxDEV("pattern", {
2155
- height: "100%",
2156
- id: t9,
2157
- patternUnits: "userSpaceOnUse",
2158
- width: "100%",
2159
- children: t12
2160
- }, void 0, false);
2161
- $[12] = t12;
2162
- $[13] = t9;
2163
- $[14] = t13;
2164
- } else {
2165
- t13 = $[14];
2166
- }
2167
- let t14;
2168
- if ($[15] !== t13 || $[16] !== t4 || $[17] !== t8) {
2169
- t14 = /* @__PURE__ */ jsxDEV(Fragment, {
2170
- children: [t4, t8, t13]
2171
- }, void 0, true);
2172
- $[15] = t13;
2173
- $[16] = t4;
2174
- $[17] = t8;
2175
- $[18] = t14;
2176
- } else {
2177
- t14 = $[18];
2178
- }
2179
- return t14;
2180
- };
2181
- const BufferHatchedPattern = (t0) => {
2182
- const $ = c(19);
2183
- const {
2184
- id,
2185
- dataKey
2186
- } = t0;
2187
- const t1 = `${id}-buffer-hatched-mask-pattern`;
2188
- let t2;
2189
- let t3;
2190
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2191
- t2 = /* @__PURE__ */ jsxDEV("rect", {
2192
- fill: "black",
2193
- fillOpacity: 0,
2194
- height: "5",
2195
- width: "5"
2196
- }, void 0, false);
2197
- t3 = /* @__PURE__ */ jsxDEV("rect", {
2198
- fill: "white",
2199
- fillOpacity: 1,
2200
- height: "5",
2201
- width: "1"
2202
- }, void 0, false);
2203
- $[0] = t2;
2204
- $[1] = t3;
2205
- } else {
2206
- t2 = $[0];
2207
- t3 = $[1];
2208
- }
2209
- let t4;
2210
- if ($[2] !== t1) {
2211
- t4 = /* @__PURE__ */ jsxDEV("pattern", {
2212
- height: "5",
2213
- id: t1,
2214
- patternTransform: "rotate(-45)",
2215
- patternUnits: "userSpaceOnUse",
2216
- width: "5",
2217
- x: "0",
2218
- y: "0",
2219
- children: [t2, t3]
2220
- }, void 0, true);
2221
- $[2] = t1;
2222
- $[3] = t4;
2223
- } else {
2224
- t4 = $[3];
2225
- }
2226
- const t5 = `${id}-buffer-hatched-mask-${dataKey}`;
2227
- const t6 = `url(#${id}-buffer-hatched-mask-pattern)`;
2228
- let t7;
2229
- if ($[4] !== t6) {
2230
- t7 = /* @__PURE__ */ jsxDEV("rect", {
2231
- fill: t6,
2232
- height: "100%",
2233
- width: "100%"
2234
- }, void 0, false);
2235
- $[4] = t6;
2236
- $[5] = t7;
2237
- } else {
2238
- t7 = $[5];
2239
- }
2240
- let t8;
2241
- if ($[6] !== t5 || $[7] !== t7) {
2242
- t8 = /* @__PURE__ */ jsxDEV("mask", {
2243
- id: t5,
2244
- children: t7
2245
- }, void 0, false);
2246
- $[6] = t5;
2247
- $[7] = t7;
2248
- $[8] = t8;
2249
- } else {
2250
- t8 = $[8];
2251
- }
2252
- const t9 = `${id}-buffer-hatched-${dataKey}`;
2253
- const t10 = `url(#${id}-colors-${dataKey})`;
2254
- const t11 = `url(#${id}-buffer-hatched-mask-${dataKey})`;
2255
- let t12;
2256
- if ($[9] !== t10 || $[10] !== t11) {
2257
- t12 = /* @__PURE__ */ jsxDEV("rect", {
2258
- fill: t10,
2259
- height: "100%",
2260
- mask: t11,
2261
- width: "100%"
2262
- }, void 0, false);
2263
- $[9] = t10;
2264
- $[10] = t11;
2265
- $[11] = t12;
2266
- } else {
2267
- t12 = $[11];
2268
- }
2269
- let t13;
2270
- if ($[12] !== t12 || $[13] !== t9) {
2271
- t13 = /* @__PURE__ */ jsxDEV("pattern", {
2272
- height: "100%",
2273
- id: t9,
2274
- patternUnits: "userSpaceOnUse",
2275
- width: "100%",
2276
- children: t12
2277
- }, void 0, false);
2278
- $[12] = t12;
2279
- $[13] = t9;
2280
- $[14] = t13;
2281
- } else {
2282
- t13 = $[14];
2283
- }
2284
- let t14;
2285
- if ($[15] !== t13 || $[16] !== t4 || $[17] !== t8) {
2286
- t14 = /* @__PURE__ */ jsxDEV(Fragment, {
2287
- children: [t4, t8, t13]
2288
- }, void 0, true);
2289
- $[15] = t13;
2290
- $[16] = t4;
2291
- $[17] = t8;
2292
- $[18] = t14;
2293
- } else {
2294
- t14 = $[18];
2295
- }
2296
- return t14;
2297
- };
2298
- const DuotonePattern = (t0) => {
2299
- const $ = c(39);
2300
- const {
2301
- id,
2302
- dataKey,
2303
- config
2304
- } = t0;
2305
- let t1;
2306
- let t2;
2307
- let t3;
2308
- let t4;
2309
- let t5;
2310
- let t6;
2311
- let t7;
2312
- let t8;
2313
- if ($[0] !== config || $[1] !== dataKey || $[2] !== id) {
2314
- const colorsCount = getColorsCount(config[dataKey] ?? {});
2315
- const t92 = `${id}-duotone-mask-gradient-${dataKey}`;
2316
- let t102;
2317
- let t112;
2318
- if ($[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2319
- t102 = /* @__PURE__ */ jsxDEV("stop", {
2320
- offset: "50%",
2321
- stopColor: "white",
2322
- stopOpacity: 0.4
2323
- }, void 0, false);
2324
- t112 = /* @__PURE__ */ jsxDEV("stop", {
2325
- offset: "50%",
2326
- stopColor: "white",
2327
- stopOpacity: 1
2328
- }, void 0, false);
2329
- $[11] = t102;
2330
- $[12] = t112;
2331
- } else {
2332
- t102 = $[11];
2333
- t112 = $[12];
2334
- }
2335
- if ($[13] !== t92) {
2336
- t8 = /* @__PURE__ */ jsxDEV("linearGradient", {
2337
- gradientUnits: "objectBoundingBox",
2338
- id: t92,
2339
- x1: "0",
2340
- x2: "1",
2341
- y1: "0",
2342
- y2: "0",
2343
- children: [t102, t112]
2344
- }, void 0, true);
2345
- $[13] = t92;
2346
- $[14] = t8;
2347
- } else {
2348
- t8 = $[14];
2349
- }
2350
- t1 = "objectBoundingBox";
2351
- t2 = `${id}-duotone-colors-${dataKey}`;
2352
- t3 = "0";
2353
- t4 = "0";
2354
- t5 = "0";
2355
- t6 = "1";
2356
- t7 = colorsCount === 1 ? /* @__PURE__ */ jsxDEV(Fragment, {
2357
- children: [/* @__PURE__ */ jsxDEV("stop", {
2358
- offset: "0%",
2359
- stopColor: `var(--color-${dataKey}-0)`
2360
- }, void 0, false), /* @__PURE__ */ jsxDEV("stop", {
2361
- offset: "100%",
2362
- stopColor: `var(--color-${dataKey}-0)`
2363
- }, void 0, false)]
2364
- }, void 0, true) : Array.from({
2365
- length: colorsCount
2366
- }, (_, index) => {
2367
- const offset = `${index / (colorsCount - 1) * 100}%`;
2368
- return /* @__PURE__ */ jsxDEV("stop", {
2369
- offset,
2370
- stopColor: `var(--color-${dataKey}-${index}, var(--color-${dataKey}-0))`
2371
- }, offset, false);
2372
- });
2373
- $[0] = config;
2374
- $[1] = dataKey;
2375
- $[2] = id;
2376
- $[3] = t1;
2377
- $[4] = t2;
2378
- $[5] = t3;
2379
- $[6] = t4;
2380
- $[7] = t5;
2381
- $[8] = t6;
2382
- $[9] = t7;
2383
- $[10] = t8;
2384
- } else {
2385
- t1 = $[3];
2386
- t2 = $[4];
2387
- t3 = $[5];
2388
- t4 = $[6];
2389
- t5 = $[7];
2390
- t6 = $[8];
2391
- t7 = $[9];
2392
- t8 = $[10];
2393
- }
2394
- let t9;
2395
- if ($[15] !== t1 || $[16] !== t2 || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== t6 || $[21] !== t7) {
2396
- t9 = /* @__PURE__ */ jsxDEV("linearGradient", {
2397
- gradientUnits: t1,
2398
- id: t2,
2399
- x1: t3,
2400
- x2: t4,
2401
- y1: t5,
2402
- y2: t6,
2403
- children: t7
2404
- }, void 0, false);
2405
- $[15] = t1;
2406
- $[16] = t2;
2407
- $[17] = t3;
2408
- $[18] = t4;
2409
- $[19] = t5;
2410
- $[20] = t6;
2411
- $[21] = t7;
2412
- $[22] = t9;
2413
- } else {
2414
- t9 = $[22];
2415
- }
2416
- const t10 = `${id}-duotone-mask-${dataKey}`;
2417
- const t11 = `url(#${id}-duotone-mask-gradient-${dataKey})`;
2418
- let t12;
2419
- if ($[23] !== t11) {
2420
- t12 = /* @__PURE__ */ jsxDEV("rect", {
2421
- fill: t11,
2422
- height: "1",
2423
- width: "1",
2424
- x: "0",
2425
- y: "0"
2426
- }, void 0, false);
2427
- $[23] = t11;
2428
- $[24] = t12;
2429
- } else {
2430
- t12 = $[24];
2431
- }
2432
- let t13;
2433
- if ($[25] !== t10 || $[26] !== t12) {
2434
- t13 = /* @__PURE__ */ jsxDEV("mask", {
2435
- id: t10,
2436
- maskContentUnits: "objectBoundingBox",
2437
- children: t12
2438
- }, void 0, false);
2439
- $[25] = t10;
2440
- $[26] = t12;
2441
- $[27] = t13;
2442
- } else {
2443
- t13 = $[27];
2444
- }
2445
- const t14 = `${id}-duotone-${dataKey}`;
2446
- const t15 = `url(#${id}-duotone-colors-${dataKey})`;
2447
- const t16 = `url(#${id}-duotone-mask-${dataKey})`;
2448
- let t17;
2449
- if ($[28] !== t15 || $[29] !== t16) {
2450
- t17 = /* @__PURE__ */ jsxDEV("rect", {
2451
- fill: t15,
2452
- height: "1",
2453
- mask: t16,
2454
- width: "1",
2455
- x: "0",
2456
- y: "0"
2457
- }, void 0, false);
2458
- $[28] = t15;
2459
- $[29] = t16;
2460
- $[30] = t17;
2461
- } else {
2462
- t17 = $[30];
2463
- }
2464
- let t18;
2465
- if ($[31] !== t14 || $[32] !== t17) {
2466
- t18 = /* @__PURE__ */ jsxDEV("pattern", {
2467
- height: "1",
2468
- id: t14,
2469
- patternContentUnits: "objectBoundingBox",
2470
- patternUnits: "objectBoundingBox",
2471
- width: "1",
2472
- children: t17
2473
- }, void 0, false);
2474
- $[31] = t14;
2475
- $[32] = t17;
2476
- $[33] = t18;
2477
- } else {
2478
- t18 = $[33];
2479
- }
2480
- let t19;
2481
- if ($[34] !== t13 || $[35] !== t18 || $[36] !== t8 || $[37] !== t9) {
2482
- t19 = /* @__PURE__ */ jsxDEV(Fragment, {
2483
- children: [t8, t9, t13, t18]
2484
- }, void 0, true);
2485
- $[34] = t13;
2486
- $[35] = t18;
2487
- $[36] = t8;
2488
- $[37] = t9;
2489
- $[38] = t19;
2490
- } else {
2491
- t19 = $[38];
2492
- }
2493
- return t19;
2494
- };
2495
- const DuotoneReversePattern = (t0) => {
2496
- const $ = c(39);
2497
- const {
2498
- id,
2499
- dataKey,
2500
- config
2501
- } = t0;
2502
- let t1;
2503
- let t2;
2504
- let t3;
2505
- let t4;
2506
- let t5;
2507
- let t6;
2508
- let t7;
2509
- let t8;
2510
- if ($[0] !== config || $[1] !== dataKey || $[2] !== id) {
2511
- const colorsCount = getColorsCount(config[dataKey] ?? {});
2512
- const t92 = `${id}-duotone-reverse-mask-gradient-${dataKey}`;
2513
- let t102;
2514
- let t112;
2515
- if ($[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2516
- t102 = /* @__PURE__ */ jsxDEV("stop", {
2517
- offset: "50%",
2518
- stopColor: "white",
2519
- stopOpacity: 1
2520
- }, void 0, false);
2521
- t112 = /* @__PURE__ */ jsxDEV("stop", {
2522
- offset: "50%",
2523
- stopColor: "white",
2524
- stopOpacity: 0.4
2525
- }, void 0, false);
2526
- $[11] = t102;
2527
- $[12] = t112;
2528
- } else {
2529
- t102 = $[11];
2530
- t112 = $[12];
2531
- }
2532
- if ($[13] !== t92) {
2533
- t8 = /* @__PURE__ */ jsxDEV("linearGradient", {
2534
- gradientUnits: "objectBoundingBox",
2535
- id: t92,
2536
- x1: "0",
2537
- x2: "1",
2538
- y1: "0",
2539
- y2: "0",
2540
- children: [t102, t112]
2541
- }, void 0, true);
2542
- $[13] = t92;
2543
- $[14] = t8;
2544
- } else {
2545
- t8 = $[14];
2546
- }
2547
- t1 = "objectBoundingBox";
2548
- t2 = `${id}-duotone-reverse-colors-${dataKey}`;
2549
- t3 = "0";
2550
- t4 = "0";
2551
- t5 = "0";
2552
- t6 = "1";
2553
- t7 = colorsCount === 1 ? /* @__PURE__ */ jsxDEV(Fragment, {
2554
- children: [/* @__PURE__ */ jsxDEV("stop", {
2555
- offset: "0%",
2556
- stopColor: `var(--color-${dataKey}-0)`
2557
- }, void 0, false), /* @__PURE__ */ jsxDEV("stop", {
2558
- offset: "100%",
2559
- stopColor: `var(--color-${dataKey}-0)`
2560
- }, void 0, false)]
2561
- }, void 0, true) : Array.from({
2562
- length: colorsCount
2563
- }, (_, index) => {
2564
- const offset = `${index / (colorsCount - 1) * 100}%`;
2565
- return /* @__PURE__ */ jsxDEV("stop", {
2566
- offset,
2567
- stopColor: `var(--color-${dataKey}-${index}, var(--color-${dataKey}-0))`
2568
- }, offset, false);
2569
- });
2570
- $[0] = config;
2571
- $[1] = dataKey;
2572
- $[2] = id;
2573
- $[3] = t1;
2574
- $[4] = t2;
2575
- $[5] = t3;
2576
- $[6] = t4;
2577
- $[7] = t5;
2578
- $[8] = t6;
2579
- $[9] = t7;
2580
- $[10] = t8;
2581
- } else {
2582
- t1 = $[3];
2583
- t2 = $[4];
2584
- t3 = $[5];
2585
- t4 = $[6];
2586
- t5 = $[7];
2587
- t6 = $[8];
2588
- t7 = $[9];
2589
- t8 = $[10];
2590
- }
2591
- let t9;
2592
- if ($[15] !== t1 || $[16] !== t2 || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== t6 || $[21] !== t7) {
2593
- t9 = /* @__PURE__ */ jsxDEV("linearGradient", {
2594
- gradientUnits: t1,
2595
- id: t2,
2596
- x1: t3,
2597
- x2: t4,
2598
- y1: t5,
2599
- y2: t6,
2600
- children: t7
2601
- }, void 0, false);
2602
- $[15] = t1;
2603
- $[16] = t2;
2604
- $[17] = t3;
2605
- $[18] = t4;
2606
- $[19] = t5;
2607
- $[20] = t6;
2608
- $[21] = t7;
2609
- $[22] = t9;
2610
- } else {
2611
- t9 = $[22];
2612
- }
2613
- const t10 = `${id}-duotone-reverse-mask-${dataKey}`;
2614
- const t11 = `url(#${id}-duotone-reverse-mask-gradient-${dataKey})`;
2615
- let t12;
2616
- if ($[23] !== t11) {
2617
- t12 = /* @__PURE__ */ jsxDEV("rect", {
2618
- fill: t11,
2619
- height: "1",
2620
- width: "1",
2621
- x: "0",
2622
- y: "0"
2623
- }, void 0, false);
2624
- $[23] = t11;
2625
- $[24] = t12;
2626
- } else {
2627
- t12 = $[24];
2628
- }
2629
- let t13;
2630
- if ($[25] !== t10 || $[26] !== t12) {
2631
- t13 = /* @__PURE__ */ jsxDEV("mask", {
2632
- id: t10,
2633
- maskContentUnits: "objectBoundingBox",
2634
- children: t12
2635
- }, void 0, false);
2636
- $[25] = t10;
2637
- $[26] = t12;
2638
- $[27] = t13;
2639
- } else {
2640
- t13 = $[27];
2641
- }
2642
- const t14 = `${id}-duotone-reverse-${dataKey}`;
2643
- const t15 = `url(#${id}-duotone-reverse-colors-${dataKey})`;
2644
- const t16 = `url(#${id}-duotone-reverse-mask-${dataKey})`;
2645
- let t17;
2646
- if ($[28] !== t15 || $[29] !== t16) {
2647
- t17 = /* @__PURE__ */ jsxDEV("rect", {
2648
- fill: t15,
2649
- height: "1",
2650
- mask: t16,
2651
- width: "1",
2652
- x: "0",
2653
- y: "0"
2654
- }, void 0, false);
2655
- $[28] = t15;
2656
- $[29] = t16;
2657
- $[30] = t17;
2658
- } else {
2659
- t17 = $[30];
2660
- }
2661
- let t18;
2662
- if ($[31] !== t14 || $[32] !== t17) {
2663
- t18 = /* @__PURE__ */ jsxDEV("pattern", {
2664
- height: "1",
2665
- id: t14,
2666
- patternContentUnits: "objectBoundingBox",
2667
- patternUnits: "objectBoundingBox",
2668
- width: "1",
2669
- children: t17
2670
- }, void 0, false);
2671
- $[31] = t14;
2672
- $[32] = t17;
2673
- $[33] = t18;
2674
- } else {
2675
- t18 = $[33];
2676
- }
2677
- let t19;
2678
- if ($[34] !== t13 || $[35] !== t18 || $[36] !== t8 || $[37] !== t9) {
2679
- t19 = /* @__PURE__ */ jsxDEV(Fragment, {
2680
- children: [t8, t9, t13, t18]
2681
- }, void 0, true);
2682
- $[34] = t13;
2683
- $[35] = t18;
2684
- $[36] = t8;
2685
- $[37] = t9;
2686
- $[38] = t19;
2687
- } else {
2688
- t19 = $[38];
2689
- }
2690
- return t19;
2691
- };
2692
- const GradientPattern = (t0) => {
2693
- const $ = c(19);
2694
- const {
2695
- id,
2696
- dataKey
2697
- } = t0;
2698
- const t1 = `${id}-gradient-mask-gradient`;
2699
- let t2;
2700
- let t3;
2701
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2702
- t2 = /* @__PURE__ */ jsxDEV("stop", {
2703
- offset: "20%",
2704
- stopColor: "white",
2705
- stopOpacity: 1
2706
- }, void 0, false);
2707
- t3 = /* @__PURE__ */ jsxDEV("stop", {
2708
- offset: "90%",
2709
- stopColor: "white",
2710
- stopOpacity: 0
2711
- }, void 0, false);
2712
- $[0] = t2;
2713
- $[1] = t3;
2714
- } else {
2715
- t2 = $[0];
2716
- t3 = $[1];
2717
- }
2718
- let t4;
2719
- if ($[2] !== t1) {
2720
- t4 = /* @__PURE__ */ jsxDEV("linearGradient", {
2721
- id: t1,
2722
- x1: "0",
2723
- x2: "0",
2724
- y1: "0",
2725
- y2: "1",
2726
- children: [t2, t3]
2727
- }, void 0, true);
2728
- $[2] = t1;
2729
- $[3] = t4;
2730
- } else {
2731
- t4 = $[3];
2732
- }
2733
- const t5 = `${id}-gradient-mask-${dataKey}`;
2734
- const t6 = `url(#${id}-gradient-mask-gradient)`;
2735
- let t7;
2736
- if ($[4] !== t6) {
2737
- t7 = /* @__PURE__ */ jsxDEV("rect", {
2738
- fill: t6,
2739
- height: "100%",
2740
- width: "100%"
2741
- }, void 0, false);
2742
- $[4] = t6;
2743
- $[5] = t7;
2744
- } else {
2745
- t7 = $[5];
2746
- }
2747
- let t8;
2748
- if ($[6] !== t5 || $[7] !== t7) {
2749
- t8 = /* @__PURE__ */ jsxDEV("mask", {
2750
- id: t5,
2751
- children: t7
2752
- }, void 0, false);
2753
- $[6] = t5;
2754
- $[7] = t7;
2755
- $[8] = t8;
2756
- } else {
2757
- t8 = $[8];
2758
- }
2759
- const t9 = `${id}-gradient-${dataKey}`;
2760
- const t10 = `url(#${id}-colors-${dataKey})`;
2761
- const t11 = `url(#${id}-gradient-mask-${dataKey})`;
2762
- let t12;
2763
- if ($[9] !== t10 || $[10] !== t11) {
2764
- t12 = /* @__PURE__ */ jsxDEV("rect", {
2765
- fill: t10,
2766
- height: "100%",
2767
- mask: t11,
2768
- width: "100%"
2769
- }, void 0, false);
2770
- $[9] = t10;
2771
- $[10] = t11;
2772
- $[11] = t12;
2773
- } else {
2774
- t12 = $[11];
2775
- }
2776
- let t13;
2777
- if ($[12] !== t12 || $[13] !== t9) {
2778
- t13 = /* @__PURE__ */ jsxDEV("pattern", {
2779
- height: "100%",
2780
- id: t9,
2781
- patternUnits: "userSpaceOnUse",
2782
- width: "100%",
2783
- children: t12
2784
- }, void 0, false);
2785
- $[12] = t12;
2786
- $[13] = t9;
2787
- $[14] = t13;
2788
- } else {
2789
- t13 = $[14];
2790
- }
2791
- let t14;
2792
- if ($[15] !== t13 || $[16] !== t4 || $[17] !== t8) {
2793
- t14 = /* @__PURE__ */ jsxDEV(Fragment, {
2794
- children: [t4, t8, t13]
2795
- }, void 0, true);
2796
- $[15] = t13;
2797
- $[16] = t4;
2798
- $[17] = t8;
2799
- $[18] = t14;
2800
- } else {
2801
- t14 = $[18];
2802
- }
2803
- return t14;
2804
- };
2805
- const StrippedPattern = (t0) => {
2806
- const $ = c(19);
2807
- const {
2808
- id,
2809
- dataKey
2810
- } = t0;
2811
- const t1 = `${id}-stripped-mask-gradient`;
2812
- let t2;
2813
- let t3;
2814
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2815
- t2 = /* @__PURE__ */ jsxDEV("stop", {
2816
- offset: "0%",
2817
- stopColor: "white",
2818
- stopOpacity: 0.2
2819
- }, void 0, false);
2820
- t3 = /* @__PURE__ */ jsxDEV("stop", {
2821
- offset: "100%",
2822
- stopColor: "white",
2823
- stopOpacity: 0.2
2824
- }, void 0, false);
2825
- $[0] = t2;
2826
- $[1] = t3;
2827
- } else {
2828
- t2 = $[0];
2829
- t3 = $[1];
2830
- }
2831
- let t4;
2832
- if ($[2] !== t1) {
2833
- t4 = /* @__PURE__ */ jsxDEV("linearGradient", {
2834
- id: t1,
2835
- x1: "0",
2836
- x2: "0",
2837
- y1: "0",
2838
- y2: "1",
2839
- children: [t2, t3]
2840
- }, void 0, true);
2841
- $[2] = t1;
2842
- $[3] = t4;
2843
- } else {
2844
- t4 = $[3];
2845
- }
2846
- const t5 = `${id}-stripped-mask-${dataKey}`;
2847
- const t6 = `url(#${id}-stripped-mask-gradient)`;
2848
- let t7;
2849
- if ($[4] !== t6) {
2850
- t7 = /* @__PURE__ */ jsxDEV("rect", {
2851
- fill: t6,
2852
- height: "100%",
2853
- width: "100%"
2854
- }, void 0, false);
2855
- $[4] = t6;
2856
- $[5] = t7;
2857
- } else {
2858
- t7 = $[5];
2859
- }
2860
- let t8;
2861
- if ($[6] !== t5 || $[7] !== t7) {
2862
- t8 = /* @__PURE__ */ jsxDEV("mask", {
2863
- id: t5,
2864
- children: t7
2865
- }, void 0, false);
2866
- $[6] = t5;
2867
- $[7] = t7;
2868
- $[8] = t8;
2869
- } else {
2870
- t8 = $[8];
2871
- }
2872
- const t9 = `${id}-stripped-${dataKey}`;
2873
- const t10 = `url(#${id}-colors-${dataKey})`;
2874
- const t11 = `url(#${id}-stripped-mask-${dataKey})`;
2875
- let t12;
2876
- if ($[9] !== t10 || $[10] !== t11) {
2877
- t12 = /* @__PURE__ */ jsxDEV("rect", {
2878
- fill: t10,
2879
- height: "100%",
2880
- mask: t11,
2881
- width: "100%"
2882
- }, void 0, false);
2883
- $[9] = t10;
2884
- $[10] = t11;
2885
- $[11] = t12;
2886
- } else {
2887
- t12 = $[11];
2888
- }
2889
- let t13;
2890
- if ($[12] !== t12 || $[13] !== t9) {
2891
- t13 = /* @__PURE__ */ jsxDEV("pattern", {
2892
- height: "100%",
2893
- id: t9,
2894
- patternUnits: "userSpaceOnUse",
2895
- width: "100%",
2896
- children: t12
2897
- }, void 0, false);
2898
- $[12] = t12;
2899
- $[13] = t9;
2900
- $[14] = t13;
2901
- } else {
2902
- t13 = $[14];
2903
- }
2904
- let t14;
2905
- if ($[15] !== t13 || $[16] !== t4 || $[17] !== t8) {
2906
- t14 = /* @__PURE__ */ jsxDEV(Fragment, {
2907
- children: [t4, t8, t13]
2908
- }, void 0, true);
2909
- $[15] = t13;
2910
- $[16] = t4;
2911
- $[17] = t8;
2912
- $[18] = t14;
2913
- } else {
2914
- t14 = $[18];
2915
- }
2916
- return t14;
2917
- };
2918
- const GlowFilter = (t0) => {
2919
- const $ = c(5);
2920
- const {
2921
- id,
2922
- dataKey
2923
- } = t0;
2924
- const t1 = `${id}-bar-glow-${dataKey}`;
2925
- let t2;
2926
- let t3;
2927
- let t4;
2928
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2929
- t2 = /* @__PURE__ */ jsxDEV("feGaussianBlur", {
2930
- in: "SourceGraphic",
2931
- result: "blur",
2932
- stdDeviation: "8"
2933
- }, void 0, false);
2934
- t3 = /* @__PURE__ */ jsxDEV("feColorMatrix", {
2935
- in: "blur",
2936
- result: "glow",
2937
- type: "matrix",
2938
- values: "1 0 0 0 0\n 0 1 0 0 0\n 0 0 1 0 0\n 0 0 0 0.5 0"
2939
- }, void 0, false);
2940
- t4 = /* @__PURE__ */ jsxDEV("feMerge", {
2941
- children: [/* @__PURE__ */ jsxDEV("feMergeNode", {
2942
- in: "glow"
2943
- }, void 0, false), /* @__PURE__ */ jsxDEV("feMergeNode", {
2944
- in: "SourceGraphic"
2945
- }, void 0, false)]
2946
- }, void 0, true);
2947
- $[0] = t2;
2948
- $[1] = t3;
2949
- $[2] = t4;
2950
- } else {
2951
- t2 = $[0];
2952
- t3 = $[1];
2953
- t4 = $[2];
2954
- }
2955
- let t5;
2956
- if ($[3] !== t1) {
2957
- t5 = /* @__PURE__ */ jsxDEV("filter", {
2958
- height: "300%",
2959
- id: t1,
2960
- width: "300%",
2961
- x: "-100%",
2962
- y: "-100%",
2963
- children: [t2, t3, t4]
2964
- }, void 0, true);
2965
- $[3] = t1;
2966
- $[4] = t5;
2967
- } else {
2968
- t5 = $[4];
2969
- }
2970
- return t5;
2971
- };
2972
- const generateEasedGradientStops = (steps = 17, minOpacity = 0.05, maxOpacity = 0.9) => Array.from({
2973
- length: steps
2974
- }, (_, i) => {
2975
- const t = i / (steps - 1);
2976
- const eased = Math.sin(t * Math.PI) ** 2;
2977
- const opacity = minOpacity + eased * (maxOpacity - minOpacity);
2978
- return {
2979
- offset: `${(t * 100).toFixed(0)}%`,
2980
- opacity: Number(opacity.toFixed(3))
2981
- };
2982
- });
2983
- function useLoadingData(isLoading, t0) {
2984
- const $ = c(8);
2985
- const loadingBars = t0 === void 0 ? 12 : t0;
2986
- const [, setLoadingDataKey] = useState(false);
2987
- let t1;
2988
- if ($[0] !== isLoading || $[1] !== setLoadingDataKey) {
2989
- t1 = () => {
2990
- if (isLoading) {
2991
- setLoadingDataKey(_temp);
2992
- }
2993
- };
2994
- $[0] = isLoading;
2995
- $[1] = setLoadingDataKey;
2996
- $[2] = t1;
2997
- } else {
2998
- t1 = $[2];
2999
- }
3000
- const onShimmerExit = t1;
3001
- let t2;
3002
- if ($[3] !== loadingBars) {
3003
- t2 = getLoadingData(loadingBars, 20, 80);
3004
- $[3] = loadingBars;
3005
- $[4] = t2;
3006
- } else {
3007
- t2 = $[4];
3008
- }
3009
- const loadingData = t2;
3010
- let t3;
3011
- if ($[5] !== loadingData || $[6] !== onShimmerExit) {
3012
- t3 = {
3013
- loadingData,
3014
- onShimmerExit
3015
- };
3016
- $[5] = loadingData;
3017
- $[6] = onShimmerExit;
3018
- $[7] = t3;
3019
- } else {
3020
- t3 = $[7];
3021
- }
3022
- return t3;
3023
- }
3024
- function _temp(previous) {
3025
- return !previous;
3026
- }
3027
- const LoadingBar = (t0) => {
3028
- const $ = c(8);
3029
- const {
3030
- chartId,
3031
- onShimmerExit
3032
- } = t0;
3033
- const t1 = `url(#${chartId}-loading-mask)`;
3034
- let t2;
3035
- if ($[0] !== t1) {
3036
- t2 = /* @__PURE__ */ jsxDEV(Bar$1, {
3037
- dataKey: LOADING_BAR_DATA_KEY,
3038
- fill: "currentColor",
3039
- fillOpacity: 0.15,
3040
- isAnimationActive: false,
3041
- legendType: "none",
3042
- radius: DEFAULT_BAR_RADIUS,
3043
- style: {
3044
- mask: t1
3045
- }
3046
- }, void 0, false);
3047
- $[0] = t1;
3048
- $[1] = t2;
3049
- } else {
3050
- t2 = $[1];
3051
- }
3052
- let t3;
3053
- if ($[2] !== chartId || $[3] !== onShimmerExit) {
3054
- t3 = /* @__PURE__ */ jsxDEV("defs", {
3055
- children: /* @__PURE__ */ jsxDEV(LoadingBarPattern, {
3056
- chartId,
3057
- onShimmerExit
3058
- }, void 0, false)
3059
- }, void 0, false);
3060
- $[2] = chartId;
3061
- $[3] = onShimmerExit;
3062
- $[4] = t3;
3063
- } else {
3064
- t3 = $[4];
3065
- }
3066
- let t4;
3067
- if ($[5] !== t2 || $[6] !== t3) {
3068
- t4 = /* @__PURE__ */ jsxDEV(Fragment, {
3069
- children: [t2, t3]
3070
- }, void 0, true);
3071
- $[5] = t2;
3072
- $[6] = t3;
3073
- $[7] = t4;
3074
- } else {
3075
- t4 = $[7];
3076
- }
3077
- return t4;
3078
- };
3079
- const LoadingBarPattern = (t0) => {
3080
- const $ = c(23);
3081
- const {
3082
- chartId,
3083
- onShimmerExit
3084
- } = t0;
3085
- const gradientStops = generateEasedGradientStops();
3086
- const lastXRef = useRef(-1);
3087
- const t1 = `${chartId}-loading-mask-gradient`;
3088
- const t2 = "0";
3089
- const t3 = "1";
3090
- const t4 = "0";
3091
- const t5 = "0";
3092
- const t6 = gradientStops.map(_temp2);
3093
- let t7;
3094
- if ($[0] !== t1 || $[1] !== t6) {
3095
- t7 = /* @__PURE__ */ jsxDEV("linearGradient", {
3096
- id: t1,
3097
- x1: t2,
3098
- x2: t3,
3099
- y1: t4,
3100
- y2: t5,
3101
- children: t6
3102
- }, void 0, false);
3103
- $[0] = t1;
3104
- $[1] = t6;
3105
- $[2] = t7;
3106
- } else {
3107
- t7 = $[2];
3108
- }
3109
- const t8 = `${chartId}-loading-mask-pattern`;
3110
- let t9;
3111
- if ($[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3112
- t9 = {
3113
- x: 2
3114
- };
3115
- $[3] = t9;
3116
- } else {
3117
- t9 = $[3];
3118
- }
3119
- const t10 = `url(#${chartId}-loading-mask-gradient)`;
3120
- let t11;
3121
- if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3122
- t11 = {
3123
- x: -1
3124
- };
3125
- $[4] = t11;
3126
- } else {
3127
- t11 = $[4];
3128
- }
3129
- let t12;
3130
- if ($[5] !== onShimmerExit) {
3131
- t12 = (latest) => {
3132
- const xValue = typeof latest.x === "number" ? latest.x : -1;
3133
- const lastX = lastXRef.current;
3134
- if (xValue >= 1 && lastX < 1) {
3135
- onShimmerExit();
3136
- }
3137
- lastXRef.current = xValue;
3138
- };
3139
- $[5] = onShimmerExit;
3140
- $[6] = t12;
3141
- } else {
3142
- t12 = $[6];
3143
- }
3144
- let t13;
3145
- if ($[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3146
- t13 = {
3147
- duration: LOADING_ANIMATION_DURATION / 1e3,
3148
- ease: "linear",
3149
- repeat: Infinity,
3150
- repeatType: "loop"
3151
- };
3152
- $[7] = t13;
3153
- } else {
3154
- t13 = $[7];
3155
- }
3156
- let t14;
3157
- if ($[8] !== t10 || $[9] !== t12) {
3158
- t14 = /* @__PURE__ */ jsxDEV(motion.rect, {
3159
- animate: t9,
3160
- fill: t10,
3161
- height: "1",
3162
- initial: t11,
3163
- onUpdate: t12,
3164
- transition: t13,
3165
- width: "1",
3166
- y: "0"
3167
- }, void 0, false);
3168
- $[8] = t10;
3169
- $[9] = t12;
3170
- $[10] = t14;
3171
- } else {
3172
- t14 = $[10];
3173
- }
3174
- let t15;
3175
- if ($[11] !== t14 || $[12] !== t8) {
3176
- t15 = /* @__PURE__ */ jsxDEV("pattern", {
3177
- height: "1",
3178
- id: t8,
3179
- patternContentUnits: "objectBoundingBox",
3180
- patternTransform: "rotate(25)",
3181
- patternUnits: "objectBoundingBox",
3182
- width: 3,
3183
- x: "0",
3184
- y: "0",
3185
- children: t14
3186
- }, void 0, false);
3187
- $[11] = t14;
3188
- $[12] = t8;
3189
- $[13] = t15;
3190
- } else {
3191
- t15 = $[13];
3192
- }
3193
- const t16 = `${chartId}-loading-mask`;
3194
- const t17 = `url(#${chartId}-loading-mask-pattern)`;
3195
- let t18;
3196
- if ($[14] !== t17) {
3197
- t18 = /* @__PURE__ */ jsxDEV("rect", {
3198
- fill: t17,
3199
- height: "100%",
3200
- width: "100%"
3201
- }, void 0, false);
3202
- $[14] = t17;
3203
- $[15] = t18;
3204
- } else {
3205
- t18 = $[15];
3206
- }
3207
- let t19;
3208
- if ($[16] !== t16 || $[17] !== t18) {
3209
- t19 = /* @__PURE__ */ jsxDEV("mask", {
3210
- id: t16,
3211
- maskUnits: "userSpaceOnUse",
3212
- children: t18
3213
- }, void 0, false);
3214
- $[16] = t16;
3215
- $[17] = t18;
3216
- $[18] = t19;
3217
- } else {
3218
- t19 = $[18];
3219
- }
3220
- let t20;
3221
- if ($[19] !== t15 || $[20] !== t19 || $[21] !== t7) {
3222
- t20 = /* @__PURE__ */ jsxDEV(Fragment, {
3223
- children: [t7, t15, t19]
3224
- }, void 0, true);
3225
- $[19] = t15;
3226
- $[20] = t19;
3227
- $[21] = t7;
3228
- $[22] = t20;
3229
- } else {
3230
- t20 = $[22];
3231
- }
3232
- return t20;
3233
- };
3234
- function _temp2(t0) {
3235
- const {
3236
- offset,
3237
- opacity
3238
- } = t0;
3239
- return /* @__PURE__ */ jsxDEV("stop", {
3240
- offset,
3241
- stopColor: "white",
3242
- stopOpacity: opacity
3243
- }, offset, false);
3244
- }
3245
-
3246
- export { Bar as B, EvilBarChart as E, Tooltip as T, XAxis as X };