@lunora/studio 1.0.0-alpha.361 → 1.0.0-alpha.362

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 (327) hide show
  1. package/dist/index.d.mts +4 -1
  2. package/dist/index.d.ts +4 -1
  3. package/dist/index.mjs +1 -1
  4. package/dist/mount.mjs +1 -1
  5. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -1
  6. package/dist/packem_chunks/ApiTab.mjs +1 -1
  7. package/dist/packem_chunks/AuditPanel.mjs +1 -1
  8. package/dist/packem_chunks/ExportImportPanel.mjs +1 -1
  9. package/dist/packem_chunks/FileBrowser.mjs +1 -1
  10. package/dist/packem_chunks/FunctionRunner.mjs +1 -1
  11. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -1
  12. package/dist/packem_chunks/HealthPanel.mjs +1 -1
  13. package/dist/packem_chunks/InsightsPanel.mjs +1 -1
  14. package/dist/packem_chunks/LogsPanel.mjs +1 -1
  15. package/dist/packem_chunks/MailPanel.mjs +1 -1
  16. package/dist/packem_chunks/MetricsPanel.mjs +1 -1
  17. package/dist/packem_chunks/NotificationsPanel.mjs +1 -1
  18. package/dist/packem_chunks/PitrPanel.mjs +1 -1
  19. package/dist/packem_chunks/SchemaViewer.mjs +1 -1
  20. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -1
  21. package/dist/packem_chunks/SettingsPanel.mjs +1 -1
  22. package/dist/packem_chunks/SqlEditorPanel.mjs +24 -9
  23. package/dist/packem_chunks/TableEditor.mjs +1 -1
  24. package/dist/packem_chunks/agents-panel.mjs +1 -1
  25. package/dist/packem_chunks/ai-knowledge.mjs +1 -0
  26. package/dist/packem_chunks/ai-usage-panel.mjs +1 -1
  27. package/dist/packem_chunks/assistant-panel.mjs +3 -0
  28. package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
  29. package/dist/packem_chunks/containers-panel.mjs +1 -1
  30. package/dist/packem_chunks/dashboards-panel.mjs +1 -1
  31. package/dist/packem_chunks/evals-panel.mjs +1 -1
  32. package/dist/packem_chunks/fanout-panel.mjs +1 -1
  33. package/dist/packem_chunks/flags-panel.mjs +1 -1
  34. package/dist/packem_chunks/issues-panel.mjs +1 -1
  35. package/dist/packem_chunks/kv-browser.mjs +1 -1
  36. package/dist/packem_chunks/log-drains-panel.mjs +1 -1
  37. package/dist/packem_chunks/migrations-route.mjs +1 -1
  38. package/dist/packem_chunks/payments-panel.mjs +1 -1
  39. package/dist/packem_chunks/permissions-panel.mjs +1 -1
  40. package/dist/packem_chunks/privacy-requests-panel.mjs +1 -1
  41. package/dist/packem_chunks/queues-panel.mjs +1 -1
  42. package/dist/packem_chunks/reactors-panel.mjs +1 -1
  43. package/dist/packem_chunks/rls-panel.mjs +1 -1
  44. package/dist/packem_chunks/schedule-panel.mjs +1 -1
  45. package/dist/packem_chunks/storage-rules-panel.mjs +1 -1
  46. package/dist/packem_chunks/subscriptions-panel.mjs +1 -1
  47. package/dist/packem_chunks/traces-panel.mjs +1 -1
  48. package/dist/packem_chunks/workflows-panel.mjs +1 -1
  49. package/dist/packem_shared/ADMIN_FUNCTIONS-DUXsXId1.mjs +1 -0
  50. package/dist/packem_shared/{ApiDocsPanel-DD2Uns6b.mjs → ApiDocsPanel-B9S9l1Ce.mjs} +1 -1
  51. package/dist/packem_shared/{DataBrowser-CVRWnNWu.mjs → DataBrowser-Dm-jhIUP.mjs} +2 -2
  52. package/dist/packem_shared/{GlobalDataBrowser-DC47T6Zl.mjs → GlobalDataBrowser-C1Y8GUhe.mjs} +1 -1
  53. package/dist/packem_shared/{HomePanel-D12HxHQo.mjs → HomePanel-B5ytwPIo.mjs} +1 -1
  54. package/dist/packem_shared/{MigrationsPanel-DMkxSXNl.mjs → MigrationsPanel-CwLikxDT.mjs} +1 -1
  55. package/dist/packem_shared/Studio-B89ZNMOD.mjs +1 -0
  56. package/dist/packem_shared/{StudioApp-isdWpF9P.mjs → StudioApp-C9l1a3A8.mjs} +1 -1
  57. package/dist/packem_shared/advisor-view-CzieqKMe.mjs +5 -0
  58. package/dist/packem_shared/assistant-provider-Bp72uWsq.mjs +1 -0
  59. package/dist/packem_shared/assistant-reason-D6EwMCxT.mjs +1 -0
  60. package/dist/packem_shared/{cf-links-CBJ5SywP.mjs → cf-links-C4DVTr8A.mjs} +1 -1
  61. package/dist/packem_shared/error-alert-DKXm5h19.mjs +6 -0
  62. package/dist/packem_shared/{home-panel-CDVTuTF8.mjs → home-panel-5fGktYeD.mjs} +1 -1
  63. package/dist/packem_shared/recording-client-z4CBi0y8.mjs +1 -0
  64. package/dist/packem_shared/studio-gZfpz1wC.mjs +2 -0
  65. package/dist/packem_shared/{table-list-sidebar-CNadcIgG.mjs → table-list-sidebar-kpHaDWjy.mjs} +1 -1
  66. package/dist/packem_shared/use-assistant-rpc-GCUK2zPa.mjs +1 -0
  67. package/dist/standalone/chunk-2DT3QG6Q.js +1 -0
  68. package/dist/standalone/chunk-2EB7FN5S.js +1 -0
  69. package/dist/standalone/chunk-2FTGLXYA.js +1 -0
  70. package/dist/standalone/chunk-2H6VLY2M.js +1 -0
  71. package/dist/standalone/chunk-2NGKUO32.js +1 -0
  72. package/dist/standalone/chunk-2SNHKJXK.js +1 -0
  73. package/dist/standalone/chunk-2W4UO5BC.js +1 -0
  74. package/dist/standalone/{chunk-SLIDAWNX.js → chunk-3D67ZJRW.js} +1 -1
  75. package/dist/standalone/chunk-3RZD6VJ7.js +1 -0
  76. package/dist/standalone/chunk-3X3NXJBR.js +1 -0
  77. package/dist/standalone/chunk-4EPW63HS.js +1 -0
  78. package/dist/standalone/{chunk-WS36BO4R.js → chunk-4NKJV7YX.js} +1 -1
  79. package/dist/standalone/chunk-4PI2OSSP.js +1 -0
  80. package/dist/standalone/chunk-53CGUTRT.js +1 -0
  81. package/dist/standalone/chunk-5EWIOOBI.js +1 -0
  82. package/dist/standalone/chunk-5GYHGDIF.js +8 -0
  83. package/dist/standalone/chunk-5NIQHOPN.js +1 -0
  84. package/dist/standalone/chunk-5O7ICPWV.js +1 -0
  85. package/dist/standalone/chunk-5PEAXTYQ.js +1 -0
  86. package/dist/standalone/{chunk-O2NMPIV2.js → chunk-5WNGRT7N.js} +1 -1
  87. package/dist/standalone/chunk-66BMMNUR.js +1 -0
  88. package/dist/standalone/chunk-66LYVBXB.js +1 -0
  89. package/dist/standalone/chunk-6FPV3EK2.js +1 -0
  90. package/dist/standalone/chunk-6G3E4PJ2.js +1 -0
  91. package/dist/standalone/chunk-6KE7ILEZ.js +1 -0
  92. package/dist/standalone/chunk-7KJCRT4B.js +1 -0
  93. package/dist/standalone/chunk-7O5SGABV.js +1 -0
  94. package/dist/standalone/chunk-7QEZ2SFW.js +1 -0
  95. package/dist/standalone/chunk-7WV3EPE6.js +1 -0
  96. package/dist/standalone/chunk-A2Q3TGIQ.js +1 -0
  97. package/dist/standalone/chunk-ABMHWBYA.js +1 -0
  98. package/dist/standalone/chunk-AEU3EF4T.js +1 -0
  99. package/dist/standalone/chunk-ALQHMFOC.js +1 -0
  100. package/dist/standalone/chunk-AZIKM5BA.js +1 -0
  101. package/dist/standalone/chunk-BCUOQNI2.js +1 -0
  102. package/dist/standalone/chunk-BG2CJOVS.js +1 -0
  103. package/dist/standalone/chunk-BKI3JMXQ.js +1 -0
  104. package/dist/standalone/chunk-BO5NNWMO.js +1 -0
  105. package/dist/standalone/chunk-BX7TFVCC.js +1 -0
  106. package/dist/standalone/chunk-CKEQX655.js +1 -0
  107. package/dist/standalone/{chunk-DX55P3KZ.js → chunk-CL3JOU6F.js} +1 -1
  108. package/dist/standalone/chunk-COLSZPCE.js +1 -0
  109. package/dist/standalone/chunk-CVSIFPI5.js +1 -0
  110. package/dist/standalone/chunk-D65UVZIA.js +1 -0
  111. package/dist/standalone/{chunk-DBVJ5VLI.js → chunk-DA2CAFXI.js} +1 -1
  112. package/dist/standalone/chunk-DB6QX4X6.js +1 -0
  113. package/dist/standalone/{chunk-7ZIYHKLX.js → chunk-E2FFHKGI.js} +3 -3
  114. package/dist/standalone/chunk-EE2COWFF.js +1 -0
  115. package/dist/standalone/chunk-ELSQ4FVH.js +1 -0
  116. package/dist/standalone/chunk-EXFERMUT.js +1 -0
  117. package/dist/standalone/chunk-FACXM2UB.js +7 -0
  118. package/dist/standalone/chunk-FBDIQ67D.js +1 -0
  119. package/dist/standalone/chunk-FHLODLBC.js +1 -0
  120. package/dist/standalone/chunk-FQEZUQ36.js +1 -0
  121. package/dist/standalone/{chunk-VEWQWS3J.js → chunk-FWM5Z6CH.js} +1 -1
  122. package/dist/standalone/chunk-GC3GKGWD.js +1 -0
  123. package/dist/standalone/chunk-GJXCPZDN.js +1 -0
  124. package/dist/standalone/chunk-GNI37YCV.js +33 -0
  125. package/dist/standalone/chunk-GVZ3VFGG.js +1 -0
  126. package/dist/standalone/chunk-GWNGVKLG.js +1 -0
  127. package/dist/standalone/chunk-GXTSE66Z.js +1 -0
  128. package/dist/standalone/chunk-H7BQUL7D.js +1 -0
  129. package/dist/standalone/chunk-HCCQTUHS.js +1 -0
  130. package/dist/standalone/chunk-HCOF7HOM.js +1 -0
  131. package/dist/standalone/chunk-HZDLUAWS.js +1 -0
  132. package/dist/standalone/chunk-IDZLHZIA.js +1 -0
  133. package/dist/standalone/{chunk-SU5DTRGK.js → chunk-IHGRWY3Y.js} +1 -1
  134. package/dist/standalone/chunk-IUGNIG6L.js +6 -0
  135. package/dist/standalone/chunk-J3BZWYJQ.js +1 -0
  136. package/dist/standalone/chunk-J45HAKBU.js +1 -0
  137. package/dist/standalone/chunk-J4PQAVOF.js +1 -0
  138. package/dist/standalone/chunk-J6FR2B77.js +1 -0
  139. package/dist/standalone/chunk-J6XQKD2F.js +1 -0
  140. package/dist/standalone/chunk-JCRFMCNP.js +1 -0
  141. package/dist/standalone/chunk-JD6PRRFO.js +1 -0
  142. package/dist/standalone/chunk-JENPPZFV.js +1 -0
  143. package/dist/standalone/chunk-JHTL3QHW.js +1 -0
  144. package/dist/standalone/chunk-JOPNP4EO.js +1 -0
  145. package/dist/standalone/chunk-JVP3TR3A.js +1 -0
  146. package/dist/standalone/chunk-KGLIQIZU.js +1 -0
  147. package/dist/standalone/{chunk-ONWGX5Y4.js → chunk-KH6OXCG3.js} +1 -1
  148. package/dist/standalone/{chunk-3FS22LNI.js → chunk-L26RMC2W.js} +3 -3
  149. package/dist/standalone/chunk-L2FYX4FN.js +1 -0
  150. package/dist/standalone/{chunk-XIRKBJPD.js → chunk-LPFUEJZ4.js} +5 -5
  151. package/dist/standalone/chunk-LSEUUZN4.js +1 -0
  152. package/dist/standalone/{chunk-BYOGQ2IV.js → chunk-MJTVTUNI.js} +2 -2
  153. package/dist/standalone/chunk-MQTI3STP.js +1 -0
  154. package/dist/standalone/chunk-N7WQJPOM.js +1 -0
  155. package/dist/standalone/chunk-NF2Q75WM.js +1 -0
  156. package/dist/standalone/chunk-NGZNXNRD.js +1 -0
  157. package/dist/standalone/chunk-O3AZ7JKE.js +1 -0
  158. package/dist/standalone/chunk-OK2QU2EV.js +1 -0
  159. package/dist/standalone/{chunk-IH2CJZF2.js → chunk-ONTGYVAN.js} +1 -1
  160. package/dist/standalone/chunk-OP4QEV27.js +1 -0
  161. package/dist/standalone/chunk-OPIMGKWU.js +1 -0
  162. package/dist/standalone/chunk-OWRKSQPE.js +1 -0
  163. package/dist/standalone/chunk-P5EVJEGC.js +1 -0
  164. package/dist/standalone/chunk-PAZKX7I6.js +1 -0
  165. package/dist/standalone/chunk-PDBW6GTJ.js +1 -0
  166. package/dist/standalone/chunk-PJUVJTDR.js +1 -0
  167. package/dist/standalone/chunk-Q2J73V2C.js +2 -0
  168. package/dist/standalone/chunk-Q2KL457J.js +1 -0
  169. package/dist/standalone/chunk-QAOZXPLU.js +1 -0
  170. package/dist/standalone/{chunk-3PAYDWHN.js → chunk-QEFLZBT7.js} +2 -2
  171. package/dist/standalone/chunk-QKUVJIRX.js +1 -0
  172. package/dist/standalone/chunk-QNM2J7MG.js +1 -0
  173. package/dist/standalone/chunk-QRA7AKYO.js +1 -0
  174. package/dist/standalone/chunk-RCXNYW7P.js +1 -0
  175. package/dist/standalone/chunk-RE7GRXBM.js +1 -0
  176. package/dist/standalone/{chunk-TDVDZ7XQ.js → chunk-RIAOZECW.js} +1 -1
  177. package/dist/standalone/{chunk-LUHXNZI4.js → chunk-RTS5G3ET.js} +1 -1
  178. package/dist/standalone/chunk-S36FVTKK.js +1 -0
  179. package/dist/standalone/chunk-SR6CPTRT.js +1 -0
  180. package/dist/standalone/chunk-T3ZCW3RG.js +1 -0
  181. package/dist/standalone/chunk-TKBTZX4K.js +1 -0
  182. package/dist/standalone/chunk-TMWKF4XM.js +5 -0
  183. package/dist/standalone/chunk-TW4O2BA5.js +159 -0
  184. package/dist/standalone/chunk-UD5REVU2.js +1 -0
  185. package/dist/standalone/{chunk-PQH2LSJX.js → chunk-UQA2AJGI.js} +1 -1
  186. package/dist/standalone/chunk-UW6QNC74.js +3 -0
  187. package/dist/standalone/chunk-UXBNXITB.js +1 -0
  188. package/dist/standalone/chunk-UZ2ZXB74.js +1 -0
  189. package/dist/standalone/chunk-V3BE427M.js +1 -0
  190. package/dist/standalone/chunk-VHPTPEZ4.js +1 -0
  191. package/dist/standalone/chunk-W4LJQYCI.js +1 -0
  192. package/dist/standalone/chunk-WADY55J2.js +30 -0
  193. package/dist/standalone/chunk-WCWP4EAW.js +1 -0
  194. package/dist/standalone/chunk-X54WR7FF.js +1 -0
  195. package/dist/standalone/chunk-XWWQIAF6.js +1 -0
  196. package/dist/standalone/{chunk-SYGCASPT.js → chunk-Y2YLTUMD.js} +1 -1
  197. package/dist/standalone/chunk-YEVTA35E.js +1 -0
  198. package/dist/standalone/{chunk-R36QXQZX.js → chunk-YORPLSI5.js} +1 -1
  199. package/dist/standalone/chunk-YX2N5PJW.js +1 -0
  200. package/dist/standalone/chunk-Z57KMMOK.js +1 -0
  201. package/dist/standalone/chunk-ZFQ253FX.js +1 -0
  202. package/dist/standalone/chunk-ZG3IUVQ2.js +1 -0
  203. package/dist/standalone/chunk-ZKEYRU5C.js +1 -0
  204. package/dist/standalone/{chunk-5R2YO7HF.js → chunk-ZOKSVUID.js} +4 -4
  205. package/dist/standalone/{chunk-H7HZ42JY.js → chunk-ZPQBVYNN.js} +1 -1
  206. package/dist/standalone/chunk-ZSLKFLWE.js +1 -0
  207. package/dist/standalone/chunk-ZSWW2UGP.js +1 -0
  208. package/dist/standalone/studio.js +2 -2
  209. package/dist/styles.css +1 -1
  210. package/package.json +7 -6
  211. package/dist/packem_shared/ADMIN_FUNCTIONS-4aGsMs95.mjs +0 -1
  212. package/dist/packem_shared/Studio-MA8kKZLu.mjs +0 -1
  213. package/dist/packem_shared/advisor-view-tBumWci_.mjs +0 -1
  214. package/dist/packem_shared/error-alert-C0R39DO1.mjs +0 -1
  215. package/dist/packem_shared/recording-client-DAipTA_n.mjs +0 -1
  216. package/dist/packem_shared/studio-UhUrPz5J.mjs +0 -2
  217. package/dist/packem_shared/use-sql-assistant-rZPs3LC3.mjs +0 -1
  218. package/dist/standalone/chunk-2AH4ABE5.js +0 -1
  219. package/dist/standalone/chunk-2G57ENH5.js +0 -1
  220. package/dist/standalone/chunk-3GXPALXG.js +0 -1
  221. package/dist/standalone/chunk-3GYLOE4V.js +0 -1
  222. package/dist/standalone/chunk-473JK2PQ.js +0 -1
  223. package/dist/standalone/chunk-4C4THJUD.js +0 -1
  224. package/dist/standalone/chunk-4DAKKAK7.js +0 -1
  225. package/dist/standalone/chunk-4M57OYFX.js +0 -1
  226. package/dist/standalone/chunk-4SQBAPY6.js +0 -1
  227. package/dist/standalone/chunk-5DNGK3NT.js +0 -1
  228. package/dist/standalone/chunk-5GIQ6C5N.js +0 -1
  229. package/dist/standalone/chunk-5WJG7FMH.js +0 -1
  230. package/dist/standalone/chunk-63KDHS3H.js +0 -1
  231. package/dist/standalone/chunk-6B6ARRMI.js +0 -1
  232. package/dist/standalone/chunk-6LMO2D54.js +0 -1
  233. package/dist/standalone/chunk-6M7FLLMT.js +0 -1
  234. package/dist/standalone/chunk-6QEXGYWH.js +0 -1
  235. package/dist/standalone/chunk-6UTZXEW3.js +0 -1
  236. package/dist/standalone/chunk-6VAY6L4J.js +0 -1
  237. package/dist/standalone/chunk-7PADVGQX.js +0 -1
  238. package/dist/standalone/chunk-7RGYCU6F.js +0 -1
  239. package/dist/standalone/chunk-7UM5ROG6.js +0 -1
  240. package/dist/standalone/chunk-A566HCBX.js +0 -1
  241. package/dist/standalone/chunk-A5JISKHE.js +0 -1
  242. package/dist/standalone/chunk-ADNRFCMZ.js +0 -1
  243. package/dist/standalone/chunk-AP4PC2M4.js +0 -1
  244. package/dist/standalone/chunk-BFE2DRP6.js +0 -33
  245. package/dist/standalone/chunk-BPEB4KFE.js +0 -1
  246. package/dist/standalone/chunk-BVX45MU5.js +0 -7
  247. package/dist/standalone/chunk-C6GN7ZXJ.js +0 -1
  248. package/dist/standalone/chunk-CL2VZNDI.js +0 -1
  249. package/dist/standalone/chunk-CNA3TVUK.js +0 -1
  250. package/dist/standalone/chunk-CZ6HBDIL.js +0 -1
  251. package/dist/standalone/chunk-D6S7MXW4.js +0 -1
  252. package/dist/standalone/chunk-E26OT26O.js +0 -1
  253. package/dist/standalone/chunk-FCAXVYAX.js +0 -1
  254. package/dist/standalone/chunk-FXPAJDES.js +0 -1
  255. package/dist/standalone/chunk-HHRYM6UW.js +0 -1
  256. package/dist/standalone/chunk-HPRF5LMA.js +0 -1
  257. package/dist/standalone/chunk-IB22LETR.js +0 -1
  258. package/dist/standalone/chunk-IBJVVHV5.js +0 -1
  259. package/dist/standalone/chunk-IENQRRQT.js +0 -1
  260. package/dist/standalone/chunk-IQ4TTHQT.js +0 -1
  261. package/dist/standalone/chunk-ITH5LRWM.js +0 -1
  262. package/dist/standalone/chunk-J6VFG6M5.js +0 -1
  263. package/dist/standalone/chunk-JSDKOE4U.js +0 -1
  264. package/dist/standalone/chunk-JTGGWF7R.js +0 -1
  265. package/dist/standalone/chunk-JZD7ZN3F.js +0 -1
  266. package/dist/standalone/chunk-K3CWB3AM.js +0 -1
  267. package/dist/standalone/chunk-KNFB3FGW.js +0 -1
  268. package/dist/standalone/chunk-KNXWDE4N.js +0 -1
  269. package/dist/standalone/chunk-KRPXOSBL.js +0 -1
  270. package/dist/standalone/chunk-KRY7BYHT.js +0 -1
  271. package/dist/standalone/chunk-KYAG2YMF.js +0 -1
  272. package/dist/standalone/chunk-KZCEJFZF.js +0 -1
  273. package/dist/standalone/chunk-KZILJQX3.js +0 -8
  274. package/dist/standalone/chunk-LEYUH5TS.js +0 -1
  275. package/dist/standalone/chunk-LFM672WN.js +0 -1
  276. package/dist/standalone/chunk-LIGOLZND.js +0 -1
  277. package/dist/standalone/chunk-LPU6YTSU.js +0 -1
  278. package/dist/standalone/chunk-MWJC3S62.js +0 -1
  279. package/dist/standalone/chunk-NP2AQOLE.js +0 -1
  280. package/dist/standalone/chunk-NVKLYDOH.js +0 -1
  281. package/dist/standalone/chunk-O2X2XYCM.js +0 -1
  282. package/dist/standalone/chunk-O3MDWYXF.js +0 -1
  283. package/dist/standalone/chunk-ONG4JEZD.js +0 -1
  284. package/dist/standalone/chunk-OS26JXYA.js +0 -1
  285. package/dist/standalone/chunk-OXFKZ4BM.js +0 -1
  286. package/dist/standalone/chunk-PGTEGUAB.js +0 -1
  287. package/dist/standalone/chunk-PTBUWRBY.js +0 -1
  288. package/dist/standalone/chunk-Q6HA3L2H.js +0 -1
  289. package/dist/standalone/chunk-QGV5ARD2.js +0 -1
  290. package/dist/standalone/chunk-QWRK4ESB.js +0 -1
  291. package/dist/standalone/chunk-RL2ITK2N.js +0 -1
  292. package/dist/standalone/chunk-RTJO3AR4.js +0 -1
  293. package/dist/standalone/chunk-SFY646MC.js +0 -1
  294. package/dist/standalone/chunk-T5UMHPAB.js +0 -1
  295. package/dist/standalone/chunk-T6HV2FQP.js +0 -2
  296. package/dist/standalone/chunk-T7ZKNNGX.js +0 -1
  297. package/dist/standalone/chunk-TCYPNSTV.js +0 -1
  298. package/dist/standalone/chunk-TQM6XHBA.js +0 -1
  299. package/dist/standalone/chunk-TRMWBRRU.js +0 -1
  300. package/dist/standalone/chunk-TW7KJSMR.js +0 -15
  301. package/dist/standalone/chunk-TYD3V4NB.js +0 -1
  302. package/dist/standalone/chunk-TZKLK52W.js +0 -1
  303. package/dist/standalone/chunk-U4RXQSQ7.js +0 -1
  304. package/dist/standalone/chunk-UNZ2UBVL.js +0 -1
  305. package/dist/standalone/chunk-VJRNOSRY.js +0 -1
  306. package/dist/standalone/chunk-W2BCSK5S.js +0 -1
  307. package/dist/standalone/chunk-W7MRISE3.js +0 -1
  308. package/dist/standalone/chunk-WM72PRE3.js +0 -1
  309. package/dist/standalone/chunk-X4WHMCOZ.js +0 -1
  310. package/dist/standalone/chunk-X74GEPSG.js +0 -1
  311. package/dist/standalone/chunk-XKPD4SFN.js +0 -1
  312. package/dist/standalone/chunk-XMSNLMWU.js +0 -1
  313. package/dist/standalone/chunk-XOPFDWXX.js +0 -1
  314. package/dist/standalone/chunk-XQLOVFPP.js +0 -1
  315. package/dist/standalone/chunk-XSHYZPGF.js +0 -1
  316. package/dist/standalone/chunk-XST3UEHU.js +0 -1
  317. package/dist/standalone/chunk-XYR5NST4.js +0 -1
  318. package/dist/standalone/chunk-Y74LIFSL.js +0 -1
  319. package/dist/standalone/chunk-YHTHRYP5.js +0 -1
  320. package/dist/standalone/chunk-YMEKCV27.js +0 -1
  321. package/dist/standalone/chunk-Z5EV64KS.js +0 -1
  322. package/dist/standalone/chunk-ZBON5T5A.js +0 -1
  323. package/dist/standalone/chunk-ZGSL4DPP.js +0 -1
  324. package/dist/standalone/chunk-ZOQTXWPK.js +0 -1
  325. package/dist/standalone/chunk-ZTOREMGH.js +0 -1
  326. package/dist/standalone/chunk-ZZ5GICTF.js +0 -1
  327. /package/dist/standalone/{chunk-UYEZR3BI.js → chunk-P6VNMPWR.js} +0 -0
