@lunora/studio 1.0.0-alpha.8 → 1.0.0-alpha.80

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 (305) hide show
  1. package/LICENSE.md +6 -0
  2. package/dist/index.d.ts +777 -780
  3. package/dist/index.js +1 -41
  4. package/dist/mount.d.ts +10 -10
  5. package/dist/mount.js +1 -26
  6. package/dist/packem_chunks/ApiTab.js +1 -0
  7. package/dist/packem_chunks/AuditPanel.js +1 -0
  8. package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
  9. package/dist/packem_chunks/ExportImportPanel.js +3 -0
  10. package/dist/packem_chunks/FileBrowser.js +4 -0
  11. package/dist/packem_chunks/FunctionRunner.js +1 -0
  12. package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
  13. package/dist/packem_chunks/HealthPanel.js +1 -0
  14. package/dist/packem_chunks/InsightsPanel.js +1 -0
  15. package/dist/packem_chunks/LogsPanel.js +1 -0
  16. package/dist/packem_chunks/MailPanel.js +2 -0
  17. package/dist/packem_chunks/MetricsPanel.js +1 -0
  18. package/dist/packem_chunks/NotificationsPanel.js +1 -0
  19. package/dist/packem_chunks/PitrPanel.js +1 -0
  20. package/dist/packem_chunks/SchemaViewer.js +1 -0
  21. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
  22. package/dist/packem_chunks/SettingsPanel.js +1 -0
  23. package/dist/packem_chunks/SqlEditorPanel.js +6 -0
  24. package/dist/packem_chunks/TableEditor.js +1 -0
  25. package/dist/packem_chunks/agents-panel.js +1 -0
  26. package/dist/packem_chunks/analytics-panel.js +1 -0
  27. package/dist/packem_chunks/auth-audit-panel.js +1 -0
  28. package/dist/packem_chunks/auth-config-panel.js +1 -0
  29. package/dist/packem_chunks/auth-sessions-panel.js +1 -0
  30. package/dist/packem_chunks/containers-panel.js +1 -0
  31. package/dist/packem_chunks/dashboards-panel.js +1 -0
  32. package/dist/packem_chunks/fanout-panel.js +1 -0
  33. package/dist/packem_chunks/flags-panel.js +1 -0
  34. package/dist/packem_chunks/issues-panel.js +1 -0
  35. package/dist/packem_chunks/kv-browser.js +1 -0
  36. package/dist/packem_chunks/log-drains-panel.js +4 -0
  37. package/dist/packem_chunks/migrations-route.js +1 -0
  38. package/dist/packem_chunks/organizations-panel.js +1 -0
  39. package/dist/packem_chunks/payments-panel.js +1 -0
  40. package/dist/packem_chunks/permissions-panel.js +1 -0
  41. package/dist/packem_chunks/queues-panel.js +1 -0
  42. package/dist/packem_chunks/rls-panel.js +1 -0
  43. package/dist/packem_chunks/schedule-panel.js +1 -0
  44. package/dist/packem_chunks/sparkline.js +1 -0
  45. package/dist/packem_chunks/storage-rules-panel.js +1 -0
  46. package/dist/packem_chunks/subscriptions-panel.js +1 -0
  47. package/dist/packem_chunks/sync-client-panel.js +1 -0
  48. package/dist/packem_chunks/traces-panel.js +1 -0
  49. package/dist/packem_chunks/users-panel.js +1 -0
  50. package/dist/packem_chunks/vector-browser.js +1 -0
  51. package/dist/packem_chunks/workflows-panel.js +1 -0
  52. package/dist/packem_shared/ADMIN_FUNCTIONS-BnD4aovm.js +1 -0
  53. package/dist/packem_shared/ApiDocsPanel-DfUQ1ZAF.js +2 -0
  54. package/dist/packem_shared/ApiReferencePanel-9q8BbJl-.js +1 -0
  55. package/dist/packem_shared/CommandPalette--SQwfTW1.js +1 -0
  56. package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
  57. package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
  58. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
  59. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
  60. package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
  61. package/dist/packem_shared/DataBrowser-CuRlztBz.js +1 -0
  62. package/dist/packem_shared/DataFilters-B26ZeqBZ.js +1 -0
  63. package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
  64. package/dist/packem_shared/GlobalDataBrowser-DB-vQ2_H.js +1 -0
  65. package/dist/packem_shared/HomePanel-Dcs4a3Ax.js +1 -0
  66. package/dist/packem_shared/MigrationsPanel-C2OnsqRb.js +1 -0
  67. package/dist/packem_shared/OpenRpcReferencePanel-qOZcWXMs.js +1 -0
  68. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
  69. package/dist/packem_shared/ScheduledJobs-D8kBZWBu.js +1 -0
  70. package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
  71. package/dist/packem_shared/Studio-B26_pT8J.js +1 -0
  72. package/dist/packem_shared/StudioApp-bXhJeLlZ.js +1 -0
  73. package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
  74. package/dist/packem_shared/advisor-view-Pa8HLtBv.js +1 -0
  75. package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
  76. package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
  77. package/dist/packem_shared/app.d-DW7yZsfu.d.ts +252 -0
  78. package/dist/packem_shared/badge-BbuuAio7.js +1 -0
  79. package/dist/packem_shared/bar-chart-DraN_srt.js +9 -0
  80. package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
  81. package/dist/packem_shared/button-BkCrNcAs.js +1 -0
  82. package/dist/packem_shared/card-CIDGUN6K.js +1 -0
  83. package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
  84. package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
  85. package/dist/packem_shared/data-grid-DcxyIXwG.js +1 -0
  86. package/dist/packem_shared/data-view-params-ClrV7XgF.js +1 -0
  87. package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
  88. package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
  89. package/dist/packem_shared/error-alert-t6cpEi0z.js +1 -0
  90. package/dist/packem_shared/grid-features-jnrD0SpX.js +6 -0
  91. package/dist/packem_shared/home-panel-CU6MWLHG.js +3 -0
  92. package/dist/packem_shared/input-JHu63lTv.js +1 -0
  93. package/dist/packem_shared/internal-BSIsQVC6.js +2 -0
  94. package/dist/packem_shared/label-6uP1obNF.js +1 -0
  95. package/dist/packem_shared/live-status-CmuRLFKf.js +1 -0
  96. package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
  97. package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
  98. package/dist/packem_shared/operation-console-provider-BMJNtiyB.js +1 -0
  99. package/dist/packem_shared/recording-client-DRAZEmzE.js +1 -0
  100. package/dist/packem_shared/reference-view-DnYYWr7I.js +12 -0
  101. package/dist/packem_shared/result-chart-DzJOVsaw.js +1 -0
  102. package/dist/packem_shared/schema-diagram-cg-bz_VL.js +2 -0
  103. package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
  104. package/dist/packem_shared/select-Bul-DeII.js +2 -0
  105. package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
  106. package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
  107. package/dist/packem_shared/sparkline-CgjeUU2I.js +1 -0
  108. package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
  109. package/dist/packem_shared/studio-q-C-acL7.js +2 -0
  110. package/dist/packem_shared/table-DdJBrClo.js +2 -0
  111. package/dist/packem_shared/table-list-sidebar-BFkSQwlB.js +1 -0
  112. package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
  113. package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
  114. package/dist/packem_shared/use-admin-query-QJ-ibl5u.js +1 -0
  115. package/dist/packem_shared/use-async-submit-q3ymBJkD.js +1 -0
  116. package/dist/packem_shared/use-auth-config-BObBpdsi.js +1 -0
  117. package/dist/packem_shared/use-sql-assistant-CHEu2-Rk.js +1 -0
  118. package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
  119. package/dist/packem_shared/utils-bhneXptQ.js +1 -0
  120. package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
  121. package/dist/standalone/chunk-2GA4SHO7.js +1 -0
  122. package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
  123. package/dist/standalone/chunk-2PJNAWB3.js +1 -0
  124. package/dist/standalone/chunk-2VDFV5TD.js +1 -0
  125. package/dist/standalone/chunk-2WOIRKEI.js +1 -0
  126. package/dist/standalone/chunk-33CL6OHR.js +1 -0
  127. package/dist/standalone/chunk-34D36UCW.js +1 -0
  128. package/dist/standalone/chunk-3C3CG7ZK.js +1 -0
  129. package/dist/standalone/chunk-3O3HAXW7.js +1 -0
  130. package/dist/standalone/chunk-3STOIE7Q.js +1 -0
  131. package/dist/standalone/chunk-3XIESWL4.js +1 -0
  132. package/dist/standalone/chunk-4UOFSGUS.js +1 -0
  133. package/dist/standalone/chunk-53WEPGUD.js +1 -0
  134. package/dist/standalone/chunk-54MMVNPT.js +1 -0
  135. package/dist/standalone/chunk-5CVJS7ON.js +1 -0
  136. package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
  137. package/dist/standalone/chunk-6IKEW5LG.js +1 -0
  138. package/dist/standalone/chunk-6LNCYDZO.js +1 -0
  139. package/dist/standalone/chunk-6NY7SPDL.js +1 -0
  140. package/dist/standalone/chunk-6PNPIW6I.js +2 -0
  141. package/dist/standalone/chunk-6ST5ECQA.js +1 -0
  142. package/dist/standalone/chunk-6VAKZALJ.js +1 -0
  143. package/dist/standalone/chunk-6YI4WJO4.js +1 -0
  144. package/dist/standalone/chunk-6YTSSIEJ.js +3 -0
  145. package/dist/standalone/chunk-7LWMHTJ3.js +1 -0
  146. package/dist/standalone/chunk-7QIFDWQV.js +1 -0
  147. package/dist/standalone/chunk-7T7UOTYK.js +1 -0
  148. package/dist/standalone/chunk-A74VSSA2.js +4 -0
  149. package/dist/standalone/chunk-AADILRJW.js +14 -0
  150. package/dist/standalone/chunk-AVAC26HJ.js +1 -0
  151. package/dist/standalone/chunk-BGBLQ563.js +1 -0
  152. package/dist/standalone/chunk-CCVXYYPJ.js +1 -0
  153. package/dist/standalone/chunk-CFPZYHPY.js +2 -0
  154. package/dist/standalone/chunk-CT5MMH4O.js +1 -0
  155. package/dist/standalone/chunk-CTNB2KIA.js +1 -0
  156. package/dist/standalone/chunk-CU55Y5TV.js +62 -0
  157. package/dist/standalone/chunk-D2RKH6JK.js +1 -0
  158. package/dist/standalone/chunk-E3NMX2VU.js +4 -0
  159. package/dist/standalone/chunk-EN2QAEO4.js +11 -0
  160. package/dist/standalone/chunk-ESVP44Y3.js +1 -0
  161. package/dist/standalone/chunk-FNPJ7GJZ.js +1 -0
  162. package/dist/standalone/chunk-FOBRNWBG.js +3 -0
  163. package/dist/standalone/chunk-FXCBF4XT.js +1 -0
  164. package/dist/standalone/chunk-G6PSMGLD.js +1 -0
  165. package/dist/standalone/chunk-GAX5IZYG.js +8 -0
  166. package/dist/standalone/chunk-GB6U2BPU.js +1 -0
  167. package/dist/standalone/chunk-GEDMLM4A.js +6 -0
  168. package/dist/standalone/chunk-GMR677FL.js +1 -0
  169. package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
  170. package/dist/standalone/chunk-GXSZH7VJ.js +13 -0
  171. package/dist/standalone/chunk-GYKVBKT5.js +1 -0
  172. package/dist/standalone/chunk-H6YOWRFB.js +1 -0
  173. package/dist/standalone/chunk-HJ3E4YF5.js +1 -0
  174. package/dist/standalone/chunk-HJD2YUQS.js +1 -0
  175. package/dist/standalone/chunk-HPFLBYRI.js +1 -0
  176. package/dist/standalone/chunk-IC4L6G56.js +1 -0
  177. package/dist/standalone/chunk-IHQC7J35.js +1 -0
  178. package/dist/standalone/chunk-ILNELDFC.js +1 -0
  179. package/dist/standalone/chunk-IVFHIQOT.js +1 -0
  180. package/dist/standalone/chunk-JLOWAJRR.js +1 -0
  181. package/dist/standalone/chunk-JN2Y24PY.js +1 -0
  182. package/dist/standalone/chunk-JRMMYIAF.js +1 -0
  183. package/dist/standalone/chunk-KC44QCN6.js +1 -0
  184. package/dist/standalone/chunk-KJB7YAKB.js +1 -0
  185. package/dist/standalone/chunk-KLQYC6CC.js +1 -0
  186. package/dist/standalone/chunk-KUVMORDQ.js +1 -0
  187. package/dist/standalone/chunk-KZ3ALMMP.js +1 -0
  188. package/dist/standalone/chunk-L7R74G63.js +1 -0
  189. package/dist/standalone/chunk-LEDWUPXM.js +1 -0
  190. package/dist/standalone/chunk-LFKCLLPT.js +1 -0
  191. package/dist/standalone/chunk-MIQTKZAR.js +1 -0
  192. package/dist/standalone/chunk-OG4N2XHD.js +19 -0
  193. package/dist/standalone/chunk-OY2RVUZL.js +1 -0
  194. package/dist/standalone/chunk-P4YLIBCN.js +1 -0
  195. package/dist/standalone/chunk-PZVU2QMX.js +1 -0
  196. package/dist/standalone/chunk-Q7O6B7WC.js +1 -0
  197. package/dist/standalone/chunk-QBWRC5YX.js +1 -0
  198. package/dist/standalone/chunk-QLQADHFE.js +1 -0
  199. package/dist/standalone/chunk-QWGT25SE.js +1 -0
  200. package/dist/standalone/chunk-QXXIJAD5.js +1 -0
  201. package/dist/standalone/chunk-QZGTH6WH.js +1 -0
  202. package/dist/standalone/chunk-RJP3WBZ4.js +1 -0
  203. package/dist/standalone/chunk-RNL6BSFM.js +1 -0
  204. package/dist/standalone/chunk-RNRJKBY3.js +4 -0
  205. package/dist/standalone/chunk-RQ7AFLIV.js +1 -0
  206. package/dist/standalone/chunk-S252DAFP.js +1 -0
  207. package/dist/standalone/chunk-S2VVR7HI.js +1 -0
  208. package/dist/standalone/chunk-SD4BERSA.js +1 -0
  209. package/dist/standalone/chunk-SFDOII3B.js +1 -0
  210. package/dist/standalone/chunk-SKHEGARW.js +1 -0
  211. package/dist/standalone/chunk-SKW6J4VW.js +1 -0
  212. package/dist/standalone/chunk-SMIESS7P.js +1 -0
  213. package/dist/standalone/chunk-T6VMSOBB.js +1 -0
  214. package/dist/standalone/chunk-T7IUZIF4.js +1 -0
  215. package/dist/standalone/chunk-THIXMMZD.js +1 -0
  216. package/dist/standalone/chunk-TTGOOYLF.js +1 -0
  217. package/dist/standalone/chunk-U6TNNM5U.js +1 -0
  218. package/dist/standalone/chunk-UZERI5YC.js +1 -0
  219. package/dist/standalone/chunk-V53KNYRN.js +1 -0
  220. package/dist/standalone/chunk-VHWOCPRK.js +1 -0
  221. package/dist/standalone/chunk-W6SAOXGH.js +6 -0
  222. package/dist/standalone/chunk-WBYSSCV2.js +1 -0
  223. package/dist/standalone/chunk-X665E2HU.js +1 -0
  224. package/dist/standalone/chunk-XBDKZZ67.js +1 -0
  225. package/dist/standalone/chunk-XDAT7LHC.js +1 -0
  226. package/dist/standalone/chunk-XQCVZAGU.js +1 -0
  227. package/dist/standalone/chunk-XS5LDR52.js +1 -0
  228. package/dist/standalone/chunk-XXQUMVWH.js +1 -0
  229. package/dist/standalone/chunk-Y5Y7DHFW.js +1 -0
  230. package/dist/standalone/chunk-YJYTMQJI.js +1 -0
  231. package/dist/standalone/chunk-Z2V42P7J.js +1 -0
  232. package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
  233. package/dist/standalone/studio.js +9 -356
  234. package/dist/styles.css +2 -2
  235. package/package.json +16 -14
  236. package/dist/packem_shared/ADMIN_FUNCTIONS-DjXgvJb6.js +0 -46
  237. package/dist/packem_shared/ApiDocsPanel-yVSGHK3H.js +0 -842
  238. package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
  239. package/dist/packem_shared/ApiTab-rwttyQ1-.js +0 -251
  240. package/dist/packem_shared/AuditPanel-BqXZAsu_.js +0 -212
  241. package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
  242. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  243. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  244. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  245. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  246. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  247. package/dist/packem_shared/DataBrowser-Ck_7QwNK.js +0 -4542
  248. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  249. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  250. package/dist/packem_shared/ExportImportPanel-Dq6rj0tI.js +0 -193
  251. package/dist/packem_shared/FileBrowser-0pCpdKPE.js +0 -2932
  252. package/dist/packem_shared/FunctionRunner-7NH3KcTg.js +0 -343
  253. package/dist/packem_shared/FunctionStatsPanel-Cn_EBpDy.js +0 -432
  254. package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
  255. package/dist/packem_shared/HealthPanel-CQ4LzVET.js +0 -640
  256. package/dist/packem_shared/HomePanel-CP0lN1eF.js +0 -1273
  257. package/dist/packem_shared/InsightsPanel-DzNtoz7k.js +0 -423
  258. package/dist/packem_shared/LogsPanel-C3W0mabf.js +0 -839
  259. package/dist/packem_shared/MailPanel-CoEfWkCh.js +0 -447
  260. package/dist/packem_shared/MetricsPanel-CujtUfpl.js +0 -1625
  261. package/dist/packem_shared/MigrationsPanel-RX5qIFSr.js +0 -246
  262. package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
  263. package/dist/packem_shared/PitrPanel-LJGNP_IX.js +0 -252
  264. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  265. package/dist/packem_shared/ScheduledJobs-CabfKbyM.js +0 -159
  266. package/dist/packem_shared/SchemaViewer-Bam6ylvw.js +0 -2512
  267. package/dist/packem_shared/SecurityAdvisorPanel-DHr_bI38.js +0 -79
  268. package/dist/packem_shared/SettingsPanel-CBXQpYQA.js +0 -176
  269. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  270. package/dist/packem_shared/SqlEditorPanel-D5wMIxcg.js +0 -13
  271. package/dist/packem_shared/Studio-DkgODWD3.js +0 -33
  272. package/dist/packem_shared/StudioApp-ColQCvC_.js +0 -657
  273. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  274. package/dist/packem_shared/TableEditor-B8K5nUna.js +0 -371
  275. package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
  276. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  277. package/dist/packem_shared/app.d-Nbhpihxv.d.ts +0 -300
  278. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  279. package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
  280. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  281. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  282. package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
  283. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  284. package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
  285. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  286. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  287. package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
  288. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  289. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  290. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  291. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  292. package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
  293. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  294. package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
  295. package/dist/packem_shared/sql-editor-panel-Smfl_FDF.js +0 -2562
  296. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  297. package/dist/packem_shared/studio-Be28OqIx.js +0 -10413
  298. package/dist/packem_shared/table-_RzNvy3R.js +0 -246
  299. package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
  300. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  301. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  302. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
  303. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  304. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  305. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{c as w}from"react/compiler-runtime";import{RouterProvider as Qt,createRootRoute as Jt,createRoute as kt,createBrowserHistory as Xt,createMemoryHistory as Yt,createRouter as Gt,useSearch as ea,useNavigate as _t,useRouterState as ta,Outlet as aa}from"@tanstack/react-router";import*as at from"react";import{useState as nt,useEffect as rt,use as yt,createContext as Lt,useSyncExternalStore as ra,lazy as X,Suspense as sa}from"react";import{c as A}from"./utils-bhneXptQ.js";import{jsx as s,jsxs as x,Fragment as Pt}from"react/jsx-runtime";import{ErrorBoundary as na}from"./ErrorBoundary-DvzYskH7.js";import{O as oa,u as ia}from"./operation-console-provider-BMJNtiyB.js";import{useT as G}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{LunoraError as $t}from"@lunora/errors";import{g as ot}from"./badge-BbuuAio7.js";import{u as At}from"./input-JHu63lTv.js";import{Popover as st}from"@base-ui/react/popover";import{Cancel01Icon as la,SidebarLeftIcon as da}from"@hugeicons/core-free-icons";import{HugeiconsIcon as Tt}from"@hugeicons/react";import{mergeProps as zt}from"@base-ui/react/merge-props";import{useRender as Et}from"@base-ui/react/use-render";import{cva as ca}from"class-variance-authority";import{u as Rt}from"./button-BkCrNcAs.js";import{Dialog as ae}from"@base-ui/react/dialog";import{Tooltip as te}from"@base-ui/react/tooltip";import{n as pt}from"./skeleton-C1wQ9M5t.js";import{H as ua,S as ha}from"./home-panel-CU6MWLHG.js";import{c as ma,f as bt}from"./internal-BSIsQVC6.js";import{y as ct}from"./use-admin-query-QJ-ibl5u.js";import{StudioI18nProvider as pa}from"./StudioI18nProvider-CZ5h4nrV.js";import{v as fa,a as ga}from"./data-view-params-ClrV7XgF.js";import{CommandPalette as ba,openCommandPalette as va}from"./CommandPalette--SQwfTW1.js";import{motion as ya}from"motion/react";const It="(prefers-color-scheme: dark)",Kt=()=>{try{return globalThis.localStorage}catch{return}},xa=t=>t==="system"||t==="light"||t==="dark",Vt=()=>globalThis.matchMedia,Zt="lunora-studio-theme",ft=["system","light","dark"],ka=(t="system")=>{try{const e=Kt()?.getItem(Zt);return xa(e)?e:t}catch{return t}},wt=t=>{const e=Kt();if(e!==void 0)try{e.setItem(Zt,t)}catch{}},wa=()=>{try{return Vt()?.(It).matches?"dark":"light"}catch{return"light"}},Na=(t,e)=>t==="system"?e:t,Sa=t=>{let e;try{e=Vt()?.(It)}catch{e=void 0}if(e===void 0)return()=>{};const a=r=>{t(r.matches?"dark":"light")};return e.addEventListener("change",a),()=>{e.removeEventListener("change",a)}},xt=Lt(null),Ma=({children:t,defaultTheme:e="system"})=>{const[a,r]=nt(()=>ka(e)),[n,o]=nt(()=>wa());rt(()=>Sa(o),[]);const i=d=>{wt(d),r(d)},l={cycleTheme:()=>{r(d=>{const u=ft[(ft.indexOf(d)+1)%ft.length]??d;return wt(u),u})},resolvedTheme:Na(a,n),setTheme:i,systemTheme:n,theme:a};return s(xt,{value:l,children:t})},Ca=t=>{const e=w(3),{children:a}=t,r=yt(xt);let n;return e[0]!==a||e[1]!==r?(n=r===null?s(Ma,{children:a}):a,e[0]=a,e[1]=r,e[2]=n):n=e[2],n},_a=()=>{const t=yt(xt);if(t===null)throw new $t("INTERNAL","useTheme must be used within a <ThemeProvider>");return t};function nn({delay:t=0,...e}){return s(te.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function La(t){const e=w(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(te.Root,{"data-slot":"tooltip",...a}),e[2]=a,e[3]=r):r=e[3],r}function Pa(t){const e=w(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(te.Trigger,{"data-slot":"tooltip-trigger",...a}),e[2]=a,e[3]=r):r=e[3],r}function $a({className:t,side:e="top",sideOffset:a=4,align:r="center",alignOffset:n=0,children:o,...i}){return s(te.Portal,{children:s(te.Positioner,{align:r,alignOffset:n,side:e,sideOffset:a,className:"isolate z-50",children:x(te.Popup,{"data-slot":"tooltip-content",className:A("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-md data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...i,children:[o,s(te.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-md bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const Aa=t=>{const e=w(5),{className:a}=t;let r;e[0]!==a?(r=A("h-full w-full text-foreground",a),e[0]=a,e[1]=r):r=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=s("path",{d:"M 259.500 10.552 C 220.080 15.859, 182.424 32.566, 152.500 58.025 C 110.179 94.031, 85.380 137.183, 77.518 188.500 C 75.410 202.255, 74.569 225.677, 75.796 236.466 C 76.757 244.917, 76.683 245.692, 74.518 249.966 C 63.118 272.466, 53.141 303.876, 51.382 322.799 L 50.718 329.943 71.960 320.471 C 83.643 315.262, 93.326 311, 93.478 311 C 93.630 311, 96.547 316.063, 99.959 322.250 C 103.371 328.438, 107.249 334.850, 108.577 336.500 L 110.990 339.500 110.981 336 C 110.977 334.075, 111.499 324.991, 112.143 315.813 L 113.312 299.127 121.406 293.336 C 132.495 285.403, 149.593 271.554, 161 261.268 C 171.556 251.748, 189.116 235, 188.540 235 C 188.337 235, 183.069 238.648, 176.835 243.106 C 142.318 267.789, 68.537 314, 63.646 314 C 61.843 314, 72.791 281.179, 80.905 262.259 C 92.233 235.845, 107.473 212.389, 132.106 183.453 L 138.451 176 148.268 176 C 176.192 176, 197.512 187.154, 212.868 209.797 C 216.470 215.108, 217.035 216.595, 216.477 219.297 C 211.386 243.968, 202.359 274.496, 193.797 296 C 183.898 320.861, 167.147 352.101, 152.395 373.215 L 147.004 380.930 152.891 385.830 C 161.400 392.911, 165.563 396, 166.594 395.998 C 167.092 395.998, 168.772 391.641, 170.327 386.317 C 176.279 365.934, 188.422 338.749, 200.942 317.778 C 223.060 280.731, 256.432 244.369, 294.500 215.836 C 309.956 204.252, 313.937 201.603, 314.719 202.385 C 315.116 202.783, 315.449 213.096, 315.460 225.304 C 315.474 241.855, 315.021 250.405, 313.680 258.924 C 307.009 301.272, 291.175 336.677, 263.112 372 C 255.259 381.883, 227.182 410.673, 218.516 417.727 L 213.532 421.783 223.439 424.880 C 281.705 443.093, 349.165 436.018, 398.616 406.508 C 446.728 377.797, 483.322 331.466, 497.366 281.481 C 503.381 260.075, 504.480 250.741, 504.491 221 C 504.501 191.997, 503.598 184.047, 497.987 163.732 C 484.768 115.871, 452.505 72.708, 407.718 42.964 C 381.051 25.254, 352.818 14.828, 319.695 10.460 C 305.932 8.645, 273.298 8.695, 259.500 10.552",fillRule:"evenodd"}),e[2]=n):n=e[2];let o;return e[3]!==r?(o=s("svg",{"aria-hidden":"true",className:r,fill:"currentColor",viewBox:"0 0 543 446",children:n}),e[3]=r,e[4]=o):o=e[4],o},Ht="lunora.studio.rulesBannerDismissed",Ta=()=>{try{return globalThis.localStorage.getItem(Ht)==="1"}catch{return!1}},za=()=>{try{globalThis.localStorage.setItem(Ht,"1")}catch{}},Ea=()=>{const t=w(18),e=G(),[a,r]=nt(Ra);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{r(!0),za()},t[0]=n):n=t[0];const o=n;if(a)return null;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),t[1]=i):i=t[1];let l;t[2]!==e?(l=e("Lunora AI rules aren't installed."),t[2]=e,t[3]=l):l=t[3];let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=s("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"}),t[4]=d):d=t[4];let u;t[5]!==e?(u=e("lets your coding agent use Lunora correctly."),t[5]=e,t[6]=u):u=t[6];let c;t[7]!==l||t[8]!==u?(c=x("span",{children:[l," ",d," ",u]}),t[7]=l,t[8]=u,t[9]=c):c=t[9];let p;t[10]!==e?(p=e("Dismiss"),t[10]=e,t[11]=p):p=t[11];let g;t[12]===Symbol.for("react.memo_cache_sentinel")?(g=s("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:s("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=g):g=t[12];let h;t[13]!==p?(h=s("button",{"aria-label":p,className:"ms-auto flex size-5 items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":"dash-app-rules-banner-dismiss",onClick:o,type:"button",children:g}),t[13]=p,t[14]=h):h=t[14];let f;return t[15]!==c||t[16]!==h?(f=x("div",{className:"flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-6 py-2 text-[12px] text-foreground","data-testid":"dash-app-rules-banner",role:"note",children:[i,c,h]}),t[15]=c,t[16]=h,t[17]=f):f=t[17],f};function Ra(){return Ta()}function Ot(t){const e=w(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(st.Root,{"data-slot":"popover",...a}),e[2]=a,e[3]=r):r=e[3],r}function qt(t){const e=w(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(st.Trigger,{"data-slot":"popover-trigger",...a}),e[2]=a,e[3]=r):r=e[3],r}function Bt({align:t="end",alignOffset:e=0,className:a,keepMounted:r=!1,side:n="bottom",sideOffset:o=6,...i}){return s(st.Portal,{keepMounted:r,children:s(st.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:n,sideOffset:o,children:s(st.Popup,{className:A("z-50 w-72 origin-(--transform-origin) rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-md outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",a),"data-slot":"popover-content",...i})})})}const gt=768;function Ia(){const t=w(2),[e,a]=nt(void 0);let r,n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=globalThis.matchMedia(`(max-width: ${gt-1}px)`),i=()=>{a(globalThis.innerWidth<gt)};return o.addEventListener("change",i),a(globalThis.innerWidth<gt),()=>{o.removeEventListener("change",i)}},n=[],t[0]=r,t[1]=n):(r=t[0],n=t[1]),rt(r,n),!!e}function Ka(t){const e=w(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(ae.Root,{"data-slot":"sheet",...a}),e[2]=a,e[3]=r):r=e[3],r}function Va(t){const e=w(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(ae.Portal,{"data-slot":"sheet-portal",...a}),e[2]=a,e[3]=r):r=e[3],r}function Za(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("fixed inset-0 z-50 bg-black/10 text-xs/relaxed transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s(ae.Backdrop,{"data-slot":"sheet-overlay",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function Ha({className:t,children:e,side:a="right",showCloseButton:r=!0,...n}){return x(Va,{children:[s(Za,{}),x(ae.Popup,{"data-slot":"sheet-content","data-side":a,className:A("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:data-ending-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-ending-style:-translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-starting-style:-translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:data-ending-style:translate-x-[2.5rem] rtl:data-[side=right]:data-ending-style:-translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] rtl:data-[side=right]:data-starting-style:-translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...n,children:[e,r&&x(ae.Close,{"data-slot":"sheet-close",render:s(Rt,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[s(Tt,{icon:la,strokeWidth:2}),s("span",{className:"sr-only",children:"Close"})]})]})]})}function Oa(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("flex flex-col gap-0.5 p-4",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sheet-header",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function qa(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("text-sm font-medium text-foreground",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s(ae.Title,{"data-slot":"sheet-title",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function Ba(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("text-xs/relaxed text-muted-foreground",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s(ae.Description,{"data-slot":"sheet-description",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}const Da="sidebar_state",Wa=3600*24*7,Fa="16rem",ja="18rem",Ua="3rem",Qa="b",Dt=at.createContext(null);function ut(){const t=at.useContext(Dt);if(!t)throw new $t("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}function Ja({defaultOpen:t=!0,open:e,onOpenChange:a,className:r,style:n,children:o,...i}){const l=Ia(),[d,u]=at.useState(!1),[c,p]=at.useState(t),g=e??c,h=m=>{const y=typeof m=="function"?m(g):m;a?a(y):p(y),document.cookie=`${Da}=${y}; path=/; max-age=${Wa}`},f=()=>l?u(m=>!m):h(m=>!m),v=at.useEffectEvent(()=>{f()});at.useEffect(()=>{const m=y=>{y.key===Qa&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),v())};return globalThis.addEventListener("keydown",m),()=>globalThis.removeEventListener("keydown",m)},[]);const b={state:g?"expanded":"collapsed",open:g,setOpen:h,isMobile:l,openMobile:d,setOpenMobile:u,toggleSidebar:f};return s(Dt.Provider,{value:b,children:s("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Fa,"--sidebar-width-icon":Ua,...n},className:A("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...i,children:o})})}function Xa({side:t="left",variant:e="sidebar",collapsible:a="offcanvas",className:r,children:n,dir:o,...i}){const{isMobile:l,state:d,openMobile:u,setOpenMobile:c}=ut();return a==="none"?s("div",{"data-slot":"sidebar",className:A("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...i,children:n}):l?s(Ka,{open:u,onOpenChange:c,...i,children:x(Ha,{dir:o,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":ja},side:t,children:[x(Oa,{className:"sr-only",children:[s(qa,{children:"Sidebar"}),s(Ba,{children:"Displays the mobile sidebar."})]}),s("div",{className:"flex h-full w-full flex-col",children:n})]})}):x("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?a:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[s("div",{"data-slot":"sidebar-gap",className:A("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),s("div",{"data-slot":"sidebar-container","data-side":t,className:A("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s",r),...i,children:s("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-none group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:n})})]})}function Ya(t){const e=w(15);let a,r,n;e[0]!==t?({className:a,onClick:r,...n}=t,e[0]=t,e[1]=a,e[2]=r,e[3]=n):(a=e[1],r=e[2],n=e[3]);const{toggleSidebar:o}=ut();let i;e[4]!==a?(i=A(a),e[4]=a,e[5]=i):i=e[5];let l;e[6]!==r||e[7]!==o?(l=p=>{r?.(p),o()},e[6]=r,e[7]=o,e[8]=l):l=e[8];let d,u;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s(Tt,{icon:da,strokeWidth:2,className:"rtl:rotate-180"}),u=s("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=d,e[10]=u):(d=e[9],u=e[10]);let c;return e[11]!==n||e[12]!==i||e[13]!==l?(c=x(Rt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:i,onClick:l,...n,children:[d,u]}),e[11]=n,e[12]=i,e[13]=l,e[14]=c):c=e[14],c}function Ga(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-none md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("main",{"data-slot":"sidebar-inset",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function er(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("flex flex-col gap-2 p-2",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function tr(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("flex flex-col gap-2 p-2",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function ar(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto [scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_25%,transparent)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/25 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5 hover:[scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_50%,transparent)_transparent] hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function rr(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("relative flex w-full min-w-0 flex-col p-2",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function sr(t){const e=w(10);let a,r,n,o;if(e[0]!==t){const{className:d,render:u,...c}=t;a=u,o=Et,r="div",n=zt({className:A("flex h-8 shrink-0 items-center rounded-none px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",d)},c),e[0]=t,e[1]=a,e[2]=r,e[3]=n,e[4]=o}else a=e[1],r=e[2],n=e[3],o=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i={slot:"sidebar-group-label",sidebar:"group-label"},e[5]=i):i=e[5];let l;return e[6]!==a||e[7]!==r||e[8]!==n?(l={defaultTagName:r,props:n,render:a,state:i},e[6]=a,e[7]=r,e[8]=n,e[9]=l):l=e[9],o(l)}function nr(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("w-full text-xs",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function Nt(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("flex w-full min-w-0 flex-col gap-0",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function St(t){const e=w(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=A("group/menu-item relative",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}const or=ca("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-none p-2 text-start text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Wt({render:t,isActive:e=!1,variant:a="default",size:r="default",tooltip:n,className:o,...i}){const{isMobile:l,state:d}=ut(),u=Et({defaultTagName:"button",props:zt({className:A(or({variant:a,size:r}),o)},i),render:n?s(Pa,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:e}});return n?(typeof n=="string"&&(n={children:n}),x(La,{children:[u,s($a,{side:"right",align:"center",hidden:d!=="collapsed"||l,...n})]})):u}const ir=t=>t.replace("__lunora_admin__:",""),lr=()=>ra(ct.subscribe,ct.getSnapshot,ct.getSnapshot),dr=t=>t==="error"?"destructive":t==="pending"?"secondary":"default",cr=t=>{const e=w(56),{entry:a,focused:r}=t,n=G();let o;e[0]!==r?(o=E=>{E!==null&&r&&E.scrollIntoView({block:"nearest"})},e[0]=r,e[1]=o):o=e[1];const i=o;let l;e[2]!==a.functionPath||e[3]!==a.shardKey||e[4]!==a.summary?(l=()=>{ma(`${a.functionPath} ${a.summary}${a.shardKey===""?"":` (shard ${a.shardKey})`}`)},e[2]=a.functionPath,e[3]=a.shardKey,e[4]=a.summary,e[5]=l):l=e[5];const d=l,u=r&&"bg-accent ring-1 ring-inset ring-primary/40";let c;e[6]!==u?(c=A("border-b border-border/60 last:border-b-0",u),e[6]=u,e[7]=c):c=e[7];let p;e[8]!==a.status?(p=dr(a.status),e[8]=a.status,e[9]=p):p=e[9];const g=a.status==="pending"?"…":a.status;let h;e[10]!==p||e[11]!==g?(h=s(ot,{className:"mt-px shrink-0",variant:p,children:g}),e[10]=p,e[11]=g,e[12]=h):h=e[12];let f;e[13]!==a.functionPath?(f=ir(a.functionPath),e[13]=a.functionPath,e[14]=f):f=e[14];let v;e[15]!==f?(v=s("span",{className:"shrink-0 font-mono text-[11px] text-foreground",children:f}),e[15]=f,e[16]=v):v=e[16];let b;e[17]!==a.kind||e[18]!==n?(b=a.kind==="subscription"&&s(ot,{className:"shrink-0",variant:"outline",children:n("live")}),e[17]=a.kind,e[18]=n,e[19]=b):b=e[19];let m;e[20]!==a.summary?(m=a.summary!==""&&s("span",{className:"min-w-0 truncate text-muted-foreground",children:a.summary}),e[20]=a.summary,e[21]=m):m=e[21];let y;e[22]!==a.shardKey?(y=a.shardKey!==""&&s("span",{className:"font-mono",children:a.shardKey}),e[22]=a.shardKey,e[23]=y):y=e[23];let k;e[24]!==a.resultCount||e[25]!==n?(k=a.resultCount!==void 0&&s("span",{children:n("{count} rows",{count:a.resultCount})}),e[24]=a.resultCount,e[25]=n,e[26]=k):k=e[26];let S;e[27]!==a.pushes||e[28]!==n?(S=a.pushes!==void 0&&a.pushes>0&&s("span",{children:n("{count} pushes",{count:a.pushes})}),e[27]=a.pushes,e[28]=n,e[29]=S):S=e[29];let _;e[30]!==a.durationMs?(_=a.durationMs!==void 0&&x("span",{children:[a.durationMs,"ms"]}),e[30]=a.durationMs,e[31]=_):_=e[31];let L;e[32]!==n?(L=n("Copy"),e[32]=n,e[33]=L):L=e[33];let N;e[34]!==d||e[35]!==L?(N=s("button",{"aria-label":L,className:"rounded px-1 outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-copy",onClick:d,type:"button",children:"⧉"}),e[34]=d,e[35]=L,e[36]=N):N=e[36];let P;e[37]!==y||e[38]!==k||e[39]!==S||e[40]!==_||e[41]!==N?(P=x("span",{className:"ms-auto flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[y,k,S,_,N]}),e[37]=y,e[38]=k,e[39]=S,e[40]=_,e[41]=N,e[42]=P):P=e[42];let M;e[43]!==b||e[44]!==m||e[45]!==P||e[46]!==h||e[47]!==v?(M=x("div",{className:"flex items-start gap-2 px-3 py-1.5 text-xs",children:[h,v,b,m,P]}),e[43]=b,e[44]=m,e[45]=P,e[46]=h,e[47]=v,e[48]=M):M=e[48];let $;e[49]!==a.error?($=a.error!==void 0&&s("p",{className:"px-3 pb-1.5 font-mono text-[11px] text-destructive","data-testid":"oc-error",children:a.error}),e[49]=a.error,e[50]=$):$=e[50];let T;return e[51]!==i||e[52]!==M||e[53]!==$||e[54]!==c?(T=x("li",{className:c,"data-testid":"oc-row",ref:i,children:[M,$]}),e[51]=i,e[52]=M,e[53]=$,e[54]=c,e[55]=T):T=e[55],T},ur=t=>{const e=w(62),{focusSeq:a,onClose:r,onShownChange:n,shown:o}=t,i=G(),l=lr(),[d,u]=nt("");let c;if(e[0]!==l||e[1]!==a||e[2]!==d||e[3]!==r||e[4]!==n||e[5]!==o||e[6]!==i){const p=d.trim().toLowerCase(),g=l.filter(z=>(o==="errors"?z.status==="error":!0)&&(p===""||`${z.functionPath} ${z.summary} ${z.shardKey}`.toLowerCase().includes(p))).toReversed();let h;e[8]!==l?(h=l.filter(hr),e[8]=l,e[9]=h):h=e[9];const f=h.length;let v;e[10]!==i?(v=i("Operation console"),e[10]=i,e[11]=v):v=e[11];let b;e[12]!==i?(b=i("Operation console"),e[12]=i,e[13]=b):b=e[13];let m;e[14]!==b?(m=s("span",{className:"text-xs font-medium",children:b}),e[14]=b,e[15]=m):m=e[15];let y;e[16]!==l.length||e[17]!==i?(y=i("{count} calls",{count:l.length}),e[16]=l.length,e[17]=i,e[18]=y):y=e[18];let k;e[19]!==y?(k=s(ot,{variant:"secondary",children:y}),e[19]=y,e[20]=k):k=e[20];let S;e[21]!==f||e[22]!==i?(S=f>0&&s(ot,{variant:"destructive",children:i("{count} failed",{count:f})}),e[21]=f,e[22]=i,e[23]=S):S=e[23];const _=o==="errors",L=o==="errors"&&"bg-accent";let N;e[24]!==L?(N=A("rounded px-2 py-0.5 text-xs outline-none hover:bg-accent focus-visible:bg-accent",L),e[24]=L,e[25]=N):N=e[25];let P;e[26]!==n||e[27]!==o?(P=()=>{n(o==="errors"?"all":"errors")},e[26]=n,e[27]=o,e[28]=P):P=e[28];let M;e[29]!==i?(M=i("Errors"),e[29]=i,e[30]=M):M=e[30];let $;e[31]!==N||e[32]!==P||e[33]!==M||e[34]!==_?($=s("button",{"aria-pressed":_,className:N,"data-testid":"oc-filter-errors",onClick:P,type:"button",children:M}),e[31]=N,e[32]=P,e[33]=M,e[34]=_,e[35]=$):$=e[35];let T;e[36]!==i?(T=i("Filter"),e[36]=i,e[37]=T):T=e[37];let E;e[38]===Symbol.for("react.memo_cache_sentinel")?(E=z=>{u(z.target.value)},e[38]=E):E=e[38];let K;e[39]!==i?(K=i("Filter"),e[39]=i,e[40]=K):K=e[40];let V;e[41]!==d||e[42]!==T||e[43]!==K?(V=s(At,{"aria-label":T,className:"h-7 w-40 text-xs","data-testid":"oc-search",onChange:E,placeholder:K,value:d}),e[41]=d,e[42]=T,e[43]=K,e[44]=V):V=e[44];let R;e[45]!==i?(R=i("Clear"),e[45]=i,e[46]=R):R=e[46];let I;e[47]!==R?(I=s("button",{className:"ms-auto rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-clear",onClick:mr,type:"button",children:R}),e[47]=R,e[48]=I):I=e[48];let Z;e[49]!==i?(Z=i("Hide"),e[49]=i,e[50]=Z):Z=e[50];let H;e[51]!==r||e[52]!==Z?(H=s("button",{"aria-label":Z,className:"rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-close",onClick:r,type:"button",children:"✕"}),e[51]=r,e[52]=Z,e[53]=H):H=e[53];let O;e[54]!==$||e[55]!==V||e[56]!==I||e[57]!==H||e[58]!==m||e[59]!==k||e[60]!==S?(O=x("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[m,k,S,$,V,I,H]}),e[54]=$,e[55]=V,e[56]=I,e[57]=H,e[58]=m,e[59]=k,e[60]=S,e[61]=O):O=e[61],c=x("section",{"aria-label":v,className:"flex max-h-80 flex-col border-t border-border bg-card","data-testid":"lunora-operation-console",children:[O,g.length===0?s("p",{className:"p-3 text-xs text-muted-foreground","data-testid":"oc-empty",children:i("Every admin call this studio makes is recorded here.")}):s("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"oc-rows",children:g.map(z=>s(cr,{entry:z,focused:z.seq===a},z.seq))})]}),e[0]=l,e[1]=a,e[2]=d,e[3]=r,e[4]=n,e[5]=o,e[6]=i,e[7]=c}else c=e[7];return c};function hr(t){return t.status==="error"}function mr(){ct.clear()}const pr=()=>{const t=w(298),e=G();let a;t[0]!==e?(a=e("Agents"),t[0]=e,t[1]=a):a=t[1];let r;t[2]!==e?(r=e("Analytics"),t[2]=e,t[3]=r):r=t[3];let n;t[4]!==e?(n=e("API"),t[4]=e,t[5]=n):n=t[5];let o;t[6]!==e?(o=e("Audit"),t[6]=e,t[7]=o):o=t[7];let i;t[8]!==e?(i=e("Auth audit"),t[8]=e,t[9]=i):i=t[9];let l;t[10]!==e?(l=e("Configuration"),t[10]=e,t[11]=l):l=t[11];let d;t[12]!==e?(d=e("Sessions"),t[12]=e,t[13]=d):d=t[13];let u;t[14]!==e?(u=e("Containers"),t[14]=e,t[15]=u):u=t[15];let c;t[16]!==e?(c=e("Dashboards"),t[16]=e,t[17]=c):c=t[17];let p;t[18]!==e?(p=e("Data"),t[18]=e,t[19]=p):p=t[19];let g;t[20]!==e?(g=e("Deployment health"),t[20]=e,t[21]=g):g=t[21];let h;t[22]!==e?(h=e("Log drains"),t[22]=e,t[23]=h):h=t[23];let f;t[24]!==e?(f=e("Export / Import"),t[24]=e,t[25]=f):f=t[25];let v;t[26]!==e?(v=e("Fan-out"),t[26]=e,t[27]=v):v=t[27];let b;t[28]!==e?(b=e("Files"),t[28]=e,t[29]=b):b=t[29];let m;t[30]!==e?(m=e("Flags"),t[30]=e,t[31]=m):m=t[31];let y;t[32]!==e?(y=e("Functions"),t[32]=e,t[33]=y):y=t[33];let k;t[34]!==e?(k=e("Health"),t[34]=e,t[35]=k):k=t[35];let S;t[36]!==e?(S=e("Home"),t[36]=e,t[37]=S):S=t[37];let _;t[38]!==e?(_=e("Performance"),t[38]=e,t[39]=_):_=t[39];let L;t[40]!==e?(L=e("Issues"),t[40]=e,t[41]=L):L=t[41];let N;t[42]!==e?(N=e("KV"),t[42]=e,t[43]=N):N=t[43];let P;t[44]!==e?(P=e("Logs"),t[44]=e,t[45]=P):P=t[45];let M;t[46]!==e?(M=e("Metrics"),t[46]=e,t[47]=M):M=t[47];let $;t[48]!==e?($=e("Migrations"),t[48]=e,t[49]=$):$=t[49];let T;t[50]!==e?(T=e("Notifications"),t[50]=e,t[51]=T):T=t[51];let E;t[52]!==e?(E=e("Organizations"),t[52]=e,t[53]=E):E=t[53];let K;t[54]!==e?(K=e("Time Travel"),t[54]=e,t[55]=K):K=t[55];let V;t[56]!==e?(V=e("Mail"),t[56]=e,t[57]=V):V=t[57];let R;t[58]!==e?(R=e("Payments"),t[58]=e,t[59]=R):R=t[59];let I;t[60]!==e?(I=e("Permissions"),t[60]=e,t[61]=I):I=t[61];let Z;t[62]!==e?(Z=e("Queues"),t[62]=e,t[63]=Z):Z=t[63];let H;t[64]!==e?(H=e("Realtime"),t[64]=e,t[65]=H):H=t[65];let O;t[66]!==e?(O=e("RLS Policies"),t[66]=e,t[67]=O):O=t[67];let z;t[68]!==e?(z=e("Scheduled"),t[68]=e,t[69]=z):z=t[69];let Y;t[70]!==e?(Y=e("Schema"),t[70]=e,t[71]=Y):Y=t[71];let B;t[72]!==e?(B=e("Security"),t[72]=e,t[73]=B):B=t[73];let Q;t[74]!==e?(Q=e("Settings"),t[74]=e,t[75]=Q):Q=t[75];let D;t[76]!==e?(D=e("SQL editor"),t[76]=e,t[77]=D):D=t[77];let W;t[78]!==e?(W=e("Traces"),t[78]=e,t[79]=W):W=t[79];let F;t[80]!==e?(F=e("Access Rules"),t[80]=e,t[81]=F):F=t[81];let j;t[82]!==e?(j=e("Users"),t[82]=e,t[83]=j):j=t[83];let U;t[84]!==e?(U=e("Vectors"),t[84]=e,t[85]=U):U=t[85];let J;t[86]!==e?(J=e("Workflows"),t[86]=e,t[87]=J):J=t[87];let q;t[88]!==a||t[89]!==r||t[90]!==g||t[91]!==h||t[92]!==f||t[93]!==v||t[94]!==b||t[95]!==m||t[96]!==y||t[97]!==k||t[98]!==S||t[99]!==_||t[100]!==n||t[101]!==L||t[102]!==N||t[103]!==P||t[104]!==M||t[105]!==$||t[106]!==T||t[107]!==E||t[108]!==K||t[109]!==V||t[110]!==R||t[111]!==o||t[112]!==I||t[113]!==Z||t[114]!==H||t[115]!==O||t[116]!==z||t[117]!==Y||t[118]!==B||t[119]!==Q||t[120]!==D||t[121]!==W||t[122]!==i||t[123]!==F||t[124]!==j||t[125]!==U||t[126]!==J||t[127]!==l||t[128]!==d||t[129]!==u||t[130]!==c||t[131]!==p?(q={agents:a,analytics:r,api:n,audit:o,authAudit:i,authConfig:l,authSessions:d,containers:u,dashboards:c,data:p,deploymentHealth:g,drains:h,export:f,fanout:v,files:b,flags:m,functions:y,health:k,home:S,insights:_,issues:L,kv:N,logs:P,metrics:M,migrations:$,notifications:T,organizations:E,pitr:K,mail:V,payments:R,permissions:I,queues:Z,realtime:H,rls:O,schedule:z,schema:Y,security:B,settings:Q,sql:D,traces:W,storageRules:F,users:j,vectors:U,workflows:J},t[88]=a,t[89]=r,t[90]=g,t[91]=h,t[92]=f,t[93]=v,t[94]=b,t[95]=m,t[96]=y,t[97]=k,t[98]=S,t[99]=_,t[100]=n,t[101]=L,t[102]=N,t[103]=P,t[104]=M,t[105]=$,t[106]=T,t[107]=E,t[108]=K,t[109]=V,t[110]=R,t[111]=o,t[112]=I,t[113]=Z,t[114]=H,t[115]=O,t[116]=z,t[117]=Y,t[118]=B,t[119]=Q,t[120]=D,t[121]=W,t[122]=i,t[123]=F,t[124]=j,t[125]=U,t[126]=J,t[127]=l,t[128]=d,t[129]=u,t[130]=c,t[131]=p,t[132]=q):q=t[132];const ee=q;let re;t[133]!==e?(re=e("Advisors"),t[133]=e,t[134]=re):re=t[134];let se;t[135]!==e?(se=e("Auth"),t[135]=e,t[136]=se):se=t[136];let ne;t[137]!==e?(ne=e("Database"),t[137]=e,t[138]=ne):ne=t[138];let oe;t[139]!==e?(oe=e("Functions"),t[139]=e,t[140]=oe):oe=t[140];let ie;t[141]!==e?(ie=e("Observability"),t[141]=e,t[142]=ie):ie=t[142];let le;t[143]!==e?(le=e("Operations"),t[143]=e,t[144]=le):le=t[144];let de;t[145]!==e?(de=e("Overview"),t[145]=e,t[146]=de):de=t[146];let ce;t[147]!==e?(ce=e("Settings"),t[147]=e,t[148]=ce):ce=t[148];let ue;t[149]!==e?(ue=e("Storage"),t[149]=e,t[150]=ue):ue=t[150];let it;t[151]!==re||t[152]!==se||t[153]!==ne||t[154]!==oe||t[155]!==ie||t[156]!==le||t[157]!==de||t[158]!==ce||t[159]!==ue?(it={advisors:re,auth:se,database:ne,functions:oe,observability:ie,operations:le,overview:de,settings:ce,storage:ue},t[151]=re,t[152]=se,t[153]=ne,t[154]=oe,t[155]=ie,t[156]=le,t[157]=de,t[158]=ce,t[159]=ue,t[160]=it):it=t[160];const ht=it;let he;t[161]!==e?(he=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[161]=e,t[162]=he):he=t[162];let me;t[163]!==e?(me=e("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards."),t[163]=e,t[164]=me):me=t[164];let pe;t[165]!==e?(pe=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[165]=e,t[166]=pe):pe=t[166];let fe;t[167]!==e?(fe=e("A durable log of admin state-changing operations."),t[167]=e,t[168]=fe):fe=t[168];let ge;t[169]!==e?(ge=e("Authentication and security events — sign-ins, MFA, and session changes."),t[169]=e,t[170]=ge):ge=t[170];let be;t[171]!==e?(be=e("Enabled plugins and session config (read-only)."),t[171]=e,t[172]=be):be=t[172];let ve;t[173]!==e?(ve=e("Browse and revoke active sessions across all users."),t[173]=e,t[174]=ve):ve=t[174];let ye;t[175]!==e?(ye=e("Live Cloudflare Containers — current lifecycle state per instance from the log stream."),t[175]=e,t[176]=ye):ye=t[176];let xe;t[177]!==e?(xe=e("Chart widgets backed by saved read-only SQL queries."),t[177]=e,t[178]=xe):xe=t[178];let ke;t[179]!==e?(ke=e("Browse and edit rows across your shard and global tables."),t[179]=e,t[180]=ke):ke=t[180];let we;t[181]!==e?(we=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[181]=e,t[182]=we):we=t[182];let Ne;t[183]!==e?(Ne=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[183]=e,t[184]=Ne):Ne=t[184];let Se;t[185]!==e?(Se=e("Export a shard to NDJSON, or import rows from it."),t[185]=e,t[186]=Se):Se=t[186];let Me;t[187]!==e?(Me=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[187]=e,t[188]=Me):Me=t[188];let Ce;t[189]!==e?(Ce=e("Browse objects in your R2 storage buckets."),t[189]=e,t[190]=Ce):Ce=t[190];let _e;t[191]!==e?(_e=e("Inspect feature flags and their live evaluation under a targeting context."),t[191]=e,t[192]=_e):_e=t[192];let Le;t[193]!==e?(Le=e("Run registered queries, mutations, and actions."),t[193]=e,t[194]=Le):Le=t[194];let Pe;t[195]!==e?(Pe=e("At-a-glance connection, error, and shard signals."),t[195]=e,t[196]=Pe):Pe=t[196];let $e;t[197]!==e?($e=e("Connection, health, and advisor summary for your deployment."),t[197]=e,t[198]=$e):$e=t[198];let Ae;t[199]!==e?(Ae=e("Surface slow functions, error spikes, and cache problems."),t[199]=e,t[200]=Ae):Ae=t[200];let Te;t[201]!==e?(Te=e("Grouped error triage — Worker throws and container crashes folded by fingerprint."),t[201]=e,t[202]=Te):Te=t[202];let ze;t[203]!==e?(ze=e("A live stream of recent function logs."),t[203]=e,t[204]=ze):ze=t[204];let Ee;t[205]!==e?(Ee=e("Per-shard health and aggregate metrics."),t[205]=e,t[206]=Ee):Ee=t[206];let Re;t[207]!==e?(Re=e("Review migration status and run them."),t[207]=e,t[208]=Re):Re=t[208];let Ie;t[209]!==e?(Ie=e("Registered push devices — endpoint, kind, last-send status, and delivery errors."),t[209]=e,t[210]=Ie):Ie=t[210];let Ke;t[211]!==e?(Ke=e("Browse and manage organizations, members, and invitations."),t[211]=e,t[212]=Ke):Ke=t[212];let Ve;t[213]!==e?(Ve=e("Restore a shard to a point in the last 30 days."),t[213]=e,t[214]=Ve):Ve=t[214];let Ze;t[215]!==e?(Ze=e("Email your app sent, captured in dev."),t[215]=e,t[216]=Ze):Ze=t[216];let He;t[217]!==e?(He=e("Synced customers, subscriptions, and webhook events."),t[217]=e,t[218]=He):He=t[218];let Oe;t[219]!==e?(Oe=e("Inspect access policies per table, and probe a function as any identity."),t[219]=e,t[220]=Oe):Oe=t[220];let qe;t[221]!==e?(qe=e("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue."),t[221]=e,t[222]=qe):qe=t[222];let Be;t[223]!==e?(Be=e("Active WebSocket subscriptions on this shard."),t[223]=e,t[224]=Be):Be=t[224];let De;t[225]!==e?(De=e("Inspect row-level-security policies and roles, per table."),t[225]=e,t[226]=De):De=t[226];let We;t[227]!==e?(We=e("Inspect and cancel scheduled jobs."),t[227]=e,t[228]=We):We=t[228];let Fe;t[229]!==e?(Fe=e("Inspect each table and its columns."),t[229]=e,t[230]=Fe):Fe=t[230];let je;t[231]!==e?(je=e("Review admin gates, credentials, and log redaction."),t[231]=e,t[232]=je):je=t[232];let Ue;t[233]!==e?(Ue=e("Read-only deployment config — vars, secrets, and bindings."),t[233]=e,t[234]=Ue):Ue=t[234];let Qe;t[235]!==e?(Qe=e("Run read-only SQL against a shard."),t[235]=e,t[236]=Qe):Qe=t[236];let Je;t[237]!==e?(Je=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[237]=e,t[238]=Je):Je=t[238];let Xe;t[239]!==e?(Xe=e("Inspect storage access rules — per bucket, operation, and key prefix."),t[239]=e,t[240]=Xe):Xe=t[240];let Ye;t[241]!==e?(Ye=e("Recent ctx.trace waterfalls for this shard — the drill-down from a log line."),t[241]=e,t[242]=Ye):Ye=t[242];let Ge;t[243]!==e?(Ge=e("Manage auth users — roles, bans, sessions, and identity."),t[243]=e,t[244]=Ge):Ge=t[244];let et;t[245]!==e?(et=e("Browse Vectorize indexes and run similarity searches."),t[245]=e,t[246]=et):et=t[246];let tt;t[247]!==e?(tt=e("Inspect declared Cloudflare Workflows and their bindings."),t[247]=e,t[248]=tt):tt=t[248];let lt;t[249]!==he||t[250]!==me||t[251]!==pe||t[252]!==fe||t[253]!==ge||t[254]!==be||t[255]!==ve||t[256]!==ye||t[257]!==xe||t[258]!==ke||t[259]!==we||t[260]!==Ne||t[261]!==Se||t[262]!==Me||t[263]!==Ce||t[264]!==_e||t[265]!==Le||t[266]!==Pe||t[267]!==$e||t[268]!==Ae||t[269]!==Te||t[270]!==ze||t[271]!==Ee||t[272]!==Re||t[273]!==Ie||t[274]!==Ke||t[275]!==Ve||t[276]!==Ze||t[277]!==He||t[278]!==Oe||t[279]!==qe||t[280]!==Be||t[281]!==De||t[282]!==We||t[283]!==Fe||t[284]!==je||t[285]!==Ue||t[286]!==Qe||t[287]!==Je||t[288]!==Xe||t[289]!==Ye||t[290]!==Ge||t[291]!==et||t[292]!==tt?(lt={agents:he,analytics:me,api:pe,audit:fe,authAudit:ge,authConfig:be,authSessions:ve,containers:ye,dashboards:xe,data:ke,deploymentHealth:we,drains:Ne,export:Se,fanout:Me,files:Ce,flags:_e,functions:Le,health:Pe,home:$e,insights:Ae,issues:Te,logs:ze,metrics:Ee,migrations:Re,notifications:Ie,organizations:Ke,pitr:Ve,mail:Ze,payments:He,permissions:Oe,queues:qe,realtime:Be,rls:De,schedule:We,schema:Fe,security:je,settings:Ue,sql:Qe,kv:Je,storageRules:Xe,traces:Ye,users:Ge,vectors:et,workflows:tt},t[249]=he,t[250]=me,t[251]=pe,t[252]=fe,t[253]=ge,t[254]=be,t[255]=ve,t[256]=ye,t[257]=xe,t[258]=ke,t[259]=we,t[260]=Ne,t[261]=Se,t[262]=Me,t[263]=Ce,t[264]=_e,t[265]=Le,t[266]=Pe,t[267]=$e,t[268]=Ae,t[269]=Te,t[270]=ze,t[271]=Ee,t[272]=Re,t[273]=Ie,t[274]=Ke,t[275]=Ve,t[276]=Ze,t[277]=He,t[278]=Oe,t[279]=qe,t[280]=Be,t[281]=De,t[282]=We,t[283]=Fe,t[284]=je,t[285]=Ue,t[286]=Qe,t[287]=Je,t[288]=Xe,t[289]=Ye,t[290]=Ge,t[291]=et,t[292]=tt,t[293]=lt):lt=t[293];const mt=lt;let dt;return t[294]!==ht||t[295]!==mt||t[296]!==ee?(dt={groupLabel:ht,tabDescription:mt,tabLabel:ee},t[294]=ht,t[295]=mt,t[296]=ee,t[297]=dt):dt=t[297],dt},fr=()=>{const t=w(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[s("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),s("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},gr=()=>{const t=w(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[s("circle",{cx:"12",cy:"12",r:"4"}),s("path",{d:"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),t[0]=e):e=t[0],e},br=()=>{const t=w(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:s("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),t[0]=e):e=t[0],e},vr=[{Icon:fr,value:"system"},{Icon:gr,value:"light"},{Icon:br,value:"dark"}],yr=()=>{const t=w(19),{theme:e,setTheme:a}=_a(),r=G();let n;t[0]!==r?(n=r("Dark theme"),t[0]=r,t[1]=n):n=t[1];let o;t[2]!==r?(o=r("Light theme"),t[2]=r,t[3]=o):o=t[3];let i;t[4]!==r?(i=r("System theme"),t[4]=r,t[5]=i):i=t[5];let l;t[6]!==n||t[7]!==o||t[8]!==i?(l={dark:n,light:o,system:i},t[6]=n,t[7]=o,t[8]=i,t[9]=l):l=t[9];const d=l;let u;t[10]!==r?(u=r("Theme"),t[10]=r,t[11]=u):u=t[11];let c;t[12]!==d||t[13]!==a||t[14]!==e?(c=vr.map(g=>{const{Icon:h,value:f}=g,v=e===f;return x("button",{"aria-checked":v,"aria-label":d[f],className:A("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",v?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${f}`,onClick:()=>{a(f)},role:"radio",title:d[f],type:"button",children:[v&&s(ya.span,{className:"absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",layoutId:"studio-theme-active",transition:{bounce:.1,duration:.45,type:"spring"}}),s("span",{className:"relative",children:s(h,{})})]},f)}),t[12]=d,t[13]=a,t[14]=e,t[15]=c):c=t[15];let p;return t[16]!==u||t[17]!==c?(p=s("div",{"aria-label":u,className:"inline-flex items-center gap-0.5 overflow-hidden rounded-md border border-border bg-muted/60 p-0.5","data-testid":"dash-app-theme",role:"radiogroup",children:c}),t[16]=u,t[17]=c,t[18]=p):p=t[18],p},xr=t=>{const e=w(23),{domain:a,onOpenCommandPalette:r,page:n}=t,o=G();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s(Ya,{className:"-ms-1"}),e[0]=i):i=e[0];let l;e[1]!==o?(l=o("Breadcrumb"),e[1]=o,e[2]=l):l=e[2];let d;e[3]!==a?(d=s("span",{className:"text-muted-foreground",children:a}),e[3]=a,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s("svg",{"aria-hidden":"true",className:"size-3.5 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:s("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),e[5]=u):u=e[5];let c;e[6]!==n?(c=s("span",{className:"font-medium text-foreground",children:n}),e[6]=n,e[7]=c):c=e[7];let p;e[8]!==l||e[9]!==d||e[10]!==c?(p=x("nav",{"aria-label":l,className:"flex items-center gap-1.5 text-[13px]",children:[d,u,c]}),e[8]=l,e[9]=d,e[10]=c,e[11]=p):p=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=x("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[s("circle",{cx:"11",cy:"11",r:"7"}),s("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[12]=g):g=e[12];let h;e[13]!==o?(h=o("Search…"),e[13]=o,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"⌘K"}),e[15]=f):f=e[15];let v;e[16]!==r||e[17]!==h?(v=x("button",{className:"mx-auto hidden h-8 w-72 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted md:flex","data-testid":"dash-app-search",onClick:r,type:"button",children:[g,h,f]}),e[16]=r,e[17]=h,e[18]=v):v=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:s(yr,{})}),e[19]=b):b=e[19];let m;return e[20]!==v||e[21]!==p?(m=x("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[i,p,v,b]}),e[20]=v,e[21]=p,e[22]=m):m=e[22],m},kr=t=>{const e=w(3);let a,r;e[0]!==t?(a=()=>{if(t===void 0)return;const n=o=>{if(!o.ctrlKey||o.metaKey||o.altKey||o.shiftKey||o.repeat||o.key!=="`")return;const{target:i}=o;i instanceof HTMLElement&&(i.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(i.tagName))||(o.preventDefault(),t())};return globalThis.addEventListener("keydown",n),()=>{globalThis.removeEventListener("keydown",n)}},r=[t],e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]),rt(a,r)},C=(t,e)=>X(()=>t().then(a=>({default:a[e]}))),wr=C(()=>import("../packem_chunks/InsightsPanel.js"),"InsightsPanel"),Nr=X(()=>import("../packem_chunks/rls-panel.js")),Sr=X(()=>import("../packem_chunks/SecurityAdvisorPanel.js")),Mr=C(()=>import("../packem_chunks/agents-panel.js"),"AgentsPanel"),Cr=C(()=>import("../packem_chunks/analytics-panel.js"),"AnalyticsPanel"),_r=X(()=>import("../packem_chunks/ApiTab.js")),Lr=C(()=>import("../packem_chunks/auth-audit-panel.js"),"AuthAuditPanel"),Pr=C(()=>import("../packem_chunks/auth-config-panel.js"),"AuthConfigPanel"),$r=C(()=>import("../packem_chunks/auth-sessions-panel.js"),"AuthSessionsPanel"),Ar=C(()=>import("../packem_chunks/organizations-panel.js"),"OrganizationsPanel"),Tr=C(()=>import("../packem_chunks/users-panel.js"),"UsersPanel"),zr=C(()=>import("../packem_chunks/containers-panel.js"),"ContainersPanel"),Er=C(()=>import("../packem_chunks/DeploymentHealthPanel.js"),"DeploymentHealthPanel"),Rr=C(()=>import("../packem_chunks/TableEditor.js"),"TableEditor"),Ir=C(()=>import("../packem_chunks/ExportImportPanel.js"),"ExportImportPanel"),Kr=C(()=>import("../packem_chunks/migrations-route.js"),"MigrationsRoutePanel"),Vr={data:ga,migrations:fa},Zr=C(()=>import("../packem_chunks/PitrPanel.js"),"PitrPanel"),Hr=C(()=>import("../packem_chunks/flags-panel.js"),"FlagsPanel"),Or=C(()=>import("../packem_chunks/FunctionRunner.js"),"FunctionRunner"),qr=C(()=>import("../packem_chunks/FunctionStatsPanel.js"),"FunctionStatsPanel"),Br=C(()=>import("../packem_chunks/issues-panel.js"),"IssuesPanel"),Dr=C(()=>import("../packem_chunks/AuditPanel.js"),"AuditPanel"),Wr=C(()=>import("../packem_chunks/log-drains-panel.js"),"LogDrainsPanel"),Fr=X(()=>import("../packem_chunks/LogsPanel.js").then(t=>({default:t.LogsPanel}))),jr=C(()=>import("../packem_chunks/MailPanel.js"),"MailPanel"),Ur=C(()=>import("../packem_chunks/schedule-panel.js"),"SchedulePanel"),Qr=X(()=>import("../packem_chunks/subscriptions-panel.js")),Jr=X(()=>import("../packem_chunks/sync-client-panel.js")),Xr=C(()=>import("../packem_chunks/kv-browser.js"),"KvBrowser"),Yr=C(()=>import("../packem_chunks/NotificationsPanel.js"),"NotificationsPanel"),Gr=C(()=>import("../packem_chunks/payments-panel.js"),"PaymentsPanel"),es=C(()=>import("../packem_chunks/permissions-panel.js"),"PermissionsPanel"),ts=X(()=>import("../packem_chunks/queues-panel.js")),as=X(()=>import("../packem_chunks/dashboards-panel.js")),rs=X(()=>import("../packem_chunks/fanout-panel.js")),ss=C(()=>import("../packem_chunks/HealthPanel.js"),"HealthPanel"),ns=C(()=>import("../packem_chunks/MetricsPanel.js"),"MetricsPanel"),os=C(()=>import("../packem_chunks/SchemaViewer.js"),"SchemaViewer"),is=C(()=>import("../packem_chunks/SettingsPanel.js"),"SettingsPanel"),ls=C(()=>import("../packem_chunks/SqlEditorPanel.js"),"SqlEditorPanel"),ds=C(()=>import("../packem_chunks/FileBrowser.js"),"FileBrowser"),cs=C(()=>import("../packem_chunks/storage-rules-panel.js"),"StorageRulesPanel"),us=C(()=>import("../packem_chunks/traces-panel.js"),"TracesPanel"),hs=C(()=>import("../packem_chunks/vector-browser.js"),"VectorBrowser"),ms=X(()=>import("../packem_chunks/workflows-panel.js")),Ft=Lt(null),ps={analytics:s("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:s("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),audit:s("path",{d:"M7 4h7l4 4v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm6 0v5h5M9 13h6M9 16h6M9 10h2"}),authAudit:s("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8h6m-6 3h6"}),authConfig:s("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6h-3.6l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),agents:s("path",{d:"M12 8V5m0 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM6 8h12a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Zm3 5h.01M15 13h.01M9 21h6"}),authSessions:s("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:s("path",{d:"M3 7.5 12 3l9 4.5v9L12 21l-9-4.5v-9Zm0 0 9 4.5m0 0 9-4.5m-9 4.5V21"}),dashboards:s("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:s("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2 3 4-5"}),drains:s("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:s("path",{d:"M5 6c0-1.4 3.1-2.5 7-2.5s7 1.1 7 2.5-3.1 2.5-7 2.5S5 7.4 5 6Zm0 0v12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V6M5 12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5"}),export:s("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"}),fanout:s("path",{d:"M12 5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm-7 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm14 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 7v3.5M12 10.5 6 17m6-6.5 6 6.5"}),files:s("path",{d:"M4 7a2 2 0 0 1 2-2h3l2 2.5h7a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7Z"}),flags:s("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:s("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),health:s("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:s("path",{d:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"}),insights:s("path",{d:"M12 3a6 6 0 0 0-3.6 10.8c.5.4.8.9.9 1.5l.2 1.2h5l.2-1.2c.1-.6.4-1.1.9-1.5A6 6 0 0 0 12 3ZM9.5 20.5h5M10 18h4"}),issues:s("path",{d:"M10.3 4.3 2.5 18a2 2 0 0 0 1.7 3h15.6a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0ZM12 9v4m0 3v.01"}),kv:s("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:s("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:s("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:s("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:s("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:s("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"}),notifications:s("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"}),organizations:s("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:s("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2.2 2.2L15 9.5M8.5 16h7"}),pitr:s("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),queues:s("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),realtime:s("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"}),rls:s("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3ZM8.5 10h7M8.5 13h7"}),schedule:s("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:s("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:s("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:s("path",{d:"M7 10V7a5 5 0 0 1 10 0v3m-11 0h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1Zm6 4v2"}),security:s("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-2.5 8.5 2 2 4-4"}),traces:s("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:s("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6H10.5l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),users:s("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.85M16 3.13A4 4 0 0 1 16 11"}),vectors:s("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:s("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},Mt=[{key:"overview",tabs:["home","dashboards"]},{key:"database",tabs:["data","sql","schema","migrations","vectors","pitr","export"]},{key:"functions",tabs:["functions","api","workflows","agents","queues"]},{key:"auth",tabs:["users","organizations","authSessions","authAudit","authConfig"]},{key:"storage",tabs:["files","storageRules","kv"]},{key:"observability",tabs:["issues","logs","traces","audit","realtime","fanout","containers","metrics","analytics","health","deploymentHealth"]},{key:"advisors",tabs:["security","rls","permissions","insights"]},{key:"operations",tabs:["schedule","mail","drains","notifications","payments","flags"]},{key:"settings",tabs:["settings"]}],fs={analytics:"analytics",authAudit:"auth",authConfig:"auth",authSessions:"auth",containers:"containers",files:"storage",flags:"flags",kv:"kv",mail:"mail",notifications:"notifications",organizations:"auth",payments:"payments",queues:"queues",schedule:"scheduler",storageRules:"storage",users:"auth",vectors:"vectors",workflows:"workflows"},Ct=(t,e)=>{const a=fs[t];return a===void 0||e[a]},vt=t=>{const e=w(2),{tab:a}=t,r=ps[a];let n;return e[0]!==r?(n=s("svg",{"aria-hidden":"true",className:"size-4 shrink-0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:r}),e[0]=r,e[1]=n):n=e[1],n},gs=t=>t,jt=gs(["home","data","sql","functions","api","workflows","agents","queues","containers","schema","migrations","vectors","export","pitr","users","organizations","authSessions","authAudit","authConfig","files","storageRules","kv","dashboards","metrics","analytics","health","deploymentHealth","security","rls","permissions","insights","issues","logs","traces","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","settings"]),bs=new Set(["api","data","migrations","sql"]),vs=t=>{const e=t.split("/").findLast(Boolean)??"";return jt.includes(e)?e:"home"},ys=t=>{const e=w(19),{chrome:a,connected:r}=t,n=G();let o;e[0]!==n?(o=n("admin token"),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==o?(i=s("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:o}),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==a.onTokenChange||e[5]!==a.token?(l=s(At,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:a.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:a.token}),e[4]=a.onTokenChange,e[5]=a.token,e[6]=l):l=e[6];let d;e[7]!==r||e[8]!==n?(d=r&&x("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[s("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),n("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=r,e[8]=n,e[9]=d):d=e[9];let u;e[10]!==a.clearToken||e[11]!==r||e[12]!==n?(u=r&&s("button",{className:"self-start rounded-md border border-border px-2.5 py-1 text-xs font-medium outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"dash-app-clear-token",onClick:a.clearToken,type:"button",children:n("Clear")}),e[10]=a.clearToken,e[11]=r,e[12]=n,e[13]=u):u=e[13];let c;return e[14]!==i||e[15]!==l||e[16]!==d||e[17]!==u?(c=x("div",{className:"flex flex-col gap-2",children:[i,l,d,u]}),e[14]=i,e[15]=l,e[16]=d,e[17]=u,e[18]=c):c=e[18],c},xs=t=>{const e=w(25),{current:a,group:r,groupLabel:n,selectTab:o,tabDescription:i,tabLabel:l}=t,d=r.tabs.includes(a)?"page":void 0,u=n[r.key],c=r.tabs[0];let p;e[0]!==c?(p=s(vt,{tab:c}),e[0]=c,e[1]=p):p=e[1];let g;e[2]!==d||e[3]!==u||e[4]!==p?(g=s(qt,{"aria-current":d,"aria-label":u,className:"mx-auto flex size-8 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-sidebar-accent-foreground data-[popup-open]:shadow-xs aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground aria-[current=page]:shadow-xs",delay:120,openOnHover:!0,children:p}),e[2]=d,e[3]=u,e[4]=p,e[5]=g):g=e[5];const h=n[r.key];let f;e[6]!==h?(f=s("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:h}),e[6]=h,e[7]=f):f=e[7];let v;if(e[8]!==a||e[9]!==r.tabs||e[10]!==o||e[11]!==i||e[12]!==l){let y;e[14]!==a||e[15]!==o||e[16]!==i||e[17]!==l?(y=k=>x("button",{"aria-current":a===k?"page":void 0,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent aria-[current=page]:font-medium [&_svg]:opacity-70 aria-[current=page]:[&_svg]:opacity-100","data-tab":k,"data-testid":`dash-tab-${k}`,onClick:o,title:i[k],type:"button",children:[s(vt,{tab:k}),s("span",{children:l[k]})]},k),e[14]=a,e[15]=o,e[16]=i,e[17]=l,e[18]=y):y=e[18],v=r.tabs.map(y),e[8]=a,e[9]=r.tabs,e[10]=o,e[11]=i,e[12]=l,e[13]=v}else v=e[13];let b;e[19]!==f||e[20]!==v?(b=x(Bt,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[f,v]}),e[19]=f,e[20]=v,e[21]=b):b=e[21];let m;return e[22]!==g||e[23]!==b?(m=x(Ot,{children:[g,b]}),e[22]=g,e[23]=b,e[24]=m):m=e[24],m},ks=t=>{const e=w(45),{chrome:a,collapsed:r,connected:n}=t,o=G();if(a===null){let k;e[0]!==o?(k=o("Admin"),e[0]=o,e[1]=k):k=e[1];let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=s("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"}),e[2]=S):S=e[2];let _;e[3]!==o?(_=o("Admin"),e[3]=o,e[4]=_):_=e[4];let L;e[5]!==_?(L=s("span",{className:"truncate text-[13px] font-medium",children:_}),e[5]=_,e[6]=L):L=e[6];let N;e[7]!==o?(N=o("Studio"),e[7]=o,e[8]=N):N=e[8];let P;e[9]!==N?(P=s("span",{className:"truncate text-[11px] text-muted-foreground",children:N}),e[9]=N,e[10]=P):P=e[10];let M;e[11]!==L||e[12]!==P?(M=x("span",{className:"grid flex-1 text-start leading-tight",children:[L,P]}),e[11]=L,e[12]=P,e[13]=M):M=e[13];let $;return e[14]!==k||e[15]!==M?($=x(Wt,{className:"data-active:bg-transparent",size:"lg",tooltip:k,children:[S,M]}),e[14]=k,e[15]=M,e[16]=$):$=e[16],$}const i=r?"mx-auto size-8 justify-center":"w-full p-2";let l;e[17]!==i?(l=A("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",i),e[17]=i,e[18]=l):l=e[18];let d;e[19]!==n||e[20]!==o?(d=o(n?"Connected":"Not connected"),e[19]=n,e[20]=o,e[21]=d):d=e[21];const u=n?"bg-success":"bg-muted-foreground/50";let c;e[22]!==u?(c=A("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",u),e[22]=u,e[23]=c):c=e[23];let p;e[24]!==c?(p=x("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",s("span",{"aria-hidden":"true",className:c})]}),e[24]=c,e[25]=p):p=e[25];let g;e[26]!==r||e[27]!==n||e[28]!==o?(g=!r&&x(Pt,{children:[x("span",{className:"grid flex-1 text-start leading-tight",children:[s("span",{className:"truncate text-[13px] font-medium",children:o("Admin")}),s("span",{className:"truncate text-[11px] text-muted-foreground",children:o(n?"Connected":"Not connected")})]}),s("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:s("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=r,e[27]=n,e[28]=o,e[29]=g):g=e[29];let h;e[30]!==l||e[31]!==d||e[32]!==p||e[33]!==g?(h=x(qt,{className:l,"data-testid":"dash-app-connect",title:d,children:[p,g]}),e[30]=l,e[31]=d,e[32]=p,e[33]=g,e[34]=h):h=e[34];const f=r?"end":"start",v=r?"right":"top";let b;e[35]!==a||e[36]!==n?(b=s(ys,{chrome:a,connected:n}),e[35]=a,e[36]=n,e[37]=b):b=e[37];let m;e[38]!==v||e[39]!==b||e[40]!==f?(m=s(Bt,{align:f,keepMounted:!0,side:v,children:b}),e[38]=v,e[39]=b,e[40]=f,e[41]=m):m=e[41];let y;return e[42]!==m||e[43]!==h?(y=x(Ot,{children:[h,m]}),e[42]=m,e[43]=h,e[44]=y):y=e[44],y},ws=t=>{const e=w(28),{chrome:a,connected:r,current:n,groupLabel:o,groups:i,selectTab:l,tabDescription:d,tabLabel:u}=t,c=G(),{state:p}=ut(),g=p==="collapsed",h=g&&"justify-center px-0";let f;e[0]!==h?(f=A("flex items-center gap-2.5 px-1.5 py-1",h),e[0]=h,e[1]=f):f=e[1];let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=s(Aa,{className:"size-9 shrink-0 text-foreground"}),e[2]=v):v=e[2];let b;e[3]!==g||e[4]!==r||e[5]!==c?(b=!g&&x(Pt,{children:[x("span",{className:"grid flex-1 leading-tight",children:[s("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),s("span",{className:"truncate text-[11px] text-muted-foreground",children:c("Studio")})]}),s(ot,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:c(r?"Live":"Local")})]}),e[3]=g,e[4]=r,e[5]=c,e[6]=b):b=e[6];let m;e[7]!==f||e[8]!==b?(m=s(er,{children:x("div",{className:f,children:[v,b]})}),e[7]=f,e[8]=b,e[9]=m):m=e[9];let y;e[10]!==g||e[11]!==n||e[12]!==o||e[13]!==i||e[14]!==l||e[15]!==d||e[16]!==u?(y=g?i.map(L=>s(xs,{current:n,group:L,groupLabel:o,selectTab:l,tabDescription:d,tabLabel:u},L.key)):i.map(L=>x(rr,{children:[s(sr,{className:"text-[11px] font-medium tracking-wider uppercase",children:o[L.key]}),s(nr,{children:s(Nt,{children:L.tabs.map(N=>s(St,{children:x(Wt,{className:"data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]","data-tab":N,"data-testid":`dash-tab-${N}`,isActive:n===N,onClick:l,title:d[N],tooltip:d[N],children:[s(vt,{tab:N}),s("span",{children:u[N]})]})},N))})})]},L.key)),e[10]=g,e[11]=n,e[12]=o,e[13]=i,e[14]=l,e[15]=d,e[16]=u,e[17]=y):y=e[17];let k;e[18]!==y?(k=s(ar,{children:y}),e[18]=y,e[19]=k):k=e[19];let S;e[20]!==a||e[21]!==g||e[22]!==r?(S=s(tr,{children:s(Nt,{children:s(St,{children:s(ks,{chrome:a,collapsed:g,connected:r})})})}),e[20]=a,e[21]=g,e[22]=r,e[23]=S):S=e[23];let _;return e[24]!==m||e[25]!==k||e[26]!==S?(_=x(Xa,{collapsible:"icon",variant:"inset",children:[m,k,S]}),e[24]=m,e[25]=k,e[26]=S,e[27]=_):_=e[27],_},Ut=()=>{const t=w(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[x("div",{className:"flex items-center gap-2",children:[s(pt,{className:"h-8 w-40"}),s(pt,{className:"h-8 w-24"})]}),s(pt,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},Ns=()=>{const t=w(64),e=G(),a=_t();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={select:Ps},t[0]=r):r=t[0];const n=ta(r);let o,i;t[1]!==n?(o=vs(n),i=bs.has(o),t[1]=n,t[2]=o,t[3]=i):(o=t[2],i=t[3]);const l=i,d=ia(),u=d?.toggle;kr(u);const c=ha(),{groupLabel:p,tabDescription:g,tabLabel:h}=pr();let f;t[4]!==c?(f=q=>({...q,tabs:q.tabs.filter(ee=>Ct(ee,c))}),t[4]=c,t[5]=f):f=t[5];const v=Mt.map(f).filter($s);let b,m;t[6]!==o||t[7]!==c||t[8]!==a?(b=()=>{Ct(o,c)||bt(a({replace:!0,to:"/home"}))},m=[o,c,a],t[6]=o,t[7]=c,t[8]=a,t[9]=b,t[10]=m):(b=t[9],m=t[10]),rt(b,m);let y;t[11]!==a?(y=q=>{bt(a({to:`/${q.currentTarget.dataset.tab??""}`}))},t[11]=a,t[12]=y):y=t[12];const k=y;let S,_;t[13]!==o||t[14]!==h?(S=()=>{typeof document<"u"&&(document.title=`${h[o]} · lunora`)},_=[o,h],t[13]=o,t[14]=h,t[15]=S,t[16]=_):(S=t[15],_=t[16]),rt(S,_);const L=v.find(q=>q.tabs.includes(o))??Mt[0];let N;t[17]!==p||t[18]!==h?(N=q=>q.tabs.map(ee=>({group:p[q.key],label:h[ee],to:`/${ee}`})),t[17]=p,t[18]=h,t[19]=N):N=t[19];const P=v.flatMap(N),M=yt(Ft),$=M!==null&&M.token!=="";let T;t[20]!==P?(T=s(ba,{items:P}),t[20]=P,t[21]=T):T=t[21];let E;t[22]!==M||t[23]!==$||t[24]!==o||t[25]!==p||t[26]!==k||t[27]!==g||t[28]!==h||t[29]!==v?(E=s(ws,{chrome:M,connected:$,current:o,groupLabel:p,groups:v,selectTab:k,tabDescription:g,tabLabel:h}),t[22]=M,t[23]=$,t[24]=o,t[25]=p,t[26]=k,t[27]=g,t[28]=h,t[29]=v,t[30]=E):E=t[30];const K=p[L.key],V=h[o];let R;t[31]!==K||t[32]!==V?(R=s(xr,{domain:K,onOpenCommandPalette:va,page:V}),t[31]=K,t[32]=V,t[33]=R):R=t[33];let I;t[34]!==M?.rulesInstalled?(I=M?.rulesInstalled===!1&&s(Ea,{}),t[34]=M?.rulesInstalled,t[35]=I):I=t[35];const Z=`dash-tab-${o}`,H=l?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",O=h[o];let z;t[36]!==e||t[37]!==O?(z=e("{title} failed",{title:O}),t[36]=e,t[37]=O,t[38]=z):z=t[38];const Y=h[o];let B;t[39]!==e?(B=e("Try again"),t[39]=e,t[40]=B):B=t[40];let Q;t[41]===Symbol.for("react.memo_cache_sentinel")?(Q=s(sa,{fallback:s(Ut,{}),children:s(aa,{})}),t[41]=Q):Q=t[41];let D;t[42]!==o||t[43]!==z||t[44]!==Y||t[45]!==B?(D=s(na,{fallbackTitle:z,label:Y,retryLabel:B,children:Q},o),t[42]=o,t[43]=z,t[44]=Y,t[45]=B,t[46]=D):D=t[46];let W;t[47]!==H||t[48]!==D?(W=s("div",{className:H,children:D}),t[47]=H,t[48]=D,t[49]=W):W=t[49];let F;t[50]!==d?(F=d?.open===!0&&s(ur,{focusSeq:d.focusSeq,onClose:d.close,onShownChange:d.setShown,shown:d.shown}),t[50]=d,t[51]=F):F=t[51];let j;t[52]!==Z||t[53]!==W||t[54]!==F?(j=x("div",{"aria-labelledby":Z,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:[W,F]}),t[52]=Z,t[53]=W,t[54]=F,t[55]=j):j=t[55];let U;t[56]!==R||t[57]!==I||t[58]!==j?(U=x(Ga,{className:"overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[R,I,j]}),t[56]=R,t[57]=I,t[58]=j,t[59]=U):U=t[59];let J;return t[60]!==E||t[61]!==U||t[62]!==T?(J=x(Ja,{className:"min-h-0 flex-1","data-testid":"lunora-studio",children:[T,E,U]}),t[60]=E,t[61]=U,t[62]=T,t[63]=J):J=t[63],J},Ss=()=>{const t=w(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s(oa,{children:s(Ns,{})}),t[0]=e):e=t[0],e},Ms=t=>{const e=w(5),{initialShardKey:a,schemaEditable:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const o=ea(n),{table:i}=o,l=typeof i=="string"?i:void 0;let d;return e[1]!==a||e[2]!==l||e[3]!==r?(d=s(os,{initialShardKey:a,initialTable:l,schemaEditable:r}),e[1]=a,e[2]=l,e[3]=r,e[4]=d):d=e[4],d},Cs=()=>{const t=w(3),e=_t();let a,r;return t[0]!==e?(a=()=>{bt(e({replace:!0,to:"/home"}))},r=[e],t[0]=e,t[1]=a,t[2]=r):(a=t[1],r=t[2]),rt(a,r),null},_s=({basePath:t,dataEditable:e=!1,functions:a,initialShardKey:r,openApiSpec:n,openRpcSpec:o,runAsIdentity:i=!1,schemaEditable:l=!1,scheduledCancel:d,scheduledCron:u,scheduledLoad:c})=>{const p=Jt({component:Ss}),g={agents:s(Mr,{initialShardKey:r}),analytics:s(Cr,{}),api:s(_r,{functions:a,initialShardKey:r,openApiSpec:n,openRpcSpec:o}),audit:s(Dr,{initialShardKey:r}),authAudit:s(Lr,{}),authConfig:s(Pr,{}),authSessions:s($r,{}),containers:s(zr,{}),dashboards:s(as,{initialShardKey:r}),data:s(Rr,{editable:e,initialShardKey:r}),deploymentHealth:s(Er,{}),drains:s(Wr,{}),export:s(Ir,{initialShardKey:r}),fanout:s(rs,{initialShardKey:r}),files:s(ds,{}),kv:s(Xr,{}),flags:s(Hr,{initialShardKey:r}),functions:x("div",{className:"flex flex-col gap-8",children:[s(qr,{functions:a,initialShardKey:r}),s(Or,{functions:a,runAsIdentity:i})]}),health:s(ss,{initialShardKey:r}),home:s(ua,{initialShardKey:r}),insights:s(wr,{initialShardKey:r}),issues:s(Br,{initialShardKey:r}),logs:s(Fr,{initialShardKey:r}),traces:s(us,{initialShardKey:r}),metrics:s(ns,{initialShardKey:r}),migrations:s(Kr,{initialShardKey:r}),notifications:s(Yr,{}),organizations:s(Ar,{}),permissions:s(es,{functions:a,runAsIdentity:i,schemaEditable:l}),pitr:s(Zr,{initialShardKey:r}),mail:s(jr,{}),payments:s(Gr,{}),queues:s(ts,{}),realtime:x("div",{className:"flex flex-col gap-8",children:[s(Qr,{initialShardKey:r}),s(Jr,{})]}),rls:s(Nr,{}),schedule:s(Ur,{loadCronJobs:u,scheduledCancel:d,scheduledLoad:c}),schema:s(Ms,{initialShardKey:r,schemaEditable:l}),security:s(Sr,{}),settings:s(is,{initialShardKey:r}),sql:s(ls,{initialShardKey:r}),storageRules:s(cs,{}),users:s(Tr,{}),vectors:s(hs,{}),workflows:s(ms,{})},h=kt({component:()=>g.home,getParentRoute:()=>p,path:"/"}),f=jt.map(m=>kt({component:()=>g[m],getParentRoute:()=>p,path:`/${m}`,validateSearch:Vr[m]})),v=p.addChildren([h,...f]),b="window"in globalThis?Xt():Yt({initialEntries:["/home"]});return Gt({...t===void 0||t==="/"?{}:{basepath:t},defaultNotFoundComponent:Cs,defaultPendingComponent:Ut,defaultPendingMinMs:0,defaultPendingMs:0,history:b,routeTree:v})},Ls=t=>{const e=w(17),{basePath:a,chrome:r,dataEditable:n,functions:o,initialShardKey:i,openApiSpec:l,openRpcSpec:d,runAsIdentity:u,schemaEditable:c,scheduledCancel:p,scheduledCron:g,scheduledLoad:h}=t;let f;e[0]!==a||e[1]!==n||e[2]!==o||e[3]!==i||e[4]!==l||e[5]!==d||e[6]!==u||e[7]!==p||e[8]!==g||e[9]!==h||e[10]!==c?(f=_s({basePath:a,dataEditable:n,functions:o,initialShardKey:i,openApiSpec:l,openRpcSpec:d,runAsIdentity:u,schemaEditable:c,scheduledCancel:p,scheduledCron:g,scheduledLoad:h}),e[0]=a,e[1]=n,e[2]=o,e[3]=i,e[4]=l,e[5]=d,e[6]=u,e[7]=p,e[8]=g,e[9]=h,e[10]=c,e[11]=f):f=e[11];const v=f,b=r??null;let m;e[12]!==v?(m=s(Qt,{router:v}),e[12]=v,e[13]=m):m=e[13];let y;return e[14]!==b||e[15]!==m?(y=s(Ft,{value:b,children:m}),e[14]=b,e[15]=m,e[16]=y):y=e[16],y},on=t=>{const e=w(17),{basePath:a,chrome:r,dataEditable:n,functions:o,i18n:i,initialShardKey:l,locale:d,openApiSpec:u,openRpcSpec:c,runAsIdentity:p,schemaEditable:g,scheduledCancel:h,scheduledCron:f,scheduledLoad:v}=t;let b;e[0]!==a||e[1]!==r||e[2]!==n||e[3]!==o||e[4]!==l||e[5]!==u||e[6]!==c||e[7]!==p||e[8]!==h||e[9]!==f||e[10]!==v||e[11]!==g?(b=s(Ca,{children:s(Ls,{basePath:a,chrome:r,dataEditable:n,functions:o,initialShardKey:l,openApiSpec:u,openRpcSpec:c,runAsIdentity:p,scheduledCancel:h,scheduledCron:f,scheduledLoad:v,schemaEditable:g})}),e[0]=a,e[1]=r,e[2]=n,e[3]=o,e[4]=l,e[5]=u,e[6]=c,e[7]=p,e[8]=h,e[9]=f,e[10]=v,e[11]=g,e[12]=b):b=e[12];const m=b;if(i===void 0&&d===void 0)return m;let y;return e[13]!==i||e[14]!==d||e[15]!==m?(y=s(pa,{i18n:i,locale:d,children:m}),e[13]=i,e[14]=d,e[15]=m,e[16]=y):y=e[16],y};function Ps(t){return t.location.pathname}function $s(t){return t.tabs.length>0}export{Oa as N,on as S,Ma as a,_a as b,Ha as c,Aa as f,Ka as g,nn as m,qa as v};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{c}from"react/compiler-runtime";import"react";import{c as d}from"./utils-bhneXptQ.js";import{jsx as o}from"react/jsx-runtime";function u(s){const e=c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("w-full caption-bottom text-xs",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=o("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto overflow-y-clip",children:o("table",{"data-slot":"table",className:l,...a})}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function p(s){const e=c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("bg-muted/50 [&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=o("thead",{"data-slot":"table-header",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function f(s){const e=c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=o("tbody",{"data-slot":"table-body",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function h(s){const e=c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=o("tr",{"data-slot":"table-row",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function x(s){const e=c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("h-9 border-e border-border px-3 text-start align-middle font-mono text-[11px] font-medium tracking-wide whitespace-nowrap text-muted-foreground uppercase last:border-e-0 [&:has([role=checkbox])]:pe-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=o("th",{"data-slot":"table-head",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function N(s){const e=c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("border-e border-border px-3 py-1.5 align-middle whitespace-nowrap last:border-e-0 [&:has([role=checkbox])]:pe-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=o("td",{"data-slot":"table-cell",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}export{p as d,f,h as m,u as n,x as p,N as u};
@@ -0,0 +1 @@
1
+ import{c as w}from"react/compiler-runtime";import{useT as k}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{jsx as x,jsxs as N}from"react/jsx-runtime";import{useRef as C,useEffect as T,useState as L,useMemo as E}from"react";import{f as F,b as P}from"./internal-BSIsQVC6.js";import{useVirtualizer as R}from"@tanstack/react-virtual";import{c as O}from"./utils-bhneXptQ.js";import{l as I}from"./virtual-rect-1o1veP7R.js";const S=b=>b==null?"∅":b===""?"(empty)":typeof b=="object"?JSON.stringify(b):String(b),J=b=>{const e=w(32),{column:t,onFacetFilter:l,state:r}=b,n=k();let a;e[0]!==t||e[1]!==l||e[2]!==r.result?.values?(a=u=>{const h=Number(u.currentTarget.dataset.index),v=r.result?.values[h];v!==void 0&&l(t,v.value)},e[0]=t,e[1]=l,e[2]=r.result?.values,e[3]=a):a=e[3];const i=a,o=`db-facet-${t}`;let c;e[4]!==t?(c=x("span",{className:"font-medium text-foreground",children:t}),e[4]=t,e[5]=c):c=e[5];let m;e[6]!==r.loading||e[7]!==r.result||e[8]!==n?(m=r.loading&&r.result===null&&x("span",{className:"text-muted-foreground",children:n("Loading…")}),e[6]=r.loading,e[7]=r.result,e[8]=n,e[9]=m):m=e[9];let g;e[10]!==r.error?(g=r.error!==null&&x("span",{className:"text-destructive",role:"alert",children:r.error}),e[10]=r.error,e[11]=g):g=e[11];let p;e[12]!==r.result?.values?(p=r.result?.values??[],e[12]=r.result?.values,e[13]=p):p=e[13];let d;if(e[14]!==t||e[15]!==i||e[16]!==p){let u;e[18]!==t||e[19]!==i?(u=(h,v)=>N("button",{className:"flex items-center justify-between gap-2 rounded px-1 py-0.5 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground","data-index":v,"data-testid":`db-facet-value-${t}`,onClick:i,type:"button",children:[x("span",{className:"truncate",children:S(h.value)}),x("span",{className:"shrink-0 tabular-nums text-foreground/70",children:h.count})]},S(h.value)),e[18]=t,e[19]=i,e[20]=u):u=e[20],d=p.map(u),e[14]=t,e[15]=i,e[16]=p,e[17]=d}else d=e[17];let f;e[21]!==t||e[22]!==r.result||e[23]!==n?(f=r.result?.truncated===!0&&x("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${t}`,children:n("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=t,e[22]=r.result,e[23]=n,e[24]=f):f=e[24];let s;return e[25]!==o||e[26]!==c||e[27]!==m||e[28]!==g||e[29]!==d||e[30]!==f?(s=N("section",{className:"flex flex-col gap-1","data-testid":o,children:[c,m,g,d,f]}),e[25]=o,e[26]=c,e[27]=m,e[28]=g,e[29]=d,e[30]=f,e[31]=s):s=e[31],s},Z=b=>{const e=w(26),{columns:t,facets:l,onFacetFilter:r,onToggleFacet:n}=b,a=k();let i;e[0]!==n?(i=h=>{const{column:v}=h.currentTarget.dataset;v!==void 0&&n(v)},e[0]=n,e[1]=i):i=e[1];const o=i;if(t.length===0)return null;let c;e[2]!==a?(c=a("Facets"),e[2]=a,e[3]=c):c=e[3];let m;e[4]!==c?(m=x("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:c}),e[4]=c,e[5]=m):m=e[5];let g;if(e[6]!==t||e[7]!==l||e[8]!==o){let h;e[10]!==l||e[11]!==o?(h=v=>x("button",{"aria-pressed":v in l,className:"rounded border border-border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-column":v,"data-testid":`db-facet-toggle-${v}`,onClick:o,type:"button",children:v},v),e[10]=l,e[11]=o,e[12]=h):h=e[12],g=t.map(h),e[6]=t,e[7]=l,e[8]=o,e[9]=g}else g=e[9];let p;e[13]!==g?(p=x("div",{className:"flex flex-wrap gap-1",children:g}),e[13]=g,e[14]=p):p=e[14];let d;e[15]!==m||e[16]!==p?(d=N("div",{className:"flex flex-col gap-1.5",children:[m,p]}),e[15]=m,e[16]=p,e[17]=d):d=e[17];let f;e[18]!==l?(f=Object.entries(l),e[18]=l,e[19]=f):f=e[19];let s;e[20]!==r||e[21]!==f?(s=f.map(h=>{const[v,$]=h;return x(J,{column:v,onFacetFilter:r,state:$},v)}),e[20]=r,e[21]=f,e[22]=s):s=e[22];let u;return e[23]!==d||e[24]!==s?(u=N("aside",{className:"flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs","data-testid":"db-facets",children:[d,s]}),e[23]=d,e[24]=s,e[25]=u):u=e[25],u},V=[25,50,100,250],B=b=>{const e=w(18),{onChange:t,options:l,prefix:r,value:n}=b,a=k();let i;e[0]!==t?(i=h=>{t(Number.parseInt(h.target.value,10))},e[0]=t,e[1]=i):i=e[1];const o=i,c=`${r}-page-size`;let m;e[2]!==a?(m=a("Rows per page"),e[2]=a,e[3]=m):m=e[3];let g;e[4]!==m?(g=x("span",{children:m}),e[4]=m,e[5]=g):g=e[5];const p=`${r}-page-size`,d=`${r}-page-size`;let f;e[6]!==l?(f=l.map(A),e[6]=l,e[7]=f):f=e[7];let s;e[8]!==o||e[9]!==p||e[10]!==d||e[11]!==f||e[12]!==n?(s=x("select",{className:"h-6 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":p,id:d,onChange:o,value:n,children:f}),e[8]=o,e[9]=p,e[10]=d,e[11]=f,e[12]=n,e[13]=s):s=e[13];let u;return e[14]!==c||e[15]!==g||e[16]!==s?(u=N("label",{className:"flex items-center gap-1.5",htmlFor:c,children:[g,s]}),e[14]=c,e[15]=g,e[16]=s,e[17]=u):u=e[17],u},_=b=>{const e=w(25),{onJump:t,page:l,pages:r,prefix:n}=b,a=k();let i;e[0]!==t||e[1]!==r?(i=y=>{const j=Number.parseInt(y,10);Number.isNaN(j)||t(Math.min(Math.max(1,j),Math.max(1,r)))},e[0]=t,e[1]=r,e[2]=i):i=e[2];const o=i;let c;e[3]!==o?(c=y=>{y.key==="Enter"&&o(y.currentTarget.value)},e[3]=o,e[4]=c):c=e[4];const m=c;let g;e[5]!==o?(g=y=>{o(y.currentTarget.value)},e[5]=o,e[6]=g):g=e[6];const p=g;let d;e[7]!==a?(d=a("Page"),e[7]=a,e[8]=d):d=e[8];let f;e[9]!==a?(f=a("Page"),e[9]=a,e[10]=f):f=e[10];const s=`${n}-page-jump`,u=Math.max(1,r);let h;e[11]!==p||e[12]!==m||e[13]!==l||e[14]!==f||e[15]!==s||e[16]!==u?(h=x("input",{"aria-label":f,className:"h-6 w-12 rounded-md border border-border bg-background px-1 text-center tabular-nums outline-none focus-visible:border-ring","data-testid":s,defaultValue:l,max:u,min:1,onBlur:p,onKeyDown:m,type:"number"},l),e[11]=p,e[12]=m,e[13]=l,e[14]=f,e[15]=s,e[16]=u,e[17]=h):h=e[17];let v;e[18]!==r||e[19]!==a?(v=a("of {pages}",{pages:r}),e[18]=r,e[19]=a,e[20]=v):v=e[20];let $;return e[21]!==d||e[22]!==h||e[23]!==v?($=N("span",{className:"flex items-center gap-1.5 tabular-nums",children:[d,h,v]}),e[21]=d,e[22]=h,e[23]=v,e[24]=$):$=e[24],$},ee=({hasNext:b,hasPrevious:e,onJumpToPage:t,onNext:l,onPageSizeChange:r,onPrevious:n,pageSize:a,pageSizeOptions:i=V,prefix:o,rangeEnd:c,rangeStart:m,total:g})=>{const p=k(),d="rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",f=a!==void 0&&a>0?Math.max(1,Math.ceil(g/a)):1,s=a!==void 0&&a>0?Math.floor(Math.max(0,m-1)/a)+1:1;return N("div",{className:"flex w-full items-center justify-between gap-3 text-xs text-muted-foreground",children:[N("div",{className:"flex items-center gap-3",children:[a!==void 0&&r!==void 0&&x(B,{onChange:r,options:i,prefix:o,value:a}),x("span",{className:"tabular-nums","data-testid":`${o}-page-info`,children:p("{rangeStart}-{rangeEnd} of {total}",{rangeEnd:c,rangeStart:m,total:g})})]}),N("div",{className:"flex items-center gap-3",children:[x("button",{className:d,"data-testid":`${o}-prev`,disabled:!e,onClick:n,type:"button",children:p("Previous")}),a!==void 0&&t!==void 0&&x(_,{onJump:t,page:s,pages:f,prefix:o}),x("button",{className:d,"data-testid":`${o}-next`,disabled:!b,onClick:l,type:"button",children:p("Next")})]})]})};function A(b){return x("option",{value:b,children:b},b)}function D(b){const e=w(2),t=C(b);let l;return e[0]!==b?(l=()=>{t.current=b},e[0]=b,e[1]=l):l=e[1],T(l),t}const te=()=>{const[b,e]=L({}),t=D(b),l=C({}),r=async(n,a)=>{const i=(l.current[n]??0)+1;l.current[n]=i,e(o=>n in o?{...o,[n]:{error:null,loading:!0,result:o[n]?.result??null}}:o);try{const o=await a(n);if(l.current[n]!==i)return;e(c=>n in c?{...c,[n]:{error:null,loading:!1,result:o}}:c)}catch(o){if(l.current[n]!==i)return;e(c=>n in c?{...c,[n]:{error:P(o),loading:!1,result:null}}:c)}};return{clearFacets:()=>{e({}),t.current={}},facets:b,facetsRef:t,refetchFacets:n=>{for(const a of Object.keys(t.current))F(r(a,n))},toggleFacet:(n,a)=>{if(n in t.current){e(i=>Object.fromEntries(Object.entries(i).filter(([o])=>o!==n)));return}e(i=>({...i,[n]:{error:null,loading:!0,result:null}})),a!==null&&F(r(n,a))}}},M=34,z=600,K=b=>{const e=w(21),{item:t,onSelect:l,prefix:r,selected:n,start:a}=b;let i;e[0]!==t.name||e[1]!==l?(i=()=>{l(t.name)},e[0]=t.name,e[1]=l,e[2]=i):i=e[2];const o=i,c=`translateY(${String(a)}px)`;let m;e[3]!==c?(m={insetInline:0,position:"absolute",top:0,transform:c},e[3]=c,e[4]=m):m=e[4];const g=m,p=n?"bg-accent font-medium text-accent-foreground":"text-foreground";let d;e[5]!==p?(d=O("flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",p),e[5]=p,e[6]=d):d=e[6];const f=`${r}-table-${t.name}`;let s;e[7]!==t.name?(s=x("span",{className:"truncate",children:t.name}),e[7]=t.name,e[8]=s):s=e[8];let u;e[9]!==t.rowCount?(u=x("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:t.rowCount}),e[9]=t.rowCount,e[10]=u):u=e[10];let h;e[11]!==o||e[12]!==n||e[13]!==d||e[14]!==f||e[15]!==s||e[16]!==u?(h=N("button",{"aria-pressed":n,className:d,"data-testid":f,onClick:o,type:"button",children:[s,u]}),e[11]=o,e[12]=n,e[13]=d,e[14]=f,e[15]=s,e[16]=u,e[17]=h):h=e[17];let v;return e[18]!==g||e[19]!==h?(v=x("li",{style:g,children:h}),e[18]=g,e[19]=h,e[20]=v):v=e[20],v},re=({header:b,onReload:e,onSelect:t,prefix:l,reloadLabel:r,selected:n,tables:a})=>{const i=k(),[o,c]=L(""),m=C(null),g=s=>{c(s.target.value)},p=E(()=>{const s=o.trim().toLowerCase();return s===""?a:a.filter(u=>u.name.toLowerCase().includes(s))},[o,a]),d=R({count:p.length,estimateSize:()=>M,getScrollElement:()=>m.current,initialRect:{height:z,width:240},observeElementRect:(s,u)=>I(s,u,z),overscan:12}).getVirtualItems(),f={height:p.length*M};return N("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${l}-table-list`,children:[b,N("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[x("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:i("Tables")}),e!==void 0&&x("button",{"aria-label":r??i("Refresh"),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":`${l}-load-tables`,onClick:e,title:r??i("Refresh"),type:"button",children:x("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:x("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})})})]}),x("div",{className:"shrink-0 border-b border-border p-2",children:x("input",{className:"h-7 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring","data-testid":`${l}-table-search`,onChange:g,placeholder:i("search table…"),type:"search",value:o})}),N("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${l}-table-list-rows`,ref:m,children:[x("li",{"aria-hidden":"true",style:f}),d.map(s=>{const u=p[s.index];return u===void 0?null:x(K,{item:u,onSelect:t,prefix:l,selected:n===u.name,start:s.start},u.name)})]})]})};export{Z as $,re as _,ee as a,D as i,te as u};
@@ -0,0 +1 @@
1
+ import{c as d}from"react/compiler-runtime";import"react";import{c as o}from"./utils-bhneXptQ.js";import{jsx as l}from"react/jsx-runtime";function p(n){const i=d(8);let r,e;i[0]!==n?({className:r,...e}=n,i[0]=n,i[1]=r,i[2]=e):(r=i[1],e=i[2]);let t;i[3]!==r?(t=o("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 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",r),i[3]=r,i[4]=t):t=i[4];let a;return i[5]!==e||i[6]!==t?(a=l("textarea",{"data-slot":"textarea",className:t,...e}),i[5]=e,i[6]=t,i[7]=a):a=i[7],a}export{p as l};
@@ -0,0 +1 @@
1
+ import{s as a,a as n}from"./browser-storage-xjTyMKY0.js";const t="lunora:traces:pending-filter",o=e=>{a(t,e,"session")},c=()=>{const e=n("session");if(e!==void 0)try{const s=e.getItem(t);if(s===null)return;const r=JSON.parse(s);return typeof r.traceId!="string"?void 0:{traceId:r.traceId,...typeof r.shardKey=="string"?{shardKey:r.shardKey}:{}}}catch{return}},d=()=>{try{n("session")?.removeItem(t)}catch{}};export{d as c,c as p,o as w};
@@ -0,0 +1 @@
1
+ import{c as T}from"react/compiler-runtime";import{useLunora as E}from"@lunora/react";import{useQueryClient as v,useQuery as I,keepPreviousData as O}from"@tanstack/react-query";import{useState as _,useEffect as $}from"react";import{g as y,d as g,f as S,b as j}from"./internal-BSIsQVC6.js";const u=t=>typeof t=="string"?t===""?void 0:t:typeof t=="number"||typeof t=="boolean"?String(t):void 0,d=t=>t.filter(r=>r!==void 0).join(" "),x={deleteRows:t=>d([u(t.table),Array.isArray(t.ids)?`${String(t.ids.length)} rows`:void 0]),facetColumn:t=>d([u(t.table),u(t.column)]),lintSql:()=>"sql",readTablePage:t=>d([u(t.table),Array.isArray(t.filters)&&t.filters.length>0?`${String(t.filters.length)} filters`:void 0,typeof t.search=="string"&&t.search!==""?"search":void 0,typeof t.limit=="number"?`limit ${String(t.limit)}`:void 0]),runMigration:t=>d([u(t.id),u(t.direction),t.dryRun===!0?"dry-run":void 0]),runSql:t=>typeof t.sql=="string"?`${String(t.sql.length)} chars`:"",schemaVersion:t=>typeof t.hash=="string"?t.hash.slice(0,8):"",writeRow:t=>d([u(t.table),"1 row"])},b="__lunora_admin__:",N=(t,r)=>{const e=t.startsWith(b)?t.slice(b.length):t,s=x[e];if(s!==void 0)return s(r);const i=Object.keys(r);return i.length===0?"":i.join(", ")},K=t=>{if(Array.isArray(t))return t.length;if(!(typeof t!="object"||t===null)){for(const r of Object.values(t))if(Array.isArray(r))return r.length}};class L{entries=[];listeners=new Set;nextSeq=1;getSnapshot=()=>this.entries;subscribe=r=>(this.listeners.add(r),()=>{this.listeners.delete(r)});start(r,e,s){return this.append(r,e,s,"call","pending")}startSubscription(r,e,s){return this.append(r,e,s,"subscription","live")}recordPush(r){if(this.listeners.size===0){const e=this.entries.find(s=>s.seq===r);e!==void 0&&(e.pushes=(e.pushes??0)+1);return}this.patch(r,e=>({...e,pushes:(e.pushes??0)+1}))}failSubscription(r,e){this.patch(r,s=>({...s,error:e,status:"error"}))}endSubscription(r){this.patch(r,e=>e.status==="error"?e:{...e,durationMs:Date.now()-e.startedAt,status:"closed"})}lastErrorSeq(){return this.entries.findLast(r=>r.status==="error")?.seq}settle(r,e){this.patch(r,s=>({...s,durationMs:Date.now()-s.startedAt,...e.error===void 0?{resultCount:K(e.result),status:"ok"}:{error:e.error,status:"error"}}))}clear(){this.entries=[],this.emit()}append(r,e,s,i,o){const n=this.nextSeq;this.nextSeq+=1;const l={functionPath:r,kind:i,seq:n,shardKey:s,startedAt:Date.now(),status:o,summary:N(r,e),...i==="subscription"?{pushes:0}:{}},a=[...this.entries,l];return this.entries=a.length>300?a.slice(a.length-300):a,this.emit(),n}patch(r,e){const s=this.entries.findIndex(i=>i.seq===r);s!==-1&&(this.entries=this.entries.with(s,e(this.entries[s])),this.emit())}emit(){for(const r of this.listeners)r()}}const c=new L,q=(t,r,e)=>["lunora-admin",t,r,e.trim()];function M(t,r,e={}){const{enabled:s=!0,keepPreviousData:i=!1,staleTime:o=0}=e,n=I({enabled:s,queryFn:r,placeholderData:i?O:void 0,queryKey:t,staleTime:o});return{data:n.data,error:n.error?j(n.error):n.error,errorSource:n.error??void 0,isLoading:n.isLoading,liveError:void 0,refetch:()=>{S(n.refetch())}}}function z(t,r,e={}){const s=E(),i=v(),{enabled:o=!0,keepPreviousData:n=!1,live:l=!1,shardKey:a="",staleTime:A}=e,f=q(t,r,a),w=M(f,()=>s.query(y(t),r,g(a)),{enabled:o,keepPreviousData:n,staleTime:A??(l?Number.POSITIVE_INFINITY:0)}),[D,p]=_(void 0),P=JSON.stringify(f);return $(()=>{if(!o||!l)return;p(void 0);const m=c.startSubscription(t,r,a),k=s.subscribe(y(t),r,h=>{c.recordPush(m),p(void 0),i.setQueryData(f,h)},{...g(a),onError:h=>{c.failSubscription(m,h.message),p(h.message)}});return()=>{c.endSubscription(m),k()}},[P,o,l]),{...w,liveError:o&&l?D:void 0}}const J=()=>{const t=T(2),r=v();let e;return t[0]!==r?(e=(s,i,o)=>{const n=i===void 0?["lunora-admin",s]:q(s,i,o??"");S(r.invalidateQueries({queryKey:n}))},t[0]=r,t[1]=e):e=t[1],e};export{z as N,M as O,J as U,c as y};
@@ -0,0 +1 @@
1
+ import{c as f}from"react/compiler-runtime";import{useState as c}from"react";import{f as i,b as y}from"./internal-BSIsQVC6.js";const g=()=>{const r=f(4),[o,a]=c(!1),[s,n]=c(null);let e;r[0]===Symbol.for("react.memo_cache_sentinel")?(e=l=>{i((async()=>{a(!0),n(null);try{await l()}catch(m){n(y(m))}a(!1)})())},r[0]=e):e=r[0];const u=e;let t;return r[1]!==o||r[2]!==s?(t={busy:o,error:s,run:u},r[1]=o,r[2]=s,r[3]=t):t=r[3],t};export{g as u};
@@ -0,0 +1 @@
1
+ import{c as f}from"react/compiler-runtime";import{useLunora as c}from"@lunora/react";import{O as u}from"./use-admin-query-QJ-ibl5u.js";const m={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=()=>{const e=f(6),t=c();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["lunora-auth-config"],e[0]=a):a=e[0];let o;e[1]!==t?(o=()=>t.getAuthConfig(),e[1]=t,e[2]=o):o=e[2];const{data:n,isLoading:l}=u(a,o),i=n??m,r=!l;let s;return e[3]!==i||e[4]!==r?(s={config:i,ready:r},e[3]=i,e[4]=r,e[5]=s):s=e[5],s};export{A as u};
@@ -0,0 +1 @@
1
+ import{useLunora as y}from"@lunora/react";import{useState as l}from"react";import{N as b}from"./use-admin-query-QJ-ibl5u.js";import{ADMIN_FUNCTIONS as o}from"./ADMIN_FUNCTIONS-BnD4aovm.js";import{d as s,g as u}from"./internal-BSIsQVC6.js";const S={},C=u(o.aiGenerateSql),N=u(o.aiTableFilter),w=u(o.aiChartConfig),k=i=>{const d=y(),[g,c]=l({}),[m,f]=l({}),p=b(o.aiAvailable,S,{shardKey:i}),[h,q]=l(!1),v=h||p.data?.available===!1,n=e=>{c(r=>({...r,[e]:!0})),f(r=>({...r,[e]:void 0}))},t=(e,r)=>{c(a=>({...a,[e]:!1})),r!==void 0&&f(a=>({...a,[e]:r})),r==="no-ai-binding"&&q(!0)};return{generate:async(e,r)=>{n("sql");try{const{result:a}=await d.query(C,{failedError:r?.error,failedSql:r?.sql,prompt:e},s(i));return t("sql",a.degraded?a.reason:void 0),a.degraded?void 0:a.sql}catch{t("sql","ai-error");return}},inferChart:async e=>{n("chart");try{const{result:r}=await d.query(w,e,s(i));return t("chart",r.degraded?r.reason:void 0),r.degraded?void 0:r.chart}catch{t("chart","ai-error");return}},pending:e=>g[e]===!0,reason:e=>m[e],suggestFilter:async(e,r)=>{n("filter");try{const{result:a}=await d.query(N,{prompt:e,table:r},s(i));return t("filter",a.degraded?a.reason:void 0),a.degraded?void 0:a.clauses}catch{t("filter","ai-error");return}},unavailable:v}};export{k};
@@ -0,0 +1 @@
1
+ import{c as m}from"react/compiler-runtime";import{useState as s,useEffect as a}from"react";const p=function(o,c){const e=m(4),t=c===void 0?300:c,[n,f]=s(o);let r,u;return e[0]!==t||e[1]!==o?(r=()=>{const i=setTimeout(()=>{f(o)},t);return()=>{clearTimeout(i)}},u=[o,t],e[0]=t,e[1]=o,e[2]=r,e[3]=u):(r=e[2],u=e[3]),a(r,u),n};export{p as default};
@@ -0,0 +1 @@
1
+ import{clsx as o}from"clsx";import{twMerge as t}from"tailwind-merge";function m(...r){return t(o(r))}export{m as c};
@@ -0,0 +1 @@
1
+ import{observeElementRect as o}from"@tanstack/react-virtual";const m=(e,h,i)=>o(e,t=>{h(t.height>0?t:{height:i,width:t.width})});export{m as l};
@@ -0,0 +1 @@
1
+ import{a as Rt}from"./chunk-KUVMORDQ.js";import{a as Kt,b as Lt,c as zt,d as At,e as ot}from"./chunk-Y5Y7DHFW.js";import{a as Ot}from"./chunk-QWGT25SE.js";import{a as Ct,b as Dt,c as Ft,d as Tt,e as Ee}from"./chunk-OY2RVUZL.js";import"./chunk-2PJNAWB3.js";import{a as Mt}from"./chunk-CTNB2KIA.js";import{e as It}from"./chunk-SKHEGARW.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import"./chunk-RQ7AFLIV.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import{a as et,b as tt,c as rt,d as yt,e as Nt,f as at,g as lt,h as wt,i as St}from"./chunk-CU55Y5TV.js";import"./chunk-4UOFSGUS.js";import"./chunk-ILNELDFC.js";import{e as ut}from"./chunk-SMIESS7P.js";import{a as _t}from"./chunk-LFKCLLPT.js";import"./chunk-T6VMSOBB.js";import"./chunk-QLQADHFE.js";import{c as Re}from"./chunk-XDAT7LHC.js";import{a as st,b as nt,c as it,d as je,e as ne,f as P}from"./chunk-MIQTKZAR.js";import{a as ce,b as ze,c as Ae,d as gt,e as ge}from"./chunk-UZERI5YC.js";import"./chunk-QBWRC5YX.js";import{a as $t}from"./chunk-X665E2HU.js";import{a as qt,b as kt}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as Ye}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as We}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as Oe}from"./chunk-2WOIRKEI.js";import{f as mt}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as pt}from"./chunk-XQCVZAGU.js";import{d as Te,f as ft,g as xt,h as bt,i as vt,m as Ze,p as Ge}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as n,e as Xe,f as Jt,g as Qt,h as Ut,j as ht}from"./chunk-3XIESWL4.js";var Ke=Xe(Qt(),1);var _=Xe(Jt(),1);var t=Xe(Ut(),1);var Ht=n((l,e)=>l<e?-1:l>e?1:0,"Bt"),ct=n(l=>{if(l===void 0)return"null";if(typeof l=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key \u2014 pass it as a string, or use stableWireKey");if(l===null||typeof l!="object")return JSON.stringify(l);if(Array.isArray(l))return`[${l.map(u=>ct(u)).join(",")}]`;let e=Object.getPrototypeOf(l);if(e!==null&&e!==Object.prototype){let u=l.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${u} in a stable JSON cache key \u2014 only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}let s=l,r=Object.keys(s).toSorted(Ht),a=[];for(let u of r){let c=s[u];c!==void 0&&a.push(`${JSON.stringify(u)}:${ct(c)}`)}return`{${a.join(",")}}`},"Ze"),Et=n((l,e,s)=>`${l}:${e}:${ct(s??{})}`,"gt"),Pt=n((l,e)=>l==="gauge"?e.last:l==="histogram"?e.sum/Math.max(1,e.count):e.sum,"ft"),Wt=n((l,e)=>Pt(l,e),"Ht"),Gt=n(l=>Pt(l.kind,l),"Wt"),dt=n(l=>Number.isInteger(l)?l.toLocaleString():l.toLocaleString(void 0,{maximumFractionDigits:2}),"Ve"),Bt=n(l=>Array.isArray(l?.series)?l.series:[],"Gt"),Vt="FUNCTION_NOT_FOUND",Xt=n(l=>{let e=new Map;if(!Array.isArray(l?.series))return e;for(let s of l.series)e.set(Et(s.kind,s.name,s.attributes),s.points);return e},"Yt"),Yt={counter:"secondary",gauge:"default",histogram:"outline"},Zt=n(l=>{let e=(0,Ke.c)(18),{name:s,onOpenTrace:r,traceId:a}=l,u=Te();if(a===void 0){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=m):m=e[0],m}let c;e[1]!==a?(c=a.slice(0,8),e[1]=a,e[2]=c):c=e[2];let g=c;if(r===void 0){let m=`mt-instrument-trace-${s}`,b;return e[3]!==g||e[4]!==m||e[5]!==a?(b=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":m,title:a,children:g}),e[3]=g,e[4]=m,e[5]=a,e[6]=b):b=e[6],b}let f=`mt-instrument-trace-${s}`,x;e[7]!==r||e[8]!==a?(x=n(()=>{r(a)},"x"),e[7]=r,e[8]=a,e[9]=x):x=e[9];let v;e[10]!==u||e[11]!==a?(v=u("Open the exemplar trace {trace}",{trace:a}),e[10]=u,e[11]=a,e[12]=v):v=e[12];let h;return e[13]!==g||e[14]!==f||e[15]!==x||e[16]!==v?(h=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":f,onClick:x,title:v,type:"button",children:g}),e[13]=g,e[14]=f,e[15]=x,e[16]=v,e[17]=h):h=e[17],h},"Zt"),er=n(l=>{let e=(0,Ke.c)(105),{onOpenTrace:s,shardKey:r}=l,a=Te(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={},e[0]=u):u=e[0];let c;e[1]!==r?(c={live:!0,shardKey:r},e[1]=r,e[2]=c):c=e[2];let{data:g,error:f,errorSource:x}=Re(Oe.getMetricSeries,u,c),v;e[3]===Symbol.for("react.memo_cache_sentinel")?(v={},e[3]=v):v=e[3];let h;e[4]!==r?(h={live:!0,shardKey:r},e[4]=r,e[5]=h):h=e[5];let{data:m}=Re(Oe.getMetricHistory,v,h),b,L,k,D,z,o,y,q,F,T,M,N,A;if(e[6]!==g||e[7]!==f||e[8]!==x||e[9]!==m||e[10]!==s||e[11]!==a){q=Symbol.for("react.early_return_sentinel");e:{let me=Bt(g),ue=vt(x)===Vt;if(f!==null&&!ue){let i;e[25]!==a?(i=a("Instruments"),e[25]=a,e[26]=i):i=e[26];let C;e[27]!==i?(C=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:i}),e[27]=i,e[28]=C):C=e[28];let O;e[29]!==f||e[30]!==a?(O=a("Instruments unavailable: {error}",{error:f}),e[29]=f,e[30]=a,e[31]=O):O=e[31];let K;e[32]!==O?(K=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:O}),e[32]=O,e[33]=K):K=e[33];let se;e[34]!==C||e[35]!==K?(se=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[C,K]}),e[34]=C,e[35]=K,e[36]=se):se=e[36],q=se;break e}if(me.length===0){q=null;break e}let Le=Xt(m),d;e[37]!==a?(d=n(i=>a(i==="counter"?"Counter":i==="gauge"?"Gauge":"Histogram"),"d"),e[37]=a,e[38]=d):d=e[38];let j=d;z="flex flex-col gap-2",o="mt-instruments";let w;e[39]!==a?(w=a("Instruments"),e[39]=a,e[40]=w):w=e[40],e[41]!==w?(y=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:w}),e[41]=w,e[42]=y):y=e[42],D=ce,A="overflow-hidden py-0",k=ge,N="px-0",L=st,T="mt-instruments-table";let S;e[43]!==a?(S=a("name"),e[43]=a,e[44]=S):S=e[44];let Q;e[45]!==S?(Q=(0,t.jsx)(ne,{children:S}),e[45]=S,e[46]=Q):Q=e[46];let U;e[47]!==a?(U=a("kind"),e[47]=a,e[48]=U):U=e[48];let H;e[49]!==U?(H=(0,t.jsx)(ne,{children:U}),e[49]=U,e[50]=H):H=e[50];let W;e[51]!==a?(W=a("value"),e[51]=a,e[52]=W):W=e[52];let G;e[53]!==W?(G=(0,t.jsx)(ne,{className:"text-right",children:W}),e[53]=W,e[54]=G):G=e[54];let B;e[55]!==a?(B=a("count"),e[55]=a,e[56]=B):B=e[56];let V;e[57]!==B?(V=(0,t.jsx)(ne,{className:"text-right",children:B}),e[57]=B,e[58]=V):V=e[58];let X;e[59]!==a?(X=a("range"),e[59]=a,e[60]=X):X=e[60];let Y;e[61]!==X?(Y=(0,t.jsx)(ne,{className:"text-right",children:X}),e[61]=X,e[62]=Y):Y=e[62];let Z;e[63]!==a?(Z=a("trend"),e[63]=a,e[64]=Z):Z=e[64];let ee;e[65]!==Z?(ee=(0,t.jsx)(ne,{children:Z}),e[65]=Z,e[66]=ee):ee=e[66];let te;e[67]!==a?(te=a("trace"),e[67]=a,e[68]=te):te=e[68];let re;e[69]!==te?(re=(0,t.jsx)(ne,{children:te}),e[69]=te,e[70]=re):re=e[70];let ae;e[71]!==a?(ae=a("dimensions"),e[71]=a,e[72]=ae):ae=e[72];let le;e[73]!==ae?(le=(0,t.jsx)(ne,{children:ae}),e[73]=ae,e[74]=le):le=e[74],e[75]!==Q||e[76]!==H||e[77]!==G||e[78]!==V||e[79]!==Y||e[80]!==ee||e[81]!==re||e[82]!==le?(M=(0,t.jsx)(nt,{children:(0,t.jsxs)(je,{children:[Q,H,G,V,Y,ee,re,le]})}),e[75]=Q,e[76]=H,e[77]=G,e[78]=V,e[79]=Y,e[80]=ee,e[81]=re,e[82]=le,e[83]=M):M=e[83],b=it,F=me.map(i=>{let C=Ot(i.attributes),O=Et(i.kind,i.name,i.attributes),K=(Le.get(O)??[]).map(se=>Wt(i.kind,se));return(0,t.jsxs)(je,{"data-testid":`mt-instrument-${i.name}`,children:[(0,t.jsx)(P,{className:"font-mono text-xs",title:i.functionPath,children:i.name}),(0,t.jsx)(P,{children:(0,t.jsx)(We,{variant:Yt[i.kind],children:j(i.kind)})}),(0,t.jsx)(P,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${i.name}`,children:dt(Gt(i))}),(0,t.jsx)(P,{className:"text-right tabular-nums text-muted-foreground",children:i.count.toLocaleString()}),(0,t.jsx)(P,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:i.min===i.max?"\u2014":`${dt(i.min)}\u2013${dt(i.max)}`}),(0,t.jsx)(P,{children:K.length>=2?(0,t.jsx)(ot,{ariaLabel:a("{name} trend",{name:i.name}),className:"h-6 w-24 text-foreground",series:K,testId:`mt-instrument-trend-${i.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(P,{className:"font-mono text-xs",children:(0,t.jsx)(Zt,{name:i.name,onOpenTrace:s,traceId:i.exemplarTraceId})}),(0,t.jsx)(P,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:C,children:C===""?"\u2014":C})]},O)})}e[6]=g,e[7]=f,e[8]=x,e[9]=m,e[10]=s,e[11]=a,e[12]=b,e[13]=L,e[14]=k,e[15]=D,e[16]=z,e[17]=o,e[18]=y,e[19]=q,e[20]=F,e[21]=T,e[22]=M,e[23]=N,e[24]=A}else b=e[12],L=e[13],k=e[14],D=e[15],z=e[16],o=e[17],y=e[18],q=e[19],F=e[20],T=e[21],M=e[22],N=e[23],A=e[24];if(q!==Symbol.for("react.early_return_sentinel"))return q;let J;e[84]!==b||e[85]!==F?(J=(0,t.jsx)(b,{children:F}),e[84]=b,e[85]=F,e[86]=J):J=e[86];let R;e[87]!==L||e[88]!==J||e[89]!==T||e[90]!==M?(R=(0,t.jsxs)(L,{"data-testid":T,children:[M,J]}),e[87]=L,e[88]=J,e[89]=T,e[90]=M,e[91]=R):R=e[91];let I;e[92]!==k||e[93]!==R||e[94]!==N?(I=(0,t.jsx)(k,{className:N,children:R}),e[92]=k,e[93]=R,e[94]=N,e[95]=I):I=e[95];let $;e[96]!==D||e[97]!==I||e[98]!==A?($=(0,t.jsx)(D,{className:A,children:I}),e[96]=D,e[97]=I,e[98]=A,e[99]=$):$=e[99];let de;return e[100]!==z||e[101]!==o||e[102]!==y||e[103]!==$?(de=(0,t.jsxs)("section",{className:z,"data-testid":o,children:[y,$]}),e[100]=z,e[101]=o,e[102]=y,e[103]=$,e[104]=de):de=e[104],de},"er"),Ve=n(l=>l>=100?"critical":l>=50?"warning":"good","We"),Pe=n(l=>l<1?`${(l*1e3).toFixed(0)}\u03BCs`:l<1e3?`${l.toFixed(1)}ms`:`${(l/1e3).toFixed(2)}s`,"Le"),Be=n(l=>l>=1e9?`${(l/1e9).toFixed(1)}B`:l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:l.toLocaleString(),"Je"),tr=n(l=>{let e=(0,Ke.c)(3),{level:s}=l;if(s==="critical"){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)(We,{variant:"destructive",children:"Slow"}),e[0]=a):a=e[0],a}if(s==="warning"){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=a):a=e[1],a}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=r):r=e[2],r},"tr"),rr=n((l,e)=>{let s=[...l];return s.sort((r,a)=>{switch(e){case"avgTime":return a.avgDurationMs-r.avgDurationMs;case"execCount":return a.execCount-r.execCount;case"rowsRead":return a.rowsRead-r.rowsRead;default:return a.totalDurationMs-r.totalDurationMs}}),s},"rr"),ar=n(l=>{let e=(0,Ke.c)(161),{queryStats:s}=l,r=Te(),[a,u]=(0,_.useState)("totalTime"),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=new Set,e[0]=c):c=e[0];let[g,f]=(0,_.useState)(c),x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=n(A=>{A!==null&&u(A)},"x"),e[1]=x):x=e[1];let v=x,h,m,b,L,k,D,z,o,y,q;if(e[2]!==g||e[3]!==s||e[4]!==a||e[5]!==r){b=Symbol.for("react.early_return_sentinel");e:{let A=rr(s,a),J;e[16]!==s?(J=s.filter(lr),e[16]=s,e[17]=J):J=e[17];let R=J.length,I;e[18]!==s?(I=s.filter(sr),e[18]=s,e[19]=I):I=e[19];let $=I.length,de;e[20]!==s?(de=s.filter(nr),e[20]=s,e[21]=de):de=e[21];let me=de.length,ue;e[22]===Symbol.for("react.memo_cache_sentinel")?(ue=n(p=>{f(ie=>{let E=new Set(ie);return E.has(p)?E.delete(p):E.add(p),E})},"ce"),e[22]=ue):ue=e[22];let Le=ue;if(s.length===0){let p;e[23]!==r?(p=r("No query insights yet"),e[23]=r,e[24]=p):p=e[24];let ie;e[25]!==p?(ie=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:p}),e[25]=p,e[26]=ie):ie=e[26];let E;e[27]!==r?(E=r("Query insights appear once statements are executed against this shard."),e[27]=r,e[28]=E):E=e[28];let he;e[29]!==E?(he=(0,t.jsx)("p",{className:"mt-1 text-sm",children:E}),e[29]=E,e[30]=he):he=e[30];let He;e[31]!==ie||e[32]!==he?(He=(0,t.jsx)(ce,{children:(0,t.jsx)(ge,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ie,he]})})}),e[31]=ie,e[32]=he,e[33]=He):He=e[33],b=He;break e}z="space-y-4",o="qi-root";let d;e[34]!==r?(d=r("Critical queries"),e[34]=r,e[35]=d):d=e[35];let j;e[36]!==d?(j=(0,t.jsx)(ze,{className:"pb-2",children:(0,t.jsx)(Ae,{className:"text-sm font-medium",children:d})}),e[36]=d,e[37]=j):j=e[37];let w;e[38]!==R?(w=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:R}),e[38]=R,e[39]=w):w=e[39];let S;e[40]!==r?(S=r(">100ms avg execution"),e[40]=r,e[41]=S):S=e[41];let Q;e[42]!==S?(Q=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:S}),e[42]=S,e[43]=Q):Q=e[43];let U;e[44]!==w||e[45]!==Q?(U=(0,t.jsxs)(ge,{children:[w,Q]}),e[44]=w,e[45]=Q,e[46]=U):U=e[46];let H;e[47]!==j||e[48]!==U?(H=(0,t.jsxs)(ce,{children:[j,U]}),e[47]=j,e[48]=U,e[49]=H):H=e[49];let W;e[50]!==r?(W=r("Moderate queries"),e[50]=r,e[51]=W):W=e[51];let G;e[52]!==W?(G=(0,t.jsx)(ze,{className:"pb-2",children:(0,t.jsx)(Ae,{className:"text-sm font-medium",children:W})}),e[52]=W,e[53]=G):G=e[53];let B;e[54]!==$?(B=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:$}),e[54]=$,e[55]=B):B=e[55];let V;e[56]!==r?(V=r("50\u2013100ms avg execution"),e[56]=r,e[57]=V):V=e[57];let X;e[58]!==V?(X=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:V}),e[58]=V,e[59]=X):X=e[59];let Y;e[60]!==B||e[61]!==X?(Y=(0,t.jsxs)(ge,{children:[B,X]}),e[60]=B,e[61]=X,e[62]=Y):Y=e[62];let Z;e[63]!==G||e[64]!==Y?(Z=(0,t.jsxs)(ce,{children:[G,Y]}),e[63]=G,e[64]=Y,e[65]=Z):Z=e[65];let ee;e[66]!==r?(ee=r("Fast queries"),e[66]=r,e[67]=ee):ee=e[67];let te;e[68]!==ee?(te=(0,t.jsx)(ze,{className:"pb-2",children:(0,t.jsx)(Ae,{className:"text-sm font-medium",children:ee})}),e[68]=ee,e[69]=te):te=e[69];let re;e[70]!==me?(re=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:me}),e[70]=me,e[71]=re):re=e[71];let ae;e[72]!==r?(ae=r("<50ms avg execution"),e[72]=r,e[73]=ae):ae=e[73];let le;e[74]!==ae?(le=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ae}),e[74]=ae,e[75]=le):le=e[75];let i;e[76]!==re||e[77]!==le?(i=(0,t.jsxs)(ge,{children:[re,le]}),e[76]=re,e[77]=le,e[78]=i):i=e[78];let C;e[79]!==te||e[80]!==i?(C=(0,t.jsxs)(ce,{children:[te,i]}),e[79]=te,e[80]=i,e[81]=C):C=e[81],e[82]!==H||e[83]!==Z||e[84]!==C?(y=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[H,Z,C]}),e[82]=H,e[83]=Z,e[84]=C,e[85]=y):y=e[85];let O;e[86]!==r?(O=r("Query leaderboard"),e[86]=r,e[87]=O):O=e[87];let K;e[88]!==O?(K=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:O}),e[88]=O,e[89]=K):K=e[89];let se;e[90]!==a||e[91]!==r?(se=r("Slow queries sorted by {sortField}",{sortField:r(a)}),e[90]=a,e[91]=r,e[92]=se):se=e[92];let pe;e[93]!==se?(pe=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:se}),e[93]=se,e[94]=pe):pe=e[94];let fe;e[95]!==K||e[96]!==pe?(fe=(0,t.jsxs)("div",{children:[K,pe]}),e[95]=K,e[96]=pe,e[97]=fe):fe=e[97];let xe;e[98]!==r?(xe=r("Sort by"),e[98]=r,e[99]=xe):xe=e[99];let be;e[100]!==xe?(be=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:xe}),e[100]=xe,e[101]=be):be=e[101];let ve;e[102]!==r?(ve=r("Sort queries by"),e[102]=r,e[103]=ve):ve=e[103];let Je;e[104]===Symbol.for("react.memo_cache_sentinel")?(Je=(0,t.jsx)(Dt,{}),e[104]=Je):Je=e[104];let ye;e[105]!==ve?(ye=(0,t.jsx)(Ft,{"aria-label":ve,className:"w-[140px]","data-testid":"qi-sort",children:Je}),e[105]=ve,e[106]=ye):ye=e[106];let Ne;e[107]!==r?(Ne=r("Total time"),e[107]=r,e[108]=Ne):Ne=e[108];let we;e[109]!==Ne?(we=(0,t.jsx)(Ee,{value:"totalTime",children:Ne}),e[109]=Ne,e[110]=we):we=e[110];let Se;e[111]!==r?(Se=r("Avg time"),e[111]=r,e[112]=Se):Se=e[112];let qe;e[113]!==Se?(qe=(0,t.jsx)(Ee,{value:"avgTime",children:Se}),e[113]=Se,e[114]=qe):qe=e[114];let ke;e[115]!==r?(ke=r("Execution count"),e[115]=r,e[116]=ke):ke=e[116];let $e;e[117]!==ke?($e=(0,t.jsx)(Ee,{value:"execCount",children:ke}),e[117]=ke,e[118]=$e):$e=e[118];let _e;e[119]!==r?(_e=r("Rows read"),e[119]=r,e[120]=_e):_e=e[120];let Me;e[121]!==_e?(Me=(0,t.jsx)(Ee,{value:"rowsRead",children:_e}),e[121]=_e,e[122]=Me):Me=e[122];let Ie;e[123]!==we||e[124]!==qe||e[125]!==$e||e[126]!==Me?(Ie=(0,t.jsxs)(Tt,{children:[we,qe,$e,Me]}),e[123]=we,e[124]=qe,e[125]=$e,e[126]=Me,e[127]=Ie):Ie=e[127];let Ce;e[128]!==a||e[129]!==ye||e[130]!==Ie?(Ce=(0,t.jsxs)(Ct,{onValueChange:v,value:a,children:[ye,Ie]}),e[128]=a,e[129]=ye,e[130]=Ie,e[131]=Ce):Ce=e[131];let De;e[132]!==be||e[133]!==Ce?(De=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[be,Ce]}),e[132]=be,e[133]=Ce,e[134]=De):De=e[134],e[135]!==fe||e[136]!==De?(q=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[fe,De]}),e[135]=fe,e[136]=De,e[137]=q):q=e[137],m=ce;let Fe;e[138]!==r?(Fe=r("Statements"),e[138]=r,e[139]=Fe):Fe=e[139];let Qe;e[140]!==Fe?(Qe=(0,t.jsx)(Ae,{children:Fe}),e[140]=Fe,e[141]=Qe):Qe=e[141],D=(0,t.jsxs)(ze,{children:[Qe,(0,t.jsx)(gt,{children:r("{count} tracked statements",{count:A.length})})]}),h=ge,L="space-y-2";let Ue;e[142]!==g||e[143]!==r?(Ue=n(p=>{let ie=p.normalizedSql,E=g.has(ie),he=Ve(p.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":E,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:n(()=>{Le(ie)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(tr,{level:he}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:p.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Pe(p.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:r("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Pe(p.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:r("avg")})]}),p.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Pe(p.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:r("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Be(p.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:r("calls")})]})]})]}),E&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:r("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:p.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[p.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Pe(p.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Be(p.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Pe(p.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Be(p.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Be(p.rowsWritten)})]})]})]})]},ie)},"Ee"),e[142]=g,e[143]=r,e[144]=Ue):Ue=e[144],k=A.map(Ue)}e[2]=g,e[3]=s,e[4]=a,e[5]=r,e[6]=h,e[7]=m,e[8]=b,e[9]=L,e[10]=k,e[11]=D,e[12]=z,e[13]=o,e[14]=y,e[15]=q}else h=e[6],m=e[7],b=e[8],L=e[9],k=e[10],D=e[11],z=e[12],o=e[13],y=e[14],q=e[15];if(b!==Symbol.for("react.early_return_sentinel"))return b;let F;e[145]!==L||e[146]!==k?(F=(0,t.jsx)("div",{className:L,children:k}),e[145]=L,e[146]=k,e[147]=F):F=e[147];let T;e[148]!==h||e[149]!==F?(T=(0,t.jsx)(h,{children:F}),e[148]=h,e[149]=F,e[150]=T):T=e[150];let M;e[151]!==m||e[152]!==T||e[153]!==D?(M=(0,t.jsxs)(m,{children:[D,T]}),e[151]=m,e[152]=T,e[153]=D,e[154]=M):M=e[154];let N;return e[155]!==M||e[156]!==z||e[157]!==o||e[158]!==y||e[159]!==q?(N=(0,t.jsxs)("div",{className:z,"data-testid":o,children:[y,q,M]}),e[155]=M,e[156]=z,e[157]=o,e[158]=y,e[159]=q,e[160]=N):N=e[160],N},"ar");function lr(l){return Ve(l.avgDurationMs)==="critical"}n(lr,"sr");function sr(l){return Ve(l.avgDurationMs)==="warning"}n(sr,"lr");function nr(l){return Ve(l.avgDurationMs)==="good"}n(nr,"nr");var ir=["1m","5m","15m","1h"],or=n(l=>new Date(l).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"or"),dr=n(l=>l.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:or(e.bucketMs)})),"dr"),cr=n(({shardKey:l=""})=>{let e=Te(),[s,r]=(0,_.useState)("15m"),a=Re(Oe.getQueryInsights,{range:s},{live:!0,shardKey:l}).data,u=dr(a?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:ir.map(c=>(0,t.jsx)("button",{"aria-pressed":c===s,className:ht("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",c===s&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${c}`,onClick:n(()=>{r(c)},"onClick"),type:"button",children:c},c))}),a?.capped===!0&&(0,t.jsx)(We,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),u.length===0?(0,t.jsx)(pt,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(et,{height:140,width:"100%",children:(0,t.jsxs)(St,{data:u,children:[(0,t.jsx)(rt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(at,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(lt,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(tt,{}),(0,t.jsx)(Nt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(et,{height:140,width:"100%",children:(0,t.jsxs)(wt,{data:u,children:[(0,t.jsx)(rt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(at,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(lt,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(tt,{}),(0,t.jsx)(yt,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(ar,{queryStats:a?.entries??[]})]})},"cr"),mr=ft(Oe.getMetrics),ur=n(l=>{let e=Math.floor(l/1e3),s=Math.floor(e/3600),r=Math.floor(e%3600/60),a=e%60;return s>0?`${s.toString()}h ${r.toString()}m`:r>0?`${r.toString()}m ${a.toString()}s`:`${a.toString()}s`},"ur"),hr=n((l,e)=>l?e:"overview","hr"),gr=n((l,e)=>{let s=l+e;return s===0?"\u2014":`${(l/s*100).toFixed(1)}%`},"gr"),oe=n(l=>{let e=(0,Ke.c)(16),{chart:s,footer:r,label:a,testId:u,value:c}=l,g;e[0]!==a?(g=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a}),e[0]=a,e[1]=g):g=e[1];let f;e[2]!==u||e[3]!==c?(f=(0,t.jsx)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":u,children:c}),e[2]=u,e[3]=c,e[4]=f):f=e[4];let x;e[5]!==s||e[6]!==f?(x=(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[f,s]}),e[5]=s,e[6]=f,e[7]=x):x=e[7];let v;e[8]!==g||e[9]!==x?(v=(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[g,x]}),e[8]=g,e[9]=x,e[10]=v):v=e[10];let h;e[11]!==r?(h=r!=null&&(0,t.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:r}),e[11]=r,e[12]=h):h=e[12];let m;return e[13]!==v||e[14]!==h?(m=(0,t.jsxs)(ce,{className:"justify-between gap-0 py-0",children:[v,h]}),e[13]=v,e[14]=h,e[15]=m):m=e[15],m},"ne"),jt=n(l=>l<=0?"\u2014":l<1?`${(l*1e3).toFixed(0)}\u03BCs`:l<1e3?`${l.toFixed(1)}ms`:`${(l/1e3).toFixed(2)}s`,"dt"),Ar=n(({initialShardKey:l})=>{let e=mt(),s=Te(),r=ut(),[a,u]=(0,_.useState)(l??""),[c,g]=(0,_.useState)("overview"),[f,x]=(0,_.useState)([]),v=(0,_.useRef)(null),h=(0,_.useRef)(null),m=(0,_.useRef)(!0);(0,_.useEffect)(()=>(m.current=!0,()=>{m.current=!1}),[]);let b=_t(a.trim(),400),L=n(d=>{Rt({shardKey:b,traceId:d}),Ze(r({to:"/traces"}))},"O"),{data:k,error:D,liveError:z}=Re(Oe.getMetrics,{},{live:!0,shardKey:b}),o=k??null;(0,_.useEffect)(()=>{if(k===void 0)return;kt(b);let d=k,j=v.current,w=h.current!==null&&h.current!==d.shard;if(h.current=d.shard,v.current=d.requests,w){x([]);return}j!==null&&d.requests>=j&&x(S=>[...S,d.requests-j].slice(-30))},[k,b]);let[y,q]=(0,_.useState)(null),[F,T]=(0,_.useState)(!1),M=n(async()=>{T(!0);let d=Lt(a,qt());try{let j=await Promise.all(d.map(async w=>{try{let S=await e.query(mr,{},xt(w));return{error:null,metrics:S,shard:w===""?S.shard:w}}catch(S){return{error:bt(S),metrics:null,shard:w===""?"__root__":w}}}));m.current&&q(j)}finally{m.current&&T(!1)}},"_"),N=y===null?null:Kt(y),A=o===null||o.requests===0?"\u2014":`${(o.errors/o.requests*100).toFixed(1)}%`,J=f.length>0?f.at(-1):0,R=o?zt(o):{p90:0,p95:0},I=(0,_.useMemo)(()=>{if(!o||!("queryStats"in o))return;let d=o.queryStats;if(!(!d||!Array.isArray(d)))return At(d)},[o]),$=hr(I!==void 0,c),de=n(()=>{Ze(M())},"oe"),me=n(()=>{q(null)},"de"),ue=n(()=>{g("overview")},"ce"),Le=n(()=>{g("query-insights")},"Fe");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)($t,{onChange:u,testId:"mt-shard-input",value:a}),(0,t.jsx)(Mt,{message:z,prefix:"mt"}),(0,t.jsx)(Ye,{"data-testid":"mt-aggregate",disabled:F,onClick:de,size:"sm",type:"button",variant:"secondary",children:s(F?"Aggregating\u2026":"All shards")}),y!==null&&(0,t.jsx)(Ye,{"data-testid":"mt-aggregate-clear",onClick:me,size:"sm",type:"button",variant:"ghost",children:s("Hide")}),(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:It,rel:"noreferrer",target:"_blank",children:s("Open in Cloudflare")})]}),D!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:D}),I!==void 0&&(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsx)("button",{className:`pb-2 text-sm font-medium transition-colors ${$==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:ue,type:"button",children:s("Overview")}),(0,t.jsxs)("button",{className:`pb-2 text-sm font-medium transition-colors ${$==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:Le,type:"button",children:[s("Query insights"),I.length>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:I.length})]})]}),$==="query-insights"&&I!==void 0&&(0,t.jsx)(cr,{shardKey:b}),$==="overview"&&o!==null&&(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[(0,t.jsx)(oe,{chart:f.length>=2?(0,t.jsx)(ot,{ariaLabel:s("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:f,testId:"mt-sparkline"}):void 0,footer:f.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${J.toLocaleString()}`})," ",s("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:s("collecting samples\u2026")}),label:s("Requests"),testId:"mt-requests",value:o.requests}),(0,t.jsx)(oe,{footer:s("{rate} error rate",{rate:A}),label:s("Errors"),testId:"mt-errors",value:(0,t.jsxs)(t.Fragment,{children:[o.errors," (",A,")"]})}),(0,t.jsx)(oe,{footer:R.p90>0?`P90 ${jt(R.p90)}`:void 0,label:s("P95 latency"),testId:"mt-p95",value:R.p95>0?jt(R.p95):"\u2014"}),(0,t.jsx)(oe,{footer:o.cache===null?void 0:`${o.cache.entries.toLocaleString()} ${s("cache entries")}`,label:s("Database size"),testId:"mt-db-size",value:Ge(o.databaseSize)}),(0,t.jsx)(oe,{label:s("Shard"),testId:"mt-shard",value:o.shard}),(0,t.jsx)(oe,{label:s("Uptime"),testId:"mt-uptime",value:ur(o.uptimeMs)}),(0,t.jsx)(oe,{label:s("Cache hit rate"),testId:"mt-cache",value:o.cache===null?s("no cache configured"):s("{rate} ({count} entries)",{count:o.cache.entries,rate:gr(o.cache.hits,o.cache.misses)})})]}),$==="overview"&&o===null&&null,$==="overview"&&(0,t.jsx)(er,{onOpenTrace:L,shardKey:b}),$==="overview"&&N!==null&&y!==null&&(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[(0,t.jsx)(oe,{label:s("Shards"),testId:"mt-agg-shards",value:N.failed>0?s("{reachable} reachable, {failed} unreachable",{failed:N.failed,reachable:N.reachable}):s("{reachable} reachable",{reachable:N.reachable})}),(0,t.jsx)(oe,{label:s("Total requests"),testId:"mt-agg-requests",value:N.totalRequests}),(0,t.jsx)(oe,{label:s("Total errors"),testId:"mt-agg-errors",value:N.totalErrors}),(0,t.jsx)(oe,{label:s("Total database size"),testId:"mt-agg-db-size",value:Ge(N.totalDatabaseSize)}),(0,t.jsx)(oe,{label:s("Combined cache hit rate"),testId:"mt-agg-cache",value:N.hitRate===null?s("no cache configured"):`${(N.hitRate*100).toFixed(1)}%`})]}),(0,t.jsx)(ce,{className:"overflow-hidden py-0",children:(0,t.jsx)(ge,{className:"px-0",children:(0,t.jsxs)(st,{"data-testid":"mt-agg-table",children:[(0,t.jsx)(nt,{children:(0,t.jsxs)(je,{children:[(0,t.jsx)(ne,{children:s("shard")}),(0,t.jsx)(ne,{children:s("requests")}),(0,t.jsx)(ne,{children:s("errors")}),(0,t.jsx)(ne,{children:s("db size")})]})}),(0,t.jsx)(it,{children:y.map(d=>(0,t.jsxs)(je,{"data-testid":`mt-agg-row-${d.shard}`,children:[(0,t.jsx)(P,{children:d.shard}),d.metrics===null?(0,t.jsx)(P,{className:"text-destructive",colSpan:3,children:d.error??s("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P,{className:"tabular-nums",children:d.metrics.requests}),(0,t.jsx)(P,{className:"tabular-nums",children:d.metrics.errors}),(0,t.jsx)(P,{className:"tabular-nums",children:Ge(d.metrics.databaseSize)})]})]},d.shard))})]})})})]})]})},"jr");export{Ar as MetricsPanel};
@@ -0,0 +1 @@
1
+ import{d as E}from"./chunk-6ST5ECQA.js";import{a as n,e as b,f as h}from"./chunk-3XIESWL4.js";var y=b(h(),1);var x=n(()=>{},"noop"),K=typeof document<"u"?y.useLayoutEffect:x;var _=b(h(),1),f={..._};var a=f.useInsertionEffect,W=a&&a!==f.useLayoutEffect?a:t=>t();function q(t){let e=E(B).current;return e.next=t,W(e.effect),e.trampoline}n(q,"useStableCallback");function B(){let t={next:void 0,callback:O,trampoline:n((...e)=>t.callback?.(...e),"trampoline"),effect:n(()=>{t.callback=t.next},"effect")};return t}n(B,"createStableCallback");function O(){}n(O,"assertNotCalled");function s(){return typeof window<"u"}n(s,"hasWindow");function m(t){return N(t)?(t.nodeName||"").toLowerCase():"#document"}n(m,"getNodeName");function i(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}n(i,"getWindow");function V(t){var e;return(e=(N(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}n(V,"getDocumentElement");function N(t){return s()?t instanceof Node||t instanceof i(t).Node:!1}n(N,"isNode");function C(t){return s()?t instanceof Element||t instanceof i(t).Element:!1}n(C,"isElement");function L(t){return s()?t instanceof HTMLElement||t instanceof i(t).HTMLElement:!1}n(L,"isHTMLElement");function S(t){return!s()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof i(t).ShadowRoot}n(S,"isShadowRoot");function R(t){let{overflow:e,overflowX:c,overflowY:u,display:o}=v(t);return/auto|scroll|overlay|hidden|clip/.test(e+u+c)&&o!=="inline"&&o!=="contents"}n(R,"isOverflowElement");function J(t){return/^(table|td|th)$/.test(m(t))}n(J,"isTableElement");function $(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}n($,"isTopLayer");var A=/transform|translate|scale|rotate|perspective|filter/,H=/paint|layout|strict|content/,r=n(t=>!!t&&t!=="none","isNotNone"),d;function I(t){let e=C(t)?v(t):t;return r(e.transform)||r(e.translate)||r(e.scale)||r(e.rotate)||r(e.perspective)||!M()&&(r(e.backdropFilter)||r(e.filter))||A.test(e.willChange||"")||H.test(e.contain||"")}n(I,"isContainingBlock");function Q(t){let e=p(t);for(;L(e)&&!k(e);){if(I(e))return e;if($(e))return null;e=p(e)}return null}n(Q,"getContainingBlock");function M(){return d==null&&(d=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),d}n(M,"isWebKit");function k(t){return/^(html|body|#document)$/.test(m(t))}n(k,"isLastTraversableNode");function v(t){return i(t).getComputedStyle(t)}n(v,"getComputedStyle");function Z(t){return C(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}n(Z,"getNodeScroll");function p(t){if(m(t)==="html")return t;let e=t.assignedSlot||t.parentNode||S(t)&&t.host||V(t);return S(e)?e.host:e}n(p,"getParentNode");function D(t){let e=p(t);return k(e)?t.ownerDocument?t.ownerDocument.body:t.body:L(e)&&R(e)?e:D(e)}n(D,"getNearestOverflowAncestor");function g(t,e,c){var u;e===void 0&&(e=[]),c===void 0&&(c=!0);let o=D(t),T=o===((u=t.ownerDocument)==null?void 0:u.body),l=i(o);if(T){let w=F(l);return e.concat(l,l.visualViewport||[],R(o)?o:[],w&&c?g(w):[])}else return e.concat(o,g(o,[],c))}n(g,"getOverflowAncestors");function F(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}n(F,"getFrameElement");export{K as a,f as b,q as c,m as d,i as e,V as f,N as g,C as h,L as i,S as j,R as k,J as l,$ as m,I as n,Q as o,M as p,k as q,v as r,Z as s,p as t,g as u,F as v};
@@ -0,0 +1 @@
1
+ import{a as n,e as E,f as S,h as m}from"./chunk-3XIESWL4.js";function u(t,e=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,r))}n(u,"clamp");var p=1;function x(t,e){return Math.max(0,t-e)}n(x,"getMaxScrollOffset");function A(t,e){if(e<=0)return 0;let r=u(t,0,e),l=r,c=e-r,a=l<=p,i=c<=p;return a&&i?l<=c?0:e:a?0:i?e:r}n(A,"normalizeScrollOffset");var f=E(m(),1),o="base-ui-disable-scrollbar",R={className:o,getElement(t){return(0,f.jsx)("style",{nonce:t,href:o,precedence:"base-ui:low",children:`.${o}{scrollbar-width:none}.${o}::-webkit-scrollbar{display:none}`})}};var s=E(S(),1);var b=s.createContext(void 0),C={disableStyleElements:!1};function y(){return s.useContext(b)??C}n(y,"useCSPContext");export{u as a,p as b,x as c,A as d,R as e,y as f};
@@ -0,0 +1 @@
1
+ import{a as O,b as v,c as N,d as b,e as _,f as M}from"./chunk-MIQTKZAR.js";import{a as k}from"./chunk-UZERI5YC.js";import{a as q}from"./chunk-XQCVZAGU.js";import{d as g,h as w,l as I,m as T}from"./chunk-OG4N2XHD.js";import{c as L}from"./chunk-AADILRJW.js";import{a as u,e as x,f as P,g as U,h as W}from"./chunk-3XIESWL4.js";var $=x(U(),1);var F="https://api.cloudflare.com/client/v4/accounts",E=class extends L{static{u(this,"c")}constructor(t,m){super("ANALYTICS_SQL_ERROR",`Analytics Engine SQL API returned ${String(t)}: ${m}`,{name:"AnalyticsSqlError",status:t})}},R=u(n=>{let t=n.fetch??globalThis.fetch,m=`${F}/${encodeURIComponent(n.accountId)}/analytics_engine/sql`;return{query:u(async p=>{let l=await t(m,{body:p,headers:{Authorization:`Bearer ${n.apiToken}`,"Content-Type":"text/plain"},method:"POST"});if(!l.ok)throw new E(l.status,await l.text());let r;try{r=await l.json()}catch{throw new E(l.status,"Analytics Engine SQL API returned a non-JSON body.")}let e=r,s=e.data??[];return{columns:e.meta??[],rowCount:e.rows??s.length,rows:s}},"query")}},"d");var y=x(P(),1);var a=x(W(),1);var H="ANALYTICS",D=[{key:"volume",sql:u(n=>`SELECT blob2 AS fn, count() AS calls FROM ${n} WHERE blob1 = 'function_call' GROUP BY fn ORDER BY calls DESC LIMIT 25`,"sql"),title:"Request volume per function"},{key:"latency",sql:u(n=>`SELECT blob2 AS fn, quantileWeighted(0.50)(double1, _sample_interval) AS p50, quantileWeighted(0.95)(double1, _sample_interval) AS p95 FROM ${n} WHERE blob1 = 'function_call' GROUP BY fn ORDER BY p95 DESC LIMIT 25`,"sql"),title:"Latency p50 / p95 per function"},{key:"hotShards",sql:u(n=>`SELECT blob3 AS shard, count() AS calls FROM ${n} WHERE blob1 = 'function_call' GROUP BY shard ORDER BY calls DESC LIMIT 25`,"sql"),title:"Hot shards"}],j={error:null,loading:!0,result:null},Q=u(n=>{let t=(0,$.c)(27),{state:m,title:p}=n,l=g(),{error:r,loading:e,result:s}=m,o=`analytics-panel-${p}`,c;t[0]!==l||t[1]!==p?(c=l(p),t[0]=l,t[1]=p,t[2]=c):c=t[2];let i;t[3]!==c?(i=(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:c})}),t[3]=c,t[4]=i):i=t[4];let d;t[5]!==e||t[6]!==l?(d=e&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"analytics-loading",children:l("Loading\u2026")}),t[5]=e,t[6]=l,t[7]=d):d=t[7];let f;t[8]!==r||t[9]!==e?(f=!e&&r!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"analytics-error",role:"alert",children:r}),t[8]=r,t[9]=e,t[10]=f):f=t[10];let h;t[11]!==r||t[12]!==e||t[13]!==s||t[14]!==l?(h=!e&&r===null&&s!==null&&s.rows.length===0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"analytics-empty-rows",children:l("No data points yet.")}),t[11]=r,t[12]=e,t[13]=s,t[14]=l,t[15]=h):h=t[15];let A;t[16]!==r||t[17]!==e||t[18]!==s?(A=!e&&r===null&&s!==null&&s.rows.length>0&&(0,a.jsxs)(O,{children:[(0,a.jsx)(v,{children:(0,a.jsx)(b,{children:s.columns.map(G)})}),(0,a.jsx)(N,{children:s.rows.map((B,Y)=>(0,a.jsx)(b,{children:s.columns.map(C=>(0,a.jsx)(M,{className:"font-mono text-xs",children:I(B[C.name])},C.name))},Y))})]}),t[16]=r,t[17]=e,t[18]=s,t[19]=A):A=t[19];let S;return t[20]!==o||t[21]!==i||t[22]!==d||t[23]!==f||t[24]!==h||t[25]!==A?(S=(0,a.jsxs)(k,{className:"gap-0 py-0","data-testid":o,children:[i,d,f,h,A]}),t[20]=o,t[21]=i,t[22]=d,t[23]=f,t[24]=h,t[25]=A,t[26]=S):S=t[26],S},"U"),rt=u(({config:n,dataset:t=H,runQuery:m}={})=>{let p=g(),[l,r]=(0,y.useState)({}),e=(0,y.useMemo)(()=>{if(m!==void 0)return m;if(n===void 0)return null;let o=R({accountId:n.accountId,apiToken:n.apiToken});return c=>o.query(c)},[n,m]),s=(0,y.useCallback)(async o=>{if(e!==null)for(let c of D){if(o.cancelled)return;r(i=>({...i,[c.key]:{error:null,loading:!0,result:null}}));try{let i=await e(c.sql(t));o.cancelled||r(d=>({...d,[c.key]:{error:null,loading:!1,result:i}}))}catch(i){o.cancelled||r(d=>({...d,[c.key]:{error:w(i),loading:!1,result:null}}))}}},[e,t]);return(0,y.useEffect)(()=>{let o={cancelled:!1};return T(s(o)),()=>{o.cancelled=!0}},[s]),e===null?(0,a.jsx)(q,{description:p("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN (Analytics Read) in your .dev.vars to enable usage panels."),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:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"})}),testId:"analytics-not-configured",title:p("Analytics is not configured.")}):(0,a.jsx)("div",{className:"flex flex-col gap-4","data-testid":"lunora-analytics-panel",children:D.map(o=>(0,a.jsx)(Q,{state:l[o.key]??j,title:o.title},o.key))})},"Z");function G(n){return(0,a.jsx)(_,{children:n.name},n.name)}u(G,"H");export{rt as AnalyticsPanel};
@@ -0,0 +1 @@
1
+ var _={aiAvailable:"__lunora_admin__:aiAvailable",aiChartConfig:"__lunora_admin__:aiChartConfig",aiGenerateSql:"__lunora_admin__:aiGenerateSql",aiTableFilter:"__lunora_admin__:aiTableFilter",assignIssue:"__lunora_admin__:assignIssue",backRelationCounts:"__lunora_admin__:backRelationCounts",clearCapturedMail:"__lunora_admin__:clearCapturedMail",clearQueueMessages:"__lunora_admin__:clearQueueMessages",clearTable:"__lunora_admin__:clearTable",createWorkflowInstance:"__lunora_admin__:createWorkflowInstance",deleteRows:"__lunora_admin__:deleteRows",describeTable:"__lunora_admin__:describeTable",describeTables:"__lunora_admin__:describeTables",explainIssue:"__lunora_admin__:explainIssue",exportShard:"__lunora_admin__:exportShard",facetColumn:"__lunora_admin__:facetColumn",getAdvisories:"__lunora_admin__:getAdvisories",getAuditLog:"__lunora_admin__:getAuditLog",getAuthAuditLog:"__lunora_admin__:getAuthAuditLog",getAuthMetrics:"__lunora_admin__:getAuthMetrics",getCapturedMail:"__lunora_admin__:getCapturedMail",getFanoutMetrics:"__lunora_admin__:getFanoutMetrics",getFunctionStats:"__lunora_admin__:getFunctionStats",getIssues:"__lunora_admin__:getIssues",lintSql:"__lunora_admin__:lintSql",listFlags:"__lunora_admin__:listFlags",listPushSubscriptions:"__lunora_admin__:listPushSubscriptions",listQueues:"__lunora_admin__:listQueues",listSubscriptions:"__lunora_admin__:listSubscriptions",listTableIndexes:"__lunora_admin__:listTableIndexes",listWorkflows:"__lunora_admin__:listWorkflows",getLogs:"__lunora_admin__:getLogs",getMetricHistory:"__lunora_admin__:getMetricHistory",getMetricSeries:"__lunora_admin__:getMetricSeries",getMetrics:"__lunora_admin__:getMetrics",getPitrBookmark:"__lunora_admin__:getPitrBookmark",getQueryInsights:"__lunora_admin__:getQueryInsights",getQueueMessages:"__lunora_admin__:getQueueMessages",getRequestLog:"__lunora_admin__:getRequestLog",getSecurityAudit:"__lunora_admin__:getSecurityAudit",getSettings:"__lunora_admin__:getSettings",getTraces:"__lunora_admin__:getTraces",getWorkflowInstanceStatus:"__lunora_admin__:getWorkflowInstanceStatus",ignoreIssue:"__lunora_admin__:ignoreIssue",importShard:"__lunora_admin__:importShard",listTables:"__lunora_admin__:listTables",maskPolicies:"__lunora_admin__:maskPolicies",migrationStatus:"__lunora_admin__:migrationStatus",pitrRestore:"__lunora_admin__:pitrRestore",readTablePage:"__lunora_admin__:readTablePage",replayQueueMessage:"__lunora_admin__:replayQueueMessage",resolveIssue:"__lunora_admin__:resolveIssue",rlsPolicies:"__lunora_admin__:rlsPolicies",schemaHistory:"__lunora_admin__:schemaHistory",schemaVersion:"__lunora_admin__:schemaVersion",runAs:"__lunora_admin__:runAs",runMigration:"__lunora_admin__:runMigration",runSql:"__lunora_admin__:runSql",sendQueueMessage:"__lunora_admin__:sendQueueMessage",sendTestMail:"__lunora_admin__:sendTestMail",setIssueSeverity:"__lunora_admin__:setIssueSeverity",storageOrphans:"__lunora_admin__:storageOrphans",storageReferences:"__lunora_admin__:storageReferences",storageRules:"__lunora_admin__:storageRules",studioFeatures:"__lunora_admin__:studioFeatures",writeRow:"__lunora_admin__:writeRow"};export{_ as a};
@@ -0,0 +1 @@
1
+ import{a as q}from"./chunk-53WEPGUD.js";import"./chunk-XXQUMVWH.js";import"./chunk-RNL6BSFM.js";import"./chunk-QLQADHFE.js";import{c as O}from"./chunk-XDAT7LHC.js";import{a as G,b as J,c as K,d as M,e as a,f as o}from"./chunk-MIQTKZAR.js";import{a as W,e as B}from"./chunk-UZERI5YC.js";import{R as V}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as F}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as C}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as U}from"./chunk-2WOIRKEI.js";import"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as D}from"./chunk-XQCVZAGU.js";import{d as T,q as H}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as n,e as j,f as re,g as se,h as ie}from"./chunk-3XIESWL4.js";var X=j(se(),1),P=j(re(),1);var t=j(ie(),1);var ne=n(e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary","te"),Q=n(e=>e.endpoint??e.id,"P"),xe=n(()=>{let e=(0,X.c)(38),r=T(),[i,Y]=(0,P.useState)("all"),[l,Z]=(0,P.useState)(""),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let{data:_,error:c,errorSource:v,isLoading:I,refetch:x}=O(U.listPushSubscriptions,g),N;if(e[1]!==_?.subscriptions||e[2]!==c||e[3]!==v||e[4]!==I||e[5]!==i||e[6]!==x||e[7]!==l||e[8]!==r){let L=_?.subscriptions??[],z=l.trim().toLowerCase(),A=L.filter(s=>i!=="all"&&s.kind!==i?!1:z===""?!0:`${Q(s)} ${s.userId??""}`.toLowerCase().includes(z)),b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n(s=>{Z(s.target.value)},"b"),e[10]=b):b=e[10];let ee=b,w;e[11]!==x?(w=n(()=>{x()},"w"),e[11]=x,e[12]=w):w=e[12];let E=w,k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=["all","web-push","fcm"],e[13]=k):k=e[13];let te=k,d;e[14]!==i||e[15]!==r?(d=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:te.map(s=>(0,t.jsx)(F,{"aria-selected":i===s,"data-testid":`nt-kind-${s}`,onClick:n(()=>{Y(s)},"onClick"),role:"tab",size:"sm",type:"button",variant:i===s?"secondary":"ghost",children:s==="all"?r("All"):s},s))}),e[14]=i,e[15]=r,e[16]=d):d=e[16];let m;e[17]!==r?(m=r("Filter devices"),e[17]=r,e[18]=m):m=e[18];let h;e[19]!==r?(h=r("filter endpoint, user"),e[19]=r,e[20]=h):h=e[20];let u;e[21]!==l||e[22]!==m||e[23]!==h?(u=(0,t.jsx)(V,{"aria-label":m,className:"h-8 w-56","data-testid":"nt-search",onChange:ee,placeholder:h,value:l}),e[21]=l,e[22]=m,e[23]=h,e[24]=u):u=e[24];let f;e[25]!==r?(f=r("Refresh"),e[25]=r,e[26]=f):f=e[26];let p;e[27]!==E||e[28]!==f?(p=(0,t.jsx)(F,{className:"ml-auto","data-testid":"nt-refresh",onClick:E,size:"sm",type:"button",variant:"outline",children:f}),e[27]=E,e[28]=f,e[29]=p):p=e[29];let $=L.length>0&&(0,t.jsx)(C,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:L.length})}),y;e[30]!==p||e[31]!==$||e[32]!==d||e[33]!==u?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[d,u,p,$]}),e[30]=p,e[31]=$,e[32]=d,e[33]=u,e[34]=y):y=e[34];let S;e[35]!==c||e[36]!==v?(S=c!==null&&(0,t.jsx)(q,{error:v,testId:"nt-error"}),e[35]=c,e[36]=v,e[37]=S):S=e[37],N=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[y,S,c===null&&!I&&A.length===0&&(0,t.jsx)(D,{description:r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),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:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"})}),testId:"nt-empty",title:r("No registered devices.")}),A.length>0&&(0,t.jsx)(W,{className:"overflow-hidden py-0",children:(0,t.jsx)(B,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(G,{"data-testid":"nt-table",children:[(0,t.jsx)(J,{children:(0,t.jsxs)(M,{children:[(0,t.jsx)(a,{children:r("kind")}),(0,t.jsx)(a,{children:r("endpoint")}),(0,t.jsx)(a,{children:r("user")}),(0,t.jsx)(a,{children:r("last seen")}),(0,t.jsx)(a,{children:r("status")}),(0,t.jsx)(a,{children:r("error")})]})}),(0,t.jsx)(K,{children:A.map(s=>{let R=Q(s);return(0,t.jsxs)(M,{"data-testid":"nt-row",children:[(0,t.jsx)(o,{children:(0,t.jsx)(C,{variant:"outline",children:s.kind})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs",title:R,children:R}),(0,t.jsx)(o,{className:"max-w-[16ch] truncate font-mono text-xs",children:s.userId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(o,{className:"text-muted-foreground tabular-nums",children:H(s.lastSeenAt,"\u2014")}),(0,t.jsx)(o,{children:(0,t.jsx)(C,{"data-testid":`nt-status-${s.id}`,variant:ne(s.lastStatus),children:s.lastStatus??r("n/a")})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:s.lastError??void 0,children:s.lastError??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},s.id)})})]})})})]}),e[1]=_?.subscriptions,e[2]=c,e[3]=v,e[4]=I,e[5]=i,e[6]=x,e[7]=l,e[8]=r,e[9]=N}else N=e[9];return N},"ve");export{xe as NotificationsPanel};
@@ -0,0 +1 @@
1
+ import{a as E}from"./chunk-54MMVNPT.js";import{b as $}from"./chunk-XDAT7LHC.js";import{a as z,b as B,c as C,d as g,e as n,f as i}from"./chunk-MIQTKZAR.js";import{a as S,e as I}from"./chunk-UZERI5YC.js";import{c as w}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{f as b}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as j}from"./chunk-XQCVZAGU.js";import{d as k,m as R,q as _}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as h,e as y,g as O,h as P}from"./chunk-3XIESWL4.js";var L=y(O(),1);var s=y(P(),1);var T=200,U=h(()=>{let e=(0,L.c)(21),l=b(),t=k(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=["lunora-auth-sessions",T],e[0]=u):u=e[0];let p;e[1]!==l?(p=h(()=>l.listAuthSessions({limit:T}),"u"),e[1]=l,e[2]=p):p=e[2];let o=$(u,p),{error:f}=o,a=o.data?.rows??null,x;e[3]!==o?(x=h(()=>{o.refetch()},"f"),e[3]=o,e[4]=x):x=e[4],E(x,!0);let N;e[5]!==l||e[6]!==o?(N=h(r=>{R((async()=>{await l.revokeAuthSession({sessionId:r}),o.refetch()})())},"x"),e[5]=l,e[6]=o,e[7]=N):N=e[7];let A=N,d;e[8]!==f?(d=f!==null&&(0,s.jsx)("p",{className:"text-sm text-destructive","data-testid":"auth-sessions-error",role:"alert",children:f}),e[8]=f,e[9]=d):d=e[9];let c;e[10]!==a||e[11]!==t?(c=a!==null&&a.length===0&&(0,s.jsx)(j,{testId:"auth-sessions-empty",title:t("No active sessions.")}),e[10]=a,e[11]=t,e[12]=c):c=e[12];let m;e[13]!==A||e[14]!==a||e[15]!==t?(m=a!==null&&a.length>0&&(0,s.jsx)(S,{className:"overflow-hidden py-0",children:(0,s.jsx)(I,{className:"px-0",children:(0,s.jsxs)(z,{"data-testid":"auth-sessions-table",children:[(0,s.jsx)(B,{children:(0,s.jsxs)(g,{children:[(0,s.jsx)(n,{children:t("user")}),(0,s.jsx)(n,{children:t("expires")}),(0,s.jsx)(n,{children:t("ip")}),(0,s.jsx)(n,{children:t("user agent")}),(0,s.jsx)(n,{children:t("impersonated by")}),(0,s.jsx)(n,{"aria-label":t("Actions")})]})}),(0,s.jsx)(C,{children:a.map(r=>(0,s.jsxs)(g,{"data-testid":`auth-session-${r.id}`,children:[(0,s.jsx)(i,{className:"font-mono text-xs",children:r.userId}),(0,s.jsx)(i,{className:"text-muted-foreground tabular-nums",children:_(r.expiresAt)}),(0,s.jsx)(i,{children:r.ipAddress??""}),(0,s.jsx)(i,{className:"max-w-40 truncate",children:r.userAgent??""}),(0,s.jsx)(i,{className:"font-mono text-xs",children:r.impersonatedBy??""}),(0,s.jsx)(i,{children:(0,s.jsx)(w,{"data-testid":`auth-session-revoke-${r.id}`,onClick:h(()=>{A(r.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Revoke")})})]},r.id))})]})})}),e[13]=A,e[14]=a,e[15]=t,e[16]=m):m=e[16];let v;return e[17]!==d||e[18]!==c||e[19]!==m?(v=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-sessions",children:[d,c,m]}),e[17]=d,e[18]=c,e[19]=m,e[20]=v):v=e[20],v},"Q");export{U as AuthSessionsPanel};
@@ -0,0 +1 @@
1
+ import{a as s}from"./chunk-3XIESWL4.js";var g=new Set(["contains","eq","gt","gte","lt","lte","ne"]),n=s(t=>{if(typeof t!="string")return;let e=t.trim();return e===""?void 0:e},"i"),v=s(t=>{if(t===null||typeof t!="object")return!1;let e=t;return typeof e.column=="string"&&typeof e.operator=="string"&&g.has(e.operator)},"v"),h=s(t=>{if(typeof t!="string"||t==="")return[];try{let e=JSON.parse(t);return Array.isArray(e)?e.filter(v):[]}catch{return[]}},"l"),f=s(t=>{if(typeof t!="string"||t==="")return;let e=t.lastIndexOf(":");if(e<=0)return;let o=t.slice(0,e),i=t.slice(e+1);if(!(i!=="asc"&&i!=="desc"))return{column:o,direction:i}},"h"),p=/^[\da-f]{16}$/u,u=s(t=>{let e={};if(typeof t.pins=="string"&&t.pins!==""){let c=t.pins.split(",").filter(d=>d!==""&&d.length<=64).slice(0,12);c.length>0&&(e.pins=c.join(","))}t.schema==="global"&&(e.schema="global");let o=n(t.table);o!==void 0&&(e.table=o);let i=n(t.shard);i!==void 0&&(e.shard=i);let l=n(t.search);l!==void 0&&(e.search=l);let r=n(t.order);r!==void 0&&f(r)!==void 0&&(e.order=r);let a=n(t.filters);return a!==void 0&&h(a).length>0&&(e.filters=a),e},"p"),y=s(t=>{let e=h(t.filters),o=f(t.order);return{filters:e.length>0?e:void 0,orderBy:o,search:typeof t.search=="string"&&t.search!==""?t.search:void 0,shard:typeof t.shard=="string"&&t.shard!==""?t.shard:void 0,table:typeof t.table=="string"&&t.table!==""?t.table:void 0,tier:t.schema==="global"?"global":"shard"}},"u"),b=s(t=>{let e=t.filters??[];return{filters:e.length>0?JSON.stringify(e):void 0,order:t.orderBy===void 0?void 0:`${t.orderBy.column}:${t.orderBy.direction}`,schema:t.tier==="global"?"global":void 0,search:t.search!==void 0&&t.search!==""?t.search:void 0,shard:t.shard!==void 0&&t.shard!==""?t.shard:void 0,table:t.table!==void 0&&t.table!==""?t.table:void 0}},"y"),m=s(t=>{let{version:e}=t;return typeof e=="string"&&p.test(e)?{version:e}:{}},"b");export{u as a,y as b,b as c,m as d};
@@ -0,0 +1 @@
1
+ import{a as G}from"./chunk-V53KNYRN.js";import{a as g}from"./chunk-5Y3QLNWX.js";import{a as B}from"./chunk-X665E2HU.js";import{b as U}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as O}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as h}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as w}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as M}from"./chunk-2WOIRKEI.js";import{f as D}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{d as K,e as _,f as z,h as P,m as q,q as E}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as s,e as T,f as ie,h as oe}from"./chunk-3XIESWL4.js";var i=T(ie(),1);var e=T(oe(),1);var de=s(r=>r.kind==="id"?r.table===void 0?"id":`id<${r.table}>`:r.kind==="array"?r.element===void 0?"array":`${r.element}[]`:r.kind,"ie"),le=s(r=>r===void 0||r.length===0?"()":`(${r.map(o=>`${o.name}${o.optional?"?":""}: ${de(o)}`).join(", ")})`,"oe"),ue=s(r=>{switch(r){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},"de"),ce=s(r=>{let o={};for(let a of r??[])a.optional||(o[a.name]=ue(a.kind));return JSON.stringify(o,void 0,2)},"le"),me=z(M.runAs),fe=10,pe=s(r=>r===void 0?"undefined":JSON.stringify(r,null,2),"me"),Fe=s(({functions:r,runAsIdentity:o=!1}={})=>{let a=K(),c=D(),[H,Q]=(0,i.useState)(null),[k,V]=(0,i.useState)(null),x=r??H??[],[I,S]=(0,i.useState)(""),[m,b]=(0,i.useState)("{}"),[u,F]=(0,i.useState)(""),[f,W]=(0,i.useState)(""),[v,p]=(0,i.useState)("idle"),[X,y]=(0,i.useState)(void 0),[C,N]=(0,i.useState)(null),[$,Y]=(0,i.useState)([]);(0,i.useEffect)(()=>{if(r!==void 0)return;let t=!1;return c.listFunctions().then(d=>(t||Q(d),d)).catch(d=>{t||V(P(d))}),()=>{t=!0}},[c,r]);let j=I===""?x[0]?.path??"":I,n=x.find(t=>t.path===j),Z=s(async()=>{if(!n)return;let t;try{t=m.trim()===""?{}:JSON.parse(m)}catch(l){p("error"),y(void 0),N(a("Invalid JSON args: {message}",{message:l.message}));return}let d={__lunoraRef:n.path},R=u.trim()===""?{}:{shardKey:u.trim()},A=o?f.trim():"",J=s(l=>{Y(L=>[{argsText:m,at:Date.now(),id:(L[0]?.id??0)+1,kind:n.kind,path:n.path,shardKey:u,status:l},...L].slice(0,fe))},"A");p("running"),N(null);try{let l=A===""?await _(c,n.kind,d,t,R):await c.query(me,{args:t,functionPath:n.path,userId:A},R);U(u),y(l),p("success"),J("success")}catch(l){y(void 0),N(l.message),p("error"),J("error")}},"_"),ee=s(t=>{S(t.path),b(t.argsText),F(t.shardKey)},"q"),te=s(t=>{S(t.target.value)},"B"),re=s(t=>{b(t.target.value)},"D"),ae=s(t=>{W(t.target.value)},"E"),se=s(()=>{q(Z())},"U"),ne=s(()=>{b(ce(n?.args))},"X");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[k!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:k}),(0,e.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)(g,{htmlFor:"function-select",children:a("Function")}),(0,e.jsx)("select",{"aria-label":a("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:te,value:j,children:x.map(t=>(0,e.jsxs)("option",{value:t.path,children:[t.path," (",t.kind,")"]},t.path))}),n!==void 0&&(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"mr-1.5 font-medium",children:a("Signature")}),(0,e.jsx)("code",{className:"font-mono","data-testid":"function-signature",children:le(n.args)})]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)(g,{htmlFor:"args-input",children:a("Arguments")}),(0,e.jsx)(h,{"data-testid":"prefill-button",disabled:n===void 0,onClick:ne,size:"xs",type:"button",variant:"ghost",children:a("Prefill")})]}),(0,e.jsx)(G,{"aria-label":a("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:re,value:m})]}),(0,e.jsx)(B,{onChange:F,testId:"shard-input",value:u}),o&&(0,e.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,e.jsx)(g,{htmlFor:"run-as-input",children:a("Run as identity (userId)")}),(0,e.jsx)(O,{"aria-label":a("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:ae,placeholder:a("Leave empty to run as admin"),value:f}),(0,e.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(h,{"data-testid":"run-button",disabled:v==="running"||n===void 0,onClick:se,type:"button",children:a("Run")}),n!==void 0&&(0,e.jsx)(w,{variant:"outline",children:n.kind}),o&&f.trim()!==""&&(0,e.jsx)(w,{"data-testid":"run-as-badge",variant:"secondary",children:a("as {userId}",{userId:f.trim()})})]})]}),v==="error"&&C!==null&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:C}),v==="success"&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:pe(X)}),$.length>0&&(0,e.jsx)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:$.map((t,d)=>(0,e.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,e.jsx)("span",{className:t.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:t.status==="success"?"\u2713":"\u2717"})," ",(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t.path," (",t.kind,")"]})," ",(0,e.jsx)("time",{className:"text-xs text-muted-foreground",children:E(t.at)})," ",(0,e.jsx)(h,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:s(()=>{ee(t)},"onClick"),size:"xs",type:"button",variant:"ghost",children:a("Load")})]},t.id))})]})},"Ie");export{Fe as FunctionRunner};
@@ -0,0 +1 @@
1
+ import{a as ae}from"./chunk-UZERI5YC.js";import{a as le}from"./chunk-HPFLBYRI.js";import{b as re}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{d as de,f as oe}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as me}from"./chunk-XQCVZAGU.js";import{d as ce,q as pe}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as k,e as ie,g as xe,h as ge,j as Z}from"./chunk-3XIESWL4.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};