@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
@@ -0,0 +1 @@
1
+ import{a as G}from"./chunk-46IB4C4Q.js";import{a as u,e as N,f as Y}from"./chunk-UHHTEBC3.js";function K(l,a,t){let e=new Array(l);return new Proxy(e,{get(s,n,o){if(typeof n=="string"){let i=n.charCodeAt(0);if(i>=48&&i<=57){let r=+n;if(Number.isInteger(r)&&r>=0&&r<l){let h=s[r];if(!h){let c=a[r*2];h=s[r]={index:r,key:t(r),start:c,size:a[r*2+1],end:c+a[r*2+1],lane:0}}return h}}if(n==="length")return l}return Reflect.get(s,n,o)}})}u(K,"createLazyMeasurementsView");function z(l,a,t){let e=t.initialDeps??[],s,n=!0;function o(){var i;let h=0,c=l();if(!(c.length!==e.length||c.some((p,S)=>e[S]!==p)))return s;e=c;let d=0;return s=a(...c),t?.onChange&&!(n&&t.skipInitialOnChange)&&t.onChange(s),n=!1,s}return u(o,"memoizedFunction"),o.updateDeps=i=>{e=i},o}u(z,"memo");function W(l,a){if(l===void 0)throw new Error(`Unexpected undefined${a?`: ${a}`:""}`);return l}u(W,"notUndefined");var P=u((l,a)=>Math.abs(l-a)<1.01,"approxEqual"),B=u((l,a,t)=>{let e;return function(...s){l.clearTimeout(e),e=l.setTimeout(()=>a.apply(this,s),t)}},"debounce");var C,k=u(()=>{if(C!==void 0)return C;if(typeof navigator>"u")return C=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return C=!0;let l=navigator.maxTouchPoints;return C=navigator.platform==="MacIntel"&&l!==void 0&&l>0},"isIOSWebKit");var $=u(l=>{let{offsetWidth:a,offsetHeight:t}=l;return{width:a,height:t}},"getRect"),Q=u(l=>l,"defaultKeyExtractor"),Z=u(l=>{let a=Math.max(l.startIndex-l.overscan,0),e=Math.min(l.endIndex+l.overscan,l.count-1)-a+1,s=new Array(e);for(let n=0;n<e;n++)s[n]=a+n;return s},"defaultRangeExtractor"),H=u((l,a)=>{let t=l.scrollElement;if(!t)return;let e=l.targetWindow;if(!e)return;let s=u(o=>{let{width:i,height:r}=o;a({width:Math.round(i),height:Math.round(r)})},"handler");if(s($(t)),!e.ResizeObserver)return()=>{};let n=new e.ResizeObserver(o=>{let i=u(()=>{let r=o[0];if(r?.borderBoxSize){let h=r.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s($(t))},"run");l.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return n.observe(t,{box:"border-box"}),()=>{n.unobserve(t)}},"observeElementRect"),R={passive:!0};var tt=typeof window>"u"?!0:"onscrollend"in window,et=u((l,a,t)=>{let e=l.scrollElement;if(!e)return;let s=l.targetWindow;if(!s)return;let n=l.options.useScrollendEvent&&tt,o=0,i=n?null:B(s,()=>a(o,!1),l.options.isScrollingResetDelay),r=u(m=>()=>{o=t(e),i?.(),a(o,m)},"createHandler"),h=r(!0),c=r(!1);return e.addEventListener("scroll",h,R),n&&e.addEventListener("scrollend",c,R),()=>{e.removeEventListener("scroll",h),n&&e.removeEventListener("scrollend",c)}},"observeOffset"),J=u((l,a)=>et(l,a,t=>{let{horizontal:e,isRtl:s}=l.options;return e?t.scrollLeft*(s&&-1||1):t.scrollTop}),"observeElementOffset");var st=u((l,a,t)=>{if(t.options.useCachedMeasurements){let e=t.indexFromElement(l),s=t.options.getItemKey(e);return t.itemSizeCache.get(s)??t.options.estimateSize(e)}if(a?.borderBoxSize){let e=a.borderBoxSize[0];if(e)return Math.round(e[t.options.horizontal?"inlineSize":"blockSize"])}if(!a){let e=t.indexFromElement(l),s=t.options.getItemKey(e),n=t.itemSizeCache.get(s);if(n!==void 0)return n}return l[t.options.horizontal?"offsetWidth":"offsetHeight"]},"measureElement"),nt=u((l,{adjustments:a=0,behavior:t},e)=>{var s,n;(n=(s=e.scrollElement)==null?void 0:s.scrollTo)==null||n.call(s,{[e.options.horizontal?"left":"top"]:l+a,behavior:t})},"scrollWithAdjustments");var q=nt,F=class{static{u(this,"Virtualizer")}constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,e,s;return((s=(e=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:e.now)==null?void 0:s.call(e))??Date.now()},this.observer=(()=>{let t=null,e=u(()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(n=>{let o=u(()=>{let i=n.target,r=this.indexFromElement(i);if(!i.isConnected){this.observer.unobserve(i);for(let[h,c]of this.elementsCache)if(c===i){this.elementsCache.delete(h);break}return}this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(i,n,this))},"run");this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})})),"get");return{disconnect:u(()=>{var s;(s=e())==null||s.disconnect(),t=null},"disconnect"),observe:u(s=>{var n;return(n=e())==null?void 0:n.observe(s,{box:"border-box"})},"observe"),unobserve:u(s=>{var n;return(n=e())==null?void 0:n.unobserve(s)},"unobserve")}})(),this.range=null,this.setOptions=t=>{var e,s;let n={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Q,rangeExtractor:Z,onChange:u(()=>{},"onChange"),measureElement:st,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let d in t){let p=t[d];p!==void 0&&(n[d]=p)}let o=this.options,i=null,r=null,h=!1;if(o!==void 0&&o.enabled&&n.enabled&&n.anchorTo==="end"&&this.scrollElement!==null){let d=o.count,p=n.count,S=this.getMeasurements(),b=d>0?((e=S[0])==null?void 0:e.key)??o.getItemKey(0):null,x=d>0?((s=S[d-1])==null?void 0:s.key)??o.getItemKey(d-1):null;if(p!==d||d>0&&p>0&&(n.getItemKey(0)!==b||n.getItemKey(p-1)!==x)){h=!0;let v=d>0?this.getVirtualItemForOffset(this.getScrollOffset())??S[0]:null;v&&(i=[v.key,this.getScrollOffset()-v.start]);let O=n.followOnAppend===!0?"auto":n.followOnAppend||null;O&&p>d&&this.isAtEnd(o.scrollEndThreshold)&&(d===0||n.getItemKey(p-1)!==x)&&(r=O)}}this.options=n,h&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,m=0;if(i&&this.scrollOffset!==null){let[d,p]=i,S=this.getMeasurements(),{count:b,getItemKey:x}=this.options,f=0;for(;f<b&&x(f)!==d;)f++;if(f<b){let g=S[f];if(g){let v=g.start+p;v!==this.scrollOffset&&(m=v-this.scrollOffset,this.scrollOffset=v,c=!0)}}}(c||r)&&(this.pendingScrollAnchor=[c?i[0]:null,c?i[1]:0,r,m])},this.notify=t=>{var e,s;(s=(e=this.options).onChange)==null||s.call(e,this,t)},this.maybeNotify=z(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:u(()=>this.options.debug,"debug"),initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,o)=>{if(o&&this._intendedScrollOffset===null&&n===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(n-this._intendedScrollOffset)<1.5&&(n=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let i=this.getScrollOffset();this.scrollDirection=o?i===n?this.scrollDirection:i<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=o,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){let n=this.scrollElement,o=u(()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},"onTouchStart"),i=u(()=>{this._iosTouching=!1,!(!k()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))},"onTouchEnd");n.addEventListener("touchstart",o,R),n.addEventListener("touchend",i,R),this.unsubs.push(()=>{n.removeEventListener("touchstart",o),n.removeEventListener("touchend",i),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){let[n,o,i,r]=s;n!==null&&!i&&(k()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?r!==0&&(this._iosDeferredAdjustment+=r):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),i&&this.scrollToEnd({behavior:i})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let t=this.getScrollOffset(),e=this.getMaxScrollOffset();if(t<0||t>e)return;let s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=z(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,e,s,n,o,i,r,h)=>(this.prevLanes!==void 0&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMin=null,{count:t,paddingStart:e,scrollMargin:s,getItemKey:n,enabled:o,lanes:i,laneAssignmentMode:r,gap:h}),{key:!1}),this.getMeasurements=z(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:e,scrollMargin:s,getItemKey:n,enabled:o,lanes:i,laneAssignmentMode:r,gap:h},c)=>{let m=this.itemSizeCache;if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(let f of this.laneAssignments.keys())f>=t&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));let d=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),i===1){let f=t*2,g=this._flatMeasurements;if(!g||g.length<f){let E=new Float64Array(f);g&&d>0&&E.set(g.subarray(0,d*2)),g=E,this._flatMeasurements=g}let v;if(d===0)v=e+s;else{let E=d-1;v=g[E*2]+g[E*2+1]+h}for(let E=d;E<t;E++){let A=n(E),y=m.get(A),T=typeof y=="number"?y:this.options.estimateSize(E);g[E*2]=v,g[E*2+1]=T,v+=T+h}let O=K(t,g,n);return this.measurementsCache=O,O}let p=this.measurementsCache.slice(0,d),S=new Array(i).fill(void 0),b=new Float64Array(i),x=0;for(let f=0;f<d;f++){let g=p[f];g&&(S[g.lane]===void 0&&x++,S[g.lane]=f,b[g.lane]=g.end)}for(let f=d;f<t;f++){let g=n(f),v=this.laneAssignments.get(f),O,E,A=r==="estimate"||m.has(g);if(v!==void 0&&this.options.lanes>1){O=v;let M=S[O],I=M!==void 0?p[M]:void 0;E=I?I.end+h:e+s}else if(x===i){let M=0,I=b[0],j=S[0];for(let _=1;_<i;_++){let D=b[_];(D<I||D===I&&S[_]<j)&&(M=_,I=D,j=S[_])}O=M,E=I+h,A&&this.laneAssignments.set(f,O)}else O=f%this.options.lanes,E=e+s,A&&this.laneAssignments.set(f,O);let y=m.get(g),T=typeof y=="number"?y:this.options.estimateSize(f),V=E+T;p[f]={index:f,start:E,size:T,end:V,key:g,lane:O},S[O]===void 0&&x++,S[O]=f,b[O]=V}return this.measurementsCache=p,p},{key:!1,debug:u(()=>this.options.debug,"debug")}),this.calculateRange=z(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,e,s,n)=>t.length===0||e===0?(this.range=null,null):(this.range=ot(t,e,s,n,n===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:u(()=>this.options.debug,"debug")}),this.getVirtualIndexes=z(()=>{let t=null,e=null,s=this.calculateRange();return s&&(t=s.startIndex,e=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,e]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,e]},(t,e,s,n,o)=>n===null||o===null?[]:t({startIndex:n,endIndex:o,overscan:e,count:s}),{key:!1,debug:u(()=>this.options.debug,"debug")}),this.indexFromElement=t=>{let e=this.options.indexAttribute,s=t.getAttribute(e);return s?parseInt(s,10):(console.warn(`Missing attribute name '${e}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var e;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;let s=this.scrollState.index??((e=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:e.index);if(s!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,s-n),i=Math.min(this.options.count-1,s+n);return t>=o&&t<=i}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,i)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(i))});return}let e=this.indexFromElement(t),s=this.options.getItemKey(e),n=this.elementsCache.get(s);n!==t&&(n&&this.observer.unobserve(n),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(e)&&this.resizeItem(e,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,e)=>{var s,n;if(t<0||t>=this.options.count)return;let o,i,r,h=this._flatMeasurements;if(this.options.lanes===1&&h!==null)r=this.options.getItemKey(t),i=h[t*2],o=h[t*2+1];else{let d=this.measurementsCache[t];if(!d)return;r=d.key,i=d.start,o=d.size}let c=this.itemSizeCache.get(r)??o,m=e-c;if(m!==0){let d=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,p=d?this.getTotalSize():0,S=((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:r,start:i,size:o,end:i+o,lane:0},m,this):i<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(r)||this.scrollDirection!=="backward"));(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(r,e),this.itemSizeCacheVersion++,d?this.applyScrollAdjustment(this.getTotalSize()-p):S&&this.applyScrollAdjustment(m),this.notify(!1)}},this.getVirtualItems=z(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,e)=>{let s=[];for(let n=0,o=t.length;n<o;n++){let i=t[n],r=e[i];s.push(r)}return s},{key:!1,debug:u(()=>this.options.debug,"debug")}),this.getVirtualItemForOffset=t=>{let e=this.getMeasurements();if(e.length===0)return;let s=this._flatMeasurements,n=this.options.lanes===1&&s!=null,o=U(0,e.length-1,n?i=>s[i*2]:i=>W(e[i]).start,t);return W(e[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,e,s=0)=>{if(!this.scrollElement)return 0;let n=this.getSize(),o=this.getScrollOffset();e==="auto"&&(e=t>=o+n?"end":"start"),e==="center"?t+=(s-n)/2:e==="end"&&(t-=n);let i=this.getMaxScrollOffset();return Math.max(Math.min(i,t),0)},this.getOffsetForIndex=(t,e="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));let s=this.getSize(),n=this.getScrollOffset(),o=this.measurementsCache[t];if(!o)return;if(e==="auto")if(o.end>=n+s-this.options.scrollPaddingEnd)e="end";else if(o.start<=n+this.options.scrollPaddingStart)e="start";else return[n,e];if(e==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),e];let i=e==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,e,o.size),e]},this.scrollToOffset=(t,{align:e="start",behavior:s="auto"}={})=>{let n=this.getOffsetForAlignment(t,e),o=this.now();this.scrollState={index:null,align:e,behavior:s,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:e="auto",behavior:s="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));let n=this.getOffsetForIndex(t,e);if(!n)return;let[o,i]=n,r=this.now();this.scrollState={index:t,align:i,behavior:s,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:e="auto"}={})=>{let s=this.getScrollOffset()+t,n=this.now();this.scrollState={index:null,align:"start",behavior:e,startedAt:n,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:e}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;let e=this.getMeasurements(),s;if(e.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,o=this._flatMeasurements;o!=null?s=o[n*2]+o[n*2+1]:s=((t=e[n])==null?void 0:t.end)??0}else{let n=Array(this.options.lanes).fill(null),o=e.length-1;for(;o>=0&&n.some(i=>i===null);){let i=e[o];n[i.lane]===null&&(n[i.lane]=i.end),o--}s=Math.max(...n.filter(i=>i!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let t=[];if(this.itemSizeCache.size===0)return t;let e=this.getMeasurements();for(let s of e)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:e,behavior:s})=>{this._intendedScrollOffset=t+(e??0),this.options.scrollToFn(t,{behavior:s,adjustments:e},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,t){a!==0&&(k()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=a:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=e?e[0]:this.scrollState.lastTargetOffset,n=1,o=s!==this.scrollState.lastTargetOffset;if(!o&&P(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=n){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,o){let i=this.getSize()||600,r=Math.abs(s-this.getScrollOffset()),h=this.scrollState.behavior==="smooth"&&r>i;this.scrollState.lastTargetOffset=s,h||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:h?"smooth":"auto"})}this.scheduleScrollReconcile()}},U=u((l,a,t,e)=>{for(;l<=a;){let s=(l+a)/2|0,n=t(s);if(n<e)l=s+1;else if(n>e)a=s-1;else return s}return l>0?l-1:0},"findNearestBinarySearch");function it(l,a,t){let e=0;for(;e<=a;){let s=(e+a)/2|0,n=l[s*2];if(n<t)e=s+1;else if(n>t)a=s-1;else return s}return e>0?e-1:0}u(it,"findNearestBinarySearchFlat");function ot(l,a,t,e,s){let n=l.length-1;if(l.length<=e)return{startIndex:0,endIndex:n};if(e===1&&s!==null){let h=it(s,n,t),c=h,m=t+a;for(;c<n&&s[c*2]+s[c*2+1]<m;)c++;return{startIndex:h,endIndex:c}}let i=U(0,n,u(h=>l[h].start,"getStart"),t),r=i;if(e===1)for(;r<n&&l[r].end<t+a;)r++;else if(e>1){let h=Array(e).fill(0);for(;r<n&&h.some(m=>m<t+a);){let m=l[r];h[m.lane]=m.end,r++}let c=Array(e).fill(t+a);for(;i>=0&&c.some(m=>m>=t);){let m=l[i];c[m.lane]=m.start,i--}i=Math.max(0,i-i%e),r=Math.min(n,r+(e-1-r%e))}return{startIndex:i,endIndex:r}}u(ot,"calculateRangeImpl");var w=N(Y(),1),X=N(G(),1);var L=typeof document<"u"?w.useLayoutEffect:w.useEffect;function lt({useFlushSync:l=!0,directDomUpdates:a=!1,directDomUpdatesMode:t="transform",...e}){let s=w.useReducer(h=>h+1,0)[1],n=w.useRef({enabled:a,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});n.current.enabled=a,n.current.mode=t;let o=u(h=>{let c=n.current;if(!c.enabled||!c.container)return;let m=h.getTotalSize();if(m!==c.lastSize){c.lastSize=m;let f=h.options.horizontal?"width":"height";c.container.style[f]=`${m}px`}let d=!!h.options.horizontal,p=c.mode==="transform",S=d?"left":"top",b=h.options.scrollMargin,x=h.getVirtualItems();for(let f of x){let g=f.start-b,v=h.elementsCache.get(f.key);v&&c.lastPositions.get(v)!==g&&(c.lastPositions.set(v,g),p?v.style.transform=d?`translate3d(${g}px, 0, 0)`:`translate3d(0, ${g}px, 0)`:v.style[S]=`${g}px`)}},"applyDirectStyles"),i={...e,onChange:u((h,c)=>{var m;let d=n.current,p=!0;if(d.enabled){o(h);let S=h.range,b=d.prevRange;p=!b||b.isScrolling!==h.isScrolling||b.startIndex!==S?.startIndex||b.endIndex!==S?.endIndex,p&&(d.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:h.isScrolling}:null)}p&&(l&&c?(0,X.flushSync)(s):s()),(m=e.onChange)==null||m.call(e,h,c)},"onChange")},[r]=w.useState(()=>{let h=new F(i);return Object.assign(h,{containerRef:u(c=>{let m=n.current;if(m.container=c,m.lastSize=null,c&&m.enabled){let d=h.getTotalSize();m.lastSize=d;let p=h.options.horizontal?"width":"height";c.style[p]=`${d}px`}},"containerRef")})});return r.setOptions(i),L(()=>r._didMount(),[]),L(()=>r._willUpdate()),L(()=>{o(r)}),r}u(lt,"useVirtualizerBase");function Et(l){return lt({observeElementRect:H,observeElementOffset:J,scrollToFn:q,...l})}u(Et,"useVirtualizer");export{H as a,Et as b};
@@ -0,0 +1 @@
1
+ import{a as g}from"./chunk-SKJZDOHG.js";import{f}from"./chunk-KJTLW5W2.js";import{h as d,m as p}from"./chunk-KLLYGWNF.js";import{a as t,e as u,f as b,g as h}from"./chunk-UHHTEBC3.js";var y=u(h(),1);var m=u(b(),1);var L={capabilities:{accounts:!0,admin:!0,organization:!1,passkey:!1,twoFactor:!1},emailAndPassword:!1,organization:{enabled:!1,roles:!1,teams:!1},plugins:[],rateLimit:{enabled:!1},session:{},socialProviders:[],userFields:[]},A=t(()=>{let a=(0,y.c)(6),r=f(),s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s=["lunora-auth-config"],a[0]=s):s=a[0];let o;a[1]!==r?(o=t(()=>r.getAuthConfig(),"a"),a[1]=r,a[2]=o):o=a[2];let{data:n,isLoading:i}=g(s,o),l=n??L,c=!i,e;return a[3]!==l||a[4]!==c?(e={config:l,ready:c},a[3]=l,a[4]=c,a[5]=e):e=a[5],e},"L"),F=t(()=>{let[a,r]=(0,m.useState)(!1),[s,o]=(0,m.useState)(null);return{busy:a,error:s,run:t(n=>{p((async()=>{r(!0),o(null);try{await n()}catch(i){o(d(i))}finally{r(!1)}})())},"run")}},"_");export{A as a,F as b};
@@ -0,0 +1 @@
1
+ import{a as ae}from"./chunk-JKPK25JO.js";import{a as le}from"./chunk-H6SIM4BT.js";import{b as re}from"./chunk-K5PFWU5J.js";import"./chunk-4FNHHFWR.js";import{d as de,f as oe}from"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{a as me}from"./chunk-6OKDCV7J.js";import{d as ce,q as pe}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as k,e as ie,g as xe,h as ge,j as Z}from"./chunk-UHHTEBC3.js";var ne=ie(xe(),1);var a=ie(ge(),1);var ye="/_lunora/health",Ne="/_lunora/health/ready",ve=k((n,e)=>(n.endsWith("/")?n.slice(0,-1):n)+e,"xe"),be=k(()=>{let n=oe();return async e=>{let w=e==="ready"?Ne:ye,t=n.getAuthToken(),_=ve(n.url,w);try{let l=await fetch(_,{headers:t===null?{}:{authorization:`Bearer ${t}`}}),d=null;try{d=await l.json()}catch{d=null}return{body:d,ok:l.ok,status:l.status}}catch(l){return{body:null,error:l instanceof Error?l.message:String(l),ok:!1,status:0}}}},"Ne"),he={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},ke={crit:"bg-destructive/10 text-destructive",ok:"bg-success/10 text-success",warn:"bg-warning/10 text-warning"},we=k(n=>n==="unhealthy"?"crit":n==="degraded"?"warn":"ok","ye"),ue=k(n=>{let e=(0,ne.c)(13),{label:w,level:t,testId:_,value:l}=n,d=he[t],o;e[0]!==d?(o=Z("size-1.5 shrink-0 rounded-full",d),e[0]=d,e[1]=o):o=e[1];let c;e[2]!==o?(c=(0,a.jsx)("span",{"aria-hidden":"true",className:o}),e[2]=o,e[3]=c):c=e[3];let x;e[4]!==w||e[5]!==c?(x=(0,a.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[c,w]}),e[4]=w,e[5]=c,e[6]=x):x=e[6];let g;e[7]!==_||e[8]!==l?(g=(0,a.jsx)("span",{className:"text-lg font-semibold text-foreground","data-testid":_,children:l}),e[7]=_,e[8]=l,e[9]=g):g=e[9];let u;return e[10]!==x||e[11]!==g?(u=(0,a.jsx)(ae,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[x,g]})}),e[10]=x,e[11]=g,e[12]=u):u=e[12],u},"ne"),De=k(n=>{let e=(0,ne.c)(115),{probe:w}=n,t=ce(),_=be(),l=w??_,d;e[0]!==l?(d=k(async()=>{let[s,i]=await Promise.all([l("live"),l("ready")]);return{live:s,ready:i}},"d"),e[0]=l,e[1]=d):d=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=["deployment-health"],e[2]=o):o=e[2];let c;e[3]!==d?(c={queryFn:d,queryKey:o},e[3]=d,e[4]=c):c=e[4];let{data:x,isPending:g}=de(c),u=x?.live??null,fe=x?.ready??null;if(g){let s;return e[5]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"deployment-health-loading",children:[(0,a.jsx)(le,{className:"h-16 w-full"}),(0,a.jsx)(le,{className:"h-40 w-full"})]}),e[5]=s):s=e[5],s}let r=u?.body??null;if(r===null){let s=u?.status===403,i;e[6]!==s||e[7]!==u?.error||e[8]!==t?(i=s?t("The health endpoint is in the admin posture. Paste a valid admin token in the connect popover, or set its auth to public."):t("Couldn't reach the health endpoint: {message}",{message:u?.error??t("no response")}),e[6]=s,e[7]=u?.error,e[8]=t,e[9]=i):i=e[9];let h;e[10]!==t?(h=t("Health endpoint unavailable"),e[10]=t,e[11]=h):h=e[11];let p;return e[12]!==i||e[13]!==h?(p=(0,a.jsx)(me,{description:i,testId:"deployment-health-error",title:h}),e[12]=i,e[13]=h,e[14]=p):p=e[14],p}let ee;e[15]!==r.status?(ee=we(r.status),e[15]=r.status,e[16]=ee):ee=e[16];let j=ee,m;if(r.status==="unhealthy"){let s;e[17]!==t?(s=t("Unhealthy"),e[17]=t,e[18]=s):s=e[18],m=s}else if(r.status==="degraded"){let s;e[19]!==t?(s=t("Degraded"),e[19]=t,e[20]=s):s=e[20],m=s}else{let s;e[21]!==t?(s=t("Healthy"),e[21]=t,e[22]=s):s=e[22],m=s}let C=fe?.ok??!1,Y=C?"ok":"crit",z,I,y,N,v,S,V,b,$,H;if(e[23]!==r.appName||e[24]!==r.appVersion||e[25]!==r.checks||e[26]!==r.timestamp||e[27]!==j||e[28]!==Y||e[29]!==C||e[30]!==m||e[31]!==t){let s=[...r.checks].toSorted(_e);H="flex flex-col gap-6",I="deployment-health";let i;e[42]!==t?(i=t("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint \u2014 wire an uptime monitor or a Cloudflare Health Check at it."),e[42]=t,e[43]=i):i=e[43],e[44]!==i?(y=(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[44]=i,e[45]=y):y=e[45];let h=ke[j],p;e[46]!==h?(p=Z("flex size-10 shrink-0 items-center justify-center rounded-full",h),e[46]=h,e[47]=p):p=e[47];let se=he[j],D;e[48]!==se?(D=Z("size-3 rounded-full",se),e[48]=se,e[49]=D):D=e[49];let L;e[50]!==D?(L=(0,a.jsx)("span",{className:D}),e[50]=D,e[51]=L):L=e[51];let T;e[52]!==p||e[53]!==L?(T=(0,a.jsx)("span",{"aria-hidden":"true",className:p,children:L}),e[52]=p,e[53]=L,e[54]=T):T=e[54];let q;e[55]!==m?(q=(0,a.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"dh-status",children:m}),e[55]=m,e[56]=q):q=e[56];let E;e[57]!==r.appName||e[58]!==r.appVersion?(E=(0,a.jsxs)("span",{className:"font-mono text-[13px] text-muted-foreground","data-testid":"dh-app",children:[r.appName," \xB7 ",r.appVersion]}),e[57]=r.appName,e[58]=r.appVersion,e[59]=E):E=e[59];let R;e[60]!==q||e[61]!==E?(R=(0,a.jsxs)("div",{className:"grid leading-tight",children:[q,E]}),e[60]=q,e[61]=E,e[62]=R):R=e[62];let U;e[63]!==T||e[64]!==R?(U=(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[T,R]}),e[63]=T,e[64]=R,e[65]=U):U=e[65];let A;e[66]!==t?(A=t("Checked"),e[66]=t,e[67]=A):A=e[67];let B;e[68]!==A?(B=(0,a.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:A}),e[68]=A,e[69]=B):B=e[69];let F;e[70]!==r.timestamp?(F=pe(r.timestamp),e[70]=r.timestamp,e[71]=F):F=e[71];let K;e[72]!==F?(K=(0,a.jsx)("time",{className:"text-[13px] text-muted-foreground","data-testid":"dh-timestamp",children:F}),e[72]=F,e[73]=K):K=e[73];let Q;e[74]!==B||e[75]!==K?(Q=(0,a.jsxs)("div",{className:"text-end",children:[B,K]}),e[74]=B,e[75]=K,e[76]=Q):Q=e[76],e[77]!==U||e[78]!==Q?(N=(0,a.jsx)(ae,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[U,Q]})}),e[77]=U,e[78]=Q,e[79]=N):N=e[79];let W;e[80]!==t?(W=t("Liveness"),e[80]=t,e[81]=W):W=e[81];let G;e[82]!==j||e[83]!==m||e[84]!==W?(G=(0,a.jsx)(ue,{label:W,level:j,testId:"dh-liveness",value:m}),e[82]=j,e[83]=m,e[84]=W,e[85]=G):G=e[85];let J;e[86]!==t?(J=t("Readiness"),e[86]=t,e[87]=J):J=e[87];let M;e[88]!==C||e[89]!==t?(M=t(C?"Ready":"Not ready"),e[88]=C,e[89]=t,e[90]=M):M=e[90];let O;e[91]!==Y||e[92]!==J||e[93]!==M?(O=(0,a.jsx)(ue,{label:J,level:Y,testId:"dh-readiness",value:M}),e[91]=Y,e[92]=J,e[93]=M,e[94]=O):O=e[94],e[95]!==G||e[96]!==O?(v=(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2","data-testid":"dh-probes",children:[G,O]}),e[95]=G,e[96]=O,e[97]=v):v=e[97],z=ae,S="gap-0 py-0",V="dh-checks";let X;e[98]!==t?(X=t("Subsystem checks"),e[98]=t,e[99]=X):X=e[99],e[100]!==X?(b=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:X})}),e[100]=X,e[101]=b):b=e[101],$=s.length===0?(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"dh-checks-empty",children:t("No checks reported.")}):(0,a.jsx)("ul",{className:"divide-y divide-border",children:s.map(f=>(0,a.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2.5 text-xs","data-testid":`dh-check-${f.name}`,children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:Z("size-1.5 shrink-0 rounded-full",f.status==="up"?"bg-success":"bg-destructive")}),(0,a.jsx)("span",{className:"font-mono text-foreground",children:f.name}),f.critical&&(0,a.jsx)(re,{variant:"outline",children:t("Critical")})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[f.message!==void 0&&(0,a.jsx)("span",{className:"text-muted-foreground",children:f.message}),(0,a.jsx)(re,{"data-testid":`dh-check-status-${f.name}`,variant:f.status==="up"?"secondary":"destructive",children:f.status==="up"?t("Up"):t("Down")})]})]},f.name))}),e[23]=r.appName,e[24]=r.appVersion,e[25]=r.checks,e[26]=r.timestamp,e[27]=j,e[28]=Y,e[29]=C,e[30]=m,e[31]=t,e[32]=z,e[33]=I,e[34]=y,e[35]=N,e[36]=v,e[37]=S,e[38]=V,e[39]=b,e[40]=$,e[41]=H}else z=e[32],I=e[33],y=e[34],N=e[35],v=e[36],S=e[37],V=e[38],b=e[39],$=e[40],H=e[41];let P;e[102]!==z||e[103]!==S||e[104]!==V||e[105]!==b||e[106]!==$?(P=(0,a.jsxs)(z,{className:S,"data-testid":V,children:[b,$]}),e[102]=z,e[103]=S,e[104]=V,e[105]=b,e[106]=$,e[107]=P):P=e[107];let te;return e[108]!==I||e[109]!==y||e[110]!==N||e[111]!==v||e[112]!==P||e[113]!==H?(te=(0,a.jsxs)("div",{className:H,"data-testid":I,children:[y,N,v,P]}),e[108]=I,e[109]=y,e[110]=N,e[111]=v,e[112]=P,e[113]=H,e[114]=te):te=e[114],te},"Ie");function _e(n,e){return n.name.localeCompare(e.name)}k(_e,"be");export{De as DeploymentHealthPanel};
@@ -0,0 +1,2 @@
1
+ import{a as hr}from"./chunk-46IB4C4Q.js";import{a as D,b as It,c as F,h as ve,i as Ce,j as yt}from"./chunk-ZFWEPGWG.js";import{a as Et,c as ue,d as z,g as V,i as de,j as $}from"./chunk-4FNHHFWR.js";import{a as r,d as te,e as g,f as y,g as vr,h as re,j as Ct}from"./chunk-UHHTEBC3.js";var mr=g(vr(),1),Ba=g(y(),1);var dr=g(y(),1);var qe={};te(qe,{Control:()=>sr,Description:()=>tr,Error:()=>Zt,Item:()=>ur,Label:()=>Gt,Root:()=>qt,Validity:()=>lr});var A=g(y(),1);var Ee=g(y(),1);var He=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});var oe={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},fe={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ft={disabled:!1,...fe},W={valid(e){return e===null?null:e?{[He.valid]:""}:{[He.invalid]:""}}};var Cr={invalid:void 0,name:void 0,validityData:{state:oe,errors:[],error:"",value:"",initialValue:null},setValidityData:V,disabled:void 0,touched:fe.touched,setTouched:V,dirty:fe.dirty,setDirty:V,filled:fe.filled,setFilled:V,focused:fe.focused,setFocused:V,validate:r(()=>null,"validate"),validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:r(()=>!1,"shouldValidateOnChange"),state:Ft,markedDirtyRef:{current:!1},registerFieldControl:V,validation:{getValidationProps:r((e,t=de)=>t,"getValidationProps"),inputRef:{current:null},registerInput:V,commit:r(async()=>{},"commit"),change:V}},Je=Ee.createContext(Cr);function B(e=!0){let t=Ee.useContext(Je);if(t.setValidityData===V&&!e)throw new Error(ue(28));return t}r(B,"useFieldRootContext");var Ie=g(y(),1);var Er=Ie.createContext(void 0);function Tt(e=!1){let t=Ie.useContext(Er);if(!t&&!e)throw new Error(ue(86));return t}r(Tt,"useFieldsetRootContext");var ye=g(y(),1);var Ir=ye.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:V,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function H(){return ye.useContext(Ir)}r(H,"useFormContext");var Q=g(y(),1);var Fe=g(y(),1);var Dt=0;function yr(e,t="mui"){let[o,n]=Fe.useState(e),i=e||o;return Fe.useEffect(()=>{o==null&&(Dt+=1,n(`${t}-${Dt}`))},[o,t]),i}r(yr,"useGlobalId");var St=It.useId;function At(e,t){if(St!==void 0){let o=St();return e??(t?`${t}-${o}`:o)}return yr(e,t)}r(At,"useId");function J(e){return At(e,"base-ui")}r(J,"useBaseUiId");var Te=g(y(),1);var Xe=Te.createContext({controlId:void 0,registerControlId:V,labelId:void 0,setLabelId:V,messageIds:[],setMessageIds:V,getDescriptionProps:r(e=>e,"getDescriptionProps")});function P(){return Te.useContext(Xe)}r(P,"useLabelableContext");var Vt=g(re(),1);var De=r(function(t){let o=J(),n=t.controlId===void 0?o:t.controlId,[i,s]=Q.useState(n),[l,a]=Q.useState(t.labelId),[u,d]=Q.useState([]),m=z(()=>new Map),{messageIds:f}=P(),h=F((R,T)=>{let N=m.current;if(T===void 0){N.delete(R);return}N.set(R,T),s(C=>{if(N.size===0)return;let k;for(let c of N.values()){if(C!==void 0&&c===C)return C;k===void 0&&(k=c)}return k})}),p=Q.useCallback(R=>{let T=R["aria-describedby"]?R["aria-describedby"].split(" "):[];return T.push(...f,...u),{...R,"aria-describedby":Array.from(new Set(T)).join(" ")||void 0}},[f,u]),v=Q.useMemo(()=>({controlId:i,registerControlId:h,labelId:l,setLabelId:a,messageIds:u,setMessageIds:d,getDescriptionProps:p}),[i,h,l,a,u,d,p]);return(0,Vt.jsx)(Xe.Provider,{value:v,children:t.children})},"LabelableProvider");var be=g(y(),1);function Nt(e={}){let{id:t,implicit:o=!1,controlRef:n}=e,{controlId:i,registerControlId:s}=P(),l=J(t),a=o?i:void 0,u=z(()=>Symbol("labelable-control")),d=be.useRef(!1),m=be.useRef(t!=null),f=F(()=>{!d.current||s===V||(d.current=!1,s(u.current,void 0))});return D(()=>{if(s===V)return;let h;if(o){let p=n?.current;ve(p)&&p.closest("label")!=null?h=t??null:h=a??l}else if(t!=null)m.current=!0,h=t;else if(m.current)h=l;else{f();return}if(h===void 0){f();return}d.current=!0,s(u.current,h)},[t,n,a,s,o,l,u,f]),be.useEffect(()=>f,[f]),i??l}r(Nt,"useLabelableId");function Se(e){return e?.ownerDocument||document}r(Se,"ownerDocument");var Ae={};te(Ae,{engine:()=>rt,env:()=>nt,os:()=>et,screenReader:()=>ot});var et={};te(et,{android:()=>_t,apple:()=>Ze,ios:()=>Qe,linux:()=>Ar,mac:()=>Ot,windows:()=>Sr});function Fr(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}r(Fr,"readRawData");var{userAgent:Tr,platform:Dr,maxTouchPoints:wt}=Fr(),ne=Tr.toLowerCase(),ie=Dr.toLowerCase();var Qe=/^i(os$|p)/.test(ie)||ie==="macintel"&&wt>1,Lt="android",_t=ie===Lt||ne.includes(Lt),Ot=!Qe&&ie.startsWith("mac"),Sr=ie.startsWith("win"),Ar=!_t&&/^(linux|chrome os)/.test(ie),Ze=Ot||Qe;var rt={};te(rt,{blink:()=>Nr,gecko:()=>Vr,webkit:()=>tt});var tt=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),Vr=!tt&&ne.includes("firefox"),Nr=!tt&&ne.includes("chrom");var ot={};te(ot,{voiceOver:()=>wr});var wr=Ze;var nt={};te(nt,{jsdom:()=>Lr});var Lr=/jsdom|happydom/.test(ne);var it="data-base-ui-focusable";var st="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Fn="ArrowLeft",Tn="ArrowRight",Dn="ArrowUp",Sn="ArrowDown";function at(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}r(at,"activeElement");function Mt(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&yt(o)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}r(Mt,"contains");function lt(e){return"composedPath"in e?e.composedPath()[0]:e.target}r(lt,"getTarget");function Pn(e,t){if(!ve(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute("data-trigger-disabled");for(let[,n]of t.entries())if(Mt(n,o))return!n.hasAttribute("data-trigger-disabled");return!1}r(Pn,"isTargetInsideEnabledTrigger");function kn(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}r(kn,"isEventTargetWithin");function Un(e){return e.matches("html,body")}r(Un,"isRootElement");function _r(e){return Ce(e)&&e.matches(st)}r(_r,"isTypeableElement");function jn(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${st}`)!=null}r(jn,"isInteractiveElement");function Bn(e){return e?e.getAttribute("role")==="combobox"&&_r(e):!1}r(Bn,"isTypeableCombobox");function $n(e){if(!e||Ae.env.jsdom)return!0;try{return e.matches(":focus-visible")}catch{return!0}}r($n,"matchesFocusVisible");function Wn(e){return e?e.hasAttribute(it)?e:e.querySelector(`[${it}]`)||e:null}r(Wn,"getFloatingFocusElement");function Pt(e,t){let o=J(e);return D(()=>(t(o),()=>{t(void 0)}),[o,t]),o}r(Pt,"useRegisteredLabelId");function kt(e={}){let{id:t,fallbackControlId:o,native:n=!1,setLabelId:i,focusControl:s}=e,{controlId:l,setLabelId:a}=P(),u=F(p=>{a(p),i?.(p)}),d=Pt(t,u),m=l??o;function f(p){if(s){s(p,m);return}if(!m)return;let v=Se(p.currentTarget).getElementById(m);Ce(v)&&Or(v)}r(f,"focusControl");function h(p){lt(p.nativeEvent)?.closest("button,input,select,textarea")||(!p.defaultPrevented&&p.detail>1&&p.preventDefault(),!n&&f(p))}return r(h,"handleInteraction"),n?{id:d,htmlFor:m??void 0,onMouseDown:h}:{id:d,onClick:h,onPointerDown(p){p.preventDefault()}}}r(kt,"useLabel");function Or(e){e.focus({focusVisible:!0})}r(Or,"focusElementWithVisible");var Z=g(y(),1);var Ut=g(y(),1);var Mr=[];function Ve(e){Ut.useEffect(e,Mr)}r(Ve,"useOnMount");var xe=0,ct=class e{static{r(this,"Timeout")}static create(){return new e}currentId=xe;start(t,o){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xe,o()},t)}isStarted(){return this.currentId!==xe}clear=r(()=>{this.currentId!==xe&&(clearTimeout(this.currentId),this.currentId=xe)},"clear");disposeEffect=r(()=>this.clear,"disposeEffect")};function jt(){let e=z(ct.create).current;return Ve(e.disposeEffect),e}r(jt,"useTimeout");function se(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}r(se,"getCombinedFieldValidityData");var Ne=Object.keys(oe);function Pr(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let o of Ne)o!=="valid"&&(o==="valueMissing"?t=e[o]:e[o]&&(t=!1));return t}r(Pr,"isOnlyValueMissing");function kr(e){let t=null;for(let o of e)if(!o.disabled){if(!o.validity.valid)return o;t??=o}return t}r(kr,"findRepresentativeInput");function Bt(e,t){let o=!1;for(let n of t)n.setCustomValidity(""),o||=n===e;o||e.setCustomValidity("")}r(Bt,"clearCustomValidity");function $t(e){let{formRef:t}=H(),{setValidityData:o,validate:n,validityData:i,validationDebounceTime:s,invalid:l,markedDirtyRef:a,state:u,shouldValidateOnChange:d,getRegisteredFieldId:m}=e,{controlId:f,getDescriptionProps:h}=P(),p=jt(),v=Z.useRef(null),R=z(()=>new Set).current,T=Z.useRef(0),N=Z.useCallback(b=>{if(b)return R.add(b),()=>{R.delete(b)}},[R]),C=F(async(b,w=!1)=>{let E=kr(R)??v.current;if(!E)return;T.current+=1;let ee=T.current;function q(M,S=l){let _=m()??f;if(_==null)return;let x=t.current.fields.get(_);if(!x)return;let K=se(M,S);t.current.fields.set(_,{...x,validityData:K})}if(r(q,"updateRegisteredFieldValidity"),w){if(u.valid!==!1)return;let M=E.validity;if(!M.valueMissing){let _={value:b,state:{...oe,valid:!0},error:"",errors:[],initialValue:i.initialValue};Bt(E,R),q(_,!1),o(_);return}let S=Ne.reduce((_,x)=>(_[x]=M[x],_),{});if(!S.valid&&!Pr(S))return}function G(M){let S=Ne.reduce((x,K)=>(x[K]=M.validity[K],x),{}),_=!1;for(let x of Ne)if(x!=="valid"){if(x==="valueMissing"&&S[x])_=!0;else if(S[x])return S}return _&&!a.current&&(S.valid=!0,S.valueMissing=!1),S}r(G,"getState"),p.clear();let I=null,O=[],U=G(E),j,Y=d();if(E.validationMessage&&!Y)j=E.validationMessage,O=[E.validationMessage];else{let M=Array.from(t.current.fields.values()).reduce((_,x)=>(x.name&&(_[x.name]=x.getValue()),_),{}),S=n(b,M);if(typeof S=="object"&&S!==null&&"then"in S){if(I=await S,ee!==T.current)return}else I=S;I!==null?(U.valid=!1,U.customError=!0,Array.isArray(I)?(O=I,E.setCustomValidity(I.join(`
2
+ `))):I&&(O=[I],E.setCustomValidity(I))):Y&&(Bt(E,R),U.customError=!1,E.validationMessage?(j=E.validationMessage,O=[E.validationMessage]):E.validity.valid&&!U.valid&&(U.valid=!0))}let L={value:b,state:U,error:j??(Array.isArray(I)?I[0]:I??""),errors:O,initialValue:i.initialValue};q(L),o(L)}),k=F(b=>{p.clear();let w=d();w&&b!==""&&s?(T.current+=1,p.start(s,()=>{C(b)})):C(b,!w)}),c=Z.useCallback((b,w={})=>Et(h(w),u.valid===!1&&!u.disabled&&!b?{"aria-invalid":!0}:de),[h,u.disabled,u.valid]);return Z.useMemo(()=>({getValidationProps:c,inputRef:v,registerInput:N,commit:C,change:k}),[c,N,C,k])}r($t,"useFieldValidation");var we=g(y(),1);function Wt(e){let{commit:t,invalid:o,markedDirtyRef:n,name:i,setRegisteredFieldName:s,setRegisteredFieldId:l,setValidityData:a,validityData:u}=e,{formRef:d}=H(),m=we.useRef(null),f=we.useRef(null),h=we.useRef(null),p=F(()=>{let c=f.current;if(c)return c.getValue?c.getValue():c.value});function v(c){return c.value===void 0?p():c.value}r(v,"getRegistrationValue");let R=F(()=>{let c=f.current;if(n.current=!0,!c){t(u.value);return}t(v(c))});function T(){let c=f.current;!c||!c.id||d.current.fields.set(c.id,{getValue:p,name:i??c.name,controlRef:c.controlRef??h,validityData:se(u,o),validate:R})}r(T,"refreshRegistration");function N(c=f.current?.id){c&&d.current.fields.delete(c)}r(N,"deleteRegistration");function C(){let c=f.current;if(!c)return;let b=v(c);u.initialValue===null&&b!==null&&a(w=>({...w,initialValue:b}))}r(C,"syncInitialValue"),D(()=>{let c=f.current;!c||!c.id||(s(i?void 0:c.name),d.current.fields.set(c.id,{getValue:p,name:i??c.name,controlRef:c.controlRef??h,validityData:se(u,o),validate:R}))},[d,p,o,i,s,R,u]),D(()=>{let c=d.current.fields;return()=>{let b=f.current?.id;b&&c.delete(b)}},[d]);let k=F((c,b)=>{if(!b){m.current===c&&(m.current=null,N(),f.current=null,s(void 0),l(void 0));return}let w=f.current?.id;m.current=c,f.current=b,i||s(b.name),l(b.id),w&&w!==b.id&&N(w),C(),T()});return[R,k]}r(Wt,"useFieldControlRegistration");var Le=g(re(),1);var Ur=A.forwardRef(r(function(t,o){let{errors:n,validationMode:i,submitAttemptedRef:s}=H(),{render:l,className:a,validate:u,validationDebounceTime:d=0,validationMode:m=i,name:f,disabled:h=!1,invalid:p,dirty:v,touched:R,actionsRef:T,style:N,...C}=t,k=Tt(!0)?.disabled,c=F(u||(()=>null)),b=k||h,[w,E]=A.useState(!1),[ee,q]=A.useState(!1),[G,I]=A.useState(!1),[O,U]=A.useState(!1),j=v??ee,Y=R??w,L=A.useRef(j),M=A.useRef(void 0),[S,_]=A.useState(),x=f??S;D(()=>{v!==void 0&&(L.current=v)},[v]);let K=A.useCallback(()=>M.current,[]),br=A.useCallback(ce=>{M.current=ce},[]),xt=F(ce=>{v===void 0&&(ce&&(L.current=!0),q(ce))}),gt=F(ce=>{R===void 0&&E(ce)}),Ge=F(()=>m==="onChange"||m==="onSubmit"&&s.current),Ye=x&&Object.hasOwn(n,x)?n[x]:null,xr=!!(Array.isArray(Ye)?Ye.length:Ye),me=p===!0||xr,[pe,Ke]=A.useState({state:oe,error:"",errors:[],value:null,initialValue:null}),Rt=b?null:!me&&pe.state.valid,he=A.useMemo(()=>({disabled:b,touched:Y,dirty:j,valid:Rt,filled:G,focused:O}),[b,Y,j,Rt,G,O]),ze=$t({setValidityData:Ke,validate:c,validityData:pe,validationDebounceTime:d,invalid:me,markedDirtyRef:L,state:he,shouldValidateOnChange:Ge,getRegisteredFieldId:K}),[ht,vt]=Wt({commit:ze.commit,invalid:me,markedDirtyRef:L,name:f,setRegisteredFieldName:_,setRegisteredFieldId:br,setValidityData:Ke,validityData:pe});A.useImperativeHandle(T,()=>({validate:ht}),[ht]);let gr=A.useMemo(()=>({invalid:me,name:x,validityData:pe,setValidityData:Ke,disabled:b,touched:Y,setTouched:gt,dirty:j,setDirty:xt,filled:G,setFilled:I,focused:O,setFocused:U,validate:c,validationMode:m,validationDebounceTime:d,shouldValidateOnChange:Ge,state:he,markedDirtyRef:L,registerFieldControl:vt,validation:ze}),[me,x,pe,b,Y,gt,j,xt,G,I,O,U,c,m,d,Ge,he,vt,ze]),Rr=$("div",t,{ref:o,state:he,props:C,stateAttributesMapping:W});return(0,Le.jsx)(Je.Provider,{value:gr,children:Rr})},"FieldRootInner")),qt=A.forwardRef(r(function(t,o){return(0,Le.jsx)(De,{children:(0,Le.jsx)(Ur,{...t,ref:o})})},"FieldRoot"));var ge=g(y(),1);var _e=g(y(),1);var ut=_e.createContext({disabled:!1});function Oe(){return _e.useContext(ut)}r(Oe,"useFieldItemContext");var Gt=ge.forwardRef(r(function(t,o){let{render:n,className:i,style:s,id:l,nativeLabel:a=!0,...u}=t,d=B(!1),m=Oe(),{labelId:f}=P(),h={...d.state,disabled:d.disabled||m.disabled},p=ge.useRef(null),v=kt({id:f??l,native:a});return $("label",t,{ref:[o,p],state:h,props:[v,u],stateAttributesMapping:W})},"FieldLabel"));var ae=g(y(),1);var Xt=g(y(),1);var Ht=g(hr(),1);var Me=null,Zi=globalThis.requestAnimationFrame,dt=class{static{r(this,"Scheduler")}callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=r(t=>{this.isScheduled=!1;let o=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let i=0;i<o.length;i+=1)o[i]?.(t)},"tick");request(t){let o=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),o}cancel(t){let o=t-this.startId;o<0||o>=this.callbacks.length||(this.callbacks[o]=null,this.callbacksCount-=1)}},Pe=new dt,X=class e{static{r(this,"AnimationFrame")}static create(){return new e}static request(t){return Pe.request(t)}static cancel(t){return Pe.cancel(t)}currentId=Me;request(t){this.cancel(),this.currentId=Pe.request(()=>{this.currentId=Me,t()})}cancel=r(()=>{this.currentId!==Me&&(Pe.cancel(this.currentId),this.currentId=Me)},"cancel");disposeEffect=r(()=>this.cancel,"disposeEffect")};function Yt(){let e=z(X.create).current;return Ve(e.disposeEffect),e}r(Yt,"useAnimationFrame");function Kt(e){return e==null?e:"current"in e?e.current:e}r(Kt,"resolveRef");var ke=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({}),jr={[ke.startingStyle]:""},Br={[ke.endingStyle]:""},zt={transitionStatus(e){return e==="starting"?jr:e==="ending"?Br:null}};function Jt(e,t=!1,o=!0){let n=Yt();return F((i,s=null)=>{n.cancel();let l=Kt(e);if(l==null)return;let a=l,u=r(()=>{Ht.flushSync(i)},"done");if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function d(){Promise.all(a.getAnimations().map(m=>m.finished)).then(()=>{s?.aborted||u()}).catch(()=>{if(o){s?.aborted||u();return}let m=a.getAnimations();!s?.aborted&&m.length>0&&m.some(f=>f.pending||f.playState!=="finished")&&d()})}if(r(d,"exec"),t){let m=ke.startingStyle;if(!a.hasAttribute(m)){n.request(d);return}let f=new MutationObserver(()=>{a.hasAttribute(m)||(f.disconnect(),d())});f.observe(a,{attributes:!0,attributeFilter:[m]}),s?.addEventListener("abort",()=>f.disconnect(),{once:!0});return}n.request(d)})}r(Jt,"useAnimationsFinished");function Qt(e){let{enabled:t=!0,open:o,ref:n,onComplete:i}=e,s=F(i),l=Jt(n,o,!1);Xt.useEffect(()=>{if(!t)return;let a=new AbortController;return l(s,a.signal),()=>{a.abort()}},[t,o,s,l])}r(Qt,"useOpenChangeComplete");var ft=g(y(),1);function Ue(e,t=!1,o=!1){let[n,i]=ft.useState(e&&t?"idle":void 0),[s,l]=ft.useState(e);return e&&!s&&(l(!0),i("starting")),!e&&s&&n!=="ending"&&!o&&i("ending"),!e&&!s&&n==="ending"&&i(void 0),D(()=>{if(!e&&s&&n!=="ending"&&o){let a=X.request(()=>{i("ending")});return()=>{X.cancel(a)}}},[e,s,n,o]),D(()=>{if(!e||t)return;let a=X.request(()=>{i(void 0)});return()=>{X.cancel(a)}},[t,e]),D(()=>{if(!e||!t)return;e&&s&&n!=="idle"&&i("starting");let a=X.request(()=>{i("idle")});return()=>{X.cancel(a)}},[t,e,s,n]),{mounted:s,setMounted:l,transitionStatus:n}}r(Ue,"useTransitionStatus");var mt=g(re(),1);var $r={...W,...zt},Zt=ae.forwardRef(r(function(t,o){let{render:n,id:i,className:s,match:l,style:a,...u}=t,d=J(i),{validityData:m,state:f,name:h}=B(!1),{setMessageIds:p}=P(),{errors:v}=H(),R=h&&Object.hasOwn(v,h)?v[h]:null,T=!!(Array.isArray(R)?R.length:R),N=typeof l=="string",C=!1;l===!0?C=!0:f.disabled?C=!1:N?C=!!m.state[l]:C=T||m.state.valid===!1;let{mounted:k,transitionStatus:c,setMounted:b}=Ue(C);D(()=>{if(!(!C||!d))return p(L=>L.concat(d)),()=>{p(L=>L.filter(M=>M!==d))}},[C,d,p]);let w=ae.useRef(null),[E,ee]=ae.useState(null),[q,G]=ae.useState(null),I=m.error;!N&&T?I=R:m.errors.length>1&&(I=m.errors);let O=I??"";Array.isArray(I)&&(O=I.length>1?(0,mt.jsx)("ul",{children:I.map(L=>(0,mt.jsx)("li",{children:L},L))}):I[0]??"");let U=Array.isArray(I)?JSON.stringify(I):I;C&&U!==q&&(G(U),ee(O)),Qt({open:C,ref:w,onComplete(){C||b(!1)}});let j={...f,transitionStatus:c},Y=$("div",t,{ref:[o,w],state:j,props:[{id:d,children:C?O:E},u],stateAttributesMapping:$r,enabled:k});return k?Y:null},"FieldError"));var er=g(y(),1);var tr=er.forwardRef(r(function(t,o){let{render:n,id:i,className:s,style:l,...a}=t,u=J(i),d=B(!1),m=Oe(),{setMessageIds:f}=P(),h={...d.state,disabled:d.disabled||m.disabled};return D(()=>{if(u)return f(v=>v.concat(u)),()=>{f(v=>v.filter(R=>R!==u))}},[u,f]),$("p",t,{ref:o,state:h,props:[{id:u},a],stateAttributesMapping:W})},"FieldDescription"));var Be=g(y(),1);var le=g(y(),1);function rr({controlled:e,default:t,name:o,state:n="value"}){let{current:i}=le.useRef(e!==void 0),[s,l]=le.useState(t),a=i?e:s,u=le.useCallback(d=>{i||l(d)},[]);return[a,u]}r(rr,"useControlled");var or=g(y(),1);function nr(e,t,o,n,i=!0,s){let{registerFieldControl:l}=B(),a=or.useRef(null);a.current||(a.current=Symbol()),D(()=>{let u=a.current;return!u||!i?void 0:(l(u,{controlRef:e,getValue:n,id:t,name:s,value:o}),()=>{l(u,void 0)})},[e,i,n,t,s,l,o])}r(nr,"useRegisterFieldControl");var je={};te(je,{cancelOpen:()=>go,chipRemovePress:()=>Qr,clearPress:()=>Xr,closePress:()=>Hr,closeWatcher:()=>co,decrementPress:()=>to,disabled:()=>ho,drag:()=>po,escapeKey:()=>lo,focusOut:()=>ao,imperativeAction:()=>Eo,incrementPress:()=>eo,initial:()=>Co,inputBlur:()=>no,inputChange:()=>ro,inputClear:()=>oo,inputPaste:()=>io,inputPress:()=>so,itemPress:()=>zr,keyboard:()=>fo,linkPress:()=>Jr,listNavigation:()=>uo,missing:()=>vo,none:()=>Wr,outsidePress:()=>Kr,pointer:()=>mo,scrub:()=>xo,siblingOpen:()=>Ro,swipe:()=>Io,trackPress:()=>Zr,triggerFocus:()=>Yr,triggerHover:()=>Gr,triggerPress:()=>qr,wheel:()=>bo,windowResize:()=>yo});var Wr="none",qr="trigger-press",Gr="trigger-hover",Yr="trigger-focus",Kr="outside-press",zr="item-press",Hr="close-press",Jr="link-press",Xr="clear-press",Qr="chip-remove-press",Zr="track-press",eo="increment-press",to="decrement-press",ro="input-change",oo="input-clear",no="input-blur",io="input-paste",so="input-press",ao="focus-out",lo="escape-key",co="close-watcher",uo="list-navigation",fo="keyboard",mo="pointer",po="drag",bo="wheel",xo="scrub",go="cancel-open",Ro="sibling-open",ho="disabled",vo="missing",Co="initial",Eo="imperative-action",Io="swipe",yo="window-resize";function ir(e,t,o,n){let i=!1,s=!1,l=n??de;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){s=!0},get isCanceled(){return i},get isPropagationAllowed(){return s},trigger:o,...l}}r(ir,"createChangeEventDetails");var sr=Be.forwardRef(r(function(t,o){let{render:n,className:i,id:s,name:l,value:a,disabled:u=!1,onValueChange:d,defaultValue:m,autoFocus:f=!1,style:h,...p}=t,{state:v,name:R,disabled:T,setTouched:N,setDirty:C,validityData:k,setFocused:c,setFilled:b,validationMode:w,validation:E}=B(),{clearErrors:ee}=H(),q=T||u,G=R??l,I={...v,disabled:q},{labelId:O}=P(),U=Nt({id:s});D(()=>{let x=a!=null;E.inputRef.current?.value||x&&a!==""?b(!0):x&&a===""&&b(!1)},[E.inputRef,b,a]);let j=Be.useRef(null);D(()=>{f&&j.current===at(Se(j.current))&&c(!0)},[f,c]);let[Y]=rr({controlled:a,default:m,name:"FieldControl",state:"value"}),L=a!==void 0,M=L?Y:void 0,S=F(()=>E.inputRef.current?.value);return nr(E.inputRef,U,M,S,!q,l),$("input",t,{ref:[o,j],state:I,props:[{id:U,disabled:q,name:G,ref:E.inputRef,"aria-labelledby":O,autoFocus:f,...L?{value:M}:{defaultValue:m},onChange(x){let K=x.currentTarget.value;d?.(K,ir(je.none,x.nativeEvent)),C(K!==k.initialValue),b(K!==""),x.nativeEvent.defaultPrevented||(ee(G),E.change(K))},onFocus(){c(!0)},onBlur(x){N(!0),c(!1),w==="onBlur"&&E.commit(x.currentTarget.value)},onKeyDown(x){x.currentTarget.tagName==="INPUT"&&x.key==="Enter"&&(N(!0),E.commit(x.currentTarget.value))}},p,x=>E.getValidationProps(q,x)],stateAttributesMapping:W})},"FieldControl"));var Re=g(y(),1);var ar=g(re(),1);var lr=r(function(t){let{children:o}=t,{validityData:n,invalid:i}=B(!1),s=Re.useMemo(()=>se(n,i),[n,i]),l=s.state.valid===!1,{transitionStatus:a}=Ue(l),u=Re.useMemo(()=>({...s,validity:s.state,transitionStatus:a}),[s,a]);return(0,ar.jsx)(Re.Fragment,{children:o(u)})},"FieldValidity");var We=g(y(),1);var $e=g(y(),1);var Fo=$e.createContext(void 0);function cr(e=!0){let t=$e.useContext(Fo);if(t===void 0&&!e)throw new Error(ue(3));return t}r(cr,"useCheckboxGroupContext");var pt=g(re(),1);var ur=We.forwardRef(r(function(t,o){let{render:n,className:i,style:s,disabled:l=!1,...a}=t,{state:u,disabled:d}=B(!1),m=d||l,f={...u,disabled:m},h=cr(),v=h?.allValues!==void 0?h?.parent.id:void 0,R=We.useMemo(()=>({disabled:m}),[m]),T=$("div",t,{ref:o,state:f,props:a,stateAttributesMapping:W});return(0,pt.jsx)(De,{controlId:v,children:(0,pt.jsx)(ut.Provider,{value:R,children:T})})},"FieldItem"));var fr=g(re(),1);var bt=dr.forwardRef(r(function(t,o){return(0,fr.jsx)(qe.Control,{ref:o,...t})},"Input"));var pr=g(re(),1);function qa(e){let t=(0,mr.c)(10),o,n,i;t[0]!==e?({className:o,type:i,...n}=e,t[0]=e,t[1]=o,t[2]=n,t[3]=i):(o=t[1],n=t[2],i=t[3]);let s;t[4]!==o?(s=Ct("h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",o),t[4]=o,t[5]=s):s=t[5];let l;return t[6]!==n||t[7]!==s||t[8]!==i?(l=(0,pr.jsx)(bt,{type:i,"data-slot":"input",className:s,...n}),t[6]=n,t[7]=s,t[8]=i,t[9]=l):l=t[9],l}r(qa,"g");export{W as a,B as b,H as c,At as d,J as e,P as f,Nt as g,Se as h,Ae as i,it as j,Fn as k,Tn as l,Dn as m,Sn as n,at as o,Mt as p,lt as q,Pn as r,kn as s,Un as t,_r as u,jn as v,Bn as w,$n as x,Wn as y,kt as z,Ve as A,ct as B,jt as C,Oe as D,X as E,Yt as F,Kt as G,ke as H,zt as I,Jt as J,Qt as K,Ue as L,rr as M,nr as N,je as O,ir as P,cr as Q,qa as R};
@@ -0,0 +1 @@
1
+ import{a as q,b as L,c as B,d as f,e as c,f as d}from"./chunk-Q5WXTZWX.js";import{a as I,e as j}from"./chunk-JKPK25JO.js";import{R as Q}from"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import{c as W}from"./chunk-UY2Y5CXB.js";import"./chunk-ZFWEPGWG.js";import"./chunk-4FNHHFWR.js";import{f as F}from"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{a as Z}from"./chunk-6OKDCV7J.js";import{d as K,h as S,l as $,m as V}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as h,e as C,f as R,g as P,h as U}from"./chunk-UHHTEBC3.js";var A=C(P(),1);var n=C(R(),1);var e=C(U(),1);var X=10,g=h(v=>{let l=(0,A.c)(7),{label:m,value:t}=v,r;l[0]!==m?(r=(0,e.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:m}),l[0]=m,l[1]=r):r=l[1];let p=t??"\u2014",s;l[2]!==p?(s=(0,e.jsx)("span",{className:"font-mono text-sm",children:p}),l[2]=p,l[3]=s):s=l[3];let u;return l[4]!==r||l[5]!==s?(u=(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r,s]}),l[4]=r,l[5]=s,l[6]=u):u=l[6],u},"g"),se=h(({loadIndexes:v,runQuery:l}={})=>{let m=F(),t=K(),[r,p]=(0,n.useState)(null),[s,u]=(0,n.useState)(null),[N,E]=(0,n.useState)(null),[b,D]=(0,n.useState)(""),[x,y]=(0,n.useState)(null),[M,w]=(0,n.useState)(null),[T,z]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let a={cancelled:!1};return V((async()=>{try{let i=await(v??(()=>m.listVectorIndexes()))();a.cancelled||(p(i),u(null),E(k=>k??i[0]?.name??null))}catch(i){a.cancelled||(p(null),u(S(i)))}})()),()=>{a.cancelled=!0}},[m,v]);let o=r?.find(a=>a.name===N)??null,G=h(a=>{E(a.currentTarget.dataset.index??null),y(null),w(null)},"K"),H=h(a=>{D(a.target.value)},"T"),J=h(async()=>{let a=b.trim();if(!(N===null||a==="")){z(!0),w(null);try{let i=await(l??(k=>m.queryVectorIndex(k)))({name:N,text:a,topK:X});y(i)}catch(i){y(null),w(S(i))}finally{z(!1)}}},"Z"),O=h(()=>{V(J())},"z");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-vector-browser",children:[s!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"vector-error",role:"alert",children:s}),r!==null&&r.length===0&&(0,e.jsx)(Z,{description:t("Indexes declared with .vectorize() or defineVectorIndex() appear here."),icon:(0,e.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"})}),testId:"vector-empty",title:t("No vector indexes.")}),r!==null&&r.length>0&&(0,e.jsx)(I,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(q,{"data-testid":"vector-table",children:[(0,e.jsx)(L,{children:(0,e.jsxs)(f,{children:[(0,e.jsx)(c,{children:t("name")}),(0,e.jsx)(c,{children:t("table")}),(0,e.jsx)(c,{children:t("dimensions")}),(0,e.jsx)(c,{children:t("metric")}),(0,e.jsx)(c,{children:t("vectors")})]})}),(0,e.jsx)(B,{children:r.map(a=>(0,e.jsxs)(f,{className:a.name===N?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-index":a.name,"data-testid":`vector-row-${a.name}`,onClick:G,children:[(0,e.jsx)(d,{className:"font-mono text-xs",children:a.name}),(0,e.jsx)(d,{className:"font-mono text-xs",children:a.table}),(0,e.jsx)(d,{className:"tabular-nums",children:a.dimensions??"\u2014"}),(0,e.jsx)(d,{children:a.metric??"\u2014"}),(0,e.jsx)(d,{className:"tabular-nums",children:a.vectorsCount??"\u2014"})]},a.name))})]})})}),o!==null&&(0,e.jsxs)("section",{className:"border border-border bg-card p-3","data-testid":"vector-detail",children:[(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,e.jsx)(g,{label:t("field"),value:o.field}),(0,e.jsx)(g,{label:t("dimensions"),value:o.dimensions}),(0,e.jsx)(g,{label:t("metric"),value:o.metric}),(0,e.jsx)(g,{label:t("vectors"),value:o.vectorsCount})]}),o.metadata!==void 0&&o.metadata.length>0&&(0,e.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground","data-testid":"vector-metadata",children:[t("metadata"),": ",(0,e.jsx)("span",{className:"font-mono",children:o.metadata.join(", ")})]}),(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,e.jsx)(Q,{className:"min-w-[18rem] flex-1","data-testid":"vector-query-input",onChange:H,placeholder:t("Search by similarity\u2026"),value:b}),(0,e.jsx)(W,{"data-testid":"vector-search",disabled:T||b.trim()==="",onClick:O,children:t(T?"Searching\u2026":"Search")})]}),M!==null&&(0,e.jsx)("p",{className:"mt-2 text-sm text-destructive","data-testid":"vector-query-error",role:"alert",children:M}),x!==null&&x.length===0&&(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground","data-testid":"vector-no-matches",children:t("No matches.")}),x!==null&&x.length>0&&(0,e.jsx)(I,{className:"mt-3 overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(q,{"data-testid":"vector-matches",children:[(0,e.jsx)(L,{children:(0,e.jsxs)(f,{children:[(0,e.jsx)(c,{children:t("id")}),(0,e.jsx)(c,{children:t("score")}),(0,e.jsx)(c,{children:t("metadata")})]})}),(0,e.jsx)(B,{children:x.map(a=>(0,e.jsxs)(f,{"data-testid":`vector-match-${a.id}`,children:[(0,e.jsx)(d,{className:"font-mono text-xs",children:a.id}),(0,e.jsx)(d,{className:"tabular-nums",children:a.score.toFixed(4)}),(0,e.jsx)(d,{className:"max-w-md truncate font-mono text-xs",children:a.metadata===void 0?"\u2014":$(a.metadata)})]},a.id))})]})})})]})]})},"ce");export{se as VectorBrowser};
@@ -0,0 +1 @@
1
+ import{a as w,b as x,c as N,d as j}from"./chunk-OTJOI23O.js";import{d as y,l as g}from"./chunk-KLLYGWNF.js";import{a as v,e as b,g as S,h as B}from"./chunk-UHHTEBC3.js";var q=b(S(),1);var a=b(B(),1);var K=50,T={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},X=v(r=>{let l=r.columns.find(e=>r.rows.length>0&&r.rows.every(o=>typeof o[e]=="number"))??null;return{label:r.columns.find(e=>e!==l)??null,value:l}},"S"),$=v(r=>{let l=(0,q.c)(15),{result:e}=r,o=y(),c;l[0]!==e?(c=X(e),l[0]=e,l[1]=c):c=l[1];let{label:u,value:n}=c,m;l[2]!==u||l[3]!==e||l[4]!==n?(m=n===null?[]:e.rows.slice(0,K).map((t,s)=>({label:u===null?`#${(s+1).toString()}`:g(t[u]),value:Number(t[n])||0})),l[2]=u,l[3]=e,l[4]=n,l[5]=m):m=l[5];let p=m;if(n===null){let t;l[6]!==o?(t=o("No numeric column to chart."),l[6]=o,l[7]=t):t=l[7];let s;return l[8]!==t?(s=(0,a.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:t}),l[8]=t,l[9]=s):s=l[9],s}let i,d,f;l[10]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(N,{dataKey:"label"}),d=(0,a.jsx)(x,{dataKey:"value"}),f=(0,a.jsx)(j,{}),l[10]=i,l[11]=d,l[12]=f):(i=l[10],d=l[11],f=l[12]);let h;return l[13]!==p?(h=(0,a.jsx)("div",{className:"h-80 w-full p-3","data-testid":"sql-chart",children:(0,a.jsxs)(w,{className:"h-full w-full",config:T,data:p,children:[i,d,f]})}),l[13]=p,l[14]=h):h=l[14],h},"X");export{$ as a};
@@ -0,0 +1 @@
1
+ import{a as Oe,b as Ke}from"./chunk-7AZZ7OJO.js";import{a as Qe}from"./chunk-JLFCXBNQ.js";import{a as Ve}from"./chunk-VEFNSN7P.js";import{a as Je}from"./chunk-SA6MBPBL.js";import"./chunk-C4O5UR4Y.js";import{a as He}from"./chunk-YQ5PILIJ.js";import{a as Ge}from"./chunk-SKJZDOHG.js";import{a as Ue,b as _e,c as $e,d as M,e as U,f as _}from"./chunk-Q5WXTZWX.js";import{a as we,e as Ce}from"./chunk-JKPK25JO.js";import{a as D}from"./chunk-YT7VXQVX.js";import"./chunk-KOC5KV3E.js";import{R as T}from"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import{c as z}from"./chunk-UY2Y5CXB.js";import"./chunk-ZFWEPGWG.js";import{b as B}from"./chunk-K5PFWU5J.js";import"./chunk-4FNHHFWR.js";import{f as E}from"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{a as Ze}from"./chunk-6OKDCV7J.js";import{d as W,h as Pe,l as Ae,m as ze,q as Ie}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as r,e as Me,f as Ye,g as et,h as tt}from"./chunk-UHHTEBC3.js";var k=Me(Ye(),1);var Z=Me(et(),1);var t=Me(tt(),1);var at=r(()=>{let u=(0,Z.c)(3),{config:e,ready:l}=Oe(),s;return u[0]!==e.capabilities||u[1]!==l?(s={capabilities:e.capabilities,ready:l},u[0]=e.capabilities,u[1]=l,u[2]=s):s=u[2],s},"et"),st={boolean:"checkbox",date:"datetime-local",number:"number",string:"text"},lt=r((u,e)=>u.type==="boolean"?!0:typeof e!="string"||e.trim()===""?!1:u.type!=="number"||!Number.isNaN(Number(e.trim())),"at"),rt=r((u,e)=>{if(u.type==="boolean")return e===!0?{value:!0}:u.required?{value:!1}:void 0;let l=typeof e=="string"?e.trim():"";if(l!==""){if(u.type==="number"){let s=Number(l);return Number.isNaN(s)?void 0:{value:s}}return{value:l}}},"lt"),it=r(u=>{let e=(0,Z.c)(105),{onClose:l,onCreated:s}=u,c=E(),a=W(),{config:o}=Oe(),{busy:i,error:n,run:m}=Ke(),[w,S]=(0,k.useState)(""),[b,C]=(0,k.useState)(""),[y,I]=(0,k.useState)(""),[h,g]=(0,k.useState)(""),v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={},e[0]=v):v=e[0];let[f,d]=(0,k.useState)(v),A;e[1]===Symbol.for("react.memo_cache_sentinel")?(A=r(p=>{S(p.target.value)},"C"),e[1]=A):A=e[1];let x=A,F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r(p=>{C(p.target.value)},"F"),e[2]=F):F=e[2];let q=F,R;e[3]===Symbol.for("react.memo_cache_sentinel")?(R=r(p=>{I(p.target.value)},"_"),e[3]=R):R=e[3];let Te=R,G;e[4]===Symbol.for("react.memo_cache_sentinel")?(G=r(p=>{g(p.target.value)},"O"),e[4]=G):G=e[4];let Be=G,H;e[5]===Symbol.for("react.memo_cache_sentinel")?(H=r((p,$)=>{d(V=>({...V,[p]:$}))},"G"),e[5]=H):H=e[5];let Re=H,J;e[6]!==f?(J=r(p=>f[p.name]??(p.type==="boolean"?!1:""),"H"),e[6]=f,e[7]=J):J=e[7];let j=J,K;if(e[8]!==o.userFields||e[9]!==j){let p;e[11]!==j?(p=r($=>!$.required||lt($,j($)),"p"),e[11]=j,e[12]=p):p=e[12],K=o.userFields.every(p),e[8]=o.userFields,e[9]=j,e[10]=K}else K=e[10];let Fe=K,Q;e[13]!==i||e[14]!==w||e[15]!==b||e[16]!==Fe?(Q=!i&&w.trim()!==""&&b.trim()!==""&&Fe,e[13]=i,e[14]=w,e[15]=b,e[16]=Fe,e[17]=Q):Q=e[17];let De=Q,X;e[18]!==o.userFields||e[19]!==j?(X=r(()=>{let p={};for(let $ of o.userFields){let V=rt($,j($));V!==void 0&&(p[$.name]=V.value)}return Object.keys(p).length===0?void 0:p},"W"),e[18]=o.userFields,e[19]=j,e[20]=X):X=e[20];let Se=X,Y;e[21]!==Se||e[22]!==c||e[23]!==w||e[24]!==b||e[25]!==l||e[26]!==s||e[27]!==y||e[28]!==h||e[29]!==m?(Y=r(()=>{m(async()=>{await c.createAuthUser({data:Se(),email:w.trim(),name:b.trim(),password:y===""?void 0:y,role:h.trim()===""?void 0:h.trim()}),s(),l()})},"Z"),e[21]=Se,e[22]=c,e[23]=w,e[24]=b,e[25]=l,e[26]=s,e[27]=y,e[28]=h,e[29]=m,e[30]=Y):Y=e[30];let N=Y,P;e[31]!==a?(P=a("Create user"),e[31]=a,e[32]=P):P=e[32];let L;e[33]!==a?(L=a("Create user"),e[33]=a,e[34]=L):L=e[34];let O;e[35]!==L?(O=(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:L}),e[35]=L,e[36]=O):O=e[36];let ee;e[37]!==a?(ee=a("email"),e[37]=a,e[38]=ee):ee=e[38];let te;e[39]!==ee?(te=(0,t.jsx)(D,{htmlFor:"uc-email",children:ee}),e[39]=ee,e[40]=te):te=e[40];let ae;e[41]!==w?(ae=(0,t.jsx)(T,{"data-testid":"uc-email",id:"uc-email",onChange:x,type:"email",value:w}),e[41]=w,e[42]=ae):ae=e[42];let se;e[43]!==te||e[44]!==ae?(se=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[te,ae]}),e[43]=te,e[44]=ae,e[45]=se):se=e[45];let le;e[46]!==a?(le=a("name"),e[46]=a,e[47]=le):le=e[47];let re;e[48]!==le?(re=(0,t.jsx)(D,{htmlFor:"uc-name",children:le}),e[48]=le,e[49]=re):re=e[49];let ie;e[50]!==b?(ie=(0,t.jsx)(T,{"data-testid":"uc-name",id:"uc-name",onChange:q,value:b}),e[50]=b,e[51]=ie):ie=e[51];let ne;e[52]!==re||e[53]!==ie?(ne=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[re,ie]}),e[52]=re,e[53]=ie,e[54]=ne):ne=e[54];let de;e[55]!==a?(de=a("Password (optional)"),e[55]=a,e[56]=de):de=e[56];let oe;e[57]!==de?(oe=(0,t.jsx)(D,{htmlFor:"uc-password",children:de}),e[57]=de,e[58]=oe):oe=e[58];let ce;e[59]!==y?(ce=(0,t.jsx)(T,{"data-testid":"uc-password",id:"uc-password",onChange:Te,type:"password",value:y}),e[59]=y,e[60]=ce):ce=e[60];let ue;e[61]!==oe||e[62]!==ce?(ue=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[oe,ce]}),e[61]=oe,e[62]=ce,e[63]=ue):ue=e[63];let me;e[64]!==a?(me=a("Role (optional)"),e[64]=a,e[65]=me):me=e[65];let he;e[66]!==me?(he=(0,t.jsx)(D,{htmlFor:"uc-role",children:me}),e[66]=me,e[67]=he):he=e[67];let pe;e[68]!==h?(pe=(0,t.jsx)(T,{"data-testid":"uc-role",id:"uc-role",onChange:Be,value:h}),e[68]=h,e[69]=pe):pe=e[69];let fe;e[70]!==he||e[71]!==pe?(fe=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[he,pe]}),e[70]=he,e[71]=pe,e[72]=fe):fe=e[72];let ve;e[73]!==o.userFields||e[74]!==j||e[75]!==a?(ve=o.userFields.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border pt-3","data-testid":"uc-plugin-fields",children:[(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Plugin fields")}),o.userFields.map(p=>{let $=`uc-field-${p.name}`,V=p.required?"":` (${a("optional")})`;if(p.type==="boolean"){let Le=j(p)===!0;return(0,t.jsxs)("label",{className:"flex items-center gap-2",htmlFor:$,children:[(0,t.jsx)(Qe,{checked:Le,"data-testid":$,id:$,onCheckedChange:r(Xe=>{Re(p.name,Xe)},"onCheckedChange")}),(0,t.jsxs)("span",{className:"text-sm",children:[p.name,V]})]},p.name)}let We=j(p);return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)(D,{htmlFor:$,children:[p.name,V]}),(0,t.jsx)(T,{"data-testid":$,id:$,onChange:r(Le=>{Re(p.name,Le.target.value)},"onChange"),type:st[p.type],value:typeof We=="string"?We:""})]},p.name)})]}),e[73]=o.userFields,e[74]=j,e[75]=a,e[76]=ve):ve=e[76];let xe;e[77]!==n?(xe=n!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"uc-error",role:"alert",children:n}),e[77]=n,e[78]=xe):xe=e[78];let be;e[79]!==a?(be=a("Cancel"),e[79]=a,e[80]=be):be=e[80];let ye;e[81]!==l||e[82]!==be?(ye=(0,t.jsx)(z,{"data-testid":"uc-cancel",onClick:l,size:"sm",type:"button",variant:"outline",children:be}),e[81]=l,e[82]=be,e[83]=ye):ye=e[83];let qe=!De,ge;e[84]!==i||e[85]!==a?(ge=a(i?"Creating\u2026":"Create"),e[84]=i,e[85]=a,e[86]=ge):ge=e[86];let Ne;e[87]!==N||e[88]!==qe||e[89]!==ge?(Ne=(0,t.jsx)(z,{"data-testid":"uc-submit",disabled:qe,onClick:N,size:"sm",type:"button",children:ge}),e[87]=N,e[88]=qe,e[89]=ge,e[90]=Ne):Ne=e[90];let ke;e[91]!==ye||e[92]!==Ne?(ke=(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[ye,Ne]}),e[91]=ye,e[92]=Ne,e[93]=ke):ke=e[93];let je;return e[94]!==l||e[95]!==P||e[96]!==O||e[97]!==se||e[98]!==ne||e[99]!==ue||e[100]!==fe||e[101]!==ve||e[102]!==xe||e[103]!==ke?(je=(0,t.jsxs)(Ve,{label:P,onClose:l,panelTestId:"uc-dialog",testId:"uc-overlay",variant:"dialog",children:[O,se,ne,ue,fe,ve,xe,ke]}),e[94]=l,e[95]=P,e[96]=O,e[97]=se,e[98]=ne,e[99]=ue,e[100]=fe,e[101]=ve,e[102]=xe,e[103]=ke,e[104]=je):je=e[104],je},"st"),Ee=r(u=>{let e=(0,Z.c)(2),{children:l}=u,s;return e[0]!==l?(s=(0,t.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[0]=l,e[1]=s):s=e[1],s},"Le"),nt=r(u=>{let e=(0,Z.c)(29),{busy:l,runAction:s,userId:c,version:a}=u,o=E(),i=W(),[n,m]=(0,k.useState)(null),[w,S]=(0,k.useState)(null),b;e[0]!==o||e[1]!==c?(b=r(()=>{ze((async()=>{S(null);try{let x=await o.listAuthSessions({limit:50,userId:c});m(x.rows)}catch(x){let F=x;m(null),S(Pe(F))}})())},"x"),e[0]=o,e[1]=c,e[2]=b):b=e[2];let C;e[3]!==o||e[4]!==c||e[5]!==a?(C=[o,c,a],e[3]=o,e[4]=c,e[5]=a,e[6]=C):C=e[6],(0,k.useEffect)(b,C);let y;e[7]!==o||e[8]!==s?(y=r(x=>{s(()=>o.revokeAuthSession({sessionId:x}))},"y"),e[7]=o,e[8]=s,e[9]=y):y=e[9];let I=y,h;e[10]!==i?(h=i("Sessions"),e[10]=i,e[11]=h):h=e[11];let g;e[12]!==h?(g=(0,t.jsx)(Ee,{children:h}),e[12]=h,e[13]=g):g=e[13];let v;e[14]!==w?(v=w!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"ud-sessions-error",role:"alert",children:w}),e[14]=w,e[15]=v):v=e[15];let f;e[16]!==n||e[17]!==i?(f=n!==null&&n.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ud-sessions-empty",children:i("No active sessions.")}),e[16]=n,e[17]=i,e[18]=f):f=e[18];let d;e[19]!==l||e[20]!==I||e[21]!==n||e[22]!==i?(d=n!==null&&n.length>0&&(0,t.jsx)(we,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(Ue,{"data-testid":"ud-sessions-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(M,{children:[(0,t.jsx)(U,{children:i("expires")}),(0,t.jsx)(U,{children:i("ip")}),(0,t.jsx)(U,{children:i("user agent")}),(0,t.jsx)(U,{"aria-label":i("Actions")})]})}),(0,t.jsx)($e,{children:n.map(x=>(0,t.jsxs)(M,{"data-testid":`ud-session-${x.id}`,children:[(0,t.jsx)(_,{className:"text-muted-foreground tabular-nums",children:Ie(x.expiresAt)}),(0,t.jsx)(_,{children:x.ipAddress??""}),(0,t.jsx)(_,{className:"max-w-40 truncate",children:x.userAgent??""}),(0,t.jsx)(_,{children:(0,t.jsx)(z,{"data-testid":`ud-revoke-${x.id}`,disabled:l,onClick:r(()=>{I(x.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Revoke")})})]},x.id))})]})})}),e[19]=l,e[20]=I,e[21]=n,e[22]=i,e[23]=d):d=e[23];let A;return e[24]!==g||e[25]!==v||e[26]!==f||e[27]!==d?(A=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-sessions",children:[g,v,f,d]}),e[24]=g,e[25]=v,e[26]=f,e[27]=d,e[28]=A):A=e[28],A},"rt"),dt=r(u=>{let e=(0,Z.c)(30),{busy:l,runAction:s,userId:c,version:a}=u,o=E(),i=W(),[n,m]=(0,k.useState)(null),[w,S]=(0,k.useState)(null),b;e[0]!==o||e[1]!==c?(b=r(()=>{ze((async()=>{S(null);try{m(await o.listAuthAccounts({userId:c}))}catch(x){let F=x;m(null),S(Pe(F))}})())},"x"),e[0]=o,e[1]=c,e[2]=b):b=e[2];let C;e[3]!==o||e[4]!==c||e[5]!==a?(C=[o,c,a],e[3]=o,e[4]=c,e[5]=a,e[6]=C):C=e[6],(0,k.useEffect)(b,C);let y;e[7]!==o||e[8]!==s||e[9]!==c?(y=r(x=>{s(()=>o.unlinkAuthAccount({accountId:x,userId:c}))},"y"),e[7]=o,e[8]=s,e[9]=c,e[10]=y):y=e[10];let I=y,h;e[11]!==i?(h=i("Linked accounts"),e[11]=i,e[12]=h):h=e[12];let g;e[13]!==h?(g=(0,t.jsx)(Ee,{children:h}),e[13]=h,e[14]=g):g=e[14];let v;e[15]!==w?(v=w!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:w}),e[15]=w,e[16]=v):v=e[16];let f;e[17]!==n||e[18]!==i?(f=n!==null&&n.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("No linked accounts.")}),e[17]=n,e[18]=i,e[19]=f):f=e[19];let d;e[20]!==n||e[21]!==l||e[22]!==I||e[23]!==i?(d=n!==null&&n.length>0&&(0,t.jsx)(we,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(Ue,{"data-testid":"ud-accounts-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(M,{children:[(0,t.jsx)(U,{children:i("provider")}),(0,t.jsx)(U,{children:i("created")}),(0,t.jsx)(U,{"aria-label":i("Actions")})]})}),(0,t.jsx)($e,{children:n.map(x=>{let F=Ae(x.id);return(0,t.jsxs)(M,{"data-testid":`ud-account-${F}`,children:[(0,t.jsx)(_,{children:Ae(x.providerId)}),(0,t.jsx)(_,{className:"text-muted-foreground tabular-nums",children:Ie(x.createdAt)}),(0,t.jsx)(_,{children:(0,t.jsx)(z,{"data-testid":`ud-unlink-${F}`,disabled:l,onClick:r(()=>{I(F)},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Unlink")})})]},F)})})]})})}),e[20]=n,e[21]=l,e[22]=I,e[23]=i,e[24]=d):d=e[24];let A;return e[25]!==g||e[26]!==v||e[27]!==f||e[28]!==d?(A=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-accounts",children:[g,v,f,d]}),e[25]=g,e[26]=v,e[27]=f,e[28]=d,e[29]=A):A=e[29],A},"it"),ot=r(u=>{let e=(0,Z.c)(40),{busy:l,capabilities:s,runAction:c,userId:a,version:o}=u,i=E(),n=W(),[m,w]=(0,k.useState)(null),S;e[0]!==s.passkey||e[1]!==i||e[2]!==a?(S=r(()=>{s.passkey&&ze((async()=>{try{w(await i.listAuthPasskeys({userId:a}))}catch{w(null)}})())},"I"),e[0]=s.passkey,e[1]=i,e[2]=a,e[3]=S):S=e[3];let b;e[4]!==s.passkey||e[5]!==i||e[6]!==a||e[7]!==o?(b=[s.passkey,i,a,o],e[4]=s.passkey,e[5]=i,e[6]=a,e[7]=o,e[8]=b):b=e[8],(0,k.useEffect)(S,b);let C;e[9]!==i||e[10]!==c||e[11]!==a?(C=r(()=>{c(()=>i.disableAuthTwoFactor({userId:a}))},"w"),e[9]=i,e[10]=c,e[11]=a,e[12]=C):C=e[12];let y=C,I;e[13]!==i||e[14]!==c?(I=r(F=>{c(()=>i.deleteAuthPasskey({passkeyId:F}))},"A"),e[13]=i,e[14]=c,e[15]=I):I=e[15];let h=I,g;e[16]!==n?(g=n("Security"),e[16]=n,e[17]=g):g=e[17];let v;e[18]!==g?(v=(0,t.jsx)(Ee,{children:g}),e[18]=g,e[19]=v):v=e[19];let f;e[20]!==l||e[21]!==s.twoFactor||e[22]!==y||e[23]!==n?(f=s.twoFactor&&(0,t.jsx)(z,{"data-testid":"ud-disable-2fa",disabled:l,onClick:y,size:"sm",type:"button",variant:"outline",children:n("Disable two-factor")}),e[20]=l,e[21]=s.twoFactor,e[22]=y,e[23]=n,e[24]=f):f=e[24];let d;e[25]!==s.passkey||e[26]!==m||e[27]!==n?(d=s.passkey&&m!==null&&m.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("No passkeys.")}),e[25]=s.passkey,e[26]=m,e[27]=n,e[28]=d):d=e[28];let A;e[29]!==l||e[30]!==s.passkey||e[31]!==h||e[32]!==m||e[33]!==n?(A=s.passkey&&m!==null&&m.length>0&&(0,t.jsx)(we,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(Ue,{"data-testid":"ud-passkeys-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(M,{children:[(0,t.jsx)(U,{children:n("name")}),(0,t.jsx)(U,{children:n("created")}),(0,t.jsx)(U,{"aria-label":n("Actions")})]})}),(0,t.jsx)($e,{children:m.map(F=>{let q=Ae(F.id);return(0,t.jsxs)(M,{"data-testid":`ud-passkey-${q}`,children:[(0,t.jsx)(_,{children:Ae(F.name)||q}),(0,t.jsx)(_,{className:"text-muted-foreground tabular-nums",children:Ie(F.createdAt)}),(0,t.jsx)(_,{children:(0,t.jsx)(z,{"data-testid":`ud-delete-passkey-${q}`,disabled:l,onClick:r(()=>{h(q)},"onClick"),size:"xs",type:"button",variant:"ghost",children:n("Delete")})})]},q)})})]})})}),e[29]=l,e[30]=s.passkey,e[31]=h,e[32]=m,e[33]=n,e[34]=A):A=e[34];let x;return e[35]!==v||e[36]!==f||e[37]!==d||e[38]!==A?(x=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-security",children:[v,f,d,A]}),e[35]=v,e[36]=f,e[37]=d,e[38]=A,e[39]=x):x=e[39],x},"nt"),ct=/(?:at|expires)$/iu,ut=new Set(["banExpires","banned","banReason","email","emailVerified","id","name","role"]),mt=r((u,e)=>typeof e=="number"&&ct.test(u)?Ie(e):Ae(e),"ct"),ht=r(({capabilities:u,onChanged:e,onClose:l,user:s})=>{let c=E(),a=W(),o=s.banned===!0,[i,n]=(0,k.useState)(null),[m,w]=(0,k.useState)(!1),[S,b]=(0,k.useState)(0),[C,y]=(0,k.useState)(typeof s.role=="string"?s.role:""),[I,h]=(0,k.useState)(""),[g,v]=(0,k.useState)(""),[f,d]=(0,k.useState)(""),[A,x]=(0,k.useState)(null),[F,q]=(0,k.useState)(!1),R=r((N,P)=>{ze((async()=>{w(!0),n(null);try{let L=await N();P?.refresh!==!1&&(b(O=>O+1),e()),P?.onResult?.(L)}catch(L){n(Pe(L))}finally{w(!1)}})())},"_"),Te=r(N=>{y(N.target.value)},"De"),G=r(N=>{h(N.target.value)},"O"),Be=r(N=>{v(N.target.value)},"je"),H=r(N=>{d(N.target.value)},"G"),Re=r(()=>{let N=C.trim();N!==""&&R(async()=>{await c.setAuthUserRole({role:N,userId:s.id})})},"Se"),J=r(()=>{let N=Number.parseInt(g,10),P=Number.isFinite(N)&&N>0?N*86400:void 0;R(async()=>{await c.banAuthUser({expiresInSeconds:P,reason:I.trim()===""?void 0:I.trim(),userId:s.id})})},"H"),j=r(()=>{R(async()=>{await c.unbanAuthUser({userId:s.id})})},"R"),K=r(()=>{R(async()=>{await c.setAuthUserPassword({newPassword:f,userId:s.id}),d("")})},"J"),Fe=r(()=>{R(()=>c.impersonateAuthUser({userId:s.id}),{onResult:r(N=>{x(N.token)},"onResult"),refresh:!1})},"we"),Q=r(()=>{R(async()=>{await c.revokeAuthUserSessions({userId:s.id})})},"K"),De=r(()=>{R(async()=>{await c.removeAuthUser({userId:s.id}),l()})},"Te"),X=r(()=>{q(!0)},"W"),Se=r(()=>{q(!1)},"Ce"),Y=Object.entries(s).filter(([N])=>!ut.has(N));return(0,t.jsxs)(Ve,{label:a("User details"),onClose:l,panelTestId:"ud-panel",testId:"ud-overlay",variant:"drawer",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:s.name??s.email??s.id}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:s.id}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 pt-1",children:[typeof s.role=="string"&&s.role!==""&&(0,t.jsx)(B,{variant:"secondary",children:s.role}),o?(0,t.jsx)(B,{variant:"destructive",children:a("Banned")}):(0,t.jsx)(B,{variant:"outline",children:a("Active")}),s.emailVerified===!0?(0,t.jsx)(B,{variant:"secondary",children:a("verified")}):(0,t.jsx)(B,{variant:"outline",children:a("unverified")})]})]}),(0,t.jsx)(z,{"data-testid":"ud-close",onClick:l,size:"sm",type:"button",variant:"ghost",children:a("Close")})]}),i!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"ud-action-error",role:"alert",children:i}),u.admin&&(0,t.jsxs)(we,{className:"gap-0 py-0",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Actions")})}),(0,t.jsxs)(Ce,{className:"flex flex-col gap-3 p-3",children:[(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)(D,{htmlFor:"ud-role",children:a("Role")}),(0,t.jsx)(T,{"data-testid":"ud-role-input",id:"ud-role",onChange:Te,value:C})]}),(0,t.jsx)(z,{"data-testid":"ud-set-role",disabled:m||C.trim()==="",onClick:Re,size:"sm",type:"button",variant:"outline",children:a("Set role")})]}),o?(0,t.jsx)(z,{"data-testid":"ud-unban",disabled:m,onClick:j,size:"sm",type:"button",variant:"outline",children:a("Unban")}):(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)(D,{htmlFor:"ud-ban-reason",children:a("Ban reason (optional)")}),(0,t.jsx)(T,{"data-testid":"ud-ban-reason",id:"ud-ban-reason",onChange:G,value:I})]}),(0,t.jsxs)("div",{className:"flex w-24 flex-col gap-1",children:[(0,t.jsx)(D,{htmlFor:"ud-ban-days",children:a("Days")}),(0,t.jsx)(T,{"data-testid":"ud-ban-days",id:"ud-ban-days",onChange:Be,type:"number",value:g})]}),(0,t.jsx)(z,{"data-testid":"ud-ban",disabled:m,onClick:J,size:"sm",type:"button",variant:"destructive",children:a("Ban user")})]}),(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)(D,{htmlFor:"ud-password",children:a("New password")}),(0,t.jsx)(T,{"data-testid":"ud-password",id:"ud-password",onChange:H,type:"password",value:f})]}),(0,t.jsx)(z,{"data-testid":"ud-set-password",disabled:m||f==="",onClick:K,size:"sm",type:"button",variant:"outline",children:a("Set password")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(z,{"data-testid":"ud-impersonate",disabled:m,onClick:Fe,size:"sm",type:"button",variant:"outline",children:a("Impersonate")}),(0,t.jsx)(z,{"data-testid":"ud-revoke-all",disabled:m,onClick:Q,size:"sm",type:"button",variant:"outline",children:a("Revoke all sessions")}),F?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z,{"data-testid":"ud-delete-confirm",disabled:m,onClick:De,size:"sm",type:"button",variant:"destructive",children:a("Confirm delete")}),(0,t.jsx)(z,{"data-testid":"ud-delete-cancel",onClick:Se,size:"sm",type:"button",variant:"ghost",children:a("Cancel")})]}):(0,t.jsx)(z,{"data-testid":"ud-delete",disabled:m,onClick:X,size:"sm",type:"button",variant:"destructive",children:a("Delete user")})]}),A!==null&&(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":"ud-impersonation",children:[(0,t.jsx)(D,{htmlFor:"ud-token",children:a("Impersonation token")}),(0,t.jsx)(T,{"data-testid":"ud-token",id:"ud-token",readOnly:!0,value:A})]})]})]}),(0,t.jsx)(nt,{busy:m,runAction:R,userId:s.id,version:S}),u.accounts&&(0,t.jsx)(dt,{busy:m,runAction:R,userId:s.id,version:S}),(u.twoFactor||u.passkey)&&(0,t.jsx)(ot,{busy:m,capabilities:u,runAction:R,userId:s.id,version:S}),(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":"ud-fields",children:[(0,t.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Fields")}),(0,t.jsx)("dl",{className:"flex flex-col",children:Y.map(([N,P])=>(0,t.jsxs)("div",{className:"flex flex-col border-t border-border py-1.5",children:[(0,t.jsx)("dt",{className:"text-xs font-semibold text-muted-foreground",children:N}),(0,t.jsx)("dd",{className:"m-0 font-mono text-xs break-words",children:mt(N,P)})]},N))})]})]})},"ut"),pt=50,_t=r(({pageSize:u=pt}={})=>{let e=E(),l=W(),[s,c]=(0,k.useState)(""),[a,o]=(0,k.useState)(""),i=He(s),[n,m]=(0,k.useState)(null),[w,S]=(0,k.useState)(!1),{capabilities:b}=at(),C=i.trim(),y=a.trim(),I=Ge(["lunora-auth-users",C,y,u],()=>e.listAuthUsers({filterField:y===""?void 0:"role",filterValue:y===""?void 0:y,limit:u,search:C===""?void 0:C}),{keepPreviousData:!0}),h=I.data?.rows??null,g=I.error,v=r(()=>{I.refetch()},"v");Je(()=>{I.refetch()},!0);let f=n===null?null:h?.find(d=>d.id===n)??null;return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-users",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(T,{"aria-label":l("Search users"),className:"w-56","data-testid":"us-search",onChange:r(d=>{c(d.target.value)},"onChange"),placeholder:l("Search by email or name\u2026"),value:s}),(0,t.jsx)(T,{"aria-label":l("Filter by role"),className:"w-40","data-testid":"us-role-filter",onChange:r(d=>{o(d.target.value)},"onChange"),placeholder:l("Filter by role"),value:a}),(0,t.jsx)(z,{"data-testid":"us-new",onClick:r(()=>{S(!0)},"onClick"),size:"sm",type:"button",children:l("New user")})]}),g!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"us-users-error",role:"alert",children:g}),h!==null&&h.length===0&&(0,t.jsx)(Ze,{description:l("Users who sign up to your app will appear here."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85"})}),testId:"us-empty",title:l("No users.")}),h!==null&&h.length>0&&(0,t.jsx)(we,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(Ue,{"data-testid":"us-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(M,{children:[(0,t.jsx)(U,{children:l("id")}),(0,t.jsx)(U,{children:l("email")}),(0,t.jsx)(U,{children:l("name")}),(0,t.jsx)(U,{children:l("role")}),(0,t.jsx)(U,{children:l("status")}),(0,t.jsx)(U,{children:l("verified")}),(0,t.jsx)(U,{children:l("created")}),(0,t.jsx)(U,{"aria-label":l("Actions")})]})}),(0,t.jsx)($e,{children:h.map(d=>(0,t.jsxs)(M,{"data-testid":`us-row-${d.id}`,children:[(0,t.jsx)(_,{className:"font-mono text-xs",children:d.id}),(0,t.jsx)(_,{children:d.email??""}),(0,t.jsx)(_,{children:d.name??""}),(0,t.jsx)(_,{children:typeof d.role=="string"&&d.role!==""?(0,t.jsx)(B,{variant:"secondary",children:d.role}):""}),(0,t.jsx)(_,{children:d.banned===!0?(0,t.jsx)(B,{variant:"destructive",children:l("Banned")}):(0,t.jsx)(B,{variant:"success",children:l("Active")})}),(0,t.jsx)(_,{children:d.emailVerified===!0?(0,t.jsx)(B,{variant:"success",children:l("yes")}):(0,t.jsx)(B,{variant:"outline",children:l("no")})}),(0,t.jsx)(_,{className:"text-muted-foreground tabular-nums",children:Ie(d.createdAt)}),(0,t.jsx)(_,{children:(0,t.jsx)(z,{"data-testid":`us-manage-${d.id}`,onClick:r(()=>{m(d.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:l("Manage")})})]},d.id))})]})})}),f!==null&&(0,t.jsx)(ht,{capabilities:b,onChanged:v,onClose:r(()=>{m(null)},"onClose"),user:f}),w&&(0,t.jsx)(it,{onClose:r(()=>{S(!1)},"onClose"),onCreated:v})]})},"Pt");export{_t as UsersPanel};
@@ -0,0 +1 @@
1
+ import{a as T}from"./chunk-6I62RSI5.js";import{b as k}from"./chunk-SKJZDOHG.js";import{a as D,b as E,c as O,d as C,e as i,f as o}from"./chunk-Q5WXTZWX.js";import{a as I,e as $}from"./chunk-JKPK25JO.js";import{b}from"./chunk-K5PFWU5J.js";import"./chunk-4FNHHFWR.js";import{a as A}from"./chunk-GXZAXNZI.js";import"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{a as L}from"./chunk-6OKDCV7J.js";import{d as S}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as v,e as w,f as K,g as M,h as P}from"./chunk-UHHTEBC3.js";var j=w(M(),1),q=w(K(),1);var t=w(P(),1);var _="container:",W={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},B=v(e=>{let n=e.indexOf(":");if(n===-1)return{event:e.trim()};let r=e.slice(n+1).trim(),a=e.slice(0,n).trim();return r===""?{event:a}:{detail:r,event:a}},"j"),F=v(e=>{let n=new Map;for(let r of e){let a=r.functionPath??"";if(!a.startsWith(_))continue;let s=a.slice(_.length);if(s==="")continue;let c=JSON.stringify([s,r.instance??""]),m=n.get(c);if(m!==void 0&&m.timestamp>=r.timestamp)continue;let{detail:g,event:l}=B(r.message);n.set(c,{detail:g,event:l,exitCode:r.exitCode,instance:r.instance,level:r.level,name:s,state:W[l]??"unknown",timestamp:r.timestamp})}return[...n.values()].toSorted((r,a)=>r.name.localeCompare(a.name)||(r.instance??"").localeCompare(a.instance??""))},"K"),J={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},U=v(e=>{let{entries:n}=e??{};return Array.isArray(n)?n:[]},"W"),ee=v(()=>{let e=(0,j.c)(23),n=S(),r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},a={live:!0,shardKey:""},e[0]=r,e[1]=a):(r=e[0],a=e[1]);let{data:s,error:c,liveError:m}=k(A.getLogs,r,a),g=s!==void 0,l;e[2]!==s?(l=F(U(s)),e[2]=s,e[3]=l):l=e[3];let N=l,d;e[4]!==c?(d=c!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:c}),e[4]=c,e[5]=d):d=e[5];let h;e[6]!==n?(h=n("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance \u2014 ports and health checks aren't carried in that stream."),e[6]=n,e[7]=h):h=e[7];let p;e[8]!==h?(p=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:h}),e[8]=h,e[9]=p):p=e[9];let u;e[10]!==m?(u=(0,t.jsx)(T,{message:m,prefix:"containers"}),e[10]=m,e[11]=u):u=e[11];let f;e[12]!==p||e[13]!==u?(f=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,u]}),e[12]=p,e[13]=u,e[14]=f):f=e[14];let x;e[15]!==g||e[16]!==N||e[17]!==n?(x=g&&N.length===0?(0,t.jsx)(L,{description:n("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:n("No container activity")}):(0,t.jsx)(I,{className:"overflow-hidden py-0",children:(0,t.jsx)($,{className:"px-0",children:(0,t.jsxs)(D,{"data-testid":"containers-table",children:[(0,t.jsx)(E,{children:(0,t.jsxs)(C,{children:[(0,t.jsx)(i,{children:n("Container")}),(0,t.jsx)(i,{children:n("Instance")}),(0,t.jsx)(i,{children:n("State")}),(0,t.jsx)(i,{children:n("Last event")}),(0,t.jsx)(i,{children:n("Detail")}),(0,t.jsx)(i,{children:n("Exit")}),(0,t.jsx)(i,{children:n("When")})]})}),(0,t.jsx)(O,{children:N.map(Y)})]})})}),e[15]=g,e[16]=N,e[17]=n,e[18]=x):x=e[18];let y;return e[19]!==d||e[20]!==f||e[21]!==x?(y=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[d,f,x]}),e[19]=d,e[20]=f,e[21]=x,e[22]=y):y=e[22],y},"Y");function Y(e){return(0,t.jsxs)(C,{"data-testid":`containers-row-${e.name}${e.instance===void 0?"":`-${e.instance}`}`,children:[(0,t.jsx)(o,{className:"font-mono text-xs",children:e.name}),(0,t.jsx)(o,{className:"max-w-40 truncate font-mono text-xs text-muted-foreground",title:e.instance,children:e.instance??"\u2014"}),(0,t.jsx)(o,{children:(0,t.jsx)(b,{variant:J[e.state],children:e.state})}),(0,t.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:e.event}),(0,t.jsx)(o,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"}),(0,t.jsx)(o,{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.exitCode??"\u2014"}),(0,t.jsx)(o,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()})]},`${e.name}/${e.instance??""}`)}v(Y,"B");export{ee as ContainersPanel};
@@ -1 +1 @@
1
- import{a as o,c as r}from"./chunk-O3NAGRTR.js";import{a as i,e as d,f as l}from"./chunk-RRCPZMC2.js";var s={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},p={...s,position:"fixed",top:0,left:0},u={...s,position:"absolute"};var a=d(l(),1);function b(e,c){let t=a.useRef(e),n=r(c);o(()=>{t.current!==e&&n(t.current)},[e,n]),o(()=>{t.current=e},[e])}i(b,"useValueChanged");export{p as a,u as b,b as c};
1
+ import{a as o,c as r}from"./chunk-ZFWEPGWG.js";import{a as i,e as d,f as l}from"./chunk-UHHTEBC3.js";var s={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},p={...s,position:"fixed",top:0,left:0},u={...s,position:"absolute"};var a=d(l(),1);function b(e,c){let t=a.useRef(e),n=r(c);o(()=>{t.current!==e&&n(t.current)},[e,n]),o(()=>{t.current=e},[e])}i(b,"useValueChanged");export{p as a,u as b,b as c};
@@ -0,0 +1 @@
1
+ import{c as a}from"./chunk-UY2Y5CXB.js";import{d}from"./chunk-KLLYGWNF.js";import{a as e,e as r,f as h,h as v}from"./chunk-UHHTEBC3.js";var m=r(h(),1);var t=r(v(),1);var g=e(({children:c,confirmLabel:l,disabled:s=!1,onConfirm:p,testId:i})=>{let o=d(),[u,n]=(0,m.useState)(!1),f=e(()=>{n(!0)},"m"),b=e(()=>{n(!1)},"c"),C=e(()=>{n(!1),p()},"f");return u?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1","data-testid":`${i}-prompt`,role:"group",children:[(0,t.jsx)(a,{"data-testid":`${i}-confirm`,disabled:s,onClick:C,size:"sm",type:"button",variant:"destructive",children:l??o("Confirm")}),(0,t.jsx)(a,{"data-testid":`${i}-cancel`,onClick:b,size:"sm",type:"button",variant:"ghost",children:o("Cancel")})]}):(0,t.jsx)(a,{"data-testid":i,disabled:s,onClick:f,size:"sm",type:"button",variant:"outline",children:c})},"$");export{g as a};
@@ -0,0 +1,4 @@
1
+ import{a as ze}from"./chunk-AKTGRZXN.js";import{a as _e}from"./chunk-VUXJER3D.js";import{a as Ae}from"./chunk-HY46NTNW.js";import"./chunk-6P7HIPUE.js";import"./chunk-PR2SE2MD.js";import"./chunk-CZEUVNCQ.js";import"./chunk-VEFNSN7P.js";import"./chunk-NCCUM26H.js";import"./chunk-PWDMXMRD.js";import"./chunk-YNBJ6ICE.js";import"./chunk-C4O5UR4Y.js";import"./chunk-OTJOI23O.js";import"./chunk-SEDZDNQF.js";import"./chunk-TYTJDFX2.js";import"./chunk-C4VURT57.js";import"./chunk-KSRXMTBV.js";import{a as Le}from"./chunk-4AYEV5UN.js";import{a as Re,b as Te,c as Oe,d as xe,e as De,f as Me}from"./chunk-Q5WXTZWX.js";import"./chunk-KOC5KV3E.js";import{a as Ee}from"./chunk-V66TSUKV.js";import{b as Ie}from"./chunk-UWF5DOGV.js";import{d as oe,e as he,f as fe}from"./chunk-PTTDIYGP.js";import"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import"./chunk-UY2Y5CXB.js";import"./chunk-ZFWEPGWG.js";import"./chunk-4FNHHFWR.js";import{a as le}from"./chunk-GXZAXNZI.js";import{f as be}from"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{d as K,f as ne,g as re,h as Se,m as X}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as s,e as pe,f as Et,g as Lt,h as Rt,j as te}from"./chunk-UHHTEBC3.js";var Y=pe(Lt(),1);var E=pe(Et(),1);var r=pe(Rt(),1);var Tt=["ORDER BY","GROUP BY","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN","EXPLAIN QUERY PLAN","SELECT","DISTINCT","FROM","WHERE","HAVING","LIMIT","OFFSET","JOIN","ON","AND","OR","AS","ASC","DESC","WITH","UNION","EXPLAIN"],Ot=["FROM","WHERE","ORDER BY","GROUP BY","HAVING","LIMIT","OFFSET","UNION","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN"],se=String.fromCodePoint(0),Dt=new RegExp(`${se}${String.raw`(\d+)`}${se}`,"gu"),Mt=Tt.map(l=>({pattern:new RegExp(String.raw`\b${l.replaceAll(" ",String.raw`\s+`)}\b`,"giu"),replacement:l})),_t=Ot.map(l=>({pattern:new RegExp(String.raw`\s+${l.replaceAll(" ",String.raw`\s+`)}\b`,"gu"),replacement:`
2
+ ${l}`})),At=s(l=>{let e=[],t=l.replaceAll(/'(?:[^']|'')*'/gu,n=>(e.push(n),`${se}${(e.length-1).toString()}${se}`)).replaceAll(/\s+/gu," ").trim();for(let{pattern:n,replacement:o}of Mt)t=t.replaceAll(n,o);for(let{pattern:n,replacement:o}of _t)t=t.replaceAll(n,o);return t=t.replaceAll(Dt,(n,o)=>e[Number(o)]??""),t},"_t"),zt=["AND","ASC","AS","BY","COUNT","DESC","DISTINCT","EXPLAIN","FROM","GROUP","HAVING","INNER","JOIN","LEFT","LIKE","LIMIT","NOT","NULL","OFFSET","ON","ORDER","OR","QUERY","SELECT","WHERE","WITH"],Wt=new Set(["AND","BY","HAVING","ON","OR","SELECT","WHERE"]),$t=/[\w$]/,Be=s(l=>l!==void 0&&$t.test(l),"Te"),je=s(l=>{let e=l.length;for(;e>0&&Be(l[e-1]);)e-=1;return l.slice(e)},"Le"),He=s((l,e)=>{let t=e;for(;t>0&&Be(l[t-1]);)t-=1;return{end:e,start:t,text:l.slice(t,e)}},"Re"),We=s((l,e)=>{let t=l.slice(0,e).trimEnd();return t.endsWith(".")||Wt.has(je(t).toUpperCase())},"Ce"),Bt=s((l,e)=>{let t=l.slice(0,e);if(!t.endsWith("."))return;let n=je(t.slice(0,-1));return n===""?void 0:n},"Bt"),Ne=s((l,e)=>l.toLowerCase().startsWith(e.toLowerCase()),"ge"),$e=s((l,e,t,n)=>{let o=[];for(let a of l)if(Ne(a,e)&&(o.push(n(a)),o.length>=t))break;return o},"Se"),jt=s((l,e,t)=>{let n=new Map;for(let[o,a]of Object.entries(l.columns))for(let d of a)if(Ne(d,e)&&!n.has(d)&&(n.set(d,o),n.size>=t))return[...n].map(([p,c])=>({detail:c,kind:"column",label:p}));return[...n].map(([o,a])=>({detail:a,kind:"column",label:o}))},"Wt"),Ht=s((l,e,t)=>{let n=He(l,e),o=Bt(l,n.start);if(o!==void 0){let c=t.columns[o]??t.columns[o.toLowerCase()]??[];return $e(c,n.text,8,m=>({detail:o,kind:"column",label:m}))}if(n.text===""&&!We(l,n.start))return[];let a=$e(t.tables,n.text,8,c=>({kind:"table",label:c})),d=jt(t,n.text,8),p=zt.filter(c=>n.text!==""&&Ne(c,n.text)&&c.toLowerCase()!==n.text.toLowerCase()).map(c=>({kind:"keyword",label:c}));return(We(l,n.start)?[...d,...a,...p]:[...a,...d,...p]).slice(0,8)},"Ft"),Ft=s((l,e,t)=>{let n=He(l,e),o=l.slice(0,n.start)+t.label+l.slice(n.end);return{caret:n.start+t.label.length,value:o}},"Ht"),Pt=["boxSizing","borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textTransform","width","wordSpacing"],Jt=s((l,e)=>{let t=globalThis.getComputedStyle(l),n=globalThis.document.createElement("div"),{style:o}=n;o.position="absolute",o.visibility="hidden",o.whiteSpace="pre-wrap",o.overflowWrap="break-word";for(let c of Pt)o[c]=t[c];n.textContent=l.value.slice(0,Math.max(0,e));let a=globalThis.document.createElement("span");a.textContent=l.value.slice(Math.max(0,e))||".",n.append(a),globalThis.document.body.append(n);let d=a.offsetLeft-l.scrollLeft,p=a.offsetTop-l.scrollTop;return n.remove(),{left:d,top:p}},"Ut"),Ut=s((l,e,t)=>{let n=(0,Y.c)(13),[o,a]=(0,E.useState)(null),d;n[0]!==l||n[1]!==e?(d=s((y,v)=>{let N=Ht(y,v,l);if(N.length===0){a(null);return}let f=e.current,{left:C,top:q}=f===null?{left:0,top:0}:Jt(f,v);a(L=>L!==null&&L.active===0&&L.left===C&&L.top===q&&L.suggestions.length===N.length&&L.suggestions.every((S,M)=>{let O=N.at(M);return S.kind===O?.kind&&S.label===O.label&&S.detail===O.detail})?L:{active:0,left:C,suggestions:N,top:q})},"c"),n[0]=l,n[1]=e,n[2]=d):d=n[2];let p=d,c;n[3]===Symbol.for("react.memo_cache_sentinel")?(c=s(()=>{a(null)},"i"),n[3]=c):c=n[3];let m=c,k;n[4]===Symbol.for("react.memo_cache_sentinel")?(k=s(y=>{a(v=>{if(v===null)return v;let N=v.suggestions.length,f=(v.active+y+N)%N;return{...v,active:f}})},"N"),n[4]=k):k=n[4];let g=k,x;n[5]!==t||n[6]!==o||n[7]!==e?(x=s(()=>{let y=e.current;if(o===null||y===null)return!1;let v=o.suggestions[o.active];if(v===void 0)return!1;let N=Ft(y.value,y.selectionStart,v);return t(N.value),a(null),requestAnimationFrame(()=>{let f=e.current;f!==null&&(f.focus(),f.setSelectionRange(N.caret,N.caret))}),!0},"h"),n[5]=t,n[6]=o,n[7]=e,n[8]=x):x=n[8];let b=x,u;return n[9]!==b||n[10]!==p||n[11]!==o?(u={close:m,commit:b,move:g,refresh:p,state:o},n[9]=b,n[10]=p,n[11]=o,n[12]=u):u=n[12],u},"Jt"),Yt={column:"column",keyword:"keyword",table:"table"},Kt=20,Gt=s(l=>{let e=(0,Y.c)(17),{listboxId:t,onPick:n,state:o}=l,a=K(),d;e[0]!==o?(d=o===null?void 0:{left:o.left,top:o.top+Kt},e[0]=o,e[1]=d):d=e[1];let p=d;if(o===null)return null;let c;if(e[2]!==t||e[3]!==n||e[4]!==o.active||e[5]!==o.suggestions||e[6]!==a){let k;e[8]!==t||e[9]!==n||e[10]!==o.active||e[11]!==a?(k=s((g,x)=>(0,r.jsxs)("li",{"aria-selected":x===o.active,className:te("flex cursor-pointer items-center gap-2 px-2 py-1 text-[13px]",x===o.active?"bg-accent text-accent-foreground":"text-foreground"),"data-testid":"sql-autocomplete-item",id:`${t}-opt-${x.toString()}`,onMouseDown:s(b=>{b.preventDefault(),n(x)},"onMouseDown"),role:"option",children:[(0,r.jsx)("span",{className:"truncate font-mono",children:g.label}),g.detail!==void 0&&(0,r.jsx)("span",{className:"ms-auto truncate text-xs text-muted-foreground",children:g.detail}),(0,r.jsx)("span",{className:"shrink-0 font-mono text-[10px] tracking-wide text-muted-foreground/70 uppercase",children:a(Yt[g.kind])})]},`${g.kind}:${g.label}`),"N"),e[8]=t,e[9]=n,e[10]=o.active,e[11]=a,e[12]=k):k=e[12],c=o.suggestions.map(k),e[2]=t,e[3]=n,e[4]=o.active,e[5]=o.suggestions,e[6]=a,e[7]=c}else c=e[7];let m;return e[13]!==t||e[14]!==p||e[15]!==c?(m=(0,r.jsx)("ul",{className:"absolute z-30 max-h-56 w-72 overflow-auto rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-autocomplete",id:t,role:"listbox",style:p,children:c}),e[13]=t,e[14]=p,e[15]=c,e[16]=m):m=e[16],m},"Vt"),Fe=[{label:"List tables",sql:"SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;"},{label:"Table row count",sql:"SELECT COUNT(*) AS rows FROM messages;"},{label:"Recent rows",sql:"SELECT id, _creationTime, __doc__ FROM messages ORDER BY _creationTime DESC LIMIT 50;"},{label:"Index list",sql:"SELECT name, tbl_name FROM sqlite_master WHERE type = 'index' ORDER BY tbl_name;"}],Vt=s(l=>{let e=(0,Y.c)(29),{active:t,onDelete:n,onSelect:o,query:a}=l,d=K(),p;e[0]!==o||e[1]!==a.id?(p=s(()=>{o(a.id)},"m"),e[0]=o,e[1]=a.id,e[2]=p):p=e[2];let c=p,m;e[3]!==n||e[4]!==a.id?(m=s(S=>{S.stopPropagation(),n(a.id)},"u"),e[3]=n,e[4]=a.id,e[5]=m):m=e[5];let k=m,g=t?"bg-sidebar-accent font-medium text-foreground":"text-muted-foreground",x;e[6]!==g?(x=te("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",g),e[6]=g,e[7]=x):x=e[7];let b=`sql-query-${a.id}`,u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,r.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M4 6h16M4 12h10M4 18h7"})}),e[8]=u):u=e[8];let y;e[9]!==a.name?(y=(0,r.jsx)("span",{className:"truncate",children:a.name}),e[9]=a.name,e[10]=y):y=e[10];let v;e[11]!==t||e[12]!==c||e[13]!==x||e[14]!==b||e[15]!==y?(v=(0,r.jsxs)("button",{"aria-pressed":t,className:x,"data-testid":b,onClick:c,type:"button",children:[u,y]}),e[11]=t,e[12]=c,e[13]=x,e[14]=b,e[15]=y,e[16]=v):v=e[16];let N;e[17]!==d?(N=d("Delete query"),e[17]=d,e[18]=N):N=e[18];let f;e[19]!==d?(f=d("Delete query"),e[19]=d,e[20]=f):f=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=(0,r.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[21]=C):C=e[21];let q;e[22]!==k||e[23]!==f||e[24]!==N?(q=(0,r.jsx)("button",{"aria-label":N,className:"me-1 hidden size-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive group-hover/q:flex",onClick:k,title:f,type:"button",children:C}),e[22]=k,e[23]=f,e[24]=N,e[25]=q):q=e[25];let L;return e[26]!==q||e[27]!==v?(L=(0,r.jsxs)("li",{className:"group/q flex items-center",children:[v,q]}),e[26]=q,e[27]=v,e[28]=L):L=e[28],L},"Gt"),Xt=s(l=>{let e=(0,Y.c)(58),{activeId:t,history:n,listRef:o,onClearHistory:a,onDelete:d,onLoadHistory:p,onLoadTemplate:c,onNew:m,onSearchChange:k,onSelect:g,queries:x,search:b}=l,u=K(),y;if(e[0]!==x||e[1]!==b){let I=b.trim().toLowerCase();y=I===""?[...x]:x.filter(T=>T.name.toLowerCase().includes(I)),e[0]=x,e[1]=b,e[2]=y}else y=e[2];let v=y,N;e[3]!==u?(N=u("Search queries\u2026"),e[3]=u,e[4]=N):N=e[4];let f;e[5]!==k||e[6]!==b||e[7]!==N?(f=(0,r.jsx)("input",{className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"sql-search",onChange:k,placeholder:N,type:"text",value:b}),e[5]=k,e[6]=b,e[7]=N,e[8]=f):f=e[8];let C;e[9]!==u?(C=u("New query"),e[9]=u,e[10]=C):C=e[10];let q;e[11]!==u?(q=u("New query"),e[11]=u,e[12]=q):q=e[12];let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=(0,r.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[13]=L):L=e[13];let S;e[14]!==m||e[15]!==C||e[16]!==q?(S=(0,r.jsx)("button",{"aria-label":C,className:"flex size-8 shrink-0 items-center justify-center rounded-md border border-border text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-new",onClick:m,title:q,type:"button",children:L}),e[14]=m,e[15]=C,e[16]=q,e[17]=S):S=e[17];let M;e[18]!==f||e[19]!==S?(M=(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border p-2",children:[f,S]}),e[18]=f,e[19]=S,e[20]=M):M=e[20];let O;e[21]!==u?(O=u("Private"),e[21]=u,e[22]=O):O=e[22];let _;e[23]!==O?(_=(0,r.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:O}),e[23]=O,e[24]=_):_=e[24];let A;e[25]!==t||e[26]!==v||e[27]!==o||e[28]!==d||e[29]!==g||e[30]!==u?(A=v.length===0?(0,r.jsx)("p",{className:"px-1 py-2 text-xs text-muted-foreground","data-testid":"sql-private-empty",children:u("No saved queries yet \u2014 they save to this browser as you type.")}):(0,r.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-private",ref:o,children:v.map(I=>(0,r.jsx)(Vt,{active:t===I.id,onDelete:d,onSelect:g,query:I},I.id))}),e[25]=t,e[26]=v,e[27]=o,e[28]=d,e[29]=g,e[30]=u,e[31]=A):A=e[31];let W;e[32]!==_||e[33]!==A?(W=(0,r.jsxs)("div",{children:[_,A]}),e[32]=_,e[33]=A,e[34]=W):W=e[34];let $;e[35]!==u?($=u("Reference"),e[35]=u,e[36]=$):$=e[36];let P;e[37]!==$?(P=(0,r.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:$}),e[37]=$,e[38]=P):P=e[38];let H;e[39]!==c?(H=Fe.map(I=>(0,r.jsx)("li",{children:(0,r.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":I.sql,onClick:c,type:"button",children:[(0,r.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M7 4h7l4 4v12H7zM14 4v4h4"})}),I.label]})},I.label)),e[39]=c,e[40]=H):H=e[40];let z;e[41]!==H?(z=(0,r.jsx)("ul",{className:"flex flex-col gap-px",children:H}),e[41]=H,e[42]=z):z=e[42];let R;e[43]!==P||e[44]!==z?(R=(0,r.jsxs)("div",{children:[P,z]}),e[43]=P,e[44]=z,e[45]=R):R=e[45];let D;e[46]!==n||e[47]!==a||e[48]!==p||e[49]!==u?(D=n.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-1 pb-1",children:[(0,r.jsx)("p",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:u("History")}),(0,r.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"sql-history-clear",onClick:a,type:"button",children:u("Clear history")})]}),(0,r.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-history",children:n.map(I=>(0,r.jsx)("li",{children:(0,r.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":I.sql,"data-testid":"sql-history-item",onClick:p,title:I.sql,type:"button",children:[(0,r.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 8v4l3 2M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"})}),(0,r.jsx)("span",{className:"truncate font-mono",children:I.sql})]})},`${I.at.toString()}:${I.sql}`))})]}),e[46]=n,e[47]=a,e[48]=p,e[49]=u,e[50]=D):D=e[50];let B;e[51]!==W||e[52]!==R||e[53]!==D?(B=(0,r.jsxs)("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-2",children:[W,R,D]}),e[51]=W,e[52]=R,e[53]=D,e[54]=B):B=e[54];let j;return e[55]!==B||e[56]!==M?(j=(0,r.jsxs)("aside",{className:"flex h-full w-64 shrink-0 flex-col border-e border-border bg-sidebar",children:[M,B]}),e[55]=B,e[56]=M,e[57]=j):j=e[57],j},"Qt"),Qt=ne(le.listTables),Zt=ne(le.readTablePage),en=s(l=>{let e=(0,Y.c)(16),t=be(),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];let[o,a]=(0,E.useState)(n),d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d={},e[1]=d):d=e[1];let[p,c]=(0,E.useState)(d),m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=new Set,e[2]=m):m=e[2];let k=(0,E.useRef)(m),g,x;e[3]!==t||e[4]!==l?(g=s(()=>{let f={cancelled:!1};return X((async()=>{try{let C=await t.query(Qt,{},re(l));f.cancelled||(a(C.map(nn)),c({}),k.current=new Set)}catch{f.cancelled||(a([]),c({}),k.current=new Set)}})()),()=>{f.cancelled=!0}},"x"),x=[t,l],e[3]=t,e[4]=l,e[5]=g,e[6]=x):(g=e[5],x=e[6]),(0,E.useEffect)(g,x);let b;e[7]!==t||e[8]!==l?(b=s(f=>{k.current.has(f)||(k.current.add(f),X((async()=>{try{let C=await t.query(Zt,{limit:1,offset:0,table:f},re(l));c(q=>({...q,[f]:C.columns}))}catch{k.current.delete(f)}})()))},"p"),e[7]=t,e[8]=l,e[9]=b):b=e[9];let u=b,y;e[10]!==p||e[11]!==o?(y={columns:p,tables:o},e[10]=p,e[11]=o,e[12]=y):y=e[12];let v=y,N;return e[13]!==u||e[14]!==v?(N={probe:u,schema:v},e[13]=u,e[14]=v,e[15]=N):N=e[15],N},"en"),ge=/\b(?:from|join|update|into)\s+([a-z_][\w$]*)|\b([a-z_][\w$]*)\s*\./gi,tn=s(l=>{let e=new Set;ge.lastIndex=0;let t=ge.exec(l);for(;t!==null;)e.add(t[1]??t[2]),t=ge.exec(l);return[...e]},"tn");function nn(l){return l.name}s(nn,"nn");var rn="lunora-studio-sql-tabs",ln="lunora-studio-sql-active-tab",ye=12,Q=s((l="",e="")=>({activeId:null,id:fe("tab"),name:e,sql:l}),"Q"),on=s(()=>he(ln,""),"on"),sn=s(l=>{let[e,t]=oe(rn),[n,o]=on(),a=(0,E.useRef)(null);e.length===0&&a.current===null&&(a.current=l()),(0,E.useEffect)(()=>{if(e.length===0&&a.current!==null){let p=a.current;t([p])}},[t,e.length]);let d=e.length===0&&a.current!==null?[a.current]:e;return{activeId:d.some(p=>p.id===n)?n:d[0]?.id??"",setActiveId:o,setTabs:t,tabs:d}},"sn"),Pe=s(l=>l.activeId===null&&l.sql.trim()!=="","De"),an=s((l,e)=>[...l,e].slice(-ye),"an"),cn=s((l,e,t)=>{let n=l.findIndex(a=>a.id===e);if(n===-1)return{activeId:l[0]?.id??"",tabs:[...l]};let o=l.filter(a=>a.id!==e);if(o.length===0){let a=t();return{activeId:a.id,tabs:[a]}}return{activeId:o[Math.min(n,o.length-1)].id,tabs:o}},"cn"),dn=s((l,e)=>{let t=l.filter(n=>n.id===e);return t.length===0?{activeId:l[0]?.id??"",tabs:[...l]}:{activeId:e,tabs:t}},"dn"),un=s((l,e,t)=>{let n=l.findIndex(a=>a.id===e);if(n===-1)return{activeId:t,tabs:[...l]};let o=l.slice(0,n+1);return{activeId:o.some(a=>a.id===t)?t:e,tabs:o}},"un"),mn=s(l=>{let e=l();return{activeId:e.id,tabs:[e]}},"mn"),pn=s((l,e,t)=>{if(l==="others")return e.filter(n=>n.id!==t);if(l==="right"){let n=e.findIndex(o=>o.id===t);return n===-1?[]:e.slice(n+1)}return[...e]},"pn"),bn=s((l,e)=>l.trim()===""?e:(l.split(`
3
+ `)[0]??l).slice(0,24),"fn"),hn=s(l=>{let e=(0,Y.c)(14),{initial:t,onCancel:n,onCommit:o,placeholder:a,testId:d}=l,p=K(),c=gn,m;e[0]!==o?(m=s(y=>{o(y.currentTarget.value.trim())},"u"),e[0]=o,e[1]=m):m=e[1];let k=m,g;e[2]!==n||e[3]!==o?(g=s(y=>{y.key==="Enter"?o(y.currentTarget.value.trim()):y.key==="Escape"&&n()},"x"),e[2]=n,e[3]=o,e[4]=g):g=e[4];let x=g,b;e[5]!==p?(b=p("Tab title"),e[5]=p,e[6]=b):b=e[6];let u;return e[7]!==t||e[8]!==k||e[9]!==x||e[10]!==a||e[11]!==b||e[12]!==d?(u=(0,r.jsx)("input",{"aria-label":b,className:"w-40 rounded border border-ring bg-background px-1 py-0.5 text-xs outline-none","data-testid":d,defaultValue:t,onBlur:k,onKeyDown:x,placeholder:a,ref:c,type:"text"}),e[7]=t,e[8]=k,e[9]=x,e[10]=a,e[11]=b,e[12]=d,e[13]=u):u=e[13],u},"bn"),fn=s(l=>{let e=(0,Y.c)(29),{idBase:t,onDiscard:n,onKeep:o}=l,a=K(),d=`sql-tab-close-prompt-${t}`,p;e[0]!==a?(p=a("Discard?"),e[0]=a,e[1]=p):p=e[1];let c;e[2]!==p?(c=(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground",children:p}),e[2]=p,e[3]=c):c=e[3];let m;e[4]!==a?(m=a("Discard changes"),e[4]=a,e[5]=m):m=e[5];let k=`sql-tab-close-confirm-${t}`,g;e[6]!==a?(g=a("Discard changes"),e[6]=a,e[7]=g):g=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=(0,r.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M5 13l4 4L19 7"})}),e[8]=x):x=e[8];let b;e[9]!==n||e[10]!==m||e[11]!==k||e[12]!==g?(b=(0,r.jsx)("button",{"aria-label":m,className:"flex size-5 items-center justify-center rounded text-destructive hover:bg-destructive/10","data-testid":k,onClick:n,title:g,type:"button",children:x}),e[9]=n,e[10]=m,e[11]=k,e[12]=g,e[13]=b):b=e[13];let u;e[14]!==a?(u=a("Keep editing"),e[14]=a,e[15]=u):u=e[15];let y=`sql-tab-close-cancel-${t}`,v;e[16]!==a?(v=a("Keep editing"),e[16]=a,e[17]=v):v=e[17];let N;e[18]===Symbol.for("react.memo_cache_sentinel")?(N=(0,r.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})}),e[18]=N):N=e[18];let f;e[19]!==o||e[20]!==y||e[21]!==v||e[22]!==u?(f=(0,r.jsx)("button",{"aria-label":u,className:"flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent","data-testid":y,onClick:o,title:v,type:"button",children:N}),e[19]=o,e[20]=y,e[21]=v,e[22]=u,e[23]=f):f=e[23];let C;return e[24]!==d||e[25]!==f||e[26]!==c||e[27]!==b?(C=(0,r.jsxs)("span",{className:"flex shrink-0 items-center gap-1","data-testid":d,role:"group",children:[c,b,f]}),e[24]=d,e[25]=f,e[26]=c,e[27]=b,e[28]=C):C=e[28],C},"hn"),xn=s(l=>{let e=(0,Y.c)(47),{active:t,canClose:n,onClose:o,onMenu:a,onRename:d,onSelect:p,tab:c}=l,m=K(),[k,g]=(0,E.useState)(!1),[x,b]=(0,E.useState)(!1),u;e[0]!==a||e[1]!==c.id?(u=s(F=>{a(c.id,F)},"d"),e[0]=a,e[1]=c.id,e[2]=u):u=e[2];let y=u,v;e[3]!==p||e[4]!==c.id?(v=s(()=>{p(c.id)},"g"),e[3]=p,e[4]=c.id,e[5]=v):v=e[5];let N=v,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=s(()=>{g(!0)},"b"),e[6]=f):f=e[6];let C=f,q;e[7]!==o||e[8]!==c?(q=s(F=>{F.stopPropagation(),Pe(c)?b(!0):o(c.id)},"q"),e[7]=o,e[8]=c,e[9]=q):q=e[9];let L=q,S;e[10]!==o||e[11]!==c.id?(S=s(F=>{F.stopPropagation(),b(!1),o(c.id)},"S"),e[10]=o,e[11]=c.id,e[12]=S):S=e[12];let M=S,O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=s(F=>{F.stopPropagation(),b(!1)},"L"),e[13]=O):O=e[13];let _=O,A;e[14]!==d||e[15]!==c.id?(A=s(F=>{d(c.id,F),g(!1)},"M"),e[14]=d,e[15]=c.id,e[16]=A):A=e[16];let W=A,$;e[17]===Symbol.for("react.memo_cache_sentinel")?($=s(()=>{g(!1)},"z"),e[17]=$):$=e[17];let P=$,H;e[18]!==c.name?(H=c.name.trim(),e[18]=c.name,e[19]=H):H=e[19];let z=H,R;e[20]!==m||e[21]!==c.sql?(R=bn(c.sql,m("Untitled")),e[20]=m,e[21]=c.sql,e[22]=R):R=e[22];let D=R,B=t?"bg-background text-foreground":"bg-muted/40 text-muted-foreground hover:text-foreground",j;e[23]!==B?(j=te("group/tab flex shrink-0 items-center gap-1 border-e border-border ps-3 pe-1.5 text-xs",B),e[23]=B,e[24]=j):j=e[24];let I=`sql-tab-${c.id}`,T;e[25]!==t||e[26]!==W||e[27]!==z||e[28]!==D||e[29]!==k||e[30]!==N||e[31]!==m||e[32]!==c.id?(T=k?(0,r.jsx)(hn,{initial:z,onCancel:P,onCommit:W,placeholder:D,testId:`sql-tab-rename-${c.id}`}):(0,r.jsx)("button",{"aria-pressed":t,className:"max-w-40 truncate py-1.5 outline-none","data-testid":`sql-tab-select-${c.id}`,onClick:N,onDoubleClick:C,title:m("Double-click to rename"),type:"button",children:z===""?D:z}),e[25]=t,e[26]=W,e[27]=z,e[28]=D,e[29]=k,e[30]=N,e[31]=m,e[32]=c.id,e[33]=T):T=e[33];let J;e[34]!==n||e[35]!==M||e[36]!==x||e[37]!==L||e[38]!==m||e[39]!==c.id?(J=n&&(x?(0,r.jsx)(fn,{idBase:c.id,onDiscard:M,onKeep:_}):(0,r.jsx)("button",{"aria-label":m("Close tab"),className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive","data-testid":`sql-tab-close-${c.id}`,onClick:L,title:m("Close tab"),type:"button",children:(0,r.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})})})),e[34]=n,e[35]=M,e[36]=x,e[37]=L,e[38]=m,e[39]=c.id,e[40]=J):J=e[40];let V;return e[41]!==y||e[42]!==j||e[43]!==I||e[44]!==T||e[45]!==J?(V=(0,r.jsxs)("div",{className:j,"data-testid":I,onContextMenu:y,children:[T,J]}),e[41]=y,e[42]=j,e[43]=I,e[44]=T,e[45]=J,e[46]=V):V=e[46],V},"xn");function gn(l){l?.focus(),l?.select()}s(gn,"gn");var vn=ne(le.runSql),yn="lunora-studio-sql-queries",Nn="lunora-studio-sql-history",kn="lunora-studio-sql-split-view",wn=25,qn={minWidth:"2.75rem",paddingInline:"0.5rem"},ve={error:null,pane:"results",result:null},Cn=s(l=>{let e=(0,Y.c)(16),{result:t}=l;if(t.columns.length===0){let c=t.rowCount===0?"0 rows":"",m;return e[0]!==c?(m=(0,r.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:c}),e[0]=c,e[1]=m):m=e[1],m}let n;e[2]!==t.columns?(n=t.columns.map(Sn),e[2]=t.columns,e[3]=n):n=e[3];let o;e[4]!==n?(o=(0,r.jsx)(Te,{className:"sticky top-0 z-10 bg-muted",children:(0,r.jsx)(xe,{children:n})}),e[4]=n,e[5]=o):o=e[5];let a;if(e[6]!==t.columns||e[7]!==t.rows){let c;e[9]!==t.columns?(c=s((m,k)=>(0,r.jsx)(xe,{"data-testid":"sql-row",children:t.columns.map(g=>(0,r.jsx)(Me,{className:"max-w-md truncate font-mono text-xs",children:(0,r.jsx)(_e,{value:m[g]})},g))},k),"i"),e[9]=t.columns,e[10]=c):c=e[10],a=t.rows.map(c),e[6]=t.columns,e[7]=t.rows,e[8]=a}else a=e[8];let d;e[11]!==a?(d=(0,r.jsx)(Oe,{children:a}),e[11]=a,e[12]=d):d=e[12];let p;return e[13]!==o||e[14]!==d?(p=(0,r.jsxs)(Re,{"data-testid":"sql-rows",children:[o,d]}),e[13]=o,e[14]=d,e[15]=p):p=e[15],p},"Cn"),Bn=s(({initialShardKey:l})=>{let e=be(),t=K(),[n,o]=oe(yn),[a,d]=oe(Nn),[p,c]=(0,E.useState)(""),m=s(()=>Q(Fe[0]?.sql??""),"u"),{activeId:k,setActiveId:g,setTabs:x,tabs:b}=sn(m),[u,y]=(0,E.useState)({}),[v,N]=(0,E.useState)(l??""),[f,C]=(0,E.useState)(!1),[q,L]=he(kn,!1),[S,M]=(0,E.useState)(null),[O,_]=(0,E.useState)(null),A=(0,E.useRef)(null),W=(0,E.useRef)(null),$=(0,E.useRef)(null),P=(0,E.useId)(),{probe:H,schema:z}=en(v),R=b.find(i=>i.id===k)??b[0]??Q(),D=R.sql,{activeId:B}=R,j=u[R.id]??ve,{error:I,result:T}=j,J=j.pane,V=s(i=>{x(h=>h.map(w=>w.id===R.id?{...w,...i}:w))},"G"),F=s(i=>{y(h=>{let w=h[R.id]??ve;return{...h,[R.id]:{error:i.error,pane:i.pane??w.pane,result:i.result}}})},"F"),ke=s(i=>{y(h=>{let w=h[R.id]??ve;return{...h,[R.id]:{...w,pane:i}}})},"ve"),ie=s(i=>{V({sql:i}),B!==null&&o(h=>h.map(w=>w.id===B?{...w,sql:i}:w))},"re"),Je=Ut(z,W,ie),{close:ae,commit:we,move:ce,refresh:Z,state:G}=Je,Ue=s(i=>{ce(i-(G?.active??0)),we()},"_e");(0,E.useEffect)(()=>{let i=W.current;i!==null&&i===document.activeElement&&Z(i.value,i.selectionStart)},[Z,z]);let Ye=s(i=>{d(h=>h[0]?.sql===i?h:[{at:Date.now(),sql:i},...h.filter(w=>w.sql!==i)].slice(0,wn))},"Ae"),de=s(async i=>{if(D.trim()==="")return;C(!0);let h=i==="explain"?`EXPLAIN QUERY PLAN ${D}`:D;try{let w=await e.query(vn,{sql:h},re(v));F({error:null,pane:i,result:w}),Ie(v),Ye(h)}catch(w){F({error:Se(w),pane:i,result:null})}finally{C(!1)}},"se"),Ke=s(()=>{X(de("results"))},"ze"),Ge=s(i=>{let{selectionStart:h,value:w}=i.target;ie(w);for(let U of tn(w))H(U);Z(w,h)},"je"),Ve=s(i=>{let h=i.currentTarget;Z(h.value,h.selectionStart)},"Be"),Xe=s(i=>{if(G!==null){if(i.key==="ArrowDown"){i.preventDefault(),ce(1);return}if(i.key==="ArrowUp"){i.preventDefault(),ce(-1);return}if(i.key==="Escape"){i.preventDefault(),ae();return}if((i.key==="Enter"||i.key==="Tab")&&!i.metaKey&&!i.ctrlKey&&we()){i.preventDefault();return}}(i.metaKey||i.ctrlKey)&&i.key==="Enter"&&(i.preventDefault(),X(de(J)))},"We"),Qe=s(()=>{requestAnimationFrame(()=>{ae()})},"Fe"),Ze=s(i=>{A.current!==null&&(A.current.scrollTop=i.currentTarget.scrollTop)},"He"),ee=s((i,h)=>{x(w=>w.map(U=>U.id===R.id?{...U,activeId:h,sql:i}:U)),F({error:null,result:null})},"te"),et=s(()=>{let i={id:fe("q"),name:t("Untitled query"),sql:""};o(h=>[i,...h]),ee("",i.id)},"Pe"),tt=s(i=>{let h=n.find(w=>w.id===i);h!==void 0&&(ee(h.sql,i),$.current?.querySelector(`[data-testid="sql-query-${i}"]`)?.scrollIntoView({block:"nearest"}))},"Ue"),nt=s(i=>{o(h=>h.filter(w=>w.id!==i)),x(h=>h.map(w=>w.activeId===i?{...w,activeId:null}:w))},"Je"),rt=s(i=>{ee(i.currentTarget.dataset.sql??"",null)},"Ke"),lt=s(i=>{ee(i.currentTarget.dataset.sql??"",null)},"Ye"),ot=s(()=>{d([])},"Ve"),st=s(()=>{ie(At(D))},"Ge"),it=s(()=>{if(b.length>=ye)return;let i=Q();x(h=>an(h,i)),g(i.id)},"Qe"),qe=s(i=>{M(null),_(null),x(i.tabs),g(i.activeId);let h=new Set(i.tabs.map(w=>w.id));y(w=>Object.fromEntries(Object.entries(w).filter(([U])=>h.has(U))))},"Ne"),at=s(i=>{qe(cn(b,i,Q))},"Xe"),Ce=s((i,h)=>{qe(i==="others"?dn(b,h):i==="right"?un(b,h,k):mn(Q))},"ke"),ue=s(i=>{S!==null&&(pn(i,b,S.id).some(h=>Pe(h))?_(i):Ce(i,S.id))},"ie"),ct=s((i,h)=>{h.preventDefault(),_(null),M({id:i,x:h.clientX,y:h.clientY})},"Ze"),dt=s(()=>{M(null),_(null)},"et"),ut=s(i=>{i.preventDefault(),M(null),_(null)},"tt"),mt=s(()=>{ue("others")},"nt"),pt=s(()=>{ue("right")},"rt"),bt=s(()=>{ue("all")},"lt"),ht=s(()=>{S!==null&&O!==null&&Ce(O,S.id),_(null)},"ot"),ft=s(()=>{_(null)},"st"),xt=S===null?void 0:{left:S.x,top:S.y},gt=s(i=>{ae(),g(i)},"at"),vt=s((i,h)=>{x(w=>w.map(U=>U.id===i?{...U,name:h}:U))},"ct"),yt=s(()=>{ke("results")},"dt"),Nt=s(()=>{X(de("explain"))},"ut"),kt=s(()=>{ke("chart")},"mt"),wt=s(()=>{L(!q)},"pt"),qt=D.split(`
4
+ `).length,Ct=s(i=>{c(i.target.value)},"bt"),me=s(i=>`border-b-2 px-3 py-2 text-sm outline-none transition-colors ${i?"border-foreground font-medium text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"ae"),St=q?"flex min-h-0 flex-1 flex-row":"flex min-h-0 flex-1 flex-col",It=q?"flex w-2/5 min-h-0 min-w-0 shrink-0 flex-col border-s border-border":"flex h-2/5 min-h-0 shrink-0 flex-col border-t border-border";return(0,r.jsxs)("div",{className:"flex h-full min-w-0","data-testid":"lunora-sql-editor",children:[(0,r.jsx)(Xt,{activeId:B,history:a,listRef:$,onClearHistory:ot,onDelete:nt,onLoadHistory:lt,onLoadTemplate:rt,onNew:et,onSearchChange:Ct,onSelect:tt,queries:n,search:p}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,r.jsxs)("div",{className:"flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-muted/30","data-testid":"sql-tab-strip",role:"tablist",children:[b.map(i=>(0,r.jsx)(xn,{active:i.id===R.id,canClose:b.length>1,onClose:at,onMenu:ct,onRename:vt,onSelect:gt,tab:i},i.id)),(0,r.jsx)("button",{"aria-label":t("New tab"),className:"flex size-8 shrink-0 items-center justify-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-add",disabled:b.length>=ye,onClick:it,title:t("New tab"),type:"button",children:(0,r.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 5v14M5 12h14"})})})]}),S!==null&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-40","data-testid":"sql-tab-menu-backdrop",onClick:dt,onContextMenu:ut,role:"presentation"}),(0,r.jsx)("div",{className:"fixed z-50 min-w-44 rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-tab-menu",role:"menu",style:xt,children:O===null?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-others",disabled:b.length<=1,onClick:mt,role:"menuitem",type:"button",children:t("Close other tabs")}),(0,r.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-right",disabled:b.findIndex(i=>i.id===S.id)>=b.length-1,onClick:pt,role:"menuitem",type:"button",children:t("Close tabs to the right")}),(0,r.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-close-all",onClick:bt,role:"menuitem",type:"button",children:t("Close all tabs")})]}):(0,r.jsxs)("div",{className:"px-3 py-1.5","data-testid":"sql-tab-menu-confirm",children:[(0,r.jsx)("p",{className:"pb-1.5 text-xs text-muted-foreground",children:t("Discard unsaved tabs?")}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{className:"rounded px-2 py-1 text-xs font-medium text-destructive outline-none hover:bg-destructive/10 focus-visible:bg-destructive/10","data-testid":"sql-tab-menu-confirm-discard",onClick:ht,type:"button",children:t("Discard")}),(0,r.jsx)("button",{className:"rounded px-2 py-1 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-confirm-cancel",onClick:ft,type:"button",children:t("Cancel")})]})]})})]}),(0,r.jsxs)("div",{className:St,children:[(0,r.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1",children:[(0,r.jsx)("div",{"aria-hidden":"true",className:"shrink-0 select-none overflow-hidden border-e border-border bg-muted/30 py-3 text-end font-mono text-xs leading-5 text-muted-foreground/60",ref:A,style:qn,children:Array.from({length:qt},(i,h)=>(0,r.jsx)("div",{children:h+1},h))}),(0,r.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,r.jsx)("textarea",{"aria-activedescendant":G===null?void 0:`${P}-opt-${G.active.toString()}`,"aria-autocomplete":"list","aria-controls":G===null?void 0:P,"aria-expanded":G!==null,"aria-label":t("SQL query"),className:"size-full resize-none bg-background p-3 font-mono text-xs leading-5 outline-none","data-testid":"sql-input",onBlur:Qe,onChange:Ge,onKeyDown:Xe,onScroll:Ze,onSelect:Ve,placeholder:"SELECT * FROM \u2026",ref:W,role:"combobox",spellCheck:!1,value:D}),(0,r.jsx)(Gt,{listboxId:P,onPick:Ue,state:G})]})]}),(0,r.jsxs)("div",{className:It,children:[(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border pe-2",children:[(0,r.jsx)("button",{className:me(J==="results"),"data-testid":"sql-tab-results",onClick:yt,type:"button",children:t("Results")}),(0,r.jsx)("button",{className:me(J==="chart"),"data-testid":"sql-tab-chart",onClick:kt,type:"button",children:t("Chart")}),(0,r.jsx)("button",{className:me(J==="explain"),"data-testid":"sql-tab-explain",onClick:Nt,type:"button",children:t("Explain")}),(0,r.jsxs)("div",{className:"ms-auto flex items-center gap-2",children:[(0,r.jsx)("button",{"aria-label":t("Split editor and results"),"aria-pressed":q,className:`inline-flex items-center rounded-md border border-border px-2 py-1.5 outline-none transition-colors hover:bg-accent focus-visible:bg-accent ${q?"bg-accent text-foreground":"text-muted-foreground"}`,"data-testid":"sql-split-toggle",onClick:wt,title:t("Split editor and results"),type:"button",children:(0,r.jsxs)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:[(0,r.jsx)("rect",{height:"16",rx:"2",width:"18",x:"3",y:"4"}),(0,r.jsx)("path",{d:"M12 4v16"})]})}),T!==null&&T.columns.length>0&&(0,r.jsx)(Ae,{columns:T.columns,name:"query-result",rows:T.rows}),(0,r.jsx)("button",{className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-format",disabled:f,onClick:st,type:"button",children:t("Format")}),(0,r.jsx)(Ee,{onChange:N,testId:"sql-shard-input",value:v}),(0,r.jsxs)("button",{className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-run",disabled:f,onClick:Ke,type:"button",children:[t(f?"Running\u2026":"Run"),(0,r.jsx)("kbd",{className:"rounded border border-primary-foreground/30 px-1 font-sans text-[10px]",children:"\u2318\u21B5"})]})]})]}),(0,r.jsxs)("div",{className:"min-h-0 flex-1 overflow-auto",children:[I!==null&&(0,r.jsx)(Le,{className:"m-3 font-mono text-xs",testId:"sql-error",variant:"destructive",children:I}),I===null&&T===null&&(0,r.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-empty",children:t("Click Run to execute your query.")}),I===null&&T!==null&&(0,r.jsxs)("div",{"data-testid":"sql-result",children:[J==="chart"?(0,r.jsx)(ze,{result:T}):(0,r.jsx)(Cn,{result:T}),(0,r.jsx)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground","data-testid":"sql-count",children:T.truncated?t("Showing the first {max} of {count} rows.",{count:T.rowCount,max:T.rows.length}):t("{count} rows",{count:T.rowCount})})]})]})]})]})]})]})},"Hn");function Sn(l){return(0,r.jsx)(De,{children:l},l)}s(Sn,"Sn");export{Bn as SqlEditorPanel};
@@ -0,0 +1,4 @@
1
+ import{a as L}from"./chunk-SKHEGARW.js";import{a as w,e as N}from"./chunk-JKPK25JO.js";import{R as S}from"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import{c as v}from"./chunk-UY2Y5CXB.js";import"./chunk-ZFWEPGWG.js";import"./chunk-4FNHHFWR.js";import"./chunk-UREY4GLG.js";import{d as k,h as C,m as j,o as T}from"./chunk-KLLYGWNF.js";import{a as p,e as b,f as M,g as O,h as W}from"./chunk-UHHTEBC3.js";var q=b(O(),1),x=b(M(),1);var t=b(W(),1);var D=p(s=>{let e=(0,q.c)(23),{destination:a}=s,h=k(),m;e[0]!==a.snippet?(m=p(()=>{T(a.snippet)},"m"),e[0]=a.snippet,e[1]=m):m=e[1];let u=m,r;e[2]!==a.title?(r=(0,t.jsx)("h4",{className:"text-sm font-semibold",children:a.title}),e[2]=a.title,e[3]=r):r=e[3];let o;e[4]!==a.description?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:a.description}),e[4]=a.description,e[5]=o):o=e[5];let l;e[6]!==r||e[7]!==o?(l=(0,t.jsxs)("div",{children:[r,o]}),e[6]=r,e[7]=o,e[8]=l):l=e[8];let g=`drain-copy-${a.id}`,d;e[9]!==h?(d=h("Copy"),e[9]=h,e[10]=d):d=e[10];let i;e[11]!==u||e[12]!==g||e[13]!==d?(i=(0,t.jsx)(v,{"data-testid":g,onClick:u,size:"sm",variant:"outline",children:d}),e[11]=u,e[12]=g,e[13]=d,e[14]=i):i=e[14];let n;e[15]!==l||e[16]!==i?(n=(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[l,i]}),e[15]=l,e[16]=i,e[17]=n):n=e[17];let c;e[18]!==a.snippet?(c=(0,t.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-muted p-2 font-mono text-xs",children:a.snippet}),e[18]=a.snippet,e[19]=c):c=e[19];let f;return e[20]!==n||e[21]!==c?(f=(0,t.jsx)(w,{className:"py-0","data-testid":"drain-card",children:(0,t.jsxs)(N,{className:"p-3",children:[n,c]})}),e[20]=n,e[21]=c,e[22]=f):f=e[22],f},"$"),z=p(()=>{let s=k(),e=[{description:s("Stream every request log to R2, a SIEM, or a third-party log service."),id:"logpush",snippet:["{",' "logpush": true',"}"].join(`
2
+ `),title:s("Logpush")},{description:s("Send logs programmatically to a Worker for custom capture and forwarding."),id:"tail-worker",snippet:["{",' "tail_consumers": [{ "service": "my-log-forwarder" }]',"}"].join(`
3
+ `),title:s("Tail Workers")},{description:s("Retain and query recent request logs directly in Cloudflare's dashboard."),id:"workers-logs",snippet:["{",' "observability": { "enabled": true }',"}"].join(`
4
+ `),title:s("Workers Logs")}],[a,h]=(0,x.useState)(""),[m,u]=(0,x.useState)(!1),[r,o]=(0,x.useState)(null),l=p(async()=>{let i=a.trim();if(i==="")return;let n="fetch"in globalThis?globalThis.fetch:void 0;if(n===void 0){o({kind:"error",message:s("fetch is unavailable in this environment.")});return}let c={durationMs:12,function:"messages:list",outcome:"ok",shard:"root",source:"lunora",tablesRead:["messages"],tablesWritten:[],ts:new Date().toISOString(),type:"request"};u(!0),o(null);let f=performance.now();try{let y=await n(i,{body:JSON.stringify(c),headers:{"Content-Type":"application/json"},method:"POST"});o({kind:"success",latencyMs:Math.round(performance.now()-f),status:y.status})}catch(y){o({kind:"error",message:C(y)})}finally{u(!1)}},"l"),g=p(()=>{j(l())},"g"),d=p(i=>{h(i.target.value)},"d");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"log-drains",children:[(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"drain-cf-link",href:L,rel:"noreferrer",target:"_blank",children:s("Open in Cloudflare")})}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"drain-readonly-note",children:s("Lunora does not ship logs itself \u2014 forwarding is handled by Cloudflare. Configure a destination below, then test your collector.")}),(0,t.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"drain-destinations",children:[(0,t.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Cloudflare destinations")}),e.map(i=>(0,t.jsx)(D,{destination:i},i.id))]}),(0,t.jsx)(w,{className:"py-0",children:(0,t.jsx)(N,{className:"p-3",children:(0,t.jsxs)("section",{"data-testid":"drain-webhook",children:[(0,t.jsx)("h3",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Webhook test")}),(0,t.jsx)("p",{className:"mb-2 text-sm text-muted-foreground",children:s("POST a sample Lunora request-log envelope to your collector to confirm it is reachable.")}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(S,{className:"min-w-[20rem] flex-1","data-testid":"drain-webhook-url",onChange:d,placeholder:s("https://example.com/logs"),type:"url",value:a}),(0,t.jsx)(v,{"data-testid":"drain-webhook-test",disabled:m||a.trim()==="",onClick:g,children:s(m?"Sending\u2026":"Send test event")})]}),r!==null&&(0,t.jsx)("p",{className:r.kind==="success"?"mt-2 text-sm text-muted-foreground":"mt-2 text-sm text-destructive","data-testid":"drain-webhook-result",role:r.kind==="error"?"alert":void 0,children:r.kind==="success"?s("Delivered \u2014 status {status} in {latency}ms",{latency:r.latencyMs,status:r.status}):s("Failed: {message}",{message:r.message})})]})})})]})},"E");export{z as LogDrainsPanel};
@@ -0,0 +1 @@
1
+ import{a as st}from"./chunk-6I62RSI5.js";import{a as Y}from"./chunk-YQ5PILIJ.js";import{a as Z}from"./chunk-Q34MSC2F.js";import"./chunk-4AYEV5UN.js";import{b as Q}from"./chunk-SKJZDOHG.js";import{a as tt,b as et,c as rt,d as z,e as n,f as o}from"./chunk-Q5WXTZWX.js";import{a as W,e as G}from"./chunk-JKPK25JO.js";import{a as X}from"./chunk-V66TSUKV.js";import"./chunk-UWF5DOGV.js";import"./chunk-PTTDIYGP.js";import"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import{c as U}from"./chunk-UY2Y5CXB.js";import"./chunk-ZFWEPGWG.js";import{b as R}from"./chunk-K5PFWU5J.js";import"./chunk-4FNHHFWR.js";import{a as V}from"./chunk-GXZAXNZI.js";import"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{a as H}from"./chunk-6OKDCV7J.js";import{d as O,q as J}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a,e as q,f as mt,g as ht,h as ut,j as P}from"./chunk-UHHTEBC3.js";var at=q(ht(),1),B=q(mt(),1);var e=q(ut(),1);var ft={action:"outline",mutation:"default",query:"secondary"},lt=a(r=>r<1e3?`${r<10?r.toFixed(1):Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,"O"),pt=a(r=>r.calls===0?"\u2014":r.errors===0?"0":`${r.errors.toString()} (${(r.errors/r.calls*100).toFixed(1)}%)`,"mt"),xt=a(r=>{let t=r.conflicts??0;return r.calls===0?"\u2014":t===0?"0":`${t.toString()} (${(t/r.calls*100).toFixed(1)}%)`},"ut"),gt={calls:a((r,t)=>t.calls-r.calls,"calls"),recent:a((r,t)=>t.lastCalledAt-r.lastCalledAt,"recent"),slowest:a((r,t)=>t.maxDurationMs-r.maxDurationMs,"slowest")},At=a(r=>{let t=(0,at.c)(47),{functions:A,initialShardKey:nt}=r,l=O(),[i,ot]=(0,B.useState)(nt??""),[c,it]=(0,B.useState)("recent"),M;t[0]!==i?(M=i.trim(),t[0]=i,t[1]=M):M=t[1];let j=Y(M,400),w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w={},t[2]=w):w=t[2];let $;t[3]!==j?($={live:!0,shardKey:j},t[3]=j,t[4]=$):$=t[4];let{data:ct,error:d,errorSource:v,liveError:k}=Q(V.getFunctionStats,w,$),S=ct?.functions??null,C;t[5]!==A?(C=new Map((A??[]).map(Nt)),t[5]=A,t[6]=C):C=t[6];let K=C,F;t[7]===Symbol.for("react.memo_cache_sentinel")?(F=a(b=>{it(b.currentTarget.dataset.sort)},"C"),t[7]=F):F=t[7];let dt=F,D;if(t[8]!==d||t[9]!==v||t[10]!==K||t[11]!==k||t[12]!==i||t[13]!==c||t[14]!==S||t[15]!==l){let b=S===null?[]:S.toSorted(gt[c]),m;t[17]!==l?(m=l("Recent"),t[17]=l,t[18]=m):m=t[18];let h;t[19]!==m?(h={key:"recent",label:m},t[19]=m,t[20]=h):h=t[20];let u;t[21]!==l?(u=l("Most called"),t[21]=l,t[22]=u):u=t[22];let f;t[23]!==u?(f={key:"calls",label:u},t[23]=u,t[24]=f):f=t[24];let p;t[25]!==l?(p=l("Slowest"),t[25]=l,t[26]=p):p=t[26];let x;t[27]!==p?(x={key:"slowest",label:p},t[27]=p,t[28]=x):x=t[28];let I;t[29]!==f||t[30]!==x||t[31]!==h?(I=[h,f,x],t[29]=f,t[30]=x,t[31]=h,t[32]=I):I=t[32];let L=I,g;t[33]!==i?(g=(0,e.jsx)(X,{onChange:ot,testId:"fs-shard-input",value:i}),t[33]=i,t[34]=g):g=t[34];let N;t[35]!==k?(N=(0,e.jsx)(st,{message:k,prefix:"fs"}),t[35]=k,t[36]=N):N=t[36];let y;t[37]!==L||t[38]!==c?(y=(0,e.jsx)("div",{className:"ml-auto flex items-center gap-1",role:"group",children:L.map(s=>(0,e.jsx)(U,{"data-sort":s.key,"data-testid":`fs-sort-${s.key}`,onClick:dt,size:"sm",type:"button",variant:c===s.key?"secondary":"ghost",children:s.label},s.key))}),t[37]=L,t[38]=c,t[39]=y):y=t[39];let E;t[40]!==g||t[41]!==N||t[42]!==y?(E=(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[g,N,y]}),t[40]=g,t[41]=N,t[42]=y,t[43]=E):E=t[43];let _;t[44]!==d||t[45]!==v?(_=d!==null&&(0,e.jsx)(Z,{error:v,testId:"fs-error"}),t[44]=d,t[45]=v,t[46]=_):_=t[46],D=(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-stats",children:[E,_,S!==null&&b.length===0&&d===null&&(0,e.jsx)(H,{description:l("Per-function call counts, error rates, and latency land here after your first request."),icon:(0,e.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,e.jsx)("path",{d:"M3 3v18h18"}),(0,e.jsx)("path",{d:"M7 14l4-4 3 3 5-6"})]}),testId:"fs-empty",title:l("No functions have run on this shard yet.")}),b.length>0&&(0,e.jsx)(W,{className:"overflow-hidden py-0",children:(0,e.jsx)(G,{className:"px-0",children:(0,e.jsxs)(tt,{"data-testid":"fs-table",children:[(0,e.jsx)(et,{children:(0,e.jsxs)(z,{children:[(0,e.jsx)(n,{children:l("function")}),(0,e.jsx)(n,{children:l("kind")}),(0,e.jsx)(n,{className:"text-right",children:l("calls")}),(0,e.jsx)(n,{className:"text-right",children:l("errors")}),(0,e.jsx)(n,{className:"text-right",children:l("conflicts")}),(0,e.jsx)(n,{className:"text-right",children:l("avg")}),(0,e.jsx)(n,{className:"text-right",children:l("max")}),(0,e.jsx)(n,{children:l("last run")}),(0,e.jsx)(n,{children:l("last error")})]})}),(0,e.jsx)(rt,{children:b.map(s=>{let T=K.get(s.path);return(0,e.jsxs)(z,{"data-testid":`fs-row-${s.path}`,children:[(0,e.jsx)(o,{className:"font-medium",children:s.path}),(0,e.jsx)(o,{children:T===void 0?(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}):(0,e.jsx)(R,{variant:ft[T],children:T})}),(0,e.jsx)(o,{className:"text-right tabular-nums",children:s.calls}),(0,e.jsx)(o,{className:P("text-right tabular-nums",s.errors>0&&"text-destructive"),children:pt(s)}),(0,e.jsx)(o,{className:P("text-right tabular-nums",(s.conflicts??0)>0&&"text-warning"),children:xt(s)}),(0,e.jsx)(o,{className:"text-right tabular-nums",children:s.calls===0?"\u2014":lt(s.totalDurationMs/s.calls)}),(0,e.jsx)(o,{className:"text-right tabular-nums",children:s.calls===0?"\u2014":lt(s.maxDurationMs)}),(0,e.jsx)(o,{className:"text-muted-foreground",children:J(s.lastCalledAt,"\u2014")}),(0,e.jsx)(o,{className:"max-w-[24ch] truncate text-destructive",title:s.lastErrorMessage??void 0,children:s.lastErrorMessage??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},s.path)})})]})})})]}),t[8]=d,t[9]=v,t[10]=K,t[11]=k,t[12]=i,t[13]=c,t[14]=S,t[15]=l,t[16]=D}else D=t[16];return D},"Dt");function Nt(r){return[r.path,r.kind]}a(Nt,"ft");export{At as FunctionStatsPanel};
@@ -0,0 +1 @@
1
+ import{b as de,e as F}from"./chunk-RE6UWCMG.js";import{a as ce}from"./chunk-6I62RSI5.js";import"./chunk-OTJOI23O.js";import"./chunk-SEDZDNQF.js";import"./chunk-TYTJDFX2.js";import"./chunk-KSRXMTBV.js";import{b as ie}from"./chunk-SKJZDOHG.js";import{a as k}from"./chunk-JKPK25JO.js";import{a as oe}from"./chunk-UWF5DOGV.js";import"./chunk-PTTDIYGP.js";import"./chunk-46IB4C4Q.js";import{b as A}from"./chunk-K5PFWU5J.js";import"./chunk-4FNHHFWR.js";import{a as y}from"./chunk-GXZAXNZI.js";import{f as ae,g as le}from"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{d as R,f as S,g as Q,h as V,m as z,q as ne}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as p,e as q,f as qe,g as re,h as se,j as w}from"./chunk-UHHTEBC3.js";var xe=q(re(),1);var c=q(qe(),1);var ue=q(re(),1);var K=q(se(),1);var Ae={connected:"bg-success",connecting:"bg-warning",idle:"bg-muted-foreground",offline:"bg-destructive"},me=p(()=>{let t=(0,ue.c)(16),e=R(),a=le(),s;e:switch(a){case"connected":{let i;t[0]!==e?(i=e("Connected"),t[0]=e,t[1]=i):i=t[1],s=i;break e}case"connecting":{let i;t[2]!==e?(i=e("Connecting\u2026"),t[2]=e,t[3]=i):i=t[3],s=i;break e}case"idle":{let i;t[4]!==e?(i=e("Idle"),t[4]=e,t[5]=i):i=t[5],s=i;break e}case"offline":{let i;t[6]!==e?(i=e("Offline"),t[6]=e,t[7]=i):i=t[7],s=i;break e}default:s=a}let l=Ae[a],d;t[8]!==l?(d=w("size-2 rounded-full",l),t[8]=l,t[9]=d):d=t[9];let u;t[10]!==d?(u=(0,K.jsx)("span",{"aria-hidden":"true",className:d}),t[10]=d,t[11]=u):u=t[11];let o;return t[12]!==a||t[13]!==u||t[14]!==s?(o=(0,K.jsxs)("span",{"aria-live":"polite",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","data-status":a,"data-testid":"dash-connection",role:"status",children:[u,s]}),t[12]=a,t[13]=u,t[14]=s,t[15]=o):o=t[15],o},"j");var r=q(se(),1);var fe={completed:0,failed:2,in_progress:1},Ee=p(t=>{let e=0,a=0,s=0,l=0,d=[];for(let{metrics:u}of t){if(u===null){l+=1;continue}s+=1,e+=u.requests,a+=u.errors,d.push(...u.history??[])}return{errors:a,failed:l,history:d,reachable:s,requests:e}},"Se"),je=p(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.path);if(l===void 0){e.set(s.path,{...s});continue}l.calls+=s.calls,l.errors+=s.errors,l.totalDurationMs+=s.totalDurationMs,l.scans=(l.scans??0)+(s.scans??0),l.maxDurationMs=Math.max(l.maxDurationMs,s.maxDurationMs),l.lastCalledAt=Math.max(l.lastCalledAt,s.lastCalledAt),(s.lastErrorAt??0)>(l.lastErrorAt??0)&&(l.lastErrorAt=s.lastErrorAt,l.lastErrorMessage=s.lastErrorMessage)}return[...e.values()]},"Me"),Ie=p(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.id);if(l===void 0){e.set(s.id,s);continue}let d=fe[s.status]-fe[l.status];(d>0||d===0&&(s.updatedAt??0)>(l.updatedAt??0))&&e.set(s.id,s)}return[...e.values()]},"qe"),De=S(y.getAuthMetrics),Ce=S(y.getFunctionStats),Pe=S(y.getLogs),Le=S(y.getMetrics),Te=S(y.migrationStatus),Re=5,pe=2e3,ze=5,he=.01,ge=.05,Fe=.1,Ke=.3,Oe=1,_e=50,W=p((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","V"),$e=p((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","Re"),He={crit:"destructive",ok:"secondary",warn:"default"},O=p((t,e)=>e===0?"\u2014":`${(t/e*100).toFixed(1)}%`,"F"),Ue=p(t=>{let e=new Map;for(let s of t??[]){let l=e.get(s.bucketMs)??{calls:0,errors:0};l.calls+=s.calls,l.errors+=s.errors,e.set(s.bucketMs,l)}let a=[...e.entries()].toSorted((s,l)=>s[0]-l[0]);return{errors:a.map(([,s])=>s.errors),requests:a.map(([,s])=>s.calls)}},"_e"),Be=p(t=>{let e=0,a=0;for(let l of t)l.status==="failed"?e+=1:l.status==="in_progress"&&(a+=1);let s="ok";return e>0?s="crit":a>0&&(s="warn"),{failed:e,level:s,running:a}},"ze"),Ge=p((t,e)=>t.failed>0?e("{count} failed",{count:t.failed.toString()}):t.running>0?e("{count} running",{count:t.running.toString()}):e("OK"),"Ke"),ve={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},be={crit:"text-destructive",ok:"text-foreground",warn:"text-warning"},Je={crit:"bg-destructive/10 text-destructive",ok:"bg-success/10 text-success",warn:"bg-warning/10 text-warning"},Qe=p(t=>t.includes("crit")?"crit":t.includes("warn")?"warn":"ok","Ue"),_=p(t=>{let e=(0,xe.c)(19),{chart:a,label:s,level:l,testId:d,value:u}=t,o=ve[l],i;e[0]!==o?(i=w("size-1.5 shrink-0 rounded-full",o),e[0]=o,e[1]=i):i=e[1];let h;e[2]!==i?(h=(0,r.jsx)("span",{"aria-hidden":"true",className:i}),e[2]=i,e[3]=h):h=e[3];let g;e[4]!==s||e[5]!==h?(g=(0,r.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[h,s]}),e[4]=s,e[5]=h,e[6]=g):g=e[6];let N=be[l],f;e[7]!==N?(f=w("truncate text-2xl font-semibold tabular-nums",N),e[7]=N,e[8]=f):f=e[8];let m;e[9]!==f||e[10]!==d||e[11]!==u?(m=(0,r.jsx)("span",{className:f,"data-testid":d,children:u}),e[9]=f,e[10]=d,e[11]=u,e[12]=m):m=e[12];let x;e[13]!==a||e[14]!==m?(x=(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[m,a]}),e[13]=a,e[14]=m,e[15]=x):x=e[15];let v;return e[16]!==g||e[17]!==x?(v=(0,r.jsx)(k,{className:"gap-0 py-0",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[g,x]})}),e[16]=g,e[17]=x,e[18]=v):v=e[18],v},"R"),Ve=p(async(t,e,a)=>{let s=await Promise.all(a.map(f=>{let m=Q(f);return Promise.allSettled([t.query(Le,{},m),t.query(Ce,{},m),t.query(Te,{},m)])})),l=Q(e),d=typeof t.schedulerStatus=="function"?t.schedulerStatus():Promise.reject(new Error("scheduler status unavailable")),[u,o,i]=await Promise.allSettled([t.query(Pe,{},l),t.query(De,{},l),d]),h=s.map(([f,m,x])=>({functions:m.status==="fulfilled"?m.value.functions:[],metrics:f.status==="fulfilled"?f.value:null,migrations:x.status==="fulfilled"?x.value.migrations:[]})),g=Ee(h),N=s[0]?.[0];return{auth:o.status==="fulfilled"?o.value:null,entries:u.status==="fulfilled"?u.value.entries:[],functions:je(h.map(f=>f.functions)),logsError:u.status==="rejected"?V(u.reason):null,metricsError:g.reachable===0&&N?.status==="rejected"?V(N.reason):null,migrations:Ie(h.map(f=>f.migrations)),scheduler:i.status==="fulfilled"?i.value:null,totals:g}},"Be"),pt=p(({initialShardKey:t})=>{let e=ae(),a=R(),[s,l]=(0,c.useState)([]),[d,u]=(0,c.useState)(null),[o,i]=(0,c.useState)(null),[h,g]=(0,c.useState)(null),[N,f]=(0,c.useState)([]),[m,x]=(0,c.useState)(null),[v,Ne]=(0,c.useState)(null),[we,ye]=(0,c.useState)([]),[M]=(0,c.useState)(oe),E=(0,c.useRef)(!1),$=(0,c.useRef)(!0);(0,c.useEffect)(()=>($.current=!0,()=>{$.current=!1}),[]);let j=t??"",I=(0,c.useCallback)(async()=>{if(E.current)return;E.current=!0;let n=await Ve(e,j,de(j,M));if(!$.current){E.current=!1;return}i(n.totals),g(n.metricsError),f(n.functions),ye(n.migrations),l(n.entries),u(n.logsError),x(n.auth),Ne(n.scheduler),E.current=!1},[e,M,j]);(0,c.useEffect)(()=>{z(I())},[I]);let H=(0,c.useRef)(0),D=(0,c.useRef)(null),ke=p(()=>{let n=Date.now()-H.current;if(n>=pe){H.current=Date.now(),z(I());return}D.current??=setTimeout(()=>{D.current=null,H.current=Date.now(),z(I())},pe-n)},"de");(0,c.useEffect)(()=>()=>{D.current!==null&&clearTimeout(D.current)},[]);let{data:X,liveError:Se}=ie(y.getMetrics,{},{live:!0,shardKey:j});(0,c.useEffect)(()=>{X!==void 0&&ke()},[X]);let U=s.filter(n=>n.level==="error"),B=U.slice(0,Re),C=Ue(o?.history),Y=(0,c.useMemo)(()=>{let n=m?.history??[];return{attempts:n.map(b=>b.attempts),failures:n.map(b=>b.failures)}},[m?.history]),Z=N.filter(n=>n.calls>0).toSorted((n,b)=>b.errors/b.calls-n.errors/n.calls||b.calls-n.calls).slice(0,ze),G=Be(we),Me=o===null||o.requests===0?0:o.errors/o.requests,J=W(Me,he,ge),ee=m===null?"ok":W(m.failureRate,Fe,Ke),te=v===null?"ok":$e(v.backlog,Oe,_e),P=Qe([J,ee,te,G.level]),L,T;return P==="crit"?(L=a("Critical"),T=a("One or more service levels are breached.")):P==="warn"?(L=a("Degraded"),T=a("Some service levels need attention.")):(L=a("All systems healthy"),T=a("All service levels are within target.")),(0,r.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-health",children:[(0,r.jsxs)(k,{className:"gap-0 py-0",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:w("flex size-10 shrink-0 items-center justify-center rounded-full",Je[P]),children:(0,r.jsx)("span",{className:w("size-3 rounded-full",ve[P])})}),(0,r.jsxs)("div",{className:"grid leading-tight",children:[(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"hl-status",children:L}),(0,r.jsx)("span",{className:"text-[13px] text-muted-foreground",children:T})]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,r.jsxs)("div",{className:"text-end",children:[(0,r.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Requests")}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[C.requests.length>=2&&(0,r.jsx)(F,{ariaLabel:a("Requests over time"),className:"h-6 w-20 text-foreground",series:C.requests,testId:"hl-spark-requests"}),(0,r.jsx)("span",{className:"text-lg font-semibold tabular-nums text-foreground","data-testid":"hl-requests",children:(o?.requests??0).toString()})]})]}),(0,r.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),(0,r.jsxs)("div",{className:"text-end",children:[(0,r.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Error rate")}),(0,r.jsx)("div",{className:w("text-lg font-semibold tabular-nums",be[J]),"data-testid":"hl-error-rate",children:o===null?"\u2014":O(o.errors,o.requests)})]}),(0,r.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(me,{}),(0,r.jsx)(ce,{message:Se,prefix:"hl"})]})]})]}),h!==null&&(0,r.jsx)("div",{className:"border-t border-border bg-destructive/5 px-4 py-2 text-sm text-destructive","data-testid":"hl-metrics-error",role:"alert",children:h})]}),(0,r.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"hl-slo",children:[(0,r.jsx)(_,{chart:C.errors.length>=2?(0,r.jsx)(F,{ariaLabel:a("Errors over time"),className:"h-7 w-20 text-destructive",series:C.errors,testId:"hl-spark-errors"}):void 0,label:a("Error rate"),level:J,testId:"hl-slo-errorrate",value:o===null?"\u2014":O(o.errors,o.requests)}),(0,r.jsx)(_,{chart:Y.failures.length>=2?(0,r.jsx)(F,{ariaLabel:a("Auth failures over time"),className:"h-7 w-20 text-destructive",series:Y.failures,testId:"hl-spark-auth"}):void 0,label:a("Auth failures"),level:ee,testId:"hl-slo-auth",value:m===null?"\u2014":O(m.failures,m.attempts)}),(0,r.jsx)(_,{label:a("Scheduler backlog"),level:te,testId:"hl-slo-backlog",value:v===null?"\u2014":v.backlog.toString()}),(0,r.jsx)(_,{label:a("Migrations"),level:G.level,testId:"hl-slo-migrations",value:Ge(G,a)})]}),(0,r.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,r.jsxs)(k,{className:"gap-0 py-0","data-testid":"hl-functions",children:[(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Functions by error rate")})}),Z.length===0?(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-functions-empty",children:a("No function activity yet.")}):(0,r.jsx)("ul",{className:"divide-y divide-border",children:Z.map(n=>(0,r.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs","data-testid":"hl-fn-row",children:[(0,r.jsx)("span",{className:"truncate font-mono text-foreground",children:n.path}),(0,r.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsx)("span",{className:"tabular-nums text-muted-foreground",children:a("{count} calls",{count:n.calls.toString()})}),(0,r.jsx)(A,{variant:He[W(n.errors/n.calls,he,ge)],children:O(n.errors,n.calls)})]})]},n.path))})]}),(0,r.jsxs)(k,{className:"gap-0 py-0",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Recent errors")}),(0,r.jsx)(A,{"data-testid":"hl-error-count",variant:U.length>0?"destructive":"outline",children:U.length})]}),d!==null&&(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"hl-logs-error",role:"alert",children:d}),d===null&&B.length===0&&(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-errors-empty",children:a("No recent errors.")}),B.length>0&&(0,r.jsx)("ul",{className:"divide-y divide-border",children:B.map((n,b)=>(0,r.jsxs)("li",{className:"flex flex-col gap-0.5 px-4 py-2 text-xs","data-testid":"hl-error-row",children:[(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("time",{className:"shrink-0 text-muted-foreground",children:ne(n.timestamp)}),n.functionPath!==void 0&&(0,r.jsx)("span",{className:"truncate font-mono text-foreground",children:n.functionPath})]}),(0,r.jsx)("span",{className:"text-destructive",children:n.message})]},`${n.timestamp.toString()}-${b.toString()}`))})]})]}),(0,r.jsxs)(k,{className:"gap-0 py-0",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Shards seen")}),(0,r.jsx)(A,{"data-testid":"hl-shard-count",variant:"outline",children:M.length})]}),M.length>0&&(0,r.jsx)("ul",{className:"flex flex-wrap gap-1.5 p-4",children:M.map(n=>(0,r.jsx)("li",{"data-testid":"hl-shard",children:(0,r.jsx)(A,{variant:"secondary",children:n})},n))})]})]})},"ot");export{pt as HealthPanel};
@@ -0,0 +1 @@
1
+ import{j as o}from"./chunk-4FNHHFWR.js";import{a as r,e as i,f as p}from"./chunk-UHHTEBC3.js";var a=i(p(),1);var R=a.forwardRef(r(function(e,n){let{className:l,render:m,orientation:t="horizontal",style:f,...s}=e;return o("div",e,{state:{orientation:t},ref:n,props:[{role:"separator","aria-orientation":t},s]})},"SeparatorComponent"));export{R as a};
@@ -0,0 +1 @@
1
+ import{a as d,e as n,g as c,h as p}from"./chunk-UHHTEBC3.js";var b=n(c(),1),s=n(p(),1);var y={alignItems:"center",border:"1px solid",borderRadius:4,display:"inline-flex",fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:11,fontWeight:400,gap:6,letterSpacing:"0.06em",lineHeight:1.4,padding:"1px 8px",textTransform:"uppercase"},g={borderRadius:"50%",display:"inline-block",height:7,width:7},h=d((r,e,t,a)=>({badgeStyle:{...y,borderColor:r,color:r},color:r,dotStyle:{...g,backgroundColor:r},hint:a,label:e,title:t}),"i"),S={global:h("var(--royal-amethyst)","Global \xB7 D1","Global table \u2014 a single D1 table shared across all shards","Declared .global() and stored once in Cloudflare D1, shared across every shard and tenant. Auth tables (user, session, \u2026) live here too."),shard:h("var(--sky-sapphire)","Shard-local","Shard-local table \u2014 per-shard SQLite inside a Durable Object","Stored per shard key in a Durable Object's SQLite (.shardBy(...)). You are viewing one shard at a time \u2014 change the shard key to inspect another.")},m=d(r=>{let e=(0,b.c)(9),{tier:t}=r,a=S[t],i=`storage-tier-${t}`,l;e[0]!==a.dotStyle?(l=(0,s.jsx)("span",{"aria-hidden":"true",style:a.dotStyle}),e[0]=a.dotStyle,e[1]=l):l=e[1];let o;return e[2]!==a.badgeStyle||e[3]!==a.label||e[4]!==a.title||e[5]!==i||e[6]!==l||e[7]!==t?(o=(0,s.jsxs)("span",{"data-testid":i,"data-tier":t,style:a.badgeStyle,title:a.title,children:[l,a.label]}),e[2]=a.badgeStyle,e[3]=a.label,e[4]=a.title,e[5]=i,e[6]=l,e[7]=t,e[8]=o):o=e[8],o},"S");export{S as a,m as b};
@@ -0,0 +1 @@
1
+ import{b as de,c as ce}from"./chunk-6CLVIOCB.js";import{a as ie}from"./chunk-ZMFZRGAN.js";import{a as le}from"./chunk-6I62RSI5.js";import{a as ne}from"./chunk-YQ5PILIJ.js";import{a as oe}from"./chunk-Q34MSC2F.js";import"./chunk-4AYEV5UN.js";import{b as te}from"./chunk-SKJZDOHG.js";import{a as se}from"./chunk-V66TSUKV.js";import{b as ae}from"./chunk-UWF5DOGV.js";import"./chunk-PTTDIYGP.js";import{R as Z}from"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import"./chunk-ZFWEPGWG.js";import{b as Y}from"./chunk-K5PFWU5J.js";import"./chunk-4FNHHFWR.js";import{a as re}from"./chunk-GXZAXNZI.js";import"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{a as X}from"./chunk-6OKDCV7J.js";import{d as z,q as ee}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as M,e as Q,f as he,g as fe,h as pe,j as V}from"./chunk-UHHTEBC3.js";var H=Q(fe(),1),F=Q(he(),1);var a=Q(pe(),1);var me=M(o=>Math.min(100,Math.max(0,o)),"V"),ge=M((o,e)=>{if(!Number.isFinite(e)||e<=0)return{leftPercent:0,widthPercent:100};let t=me(o.offsetMs/e*100),s=o.durationMs/e*100,r=Math.max(.5,Math.min(me(s),100-t));return{leftPercent:t,widthPercent:r}},"he"),xe=M((o,e)=>{let t=e.trim().toLowerCase();return t===""?[...o]:o.filter(s=>s.rootName.toLowerCase().includes(t)||s.functionPath.toLowerCase().includes(t)||s.traceId.toLowerCase().includes(t))},"fe"),G=M(o=>Number.isFinite(o)?o>0&&o<1?`${o.toFixed(2)}ms`:`${String(Math.round(o))}ms`:"\u2014","U"),be=14,we=M(o=>Array.isArray(o?.traces)?o.traces:[],"ge"),Ne=M(o=>{let e=(0,H.c)(50),{span:t,traceDurationMs:s}=o,r=z(),n;e[0]!==t||e[1]!==s?(n=ge(t,s),e[0]=t,e[1]=s,e[2]=n):n=e[2];let{leftPercent:P,widthPercent:x}=n,L;e[3]!==t.attributes?(L=ie(t.attributes),e[3]=t.attributes,e[4]=L):L=e[4];let k=L,C=t.depth*be,y;e[5]!==C?(y={paddingLeft:C},e[5]=C,e[6]=y):y=e[6];let b=y,c=`${String(P)}%`,w=`${String(x)}%`,p;e[7]!==c||e[8]!==w?(p={left:c,width:w},e[7]=c,e[8]=w,e[9]=p):p=e[9];let l=p,f=t.depth,i;e[10]!==t.ok||e[11]!==r?(i=t.ok?null:(0,a.jsx)("span",{"aria-label":r("Errored span"),className:"mr-1 text-destructive","data-testid":"tr-span-error",role:"img",children:"\u25CF"}),e[10]=t.ok,e[11]=r,e[12]=i):i=e[12];let v;e[13]!==b||e[14]!==t.name||e[15]!==i?(v=(0,a.jsxs)("span",{className:"w-56 shrink-0 truncate",role:"gridcell",style:b,title:t.name,children:[i,t.name]}),e[13]=b,e[14]=t.name,e[15]=i,e[16]=v):v=e[16];let d;e[17]!==t.durationMs||e[18]!==t.offsetMs||e[19]!==r?(d=r("starts {offset} in, runs {duration}",{duration:G(t.durationMs),offset:G(t.offsetMs)}),e[17]=t.durationMs,e[18]=t.offsetMs,e[19]=r,e[20]=d):d=e[20];let N=t.ok?"bg-primary/70":"bg-destructive",m;e[21]!==N?(m=V("absolute inset-y-0 rounded-sm",N),e[21]=N,e[22]=m):m=e[22];let u;e[23]!==l||e[24]!==P||e[25]!==m||e[26]!==x?(u=(0,a.jsx)("span",{className:m,"data-left":P,"data-testid":"tr-span-bar","data-width":x,style:l}),e[23]=l,e[24]=P,e[25]=m,e[26]=x,e[27]=u):u=e[27];let h;e[28]!==d||e[29]!==u?(h=(0,a.jsx)("span",{"aria-label":d,className:"relative h-3 flex-1 overflow-hidden rounded-sm bg-muted",role:"gridcell",children:u}),e[28]=d,e[29]=u,e[30]=h):h=e[30];let g;e[31]!==t.durationMs?(g=G(t.durationMs),e[31]=t.durationMs,e[32]=g):g=e[32];let I;e[33]!==g?(I=(0,a.jsx)("span",{className:"w-16 shrink-0 text-right tabular-nums text-muted-foreground",role:"gridcell",children:g}),e[33]=g,e[34]=I):I=e[34];let S;e[35]!==t.error?(S=t.error===void 0?null:(0,a.jsx)("span",{className:"text-destructive","data-testid":"tr-span-error-message",title:t.error.message,children:`${t.error.type}: ${t.error.message}`}),e[35]=t.error,e[36]=S):S=e[36];let T;e[37]!==S?(T=(0,a.jsx)("span",{className:"w-64 shrink-0 truncate text-muted-foreground",role:"gridcell",children:S}),e[37]=S,e[38]=T):T=e[38];let E;e[39]!==k?(E=k===""?null:(0,a.jsx)("span",{"data-testid":"tr-span-attributes",title:k,children:k}),e[39]=k,e[40]=E):E=e[40];let $;e[41]!==E?($=(0,a.jsx)("span",{className:"w-64 shrink-0 truncate text-muted-foreground",role:"gridcell",children:E}),e[41]=E,e[42]=$):$=e[42];let _;return e[43]!==t.depth||e[44]!==v||e[45]!==h||e[46]!==I||e[47]!==T||e[48]!==$?(_=(0,a.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-1.5 font-mono text-xs last:border-b-0 hover:bg-muted/50","data-depth":f,"data-testid":"tr-span-row",role:"row",children:[v,h,I,T,$]}),e[43]=t.depth,e[44]=v,e[45]=h,e[46]=I,e[47]=T,e[48]=$,e[49]=_):_=e[49],_},"xe"),Me=M(o=>{let e=(0,H.c)(50),{expanded:t,onToggle:s,trace:r}=o,n=z(),P;e[0]!==s||e[1]!==r.traceId?(P=M(()=>{s(r.traceId)},"S"),e[0]=s,e[1]=r.traceId,e[2]=P):P=e[2];let x=P,L=`tr-row-${r.traceId}`,k=`tr-waterfall-${r.traceId}`,C=`tr-toggle-${r.traceId}`,y=t?"\u25BE":"\u25B8",b;e[3]!==y?(b=(0,a.jsx)("span",{"aria-hidden":"true",className:"w-3 shrink-0 text-xs text-muted-foreground",children:y}),e[3]=y,e[4]=b):b=e[4];let c;e[5]!==r.rootName?(c=(0,a.jsx)("span",{className:"w-56 shrink-0 truncate text-sm font-medium",title:r.rootName,children:r.rootName}),e[5]=r.rootName,e[6]=c):c=e[6];let w;e[7]!==r.functionPath?(w=(0,a.jsx)("span",{className:"w-48 shrink-0 truncate font-mono text-xs text-muted-foreground",title:r.functionPath,children:r.functionPath}),e[7]=r.functionPath,e[8]=w):w=e[8];let p;e[9]!==r.durationMs?(p=G(r.durationMs),e[9]=r.durationMs,e[10]=p):p=e[10];let l;e[11]!==p?(l=(0,a.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:p}),e[11]=p,e[12]=l):l=e[12];let f;e[13]!==n||e[14]!==r.spans.length?(f=n("{count} spans",{count:r.spans.length}),e[13]=n,e[14]=r.spans.length,e[15]=f):f=e[15];let i;e[16]!==f?(i=(0,a.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:f}),e[16]=f,e[17]=i):i=e[17];let v=r.ok?"secondary":"destructive",d;e[18]!==n||e[19]!==r.ok?(d=r.ok?n("ok"):n("error"),e[18]=n,e[19]=r.ok,e[20]=d):d=e[20];let N;e[21]!==v||e[22]!==d?(N=(0,a.jsx)("span",{className:"shrink-0",children:(0,a.jsx)(Y,{variant:v,children:d})}),e[21]=v,e[22]=d,e[23]=N):N=e[23];let m;e[24]!==r.startTs?(m=ee(r.startTs),e[24]=r.startTs,e[25]=m):m=e[25];let u;e[26]!==m?(u=(0,a.jsx)("span",{className:"flex-1 truncate text-right font-mono text-xs tabular-nums text-muted-foreground",children:m}),e[26]=m,e[27]=u):u=e[27];let h;e[28]!==t||e[29]!==x||e[30]!==l||e[31]!==i||e[32]!==N||e[33]!==u||e[34]!==k||e[35]!==C||e[36]!==b||e[37]!==c||e[38]!==w?(h=(0,a.jsxs)("button",{"aria-controls":k,"aria-expanded":t,className:"flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50","data-testid":C,onClick:x,type:"button",children:[b,c,w,l,i,N,u]}),e[28]=t,e[29]=x,e[30]=l,e[31]=i,e[32]=N,e[33]=u,e[34]=k,e[35]=C,e[36]=b,e[37]=c,e[38]=w,e[39]=h):h=e[39];let g;e[40]!==t||e[41]!==n||e[42]!==r.durationMs||e[43]!==r.spans||e[44]!==r.traceId?(g=t&&(0,a.jsx)("div",{"aria-label":n("Trace waterfall"),className:"bg-muted/20","data-testid":`tr-waterfall-${r.traceId}`,id:`tr-waterfall-${r.traceId}`,role:"grid",children:r.spans.map(S=>(0,a.jsx)(Ne,{span:S,traceDurationMs:r.durationMs},S.spanId))}),e[40]=t,e[41]=n,e[42]=r.durationMs,e[43]=r.spans,e[44]=r.traceId,e[45]=g):g=e[45];let I;return e[46]!==h||e[47]!==g||e[48]!==L?(I=(0,a.jsxs)("div",{className:"border-b border-border last:border-b-0","data-testid":L,children:[h,g]}),e[46]=h,e[47]=g,e[48]=L,e[49]=I):I=e[49],I},"be"),Be=M(o=>{let e=(0,H.c)(44),{initialShardKey:t}=o,s=z(),[r]=(0,F.useState)(de),[n,P]=(0,F.useState)(r?.shardKey!==void 0&&r.shardKey!==""?r.shardKey:t??""),[x,L]=(0,F.useState)(r?.traceId??""),[k,C]=(0,F.useState)(ve),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0],(0,F.useEffect)(ke,y);let b;e[1]!==n?(b=n.trim(),e[1]=n,e[2]=b):b=e[2];let c=ne(b,400),w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w={},e[3]=w):w=e[3];let p;e[4]!==c?(p={live:!0,shardKey:c},e[4]=c,e[5]=p):p=e[5];let{data:l,error:f,errorSource:i,isLoading:v,liveError:d}=te(re.getTraces,w,p),N,m;e[6]!==l||e[7]!==c?(N=M(()=>{l!==void 0&&ae(c)},"N"),m=[l,c],e[6]=l,e[7]=c,e[8]=N,e[9]=m):(N=e[8],m=e[9]),(0,F.useEffect)(N,m);let u;if(e[10]!==l||e[11]!==f||e[12]!==i||e[13]!==k||e[14]!==v||e[15]!==d||e[16]!==x||e[17]!==n||e[18]!==s){let h=we(l),g=l?.total??h.length,I=g>h.length,S=xe(h,x),T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=M(K=>{L(K.target.value)},"T"),e[20]=T):T=e[20];let E=T,$;e[21]===Symbol.for("react.memo_cache_sentinel")?($=M(K=>{C(ue=>{let q=new Set(ue);return q.has(K)?q.delete(K):q.add(K),q})},"$"),e[21]=$):$=e[21];let _=$,J=f===null&&S.length===0&&!v,j;e[22]!==n?(j=(0,a.jsx)(se,{onChange:P,testId:"tr-shard-input",value:n}),e[22]=n,e[23]=j):j=e[23];let A;e[24]!==s?(A=s("Search traces"),e[24]=s,e[25]=A):A=e[25];let D;e[26]!==s?(D=s("search trace or function"),e[26]=s,e[27]=D):D=e[27];let B;e[28]!==x||e[29]!==A||e[30]!==D?(B=(0,a.jsx)(Z,{"aria-label":A,className:"h-8 w-56","data-testid":"tr-search",onChange:E,placeholder:D,value:x}),e[28]=x,e[29]=A,e[30]=D,e[31]=B):B=e[31];let O;e[32]!==d?(O=(0,a.jsx)(le,{message:d,prefix:"tr"}),e[32]=d,e[33]=O):O=e[33];let R;e[34]!==j||e[35]!==B||e[36]!==O?(R=(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[j,B,O]}),e[34]=j,e[35]=B,e[36]=O,e[37]=R):R=e[37];let U;e[38]!==f||e[39]!==i?(U=f!==null&&(0,a.jsx)(oe,{error:i,testId:"tr-error"}),e[38]=f,e[39]=i,e[40]=U):U=e[40];let W;e[41]!==J||e[42]!==s?(W=J&&(0,a.jsx)(X,{description:s("Traces recorded with ctx.trace show up here as your app handles traffic. The span buffer resets when the shard hibernates."),icon:(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M4 6h10M7 12h13M10 18h7"})}),testId:"tr-empty",title:s("No traces")}),e[41]=J,e[42]=s,e[43]=W):W=e[43],u=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-traces-panel",children:[R,U,W,f===null&&I&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"tr-truncated",children:s("Showing the {shown} most recent of {total} traces in the buffer.",{shown:h.length,total:g})}),f===null&&S.length>0&&(0,a.jsx)("div",{"aria-label":s("Recent traces"),className:"overflow-hidden rounded-xl border border-border shadow-xs","data-testid":"tr-list",children:S.map(K=>(0,a.jsx)(Me,{expanded:k.has(K.traceId),onToggle:_,trace:K},K.traceId))})]}),e[10]=l,e[11]=f,e[12]=i,e[13]=k,e[14]=v,e[15]=d,e[16]=x,e[17]=n,e[18]=s,e[19]=u}else u=e[19];return u},"Be");function ve(){return new Set}M(ve,"we");function ke(){ce()}M(ke,"Ne");export{Be as TracesPanel};
@@ -0,0 +1 @@
1
+ import{a as u,b as d}from"./chunk-OTJOI23O.js";import"./chunk-SEDZDNQF.js";import"./chunk-TYTJDFX2.js";import"./chunk-KSRXMTBV.js";import"./chunk-46IB4C4Q.js";import"./chunk-UDZY7MKE.js";import{a as c,e as f,g as p,h as y}from"./chunk-UHHTEBC3.js";var h=f(p(),1);var n=f(y(),1);var b={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},_=c(o=>{let e=(0,h.c)(6),{data:i}=o,a,r;if(e[0]!==i){r=Symbol.for("react.early_return_sentinel");e:{let m=i.slice(-16);if(m.length<3){r=null;break e}a=m.map(g)}e[0]=i,e[1]=a,e[2]=r}else a=e[1],r=e[2];if(r!==Symbol.for("react.early_return_sentinel"))return r;let s=a,t;e[3]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)(d,{dataKey:"value"}),e[3]=t):t=e[3];let l;return e[4]!==s?(l=(0,n.jsx)("div",{"aria-hidden":"true",className:"h-8 w-28",children:(0,n.jsx)(u,{animationType:"none",barCategoryGap:1,className:"h-8 w-full",config:b,data:s,children:t})}),e[4]=s,e[5]=l):l=e[5],l},"b");function g(o,e){return{index:e,value:o}}c(g,"h");export{_ as Sparkline};
@@ -0,0 +1 @@
1
+ import{a as J}from"./chunk-SA6MBPBL.js";import{a as L}from"./chunk-YQ5PILIJ.js";import{a as O}from"./chunk-Q34MSC2F.js";import"./chunk-4AYEV5UN.js";import{b as _}from"./chunk-SKJZDOHG.js";import{a as P,b as W,c as B,d as A,e as m,f as u}from"./chunk-Q5WXTZWX.js";import{a as E,e as K}from"./chunk-JKPK25JO.js";import{a as F}from"./chunk-V66TSUKV.js";import"./chunk-UWF5DOGV.js";import"./chunk-PTTDIYGP.js";import"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import"./chunk-ZFWEPGWG.js";import{b as S}from"./chunk-K5PFWU5J.js";import"./chunk-4FNHHFWR.js";import{a as D}from"./chunk-GXZAXNZI.js";import"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{a as T}from"./chunk-6OKDCV7J.js";import{d as j}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as N,e as C,f as X,g as q,h as z}from"./chunk-UHHTEBC3.js";var U=C(q(),1),Z=C(X(),1);var e=C(z(),1);var R=80,G=N(a=>{if(a===void 0)return"";let t=JSON.stringify(a);return t.length>R?`${t.slice(0,R)}\u2026`:t},"X"),H=N(a=>{let t=[];for(let i of a){let n=i.id.toString();if(i.subscriptions.length===0){t.push({admin:i.admin,connectionId:i.id,key:`c${n}`,subscription:null});continue}i.subscriptions.forEach((s,y)=>{t.push({admin:i.admin,connectionId:i.id,key:`c${n}-s${y.toString()}`,subscription:s})})}return t},"Z"),M=(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),lt=N(a=>{let t=(0,U.c)(22),{initialShardKey:i}=a,n=j(),[s,y]=(0,Z.useState)(i??""),h;t[0]!==s?(h=s.trim(),t[0]=s,t[1]=h):h=t[1];let k=L(h,400),p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p={},t[2]=p):p=t[2];let f;t[3]!==k?(f={keepPreviousData:!0,shardKey:k},t[3]=k,t[4]=f):f=t[4];let{data:r,error:o,errorSource:d,refetch:Q}=_(D.listSubscriptions,p,f);J(Q,!0);let b;if(t[5]!==o||t[6]!==d||t[7]!==r||t[8]!==s||t[9]!==n){let I=r===void 0?[]:H(r.connections),c;t[11]!==s?(c=(0,e.jsx)(F,{onChange:y,testId:"subs-shard-input",value:s}),t[11]=s,t[12]=c):c=t[12];let l;t[13]!==r||t[14]!==n?(l=r!==void 0&&(0,e.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,e.jsx)(S,{variant:"secondary",children:n("{count} connections",{count:r.totalConnections})}),(0,e.jsx)(S,{variant:"secondary",children:n("{count} subscriptions",{count:r.totalSubscriptions})})]}),t[13]=r,t[14]=n,t[15]=l):l=t[15];let g;t[16]!==c||t[17]!==l?(g=(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,l]}),t[16]=c,t[17]=l,t[18]=g):g=t[18];let v;t[19]!==o||t[20]!==d?(v=o!==null&&(0,e.jsx)(O,{error:d,testId:"subs-error"}),t[19]=o,t[20]=d,t[21]=v):v=t[21],b=(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[g,v,o===null&&r!==void 0&&I.length===0&&(0,e.jsx)(T,{description:n("Active WebSocket subscriptions on this shard."),icon:(0,e.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),testId:"subs-empty",title:n("No active subscriptions.")}),o===null&&I.length>0&&(0,e.jsx)(E,{className:"overflow-hidden py-0",children:(0,e.jsx)(K,{className:"px-0",children:(0,e.jsxs)(P,{"data-testid":"subs-table",children:[(0,e.jsx)(W,{children:(0,e.jsxs)(A,{children:[(0,e.jsx)(m,{children:n("Connection")}),(0,e.jsx)(m,{children:n("Function path")}),(0,e.jsx)(m,{children:n("Table")}),(0,e.jsx)(m,{children:n("Arguments")})]})}),(0,e.jsx)(B,{children:I.map(x=>{let{subscription:w}=x,$=G(w?.args);return(0,e.jsxs)(A,{"data-testid":"subs-row",children:[(0,e.jsx)(u,{className:"font-medium tabular-nums",children:(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",x.connectionId,x.admin&&(0,e.jsx)(S,{variant:"outline",children:n("admin")})]})}),(0,e.jsx)(u,{className:"font-mono text-xs",children:w?.functionPath??M}),(0,e.jsx)(u,{children:w?.table??M}),(0,e.jsx)(u,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:$||void 0,children:$||M})]},x.key)})})]})})})]}),t[5]=o,t[6]=d,t[7]=r,t[8]=s,t[9]=n,t[10]=b}else b=t[10];return b},"at");export{lt as default};
@@ -0,0 +1 @@
1
+ import{a,e as l,g as i,h as p,j as n}from"./chunk-UHHTEBC3.js";var c=l(i(),1);var d=l(p(),1);function f(r){let t=(0,c.c)(8),e,s;t[0]!==r?({className:e,...s}=r,t[0]=r,t[1]=e,t[2]=s):(e=t[1],s=t[2]);let o;t[3]!==e?(o=n("animate-pulse rounded-md bg-muted",e),t[3]=e,t[4]=o):o=t[4];let m;return t[5]!==s||t[6]!==o?(m=(0,d.jsx)("div",{"data-slot":"skeleton",className:o,...s}),t[5]=s,t[6]=o,t[7]=m):m=t[7],m}a(f,"p");export{f as a};