@@ -1 +0,0 @@
1
- import{useState as g}from"react";import{E as x}from"./error-alert-C0R39DO1.mjs";import{C as N,a as y}from"./card-By2O8ULa.mjs";import{T as v,a as T,b as d,c as m,d as w,e as l}from"./table-D0SBiDu-.mjs";import{useT as E}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{c as L}from"./utils-bhneXptQ.mjs";import{jsxs as o,jsx as t}from"react/jsx-runtime";const C={ERROR:"error",INFO:"info",WARN:"warning"},z=e=>{const a=typeof e.metadata.table=="string"?e.metadata.table:void 0;return{description:`${e.detail} ${e.remediation}`,entity:a,issueType:e.title,key:e.cacheKey,level:C[e.level]}},R=["error","warning","info"],A={error:"bg-destructive",info:"bg-info",warning:"bg-warning"},$=(e,a)=>({error:e("Errors"),info:e("Info"),warning:e("Warnings")})[a],k=(e,a,n)=>({error:e("{count} errors",{count:n}),info:e("{count} suggestions",{count:n}),warning:e("{count} warnings",{count:n})})[a],V=(e,a)=>({error:e("No errors detected"),info:e("No suggestions"),warning:e("No warnings detected")})[a],O=e=>{const a={error:0,info:0,warning:0};for(const n of e??[])a[n.level]+=1;return a},F=({error:e=null,errorSource:a,rows:n,testId:i,toolbar:p})=>{const s=E(),[c,f]=g("error"),b=O(n),u=(n??[]).filter(r=>r.level===c),h=r=>{f(r.currentTarget.dataset.level)};return o("div",{className:"flex flex-col gap-3","data-testid":i,children:[t("div",{className:"flex border-b border-border",role:"tablist",children:R.map(r=>o("button",{"aria-selected":c===r,className:"flex min-w-32 flex-col gap-0.5 border-b-2 border-transparent px-4 py-2 text-start outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 aria-selected:border-foreground","data-level":r,"data-testid":`${i}-tab-${r}`,onClick:h,role:"tab",type:"button",children:[o("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[t("span",{"aria-hidden":"true",className:L("size-2 rounded-sm",A[r])}),$(s,r)]}),t("span",{className:"ps-4 text-xs text-muted-foreground",children:k(s,r,b[r])})]},r))}),p!==void 0&&t("div",{className:"flex flex-wrap items-center gap-2",children:p}),e!==null&&t(x,{error:a??e,testId:`${i}-error`}),t(N,{className:"overflow-hidden py-0",children:t(y,{className:"px-0",children:o(v,{children:[t(T,{children:o(d,{children:[t(m,{children:s("Issue type")}),t(m,{children:s("Entity/item")}),t(m,{children:s("Description")})]})}),t(w,{children:u.length===0?t(d,{children:o(l,{className:"h-40 text-center align-middle text-muted-foreground",colSpan:3,"data-testid":`${i}-empty`,children:[t("span",{className:"block text-sm font-medium text-foreground",children:V(s,c)}),t("span",{className:"block text-sm",children:s("Nothing to report for this deployment.")})]})}):u.map(r=>o(d,{children:[t(l,{className:"font-medium text-foreground",children:r.issueType}),t(l,{className:"font-mono text-xs text-muted-foreground",children:r.entity??"—"}),o(l,{className:"text-muted-foreground",children:[t("span",{children:r.description}),r.action!==void 0&&t("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:r.action})]})]},r.key))})]})})})]})};export{F as A,z as a};
@@ -1 +0,0 @@
1
- import{c as O}from"react/compiler-runtime";import{flattenHint as j}from"@lunora/errors";import{useT as q}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{e as E,a as H,b as S}from"./internal-hIuTpSbx.mjs";import{o as T}from"./recording-client-DAipTA_n.mjs";import{u as U}from"./operation-console-provider-DoloEvon.mjs";import{A as V}from"./alert-PB5W11MM.mjs";import{jsx as h,jsxs as D}from"react/jsx-runtime";const K=I=>{const e=O(42),{className:N,error:t,testId:g}=I,C=q(),o=U();let i,s,n,a,c,m,r,l,f;if(e[0]!==N||e[1]!==t||e[2]!==o||e[3]!==g){const A=E(t);let b;e[13]!==t?(b=H(t),e[13]=t,e[14]=b):b=e[14],s=b;let w;e[15]!==t?(w=T(t),e[15]=t,e[16]=w):w=e[16];const k=w,v=t?.why;let y;e[17]!==o||e[18]!==k?(y=()=>{o?.openConsole({errorsOnly:!0,seq:k})},e[17]=o,e[18]=k,e[19]=y):y=e[19],n=y,i=V,a=N,c=g,m="destructive";let d;e[20]!==t?(d=S(t),e[20]=t,e[21]=d):d=e[21],e[22]!==d?(r=h("p",{className:"font-medium",children:d}),e[22]=d,e[23]=r):r=e[23],e[24]!==v?(l=typeof v=="string"?h("p",{className:"mt-1 text-xs opacity-90",children:v}):null,e[24]=v,e[25]=l):l=e[25],f=A===void 0?null:h("p",{className:"mt-1 whitespace-pre-wrap text-xs opacity-90",children:j(A)}),e[0]=N,e[1]=t,e[2]=o,e[3]=g,e[4]=i,e[5]=s,e[6]=n,e[7]=a,e[8]=c,e[9]=m,e[10]=r,e[11]=l,e[12]=f}else i=e[4],s=e[5],n=e[6],a=e[7],c=e[8],m=e[9],r=e[10],l=e[11],f=e[12];let p;e[26]!==s?(p=s===void 0?null:h("a",{"aria-label":"View documentation for this error",className:"mt-1 inline-block text-xs underline",href:s,rel:"noreferrer",target:"_blank",children:"View error docs"}),e[26]=s,e[27]=p):p=e[27];let u;e[28]!==o||e[29]!==n||e[30]!==C?(u=o===void 0?null:h("button",{className:"mt-1 block text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"error-show-in-console",onClick:n,type:"button",children:C("Show in console")}),e[28]=o,e[29]=n,e[30]=C,e[31]=u):u=e[31];let x;return e[32]!==i||e[33]!==a||e[34]!==c||e[35]!==m||e[36]!==r||e[37]!==l||e[38]!==f||e[39]!==p||e[40]!==u?(x=D(i,{className:a,testId:c,variant:m,children:[r,l,f,p,u]}),e[32]=i,e[33]=a,e[34]=c,e[35]=m,e[36]=r,e[37]=l,e[38]=f,e[39]=p,e[40]=u,e[41]=x):x=e[41],x};export{K as E};
@@ -1 +0,0 @@
1
- import{o as u}from"./use-admin-query-CaOm4JS3.mjs";const b="__lunora_admin__:",d=new Set(["action","mutation","query"]),r=Symbol("lunora.operationSeq"),g=t=>{if(typeof t!="object"||t===null)return;const n=t[r];return typeof n=="number"?n:void 0},h=(t,n)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,r,{configurable:!0,enumerable:!1,value:n,writable:!0})}catch{}},p=t=>{if(typeof t!="object"||t===null)return;const n=t.__lunoraRef;return typeof n=="string"&&n.startsWith(b)?n:void 0},O=t=>{if(typeof t!="object"||t===null)return"";const{shardKey:n}=t;return typeof n=="string"?n:""},E=t=>new Proxy(t,{get(n,c,a){const i=Reflect.get(n,c,a);if(typeof i!="function"||typeof c!="string"||!d.has(c))return typeof i=="function"?i.bind(n):i;const f=i;return async(...e)=>{const l=p(e[0]);if(l===void 0)return f.apply(n,e);const y=typeof e[1]=="object"&&e[1]!==null?e[1]:{},s=u.start(l,y,O(e[2]));try{const o=await f.apply(n,e);return u.settle(s,{result:o}),o}catch(o){throw u.settle(s,{error:o instanceof Error?o.message:String(o)}),h(o,s),o}}}});export{g as o,E as w};
@@ -1,2 +0,0 @@
1
- 'use client';
2
- import{c as M}from"react/compiler-runtime";import{createRootRoute as us,createRoute as $t,createBrowserHistory as fs,createMemoryHistory as ms,createRouter as hs,useNavigate as Ot,useSearch as ps,RouterProvider as gs,useRouterState as bs,Outlet as vs}from"@tanstack/react-router";import*as ft from"react";import{use as Lt,createContext as Zt,useState as mt,useEffect as ht,useSyncExternalStore as xs,Suspense as qt,lazy as R}from"react";import{c as _}from"./utils-bhneXptQ.mjs";import{jsx as o,jsxs as k,Fragment as Ft}from"react/jsx-runtime";import{ErrorBoundary as ys}from"./ErrorBoundary-BWNF98VF.mjs";import{O as ws,u as ks}from"./operation-console-provider-DoloEvon.mjs";import{useT as se}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{LunoraError as Wt}from"@lunora/errors";import{B as gt}from"./badge-r_5B4LHP.mjs";import{I as Ut}from"./input-CXhxesPC.mjs";import{Popover as pt}from"@base-ui/react/popover";import{Cancel01Icon as Ms,SidebarLeftIcon as Ns}from"@hugeicons/core-free-icons";import{HugeiconsIcon as jt}from"@hugeicons/react";import{mergeProps as Gt}from"@base-ui/react/merge-props";import{useRender as Kt}from"@base-ui/react/use-render";import{cva as Ss}from"class-variance-authority";import{B as Qt}from"./button-q0UYSmrn.mjs";import{Dialog as oe}from"@base-ui/react/dialog";import{Tooltip as ae}from"@base-ui/react/tooltip";import{S as Ct}from"./skeleton-DX1gfixl.mjs";import{H as Cs,u as Ps}from"./home-panel-CDVTuTF8.mjs";import{g as _s,f as Rt}from"./internal-hIuTpSbx.mjs";import{o as wt}from"./use-admin-query-CaOm4JS3.mjs";import{StudioI18nProvider as Ts}from"./StudioI18nProvider-CGXCPnQn.mjs";import{v as Rs,a as As}from"./data-view-params-C-_G-biH.mjs";import{CommandPalette as Ls,openCommandPalette as Is}from"./CommandPalette-BZCHLpst.mjs";import{E as Es}from"./empty-state-D7jEML_T.mjs";import{u as $s}from"./shortcuts-B9gDaXmw.mjs";const Yt="(prefers-color-scheme: dark)",Jt=()=>{try{return globalThis.localStorage}catch{return}},Hs=t=>t==="system"||t==="light"||t==="dark",Xt=()=>globalThis.matchMedia,es="lunora-studio-theme",Pt=["system","light","dark"],Vs=(t="system")=>{try{const e=Jt()?.getItem(es);return Hs(e)?e:t}catch{return t}},Ht=t=>{const e=Jt();if(e!==void 0)try{e.setItem(es,t)}catch{}},Bs=()=>{try{return Xt()?.(Yt).matches?"dark":"light"}catch{return"light"}},zs=(t,e)=>t==="system"?e:t,Ds=t=>{let e;try{e=Xt()?.(Yt)}catch{e=void 0}if(e===void 0)return()=>{};const s=a=>{t(a.matches?"dark":"light")};return e.addEventListener("change",s),()=>{e.removeEventListener("change",s)}},It=Zt(null),Os=({children:t,defaultTheme:e="system"})=>{const[s,a]=mt(()=>Vs(e)),[r,n]=mt(()=>Bs());ht(()=>Ds(n),[]);const i=u=>{Ht(u),a(u)},c={cycleTheme:()=>{a(u=>{const d=Pt[(Pt.indexOf(u)+1)%Pt.length]??u;return Ht(d),d})},resolvedTheme:zs(s,r),setTheme:i,systemTheme:r,theme:s};return o(It,{value:c,children:t})},Zs=t=>{const e=M(3),{children:s}=t,a=Lt(It);let r;return e[0]!==s||e[1]!==a?(r=a===null?o(Os,{children:s}):s,e[0]=s,e[1]=a,e[2]=r):r=e[2],r},qs=()=>{const t=Lt(It);if(t===null)throw new Wt("INTERNAL","useTheme must be used within a <ThemeProvider>");return t};function Hr({delay:t=0,...e}){return o(ae.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function Fs(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(ae.Root,{"data-slot":"tooltip",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ws(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(ae.Trigger,{"data-slot":"tooltip-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Us({className:t,side:e="top",sideOffset:s=4,align:a="center",alignOffset:r=0,children:n,...i}){return o(ae.Portal,{children:o(ae.Positioner,{align:a,alignOffset:r,side:e,sideOffset:s,className:"isolate z-50",children:k(ae.Popup,{"data-slot":"tooltip-content",className:_("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:[n,o(ae.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 js=t=>{const e=M(5),{className:s}=t;let a;e[0]!==s?(a=_("h-full w-full text-foreground",s),e[0]=s,e[1]=a):a=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=o("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]=r):r=e[2];let n;return e[3]!==a?(n=o("svg",{"aria-hidden":"true",className:a,fill:"currentColor",viewBox:"0 0 543 446",children:r}),e[3]=a,e[4]=n):n=e[4],n},ts="lunora.studio.rulesBannerDismissed",Gs=()=>{try{return globalThis.localStorage.getItem(ts)==="1"}catch{return!1}},Ks=()=>{try{globalThis.localStorage.setItem(ts,"1")}catch{}},Qs=()=>{const t=M(18),e=se(),[s,a]=mt(Ys);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{a(!0),Ks()},t[0]=r):r=t[0];const n=r;if(s)return null;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o("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 c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=o("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"}),t[4]=c):c=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 d;t[7]!==l||t[8]!==u?(d=k("span",{children:[l," ",c," ",u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let g;t[10]!==e?(g=e("Dismiss"),t[10]=e,t[11]=g):g=t[11];let p;t[12]===Symbol.for("react.memo_cache_sentinel")?(p=o("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:o("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=p):p=t[12];let f;t[13]!==g?(f=o("button",{"aria-label":g,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:n,type:"button",children:p}),t[13]=g,t[14]=f):f=t[14];let b;return t[15]!==d||t[16]!==f?(b=k("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,d,f]}),t[15]=d,t[16]=f,t[17]=b):b=t[17],b};function Ys(){return Gs()}function ss(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(pt.Root,{"data-slot":"popover",...s}),e[2]=s,e[3]=a):a=e[3],a}function as(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(pt.Trigger,{"data-slot":"popover-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function os({align:t="end",alignOffset:e=0,className:s,keepMounted:a=!1,side:r="bottom",sideOffset:n=6,...i}){return o(pt.Portal,{keepMounted:a,children:o(pt.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:r,sideOffset:n,children:o(pt.Popup,{className:_("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",s),"data-slot":"popover-content",...i})})})}const _t=768;function Js(){const t=M(2),[e,s]=mt(void 0);let a,r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{const n=globalThis.matchMedia(`(max-width: ${_t-1}px)`),i=()=>{s(globalThis.innerWidth<_t)};return n.addEventListener("change",i),s(globalThis.innerWidth<_t),()=>{n.removeEventListener("change",i)}},r=[],t[0]=a,t[1]=r):(a=t[0],r=t[1]),ht(a,r),!!e}function Xs(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(oe.Root,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function ea(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(oe.Portal,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function ta(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("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:",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o(oe.Backdrop,{"data-slot":"sheet-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function sa({className:t,children:e,side:s="right",showCloseButton:a=!0,...r}){return k(ea,{children:[o(ta,{}),k(oe.Popup,{"data-slot":"sheet-content","data-side":s,className:_("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),...r,children:[e,a&&k(oe.Close,{"data-slot":"sheet-close",render:o(Qt,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[o(jt,{icon:Ms,strokeWidth:2}),o("span",{className:"sr-only",children:"Close"})]})]})]})}function aa(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("flex flex-col gap-0.5 p-4",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sheet-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function oa(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("text-sm font-medium text-foreground",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o(oe.Title,{"data-slot":"sheet-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function ra(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("text-xs/relaxed text-muted-foreground",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o(oe.Description,{"data-slot":"sheet-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}const na="sidebar_state",ia=3600*24*7,la="16rem",ca="18rem",da="3rem",ua="b",rs=ft.createContext(null);function kt(){const t=ft.useContext(rs);if(!t)throw new Wt("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}function fa({defaultOpen:t=!0,open:e,onOpenChange:s,className:a,style:r,children:n,...i}){const l=Js(),[c,u]=ft.useState(!1),[d,g]=ft.useState(t),p=e??d,f=h=>{const m=typeof h=="function"?h(p):h;s?s(m):g(m),document.cookie=`${na}=${m}; path=/; max-age=${ia}`},b=()=>l?u(h=>!h):f(h=>!h),y=ft.useEffectEvent(()=>{b()});ft.useEffect(()=>{const h=m=>{m.key===ua&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),y())};return globalThis.addEventListener("keydown",h),()=>globalThis.removeEventListener("keydown",h)},[]);const v={state:p?"expanded":"collapsed",open:p,setOpen:f,isMobile:l,openMobile:c,setOpenMobile:u,toggleSidebar:b};return o(rs.Provider,{value:v,children:o("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":la,"--sidebar-width-icon":da,...r},className:_("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...i,children:n})})}function ma({side:t="left",variant:e="sidebar",collapsible:s="offcanvas",className:a,children:r,dir:n,...i}){const{isMobile:l,state:c,openMobile:u,setOpenMobile:d}=kt();return s==="none"?o("div",{"data-slot":"sidebar",className:_("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...i,children:r}):l?o(Xs,{open:u,onOpenChange:d,...i,children:k(sa,{dir:n,"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":ca},side:t,children:[k(aa,{className:"sr-only",children:[o(oa,{children:"Sidebar"}),o(ra,{children:"Displays the mobile sidebar."})]}),o("div",{className:"flex h-full w-full flex-col",children:r})]})}):k("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?s:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[o("div",{"data-slot":"sidebar-gap",className:_("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)")}),o("div",{"data-slot":"sidebar-container","data-side":t,className:_("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",a),...i,children:o("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:r})})]})}function ha(t){const e=M(15);let s,a,r;e[0]!==t?({className:s,onClick:a,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r):(s=e[1],a=e[2],r=e[3]);const{toggleSidebar:n}=kt();let i;e[4]!==s?(i=_(s),e[4]=s,e[5]=i):i=e[5];let l;e[6]!==a||e[7]!==n?(l=g=>{a?.(g),n()},e[6]=a,e[7]=n,e[8]=l):l=e[8];let c,u;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=o(jt,{icon:Ns,strokeWidth:2,className:"rtl:rotate-180"}),u=o("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=c,e[10]=u):(c=e[9],u=e[10]);let d;return e[11]!==r||e[12]!==i||e[13]!==l?(d=k(Qt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:i,onClick:l,...r,children:[c,u]}),e[11]=r,e[12]=i,e[13]=l,e[14]=d):d=e[14],d}function pa(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("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",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("main",{"data-slot":"sidebar-inset",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function ga(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function ba(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function va(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("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",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function xa(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("relative flex w-full min-w-0 flex-col p-2",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function ya(t){const e=M(10);let s,a,r,n;if(e[0]!==t){const{className:c,render:u,...d}=t;s=u,n=Kt,a="div",r=Gt({className:_("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",c)},d),e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=n}else s=e[1],a=e[2],r=e[3],n=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]!==s||e[7]!==a||e[8]!==r?(l={defaultTagName:a,props:r,render:s,state:i},e[6]=s,e[7]=a,e[8]=r,e[9]=l):l=e[9],n(l)}function wa(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("w-full text-xs",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function Vt(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("flex w-full min-w-0 flex-col gap-0",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function Bt(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=_("group/menu-item relative",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}const ka=Ss("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 ns({render:t,isActive:e=!1,variant:s="default",size:a="default",tooltip:r,className:n,...i}){const{isMobile:l,state:c}=kt(),u=Kt({defaultTagName:"button",props:Gt({className:_(ka({variant:s,size:a}),n)},i),render:r?o(Ws,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:e}});return r?(typeof r=="string"&&(r={children:r}),k(Fs,{children:[u,o(Us,{side:"right",align:"center",hidden:c!=="collapsed"||l,...r})]})):u}const Ma=t=>t.replace("__lunora_admin__:",""),Na=()=>xs(wt.subscribe,wt.getSnapshot,wt.getSnapshot),Sa=t=>t==="error"?"destructive":t==="pending"?"secondary":"default",Ca=t=>{const e=M(56),{entry:s,focused:a}=t,r=se();let n;e[0]!==a?(n=O=>{O!==null&&a&&O.scrollIntoView({block:"nearest"})},e[0]=a,e[1]=n):n=e[1];const i=n;let l;e[2]!==s.functionPath||e[3]!==s.shardKey||e[4]!==s.summary?(l=()=>{_s(`${s.functionPath} ${s.summary}${s.shardKey===""?"":` (shard ${s.shardKey})`}`)},e[2]=s.functionPath,e[3]=s.shardKey,e[4]=s.summary,e[5]=l):l=e[5];const c=l,u=a&&"bg-accent ring-1 ring-inset ring-primary/40";let d;e[6]!==u?(d=_("border-b border-border/60 last:border-b-0",u),e[6]=u,e[7]=d):d=e[7];let g;e[8]!==s.status?(g=Sa(s.status),e[8]=s.status,e[9]=g):g=e[9];const p=s.status==="pending"?"…":s.status;let f;e[10]!==g||e[11]!==p?(f=o(gt,{className:"mt-px shrink-0",variant:g,children:p}),e[10]=g,e[11]=p,e[12]=f):f=e[12];let b;e[13]!==s.functionPath?(b=Ma(s.functionPath),e[13]=s.functionPath,e[14]=b):b=e[14];let y;e[15]!==b?(y=o("span",{className:"shrink-0 font-mono text-[11px] text-foreground",children:b}),e[15]=b,e[16]=y):y=e[16];let x;e[17]!==s.kind||e[18]!==r?(x=s.kind==="subscription"&&o(gt,{className:"shrink-0",variant:"outline",children:r("live")}),e[17]=s.kind,e[18]=r,e[19]=x):x=e[19];let v;e[20]!==s.summary?(v=s.summary!==""&&o("span",{className:"min-w-0 truncate text-muted-foreground",children:s.summary}),e[20]=s.summary,e[21]=v):v=e[21];let h;e[22]!==s.shardKey?(h=s.shardKey!==""&&o("span",{className:"font-mono",children:s.shardKey}),e[22]=s.shardKey,e[23]=h):h=e[23];let m;e[24]!==s.resultCount||e[25]!==r?(m=s.resultCount!==void 0&&o("span",{children:r("{count} rows",{count:s.resultCount})}),e[24]=s.resultCount,e[25]=r,e[26]=m):m=e[26];let w;e[27]!==s.pushes||e[28]!==r?(w=s.pushes!==void 0&&s.pushes>0&&o("span",{children:r("{count} pushes",{count:s.pushes})}),e[27]=s.pushes,e[28]=r,e[29]=w):w=e[29];let P;e[30]!==s.durationMs?(P=s.durationMs!==void 0&&k("span",{children:[s.durationMs,"ms"]}),e[30]=s.durationMs,e[31]=P):P=e[31];let C;e[32]!==r?(C=r("Copy"),e[32]=r,e[33]=C):C=e[33];let S;e[34]!==c||e[35]!==C?(S=o("button",{"aria-label":C,className:"rounded px-1 outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-copy",onClick:c,type:"button",children:"⧉"}),e[34]=c,e[35]=C,e[36]=S):S=e[36];let N;e[37]!==h||e[38]!==m||e[39]!==w||e[40]!==P||e[41]!==S?(N=k("span",{className:"ms-auto flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[h,m,w,P,S]}),e[37]=h,e[38]=m,e[39]=w,e[40]=P,e[41]=S,e[42]=N):N=e[42];let T;e[43]!==x||e[44]!==v||e[45]!==N||e[46]!==f||e[47]!==y?(T=k("div",{className:"flex items-start gap-2 px-3 py-1.5 text-xs",children:[f,y,x,v,N]}),e[43]=x,e[44]=v,e[45]=N,e[46]=f,e[47]=y,e[48]=T):T=e[48];let A;e[49]!==s.error?(A=s.error!==void 0&&o("p",{className:"px-3 pb-1.5 font-mono text-[11px] text-destructive","data-testid":"oc-error",children:s.error}),e[49]=s.error,e[50]=A):A=e[50];let L;return e[51]!==i||e[52]!==T||e[53]!==A||e[54]!==d?(L=k("li",{className:d,"data-testid":"oc-row",ref:i,children:[T,A]}),e[51]=i,e[52]=T,e[53]=A,e[54]=d,e[55]=L):L=e[55],L},Pa=t=>{const e=M(62),{focusSeq:s,onClose:a,onShownChange:r,shown:n}=t,i=se(),l=Na(),[c,u]=mt("");let d;if(e[0]!==l||e[1]!==s||e[2]!==c||e[3]!==a||e[4]!==r||e[5]!==n||e[6]!==i){const g=c.trim().toLowerCase(),p=l.filter(E=>(n==="errors"?E.status==="error":!0)&&(g===""||`${E.functionPath} ${E.summary} ${E.shardKey}`.toLowerCase().includes(g))).toReversed();let f;e[8]!==l?(f=l.filter(_a),e[8]=l,e[9]=f):f=e[9];const b=f.length;let y;e[10]!==i?(y=i("Operation console"),e[10]=i,e[11]=y):y=e[11];let x;e[12]!==i?(x=i("Operation console"),e[12]=i,e[13]=x):x=e[13];let v;e[14]!==x?(v=o("span",{className:"text-xs font-medium",children:x}),e[14]=x,e[15]=v):v=e[15];let h;e[16]!==l.length||e[17]!==i?(h=i("{count} calls",{count:l.length}),e[16]=l.length,e[17]=i,e[18]=h):h=e[18];let m;e[19]!==h?(m=o(gt,{variant:"secondary",children:h}),e[19]=h,e[20]=m):m=e[20];let w;e[21]!==b||e[22]!==i?(w=b>0&&o(gt,{variant:"destructive",children:i("{count} failed",{count:b})}),e[21]=b,e[22]=i,e[23]=w):w=e[23];const P=n==="errors",C=n==="errors"&&"bg-accent";let S;e[24]!==C?(S=_("rounded px-2 py-0.5 text-xs outline-none hover:bg-accent focus-visible:bg-accent",C),e[24]=C,e[25]=S):S=e[25];let N;e[26]!==r||e[27]!==n?(N=()=>{r(n==="errors"?"all":"errors")},e[26]=r,e[27]=n,e[28]=N):N=e[28];let T;e[29]!==i?(T=i("Errors"),e[29]=i,e[30]=T):T=e[30];let A;e[31]!==S||e[32]!==N||e[33]!==T||e[34]!==P?(A=o("button",{"aria-pressed":P,className:S,"data-testid":"oc-filter-errors",onClick:N,type:"button",children:T}),e[31]=S,e[32]=N,e[33]=T,e[34]=P,e[35]=A):A=e[35];let L;e[36]!==i?(L=i("Filter"),e[36]=i,e[37]=L):L=e[37];let O;e[38]===Symbol.for("react.memo_cache_sentinel")?(O=E=>{u(E.target.value)},e[38]=O):O=e[38];let V;e[39]!==i?(V=i("Filter"),e[39]=i,e[40]=V):V=e[40];let B;e[41]!==c||e[42]!==L||e[43]!==V?(B=o(Ut,{"aria-label":L,className:"h-7 w-40 text-xs","data-testid":"oc-search",onChange:O,placeholder:V,value:c}),e[41]=c,e[42]=L,e[43]=V,e[44]=B):B=e[44];let z;e[45]!==i?(z=i("Clear"),e[45]=i,e[46]=z):z=e[46];let $;e[47]!==z?($=o("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:Ta,type:"button",children:z}),e[47]=z,e[48]=$):$=e[48];let H;e[49]!==i?(H=i("Hide"),e[49]=i,e[50]=H):H=e[50];let D;e[51]!==a||e[52]!==H?(D=o("button",{"aria-label":H,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:a,type:"button",children:"✕"}),e[51]=a,e[52]=H,e[53]=D):D=e[53];let Z;e[54]!==A||e[55]!==B||e[56]!==$||e[57]!==D||e[58]!==v||e[59]!==m||e[60]!==w?(Z=k("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[v,m,w,A,B,$,D]}),e[54]=A,e[55]=B,e[56]=$,e[57]=D,e[58]=v,e[59]=m,e[60]=w,e[61]=Z):Z=e[61],d=k("section",{"aria-label":y,className:"flex max-h-80 flex-col border-t border-border bg-card","data-testid":"lunora-operation-console",children:[Z,p.length===0?o("p",{className:"p-3 text-xs text-muted-foreground","data-testid":"oc-empty",children:i("Every admin call this studio makes is recorded here.")}):o("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"oc-rows",children:p.map(E=>o(Ca,{entry:E,focused:E.seq===s},E.seq))})]}),e[0]=l,e[1]=s,e[2]=c,e[3]=a,e[4]=r,e[5]=n,e[6]=i,e[7]=d}else d=e[7];return d};function _a(t){return t.status==="error"}function Ta(){wt.clear()}const Ra=()=>{const t=M(334),e=se();let s;t[0]!==e?(s=e("Health score"),t[0]=e,t[1]=s):s=t[1];let a;t[2]!==e?(a=e("Agents"),t[2]=e,t[3]=a):a=t[3];let r;t[4]!==e?(r=e("Evals"),t[4]=e,t[5]=r):r=t[5];let n;t[6]!==e?(n=e("AI usage"),t[6]=e,t[7]=n):n=t[7];let i;t[8]!==e?(i=e("Analytics"),t[8]=e,t[9]=i):i=t[9];let l;t[10]!==e?(l=e("API"),t[10]=e,t[11]=l):l=t[11];let c;t[12]!==e?(c=e("Architecture"),t[12]=e,t[13]=c):c=t[13];let u;t[14]!==e?(u=e("Audit"),t[14]=e,t[15]=u):u=t[15];let d;t[16]!==e?(d=e("Auth audit"),t[16]=e,t[17]=d):d=t[17];let g;t[18]!==e?(g=e("Configuration"),t[18]=e,t[19]=g):g=t[19];let p;t[20]!==e?(p=e("Sessions"),t[20]=e,t[21]=p):p=t[21];let f;t[22]!==e?(f=e("Containers"),t[22]=e,t[23]=f):f=t[23];let b;t[24]!==e?(b=e("Dashboards"),t[24]=e,t[25]=b):b=t[25];let y;t[26]!==e?(y=e("Data"),t[26]=e,t[27]=y):y=t[27];let x;t[28]!==e?(x=e("Deployment health"),t[28]=e,t[29]=x):x=t[29];let v;t[30]!==e?(v=e("Log drains"),t[30]=e,t[31]=v):v=t[31];let h;t[32]!==e?(h=e("Export / Import"),t[32]=e,t[33]=h):h=t[33];let m;t[34]!==e?(m=e("Fan-out"),t[34]=e,t[35]=m):m=t[35];let w;t[36]!==e?(w=e("Files"),t[36]=e,t[37]=w):w=t[37];let P;t[38]!==e?(P=e("Flags"),t[38]=e,t[39]=P):P=t[39];let C;t[40]!==e?(C=e("Functions"),t[40]=e,t[41]=C):C=t[41];let S;t[42]!==e?(S=e("Health"),t[42]=e,t[43]=S):S=t[43];let N;t[44]!==e?(N=e("Home"),t[44]=e,t[45]=N):N=t[45];let T;t[46]!==e?(T=e("Performance"),t[46]=e,t[47]=T):T=t[47];let A;t[48]!==e?(A=e("Issues"),t[48]=e,t[49]=A):A=t[49];let L;t[50]!==e?(L=e("KV"),t[50]=e,t[51]=L):L=t[51];let O;t[52]!==e?(O=e("Logs"),t[52]=e,t[53]=O):O=t[53];let V;t[54]!==e?(V=e("Metrics"),t[54]=e,t[55]=V):V=t[55];let B;t[56]!==e?(B=e("Migrations"),t[56]=e,t[57]=B):B=t[57];let z;t[58]!==e?(z=e("Notifications"),t[58]=e,t[59]=z):z=t[59];let $;t[60]!==e?($=e("Organizations"),t[60]=e,t[61]=$):$=t[61];let H;t[62]!==e?(H=e("Time Travel"),t[62]=e,t[63]=H):H=t[63];let D;t[64]!==e?(D=e("Privacy requests"),t[64]=e,t[65]=D):D=t[65];let Z;t[66]!==e?(Z=e("Mail"),t[66]=e,t[67]=Z):Z=t[67];let E;t[68]!==e?(E=e("Payments"),t[68]=e,t[69]=E):E=t[69];let q;t[70]!==e?(q=e("Permissions"),t[70]=e,t[71]=q):q=t[71];let ee;t[72]!==e?(ee=e("Queues"),t[72]=e,t[73]=ee):ee=t[73];let F;t[74]!==e?(F=e("Reactors"),t[74]=e,t[75]=F):F=t[75];let Y;t[76]!==e?(Y=e("Realtime"),t[76]=e,t[77]=Y):Y=t[77];let te;t[78]!==e?(te=e("RLS Policies"),t[78]=e,t[79]=te):te=t[79];let W;t[80]!==e?(W=e("Scheduled"),t[80]=e,t[81]=W):W=t[81];let U;t[82]!==e?(U=e("Schema"),t[82]=e,t[83]=U):U=t[83];let j;t[84]!==e?(j=e("Security"),t[84]=e,t[85]=j):j=t[85];let G;t[86]!==e?(G=e("Settings"),t[86]=e,t[87]=G):G=t[87];let K;t[88]!==e?(K=e("SQL editor"),t[88]=e,t[89]=K):K=t[89];let J;t[90]!==e?(J=e("Traces"),t[90]=e,t[91]=J):J=t[91];let Q;t[92]!==e?(Q=e("Access Rules"),t[92]=e,t[93]=Q):Q=t[93];let X;t[94]!==e?(X=e("Users"),t[94]=e,t[95]=X):X=t[95];let re;t[96]!==e?(re=e("Vectors"),t[96]=e,t[97]=re):re=t[97];let ne;t[98]!==e?(ne=e("Workflows"),t[98]=e,t[99]=ne):ne=t[99];let bt;t[100]!==s||t[101]!==a||t[102]!==p||t[103]!==f||t[104]!==b||t[105]!==y||t[106]!==x||t[107]!==v||t[108]!==h||t[109]!==m||t[110]!==w||t[111]!==P||t[112]!==r||t[113]!==C||t[114]!==S||t[115]!==N||t[116]!==T||t[117]!==A||t[118]!==L||t[119]!==O||t[120]!==V||t[121]!==B||t[122]!==z||t[123]!==n||t[124]!==$||t[125]!==H||t[126]!==D||t[127]!==Z||t[128]!==E||t[129]!==q||t[130]!==ee||t[131]!==F||t[132]!==Y||t[133]!==te||t[134]!==i||t[135]!==W||t[136]!==U||t[137]!==j||t[138]!==G||t[139]!==K||t[140]!==J||t[141]!==Q||t[142]!==X||t[143]!==re||t[144]!==ne||t[145]!==l||t[146]!==c||t[147]!==u||t[148]!==d||t[149]!==g?(bt={advisorHealth:s,agents:a,evals:r,aiUsage:n,analytics:i,api:l,architecture:c,audit:u,authAudit:d,authConfig:g,authSessions:p,containers:f,dashboards:b,data:y,deploymentHealth:x,drains:v,export:h,fanout:m,files:w,flags:P,functions:C,health:S,home:N,insights:T,issues:A,kv:L,logs:O,metrics:V,migrations:B,notifications:z,organizations:$,pitr:H,privacyRequests:D,mail:Z,payments:E,permissions:q,queues:ee,reactors:F,realtime:Y,rls:te,schedule:W,schema:U,security:j,settings:G,sql:K,traces:J,storageRules:Q,users:X,vectors:re,workflows:ne},t[100]=s,t[101]=a,t[102]=p,t[103]=f,t[104]=b,t[105]=y,t[106]=x,t[107]=v,t[108]=h,t[109]=m,t[110]=w,t[111]=P,t[112]=r,t[113]=C,t[114]=S,t[115]=N,t[116]=T,t[117]=A,t[118]=L,t[119]=O,t[120]=V,t[121]=B,t[122]=z,t[123]=n,t[124]=$,t[125]=H,t[126]=D,t[127]=Z,t[128]=E,t[129]=q,t[130]=ee,t[131]=F,t[132]=Y,t[133]=te,t[134]=i,t[135]=W,t[136]=U,t[137]=j,t[138]=G,t[139]=K,t[140]=J,t[141]=Q,t[142]=X,t[143]=re,t[144]=ne,t[145]=l,t[146]=c,t[147]=u,t[148]=d,t[149]=g,t[150]=bt):bt=t[150];const Mt=bt;let ie;t[151]!==e?(ie=e("Advisors"),t[151]=e,t[152]=ie):ie=t[152];let le;t[153]!==e?(le=e("Auth"),t[153]=e,t[154]=le):le=t[154];let ce;t[155]!==e?(ce=e("Database"),t[155]=e,t[156]=ce):ce=t[156];let de;t[157]!==e?(de=e("Functions"),t[157]=e,t[158]=de):de=t[158];let ue;t[159]!==e?(ue=e("Observability"),t[159]=e,t[160]=ue):ue=t[160];let fe;t[161]!==e?(fe=e("Operations"),t[161]=e,t[162]=fe):fe=t[162];let me;t[163]!==e?(me=e("Overview"),t[163]=e,t[164]=me):me=t[164];let he;t[165]!==e?(he=e("Settings"),t[165]=e,t[166]=he):he=t[166];let pe;t[167]!==e?(pe=e("Storage"),t[167]=e,t[168]=pe):pe=t[168];let vt;t[169]!==ie||t[170]!==le||t[171]!==ce||t[172]!==de||t[173]!==ue||t[174]!==fe||t[175]!==me||t[176]!==he||t[177]!==pe?(vt={advisors:ie,auth:le,database:ce,functions:de,observability:ue,operations:fe,overview:me,settings:he,storage:pe},t[169]=ie,t[170]=le,t[171]=ce,t[172]=de,t[173]=ue,t[174]=fe,t[175]=me,t[176]=he,t[177]=pe,t[178]=vt):vt=t[178];const Nt=vt;let ge;t[179]!==e?(ge=e("Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first."),t[179]=e,t[180]=ge):ge=t[180];let be;t[181]!==e?(be=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[181]=e,t[182]=be):be=t[182];let ve;t[183]!==e?(ve=e("Scores recorded by recordEvaluation — the latest verdict per eval, its trend, and the graded runs behind it."),t[183]=e,t[184]=ve):ve=t[184];let xe;t[185]!==e?(xe=e("Tokens and spend from ctx.ai.model calls — totals, per function and per model, and the recent calls behind them."),t[185]=e,t[186]=xe):xe=t[186];let ye;t[187]!==e?(ye=e("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards."),t[187]=e,t[188]=ye):ye=t[188];let we;t[189]!==e?(we=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[189]=e,t[190]=we):we=t[190];let ke;t[191]!==e?(ke=e("A durable log of admin state-changing operations."),t[191]=e,t[192]=ke):ke=t[192];let Me;t[193]!==e?(Me=e("Authentication and security events — sign-ins, MFA, and session changes."),t[193]=e,t[194]=Me):Me=t[194];let Ne;t[195]!==e?(Ne=e("Enabled plugins and session config (read-only)."),t[195]=e,t[196]=Ne):Ne=t[196];let Se;t[197]!==e?(Se=e("Your modules, and the calls, reads, writes and hand-offs between them, from codegen."),t[197]=e,t[198]=Se):Se=t[198];let Ce;t[199]!==e?(Ce=e("Browse and revoke active sessions across all users."),t[199]=e,t[200]=Ce):Ce=t[200];let Pe;t[201]!==e?(Pe=e("Live Cloudflare Containers — current lifecycle state per instance from the log stream."),t[201]=e,t[202]=Pe):Pe=t[202];let _e;t[203]!==e?(_e=e("Chart widgets backed by saved read-only SQL queries."),t[203]=e,t[204]=_e):_e=t[204];let Te;t[205]!==e?(Te=e("Browse and edit rows across your shard and global tables."),t[205]=e,t[206]=Te):Te=t[206];let Re;t[207]!==e?(Re=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[207]=e,t[208]=Re):Re=t[208];let Ae;t[209]!==e?(Ae=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[209]=e,t[210]=Ae):Ae=t[210];let Le;t[211]!==e?(Le=e("Export a shard to NDJSON, or import rows from it."),t[211]=e,t[212]=Le):Le=t[212];let Ie;t[213]!==e?(Ie=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[213]=e,t[214]=Ie):Ie=t[214];let Ee;t[215]!==e?(Ee=e("Browse objects in your R2 storage buckets."),t[215]=e,t[216]=Ee):Ee=t[216];let $e;t[217]!==e?($e=e("Inspect feature flags and their live evaluation under a targeting context."),t[217]=e,t[218]=$e):$e=t[218];let He;t[219]!==e?(He=e("Run registered queries, mutations, and actions."),t[219]=e,t[220]=He):He=t[220];let Ve;t[221]!==e?(Ve=e("At-a-glance connection, error, and shard signals."),t[221]=e,t[222]=Ve):Ve=t[222];let Be;t[223]!==e?(Be=e("Connection, health, and advisor summary for your deployment."),t[223]=e,t[224]=Be):Be=t[224];let ze;t[225]!==e?(ze=e("Surface slow functions, error spikes, and cache problems."),t[225]=e,t[226]=ze):ze=t[226];let De;t[227]!==e?(De=e("Grouped error triage — Worker throws and container crashes folded by fingerprint."),t[227]=e,t[228]=De):De=t[228];let Oe;t[229]!==e?(Oe=e("A live stream of recent function logs."),t[229]=e,t[230]=Oe):Oe=t[230];let Ze;t[231]!==e?(Ze=e("Per-shard health and aggregate metrics."),t[231]=e,t[232]=Ze):Ze=t[232];let qe;t[233]!==e?(qe=e("Review migration status and run them."),t[233]=e,t[234]=qe):qe=t[234];let Fe;t[235]!==e?(Fe=e("Registered push devices — endpoint, kind, last-send status, and delivery errors."),t[235]=e,t[236]=Fe):Fe=t[236];let We;t[237]!==e?(We=e("Browse and manage organizations, members, and invitations."),t[237]=e,t[238]=We):We=t[238];let Ue;t[239]!==e?(Ue=e("Restore a shard to a point in the last 30 days."),t[239]=e,t[240]=Ue):Ue=t[240];let je;t[241]!==e?(je=e("Open data-subject export and erasure requests, with due dates and failed-run retries."),t[241]=e,t[242]=je):je=t[242];let Ge;t[243]!==e?(Ge=e("Email your app sent, captured in dev."),t[243]=e,t[244]=Ge):Ge=t[244];let Ke;t[245]!==e?(Ke=e("Synced customers, subscriptions, and webhook events."),t[245]=e,t[246]=Ke):Ke=t[246];let Qe;t[247]!==e?(Qe=e("Inspect access policies per table, and probe a function as any identity."),t[247]=e,t[248]=Qe):Qe=t[248];let Ye;t[249]!==e?(Ye=e("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue."),t[249]=e,t[250]=Ye):Ye=t[250];let Je;t[251]!==e?(Je=e("Server-side onQueryChange reactors: what has run, what was suppressed, and what is failing."),t[251]=e,t[252]=Je):Je=t[252];let Xe;t[253]!==e?(Xe=e("Active WebSocket subscriptions on this shard."),t[253]=e,t[254]=Xe):Xe=t[254];let et;t[255]!==e?(et=e("Inspect row-level-security policies and roles, per table."),t[255]=e,t[256]=et):et=t[256];let tt;t[257]!==e?(tt=e("Inspect and cancel scheduled jobs."),t[257]=e,t[258]=tt):tt=t[258];let st;t[259]!==e?(st=e("Inspect each table and its columns."),t[259]=e,t[260]=st):st=t[260];let at;t[261]!==e?(at=e("Review admin gates, credentials, and log redaction."),t[261]=e,t[262]=at):at=t[262];let ot;t[263]!==e?(ot=e("Read-only deployment config — vars, secrets, and bindings."),t[263]=e,t[264]=ot):ot=t[264];let rt;t[265]!==e?(rt=e("Run read-only SQL against a shard."),t[265]=e,t[266]=rt):rt=t[266];let nt;t[267]!==e?(nt=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[267]=e,t[268]=nt):nt=t[268];let it;t[269]!==e?(it=e("Inspect storage access rules — per bucket, operation, and key prefix."),t[269]=e,t[270]=it):it=t[270];let lt;t[271]!==e?(lt=e("Recent ctx.trace waterfalls for this shard — the drill-down from a log line."),t[271]=e,t[272]=lt):lt=t[272];let ct;t[273]!==e?(ct=e("Manage auth users — roles, bans, sessions, and identity."),t[273]=e,t[274]=ct):ct=t[274];let dt;t[275]!==e?(dt=e("Browse Vectorize indexes and run similarity searches."),t[275]=e,t[276]=dt):dt=t[276];let ut;t[277]!==e?(ut=e("Inspect declared Cloudflare Workflows and their bindings."),t[277]=e,t[278]=ut):ut=t[278];let xt;t[279]!==tt||t[280]!==st||t[281]!==at||t[282]!==ot||t[283]!==rt||t[284]!==nt||t[285]!==it||t[286]!==lt||t[287]!==ct||t[288]!==dt||t[289]!==ut||t[290]!==ge||t[291]!==be||t[292]!==ve||t[293]!==xe||t[294]!==ye||t[295]!==we||t[296]!==ke||t[297]!==Me||t[298]!==Ne||t[299]!==Se||t[300]!==Ce||t[301]!==Pe||t[302]!==_e||t[303]!==Te||t[304]!==Re||t[305]!==Ae||t[306]!==Le||t[307]!==Ie||t[308]!==Ee||t[309]!==$e||t[310]!==He||t[311]!==Ve||t[312]!==Be||t[313]!==ze||t[314]!==De||t[315]!==Oe||t[316]!==Ze||t[317]!==qe||t[318]!==Fe||t[319]!==We||t[320]!==Ue||t[321]!==je||t[322]!==Ge||t[323]!==Ke||t[324]!==Qe||t[325]!==Ye||t[326]!==Je||t[327]!==Xe||t[328]!==et?(xt={advisorHealth:ge,agents:be,evals:ve,aiUsage:xe,analytics:ye,api:we,audit:ke,authAudit:Me,authConfig:Ne,architecture:Se,authSessions:Ce,containers:Pe,dashboards:_e,data:Te,deploymentHealth:Re,drains:Ae,export:Le,fanout:Ie,files:Ee,flags:$e,functions:He,health:Ve,home:Be,insights:ze,issues:De,logs:Oe,metrics:Ze,migrations:qe,notifications:Fe,organizations:We,pitr:Ue,privacyRequests:je,mail:Ge,payments:Ke,permissions:Qe,queues:Ye,reactors:Je,realtime:Xe,rls:et,schedule:tt,schema:st,security:at,settings:ot,sql:rt,kv:nt,storageRules:it,traces:lt,users:ct,vectors:dt,workflows:ut},t[279]=tt,t[280]=st,t[281]=at,t[282]=ot,t[283]=rt,t[284]=nt,t[285]=it,t[286]=lt,t[287]=ct,t[288]=dt,t[289]=ut,t[290]=ge,t[291]=be,t[292]=ve,t[293]=xe,t[294]=ye,t[295]=we,t[296]=ke,t[297]=Me,t[298]=Ne,t[299]=Se,t[300]=Ce,t[301]=Pe,t[302]=_e,t[303]=Te,t[304]=Re,t[305]=Ae,t[306]=Le,t[307]=Ie,t[308]=Ee,t[309]=$e,t[310]=He,t[311]=Ve,t[312]=Be,t[313]=ze,t[314]=De,t[315]=Oe,t[316]=Ze,t[317]=qe,t[318]=Fe,t[319]=We,t[320]=Ue,t[321]=je,t[322]=Ge,t[323]=Ke,t[324]=Qe,t[325]=Ye,t[326]=Je,t[327]=Xe,t[328]=et,t[329]=xt):xt=t[329];const St=xt;let yt;return t[330]!==Nt||t[331]!==St||t[332]!==Mt?(yt={groupLabel:Nt,tabDescription:St,tabLabel:Mt},t[330]=Nt,t[331]=St,t[332]=Mt,t[333]=yt):yt=t[333],yt},Aa=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=k("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:[o("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),o("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},La=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=k("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:[o("circle",{cx:"12",cy:"12",r:"4"}),o("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},Ia=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o("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:o("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},Ea=t=>{const e=M(2),{className:s}=t;let a;return e[0]!==s?(a=o("span",{className:s}),e[0]=s,e[1]=a):a=e[1],a},$a=R(()=>import("../packem_chunks/theme-indicator.mjs").catch(()=>({default:Ea}))),Tt="absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",Ha=[{Icon:Aa,value:"system"},{Icon:La,value:"light"},{Icon:Ia,value:"dark"}],Va=()=>{const t=M(21),{theme:e,setTheme:s}=qs(),a=se(),[r,n]=mt(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{n(!0)},t[0]=i):i=t[0];const l=i;let c;t[1]!==a?(c=a("Dark theme"),t[1]=a,t[2]=c):c=t[2];let u;t[3]!==a?(u=a("Light theme"),t[3]=a,t[4]=u):u=t[4];let d;t[5]!==a?(d=a("System theme"),t[5]=a,t[6]=d):d=t[6];let g;t[7]!==c||t[8]!==u||t[9]!==d?(g={dark:c,light:u,system:d},t[7]=c,t[8]=u,t[9]=d,t[10]=g):g=t[10];const p=g;let f;t[11]!==a?(f=a("Theme"),t[11]=a,t[12]=f):f=t[12];let b;t[13]!==r||t[14]!==p||t[15]!==s||t[16]!==e?(b=Ha.map(x=>{const{Icon:v,value:h}=x,m=e===h;return k("button",{"aria-checked":m,"aria-label":p[h],className:_("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",m?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${h}`,onClick:()=>{l(),s(h)},role:"radio",title:p[h],type:"button",children:[m&&(r?o(qt,{fallback:o("span",{className:Tt}),children:o($a,{className:Tt})}):o("span",{className:Tt})),o("span",{className:"relative",children:o(v,{})})]},h)}),t[13]=r,t[14]=p,t[15]=s,t[16]=e,t[17]=b):b=t[17];let y;return t[18]!==f||t[19]!==b?(y=o("div",{"aria-label":f,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",onFocus:l,onPointerEnter:l,role:"radiogroup",children:b}),t[18]=f,t[19]=b,t[20]=y):y=t[20],y},Ba=t=>{const e=M(23),{domain:s,onOpenCommandPalette:a,page:r}=t,n=se();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o(ha,{className:"-ms-1"}),e[0]=i):i=e[0];let l;e[1]!==n?(l=n("Breadcrumb"),e[1]=n,e[2]=l):l=e[2];let c;e[3]!==s?(c=o("span",{className:"text-muted-foreground",children:s}),e[3]=s,e[4]=c):c=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=o("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:o("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),e[5]=u):u=e[5];let d;e[6]!==r?(d=o("span",{className:"font-medium text-foreground",children:r}),e[6]=r,e[7]=d):d=e[7];let g;e[8]!==l||e[9]!==c||e[10]!==d?(g=k("nav",{"aria-label":l,className:"flex items-center gap-1.5 text-[13px]",children:[c,u,d]}),e[8]=l,e[9]=c,e[10]=d,e[11]=g):g=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=k("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[o("circle",{cx:"11",cy:"11",r:"7"}),o("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[12]=p):p=e[12];let f;e[13]!==n?(f=n("Search…"),e[13]=n,e[14]=f):f=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=o("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"⌘K"}),e[15]=b):b=e[15];let y;e[16]!==a||e[17]!==f?(y=k("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:a,type:"button",children:[p,f,b]}),e[16]=a,e[17]=f,e[18]=y):y=e[18];let x;e[19]===Symbol.for("react.memo_cache_sentinel")?(x=o("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:o(Va,{})}),e[19]=x):x=e[19];let v;return e[20]!==y||e[21]!==g?(v=k("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[i,g,y,x]}),e[20]=y,e[21]=g,e[22]=v):v=e[22],v},za={agents:{capability:"agents"},analytics:{capability:"analytics",feature:"analytics"},authAudit:{feature:"auth"},authConfig:{feature:"auth"},authSessions:{feature:"auth"},containers:{capability:"containers",feature:"containers"},fanout:{capability:"crossShardFanout"},files:{capability:"objectStorage",feature:"storage"},flags:{feature:"flags"},kv:{capability:"keyValueStore",feature:"kv"},mail:{capability:"mail",feature:"mail"},notifications:{feature:"notifications"},organizations:{feature:"auth"},payments:{feature:"payments"},pitr:{capability:"pointInTimeRecovery"},privacyRequests:{feature:"privacy"},queues:{capability:"queues",feature:"queues"},reactors:{capability:"serverReactors"},schedule:{capability:"scheduler",feature:"scheduler"},storageRules:{feature:"storage"},users:{feature:"auth"},vectors:{capability:"vectorStore",feature:"vectors"},workflows:{capability:"workflows",feature:"workflows"}},Da={agents:"Durable agents",analytics:"Analytics",containers:"Containers",crossShardFanout:"Cross-shard fan-out",keyValueStore:"Key-value storage",mail:"Mail delivery",objectStorage:"Object storage",pointInTimeRecovery:"Point-in-time recovery",queues:"Queues",scheduler:"Scheduling",serverReactors:"Server reactors",vectorStore:"Vector search",workflows:"Workflows"},Oa={kind:"hidden"},zt={kind:"ok"},Za={kind:"pending"},is=(t,e,s)=>{const a=za[t];return a?.feature!==void 0&&!e[a.feature]?Oa:a?.capability===void 0?zt:e.settled?e.platform?.unsupported.includes(a.capability)===!0?{kind:"unavailable",reason:s("{capability} is not supported on {platform}.",{capability:s(Da[a.capability]),platform:e.platform.name})}:zt:Za},qa=(t,e,s)=>{const a={},r=[];for(const n of t){const i=[];for(const l of n.tabs){const c=is(l,e,s);c.kind!=="hidden"&&i.push(l),c.kind==="unavailable"&&(a[l]=c.reason)}i.length>0&&r.push({...n,tabs:i})}return{unavailable:a,visibleGroups:r}},Fa=t=>{const e=M(3),{reason:s,title:a}=t;let r;return e[0]!==s||e[1]!==a?(r=o(Es,{description:s,testId:"dash-unsupported",title:a}),e[0]=s,e[1]=a,e[2]=r):r=e[2],r},Wa=t=>{const e=M(4),{console:s}=$s();let a,r;e[0]!==s||e[1]!==t?(a=()=>{if(t===void 0)return;const n=i=>{if(!i.ctrlKey||i.metaKey||i.altKey||i.shiftKey||i.repeat||i.key.toLowerCase()!==s)return;const{target:l}=i;l instanceof HTMLElement&&(l.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(l.tagName))||(i.preventDefault(),t())};return globalThis.addEventListener("keydown",n),()=>{globalThis.removeEventListener("keydown",n)}},r=[s,t],e[0]=s,e[1]=t,e[2]=a,e[3]=r):(a=e[2],r=e[3]),ht(a,r)},I=(t,e)=>R(()=>t().then(s=>({default:s[e]}))),Ua=I(()=>import("../packem_chunks/InsightsPanel.mjs"),"InsightsPanel"),ja=R(()=>import("../packem_chunks/rls-panel.mjs")),Ga=R(()=>import("../packem_chunks/AdvisorHealthPanel.mjs")),Ka=R(()=>import("../packem_chunks/SecurityAdvisorPanel.mjs")),Qa=R(()=>import("../packem_chunks/agents-panel.mjs")),Ya=I(()=>import("../packem_chunks/analytics-panel.mjs"),"AnalyticsPanel"),Ja=R(()=>import("../packem_chunks/ApiTab.mjs")),Xa=R(()=>import("../packem_chunks/architecture-panel.mjs")),eo=R(()=>import("../packem_chunks/auth-audit-panel.mjs")),to=R(()=>import("../packem_chunks/auth-config-panel.mjs")),so=R(()=>import("../packem_chunks/auth-sessions-panel.mjs")),ao=R(()=>import("../packem_chunks/organizations-panel.mjs")),oo=I(()=>import("../packem_chunks/users-panel.mjs"),"UsersPanel"),ro=R(()=>import("../packem_chunks/containers-panel.mjs")),no=I(()=>import("../packem_chunks/DeploymentHealthPanel.mjs"),"DeploymentHealthPanel"),io=I(()=>import("../packem_chunks/TableEditor.mjs"),"TableEditor"),lo=I(()=>import("../packem_chunks/ExportImportPanel.mjs"),"ExportImportPanel"),co=R(()=>import("../packem_chunks/migrations-route.mjs")),uo={data:As,migrations:Rs},fo=I(()=>import("../packem_chunks/PitrPanel.mjs"),"PitrPanel"),mo=I(()=>import("../packem_chunks/privacy-requests-panel.mjs"),"PrivacyRequestsPanel"),ho=R(()=>import("../packem_chunks/flags-panel.mjs")),po=R(()=>import("../packem_chunks/reactors-panel.mjs")),go=I(()=>import("../packem_chunks/FunctionRunner.mjs"),"FunctionRunner"),bo=I(()=>import("../packem_chunks/FunctionStatsPanel.mjs"),"FunctionStatsPanel"),vo=R(()=>import("../packem_chunks/issues-panel.mjs")),xo=I(()=>import("../packem_chunks/AuditPanel.mjs"),"AuditPanel"),yo=R(()=>import("../packem_chunks/log-drains-panel.mjs")),wo=R(()=>import("../packem_chunks/LogsPanel.mjs").then(t=>({default:t.LogsPanel}))),ko=I(()=>import("../packem_chunks/MailPanel.mjs"),"MailPanel"),Mo=I(()=>import("../packem_chunks/schedule-panel.mjs"),"SchedulePanel"),No=R(()=>import("../packem_chunks/subscriptions-panel.mjs")),So=R(()=>import("../packem_chunks/sync-client-panel.mjs")),Co=I(()=>import("../packem_chunks/kv-browser.mjs"),"KvBrowser"),Po=R(()=>import("../packem_chunks/NotificationsPanel.mjs")),_o=I(()=>import("../packem_chunks/payments-panel.mjs"),"PaymentsPanel"),To=I(()=>import("../packem_chunks/permissions-panel.mjs"),"PermissionsPanel"),Ro=R(()=>import("../packem_chunks/queues-panel.mjs")),Ao=R(()=>import("../packem_chunks/dashboards-panel.mjs")),Lo=R(()=>import("../packem_chunks/fanout-panel.mjs")),Io=I(()=>import("../packem_chunks/HealthPanel.mjs"),"HealthPanel"),Eo=I(()=>import("../packem_chunks/MetricsPanel.mjs"),"MetricsPanel"),$o=I(()=>import("../packem_chunks/SchemaViewer.mjs"),"SchemaViewer"),Ho=I(()=>import("../packem_chunks/SettingsPanel.mjs"),"SettingsPanel"),Vo=I(()=>import("../packem_chunks/SqlEditorPanel.mjs"),"SqlEditorPanel"),Bo=I(()=>import("../packem_chunks/FileBrowser.mjs"),"FileBrowser"),zo=R(()=>import("../packem_chunks/storage-rules-panel.mjs")),Do=R(()=>import("../packem_chunks/traces-panel.mjs")),Oo=R(()=>import("../packem_chunks/evals-panel.mjs")),Zo=R(()=>import("../packem_chunks/ai-usage-panel.mjs")),qo=I(()=>import("../packem_chunks/vector-browser.mjs"),"VectorBrowser"),Fo=R(()=>import("../packem_chunks/workflows-panel.mjs")),ls=Zt(null),Wo={analytics:o("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:o("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),architecture:o("path",{d:"M4 4h6v5H4V4Zm10 0h6v5h-6V4ZM9 15h6v5H9v-5ZM7 9v3h10V9M12 12v3"}),audit:o("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:o("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:o("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:o("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:o("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:o("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:o("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:o("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:o("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:o("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:o("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:o("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:o("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:o("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:o("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),evals:o("path",{d:"M4 19V5m0 14h16M8 15l3-4 3 3 4-6M8 15v.01"}),aiUsage:o("path",{d:"M12 3v3m0 12v3M5.6 5.6l2.1 2.1m8.6 8.6 2.1 2.1M3 12h3m12 0h3M5.6 18.4l2.1-2.1m8.6-8.6 2.1-2.1M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z"}),health:o("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:o("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:o("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:o("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:o("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:o("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:o("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:o("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:o("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:o("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:o("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:o("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:o("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:o("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),privacyRequests:o("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 3h4"}),queues:o("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),reactors:o("path",{d:"M4 4v6h6M20 20v-6h-6M20 9a8 8 0 0 0-14.7-3M4 15a8 8 0 0 0 14.7 3"}),realtime:o("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:o("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:o("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:o("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:o("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:o("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"}),advisorHealth:o("path",{d:"M3 12h4l2-5 3 10 2-5h5"}),security:o("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:o("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:o("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:o("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:o("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:o("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},Dt=[{key:"overview",tabs:["home","dashboards"]},{key:"database",tabs:["data","sql","schema","migrations","vectors","pitr","export"]},{key:"functions",tabs:["functions","api","architecture","workflows","agents","queues"]},{key:"auth",tabs:["users","organizations","authSessions","authAudit","authConfig"]},{key:"storage",tabs:["files","storageRules","kv"]},{key:"observability",tabs:["issues","logs","traces","evals","aiUsage","audit","realtime","reactors","fanout","containers","metrics","analytics","health","deploymentHealth"]},{key:"advisors",tabs:["advisorHealth","security","rls","permissions","insights"]},{key:"operations",tabs:["schedule","mail","drains","notifications","payments","flags","privacyRequests"]},{key:"settings",tabs:["settings"]}],At=t=>{const e=M(2),{tab:s}=t,a=Wo[s];let r;return e[0]!==a?(r=o("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:a}),e[0]=a,e[1]=r):r=e[1],r},Uo=t=>t,cs=Uo(["home","data","sql","functions","api","architecture","workflows","agents","queues","containers","schema","migrations","vectors","export","pitr","users","organizations","authSessions","authAudit","authConfig","files","storageRules","kv","dashboards","metrics","analytics","health","deploymentHealth","advisorHealth","security","rls","permissions","insights","issues","logs","traces","evals","aiUsage","reactors","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","privacyRequests","settings"]),jo=new Set(["api","data","migrations","sql"]),Go=t=>{const e=t.split("/").findLast(Boolean)??"";return cs.includes(e)?e:"home"},Ko=t=>{const e=M(19),{chrome:s,connected:a}=t,r=se();let n;e[0]!==r?(n=r("admin token"),e[0]=r,e[1]=n):n=e[1];let i;e[2]!==n?(i=o("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:n}),e[2]=n,e[3]=i):i=e[3];let l;e[4]!==s.onTokenChange||e[5]!==s.token?(l=o(Ut,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:s.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:s.token}),e[4]=s.onTokenChange,e[5]=s.token,e[6]=l):l=e[6];let c;e[7]!==a||e[8]!==r?(c=a&&k("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[o("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),r("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=a,e[8]=r,e[9]=c):c=e[9];let u;e[10]!==s.clearToken||e[11]!==a||e[12]!==r?(u=a&&o("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:s.clearToken,type:"button",children:r("Clear")}),e[10]=s.clearToken,e[11]=a,e[12]=r,e[13]=u):u=e[13];let d;return e[14]!==i||e[15]!==l||e[16]!==c||e[17]!==u?(d=k("div",{className:"flex flex-col gap-2",children:[i,l,c,u]}),e[14]=i,e[15]=l,e[16]=c,e[17]=u,e[18]=d):d=e[18],d},ds="opacity-50",Qo=t=>{const e=M(27),{current:s,group:a,groupLabel:r,selectTab:n,tabDescription:i,tabLabel:l,unavailable:c}=t,u=a.tabs.includes(s)?"page":void 0,d=r[a.key],g=a.tabs[0];let p;e[0]!==g?(p=o(At,{tab:g}),e[0]=g,e[1]=p):p=e[1];let f;e[2]!==u||e[3]!==d||e[4]!==p?(f=o(as,{"aria-current":u,"aria-label":d,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]=u,e[3]=d,e[4]=p,e[5]=f):f=e[5];const b=r[a.key];let y;e[6]!==b?(y=o("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:b}),e[6]=b,e[7]=y):y=e[7];let x;if(e[8]!==s||e[9]!==a.tabs||e[10]!==n||e[11]!==i||e[12]!==l||e[13]!==c){let m;e[15]!==s||e[16]!==n||e[17]!==i||e[18]!==l||e[19]!==c?(m=w=>k("button",{"aria-current":s===w?"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",c[w]!==void 0&&ds),"data-tab":w,"data-testid":`dash-tab-${w}`,"data-unsupported":c[w]===void 0?void 0:"true",onClick:n,title:i[w],type:"button",children:[o(At,{tab:w}),o("span",{children:l[w]})]},w),e[15]=s,e[16]=n,e[17]=i,e[18]=l,e[19]=c,e[20]=m):m=e[20],x=a.tabs.map(m),e[8]=s,e[9]=a.tabs,e[10]=n,e[11]=i,e[12]=l,e[13]=c,e[14]=x}else x=e[14];let v;e[21]!==y||e[22]!==x?(v=k(os,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[y,x]}),e[21]=y,e[22]=x,e[23]=v):v=e[23];let h;return e[24]!==f||e[25]!==v?(h=k(ss,{children:[f,v]}),e[24]=f,e[25]=v,e[26]=h):h=e[26],h},Yo=t=>{const e=M(45),{chrome:s,collapsed:a,connected:r}=t,n=se();if(s===null){let m;e[0]!==n?(m=n("Admin"),e[0]=n,e[1]=m):m=e[1];let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w=o("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"}),e[2]=w):w=e[2];let P;e[3]!==n?(P=n("Admin"),e[3]=n,e[4]=P):P=e[4];let C;e[5]!==P?(C=o("span",{className:"truncate text-[13px] font-medium",children:P}),e[5]=P,e[6]=C):C=e[6];let S;e[7]!==n?(S=n("Studio"),e[7]=n,e[8]=S):S=e[8];let N;e[9]!==S?(N=o("span",{className:"truncate text-[11px] text-muted-foreground",children:S}),e[9]=S,e[10]=N):N=e[10];let T;e[11]!==C||e[12]!==N?(T=k("span",{className:"grid flex-1 text-start leading-tight",children:[C,N]}),e[11]=C,e[12]=N,e[13]=T):T=e[13];let A;return e[14]!==m||e[15]!==T?(A=k(ns,{className:"data-active:bg-transparent",size:"lg",tooltip:m,children:[w,T]}),e[14]=m,e[15]=T,e[16]=A):A=e[16],A}const i=a?"mx-auto size-8 justify-center":"w-full p-2";let l;e[17]!==i?(l=_("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 c;e[19]!==r||e[20]!==n?(c=n(r?"Connected":"Not connected"),e[19]=r,e[20]=n,e[21]=c):c=e[21];const u=r?"bg-success":"bg-muted-foreground/50";let d;e[22]!==u?(d=_("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",u),e[22]=u,e[23]=d):d=e[23];let g;e[24]!==d?(g=k("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",o("span",{"aria-hidden":"true",className:d})]}),e[24]=d,e[25]=g):g=e[25];let p;e[26]!==a||e[27]!==r||e[28]!==n?(p=!a&&k(Ft,{children:[k("span",{className:"grid flex-1 text-start leading-tight",children:[o("span",{className:"truncate text-[13px] font-medium",children:n("Admin")}),o("span",{className:"truncate text-[11px] text-muted-foreground",children:n(r?"Connected":"Not connected")})]}),o("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:o("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=a,e[27]=r,e[28]=n,e[29]=p):p=e[29];let f;e[30]!==l||e[31]!==c||e[32]!==g||e[33]!==p?(f=k(as,{className:l,"data-testid":"dash-app-connect",title:c,children:[g,p]}),e[30]=l,e[31]=c,e[32]=g,e[33]=p,e[34]=f):f=e[34];const b=a?"end":"start",y=a?"right":"top";let x;e[35]!==s||e[36]!==r?(x=o(Ko,{chrome:s,connected:r}),e[35]=s,e[36]=r,e[37]=x):x=e[37];let v;e[38]!==y||e[39]!==x||e[40]!==b?(v=o(os,{align:b,keepMounted:!0,side:y,children:x}),e[38]=y,e[39]=x,e[40]=b,e[41]=v):v=e[41];let h;return e[42]!==v||e[43]!==f?(h=k(ss,{children:[f,v]}),e[42]=v,e[43]=f,e[44]=h):h=e[44],h},Jo=t=>{const e=M(29),{chrome:s,connected:a,current:r,groupLabel:n,groups:i,selectTab:l,tabDescription:c,tabLabel:u,unavailable:d}=t,g=se(),{state:p}=kt(),f=p==="collapsed",b=f&&"justify-center px-0";let y;e[0]!==b?(y=_("flex items-center gap-2.5 px-1.5 py-1",b),e[0]=b,e[1]=y):y=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=o(js,{className:"size-9 shrink-0 text-foreground"}),e[2]=x):x=e[2];let v;e[3]!==f||e[4]!==a||e[5]!==g?(v=!f&&k(Ft,{children:[k("span",{className:"grid flex-1 leading-tight",children:[o("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),o("span",{className:"truncate text-[11px] text-muted-foreground",children:g("Studio")})]}),o(gt,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:g(a?"Live":"Local")})]}),e[3]=f,e[4]=a,e[5]=g,e[6]=v):v=e[6];let h;e[7]!==y||e[8]!==v?(h=o(ga,{children:k("div",{className:y,children:[x,v]})}),e[7]=y,e[8]=v,e[9]=h):h=e[9];let m;e[10]!==f||e[11]!==r||e[12]!==n||e[13]!==i||e[14]!==l||e[15]!==c||e[16]!==u||e[17]!==d?(m=f?i.map(S=>o(Qo,{current:r,group:S,groupLabel:n,selectTab:l,tabDescription:c,tabLabel:u,unavailable:d},S.key)):i.map(S=>k(xa,{children:[o(ya,{className:"text-[11px] font-medium tracking-wider uppercase",children:n[S.key]}),o(wa,{children:o(Vt,{children:S.tabs.map(N=>o(Bt,{children:k(ns,{className:_("data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]",d[N]!==void 0&&ds),"data-tab":N,"data-testid":`dash-tab-${N}`,"data-unsupported":d[N]===void 0?void 0:"true",isActive:r===N,onClick:l,title:c[N],tooltip:c[N],children:[o(At,{tab:N}),o("span",{children:u[N]})]})},N))})})]},S.key)),e[10]=f,e[11]=r,e[12]=n,e[13]=i,e[14]=l,e[15]=c,e[16]=u,e[17]=d,e[18]=m):m=e[18];let w;e[19]!==m?(w=o(va,{children:m}),e[19]=m,e[20]=w):w=e[20];let P;e[21]!==s||e[22]!==f||e[23]!==a?(P=o(ba,{children:o(Vt,{children:o(Bt,{children:o(Yo,{chrome:s,collapsed:f,connected:a})})})}),e[21]=s,e[22]=f,e[23]=a,e[24]=P):P=e[24];let C;return e[25]!==h||e[26]!==w||e[27]!==P?(C=k(ma,{collapsible:"icon",variant:"inset",children:[h,w,P]}),e[25]=h,e[26]=w,e[27]=P,e[28]=C):C=e[28],C},Et=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=k("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[k("div",{className:"flex items-center gap-2",children:[o(Ct,{className:"h-8 w-40"}),o(Ct,{className:"h-8 w-24"})]}),o(Ct,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},Xo=t=>{const e=M(5),{title:s,verdict:a}=t;if(a.kind==="pending"){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o(Et,{}),e[0]=n):n=e[0],n}if(a.kind==="unavailable"){let n;return e[1]!==s||e[2]!==a.reason?(n=o(Fa,{reason:a.reason,title:s}),e[1]=s,e[2]=a.reason,e[3]=n):n=e[3],n}let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=o(vs,{}),e[4]=r):r=e[4],r},er=()=>{const t=M(46),e=se(),s=Ot();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:nr},t[0]=a):a=t[0];const r=bs(a),n=Go(r),i=jo.has(n),l=ks(),c=l?.toggle;Wa(c);const u=Ps(),{groupLabel:d,tabDescription:g,tabLabel:p}=Ra(),{unavailable:f,visibleGroups:b}=qa(Dt,u,e),y={...g,...f},x=is(n,u,e),v=x.kind==="hidden";let h,m;t[1]!==v||t[2]!==s?(h=()=>{v&&Rt(s({replace:!0,to:"/home"}))},m=[v,s],t[1]=v,t[2]=s,t[3]=h,t[4]=m):(h=t[3],m=t[4]),ht(h,m);let w;t[5]!==s?(w=Q=>{Rt(s({to:`/${Q.currentTarget.dataset.tab??""}`}))},t[5]=s,t[6]=w):w=t[6];const P=w;let C,S;t[7]!==n||t[8]!==p?(C=()=>{typeof document<"u"&&(document.title=`${p[n]} · lunora`)},S=[n,p],t[7]=n,t[8]=p,t[9]=C,t[10]=S):(C=t[9],S=t[10]),ht(C,S);const N=b.find(Q=>Q.tabs.includes(n))??Dt[0],T=b.flatMap(Q=>Q.tabs.filter(X=>f[X]===void 0).map(X=>({group:d[Q.key],label:p[X],to:`/${X}`}))),A=c===void 0?T:[...T,{group:e("Operations"),label:e("Toggle operation console"),run:c}],L=Lt(ls),O=L!==null&&L.token!=="";let V;t[11]!==A?(V=o(Ls,{items:A}),t[11]=A,t[12]=V):V=t[12];const B=d[N.key],z=p[n];let $;t[13]!==B||t[14]!==z?($=o(Ba,{domain:B,onOpenCommandPalette:Is,page:z}),t[13]=B,t[14]=z,t[15]=$):$=t[15];let H;t[16]!==L?.rulesInstalled?(H=L?.rulesInstalled===!1&&o(Qs,{}),t[16]=L?.rulesInstalled,t[17]=H):H=t[17];const D=`dash-tab-${n}`,Z=i?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",E=p[n];let q;t[18]!==e||t[19]!==E?(q=e("{title} failed",{title:E}),t[18]=e,t[19]=E,t[20]=q):q=t[20];const ee=p[n];let F;t[21]!==e?(F=e("Try again"),t[21]=e,t[22]=F):F=t[22];let Y;t[23]===Symbol.for("react.memo_cache_sentinel")?(Y=o(Et,{}),t[23]=Y):Y=t[23];const te=p[n];let W;t[24]!==te||t[25]!==x?(W=o(qt,{fallback:Y,children:o(Xo,{title:te,verdict:x})}),t[24]=te,t[25]=x,t[26]=W):W=t[26];let U;t[27]!==n||t[28]!==q||t[29]!==ee||t[30]!==F||t[31]!==W?(U=o(ys,{fallbackTitle:q,label:ee,retryLabel:F,children:W},n),t[27]=n,t[28]=q,t[29]=ee,t[30]=F,t[31]=W,t[32]=U):U=t[32];let j;t[33]!==Z||t[34]!==U?(j=o("div",{className:Z,children:U}),t[33]=Z,t[34]=U,t[35]=j):j=t[35];let G;t[36]!==l?(G=l?.open===!0&&o(Pa,{focusSeq:l.focusSeq,onClose:l.close,onShownChange:l.setShown,shown:l.shown}),t[36]=l,t[37]=G):G=t[37];let K;t[38]!==D||t[39]!==j||t[40]!==G?(K=k("div",{"aria-labelledby":D,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:[j,G]}),t[38]=D,t[39]=j,t[40]=G,t[41]=K):K=t[41];let J;return t[42]!==H||t[43]!==K||t[44]!==$?(J=k(pa,{className:"overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[$,H,K]}),t[42]=H,t[43]=K,t[44]=$,t[45]=J):J=t[45],k(fa,{className:"min-h-0 flex-1","data-platform":u.platform?.id,"data-testid":"lunora-studio",children:[V,o(Jo,{chrome:L,connected:O,current:n,groupLabel:d,groups:b,selectTab:P,tabDescription:y,tabLabel:p,unavailable:f}),J]})},tr=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o(ws,{children:o(er,{})}),t[0]=e):e=t[0],e},sr=t=>{const e=M(5),{initialShardKey:s,schemaEditable:a}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const n=ps(r),{table:i}=n,l=typeof i=="string"?i:void 0;let c;return e[1]!==s||e[2]!==l||e[3]!==a?(c=o($o,{initialShardKey:s,initialTable:l,schemaEditable:a}),e[1]=s,e[2]=l,e[3]=a,e[4]=c):c=e[4],c},ar=()=>{const t=M(3),e=Ot();let s,a;return t[0]!==e?(s=()=>{Rt(e({replace:!0,to:"/home"}))},a=[e],t[0]=e,t[1]=s,t[2]=a):(s=t[1],a=t[2]),ht(s,a),null},or=({analyticsSqlQuery:t,basePath:e,privacyRequests:s,dataEditable:a=!1,functions:r,initialShardKey:n,openApiSpec:i,openRpcSpec:l,runAsIdentity:c=!1,schemaEditable:u=!1,scheduledCancel:d,scheduledCron:g,scheduledLoad:p})=>{const f=us({component:tr}),b={agents:o(Qa,{initialShardKey:n}),analytics:o(Ya,{runQuery:t}),api:o(Ja,{functions:r,initialShardKey:n,openApiSpec:i,openRpcSpec:l}),architecture:o(Xa,{}),audit:o(xo,{initialShardKey:n}),authAudit:o(eo,{}),authConfig:o(to,{}),authSessions:o(so,{}),containers:o(ro,{}),dashboards:o(Ao,{initialShardKey:n}),data:o(io,{canGenerateRows:a&&u,editable:a,initialShardKey:n}),deploymentHealth:o(no,{}),drains:o(yo,{}),export:o(lo,{initialShardKey:n}),fanout:o(Lo,{initialShardKey:n}),files:o(Bo,{}),kv:o(Co,{}),flags:o(ho,{initialShardKey:n}),reactors:o(po,{initialShardKey:n}),functions:k("div",{className:"flex flex-col gap-8",children:[o(bo,{functions:r,initialShardKey:n}),o(go,{functions:r,runAsIdentity:c})]}),health:o(Io,{initialShardKey:n}),home:o(Cs,{initialShardKey:n}),insights:o(Ua,{initialShardKey:n}),issues:o(vo,{initialShardKey:n}),logs:o(wo,{initialShardKey:n}),traces:o(Do,{initialShardKey:n}),evals:o(Oo,{initialShardKey:n}),aiUsage:o(Zo,{initialShardKey:n}),metrics:o(Eo,{initialShardKey:n}),migrations:o(co,{initialShardKey:n}),notifications:o(Po,{}),organizations:o(ao,{}),permissions:o(To,{functions:r,runAsIdentity:c,schemaEditable:u}),pitr:o(fo,{initialShardKey:n}),privacyRequests:o(mo,{source:s}),mail:o(ko,{}),payments:o(_o,{}),queues:o(Ro,{}),realtime:k("div",{className:"flex flex-col gap-8",children:[o(No,{initialShardKey:n}),o(So,{})]}),rls:o(ja,{}),schedule:o(Mo,{loadCronJobs:g,scheduledCancel:d,scheduledLoad:p}),schema:o(sr,{initialShardKey:n,schemaEditable:u}),advisorHealth:o(Ga,{}),security:o(Ka,{}),settings:o(Ho,{initialShardKey:n}),sql:o(Vo,{initialShardKey:n}),storageRules:o(zo,{}),users:o(oo,{}),vectors:o(qo,{}),workflows:o(Fo,{})},y=$t({component:()=>b.home,getParentRoute:()=>f,path:"/"}),x=cs.map(m=>$t({component:()=>b[m],getParentRoute:()=>f,path:`/${m}`,validateSearch:uo[m]})),v=f.addChildren([y,...x]),h="window"in globalThis?fs():ms({initialEntries:["/home"]});return hs({...e===void 0||e==="/"?{}:{basepath:e},defaultNotFoundComponent:ar,defaultPendingComponent:Et,defaultPendingMinMs:0,defaultPendingMs:0,history:h,routeTree:v})},rr=t=>{const e=M(19),{analyticsSqlQuery:s,basePath:a,chrome:r,dataEditable:n,functions:i,initialShardKey:l,openApiSpec:c,openRpcSpec:u,privacyRequests:d,runAsIdentity:g,schemaEditable:p,scheduledCancel:f,scheduledCron:b,scheduledLoad:y}=t;let x;e[0]!==s||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==l||e[5]!==c||e[6]!==u||e[7]!==d||e[8]!==g||e[9]!==f||e[10]!==b||e[11]!==y||e[12]!==p?(x=or({analyticsSqlQuery:s,basePath:a,privacyRequests:d,dataEditable:n,functions:i,initialShardKey:l,openApiSpec:c,openRpcSpec:u,runAsIdentity:g,schemaEditable:p,scheduledCancel:f,scheduledCron:b,scheduledLoad:y}),e[0]=s,e[1]=a,e[2]=n,e[3]=i,e[4]=l,e[5]=c,e[6]=u,e[7]=d,e[8]=g,e[9]=f,e[10]=b,e[11]=y,e[12]=p,e[13]=x):x=e[13];const v=x,h=r??null;let m;e[14]!==v?(m=o(gs,{router:v}),e[14]=v,e[15]=m):m=e[15];let w;return e[16]!==h||e[17]!==m?(w=o(ls,{value:h,children:m}),e[16]=h,e[17]=m,e[18]=w):w=e[18],w},Vr=t=>{const e=M(10);let s,a,r;e[0]!==t?({i18n:s,locale:a,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r):(s=e[1],a=e[2],r=e[3]);let n;e[4]!==r?(n=o(Zs,{children:o(rr,{...r})}),e[4]=r,e[5]=n):n=e[5];const i=n;if(s===void 0&&a===void 0)return i;let l;return e[6]!==s||e[7]!==a||e[8]!==i?(l=o(Ts,{i18n:s,locale:a,children:i}),e[6]=s,e[7]=a,e[8]=i,e[9]=l):l=e[9],l};function nr(t){return t.location.pathname}export{js as B,Vr as S,Os as T,Hr as a,Xs as b,sa as c,aa as d,oa as e,qs as u};
@@ -1 +0,0 @@
1
- import{useState as c}from"react";import{u as h}from"./use-admin-query-CaOm4JS3.mjs";import{u as S}from"./use-studio-client-DCA50tF2.mjs";import{ADMIN_FUNCTIONS as s}from"./ADMIN_FUNCTIONS-4aGsMs95.mjs";import{d,c as l}from"./internal-hIuTpSbx.mjs";const T={},C=l(s.aiGenerateSql),_=l(s.aiTableFilter),b=l(s.aiChartConfig),Q=n=>{const o=S(),[v,u]=c({}),[m,g]=c({}),p=h(s.aiAvailable,T,{shardKey:n}),[y,q]=c(!1),A=y||p.data?.available===!1,i=e=>{u(r=>({...r,[e]:!0})),g(r=>({...r,[e]:void 0}))},a=(e,r)=>{u(t=>({...t,[e]:!1})),r!==void 0&&g(t=>({...t,[e]:r})),r==="no-ai-binding"&&q(!0)},f=async e=>{i("sql");try{const{result:r}=await o.query(C,e,d(n));return a("sql",r.degraded?r.reason:void 0),r.degraded?void 0:r.sql}catch{a("sql","ai-error");return}};return{generate:async(e,r)=>f({failedError:r?.error,failedSql:r?.sql,prompt:e}),inferChart:async e=>{i("chart");try{const{result:r}=await o.query(b,e,d(n));return a("chart",r.degraded?r.reason:void 0),r.degraded?void 0:r.chart}catch{a("chart","ai-error");return}},pending:e=>v[e]===!0,reason:e=>m[e],rewrite:async(e,r)=>f({editSql:r,prompt:e}),suggestFilter:async(e,r)=>{i("filter");try{const{result:t}=await o.query(_,{prompt:e,table:r},d(n));return a("filter",t.degraded?t.reason:void 0),t.degraded?void 0:t.clauses}catch{a("filter","ai-error");return}},unavailable:A}};export{Q as u};
@@ -1 +0,0 @@
1
- import{a as L}from"./chunk-FCAXVYAX.js";import"./chunk-WM72PRE3.js";import{a as H}from"./chunk-473JK2PQ.js";import{a as C}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import"./chunk-4C4THJUD.js";import{b as $}from"./chunk-4DAKKAK7.js";import{m as T}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as z}from"./chunk-XMSNLMWU.js";import{a as E,b as O,c as F,d as k,e as r,f as n}from"./chunk-HHRYM6UW.js";import{a as I,e as j}from"./chunk-JSDKOE4U.js";import{C as R,l as S,y as B}from"./chunk-BFE2DRP6.js";import{a as f,d as y,e as D,f as G,g as J}from"./chunk-OXFKZ4BM.js";var P=y(G(),1),Q=y(D(),1);var s=y(J(),1);var w=200,se=f(()=>{let e=(0,P.c)(28),d=T(),a=S(),[l,q]=(0,Q.useState)(0),p;e[0]!==l?(p=["lunora-auth-sessions",w,l],e[0]=l,e[1]=p):p=e[1];let x;e[2]!==d||e[3]!==l?(x=f(()=>d.listAuthSessions({limit:w,offset:l}),"p"),e[2]=d,e[3]=l,e[4]=x):x=e[4];let o=$(p,x),{error:g}=o,t=o.data?.rows??null,N;e[5]!==o?(N=f(()=>o.poll(),"b"),e[5]=o,e[6]=N):N=e[6],H(N,!0);let v;e[7]!==d||e[8]!==o?(v=f(i=>{B((async()=>{await d.revokeAuthSession({sessionId:i}),o.refetch()})())},"g"),e[7]=d,e[8]=o,e[9]=v):v=e[9];let b=v,m;e[10]!==g?(m=g!==null&&(0,s.jsx)("p",{className:"text-sm text-destructive","data-testid":"auth-sessions-error",role:"alert",children:g}),e[10]=g,e[11]=m):m=e[11];let c;e[12]!==t||e[13]!==a?(c=t!==null&&t.length===0&&(0,s.jsx)(z,{testId:"auth-sessions-empty",title:a("No active sessions.")}),e[12]=t,e[13]=a,e[14]=c):c=e[14];let h;e[15]!==b||e[16]!==t||e[17]!==a?(h=t!==null&&t.length>0&&(0,s.jsx)(I,{className:"overflow-hidden py-0",children:(0,s.jsx)(j,{className:"px-0",children:(0,s.jsxs)(E,{"data-testid":"auth-sessions-table",children:[(0,s.jsx)(O,{children:(0,s.jsxs)(k,{children:[(0,s.jsx)(r,{children:a("user")}),(0,s.jsx)(r,{children:a("expires")}),(0,s.jsx)(r,{children:a("ip")}),(0,s.jsx)(r,{children:a("user agent")}),(0,s.jsx)(r,{children:a("impersonated by")}),(0,s.jsx)(r,{"aria-label":a("Actions")})]})}),(0,s.jsx)(F,{children:t.map(i=>(0,s.jsxs)(k,{"data-testid":`auth-session-${i.id}`,children:[(0,s.jsx)(n,{className:"font-mono text-xs",children:i.userId}),(0,s.jsx)(n,{className:"text-muted-foreground tabular-nums",children:R(i.expiresAt)}),(0,s.jsx)(n,{children:i.ipAddress??""}),(0,s.jsx)(n,{className:"max-w-40 truncate",children:i.userAgent??""}),(0,s.jsx)(n,{className:"font-mono text-xs",children:i.impersonatedBy??""}),(0,s.jsx)(n,{children:(0,s.jsx)(C,{"data-testid":`auth-session-revoke-${i.id}`,onClick:f(()=>{b(i.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:a("Revoke")})})]},i.id))})]})})}),e[15]=b,e[16]=t,e[17]=a,e[18]=h):h=e[18];let u;e[19]!==l||e[20]!==t||e[21]!==o.data?.total?(u=t!==null&&(0,s.jsx)(L,{count:t.length,offset:l,onOffsetChange:q,pageSize:w,prefix:"auth-sessions",total:o.data?.total}),e[19]=l,e[20]=t,e[21]=o.data?.total,e[22]=u):u=e[22];let A;return e[23]!==m||e[24]!==c||e[25]!==h||e[26]!==u?(A=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-sessions",children:[m,c,h,u]}),e[23]=m,e[24]=c,e[25]=h,e[26]=u,e[27]=A):A=e[27],A},"ee");export{se as default};
@@ -1 +0,0 @@
1
- import{b as g}from"./chunk-BPEB4KFE.js";import"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as f}from"./chunk-6UTZXEW3.js";import{c as m}from"./chunk-4DAKKAK7.js";import"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import"./chunk-HHRYM6UW.js";import"./chunk-JSDKOE4U.js";import{l as p}from"./chunk-BFE2DRP6.js";import{a as r,d as h,f as S,g as A}from"./chunk-OXFKZ4BM.js";var R=h(S(),1);var k=h(A(),1);var _=r((e,s)=>({"admin-token-weak":e("Weak admin token"),"auth-secret-weak":e("Weak auth secret"),"cookies-insecure":e("Session cookies are not Secure"),"cors-wildcard-credentials":e("Wildcard CORS with credentials"),"csrf-disabled":e("CSRF/origin guard is off"),"dev-args-unredacted":e("Request log keeps un-redacted args"),"security-headers-disabled":e("Security headers are off"),"ws-gate-open":e("User subscriptions are ungated")})[s.kind],"k"),w=r(e=>Array.isArray(e.findings)?e.findings:[],"g"),b=r(e=>({"admin-token-weak":"LUNORA_ADMIN_TOKEN","auth-secret-weak":"AUTH_SECRET","cookies-insecure":"BETTER_AUTH_URL","cors-wildcard-credentials":"LUNORA_ALLOWED_ORIGINS","csrf-disabled":"LUNORA_SECURITY_CSRF","dev-args-unredacted":"request log","security-headers-disabled":"LUNORA_SECURITY_HEADERS","ws-gate-open":"LUNORA_WS_BEARER"})[e.kind],"S"),E=r((e,s)=>({"admin-token-weak":e("Your admin token is {length} characters \u2014 use at least {min} for a brute-force-resistant secret.",{length:s.detail?.length,min:s.detail?.min}),"auth-secret-weak":e("Your auth secret is {length} characters \u2014 use at least {min} (e.g. `openssl rand -hex 32`) to sign sessions safely.",{length:s.detail?.length,min:s.detail?.min}),"cookies-insecure":e("BETTER_AUTH_URL is a plaintext http:// origin, so session cookies cannot be Secure and ride in cleartext. Serve auth over https:// in production."),"cors-wildcard-credentials":e("LUNORA_ALLOWED_ORIGINS includes a wildcard while credentials are allowed \u2014 browsers reject this and it defeats the allowlist. Name explicit origins instead of *."),"csrf-disabled":e("LUNORA_SECURITY_CSRF is off, so cross-origin state-changing cookie requests are not blocked. Re-enable it in production to keep mutations un-forgeable."),"dev-args-unredacted":e("This worker reports a development environment, so the request log stores raw args and identity. Confirm it isn't a mislabeled production deploy."),"security-headers-disabled":e("LUNORA_SECURITY_HEADERS is off, so HSTS, CSP, nosniff, and frame-options are not applied. Re-enable the baseline headers in production."),"ws-gate-open":e("LUNORA_WS_BEARER is unset, so the WebSocket upgrade gate is open: anyone who can reach the worker can open a socket and run ordinary user subscriptions. Admin subscriptions are unaffected \u2014 they need the admin token. Set it if subscribers should present a shared credential.")})[s.kind],"A"),O=r(()=>{let e=(0,R.c)(8),s=p(),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let{data:a,error:d,errorSource:c}=m(f.getSecurityAudit,i),n;if(e[1]!==a||e[2]!==s){let u=a===void 0?null:w(a);n=u===null?null:u.map(t=>({description:E(s,t),entity:b(t),issueType:_(s,t),key:t.kind,level:t.level})),e[1]=a,e[2]=s,e[3]=n}else n=e[3];let l=n,o;return e[4]!==d||e[5]!==c||e[6]!==l?(o=(0,k.jsx)(g,{error:d,errorSource:c,rows:l,testId:"lunora-security-advisor"}),e[4]=d,e[5]=c,e[6]=l,e[7]=o):o=e[7],o},"T");export{O as default};
@@ -1 +0,0 @@
1
- import{j as o}from"./chunk-4C4THJUD.js";import{a as r,d as i,e as p}from"./chunk-OXFKZ4BM.js";var a=i(p(),1);var R=a.forwardRef(r(function(e,n){let{className:l,render:m,orientation:t="horizontal",style:f,...s}=e;return o("div",e,{state:{orientation:t},ref:n,props:[{role:"separator","aria-orientation":t},s]})},"SeparatorComponent"));export{R as a};
@@ -1 +0,0 @@
1
- import{d as E,e as _}from"./chunk-VEWQWS3J.js";import{a as $}from"./chunk-Y74LIFSL.js";import{a as de}from"./chunk-XSHYZPGF.js";import"./chunk-O2NMPIV2.js";import{a as ce}from"./chunk-MWJC3S62.js";import"./chunk-IH2CJZF2.js";import"./chunk-SYGCASPT.js";import"./chunk-ZGSL4DPP.js";import{a as le}from"./chunk-5DNGK3NT.js";import{a as re}from"./chunk-XST3UEHU.js";import"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import"./chunk-LUHXNZI4.js";import"./chunk-ZTOREMGH.js";import"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import"./chunk-ZBON5T5A.js";import{b as K}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as ie}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as J}from"./chunk-6UTZXEW3.js";import{c as H}from"./chunk-4DAKKAK7.js";import"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as ne}from"./chunk-XMSNLMWU.js";import{a as R,b as W,c as Z,d as A,e as M,f as S}from"./chunk-HHRYM6UW.js";import{a as q,b as D,c as U,e as oe}from"./chunk-JSDKOE4U.js";import{C as ae,l as F}from"./chunk-BFE2DRP6.js";import{a as p,d as se,f as be,g as ge}from"./chunk-OXFKZ4BM.js";var O=se(be(),1);var o=se(ge(),1);var G="gen_ai.usage.input_tokens",Q="gen_ai.usage.output_tokens",V="gen_ai.usage.cost",fe="gen_ai.request.model",Te="lunora.usage.cost.source",xe=new Set(["ai.embed","ai.generate","ai.stream"]),ue=6e4,Ce=1440,ve="unknown",X=p(()=>({calls:0,estimatedCost:0,inputTokens:0,outputTokens:0,providerCost:0}),"q"),Y=p((n,e)=>{let s=n?.[e];return typeof s=="string"&&s!==""?s:void 0},"J"),z=p((n,e)=>{let s=n?.[e];return typeof s=="number"&&Number.isFinite(s)?s:void 0},"L"),ee=p(n=>Y(n,Te)==="provider"?"provider":"estimated","Q"),me=p((n,e)=>n.reduce((s,a)=>s+e(a),0),"Y"),B=p(n=>n.providerCost+n.estimatedCost,"F"),ke=p(n=>n.estimatedCost>0?n.providerCost>0?"mixed":"estimated":n.providerCost>0?"provider":"none","ae"),ye=p((n,e)=>({calls:n.calls+e.calls,estimatedCost:n.estimatedCost+e.estimatedCost,inputTokens:n.inputTokens+e.inputTokens,outputTokens:n.outputTokens+e.outputTokens,providerCost:n.providerCost+e.providerCost}),"ce"),Ie=p(n=>{let e=X(),s=0,a=0,t=0;for(let c of n){let l=me(c.points,i=>i.sum),r=me(c.points,i=>i.count);c.name===G?(e.inputTokens+=l,s+=r):c.name===Q?(e.outputTokens+=l,a+=r):(t+=r,ee(c.attributes)==="provider"?e.providerCost+=l:e.estimatedCost+=l)}return e.calls=Math.max(s,a,t),e},"ge"),Ne=p((n,e)=>B(e)-B(n)||e.inputTokens+e.outputTokens-(n.inputTokens+n.outputTokens)||n.key.localeCompare(e.key),"Ne"),pe=p((n,e)=>{let s=new Map;for(let a of n){let t=e(a);s.set(t,{key:t,...ye(s.get(t)??X(),a)})}return[...s.values()].toSorted(Ne)},"Z"),we=p(n=>(n?.series??[]).filter(e=>e.name===G||e.name===Q||e.name===V),"xe"),Me=p(n=>Y(n.attributes,fe)??ve,"Se"),Se=p(n=>{let e=new Map;for(let s of n){let a=Me(s),t=JSON.stringify([s.functionPath,a]),c=e.get(t)??{functionPath:s.functionPath,model:a,series:[]};c.series.push(s),e.set(t,c)}return[...e.values()].map(({functionPath:s,model:a,series:t})=>({functionPath:s,model:a,...Ie(t)}))},"Ie"),_e=p(n=>{let e=new Map;for(let r of n){if(r.name!==V)continue;let i=ee(r.attributes)==="provider";for(let u of r.points){let m=e.get(u.bucketMs)??{bucketMs:u.bucketMs,estimatedCost:0,providerCost:0};i?m.providerCost+=u.sum:m.estimatedCost+=u.sum,e.set(u.bucketMs,m)}}let s=[...e.keys()].toSorted((r,i)=>r-i),a=s[0],t=s.at(-1);if(a===void 0||t===void 0)return[];let c=Math.max(a,t-(Ce-1)*ue),l=[];for(let r=c;r<=t;r+=ue)l.push(e.get(r)??{bucketMs:r,estimatedCost:0,providerCost:0});return l},"_e"),Pe=p(n=>{let e=[];for(let s of n)for(let a of s.spans){if(!xe.has(a.name))continue;let{attributes:t}=a,c=z(t,V),l=z(t,G),r=z(t,Q);e.push({...c===void 0?{}:{cost:c,costSource:ee(t)},functionPath:s.functionPath,...l===void 0?{}:{inputTokens:l},model:Y(t,fe)??ve,ok:a.ok,...r===void 0?{}:{outputTokens:r},startTs:s.startTs+a.offsetMs,streaming:a.name==="ai.stream",traceId:s.traceId})}return e.toSorted((s,a)=>a.startTs-s.startTs)},"Me"),Fe=p(n=>n.map(e=>{let s=e.cost??0;return{calls:1,estimatedCost:e.costSource==="provider"?0:s,functionPath:e.functionPath,inputTokens:e.inputTokens??0,model:e.model,outputTokens:e.outputTokens??0,providerCost:e.costSource==="provider"?s:0}}),"Oe"),Oe=p((n,e)=>{let s=we(n),a=Pe(e),t=s.length>0,c=t?Se(s):Fe(a),l=X(),r="none";for(let i of c)l=ye(l,i);return t?r="history":a.length>0&&(r="live"),{byFunction:pe(c,i=>i.functionPath),byModel:pe(c,i=>i.model),calls:a,source:r,totals:l,trend:t?_e(s):[]}},"Ae"),Ke=p(n=>Array.isArray(n?.traces)?n.traces:[],"Ee"),Ae=25,te=p(n=>{let e=(0,O.c)(16),{provenance:s,value:a}=n,t=F();if(s==="none"){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=(0,o.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=m):m=e[0],m}let c;e[1]!==s||e[2]!==a?(c=s==="provider"?E(a):`~${E(a)}`,e[1]=s,e[2]=a,e[3]=c):c=e[3];let l;e[4]!==c?(l=(0,o.jsx)("span",{className:"tabular-nums",children:c}),e[4]=c,e[5]=l):l=e[5];let r;e[6]!==s||e[7]!==t?(r=s==="estimated"?(0,o.jsx)(K,{title:t("Derived from a price table, not reported by the provider."),variant:"warning",children:t("Estimated")}):null,e[6]=s,e[7]=t,e[8]=r):r=e[8];let i;e[9]!==s||e[10]!==t?(i=s==="mixed"?(0,o.jsx)(K,{title:t("Includes cost derived from a price table, not reported by the provider."),variant:"warning",children:t("Partly estimated")}):null,e[9]=s,e[10]=t,e[11]=i):i=e[11];let u;return e[12]!==l||e[13]!==r||e[14]!==i?(u=(0,o.jsxs)("span",{className:"inline-flex items-center gap-2",children:[l,r,i]}),e[12]=l,e[13]=r,e[14]=i,e[15]=u):u=e[15],u},"V"),he=p(n=>{let e=(0,O.c)(40),{keyLabel:s,rows:a,testId:t,title:c}=n,l=F(),r;e[0]!==c?(r=(0,o.jsx)(D,{className:"px-4 py-3",children:(0,o.jsx)(U,{children:c})}),e[0]=c,e[1]=r):r=e[1];let i;e[2]!==s?(i=(0,o.jsx)(M,{children:s}),e[2]=s,e[3]=i):i=e[3];let u;e[4]!==l?(u=l("Calls"),e[4]=l,e[5]=u):u=e[5];let m;e[6]!==u?(m=(0,o.jsx)(M,{className:"text-end",children:u}),e[6]=u,e[7]=m):m=e[7];let k;e[8]!==l?(k=l("Input tokens"),e[8]=l,e[9]=k):k=e[9];let y;e[10]!==k?(y=(0,o.jsx)(M,{className:"text-end",children:k}),e[10]=k,e[11]=y):y=e[11];let b;e[12]!==l?(b=l("Output tokens"),e[12]=l,e[13]=b):b=e[13];let T;e[14]!==b?(T=(0,o.jsx)(M,{className:"text-end",children:b}),e[14]=b,e[15]=T):T=e[15];let g;e[16]!==l?(g=l("Cost"),e[16]=l,e[17]=g):g=e[17];let d;e[18]!==g?(d=(0,o.jsx)(M,{className:"text-end",children:g}),e[18]=g,e[19]=d):d=e[19];let x;e[20]!==d||e[21]!==i||e[22]!==m||e[23]!==y||e[24]!==T?(x=(0,o.jsx)(W,{children:(0,o.jsxs)(A,{children:[i,m,y,T,d]})}),e[20]=d,e[21]=i,e[22]=m,e[23]=y,e[24]=T,e[25]=x):x=e[25];let h;if(e[26]!==a||e[27]!==t){let N;e[29]!==t?(N=p(w=>(0,o.jsxs)(A,{"data-testid":`${t}-row`,children:[(0,o.jsx)(S,{className:"max-w-[280px] truncate font-mono",title:w.key,children:w.key}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.calls)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.inputTokens)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.outputTokens)}),(0,o.jsx)(S,{className:"text-end",children:(0,o.jsx)(te,{provenance:ke(w),value:B(w)})})]},w.key),"x"),e[29]=t,e[30]=N):N=e[30],h=a.map(N),e[26]=a,e[27]=t,e[28]=h}else h=e[28];let f;e[31]!==h?(f=(0,o.jsx)(Z,{children:h}),e[31]=h,e[32]=f):f=e[32];let v;e[33]!==x||e[34]!==f?(v=(0,o.jsxs)(R,{children:[x,f]}),e[33]=x,e[34]=f,e[35]=v):v=e[35];let C;return e[36]!==r||e[37]!==v||e[38]!==t?(C=(0,o.jsxs)(q,{className:"gap-0 py-0","data-testid":t,children:[r,v]}),e[36]=r,e[37]=v,e[38]=t,e[39]=C):C=e[39],C},"ee"),$e=p(n=>{let e=(0,O.c)(55),{calls:s,onOpenTrace:a}=n,t=F(),c;e[0]!==t?(c=t("Recent calls"),e[0]=t,e[1]=c):c=e[1];let l;e[2]!==c?(l=(0,o.jsx)(D,{className:"px-4 py-3",children:(0,o.jsx)(U,{children:c})}),e[2]=c,e[3]=l):l=e[3];let r;e[4]!==t?(r=t("When"),e[4]=t,e[5]=r):r=e[5];let i;e[6]!==r?(i=(0,o.jsx)(M,{children:r}),e[6]=r,e[7]=i):i=e[7];let u;e[8]!==t?(u=t("Function"),e[8]=t,e[9]=u):u=e[9];let m;e[10]!==u?(m=(0,o.jsx)(M,{children:u}),e[10]=u,e[11]=m):m=e[11];let k;e[12]!==t?(k=t("Model"),e[12]=t,e[13]=k):k=e[13];let y;e[14]!==k?(y=(0,o.jsx)(M,{children:k}),e[14]=k,e[15]=y):y=e[15];let b;e[16]!==t?(b=t("Input tokens"),e[16]=t,e[17]=b):b=e[17];let T;e[18]!==b?(T=(0,o.jsx)(M,{className:"text-end",children:b}),e[18]=b,e[19]=T):T=e[19];let g;e[20]!==t?(g=t("Output tokens"),e[20]=t,e[21]=g):g=e[21];let d;e[22]!==g?(d=(0,o.jsx)(M,{className:"text-end",children:g}),e[22]=g,e[23]=d):d=e[23];let x;e[24]!==t?(x=t("Cost"),e[24]=t,e[25]=x):x=e[25];let h;e[26]!==x?(h=(0,o.jsx)(M,{className:"text-end",children:x}),e[26]=x,e[27]=h):h=e[27];let f;e[28]!==t?(f=t("Trace"),e[28]=t,e[29]=f):f=e[29];let v;e[30]!==f?(v=(0,o.jsx)(M,{children:f}),e[30]=f,e[31]=v):v=e[31];let C;e[32]!==T||e[33]!==d||e[34]!==h||e[35]!==v||e[36]!==i||e[37]!==m||e[38]!==y?(C=(0,o.jsx)(W,{children:(0,o.jsxs)(A,{children:[i,m,y,T,d,h,v]})}),e[32]=T,e[33]=d,e[34]=h,e[35]=v,e[36]=i,e[37]=m,e[38]=y,e[39]=C):C=e[39];let N;if(e[40]!==s||e[41]!==a||e[42]!==t){let j;e[44]!==a||e[45]!==t?(j=p(I=>(0,o.jsxs)(A,{"data-testid":"ai-call",children:[(0,o.jsx)(S,{className:"font-mono text-muted-foreground",children:ae(I.startTs)}),(0,o.jsx)(S,{className:"font-mono",children:(0,o.jsxs)("span",{className:"inline-flex items-center gap-2",children:[I.functionPath,I.streaming?(0,o.jsx)(K,{variant:"outline",children:t("stream")}):null,I.ok?null:(0,o.jsx)(K,{variant:"destructive",children:t("failed")})]})}),(0,o.jsx)(S,{className:"max-w-[240px] truncate font-mono",title:I.model,children:I.model}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:I.inputTokens===void 0?"\u2014":_(I.inputTokens)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:I.outputTokens===void 0?"\u2014":_(I.outputTokens)}),(0,o.jsx)(S,{className:"text-end",children:(0,o.jsx)(te,{provenance:I.cost===void 0?"none":I.costSource??"estimated",value:I.cost??0})}),(0,o.jsx)(S,{children:(0,o.jsx)("button",{className:"font-mono text-muted-foreground underline-offset-2 hover:underline",onClick:p(()=>{a(I.traceId)},"onClick"),title:t("Open the trace {trace}",{trace:I.traceId}),type:"button",children:I.traceId.slice(0,8)})})]},`${I.traceId}:${I.startTs.toString()}:${I.model}`),"U"),e[44]=a,e[45]=t,e[46]=j):j=e[46],N=s.slice(0,Ae).map(j),e[40]=s,e[41]=a,e[42]=t,e[43]=N}else N=e[43];let w;e[47]!==N?(w=(0,o.jsx)(Z,{children:N}),e[47]=N,e[48]=w):w=e[48];let P;e[49]!==C||e[50]!==w?(P=(0,o.jsxs)(R,{children:[C,w]}),e[49]=C,e[50]=w,e[51]=P):P=e[51];let L;return e[52]!==l||e[53]!==P?(L=(0,o.jsxs)(q,{className:"gap-0 py-0","data-testid":"ai-calls",children:[l,P]}),e[52]=l,e[53]=P,e[54]=L):L=e[54],L},"Pe"),Ee=p(n=>{let e=(0,O.c)(48),{totals:s,trend:a}=n,t=F(),c;e[0]!==s?(c=ke(s),e[0]=s,e[1]=c):c=e[1];let l=c,r;e[2]!==t||e[3]!==a?(r=a.length>=2?(0,o.jsx)(de,{ariaLabel:t("Cost per minute"),className:"h-7 w-24",series:a,testId:"ai-trend"}):void 0,e[2]=t,e[3]=a,e[4]=r):r=e[4];let i;e[5]!==l||e[6]!==t||e[7]!==s.estimatedCost||e[8]!==s.providerCost?(i=l==="none"?t("No cost reported"):(0,o.jsx)("span",{"data-testid":"ai-cost-split",children:t("{provider} provider-reported \xB7 {estimated} estimated",{estimated:E(s.estimatedCost),provider:E(s.providerCost)})}),e[5]=l,e[6]=t,e[7]=s.estimatedCost,e[8]=s.providerCost,e[9]=i):i=e[9];let u;e[10]!==t?(u=t("Total cost"),e[10]=t,e[11]=u):u=e[11];let m;e[12]!==s?(m=B(s),e[12]=s,e[13]=m):m=e[13];let k;e[14]!==l||e[15]!==m?(k=(0,o.jsx)(te,{provenance:l,value:m}),e[14]=l,e[15]=m,e[16]=k):k=e[16];let y;e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==k?(y=(0,o.jsx)($,{chart:r,footer:i,label:u,testId:"ai-total-cost",value:k}),e[17]=r,e[18]=i,e[19]=u,e[20]=k,e[21]=y):y=e[21];let b;e[22]!==t?(b=t("Input tokens"),e[22]=t,e[23]=b):b=e[23];let T;e[24]!==s.inputTokens?(T=_(s.inputTokens),e[24]=s.inputTokens,e[25]=T):T=e[25];let g;e[26]!==b||e[27]!==T?(g=(0,o.jsx)($,{label:b,testId:"ai-input-tokens",value:T}),e[26]=b,e[27]=T,e[28]=g):g=e[28];let d;e[29]!==t?(d=t("Output tokens"),e[29]=t,e[30]=d):d=e[30];let x;e[31]!==s.outputTokens?(x=_(s.outputTokens),e[31]=s.outputTokens,e[32]=x):x=e[32];let h;e[33]!==d||e[34]!==x?(h=(0,o.jsx)($,{label:d,testId:"ai-output-tokens",value:x}),e[33]=d,e[34]=x,e[35]=h):h=e[35];let f;e[36]!==t?(f=t("Calls"),e[36]=t,e[37]=f):f=e[37];let v;e[38]!==s.calls?(v=_(s.calls),e[38]=s.calls,e[39]=v):v=e[39];let C;e[40]!==f||e[41]!==v?(C=(0,o.jsx)($,{label:f,testId:"ai-calls-total",value:v}),e[40]=f,e[41]=v,e[42]=C):C=e[42];let N;return e[43]!==g||e[44]!==h||e[45]!==C||e[46]!==y?(N=(0,o.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"ai-totals",children:[y,g,h,C]}),e[43]=g,e[44]=h,e[45]=C,e[46]=y,e[47]=N):N=e[47],N},"Ue"),Ye=p(n=>{let e=(0,O.c)(28),{initialShardKey:s}=n,a=F(),{queryShardKey:t,setShardKey:c,shardKey:l}=le(s),r=ce(t),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let u;e[1]!==t?(u={live:!0,shardKey:t},e[1]=t,e[2]=u):u=e[2];let{data:m,error:k}=H(J.getTraces,i,u),y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y={},e[3]=y):y=e[3];let b;e[4]!==t?(b={live:!0,shardKey:t},e[4]=t,e[5]=b):b=e[5];let{data:T}=H(J.getMetricHistory,y,b),g,d;e[6]!==m||e[7]!==T?(d=Oe(T,Ke(m)),g=d.trend.map(Le),e[6]=m,e[7]=T,e[8]=g,e[9]=d):(g=e[8],d=e[9]);let x=g,h;e[10]!==c||e[11]!==l?(h=(0,o.jsx)(re,{onChange:c,testId:"ai-shard-input",value:l}),e[10]=c,e[11]=l,e[12]=h):h=e[12];let f;e[13]!==k?(f=k===null?null:(0,o.jsx)(ie,{error:k,testId:"ai-error"}),e[13]=k,e[14]=f):f=e[14];let v;e[15]!==r||e[16]!==a||e[17]!==x||e[18]!==d.byFunction||e[19]!==d.byModel||e[20]!==d.calls||e[21]!==d.source||e[22]!==d.totals?(v=d.source==="none"?(0,o.jsx)(ne,{description:a("Spend shows up here once an action calls ctx.ai.model(...) \u2014 tokens and cost per function and per model."),testId:"ai-empty",title:a("No AI usage recorded")}):(0,o.jsxs)(o.Fragment,{children:[d.source==="live"?(0,o.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ai-live-only",children:a("No durable history yet \u2014 these totals come from the live trace ring and reset when the shard hibernates.")}):(0,o.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ai-window",children:a("Totals cover the retained metric history (up to the last 24 hours).")}),(0,o.jsx)(Ee,{totals:d.totals,trend:x}),(0,o.jsxs)("div",{className:"grid gap-3 xl:grid-cols-2",children:[(0,o.jsx)(he,{keyLabel:a("Function"),rows:d.byFunction,testId:"ai-by-function",title:a("By function")}),(0,o.jsx)(he,{keyLabel:a("Model"),rows:d.byModel,testId:"ai-by-model",title:a("By model")})]}),d.calls.length===0?(0,o.jsx)(q,{children:(0,o.jsx)(oe,{className:"p-4 text-xs text-muted-foreground","data-testid":"ai-no-calls",children:a("No recent calls in the live trace ring \u2014 it empties when the shard hibernates.")})}):(0,o.jsx)($e,{calls:d.calls,onOpenTrace:r})]}),e[15]=r,e[16]=a,e[17]=x,e[18]=d.byFunction,e[19]=d.byModel,e[20]=d.calls,e[21]=d.source,e[22]=d.totals,e[23]=v):v=e[23];let C;return e[24]!==h||e[25]!==f||e[26]!==v?(C=(0,o.jsxs)("section",{className:"flex flex-col gap-4","data-testid":"ai-panel",children:[h,f,v]}),e[24]=h,e[25]=f,e[26]=v,e[27]=C):C=e[27],C},"Ze");function Le(n){return n.providerCost+n.estimatedCost}p(Le,"Ke");export{Ye as default};
@@ -1 +0,0 @@
1
- import{m as A}from"./chunk-BVX45MU5.js";import{r as v}from"./chunk-BFE2DRP6.js";import{a as o,d as R,e as _,f as F}from"./chunk-OXFKZ4BM.js";var M=R(F(),1),i=R(_(),1);var U=6e4,b=o(e=>(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function","g"),g=5e3,x=o((e,r,s)=>{let t=(0,M.c)(9),n=s===void 0?g:s,h=A(),d=(0,i.useRef)(e),c;t[0]!==e?(c=o(()=>{d.current=e},"c"),t[0]=e,t[1]=c):c=t[1],(0,i.useEffect)(c);let u;t[2]!==r||t[3]!==n?(u=o(()=>{if(!r)return;let l=n,p=!1,T,m=o(()=>{p||(T=setTimeout(P,l))},"f"),y=o(()=>{l=n,m()},"p"),E=o(a=>{v(a)||(l=Math.max(n,Math.min(l*2,U)),m())},"_"),P=o(()=>{if(globalThis.document?.hidden===!0){m();return}let a;try{a=d.current()}catch(S){E(S);return}b(a)?Promise.resolve(a).then(y).catch(E):y()},"A");return m(),()=>{p=!0,clearTimeout(T)}},"i"),t[2]=r,t[3]=n,t[4]=u):u=t[4];let f;t[5]!==h||t[6]!==r||t[7]!==n?(f=[h,r,n],t[5]=h,t[6]=r,t[7]=n,t[8]=f):f=t[8],(0,i.useEffect)(u,f)},"U"),D=o(async e=>{let r=(await Promise.allSettled(e)).find(s=>s.status==="rejected");if(r!==void 0)throw r.reason},"v");export{x as a,D as b};
@@ -1 +0,0 @@
1
- import{a as r,d as p,e as m}from"./chunk-OXFKZ4BM.js";function d(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}r(d,"mergeObjects");var y={};function h(e,t,n,o,i){if(!n&&!o&&!i&&!e)return R(t);let c=R(e);return t&&(c=E(c,t)),n&&(c=E(c,n)),o&&(c=E(c,o)),i&&(c=E(c,i)),c}r(h,"mergeProps");function x(e){if(e.length===0)return y;if(e.length===1)return R(e[0]);let t=R(e[0]);for(let n=1;n<e.length;n+=1)t=E(t,e[n]);return t}r(x,"mergePropsN");function R(e){return b(e)?{...T(e,y)}:J(e)}r(R,"createInitialMergedProps");function E(e,t){return b(t)?T(t,e):q(e,t)}r(E,"mergeInto");function J(e){let t={...e};for(let n in t){let o=t[n];O(n,o)&&(t[n]=k(o))}return t}r(J,"copyInitialProps");function q(e,t){if(!t)return e;for(let n in t){let o=t[n];switch(n){case"style":{e[n]=d(e.style,o);break}case"className":{e[n]=g(e.className,o);break}default:O(n,o)?e[n]=K(e[n],o):e[n]=o}}return e}r(q,"mutablyMergeInto");function O(e,t){let n=e.charCodeAt(0),o=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&o===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}r(O,"isEventHandler");function b(e){return typeof e=="function"}r(b,"isPropsGetter");function T(e,t){return b(e)?e(t):e??y}r(T,"resolvePropsGetter");function K(e,t){return t?e?(...n)=>{let o=n[0];if(_(o)){let c=o;M(c);let s=t(...n);return c.baseUIHandlerPrevented||e?.(...n),s}let i=t(...n);return e?.(...n),i}:k(t):e}r(K,"mergeEventHandlers");function k(e){return e&&((...t)=>{let n=t[0];return _(n)&&M(n),e(...t)})}r(k,"wrapEventHandler");function M(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}r(M,"makeEventPreventable");function g(e,t){return t?e?t+" "+e:t:e}r(g,"mergeClassNames");function _(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}r(_,"isSyntheticEvent");function Q(e,t){return r(function(o,...i){let c=new URL(e);return c.searchParams.set("code",o.toString()),i.forEach(s=>c.searchParams.append("args[]",s)),`${t} error #${o}; visit ${c} for the full message.`},"formatErrorMessage")}r(Q,"createFormatErrorMessage");var X=Q("https://base-ui.com/production-error","Base UI"),L=X;var a=p(m(),1);var j=p(m(),1);var V={};function v(e,t){let n=j.useRef(V);return n.current===V&&(n.current=e(t)),n}r(v,"useRefWithInit");function A(e,t,n,o){let i=v(S).current;return ee(i,e,t,n,o)&&$(i,[e,t,n,o]),i.callback}r(A,"useMergedRefs");function U(e){let t=v(S).current;return te(t,e)&&$(t,e),t.callback}r(U,"useMergedRefsN");function S(){return{callback:null,cleanup:null,refs:[]}}r(S,"createForkRef");function ee(e,t,n,o,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==i}r(ee,"didChange");function te(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}r(te,"didChangeN");function $(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){let o=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){let c=t[i];if(c!=null)switch(typeof c){case"function":{let s=c(n);typeof s=="function"&&(o[i]=s);break}case"object":{c.current=n;break}default:}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){let c=t[i];if(c!=null)switch(typeof c){case"function":{let s=o[i];typeof s=="function"?s():c(null);break}case"object":{c.current=null;break}default:}}}}}}r($,"update");var z=p(m(),1);var B=p(m(),1);var ne=parseInt(B.version,10);function Y(e){return ne>=e}r(Y,"isReactVersionAtLeast");function N(e){if(!z.isValidElement(e))return null;let t=e,n=t.props;return(Y(19)?n?.ref:t.ref)??null}r(N,"getReactElementRef");function we(){}r(we,"NOOP");var Ce=Object.freeze([]),l=Object.freeze({});function D(e,t){let n={};for(let o in e){let i=e[o];if(t?.hasOwnProperty(o)){let c=t[o](i);c!=null&&Object.assign(n,c);continue}i===!0?n[`data-${o.toLowerCase()}`]="":i&&(n[`data-${o.toLowerCase()}`]=i.toString())}return n}r(D,"getStateAttributesProps");function F(e,t){return typeof e=="function"?e(t):e}r(F,"resolveClassName");function W(e,t){return typeof e=="function"?e(t):e}r(W,"resolveStyle");var P=p(m(),1);function We(e,t,n={}){let o=t.render;n.enabled!==!1&&(o=ce(o));let i=re(t,n,o);if(n.enabled===!1)return null;let c=n.state??l;return se(e,o,i,c)}r(We,"useRenderElement");function re(e,t,n){let{className:o,style:i}=e,{state:c=l,ref:s,props:I,stateAttributesMapping:Z,enabled:f=!0}=t,w=f?F(o,c):void 0,C=f?W(i,c):void 0,G=f?D(c,Z):l,H=f&&I?oe(I):void 0,u=f?d(G,H)??{}:l;return typeof document<"u"&&(f?Array.isArray(s)?u.ref=U([u.ref,N(n),...s]):u.ref=A(u.ref,N(n),s):A(null,null)),f?(w!==void 0&&(u.className=g(u.className,w)),C!==void 0&&(u.style=d(u.style,C)),u):l}r(re,"useRenderElementProps");function oe(e){return Array.isArray(e)?x(e):h(void 0,e)}r(oe,"resolveRenderFunctionProps");var ie=Symbol.for("react.lazy");function ce(e){if(e?.$$typeof!==ie)return e;let t=a.Children.toArray(e)[0];return a.isValidElement(t)?t:e}r(ce,"unwrapLazyRenderProp");function se(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);let i=h(n,t.props);return i.ref=n.ref,a.cloneElement(t,i)}if(e&&typeof e=="string")return ue(e,n);throw new Error(L(8))}r(se,"evaluateRenderProp");function ue(e,t){return e==="button"?(0,P.createElement)("button",{type:"button",...t,key:t.key}):e==="img"?(0,P.createElement)("img",{alt:"",...t,key:t.key}):a.createElement(e,t)}r(ue,"renderTag");export{h as a,M as b,L as c,v as d,A as e,Y as f,we as g,Ce as h,l as i,We as j};
@@ -1 +0,0 @@
1
- import{g as j,h as v,i as D,m as q}from"./chunk-BVX45MU5.js";import{n as g,o as S,p as P,y as w}from"./chunk-BFE2DRP6.js";import{a as i,d as A,e as L,f as M}from"./chunk-OXFKZ4BM.js";var E=A(M(),1);var p=A(L(),1);var I=300,l=i(t=>typeof t=="string"?t===""?void 0:t:typeof t=="number"||typeof t=="boolean"?String(t):void 0,"c"),u=i(t=>t.filter(r=>r!==void 0).join(" "),"u"),T=i(t=>{let r=Array.isArray(t.filters)?t.filters.length:0,e=typeof t.search=="string"&&t.search!=="";return r===0&&!e?"no predicate":u([r===0?void 0:`${String(r)} filters`,e?"search":void 0])},"q"),N={clearTable:i(t=>u([l(t.table),"whole table"]),"clearTable"),deleteRows:i(t=>u([l(t.table),T(t)]),"deleteRows"),facetColumn:i(t=>u([l(t.table),l(t.column)]),"facetColumn"),importShard:i(t=>{if(!Array.isArray(t.rows))return"";let r=[...new Set(t.rows.filter(e=>typeof e=="object"&&e!==null).map(e=>e.table).filter(e=>typeof e=="string"))].toSorted((e,s)=>e.localeCompare(s));return u([`${String(t.rows.length)} rows`,r.length===0?void 0:`into ${r.join(", ")}`])},"importShard"),lintSql:i(()=>"sql","lintSql"),patchRows:i(t=>u([l(t.table),typeof t.doc=="object"&&t.doc!==null?`set ${Object.keys(t.doc).join(", ")}`:void 0,T(t)]),"patchRows"),pitrRestore:i(t=>u([l(t.time)===void 0?void 0:`to ${String(t.time)}`,typeof t.bookmark=="string"&&t.bookmark!==""?"from bookmark":void 0,t.restart===!0?"restart now":void 0]),"pitrRestore"),readTablePage:i(t=>u([l(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]),"readTablePage"),runMigration:i(t=>u([l(t.id),l(t.direction),t.dryRun===!0?"dry-run":void 0]),"runMigration"),runSql:i(t=>typeof t.sql=="string"?`${String(t.sql.length)} chars`:"","runSql"),schemaVersion:i(t=>typeof t.hash=="string"?t.hash.slice(0,8):"","schemaVersion"),writeRow:i(t=>u([l(t.table),"1 row"]),"writeRow")},$="__lunora_admin__:",F=i((t,r)=>{let e=t.startsWith($)?t.slice($.length):t,s=N[e];if(s!==void 0)return s(r);let n=Object.keys(r);return n.length===0?"":n.join(", ")},"M"),V=i(t=>{if(Array.isArray(t))return t.length;if(!(typeof t!="object"||t===null)){for(let r of Object.values(t))if(Array.isArray(r))return r.length}},"K"),k=class{static{i(this,"x")}entries=[];listeners=new Set;nextSeq=1;getSnapshot=i(()=>this.entries,"getSnapshot");subscribe=i(r=>(this.listeners.add(r),()=>{this.listeners.delete(r)}),"subscribe");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){let 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:V(e.result),status:"ok"}:{error:e.error,status:"error"}}))}clear(){this.entries=[],this.emit()}append(r,e,s,n,a){let c=this.nextSeq;this.nextSeq+=1;let d={functionPath:r,kind:n,seq:c,shardKey:s,startedAt:Date.now(),status:a,summary:F(r,e),...n==="subscription"?{pushes:0}:{}},o=[...this.entries,d];return this.entries=o.length>I?o.slice(o.length-I):o,this.emit(),c}patch(r,e){let s=this.entries.findIndex(n=>n.seq===r);s!==-1&&(this.entries=this.entries.with(s,e(this.entries[s])),this.emit())}emit(){for(let r of this.listeners)r()}},f=new k,O=i((t,r,e)=>["lunora-admin",t,r,e.trim()],"E"),_=i((t,r)=>[...t,r],"j");function W(t,r,e={}){let s=q(),{enabled:n=!0,keepPreviousData:a=!1,staleTime:c=0}=e,d=_(t,s.clientIdentifier()),o=D({enabled:n,queryFn:r,placeholderData:a?j:void 0,queryKey:d,staleTime:c});return{data:o.data,error:o.error?P(o.error):o.error,errorSource:o.error??void 0,isLoading:o.isLoading,liveError:void 0,refetch:i(()=>{w(o.refetch())},"refetch"),poll:i(async()=>{await o.refetch({throwOnError:!0})},"poll")}}i(W,"F");function Y(t,r,e={}){let s=q(),n=v(),{enabled:a=!0,keepPreviousData:c=!1,live:d=!1,shardKey:o="",staleTime:R}=e,m=O(t,r,o),C=W(m,()=>s.query(g(t),r,S(o)),{enabled:a,keepPreviousData:c,staleTime:R??(d?Number.POSITIVE_INFINITY:0)}),[K,b]=(0,p.useState)(void 0),Q=JSON.stringify(m);return(0,p.useEffect)(()=>{if(!a||!d)return;b(void 0);let y=f.startSubscription(t,r,o),x=s.subscribe(g(t),r,h=>{f.recordPush(y),b(void 0),n.setQueryData(_(m,s.clientIdentifier()),h)},{...S(o),onError:i(h=>{f.failSubscription(y,h.message),b(h.message)},"onError")});return()=>{f.endSubscription(y),x()}},[s,Q,a,d]),{...C,liveError:a&&d?K:void 0}}i(Y,"U");var B=i(()=>{let t=(0,E.c)(2),r=v(),e;return t[0]!==r?(e=i((s,n,a)=>{let c=n===void 0?["lunora-admin",s]:O(s,n,a??"");w(r.invalidateQueries({queryKey:c}))},"r"),t[0]=r,t[1]=e):e=t[1],e},"W");export{f as a,W as b,Y as c,B as d};
@@ -1 +0,0 @@
1
- import{a as $}from"./chunk-WS36BO4R.js";import{a as b}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as u}from"./chunk-6UTZXEW3.js";import{c as p}from"./chunk-4DAKKAK7.js";import"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as y,b as w,c as j,d as h,e as c,f as i}from"./chunk-HHRYM6UW.js";import{a as d,e as l}from"./chunk-JSDKOE4U.js";import{h as x,l as k}from"./chunk-BFE2DRP6.js";import{a as o,d as I,g as T}from"./chunk-OXFKZ4BM.js";var e=I(T(),1);var m={clean:"text-emerald-600 dark:text-emerald-400",exempt:"text-muted-foreground",failing:"text-red-600 dark:text-red-400",warned:"text-amber-600 dark:text-amber-400"},A={"at-risk":"text-red-600 dark:text-red-400",excellent:"text-emerald-600 dark:text-emerald-400",good:"text-emerald-600 dark:text-emerald-400","needs-work":"text-amber-600 dark:text-amber-400"},C=o((r,a)=>`exempt: ${r.exemptReason===void 0||r.exemptReason===""?a:r.exemptReason}`,"E"),E=o(r=>r.toSorted((a,n)=>a.coverage==="clean"&&n.coverage!=="clean"?1:n.coverage==="clean"&&a.coverage!=="clean"?-1:a.score-n.score),"S"),Y=o(({testId:r="advisor-health"})=>{let a=k(),n=p(u.getAdvisories,{},{live:!0}),g=p(u.getAdvisorProcedures,{},{live:!0}),f=n.data?.advisories??null,N=g.data?.procedures??null,t=f===null||N===null?null:$(N,f),v=g.error??n.error;if(v!==null)return(0,e.jsx)(b,{error:v,testId:`${r}-error`});if(t===null)return(0,e.jsx)(d,{children:(0,e.jsx)(l,{className:"py-8 text-center text-muted-foreground","data-testid":`${r}-loading`,children:a("Loading\u2026")})});let R=E(t.procedures);return(0,e.jsxs)("div",{className:"space-y-4","data-testid":r,children:[(0,e.jsx)(d,{children:(0,e.jsxs)(l,{className:"flex flex-wrap items-baseline gap-x-6 gap-y-2 py-6",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:x("text-4xl font-semibold tabular-nums",A[t.grade]),"data-testid":`${r}-score`,children:t.score}),(0,e.jsx)("span",{className:"text-muted-foreground text-lg",children:"/100"})]}),(0,e.jsx)("span",{className:x("text-sm font-medium uppercase tracking-wide",A[t.grade]),"data-testid":`${r}-grade`,children:t.grade}),(0,e.jsxs)("div",{className:"text-muted-foreground flex gap-4 text-sm tabular-nums","data-testid":`${r}-summary`,children:[(0,e.jsxs)("span",{className:m.clean,children:[t.summary.clean," ",a("clean")]}),(0,e.jsxs)("span",{className:m.warned,children:[t.summary.warned," ",a("warned")]}),(0,e.jsxs)("span",{className:m.failing,children:[t.summary.failing," ",a("failing")]}),(0,e.jsxs)("span",{className:m.exempt,children:[t.summary.exempt," ",a("exempt")]})]})]})}),t.project.checks.length>0&&(0,e.jsx)(d,{children:(0,e.jsxs)(l,{className:"py-4 text-sm","data-testid":`${r}-project`,children:[(0,e.jsxs)("span",{className:"font-medium",children:[a("Schema & config")," ",t.project.score,"/100"]}),(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \u2014 ",t.project.checks.map(s=>s.name).join(", ")]})]})}),(0,e.jsx)(d,{children:(0,e.jsx)(l,{className:"p-0",children:(0,e.jsxs)(y,{children:[(0,e.jsx)(w,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(c,{className:"w-20",children:a("Score")}),(0,e.jsx)(c,{children:a("Procedure")}),(0,e.jsx)(c,{className:"w-32",children:a("Kind")}),(0,e.jsx)(c,{children:a("Rules fired")})]})}),(0,e.jsx)(j,{children:R.map(s=>(0,e.jsxs)(h,{"data-testid":`${r}-row`,children:[(0,e.jsx)(i,{className:x("tabular-nums font-medium",m[s.coverage]),children:s.coverage==="exempt"?"\u2014":s.score}),(0,e.jsx)(i,{className:"font-mono text-xs",children:s.id}),(0,e.jsxs)(i,{className:"text-muted-foreground text-xs",children:[s.visibility," ",s.kind,s.sensitivity.level==="high"&&(0,e.jsx)("span",{className:"ml-1 text-amber-600 dark:text-amber-400",children:a("sensitive")})]}),(0,e.jsx)(i,{className:"text-muted-foreground text-xs",children:s.coverage==="exempt"?C(s,a("no reason given")):s.checks.map(S=>S.name).join(", ")})]},s.id))})]})})})]})},"Y");export{Y as default};
@@ -1 +0,0 @@
1
- import{a as Z}from"./chunk-IBJVVHV5.js";import{a as c,d as P,e as Q}from"./chunk-OXFKZ4BM.js";function B(r){return typeof r=="object"?r.key:r}c(B,"getMeasurementKey");function H(r,a){let t=r.length;return new Proxy(r,{get(s,e,n){if(typeof e=="string"){let o=e.charCodeAt(0);if(o>=48&&o<=57){let i=+e;if(Number.isInteger(i)&&i>=0&&i<t){let l=s[i];if(typeof l!="object"){let u=a[i*2];l=s[i]={index:i,key:l,start:u,size:a[i*2+1],end:u+a[i*2+1],lane:0}}return l}}if(e==="length")return t}return Reflect.get(s,e,n)}})}c(H,"createLazyMeasurementsView");function z(r,a,t){let s=t.initialDeps??[],e,n=!0;function o(){var i;let u=0,g=r();if(!(g.length!==s.length||g.some((d,S)=>s[S]!==d)))return e;s=g;let f=0;return e=a(...g),t?.onChange&&!(n&&t.skipInitialOnChange)&&t.onChange(e),n=!1,e}return c(o,"memoizedFunction"),o.updateDeps=i=>{s=i},o}c(z,"memo");function W(r,a){if(r===void 0)throw new Error(`Unexpected undefined${a?`: ${a}`:""}`);return r}c(W,"notUndefined");var k=c((r,a)=>Math.abs(r-a)<1.01,"approxEqual"),$=c((r,a,t)=>{let s;return Object.assign(function(...e){r.clearTimeout(s),s=r.setTimeout(()=>a.apply(this,e),t)},{cancel:c(()=>{r.clearTimeout(s)},"cancel")})},"debounce");var j,V=c(()=>{if(j!==void 0)return j;if(typeof navigator>"u")return j=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return j=!0;let r=navigator.maxTouchPoints;return j=navigator.platform==="MacIntel"&&r!==void 0&&r>0},"isIOSWebKit");var J=c(r=>{let{offsetWidth:a,offsetHeight:t}=r;return{width:a,height:t}},"getRect"),tt=c(r=>r,"defaultKeyExtractor"),et=c(r=>{let a=Math.max(r.startIndex-r.overscan,0),s=Math.min(r.endIndex+r.overscan,r.count-1)-a+1,e=new Array(s);for(let n=0;n<s;n++)e[n]=a+n;return e},"defaultRangeExtractor"),q=c((r,a)=>{let t=r.scrollElement;if(!t)return;let s=r.targetWindow;if(!s)return;let e=c(o=>{let{width:i,height:l}=o;a({width:Math.round(i),height:Math.round(l)})},"handler");if(e(J(t)),!s.ResizeObserver)return()=>{};let n=new s.ResizeObserver(o=>{let i=c(()=>{let l=o[0];if(l?.borderBoxSize){let u=l.borderBoxSize[0];if(u){e({width:u.inlineSize,height:u.blockSize});return}}e(J(t))},"run");r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return n.observe(t,{box:"border-box"}),()=>{n.unobserve(t)}},"observeElementRect"),F={passive:!0};var st=typeof window>"u"?!0:"onscrollend"in window,nt=c((r,a,t)=>{let s=r.scrollElement;if(!s)return;let e=r.targetWindow;if(!e)return;let n=r.options.useScrollendEvent&&st,o=0,i=n?null:$(e,()=>a(t(s),!1),r.options.isScrollingResetDelay),l=c(h=>()=>{o=t(s),i?.(),a(o,h)},"createHandler"),u=l(!0),g=l(!1);return s.addEventListener("scroll",u,F),n&&s.addEventListener("scrollend",g,F),()=>{s.removeEventListener("scroll",u),n&&s.removeEventListener("scrollend",g),i?.cancel()}},"observeOffset"),U=c((r,a)=>nt(r,a,t=>{let{horizontal:s,isRtl:e}=r.options;return s?t.scrollLeft*(e&&-1||1):t.scrollTop}),"observeElementOffset");var it=c((r,a,t)=>{if(t.options.useCachedMeasurements){let s=t.indexFromElement(r),e=t.options.getItemKey(s);return t.itemSizeCache.get(e)??t.options.estimateSize(s)}if(a?.borderBoxSize){let s=a.borderBoxSize[0];if(s)return Math.round(s[t.options.horizontal?"inlineSize":"blockSize"])}if(!a){let s=t.indexFromElement(r),e=t.options.getItemKey(s),n=t.itemSizeCache.get(e);if(n!==void 0)return n}return r[t.options.horizontal?"offsetWidth":"offsetHeight"]},"measureElement"),ot=c((r,{adjustments:a=0,behavior:t},s)=>{var e,n;(n=(e=s.scrollElement)==null?void 0:e.scrollTo)==null||n.call(e,{[s.options.horizontal?"left":"top"]:r+a,behavior:t})},"scrollWithAdjustments");var X=ot;function lt(r,a,t,s){if(a===0)return!1;let e=s(0),n=new Set,o=0;for(;o<r;){let l=t(o);if(l===e)break;n.add(l),o++}let i=r-o;if(i===0||i>=a)return!1;for(let l=0;l<i;l++)if(s(l)!==t(o+l))return!1;for(let l=i;l<a;l++)if(n.has(s(l)))return!1;return!0}c(lt,"isAppendWithTrim");var D=class{static{c(this,"Virtualizer")}constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,s,e;return((e=(s=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:s.now)==null?void 0:e.call(s))??Date.now()},this.observer=(()=>{let t=null,s=c(()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(e=>{e.forEach(n=>{let o=c(()=>{let i=n.target,l=this.indexFromElement(i);if(!i.isConnected){this.observer.unobserve(i);for(let[u,g]of this.elementsCache)if(g===i){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(i,n,this))},"run");this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})})),"get");return{disconnect:c(()=>{var e;(e=s())==null||e.disconnect(),t=null},"disconnect"),observe:c(e=>{var n;return(n=s())==null?void 0:n.observe(e,{box:"border-box"})},"observe"),unobserve:c(e=>{var n;return(n=s())==null?void 0:n.unobserve(e)},"unobserve")}})(),this.range=null,this.setOptions=t=>{var s;let e={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:tt,rangeExtractor:et,onChange:c(()=>{},"onChange"),measureElement:it,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let h in t){let f=t[h];f!==void 0&&(e[h]=f)}let n=this.options,o=null,i=null,l=!1;if(n!==void 0&&n.enabled&&e.enabled&&e.anchorTo==="end"&&this.scrollElement!==null){let h=n.count,f=e.count,d=this.getMeasurements(),S=((s=this._singleLaneMeasurements)==null?void 0:s.items)??d,v=c(O=>B(S[O]),"getPreviousKey"),E=h>0?v(0):null,b=h>0?v(h-1):null;if(f!==h||h>0&&f>0&&(e.getItemKey(0)!==E||e.getItemKey(f-1)!==b)){l=!0;let O=h>0?this.getVirtualItemForOffset(this.getScrollOffset())??d[0]:null;O&&(o=[O.key,this.getScrollOffset()-O.start]);let _=e.followOnAppend===!0?"auto":e.followOnAppend||null;_&&f>0&&this.isAtEnd(n.scrollEndThreshold)&&(h===0||e.getItemKey(f-1)!==b)&&(f>h||lt(h,f,v,e.getItemKey))&&(i=_)}}this.options=e,l&&(this.pendingMin=0,this.itemSizeCacheVersion++);let u=!1,g=0;if(o&&this.scrollOffset!==null){let[h,f]=o,d=this.getMeasurements(),{count:S,getItemKey:v}=this.options,E=0;for(;E<S&&v(E)!==h;)E++;if(E<S){let b=d[E];if(b){let m=Math.max(0,b.start+f);!i&&m!==this.scrollOffset&&(g=m-this.scrollOffset,this.scrollOffset=m,u=!0)}}}(u||i)&&(this.pendingScrollAnchor=[u?o[0]:null,u?o[1]:0,i,g])},this.notify=t=>{var s,e;(e=(s=this.options).onChange)==null||e.call(s,this,t)},this.maybeNotify=z(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:c(()=>this.options.debug,"debug"),initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t,s;let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{if(i&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(o-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let l=this.getScrollOffset();this.scrollDirection=i?l===o?this.scrollDirection:l<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){let o=this.scrollElement,i=c(()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},"onTouchStart"),l=c(()=>{this._iosTouching=!1,!(!V()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))},"onTouchEnd");o.addEventListener("touchstart",i,F),o.addEventListener("touchend",l,F),this.unsubs.push(()=>{o.removeEventListener("touchstart",i),o.removeEventListener("touchend",l),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let n=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,n&&this.scrollElement&&this.options.enabled){let[o,i,l,u]=n;o!==null&&!l&&(V()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?u!==0&&(this._iosDeferredAdjustment+=u):((s=this.scrollState)==null?void 0:s.behavior)==="smooth"&&!k(this.getScrollOffset()-u,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),l&&this.scrollToEnd({behavior:l})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:t,maxAtWrite:s}=this._clampedAdjustment,e=this.getMaxScrollOffset();e>s+.5&&(this._clampedAdjustment=t>e+.5?{target:t,maxAtWrite:e}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let t=this.getScrollOffset(),s=this.getMaxScrollOffset();if(t<0||t>s)return;if(this._iosDeferredAdjustment<0&&t>=s-1){this._iosDeferredAdjustment=0;return}let e=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=e,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=z(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,s,e,n,o,i,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMin=null,{count:t,paddingStart:s,scrollMargin:e,getItemKey:n,enabled:o,lanes:i,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t<this.options.count,this.getMeasurements=z(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:s,scrollMargin:e,getItemKey:n,enabled:o,lanes:i,laneAssignmentMode:l,gap:u},g)=>{var h;let f=this.itemSizeCache;if(!o)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(let m of this.laneAssignments.keys())m>=t&&this.laneAssignments.delete(m);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));let d=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),i===1){let m=t*2,p=(h=this._singleLaneMeasurements)==null?void 0:h.flat;if(!p||p.length<m){let x=new Float64Array(m);p&&d>0&&x.set(p.subarray(0,d*2)),p=x}let O=d===0?new Array(t):this._singleLaneMeasurements.items.slice(),_;if(d===0)_=s+e;else{let x=d-1;_=p[x*2]+p[x*2+1]+u}for(let x=d;x<t;x++){let M=n(x);O[x]=M;let T=f.get(M),C=typeof T=="number"?T:this.options.estimateSize(x);p[x*2]=_,p[x*2+1]=C,_+=C+u}this._singleLaneMeasurements={flat:p,items:O};let y=H(O,p);return this.measurementsCache=y,y}let S=this.measurementsCache.slice(0,d),v=new Array(i).fill(void 0),E=new Float64Array(i),b=0;for(let m=0;m<d;m++){let p=S[m];p&&(v[p.lane]===void 0&&b++,v[p.lane]=m,E[p.lane]=p.end)}for(let m=d;m<t;m++){let p=n(m),O=this.laneAssignments.get(m),_,y,x=l==="estimate"||f.has(p);if(O!==void 0&&this.options.lanes>1){_=O;let R=v[_],w=R!==void 0?S[R]:void 0;y=w?w.end+u:s+e}else if(b===i){let R=0,w=E[0],K=v[0];for(let A=1;A<i;A++){let L=E[A];(L<w||L===w&&v[A]<K)&&(R=A,w=L,K=v[A])}_=R,y=w+u,x&&this.laneAssignments.set(m,_)}else _=m%this.options.lanes,y=s+e,x&&this.laneAssignments.set(m,_);let M=f.get(p),T=typeof M=="number"?M:this.options.estimateSize(m),C=y+T;S[m]={index:m,start:y,size:T,end:C,key:p,lane:_},v[_]===void 0&&b++,v[_]=m,E[_]=C}return this.measurementsCache=S,S},{key:!1,debug:c(()=>this.options.debug,"debug")}),this.calculateRange=z(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,s,e,n)=>t.length===0||s===0?(this.range=null,null):(this.range=at(t,s,e,n,n===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:c(()=>this.options.debug,"debug")}),this.getVirtualIndexes=z(()=>{let t=null,s=null,e=this.calculateRange();return e&&(t=e.startIndex,s=e.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,s]},(t,s,e,n,o)=>n===null||o===null?[]:t({startIndex:n,endIndex:o,overscan:s,count:e}),{key:!1,debug:c(()=>this.options.debug,"debug")}),this.indexFromElement=t=>{let s=this.options.indexAttribute,e=t.getAttribute(s);return e?parseInt(e,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var s;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;let e=this.scrollState.index??((s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:s.index);if(e!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,e-n),i=Math.min(this.options.count-1,e+n);return t>=o&&t<=i}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,i)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(i))});return}let s=this.indexFromElement(t);if(!this.isIndexInRange(s))return;let e=this.options.getItemKey(s),n=this.elementsCache.get(e);n!==t&&(n&&this.observer.unobserve(n),this.observer.observe(t),this.elementsCache.set(e,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,s)=>{var e,n,o;if(!this.isIndexInRange(t))return;let i,l,u,g=(e=this._singleLaneMeasurements)==null?void 0:e.flat;if(this.options.lanes===1&&g!=null)u=this.options.getItemKey(t),l=g[t*2],i=g[t*2+1];else{let d=this.measurementsCache[t];if(!d)return;u=d.key,l=d.start,i=d.size}let h=this.itemSizeCache.get(u)??i,f=s-h;if(f!==0){let d=this.options.anchorTo==="end"&&((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,S=d?this.getTotalSize():0,v=this.getScrollOffset()+this.scrollAdjustments,b=!this.itemSizeCache.has(u)?l<v:l+h<=v&&this.scrollDirection!=="backward",m=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:u,start:l,size:i,end:l+i,lane:0},f,this):b);(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(u,s),this.itemSizeCacheVersion++;let p=!1;d?p=this.applyScrollAdjustment(this.getTotalSize()-S):m&&(p=this.applyScrollAdjustment(f)),this.notify(p),this._retryClampedAdjustment()}},this.getVirtualItems=z(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,s)=>{let e=[];for(let n=0,o=t.length;n<o;n++){let i=t[n],l=s[i];e.push(l)}return e},{key:!1,debug:c(()=>this.options.debug,"debug")}),this.getVirtualItemForOffset=t=>{var s;let e=this.getMeasurements();if(e.length===0)return;let n=(s=this._singleLaneMeasurements)==null?void 0:s.flat,o=this.options.lanes===1&&n!=null,i=Y(0,e.length-1,o?l=>n[l*2]:l=>W(e[l]).start,t);return W(e[i])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,s,e=0)=>{if(!this.scrollElement)return 0;let n=this.getSize(),o=this.getScrollOffset();s==="auto"&&(s=t>=o+n?"end":"start"),s==="center"?t+=(e-n)/2:s==="end"&&(t-=n);let i=this.getMaxScrollOffset();return Math.max(Math.min(i,t),0)},this.getOffsetForIndex=(t,s="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));let e=this.getSize(),n=this.getScrollOffset(),o=this.measurementsCache[t];if(!o)return;if(s==="auto")if(o.end>=n+e-this.options.scrollPaddingEnd)s="end";else if(o.start<=n+this.options.scrollPaddingStart)s="start";else return[n,s];if(s==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),s];let i=s==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,s,o.size),s]},this.scrollToOffset=(t,{align:s="start",behavior:e="auto"}={})=>{this._iosDeferredAdjustment=0;let n=this.getOffsetForAlignment(t,s),o=this.now();this.scrollState={index:null,align:s,behavior:e,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:e}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:s="auto",behavior:e="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));let n=this.getOffsetForIndex(t,s);if(!n)return;let[o,i]=n,l=this.now();this.scrollState={index:t,align:i,behavior:e,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:e}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:s="auto"}={})=>{let e=this.getScrollOffset()+t,n=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:n,lastTargetOffset:e,stableFrames:0},this._scrollToOffset(e,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t,s;let e=this.getMeasurements(),n;if(e.length===0)n=this.options.paddingStart;else if(this.options.lanes===1){let o=e.length-1,i=(t=this._singleLaneMeasurements)==null?void 0:t.flat;i!=null?n=i[o*2]+i[o*2+1]:n=((s=e[o])==null?void 0:s.end)??0}else{let o=Array(this.options.lanes).fill(null),i=e.length-1;for(;i>=0&&o.some(l=>l===null);){let l=e[i];o[l.lane]===null&&(o[l.lane]=l.end),i--}n=Math.max(...o.filter(l=>l!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let t=[];if(this.itemSizeCache.size===0)return t;let s=this.getMeasurements();for(let e of s)e&&this.itemSizeCache.has(e.key)&&t.push({index:e.index,key:e.key,start:e.start,size:e.size,end:e.end,lane:e.lane});return t},this._scrollToOffset=(t,{adjustments:s,behavior:e})=>{this._intendedScrollOffset=t+(s??0),this.options.scrollToFn(t,{behavior:e,adjustments:s},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,t){if(a===0)return!1;if(V()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=a,!1;{let s=this.getScrollOffset()+this.scrollAdjustments+a,e=this.scrollElement,n=e!==null&&("scrollHeight"in e||"document"in e)?this.getMaxScrollOffset():null;return this._clampedAdjustment=n!==null&&s>n+.5?{target:s,maxAtWrite:n}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let s=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,e=s?s[0]:this.scrollState.lastTargetOffset,n=1,o=e!==this.scrollState.lastTargetOffset;if(!o&&k(e,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=n){this.getScrollOffset()!==e&&this._scrollToOffset(e,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,o){let i=this.getSize()||600,l=Math.abs(e-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>i;this.scrollState.lastTargetOffset=e,u||(this.scrollState.behavior="auto"),this._scrollToOffset(e,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}},Y=c((r,a,t,s)=>{for(;r<=a;){let e=(r+a)/2|0,n=t(e);if(n<s)r=e+1;else if(n>s)a=e-1;else return e}return r>0?r-1:0},"findNearestBinarySearch");function rt(r,a,t){let s=0;for(;s<=a;){let e=(s+a)/2|0,n=r[e*2];if(n<t)s=e+1;else if(n>t)a=e-1;else return e}return s>0?s-1:0}c(rt,"findNearestBinarySearchFlat");function at(r,a,t,s,e){let n=r.length-1;if(r.length<=s)return{startIndex:0,endIndex:n};if(s===1&&e!==null){let u=rt(e,n,t),g=u,h=t+a;for(;g<n&&e[g*2]+e[g*2+1]<h;)g++;return{startIndex:u,endIndex:g}}let i=Y(0,n,c(u=>r[u].start,"getStart"),t),l=i;if(s===1)for(;l<n&&r[l].end<t+a;)l++;else if(s>1){let u=Array(s).fill(0);for(;l<n&&u.some(h=>h<t+a);){let h=r[l];u[h.lane]=h.end,l++}let g=Array(s).fill(t+a);for(;i>=0&&g.some(h=>h>=t);){let h=r[i];g[h.lane]=h.start,i--}i=Math.max(0,i-i%s),l=Math.min(n,l+(s-1-l%s))}return{startIndex:i,endIndex:l}}c(at,"calculateRangeImpl");var I=P(Q(),1),G=P(Z(),1);var N=typeof document<"u"?I.useLayoutEffect:I.useEffect;function ht({useFlushSync:r=!0,directDomUpdates:a=!1,directDomUpdatesMode:t="transform",...s}){let e=I.useReducer(h=>h+1,0)[1],n=I.useRef({enabled:a,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});n.current.enabled=a,n.current.mode=t;let o=I.useRef(!1),i=c(h=>{let f=n.current;if(!f.enabled||!f.container)return;let d=h.getTotalSize();if(d!==f.lastSize){f.lastSize=d;let S=h.options.horizontal?"width":"height";f.container.style[S]=`${d}px`}},"applyContainerSize"),l=c(h=>{let f=n.current;if(!f.enabled||!f.container)return;i(h);let d=!!h.options.horizontal,S=f.mode==="transform",v=d?"left":"top",E=h.options.scrollMargin,b=h.getVirtualItems();for(let m of b){let p=m.start-E,O=h.elementsCache.get(m.key);O&&f.lastPositions.get(O)!==p&&(f.lastPositions.set(O,p),S?O.style.transform=d?`translate3d(${p}px, 0, 0)`:`translate3d(0, ${p}px, 0)`:O.style[v]=`${p}px`)}},"applyDirectStyles"),u={...s,onChange:c((h,f)=>{var d;let S=n.current,v=!0;if(S.enabled){l(h);let E=h.range,b=S.prevRange;v=!b||b.isScrolling!==h.isScrolling||b.startIndex!==E?.startIndex||b.endIndex!==E?.endIndex,v&&(S.prevRange=E?{startIndex:E.startIndex,endIndex:E.endIndex,isScrolling:h.isScrolling}:null)}v&&(r&&f&&!o.current?(0,G.flushSync)(e):e()),(d=s.onChange)==null||d.call(s,h,f)},"onChange")},[g]=I.useState(()=>{let h=new D(u),f=h.measureElement;return h.measureElement=d=>{o.current=!0;try{f(d)}finally{o.current=!1}},Object.assign(h,{containerRef:c(d=>{let S=n.current;if(S.container=d,S.lastSize=null,d&&S.enabled){let v=h.getTotalSize();S.lastSize=v;let E=h.options.horizontal?"width":"height";d.style[E]=`${v}px`}},"containerRef")})});return g.setOptions(u),N(()=>g._didMount(),[]),N(()=>(i(g),g._willUpdate())),N(()=>{l(g)}),g}c(ht,"useVirtualizerBase");function _t(r){return ht({observeElementRect:q,observeElementOffset:U,scrollToFn:X,...r})}c(_t,"useVirtualizer");export{q as a,U as b,_t as c};
@@ -1 +0,0 @@
1
- import{a as u,d as y,e as d}from"./chunk-OXFKZ4BM.js";var t=y(d(),1);var S=u((r,a=400)=>{let e=(r??"").trim(),[o,c]=(0,t.useState)(e),[i,n]=(0,t.useState)(e),m=(0,t.useRef)(r);m.current!==r&&(m.current=r,c(e),n(e));let f=o.trim();return(0,t.useEffect)(()=>{let s=setTimeout(()=>{n(f)},a);return()=>{clearTimeout(s)}},[f,a]),{queryShardKey:i,setShardKey:u(s=>{c(s)},"setShardKey"),shardKey:o}},"f");export{S as a};
@@ -1 +0,0 @@
1
- import{a as we}from"./chunk-CNA3TVUK.js";import{a as ve}from"./chunk-FXPAJDES.js";import{i as ie}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as U}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import"./chunk-4C4THJUD.js";import{a as te}from"./chunk-6UTZXEW3.js";import{c as Ne}from"./chunk-4DAKKAK7.js";import{m as ue}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as de}from"./chunk-XMSNLMWU.js";import{a as ae,b as re,c as ne,d as j,e as h,f as p}from"./chunk-HHRYM6UW.js";import{a as Y,e as ee}from"./chunk-JSDKOE4U.js";import{l as X,n as ce,o as me,p as z,v as pe,y as q}from"./chunk-BFE2DRP6.js";import{a as s,d as he,e as ke,f as be,g as Se}from"./chunk-OXFKZ4BM.js";var xe=he(be(),1),i=he(ke(),1);var t=he(Se(),1);var Ce=["queued","running","rollingBack","paused","waiting","complete","errored","terminated"],Oe=["pause","resume","restart","terminate"],Ie=s(l=>{let e=(0,xe.c)(7),{busy:w,id:x,onAct:N}=l,b=X(),a;e[0]!==w||e[1]!==x||e[2]!==N||e[3]!==b?(a=Oe.map(m=>m==="restart"?(0,t.jsx)(ve,{confirmLabel:b("Restart?"),disabled:w,onConfirm:s(()=>{N(m)},"onConfirm"),testId:`workflow-instance-${m}-${x}`,children:b(m)},m):(0,t.jsx)(U,{"data-testid":`workflow-instance-${m}-${x}`,disabled:w,onClick:s(()=>{N(m)},"onClick"),size:"sm",type:"button",variant:"ghost",children:b(m)},m)),e[0]=w,e[1]=x,e[2]=N,e[3]=b,e[4]=a):a=e[4];let d;return e[5]!==a?(d=(0,t.jsx)(t.Fragment,{children:a}),e[5]=a,e[6]=d):d=e[6],d},"Ce"),$e="WORKFLOWS_NOT_CONFIGURED",We=s(l=>typeof l=="object"&&l!==null&&l.code===$e,"Oe"),Ae=s(l=>{let e=l.error??l.output;if(e===void 0)return"\u2014";try{return JSON.stringify(e,pe)}catch{return"(unserializable)"}},"Ee"),Te=s(({loadDetail:l,loadInstances:e,readOnly:w,runAction:x,workflowName:N})=>{let b=ue(),a=X(),[d,m]=(0,i.useState)(null),[v,L]=(0,i.useState)(null),[S,B]=(0,i.useState)(""),[C,O]=(0,i.useState)(null),[F,W]=(0,i.useState)(!1),[_,R]=(0,i.useState)(null),g=(0,i.useRef)(0),y=(0,i.useRef)(0),k=(0,i.useRef)(0),A=l??(n=>b.getWorkflowInstance(n)),I=w?void 0:x??(e===void 0?n=>b.setWorkflowInstanceStatus(n):void 0),T=s(async()=>{y.current+=1;let n=y.current;O(null),W(!1);let u=S===""?void 0:S;try{if(e===void 0){let r=await b.listWorkflowInstances({name:N,status:u});if(n!==y.current)return;if(r.configured===!1){m(null),W(!0);return}m(r.instances);return}let f=await e({name:N,status:u});n===y.current&&m(f)}catch(f){if(n!==y.current)return;m(null),We(f)?W(!0):O(z(f))}},"E");(0,i.useEffect)(()=>{g.current+=1,k.current+=1,L(null),q(T())},[N,S]);let P=s(async n=>{k.current+=1;let u=k.current;O(null);try{let f=await A({id:n,name:N});u===k.current&&L(f)}catch(f){u===k.current&&O(z(f))}},"W"),E=s(()=>{k.current+=1,L(null)},"A"),J=s(async(n,u)=>{if(I===void 0)return;let f=g.current;R(n),O(null);try{await I({action:u,id:n,name:N}),f===g.current&&await T()}catch(r){O(z(r))}R(null)},"L");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:a("Instance history")}),(0,t.jsxs)("select",{"aria-label":a("Filter by status"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflow-instances-filter",onChange:s(n=>{B(n.target.value)},"onChange"),value:S,children:[(0,t.jsx)("option",{value:"",children:a("All statuses")}),Ce.map(n=>(0,t.jsx)("option",{value:n,children:n},n))]})]}),C!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:C}),F&&(0,t.jsx)(de,{description:a("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:a("Workflow inspection not configured")}),!F&&d!==null&&d.length===0&&(0,t.jsx)(de,{description:a("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:a("No instances")}),d!==null&&d.length>0&&(0,t.jsx)(Y,{className:"overflow-hidden py-0",children:(0,t.jsx)(ee,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflow-instances-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:a("Instance id")}),(0,t.jsx)(h,{children:a("Status")}),(0,t.jsx)(h,{children:a("Created")}),(0,t.jsx)(h,{children:a("Ended")}),(0,t.jsx)(h,{"aria-label":a("Actions")})]})}),(0,t.jsx)(ne,{children:d.map(n=>(0,t.jsxs)(j,{"data-testid":`workflow-instance-${n.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:n.id}),(0,t.jsx)(p,{className:"font-mono text-xs",children:n.status}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.createdOn??"\u2014"}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.endedOn??"\u2014"}),(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsx)(U,{"data-testid":`workflow-instance-steps-${n.id}`,onClick:s(()=>{q(P(n.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:a("Steps")}),I!==void 0&&(0,t.jsx)(Ie,{busy:_===n.id,id:n.id,onAct:s(u=>{q(J(n.id,u))},"onAct")},N)]})})]},n.id))})]})})}),v!==null&&(0,t.jsx)(Y,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,t.jsxs)(ee,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"font-mono text-xs",children:[a("Steps")," \xB7 ",v.id]}),(0,t.jsx)(U,{"data-testid":"workflow-instance-detail-close",onClick:E,size:"xs",type:"button",variant:"ghost",children:a("Close")})]}),v.steps.length===0?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:a("This instance has no recorded steps yet.")}):(0,t.jsxs)(ae,{"data-testid":"workflow-instance-steps",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:a("Step")}),(0,t.jsx)(h,{children:a("Type")}),(0,t.jsx)(h,{children:a("Attempts")}),(0,t.jsx)(h,{children:a("Started")}),(0,t.jsx)(h,{children:a("Output")})]})}),(0,t.jsx)(ne,{children:v.steps.map((n,u)=>(0,t.jsxs)(j,{"data-testid":`workflow-step-${String(u)}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:n.name}),(0,t.jsx)(p,{className:"text-xs text-muted-foreground",children:n.type??"\u2014"}),(0,t.jsx)(p,{className:"tabular-nums",children:n.attempts??"\u2014"}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.start??"\u2014"}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:Ae(n)})]},`${n.name}:${String(u)}`))})]})]})})]})},"_e"),_e=ce(te.createWorkflowInstance),Ee=ce(te.getWorkflowInstanceStatus),Je=ce(te.sendWorkflowEvent),De=s(l=>{if(l.error)return`${l.error.name}: ${l.error.message}`;if(l.output===void 0)return"\u2014";try{return JSON.stringify(l.output,pe)}catch{return"(unserializable)"}},"$e"),ge=s(l=>{let e=l.trim();if(e==="")return{value:void 0};try{return{value:JSON.parse(e)}}catch{return null}},"ve"),Fe=s((l,e)=>l.some(w=>w.exportName===e)?e:l[0]?.exportName??"","Fe"),Pe=s(l=>{let e=(0,xe.c)(72),{eventTypes:w,exportName:x,onSent:N}=l,b=ue(),a=X(),[d,m]=(0,i.useState)(""),[v,L]=(0,i.useState)(""),[S,B]=(0,i.useState)(""),[C,O]=(0,i.useState)(!1),[F,W]=(0,i.useState)(null),_;e[0]!==b||e[1]!==x||e[2]!==N||e[3]!==a||e[4]!==v?(_=s(async(D,oe)=>{try{await b.query(Je,{exportName:x,id:D,payload:oe,type:v},me(""))}catch(fe){W(z(fe));return}try{await N(x,D)}catch(fe){let ye=fe;W(`${a("Event sent, but refreshing the instance failed")}: ${z(ye)}`)}},"_"),e[0]=b,e[1]=x,e[2]=N,e[3]=a,e[4]=v,e[5]=_):_=e[5];let R=_,g;e[6]!==R||e[7]!==d||e[8]!==S||e[9]!==a?(g=s(async()=>{let D=d.trim(),oe=ge(S);if(oe===null){W(a("Payload must be valid JSON"));return}O(!0),W(null),await R(D,oe.value).finally(()=>{O(!1)})},"N"),e[6]=R,e[7]=d,e[8]=S,e[9]=a,e[10]=g):g=e[10];let y=g,k;e[11]!==a?(k=a("Send event"),e[11]=a,e[12]=k):k=e[12];let A;e[13]!==k?(A=(0,t.jsx)("h3",{className:"text-sm font-medium",children:k}),e[13]=k,e[14]=A):A=e[14];let I;e[15]!==F?(I=F!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-event-error",role:"alert",children:F}),e[15]=F,e[16]=I):I=e[16];let T;e[17]!==a?(T=a("Instance id"),e[17]=a,e[18]=T):T=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=s(D=>{m(D.target.value)},"O"),e[19]=P):P=e[19];let E;e[20]!==a?(E=a("Instance id"),e[20]=a,e[21]=E):E=e[21];let J;e[22]!==d||e[23]!==T||e[24]!==E?(J=(0,t.jsx)(ie,{"aria-label":T,className:"max-w-48","data-testid":"workflows-event-id",onChange:P,placeholder:E,value:d}),e[22]=d,e[23]=T,e[24]=E,e[25]=J):J=e[25];let n;e[26]!==a?(n=a("Event type"),e[26]=a,e[27]=n):n=e[27];let u;e[28]===Symbol.for("react.memo_cache_sentinel")?(u=s(D=>{L(D.target.value)},"L"),e[28]=u):u=e[28];let f;e[29]!==a?(f=a("Event type"),e[29]=a,e[30]=f):f=e[30];let r;e[31]!==n||e[32]!==f||e[33]!==v?(r=(0,t.jsx)(ie,{"aria-label":n,className:"max-w-48","data-testid":"workflows-event-type",list:"workflows-event-types",onChange:u,placeholder:f,value:v}),e[31]=n,e[32]=f,e[33]=v,e[34]=r):r=e[34];let c;e[35]!==w?(c=w.map(je),e[35]=w,e[36]=c):c=e[36];let o;e[37]!==c?(o=(0,t.jsx)("datalist",{"data-testid":"workflows-event-types",id:"workflows-event-types",children:c}),e[37]=c,e[38]=o):o=e[38];let $;e[39]!==x||e[40]!==d||e[41]!==C||e[42]!==v?($=C||x===""||d.trim()===""||v.trim()==="",e[39]=x,e[40]=d,e[41]=C,e[42]=v,e[43]=$):$=e[43];let K;e[44]!==y?(K=s(()=>{q(y())},"z"),e[44]=y,e[45]=K):K=e[45];let G;e[46]!==C||e[47]!==a?(G=a(C?"Sending\u2026":"Send event"),e[46]=C,e[47]=a,e[48]=G):G=e[48];let M;e[49]!==$||e[50]!==K||e[51]!==G?(M=(0,t.jsx)(U,{"data-testid":"workflows-event-button",disabled:$,onClick:K,children:G}),e[49]=$,e[50]=K,e[51]=G,e[52]=M):M=e[52];let Z;e[53]!==r||e[54]!==o||e[55]!==M||e[56]!==J?(Z=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[J,r,o,M]}),e[53]=r,e[54]=o,e[55]=M,e[56]=J,e[57]=Z):Z=e[57];let H;e[58]!==a?(H=a("Payload (JSON)"),e[58]=a,e[59]=H):H=e[59];let se;e[60]===Symbol.for("react.memo_cache_sentinel")?(se=s(D=>{B(D.target.value)},"Y"),e[60]=se):se=e[60];let Q;e[61]!==a?(Q=a("Payload (JSON, optional)"),e[61]=a,e[62]=Q):Q=e[62];let V;e[63]!==S||e[64]!==H||e[65]!==Q?(V=(0,t.jsx)(we,{"aria-label":H,className:"font-mono","data-testid":"workflows-event-payload",onChange:se,placeholder:Q,value:S}),e[63]=S,e[64]=H,e[65]=Q,e[66]=V):V=e[66];let le;return e[67]!==Z||e[68]!==V||e[69]!==A||e[70]!==I?(le=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-event",children:[A,I,Z,V]}),e[67]=Z,e[68]=V,e[69]=A,e[70]=I,e[71]=le):le=e[71],le},"Pe"),Ve=s(()=>{let l=ue(),e=X(),{data:w,error:x}=Ne(te.listWorkflows,{}),[N,b]=(0,i.useState)(""),[a,d]=(0,i.useState)(""),[m,v]=(0,i.useState)(""),[L,S]=(0,i.useState)(!1),[B,C]=(0,i.useState)(null),[O,F]=(0,i.useState)([]),[W,_]=(0,i.useState)(null),R=w!==void 0,g=Array.isArray(w?.workflows)?[...w.workflows].toSorted((r,c)=>r.exportName.localeCompare(c.exportName)):[],y=Fe(g,N),k=g.find(r=>r.exportName===y),A=s(r=>{F(c=>{let o=c.filter($=>!($.exportName===r.exportName&&$.id===r.id));return[r,...o]})},"T"),I=s(async()=>{let r=y;if(r==="")return;let c=ge(m);if(c===null){C(e("Params must be valid JSON"));return}S(!0),C(null);try{let o=a.trim(),$=await l.query(_e,{exportName:r,id:o===""?void 0:o,params:c.value},me(""));A({exportName:r,id:$.id,status:$.status}),d("")}catch(o){C(z(o))}S(!1)},"F"),T=s(()=>{q(I())},"P"),P=s(async(r,c)=>{_(c);try{let o=await l.query(Ee,{exportName:r,id:c},me(""));A({error:o.error,exportName:r,id:o.id,output:o.output,status:o.status})}catch(o){throw _(null),o}_(null)},"O"),E=s(async(r,c)=>{try{await P(r,c)}catch(o){C(z(o))}},"E"),J=s(r=>{b(r.target.value)},"W"),n=s(r=>{d(r.target.value)},"A"),u=s(r=>{v(r.target.value)},"L"),f=s(r=>{let{export:c,id:o}=r.currentTarget.dataset;c!==void 0&&o!==void 0&&q(E(c,o))},"n");return(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[x!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:x}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")}),R&&g.length===0?(0,t.jsx)(de,{description:e("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:e("No workflows defined")}):(0,t.jsx)(Y,{className:"overflow-hidden py-0",children:(0,t.jsx)(ee,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflows-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:e("Export")}),(0,t.jsx)(h,{children:e("Name")}),(0,t.jsx)(h,{children:e("Class")})]})}),(0,t.jsx)(ne,{children:g.map(r=>(0,t.jsxs)(j,{"data-testid":`workflows-row-${r.exportName}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:r.exportName}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.name}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.className})]},r.exportName))})]})})}),g.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("Start instance")}),B!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:B}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":e("Workflow"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflows-start-select",onChange:J,value:y,children:g.map(r=>(0,t.jsx)("option",{value:r.exportName,children:r.exportName},r.exportName))}),(0,t.jsx)(ie,{"aria-label":e("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:n,placeholder:e("Instance id (optional)"),value:a}),(0,t.jsx)(U,{"data-testid":"workflows-start-button",disabled:L||y==="",onClick:T,children:e(L?"Starting\u2026":"Start instance")})]}),(0,t.jsx)(we,{"aria-label":e("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:u,placeholder:e("Params (JSON, optional)"),value:m})]}),g.length>0&&(0,t.jsx)(Pe,{eventTypes:w?.eventTypes??[],exportName:y,onSent:P},y),O.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("Instances")}),(0,t.jsx)(Y,{className:"overflow-hidden py-0",children:(0,t.jsx)(ee,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflows-instances-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:e("Workflow")}),(0,t.jsx)(h,{children:e("Instance id")}),(0,t.jsx)(h,{children:e("Status")}),(0,t.jsx)(h,{children:e("Output")}),(0,t.jsx)(h,{})]})}),(0,t.jsx)(ne,{children:O.map(r=>(0,t.jsxs)(j,{"data-testid":`workflows-instance-${r.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:r.exportName}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.id}),(0,t.jsx)(p,{className:"font-mono text-xs",children:r.status}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:De(r)}),(0,t.jsx)(p,{children:(0,t.jsx)(U,{"data-export":r.exportName,"data-id":r.id,"data-testid":`workflows-instance-refresh-${r.id}`,disabled:W===r.id,onClick:f,size:"xs",variant:"outline",children:W===r.id?e("Refreshing\u2026"):e("Refresh")})})]},`${r.exportName}:${r.id}`))})]})})})]}),k!==void 0&&(0,t.jsx)(Te,{workflowName:k.name})]})},"Ze");function je(l){return(0,t.jsx)("option",{value:l,children:l},l)}s(je,"De");export{Ve as default};
@@ -1 +0,0 @@
1
- import{a as dt}from"./chunk-TQM6XHBA.js";import"./chunk-7RGYCU6F.js";import"./chunk-KZILJQX3.js";import"./chunk-SYGCASPT.js";import"./chunk-YMEKCV27.js";import"./chunk-LIGOLZND.js";import"./chunk-3GXPALXG.js";import{a as De}from"./chunk-KZCEJFZF.js";import{a as st}from"./chunk-KYAG2YMF.js";import"./chunk-AP4PC2M4.js";import"./chunk-KRPXOSBL.js";import"./chunk-W2BCSK5S.js";import"./chunk-NGVP66OH.js";import"./chunk-XYR5NST4.js";import{a as at}from"./chunk-5DNGK3NT.js";import{a as ot}from"./chunk-FXPAJDES.js";import{a as tt}from"./chunk-XST3UEHU.js";import{b as et}from"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import{h as Be,i as We}from"./chunk-LUHXNZI4.js";import"./chunk-ZTOREMGH.js";import{i as ze}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as He}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as Ue}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as Te}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as F}from"./chunk-6UTZXEW3.js";import{c as ce}from"./chunk-4DAKKAK7.js";import{m as Ye}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as Oe}from"./chunk-XMSNLMWU.js";import{a as rt,b as it,c as nt,d as _e,e as q,f as T}from"./chunk-HHRYM6UW.js";import{a as Qe,e as Ve}from"./chunk-JSDKOE4U.js";import{C as qe,h as de,l as le,n as Ge,o as Ze,p as Xe,y as je}from"./chunk-BFE2DRP6.js";import{a as s,d as se,e as Je,f as Ae,g as Pe}from"./chunk-OXFKZ4BM.js";var be=se(Ae(),1),he=se(Je(),1);var lt=se(Ae(),1),S=se(Je(),1);var m=se(Pe(),1);var qt=Ge(F.runMigration),ct=s(t=>{let e=(0,lt.c)(98),{initialShardKey:r}=t,i=Ye(),a=le(),{queryShardKey:o,setShardKey:n,shardKey:d}=at(r),[l,f]=(0,S.useState)(""),[h,g]=(0,S.useState)("up"),[p,b]=(0,S.useState)(!0),[y,x]=(0,S.useState)(!1),[v,u]=(0,S.useState)(null),[w,k]=(0,S.useState)(null),L;e[0]!==d?(L=d.trim(),e[0]=d,e[1]=L):L=e[1];let C=L===o,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];let M;e[3]!==o?(M={live:!0,shardKey:o},e[3]=o,e[4]=M):M=e[4];let $=ce(F.migrationStatus,j,M),N=$.data?.migrations??null,Ie=$.error,{errorSource:Fe,liveError:Re}=$,ye,ve;e[5]!==o||e[6]!==$.data?(ye=s(()=>{$.data!==void 0&&et(o)},"W"),ve=[$.data,o],e[5]=o,e[6]=$.data,e[7]=ye,e[8]=ve):(ye=e[7],ve=e[8]),(0,S.useEffect)(ye,ve);let xe;if(e[9]!==i||e[10]!==h||e[11]!==p||e[12]!==l||e[13]!==d||e[14]!==$||e[15]!==a){let I=s(async()=>{let Ee=l.trim();if(Ee===""){k(a("Enter a migration id")),u(null);return}x(!0),k(null);try{let Le=await i.query(qt,{direction:h,dryRun:p,id:Ee},Ze(d));u(Le),$.refetch()}catch(Le){let jt=Le;u(null),k(Xe(jt))}x(!1)},"u");xe=s(()=>{je(I())},"V"),e[9]=i,e[10]=h,e[11]=p,e[12]=l,e[13]=d,e[14]=$,e[15]=a,e[16]=xe}else xe=e[16];let ke=xe,we;e[17]===Symbol.for("react.memo_cache_sentinel")?(we=s(I=>{f(I.target.value)},"Y"),e[17]=we):we=e[17];let Nt=we,$e;e[18]===Symbol.for("react.memo_cache_sentinel")?($e=s(I=>{g(I.target.value==="down"?"down":"up")},"Z"),e[18]=$e):$e=e[18];let St=$e,Ne;e[19]===Symbol.for("react.memo_cache_sentinel")?(Ne=s(I=>{b(I.target.checked)},"ee"),e[19]=Ne):Ne=e[19];let Ot=Ne,_;e[20]!==n||e[21]!==d?(_=(0,m.jsx)(tt,{onChange:n,testId:"mg-shard-input",value:d}),e[20]=n,e[21]=d,e[22]=_):_=e[22];let D;e[23]!==Re?(D=(0,m.jsx)(st,{message:Re,prefix:"mg"}),e[23]=Re,e[24]=D):D=e[24];let K;e[25]!==_||e[26]!==D?(K=(0,m.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[_,D]}),e[25]=_,e[26]=D,e[27]=K):K=e[27];let E;e[28]!==Ie||e[29]!==Fe?(E=Ie!==null&&(0,m.jsx)(Te,{error:Fe,testId:"mg-status-error"}),e[28]=Ie,e[29]=Fe,e[30]=E):E=e[30];let J;e[31]!==N||e[32]!==a?(J=N!==null&&N.length===0&&(0,m.jsx)(Oe,{description:a("Data migrations you run against this shard will be tracked here."),icon:(0,m.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,m.jsx)("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"})}),testId:"mg-empty",title:a("No migrations have run on this shard.")}),e[31]=N,e[32]=a,e[33]=J):J=e[33];let A;e[34]!==N||e[35]!==a?(A=N!==null&&N.length>0&&(0,m.jsx)(Qe,{className:"overflow-hidden py-0",children:(0,m.jsx)(Ve,{className:"px-0",children:(0,m.jsxs)(rt,{"data-testid":"mg-table",children:[(0,m.jsx)(it,{children:(0,m.jsxs)(_e,{children:[(0,m.jsx)(q,{children:a("id")}),(0,m.jsx)(q,{children:a("direction")}),(0,m.jsx)(q,{children:a("status")}),(0,m.jsx)(q,{children:a("processed")}),(0,m.jsx)(q,{children:a("changed")}),(0,m.jsx)(q,{children:a("updated")}),(0,m.jsx)(q,{children:a("error")})]})}),(0,m.jsx)(nt,{children:N.map(Tt)})]})})}),e[34]=N,e[35]=a,e[36]=A):A=e[36];let P;e[37]!==a?(P=a("Run migration"),e[37]=a,e[38]=P):P=e[38];let B;e[39]!==P?(B=(0,m.jsx)(De,{children:P}),e[39]=P,e[40]=B):B=e[40];let W;e[41]!==a?(W=a("Migration id"),e[41]=a,e[42]=W):W=e[42];let U;e[43]!==a?(U=a("migration id"),e[43]=a,e[44]=U):U=e[44];let z;e[45]!==l||e[46]!==W||e[47]!==U?(z=(0,m.jsx)(ze,{"aria-label":W,className:"w-auto","data-testid":"mg-id-input",onChange:Nt,placeholder:U,value:l}),e[45]=l,e[46]=W,e[47]=U,e[48]=z):z=e[48];let H;e[49]!==a?(H=a("Direction"),e[49]=a,e[50]=H):H=e[50];let Q;e[51]!==a?(Q=a("up"),e[51]=a,e[52]=Q):Q=e[52];let V;e[53]!==Q?(V=(0,m.jsx)("option",{value:"up",children:Q}),e[53]=Q,e[54]=V):V=e[54];let G;e[55]!==a?(G=a("down"),e[55]=a,e[56]=G):G=e[56];let Z;e[57]!==G?(Z=(0,m.jsx)("option",{value:"down",children:G}),e[57]=G,e[58]=Z):Z=e[58];let X;e[59]!==h||e[60]!==H||e[61]!==V||e[62]!==Z?(X=(0,m.jsxs)("select",{"aria-label":H,className:"flex h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"mg-direction",onChange:St,value:h,children:[V,Z]}),e[59]=h,e[60]=H,e[61]=V,e[62]=Z,e[63]=X):X=e[63];let Y;e[64]!==p?(Y=(0,m.jsx)("input",{checked:p,className:"size-4 accent-primary","data-testid":"mg-dry-run",id:"mg-dry-run",onChange:Ot,type:"checkbox"}),e[64]=p,e[65]=Y):Y=e[65];let ee;e[66]!==a?(ee=a("Dry run"),e[66]=a,e[67]=ee):ee=e[67];let te;e[68]!==Y||e[69]!==ee?(te=(0,m.jsxs)(De,{className:"flex items-center gap-1.5",htmlFor:"mg-dry-run",children:[Y,ee]}),e[68]=Y,e[69]=ee,e[70]=te):te=e[70];let ae;e[71]!==p||e[72]!==ke||e[73]!==y||e[74]!==C||e[75]!==a?(ae=p?(0,m.jsx)(He,{"data-testid":"mg-run",disabled:y||!C,onClick:ke,type:"button",children:a(y?"Running\u2026":"Run")}):(0,m.jsx)(ot,{confirmLabel:a(y?"Running\u2026":"Run migration?"),disabled:y||!C,onConfirm:ke,testId:"mg-run",children:a("Run")}),e[71]=p,e[72]=ke,e[73]=y,e[74]=C,e[75]=a,e[76]=ae):ae=e[76];let re;e[77]!==z||e[78]!==X||e[79]!==te||e[80]!==ae?(re=(0,m.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[z,X,te,ae]}),e[77]=z,e[78]=X,e[79]=te,e[80]=ae,e[81]=re):re=e[81];let ie;e[82]!==B||e[83]!==re?(ie=(0,m.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs",children:[B,re]}),e[82]=B,e[83]=re,e[84]=ie):ie=e[84];let ne;e[85]!==w?(ne=w!==null&&(0,m.jsx)("pre",{className:"text-sm text-destructive whitespace-pre-wrap","data-testid":"mg-run-error",role:"alert",children:w}),e[85]=w,e[86]=ne):ne=e[86];let oe;e[87]!==v||e[88]!==a?(oe=v!==null&&(0,m.jsxs)("p",{className:"text-sm text-muted-foreground","data-testid":"mg-run-result",children:[v.dryRun?a("Dry run: "):"",a("{status} \u2014 processed",{status:v.status}),v.processed,a(", changed"),v.changed]}),e[87]=v,e[88]=a,e[89]=oe):oe=e[89];let Se;return e[90]!==K||e[91]!==E||e[92]!==J||e[93]!==A||e[94]!==ie||e[95]!==ne||e[96]!==oe?(Se=(0,m.jsxs)("div",{className:"flex flex-col gap-3 pt-4","data-testid":"lunora-migrations",children:[K,E,J,A,ie,ne,oe]}),e[90]=K,e[91]=E,e[92]=J,e[93]=A,e[94]=ie,e[95]=ne,e[96]=oe,e[97]=Se):Se=e[97],Se},"yt");function Tt(t){return(0,m.jsxs)(_e,{"data-testid":`mg-row-${t.id}`,children:[(0,m.jsx)(T,{children:t.id}),(0,m.jsx)(T,{children:t.direction}),(0,m.jsx)(T,{children:(0,m.jsx)(Ue,{variant:"secondary",children:t.status})}),(0,m.jsx)(T,{children:t.processed}),(0,m.jsx)(T,{children:t.changed}),(0,m.jsx)(T,{children:qe(t.updatedAt)}),(0,m.jsx)(T,{children:t.error??""})]},t.id)}s(Tt,"Je");var c=se(Pe(),1);var Ke=1;function Ct(t){let e={},r=Object.keys(t);r.sort();for(let i of r)e[i]=t[i];return e}s(Ct,"me");var me=s(t=>typeof t=="object"&&t!==null,"O"),Mt=s(t=>me(t)&&me(t.fields)&&me(t.indexes)&&me(t.relations)&&typeof t.shardMode=="string","ue"),It=s(t=>{if(t===void 0||t.trim()==="")return{status:"absent"};let e;try{e=JSON.parse(t)}catch(r){return{error:`baseline is not valid JSON: ${r instanceof Error?r.message:String(r)}`,status:"invalid"}}if(!me(e)||e.version!==Ke||!me(e.tables))return{error:`baseline is malformed or written by an incompatible version (expected version ${String(Ke)})`,status:"invalid"};for(let[r,i]of Object.entries(e.tables))if(!Mt(i))return{error:`baseline table "${r}" has an invalid structure`,status:"invalid"};return{snapshot:{jurisdiction:typeof e.jurisdiction=="string"?e.jurisdiction:void 0,migrationIds:Array.isArray(e.migrationIds)?e.migrationIds:[],tables:e.tables,version:Ke},status:"ok"}},"fe"),Ft=s((t,e)=>t.unique===e.unique&&t.fields.length===e.fields.length&&t.fields.every((r,i)=>r===e.fields[i]),"he"),mt=s(t=>t.unique!==void 0,"V"),ge=s(({nullable:t,optional:e,refined:r,unique:i,...a})=>JSON.stringify(Ct(a)),"q"),ut=s(t=>({form:JSON.stringify([ge(t),t.optional===!0,t.nullable===!0]),refined:t.refined===!0}),"G"),ht=s(t=>t.kind==="union"&&t.members?t.members.map(e=>ut(e)):[ut({...t,nullable:!1,optional:!1})],"Q"),Rt=s((t,e)=>{if(e.kind!=="union")return!1;let r=ht(e);return ht(t).every(i=>r.some(a=>a.form===i.form&&(i.refined||!a.refined)))},"pe"),O=s(t=>{switch(t.kind){case"array":return`array(${t.of?O(t.of):"?"})`;case"from":return t.output===void 0?"from":`from(${t.output})`;case"id":return`id(${t.ref??"?"})`;case"literal":return`literal(${t.literal??"?"})`;case"object":return`object({ ${Object.keys(t.fields??{}).join(", ")} })`;case"record":return`record(${t.key?O(t.key):"?"}, ${t.of?O(t.of):"?"})`;case"union":return(t.members??[]).map(e=>O(e)).join(" | ");default:return t.kind}},"x"),fe=s((t,e,r)=>({remediation:"backfill",scope:"table",severity:"breaking",summary:r,table:t,type:e}),"F"),pe=s((t,e,r)=>({remediation:"none",scope:"table",severity:"safe",summary:r,table:t,type:e}),"T"),kt=s((t,e)=>{let r=JSON.stringify(t),i=JSON.stringify(e);return r===i?0:r<i?-1:1},"Z"),ue=s(t=>({...t,...t.kind==="from"?{output:void 0}:{},...t.fields?{fields:Object.fromEntries(Object.entries(t.fields).map(([e,r])=>[e,ue(r)]))}:{},...t.key?{key:ue(t.key)}:{},...t.of?{of:ue(t.of)}:{},...t.members?{members:t.members.map(e=>ue(e)).toSorted(kt)}:{}}),"S"),ft=s(t=>t.kind==="union"?t.members??[]:[t],"U"),Lt=s((t,e)=>{let r=[...t],i=[...e],a=new Set,o=new Set,n=s((d,l)=>{for(let[f,h]of r.entries()){if(o.has(f))continue;let g=i.findIndex((p,b)=>!a.has(b)&&d(h,p));g!==-1&&(a.add(g),o.add(f),l&&([r[f],i[g]]=Me(h,i[g])))}},"s");return n((d,l)=>JSON.stringify(d)===JSON.stringify(l),!1),n((d,l)=>ge(ue(d))===ge(ue(l)),!0),[r,i]},"ge"),Me=s((t,e)=>{if(t.kind==="union"||e.kind==="union"){let[a,o]=Lt(ft(t),ft(e)),n=s((d,l)=>d.kind==="union"?{...d,members:l.toSorted(kt)}:l[0],"s");return[n(t,a),n(e,o)]}if(t.kind!==e.kind)return[t,e];if(t.kind==="from")return t.output===void 0||e.output===void 0?[{...t,output:void 0},{...e,output:void 0}]:[t,e];let r={...t.fields?{fields:{...t.fields}}:{}},i={...e.fields?{fields:{...e.fields}}:{}};for(let a of["key","of"])t[a]&&e[a]&&([r[a],i[a]]=Me(t[a],e[a]));for(let a of Object.keys(t.fields??{})){let o=t.fields?.[a],n=e.fields?.[a];o&&n&&r.fields&&i.fields&&([r.fields[a],i.fields[a]]=Me(o,n))}return[{...t,...r},{...e,...i}]},"I"),_t=s((t,e,r,i,a)=>{let[o,n]=Me(r,i);if(o.kind===n.kind&&(!a||ge(o)===ge(n)))return;if(a&&Rt(o,n))return pe(t,"widenedFieldShape",`field ${t}.${e} widened: ${O(o)} \u2192 ${O(n)} \u2014 every stored value stays valid`);if(o.kind!==n.kind)return fe(t,"changedFieldKind",`field ${t}.${e} changed type: ${o.kind} \u2192 ${n.kind} \u2014 add a data migration to convert existing values`);let d=Object.values(n.fields??{});return a&&o.kind==="object"&&Object.keys(o.fields??{}).length===0&&d.length>0&&d.every(l=>l.optional)?pe(t,"widenedFieldShape",`field ${t}.${e} now records its optional object shape \u2014 stored values stay valid`):fe(t,"changedFieldShape",`field ${t}.${e} changed shape: ${O(o)} \u2192 ${O(n)} \u2014 stored values were written against the old shape; add a data migration to convert them`)},"be"),Dt=s((t,e,r,i)=>{let a=[];return r.unique!==i.unique&&a.push(i.unique===!0?fe(t,"addedFieldConstraint",`field ${t}.${e} became unique \u2014 existing duplicates would violate it; add a data migration to de-duplicate first`):pe(t,"relaxedFieldConstraint",`field ${t}.${e} is no longer unique`)),r.nullable!==i.nullable&&a.push(i.nullable===!0?pe(t,"relaxedFieldConstraint",`field ${t}.${e} became nullable`):fe(t,"addedFieldConstraint",`field ${t}.${e} is no longer nullable \u2014 rows holding NULL would be invalid; add a data migration to backfill them`)),r.refined!==i.refined&&a.push(i.refined===!0?fe(t,"addedFieldConstraint",`field ${t}.${e} gained a validation refinement \u2014 stored values were never checked against it; add a data migration if any could fail`):pe(t,"relaxedFieldConstraint",`field ${t}.${e} dropped its validation refinement`)),a},"ye"),wt=s((t,e,r,i)=>{let a=[],o=mt(r)&&mt(i),n=_t(t,e,r,i,o);return n&&a.push(n),o&&a.push(...Dt(t,e,r,i)),r.optional&&!i.optional?a.push({remediation:"backfill",severity:"breaking",summary:`field ${t}.${e} became required \u2014 rows missing it would be invalid; add a data migration to backfill it`,table:t,scope:"table",type:"fieldOptionalToRequired"}):!r.optional&&i.optional&&a.push({remediation:"none",scope:"table",severity:"safe",summary:`field ${t}.${e} became optional`,table:t,type:"fieldRequiredToOptional"}),a},"N"),Kt=s((t,e,r)=>r.optional?{remediation:"none",scope:"table",severity:"safe",summary:`added optional field ${t}.${e}`,table:t,type:"addedOptionalField"}:{remediation:"backfill",severity:"breaking",summary:`added required field ${t}.${e} \u2014 existing rows have no value; add a data migration to backfill it`,table:t,scope:"table",type:"addedRequiredField"},"ve"),Et=s((t,e,r,i)=>{for(let[a,o]of Object.entries(r.fields)){let n=e.fields[a];n===void 0?i.push(Kt(t,a,o)):i.push(...wt(t,a,n,o))}for(let a of Object.keys(e.fields))r.fields[a]===void 0&&i.push({remediation:"backfill",severity:"breaking",summary:`removed field ${t}.${a} \u2014 add a data migration if stored data must be cleaned up`,table:t,scope:"table",type:"removedField"})},"xe"),Jt=s((t,e,r,i)=>{for(let[a,o]of Object.entries(r.indexes)){let n=e.indexes[a];if(n===void 0){i.push(o.unique?{remediation:"backfill",scope:"table",severity:"breaking",summary:`added unique index ${a} on ${t} \u2014 existing duplicates would violate it; add a data migration to de-duplicate first`,table:t,type:"addedIndex"}:{remediation:"none",scope:"table",severity:"safe",summary:`added index ${a} on ${t}`,table:t,type:"addedIndex"});continue}Ft(n,o)||i.push({remediation:"code",severity:"breaking",summary:`index ${a} on ${t} changed shape \u2014 a query may have relied on the old index`,table:t,scope:"table",type:"changedIndex"})}for(let a of Object.keys(e.indexes))r.indexes[a]===void 0&&i.push({remediation:"code",severity:"breaking",summary:`removed index ${a} on ${t} \u2014 a query that used \`.withIndex("${a}")\` would break`,table:t,scope:"table",type:"removedIndex"})},"ke"),At=s((t,e,r,i)=>{for(let a of Object.keys(r.relations))e.relations[a]===void 0&&i.push({remediation:"none",scope:"schema",severity:"safe",summary:`added relation ${t}.${a}`,table:t,type:"addedRelation"});for(let a of Object.keys(e.relations))r.relations[a]===void 0&&i.push({remediation:"code",scope:"schema",severity:"breaking",summary:`removed relation ${t}.${a}`,table:t,type:"removedRelation"})},"$e"),pt="shardBy:_unknown_",Ce="global",Pt=s((t,e)=>t===Ce&&e.startsWith(`${Ce}:`)||e===Ce&&t.startsWith(`${Ce}:`),"we"),Bt=s((t,e,r)=>{if(e===r)return r!==pt?void 0:{remediation:"rehome",scope:"table",severity:"breaking",summary:`table ${t} declares a non-literal .shardBy(...) key, so codegen cannot read which column partitions it \u2014 every such key records as "${pt}" and two DIFFERENT keys would compare equal. Pass the shard key as a string literal; until then this is reported on every run, because the alternative is a silent pass on a re-home that strands every row (export/import is the only way back).`,table:t,type:"changedShardMode"};if(!Pt(e,r))return{remediation:"rehome",severity:"breaking",summary:`table ${t} changed shard mode: ${e} \u2192 ${r} \u2014 its physical storage moves, and existing rows do NOT follow the schema; re-home them with an export/import round trip (https://lunora.sh/docs/concepts/sharding#migrating-a-populated-table)`,table:t,scope:"table",type:"changedShardMode"}},"Oe"),gt=s(t=>t.memory!==void 0,"B"),bt=s(t=>t.after??0,"K"),R=s(t=>t.after===void 0?`.ttl("${t.field}")`:`.ttl("${t.field}", { after: ${String(t.after)} })`,"w"),Wt=s((t,e,r)=>{if(e===void 0&&r===void 0)return;let i=s(d=>({remediation:"backfill",scope:"table",severity:"breaking",summary:d,table:t,type:"changedTtlPolicy"}),"i"),a=s(d=>({remediation:"none",scope:"table",severity:"safe",summary:d,table:t,type:"changedTtlPolicy"}),"o");if(r===void 0)return a(`table ${t} dropped its TTL policy \u2014 its rows are no longer swept`);if(e===void 0)return i(`table ${t} gained a TTL policy ${R(r)} \u2014 every row already past the cutoff is deleted on the next alarm sweep; add a data migration to refresh or clear "${r.field}" on the rows written before it`);if(e.field!==r.field)return i(`table ${t} moved its TTL to a different column: ${R(e)} \u2192 ${R(r)} \u2014 rows are now expired by a column they were never written against; add a data migration to populate "${r.field}"`);let o=bt(e),n=bt(r);return n<o?i(`table ${t} shortened its TTL: ${R(e)} \u2192 ${R(r)} \u2014 rows that were not expired under the old offset are deleted on the next alarm sweep; add a data migration to refresh "${r.field}" on the rows that must survive`):n>o?a(`table ${t} lengthened its TTL: ${R(e)} \u2192 ${R(r)}`):void 0},"Se"),Ut=s((t,e,r)=>{let i=[];return e.memory!==r.memory&&i.push(r.memory===!0?{remediation:"rehome",scope:"table",severity:"breaking",summary:`table ${t} became a .memory() table \u2014 every row is deleted in every shard on the next Durable Object cold start, and no data migration survives that; export the rows first if they must be kept, or revert`,table:t,type:"changedMemoryMode"}:{remediation:"none",scope:"table",severity:"safe",summary:`table ${t} is no longer a .memory() table \u2014 its rows now survive a cold start`,table:t,type:"changedMemoryMode"}),e.commitOrdered!==r.commitOrdered&&i.push(r.commitOrdered===!0?{remediation:"backfill",scope:"table",severity:"breaking",summary:`table ${t} became .commitOrdered() \u2014 rows written before it carry no _commitSeq, so a \`_commitSeq > cursor\` changefeed never offers them; add a data migration over the table to stamp them (the rewrite allocates a sequence)`,table:t,type:"changedCommitOrdering"}:{remediation:"code",scope:"table",severity:"breaking",summary:`table ${t} is no longer .commitOrdered() \u2014 new rows carry no _commitSeq, so a \`_commitSeq > cursor\` changefeed stops advancing without erroring; update the consumers before deploying`,table:t,type:"changedCommitOrdering"}),i},"je"),zt=s((t,e,r,i)=>{let a=Bt(t,e.shardMode,r.shardMode);if(a&&i.push(a),gt(e)&&gt(r)){i.push(...Ut(t,e,r));let o=Wt(t,e.ttl,r.ttl);o&&i.push(o)}Et(t,e,r,i),Jt(t,e,r,i),At(t,e,r,i)},"Fe"),Ht=s((t,e)=>{let r=[],i=t?.tables??{};for(let[a,o]of Object.entries(e.tables)){let n=i[a];if(n===void 0){r.push({remediation:"none",scope:"table",severity:"safe",summary:`added table ${a}`,table:a,type:"addedTable"});continue}zt(a,n,o,r)}for(let a of Object.keys(i))e.tables[a]===void 0&&r.push({remediation:"rehome",scope:"table",severity:"breaking",summary:`removed table ${a} \u2014 its rows stay in each shard's SQLite, unreachable through the schema; export the shard first if the data must be kept`,table:a,type:"removedTable"});if(t!==void 0&&t.jurisdiction!==e.jurisdiction){let a=t.jurisdiction??"(none)",o=e.jurisdiction??"(none)";r.push({remediation:"rehome",scope:"schema",severity:"breaking",summary:`Durable Object jurisdiction changed from ${a} to ${o} \u2014 this re-homes every DO and strands all existing shard, scheduler, and session-DO data in the old region (no in-place migration; export then import to move it). Revert the change, or override the gate to proceed intentionally.`,type:"changedJurisdiction"})}return{changes:r}},"Te"),yt=s(t=>Object.entries(t.fields).map(([e,r])=>({name:e,optional:r.optional,ref:Object.values(t.relations).find(i=>i.field===e&&i.kind==="one")?.table,type:O(r)})),"Y"),vt=s((t,e,r)=>{let i={},a=e?.fields??{},o=r?.fields??{};for(let[n,d]of Object.entries(o)){let l=a[n];l===void 0?i[n]=e===void 0?"unchanged":"added":i[n]=wt(t,n,l,d).length===0?"unchanged":"changed"}for(let n of Object.keys(a))o[n]===void 0&&(i[n]="removed");return i},"z"),Qt=s((t,e)=>{let{changes:r}=Ht(t,e),i=new Set(r.filter(n=>n.scope==="table"&&n.table!==void 0).map(n=>n.table)),a=[],o=s((n,d)=>n?"added":i.has(d)?"changed":"context","r");for(let[n,d]of Object.entries(e.tables)){let l=t?.tables[n],f=o(l===void 0,n);a.push({columns:yt(d),fieldStatus:vt(n,l,d),name:n,shardMode:d.shardMode,status:f})}for(let[n,d]of Object.entries(t?.tables??{}))e.tables[n]===void 0&&a.push({columns:yt(d),fieldStatus:vt(n,d,void 0),name:n,shardMode:d.shardMode,status:"removed"});return a.sort((n,d)=>n.name.localeCompare(d.name)),{breakingCount:r.filter(n=>n.severity==="breaking").length,changes:r,tables:a}},"Me"),xt=s(t=>{let e=It(t);return e.status==="ok"?e.snapshot:void 0},"X"),Vt={added:"ring-2 ring-emerald-500/60",changed:"ring-2 ring-amber-500/70",context:"opacity-55",removed:"opacity-70 ring-2 ring-destructive/60"},Gt=s(t=>t==="global"||t.startsWith("global:")?"global":"shard","Ce"),Zt=s(t=>{let e=(0,be.c)(24),{appliedAt:r,hash:i,onSelect:a,selected:o,seq:n}=t,d=o?"border-s-primary bg-accent/60 text-foreground":"border-s-transparent text-muted-foreground hover:bg-accent/30 hover:text-foreground",l;e[0]!==d?(l=de("flex w-full flex-col items-start gap-1 border-s-2 px-4 py-3 text-start outline-none transition-colors",d),e[0]=d,e[1]=l):l=e[1];let f=`sh-version-${i}`,h;e[2]!==i||e[3]!==a?(h=s(()=>{a(i)},"f"),e[2]=i,e[3]=a,e[4]=h):h=e[4];let g;e[5]!==n?(g=(0,c.jsxs)("span",{className:"font-mono text-[13px] tabular-nums",children:["v",n]}),e[5]=n,e[6]=g):g=e[6];let p;e[7]!==i?(p=i.slice(0,7),e[7]=i,e[8]=p):p=e[8];let b;e[9]!==p?(b=(0,c.jsx)("span",{className:"ms-auto font-mono text-[10px] tracking-wider text-muted-foreground/70 uppercase",children:p}),e[9]=p,e[10]=b):b=e[10];let y;e[11]!==g||e[12]!==b?(y=(0,c.jsxs)("span",{className:"flex w-full items-baseline gap-2",children:[g,b]}),e[11]=g,e[12]=b,e[13]=y):y=e[13];let x;e[14]!==r?(x=qe(r),e[14]=r,e[15]=x):x=e[15];let v;e[16]!==x?(v=(0,c.jsx)("span",{className:"font-mono text-[10px] tracking-wide text-muted-foreground/70",children:x}),e[16]=x,e[17]=v):v=e[17];let u;return e[18]!==v||e[19]!==l||e[20]!==f||e[21]!==h||e[22]!==y?(u=(0,c.jsx)("li",{children:(0,c.jsxs)("button",{className:l,"data-testid":f,onClick:h,type:"button",children:[y,v]})}),e[18]=v,e[19]=l,e[20]=f,e[21]=h,e[22]=y,e[23]=u):u=e[23],u},"Ie"),Xt=s(t=>{let e=(0,be.c)(26),{breaking:r,count:i,first:a}=t,o=le();if(a){let b;e[0]!==i?(b=(0,c.jsx)("span",{className:"text-3xl leading-none font-light tracking-tight tabular-nums",children:i}),e[0]=i,e[1]=b):b=e[1];let y;e[2]!==o?(y=o("tables"),e[2]=o,e[3]=y):y=e[3];let x;e[4]!==y?(x=(0,c.jsx)("span",{className:"font-mono text-[11px] tracking-widest text-muted-foreground uppercase",children:y}),e[4]=y,e[5]=x):x=e[5];let v;return e[6]!==b||e[7]!==x?(v=(0,c.jsxs)("div",{className:"flex items-baseline gap-3","data-testid":"sh-summary",children:[b,x]}),e[6]=b,e[7]=x,e[8]=v):v=e[8],v}let n=r>0&&"text-destructive",d;e[9]!==n?(d=de("text-3xl leading-none font-light tracking-tight tabular-nums",n),e[9]=n,e[10]=d):d=e[10];let l;e[11]!==i||e[12]!==d?(l=(0,c.jsx)("span",{className:d,children:i}),e[11]=i,e[12]=d,e[13]=l):l=e[13];let f;e[14]!==i||e[15]!==o?(f=o(i===1?"change":"changes"),e[14]=i,e[15]=o,e[16]=f):f=e[16];let h;e[17]!==f?(h=(0,c.jsx)("span",{className:"font-mono text-[11px] tracking-widest text-muted-foreground uppercase",children:f}),e[17]=f,e[18]=h):h=e[18];let g;e[19]!==r||e[20]!==o?(g=r>0&&(0,c.jsxs)("span",{className:"font-mono text-[11px] tracking-widest text-destructive uppercase",children:["\xB7 ",o("{count} breaking",{count:r})]}),e[19]=r,e[20]=o,e[21]=g):g=e[21];let p;return e[22]!==l||e[23]!==h||e[24]!==g?(p=(0,c.jsxs)("div",{className:"flex items-baseline gap-3","data-testid":"sh-summary",children:[l,h,g]}),e[22]=l,e[23]=h,e[24]=g,e[25]=p):p=e[25],p},"Re"),$t={addedFieldConstraint:{action:"added",kind:"constraint"},addedIndex:{action:"added",kind:"index"},addedOptionalField:{action:"added",kind:"field?"},addedRelation:{action:"added",kind:"relation"},addedRequiredField:{action:"added",kind:"field"},addedTable:{action:"added",kind:"table"},changedCommitOrdering:{action:"changed",kind:"commit ordering"},changedFieldKind:{action:"changed",kind:"field kind"},changedFieldShape:{action:"changed",kind:"field shape"},changedIndex:{action:"changed",kind:"index"},changedJurisdiction:{action:"changed",kind:"jurisdiction"},changedMemoryMode:{action:"changed",kind:"memory mode"},changedShardMode:{action:"changed",kind:"shard mode"},changedTtlPolicy:{action:"changed",kind:"TTL policy"},fieldOptionalToRequired:{action:"changed",kind:"field \u2192 required"},fieldRequiredToOptional:{action:"changed",kind:"field \u2192 optional"},relaxedFieldConstraint:{action:"removed",kind:"constraint"},removedField:{action:"removed",kind:"field"},removedIndex:{action:"removed",kind:"index"},removedRelation:{action:"removed",kind:"relation"},removedTable:{action:"removed",kind:"table"},widenedFieldShape:{action:"changed",kind:"field \u2192 wider"}},Yt=s((t,e)=>{let r=`${$t[t.type].action} ${e} `;return t.summary.startsWith(r)?t.summary.slice(r.length):t.summary},"Ee"),ea=s(t=>{let e=new Map;for(let i of t){let a=i.table??"",o=e.get(a);o===void 0?e.set(a,[i]):o.push(i)}let r=[...e].map(([i,a])=>({changes:a,table:i}));return[...r.filter(i=>i.table!==""),...r.filter(i=>i.table==="")]},"Ae"),ta=s(t=>{let e=(0,be.c)(2),{children:r}=t,i;return e[0]!==r?(i=(0,c.jsx)("div",{className:"px-4 pt-4 pb-2 font-mono text-[10px] tracking-widest text-muted-foreground/70 uppercase",children:r}),e[0]=r,e[1]=i):i=e[1],i},"De"),aa=s(({pane:t,shardKey:e=""})=>{let r=le(),i=We(),a=Be({strict:!1}).version,o=s(u=>{je(i({search:{version:u},to:"/migrations"}))},"s"),n=ce(F.schemaHistory,{},{shardKey:e}),d=n.data?.versions??[],l=a!==void 0&&d.some(u=>u.hash===a)?a:d[0]?.hash,f=d.findIndex(u=>u.hash===l),h=f===-1?void 0:d[f+1]?.hash,g=ce(F.schemaVersion,{hash:l??""},{enabled:l!==void 0,shardKey:e}),p=ce(F.schemaVersion,{hash:h??""},{enabled:h!==void 0,shardKey:e}),b=(0,he.useMemo)(()=>{let u=xt(g.data?.version?.snapshotJson);if(u!==void 0)return Qt(xt(p.data?.version?.snapshotJson),u)},[g.data,p.data]),y=(0,he.useMemo)(()=>(b?.tables??[]).map(u=>({columns:u.columns,name:u.name,tier:Gt(u.shardMode)})),[b]),x=(0,he.useMemo)(()=>{let u={};for(let w of b?.tables??[])u[w.name]=Vt[w.status];return u},[b]);if(n.error!==null)return(0,c.jsx)(Te,{error:n.errorSource,testId:"sh-error"});if(d.length===0)return(0,c.jsx)(Oe,{description:r("Each distinct schema shape this shard runs is recorded here, so you can see what changed and when."),testId:"sh-empty",title:r("No schema versions recorded yet.")});let v=b?.changes??[];return(0,c.jsxs)("div",{className:"flex min-h-0 flex-1 gap-4","data-testid":"lunora-schema-history",children:[(0,c.jsxs)("nav",{className:"flex w-56 shrink-0 flex-col overflow-hidden border-e border-border","data-testid":"sh-timeline-rail",children:[(0,c.jsx)(ta,{children:r("Schema versions")}),(0,c.jsx)("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"sh-timeline",children:d.map(u=>(0,c.jsx)(Zt,{appliedAt:u.appliedAt,hash:u.hash,onSelect:o,selected:u.hash===l,seq:u.seq},u.hash))})]}),(0,c.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4 pe-1 pt-4",children:[(0,c.jsx)(Xt,{breaking:b?.breakingCount??0,count:h===void 0?y.length:v.length,first:h===void 0}),t==="diagram"?(0,c.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,c.jsx)(dt,{fill:!0,nodeClasses:x,tables:y,testIdPrefix:"sh"})}):(0,c.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"sh-changes",children:ea(v).map(u=>{let w=(b?.tables??[]).find(k=>k.name===u.table);return(0,c.jsxs)("section",{className:"mb-6",children:[(0,c.jsxs)("div",{className:"flex items-baseline gap-3 border-b border-border/60 pb-1.5",children:[(0,c.jsx)("span",{className:"font-mono text-[13px] text-foreground",children:u.table===""?r("schema"):u.table}),w!==void 0&&(0,c.jsx)("span",{className:"font-mono text-[10px] tracking-widest text-muted-foreground/70 tabular-nums uppercase",children:r("{count} columns",{count:w.columns.length})}),u.changes.length>1&&(0,c.jsx)("span",{className:"ms-auto font-mono text-[10px] tracking-widest text-muted-foreground/70 tabular-nums",children:u.changes.length})]}),(0,c.jsx)("ul",{children:u.changes.map(k=>{let{action:L,kind:C}=$t[k.type],j=k.severity==="breaking",M=Yt(k,C);return(0,c.jsxs)("li",{className:"flex items-baseline gap-4 border-s-2 py-1.5 ps-3 transition-colors hover:bg-accent/30",children:[(0,c.jsx)("span",{"aria-hidden":"true",className:de("-ms-3 h-3 w-0.5 shrink-0 self-center",j?"bg-destructive":"bg-transparent")}),(0,c.jsxs)("span",{className:"w-44 shrink-0 font-mono text-[10px] tracking-widest text-muted-foreground/70 uppercase",children:[r(L)," ",C]}),M!==u.table&&(0,c.jsx)("span",{className:de("min-w-0 font-mono text-[13px]",j?"text-destructive":"text-foreground"),children:M}),j&&(0,c.jsx)("span",{className:"ms-auto shrink-0 font-mono text-[10px] tracking-widest text-destructive uppercase",children:r("breaking")})]},`${k.type}-${k.summary}`)})})]},u.table)})})]})]})},"Le"),ra=s(t=>de("-mb-px border-b-2 px-3 py-2.5 font-mono text-[11px] tracking-wider uppercase transition-colors outline-none","hover:bg-accent/40 focus-visible:bg-accent/40",t?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),"Je"),Ra=s(t=>{let e=(0,be.c)(11),{initialShardKey:r}=t,i=le(),[a,o]=(0,he.useState)("diagram"),n;e[0]!==a?(n=s((g,p,b,y)=>(0,c.jsxs)("button",{"aria-selected":a===g,className:ra(a===g),"data-testid":b,onClick:s(()=>{o(g)},"onClick"),role:"tab",type:"button",children:[p,y!==void 0&&(0,c.jsx)("span",{className:"ms-2 tabular-nums text-muted-foreground/70",children:y})]}),"s"),e[0]=a,e[1]=n):n=e[1];let d=n,l;e[2]!==i||e[3]!==d?(l=(0,c.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-3","data-testid":"mg-panes",role:"tablist",children:[d("diagram",i("Diagram"),"mg-pane-diagram"),d("changes",i("Changes"),"mg-pane-changes"),d("data",i("Data migrations"),"mg-pane-data")]}),e[2]=i,e[3]=d,e[4]=l):l=e[4];let f;e[5]!==r||e[6]!==a?(f=(0,c.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:a==="data"?(0,c.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4",children:(0,c.jsx)(ct,{initialShardKey:r})}):(0,c.jsx)(aa,{pane:a,shardKey:r})}),e[5]=r,e[6]=a,e[7]=f):f=e[7];let h;return e[8]!==l||e[9]!==f?(h=(0,c.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col pt-4","data-testid":"lunora-migrations-route",children:[l,f]}),e[8]=l,e[9]=f,e[10]=h):h=e[10],h},"Ze");export{Ra as default};